@usethrottle/api-client 5.29.0 → 5.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/services/ExtensionsService.d.ts +1 -1
- package/dist/generated/services/ExtensionsService.js +1 -1
- package/dist/generated/services/MediaService.d.ts +14 -14
- package/dist/generated/services/MediaService.d.ts.map +1 -1
- package/dist/generated/services/MediaService.js +8 -8
- package/dist/generated/services/MediaService.js.map +1 -1
- package/package.json +1 -1
|
@@ -1088,7 +1088,7 @@ export declare class ExtensionsService {
|
|
|
1088
1088
|
}>;
|
|
1089
1089
|
/**
|
|
1090
1090
|
* Upload an extension icon (multipart/form-data, field: file).
|
|
1091
|
-
* Accepts PNG, JPEG, WebP or SVG up to 2 MB and returns the public `iconUrl` to set on the extension. Any credential holding `extensions:write` may call it: a secret API key or a dashboard session.
|
|
1091
|
+
* Accepts PNG, JPEG, WebP or SVG up to 2 MB (an SVG is sanitised and can be at most 20 KB; one that cannot be made safe is refused with 422 `invalid_svg`) and returns the public `iconUrl` to set on the extension. Any credential holding `extensions:write` may call it: a secret API key or a dashboard session.
|
|
1092
1092
|
* @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
|
|
1093
1093
|
* @returns any Default Response
|
|
1094
1094
|
* @throws ApiError
|
|
@@ -735,7 +735,7 @@ export class ExtensionsService {
|
|
|
735
735
|
}
|
|
736
736
|
/**
|
|
737
737
|
* Upload an extension icon (multipart/form-data, field: file).
|
|
738
|
-
* Accepts PNG, JPEG, WebP or SVG up to 2 MB and returns the public `iconUrl` to set on the extension. Any credential holding `extensions:write` may call it: a secret API key or a dashboard session.
|
|
738
|
+
* Accepts PNG, JPEG, WebP or SVG up to 2 MB (an SVG is sanitised and can be at most 20 KB; one that cannot be made safe is refused with 422 `invalid_svg`) and returns the public `iconUrl` to set on the extension. Any credential holding `extensions:write` may call it: a secret API key or a dashboard session.
|
|
739
739
|
* @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
|
|
740
740
|
* @returns any Default Response
|
|
741
741
|
* @throws ApiError
|
|
@@ -2,7 +2,7 @@ import type { CancelablePromise } from '../core/CancelablePromise.js';
|
|
|
2
2
|
export declare class MediaService {
|
|
3
3
|
/**
|
|
4
4
|
* Upload an image (multipart/form-data, field: file, optional field: alt).
|
|
5
|
-
* Adds an image to the store's media library. PNG, JPEG, WebP, GIF or
|
|
5
|
+
* Adds an image to the store's media library. PNG, JPEG, WebP, GIF, AVIF or SVG, at most 10 MB and 40 megapixels (an SVG: at most 20 KB). The type is read from the file's bytes, not its declared content type. Stores the original and WebP width variants. A JPEG original loses its EXIF data (GPS, camera) but keeps its pixels and orientation; other raster formats are stored as uploaded. An SVG is sanitised first and the sanitised copy is what is stored and served: scripts, `foreignObject`, `style` elements, event attributes, animation, external references and any DOCTYPE are removed or refused (a DOCTYPE or ENTITY refuses the file), so the stored bytes can differ from the upload. An SVG has no variants; its width and height come from its `viewBox`. Requires `media:write`.
|
|
6
6
|
* @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
|
|
7
7
|
* @returns any Default Response
|
|
8
8
|
* @throws ApiError
|
|
@@ -14,7 +14,7 @@ export declare class MediaService {
|
|
|
14
14
|
* Public URL of the original image.
|
|
15
15
|
*/
|
|
16
16
|
url?: string;
|
|
17
|
-
mime?: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'image/avif';
|
|
17
|
+
mime?: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'image/avif' | 'image/svg+xml';
|
|
18
18
|
/**
|
|
19
19
|
* Size of the original in bytes.
|
|
20
20
|
*/
|
|
@@ -23,7 +23,7 @@ export declare class MediaService {
|
|
|
23
23
|
height?: number;
|
|
24
24
|
alt?: string;
|
|
25
25
|
/**
|
|
26
|
-
* WebP copies at 320, 640, 1024, 1600 and 2400 px wide, never upscaled. Build `srcset` from these.
|
|
26
|
+
* WebP copies at 320, 640, 1024, 1600 and 2400 px wide, never upscaled. Build `srcset` from these. Empty for an SVG.
|
|
27
27
|
*/
|
|
28
28
|
variants?: Array<{
|
|
29
29
|
width?: number;
|
|
@@ -61,7 +61,7 @@ export declare class MediaService {
|
|
|
61
61
|
* Public URL of the original image.
|
|
62
62
|
*/
|
|
63
63
|
url?: string;
|
|
64
|
-
mime?: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'image/avif';
|
|
64
|
+
mime?: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'image/avif' | 'image/svg+xml';
|
|
65
65
|
/**
|
|
66
66
|
* Size of the original in bytes.
|
|
67
67
|
*/
|
|
@@ -70,7 +70,7 @@ export declare class MediaService {
|
|
|
70
70
|
height?: number;
|
|
71
71
|
alt?: string;
|
|
72
72
|
/**
|
|
73
|
-
* WebP copies at 320, 640, 1024, 1600 and 2400 px wide, never upscaled. Build `srcset` from these.
|
|
73
|
+
* WebP copies at 320, 640, 1024, 1600 and 2400 px wide, never upscaled. Build `srcset` from these. Empty for an SVG.
|
|
74
74
|
*/
|
|
75
75
|
variants?: Array<{
|
|
76
76
|
width?: number;
|
|
@@ -86,7 +86,7 @@ export declare class MediaService {
|
|
|
86
86
|
}>;
|
|
87
87
|
/**
|
|
88
88
|
* Add an image from a URL.
|
|
89
|
-
* Throttle downloads the image and adds it to the media library. The URL must be public: private, loopback and link-local addresses are refused on every redirect (at most 3), and the download is capped at 10 MB. Requires `media:write`.
|
|
89
|
+
* Throttle downloads the image and adds it to the media library (an SVG is sanitised the same way as an upload). The URL must be public: private, loopback and link-local addresses are refused on every redirect (at most 3), and the download is capped at 10 MB. Requires `media:write`.
|
|
90
90
|
* @param requestBody
|
|
91
91
|
* @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
|
|
92
92
|
* @returns any Default Response
|
|
@@ -105,7 +105,7 @@ export declare class MediaService {
|
|
|
105
105
|
* Public URL of the original image.
|
|
106
106
|
*/
|
|
107
107
|
url?: string;
|
|
108
|
-
mime?: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'image/avif';
|
|
108
|
+
mime?: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'image/avif' | 'image/svg+xml';
|
|
109
109
|
/**
|
|
110
110
|
* Size of the original in bytes.
|
|
111
111
|
*/
|
|
@@ -114,7 +114,7 @@ export declare class MediaService {
|
|
|
114
114
|
height?: number;
|
|
115
115
|
alt?: string;
|
|
116
116
|
/**
|
|
117
|
-
* WebP copies at 320, 640, 1024, 1600 and 2400 px wide, never upscaled. Build `srcset` from these.
|
|
117
|
+
* WebP copies at 320, 640, 1024, 1600 and 2400 px wide, never upscaled. Build `srcset` from these. Empty for an SVG.
|
|
118
118
|
*/
|
|
119
119
|
variants?: Array<{
|
|
120
120
|
width?: number;
|
|
@@ -149,7 +149,7 @@ export declare class MediaService {
|
|
|
149
149
|
* Public URL of the original image.
|
|
150
150
|
*/
|
|
151
151
|
url?: string;
|
|
152
|
-
mime?: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'image/avif';
|
|
152
|
+
mime?: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'image/avif' | 'image/svg+xml';
|
|
153
153
|
/**
|
|
154
154
|
* Size of the original in bytes.
|
|
155
155
|
*/
|
|
@@ -158,7 +158,7 @@ export declare class MediaService {
|
|
|
158
158
|
height?: number;
|
|
159
159
|
alt?: string;
|
|
160
160
|
/**
|
|
161
|
-
* WebP copies at 320, 640, 1024, 1600 and 2400 px wide, never upscaled. Build `srcset` from these.
|
|
161
|
+
* WebP copies at 320, 640, 1024, 1600 and 2400 px wide, never upscaled. Build `srcset` from these. Empty for an SVG.
|
|
162
162
|
*/
|
|
163
163
|
variants?: Array<{
|
|
164
164
|
width?: number;
|
|
@@ -196,7 +196,7 @@ export declare class MediaService {
|
|
|
196
196
|
* Public URL of the original image.
|
|
197
197
|
*/
|
|
198
198
|
url?: string;
|
|
199
|
-
mime?: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'image/avif';
|
|
199
|
+
mime?: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'image/avif' | 'image/svg+xml';
|
|
200
200
|
/**
|
|
201
201
|
* Size of the original in bytes.
|
|
202
202
|
*/
|
|
@@ -205,7 +205,7 @@ export declare class MediaService {
|
|
|
205
205
|
height?: number;
|
|
206
206
|
alt?: string;
|
|
207
207
|
/**
|
|
208
|
-
* WebP copies at 320, 640, 1024, 1600 and 2400 px wide, never upscaled. Build `srcset` from these.
|
|
208
|
+
* WebP copies at 320, 640, 1024, 1600 and 2400 px wide, never upscaled. Build `srcset` from these. Empty for an SVG.
|
|
209
209
|
*/
|
|
210
210
|
variants?: Array<{
|
|
211
211
|
width?: number;
|
|
@@ -240,7 +240,7 @@ export declare class MediaService {
|
|
|
240
240
|
* Public URL of the original image.
|
|
241
241
|
*/
|
|
242
242
|
url?: string;
|
|
243
|
-
mime?: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'image/avif';
|
|
243
|
+
mime?: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'image/avif' | 'image/svg+xml';
|
|
244
244
|
/**
|
|
245
245
|
* Size of the original in bytes.
|
|
246
246
|
*/
|
|
@@ -249,7 +249,7 @@ export declare class MediaService {
|
|
|
249
249
|
height?: number;
|
|
250
250
|
alt?: string;
|
|
251
251
|
/**
|
|
252
|
-
* WebP copies at 320, 640, 1024, 1600 and 2400 px wide, never upscaled. Build `srcset` from these.
|
|
252
|
+
* WebP copies at 320, 640, 1024, 1600 and 2400 px wide, never upscaled. Build `srcset` from these. Empty for an SVG.
|
|
253
253
|
*/
|
|
254
254
|
variants?: Array<{
|
|
255
255
|
width?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaService.d.ts","sourceRoot":"","sources":["../../../src/generated/services/MediaService.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGtE,qBAAa,YAAY;IACrB;;;;;;OAMG;WACW,cAAc,CACxB,sBAAsB,CAAC,EAAE,MAAM,GAChC,iBAAiB,CAAC;QACjB,IAAI,CAAC,EAAE;YACH,EAAE,CAAC,EAAE,MAAM,CAAC;YACZ;;eAEG;YACH,GAAG,CAAC,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,WAAW,GAAG,YAAY,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"MediaService.d.ts","sourceRoot":"","sources":["../../../src/generated/services/MediaService.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGtE,qBAAa,YAAY;IACrB;;;;;;OAMG;WACW,cAAc,CACxB,sBAAsB,CAAC,EAAE,MAAM,GAChC,iBAAiB,CAAC;QACjB,IAAI,CAAC,EAAE;YACH,EAAE,CAAC,EAAE,MAAM,CAAC;YACZ;;eAEG;YACH,GAAG,CAAC,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,WAAW,GAAG,YAAY,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,CAAC;YAChG;;eAEG;YACH,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,GAAG,CAAC,EAAE,MAAM,CAAC;YACb;;eAEG;YACH,QAAQ,CAAC,EAAE,KAAK,CAAC;gBACb,KAAK,CAAC,EAAE,MAAM,CAAC;gBACf,GAAG,CAAC,EAAE,MAAM,CAAC;aAChB,CAAC,CAAC;YACH,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,SAAS,CAAC,EAAE,MAAM,GA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;aACrB,CAAC;SACL,CAAC;KACL,CAAC;CAeL"}
|
|
@@ -3,7 +3,7 @@ import { request as __request } from '../core/request.js';
|
|
|
3
3
|
export class MediaService {
|
|
4
4
|
/**
|
|
5
5
|
* Upload an image (multipart/form-data, field: file, optional field: alt).
|
|
6
|
-
* Adds an image to the store's media library. PNG, JPEG, WebP, GIF or
|
|
6
|
+
* Adds an image to the store's media library. PNG, JPEG, WebP, GIF, AVIF or SVG, at most 10 MB and 40 megapixels (an SVG: at most 20 KB). The type is read from the file's bytes, not its declared content type. Stores the original and WebP width variants. A JPEG original loses its EXIF data (GPS, camera) but keeps its pixels and orientation; other raster formats are stored as uploaded. An SVG is sanitised first and the sanitised copy is what is stored and served: scripts, `foreignObject`, `style` elements, event attributes, animation, external references and any DOCTYPE are removed or refused (a DOCTYPE or ENTITY refuses the file), so the stored bytes can differ from the upload. An SVG has no variants; its width and height come from its `viewBox`. Requires `media:write`.
|
|
7
7
|
* @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
|
|
8
8
|
* @returns any Default Response
|
|
9
9
|
* @throws ApiError
|
|
@@ -18,9 +18,9 @@ export class MediaService {
|
|
|
18
18
|
errors: {
|
|
19
19
|
400: `\`no_file\` or \`validation_error\`.`,
|
|
20
20
|
409: `\`media_quota_exceeded\`: 10,000 images or 5 GB of originals (deleted images count toward the 5 GB until their files are removed after 30 days).`,
|
|
21
|
-
413: `\`file_too_large\`: over 10 MB.`,
|
|
22
|
-
415: `\`unsupported_media_type\`: not a PNG, JPEG, WebP, GIF
|
|
23
|
-
422: `\`image_too_large\` (over 40 megapixels) or \`
|
|
21
|
+
413: `\`file_too_large\`: over 10 MB (an SVG: over 20 KB).`,
|
|
22
|
+
415: `\`unsupported_media_type\`: not a PNG, JPEG, WebP, GIF, AVIF or SVG image.`,
|
|
23
|
+
422: `\`image_too_large\` (over 40 megapixels), \`invalid_image\`, or \`invalid_svg\` (an SVG that is not well-formed XML, has a DOCTYPE or ENTITY, or has nothing safe to draw left after sanitising).`,
|
|
24
24
|
429: `\`rate_limited\`: more than 60 uploads a minute for this store.`,
|
|
25
25
|
},
|
|
26
26
|
});
|
|
@@ -56,7 +56,7 @@ export class MediaService {
|
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Add an image from a URL.
|
|
59
|
-
* Throttle downloads the image and adds it to the media library. The URL must be public: private, loopback and link-local addresses are refused on every redirect (at most 3), and the download is capped at 10 MB. Requires `media:write`.
|
|
59
|
+
* Throttle downloads the image and adds it to the media library (an SVG is sanitised the same way as an upload). The URL must be public: private, loopback and link-local addresses are refused on every redirect (at most 3), and the download is capped at 10 MB. Requires `media:write`.
|
|
60
60
|
* @param requestBody
|
|
61
61
|
* @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
|
|
62
62
|
* @returns any Default Response
|
|
@@ -74,9 +74,9 @@ export class MediaService {
|
|
|
74
74
|
errors: {
|
|
75
75
|
400: `\`no_file\` or \`validation_error\`.`,
|
|
76
76
|
409: `\`media_quota_exceeded\`: 10,000 images or 5 GB of originals (deleted images count toward the 5 GB until their files are removed after 30 days).`,
|
|
77
|
-
413: `\`file_too_large\`: over 10 MB.`,
|
|
78
|
-
415: `\`unsupported_media_type\`: not a PNG, JPEG, WebP, GIF
|
|
79
|
-
422: `\`fetch_failed\` (the host did not resolve, answered non-200 or timed out), \`too_many_redirects\` (more than 3), \`image_too_large\` (over 40 megapixels) or \`
|
|
77
|
+
413: `\`file_too_large\`: over 10 MB (an SVG: over 20 KB).`,
|
|
78
|
+
415: `\`unsupported_media_type\`: not a PNG, JPEG, WebP, GIF, AVIF or SVG image.`,
|
|
79
|
+
422: `\`fetch_failed\` (the host did not resolve, answered non-200 or timed out), \`too_many_redirects\` (more than 3), \`image_too_large\` (over 40 megapixels), \`invalid_image\`, or \`invalid_svg\` (an SVG that is not well-formed XML, has a DOCTYPE or ENTITY, or has nothing safe to draw left after sanitising).`,
|
|
80
80
|
429: `\`rate_limited\`: more than 60 uploads a minute for this store.`,
|
|
81
81
|
},
|
|
82
82
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaService.js","sourceRoot":"","sources":["../../../src/generated/services/MediaService.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC1D,MAAM,OAAO,YAAY;IACrB;;;;;;OAMG;IACI,MAAM,CAAC,cAAc,CACxB,sBAA+B;QAqC/B,OAAO,SAAS,CAAC,OAAO,EAAE;YACtB,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,eAAe;YACpB,OAAO,EAAE;gBACL,2BAA2B,EAAE,sBAAsB;aACtD;YACD,MAAM,EAAE;gBACJ,GAAG,EAAE,sCAAsC;gBAC3C,GAAG,EAAE,kJAAkJ;gBACvJ,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"MediaService.js","sourceRoot":"","sources":["../../../src/generated/services/MediaService.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC1D,MAAM,OAAO,YAAY;IACrB;;;;;;OAMG;IACI,MAAM,CAAC,cAAc,CACxB,sBAA+B;QAqC/B,OAAO,SAAS,CAAC,OAAO,EAAE;YACtB,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,eAAe;YACpB,OAAO,EAAE;gBACL,2BAA2B,EAAE,sBAAsB;aACtD;YACD,MAAM,EAAE;gBACJ,GAAG,EAAE,sCAAsC;gBAC3C,GAAG,EAAE,kJAAkJ;gBACvJ,GAAG,EAAE,sDAAsD;gBAC3D,GAAG,EAAE,4EAA4E;gBACjF,GAAG,EAAE,mMAAmM;gBACxM,GAAG,E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