@stackfactor/client-api 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,4 +34,45 @@ export declare const setIntegrationEnabled: (id: string, enabled: boolean, token
34
34
  * @returns {Promise<object>}
35
35
  */
36
36
  export declare const testIntegrationConfiguration: (id: string, type: number, configuration: object, token: string) => Promise<object>;
37
+ /**
38
+ * Get this organization's webhook endpoint for an integration, creating one if it does not have
39
+ * one yet.
40
+ *
41
+ * The returned `endpoint` is the first segment of every webhook URL for this organization and
42
+ * integration: `{backend}/webhooks/{endpoint}/{integrationId}/{path}`. It is per organization, so
43
+ * there is no single URL for an integration — each has its own.
44
+ *
45
+ * A POST rather than a GET because the first call for an organization WRITES: it generates the
46
+ * secret half. It is idempotent from then on, so a configuration screen may call it on every load.
47
+ * @param {String} id The id of the integration whose endpoint is wanted
48
+ * @param {String} token Authorization token
49
+ * @returns {Promise<object>} `{ _id, endpoint }`
50
+ */
51
+ export declare const getWebhookEndpoint: (id: string, token: string) => Promise<object>;
52
+ /**
53
+ * Replace this organization's webhook endpoint secret for an integration.
54
+ *
55
+ * ⚠️ Destructive beyond StackFactor. The previous URL is configured in whichever outside system
56
+ * calls it, so rotating stops those deliveries until someone updates it there. Use
57
+ * {@link getWebhookEndpoint} to obtain an endpoint; use this only when one has leaked.
58
+ * @param {String} id The id of the integration whose endpoint should be replaced
59
+ * @param {String} token Authorization token
60
+ * @returns {Promise<object>} `{ _id, endpoint }` carrying the NEW endpoint
61
+ */
62
+ export declare const rotateWebhookEndpoint: (id: string, token: string) => Promise<object>;
63
+ /**
64
+ * Set the user that this organization's tokenless webhook deliveries act as.
65
+ *
66
+ * A webhook authenticated by a provider signature, or by possession of its URL alone, carries no
67
+ * token — so it proves where the request came from but names nobody. This is the identity such
68
+ * deliveries run with, supplying both permissions and an audit subject. Deliveries that DO carry a
69
+ * token ignore it and act as that token's owner.
70
+ *
71
+ * Passing null clears it, which stops those deliveries rather than running them as nobody.
72
+ * @param {String} id The id of the integration
73
+ * @param {String|null} userId A user in this organization, or null to clear
74
+ * @param {String} token Authorization token
75
+ * @returns {Promise<object>} `{ _id, dispatchUserId }`
76
+ */
77
+ export declare const setWebhookDispatchUser: (id: string, userId: string | null, token: string) => Promise<object>;
37
78
  //# sourceMappingURL=integrationConfiguration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"integrationConfiguration.d.ts","sourceRoot":"","sources":["../../../src/lib/integrationConfiguration.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,GACvC,KAAK,MAAM,EAAE,EACb,OAAO,MAAM,EAAE,EACf,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAmBhB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACvC,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,eAAe,MAAM,EACrB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAsBhB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,IAAI,MAAM,EACV,SAAS,OAAO,EAChB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAiBhB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACvC,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,eAAe,MAAM,EACrB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAsBhB,CAAC"}
1
+ {"version":3,"file":"integrationConfiguration.d.ts","sourceRoot":"","sources":["../../../src/lib/integrationConfiguration.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,GACvC,KAAK,MAAM,EAAE,EACb,OAAO,MAAM,EAAE,EACf,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAmBhB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACvC,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,eAAe,MAAM,EACrB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAsBhB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,IAAI,MAAM,EACV,SAAS,OAAO,EAChB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAiBhB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACvC,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,eAAe,MAAM,EACrB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAsBhB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,GAC7B,IAAI,MAAM,EACV,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAiBhB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAChC,IAAI,MAAM,EACV,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAiBhB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,GACjC,IAAI,MAAM,EACV,QAAQ,MAAM,GAAG,IAAI,EACrB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAiBhB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.testIntegrationConfiguration = exports.setIntegrationEnabled = exports.saveIntegrationConfiguration = exports.getIntegrationsConfiguration = void 0;
3
+ exports.setWebhookDispatchUser = exports.rotateWebhookEndpoint = exports.getWebhookEndpoint = exports.testIntegrationConfiguration = exports.setIntegrationEnabled = exports.saveIntegrationConfiguration = exports.getIntegrationsConfiguration = void 0;
4
4
  const axiosClient_js_1 = require("./axiosClient.js");
5
5
  /**
6
6
  * Get the integration configuration
@@ -107,4 +107,87 @@ const testIntegrationConfiguration = (id, type, configuration, token) => {
107
107
  });
108
108
  };
109
109
  exports.testIntegrationConfiguration = testIntegrationConfiguration;
110
+ /**
111
+ * Get this organization's webhook endpoint for an integration, creating one if it does not have
112
+ * one yet.
113
+ *
114
+ * The returned `endpoint` is the first segment of every webhook URL for this organization and
115
+ * integration: `{backend}/webhooks/{endpoint}/{integrationId}/{path}`. It is per organization, so
116
+ * there is no single URL for an integration — each has its own.
117
+ *
118
+ * A POST rather than a GET because the first call for an organization WRITES: it generates the
119
+ * secret half. It is idempotent from then on, so a configuration screen may call it on every load.
120
+ * @param {String} id The id of the integration whose endpoint is wanted
121
+ * @param {String} token Authorization token
122
+ * @returns {Promise<object>} `{ _id, endpoint }`
123
+ */
124
+ const getWebhookEndpoint = (id, token) => {
125
+ return new Promise((resolve, reject) => {
126
+ const request = axiosClient_js_1.client.post(`/api/v1/integrationsconfiguration/webhookendpoint`, { id: id }, {
127
+ headers: { authorization: token },
128
+ });
129
+ request
130
+ .then((response) => {
131
+ resolve(response.data);
132
+ })
133
+ .catch((error) => {
134
+ reject(error);
135
+ });
136
+ });
137
+ };
138
+ exports.getWebhookEndpoint = getWebhookEndpoint;
139
+ /**
140
+ * Replace this organization's webhook endpoint secret for an integration.
141
+ *
142
+ * ⚠️ Destructive beyond StackFactor. The previous URL is configured in whichever outside system
143
+ * calls it, so rotating stops those deliveries until someone updates it there. Use
144
+ * {@link getWebhookEndpoint} to obtain an endpoint; use this only when one has leaked.
145
+ * @param {String} id The id of the integration whose endpoint should be replaced
146
+ * @param {String} token Authorization token
147
+ * @returns {Promise<object>} `{ _id, endpoint }` carrying the NEW endpoint
148
+ */
149
+ const rotateWebhookEndpoint = (id, token) => {
150
+ return new Promise((resolve, reject) => {
151
+ const request = axiosClient_js_1.client.put(`/api/v1/integrationsconfiguration/webhookendpoint/rotate`, { id: id }, {
152
+ headers: { authorization: token },
153
+ });
154
+ request
155
+ .then((response) => {
156
+ resolve(response.data);
157
+ })
158
+ .catch((error) => {
159
+ reject(error);
160
+ });
161
+ });
162
+ };
163
+ exports.rotateWebhookEndpoint = rotateWebhookEndpoint;
164
+ /**
165
+ * Set the user that this organization's tokenless webhook deliveries act as.
166
+ *
167
+ * A webhook authenticated by a provider signature, or by possession of its URL alone, carries no
168
+ * token — so it proves where the request came from but names nobody. This is the identity such
169
+ * deliveries run with, supplying both permissions and an audit subject. Deliveries that DO carry a
170
+ * token ignore it and act as that token's owner.
171
+ *
172
+ * Passing null clears it, which stops those deliveries rather than running them as nobody.
173
+ * @param {String} id The id of the integration
174
+ * @param {String|null} userId A user in this organization, or null to clear
175
+ * @param {String} token Authorization token
176
+ * @returns {Promise<object>} `{ _id, dispatchUserId }`
177
+ */
178
+ const setWebhookDispatchUser = (id, userId, token) => {
179
+ return new Promise((resolve, reject) => {
180
+ const request = axiosClient_js_1.client.put(`/api/v1/integrationsconfiguration/webhookdispatchuser`, { id: id, userId: userId }, {
181
+ headers: { authorization: token },
182
+ });
183
+ request
184
+ .then((response) => {
185
+ resolve(response.data);
186
+ })
187
+ .catch((error) => {
188
+ reject(error);
189
+ });
190
+ });
191
+ };
192
+ exports.setWebhookDispatchUser = setWebhookDispatchUser;
110
193
  //# sourceMappingURL=integrationConfiguration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"integrationConfiguration.js","sourceRoot":"","sources":["../../../src/lib/integrationConfiguration.ts"],"names":[],"mappings":";;;AACA,qDAA0C;AAE1C;;;;;;GAMG;AACI,MAAM,4BAA4B,GAAG,CAC1C,GAAa,EACb,KAAe,EACf,KAAa,EACI,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,WAAW,GAAwC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;QAC1E,IAAI,GAAG;YAAE,WAAW,CAAC,GAAG,GAAG,GAAG,CAAC;QAC/B,MAAM,mBAAmB,GAAG,uBAAM,CAAC,IAAI,CACrC,mCAAmC,EACnC,WAAW,EACX;YACE,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;SAClC,CACF,CAAC;QACF,mBAAm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,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAC5B;YACE,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;SAClC,CACF,CAAC;QACF,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AArBW,QAAA,qBAAqB,yBAqBhC;AAEF;;;;;;;GAOG;AACI,MAAM,4BAA4B,GAAG,CAC1C,EAAU,EACV,IAAY,EACZ,aAAqB,EACrB,KAAa,EACI,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,WAAW,GAAG;YAClB,EAAE,EAAE,EAAE;YACN,aAAa,EAAE,aAAa;YAC5B,IAAI,EAAE,IAAI;SACX,CAAC;QACF,MAAM,mBAAmB,GAAG,uBAAM,CAAC,IAAI,CACrC,qDAAqD,EACrD,WAAW,EACX;YACE,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;SAClC,CACF,CAAC;QACF,mBAAmB;aAChB,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AA3BW,QAAA,4BAA4B,gCA2BvC"}
1
+ {"version":3,"file":"integrationConfiguration.js","sourceRoot":"","sources":["../../../src/lib/integrationConfiguration.ts"],"names":[],"mappings":";;;AACA,qDAA0C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;SAClC,CACF,CAAC;QACF,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AApBW,QAAA,qBAAqB,yBAoBhC;AAEF;;;;;;;;;;;;;GAaG;AACI,MAAM,sBAAsB,GAAG,CACpC,EAAU,EACV,MAAqB,EACrB,KAAa,EACI,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,uBAAM,CAAC,GAAG,CACxB,uDAAuD,EACvD,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAC1B;YACE,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;SAClC,CACF,CAAC;QACF,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AArBW,QAAA,sBAAsB,0BAqBjC"}
@@ -34,4 +34,45 @@ export declare const setIntegrationEnabled: (id: string, enabled: boolean, token
34
34
  * @returns {Promise<object>}
35
35
  */
36
36
  export declare const testIntegrationConfiguration: (id: string, type: number, configuration: object, token: string) => Promise<object>;
37
+ /**
38
+ * Get this organization's webhook endpoint for an integration, creating one if it does not have
39
+ * one yet.
40
+ *
41
+ * The returned `endpoint` is the first segment of every webhook URL for this organization and
42
+ * integration: `{backend}/webhooks/{endpoint}/{integrationId}/{path}`. It is per organization, so
43
+ * there is no single URL for an integration — each has its own.
44
+ *
45
+ * A POST rather than a GET because the first call for an organization WRITES: it generates the
46
+ * secret half. It is idempotent from then on, so a configuration screen may call it on every load.
47
+ * @param {String} id The id of the integration whose endpoint is wanted
48
+ * @param {String} token Authorization token
49
+ * @returns {Promise<object>} `{ _id, endpoint }`
50
+ */
51
+ export declare const getWebhookEndpoint: (id: string, token: string) => Promise<object>;
52
+ /**
53
+ * Replace this organization's webhook endpoint secret for an integration.
54
+ *
55
+ * ⚠️ Destructive beyond StackFactor. The previous URL is configured in whichever outside system
56
+ * calls it, so rotating stops those deliveries until someone updates it there. Use
57
+ * {@link getWebhookEndpoint} to obtain an endpoint; use this only when one has leaked.
58
+ * @param {String} id The id of the integration whose endpoint should be replaced
59
+ * @param {String} token Authorization token
60
+ * @returns {Promise<object>} `{ _id, endpoint }` carrying the NEW endpoint
61
+ */
62
+ export declare const rotateWebhookEndpoint: (id: string, token: string) => Promise<object>;
63
+ /**
64
+ * Set the user that this organization's tokenless webhook deliveries act as.
65
+ *
66
+ * A webhook authenticated by a provider signature, or by possession of its URL alone, carries no
67
+ * token — so it proves where the request came from but names nobody. This is the identity such
68
+ * deliveries run with, supplying both permissions and an audit subject. Deliveries that DO carry a
69
+ * token ignore it and act as that token's owner.
70
+ *
71
+ * Passing null clears it, which stops those deliveries rather than running them as nobody.
72
+ * @param {String} id The id of the integration
73
+ * @param {String|null} userId A user in this organization, or null to clear
74
+ * @param {String} token Authorization token
75
+ * @returns {Promise<object>} `{ _id, dispatchUserId }`
76
+ */
77
+ export declare const setWebhookDispatchUser: (id: string, userId: string | null, token: string) => Promise<object>;
37
78
  //# sourceMappingURL=integrationConfiguration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"integrationConfiguration.d.ts","sourceRoot":"","sources":["../../../src/lib/integrationConfiguration.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,GACvC,KAAK,MAAM,EAAE,EACb,OAAO,MAAM,EAAE,EACf,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAmBhB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACvC,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,eAAe,MAAM,EACrB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAsBhB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,IAAI,MAAM,EACV,SAAS,OAAO,EAChB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAiBhB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACvC,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,eAAe,MAAM,EACrB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAsBhB,CAAC"}
1
+ {"version":3,"file":"integrationConfiguration.d.ts","sourceRoot":"","sources":["../../../src/lib/integrationConfiguration.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,GACvC,KAAK,MAAM,EAAE,EACb,OAAO,MAAM,EAAE,EACf,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAmBhB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACvC,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,eAAe,MAAM,EACrB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAsBhB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,IAAI,MAAM,EACV,SAAS,OAAO,EAChB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAiBhB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACvC,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,eAAe,MAAM,EACrB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAsBhB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,GAC7B,IAAI,MAAM,EACV,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAiBhB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAChC,IAAI,MAAM,EACV,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAiBhB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,GACjC,IAAI,MAAM,EACV,QAAQ,MAAM,GAAG,IAAI,EACrB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAiBhB,CAAC"}
@@ -100,4 +100,84 @@ export const testIntegrationConfiguration = (id, type, configuration, token) =>
100
100
  });
101
101
  });
102
102
  };
