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
|
@@ -80,91 +80,78 @@ class Webhooks {
|
|
|
80
80
|
* include_total_count: false
|
|
81
81
|
* })
|
|
82
82
|
*/
|
|
83
|
-
index(
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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, _d;
|
|
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 ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
105
|
+
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`),
|
|
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.
|
|
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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
/**
|
|
@@ -200,10 +187,10 @@ class Webhooks {
|
|
|
200
187
|
}
|
|
201
188
|
__create(accountId, workspaceId, request, requestOptions) {
|
|
202
189
|
return __awaiter(this, void 0, void 0, function* () {
|
|
203
|
-
var _a, _b, _c;
|
|
190
|
+
var _a, _b, _c, _d;
|
|
204
191
|
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);
|
|
205
|
-
const _response = yield core.fetcher({
|
|
206
|
-
url: core.url.join((
|
|
192
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
193
|
+
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`),
|
|
207
194
|
method: "POST",
|
|
208
195
|
headers: _headers,
|
|
209
196
|
contentType: "application/json",
|
|
@@ -284,15 +271,15 @@ class Webhooks {
|
|
|
284
271
|
}
|
|
285
272
|
__show(accountId_1, webhookId_1) {
|
|
286
273
|
return __awaiter(this, arguments, void 0, function* (accountId, webhookId, request = {}, requestOptions) {
|
|
287
|
-
var _a, _b, _c;
|
|
274
|
+
var _a, _b, _c, _d;
|
|
288
275
|
const { include } = request;
|
|
289
276
|
const _queryParams = {};
|
|
290
277
|
if (include != null) {
|
|
291
278
|
_queryParams["include"] = include;
|
|
292
279
|
}
|
|
293
280
|
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);
|
|
294
|
-
const _response = yield core.fetcher({
|
|
295
|
-
url: core.url.join((
|
|
281
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
282
|
+
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)}`),
|
|
296
283
|
method: "GET",
|
|
297
284
|
headers: _headers,
|
|
298
285
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -367,10 +354,10 @@ class Webhooks {
|
|
|
367
354
|
}
|
|
368
355
|
__delete(accountId, webhookId, requestOptions) {
|
|
369
356
|
return __awaiter(this, void 0, void 0, function* () {
|
|
370
|
-
var _a, _b, _c;
|
|
357
|
+
var _a, _b, _c, _d;
|
|
371
358
|
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);
|
|
372
|
-
const _response = yield core.fetcher({
|
|
373
|
-
url: core.url.join((
|
|
359
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
360
|
+
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)}`),
|
|
374
361
|
method: "DELETE",
|
|
375
362
|
headers: _headers,
|
|
376
363
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -453,10 +440,10 @@ class Webhooks {
|
|
|
453
440
|
}
|
|
454
441
|
__update(accountId, webhookId, request, requestOptions) {
|
|
455
442
|
return __awaiter(this, void 0, void 0, function* () {
|
|
456
|
-
var _a, _b, _c;
|
|
443
|
+
var _a, _b, _c, _d;
|
|
457
444
|
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);
|
|
458
|
-
const _response = yield core.fetcher({
|
|
459
|
-
url: core.url.join((
|
|
445
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
446
|
+
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)}`),
|
|
460
447
|
method: "PATCH",
|
|
461
448
|
headers: _headers,
|
|
462
449
|
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
|
*
|
|
@@ -80,91 +80,78 @@ class WorkspacePermissions {
|
|
|
80
80
|
* include_total_count: false
|
|
81
81
|
* })
|
|
82
82
|
*/
|
|
83
|
-
index(
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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, _d;
|
|
89
|
+
const { include_deactivated: includeDeactivated, after, page_size: pageSize, include_total_count: includeTotalCount, } = request;
|
|
90
|
+
const _queryParams = {};
|
|
91
|
+
if (includeDeactivated != null) {
|
|
92
|
+
_queryParams["include_deactivated"] = includeDeactivated.toString();
|
|
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 ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
105
|
+
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`),
|
|
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.
|
|
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}/users.");
|
|
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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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}/users.");
|
|
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
|
/**
|
|
@@ -191,10 +178,10 @@ class WorkspacePermissions {
|
|
|
191
178
|
}
|
|
192
179
|
__workspaceUserRolesDelete(accountId, workspaceId, userId, requestOptions) {
|
|
193
180
|
return __awaiter(this, void 0, void 0, function* () {
|
|
194
|
-
var _a, _b, _c;
|
|
181
|
+
var _a, _b, _c, _d;
|
|
195
182
|
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);
|
|
196
|
-
const _response = yield core.fetcher({
|
|
197
|
-
url: core.url.join((
|
|
183
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
184
|
+
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)}`),
|
|
198
185
|
method: "DELETE",
|
|
199
186
|
headers: _headers,
|
|
200
187
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -276,10 +263,10 @@ class WorkspacePermissions {
|
|
|
276
263
|
}
|
|
277
264
|
__workspaceUserRolesUpdate(accountId, workspaceId, userId, request, requestOptions) {
|
|
278
265
|
return __awaiter(this, void 0, void 0, function* () {
|
|
279
|
-
var _a, _b, _c;
|
|
266
|
+
var _a, _b, _c, _d;
|
|
280
267
|
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);
|
|
281
|
-
const _response = yield core.fetcher({
|
|
282
|
-
url: core.url.join((
|
|
268
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
269
|
+
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)}`),
|
|
283
270
|
method: "PATCH",
|
|
284
271
|
headers: _headers,
|
|
285
272
|
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
|
*
|