@stackshift-cloud/sdk 0.1.3 → 1.0.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.
@@ -0,0 +1,329 @@
1
+ export type AssetOperationId = 'uploadAsset' | 'createUploadSession' | 'getUploadSession' | 'completeUploadSession' | 'cancelUploadSession' | 'createSignedUploadUrl' | 'createBucket' | 'listBuckets' | 'updateBucket' | 'deleteBucket' | 'getContentPolicy' | 'updateContentPolicy' | 'upsertTransformation' | 'listTransformations' | 'deleteTransformation' | 'createLifecycleRule' | 'listLifecycleRules' | 'deleteLifecycleRule' | 'createDomain' | 'listDomains' | 'verifyDomain' | 'deleteDomain' | 'getAnalytics' | 'getUsageSummary' | 'listEvents' | 'createWebhook' | 'listWebhooks' | 'deleteWebhook' | 'listWebhookDeliveries' | 'retryWebhookDelivery' | 'bulkAssets' | 'listCollections' | 'createCollection' | 'updateCollection' | 'deleteCollection' | 'listSavedSearches' | 'createSavedSearch' | 'updateSavedSearch' | 'deleteSavedSearch' | 'getAIConfig' | 'updateAIConfig' | 'getJob' | 'cancelJob' | 'listAssets' | 'getAsset' | 'patchAsset' | 'getAssetAI' | 'analyzeAsset' | 'moderateAsset' | 'getTranscript' | 'transcribeAsset' | 'smartCropAsset' | 'removeAssetBackground' | 'listAssetVersions' | 'createAssetBranch' | 'restoreAssetVersion' | 'promoteAssetBranch' | 'deleteAsset' | 'replaceAsset' | 'createSignedAssetUrl' | 'createSignedTransformUrl' | 'setAssetTags' | 'patchAssetMetadata' | 'purgeAsset';
2
+ export type AssetAPIScope = 'assets:read' | 'assets:write' | 'assets:process' | 'assets:admin';
3
+ export interface AssetContractOperation {
4
+ readonly id: AssetOperationId;
5
+ readonly method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
6
+ readonly path: string;
7
+ readonly scope: AssetAPIScope;
8
+ }
9
+ export declare const assetContractOperations: readonly [{
10
+ readonly id: "uploadAsset";
11
+ readonly method: "POST";
12
+ readonly path: "/api/v1/assets/upload";
13
+ readonly scope: "assets:write";
14
+ }, {
15
+ readonly id: "createUploadSession";
16
+ readonly method: "POST";
17
+ readonly path: "/api/v1/assets/upload-sessions";
18
+ readonly scope: "assets:write";
19
+ }, {
20
+ readonly id: "getUploadSession";
21
+ readonly method: "GET";
22
+ readonly path: "/api/v1/assets/upload-sessions/{sessionID}";
23
+ readonly scope: "assets:read";
24
+ }, {
25
+ readonly id: "completeUploadSession";
26
+ readonly method: "POST";
27
+ readonly path: "/api/v1/assets/upload-sessions/{sessionID}/complete";
28
+ readonly scope: "assets:write";
29
+ }, {
30
+ readonly id: "cancelUploadSession";
31
+ readonly method: "DELETE";
32
+ readonly path: "/api/v1/assets/upload-sessions/{sessionID}";
33
+ readonly scope: "assets:write";
34
+ }, {
35
+ readonly id: "createSignedUploadUrl";
36
+ readonly method: "POST";
37
+ readonly path: "/api/v1/assets/upload-url";
38
+ readonly scope: "assets:write";
39
+ }, {
40
+ readonly id: "createBucket";
41
+ readonly method: "POST";
42
+ readonly path: "/api/v1/assets/buckets";
43
+ readonly scope: "assets:admin";
44
+ }, {
45
+ readonly id: "listBuckets";
46
+ readonly method: "GET";
47
+ readonly path: "/api/v1/assets/buckets";
48
+ readonly scope: "assets:read";
49
+ }, {
50
+ readonly id: "updateBucket";
51
+ readonly method: "PUT";
52
+ readonly path: "/api/v1/assets/buckets/{bucketID}";
53
+ readonly scope: "assets:admin";
54
+ }, {
55
+ readonly id: "deleteBucket";
56
+ readonly method: "DELETE";
57
+ readonly path: "/api/v1/assets/buckets/{bucketID}";
58
+ readonly scope: "assets:admin";
59
+ }, {
60
+ readonly id: "getContentPolicy";
61
+ readonly method: "GET";
62
+ readonly path: "/api/v1/assets/policy";
63
+ readonly scope: "assets:read";
64
+ }, {
65
+ readonly id: "updateContentPolicy";
66
+ readonly method: "PUT";
67
+ readonly path: "/api/v1/assets/policy";
68
+ readonly scope: "assets:admin";
69
+ }, {
70
+ readonly id: "upsertTransformation";
71
+ readonly method: "POST";
72
+ readonly path: "/api/v1/assets/transformations";
73
+ readonly scope: "assets:process";
74
+ }, {
75
+ readonly id: "listTransformations";
76
+ readonly method: "GET";
77
+ readonly path: "/api/v1/assets/transformations";
78
+ readonly scope: "assets:read";
79
+ }, {
80
+ readonly id: "deleteTransformation";
81
+ readonly method: "DELETE";
82
+ readonly path: "/api/v1/assets/transformations/{name}";
83
+ readonly scope: "assets:process";
84
+ }, {
85
+ readonly id: "createLifecycleRule";
86
+ readonly method: "POST";
87
+ readonly path: "/api/v1/assets/lifecycle-rules";
88
+ readonly scope: "assets:admin";
89
+ }, {
90
+ readonly id: "listLifecycleRules";
91
+ readonly method: "GET";
92
+ readonly path: "/api/v1/assets/lifecycle-rules";
93
+ readonly scope: "assets:read";
94
+ }, {
95
+ readonly id: "deleteLifecycleRule";
96
+ readonly method: "DELETE";
97
+ readonly path: "/api/v1/assets/lifecycle-rules/{ruleID}";
98
+ readonly scope: "assets:admin";
99
+ }, {
100
+ readonly id: "createDomain";
101
+ readonly method: "POST";
102
+ readonly path: "/api/v1/assets/domains";
103
+ readonly scope: "assets:admin";
104
+ }, {
105
+ readonly id: "listDomains";
106
+ readonly method: "GET";
107
+ readonly path: "/api/v1/assets/domains";
108
+ readonly scope: "assets:read";
109
+ }, {
110
+ readonly id: "verifyDomain";
111
+ readonly method: "POST";
112
+ readonly path: "/api/v1/assets/domains/{domainID}/verify";
113
+ readonly scope: "assets:admin";
114
+ }, {
115
+ readonly id: "deleteDomain";
116
+ readonly method: "DELETE";
117
+ readonly path: "/api/v1/assets/domains/{domainID}";
118
+ readonly scope: "assets:admin";
119
+ }, {
120
+ readonly id: "getAnalytics";
121
+ readonly method: "GET";
122
+ readonly path: "/api/v1/assets/analytics";
123
+ readonly scope: "assets:read";
124
+ }, {
125
+ readonly id: "getUsageSummary";
126
+ readonly method: "GET";
127
+ readonly path: "/api/v1/assets/summary";
128
+ readonly scope: "assets:read";
129
+ }, {
130
+ readonly id: "listEvents";
131
+ readonly method: "GET";
132
+ readonly path: "/api/v1/assets/events";
133
+ readonly scope: "assets:read";
134
+ }, {
135
+ readonly id: "createWebhook";
136
+ readonly method: "POST";
137
+ readonly path: "/api/v1/assets/webhooks";
138
+ readonly scope: "assets:admin";
139
+ }, {
140
+ readonly id: "listWebhooks";
141
+ readonly method: "GET";
142
+ readonly path: "/api/v1/assets/webhooks";
143
+ readonly scope: "assets:read";
144
+ }, {
145
+ readonly id: "deleteWebhook";
146
+ readonly method: "DELETE";
147
+ readonly path: "/api/v1/assets/webhooks/{webhookID}";
148
+ readonly scope: "assets:admin";
149
+ }, {
150
+ readonly id: "listWebhookDeliveries";
151
+ readonly method: "GET";
152
+ readonly path: "/api/v1/assets/webhooks/{webhookID}/deliveries";
153
+ readonly scope: "assets:read";
154
+ }, {
155
+ readonly id: "retryWebhookDelivery";
156
+ readonly method: "POST";
157
+ readonly path: "/api/v1/assets/webhook-deliveries/{deliveryID}/retry";
158
+ readonly scope: "assets:admin";
159
+ }, {
160
+ readonly id: "bulkAssets";
161
+ readonly method: "POST";
162
+ readonly path: "/api/v1/assets/bulk";
163
+ readonly scope: "assets:write";
164
+ }, {
165
+ readonly id: "listCollections";
166
+ readonly method: "GET";
167
+ readonly path: "/api/v1/assets/collections";
168
+ readonly scope: "assets:read";
169
+ }, {
170
+ readonly id: "createCollection";
171
+ readonly method: "POST";
172
+ readonly path: "/api/v1/assets/collections";
173
+ readonly scope: "assets:write";
174
+ }, {
175
+ readonly id: "updateCollection";
176
+ readonly method: "PUT";
177
+ readonly path: "/api/v1/assets/collections/{collectionID}";
178
+ readonly scope: "assets:write";
179
+ }, {
180
+ readonly id: "deleteCollection";
181
+ readonly method: "DELETE";
182
+ readonly path: "/api/v1/assets/collections/{collectionID}";
183
+ readonly scope: "assets:write";
184
+ }, {
185
+ readonly id: "listSavedSearches";
186
+ readonly method: "GET";
187
+ readonly path: "/api/v1/assets/saved-searches";
188
+ readonly scope: "assets:read";
189
+ }, {
190
+ readonly id: "createSavedSearch";
191
+ readonly method: "POST";
192
+ readonly path: "/api/v1/assets/saved-searches";
193
+ readonly scope: "assets:write";
194
+ }, {
195
+ readonly id: "updateSavedSearch";
196
+ readonly method: "PUT";
197
+ readonly path: "/api/v1/assets/saved-searches/{searchID}";
198
+ readonly scope: "assets:write";
199
+ }, {
200
+ readonly id: "deleteSavedSearch";
201
+ readonly method: "DELETE";
202
+ readonly path: "/api/v1/assets/saved-searches/{searchID}";
203
+ readonly scope: "assets:write";
204
+ }, {
205
+ readonly id: "getAIConfig";
206
+ readonly method: "GET";
207
+ readonly path: "/api/v1/assets/ai/config";
208
+ readonly scope: "assets:read";
209
+ }, {
210
+ readonly id: "updateAIConfig";
211
+ readonly method: "PUT";
212
+ readonly path: "/api/v1/assets/ai/config";
213
+ readonly scope: "assets:admin";
214
+ }, {
215
+ readonly id: "getJob";
216
+ readonly method: "GET";
217
+ readonly path: "/api/v1/assets/jobs/{jobID}";
218
+ readonly scope: "assets:read";
219
+ }, {
220
+ readonly id: "cancelJob";
221
+ readonly method: "POST";
222
+ readonly path: "/api/v1/assets/jobs/{jobID}/cancel";
223
+ readonly scope: "assets:process";
224
+ }, {
225
+ readonly id: "listAssets";
226
+ readonly method: "GET";
227
+ readonly path: "/api/v1/assets";
228
+ readonly scope: "assets:read";
229
+ }, {
230
+ readonly id: "getAsset";
231
+ readonly method: "GET";
232
+ readonly path: "/api/v1/assets/{assetID}";
233
+ readonly scope: "assets:read";
234
+ }, {
235
+ readonly id: "patchAsset";
236
+ readonly method: "PATCH";
237
+ readonly path: "/api/v1/assets/{assetID}";
238
+ readonly scope: "assets:write";
239
+ }, {
240
+ readonly id: "getAssetAI";
241
+ readonly method: "GET";
242
+ readonly path: "/api/v1/assets/{assetID}/ai";
243
+ readonly scope: "assets:read";
244
+ }, {
245
+ readonly id: "analyzeAsset";
246
+ readonly method: "POST";
247
+ readonly path: "/api/v1/assets/{assetID}/ai/analyze";
248
+ readonly scope: "assets:process";
249
+ }, {
250
+ readonly id: "moderateAsset";
251
+ readonly method: "POST";
252
+ readonly path: "/api/v1/assets/{assetID}/moderation";
253
+ readonly scope: "assets:process";
254
+ }, {
255
+ readonly id: "getTranscript";
256
+ readonly method: "GET";
257
+ readonly path: "/api/v1/assets/{assetID}/transcript";
258
+ readonly scope: "assets:read";
259
+ }, {
260
+ readonly id: "transcribeAsset";
261
+ readonly method: "POST";
262
+ readonly path: "/api/v1/assets/{assetID}/transcript";
263
+ readonly scope: "assets:process";
264
+ }, {
265
+ readonly id: "smartCropAsset";
266
+ readonly method: "POST";
267
+ readonly path: "/api/v1/assets/{assetID}/smart-crop";
268
+ readonly scope: "assets:process";
269
+ }, {
270
+ readonly id: "removeAssetBackground";
271
+ readonly method: "POST";
272
+ readonly path: "/api/v1/assets/{assetID}/background-remove";
273
+ readonly scope: "assets:process";
274
+ }, {
275
+ readonly id: "listAssetVersions";
276
+ readonly method: "GET";
277
+ readonly path: "/api/v1/assets/{assetID}/versions";
278
+ readonly scope: "assets:read";
279
+ }, {
280
+ readonly id: "createAssetBranch";
281
+ readonly method: "POST";
282
+ readonly path: "/api/v1/assets/{assetID}/branches";
283
+ readonly scope: "assets:write";
284
+ }, {
285
+ readonly id: "restoreAssetVersion";
286
+ readonly method: "POST";
287
+ readonly path: "/api/v1/assets/{assetID}/versions/{versionID}/restore";
288
+ readonly scope: "assets:write";
289
+ }, {
290
+ readonly id: "promoteAssetBranch";
291
+ readonly method: "POST";
292
+ readonly path: "/api/v1/assets/{assetID}/branches/{branch}/promote";
293
+ readonly scope: "assets:write";
294
+ }, {
295
+ readonly id: "deleteAsset";
296
+ readonly method: "DELETE";
297
+ readonly path: "/api/v1/assets/{assetID}";
298
+ readonly scope: "assets:admin";
299
+ }, {
300
+ readonly id: "replaceAsset";
301
+ readonly method: "PUT";
302
+ readonly path: "/api/v1/assets/{assetID}/replace";
303
+ readonly scope: "assets:write";
304
+ }, {
305
+ readonly id: "createSignedAssetUrl";
306
+ readonly method: "POST";
307
+ readonly path: "/api/v1/assets/{assetID}/signed-url";
308
+ readonly scope: "assets:read";
309
+ }, {
310
+ readonly id: "createSignedTransformUrl";
311
+ readonly method: "POST";
312
+ readonly path: "/api/v1/assets/{assetID}/transform-url";
313
+ readonly scope: "assets:process";
314
+ }, {
315
+ readonly id: "setAssetTags";
316
+ readonly method: "PUT";
317
+ readonly path: "/api/v1/assets/{assetID}/tags";
318
+ readonly scope: "assets:write";
319
+ }, {
320
+ readonly id: "patchAssetMetadata";
321
+ readonly method: "PATCH";
322
+ readonly path: "/api/v1/assets/{assetID}/metadata";
323
+ readonly scope: "assets:write";
324
+ }, {
325
+ readonly id: "purgeAsset";
326
+ readonly method: "POST";
327
+ readonly path: "/api/v1/assets/{assetID}/purge";
328
+ readonly scope: "assets:admin";
329
+ }];
@@ -0,0 +1,66 @@
1
+ export const assetContractOperations = [
2
+ { id: 'uploadAsset', method: 'POST', path: '/api/v1/assets/upload', scope: 'assets:write' },
3
+ { id: 'createUploadSession', method: 'POST', path: '/api/v1/assets/upload-sessions', scope: 'assets:write' },
4
+ { id: 'getUploadSession', method: 'GET', path: '/api/v1/assets/upload-sessions/{sessionID}', scope: 'assets:read' },
5
+ { id: 'completeUploadSession', method: 'POST', path: '/api/v1/assets/upload-sessions/{sessionID}/complete', scope: 'assets:write' },
6
+ { id: 'cancelUploadSession', method: 'DELETE', path: '/api/v1/assets/upload-sessions/{sessionID}', scope: 'assets:write' },
7
+ { id: 'createSignedUploadUrl', method: 'POST', path: '/api/v1/assets/upload-url', scope: 'assets:write' },
8
+ { id: 'createBucket', method: 'POST', path: '/api/v1/assets/buckets', scope: 'assets:admin' },
9
+ { id: 'listBuckets', method: 'GET', path: '/api/v1/assets/buckets', scope: 'assets:read' },
10
+ { id: 'updateBucket', method: 'PUT', path: '/api/v1/assets/buckets/{bucketID}', scope: 'assets:admin' },
11
+ { id: 'deleteBucket', method: 'DELETE', path: '/api/v1/assets/buckets/{bucketID}', scope: 'assets:admin' },
12
+ { id: 'getContentPolicy', method: 'GET', path: '/api/v1/assets/policy', scope: 'assets:read' },
13
+ { id: 'updateContentPolicy', method: 'PUT', path: '/api/v1/assets/policy', scope: 'assets:admin' },
14
+ { id: 'upsertTransformation', method: 'POST', path: '/api/v1/assets/transformations', scope: 'assets:process' },
15
+ { id: 'listTransformations', method: 'GET', path: '/api/v1/assets/transformations', scope: 'assets:read' },
16
+ { id: 'deleteTransformation', method: 'DELETE', path: '/api/v1/assets/transformations/{name}', scope: 'assets:process' },
17
+ { id: 'createLifecycleRule', method: 'POST', path: '/api/v1/assets/lifecycle-rules', scope: 'assets:admin' },
18
+ { id: 'listLifecycleRules', method: 'GET', path: '/api/v1/assets/lifecycle-rules', scope: 'assets:read' },
19
+ { id: 'deleteLifecycleRule', method: 'DELETE', path: '/api/v1/assets/lifecycle-rules/{ruleID}', scope: 'assets:admin' },
20
+ { id: 'createDomain', method: 'POST', path: '/api/v1/assets/domains', scope: 'assets:admin' },
21
+ { id: 'listDomains', method: 'GET', path: '/api/v1/assets/domains', scope: 'assets:read' },
22
+ { id: 'verifyDomain', method: 'POST', path: '/api/v1/assets/domains/{domainID}/verify', scope: 'assets:admin' },
23
+ { id: 'deleteDomain', method: 'DELETE', path: '/api/v1/assets/domains/{domainID}', scope: 'assets:admin' },
24
+ { id: 'getAnalytics', method: 'GET', path: '/api/v1/assets/analytics', scope: 'assets:read' },
25
+ { id: 'getUsageSummary', method: 'GET', path: '/api/v1/assets/summary', scope: 'assets:read' },
26
+ { id: 'listEvents', method: 'GET', path: '/api/v1/assets/events', scope: 'assets:read' },
27
+ { id: 'createWebhook', method: 'POST', path: '/api/v1/assets/webhooks', scope: 'assets:admin' },
28
+ { id: 'listWebhooks', method: 'GET', path: '/api/v1/assets/webhooks', scope: 'assets:read' },
29
+ { id: 'deleteWebhook', method: 'DELETE', path: '/api/v1/assets/webhooks/{webhookID}', scope: 'assets:admin' },
30
+ { id: 'listWebhookDeliveries', method: 'GET', path: '/api/v1/assets/webhooks/{webhookID}/deliveries', scope: 'assets:read' },
31
+ { id: 'retryWebhookDelivery', method: 'POST', path: '/api/v1/assets/webhook-deliveries/{deliveryID}/retry', scope: 'assets:admin' },
32
+ { id: 'bulkAssets', method: 'POST', path: '/api/v1/assets/bulk', scope: 'assets:write' },
33
+ { id: 'listCollections', method: 'GET', path: '/api/v1/assets/collections', scope: 'assets:read' },
34
+ { id: 'createCollection', method: 'POST', path: '/api/v1/assets/collections', scope: 'assets:write' },
35
+ { id: 'updateCollection', method: 'PUT', path: '/api/v1/assets/collections/{collectionID}', scope: 'assets:write' },
36
+ { id: 'deleteCollection', method: 'DELETE', path: '/api/v1/assets/collections/{collectionID}', scope: 'assets:write' },
37
+ { id: 'listSavedSearches', method: 'GET', path: '/api/v1/assets/saved-searches', scope: 'assets:read' },
38
+ { id: 'createSavedSearch', method: 'POST', path: '/api/v1/assets/saved-searches', scope: 'assets:write' },
39
+ { id: 'updateSavedSearch', method: 'PUT', path: '/api/v1/assets/saved-searches/{searchID}', scope: 'assets:write' },
40
+ { id: 'deleteSavedSearch', method: 'DELETE', path: '/api/v1/assets/saved-searches/{searchID}', scope: 'assets:write' },
41
+ { id: 'getAIConfig', method: 'GET', path: '/api/v1/assets/ai/config', scope: 'assets:read' },
42
+ { id: 'updateAIConfig', method: 'PUT', path: '/api/v1/assets/ai/config', scope: 'assets:admin' },
43
+ { id: 'getJob', method: 'GET', path: '/api/v1/assets/jobs/{jobID}', scope: 'assets:read' },
44
+ { id: 'cancelJob', method: 'POST', path: '/api/v1/assets/jobs/{jobID}/cancel', scope: 'assets:process' },
45
+ { id: 'listAssets', method: 'GET', path: '/api/v1/assets', scope: 'assets:read' },
46
+ { id: 'getAsset', method: 'GET', path: '/api/v1/assets/{assetID}', scope: 'assets:read' },
47
+ { id: 'patchAsset', method: 'PATCH', path: '/api/v1/assets/{assetID}', scope: 'assets:write' },
48
+ { id: 'getAssetAI', method: 'GET', path: '/api/v1/assets/{assetID}/ai', scope: 'assets:read' },
49
+ { id: 'analyzeAsset', method: 'POST', path: '/api/v1/assets/{assetID}/ai/analyze', scope: 'assets:process' },
50
+ { id: 'moderateAsset', method: 'POST', path: '/api/v1/assets/{assetID}/moderation', scope: 'assets:process' },
51
+ { id: 'getTranscript', method: 'GET', path: '/api/v1/assets/{assetID}/transcript', scope: 'assets:read' },
52
+ { id: 'transcribeAsset', method: 'POST', path: '/api/v1/assets/{assetID}/transcript', scope: 'assets:process' },
53
+ { id: 'smartCropAsset', method: 'POST', path: '/api/v1/assets/{assetID}/smart-crop', scope: 'assets:process' },
54
+ { id: 'removeAssetBackground', method: 'POST', path: '/api/v1/assets/{assetID}/background-remove', scope: 'assets:process' },
55
+ { id: 'listAssetVersions', method: 'GET', path: '/api/v1/assets/{assetID}/versions', scope: 'assets:read' },
56
+ { id: 'createAssetBranch', method: 'POST', path: '/api/v1/assets/{assetID}/branches', scope: 'assets:write' },
57
+ { id: 'restoreAssetVersion', method: 'POST', path: '/api/v1/assets/{assetID}/versions/{versionID}/restore', scope: 'assets:write' },
58
+ { id: 'promoteAssetBranch', method: 'POST', path: '/api/v1/assets/{assetID}/branches/{branch}/promote', scope: 'assets:write' },
59
+ { id: 'deleteAsset', method: 'DELETE', path: '/api/v1/assets/{assetID}', scope: 'assets:admin' },
60
+ { id: 'replaceAsset', method: 'PUT', path: '/api/v1/assets/{assetID}/replace', scope: 'assets:write' },
61
+ { id: 'createSignedAssetUrl', method: 'POST', path: '/api/v1/assets/{assetID}/signed-url', scope: 'assets:read' },
62
+ { id: 'createSignedTransformUrl', method: 'POST', path: '/api/v1/assets/{assetID}/transform-url', scope: 'assets:process' },
63
+ { id: 'setAssetTags', method: 'PUT', path: '/api/v1/assets/{assetID}/tags', scope: 'assets:write' },
64
+ { id: 'patchAssetMetadata', method: 'PATCH', path: '/api/v1/assets/{assetID}/metadata', scope: 'assets:write' },
65
+ { id: 'purgeAsset', method: 'POST', path: '/api/v1/assets/{assetID}/purge', scope: 'assets:admin' },
66
+ ];
package/dist/index.d.ts CHANGED
@@ -1,11 +1,20 @@
1
1
  export { StackShift, StackShiftAPIError } from './client.js';
