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
@@ -326,88 +326,75 @@ class Shares {
326
326
  * include_total_count: false
327
327
  * })
328
328
  */
329
- listReviewers(accountId_1, shareId_1) {
329
+ listReviewers(accountId, shareId, request = {}, requestOptions) {
330
+ return core.HttpResponsePromise.fromPromise(this.__listReviewers(accountId, shareId, request, requestOptions));
331
+ }
332
+ __listReviewers(accountId_1, shareId_1) {
330
333
  return __awaiter(this, arguments, void 0, function* (accountId, shareId, request = {}, requestOptions) {
331
- const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
332
- var _a, _b, _c;
333
- const { after, page_size: pageSize, include_total_count: includeTotalCount } = request;
334
- const _queryParams = {};
335
- if (after != null) {
336
- _queryParams["after"] = after;
337
- }
338
- if (pageSize != null) {
339
- _queryParams["page_size"] = pageSize.toString();
340
- }
341
- if (includeTotalCount != null) {
342
- _queryParams["include_total_count"] = includeTotalCount.toString();
343
- }
344
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
345
- const _response = yield core.fetcher({
346
- 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`),
347
- method: "GET",
348
- headers: _headers,
349
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
350
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
351
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
352
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
353
- });
354
- if (_response.ok) {
355
- return {
356
- data: _response.body,
357
- rawResponse: _response.rawResponse,
358
- };
359
- }
360
- if (_response.error.reason === "status-code") {
361
- switch (_response.error.statusCode) {
362
- case 400:
363
- throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
364
- case 401:
365
- throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
366
- case 403:
367
- throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
368
- case 404:
369
- throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
370
- case 409:
371
- throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
372
- case 422:
373
- throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
374
- case 429:
375
- throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
376
- default:
377
- throw new errors.FrameioError({
378
- statusCode: _response.error.statusCode,
379
- body: _response.error.body,
380
- rawResponse: _response.rawResponse,
381
- });
382
- }
383
- }
384
- switch (_response.error.reason) {
385
- case "non-json":
334
+ var _a, _b, _c;
335
+ const { after, page_size: pageSize, include_total_count: includeTotalCount } = request;
336
+ const _queryParams = {};
337
+ if (after != null) {
338
+ _queryParams["after"] = after;
339
+ }
340
+ if (pageSize != null) {
341
+ _queryParams["page_size"] = pageSize.toString();
342
+ }
343
+ if (includeTotalCount != null) {
344
+ _queryParams["include_total_count"] = includeTotalCount.toString();
345
+ }
346
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
347
+ const _response = yield core.fetcher({
348
+ 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`),
349
+ method: "GET",
350
+ headers: _headers,
351
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
352
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
353
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
354
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
355
+ });
356
+ if (_response.ok) {
357
+ return { data: _response.body, rawResponse: _response.rawResponse };
358
+ }
359
+ if (_response.error.reason === "status-code") {
360
+ switch (_response.error.statusCode) {
361
+ case 400:
362
+ throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
363
+ case 401:
364
+ throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
365
+ case 403:
366
+ throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
367
+ case 404:
368
+ throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
369
+ case 409:
370
+ throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
371
+ case 422:
372
+ throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
373
+ case 429:
374
+ throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
375
+ default:
386
376
  throw new errors.FrameioError({
387
377
  statusCode: _response.error.statusCode,
388
- body: _response.error.rawBody,
389
- rawResponse: _response.rawResponse,
390
- });
391
- case "timeout":
392
- throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/shares/{share_id}/reviewers.");
393
- case "unknown":
394
- throw new errors.FrameioError({
395
- message: _response.error.errorMessage,
378
+ body: _response.error.body,
396
379
  rawResponse: _response.rawResponse,
397
380
  });
398
381
  }
399
- }));
400
- const dataWithRawResponse = yield list(request).withRawResponse();
401
- return new core.Pageable({
402
- response: dataWithRawResponse.data,
403
- rawResponse: dataWithRawResponse.rawResponse,
404
- hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.links.next) != null &&
405
- !(typeof (response === null || response === void 0 ? void 0 : response.links.next) === "string" && (response === null || response === void 0 ? void 0 : response.links.next) === ""),
406
- getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.data) !== null && _a !== void 0 ? _a : []; },
407
- loadPage: (response) => {
408
- return list(core.setObjectProperty(request, "after", response === null || response === void 0 ? void 0 : response.links.next));
409
- },
410
- });
382
+ }
383
+ switch (_response.error.reason) {
384
+ case "non-json":
385
+ throw new errors.FrameioError({
386
+ statusCode: _response.error.statusCode,
387
+ body: _response.error.rawBody,
388
+ rawResponse: _response.rawResponse,
389
+ });
390
+ case "timeout":
391
+ throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/shares/{share_id}/reviewers.");
392
+ case "unknown":
393
+ throw new errors.FrameioError({
394
+ message: _response.error.errorMessage,
395
+ rawResponse: _response.rawResponse,
396
+ });
397
+ }
411
398
  });
