frameio 1.2.2 → 1.3.0
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.
- package/dist/cjs/Client.d.ts +1 -0
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/accountPermissions/client/Client.d.ts +3 -1
- package/dist/cjs/api/resources/accountPermissions/client/Client.js +66 -79
- package/dist/cjs/api/resources/accounts/client/Client.d.ts +3 -1
- package/dist/cjs/api/resources/accounts/client/Client.js +66 -76
- package/dist/cjs/api/resources/comments/client/Client.d.ts +3 -1
- package/dist/cjs/api/resources/comments/client/Client.js +81 -94
- package/dist/cjs/api/resources/files/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/files/client/Client.js +30 -30
- package/dist/cjs/api/resources/folders/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/folders/client/Client.js +24 -24
- package/dist/cjs/api/resources/metadata/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/metadata/client/Client.js +6 -6
- package/dist/cjs/api/resources/metadataFields/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/metadataFields/client/Client.js +12 -12
- package/dist/cjs/api/resources/projectPermissions/client/Client.d.ts +3 -1
- package/dist/cjs/api/resources/projectPermissions/client/Client.js +72 -85
- package/dist/cjs/api/resources/projects/client/Client.d.ts +3 -1
- package/dist/cjs/api/resources/projects/client/Client.js +78 -91
- package/dist/cjs/api/resources/shares/client/Client.d.ts +5 -2
- package/dist/cjs/api/resources/shares/client/Client.js +150 -173
- package/dist/cjs/api/resources/users/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/users/client/Client.js +3 -3
- package/dist/cjs/api/resources/versionStacks/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/versionStacks/client/Client.js +18 -18
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +3 -1
- package/dist/cjs/api/resources/webhooks/client/Client.js +78 -91
- package/dist/cjs/api/resources/workspacePermissions/client/Client.d.ts +3 -1
- package/dist/cjs/api/resources/workspacePermissions/client/Client.js +72 -85
- package/dist/cjs/api/resources/workspaces/client/Client.d.ts +3 -1
- package/dist/cjs/api/resources/workspaces/client/Client.js +81 -91
- package/dist/cjs/core/index.d.ts +0 -2
- package/dist/cjs/core/index.js +0 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +1 -0
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/accountPermissions/client/Client.d.mts +3 -1
- package/dist/esm/api/resources/accountPermissions/client/Client.mjs +66 -79
- package/dist/esm/api/resources/accounts/client/Client.d.mts +3 -1
- package/dist/esm/api/resources/accounts/client/Client.mjs +66 -76
- package/dist/esm/api/resources/comments/client/Client.d.mts +3 -1
- package/dist/esm/api/resources/comments/client/Client.mjs +81 -94
- package/dist/esm/api/resources/files/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/files/client/Client.mjs +30 -30
- package/dist/esm/api/resources/folders/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/folders/client/Client.mjs +24 -24
- package/dist/esm/api/resources/metadata/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/metadata/client/Client.mjs +6 -6
- package/dist/esm/api/resources/metadataFields/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/metadataFields/client/Client.mjs +12 -12
- package/dist/esm/api/resources/projectPermissions/client/Client.d.mts +3 -1
- package/dist/esm/api/resources/projectPermissions/client/Client.mjs +72 -85
- package/dist/esm/api/resources/projects/client/Client.d.mts +3 -1
- package/dist/esm/api/resources/projects/client/Client.mjs +78 -91
- package/dist/esm/api/resources/shares/client/Client.d.mts +5 -2
- package/dist/esm/api/resources/shares/client/Client.mjs +150 -173
- package/dist/esm/api/resources/users/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/users/client/Client.mjs +3 -3
- package/dist/esm/api/resources/versionStacks/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/versionStacks/client/Client.mjs +18 -18
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +3 -1
- package/dist/esm/api/resources/webhooks/client/Client.mjs +78 -91
- package/dist/esm/api/resources/workspacePermissions/client/Client.d.mts +3 -1
- package/dist/esm/api/resources/workspacePermissions/client/Client.mjs +72 -85
- package/dist/esm/api/resources/workspaces/client/Client.d.mts +3 -1
- package/dist/esm/api/resources/workspaces/client/Client.mjs +81 -91
- package/dist/esm/core/index.d.mts +0 -2
- package/dist/esm/core/index.mjs +0 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +29 -203
- package/dist/cjs/core/pagination/Page.d.ts +0 -32
- package/dist/cjs/core/pagination/Page.js +0 -100
- package/dist/cjs/core/pagination/Pageable.d.ts +0 -14
- package/dist/cjs/core/pagination/Pageable.js +0 -10
- package/dist/cjs/core/pagination/index.d.ts +0 -2
- package/dist/cjs/core/pagination/index.js +0 -7
- package/dist/cjs/core/utils/index.d.ts +0 -1
- package/dist/cjs/core/utils/index.js +0 -5
- package/dist/cjs/core/utils/setObjectProperty.d.ts +0 -11
- package/dist/cjs/core/utils/setObjectProperty.js +0 -42
- package/dist/esm/core/pagination/Page.d.mts +0 -32
- package/dist/esm/core/pagination/Page.mjs +0 -96
- package/dist/esm/core/pagination/Pageable.d.mts +0 -14
- package/dist/esm/core/pagination/Pageable.mjs +0 -6
- package/dist/esm/core/pagination/index.d.mts +0 -2
- package/dist/esm/core/pagination/index.mjs +0 -2
- package/dist/esm/core/utils/index.d.mts +0 -1
- package/dist/esm/core/utils/index.mjs +0 -1
- package/dist/esm/core/utils/setObjectProperty.d.mts +0 -11
- package/dist/esm/core/utils/setObjectProperty.mjs +0 -39
|
@@ -82,15 +82,15 @@ class Workspaces {
|
|
|
82
82
|
}
|
|
83
83
|
__show(accountId_1, workspaceId_1) {
|
|
84
84
|
return __awaiter(this, arguments, void 0, function* (accountId, workspaceId, request = {}, requestOptions) {
|
|
85
|
-
var _a, _b, _c;
|
|
85
|
+
var _a, _b, _c, _d;
|
|
86
86
|
const { include } = request;
|
|
87
87
|
const _queryParams = {};
|
|
88
88
|
if (include != null) {
|
|
89
89
|
_queryParams["include"] = include;
|
|
90
90
|
}
|
|
91
91
|
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);
|
|
92
|
-
const _response = yield core.fetcher({
|
|
93
|
-
url: core.url.join((
|
|
92
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
93
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.FrameioEnvironment.Default, `v4/accounts/${encodeURIComponent(accountId)}/workspaces/${encodeURIComponent(workspaceId)}`),
|
|
94
94
|
method: "GET",
|
|
95
95
|
headers: _headers,
|
|
96
96
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -168,10 +168,10 @@ class Workspaces {
|
|
|
168
168
|
}
|
|
169
169
|
__delete(accountId, workspaceId, requestOptions) {
|
|
170
170
|
return __awaiter(this, void 0, void 0, function* () {
|
|
171
|
-
var _a, _b, _c;
|
|
171
|
+
var _a, _b, _c, _d;
|
|
172
172
|
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);
|
|
173
|
-
const _response = yield core.fetcher({
|
|
174
|
-
url: core.url.join((
|
|
173
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
174
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.FrameioEnvironment.Default, `v4/accounts/${encodeURIComponent(accountId)}/workspaces/${encodeURIComponent(workspaceId)}`),
|
|
175
175
|
method: "DELETE",
|
|
176
176
|
headers: _headers,
|
|
177
177
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -251,10 +251,10 @@ class Workspaces {
|
|
|
251
251
|
}
|
|
252
252
|
__update(accountId, workspaceId, request, requestOptions) {
|
|
253
253
|
return __awaiter(this, void 0, void 0, function* () {
|
|
254
|
-
var _a, _b, _c;
|
|
254
|
+
var _a, _b, _c, _d;
|
|
255
255
|
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);
|
|
256
|
-
const _response = yield core.fetcher({
|
|
257
|
-
url: core.url.join((
|
|
256
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
257
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.FrameioEnvironment.Default, `v4/accounts/${encodeURIComponent(accountId)}/workspaces/${encodeURIComponent(workspaceId)}`),
|
|
258
258
|
method: "PATCH",
|
|
259
259
|
headers: _headers,
|
|
260
260
|
contentType: "application/json",
|
|
@@ -332,91 +332,81 @@ class Workspaces {
|
|
|
332
332
|
* include_total_count: false
|
|
333
333
|
* })
|
|
334
334
|
*/
|
|
335
|
-
index(
|
|
335
|
+
index(accountId, request = {}, requestOptions) {
|
|
336
|
+
return core.HttpResponsePromise.fromPromise(this.__index(accountId, request, requestOptions));
|
|
337
|
+
}
|
|
338
|
+
__index(accountId_1) {
|
|
336
339
|
return __awaiter(this, arguments, void 0, function* (accountId, request = {}, requestOptions) {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
default:
|
|
386
|
-
throw new errors.FrameioError({
|
|
387
|
-
statusCode: _response.error.statusCode,
|
|
388
|
-
body: _response.error.body,
|
|
389
|
-
rawResponse: _response.rawResponse,
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
switch (_response.error.reason) {
|
|
394
|
-
case "non-json":
|
|
340
|
+
var _a, _b, _c, _d;
|
|
341
|
+
const { include, after, page_size: pageSize, include_total_count: includeTotalCount } = request;
|
|
342
|
+
const _queryParams = {};
|
|
343
|
+
if (include != null) {
|
|
344
|
+
_queryParams["include"] = include;
|
|
345
|
+
}
|
|
346
|
+
if (after != null) {
|
|
347
|
+
_queryParams["after"] = after;
|
|
348
|
+
}
|
|
349
|
+
if (pageSize != null) {
|
|
350
|
+
_queryParams["page_size"] = pageSize.toString();
|
|
351
|
+
}
|
|
352
|
+
if (includeTotalCount != null) {
|
|
353
|
+
_queryParams["include_total_count"] = includeTotalCount.toString();
|
|
354
|
+
}
|
|
355
|
+
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);
|
|
356
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
357
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.FrameioEnvironment.Default, `v4/accounts/${encodeURIComponent(accountId)}/workspaces`),
|
|
358
|
+
method: "GET",
|
|
359
|
+
headers: _headers,
|
|
360
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
361
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
362
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
363
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
364
|
+
});
|
|
365
|
+
if (_response.ok) {
|
|
366
|
+
return {
|
|
367
|
+
data: _response.body,
|
|
368
|
+
rawResponse: _response.rawResponse,
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
if (_response.error.reason === "status-code") {
|
|
372
|
+
switch (_response.error.statusCode) {
|
|
373
|
+
case 400:
|
|
374
|
+
throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
|
|
375
|
+
case 401:
|
|
376
|
+
throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
377
|
+
case 403:
|
|
378
|
+
throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
379
|
+
case 404:
|
|
380
|
+
throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
|
|
381
|
+
case 409:
|
|
382
|
+
throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
|
|
383
|
+
case 422:
|
|
384
|
+
throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
385
|
+
case 429:
|
|
386
|
+
throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
387
|
+
default:
|
|
395
388
|
throw new errors.FrameioError({
|
|
396
389
|
statusCode: _response.error.statusCode,
|
|
397
|
-
body: _response.error.
|
|
398
|
-
rawResponse: _response.rawResponse,
|
|
399
|
-
});
|
|
400
|
-
case "timeout":
|
|
401
|
-
throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/workspaces.");
|
|
402
|
-
case "unknown":
|
|
403
|
-
throw new errors.FrameioError({
|
|
404
|
-
message: _response.error.errorMessage,
|
|
390
|
+
body: _response.error.body,
|
|
405
391
|
rawResponse: _response.rawResponse,
|
|
406
392
|
});
|
|
407
393
|
}
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
394
|
+
}
|
|
395
|
+
switch (_response.error.reason) {
|
|
396
|
+
case "non-json":
|
|
397
|
+
throw new errors.FrameioError({
|
|
398
|
+
statusCode: _response.error.statusCode,
|
|
399
|
+
body: _response.error.rawBody,
|
|
400
|
+
rawResponse: _response.rawResponse,
|
|
401
|
+
});
|
|
402
|
+
case "timeout":
|
|
403
|
+
throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/workspaces.");
|
|
404
|
+
case "unknown":
|
|
405
|
+
throw new errors.FrameioError({
|
|
406
|
+
message: _response.error.errorMessage,
|
|
407
|
+
rawResponse: _response.rawResponse,
|
|
408
|
+
});
|
|
409
|
+
}
|
|
420
410
|
});
|
|
421
411
|
}
|
|
422
412
|
/**
|
|
@@ -446,10 +436,10 @@ class Workspaces {
|
|
|
446
436
|
}
|
|
447
437
|
__create(accountId, request, requestOptions) {
|
|
448
438
|
return __awaiter(this, void 0, void 0, function* () {
|
|
449
|
-
var _a, _b, _c;
|
|
439
|
+
var _a, _b, _c, _d;
|
|
450
440
|
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);
|
|
451
|
-
const _response = yield core.fetcher({
|
|
452
|
-
url: core.url.join((
|
|
441
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
442
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.FrameioEnvironment.Default, `v4/accounts/${encodeURIComponent(accountId)}/workspaces`),
|
|
453
443
|
method: "POST",
|
|
454
444
|
headers: _headers,
|
|
455
445
|
contentType: "application/json",
|
package/dist/cjs/core/index.d.ts
CHANGED
package/dist/cjs/core/index.js
CHANGED
|
@@ -42,5 +42,3 @@ __exportStar(require("./runtime/index.js"), exports);
|
|
|
42
42
|
exports.url = __importStar(require("./url/index.js"));
|
|
43
43
|
__exportStar(require("./auth/index.js"), exports);
|
|
44
44
|
__exportStar(require("./base64.js"), exports);
|
|
45
|
-
__exportStar(require("./utils/index.js"), exports);
|
|
46
|
-
__exportStar(require("./pagination/index.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.3.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.d.mts
CHANGED
|
@@ -23,6 +23,7 @@ export declare namespace FrameioClient {
|
|
|
23
23
|
token: core.Supplier<core.BearerToken>;
|
|
24
24
|
/** Additional headers to include in requests. */
|
|
25
25
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
26
|
+
fetcher?: core.FetchFunction;
|
|
26
27
|
}
|
|
27
28
|
interface RequestOptions {
|
|
28
29
|
/** The maximum time to wait for a response in seconds. */
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -21,8 +21,8 @@ export class FrameioClient {
|
|
|
21
21
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
22
22
|
"X-Fern-Language": "JavaScript",
|
|
23
23
|
"X-Fern-SDK-Name": "frameio",
|
|
24
|
-
"X-Fern-SDK-Version": "1.
|
|
25
|
-
"User-Agent": "frameio/1.
|
|
24
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
25
|
+
"User-Agent": "frameio/1.3.0",
|
|
26
26
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
27
27
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
28
28
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -9,6 +9,7 @@ export declare namespace AccountPermissions {
|
|
|
9
9
|
token: core.Supplier<core.BearerToken>;
|
|
10
10
|
/** Additional headers to include in requests. */
|
|
11
11
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
12
|
+
fetcher?: core.FetchFunction;
|
|
12
13
|
}
|
|
13
14
|
interface RequestOptions {
|
|
14
15
|
/** The maximum time to wait for a response in seconds. */
|
|
@@ -52,6 +53,7 @@ export declare class AccountPermissions {
|
|
|
52
53
|
* include_total_count: false
|
|
53
54
|
* })
|
|
54
55
|
*/
|
|
55
|
-
index(accountId: Frameio.Uuid, request?: Frameio.AccountPermissionsIndexRequest, requestOptions?: AccountPermissions.RequestOptions):
|
|
56
|
+
index(accountId: Frameio.Uuid, request?: Frameio.AccountPermissionsIndexRequest, requestOptions?: AccountPermissions.RequestOptions): core.HttpResponsePromise<Frameio.AccountUserRolesResponse>;
|
|
57
|
+
private __index;
|
|
56
58
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
57
59
|
}
|
|
@@ -43,91 +43,78 @@ export class AccountPermissions {
|
|
|
43
43
|
* include_total_count: false
|
|
44
44
|
* })
|
|
45
45
|
*/
|
|
46
|
-
index(
|
|
46
|
+
index(accountId, request = {}, requestOptions) {
|
|
47
|
+
return core.HttpResponsePromise.fromPromise(this.__index(accountId, request, requestOptions));
|
|
48
|
+
}
|
|
49
|
+
__index(accountId_1) {
|
|
47
50
|
return __awaiter(this, arguments, void 0, function* (accountId, request = {}, requestOptions) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
94
|
-
case 429:
|
|
95
|
-
throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
96
|
-
default:
|
|
97
|
-
throw new errors.FrameioError({
|
|
98
|
-
statusCode: _response.error.statusCode,
|
|
99
|
-
body: _response.error.body,
|
|
100
|
-
rawResponse: _response.rawResponse,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
switch (_response.error.reason) {
|
|
105
|
-
case "non-json":
|
|
51
|
+
var _a, _b, _c, _d;
|
|
52
|
+
const { include_deactivated: includeDeactivated, after, page_size: pageSize, include_total_count: includeTotalCount, } = request;
|
|
53
|
+
const _queryParams = {};
|
|
54
|
+
if (includeDeactivated != null) {
|
|
55
|
+
_queryParams["include_deactivated"] = includeDeactivated.toString();
|
|
56
|
+
}
|
|
57
|
+
if (after != null) {
|
|
58
|
+
_queryParams["after"] = after;
|
|
59
|
+
}
|
|
60
|
+
if (pageSize != null) {
|
|
61
|
+
_queryParams["page_size"] = pageSize.toString();
|
|
62
|
+
}
|
|
63
|
+
if (includeTotalCount != null) {
|
|
64
|
+
_queryParams["include_total_count"] = includeTotalCount.toString();
|
|
65
|
+
}
|
|
66
|
+
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);
|
|
67
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
68
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.FrameioEnvironment.Default, `v4/accounts/${encodeURIComponent(accountId)}/users`),
|
|
69
|
+
method: "GET",
|
|
70
|
+
headers: _headers,
|
|
71
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
72
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
73
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
74
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
75
|
+
});
|
|
76
|
+
if (_response.ok) {
|
|
77
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
78
|
+
}
|
|
79
|
+
if (_response.error.reason === "status-code") {
|
|
80
|
+
switch (_response.error.statusCode) {
|
|
81
|
+
case 400:
|
|
82
|
+
throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
|
|
83
|
+
case 401:
|
|
84
|
+
throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
85
|
+
case 403:
|
|
86
|
+
throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
87
|
+
case 404:
|
|
88
|
+
throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
|
|
89
|
+
case 409:
|
|
90
|
+
throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
|
|
91
|
+
case 422:
|
|
92
|
+
throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
93
|
+
case 429:
|
|
94
|
+
throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
95
|
+
default:
|
|
106
96
|
throw new errors.FrameioError({
|
|
107
97
|
statusCode: _response.error.statusCode,
|
|
108
|
-
body: _response.error.
|
|
109
|
-
rawResponse: _response.rawResponse,
|
|
110
|
-
});
|
|
111
|
-
case "timeout":
|
|
112
|
-
throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/users.");
|
|
113
|
-
case "unknown":
|
|
114
|
-
throw new errors.FrameioError({
|
|
115
|
-
message: _response.error.errorMessage,
|
|
98
|
+
body: _response.error.body,
|
|
116
99
|
rawResponse: _response.rawResponse,
|
|
117
100
|
});
|
|
118
101
|
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
102
|
+
}
|
|
103
|
+
switch (_response.error.reason) {
|
|
104
|
+
case "non-json":
|
|
105
|
+
throw new errors.FrameioError({
|
|
106
|
+
statusCode: _response.error.statusCode,
|
|
107
|
+
body: _response.error.rawBody,
|
|
108
|
+
rawResponse: _response.rawResponse,
|
|
109
|
+
});
|
|
110
|
+
case "timeout":
|
|
111
|
+
throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/users.");
|
|
112
|
+
case "unknown":
|
|
113
|
+
throw new errors.FrameioError({
|
|
114
|
+
message: _response.error.errorMessage,
|
|
115
|
+
rawResponse: _response.rawResponse,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
131
118
|
});
|
|
132
119
|
}
|
|
133
120
|
_getAuthorizationHeader() {
|
|
@@ -9,6 +9,7 @@ export declare namespace Accounts {
|
|
|
9
9
|
token: core.Supplier<core.BearerToken>;
|
|
10
10
|
/** Additional headers to include in requests. */
|
|
11
11
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
12
|
+
fetcher?: core.FetchFunction;
|
|
12
13
|
}
|
|
13
14
|
interface RequestOptions {
|
|
14
15
|
/** The maximum time to wait for a response in seconds. */
|
|
@@ -50,7 +51,8 @@ export declare class Accounts {
|
|
|
50
51
|
* include_total_count: false
|
|
51
52
|
* })
|
|
52
53
|
*/
|
|
53
|
-
index(request?: Frameio.AccountsIndexRequest, requestOptions?: Accounts.RequestOptions):
|
|
54
|
+
index(request?: Frameio.AccountsIndexRequest, requestOptions?: Accounts.RequestOptions): core.HttpResponsePromise<Frameio.AccountsResponse>;
|
|
55
|
+
private __index;
|
|
54
56
|
/**
|
|
55
57
|
* List audit logs with filtering capabilities via query params. <br>Rate Limits: 100 calls per 1.00 minute(s) per account_user
|
|
56
58
|
*
|