frameio 1.2.2 → 1.2.3

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 (68) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/accountPermissions/client/Client.d.ts +2 -1
  3. package/dist/cjs/api/resources/accountPermissions/client/Client.js +66 -79
  4. package/dist/cjs/api/resources/accounts/client/Client.d.ts +2 -1
  5. package/dist/cjs/api/resources/accounts/client/Client.js +63 -73
  6. package/dist/cjs/api/resources/comments/client/Client.d.ts +2 -1
  7. package/dist/cjs/api/resources/comments/client/Client.js +69 -82
  8. package/dist/cjs/api/resources/projectPermissions/client/Client.d.ts +2 -1
  9. package/dist/cjs/api/resources/projectPermissions/client/Client.js +66 -79
  10. package/dist/cjs/api/resources/projects/client/Client.d.ts +2 -1
  11. package/dist/cjs/api/resources/projects/client/Client.js +66 -79
  12. package/dist/cjs/api/resources/shares/client/Client.d.ts +4 -2
  13. package/dist/cjs/api/resources/shares/client/Client.js +126 -149
  14. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +2 -1
  15. package/dist/cjs/api/resources/webhooks/client/Client.js +66 -79
  16. package/dist/cjs/api/resources/workspacePermissions/client/Client.d.ts +2 -1
  17. package/dist/cjs/api/resources/workspacePermissions/client/Client.js +66 -79
  18. package/dist/cjs/api/resources/workspaces/client/Client.d.ts +2 -1
  19. package/dist/cjs/api/resources/workspaces/client/Client.js +69 -79
  20. package/dist/cjs/core/index.d.ts +0 -2
  21. package/dist/cjs/core/index.js +0 -2
  22. package/dist/cjs/version.d.ts +1 -1
  23. package/dist/cjs/version.js +1 -1
  24. package/dist/esm/Client.mjs +2 -2
  25. package/dist/esm/api/resources/accountPermissions/client/Client.d.mts +2 -1
  26. package/dist/esm/api/resources/accountPermissions/client/Client.mjs +66 -79
  27. package/dist/esm/api/resources/accounts/client/Client.d.mts +2 -1
  28. package/dist/esm/api/resources/accounts/client/Client.mjs +63 -73
  29. package/dist/esm/api/resources/comments/client/Client.d.mts +2 -1
  30. package/dist/esm/api/resources/comments/client/Client.mjs +69 -82
  31. package/dist/esm/api/resources/projectPermissions/client/Client.d.mts +2 -1
  32. package/dist/esm/api/resources/projectPermissions/client/Client.mjs +66 -79
  33. package/dist/esm/api/resources/projects/client/Client.d.mts +2 -1
  34. package/dist/esm/api/resources/projects/client/Client.mjs +66 -79
  35. package/dist/esm/api/resources/shares/client/Client.d.mts +4 -2
  36. package/dist/esm/api/resources/shares/client/Client.mjs +126 -149
  37. package/dist/esm/api/resources/webhooks/client/Client.d.mts +2 -1
  38. package/dist/esm/api/resources/webhooks/client/Client.mjs +66 -79
  39. package/dist/esm/api/resources/workspacePermissions/client/Client.d.mts +2 -1
  40. package/dist/esm/api/resources/workspacePermissions/client/Client.mjs +66 -79
  41. package/dist/esm/api/resources/workspaces/client/Client.d.mts +2 -1
  42. package/dist/esm/api/resources/workspaces/client/Client.mjs +69 -79
  43. package/dist/esm/core/index.d.mts +0 -2
  44. package/dist/esm/core/index.mjs +0 -2
  45. package/dist/esm/version.d.mts +1 -1
  46. package/dist/esm/version.mjs +1 -1
  47. package/package.json +1 -1
  48. package/reference.md +29 -203
  49. package/dist/cjs/core/pagination/Page.d.ts +0 -32
  50. package/dist/cjs/core/pagination/Page.js +0 -100
  51. package/dist/cjs/core/pagination/Pageable.d.ts +0 -14
  52. package/dist/cjs/core/pagination/Pageable.js +0 -10
  53. package/dist/cjs/core/pagination/index.d.ts +0 -2
  54. package/dist/cjs/core/pagination/index.js +0 -7
  55. package/dist/cjs/core/utils/index.d.ts +0 -1
  56. package/dist/cjs/core/utils/index.js +0 -5
  57. package/dist/cjs/core/utils/setObjectProperty.d.ts +0 -11
  58. package/dist/cjs/core/utils/setObjectProperty.js +0 -42
  59. package/dist/esm/core/pagination/Page.d.mts +0 -32
  60. package/dist/esm/core/pagination/Page.mjs +0 -96
  61. package/dist/esm/core/pagination/Pageable.d.mts +0 -14
  62. package/dist/esm/core/pagination/Pageable.mjs +0 -6
  63. package/dist/esm/core/pagination/index.d.mts +0 -2
  64. package/dist/esm/core/pagination/index.mjs +0 -2
  65. package/dist/esm/core/utils/index.d.mts +0 -1
  66. package/dist/esm/core/utils/index.mjs +0 -1
  67. package/dist/esm/core/utils/setObjectProperty.d.mts +0 -11
  68. package/dist/esm/core/utils/setObjectProperty.mjs +0 -39
