npm package diff

Package: @forge/manifest

Versions: 11.0.0-next.0 - 11.0.0-next.1

Added: package/out/validators/simple-trigger-scope-validator.js

Added: package/out/validators/simple-trigger-scope-validator.d.ts.map

Added: package/out/validators/simple-trigger-scope-validator.d.ts

Modified: package/out/validators/index.js

Index: package/out/validators/index.js
===================================================================
--- package/out/validators/index.js
+++ package/out/validators/index.js
@@ -9,8 +9,9 @@
 tslib_1.__exportStar(require("./validator-interface"), exports);
 tslib_1.__exportStar(require("./resources-validator"), exports);
 tslib_1.__exportStar(require("./display-conditions-validator"), exports);
 tslib_1.__exportStar(require("./product-trigger-scopes-validator"), exports);
+tslib_1.__exportStar(require("./simple-trigger-scope-validator"), exports);
 tslib_1.__exportStar(require("./providers-validator"), exports);
 tslib_1.__exportStar(require("./permissions-validator"), exports);
 tslib_1.__exportStar(require("./connect-remote-validator"), exports);
 tslib_1.__exportStar(require("./connect-authentication-validator"), exports);

Modified: package/out/validators/product-trigger-scopes-validator.js

Index: package/out/validators/product-trigger-scopes-validator.js
===================================================================
--- package/out/validators/product-trigger-scopes-validator.js
+++ package/out/validators/product-trigger-scopes-validator.js
@@ -1,10 +1,17 @@
 "use strict";
 Object.defineProperty(exports, "__esModule", { value: true });
-exports.ProductTriggerScopesValidator = void 0;
+exports.ProductTriggerScopesValidator = exports.validateEventScopes = void 0;
 const text_1 = require("../text");
 const utils_1 = require("../utils");
 const scopes_1 = require("../scopes");
+async function validateEventScopes(event, scopes, config) {
+    const emptyRequiredScopes = { current: [] };
+    const requiredScopes = config.mapping.find((entry) => entry.productEvent === event)?.oAuthScopes || emptyRequiredScopes;
+    const missingScopes = await (0, scopes_1.getMissingScopes)(scopes, requiredScopes);
+    return { requiredScopes, missingScopes };
+}
+exports.validateEventScopes = validateEventScopes;
 class ProductTriggerScopesValidator {
     config;
     constructor(config) {
         this.config = config;
@@ -16,12 +23,8 @@
                 manifestObject: manifest
             };
         }
         const validationErrors = [];
