@forge/api

8.0.6-next.08.1.0-next.1
~

Modified (5 files)

Index: package/out/webTrigger.js
===================================================================
--- package/out/webTrigger.js
+++ package/out/webTrigger.js
@@ -2,10 +2,24 @@
 Object.defineProperty(exports, "__esModule", { value: true });
 exports.webTrigger = void 0;
 const runtime_1 = require("./api/runtime");
 const fetch_1 = require("./api/fetch");
-const proxyGetWebTriggerURL = (0, runtime_1.wrapInMetrics)('api.getWebTriggerUrl', async (webTriggerModuleKey, forceCreate) => {
+const proxyGetWebTriggerURL = (0, runtime_1.wrapInMetrics)('api.getWebTriggerUrl', async (webTriggerModuleKey, forceCreate, secretKeyConfig) => {
     const runtime = (0, runtime_1.__getRuntime)();
+    const input = {
+        appId: runtime.appContext.appId,
+        envId: runtime.appContext.environmentId,
+        triggerKey: webTriggerModuleKey,
+        contextId: runtime.contextAri,
+        ...(secretKeyConfig !== undefined
+            ? {
+                secretKeyConfig: {
+                    key: secretKeyConfig.key,
+                    ...(secretKeyConfig.noExpiry !== undefined ? { noExpiry: secretKeyConfig.noExpiry } : {})
+                }
+            }
+            : {})
+    };
     const response = await (0, fetch_1.__requestAtlassianAsApp)('/graphql', {
         method: 'POST',
         headers: { 'Content-Type': 'application/json' },
         body: JSON.stringify({
@@ -16,14 +30,9 @@
               }
             }
           `,
             variables: {
-                input: {
-                    appId: runtime.appContext.appId,
-                    envId: runtime.appContext.environmentId,
-                    triggerKey: webTriggerModuleKey,
-                    contextId: runtime.contextAri
-                },
+                input,
                 forceCreate
             }
         })
     });
@@ -107,8 +116,14 @@
     }));
     return result;
 });
 exports.webTrigger = {
-    getUrl: async (webTriggerModuleKey, forceCreate = false) => proxyGetWebTriggerURL(webTriggerModuleKey, forceCreate),
+    getUrl: async (webTriggerModuleKey, optionsOrForceCreate) => {
+        const forceCreate = typeof optionsOrForceCreate === 'boolean' ? optionsOrForceCreate : optionsOrForceCreate?.forceCreate ?? false;
+        const secretKeyConfig = typeof optionsOrForceCreate === 'object' && optionsOrForceCreate !== null
+            ? optionsOrForceCreate.secretKeyConfig
+            : undefined;
+        return proxyGetWebTriggerURL(webTriggerModuleKey, forceCreate, secretKeyConfig);
+    },
     deleteUrl: async (webTriggerUrl) => proxyDeleteWebTriggerURL(webTriggerUrl),
     queryUrls: async (moduleKey) => proxyQueryWebTriggerURLs(moduleKey)
 };
Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
 {
   "name": "@forge/api",
-  "version": "8.0.6-next.0",
+  "version": "8.1.0-next.1",
   "description": "Forge API methods",
   "author": "Atlassian",
   "license": "SEE LICENSE IN LICENSE.txt",
   "main": "out/index.js",
Index: package/out/webTrigger.d.ts.map
===================================================================
--- package/out/webTrigger.d.ts.map
+++ package/out/webTrigger.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"webTrigger.d.ts","sourceRoot":"","sources":["../src/webTrigger.ts"],"names":[],"mappings":"AAGA,UAAU,aAAa;IACrB,MAAM,EAAE,CAAC,mBAAmB,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAChF,SAAS,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC;CACrE;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AA4IF,eAAO,MAAM,UAAU,EAAE,aAKxB,CAAC;AAMF,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC;CACvC;A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B;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC;CACvC;AAMD,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,OAAO,MAAM,EAAE,CAAC;CACjC;AAKD,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;AAM3E,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAClC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAC3C"}
\ No newline at end of file
Index: package/CHANGELOG.md
===================================================================
--- package/CHANGELOG.md
+++ package/CHANGELOG.md
@@ -1,6 +1,12 @@
 # @forge/api
 
+## 8.1.0-next.1
+
+### Minor Changes
+
+- 406407c: Added secret key support for authorised web-triggers, plus non-expiring keys via `--noKeyExpiry` on `forge webtrigger create` and `secretKeyConfig.noExpiry` in `@forge/api`
+
 ## 8.0.6-next.0
 
 ### Patch Changes
Index: package/out/webTrigger.d.ts
===================================================================
--- package/out/webTrigger.d.ts
+++ package/out/webTrigger.d.ts
@@ -1,6 +1,14 @@
+export type SecretKeyConfig = {
+    key: string;
+    noExpiry?: boolean;
+};
+export type GetUrlOptions = {
+    forceCreate?: boolean;
+    secretKeyConfig?: SecretKeyConfig;
+};
 interface WebTriggerAPI {
-    getUrl: (webTriggerModuleKey: string, forceCreate?: boolean) => Promise<string>;
+    getUrl: (webTriggerModuleKey: string, optionsOrForceCreate?: boolean | GetUrlOptions) => Promise<string>;
     deleteUrl: (webTriggerUrl: string) => Promise<void>;
     queryUrls: (moduleKey?: string) => Promise<WebTriggerQueryResult[]>;
 }
 export type WebTriggerQueryResult = {