2
2
  export { AssetsClient, assetTransformOptions, assetTransformPresets, assetTransformSpec, getAssetTransformPreset } from './assets.js';
3
- export { MailBouncesClient, MailClient, MailDomainsClient, MailEventsClient, MailLimitsClient, MailMessagesClient, MailScheduledClient, MailBatchClient, MailInboundClient, MailAnalyticsClient, MailOtpChallengesClient, MailOtpClient, MailReputationClient, MailReputationEventsClient, MailSuppressionsClient, MailTemplatesClient, MailWebhooksClient, } from './mail.js';
3
+ export { createResponsiveImage, namedResponsiveSource, uploadBrowserFile } from './assets-framework.js';
4
+ export type { ArtDirectionSource, ResponsiveImageDescriptor, ResponsiveImageOptions } from './assets-framework.js';
5
+ export { assetContractOperations } from './generated/assets-contract.js';
6
+ export type { AssetAPIScope, AssetContractOperation, AssetOperationId } from './generated/assets-contract.js';
7
+ export { MailBouncesClient, MailClient, MailDomainsClient, MailEventsClient, MailLimitsClient, MailMessagesClient, MailScheduledClient, MailBatchClient, MailInboundClient, MailAnalyticsClient, MailOtpChallengesClient, MailOtpClient, MailReputationClient, MailReputationEventsClient, MailSuppressionsClient, MailTemplatesClient, MailWebhooksClient, MailStreamsClient, MailAudiencesClient, MailCampaignsClient, } from './mail.js';
8
+ export type { MailAudience, MailAudienceMember, MailAudienceMemberImport, MailCampaign } from './mail-campaigns.js';
9
+ export { MailExportsClient } from './mail-exports.js';
10
+ export type { MailExport, MailExportCreateInput } from './mail-exports.js';
11
+ export type { MailDiagnosticFinding, MailTemplateDiagnosticInput, MailTemplateDiagnosticResult } from './mail-diagnostics.js';
4
12
  export { ProjectsClient } from './projects.js';
