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
|
@@ -44,91 +44,78 @@ export class Webhooks {
|
|
|
44
44
|
* include_total_count: false
|
|
45
45
|
* })
|
|
46
46
|
*/
|
|
47
|
-
index(
|
|
47
|
+
index(accountId, workspaceId, request = {}, requestOptions) {
|
|
48
|
+
return core.HttpResponsePromise.fromPromise(this.__index(accountId, workspaceId, request, requestOptions));
|
|
49
|
+
}
|
|
50
|
+
__index(accountId_1, workspaceId_1) {
|
|
48
51
|
return __awaiter(this, arguments, void 0, function* (accountId, workspaceId, request = {}, requestOptions) {
|
|
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
|
-
|
|
94
|
-
throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
95
|
-
case 429:
|
|
96
|
-
throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
97
|
-
default:
|
|
98
|
-
throw new errors.FrameioError({
|
|
99
|
-
statusCode: _response.error.statusCode,
|
|
100
|
-
body: _response.error.body,
|
|
101
|
-
rawResponse: _response.rawResponse,
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
switch (_response.error.reason) {
|
|
106
|
-
case "non-json":
|
|
52
|
+
var _a, _b, _c, _d;
|
|
53
|
+
const { include, after, page_size: pageSize, include_total_count: includeTotalCount } = request;
|
|
54
|
+
const _queryParams = {};
|
|
55
|
+
if (include != null) {
|
|
56
|
+
_queryParams["include"] = include;
|
|
57
|
+
}
|
|
58
|
+
if (after != null) {
|
|
59
|
+
_queryParams["after"] = after;
|
|
60
|
+
}
|
|
61
|
+
if (pageSize != null) {
|
|
62
|
+
_queryParams["page_size"] = pageSize.toString();
|
|
63
|
+
}
|
|
64
|
+
if (includeTotalCount != null) {
|
|
65
|
+
_queryParams["include_total_count"] = includeTotalCount.toString();
|
|
66
|
+
}
|
|
67
|
+
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);
|
|
68
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
69
|
+
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)}/webhooks`),
|
|
70
|
+
method: "GET",
|
|
71
|
+
headers: _headers,
|
|
72
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
73
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
74
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
75
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
76
|
+
});
|
|
77
|
+
if (_response.ok) {
|
|
78
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
79
|
+
}
|
|
80
|
+
if (_response.error.reason === "status-code") {
|
|
81
|
+
switch (_response.error.statusCode) {
|
|
82
|
+
case 400:
|
|
83
|
+
throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
|
|
84
|
+
case 401:
|
|
85
|
+
throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
86
|
+
case 403:
|
|
87
|
+
throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
88
|
+
case 404:
|
|
89
|
+
throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
|
|
90
|
+
case 409:
|
|
91
|
+
throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
|
|
92
|
+
case 422:
|
|
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:
|
|
107
97
|
throw new errors.FrameioError({
|
|
108
98
|
statusCode: _response.error.statusCode,
|
|
109
|
-
body: _response.error.
|
|
110
|
-
rawResponse: _response.rawResponse,
|
|
111
|
-
});
|
|
112
|
-
case "timeout":
|
|
113
|
-
throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/workspaces/{workspace_id}/webhooks.");
|
|
114
|
-
case "unknown":
|
|
115
|
-
throw new errors.FrameioError({
|
|
116
|
-
message: _response.error.errorMessage,
|
|
99
|
+
body: _response.error.body,
|
|
117
100
|
rawResponse: _response.rawResponse,
|
|
118
101
|
});
|
|
119
102
|
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
103
|
+
}
|
|
104
|
+
switch (_response.error.reason) {
|
|
105
|
+
case "non-json":
|
|
106
|
+
throw new errors.FrameioError({
|
|
107
|
+
statusCode: _response.error.statusCode,
|
|
108
|
+
body: _response.error.rawBody,
|
|
109
|
+
rawResponse: _response.rawResponse,
|
|
110
|
+
});
|
|
111
|
+
case "timeout":
|
|
112
|
+
throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/workspaces/{workspace_id}/webhooks.");
|
|
113
|
+
case "unknown":
|
|
114
|
+
throw new errors.FrameioError({
|
|
115
|
+
message: _response.error.errorMessage,
|
|
116
|
+
rawResponse: _response.rawResponse,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
132
119
|
});
|
|
133
120
|
}
|
|
134
121
|
/**
|
|
@@ -164,10 +151,10 @@ export class Webhooks {
|
|
|
164
151
|
}
|
|
165
152
|
__create(accountId, workspaceId, request, requestOptions) {
|
|
166
153
|
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
-
var _a, _b, _c;
|
|
154
|
+
var _a, _b, _c, _d;
|
|
168
155
|
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);
|
|
169
|
-
const _response = yield core.fetcher({
|
|
170
|
-
url: core.url.join((
|
|
156
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
157
|
+
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)}/webhooks`),
|
|
171
158
|
method: "POST",
|
|
172
159
|
headers: _headers,
|
|
173
160
|
contentType: "application/json",
|
|
@@ -248,15 +235,15 @@ export class Webhooks {
|
|
|
248
235
|
}
|
|
249
236
|
__show(accountId_1, webhookId_1) {
|
|
250
237
|
return __awaiter(this, arguments, void 0, function* (accountId, webhookId, request = {}, requestOptions) {
|
|
251
|
-
var _a, _b, _c;
|
|
238
|
+
var _a, _b, _c, _d;
|
|
252
239
|
const { include } = request;
|
|
253
240
|
const _queryParams = {};
|
|
254
241
|
if (include != null) {
|
|
255
242
|
_queryParams["include"] = include;
|
|
256
243
|
}
|
|
257
244
|
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);
|
|
258
|
-
const _response = yield core.fetcher({
|
|
259
|
-
url: core.url.join((
|
|
245
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
246
|
+
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)}/webhooks/${encodeURIComponent(webhookId)}`),
|
|
260
247
|
method: "GET",
|
|
261
248
|
headers: _headers,
|
|
262
249
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -331,10 +318,10 @@ export class Webhooks {
|
|
|
331
318
|
}
|
|
332
319
|
__delete(accountId, webhookId, requestOptions) {
|
|
333
320
|
return __awaiter(this, void 0, void 0, function* () {
|
|
334
|
-
var _a, _b, _c;
|
|
321
|
+
var _a, _b, _c, _d;
|
|
335
322
|
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);
|
|
336
|
-
const _response = yield core.fetcher({
|
|
337
|
-
url: core.url.join((
|
|
323
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
324
|
+
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)}/webhooks/${encodeURIComponent(webhookId)}`),
|
|
338
325
|
method: "DELETE",
|
|
339
326
|
headers: _headers,
|
|
340
327
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -417,10 +404,10 @@ export class Webhooks {
|
|
|
417
404
|
}
|
|
418
405
|
__update(accountId, webhookId, request, requestOptions) {
|
|
419
406
|
return __awaiter(this, void 0, void 0, function* () {
|
|
420
|
-
var _a, _b, _c;
|
|
407
|
+
var _a, _b, _c, _d;
|
|
421
408
|
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);
|
|
422
|
-
const _response = yield core.fetcher({
|
|
423
|
-
url: core.url.join((
|
|
409
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
410
|
+
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)}/webhooks/${encodeURIComponent(webhookId)}`),
|
|
424
411
|
method: "PATCH",
|
|
425
412
|
headers: _headers,
|
|
426
413
|
contentType: "application/json",
|
|
@@ -9,6 +9,7 @@ export declare namespace WorkspacePermissions {
|
|
|
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. */
|
|
@@ -53,7 +54,8 @@ export declare class WorkspacePermissions {
|
|
|
53
54
|
* include_total_count: false
|
|
54
55
|
* })
|
|
55
56
|
*/
|
|
56
|
-
index(accountId: Frameio.Uuid, workspaceId: Frameio.Uuid, request?: Frameio.WorkspacePermissionsIndexRequest, requestOptions?: WorkspacePermissions.RequestOptions):
|
|
57
|
+
index(accountId: Frameio.Uuid, workspaceId: Frameio.Uuid, request?: Frameio.WorkspacePermissionsIndexRequest, requestOptions?: WorkspacePermissions.RequestOptions): core.HttpResponsePromise<Frameio.WorkspaceUserRolesResponse>;
|
|
58
|
+
private __index;
|
|
57
59
|
/**
|
|
58
60
|
* Remove a user from a given workspace. <br>Rate Limits: 60 calls per 1.00 minute(s) per account_user
|
|
59
61
|
*
|
|
@@ -44,91 +44,78 @@ export class WorkspacePermissions {
|
|
|
44
44
|
* include_total_count: false
|
|
45
45
|
* })
|
|
46
46
|
*/
|
|
47
|
-
index(
|
|
47
|
+
index(accountId, workspaceId, request = {}, requestOptions) {
|
|
48
|
+
return core.HttpResponsePromise.fromPromise(this.__index(accountId, workspaceId, request, requestOptions));
|
|
49
|
+
}
|
|
50
|
+
__index(accountId_1, workspaceId_1) {
|
|
48
51
|
return __awaiter(this, arguments, void 0, function* (accountId, workspaceId, request = {}, requestOptions) {
|
|
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
|
-
|
|
94
|
-
throw new Frameio.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
95
|
-
case 429:
|
|
96
|
-
throw new Frameio.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
97
|
-
default:
|
|
98
|
-
throw new errors.FrameioError({
|
|
99
|
-
statusCode: _response.error.statusCode,
|
|
100
|
-
body: _response.error.body,
|
|
101
|
-
rawResponse: _response.rawResponse,
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
switch (_response.error.reason) {
|
|
106
|
-
case "non-json":
|
|
52
|
+
var _a, _b, _c, _d;
|
|
53
|
+
const { include_deactivated: includeDeactivated, after, page_size: pageSize, include_total_count: includeTotalCount, } = request;
|
|
54
|
+
const _queryParams = {};
|
|
55
|
+
if (includeDeactivated != null) {
|
|
56
|
+
_queryParams["include_deactivated"] = includeDeactivated.toString();
|
|
57
|
+
}
|
|
58
|
+
if (after != null) {
|
|
59
|
+
_queryParams["after"] = after;
|
|
60
|
+
}
|
|
61
|
+
if (pageSize != null) {
|
|
62
|
+
_queryParams["page_size"] = pageSize.toString();
|
|
63
|
+
}
|
|
64
|
+
if (includeTotalCount != null) {
|
|
65
|
+
_queryParams["include_total_count"] = includeTotalCount.toString();
|
|
66
|
+
}
|
|
67
|
+
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);
|
|
68
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
69
|
+
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)}/users`),
|
|
70
|
+
method: "GET",
|
|
71
|
+
headers: _headers,
|
|
72
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
73
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
74
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
75
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
76
|
+
});
|
|
77
|
+
if (_response.ok) {
|
|
78
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
79
|
+
}
|
|
80
|
+
if (_response.error.reason === "status-code") {
|
|
81
|
+
switch (_response.error.statusCode) {
|
|
82
|
+
case 400:
|
|
83
|
+
throw new Frameio.BadRequestError(_response.error.body, _response.rawResponse);
|
|
84
|
+
case 401:
|
|
85
|
+
throw new Frameio.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
86
|
+
case 403:
|
|
87
|
+
throw new Frameio.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
88
|
+
case 404:
|
|
89
|
+
throw new Frameio.NotFoundError(_response.error.body, _response.rawResponse);
|
|
90
|
+
case 409:
|
|
91
|
+
throw new Frameio.ConflictError(_response.error.body, _response.rawResponse);
|
|
92
|
+
case 422:
|
|
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:
|
|
107
97
|
throw new errors.FrameioError({
|
|
108
98
|
statusCode: _response.error.statusCode,
|
|
109
|
-
body: _response.error.
|
|
110
|
-
rawResponse: _response.rawResponse,
|
|
111
|
-
});
|
|
112
|
-
case "timeout":
|
|
113
|
-
throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/workspaces/{workspace_id}/users.");
|
|
114
|
-
case "unknown":
|
|
115
|
-
throw new errors.FrameioError({
|
|
116
|
-
message: _response.error.errorMessage,
|
|
99
|
+
body: _response.error.body,
|
|
117
100
|
rawResponse: _response.rawResponse,
|
|
118
101
|
});
|
|
119
102
|
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
103
|
+
}
|
|
104
|
+
switch (_response.error.reason) {
|
|
105
|
+
case "non-json":
|
|
106
|
+
throw new errors.FrameioError({
|
|
107
|
+
statusCode: _response.error.statusCode,
|
|
108
|
+
body: _response.error.rawBody,
|
|
109
|
+
rawResponse: _response.rawResponse,
|
|
110
|
+
});
|
|
111
|
+
case "timeout":
|
|
112
|
+
throw new errors.FrameioTimeoutError("Timeout exceeded when calling GET /v4/accounts/{account_id}/workspaces/{workspace_id}/users.");
|
|
113
|
+
case "unknown":
|
|
114
|
+
throw new errors.FrameioError({
|
|
115
|
+
message: _response.error.errorMessage,
|
|
116
|
+
rawResponse: _response.rawResponse,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
132
119
|
});
|
|
133
120
|
}
|
|
134
121
|
/**
|
|
@@ -155,10 +142,10 @@ export class WorkspacePermissions {
|
|
|
155
142
|
}
|
|
156
143
|
__workspaceUserRolesDelete(accountId, workspaceId, userId, requestOptions) {
|
|
157
144
|
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
-
var _a, _b, _c;
|
|
145
|
+
var _a, _b, _c, _d;
|
|
159
146
|
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);
|
|
160
|
-
const _response = yield core.fetcher({
|
|
161
|
-
url: core.url.join((
|
|
147
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
148
|
+
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)}/users/${encodeURIComponent(userId)}`),
|
|
162
149
|
method: "DELETE",
|
|
163
150
|
headers: _headers,
|
|
164
151
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -240,10 +227,10 @@ export class WorkspacePermissions {
|
|
|
240
227
|
}
|
|
241
228
|
__workspaceUserRolesUpdate(accountId, workspaceId, userId, request, requestOptions) {
|
|
242
229
|
return __awaiter(this, void 0, void 0, function* () {
|
|
243
|
-
var _a, _b, _c;
|
|
230
|
+
var _a, _b, _c, _d;
|
|
244
231
|
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);
|
|
245
|
-
const _response = yield core.fetcher({
|
|
246
|
-
url: core.url.join((
|
|
232
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
233
|
+
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)}/users/${encodeURIComponent(userId)}`),
|
|
247
234
|
method: "PATCH",
|
|
248
235
|
headers: _headers,
|
|
249
236
|
contentType: "application/json",
|
|
@@ -9,6 +9,7 @@ export declare namespace Workspaces {
|
|
|
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. */
|
|
@@ -120,7 +121,8 @@ export declare class Workspaces {
|
|
|
120
121
|
* include_total_count: false
|
|
121
122
|
* })
|
|
122
123
|
*/
|
|
123
|
-
index(accountId: Frameio.Uuid, request?: Frameio.WorkspacesIndexRequest, requestOptions?: Workspaces.RequestOptions):
|
|
124
|
+
index(accountId: Frameio.Uuid, request?: Frameio.WorkspacesIndexRequest, requestOptions?: Workspaces.RequestOptions): core.HttpResponsePromise<Frameio.WorkspacesWithIncludesResponse>;
|
|
125
|
+
private __index;
|
|
124
126
|
/**
|
|
125
127
|
* Create workspace from an account. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
|
|
126
128
|
*
|