@@ -296,91 +296,78 @@ export class Projects {
296
296
  * include_total_count: false
297
297
  * })
298
298
  */
299
- index(accountId_1, workspaceId_1) {
299
+ index(accountId, workspaceId, request = {}, requestOptions) {
300
+ return core.HttpResponsePromise.fromPromise(this.__index(accountId, workspaceId, request, requestOptions));
301
+ }
302
+ __index(accountId_1, workspaceId_1) {
300
303
  return __awaiter(this, arguments, void 0, function* (accountId, workspaceId, request = {}, requestOptions) {
301
- const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
302
- var _a, _b, _c;
303
- const { include, after, page_size: pageSize, include_total_count: includeTotalCount } = request;
304
- const _queryParams = {};
305
- if (include != null) {
306
- _queryParams["include"] = include;
307
- }
308
- if (after != null) {
309
- _queryParams["after"] = after;
310
- }
311
- if (pageSize != null) {
312
- _queryParams["page_size"] = pageSize.toString();
313
- }
314
- if (includeTotalCount != null) {
315
- _queryParams["include_total_count"] = includeTotalCount.toString();
316
- }
317
- let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
318
- const _response = yield core.fetcher({
319
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FrameioEnvironment.Default, `v4/accounts/${encodeURIComponent(accountId)}/workspaces/${encodeURIComponent(workspaceId)}/projects`),
320
- method: "GET",
321
- headers: _headers,
322
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
323
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
324
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
325
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
326
- });
327
- if (_response.ok) {
328
- return {
329
- data: _response.body,
330
- rawResponse: _response.rawResponse,
331
- };
332
- }
333
- if (_response.error.reason === "status-code") {
334
- switch (_response.error.statusCode) {
335
- case 400:
336
- throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
337
- case 401:
338
- throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
339
- case 403:
340
- throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
341
- case 404:
342
- throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
343
- case 409:
344
- throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
345
- case 422:
346
- throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
347
- case 429:
348
- throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
349
- default:
350
- throw new errors.FrameioError({
351
- statusCode: _response.error.statusCode,
352
- body: _response.error.body,
353
- rawResponse: _response.rawResponse,
354
- });
355
- }
356
- }
357
- switch (_response.error.reason) {
358
- case "non-json":
304
+ var _a, _b, _c;
305
+ const { include, after, page_size: pageSize, include_total_count: includeTotalCount } = request;
306
+ const _queryParams = {};
307
+ if (include != null) {
308
+ _queryParams["include"] = include;
309
+ }
310
+ if (after != null) {
311
+ _queryParams["after"] = after;
312
+ }
313
+ if (pageSize != null) {
314
+ _queryParams["page_size"] = pageSize.toString();
315
+ }
316
+ if (includeTotalCount != null) {
317
+ _queryParams["include_total_count"] = includeTotalCount.toString();
318
+ }
319
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
320
+ const _response = yield core.fetcher({
321
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FrameioEnvironment.Default, `v4/accounts/${encodeURIComponent(accountId)}/workspaces/${encodeURIComponent(workspaceId)}/projects`),
322
+ method: "GET",
323
+ headers: _headers,
324
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
325
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
326
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
327
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
328
+ });
329
+ if (_response.ok) {
330
+ return { data: _response.body, rawResponse: _response.rawResponse };
331
+ }
332
+ if (_response.error.reason === "status-code") {
333
+ switch (_response.error.statusCode) {
334
+ case 400:
335
+ throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
336
+ case 401:
337
+ throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
338
+ case 403:
339
+ throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
340
+ case 404:
341
+ throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
342
+ case 409:
343
+ throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
344
+ case 422:
345
+ throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
346
+ case 429:
347
+ throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
348
+ default:
359
349
  throw new errors.FrameioError({
360
350
  statusCode: _response.error.statusCode,
361
- body: _response.error.rawBody,
362
- rawResponse: _response.rawResponse,
363
- });
364
- case "timeout":
365
- throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/workspaces/{workspace_id}/projects.");
366
- case "unknown":
367
- throw new errors.FrameioError({
368
- message: _response.error.errorMessage,
351
+ body: _response.error.body,
369
352
  rawResponse: _response.rawResponse,
370
353
  });
371
354
  }
372
- }));
373
- const dataWithRawResponse = yield list(request).withRawResponse();
374
- return new core.Pageable({
375
- response: dataWithRawResponse.data,
376
- rawResponse: dataWithRawResponse.rawResponse,
377
- hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.links.next) != null &&
378
- !(typeof (response === null || response === void 0 ? void 0 : response.links.next) === "string" && (response === null || response === void 0 ? void 0 : response.links.next) === ""),
379
- getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.data) !== null && _a !== void 0 ? _a : []; },
380
- loadPage: (response) => {
381
- return list(core.setObjectProperty(request, "after", response === null || response === void 0 ? void 0 : response.links.next));
382
- },
383
- });
355
+ }
356
+ switch (_response.error.reason) {
357
+ case "non-json":
358
+ throw new errors.FrameioError({
359
+ statusCode: _response.error.statusCode,
360
+ body: _response.error.rawBody,
361
+ rawResponse: _response.rawResponse,
362
+ });
363
+ case "timeout":
364
+ throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/workspaces/{workspace_id}/projects.");
365
+ case "unknown":
366
+ throw new errors.FrameioError({
367
+ message: _response.error.errorMessage,
368
+ rawResponse: _response.rawResponse,
369
+ });
370
+ }
384
371
  });