-        const getRequiredScopes = (productEvent) => {
-            const emptyRequiredScopes = { current: [] };
-            return (this.config.mapping.find((value) => value.productEvent == productEvent)?.oAuthScopes || emptyRequiredScopes);
-        };
         const addValidationError = (scope, event) => {
             validationErrors.push({
                 message: text_1.errors.permissions.missingPermissionFromScope(scope, event),
                 reference: text_1.References.MissingScopes,
@@ -40,10 +43,9 @@
         }
         const manifestScopes = manifest.typedContent.permissions?.scopes || [];
         for (const element of manifest.typedContent.modules.trigger) {
             for (const event of element.events) {
-                const requiredScopes = getRequiredScopes(event);
-                const missingScopes = await (0, scopes_1.getMissingScopes)(manifestScopes, requiredScopes);
+                const { missingScopes } = await validateEventScopes(event, manifestScopes, this.config);
                 missingScopes.forEach((scope) => addValidationError(scope, event));
             }
         }
         return {

Modified: package/package.json

Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
 {
   "name": "@forge/manifest",
-  "version": "11.0.0-next.0",
+  "version": "11.0.0-next.1",
   "description": "Definitions and validations of the Forge manifest",
   "main": "out/index.js",
   "scripts": {
     "build": "yarn run compile",

Modified: package/out/validators/index.d.ts.map

Index: package/out/validators/index.d.ts.map
===================================================================
--- package/out/validators/index.d.ts.map
+++ package/out/validators/index.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC"}
\ No newline at end of file
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC"}
\ No newline at end of file

Modified: package/out/validators/product-trigger-scopes-validator.d.ts.map

Index: package/out/validators/product-trigger-scopes-validator.d.ts.map
===================================================================
--- package/out/validators/product-trigger-scopes-validator.d.ts.map
+++ package/out/validators/product-trigger-scopes-validator.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"product-trigger-scopes-validator.d.ts","sourceRoot":"","sources":["../../src/validators/product-trigger-scopes-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAoB,cAAc,EAAE,MAAM,WAAW,CAAC;AAE7D,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,cAAc,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED,qBAAa,6BAA6B,CAAC,CAAC,CAC1C,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IAE7E,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAE5C,QAAQ,CACZ,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GACnD,OAAO,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;CAoDrD"}
\ No newline at end of file
+{"version":3,"file":"product-trigger-scopes-validator.d.ts","sourceRoot":"","sources":["../../src/validators/product-trigger-scopes-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5D,OAAO,EAAoB,cAAc,EAAE,MAAM,WAAW,CAAC;AAE7D,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,cAAc,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAcD,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC;IAAE,cAAc,EAAE,cAAc,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAStE;AAED,qBAAa,6BAA6B,CAAC,CAAC,CAC1C,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IAE7E,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAE5C,QAAQ,CACZ,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GACnD,OAAO,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;CA6CrD"}
\ No newline at end of file

Modified: package/out/types/validation-types.d.ts.map

Index: package/out/types/validation-types.d.ts.map
===================================================================
--- package/out/types/validation-types.d.ts.map
+++ package/out/types/validation-types.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"validation-types.d.ts","sourceRoot":"","sources":["../../src/types/validation-types.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,eAAe,oBAAoB;IACnC,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,6BAA6B,kCAAkC;CAChE"}
\ No newline at end of file
+{"version":3,"file":"validation-types.d.ts","sourceRoot":"","sources":["../../src/types/validation-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,eAAe,oBAAoB;IACnC,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,6BAA6B,kCAAkC;CAChE;AAKD,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;CACvC"}
\ No newline at end of file

Modified: package/CHANGELOG.md

Index: package/CHANGELOG.md
===================================================================
--- package/CHANGELOG.md
+++ package/CHANGELOG.md
@@ -1,6 +1,12 @@
 # @forge/manifest
 
+## 11.0.0-next.1
+
+### Minor Changes
+
+- 9a6d346: Add standalone trigger scope validation API (only event name and scopes required)
+
 ## 11.0.0-next.0
 
 ### Major Changes

Modified: package/README.md

Index: package/README.md
===================================================================
--- package/README.md
+++ package/README.md
@@ -16,8 +16,30 @@
 
 console.log(`Valid manifest ? ${results.success}`);
 ```
 
+## Simple Trigger Scopes Validation
+
+For validating trigger event scopes, use the simple validation API that only requires the event name and scopes:
+
+```typescript
+import { validateTriggerScopes } from '@forge/manifest';
+
+// Simple: just pass event and scopes
+const result = await validateTriggerScopes(
+  'avi:jira:assigned:issue',
+  ['read:jira-work']
+);
+
+if (!result.valid) {
+  console.error(`Missing scopes: ${result.missingScopes.join(', ')}`);
+}
+```
+
+This is useful for:
+- External tools that need to verify scope requirements
+- Any service that validates event-scope mappings
+
 ## How to check the errors
 
 In case of an invalid `manifest.yml`, the following information will be populated:

Modified: package/out/validators/index.d.ts

Index: package/out/validators/index.d.ts
===================================================================
--- package/out/validators/index.d.ts
+++ package/out/validators/index.d.ts
@@ -6,8 +6,9 @@
 export * from './validator-interface';
 export * from './resources-validator';
 export * from './display-conditions-validator';
 export * from './product-trigger-scopes-validator';
+export * from './simple-trigger-scope-validator';
 export * from './providers-validator';
 export * from './permissions-validator';
 export * from './connect-remote-validator';
 export * from './connect-authentication-validator';

Modified: package/out/validators/product-trigger-scopes-validator.d.ts

Index: package/out/validators/product-trigger-scopes-validator.d.ts
===================================================================
--- package/out/validators/product-trigger-scopes-validator.d.ts
+++ package/out/validators/product-trigger-scopes-validator.d.ts
@@ -1,15 +1,19 @@
 import { ManifestObject, ManifestValidationResult } from '../types';
 import { ValidatorInterface } from './validator-interface';
-import { ManifestSchema } from '../schema/manifest';
+import { ManifestSchema, Scopes } from '../schema/manifest';
 import { RequiredScopes } from '../scopes';
 export interface MappingEntry {
     productEvent: string;
     oAuthScopes: RequiredScopes;
 }
 export interface MappingConfig {
     mapping: MappingEntry[];
 }
+export declare function validateEventScopes(event: string, scopes: Scopes | undefined, config: MappingConfig): Promise<{
+    requiredScopes: RequiredScopes;
+    missingScopes: string[];
+}>;
 export declare class ProductTriggerScopesValidator<T> implements ValidatorInterface<ManifestObject<ManifestSchema> | undefined, ManifestSchema> {
     private readonly config;
     constructor(config: MappingConfig);
     validate(manifest: ManifestObject<ManifestSchema> | undefined): Promise<ManifestValidationResult<ManifestSchema>>;

Modified: package/out/types/validation-types.d.ts

Index: package/out/types/validation-types.d.ts
===================================================================
--- package/out/types/validation-types.d.ts
+++ package/out/types/validation-types.d.ts
@@ -1,9 +1,16 @@
+import { RequiredScopes } from '../scopes';
 export declare enum ValidationTypes {
     BASIC = "basic",
     FULL = "full",
     PRODUCT_TRIGGER = "product-trigger",
     DEPRECATED_CSP_METHOD = "deprecated-csp-method",
     FORGE_REMOTE_COMPUTE = "forge-remote-compute",
     DEPRECATED_EGRESS_PERMISSIONS = "deprecated-egress-permissions"
 }
+export interface TriggerScopeValidationResult {
+    valid: boolean;
+    event: string;
+    missingScopes: string[];
+    requiredScopes: RequiredScopes | null;
+}
 //# sourceMappingURL=validation-types.d.ts.map
\ No newline at end of file