@camunda8/sdk 8.5.0 → 8.5.1-alpha.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/QUICKSTART.md +357 -0
  3. package/README.md +3 -7
  4. package/dist/admin/lib/AdminApiClient.d.ts +21 -2
  5. package/dist/admin/lib/AdminApiClient.js +27 -14
  6. package/dist/admin/lib/AdminApiClient.js.map +1 -1
  7. package/dist/c8/index.d.ts +2 -2
  8. package/dist/c8/index.js +4 -4
  9. package/dist/c8/index.js.map +1 -1
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/lib/GotErrors.d.ts +6 -0
  13. package/dist/lib/GotErrors.js +37 -0
  14. package/dist/lib/GotErrors.js.map +1 -0
  15. package/dist/lib/GotHooks.d.ts +23 -0
  16. package/dist/lib/GotHooks.js +51 -0
  17. package/dist/lib/GotHooks.js.map +1 -0
  18. package/dist/lib/index.d.ts +2 -0
  19. package/dist/lib/index.js +2 -0
  20. package/dist/lib/index.js.map +1 -1
  21. package/dist/modeler/lib/ModelerAPIClient.d.ts +58 -7
  22. package/dist/modeler/lib/ModelerAPIClient.js +79 -36
  23. package/dist/modeler/lib/ModelerAPIClient.js.map +1 -1
  24. package/dist/oauth/lib/OAuthProvider.d.ts +1 -1
  25. package/dist/oauth/lib/OAuthProvider.js +10 -8
  26. package/dist/oauth/lib/OAuthProvider.js.map +1 -1
  27. package/dist/operate/lib/OperateApiClient.d.ts +41 -2
  28. package/dist/operate/lib/OperateApiClient.js +50 -16
  29. package/dist/operate/lib/OperateApiClient.js.map +1 -1
  30. package/dist/optimize/lib/OptimizeApiClient.d.ts +13 -5
  31. package/dist/optimize/lib/OptimizeApiClient.js +20 -20
  32. package/dist/optimize/lib/OptimizeApiClient.js.map +1 -1
  33. package/dist/tasklist/lib/TasklistApiClient.d.ts +7 -2
  34. package/dist/tasklist/lib/TasklistApiClient.js +12 -14
  35. package/dist/tasklist/lib/TasklistApiClient.js.map +1 -1
  36. package/dist/zeebe/zb/ZeebeGrpcClient.js +12 -3
  37. package/dist/zeebe/zb/ZeebeGrpcClient.js.map +1 -1
  38. package/img/process-model.png +0 -0
  39. package/package.json +3 -1
@@ -8,6 +8,10 @@ const debug_1 = __importDefault(require("debug"));
8
8
  const got_1 = __importDefault(require("got"));
9
9
  const lib_1 = require("../../lib");
10
10
  const debug = (0, debug_1.default)('camunda:adminconsole');