385
372
  }
386
373
  /**
@@ -122,7 +122,8 @@ export declare class Shares {
122
122
  * include_total_count: false
123
123
  * })
124
124
  */
125
- listReviewers(accountId: Frameio.Uuid, shareId: Frameio.Uuid, request?: Frameio.SharesListReviewersRequest, requestOptions?: Shares.RequestOptions): Promise<core.Page<Frameio.User>>;
125
+ listReviewers(accountId: Frameio.Uuid, shareId: Frameio.Uuid, request?: Frameio.SharesListReviewersRequest, requestOptions?: Shares.RequestOptions): core.HttpResponsePromise<Frameio.ShareReviewersResponse>;
126
+ private __listReviewers;
126
127
  /**
127
128
  * Add reviewers to secure share by three identifier types: `adobe_user_id`, `email`, and `user_id`.
128
129
  * <br>
@@ -255,7 +256,8 @@ export declare class Shares {
255
256
  * include_total_count: false
256
257
  * })
257
258
  */
258
- index(accountId: Frameio.Uuid, projectId: Frameio.Uuid, request?: Frameio.SharesIndexRequest, requestOptions?: Shares.RequestOptions): Promise<core.Page<Frameio.Share>>;
259
+ index(accountId: Frameio.Uuid, projectId: Frameio.Uuid, request?: Frameio.SharesIndexRequest, requestOptions?: Shares.RequestOptions): core.HttpResponsePromise<Frameio.SharesResponse>;
260
+ private __index;
259
261
  /**
260
262
  * Create share. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
261
263
  *
@@ -290,88 +290,75 @@ export class Shares {
290
290
  * include_total_count: false
291
291
  * })
292
292
  */
