@composio/client 0.1.0-alpha.10 → 0.1.0-alpha.11
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/CHANGELOG.md +20 -0
- package/client.d.mts +6 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -6
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/auth-configs.d.mts +163 -24
- package/resources/auth-configs.d.mts.map +1 -1
- package/resources/auth-configs.d.ts +163 -24
- package/resources/auth-configs.d.ts.map +1 -1
- package/resources/auth-configs.js +50 -4
- package/resources/auth-configs.js.map +1 -1
- package/resources/auth-configs.mjs +50 -4
- package/resources/auth-configs.mjs.map +1 -1
- package/resources/connected-accounts.d.mts +80 -17
- package/resources/connected-accounts.d.mts.map +1 -1
- package/resources/connected-accounts.d.ts +80 -17
- package/resources/connected-accounts.d.ts.map +1 -1
- package/resources/connected-accounts.js +56 -4
- package/resources/connected-accounts.js.map +1 -1
- package/resources/connected-accounts.mjs +56 -4
- package/resources/connected-accounts.mjs.map +1 -1
- package/resources/files.d.mts +56 -23
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +56 -23
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +20 -2
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +20 -2
- package/resources/files.mjs.map +1 -1
- package/resources/index.d.mts +3 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/mcp/command.d.mts +0 -33
- package/resources/mcp/command.d.mts.map +1 -1
- package/resources/mcp/command.d.ts +0 -33
- package/resources/mcp/command.d.ts.map +1 -1
- package/resources/mcp/command.js +0 -6
- package/resources/mcp/command.js.map +1 -1
- package/resources/mcp/command.mjs +0 -6
- package/resources/mcp/command.mjs.map +1 -1
- package/resources/mcp/index.d.mts +2 -2
- package/resources/mcp/index.d.mts.map +1 -1
- package/resources/mcp/index.d.ts +2 -2
- package/resources/mcp/index.d.ts.map +1 -1
- package/resources/mcp/index.js.map +1 -1
- package/resources/mcp/index.mjs.map +1 -1
- package/resources/mcp/mcp.d.mts +232 -235
- package/resources/mcp/mcp.d.mts.map +1 -1
- package/resources/mcp/mcp.d.ts +232 -235
- package/resources/mcp/mcp.d.ts.map +1 -1
- package/resources/mcp/mcp.js +55 -19
- package/resources/mcp/mcp.js.map +1 -1
- package/resources/mcp/mcp.mjs +55 -19
- package/resources/mcp/mcp.mjs.map +1 -1
- package/resources/migration.d.mts +11 -2
- package/resources/migration.d.mts.map +1 -1
- package/resources/migration.d.ts +11 -2
- package/resources/migration.d.ts.map +1 -1
- package/resources/migration.js +3 -1
- package/resources/migration.js.map +1 -1
- package/resources/migration.mjs +3 -1
- package/resources/migration.mjs.map +1 -1
- package/resources/org/api-key.d.mts +23 -2
- package/resources/org/api-key.d.mts.map +1 -1
- package/resources/org/api-key.d.ts +23 -2
- package/resources/org/api-key.d.ts.map +1 -1
- package/resources/org/api-key.js +15 -2
- package/resources/org/api-key.js.map +1 -1
- package/resources/org/api-key.mjs +15 -2
- package/resources/org/api-key.mjs.map +1 -1
- package/resources/org/project/api-keys.d.mts +97 -20
- package/resources/org/project/api-keys.d.mts.map +1 -1
- package/resources/org/project/api-keys.d.ts +97 -20
- package/resources/org/project/api-keys.d.ts.map +1 -1
- package/resources/org/project/api-keys.js +57 -0
- package/resources/org/project/api-keys.js.map +1 -1
- package/resources/org/project/api-keys.mjs +57 -0
- package/resources/org/project/api-keys.mjs.map +1 -1
- package/resources/org/project/project.d.mts +176 -4
- package/resources/org/project/project.d.mts.map +1 -1
- package/resources/org/project/project.d.ts +176 -4
- package/resources/org/project/project.d.ts.map +1 -1
- package/resources/org/project/project.js +46 -3
- package/resources/org/project/project.js.map +1 -1
- package/resources/org/project/project.mjs +46 -3
- package/resources/org/project/project.mjs.map +1 -1
- package/resources/org/project/trigger.d.mts +101 -1
- package/resources/org/project/trigger.d.mts.map +1 -1
- package/resources/org/project/trigger.d.ts +101 -1
- package/resources/org/project/trigger.d.ts.map +1 -1
- package/resources/org/project/trigger.js +21 -0
- package/resources/org/project/trigger.js.map +1 -1
- package/resources/org/project/trigger.mjs +21 -0
- package/resources/org/project/trigger.mjs.map +1 -1
- package/resources/org/project/webhook.d.mts +86 -15
- package/resources/org/project/webhook.d.mts.map +1 -1
- package/resources/org/project/webhook.d.ts +86 -15
- package/resources/org/project/webhook.d.ts.map +1 -1
- package/resources/org/project/webhook.js +49 -2
- package/resources/org/project/webhook.js.map +1 -1
- package/resources/org/project/webhook.mjs +49 -2
- package/resources/org/project/webhook.mjs.map +1 -1
- package/resources/toolkits.d.mts +195 -7
- package/resources/toolkits.d.mts.map +1 -1
- package/resources/toolkits.d.ts +195 -7
- package/resources/toolkits.d.ts.map +1 -1
- package/resources/toolkits.js +14 -6
- package/resources/toolkits.js.map +1 -1
- package/resources/toolkits.mjs +14 -6
- package/resources/toolkits.mjs.map +1 -1
- package/resources/tools.d.mts +207 -40
- package/resources/tools.d.mts.map +1 -1
- package/resources/tools.d.ts +207 -40
- package/resources/tools.d.ts.map +1 -1
- package/resources/tools.js +58 -5
- package/resources/tools.js.map +1 -1
- package/resources/tools.mjs +58 -5
- package/resources/tools.mjs.map +1 -1
- package/resources/trigger-instances/index.d.mts +1 -1
- package/resources/trigger-instances/index.d.mts.map +1 -1
- package/resources/trigger-instances/index.d.ts +1 -1
- package/resources/trigger-instances/index.d.ts.map +1 -1
- package/resources/trigger-instances/index.js.map +1 -1
- package/resources/trigger-instances/index.mjs.map +1 -1
- package/resources/trigger-instances/trigger-instances.d.mts +21 -24
- package/resources/trigger-instances/trigger-instances.d.mts.map +1 -1
- package/resources/trigger-instances/trigger-instances.d.ts +21 -24
- package/resources/trigger-instances/trigger-instances.d.ts.map +1 -1
- package/resources/trigger-instances/trigger-instances.js +1 -8
- package/resources/trigger-instances/trigger-instances.js.map +1 -1
- package/resources/trigger-instances/trigger-instances.mjs +1 -8
- package/resources/trigger-instances/trigger-instances.mjs.map +1 -1
- package/resources/triggers-types.d.mts +96 -2
- package/resources/triggers-types.d.mts.map +1 -1
- package/resources/triggers-types.d.ts +96 -2
- package/resources/triggers-types.d.ts.map +1 -1
- package/resources/triggers-types.js +23 -1
- package/resources/triggers-types.js.map +1 -1
- package/resources/triggers-types.mjs +23 -1
- package/resources/triggers-types.mjs.map +1 -1
- package/src/client.ts +4 -14
- package/src/resources/auth-configs.ts +164 -24
- package/src/resources/connected-accounts.ts +80 -17
- package/src/resources/files.ts +56 -23
- package/src/resources/index.ts +2 -7
- package/src/resources/mcp/command.ts +1 -46
- package/src/resources/mcp/index.ts +2 -5
- package/src/resources/mcp/mcp.ts +240 -280
- package/src/resources/migration.ts +11 -2
- package/src/resources/org/api-key.ts +23 -2
- package/src/resources/org/project/api-keys.ts +97 -20
- package/src/resources/org/project/project.ts +176 -4
- package/src/resources/org/project/trigger.ts +101 -1
- package/src/resources/org/project/webhook.ts +86 -15
- package/src/resources/toolkits.ts +200 -7
- package/src/resources/tools.ts +207 -40
- package/src/resources/trigger-instances/index.ts +0 -3
- package/src/resources/trigger-instances/trigger-instances.ts +22 -38
- package/src/resources/triggers-types.ts +96 -2
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -7,36 +7,88 @@ const path_1 = require("../internal/utils/path.js");
|
|
|
7
7
|
class ConnectedAccounts extends resource_1.APIResource {
|
|
8
8
|
/**
|
|
9
9
|
* Create a new connected account
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const connectedAccount =
|
|
14
|
+
* await client.connectedAccounts.create({
|
|
15
|
+
* auth_config: { id: 'id' },
|
|
16
|
+
* connection: {},
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
10
19
|
*/
|
|
11
20
|
create(body, options) {
|
|
12
21
|
return this._client.post('/api/v3/connected_accounts', { body, ...options });
|
|
13
22
|
}
|
|
14
23
|
/**
|
|
15
|
-
*
|
|
24
|
+
* Retrieves comprehensive details of a connected account, including authentication
|
|
25
|
+
* configuration, connection status, and all parameters needed for API requests.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const connectedAccount =
|
|
30
|
+
* await client.connectedAccounts.retrieve(
|
|
31
|
+
* 'con_1a2b3c4d5e6f',
|
|
32
|
+
* );
|
|
33
|
+
* ```
|
|
16
34
|
*/
|
|
17
35
|
retrieve(nanoid, options) {
|
|
18
36
|
return this._client.get((0, path_1.path) `/api/v3/connected_accounts/${nanoid}`, options);
|
|
19
37
|
}
|
|
20
38
|
/**
|
|
21
39
|
* List connected accounts with optional filters
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const connectedAccounts =
|
|
44
|
+
* await client.connectedAccounts.list();
|
|
45
|
+
* ```
|
|
22
46
|
*/
|
|
23
47
|
list(query = {}, options) {
|
|
24
48
|
return this._client.get('/api/v3/connected_accounts', { query, ...options });
|
|
25
49
|
}
|
|
26
50
|
/**
|
|
27
|
-
*
|
|
51
|
+
* Soft-deletes a connected account by marking it as deleted in the database. This
|
|
52
|
+
* prevents the account from being used for API calls but preserves the record for
|
|
53
|
+
* audit purposes.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const connectedAccount =
|
|
58
|
+
* await client.connectedAccounts.delete('con_1a2b3c4d5e6f');
|
|
59
|
+
* ```
|
|
28
60
|
*/
|
|
29
61
|
delete(nanoid, options) {
|
|
30
62
|
return this._client.delete((0, path_1.path) `/api/v3/connected_accounts/${nanoid}`, options);
|
|
31
63
|
}
|
|
32
64
|
/**
|
|
33
|
-
*
|
|
65
|
+
* Initiates a new authentication flow for a connected account when credentials
|
|
66
|
+
* have expired or become invalid. This may generate a new authentication URL for
|
|
67
|
+
* OAuth flows or refresh tokens for other auth schemes.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const response = await client.connectedAccounts.refresh(
|
|
72
|
+
* 'con_1a2b3c4d5e6f',
|
|
73
|
+
* );
|
|
74
|
+
* ```
|
|
34
75
|
*/
|
|
35
76
|
refresh(nanoid, options) {
|
|
36
77
|
return this._client.post((0, path_1.path) `/api/v3/connected_accounts/${nanoid}/refresh`, options);
|
|
37
78
|
}
|
|
38
79
|
/**
|
|
39
|
-
*
|
|
80
|
+
* Updates the status of a connected account to either enabled (active) or disabled
|
|
81
|
+
* (inactive). Disabled accounts cannot be used for API calls but remain in the
|
|
82
|
+
* database.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* const response =
|
|
87
|
+
* await client.connectedAccounts.updateStatus(
|
|
88
|
+
* 'con_1a2b3c4d5e6f',
|
|
89
|
+
* { enabled: true },
|
|
90
|
+
* );
|
|
91
|
+
* ```
|
|
40
92
|
*/
|
|
41
93
|
updateStatus(nanoID, body, options) {
|
|
42
94
|
return this._client.patch((0, path_1.path) `/api/v3/connected_accounts/${nanoID}/status`, { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connected-accounts.js","sourceRoot":"","sources":["../src/resources/connected-accounts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,iBAAkB,SAAQ,sBAAW;IAChD
|
|
1
|
+
{"version":3,"file":"connected-accounts.js","sourceRoot":"","sources":["../src/resources/connected-accounts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,iBAAkB,SAAQ,sBAAW;IAChD;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,IAAkC,EAClC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAc,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,8BAA8B,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAAuD,EAAE,EACzD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,MAAc,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,8BAA8B,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAClF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,MAAc,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,8BAA8B,MAAM,UAAU,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,YAAY,CACV,MAAc,EACd,IAAwC,EACxC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,8BAA8B,MAAM,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrG,CAAC;CACF;AAxGD,8CAwGC"}
|
|
@@ -4,36 +4,88 @@ import { path } from "../internal/utils/path.mjs";
|
|
|
4
4
|
export class ConnectedAccounts extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* Create a new connected account
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const connectedAccount =
|
|
11
|
+
* await client.connectedAccounts.create({
|
|
12
|
+
* auth_config: { id: 'id' },
|
|
13
|
+
* connection: {},
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
7
16
|
*/
|
|
8
17
|
create(body, options) {
|
|
9
18
|
return this._client.post('/api/v3/connected_accounts', { body, ...options });
|
|
10
19
|
}
|
|
11
20
|
/**
|
|
12
|
-
*
|
|
21
|
+
* Retrieves comprehensive details of a connected account, including authentication
|
|
22
|
+
* configuration, connection status, and all parameters needed for API requests.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const connectedAccount =
|
|
27
|
+
* await client.connectedAccounts.retrieve(
|
|
28
|
+
* 'con_1a2b3c4d5e6f',
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
13
31
|
*/
|
|
14
32
|
retrieve(nanoid, options) {
|
|
15
33
|
return this._client.get(path `/api/v3/connected_accounts/${nanoid}`, options);
|
|
16
34
|
}
|
|
17
35
|
/**
|
|
18
36
|
* List connected accounts with optional filters
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const connectedAccounts =
|
|
41
|
+
* await client.connectedAccounts.list();
|
|
42
|
+
* ```
|
|
19
43
|
*/
|
|
20
44
|
list(query = {}, options) {
|
|
21
45
|
return this._client.get('/api/v3/connected_accounts', { query, ...options });
|
|
22
46
|
}
|
|
23
47
|
/**
|
|
24
|
-
*
|
|
48
|
+
* Soft-deletes a connected account by marking it as deleted in the database. This
|
|
49
|
+
* prevents the account from being used for API calls but preserves the record for
|
|
50
|
+
* audit purposes.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const connectedAccount =
|
|
55
|
+
* await client.connectedAccounts.delete('con_1a2b3c4d5e6f');
|
|
56
|
+
* ```
|
|
25
57
|
*/
|
|
26
58
|
delete(nanoid, options) {
|
|
27
59
|
return this._client.delete(path `/api/v3/connected_accounts/${nanoid}`, options);
|
|
28
60
|
}
|
|
29
61
|
/**
|
|
30
|
-
*
|
|
62
|
+
* Initiates a new authentication flow for a connected account when credentials
|
|
63
|
+
* have expired or become invalid. This may generate a new authentication URL for
|
|
64
|
+
* OAuth flows or refresh tokens for other auth schemes.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const response = await client.connectedAccounts.refresh(
|
|
69
|
+
* 'con_1a2b3c4d5e6f',
|
|
70
|
+
* );
|
|
71
|
+
* ```
|
|
31
72
|
*/
|
|
32
73
|
refresh(nanoid, options) {
|
|
33
74
|
return this._client.post(path `/api/v3/connected_accounts/${nanoid}/refresh`, options);
|
|
34
75
|
}
|
|
35
76
|
/**
|
|
36
|
-
*
|
|
77
|
+
* Updates the status of a connected account to either enabled (active) or disabled
|
|
78
|
+
* (inactive). Disabled accounts cannot be used for API calls but remain in the
|
|
79
|
+
* database.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* const response =
|
|
84
|
+
* await client.connectedAccounts.updateStatus(
|
|
85
|
+
* 'con_1a2b3c4d5e6f',
|
|
86
|
+
* { enabled: true },
|
|
87
|
+
* );
|
|
88
|
+
* ```
|
|
37
89
|
*/
|
|
38
90
|
updateStatus(nanoID, body, options) {
|
|
39
91
|
return this._client.patch(path `/api/v3/connected_accounts/${nanoID}/status`, { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connected-accounts.mjs","sourceRoot":"","sources":["../src/resources/connected-accounts.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAChD
|
|
1
|
+
{"version":3,"file":"connected-accounts.mjs","sourceRoot":"","sources":["../src/resources/connected-accounts.ts"],"names":[],"mappings":"AAAA,sFAAsF;OA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CHANGED
|
@@ -3,11 +3,29 @@ import { APIPromise } from "../core/api-promise.mjs";
|
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
4
|
export declare class Files extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Retrieves a list of files associated with the authenticated project. Results can
|
|
7
|
+
* be filtered by toolkit and tool slugs.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const files = await client.files.list();
|
|
12
|
+
* ```
|
|
7
13
|
*/
|
|
8
14
|
list(query?: FileListParams | null | undefined, options?: RequestOptions): APIPromise<FileListResponse>;
|
|
9
15
|
/**
|
|
10
|
-
*
|
|
16
|
+
* Generates a presigned URL for uploading a file to S3. This endpoint handles
|
|
17
|
+
* deduplication by checking if a file with the same MD5 hash already exists.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const response = await client.files.createPresignedURL({
|
|
22
|
+
* filename: 'photo.jpg',
|
|
23
|
+
* md5: 'd41d8cd98f00b204e9800998ecf8427e',
|
|
24
|
+
* mimetype: 'image/jpeg',
|
|
25
|
+
* tool_slug: 'resize-image',
|
|
26
|
+
* toolkit_slug: 'image-processing',
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
11
29
|
*/
|
|
12
30
|
createPresignedURL(body: FileCreatePresignedURLParams, options?: RequestOptions): APIPromise<FileCreatePresignedURLResponse>;
|
|
13
31
|
}
|
|
@@ -19,23 +37,25 @@ export interface FileListResponse {
|
|
|
19
37
|
export declare namespace FileListResponse {
|
|
20
38
|
interface Item {
|
|
21
39
|
/**
|
|
22
|
-
* Name of the original file.
|
|
40
|
+
* Name of the original file. Example: "document.docx"
|
|
23
41
|
*/
|
|
24
42
|
filename: string;
|
|
25
43
|
/**
|
|
26
|
-
* MD5 of
|
|
44
|
+
* MD5 hash of the file for integrity verification. Example:
|
|
45
|
+
* "d41d8cd98f00b204e9800998ecf8427e"
|
|
27
46
|
*/
|
|
28
47
|
md5: string;
|
|
29
48
|
/**
|
|
30
|
-
* Mime type of the original file.
|
|
49
|
+
* Mime type of the original file. Example:
|
|
50
|
+
* "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
31
51
|
*/
|
|
32
52
|
mimetype: string;
|
|
33
53
|
/**
|
|
34
|
-
*
|
|
54
|
+
* Slug of the action where this file belongs to. Example: "convert-to-pdf"
|
|
35
55
|
*/
|
|
36
56
|
tool_slug: string;
|
|
37
57
|
/**
|
|
38
|
-
* Slug of the app where this file belongs to.
|
|
58
|
+
* Slug of the app where this file belongs to. Example: "file-converter"
|
|
39
59
|
*/
|
|
40
60
|
toolkit_slug: string;
|
|
41
61
|
}
|
|
@@ -44,79 +64,92 @@ export type FileCreatePresignedURLResponse = FileCreatePresignedURLResponse.Unio
|
|
|
44
64
|
export declare namespace FileCreatePresignedURLResponse {
|
|
45
65
|
interface UnionMember0 {
|
|
46
66
|
/**
|
|
47
|
-
* ID of the request file
|
|
67
|
+
* ID of the request file. Example: "f1e2d3c4b5a6"
|
|
48
68
|
*/
|
|
49
69
|
id: string;
|
|
50
70
|
/**
|
|
51
|
-
* URL of the existing request file
|
|
71
|
+
* URL of the existing request file. Example:
|
|
72
|
+
* "https://storage.example.com/projects/123/files/photo-1234.jpg"
|
|
52
73
|
*/
|
|
53
74
|
existingUrl: string;
|
|
54
75
|
/**
|
|
55
|
-
* S3 upload location
|
|
76
|
+
* S3 upload location. Example: "projects/123/files/photo-1234.jpg"
|
|
56
77
|
*/
|
|
57
78
|
key: string;
|
|
79
|
+
/**
|
|
80
|
+
* Indicates the file already exists and does not need to be uploaded again
|
|
81
|
+
*/
|
|
58
82
|
type: 'existing';
|
|
59
83
|
}
|
|
60
84
|
interface UnionMember1 {
|
|
61
85
|
/**
|
|
62
|
-
* ID of the request file
|
|
86
|
+
* ID of the request file. Example: "f1e2d3c4b5a6"
|
|
63
87
|
*/
|
|
64
88
|
id: string;
|
|
65
89
|
/**
|
|
66
|
-
* S3 upload location
|
|
90
|
+
* S3 upload location. Example: "projects/123/files/photo-1234.jpg"
|
|
67
91
|
*/
|
|
68
92
|
key: string;
|
|
69
93
|
/**
|
|
70
|
-
* Presigned URL for upload
|
|
94
|
+
* Presigned URL for upload. Example:
|
|
95
|
+
* "https://storage.example.com/projects/123/files/photo-1234.jpg?X-Amz-Algorithm=..."
|
|
71
96
|
*/
|
|
72
97
|
newPresignedUrl: string;
|
|
98
|
+
/**
|
|
99
|
+
* Indicates this is a new file that needs to be uploaded
|
|
100
|
+
*/
|
|
73
101
|
type: 'new';
|
|
74
102
|
}
|
|
75
103
|
interface UnionMember2 {
|
|
76
104
|
/**
|
|
77
|
-
* ID of the request file
|
|
105
|
+
* ID of the request file. Example: "f1e2d3c4b5a6"
|
|
78
106
|
*/
|
|
79
107
|
id: string;
|
|
80
108
|
/**
|
|
81
|
-
* S3 upload location
|
|
109
|
+
* S3 upload location. Example: "projects/123/files/photo-1234.jpg"
|
|
82
110
|
*/
|
|
83
111
|
key: string;
|
|
112
|
+
/**
|
|
113
|
+
* Indicates this file exists but needs to be updated with a new version
|
|
114
|
+
*/
|
|
84
115
|
type: 'update';
|
|
85
116
|
/**
|
|
86
|
-
* Presigned URL for upload
|
|
117
|
+
* Presigned URL for upload. Example:
|
|
118
|
+
* "https://storage.example.com/projects/123/files/photo-1234.jpg?X-Amz-Algorithm=..."
|
|
87
119
|
*/
|
|
88
120
|
updatePresignedUrl: string;
|
|
89
121
|
}
|
|
90
122
|
}
|
|
91
123
|
export interface FileListParams {
|
|
92
124
|
/**
|
|
93
|
-
*
|
|
125
|
+
* Filter files by action slug. Example: "convert-to-pdf"
|
|
94
126
|
*/
|
|
95
127
|
tool_slug?: string;
|
|
96
128
|
/**
|
|
97
|
-
*
|
|
129
|
+
* Filter files by app slug. Example: "file-converter"
|
|
98
130
|
*/
|
|
99
131
|
toolkit_slug?: string;
|
|
100
132
|
}
|
|
101
133
|
export interface FileCreatePresignedURLParams {
|
|
102
134
|
/**
|
|
103
|
-
* Name of the original file.
|
|
135
|
+
* Name of the original file. Example: "photo.jpg"
|
|
104
136
|
*/
|
|
105
137
|
filename: string;
|
|
106
138
|
/**
|
|
107
|
-
* MD5 of
|
|
139
|
+
* MD5 hash of the file for deduplication and integrity verification. Example:
|
|
140
|
+
* "d41d8cd98f00b204e9800998ecf8427e"
|
|
108
141
|
*/
|
|
109
142
|
md5: string;
|
|
110
143
|
/**
|
|
111
|
-
* Mime type of the original file.
|
|
144
|
+
* Mime type of the original file. Example: "image/jpeg"
|
|
112
145
|
*/
|
|
113
146
|
mimetype: string;
|
|
114
147
|
/**
|
|
115
|
-
* Slug of the action where this file belongs to.
|
|
148
|
+
* Slug of the action where this file belongs to. Example: "resize-image"
|
|
116
149
|
*/
|
|
117
150
|
tool_slug: string;
|
|
118
151
|
/**
|
|
119
|
-
* Slug of the app where this file belongs to.
|
|
152
|
+
* Slug of the app where this file belongs to. Example: "image-processing"
|
|
120
153
|
*/
|
|
121
154
|
toolkit_slug: string;
|
|
122
155
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.mts","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"files.d.mts","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;OAQG;IACH,IAAI,CACF,KAAK,GAAE,cAAc,GAAG,IAAI,GAAG,SAAc,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,gBAAgB,CAAC;IAI/B;;;;;;;;;;;;;;OAcG;IACH,kBAAkB,CAChB,IAAI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QACH,kBAAkB,EAAE,MAAM,CAAC;KAC5B;CACF;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
|
package/resources/files.d.ts
CHANGED
|
@@ -3,11 +3,29 @@ import { APIPromise } from "../core/api-promise.js";
|
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
4
|
export declare class Files extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Retrieves a list of files associated with the authenticated project. Results can
|
|
7
|
+
* be filtered by toolkit and tool slugs.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const files = await client.files.list();
|
|
12
|
+
* ```
|
|
7
13
|
*/
|
|
8
14
|
list(query?: FileListParams | null | undefined, options?: RequestOptions): APIPromise<FileListResponse>;
|
|
9
15
|
/**
|
|
10
|
-
*
|
|
16
|
+
* Generates a presigned URL for uploading a file to S3. This endpoint handles
|
|
17
|
+
* deduplication by checking if a file with the same MD5 hash already exists.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const response = await client.files.createPresignedURL({
|
|
22
|
+
* filename: 'photo.jpg',
|
|
23
|
+
* md5: 'd41d8cd98f00b204e9800998ecf8427e',
|
|
24
|
+
* mimetype: 'image/jpeg',
|
|
25
|
+
* tool_slug: 'resize-image',
|
|
26
|
+
* toolkit_slug: 'image-processing',
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
11
29
|
*/
|
|
12
30
|
createPresignedURL(body: FileCreatePresignedURLParams, options?: RequestOptions): APIPromise<FileCreatePresignedURLResponse>;
|
|
13
31
|
}
|
|
@@ -19,23 +37,25 @@ export interface FileListResponse {
|
|
|
19
37
|
export declare namespace FileListResponse {
|
|
20
38
|
interface Item {
|
|
21
39
|
/**
|
|
22
|
-
* Name of the original file.
|
|
40
|
+
* Name of the original file. Example: "document.docx"
|
|
23
41
|
*/
|
|
24
42
|
filename: string;
|
|
25
43
|
/**
|
|
26
|
-
* MD5 of
|
|
44
|
+
* MD5 hash of the file for integrity verification. Example:
|
|
45
|
+
* "d41d8cd98f00b204e9800998ecf8427e"
|
|
27
46
|
*/
|
|
28
47
|
md5: string;
|
|
29
48
|
/**
|
|
30
|
-
* Mime type of the original file.
|
|
49
|
+
* Mime type of the original file. Example:
|
|
50
|
+
* "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
31
51
|
*/
|
|
32
52
|
mimetype: string;
|
|
33
53
|
/**
|
|
34
|
-
*
|
|
54
|
+
* Slug of the action where this file belongs to. Example: "convert-to-pdf"
|
|
35
55
|
*/
|
|
36
56
|
tool_slug: string;
|
|
37
57
|
/**
|
|
38
|
-
* Slug of the app where this file belongs to.
|
|
58
|
+
* Slug of the app where this file belongs to. Example: "file-converter"
|
|
39
59
|
*/
|
|
40
60
|
toolkit_slug: string;
|
|
41
61
|
}
|
|
@@ -44,79 +64,92 @@ export type FileCreatePresignedURLResponse = FileCreatePresignedURLResponse.Unio
|
|
|
44
64
|
export declare namespace FileCreatePresignedURLResponse {
|
|
45
65
|
interface UnionMember0 {
|
|
46
66
|
/**
|
|
47
|
-
* ID of the request file
|
|
67
|
+
* ID of the request file. Example: "f1e2d3c4b5a6"
|
|
48
68
|
*/
|
|
49
69
|
id: string;
|
|
50
70
|
/**
|
|
51
|
-
* URL of the existing request file
|
|
71
|
+
* URL of the existing request file. Example:
|
|
72
|
+
* "https://storage.example.com/projects/123/files/photo-1234.jpg"
|
|
52
73
|
*/
|
|
53
74
|
existingUrl: string;
|
|
54
75
|
/**
|
|
55
|
-
* S3 upload location
|
|
76
|
+
* S3 upload location. Example: "projects/123/files/photo-1234.jpg"
|
|
56
77
|
*/
|
|
57
78
|
key: string;
|
|
79
|
+
/**
|
|
80
|
+
* Indicates the file already exists and does not need to be uploaded again
|
|
81
|
+
*/
|
|
58
82
|
type: 'existing';
|
|
59
83
|
}
|
|
60
84
|
interface UnionMember1 {
|
|
61
85
|
/**
|
|
62
|
-
* ID of the request file
|
|
86
|
+
* ID of the request file. Example: "f1e2d3c4b5a6"
|
|
63
87
|
*/
|
|
64
88
|
id: string;
|
|
65
89
|
/**
|
|
66
|
-
* S3 upload location
|
|
90
|
+
* S3 upload location. Example: "projects/123/files/photo-1234.jpg"
|
|
67
91
|
*/
|
|
68
92
|
key: string;
|
|
69
93
|
/**
|
|
70
|
-
* Presigned URL for upload
|
|
94
|
+
* Presigned URL for upload. Example:
|
|
95
|
+
* "https://storage.example.com/projects/123/files/photo-1234.jpg?X-Amz-Algorithm=..."
|
|
71
96
|
*/
|
|
72
97
|
newPresignedUrl: string;
|
|
98
|
+
/**
|
|
99
|
+
* Indicates this is a new file that needs to be uploaded
|
|
100
|
+
*/
|
|
73
101
|
type: 'new';
|
|
74
102
|
}
|
|
75
103
|
interface UnionMember2 {
|
|
76
104
|
/**
|
|
77
|
-
* ID of the request file
|
|
105
|
+
* ID of the request file. Example: "f1e2d3c4b5a6"
|
|
78
106
|
*/
|
|
79
107
|
id: string;
|
|
80
108
|
/**
|
|
81
|
-
* S3 upload location
|
|
109
|
+
* S3 upload location. Example: "projects/123/files/photo-1234.jpg"
|
|
82
110
|
*/
|
|
83
111
|
key: string;
|
|
112
|
+
/**
|
|
113
|
+
* Indicates this file exists but needs to be updated with a new version
|
|
114
|
+
*/
|
|
84
115
|
type: 'update';
|
|
85
116
|
/**
|
|
86
|
-
* Presigned URL for upload
|
|
117
|
+
* Presigned URL for upload. Example:
|
|
118
|
+
* "https://storage.example.com/projects/123/files/photo-1234.jpg?X-Amz-Algorithm=..."
|
|
87
119
|
*/
|
|
88
120
|
updatePresignedUrl: string;
|
|
89
121
|
}
|
|
90
122
|
}
|
|
91
123
|
export interface FileListParams {
|
|
92
124
|
/**
|
|
93
|
-
*
|
|
125
|
+
* Filter files by action slug. Example: "convert-to-pdf"
|
|
94
126
|
*/
|
|
95
127
|
tool_slug?: string;
|
|
96
128
|
/**
|
|
97
|
-
*
|
|
129
|
+
* Filter files by app slug. Example: "file-converter"
|
|
98
130
|
*/
|
|
99
131
|
toolkit_slug?: string;
|
|
100
132
|
}
|
|
101
133
|
export interface FileCreatePresignedURLParams {
|
|
102
134
|
/**
|
|
103
|
-
* Name of the original file.
|
|
135
|
+
* Name of the original file. Example: "photo.jpg"
|
|
104
136
|
*/
|
|
105
137
|
filename: string;
|
|
106
138
|
/**
|
|
107
|
-
* MD5 of
|
|
139
|
+
* MD5 hash of the file for deduplication and integrity verification. Example:
|
|
140
|
+
* "d41d8cd98f00b204e9800998ecf8427e"
|
|
108
141
|
*/
|
|
109
142
|
md5: string;
|
|
110
143
|
/**
|
|
111
|
-
* Mime type of the original file.
|
|
144
|
+
* Mime type of the original file. Example: "image/jpeg"
|
|
112
145
|
*/
|
|
113
146
|
mimetype: string;
|
|
114
147
|
/**
|
|
115
|
-
* Slug of the action where this file belongs to.
|
|
148
|
+
* Slug of the action where this file belongs to. Example: "resize-image"
|
|
116
149
|
*/
|
|
117
150
|
tool_slug: string;
|
|
118
151
|
/**
|
|
119
|
-
* Slug of the app where this file belongs to.
|
|
152
|
+
* Slug of the app where this file belongs to. Example: "image-processing"
|
|
120
153
|
*/
|
|
121
154
|
toolkit_slug: string;
|
|
122
155
|
}
|
package/resources/files.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;OAQG;IACH,IAAI,CACF,KAAK,GAAE,cAAc,GAAG,IAAI,GAAG,SAAc,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,gBAAgB,CAAC;IAI/B;;;;;;;;;;;;;;OAcG;IACH,kBAAkB,CAChB,IAAI,EAAE,4BAA4B,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,8BAA8B,CAAC;CAG9C;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAEpC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,yBAAiB,gBAAgB,CAAC;IAChC,UAAiB,IAAI;QACnB;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;;WAGG;QACH,GAAG,EAAE,MAAM,CAAC;QAEZ;;;WAGG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;KACtB;CACF;AAED,MAAM,MAAM,8BAA8B,GACtC,8BAA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cAAc,EACrC,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
|
package/resources/files.js
CHANGED
|
@@ -5,13 +5,31 @@ exports.Files = void 0;
|
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
class Files extends resource_1.APIResource {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Retrieves a list of files associated with the authenticated project. Results can
|
|
9
|
+
* be filtered by toolkit and tool slugs.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const files = await client.files.list();
|
|
14
|
+
* ```
|
|
9
15
|
*/
|
|
10
16
|
list(query = {}, options) {
|
|
11
17
|
return this._client.get('/api/v3/files/list', { query, ...options });
|
|
12
18
|
}
|
|
13
19
|
/**
|
|
14
|
-
*
|
|
20
|
+
* Generates a presigned URL for uploading a file to S3. This endpoint handles
|
|
21
|
+
* deduplication by checking if a file with the same MD5 hash already exists.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const response = await client.files.createPresignedURL({
|
|
26
|
+
* filename: 'photo.jpg',
|
|
27
|
+
* md5: 'd41d8cd98f00b204e9800998ecf8427e',
|
|
28
|
+
* mimetype: 'image/jpeg',
|
|
29
|
+
* tool_slug: 'resize-image',
|
|
30
|
+
* toolkit_slug: 'image-processing',
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
15
33
|
*/
|
|
16
34
|
createPresignedURL(body, options) {
|
|
17
35
|
return this._client.post('/api/v3/files/upload/request', { body, ...options });
|
package/resources/files.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,KAAM,SAAQ,sBAAW;IACpC
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;OAQG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,kBAAkB,CAChB,IAAkC,EAClC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;CACF;AAtCD,sBAsCC"}
|
package/resources/files.mjs
CHANGED
|
@@ -2,13 +2,31 @@
|
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
export class Files extends APIResource {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Retrieves a list of files associated with the authenticated project. Results can
|
|
6
|
+
* be filtered by toolkit and tool slugs.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const files = await client.files.list();
|
|
11
|
+
* ```
|
|
6
12
|
*/
|
|
7
13
|
list(query = {}, options) {
|
|
8
14
|
return this._client.get('/api/v3/files/list', { query, ...options });
|
|
9
15
|
}
|
|
10
16
|
/**
|
|
11
|
-
*
|
|
17
|
+
* Generates a presigned URL for uploading a file to S3. This endpoint handles
|
|
18
|
+
* deduplication by checking if a file with the same MD5 hash already exists.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const response = await client.files.createPresignedURL({
|
|
23
|
+
* filename: 'photo.jpg',
|
|
24
|
+
* md5: 'd41d8cd98f00b204e9800998ecf8427e',
|
|
25
|
+
* mimetype: 'image/jpeg',
|
|
26
|
+
* tool_slug: 'resize-image',
|
|
27
|
+
* toolkit_slug: 'image-processing',
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
12
30
|
*/
|
|
13
31
|
createPresignedURL(body, options) {
|
|
14
32
|
return this._client.post('/api/v3/files/upload/request', { body, ...options });
|
package/resources/files.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.mjs","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"files.mjs","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;OAQG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,kBAAkB,CAChB,IAAkC,EAClC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;CACF"}
|