412
399
  }
413
400
  /**
@@ -783,85 +770,75 @@ class Shares {
783
770
  * include_total_count: false
784
771
  * })
785
772
  */
786
- index(accountId_1, projectId_1) {
773
+ index(accountId, projectId, request = {}, requestOptions) {
774
+ return core.HttpResponsePromise.fromPromise(this.__index(accountId, projectId, request, requestOptions));
775
+ }
776
+ __index(accountId_1, projectId_1) {
787
777
  return __awaiter(this, arguments, void 0, function* (accountId, projectId, request = {}, requestOptions) {
788
- const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
789
- var _a, _b, _c;
790
- const { after, page_size: pageSize, include_total_count: includeTotalCount } = request;
791
- const _queryParams = {};
792
- if (after != null) {
793
- _queryParams["after"] = after;
794
- }
795
- if (pageSize != null) {
796
- _queryParams["page_size"] = pageSize.toString();
797
- }
798
- if (includeTotalCount != null) {
799
- _queryParams["include_total_count"] = includeTotalCount.toString();
800
- }
801
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
802
- const _response = yield core.fetcher({
803
- 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`),
804
- method: "GET",
805
- headers: _headers,
806
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
807
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
808
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
809
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
810
- });
811
- if (_response.ok) {
812
- return { data: _response.body, rawResponse: _response.rawResponse };
813
- }
814
- if (_response.error.reason === "status-code") {
815
- switch (_response.error.statusCode) {
816
- case 400:
817
- throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
818
- case 401:
819
- throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
820
- case 403:
821
- throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
822
- case 404:
823
- throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
824
- case 409:
825
- throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
826
- case 422:
827
- throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
828
- case 429:
829
- throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
830
- default:
831
- throw new errors.FrameioError({
832
- statusCode: _response.error.statusCode,
833
- body: _response.error.body,
834
- rawResponse: _response.rawResponse,
835
- });
836
- }
837
- }
838
- switch (_response.error.reason) {
839
- case "non-json":
778
+ var _a, _b, _c;
779
+ const { after, page_size: pageSize, include_total_count: includeTotalCount } = request;
780
+ const _queryParams = {};
781
+ if (after != null) {
782
+ _queryParams["after"] = after;
783
+ }
784
+ if (pageSize != null) {
785
+ _queryParams["page_size"] = pageSize.toString();
786
+ }
787
+ if (includeTotalCount != null) {
788
+ _queryParams["include_total_count"] = includeTotalCount.toString();
789
+ }
790
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
791
+ const _response = yield core.fetcher({
792
+ 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`),
793
+ method: "GET",
794
+ headers: _headers,
795
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
796
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
797
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
798
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
799
+ });
800
+ if (_response.ok) {
801
+ return { data: _response.body, rawResponse: _response.rawResponse };
802
+ }
803
+ if (_response.error.reason === "status-code") {
804
+ switch (_response.error.statusCode) {
805
+ case 400:
806
+ throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
807
+ case 401:
808
+ throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
809
+ case 403:
810
+ throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
811
+ case 404:
812
+ throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
813
+ case 409:
814
+ throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
815
+ case 422:
816
+ throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
817
+ case 429:
818
+ throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
819
+ default:
840
820
  throw new errors.FrameioError({
841
821
  statusCode: _response.error.statusCode,
842
- body: _response.error.rawBody,
843
- rawResponse: _response.rawResponse,
844
- });
845
- case "timeout":
846
- throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/projects/{project_id}/shares.");
847
- case "unknown":
848
- throw new errors.FrameioError({
849
- message: _response.error.errorMessage,
822
+ body: _response.error.body,
850
823
  rawResponse: _response.rawResponse,
851
824
  });
852
825
  }
853
- }));
854
- const dataWithRawResponse = yield list(request).withRawResponse();
855
- return new core.Pageable({
856
- response: dataWithRawResponse.data,
857
- rawResponse: dataWithRawResponse.rawResponse,
858
- hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.links.next) != null &&
859
- !(typeof (response === null || response === void 0 ? void 0 : response.links.next) === "string" && (response === null || response === void 0 ? void 0 : response.links.next) === ""),
860
- getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.data) !== null && _a !== void 0 ? _a : []; },
861
- loadPage: (response) => {
862
- return list(core.setObjectProperty(request, "after", response === null || response === void 0 ? void 0 : response.links.next));
863
- },
864
- });
826
+ }
827
+ switch (_response.error.reason) {
828
+ case "non-json":
829
+ throw new errors.FrameioError({
830
+ statusCode: _response.error.statusCode,
831
+ body: _response.error.rawBody,
832
+ rawResponse: _response.rawResponse,
833
+ });
834
+ case "timeout":
835
+ throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/projects/{project_id}/shares.");
836
+ case "unknown":
837
+ throw new errors.FrameioError({
838
+ message: _response.error.errorMessage,
839
+ rawResponse: _response.rawResponse,
840
+ });
841
+ }
865
842
  });
