@forge/api

8.4.0-next.78.4.0-next.8
~

Modified (5 files)

Index: package/out/webTrigger.js
===================================================================
--- package/out/webTrigger.js
+++ package/out/webTrigger.js
@@ -2,15 +2,23 @@
 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
+        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' },
@@ -36,46 +44,8 @@
         throw new Error(`Internal error occurred: Failed to get web trigger URL.`);
     }
     return responseBody.data.createWebTriggerUrl.url;
 });
-const proxyCreateAuthWebTriggerURL = (0, runtime_1.wrapInMetrics)('api.createAuthWebTriggerUrl', async (webTriggerModuleKey, secretKeyConfig, forceCreate) => {
-    const runtime = (0, runtime_1.__getRuntime)();
-    const input = {
-        appId: runtime.appContext.appId,
-        envId: runtime.appContext.environmentId,
-        triggerKey: webTriggerModuleKey,
-        contextId: runtime.contextAri,
-        secretKey: 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({
-            query: `
-            mutation forge_app_createAuthenticatedWebTriggerUrl($input: CreateAuthenticatedWebTriggerUrlInput!, $forceCreate: Boolean) {
-              createAuthenticatedWebTriggerUrl(input: $input, forceCreate: $forceCreate) {
-                url
-                keyId
-              }
-            }
-          `,
-            variables: {
-                input,
-                forceCreate
-            }
-        })
-    });
-    if (!response.ok) {
-        throw new Error(`Internal error occurred: Failed to create authenticated web trigger URL: ${response.statusText}.`);
-    }
-    const responseBody = (await response.json());
-    const { url, keyId } = responseBody?.data?.createAuthenticatedWebTriggerUrl ?? {};
-    if (!url || !keyId) {
-        throw new Error(`Internal error occurred: Failed to create authenticated web trigger URL.`);
-    }
-    return { url, keyId };
-});
 const proxyDeleteWebTriggerURL = (0, runtime_1.wrapInMetrics)('api.deleteWebTriggerUrl', async (webTriggerUrl) => {
     const webTriggerUrlIdRegexGroupMatch = /\/(?:x1|public)\/([^\/\?\#]+)/;
     const matches = webTriggerUrl.match(webTriggerUrlIdRegexGroupMatch);
     if (!matches || matches.length < 2) {
@@ -150,10 +120,12 @@
 });
 exports.webTrigger = {
     getUrl: async (webTriggerModuleKey, optionsOrForceCreate) => {
         const forceCreate = typeof optionsOrForceCreate === 'boolean' ? optionsOrForceCreate : optionsOrForceCreate?.forceCreate ?? false;
-        return proxyGetWebTriggerURL(webTriggerModuleKey, forceCreate);
+        const secretKeyConfig = typeof optionsOrForceCreate === 'object' && optionsOrForceCreate !== null
+            ? optionsOrForceCreate.secretKeyConfig
+            : undefined;
+        return proxyGetWebTriggerURL(webTriggerModuleKey, forceCreate, secretKeyConfig);
     },
-    createAuthUrl: async (webTriggerModuleKey, secretKeyConfig, forceCreate = false) => proxyCreateAuthWebTriggerURL(webTriggerModuleKey, secretKeyConfig, forceCreate),
     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.4.0-next.7",
+  "version": "8.4.0-next.8",
   "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":"AAiBA,MAAM,MAAM,eAAe,GAAG;IAE5B,GAAG,EAAE,MAAM,CAAC;IAEZ,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAE1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAEhC,GAAG,EAAE,MAAM,CAAC;IAEZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,UAAU,aAAa;IAOrB,MAAM,EAAE,CAAC,mBAAmB,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,OAAO,GAAG,aAAa,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAQzG,aAAa,EAAE,CACb,mBAAmB,EAAE,MAAM,EAC3B,eAAe,EAAE,eAAe,EAChC,WAAW,CAAC,EAAE,OAAO,KAClB,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClC,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;AAsMF,eAAO,MAAM,UAA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,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;AAwJF,eAAO,MAAM,UAAU,EAAE,aAYxB,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;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.4.0-next.8
+
+### Patch Changes
+
+- b1f95d4: Revert keyid in the response when creating authenticated webtrigger urls, and disable authenticated webtrigger e2e tests
+
 ## 8.4.0-next.7
 
 ### Patch Changes
Index: package/out/webTrigger.d.ts
===================================================================
--- package/out/webTrigger.d.ts
+++ package/out/webTrigger.d.ts
@@ -3,16 +3,12 @@
     noExpiry?: boolean;
 };
 export type GetUrlOptions = {
     forceCreate?: boolean;
+    secretKeyConfig?: SecretKeyConfig;
 };
-export type CreateAuthUrlResult = {
-    url: string;
-    keyId: string;
-};
 interface WebTriggerAPI {
     getUrl: (webTriggerModuleKey: string, optionsOrForceCreate?: boolean | GetUrlOptions) => Promise<string>;
-    createAuthUrl: (webTriggerModuleKey: string, secretKeyConfig: SecretKeyConfig, forceCreate?: boolean) => Promise<CreateAuthUrlResult>;
     deleteUrl: (webTriggerUrl: string) => Promise<void>;
     queryUrls: (moduleKey?: string) => Promise<WebTriggerQueryResult[]>;
 }
 export type WebTriggerQueryResult = {