293
- listReviewers(accountId_1, shareId_1) {
293
+ listReviewers(accountId, shareId, request = {}, requestOptions) {
294
+ return core.HttpResponsePromise.fromPromise(this.__listReviewers(accountId, shareId, request, requestOptions));
295
+ }
296
+ __listReviewers(accountId_1, shareId_1) {
294
297
  return __awaiter(this, arguments, void 0, function* (accountId, shareId, request = {}, requestOptions) {
295
- const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
296
- var _a, _b, _c;
297
- const { after, page_size: pageSize, include_total_count: includeTotalCount } = request;
298
- const _queryParams = {};
299
- if (after != null) {
300
- _queryParams["after"] = after;
301
- }
302
- if (pageSize != null) {
303
- _queryParams["page_size"] = pageSize.toString();
304
- }
305
- if (includeTotalCount != null) {
306
- _queryParams["include_total_count"] = includeTotalCount.toString();
307
- }
308
- let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
309
- const _response = yield core.fetcher({
310
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FrameioEnvironment.Default, `v4/accounts/${encodeURIComponent(accountId)}/shares/${encodeURIComponent(shareId)}/reviewers`),
311
- method: "GET",
312
- headers: _headers,
313
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
314
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
315
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
316
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
317
- });
318
- if (_response.ok) {
319
- return {
320
- data: _response.body,
321
- rawResponse: _response.rawResponse,
322
- };
323
- }
324
- if (_response.error.reason === "status-code") {
325
- switch (_response.error.statusCode) {
326
- case 400:
327
- throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
328
- case 401:
329
- throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
330
- case 403:
331
- throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
332
- case 404:
333
- throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
334
- case 409:
335
- throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
336
- case 422:
337
- throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
338
- case 429:
339
- throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
340
- default:
341
- throw new errors.FrameioError({
342
- statusCode: _response.error.statusCode,
343
- body: _response.error.body,
344
- rawResponse: _response.rawResponse,
345
- });
346
- }
347
- }
348
- switch (_response.error.reason) {
349
- case "non-json":
298
+ var _a, _b, _c;
299
+ const { after, page_size: pageSize, include_total_count: includeTotalCount } = request;
300
+ const _queryParams = {};
301
+ if (after != null) {
302
+ _queryParams["after"] = after;
303
+ }
304
+ if (pageSize != null) {
305
+ _queryParams["page_size"] = pageSize.toString();
306
+ }
307
+ if (includeTotalCount != null) {
308
+ _queryParams["include_total_count"] = includeTotalCount.toString();
309
+ }
310
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
311
+ const _response = yield core.fetcher({
312
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FrameioEnvironment.Default, `v4/accounts/${encodeURIComponent(accountId)}/shares/${encodeURIComponent(shareId)}/reviewers`),
313
+ method: "GET",
314
+ headers: _headers,
315
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
316
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
317
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
318
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
319
+ });
320
+ if (_response.ok) {
321
+ return { data: _response.body, rawResponse: _response.rawResponse };
322
+ }
323
+ if (_response.error.reason === "status-code") {
324
+ switch (_response.error.statusCode) {
325
+ case 400:
326
+ throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
327
+ case 401:
328
+ throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
329
+ case 403:
330
+ throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
331
+ case 404:
332
+ throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
333
+ case 409:
334
+ throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
335
+ case 422:
336
+ throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
337
+ case 429:
338
+ throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
339
+ default:
350
340
  throw new errors.FrameioError({
351
341
  statusCode: _response.error.statusCode,
352
- body: _response.error.rawBody,
353
- rawResponse: _response.rawResponse,
354
- });
355
- case "timeout":
356
- throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/shares/{share_id}/reviewers.");
357
- case "unknown":
358
- throw new errors.FrameioError({
359
- message: _response.error.errorMessage,
342
+ body: _response.error.body,
360
343
  rawResponse: _response.rawResponse,
361
344
  });
362
345
  }
363
- }));
364
- const dataWithRawResponse = yield list(request).withRawResponse();
365
- return new core.Pageable({
366
- response: dataWithRawResponse.data,
367
- rawResponse: dataWithRawResponse.rawResponse,
368
- hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.links.next) != null &&
369
- !(typeof (response === null || response === void 0 ? void 0 : response.links.next) === "string" && (response === null || response === void 0 ? void 0 : response.links.next) === ""),
370
- getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.data) !== null && _a !== void 0 ? _a : []; },
371
- loadPage: (response) => {
372
- return list(core.setObjectProperty(request, "after", response === null || response === void 0 ? void 0 : response.links.next));
373
- },
374
- });
346
+ }
347
+ switch (_response.error.reason) {
348
+ case "non-json":
349
+ throw new errors.FrameioError({
350
+ statusCode: _response.error.statusCode,
351
+ body: _response.error.rawBody,
352
+ rawResponse: _response.rawResponse,
353
+ });
354
+ case "timeout":
355
+ throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/shares/{share_id}/reviewers.");
356
+ case "unknown":
357
+ throw new errors.FrameioError({
358
+ message: _response.error.errorMessage,
359
+ rawResponse: _response.rawResponse,
360
+ });
361
+ }
375
362
  });