866
843
  }
867
844
  /**
@@ -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
@@ -80,91 +80,78 @@ class Webhooks {
80
80
  * include_total_count: false
81
81
  * })
82
82
  */
83
- index(accountId_1, workspaceId_1) {
83
+ index(accountId, workspaceId, request = {}, requestOptions) {
84
+ return core.HttpResponsePromise.fromPromise(this.__index(accountId, workspaceId, request, requestOptions));
85
+ }
86
+ __index(accountId_1, workspaceId_1) {
84
87
  return __awaiter(this, arguments, void 0, function* (accountId, workspaceId, request = {}, requestOptions) {
85
- const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
86
- var _a, _b, _c;
87
- const { include, after, page_size: pageSize, include_total_count: includeTotalCount } = request;
88
- const _queryParams = {};
89
- if (include != null) {
90
- _queryParams["include"] = include;
91
- }
92
- if (after != null) {
93
- _queryParams["after"] = after;
94
- }
95
- if (pageSize != null) {
96
- _queryParams["page_size"] = pageSize.toString();
97
- }
98
- if (includeTotalCount != null) {
99
- _queryParams["include_total_count"] = includeTotalCount.toString();
100
- }
101
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
102
- const _response = yield core.fetcher({
103
- 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)}/webhooks`),
104
- method: "GET",
105
- headers: _headers,
106
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
107
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
108
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
109
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
110
- });
111
- if (_response.ok) {
112
- return {
113
- data: _response.body,
114
- rawResponse: _response.rawResponse,
115
- };
116
- }
117
- if (_response.error.reason === "status-code") {
118
- switch (_response.error.statusCode) {
119
- case 400:
120
- throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
121
- case 401:
122
- throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
123
- case 403:
124
- throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
125
- case 404:
126
- throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
127
- case 409:
128
- throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
129
- case 422:
130
- throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
131
- case 429:
132
- throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
133
- default:
134
- throw new errors.FrameioError({
135
- statusCode: _response.error.statusCode,
136
- body: _response.error.body,
137
- rawResponse: _response.rawResponse,
138
- });
139
- }
140
- }
141
- switch (_response.error.reason) {
142
- case "non-json":
88
+ var _a, _b, _c;
89
+ const { include, after, page_size: pageSize, include_total_count: includeTotalCount } = request;
90
+ const _queryParams = {};
91
+ if (include != null) {
92
+ _queryParams["include"] = include;
93
+ }
94
+ if (after != null) {
95
+ _queryParams["after"] = after;
96
+ }
97
+ if (pageSize != null) {
98
+ _queryParams["page_size"] = pageSize.toString();
99
+ }
100
+ if (includeTotalCount != null) {
101
+ _queryParams["include_total_count"] = includeTotalCount.toString();
102
+ }
103
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
104
+ const _response = yield core.fetcher({
105
+ 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)}/webhooks`),
106
+ method: "GET",
107
+ headers: _headers,
108
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
109
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
110
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
111
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
112
+ });
113
+ if (_response.ok) {
114
+ return { data: _response.body, rawResponse: _response.rawResponse };
115
+ }
116
+ if (_response.error.reason === "status-code") {
117
+ switch (_response.error.statusCode) {
118
+ case 400:
119
+ throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
120
+ case 401:
121
+ throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
122
+ case 403:
123
+ throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
124
+ case 404:
125
+ throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
126
+ case 409:
127
+ throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
128
+ case 422:
129
+ throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
130
+ case 429:
131
+ throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
132
+ default:
143
133
  throw new errors.FrameioError({
144
134
  statusCode: _response.error.statusCode,
145
- body: _response.error.rawBody,
146
- rawResponse: _response.rawResponse,
147
- });
148
- case "timeout":
149
- throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/workspaces/{workspace_id}/webhooks.");
150
- case "unknown":
151
- throw new errors.FrameioError({
152
- message: _response.error.errorMessage,
135
+ body: _response.error.body,
153
136
  rawResponse: _response.rawResponse,
154
137
  });
155
138
  }
156
- }));
157
- const dataWithRawResponse = yield list(request).withRawResponse();
158
- return new core.Pageable({
159
- response: dataWithRawResponse.data,
160
- rawResponse: dataWithRawResponse.rawResponse,
161
- hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.links.next) != null &&
162
- !(typeof (response === null || response === void 0 ? void 0 : response.links.next) === "string" && (response === null || response === void 0 ? void 0 : response.links.next) === ""),
163
- getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.data) !== null && _a !== void 0 ? _a : []; },
164
- loadPage: (response) => {
165
- return list(core.setObjectProperty(request, "after", response === null || response === void 0 ? void 0 : response.links.next));
166
- },
167
- });
139
+ }
140
+ switch (_response.error.reason) {
141
+ case "non-json":
142
+ throw new errors.FrameioError({
143
+ statusCode: _response.error.statusCode,
144
+ body: _response.error.rawBody,
145
+ rawResponse: _response.rawResponse,
146
+ });
147
+ case "timeout":
148
+ throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/workspaces/{workspace_id}/webhooks.");
149
+ case "unknown":
150
+ throw new errors.FrameioError({
151
+ message: _response.error.errorMessage,
152
+ rawResponse: _response.rawResponse,
153
+ });
154
+ }
168
155
  });
169
156
  }
170
157
  /**
@@ -53,7 +53,8 @@ export declare class WorkspacePermissions {
53
53
  * include_total_count: false
54
54
  * })
55
55
  */
56
- index(accountId: Frameio.Uuid, workspaceId: Frameio.Uuid, request?: Frameio.WorkspacePermissionsIndexRequest, requestOptions?: WorkspacePermissions.RequestOptions): Promise<core.Page<Frameio.UserRole>>;
56
+ index(accountId: Frameio.Uuid, workspaceId: Frameio.Uuid, request?: Frameio.WorkspacePermissionsIndexRequest, requestOptions?: WorkspacePermissions.RequestOptions): core.HttpResponsePromise<Frameio.WorkspaceUserRolesResponse>;
57
+ private __index;
57
58
  /**
58
59
  * Remove a user from a given workspace. <br>Rate Limits: 60 calls per 1.00 minute(s) per account_user
59
60
  *