5
- export type { Asset, AssetAIAnnotation, AssetAIInfo, AssetCollection, AssetListOptions, AssetListResult, AssetModerationResult, AssetSavedSearch, AssetSignedUploadUrl, AssetSignedUploadUrlOptions, AssetSignedUrl, AssetSignedUrlOptions, AssetTranscript, AssetTransformOptions, AssetTransformPreset, AssetTransformPresetCategory, AssetUploadOptions, AssetVisibility, AssetVersion, JsonValue, MailAddress, MailAddressInput, MailDnsRecord, MailDomain, MailDomainListResult, MailDomainStatus, MailIdempotencyStatus, MailLog, MailMessage, MailMessageListOptions, MailMessageListResult, MailMessageSummary, MailRecordStatus, MailSendAttempt, MailSendInput, MailSendResponse, MailStatus, Project, ProjectListOptions, StackShiftOptions, } from './types.js';
6
- export type { MailBounce, MailBounceListOptions, MailBounceListResult, MailBounceType, MailSuppression, MailSuppressionCreateInput, MailSuppressionListOptions, MailSuppressionListResult, MailSuppressionReason, MailSuppressionSource, } from './mail-phase4-types.js';
13
+ export type { Asset, AssetAIAnnotation, AssetAIInfo, AssetCollection, AssetListOptions, AssetListResult, AssetModerationResult, AssetSavedSearch, AssetSignedUploadUrl, AssetSignedUploadUrlOptions, AssetSignedUrl, AssetSignedUrlOptions, AssetTranscript, AssetTransformOptions, AssetTransformPreset, AssetTransformPresetCategory, AssetUploadOptions, AssetVisibility, AssetVersion, JsonValue, MailAddress, MailAddressInput, MailDnsRecord, MailDomain, MailDomainListResult, MailDomainStatus, MailIdempotencyStatus, MailLog, MailMessage, MailMessageListOptions, MailMessageListResult, MailMessageSummary, MailRecordStatus, MailSendAttempt, MailSendInput, MailSendResponse, MailStatus, MailRecipient, MailRecipientStatus, MailRecipientSummary, Project, ProjectListOptions, StackShiftOptions, } from './types.js';
14
+ export type { MailBounce, MailBounceListOptions, MailBounceListResult, MailBounceType, MailSuppression, MailSuppressionCreateInput, MailSuppressionListOptions, MailSuppressionListResult, MailSuppressionReason, MailSuppressionSource, } from './mail-delivery-types.js';
7
15
  export type { MailOtpChallenge, MailOtpChallengeListOptions, MailOtpChallengeListResult, MailOtpSendInput, MailOtpSendResponse, MailOtpStatus, MailOtpVerifyInput, MailOtpVerifyResponse, } from './mail-otp-types.js';