376
363
  }
377
364
  /**
@@ -747,85 +734,75 @@ export class Shares {
747
734
  * include_total_count: false
748
735
  * })
749
736
  */
750
- index(accountId_1, projectId_1) {
737
+ index(accountId, projectId, request = {}, requestOptions) {
738
+ return core.HttpResponsePromise.fromPromise(this.__index(accountId, projectId, request, requestOptions));
739
+ }
740
+ __index(accountId_1, projectId_1) {
751
741
  return __awaiter(this, arguments, void 0, function* (accountId, projectId, request = {}, requestOptions) {
752
- const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
753
- var _a, _b, _c;
754
- const { after, page_size: pageSize, include_total_count: includeTotalCount } = request;
755
- const _queryParams = {};
756
- if (after != null) {
757
- _queryParams["after"] = after;
758
- }
759
- if (pageSize != null) {
760
- _queryParams["page_size"] = pageSize.toString();
761
- }
762
- if (includeTotalCount != null) {
763
- _queryParams["include_total_count"] = includeTotalCount.toString();
764
- }
765
- let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
766
- const _response = yield core.fetcher({
767
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FrameioEnvironment.Default, `v4/accounts/${encodeURIComponent(accountId)}/projects/${encodeURIComponent(projectId)}/shares`),
768
- method: "GET",
769
- headers: _headers,
770
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
771
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
772
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
773
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
774
- });
775
- if (_response.ok) {
776
- return { data: _response.body, rawResponse: _response.rawResponse };
777
- }
778
- if (_response.error.reason === "status-code") {
779
- switch (_response.error.statusCode) {
780
- case 400:
781
- throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
782
- case 401:
783
- throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
784
- case 403:
785
- throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
786
- case 404:
787
- throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
788
- case 409:
789
- throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
790
- case 422:
791
- throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
792
- case 429:
793
- throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
794
- default:
795
- throw new errors.FrameioError({
796
- statusCode: _response.error.statusCode,
797
- body: _response.error.body,
798
- rawResponse: _response.rawResponse,
799
- });
800
- }
801
- }
802
- switch (_response.error.reason) {
803
- case "non-json":
742
+ var _a, _b, _c;
743
+ const { after, page_size: pageSize, include_total_count: includeTotalCount } = request;
744
+ const _queryParams = {};
745
+ if (after != null) {
746
+ _queryParams["after"] = after;
747
+ }
748
+ if (pageSize != null) {
749
+ _queryParams["page_size"] = pageSize.toString();
750
+ }
751
+ if (includeTotalCount != null) {
752
+ _queryParams["include_total_count"] = includeTotalCount.toString();
753
+ }
754
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
755
+ const _response = yield core.fetcher({
756
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FrameioEnvironment.Default, `v4/accounts/${encodeURIComponent(accountId)}/projects/${encodeURIComponent(projectId)}/shares`),
757
+ method: "GET",
758
+ headers: _headers,
759
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
760
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
761
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
762
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
763
+ });
764
+ if (_response.ok) {
765
+ return { data: _response.body, rawResponse: _response.rawResponse };
766
+ }
767
+ if (_response.error.reason === "status-code") {
768
+ switch (_response.error.statusCode) {
769
+ case 400:
770
+ throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
771
+ case 401:
772
+ throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
773
+ case 403:
774
+ throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
775
+ case 404:
776
+ throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
777
+ case 409:
778
+ throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
779
+ case 422:
780
+ throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
781
+ case 429:
782
+ throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
783
+ default:
804
784
  throw new errors.FrameioError({
805
785
  statusCode: _response.error.statusCode,
806
- body: _response.error.rawBody,
807
- rawResponse: _response.rawResponse,
808
- });
809
- case "timeout":
810
- throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/projects/{project_id}/shares.");
811
- case "unknown":
812
- throw new errors.FrameioError({
813
- message: _response.error.errorMessage,
786
+ body: _response.error.body,
814
787
  rawResponse: _response.rawResponse,
815
788
  });
816
789
  }
817
- }));
818
- const dataWithRawResponse = yield list(request).withRawResponse();
819
- return new core.Pageable({
820
- response: dataWithRawResponse.data,
821
- rawResponse: dataWithRawResponse.rawResponse,
822
- hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.links.next) != null &&
823
- !(typeof (response === null || response === void 0 ? void 0 : response.links.next) === "string" && (response === null || response === void 0 ? void 0 : response.links.next) === ""),
824
- getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.data) !== null && _a !== void 0 ? _a : []; },
825
- loadPage: (response) => {
826
- return list(core.setObjectProperty(request, "after", response === null || response === void 0 ? void 0 : response.links.next));
827
- },
828
- });
790
+ }
791
+ switch (_response.error.reason) {
792
+ case "non-json":
793
+ throw new errors.FrameioError({
794
+ statusCode: _response.error.statusCode,
795
+ body: _response.error.rawBody,
796
+ rawResponse: _response.rawResponse,
797
+ });
798
+ case "timeout":
799
+ throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/projects/{project_id}/shares.");
800
+ case "unknown":
801
+ throw new errors.FrameioError({
802
+ message: _response.error.errorMessage,
803
+ rawResponse: _response.rawResponse,
804
+ });
805
+ }
829
806
  });