11
+ /**
12
+ * This class provides methods to interact with the Camunda Admin API.
13
+ * @throws {RESTError} An error that may occur during API operations.
14
+ */
11
15
  class AdminApiClient {
12
16
  constructor(options) {
13
17
  const config = lib_1.CamundaEnvironmentConfigurator.mergeConfigWithEnvironment(options?.config ?? {});
@@ -16,25 +20,19 @@ class AdminApiClient {
16
20
  options?.oAuthProvider ?? (0, lib_1.constructOAuthProvider)(config);
17
21
  const certificateAuthority = (0, lib_1.GetCertificateAuthority)(config);
18
22
  this.userAgentString = (0, lib_1.createUserAgentString)(config);
23
+ const prefixUrl = `${baseUrl}/clusters`;
19
24
  this.rest = got_1.default.extend({
20
- prefixUrl: `${baseUrl}/clusters`,
25
+ prefixUrl,
26
+ retry: lib_1.GotRetryConfig,
21
27
  https: {
22
28
  certificateAuthority,
23
29
  },
30
+ handlers: [lib_1.gotErrorHandler],
24
31
  hooks: {
25
- beforeError: [
26
- (error) => {
27
- const { request } = error;
28
- if (request) {
29
- debug(`Error in request to ${request.options.url.href}`);
30
- debug(`Request headers: ${JSON.stringify(request.options.headers)}`);
31
- debug(`Error: ${error.code} - ${error.message}`);
32
- // Attach more contextual information to the error object
33
- error.message += ` (request to ${request.options.url.href})`;
34
- }
35
- return error;
36
- },
32
+ beforeRetry: [
33
+ (0, lib_1.makeBeforeRetryHandlerFor401TokenRetry)(this.getHeaders.bind(this)),
37
34
  ],
35
+ beforeError: [lib_1.gotBeforeErrorHook],
38
36
  },
39
37
  });
40
38
  debug('prefixUrl', `${baseUrl}/clusters`);
@@ -52,6 +50,7 @@ class AdminApiClient {
52
50
  /**
53
51
  *
54
52
  * @description Get an array of the current API clients for this cluster. See [the API Documentation](https://console.cloud.camunda.io/customer-api/openapi/docs/#/default/GetClients) for more details.
53
+ * @throws {RESTError}
55
54
  * @param clusterUuid - The cluster UUID
56
55
  *
57
56
  */
@@ -63,7 +62,7 @@ class AdminApiClient {
63
62
  }
64
63
  /**
65
64
  * @description Create a new API client for a cluster. See [the API Documentation](https://console.cloud.camunda.io/customer-api/openapi/docs/#/default/CreateClient) for more details.
66
- * @returns
65
+ * @throws {RESTError}
67
66
  */
68
67
  async createClient(req) {
69
68
  const headers = await this.getHeaders();
@@ -81,6 +80,7 @@ class AdminApiClient {
81
80
  * @description Get the details of an API client. See [the API Documentation](https://console.cloud.camunda.io/customer-api/openapi/docs/#/default/GetClient) for more details.
82
81
  * @param clusterUuid
83
82
  * @param clientId
83
+ * @throws {RESTError}
84
84
  * @returns
85
85
  */
86
86
  async getClient(clusterUuid, clientId) {
@@ -93,6 +93,7 @@ class AdminApiClient {
93
93
  * @description See [the API Documentation](https://console.cloud.camunda.io/customer-api/openapi/docs/#/default/DeleteClient) for more details.
94
94
  * @param clusterUuid
95
95
  * @param clientId
96
+ * @throws {RESTError}
96
97
  */
97
98
  async deleteClient(clusterUuid, clientId) {
98
99
  const headers = await this.getHeaders();
@@ -105,6 +106,7 @@ class AdminApiClient {
105
106
  /**
106
107
  *
107
108
  * @description Return an array of clusters. See [the API Documentation](https://console.cloud.camunda.io/customer-api/openapi/docs/#/default/GetClusters) for more details.
109
+ * @throws {RESTError}
108
110
  */
109
111
  async getClusters() {
110
112
  const headers = await this.getHeaders();
@@ -115,6 +117,7 @@ class AdminApiClient {
115
117
  /**
116
118
  *
117
119
  * @description Create a new cluster. See [the API Documentation](https://console.cloud.camunda.io/customer-api/openapi/docs/#/default/CreateCluster) for more details.
120
+ * @throws {RESTError}
118
121
  */
119
122
  async createCluster(createClusterRequest) {
120
123
  const headers = await this.getHeaders();
@@ -128,6 +131,7 @@ class AdminApiClient {
128
131
  /**
129
132
  *
130
133
  * @description Retrieve the metadata for a cluster. See [the API Documentation](https://console.cloud.camunda.io/customer-api/openapi/docs/#/default/GetCluster) for more details.
134
+ * @throws {RESTError}
131
135
  *
132
136
  */
133
137
  async getCluster(clusterUuid) {
@@ -139,6 +143,7 @@ class AdminApiClient {
139
143
  /**
140
144
  *
141
145
  * @description Delete a cluster. See [the API Documentation](https://console.cloud.camunda.io/customer-api/openapi/docs/#/default/DeleteCluster) for more details.
146
+ * @throws {RESTError}
142
147
  *
143
148
  */
144
149
  async deleteCluster(clusterUuid) {
@@ -152,6 +157,7 @@ class AdminApiClient {
152
157
  /**
153
158
  *
154
159
  * @description Retrieve the available parameters for cluster creation. See [the API Documentation](https://console.cloud.camunda.io/customer-api/openapi/docs/#/default/GetParameters) for more details.
160
+ * @throws {RESTError}
155
161
  */
156
162
  async getParameters() {
157
163
  const headers = await this.getHeaders();
@@ -162,6 +168,7 @@ class AdminApiClient {
162
168
  /**
163
169
  *
164
170
  * @description Retrieve the connector secrets. See [the API Documentation](https://console.cloud.camunda.io/customer-api/openapi/docs/#/default/GetSecrets) for more details.
171
+ * @throws {RESTError}
165
172
  */
166
173
  async getSecrets(clusterUuid) {
167
174
  const headers = await this.getHeaders();
@@ -172,6 +179,7 @@ class AdminApiClient {
172
179
  /**
173
180
  *
174
181
  * @description Create a new connector secret. See [the API Documentation](https://console.cloud.camunda.io/customer-api/openapi/docs/#/default/CreateSecret) for more details.
182
+ * @throws {RESTError}
175
183
  */
176
184
  async createSecret({ clusterUuid, secretName, secretValue, }) {
177
185
  const headers = await this.getHeaders();
@@ -184,6 +192,7 @@ class AdminApiClient {
184
192
  /**
185
193
  *
186
194
  * @description Delete a connector secret. See [the API Documentation](https://console.cloud.camunda.io/customer-api/openapi/docs/#/default/DeleteSecret) for more details.
195
+ * @throws {RESTError}
187
196
  */
188
197
  async deleteSecret(clusterUuid, secretName) {
189
198
  const headers = await this.getHeaders();
@@ -196,6 +205,7 @@ class AdminApiClient {
196
205
  /**
197
206
  *
198
207
  * @description Add one or more IPs to the whitelist for the cluster. See [the API Documentation](https://console.cloud.camunda.io/customer-api/openapi/docs/#/default/UpdateIpWhitelist) for more details.
208
+ * @throws {RESTError}
199
209
  * @param ipwhitelist
200
210
  * @returns
201
211
  */
@@ -213,6 +223,7 @@ class AdminApiClient {
213
223
  /**
214
224
  *
215
225
  * @description Retrieve a list of members and pending invites for your organisation. See the [API Documentation]() for more details.
226
+ * @throws {RESTError}
216
227
  */
217
228
  async getUsers() {
218
229
  const headers = await this.getHeaders();
@@ -225,6 +236,7 @@ class AdminApiClient {
225
236
  /**
226
237
  *
227
238
  * @description Add a member. See the [API Documentation]() for more details.
239
+ * @throws {RESTError}
228
240
  *
229
241
  */
230
242
  async createMember(email, orgRoles) {
@@ -239,6 +251,7 @@ class AdminApiClient {
239
251
  /**
240
252
  *
241
253
  * @description Delete a member from your organization. See the [API Documentation]() for more details.
254
+ * @throws {RESTError}
242
255
  *
243
256
  */
244
257
  async deleteMember(email) {
@@ -1 +1 @@
1
- {"version":3,"file":"AdminApiClient.js","sourceRoot":"","sources":["../../../src/admin/lib/AdminApiClient.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAqB;AACrB,8CAAqB;AAErB,mCAQkB;AAKlB,MAAM,KAAK,GAAG,IAAA,eAAC,EAAC,sBAAsB,CAAC,CAAA;AAEvC,MAAa,cAAc;IAK1B,YAAY,OAGX;QACA,MAAM,MAAM,GAAG,oCAA8B,CAAC,0BAA0B,CACvE,OAAO,EAAE,MAAM,IAAI,EAAE,CACrB,CAAA;QACD,MAAM,OAAO,GAAG,IAAA,0BAAoB,EACnC,MAAM,CAAC,wBAAwB,EAC/B,0BAA0B,CAC1B,CAAA;QAED,IAAI,CAAC,aAAa;YACjB,OAAO,EAAE,aAAa,IAAI,IAAA,4BAAsB,EAAC,MAAM,CAAC,CAAA;QAEzD,MAAM,oBAAoB,GAA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CAAA;IACT,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,YAAY,CAAC,KAAa;QAC/B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAA;QACvC,OAAO,IAAI,CAAC,IAAI;aACd,MAAM,CAAC,WAAW,KAAK,EAAE,EAAE;YAC3B,OAAO;SACP,CAAC;aACD,IAAI,EAAE,CAAA;IACT,CAAC;CACD;AAtTD,wCAsTC"}
@@ -15,7 +15,7 @@ import { ZeebeGrpcClient } from '../zeebe';
15
15
  * import { Camunda8 } from '@camunda8/sdk'
16
16
  *
17
17
  * const c8 = new Camunda8()
18
- * const zeebe = c8.getZeebeGrpcClient()
18
+ * const zeebe = c8.getZeebeGrpcApiClient()
19
19
  * const operate = c8.getOperateApiClient()
20
20
  * const optimize = c8.getOptimizeApiClient()
21
21
  * const tasklist = c8.getTasklistApiClient()
@@ -29,7 +29,7 @@ export declare class Camunda8 {
29
29
  private modelerApiClient?;
30
30
  private optimizeApiClient?;
31
31
  private tasklistApiClient?;
32
- private zeebeGrpcClient?;
32
+ private zeebeGrpcApiClient?;
33
33
  private configuration;
34
34
  private oAuthProvider?;
35
35
  constructor(config?: DeepPartial<CamundaPlatform8Configuration>);
package/dist/c8/index.js CHANGED
@@ -19,7 +19,7 @@ const zeebe_1 = require("../zeebe");
19
19
  * import { Camunda8 } from '@camunda8/sdk'
20
20
  *
21
21
  * const c8 = new Camunda8()
22
- * const zeebe = c8.getZeebeGrpcClient()
22
+ * const zeebe = c8.getZeebeGrpcApiClient()
23
23
  * const operate = c8.getOperateApiClient()
24
24
  * const optimize = c8.getOptimizeApiClient()
25
25
  * const tasklist = c8.getTasklistApiClient()
@@ -82,13 +82,13 @@ class Camunda8 {
82
82
  return this.tasklistApiClient;
83
83
  }
84
84
  getZeebeGrpcApiClient() {
85
- if (!this.zeebeGrpcClient) {
86
- this.zeebeGrpcClient = new zeebe_1.ZeebeGrpcClient({
85
+ if (!this.zeebeGrpcApiClient) {
86
+ this.zeebeGrpcApiClient = new zeebe_1.ZeebeGrpcClient({
87
87
  config: this.configuration,
88
88
  oAuthProvider: this.oAuthProvider,
89
89
  });
90
90
  }
91
- return this.zeebeGrpcClient;
91
+ return this.zeebeGrpcApiClient;
92
92
  }
93
93
  }
94
94
  exports.Camunda8 = Camunda8;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/c8/index.ts"],"names":[],"mappings":";;;AAAA,oCAAyC;AACzC,gCAIe;AACf,wCAA6C;AAC7C,oCAAwC;AACxC,wCAA6C;AAC7C,0CAA+C;AAC/C,0CAA+C;AAC/C,oCAA0C;AAE1C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,QAAQ;IAUpB,YAAY,SAAqD,EAAE;QAClE,IAAI,CAAC,aAAa;YACjB,oCAA8B,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAA;QAClE,8BAA8B;QAC9B,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,sBAAsB,EAAE,CAAC;YAChD,IAAI,CAAC,aAAa,GAAG,IAAI,qBAAa,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAA;QACvE,CAAC;IACF,CAAC;IAEM,mBAAmB;QACzB,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC5B,IAAI,CAAC,gBAAgB,GAAG,IAAI,0BAAgB,CAAC;gBAC5C,MAAM,EAAE,IAAI,CAAC,aAAa;gBAC1B,aAAa,EAAE,IAAI,CAAC,aAAa;aACjC,CAAC,CAAA;QACH,CAAC;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAA;IAC7B,CAAC;IAEM,iBAAiB;QACvB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YAC1B,IAAI,CAAC,cAAc,GAAG,IAAI,sBAAc,CAAC;gBACxC,MAAM,EAAE,IAAI,CAAC,aAAa;gBAC1B,aAAa,EAAE,IAAI,CAAC,aAAa;aACjC,CAAC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aAAa;aACjC,CAAC,CAAA;QACH,CAAC;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAA;IAC7B,CAAC;IAEM,oBAAoB;QAC1B,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC7B,IAAI,CAAC,iBAAiB,GAAG,IAAI,4BAAiB,CAAC;gBAC9C,MAAM,EAAE,IAAI,CAAC,aAAa;gBAC1B,aAAa,EAAE,IAAI,CAAC,aAAa;aACjC,CAAC,CAAA;QACH,CAAC;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAA;IAC9B,CAAC;IAEM,oBAAoB;QAC1B,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC7B,IAAI,CAAC,iBAAiB,GAAG,IAAI,4BAAiB,CAAC;gBAC9C,MAAM,EAAE,IAAI,CAAC,aAAa;gBAC1B,aAAa,EAAE,IAAI,CAAC,aAAa;aACjC,CAAC,CAAA;QACH,CAAC;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAA;IAC9B,CAAC;IAEM,qBAAqB;QAC3B,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC9B,IAAI,CAAC,kBAAkB,GAAG,IAAI,uBAAe,CAAC;gBAC7C,MAAM,EAAE,IAAI,CAAC,aAAa;gBAC1B,aAAa,EAAE,IAAI,CAAC,aAAa;aACjC,CAAC,CAAA;QACH,CAAC;QACD,OAAO,IAAI,CAAC,kBAAkB,CAAA;IAC/B,CAAC;CACD;AA9ED,4BA8EC"}
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ import * as Operate from './operate';
7
7
  import * as Optimize from './optimize';
8
8
  import * as Tasklist from './tasklist';
9
9
  import * as Zeebe from './zeebe';
10
+ export { /*HTTPError,*/ RESTError } from './lib';
10
11
  export declare const Dto: {
11
12
  ChildDto: typeof ChildDto;
12
13
  BigIntValue: typeof BigIntValue;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgC;AAYvB,sBAAK;AAXd,6BAA+B;AAWT,yFAXb,aAAQ,OAWa;AAV9B,+BAAuE;AACvE,mDAAoC;AASJ,0BAAO;AARvC,8CAA+B;AAQf,oBAAI;AAPpB,mDAAoC;AAOK,0BAAO;AANhD,qDAAsC;AAMY,4BAAQ;AAL1D,qDAAsC;AAKsB,4BAAQ;AAJpE,+CAAgC;AAIsC,sBAAK;AAF9D,QAAA,GAAG,GAAG,EAAE,QAAQ,EAAR,cAAQ,EAAE,WAAW,EAAX,iBAAW,EAAE,WAAW,EAAX,iBAAW,EAAE,WAAW,EAAX,iBAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgC;AAcvB,sBAAK;AAbd,6BAA+B;AAaT,yFAbb,aAAQ,OAaa;AAZ9B,+BAAuE;AACvE,mDAAoC;AAWJ,0BAAO;AAVvC,8CAA+B;AAUf,oBAAI;AATpB,mDAAoC;AASK,0BAAO;AARhD,qDAAsC;AAQY,4BAAQ;AAP1D,qDAAsC;AAOsB,4BAAQ;AANpE,+CAAgC;AAMsC,sBAAK;AAF9D,QAAA,GAAG,GAAG,EAAE,QAAQ,EAAR,cAAQ,EAAE,WAAW,EAAX,iBAAW,EAAE,WAAW,EAAX,iBAAW,EAAE,WAAW,EAAX,iBAAW,EAAE,CAAA"}
@@ -0,0 +1,6 @@
1
+ import * as Got from 'got';
2
+ export declare class HTTPError extends Got.HTTPError {
3
+ statusCode: number;
4
+ constructor(response: Got.Response<unknown>);
5
+ }
6
+ export type RESTError = HTTPError | Got.RequestError | Got.ReadError | Got.ParseError | Got.TimeoutError | Got.CancelError | Got.CacheError | Got.MaxRedirectsError | Got.UnsupportedProtocolError;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.HTTPError = void 0;
27
+ const Got = __importStar(require("got"));
28
+ class HTTPError extends Got.HTTPError {
29
+ constructor(response) {
30
+ super(response);
31
+ const details = JSON.parse(response?.body || '{}');
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ this.statusCode = details.status;
34
+ }
35
+ }
36
+ exports.HTTPError = HTTPError;
37
+ //# sourceMappingURL=GotErrors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GotErrors.js","sourceRoot":"","sources":["../../src/lib/GotErrors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA0B;AAE1B,MAAa,SAAU,SAAQ,GAAG,CAAC,SAAS;IAE3C,YAAY,QAA+B;QAC1C,KAAK,CAAC,QAAQ,CAAC,CAAA;QACf,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAE,QAAQ,EAAE,IAAe,IAAI,IAAI,CAAC,CAAA;QAC9D,8DAA8D;QAC9D,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,CAAA;IACjC,CAAC;CACD;AARD,8BAQC"}
@@ -0,0 +1,23 @@
1
+ import { Method } from 'got';
2
+ /**
3
+ *
4
+ * This function stores the call point from the application of got requests.
5
+ * This enables users to see where the error originated from.
6
+ */
7
+ export declare const gotErrorHandler: (options: any, next: any) => any;
8
+ /**
9
+ * This function adds the call point to the error stack trace of got errors.
10
+ * This enables users to see where the error originated from.
11
+ */
12
+ export declare const gotBeforeErrorHook: (error: any) => any;
13
+ /**
14
+ *
15
+ * This function is used on a 401 response to retry the request with a new token, one single time.
16
+ * https://github.com/camunda/camunda-8-js-sdk/issues/125
17
+ */
18
+ export declare const makeBeforeRetryHandlerFor401TokenRetry: (getHeadersFn: any) => (context: any) => Promise<void>;
19
+ export declare const GotRetryConfig: {
20
+ limit: number;
21
+ methods: Method[];
22
+ statusCodes: number[];
23
+ };
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GotRetryConfig = exports.makeBeforeRetryHandlerFor401TokenRetry = exports.gotBeforeErrorHook = exports.gotErrorHandler = void 0;
4
+ const got_1 = require("got");
5
+ const GotErrors_1 = require("./GotErrors");
6
+ /**
7
+ *
8
+ * This function stores the call point from the application of got requests.
9
+ * This enables users to see where the error originated from.
10
+ */
11
+ const gotErrorHandler = (options, next) => {
12
+ if (Object.isFrozen(options.context)) {
13
+ options.context = { ...options.context, hasRetried: false };
14
+ }
15
+ Error.captureStackTrace(options.context);
16
+ return next(options);
17
+ };
18
+ exports.gotErrorHandler = gotErrorHandler;
19
+ /**
20
+ * This function adds the call point to the error stack trace of got errors.
21
+ * This enables users to see where the error originated from.
22
+ */
23
+ const gotBeforeErrorHook = (error) => {
24
+ const { request } = error;
25
+ if (error instanceof got_1.HTTPError) {
26
+ error = new GotErrors_1.HTTPError(error.response);
27
+ const details = JSON.parse(error.response?.body || '{}');
28
+ error.statusCode = details.status;
29
+ }
30
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
+ ;
32
+ error.source = error.options.context.stack.split('\n');
33
+ error.message += ` (request to ${request?.options.url.href})`;
34
+ return error;
35
+ };
36
+ exports.gotBeforeErrorHook = gotBeforeErrorHook;
37
+ /**
38
+ *
39
+ * This function is used on a 401 response to retry the request with a new token, one single time.
40
+ * https://github.com/camunda/camunda-8-js-sdk/issues/125
41
+ */
42
+ const makeBeforeRetryHandlerFor401TokenRetry = (getHeadersFn) => async (context) => {
43
+ context.headers.authorization = (await getHeadersFn()).authorization;
44
+ };
45
+ exports.makeBeforeRetryHandlerFor401TokenRetry = makeBeforeRetryHandlerFor401TokenRetry;
46
+ exports.GotRetryConfig = {
47
+ limit: 1,
48
+ methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'],
49
+ statusCodes: [401],
50
+ };
51
+ //# sourceMappingURL=GotHooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GotHooks.js","sourceRoot":"","sources":["../../src/lib/GotHooks.ts"],"names":[],"mappings":";;;AAAA,6BAAuD;AAEvD,2CAAuC;AAEvC;;;;GAIG;AACI,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;IAChD,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,OAAO,CAAC,OAAO,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAA;IAC5D,CAAC;IACD,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAExC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAA;AACrB,CAAC,CAAA;AAPY,QAAA,eAAe,mBAO3B;AAED;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,EAAE;IAC3C,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAA;IACzB,IAAI,KAAK,YAAY,eAAY,EAAE,CAAC;QACnC,KAAK,GAAG,IAAI,qBAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAE,KAAK,CAAC,QAAQ,EAAE,IAAe,IAAI,IAAI,CAAC,CAAA;QACpE,KAAK,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,CAAA;IAClC,CAAC;IACD,8DAA8D;IAC9D,CAAC;IAAC,KAAa,CAAC,MAAM,GAAI,KAAa,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACzE,KAAK,CAAC,OAAO,IAAI,gBAAgB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAA;IAC7D,OAAO,KAAK,CAAA;AACb,CAAC,CAAA;AAXY,QAAA,kBAAkB,sBAW9B;AAED;;;;GAIG;AACI,MAAM,sCAAsC,GAClD,CAAC,YAAY,EAAE,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACnC,OAAO,CAAC,OAAO,CAAC,aAAa,GAAG,CAAC,MAAM,YAAY,EAAE,CAAC,CAAC,aAAa,CAAA;AACrE,CAAC,CAAA;AAHW,QAAA,sCAAsC,0CAGjD;AAEW,QAAA,cAAc,GAAG;IAC7B,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAa;IAC9D,WAAW,EAAE,CAAC,GAAG,CAAC;CAClB,CAAA"}
@@ -6,6 +6,8 @@ export * from './CreateUserAgentString';
6
6
  export * from './Delay';
7
7
  export * from './EnvironmentSetup';
8
8
  export { packageVersion } from './GetPackageVersion';
9
+ export * from './GotErrors';
10
+ export * from './GotHooks';
9
11
  export * from './LosslessJsonParser';
10
12
  export { RequireConfiguration } from './RequireConfiguration';
11
13
  export * from './SuppressZeebeLogging';
package/dist/lib/index.js CHANGED
@@ -24,6 +24,8 @@ __exportStar(require("./Delay"), exports);
24
24
  __exportStar(require("./EnvironmentSetup"), exports);
25
25
  var GetPackageVersion_1 = require("./GetPackageVersion");
26
26
  Object.defineProperty(exports, "packageVersion", { enumerable: true, get: function () { return GetPackageVersion_1.packageVersion; } });
27
+ __exportStar(require("./GotErrors"), exports);
28
+ __exportStar(require("./GotHooks"), exports);
27
29
  __exportStar(require("./LosslessJsonParser"), exports);
28
30
  var RequireConfiguration_1 = require("./RequireConfiguration");
29
31
  Object.defineProperty(exports, "RequireConfiguration", { enumerable: true, get: function () { return RequireConfiguration_1.RequireConfiguration; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAsC;AACtC,sDAAmC;AACnC,kDAA+B;AAC/B,2DAAwC;AACxC,0DAAuC;AACvC,0CAAuB;AACvB,qDAAkC;AAClC,yDAAoD;AAA3C,mHAAA,cAAc,OAAA;AACvB,uDAAoC;AACpC,+DAA6D;AAApD,4HAAA,oBAAoB,OAAA;AAC7B,yDAAsC;AACtC,mDAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAsC;AACtC,sDAAmC;AACnC,kDAA+B;AAC/B,2DAAwC;AACxC,0DAAuC;AACvC,0CAAuB;AACvB,qDAAkC;AAClC,yDAAoD;AAA3C,mHAAA,cAAc,OAAA;AACvB,8CAA2B;AAC3B,6CAA0B;AAC1B,uDAAoC;AACpC,+DAA6D;AAApD,4HAAA,oBAAoB,OAAA;AAC7B,yDAAsC;AACtC,mDAAgC"}
@@ -14,6 +14,7 @@ export declare class ModelerApiClient {
14
14
  /**
15
15
  * Adds a new collaborator to a project or modifies the permission level of an existing collaborator.
16
16
  * Note: Only users that are part of the authorized organization (see GET /api/v1/info) and logged in to Web Modeler at least once can be added to a project.
17
+ * @throws {RESTError}
17
18
  */
18
19
  addCollaborator(req: Dto.CreateCollaboratorDto): Promise<null>;
19
20
  /**
@@ -22,8 +23,14 @@ export declare class ModelerApiClient {
22
23
  * sort specifies by which fields and direction (ASC/DESC) the result should be sorted.
23
24
  * page specifies the page number to return.
24
25
  * size specifies the number of items per page. The default value is 10.
26
+ * @throws {RESTError}
25
27
  */
26
28
  searchCollaborators(req: Dto.PubSearchDtoProjectCollaboratorDto): Promise<Dto.PubSearchResultDtoProjectCollaboratorDto>;
29
+ /**
30
+ *
31
+ * @throws {RESTError}
32
+ * @returns
33
+ */
27
34
  deleteCollaborator({ email, projectId, }: {
28
35
  projectId: string;
29
36
  email: string;
@@ -49,7 +56,9 @@ export declare class ModelerApiClient {
49
56
  *
50
57
  * The value of content.version is managed by Web Modeler and will be updated automatically.
51
58
  *
52
- * Note: The simplePath transforms any occurrences of slashes ("/") in file and folder names into an escape sequence consisting of a backslash followed by a slash ("\/"). This form of escaping facilitates the processing of path-like structures within file and folder names.
59
+ * Note: The simplePath transforms any occurrences of slashes ("/") in file and folder names into an escape sequence consisting of a backslash followed by a slash ("\/").
60
+ * This form of escaping facilitates the processing of path-like structures within file and folder names.
61
+ * @throws {RESTError}
53
62
  */
54
63
  createFile(req: Dto.CreateFileDto): Promise<Dto.FileMetadataDto>;
55
64
  /**
@@ -60,11 +69,14 @@ export declare class ModelerApiClient {
60
69
  * facilitates the processing of path-like structures within file and folder names.
61
70
  *
62
71
  * Does this throw if it is not found?
72
+ * @throws {RESTError}
63
73
  */
64
74
  getFile(fileId: string): Promise<Dto.FileDto>;
65
75
  /**
66
76
  * Deletes a file.
67
- * Note: Deleting a file will also delete other resources attached to the file (comments, call activity/business rule task links, milestones and shares) which might have side-effects. Deletion of resources is recursive and cannot be undone.
77
+ * Note: Deleting a file will also delete other resources attached to the file (comments, call activity/business rule task links, milestones and shares) which might have side-effects.
78
+ * Deletion of resources is recursive and cannot be undone.
79
+ * @throws {RESTError}
68
80
  */
69
81
  deleteFile(fileId: string): Promise<null>;
70
82
  /**
@@ -80,7 +92,9 @@ export declare class ModelerApiClient {
80
92
  * The value of content.name can only be changed via name.
81
93
  * The value of content.id is not updatable.
82
94
  * The value of content.version is managed by Web Modeler and will be updated automatically.
83
- * Note: The simplePath transforms any occurrences of slashes ("/") in file and folder names into an escape sequence consisting of a backslash followed by a slash ("\/"). This form of escaping facilitates the processing of path-like structures within file and folder names.
95
+ * Note: The simplePath transforms any occurrences of slashes ("/") in file and folder names into an escape sequence consisting of a backslash followed by a slash ("\/").
96
+ * This form of escaping facilitates the processing of path-like structures within file and folder names.
97
+ * @throws {RESTError}
84
98
  */
85
99
  updateFile(fileId: string, update: Dto.UpdateFileDto): Promise<Dto.FileMetadataDto>;
86
100
  /**
@@ -105,7 +119,9 @@ export declare class ModelerApiClient {
105
119
  * page specifies the page number to return.
106
120
  * size specifies the number of items per page. The default value is 10.
107
121
  *
108
- * Note: The simplePath transform any occurrences of slashes ("/") in file and folder names into an escape sequence consisting of a backslash followed by a slash ("\/"). This form of escaping facilitates the processing of path-like structures within file and folder names.
122
+ * Note: The simplePath transform any occurrences of slashes ("/") in file and folder names into an escape sequence consisting of a backslash followed by a slash ("\/").
123
+ * This form of escaping facilitates the processing of path-like structures within file and folder names.
124
+ * @throws {RESTError}
109
125
  */
110
126
  searchFiles(req: Dto.PubSearchDtoFileMetadataDto): Promise<Dto.PubSearchResultDtoFileMetadataDto>;
111
127
  /**
@@ -117,12 +133,19 @@ export declare class ModelerApiClient {
117
133
  * When projectId is given and parentId is either null or omitted altogether, the folder will be created in the root of the project.
118
134
  *
119
135
  * When projectId and parentId are both given, they must be consistent - i.e. the parent folder is in the project.
136
+ * @throws {RESTError}
120
137
  */
121
138
  createFolder(req: Dto.CreateFolderDto): Promise<Dto.FolderMetadataDto>;
139
+ /**
140
+ *
141
+ * @throws {RESTError}
142
+ * @returns
143
+ */
122
144
  getFolder(folderId: string): Promise<Dto.FolderDto>;
123
145
  /**
124
146
  *
125
147
  * Deletes an empty folder. A folder is considered empty if there are no files in it. Deletion of resources is recursive and cannot be undone.
148
+ * @throws {RESTError}
126
149
  */
127
150
  deleteFolder(folderId: string): Promise<null>;
128
151
  /**
@@ -135,17 +158,32 @@ export declare class ModelerApiClient {
135
158
  * When projectId is given and parentId is either null or omitted altogether, the file will be moved to the root of the project.
136
159
  *
137
160
  * When projectId and parentId are both given, they must be consistent - i.e. the new parent folder is in the new project.
161
+ * @throws {RESTError}
138
162
  */
139
163
  updateFolder(folderId: string, update: Dto.UpdateFolderDto): Promise<Dto.FolderMetadataDto>;
164
+ /**
165
+ *
166
+ * @throws {RESTError}
167
+ */
140
168
  getInfo(): Promise<Dto.InfoDto>;
169
+ /**
170
+ *
171
+ * @throws {RESTError}
172
+ */
141
173
  createMilestone(req: Dto.CreateMilestoneDto): Promise<Dto.MilestoneMetadataDto>;
174
+ /**
175
+ *
176
+ * @throws {RESTError}
177
+ */
142
178
  getMilestone(milestoneId: string): Promise<Dto.MilestoneDto>;
143
179
  /**
144
180
  * Deletion of resources is recursive and cannot be undone.
181
+ * @throws {RESTError}
145
182
  */
146
- deleteMilestone(milestoneId: string): Promise<string | null>;
183
+ deleteMilestone(milestoneId: string): Promise<string>;
147
184
  /**
148
185
  * Returns a link to a visual comparison between two milestones where the milestone referenced by milestone1Id acts as a baseline to compare the milestone referenced by milestone2Id against.
186
+ * @throws {RESTError}
149
187
  */
150
188
  getMilestoneComparison(milestone1Id: string, milestone2Id: string): Promise<string>;
151
189
  /**
@@ -170,17 +208,29 @@ export declare class ModelerApiClient {
170
208
  * page specifies the page number to return.
171
209
  *
172
210
  * size specifies the number of items per page. The default value is 10.
211
+ * @throws {RESTError}
173
212
  */
174
213
  searchMilestones(req: Dto.PubSearchDtoMilestoneMetadataDto): Promise<Dto.PubSearchResultDtoMilestoneMetadataDto>;
175
214
  /**
176
215
  * Creates a new project. This project will be created without any collaborators, so it will not be visible in the UI by default. To assign collaborators, use `addCollaborator()`.
216
+ * @throws {RESTError}
177
217
  */
178
218
  createProject(name: string): Promise<Dto.ProjectMetadataDto>;
219
+ /**
220
+ *
221
+ * @throws {RESTError}
222
+ * @returns
223
+ */
179
224
  getProject(projectId: string): Promise<Dto.ProjectDto>;
180
225
  /**
181
- * This endpoint deletes an empty project. A project is considered empty if there are no files in it. Deletion of resources is recursive and cannot be undone.
226
+ * @description This endpoint deletes an empty project. A project is considered empty if there are no files in it. Deletion of resources is recursive and cannot be undone.
227
+ * @throws {RESTError}
228
+ */
229
+ deleteProject(projectId: string): Promise<any>;
230
+ /**
231
+ *
232
+ * @throws {RESTError}
182
233
  */
183
- deleteProject(projectId: string): Promise<string | null>;
184
234
  renameProject(projectId: string, name: string): Promise<Dto.ProjectMetadataDto>;
185
235
  /**
186
236
  * Searches for projects.
@@ -205,6 +255,7 @@ export declare class ModelerApiClient {
205
255
  * page specifies the page number to return.
206
256
  *
207
257
  * size specifies the number of items per page. The default value is 10.
258
+ * @throws {RESTError}
208
259
  */
209
260
  searchProjects(req: Dto.PubSearchDtoProjectMetadataDto): Promise<Dto.PubSearchResultDtoProjectMetadataDto>;
210
261
  }