8
16
  export type { MailSendTemplateInput, MailSendTemplateResponse, MailTemplate, MailTemplateCreateInput, MailTemplateDetail, MailTemplateListOptions, MailTemplateListResult, MailTemplatePreview, MailTemplatePreviewInput, MailTemplateStatus, MailTemplateTestSendInput, MailTemplateTestSendResponse, MailTemplateUpdateInput, MailTemplateVersion, } from './mail-template-types.js';
9
- export type { MailEvent, MailEventListOptions, MailEventListResult, MailEventType, MailTimelineItem, MailWebhook, MailWebhookCreateInput, MailWebhookCreateResponse, MailWebhookDelivery, MailWebhookDeliveryAttempt, MailWebhookDeliveryDetail, MailWebhookDeliveryListOptions, MailWebhookListOptions, MailWebhookListResult, MailWebhookUpdateInput, } from './mail-webhook-types.js';
17
+ export type { MailEvent, MailEventListOptions, MailEventListResult, MailEventType, MailTimelineItem, MailWebhook, MailWebhookCreateInput, MailWebhookCreateResponse, MailWebhookDelivery, MailWebhookDeliveryAttempt, MailWebhookDeliveryDetail, MailWebhookDeliveryListOptions, MailWebhookListOptions, MailWebhookListResult, MailWebhookUpdateInput, MailWebhookReplay, MailWebhookReplayInput, } from './mail-webhook-types.js';
18
+ export type { MailMessageStream, MailMessageStreamCreateInput, MailMessageStreamListResult } from './mail-streams.js';
10
19
  export type { MailDomainReputation, MailLimits, MailManualReviewStatus, MailReputation, MailReputationEvent, MailReputationEventListOptions, MailReputationEventListResult, MailReputationEventSeverity, MailReputationStatus, MailReputationTier, MailReputationWorkspace, } from './mail-reputation-types.js';
