@usehercules/sdk 1.13.0 → 1.14.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/CHANGELOG.md +40 -0
- package/client.d.mts +10 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +10 -2
- package/client.d.ts.map +1 -1
- package/client.js +8 -0
- package/client.js.map +1 -1
- package/client.mjs +8 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/commerce/commerce.d.mts +15 -1
- package/resources/commerce/commerce.d.mts.map +1 -1
- package/resources/commerce/commerce.d.ts +15 -1
- package/resources/commerce/commerce.d.ts.map +1 -1
- package/resources/commerce/commerce.js.map +1 -1
- package/resources/commerce/commerce.mjs.map +1 -1
- package/resources/commerce/coupons.d.mts +14 -4
- package/resources/commerce/coupons.d.mts.map +1 -1
- package/resources/commerce/coupons.d.ts +14 -4
- package/resources/commerce/coupons.d.ts.map +1 -1
- package/resources/commerce/coupons.js.map +1 -1
- package/resources/commerce/coupons.mjs.map +1 -1
- package/resources/commerce/customers.d.mts +1 -2
- package/resources/commerce/customers.d.mts.map +1 -1
- package/resources/commerce/customers.d.ts +1 -2
- package/resources/commerce/customers.d.ts.map +1 -1
- package/resources/commerce/customers.js +1 -2
- package/resources/commerce/customers.js.map +1 -1
- package/resources/commerce/customers.mjs +1 -2
- package/resources/commerce/customers.mjs.map +1 -1
- package/resources/commerce/index.d.mts +1 -1
- package/resources/commerce/index.d.mts.map +1 -1
- package/resources/commerce/index.d.ts +1 -1
- package/resources/commerce/index.d.ts.map +1 -1
- package/resources/commerce/index.js.map +1 -1
- package/resources/commerce/index.mjs.map +1 -1
- package/resources/commerce/products/products.d.mts +14 -3
- package/resources/commerce/products/products.d.mts.map +1 -1
- package/resources/commerce/products/products.d.ts +14 -3
- package/resources/commerce/products/products.d.ts.map +1 -1
- package/resources/commerce/products/products.js.map +1 -1
- package/resources/commerce/products/products.mjs.map +1 -1
- package/resources/commerce/products/variants.d.mts +27 -6
- package/resources/commerce/products/variants.d.mts.map +1 -1
- package/resources/commerce/products/variants.d.ts +27 -6
- package/resources/commerce/products/variants.d.ts.map +1 -1
- package/resources/commerce/products/variants.js.map +1 -1
- package/resources/commerce/products/variants.mjs.map +1 -1
- package/resources/files.d.mts +133 -0
- package/resources/files.d.mts.map +1 -0
- package/resources/files.d.ts +133 -0
- package/resources/files.d.ts.map +1 -0
- package/resources/files.js +29 -0
- package/resources/files.js.map +1 -0
- package/resources/files.mjs +25 -0
- package/resources/files.mjs.map +1 -0
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +18 -0
- package/src/resources/commerce/commerce.ts +150 -0
- package/src/resources/commerce/coupons.ts +14 -4
- package/src/resources/commerce/customers.ts +1 -2
- package/src/resources/commerce/index.ts +1 -0
- package/src/resources/commerce/products/products.ts +13 -2
- package/src/resources/commerce/products/variants.ts +26 -5
- package/src/resources/files.ts +168 -0
- package/src/resources/index.ts +2 -0
- 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
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../core/pagination.mjs";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Upload, retrieve, and list files and media associated with a website.
|
|
7
|
+
* Upload is a two-step process: first create an upload to get a presigned URL,
|
|
8
|
+
* then complete the upload after putting the file content to the presigned URL.
|
|
9
|
+
*/
|
|
10
|
+
export declare class Files extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves a paginated list of files uploaded to the website. Supports filtering
|
|
13
|
+
* by MIME type, folder path, creation date, and filename search.
|
|
14
|
+
*/
|
|
15
|
+
list(query?: FileListParams | null | undefined, options?: RequestOptions): PagePromise<FilesCursorIDPage, File>;
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves a file by its ID, including its CDN URL and metadata.
|
|
18
|
+
*/
|
|
19
|
+
get(fileID: string, options?: RequestOptions): APIPromise<File>;
|
|
20
|
+
}
|
|
21
|
+
export type FilesCursorIDPage = CursorIDPage<File>;
|
|
22
|
+
/**
|
|
23
|
+
* A file uploaded to CDN storage, linked to a website.
|
|
24
|
+
*/
|
|
25
|
+
export interface File {
|
|
26
|
+
/**
|
|
27
|
+
* Unique identifier for the file
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
/**
|
|
31
|
+
* Timestamp when the file was created
|
|
32
|
+
*/
|
|
33
|
+
created: string;
|
|
34
|
+
/**
|
|
35
|
+
* Original filename
|
|
36
|
+
*/
|
|
37
|
+
filename: string;
|
|
38
|
+
/**
|
|
39
|
+
* MIME type (e.g., 'image/jpeg', 'application/pdf')
|
|
40
|
+
*/
|
|
41
|
+
mime_type: string;
|
|
42
|
+
/**
|
|
43
|
+
* File size in bytes
|
|
44
|
+
*/
|
|
45
|
+
size: number;
|
|
46
|
+
/**
|
|
47
|
+
* Timestamp when the file was last updated
|
|
48
|
+
*/
|
|
49
|
+
updated: string;
|
|
50
|
+
/**
|
|
51
|
+
* Public CDN URL to access the file
|
|
52
|
+
*/
|
|
53
|
+
url: string;
|
|
54
|
+
/**
|
|
55
|
+
* SHA256 hash of the file content
|
|
56
|
+
*/
|
|
57
|
+
content_hash?: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* Additional file metadata
|
|
60
|
+
*/
|
|
61
|
+
metadata?: {
|
|
62
|
+
[key: string]: unknown;
|
|
63
|
+
} | null;
|
|
64
|
+
/**
|
|
65
|
+
* Folder path within the website (e.g., '/images/blog')
|
|
66
|
+
*/
|
|
67
|
+
path?: string | null;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Response containing a presigned upload URL. PUT the file content to upload_url
|
|
71
|
+
* with the provided headers, then call complete to finalize.
|
|
72
|
+
*/
|
|
73
|
+
export interface Upload {
|
|
74
|
+
/**
|
|
75
|
+
* File ID to use when completing the upload
|
|
76
|
+
*/
|
|
77
|
+
id: string;
|
|
78
|
+
/**
|
|
79
|
+
* Headers to include with the PUT request
|
|
80
|
+
*/
|
|
81
|
+
upload_headers: {
|
|
82
|
+
[key: string]: string;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Presigned URL to PUT the file content to
|
|
86
|
+
*/
|
|
87
|
+
upload_url: string;
|
|
88
|
+
}
|
|
89
|
+
export interface FileListParams extends CursorIDPageParams {
|
|
90
|
+
/**
|
|
91
|
+
* Filter by creation date
|
|
92
|
+
*/
|
|
93
|
+
created?: FileListParams.Created;
|
|
94
|
+
/**
|
|
95
|
+
* Filter by MIME type (supports wildcards like 'image/\*')
|
|
96
|
+
*/
|
|
97
|
+
mime_type?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Filter by folder path
|
|
100
|
+
*/
|
|
101
|
+
path?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Search in filename
|
|
104
|
+
*/
|
|
105
|
+
query?: string;
|
|
106
|
+
}
|
|
107
|
+
export declare namespace FileListParams {
|
|
108
|
+
/**
|
|
109
|
+
* Filter by creation date
|
|
110
|
+
*/
|
|
111
|
+
interface Created {
|
|
112
|
+
/**
|
|
113
|
+
* Greater than (Unix timestamp in seconds)
|
|
114
|
+
*/
|
|
115
|
+
gt?: number;
|
|
116
|
+
/**
|
|
117
|
+
* Greater than or equal (Unix timestamp in seconds)
|
|
118
|
+
*/
|
|
119
|
+
gte?: number;
|
|
120
|
+
/**
|
|
121
|
+
* Less than (Unix timestamp in seconds)
|
|
122
|
+
*/
|
|
123
|
+
lt?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Less than or equal (Unix timestamp in seconds)
|
|
126
|
+
*/
|
|
127
|
+
lte?: number;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
export declare namespace Files {
|
|
131
|
+
export { type File as File, type Upload as Upload, type FilesCursorIDPage as FilesCursorIDPage, type FileListParams as FileListParams, };
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=files.d.mts.map
|
|
@@ -0,0 +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,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OACtD,EAAE,cAAc,EAAE;AAGzB;;;;GAIG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;OAGG;IACH,IAAI,CACF,KAAK,GAAE,cAAc,GAAG,IAAI,GAAG,SAAc,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,iBAAiB,EAAE,IAAI,CAAC;IAIvC;;OAEG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAGhE;AAED,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAE7C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,cAAc,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAE1C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC;IAEjC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,yBAAiB,cAAc,CAAC;IAC9B;;OAEG;IACH,UAAiB,OAAO;QACtB;;WAEG;QACH,EAAE,CAAC,EAAE,MAAM,CAAC;QAEZ;;WAEG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,EAAE,CAAC,EAAE,MAAM,CAAC;QAEZ;;WAEG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,IAAI,IAAI,IAAI,EACjB,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;CACH"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../core/pagination.js";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Upload, retrieve, and list files and media associated with a website.
|
|
7
|
+
* Upload is a two-step process: first create an upload to get a presigned URL,
|
|
8
|
+
* then complete the upload after putting the file content to the presigned URL.
|
|
9
|
+
*/
|
|
10
|
+
export declare class Files extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves a paginated list of files uploaded to the website. Supports filtering
|
|
13
|
+
* by MIME type, folder path, creation date, and filename search.
|
|
14
|
+
*/
|
|
15
|
+
list(query?: FileListParams | null | undefined, options?: RequestOptions): PagePromise<FilesCursorIDPage, File>;
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves a file by its ID, including its CDN URL and metadata.
|
|
18
|
+
*/
|
|
19
|
+
get(fileID: string, options?: RequestOptions): APIPromise<File>;
|
|
20
|
+
}
|
|
21
|
+
export type FilesCursorIDPage = CursorIDPage<File>;
|
|
22
|
+
/**
|
|
23
|
+
* A file uploaded to CDN storage, linked to a website.
|
|
24
|
+
*/
|
|
25
|
+
export interface File {
|
|
26
|
+
/**
|
|
27
|
+
* Unique identifier for the file
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
/**
|
|
31
|
+
* Timestamp when the file was created
|
|
32
|
+
*/
|
|
33
|
+
created: string;
|
|
34
|
+
/**
|
|
35
|
+
* Original filename
|
|
36
|
+
*/
|
|
37
|
+
filename: string;
|
|
38
|
+
/**
|
|
39
|
+
* MIME type (e.g., 'image/jpeg', 'application/pdf')
|
|
40
|
+
*/
|
|
41
|
+
mime_type: string;
|
|
42
|
+
/**
|
|
43
|
+
* File size in bytes
|
|
44
|
+
*/
|
|
45
|
+
size: number;
|
|
46
|
+
/**
|
|
47
|
+
* Timestamp when the file was last updated
|
|
48
|
+
*/
|
|
49
|
+
updated: string;
|
|
50
|
+
/**
|
|
51
|
+
* Public CDN URL to access the file
|
|
52
|
+
*/
|
|
53
|
+
url: string;
|
|
54
|
+
/**
|
|
55
|
+
* SHA256 hash of the file content
|
|
56
|
+
*/
|
|
57
|
+
content_hash?: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* Additional file metadata
|
|
60
|
+
*/
|
|
61
|
+
metadata?: {
|
|
62
|
+
[key: string]: unknown;
|
|
63
|
+
} | null;
|
|
64
|
+
/**
|
|
65
|
+
* Folder path within the website (e.g., '/images/blog')
|
|
66
|
+
*/
|
|
67
|
+
path?: string | null;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Response containing a presigned upload URL. PUT the file content to upload_url
|
|
71
|
+
* with the provided headers, then call complete to finalize.
|
|
72
|
+
*/
|
|
73
|
+
export interface Upload {
|
|
74
|
+
/**
|
|
75
|
+
* File ID to use when completing the upload
|
|
76
|
+
*/
|
|
77
|
+
id: string;
|
|
78
|
+
/**
|
|
79
|
+
* Headers to include with the PUT request
|
|
80
|
+
*/
|
|
81
|
+
upload_headers: {
|
|
82
|
+
[key: string]: string;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Presigned URL to PUT the file content to
|
|
86
|
+
*/
|
|
87
|
+
upload_url: string;
|
|
88
|
+
}
|
|
89
|
+
export interface FileListParams extends CursorIDPageParams {
|
|
90
|
+
/**
|
|
91
|
+
* Filter by creation date
|
|
92
|
+
*/
|
|
93
|
+
created?: FileListParams.Created;
|
|
94
|
+
/**
|
|
95
|
+
* Filter by MIME type (supports wildcards like 'image/\*')
|
|
96
|
+
*/
|
|
97
|
+
mime_type?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Filter by folder path
|
|
100
|
+
*/
|
|
101
|
+
path?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Search in filename
|
|
104
|
+
*/
|
|
105
|
+
query?: string;
|
|
106
|
+
}
|
|
107
|
+
export declare namespace FileListParams {
|
|
108
|
+
/**
|
|
109
|
+
* Filter by creation date
|
|
110
|
+
*/
|
|
111
|
+
interface Created {
|
|
112
|
+
/**
|
|
113
|
+
* Greater than (Unix timestamp in seconds)
|
|
114
|
+
*/
|
|
115
|
+
gt?: number;
|
|
116
|
+
/**
|
|
117
|
+
* Greater than or equal (Unix timestamp in seconds)
|
|
118
|
+
*/
|
|
119
|
+
gte?: number;
|
|
120
|
+
/**
|
|
121
|
+
* Less than (Unix timestamp in seconds)
|
|
122
|
+
*/
|
|
123
|
+
lt?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Less than or equal (Unix timestamp in seconds)
|
|
126
|
+
*/
|
|
127
|
+
lte?: number;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
export declare namespace Files {
|
|
131
|
+
export { type File as File, type Upload as Upload, type FilesCursorIDPage as FilesCursorIDPage, type FileListParams as FileListParams, };
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +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,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OACtD,EAAE,cAAc,EAAE;AAGzB;;;;GAIG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;OAGG;IACH,IAAI,CACF,KAAK,GAAE,cAAc,GAAG,IAAI,GAAG,SAAc,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,iBAAiB,EAAE,IAAI,CAAC;IAIvC;;OAEG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAGhE;AAED,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAE7C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,cAAc,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAE1C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC;IAEjC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,yBAAiB,cAAc,CAAC;IAC9B;;OAEG;IACH,UAAiB,OAAO;QACtB;;WAEG;QACH,EAAE,CAAC,EAAE,MAAM,CAAC;QAEZ;;WAEG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,EAAE,CAAC,EAAE,MAAM,CAAC;QAEZ;;WAEG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,IAAI,IAAI,IAAI,EACjB,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;CACH"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Files = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../core/pagination.js");
|
|
7
|
+
const path_1 = require("../internal/utils/path.js");
|
|
8
|
+
/**
|
|
9
|
+
* Upload, retrieve, and list files and media associated with a website.
|
|
10
|
+
* Upload is a two-step process: first create an upload to get a presigned URL,
|
|
11
|
+
* then complete the upload after putting the file content to the presigned URL.
|
|
12
|
+
*/
|
|
13
|
+
class Files extends resource_1.APIResource {
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves a paginated list of files uploaded to the website. Supports filtering
|
|
16
|
+
* by MIME type, folder path, creation date, and filename search.
|
|
17
|
+
*/
|
|
18
|
+
list(query = {}, options) {
|
|
19
|
+
return this._client.getAPIList('/v1/files', (pagination_1.CursorIDPage), { query, ...options });
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves a file by its ID, including its CDN URL and metadata.
|
|
23
|
+
*/
|
|
24
|
+
get(fileID, options) {
|
|
25
|
+
return this._client.get((0, path_1.path) `/v1/files/${fileID}`, options);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.Files = Files;
|
|
29
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAwF;AAExF,oDAA8C;AAE9C;;;;GAIG;AACH,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;OAGG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA,yBAAkB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,MAAc,EAAE,OAAwB;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF;AAlBD,sBAkBC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { CursorIDPage } from "../core/pagination.mjs";
|
|
4
|
+
import { path } from "../internal/utils/path.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Upload, retrieve, and list files and media associated with a website.
|
|
7
|
+
* Upload is a two-step process: first create an upload to get a presigned URL,
|
|
8
|
+
* then complete the upload after putting the file content to the presigned URL.
|
|
9
|
+
*/
|
|
10
|
+
export class Files extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves a paginated list of files uploaded to the website. Supports filtering
|
|
13
|
+
* by MIME type, folder path, creation date, and filename search.
|
|
14
|
+
*/
|
|
15
|
+
list(query = {}, options) {
|
|
16
|
+
return this._client.getAPIList('/v1/files', (CursorIDPage), { query, ...options });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves a file by its ID, including its CDN URL and metadata.
|
|
20
|
+
*/
|
|
21
|
+
get(fileID, options) {
|
|
22
|
+
return this._client.get(path `/v1/files/${fileID}`, options);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=files.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.mjs","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAwC;OAEtD,EAAE,IAAI,EAAE;AAEf;;;;GAIG;AACH,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;OAGG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA,YAAkB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,MAAc,EAAE,OAAwB;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF"}
|
package/resources/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { Commerce, type CommerceCancelResponse, type CommerceCheckResponse, type CommerceCheckoutResponse, type CommerceCancelParams, type CommerceCheckParams, type CommerceCheckoutParams, } from "./commerce/commerce.mjs";
|
|
1
|
+
export { Commerce, type Currency, type CommerceCancelResponse, type CommerceCheckResponse, type CommerceCheckoutResponse, type CommerceCancelParams, type CommerceCheckParams, type CommerceCheckoutParams, } from "./commerce/commerce.mjs";
|
|
2
2
|
export { Content } from "./content/content.mjs";
|
|
3
|
+
export { Files, type File, type Upload, type FileListParams, type FilesCursorIDPage } from "./files.mjs";
|
|
3
4
|
export { PushNotifications, type PushNotificationEnableResponse, type PushNotificationIdentifyResponse, type PushNotificationSendResponse, type PushNotificationSubscribeResponse, type PushNotificationUnsubscribeResponse, type PushNotificationIdentifyParams, type PushNotificationSendParams, type PushNotificationSubscribeParams, type PushNotificationUnsubscribeParams, } from "./push-notifications/push-notifications.mjs";
|
|
4
5
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B;OACM,EAAE,OAAO,EAAE;OACX,EACL,iBAAiB,EACjB,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,EACpC,KAAK,iCAAiC,GACvC"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B;OACM,EAAE,OAAO,EAAE;OACX,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE;OAC9E,EACL,iBAAiB,EACjB,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,EACpC,KAAK,iCAAiC,GACvC"}
|
package/resources/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { Commerce, type CommerceCancelResponse, type CommerceCheckResponse, type CommerceCheckoutResponse, type CommerceCancelParams, type CommerceCheckParams, type CommerceCheckoutParams, } from "./commerce/commerce.js";
|
|
1
|
+
export { Commerce, type Currency, type CommerceCancelResponse, type CommerceCheckResponse, type CommerceCheckoutResponse, type CommerceCancelParams, type CommerceCheckParams, type CommerceCheckoutParams, } from "./commerce/commerce.js";
|
|
2
2
|
export { Content } from "./content/content.js";
|
|
3
|
+
export { Files, type File, type Upload, type FileListParams, type FilesCursorIDPage } from "./files.js";
|
|
3
4
|
export { PushNotifications, type PushNotificationEnableResponse, type PushNotificationIdentifyResponse, type PushNotificationSendResponse, type PushNotificationSubscribeResponse, type PushNotificationUnsubscribeResponse, type PushNotificationIdentifyParams, type PushNotificationSendParams, type PushNotificationSubscribeParams, type PushNotificationUnsubscribeParams, } from "./push-notifications/push-notifications.js";
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
package/resources/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B;OACM,EAAE,OAAO,EAAE;OACX,EACL,iBAAiB,EACjB,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,EACpC,KAAK,iCAAiC,GACvC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B;OACM,EAAE,OAAO,EAAE;OACX,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE;OAC9E,EACL,iBAAiB,EACjB,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,EACpC,KAAK,iCAAiC,GACvC"}
|
package/resources/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.PushNotifications = exports.Content = exports.Commerce = void 0;
|
|
4
|
+
exports.PushNotifications = exports.Files = exports.Content = exports.Commerce = void 0;
|
|
5
5
|
var commerce_1 = require("./commerce/commerce.js");
|
|
6
6
|
Object.defineProperty(exports, "Commerce", { enumerable: true, get: function () { return commerce_1.Commerce; } });
|
|
7
7
|
var content_1 = require("./content/content.js");
|
|
8
8
|
Object.defineProperty(exports, "Content", { enumerable: true, get: function () { return content_1.Content; } });
|
|
9
|
+
var files_1 = require("./files.js");
|
|
10
|
+
Object.defineProperty(exports, "Files", { enumerable: true, get: function () { return files_1.Files; } });
|
|
9
11
|
var push_notifications_1 = require("./push-notifications/push-notifications.js");
|
|
10
12
|
Object.defineProperty(exports, "PushNotifications", { enumerable: true, get: function () { return push_notifications_1.PushNotifications; } });
|
|
11
13
|
//# sourceMappingURL=index.js.map
|
package/resources/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAS6B;AAR3B,oGAAA,QAAQ,OAAA;AASV,gDAA4C;AAAnC,kGAAA,OAAO,OAAA;AAChB,oCAAqG;AAA5F,8FAAA,KAAK,OAAA;AACd,iFAWiD;AAV/C,uHAAA,iBAAiB,OAAA"}
|
package/resources/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
export { Commerce, } from "./commerce/commerce.mjs";
|
|
3
3
|
export { Content } from "./content/content.mjs";
|
|
4
|
+
export { Files } from "./files.mjs";
|
|
4
5
|
export { PushNotifications, } from "./push-notifications/push-notifications.mjs";
|
|
5
6
|
//# sourceMappingURL=index.mjs.map
|
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,QAAQ,GAQT;OACM,EAAE,OAAO,EAAE;OACX,EAAE,KAAK,EAAuE;OAC9E,EACL,iBAAiB,GAUlB"}
|
package/src/client.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { AbstractPage, type CursorIDPageParams, CursorIDPageResponse } from './c
|
|
|
19
19
|
import * as Uploads from './core/uploads';
|
|
20
20
|
import * as API from './resources/index';
|
|
21
21
|
import { APIPromise } from './core/api-promise';
|
|
22
|
+
import { File, FileListParams, Files, FilesCursorIDPage, Upload } from './resources/files';
|
|
22
23
|
import {
|
|
23
24
|
Commerce,
|
|
24
25
|
CommerceCancelParams,
|
|
@@ -27,6 +28,7 @@ import {
|
|
|
27
28
|
CommerceCheckResponse,
|
|
28
29
|
CommerceCheckoutParams,
|
|
29
30
|
CommerceCheckoutResponse,
|
|
31
|
+
Currency,
|
|
30
32
|
} from './resources/commerce/commerce';
|
|
31
33
|
import { Content } from './resources/content/content';
|
|
32
34
|
import {
|
|
@@ -767,11 +769,18 @@ export class Hercules {
|
|
|
767
769
|
* Content APIs are currently in beta.
|
|
768
770
|
*/
|
|
769
771
|
content: API.Content = new API.Content(this);
|
|
772
|
+
/**
|
|
773
|
+
* Upload, retrieve, and list files and media associated with a website.
|
|
774
|
+
* Upload is a two-step process: first create an upload to get a presigned URL,
|
|
775
|
+
* then complete the upload after putting the file content to the presigned URL.
|
|
776
|
+
*/
|
|
777
|
+
files: API.Files = new API.Files(this);
|
|
770
778
|
pushNotifications: API.PushNotifications = new API.PushNotifications(this);
|
|
771
779
|
}
|
|
772
780
|
|
|
773
781
|
Hercules.Commerce = Commerce;
|
|
774
782
|
Hercules.Content = Content;
|
|
783
|
+
Hercules.Files = Files;
|
|
775
784
|
Hercules.PushNotifications = PushNotifications;
|
|
776
785
|
|
|
777
786
|
export declare namespace Hercules {
|
|
@@ -782,6 +791,7 @@ export declare namespace Hercules {
|
|
|
782
791
|
|
|
783
792
|
export {
|
|
784
793
|
Commerce as Commerce,
|
|
794
|
+
type Currency as Currency,
|
|
785
795
|
type CommerceCancelResponse as CommerceCancelResponse,
|
|
786
796
|
type CommerceCheckResponse as CommerceCheckResponse,
|
|
787
797
|
type CommerceCheckoutResponse as CommerceCheckoutResponse,
|
|
@@ -792,6 +802,14 @@ export declare namespace Hercules {
|
|
|
792
802
|
|
|
793
803
|
export { Content as Content };
|
|
794
804
|
|
|
805
|
+
export {
|
|
806
|
+
Files as Files,
|
|
807
|
+
type File as File,
|
|
808
|
+
type Upload as Upload,
|
|
809
|
+
type FilesCursorIDPage as FilesCursorIDPage,
|
|
810
|
+
type FileListParams as FileListParams,
|
|
811
|
+
};
|
|
812
|
+
|
|
795
813
|
export {
|
|
796
814
|
PushNotifications as PushNotifications,
|
|
797
815
|
type PushNotificationEnableResponse as PushNotificationEnableResponse,
|
|
@@ -108,6 +108,155 @@ export class Commerce extends APIResource {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
/**
|
|
112
|
+
* Three-letter ISO currency code.
|
|
113
|
+
*
|
|
114
|
+
* Supported currencies: USD, AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN,
|
|
115
|
+
* BAM, BBD, BDT, BIF, BMD, BND, BOB, BRL, BSD, BWP, BYN, BZD, CAD, CDF, CHF, CLP,
|
|
116
|
+
* CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL,
|
|
117
|
+
* GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF, IDR, ILS, INR, ISK, JMD, JPY, KES,
|
|
118
|
+
* KGS, KHR, KMF, KRW, KYD, KZT, LAK, LBP, LKR, LRD, LSL, MAD, MDL, MGA, MKD, MMK,
|
|
119
|
+
* MNT, MOP, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, PAB, PEN,
|
|
120
|
+
* PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP,
|
|
121
|
+
* SLE, SOS, SRD, STD, SZL, THB, TJS, TOP, TRY, TTD, TWD, TZS, UAH, UGX, UYU, UZS,
|
|
122
|
+
* VND, VUV, WST, XAF, XCD, XCG, XOF, XPF, YER, ZAR, ZMW.
|
|
123
|
+
*/
|
|
124
|
+
export type Currency =
|
|
125
|
+
| 'USD'
|
|
126
|
+
| 'AED'
|
|
127
|
+
| 'AFN'
|
|
128
|
+
| 'ALL'
|
|
129
|
+
| 'AMD'
|
|
130
|
+
| 'ANG'
|
|
131
|
+
| 'AOA'
|
|
132
|
+
| 'ARS'
|
|
133
|
+
| 'AUD'
|
|
134
|
+
| 'AWG'
|
|
135
|
+
| 'AZN'
|
|
136
|
+
| 'BAM'
|
|
137
|
+
| 'BBD'
|
|
138
|
+
| 'BDT'
|
|
139
|
+
| 'BIF'
|
|
140
|
+
| 'BMD'
|
|
141
|
+
| 'BND'
|
|
142
|
+
| 'BOB'
|
|
143
|
+
| 'BRL'
|
|
144
|
+
| 'BSD'
|
|
145
|
+
| 'BWP'
|
|
146
|
+
| 'BYN'
|
|
147
|
+
| 'BZD'
|
|
148
|
+
| 'CAD'
|
|
149
|
+
| 'CDF'
|
|
150
|
+
| 'CHF'
|
|
151
|
+
| 'CLP'
|
|
152
|
+
| 'CNY'
|
|
153
|
+
| 'COP'
|
|
154
|
+
| 'CRC'
|
|
155
|
+
| 'CVE'
|
|
156
|
+
| 'CZK'
|
|
157
|
+
| 'DJF'
|
|
158
|
+
| 'DKK'
|
|
159
|
+
| 'DOP'
|
|
160
|
+
| 'DZD'
|
|
161
|
+
| 'EGP'
|
|
162
|
+
| 'ETB'
|
|
163
|
+
| 'EUR'
|
|
164
|
+
| 'FJD'
|
|
165
|
+
| 'FKP'
|
|
166
|
+
| 'GBP'
|
|
167
|
+
| 'GEL'
|
|
168
|
+
| 'GIP'
|
|
169
|
+
| 'GMD'
|
|
170
|
+
| 'GNF'
|
|
171
|
+
| 'GTQ'
|
|
172
|
+
| 'GYD'
|
|
173
|
+
| 'HKD'
|
|
174
|
+
| 'HNL'
|
|
175
|
+
| 'HTG'
|
|
176
|
+
| 'HUF'
|
|
177
|
+
| 'IDR'
|
|
178
|
+
| 'ILS'
|
|
179
|
+
| 'INR'
|
|
180
|
+
| 'ISK'
|
|
181
|
+
| 'JMD'
|
|
182
|
+
| 'JPY'
|
|
183
|
+
| 'KES'
|
|
184
|
+
| 'KGS'
|
|
185
|
+
| 'KHR'
|
|
186
|
+
| 'KMF'
|
|
187
|
+
| 'KRW'
|
|
188
|
+
| 'KYD'
|
|
189
|
+
| 'KZT'
|
|
190
|
+
| 'LAK'
|
|
191
|
+
| 'LBP'
|
|
192
|
+
| 'LKR'
|
|
193
|
+
| 'LRD'
|
|
194
|
+
| 'LSL'
|
|
195
|
+
| 'MAD'
|
|
196
|
+
| 'MDL'
|
|
197
|
+
| 'MGA'
|
|
198
|
+
| 'MKD'
|
|
199
|
+
| 'MMK'
|
|
200
|
+
| 'MNT'
|
|
201
|
+
| 'MOP'
|
|
202
|
+
| 'MUR'
|
|
203
|
+
| 'MVR'
|
|
204
|
+
| 'MWK'
|
|
205
|
+
| 'MXN'
|
|
206
|
+
| 'MYR'
|
|
207
|
+
| 'MZN'
|
|
208
|
+
| 'NAD'
|
|
209
|
+
| 'NGN'
|
|
210
|
+
| 'NIO'
|
|
211
|
+
| 'NOK'
|
|
212
|
+
| 'NPR'
|
|
213
|
+
| 'NZD'
|
|
214
|
+
| 'PAB'
|
|
215
|
+
| 'PEN'
|
|
216
|
+
| 'PGK'
|
|
217
|
+
| 'PHP'
|
|
218
|
+
| 'PKR'
|
|
219
|
+
| 'PLN'
|
|
220
|
+
| 'PYG'
|
|
221
|
+
| 'QAR'
|
|
222
|
+
| 'RON'
|
|
223
|
+
| 'RSD'
|
|
224
|
+
| 'RUB'
|
|
225
|
+
| 'RWF'
|
|
226
|
+
| 'SAR'
|
|
227
|
+
| 'SBD'
|
|
228
|
+
| 'SCR'
|
|
229
|
+
| 'SEK'
|
|
230
|
+
| 'SGD'
|
|
231
|
+
| 'SHP'
|
|
232
|
+
| 'SLE'
|
|
233
|
+
| 'SOS'
|
|
234
|
+
| 'SRD'
|
|
235
|
+
| 'STD'
|
|
236
|
+
| 'SZL'
|
|
237
|
+
| 'THB'
|
|
238
|
+
| 'TJS'
|
|
239
|
+
| 'TOP'
|
|
240
|
+
| 'TRY'
|
|
241
|
+
| 'TTD'
|
|
242
|
+
| 'TWD'
|
|
243
|
+
| 'TZS'
|
|
244
|
+
| 'UAH'
|
|
245
|
+
| 'UGX'
|
|
246
|
+
| 'UYU'
|
|
247
|
+
| 'UZS'
|
|
248
|
+
| 'VND'
|
|
249
|
+
| 'VUV'
|
|
250
|
+
| 'WST'
|
|
251
|
+
| 'XAF'
|
|
252
|
+
| 'XCD'
|
|
253
|
+
| 'XCG'
|
|
254
|
+
| 'XOF'
|
|
255
|
+
| 'XPF'
|
|
256
|
+
| 'YER'
|
|
257
|
+
| 'ZAR'
|
|
258
|
+
| 'ZMW';
|
|
259
|
+
|
|
111
260
|
/**
|
|
112
261
|
* Cancel subscription response
|
|
113
262
|
*/
|
|
@@ -312,6 +461,7 @@ Commerce.Features = Features;
|
|
|
312
461
|
|
|
313
462
|
export declare namespace Commerce {
|
|
314
463
|
export {
|
|
464
|
+
type Currency as Currency,
|
|
315
465
|
type CommerceCancelResponse as CommerceCancelResponse,
|
|
316
466
|
type CommerceCheckResponse as CommerceCheckResponse,
|
|
317
467
|
type CommerceCheckoutResponse as CommerceCheckoutResponse,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as CommerceAPI from './commerce';
|
|
4
5
|
import { APIPromise } from '../../core/api-promise';
|
|
5
6
|
import { CursorIDPage, type CursorIDPageParams, PagePromise } from '../../core/pagination';
|
|
6
7
|
import { RequestOptions } from '../../internal/request-options';
|
|
@@ -170,10 +171,19 @@ export interface CouponCreateParams {
|
|
|
170
171
|
amount_off?: number;
|
|
171
172
|
|
|
172
173
|
/**
|
|
173
|
-
* Three-letter ISO currency code
|
|
174
|
-
*
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
* Three-letter ISO currency code.
|
|
175
|
+
*
|
|
176
|
+
* Supported currencies: USD, AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN,
|
|
177
|
+
* BAM, BBD, BDT, BIF, BMD, BND, BOB, BRL, BSD, BWP, BYN, BZD, CAD, CDF, CHF, CLP,
|
|
178
|
+
* CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL,
|
|
179
|
+
* GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF, IDR, ILS, INR, ISK, JMD, JPY, KES,
|
|
180
|
+
* KGS, KHR, KMF, KRW, KYD, KZT, LAK, LBP, LKR, LRD, LSL, MAD, MDL, MGA, MKD, MMK,
|
|
181
|
+
* MNT, MOP, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, PAB, PEN,
|
|
182
|
+
* PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP,
|
|
183
|
+
* SLE, SOS, SRD, STD, SZL, THB, TJS, TOP, TRY, TTD, TWD, TZS, UAH, UGX, UYU, UZS,
|
|
184
|
+
* VND, VUV, WST, XAF, XCD, XCG, XOF, XPF, YER, ZAR, ZMW.
|
|
185
|
+
*/
|
|
186
|
+
currency?: CommerceAPI.Currency;
|
|
177
187
|
|
|
178
188
|
/**
|
|
179
189
|
* How long the discount applies: once (first payment only), repeating (for
|
|
@@ -83,8 +83,7 @@ export class Customers extends APIResource {
|
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Retrieves a customer by ID. Returns the customer object including contact
|
|
86
|
-
* information
|
|
87
|
-
* payment methods.
|
|
86
|
+
* information and billing address.
|
|
88
87
|
*
|
|
89
88
|
* @example
|
|
90
89
|
* ```ts
|