830
807
  }
831
808
  /**
@@ -53,7 +53,8 @@ export declare class Webhooks {
53
53
  * include_total_count: false
54
54
  * })
55
55
  */
56
- index(accountId: Frameio.Uuid, workspaceId: Frameio.Uuid, request?: Frameio.WebhooksIndexRequest, requestOptions?: Webhooks.RequestOptions): Promise<core.Page<Frameio.WebhookWithIncludes>>;
56
+ index(accountId: Frameio.Uuid, workspaceId: Frameio.Uuid, request?: Frameio.WebhooksIndexRequest, requestOptions?: Webhooks.RequestOptions): core.HttpResponsePromise<Frameio.WebhooksWithIncludesResponse>;
57
+ private __index;
57
58
  /**
58
59
  * Creates a single webhook with secret.<br/><br/>Valid events:<p><code>
59
60
  * file.created, file.deleted, file.ready, file.updated, file.upload.completed, file.versioned, file.copied, folder.created, folder.deleted, folder.updated, folder.copied, comment.completed, comment.created, comment.deleted, comment.uncompleted, comment.updated, customfield.created, customfield.updated, customfield.deleted, metadata.value.updated, project.created, project.deleted, project.updated, collection.created, collection.updated, collection.deleted, share.created, share.updated, share.deleted, share.viewed