11
- export type { MailAnalytics, MailAnalyticsInput, MailAttachmentInput, MailBatch, MailBatchSendInput, MailBatchTemplateInput, MailInboundDomain, MailInboundMessage, MailScheduledCreateInput, MailScheduledMessage, } from './mail-advanced-types.js';
20
+ export type { MailAnalytics, MailAnalyticsInput, MailAttachmentInput, MailBatch, MailBatchItem, MailBatchSendInput, MailBatchTemplateInput, MailInboundDomain, MailInboundMessage, MailScheduledCreateInput, MailScheduledMessage, } from './mail-advanced-types.js';
package/dist/index.js CHANGED
@@ -1,4 +1,7 @@
1
1
  export { StackShift, StackShiftAPIError } from './client.js';
2
2
  export { AssetsClient, assetTransformOptions, assetTransformPresets, assetTransformSpec, getAssetTransformPreset } from './assets.js';
3
- export { MailBouncesClient, MailClient, MailDomainsClient, MailEventsClient, MailLimitsClient, MailMessagesClient, MailScheduledClient, MailBatchClient, MailInboundClient, MailAnalyticsClient, MailOtpChallengesClient, MailOtpClient, MailReputationClient, MailReputationEventsClient, MailSuppressionsClient, MailTemplatesClient, MailWebhooksClient, } from './mail.js';
3
+ export { createResponsiveImage, namedResponsiveSource, uploadBrowserFile } from './assets-framework.js';
4
+ export { assetContractOperations } from './generated/assets-contract.js';
5
+ export { MailBouncesClient, MailClient, MailDomainsClient, MailEventsClient, MailLimitsClient, MailMessagesClient, MailScheduledClient, MailBatchClient, MailInboundClient, MailAnalyticsClient, MailOtpChallengesClient, MailOtpClient, MailReputationClient, MailReputationEventsClient, MailSuppressionsClient, MailTemplatesClient, MailWebhooksClient, MailStreamsClient, MailAudiencesClient, MailCampaignsClient, } from './mail.js';
6
+ export { MailExportsClient } from './mail-exports.js';
4
7
  export { ProjectsClient } from './projects.js';