103
+ /**
104
+ * Get this organization's webhook endpoint for an integration, creating one if it does not have
105
+ * one yet.
106
+ *
107
+ * The returned `endpoint` is the first segment of every webhook URL for this organization and
108
+ * integration: `{backend}/webhooks/{endpoint}/{integrationId}/{path}`. It is per organization, so
109
+ * there is no single URL for an integration — each has its own.
110
+ *
111
+ * A POST rather than a GET because the first call for an organization WRITES: it generates the
112
+ * secret half. It is idempotent from then on, so a configuration screen may call it on every load.
113
+ * @param {String} id The id of the integration whose endpoint is wanted
114
+ * @param {String} token Authorization token
115
+ * @returns {Promise<object>} `{ _id, endpoint }`
116
+ */
117
+ export const getWebhookEndpoint = (id, token) => {
118
+ return new Promise((resolve, reject) => {
119
+ const request = client.post(`/api/v1/integrationsconfiguration/webhookendpoint`, { id: id }, {
120
+ headers: { authorization: token },
121
+ });
122
+ request
123
+ .then((response) => {
124
+ resolve(response.data);
125
+ })
126
+ .catch((error) => {
127
+ reject(error);
128
+ });
129
+ });
130
+ };
131
+ /**
132
+ * Replace this organization's webhook endpoint secret for an integration.
133
+ *
134
+ * ⚠️ Destructive beyond StackFactor. The previous URL is configured in whichever outside system
135
+ * calls it, so rotating stops those deliveries until someone updates it there. Use
136
+ * {@link getWebhookEndpoint} to obtain an endpoint; use this only when one has leaked.
137
+ * @param {String} id The id of the integration whose endpoint should be replaced
138
+ * @param {String} token Authorization token
139
+ * @returns {Promise<object>} `{ _id, endpoint }` carrying the NEW endpoint
140
+ */
141
+ export const rotateWebhookEndpoint = (id, token) => {
142
+ return new Promise((resolve, reject) => {
143
+ const request = client.put(`/api/v1/integrationsconfiguration/webhookendpoint/rotate`, { id: id }, {
144
+ headers: { authorization: token },
145
+ });
146
+ request
147
+ .then((response) => {
148
+ resolve(response.data);
149
+ })
150
+ .catch((error) => {
151
+ reject(error);
152
+ });
153
+ });
154
+ };
155
+ /**
156
+ * Set the user that this organization's tokenless webhook deliveries act as.
157
+ *
158
+ * A webhook authenticated by a provider signature, or by possession of its URL alone, carries no
159
+ * token — so it proves where the request came from but names nobody. This is the identity such
160
+ * deliveries run with, supplying both permissions and an audit subject. Deliveries that DO carry a
161
+ * token ignore it and act as that token's owner.
162
+ *
163
+ * Passing null clears it, which stops those deliveries rather than running them as nobody.
164
+ * @param {String} id The id of the integration
165
+ * @param {String|null} userId A user in this organization, or null to clear
166
+ * @param {String} token Authorization token
167
+ * @returns {Promise<object>} `{ _id, dispatchUserId }`
168
+ */
169
+ export const setWebhookDispatchUser = (id, userId, token) => {
170
+ return new Promise((resolve, reject) => {
171
+ const request = client.put(`/api/v1/integrationsconfiguration/webhookdispatchuser`, { id: id, userId: userId }, {
172
+ headers: { authorization: token },
173
+ });
174
+ request
175
+ .then((response) => {
176
+ resolve(response.data);
177
+ })
178
+ .catch((error) => {
179
+ reject(error);
180
+ });
181
+ });
182
+ };
103
183
  //# sourceMappingURL=integrationConfiguration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"integrationConfiguration.js","sourceRoot":"","sources":["../../../src/lib/integrationConfiguration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,GAAa,EACb,KA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CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
