frameio 3.2.3 → 4.1.1
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/README.md +159 -4
- package/dist/cjs/BaseClient.d.ts +4 -0
- package/dist/cjs/BaseClient.js +4 -2
- package/dist/cjs/api/resources/accountPermissions/client/Client.js +6 -6
- package/dist/cjs/api/resources/accounts/client/Client.js +13 -13
- package/dist/cjs/api/resources/comments/client/Client.js +48 -48
- package/dist/cjs/api/resources/files/client/Client.js +77 -77
- package/dist/cjs/api/resources/folders/client/Client.js +56 -56
- package/dist/cjs/api/resources/metadata/client/Client.d.ts +4 -4
- package/dist/cjs/api/resources/metadata/client/Client.js +18 -18
- package/dist/cjs/api/resources/metadata/client/requests/BulkUpdateMetadataParams.d.ts +4 -4
- package/dist/cjs/api/resources/metadataFields/client/Client.js +28 -28
- package/dist/cjs/api/resources/projectPermissions/client/Client.js +20 -20
- package/dist/cjs/api/resources/projects/client/Client.js +34 -34
- package/dist/cjs/api/resources/shares/client/Client.d.ts +4 -4
- package/dist/cjs/api/resources/shares/client/Client.js +72 -72
- package/dist/cjs/api/resources/shares/client/requests/AddAssetParams.d.ts +1 -1
- package/dist/cjs/api/resources/shares/client/requests/CreateShareParams.d.ts +2 -2
- package/dist/cjs/api/resources/shares/client/requests/UpdateShareParams.d.ts +1 -1
- package/dist/cjs/api/resources/users/client/Client.js +7 -7
- package/dist/cjs/api/resources/versionStacks/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/versionStacks/client/Client.js +43 -43
- package/dist/cjs/api/resources/versionStacks/client/requests/VersionStackCreateParams.d.ts +1 -1
- package/dist/cjs/api/resources/webhooks/client/Client.js +34 -34
- package/dist/cjs/api/resources/workspacePermissions/client/Client.js +20 -20
- package/dist/cjs/api/resources/workspaces/client/Client.js +34 -34
- package/dist/cjs/api/types/Account.d.ts +0 -2
- package/dist/cjs/api/types/AuditLogwithIncludes.d.ts +4 -0
- package/dist/cjs/api/types/AuditLogwithIncludes.js +4 -0
- package/dist/cjs/api/types/Filters.d.ts +4 -0
- package/dist/cjs/api/types/Filters.js +4 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.js +21 -1
- package/dist/cjs/oauth/BaseAuth.d.ts +66 -0
- package/dist/cjs/oauth/BaseAuth.js +113 -0
- package/dist/cjs/oauth/NativeAppAuth.d.ts +32 -0
- package/dist/cjs/oauth/NativeAppAuth.js +35 -0
- package/dist/cjs/oauth/SPAAuth.d.ts +38 -0
- package/dist/cjs/oauth/SPAAuth.js +96 -0
- package/dist/cjs/oauth/ServerToServerAuth.d.ts +17 -0
- package/dist/cjs/oauth/ServerToServerAuth.js +49 -0
- package/dist/cjs/oauth/TokenManager.d.ts +83 -0
- package/dist/cjs/oauth/TokenManager.js +174 -0
- package/dist/cjs/oauth/WebAppAuth.d.ts +29 -0
- package/dist/cjs/oauth/WebAppAuth.js +88 -0
- package/dist/cjs/oauth/errors.d.ts +41 -0
- package/dist/cjs/oauth/errors.js +83 -0
- package/dist/cjs/oauth/http.d.ts +70 -0
- package/dist/cjs/oauth/http.js +280 -0
- package/dist/cjs/oauth/index.d.ts +34 -0
- package/dist/cjs/oauth/index.js +47 -0
- package/dist/cjs/oauth/logger.d.ts +17 -0
- package/dist/cjs/oauth/logger.js +18 -0
- package/dist/cjs/oauth/pkce.d.ts +30 -0
- package/dist/cjs/oauth/pkce.js +102 -0
- package/dist/cjs/oauth/validation.d.ts +17 -0
- package/dist/cjs/oauth/validation.js +55 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +4 -0
- package/dist/esm/BaseClient.mjs +4 -2
- package/dist/esm/api/resources/accountPermissions/client/Client.mjs +7 -7
- package/dist/esm/api/resources/accounts/client/Client.mjs +13 -13
- package/dist/esm/api/resources/comments/client/Client.mjs +49 -49
- package/dist/esm/api/resources/files/client/Client.mjs +78 -78
- package/dist/esm/api/resources/folders/client/Client.mjs +57 -57
- package/dist/esm/api/resources/metadata/client/Client.d.mts +4 -4
- package/dist/esm/api/resources/metadata/client/Client.mjs +19 -19
- package/dist/esm/api/resources/metadata/client/requests/BulkUpdateMetadataParams.d.mts +4 -4
- package/dist/esm/api/resources/metadataFields/client/Client.mjs +29 -29
- package/dist/esm/api/resources/projectPermissions/client/Client.mjs +21 -21
- package/dist/esm/api/resources/projects/client/Client.mjs +35 -35
- package/dist/esm/api/resources/shares/client/Client.d.mts +4 -4
- package/dist/esm/api/resources/shares/client/Client.mjs +73 -73
- package/dist/esm/api/resources/shares/client/requests/AddAssetParams.d.mts +1 -1
- package/dist/esm/api/resources/shares/client/requests/CreateShareParams.d.mts +2 -2
- package/dist/esm/api/resources/shares/client/requests/UpdateShareParams.d.mts +1 -1
- package/dist/esm/api/resources/users/client/Client.mjs +8 -8
- package/dist/esm/api/resources/versionStacks/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/versionStacks/client/Client.mjs +44 -44
- package/dist/esm/api/resources/versionStacks/client/requests/VersionStackCreateParams.d.mts +1 -1
- package/dist/esm/api/resources/webhooks/client/Client.mjs +35 -35
- package/dist/esm/api/resources/workspacePermissions/client/Client.mjs +21 -21
- package/dist/esm/api/resources/workspaces/client/Client.mjs +35 -35
- package/dist/esm/api/types/Account.d.mts +0 -2
- package/dist/esm/api/types/AuditLogwithIncludes.d.mts +4 -0
- package/dist/esm/api/types/AuditLogwithIncludes.mjs +4 -0
- package/dist/esm/api/types/Filters.d.mts +4 -0
- package/dist/esm/api/types/Filters.mjs +4 -0
- package/dist/esm/index.d.mts +4 -0
- package/dist/esm/index.mjs +6 -0
- package/dist/esm/oauth/BaseAuth.d.mts +66 -0
- package/dist/esm/oauth/BaseAuth.mjs +109 -0
- package/dist/esm/oauth/NativeAppAuth.d.mts +32 -0
- package/dist/esm/oauth/NativeAppAuth.mjs +31 -0
- package/dist/esm/oauth/SPAAuth.d.mts +38 -0
- package/dist/esm/oauth/SPAAuth.mjs +92 -0
- package/dist/esm/oauth/ServerToServerAuth.d.mts +17 -0
- package/dist/esm/oauth/ServerToServerAuth.mjs +45 -0
- package/dist/esm/oauth/TokenManager.d.mts +83 -0
- package/dist/esm/oauth/TokenManager.mjs +170 -0
- package/dist/esm/oauth/WebAppAuth.d.mts +29 -0
- package/dist/esm/oauth/WebAppAuth.mjs +84 -0
- package/dist/esm/oauth/errors.d.mts +41 -0
- package/dist/esm/oauth/errors.mjs +72 -0
- package/dist/esm/oauth/http.d.mts +70 -0
- package/dist/esm/oauth/http.mjs +274 -0
- package/dist/esm/oauth/index.d.mts +34 -0
- package/dist/esm/oauth/index.mjs +30 -0
- package/dist/esm/oauth/logger.d.mts +17 -0
- package/dist/esm/oauth/logger.mjs +15 -0
- package/dist/esm/oauth/pkce.d.mts +30 -0
- package/dist/esm/oauth/pkce.mjs +98 -0
- package/dist/esm/oauth/validation.d.mts +17 -0
- package/dist/esm/oauth/validation.mjs +51 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +9 -9
package/README.md
CHANGED
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FFrameio%2Ftypescript-sdk)
|
|
4
4
|
[](https://www.npmjs.com/package/frameio)
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
<img width="1644" alt="artboard_small" src="https://user-images.githubusercontent.com/19295862/66240171-ba8dd280-e6b0-11e9-9ccf-573a4fc5961f.png">
|
|
8
7
|
|
|
9
|
-
Frame.io is a cloud-based collaboration hub that allows video professionals to share files, comment on clips real-time, and compare different versions and edits of a clip.
|
|
10
|
-
|
|
8
|
+
Frame.io is a cloud-based collaboration hub that allows video professionals to share files, comment on clips real-time, and compare different versions and edits of a clip.
|
|
11
9
|
|
|
12
10
|
## Installation
|
|
13
11
|
|
|
@@ -21,7 +19,26 @@ A full reference for this library is available [here](https://next.developer.fra
|
|
|
21
19
|
|
|
22
20
|
## Usage
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
You can authenticate with a static token or OAuth 2.0 via `frameio` auth classes:
|
|
23
|
+
|
|
24
|
+
**Static token** (for legacy dev tokens or when you already have an access token):
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
const client = new FrameioClient({ token: "YOUR_TOKEN" });
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**OAuth 2.0** (for production with automatic token refresh):
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { FrameioClient, ServerToServerAuth } from "frameio";
|
|
34
|
+
|
|
35
|
+
const auth = new ServerToServerAuth({ clientId: "...", clientSecret: "..." });
|
|
36
|
+
const client = new FrameioClient({ token: () => auth.getToken() });
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
See the [Authentication](#authentication) section below for all OAuth flows.
|
|
40
|
+
|
|
41
|
+
Example: creating a metadata field definition:
|
|
25
42
|
|
|
26
43
|
```typescript
|
|
27
44
|
import { FrameioClient } from "frameio";
|
|
@@ -46,6 +63,123 @@ await client.metadataFields.metadataFieldDefinitionsCreate("b2702c44-c6da-4bb6-8
|
|
|
46
63
|
});
|
|
47
64
|
```
|
|
48
65
|
|
|
66
|
+
## Authentication
|
|
67
|
+
|
|
68
|
+
The SDK supports two authentication options:
|
|
69
|
+
|
|
70
|
+
- **Static token**: Pass a string directly to `token`. Suitable for legacy dev tokens or when you already have an access token.
|
|
71
|
+
- **OAuth 2.0**: Use the built-in auth classes for automatic token management and refresh. Pass `() => auth.getToken()` to the client.
|
|
72
|
+
|
|
73
|
+
The SDK provides four OAuth 2.0 flows:
|
|
74
|
+
|
|
75
|
+
| Flow | Use Case | Classes |
|
|
76
|
+
| ------------------------- | -------------------------------------------------- | -------------------- |
|
|
77
|
+
| **Server-to-Server** | Backend services, scripts, no user interaction | `ServerToServerAuth` |
|
|
78
|
+
| **Web App** | Server-side apps with client secret | `WebAppAuth` |
|
|
79
|
+
| **Single Page App (SPA)** | Browser apps without a client secret (PKCE) | `SPAAuth` |
|
|
80
|
+
| **Native App** | Desktop/mobile apps with custom URI schemes (PKCE) | `NativeAppAuth` |
|
|
81
|
+
|
|
82
|
+
### Server-to-Server
|
|
83
|
+
|
|
84
|
+
For backend services and scripts that need Frame.io access without user interaction:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
import { FrameioClient, ServerToServerAuth } from "frameio";
|
|
88
|
+
|
|
89
|
+
const auth = new ServerToServerAuth({ clientId: "...", clientSecret: "..." });
|
|
90
|
+
const client = new FrameioClient({ token: () => auth.getToken() });
|
|
91
|
+
// Tokens refresh automatically; no user interaction needed.
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Web App
|
|
95
|
+
|
|
96
|
+
For server-side applications with a client secret:
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
import { FrameioClient, WebAppAuth } from "frameio";
|
|
100
|
+
import crypto from "crypto";
|
|
101
|
+
|
|
102
|
+
const auth = new WebAppAuth({
|
|
103
|
+
clientId: "...",
|
|
104
|
+
clientSecret: "...",
|
|
105
|
+
redirectUri: "https://myapp.com/callback",
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const url = auth.getAuthorizationUrl({ state: crypto.randomBytes(32).toString("hex") });
|
|
109
|
+
// Redirect user to url, then:
|
|
110
|
+
await auth.exchangeCode("CODE_FROM_CALLBACK");
|
|
111
|
+
const client = new FrameioClient({ token: () => auth.getToken() });
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Single Page App (PKCE)
|
|
115
|
+
|
|
116
|
+
For browser-based apps that cannot store a client secret:
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
import { FrameioClient, SPAAuth } from "frameio";
|
|
120
|
+
|
|
121
|
+
const auth = new SPAAuth({ clientId: "...", redirectUri: "https://myapp.com/cb" });
|
|
122
|
+
|
|
123
|
+
const result = await auth.getAuthorizationUrl({ state: crypto.randomUUID() });
|
|
124
|
+
// Redirect user to result.url, store result.codeVerifier, then:
|
|
125
|
+
await auth.exchangeCode({ code: "CODE", codeVerifier: result.codeVerifier });
|
|
126
|
+
const client = new FrameioClient({ token: () => auth.getToken() });
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Native App (PKCE with custom URI schemes)
|
|
130
|
+
|
|
131
|
+
For desktop and mobile applications:
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
import { NativeAppAuth } from "frameio";
|
|
135
|
+
|
|
136
|
+
const auth = new NativeAppAuth({
|
|
137
|
+
clientId: "...",
|
|
138
|
+
redirectUri: "myapp://callback",
|
|
139
|
+
});
|
|
140
|
+
// Same PKCE flow as SPAAuth
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Token Persistence
|
|
144
|
+
|
|
145
|
+
For Web App, SPA, and Native App flows, you can persist tokens to avoid re-authenticating on each app restart:
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
// After exchangeCode() — save tokens for later
|
|
149
|
+
const data = auth.exportTokens();
|
|
150
|
+
// Store data to file or database ...
|
|
151
|
+
|
|
152
|
+
// On next app start — restore and use
|
|
153
|
+
auth.importTokens(data);
|
|
154
|
+
const client = new FrameioClient({ token: () => auth.getToken() });
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Revoking Tokens
|
|
158
|
+
|
|
159
|
+
To sign out and revoke the current access and refresh tokens:
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
await auth.revoke();
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Staging / Non-Production
|
|
166
|
+
|
|
167
|
+
Use `imsBaseUrl` to point at a staging or alternative Adobe IMS environment:
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
const auth = new ServerToServerAuth({
|
|
171
|
+
clientId: "...",
|
|
172
|
+
clientSecret: "...",
|
|
173
|
+
imsBaseUrl: "https://ims-na1-stg1.adobelogin.com",
|
|
174
|
+
});
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Async / Concurrency
|
|
178
|
+
|
|
179
|
+
All auth flows use `async/await` natively. The `getToken()` method handles automatic token refresh and is safe to call concurrently — only one refresh request fires at a time.
|
|
180
|
+
|
|
181
|
+
For the full authentication guide, see the [TypeScript Authentication Guide](https://next.developer.frame.io/platform/v4/docs/typescript-authentication-guide).
|
|
182
|
+
|
|
49
183
|
## Request And Response Types
|
|
50
184
|
|
|
51
185
|
The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
|
|
@@ -79,6 +213,27 @@ try {
|
|
|
79
213
|
}
|
|
80
214
|
```
|
|
81
215
|
|
|
216
|
+
For OAuth flows, additional exceptions are available:
|
|
217
|
+
|
|
218
|
+
- `AuthenticationError` — token exchange or refresh failed
|
|
219
|
+
- `TokenExpiredError` — refresh token expired; user must re-authenticate
|
|
220
|
+
- `ConfigurationError` — invalid configuration (e.g. missing `clientId`)
|
|
221
|
+
- `NetworkError`, `RateLimitError` — network or rate limit issues
|
|
222
|
+
|
|
223
|
+
```typescript
|
|
224
|
+
import { AuthenticationError, TokenExpiredError } from "frameio";
|
|
225
|
+
|
|
226
|
+
try {
|
|
227
|
+
await auth.exchangeCode("...");
|
|
228
|
+
} catch (error) {
|
|
229
|
+
if (error instanceof AuthenticationError) {
|
|
230
|
+
console.error(error.errorCode, error.errorDescription);
|
|
231
|
+
} else if (error instanceof TokenExpiredError) {
|
|
232
|
+
// Redirect user to sign in again
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
82
237
|
## Advanced
|
|
83
238
|
|
|
84
239
|
### Additional Headers
|
package/dist/cjs/BaseClient.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export type BaseClientOptions = {
|
|
|
5
5
|
environment?: core.Supplier<environments.FrameioEnvironment | string>;
|
|
6
6
|
/** Specify a custom URL to connect the client to. */
|
|
7
7
|
baseUrl?: core.Supplier<string>;
|
|
8
|
+
/** Override the user-agent header */
|
|
9
|
+
userAgent?: "frameio-ts";
|
|
8
10
|
/** Additional headers to include in requests. */
|
|
9
11
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
10
12
|
/** The default maximum time to wait for a response in seconds. */
|
|
@@ -24,6 +26,8 @@ export interface BaseRequestOptions {
|
|
|
24
26
|
maxRetries?: number;
|
|
25
27
|
/** A hook to abort the request. */
|
|
26
28
|
abortSignal?: AbortSignal;
|
|
29
|
+
/** Override the user-agent header */
|
|
30
|
+
userAgent?: "frameio-ts";
|
|
27
31
|
/** Additional query string parameters to include in the request. */
|
|
28
32
|
queryParams?: Record<string, unknown>;
|
|
29
33
|
/** Additional headers to include in the request. */
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -40,13 +40,15 @@ const BearerAuthProvider_js_1 = require("./auth/BearerAuthProvider.js");
|
|
|
40
40
|
const headers_js_1 = require("./core/headers.js");
|
|
41
41
|
const core = __importStar(require("./core/index.js"));
|
|
42
42
|
function normalizeClientOptions(options) {
|
|
43
|
+
var _a;
|
|
43
44
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
45
|
"X-Fern-Language": "JavaScript",
|
|
45
46
|
"X-Fern-SDK-Name": "frameio",
|
|
46
|
-
"X-Fern-SDK-Version": "
|
|
47
|
-
"User-Agent": "frameio/
|
|
47
|
+
"X-Fern-SDK-Version": "4.1.0",
|
|
48
|
+
"User-Agent": "frameio/4.1.0",
|
|
48
49
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
50
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
51
|
+
"user-agent": (_a = options === null || options === void 0 ? void 0 : options.userAgent) !== null && _a !== void 0 ? _a : "frameio-ts",
|
|
50
52
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
51
53
|
return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
|
|
52
54
|
}
|
|
@@ -85,17 +85,17 @@ class AccountPermissionsClient {
|
|
|
85
85
|
return __awaiter(this, arguments, void 0, function* (account_id, _request = {}, requestOptions) {
|
|
86
86
|
var _a, _b;
|
|
87
87
|
const list = core.HttpResponsePromise.interceptFunction((_requestUrl) => __awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
88
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
89
89
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
90
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
91
|
-
const _response = yield ((
|
|
90
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "user-agent": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.userAgent) !== null && _b !== void 0 ? _b : "frameio-ts" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
91
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
92
92
|
url: _requestUrl,
|
|
93
93
|
method: "GET",
|
|
94
94
|
headers: _headers,
|
|
95
|
-
timeoutMs: ((
|
|
96
|
-
maxRetries: (
|
|
95
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
96
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
97
97
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
98
|
-
fetchFn: (
|
|
98
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
99
99
|
logging: this._options.logging,
|
|
100
100
|
});
|
|
101
101
|
if (_response.ok) {
|
|
@@ -83,17 +83,17 @@ class AccountsClient {
|
|
|
83
83
|
return __awaiter(this, arguments, void 0, function* (_request = {}, requestOptions) {
|
|
84
84
|
var _a, _b;
|
|
85
85
|
const list = core.HttpResponsePromise.interceptFunction((_requestUrl) => __awaiter(this, void 0, void 0, function* () {
|
|
86
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
86
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
87
87
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
88
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
89
|
-
const _response = yield ((
|
|
88
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "user-agent": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.userAgent) !== null && _b !== void 0 ? _b : "frameio-ts" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
89
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
90
90
|
url: _requestUrl,
|
|
91
91
|
method: "GET",
|
|
92
92
|
headers: _headers,
|
|
93
|
-
timeoutMs: ((
|
|
94
|
-
maxRetries: (
|
|
93
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
94
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
95
95
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
96
|
-
fetchFn: (
|
|
96
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
97
97
|
logging: this._options.logging,
|
|
98
98
|
});
|
|
99
99
|
if (_response.ok) {
|
|
@@ -166,7 +166,7 @@ class AccountsClient {
|
|
|
166
166
|
}
|
|
167
167
|
__auditlogIndex(account_id_1) {
|
|
168
168
|
return __awaiter(this, arguments, void 0, function* (account_id, request = {}, requestOptions) {
|
|
169
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
169
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
170
170
|
const { include, filters, after, page_size: pageSize, include_total_count: includeTotalCount } = request;
|
|
171
171
|
const _queryParams = {
|
|
172
172
|
include: include != null ? include : undefined,
|
|
@@ -176,16 +176,16 @@ class AccountsClient {
|
|
|
176
176
|
include_total_count: includeTotalCount,
|
|
177
177
|
};
|
|
178
178
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
179
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "api-version": "4.0" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
180
|
-
const _response = yield ((
|
|
181
|
-
url: core.url.join((
|
|
179
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "api-version": "4.0", "user-agent": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.userAgent) !== null && _b !== void 0 ? _b : "frameio-ts" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
180
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
181
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.FrameioEnvironment.Default, `v4/accounts/${core.url.encodePathParam(account_id)}/audit_logs`),
|
|
182
182
|
method: "GET",
|
|
183
183
|
headers: _headers,
|
|
184
184
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
185
|
-
timeoutMs: ((
|
|
186
|
-
maxRetries: (
|
|
185
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
186
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
187
187
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
188
|
-
fetchFn: (
|
|
188
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
189
189
|
logging: this._options.logging,
|
|
190
190
|
});
|
|
191
191
|
if (_response.ok) {
|
|
@@ -93,18 +93,18 @@ class CommentsClient {
|
|
|
93
93
|
}
|
|
94
94
|
__deleteAttachment(account_id, comment_id, attachment_id, requestOptions) {
|
|
95
95
|
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
96
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
97
97
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
98
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
99
|
-
const _response = yield ((
|
|
100
|
-
url: core.url.join((
|
|
98
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "user-agent": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.userAgent) !== null && _b !== void 0 ? _b : "frameio-ts" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
99
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
100
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.FrameioEnvironment.Default, `v4/accounts/${core.url.encodePathParam(account_id)}/comments/${core.url.encodePathParam(comment_id)}/attachments/${core.url.encodePathParam(attachment_id)}`),
|
|
101
101
|
method: "DELETE",
|
|
102
102
|
headers: _headers,
|
|
103
103
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
104
|
-
timeoutMs: ((
|
|
105
|
-
maxRetries: (
|
|
104
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
105
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
106
106
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
107
|
-
fetchFn: (
|
|
107
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
108
108
|
logging: this._options.logging,
|
|
109
109
|
});
|
|
110
110
|
if (_response.ok) {
|
|
@@ -167,21 +167,21 @@ class CommentsClient {
|
|
|
167
167
|
}
|
|
168
168
|
__createAttachment(account_id, comment_id, request, requestOptions) {
|
|
169
169
|
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
170
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
171
171
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
172
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
173
|
-
const _response = yield ((
|
|
174
|
-
url: core.url.join((
|
|
172
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "user-agent": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.userAgent) !== null && _b !== void 0 ? _b : "frameio-ts" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
173
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
174
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.FrameioEnvironment.Default, `v4/accounts/${core.url.encodePathParam(account_id)}/comments/${core.url.encodePathParam(comment_id)}/attachments`),
|
|
175
175
|
method: "POST",
|
|
176
176
|
headers: _headers,
|
|
177
177
|
contentType: "application/json",
|
|
178
178
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
179
179
|
requestType: "json",
|
|
180
180
|
body: request,
|
|
181
|
-
timeoutMs: ((
|
|
182
|
-
maxRetries: (
|
|
181
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
182
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
183
183
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
184
|
-
fetchFn: (
|
|
184
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
185
185
|
logging: this._options.logging,
|
|
186
186
|
});
|
|
187
187
|
if (_response.ok) {
|
|
@@ -241,23 +241,23 @@ class CommentsClient {
|
|
|
241
241
|
}
|
|
242
242
|
__show(account_id_1, comment_id_1) {
|
|
243
243
|
return __awaiter(this, arguments, void 0, function* (account_id, comment_id, request = {}, requestOptions) {
|
|
244
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
244
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
245
245
|
const { timestamp_as_timecode: timestampAsTimecode, include } = request;
|
|
246
246
|
const _queryParams = {
|
|
247
247
|
timestamp_as_timecode: timestampAsTimecode,
|
|
248
248
|
include: include != null ? include : undefined,
|
|
249
249
|
};
|
|
250
250
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
251
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
252
|
-
const _response = yield ((
|
|
253
|
-
url: core.url.join((
|
|
251
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "user-agent": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.userAgent) !== null && _b !== void 0 ? _b : "frameio-ts" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
252
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
253
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.FrameioEnvironment.Default, `v4/accounts/${core.url.encodePathParam(account_id)}/comments/${core.url.encodePathParam(comment_id)}`),
|
|
254
254
|
method: "GET",
|
|
255
255
|
headers: _headers,
|
|
256
256
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
257
|
-
timeoutMs: ((
|
|
258
|
-
maxRetries: (
|
|
257
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
258
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
259
259
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
260
|
-
fetchFn: (
|
|
260
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
261
261
|
logging: this._options.logging,
|
|
262
262
|
});
|
|
263
263
|
if (_response.ok) {
|
|
@@ -313,18 +313,18 @@ class CommentsClient {
|
|
|
313
313
|
}
|
|
314
314
|
__delete(account_id, comment_id, requestOptions) {
|
|
315
315
|
return __awaiter(this, void 0, void 0, function* () {
|
|
316
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
316
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
317
317
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
318
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
319
|
-
const _response = yield ((
|
|
320
|
-
url: core.url.join((
|
|
318
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "user-agent": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.userAgent) !== null && _b !== void 0 ? _b : "frameio-ts" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
319
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
320
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.FrameioEnvironment.Default, `v4/accounts/${core.url.encodePathParam(account_id)}/comments/${core.url.encodePathParam(comment_id)}`),
|
|
321
321
|
method: "DELETE",
|
|
322
322
|
headers: _headers,
|
|
323
323
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
324
|
-
timeoutMs: ((
|
|
325
|
-
maxRetries: (
|
|
324
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
325
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
326
326
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
327
|
-
fetchFn: (
|
|
327
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
328
328
|
logging: this._options.logging,
|
|
329
329
|
});
|
|
330
330
|
if (_response.ok) {
|
|
@@ -404,25 +404,25 @@ class CommentsClient {
|
|
|
404
404
|
}
|
|
405
405
|
__update(account_id, comment_id, request, requestOptions) {
|
|
406
406
|
return __awaiter(this, void 0, void 0, function* () {
|
|
407
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
407
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
408
408
|
const { timestamp_as_timecode: timestampAsTimecode } = request, _body = __rest(request, ["timestamp_as_timecode"]);
|
|
409
409
|
const _queryParams = {
|
|
410
410
|
timestamp_as_timecode: timestampAsTimecode,
|
|
411
411
|
};
|
|
412
412
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
413
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
414
|
-
const _response = yield ((
|
|
415
|
-
url: core.url.join((
|
|
413
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "user-agent": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.userAgent) !== null && _b !== void 0 ? _b : "frameio-ts" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
414
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
415
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.FrameioEnvironment.Default, `v4/accounts/${core.url.encodePathParam(account_id)}/comments/${core.url.encodePathParam(comment_id)}`),
|
|
416
416
|
method: "PATCH",
|
|
417
417
|
headers: _headers,
|
|
418
418
|
contentType: "application/json",
|
|
419
419
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
420
420
|
requestType: "json",
|
|
421
421
|
body: _body,
|
|
422
|
-
timeoutMs: ((
|
|
423
|
-
maxRetries: (
|
|
422
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
423
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
424
424
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
425
|
-
fetchFn: (
|
|
425
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
426
426
|
logging: this._options.logging,
|
|
427
427
|
});
|
|
428
428
|
if (_response.ok) {
|
|
@@ -485,17 +485,17 @@ class CommentsClient {
|
|
|
485
485
|
return __awaiter(this, arguments, void 0, function* (account_id, file_id, _request = {}, requestOptions) {
|
|
486
486
|
var _a, _b;
|
|
487
487
|
const list = core.HttpResponsePromise.interceptFunction((_requestUrl) => __awaiter(this, void 0, void 0, function* () {
|
|
488
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
488
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
489
489
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
490
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
491
|
-
const _response = yield ((
|
|
490
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "user-agent": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.userAgent) !== null && _b !== void 0 ? _b : "frameio-ts" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
491
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
492
492
|
url: _requestUrl,
|
|
493
493
|
method: "GET",
|
|
494
494
|
headers: _headers,
|
|
495
|
-
timeoutMs: ((
|
|
496
|
-
maxRetries: (
|
|
495
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
496
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
497
497
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
498
|
-
fetchFn: (
|
|
498
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
499
499
|
logging: this._options.logging,
|
|
500
500
|
});
|
|
501
501
|
if (_response.ok) {
|
|
@@ -602,25 +602,25 @@ class CommentsClient {
|
|
|
602
602
|
}
|
|
603
603
|
__create(account_id, file_id, request, requestOptions) {
|
|
604
604
|
return __awaiter(this, void 0, void 0, function* () {
|
|
605
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
605
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
606
606
|
const { timestamp_as_timecode: timestampAsTimecode } = request, _body = __rest(request, ["timestamp_as_timecode"]);
|
|
607
607
|
const _queryParams = {
|
|
608
608
|
timestamp_as_timecode: timestampAsTimecode,
|
|
609
609
|
};
|
|
610
610
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
611
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
612
|
-
const _response = yield ((
|
|
613
|
-
url: core.url.join((
|
|
611
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "user-agent": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.userAgent) !== null && _b !== void 0 ? _b : "frameio-ts" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
612
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
613
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.FrameioEnvironment.Default, `v4/accounts/${core.url.encodePathParam(account_id)}/files/${core.url.encodePathParam(file_id)}/comments`),
|
|
614
614
|
method: "POST",
|
|
615
615
|
headers: _headers,
|
|
616
616
|
contentType: "application/json",
|
|
617
617
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
618
618
|
requestType: "json",
|
|
619
619
|
body: _body,
|
|
620
|
-
timeoutMs: ((
|
|
621
|
-
maxRetries: (
|
|
620
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
621
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
622
622
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
623
|
-
fetchFn: (
|
|
623
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
624
624
|
logging: this._options.logging,
|
|
625
625
|
});
|
|
626
626
|
if (_response.ok) {
|