@@ -1,10 +1,12 @@
1
- import type { JsonValue, MailAddress, MailAddressInput, MailSendInput, MailSendResponse } from './types.js';
1
+ import type { JsonValue, MailAddress, MailAddressInput, MailRecipient, MailSendInput, MailSendResponse } from './types.js';
2
2
  import type { MailSendTemplateInput } from './mail-template-types.js';
3
3
  export interface MailAttachmentInput {
4
4
  assetId?: string;
5
5
  uploadId?: string;
6
6
  filename: string;
7
7
  contentType?: string;
8
+ disposition?: 'attachment' | 'inline';
9
+ contentId?: string;
8
10
  }
9
11
  export interface MailScheduledCreateInput {
10
12
  sendAt: string;
@@ -16,15 +18,18 @@ export interface MailScheduledCreateInput {
16
18
  data?: Record<string, JsonValue>;
17
19
  idempotencyKey?: string;
18
20
  attachments?: MailAttachmentInput[];
21
+ headers?: Record<string, string>;
22
+ tags?: Record<string, string>;
23
+ stream?: string;
19
24
  }
20
25
  export interface MailScheduledMessage {
21
26
  id: string;
22
- status: 'scheduled' | 'queued' | 'sent' | 'canceled' | 'failed';
27
+ status: 'scheduled' | 'queued' | 'dispatched' | 'canceled' | 'failed';
23
28
  sendAt: string;
24
29
  messageId?: string | null;
25
30
  createdAt?: string;
26
31
  canceledAt?: string | null;
27
- sentAt?: string | null;
32
+ dispatchedAt?: string | null;
28
33
  }
29
34
  export interface MailBatchSendInput {
30
35
  from: string | MailAddress;
@@ -39,11 +44,28 @@ export interface MailBatchTemplateInput {
39
44
  data?: Record<string, JsonValue>;
40
45
  idempotencyKey?: string;
41
46
  }>;
47
+ headers?: Record<string, string>;
48
+ tags?: Record<string, string>;
49
+ stream?: string;
42
50
  }
43
51
  export interface MailBatch {
44
52
  id: string;
45
53
  status: 'queued' | 'processing' | 'completed' | 'failed';
46
54
  messageCount: number;
55
+ queuedCount: number;
56
+ acceptedCount: number;
57
+ failedCount: number;
58
+ suppressedCount: number;
59
+ }
60
+ export interface MailBatchItem {
61
+ id: string;
62
+ batchId: string;
63
+ messageId?: string | null;
64
+ recipientEmail: string;
65
+ status: 'queued' | 'sending' | 'accepted' | 'failed' | 'suppressed';
66
+ errorCode?: string | null;
67
+ errorMessage?: string | null;
68
+ recipients: MailRecipient[];
47
69
  }
48
70
  export interface MailInboundDomain {
49
71
  id: string;
@@ -1,5 +1,5 @@
1
1
  import type { StackShift } from './client.js';
2
- import type { MailAnalytics, MailAnalyticsInput, MailBatch, MailBatchSendInput, MailBatchTemplateInput, MailInboundDomain, MailInboundMessage, MailScheduledCreateInput, MailScheduledMessage } from './mail-advanced-types.js';
2
+ import type { MailAnalytics, MailAnalyticsInput, MailBatch, MailBatchItem, MailBatchSendInput, MailBatchTemplateInput, MailInboundDomain, MailInboundMessage, MailScheduledCreateInput, MailScheduledMessage } from './mail-advanced-types.js';
3
3
  export declare class MailScheduledClient {
4
4
  private readonly client;
5
5
  constructor(client: StackShift);
@@ -15,6 +15,13 @@ export declare class MailBatchClient {
15
15
  constructor(client: StackShift);
16
16
  send(input: MailBatchSendInput): Promise<MailBatch>;
17
17
  sendTemplate(input: MailBatchTemplateInput): Promise<MailBatch>;
18
+ list(): Promise<{
19
+ data: MailBatch[];
20
+ }>;
21
+ get(id: string): Promise<MailBatch>;
22
+ items(id: string): Promise<{
23
+ data: MailBatchItem[];
24
+ }>;
18
25
  }
19
26
  export declare class MailInboundClient {
20
27
  readonly domains: MailInboundDomainsClient;
@@ -27,6 +27,15 @@ export class MailBatchClient {
27
27
  sendTemplate(input) {
28
28
  return this.client.mailRequest('/mail/batch-template', { method: 'POST', body: input });
29
29
  }
30
+ list() {
31
+ return this.client.mailRequest('/mail/batches');
32
+ }
33
+ get(id) {
34
+ return this.client.mailRequest(`/mail/batches/${encodeURIComponent(id)}`);
35
+ }
36
+ items(id) {
37
+ return this.client.mailRequest(`/mail/batches/${encodeURIComponent(id)}/items`);
38
+ }
30
39
  }
31
40
  export class MailInboundClient {
32
41
  domains;
@@ -0,0 +1,76 @@
1
+ import type { StackShift } from './client.js';
2
+ export interface MailAudience {
3
+ id: string;
4
+ workspaceId: string;
5
+ name: string;
6
+ description?: string;
7
+ status: 'active' | 'archived';
8
+ memberCount: number;
9
+ createdAt: string;
10
+ updatedAt: string;
11
+ }
12
+ export interface MailAudienceMember {
13
+ id: string;
14
+ audienceId: string;
15
+ email: string;
16
+ name?: string;
17
+ status: 'subscribed' | 'unsubscribed' | 'complained' | 'hard_bounced';
18
+ consentSource: string;
19
+ consentAt: string;
20
+ consentIp?: string;
21
+ }
22
+ export interface MailAudienceMemberImport {
23
+ email: string;
24
+ name?: string;
25
+ consentSource: string;
26
+ consentAt: string;
27
+ consentIp?: string;
28
+ }
29
+ export interface MailCampaign {
30
+ id: string;
31
+ audienceId: string;
32
+ batchId?: string;
33
+ name: string;
34
+ template: string;
35
+ versionId?: string;
36
+ from: string;
37
+ status: 'draft' | 'processing' | 'queued' | 'completed' | 'failed';
38
+ createdAt: string;
39
+ updatedAt: string;
40
+ queuedAt?: string;
41
+ }
42
+ export declare class MailAudiencesClient {
43
+ private readonly client;
44
+ constructor(client: StackShift);
45
+ create(input: {
46
+ name: string;
47
+ description?: string;
48
+ }): Promise<MailAudience>;
49
+ list(): Promise<{
50
+ data: MailAudience[];
51
+ }>;
52
+ get(id: string): Promise<MailAudience>;
53
+ members(id: string): Promise<{
54
+ data: MailAudienceMember[];
55
+ }>;
56
+ import(id: string, members: MailAudienceMemberImport[]): Promise<{
57
+ imported: number;
58
+ skipped: number;
59
+ }>;
60
+ }
61
+ export declare class MailCampaignsClient {
62
+ private readonly client;
63
+ constructor(client: StackShift);
64
+ create(input: {
65
+ name: string;
66
+ audienceId: string;
67
+ template: string;
68
+ versionId?: string;
69
+ from: string;
70
+ }): Promise<MailCampaign>;
71
+ list(): Promise<{
72
+ data: MailCampaign[];
73
+ }>;
74
+ get(id: string): Promise<MailCampaign>;
75
+ send(id: string): Promise<MailCampaign>;
76
+ }