1
+ {"version":3,"file":"integrationConfiguration.js","sourceRoot":"","sources":["../../../src/lib/integrationConfiguration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,GAAa,EACb,KAAe,EACf,KAAa,EACI,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,WAAW,GAAwC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;QAC1E,IAAI,GAAG;YAAE,WAAW,CAAC,GAAG,GAAG,GAAG,CAAC;QAC/B,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CACrC,mCAAmC,EACnC,WAAW,EACX;YACE,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;SAClC,CACF,CAAC;QACF,mBAAmB;aAChB,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,EAAU,EACV,IAAY,EACZ,aAAqB,EACrB,KAAa,EACI,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,WAAW,GAAG;YAClB,EAAE,EAAE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",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -30,7 +30,7 @@
30
30
  "prepublishOnly": "npm run build",
31
31
  "test": "jest",
32
32
  "lint": "eslint 'src/**/*.{ts,tsx}'",
33
- "ar-auth": "npm config set @stackfactor:registry https://us-central1-npm.pkg.dev/virtual-development-team/sf-devenv-npm-private/; TOKEN=$(gcloud auth print-access-token 2>/dev/null || curl -sfH 'Metadata-Flavor: Google' http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token | sed -n 's/.*\"access_token\":\"\\([^\"]*\\)\".*/\\1/p'); test -n \"$TOKEN\" || { echo 'ar-auth: no credential — run: gcloud auth login' >&2; exit 1; }; npm config set //us-central1-npm.pkg.dev/virtual-development-team/:_authToken \"$TOKEN\"; echo 'ar-auth: Artifact Registry scope + token configured'",
33
+ "ar-auth": "npm config set @stackfactor:registry https://us-central1-npm.pkg.dev/virtual-development-team/sf-devenv-npm-private/; TOKEN=$(gcloud auth print-access-token 2>/dev/null || curl -sfH 'Metadata-Flavor: Google' http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token | sed -n 's/.*\"access_token\":\"\\([^\"]*\\)\".*/\\1/p'); test -n \"$TOKEN\" || { echo 'ar-auth: no credential — run: gcloud auth login' >&2; exit 1; }; npm config set //us-central1-npm.pkg.dev/virtual-development-team/sf-devenv-npm-private/:_authToken \"$TOKEN\"; npm config set //us-central1-npm.pkg.dev/virtual-development-team/:_authToken \"$TOKEN\"; echo 'ar-auth: Artifact Registry scope + token configured'",
34
34
  "reinstall": "npm run ar-auth && npm ci",
35
35
  "work:start": "bash scripts/work-start.sh",
36
36
  "work:commit": "bash scripts/work-commit.sh",