@stackshift-cloud/sdk 1.0.0 → 1.2.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.
Files changed (53) hide show
  1. package/README.md +117 -0
  2. package/dist/asset-media-v2.d.ts +65 -0
  3. package/dist/asset-media-v2.js +1 -0
  4. package/dist/asset-workflows.d.ts +269 -0
  5. package/dist/asset-workflows.js +69 -0
  6. package/dist/assets-dam-types.d.ts +225 -0
  7. package/dist/assets-dam-types.js +1 -0
  8. package/dist/assets-dam.d.ts +96 -0
  9. package/dist/assets-dam.js +47 -0
  10. package/dist/assets-platform-types.d.ts +218 -0
  11. package/dist/assets-platform-types.js +1 -0
  12. package/dist/assets-platform.d.ts +55 -0
  13. package/dist/assets-platform.js +90 -0
  14. package/dist/assets-video-types.d.ts +116 -0
  15. package/dist/assets-video-types.js +1 -0
  16. package/dist/assets-video.d.ts +25 -0
  17. package/dist/assets-video.js +19 -0
  18. package/dist/assets.d.ts +21 -1
  19. package/dist/assets.js +85 -132
  20. package/dist/client.d.ts +10 -0
  21. package/dist/client.js +26 -6
  22. package/dist/generated/assets-contract.d.ts +512 -2
  23. package/dist/generated/assets-contract.js +102 -0
  24. package/dist/index.d.ts +21 -0
  25. package/dist/index.js +11 -0
  26. package/dist/mail-advanced-types.d.ts +9 -0
  27. package/dist/mail-billing.d.ts +34 -0
  28. package/dist/mail-billing.js +7 -0
  29. package/dist/mail-brands.d.ts +35 -0
  30. package/dist/mail-brands.js +17 -0
  31. package/dist/mail-campaigns.d.ts +72 -10
  32. package/dist/mail-campaigns.js +25 -2
  33. package/dist/mail-marketing.d.ts +84 -0
  34. package/dist/mail-marketing.js +24 -0
  35. package/dist/mail-migration.d.ts +16 -0
  36. package/dist/mail-migration.js +10 -0
  37. package/dist/mail-otp-types.d.ts +4 -0
  38. package/dist/mail-simulation.d.ts +4 -0
  39. package/dist/mail-simulation.js +1 -0
  40. package/dist/mail-subscribers.d.ts +39 -0
  41. package/dist/mail-subscribers.js +1 -0
  42. package/dist/mail-template-types.d.ts +8 -0
  43. package/dist/mail-tracking.d.ts +59 -0
  44. package/dist/mail-tracking.js +14 -0
  45. package/dist/mail-webhook-types.d.ts +4 -1
  46. package/dist/mail.d.ts +12 -0
  47. package/dist/mail.js +19 -0
  48. package/dist/types.d.ts +19 -0
  49. package/dist/upload-controller.d.ts +70 -0
  50. package/dist/upload-controller.js +223 -0
  51. package/dist/workload-security.d.ts +172 -0
  52. package/dist/workload-security.js +50 -0
  53. package/package.json +2 -2
@@ -1,4 +1,19 @@
1
1
  export const assetContractOperations = [
2
+ { id: 'putAssetAICredential', method: 'PUT', path: '/api/v1/assets/ai/credential', scope: 'assets:process' },
3
+ { id: 'deleteAssetAICredential', method: 'DELETE', path: '/api/v1/assets/ai/credential', scope: 'assets:process' },
4
+ { id: 'openAssetAIOutput', method: 'GET', path: '/api/v1/assets/{assetID}/ai/outputs/{outputID}', scope: 'assets:read' },
5
+ { id: 'getVideoWorkspace', method: 'GET', path: '/api/v1/assets/{assetID}/video', scope: 'assets:read' },
6
+ { id: 'processVideoVersion', method: 'POST', path: '/api/v1/assets/{assetID}/versions/{versionID}/video', scope: 'assets:process' },
7
+ { id: 'createVideoPlaybackSession', method: 'POST', path: '/api/v1/assets/{assetID}/playback-sessions', scope: 'assets:read' },
8
+ { id: 'revokeVideoPlaybackSession', method: 'DELETE', path: '/api/v1/assets/{assetID}/playback-sessions/{sessionID}', scope: 'assets:write' },
9
+ { id: 'reviewVideoVersion', method: 'POST', path: '/api/v1/assets/{assetID}/versions/{versionID}/video/review', scope: 'assets:admin' },
10
+ { id: 'listVideoCaptions', method: 'GET', path: '/api/v1/assets/{assetID}/versions/{versionID}/video/captions', scope: 'assets:read' },
11
+ { id: 'addVideoCaption', method: 'POST', path: '/api/v1/assets/{assetID}/versions/{versionID}/video/captions', scope: 'assets:write' },
12
+ { id: 'removeVideoCaption', method: 'DELETE', path: '/api/v1/assets/{assetID}/versions/{versionID}/video/captions/{captionID}', scope: 'assets:write' },
13
+ { id: 'getVideoAnalytics', method: 'GET', path: '/api/v1/assets/{assetID}/video/analytics', scope: 'assets:read' },
14
+ { id: 'createPublicVideoPlaybackSession', method: 'POST', path: '/playback/assets/{assetID}/sessions', scope: 'assets:read' },
15
+ { id: 'renewVideoPlaybackSession', method: 'POST', path: '/playback/sessions/renew', scope: 'assets:read' },
16
+ { id: 'recordVideoPlaybackEvents', method: 'POST', path: '/playback/events', scope: 'assets:read' },
2
17
  { id: 'uploadAsset', method: 'POST', path: '/api/v1/assets/upload', scope: 'assets:write' },
3
18
  { id: 'createUploadSession', method: 'POST', path: '/api/v1/assets/upload-sessions', scope: 'assets:write' },
4
19
  { id: 'getUploadSession', method: 'GET', path: '/api/v1/assets/upload-sessions/{sessionID}', scope: 'assets:read' },
@@ -9,10 +24,54 @@ export const assetContractOperations = [
9
24
  { id: 'listBuckets', method: 'GET', path: '/api/v1/assets/buckets', scope: 'assets:read' },
10
25
  { id: 'updateBucket', method: 'PUT', path: '/api/v1/assets/buckets/{bucketID}', scope: 'assets:admin' },
11
26
  { id: 'deleteBucket', method: 'DELETE', path: '/api/v1/assets/buckets/{bucketID}', scope: 'assets:admin' },
27
+ { id: 'configureBucketStorage', method: 'PUT', path: '/api/v1/assets/buckets/{bucketID}/storage', scope: 'assets:write' },
28
+ { id: 'startBucketRelocation', method: 'POST', path: '/api/v1/assets/buckets/{bucketID}/relocations', scope: 'assets:process' },
29
+ { id: 'createAssetConnection', method: 'POST', path: '/api/v1/assets/connections', scope: 'assets:admin' },
30
+ { id: 'listAssetConnections', method: 'GET', path: '/api/v1/assets/connections', scope: 'assets:read' },
31
+ { id: 'getAssetConnection', method: 'GET', path: '/api/v1/assets/connections/{connectionID}', scope: 'assets:read' },
32
+ { id: 'updateAssetConnection', method: 'PATCH', path: '/api/v1/assets/connections/{connectionID}', scope: 'assets:admin' },
33
+ { id: 'verifyAssetConnection', method: 'POST', path: '/api/v1/assets/connections/{connectionID}/verify', scope: 'assets:admin' },
34
+ { id: 'deleteAssetConnection', method: 'DELETE', path: '/api/v1/assets/connections/{connectionID}', scope: 'assets:admin' },
35
+ { id: 'listOwnedS2Buckets', method: 'GET', path: '/api/v1/assets/s2-buckets', scope: 'assets:read' },
36
+ { id: 'createOwnedS2Bucket', method: 'POST', path: '/api/v1/assets/s2-buckets', scope: 'assets:admin' },
37
+ { id: 'startAssetMigration', method: 'POST', path: '/api/v1/assets/migrations', scope: 'assets:process' },
38
+ { id: 'listAssetMigrations', method: 'GET', path: '/api/v1/assets/migrations', scope: 'assets:read' },
39
+ { id: 'getAssetMigration', method: 'GET', path: '/api/v1/assets/migrations/{migrationID}', scope: 'assets:read' },
40
+ { id: 'cancelAssetMigration', method: 'POST', path: '/api/v1/assets/migrations/{migrationID}/cancel', scope: 'assets:process' },
41
+ { id: 'retryAssetMigrationItem', method: 'POST', path: '/api/v1/assets/migrations/{migrationID}/items/{itemID}/retry', scope: 'assets:process' },
42
+ { id: 'downloadAssetMigrationReport', method: 'GET', path: '/api/v1/assets/migrations/{migrationID}/report', scope: 'assets:read' },
43
+ { id: 'createAssetUploadCapability', method: 'POST', path: '/api/v1/assets/upload-capabilities', scope: 'assets:write' },
12
44
  { id: 'getContentPolicy', method: 'GET', path: '/api/v1/assets/policy', scope: 'assets:read' },
13
45
  { id: 'updateContentPolicy', method: 'PUT', path: '/api/v1/assets/policy', scope: 'assets:admin' },
14
46
  { id: 'upsertTransformation', method: 'POST', path: '/api/v1/assets/transformations', scope: 'assets:process' },
15
47
  { id: 'listTransformations', method: 'GET', path: '/api/v1/assets/transformations', scope: 'assets:read' },
48
+ { id: 'materializeAssetTransform', method: 'POST', path: '/api/v1/assets/{assetID}/transforms', scope: 'assets:process' },
49
+ { id: 'listAssetDerivatives', method: 'GET', path: '/api/v1/assets/{assetID}/derivatives', scope: 'assets:read' },
50
+ { id: 'generateAsset', method: 'POST', path: '/api/v1/assets/generations', scope: 'assets:generate' },
51
+ { id: 'getAssetAutomation', method: 'GET', path: '/api/v1/assets/automation', scope: 'assets:read' },
52
+ { id: 'assetMCP', method: 'POST', path: '/api/v1/assets/mcp', scope: 'assets:any' },
53
+ { id: 'getAssetWorkflowCatalog', method: 'GET', path: '/api/v1/assets/workflows/catalog', scope: 'assets:read' },
54
+ { id: 'listAssetWorkflows', method: 'GET', path: '/api/v1/assets/workflows', scope: 'assets:read' },
55
+ { id: 'createAssetWorkflow', method: 'POST', path: '/api/v1/assets/workflows', scope: 'assets:write' },
56
+ { id: 'getAssetWorkflow', method: 'GET', path: '/api/v1/assets/workflows/{workflowId}', scope: 'assets:read' },
57
+ { id: 'updateAssetWorkflowDraft', method: 'PUT', path: '/api/v1/assets/workflows/{workflowId}/draft', scope: 'assets:write' },
58
+ { id: 'validateAssetWorkflow', method: 'POST', path: '/api/v1/assets/workflows/{workflowId}/validate', scope: 'assets:write' },
59
+ { id: 'publishAssetWorkflow', method: 'POST', path: '/api/v1/assets/workflows/{workflowId}/publish', scope: 'assets:publish' },
60
+ { id: 'activateAssetWorkflow', method: 'POST', path: '/api/v1/assets/workflows/{workflowId}/activate', scope: 'assets:publish' },
61
+ { id: 'startAssetWorkflowRun', method: 'POST', path: '/api/v1/assets/workflows/{workflowId}/run', scope: 'assets:write' },
62
+ { id: 'listAssetWorkflowVersions', method: 'GET', path: '/api/v1/assets/workflows/{workflowId}/versions', scope: 'assets:read' },
63
+ { id: 'listAssetWorkflowRuns', method: 'GET', path: '/api/v1/assets/workflows/{workflowId}/runs', scope: 'assets:read' },
64
+ { id: 'getAssetWorkflowRun', method: 'GET', path: '/api/v1/assets/workflows/runs/{runId}', scope: 'assets:read' },
65
+ { id: 'cancelAssetWorkflowRun', method: 'POST', path: '/api/v1/assets/workflows/runs/{runId}/cancel', scope: 'assets:write' },
66
+ { id: 'retryAssetWorkflowRun', method: 'POST', path: '/api/v1/assets/workflows/runs/{runId}/retry', scope: 'assets:write' },
67
+ { id: 'listAssetWorkflowApprovals', method: 'GET', path: '/api/v1/assets/workflows/approvals', scope: 'assets:read' },
68
+ { id: 'approveAssetWorkflow', method: 'POST', path: '/api/v1/assets/workflows/approvals/{approvalId}/approve', scope: 'assets:publish' },
69
+ { id: 'rejectAssetWorkflow', method: 'POST', path: '/api/v1/assets/workflows/approvals/{approvalId}/reject', scope: 'assets:publish' },
70
+ { id: 'listAssetWorkflowConnections', method: 'GET', path: '/api/v1/assets/workflows/connections', scope: 'assets:read' },
71
+ { id: 'createAssetWorkflowConnection', method: 'POST', path: '/api/v1/assets/workflows/connections', scope: 'assets:admin' },
72
+ { id: 'rotateAssetWorkflowConnectionCredential', method: 'POST', path: '/api/v1/assets/workflows/connections/{connectionId}/credential/rotate', scope: 'assets:admin' },
73
+ { id: 'rotateAssetWorkflowInboundHook', method: 'POST', path: '/api/v1/assets/workflows/{workflowId}/inbound-hook/rotate', scope: 'assets:write' },
74
+ { id: 'receiveAssetWorkflowInboundHook', method: 'POST', path: '/api/v1/assets/workflow-hooks/{token}', scope: 'assets:any' },
16
75
  { id: 'deleteTransformation', method: 'DELETE', path: '/api/v1/assets/transformations/{name}', scope: 'assets:process' },
17
76
  { id: 'createLifecycleRule', method: 'POST', path: '/api/v1/assets/lifecycle-rules', scope: 'assets:admin' },
18
77
  { id: 'listLifecycleRules', method: 'GET', path: '/api/v1/assets/lifecycle-rules', scope: 'assets:read' },
@@ -44,6 +103,9 @@ export const assetContractOperations = [
44
103
  { id: 'cancelJob', method: 'POST', path: '/api/v1/assets/jobs/{jobID}/cancel', scope: 'assets:process' },
45
104
  { id: 'listAssets', method: 'GET', path: '/api/v1/assets', scope: 'assets:read' },
46
105
  { id: 'getAsset', method: 'GET', path: '/api/v1/assets/{assetID}', scope: 'assets:read' },
106
+ { id: 'startAssetTextExtraction', method: 'POST', path: '/api/v1/assets/{assetID}/text-extraction', scope: 'assets:process' },
107
+ { id: 'getAssetTextExtraction', method: 'GET', path: '/api/v1/assets/{assetID}/text-extraction', scope: 'assets:read' },
108
+ { id: 'retryAssetTextExtraction', method: 'POST', path: '/api/v1/assets/text-extractions/{extractionID}/retry', scope: 'assets:process' },
47
109
  { id: 'patchAsset', method: 'PATCH', path: '/api/v1/assets/{assetID}', scope: 'assets:write' },
48
110
  { id: 'getAssetAI', method: 'GET', path: '/api/v1/assets/{assetID}/ai', scope: 'assets:read' },
49
111
  { id: 'analyzeAsset', method: 'POST', path: '/api/v1/assets/{assetID}/ai/analyze', scope: 'assets:process' },
@@ -63,4 +125,44 @@ export const assetContractOperations = [
63
125
  { id: 'setAssetTags', method: 'PUT', path: '/api/v1/assets/{assetID}/tags', scope: 'assets:write' },
64
126
  { id: 'patchAssetMetadata', method: 'PATCH', path: '/api/v1/assets/{assetID}/metadata', scope: 'assets:write' },
65
127
  { id: 'purgeAsset', method: 'POST', path: '/api/v1/assets/{assetID}/purge', scope: 'assets:admin' },
128
+ { id: 'widgetCreateUploadSession', method: 'POST', path: '/assets/widget/sessions', scope: 'assets:write' },
129
+ { id: 'widgetGetUploadSession', method: 'GET', path: '/assets/widget/sessions/current', scope: 'assets:write' },
130
+ { id: 'widgetUploadPart', method: 'PUT', path: '/assets/widget/uploads/{sessionToken}/parts/{partNumber}', scope: 'assets:write' },
131
+ { id: 'widgetCompleteUploadSession', method: 'POST', path: '/assets/widget/sessions/current/complete', scope: 'assets:write' },
132
+ { id: 'widgetCancelUploadSession', method: 'DELETE', path: '/assets/widget/sessions/current', scope: 'assets:write' },
133
+ { id: 'widgetIngestRemoteUrl', method: 'POST', path: '/assets/widget/remote-url', scope: 'assets:write' },
134
+ { id: 'listAssetSpaces', method: 'GET', path: '/api/v1/assets/spaces', scope: 'assets:read' },
135
+ { id: 'listAssetCollaborators', method: 'GET', path: '/api/v1/assets/collaborators', scope: 'assets:admin' },
136
+ { id: 'inviteAssetCollaborator', method: 'POST', path: '/api/v1/assets/collaborators', scope: 'assets:admin' },
137
+ { id: 'updateAssetCollaborator', method: 'PUT', path: '/api/v1/assets/collaborators/{collaboratorID}', scope: 'assets:admin' },
138
+ { id: 'revokeAssetCollaborator', method: 'DELETE', path: '/api/v1/assets/collaborators/{collaboratorID}', scope: 'assets:admin' },
139
+ { id: 'acceptAssetInvitation', method: 'POST', path: '/api/v1/assets/invitations/{invitationID}/accept', scope: 'assets:read' },
140
+ { id: 'listAssetMetadataSchemas', method: 'GET', path: '/api/v1/assets/metadata-schemas', scope: 'assets:read' },
141
+ { id: 'createAssetMetadataSchema', method: 'POST', path: '/api/v1/assets/metadata-schemas', scope: 'assets:admin' },
142
+ { id: 'updateAssetMetadataSchema', method: 'PUT', path: '/api/v1/assets/metadata-schemas/{schemaID}', scope: 'assets:admin' },
143
+ { id: 'publishAssetMetadataSchema', method: 'POST', path: '/api/v1/assets/metadata-schemas/{schemaID}/publish', scope: 'assets:admin' },
144
+ { id: 'getAssetBucketGovernance', method: 'GET', path: '/api/v1/assets/buckets/{bucketID}/governance', scope: 'assets:admin' },
145
+ { id: 'updateAssetBucketGovernance', method: 'PUT', path: '/api/v1/assets/buckets/{bucketID}/governance', scope: 'assets:admin' },
146
+ { id: 'getAssetMetadataEditor', method: 'GET', path: '/api/v1/assets/{assetID}/metadata-editor', scope: 'assets:read' },
147
+ { id: 'listAssetPublications', method: 'GET', path: '/api/v1/assets/publications', scope: 'assets:read' },
148
+ { id: 'createAssetPublication', method: 'POST', path: '/api/v1/assets/publications', scope: 'assets:write' },
149
+ { id: 'updateAssetPublication', method: 'PUT', path: '/api/v1/assets/publications/{publicationID}', scope: 'assets:write' },
150
+ { id: 'transitionAssetPublication', method: 'POST', path: '/api/v1/assets/publications/{publicationID}/{action}', scope: 'assets:publish' },
151
+ { id: 'resolveAssetPublication', method: 'GET', path: '/api/v1/assets/publications/{publicationID}/resolve', scope: 'assets:read' },
152
+ { id: 'listAssetPublicationRenditions', method: 'GET', path: '/api/v1/assets/{assetID}/publication-renditions', scope: 'assets:read' },
153
+ { id: 'previewAssetPublication', method: 'GET', path: '/api/v1/assets/publications/{publicationID}/preview', scope: 'assets:read' },
154
+ { id: 'migrateAssetBucketGovernance', method: 'POST', path: '/api/v1/assets/buckets/{bucketID}/governance/migrate', scope: 'assets:admin' },
155
+ { id: 'createAssetPickerCapability', method: 'POST', path: '/api/v1/assets/picker-capabilities', scope: 'assets:read' },
156
+ { id: 'revokeAssetPickerCapability', method: 'DELETE', path: '/api/v1/assets/picker-capabilities/{capabilityID}', scope: 'assets:read' },
157
+ { id: 'listAssetModels', method: 'GET', path: '/api/v1/assets/{assetID}/models', scope: 'assets:read' },
158
+ { id: 'processAssetModel', method: 'POST', path: '/api/v1/assets/{assetID}/models', scope: 'assets:process' },
159
+ { id: 'resolveAssetPublicationAR', method: 'POST', path: '/api/v1/assets/publications/{publicationID}/ar', scope: 'assets:read' },
160
+ { id: 'listAssetGalleries', method: 'GET', path: '/api/v1/assets/galleries', scope: 'assets:read' },
161
+ { id: 'createAssetGallery', method: 'POST', path: '/api/v1/assets/galleries', scope: 'assets:write' },
162
+ { id: 'updateAssetGallery', method: 'PUT', path: '/api/v1/assets/galleries/{galleryID}', scope: 'assets:write' },
163
+ { id: 'transitionAssetGallery', method: 'POST', path: '/api/v1/assets/galleries/{galleryID}/{action}', scope: 'assets:publish' },
164
+ { id: 'resolveAssetGallery', method: 'GET', path: '/api/v1/assets/galleries/{galleryID}/resolve', scope: 'assets:read' },
165
+ { id: 'resolveAssetGalleryAR', method: 'POST', path: '/api/v1/assets/galleries/{galleryID}/ar', scope: 'assets:read' },
166
+ { id: 'searchAssetPicker', method: 'POST', path: '/assets/picker/search', scope: 'assets:read' },
167
+ { id: 'selectAssetPicker', method: 'POST', path: '/assets/picker/select', scope: 'assets:read' },
66
168
  ];
package/dist/index.d.ts CHANGED
@@ -1,5 +1,12 @@
1
1
  export { StackShift, StackShiftAPIError } from './client.js';
2
2
  export { AssetsClient, assetTransformOptions, assetTransformPresets, assetTransformSpec, getAssetTransformPreset } from './assets.js';
3
+ export { AssetWorkflowsClient } from './asset-workflows.js';
4
+ export type * from './asset-workflows.js';
5
+ export type * from './asset-media-v2.js';
6
+ export { AssetConnectionsClient, AssetMigrationsClient, AssetStorageClient, AssetTextClient, AssetUploadCapabilitiesClient } from './assets-platform.js';
7
+ export type * from './assets-platform-types.js';
8
+ export { ChunkedUploadController, UploadResumeInvalidError, putBlob, sha256Blob } from './upload-controller.js';
9
+ export type { ChunkUploadCallbacks, ChunkUploadRequest, ChunkUploadSession, ChunkUploadTransport, ChunkedUploadOptions, UploadProgress, UploadResumeRecord, UploadResumeStore, UploadedPart } from './upload-controller.js';
3
10
  export { createResponsiveImage, namedResponsiveSource, uploadBrowserFile } from './assets-framework.js';
4
11
  export type { ArtDirectionSource, ResponsiveImageDescriptor, ResponsiveImageOptions } from './assets-framework.js';
5
12
  export { assetContractOperations } from './generated/assets-contract.js';
@@ -10,6 +17,8 @@ export { MailExportsClient } from './mail-exports.js';
10
17
  export type { MailExport, MailExportCreateInput } from './mail-exports.js';
11
18
  export type { MailDiagnosticFinding, MailTemplateDiagnosticInput, MailTemplateDiagnosticResult } from './mail-diagnostics.js';
12
19
  export { ProjectsClient } from './projects.js';
20
+ export { WorkloadSecurityClient } from './workload-security.js';
21
+ export type * from './workload-security.js';
13
22
  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
23
  export type { MailBounce, MailBounceListOptions, MailBounceListResult, MailBounceType, MailSuppression, MailSuppressionCreateInput, MailSuppressionListOptions, MailSuppressionListResult, MailSuppressionReason, MailSuppressionSource, } from './mail-delivery-types.js';
15
24
  export type { MailOtpChallenge, MailOtpChallengeListOptions, MailOtpChallengeListResult, MailOtpSendInput, MailOtpSendResponse, MailOtpStatus, MailOtpVerifyInput, MailOtpVerifyResponse, } from './mail-otp-types.js';
@@ -18,3 +27,15 @@ export type { MailEvent, MailEventListOptions, MailEventListResult, MailEventTyp
18
27
  export type { MailMessageStream, MailMessageStreamCreateInput, MailMessageStreamListResult } from './mail-streams.js';
19
28
  export type { MailDomainReputation, MailLimits, MailManualReviewStatus, MailReputation, MailReputationEvent, MailReputationEventListOptions, MailReputationEventListResult, MailReputationEventSeverity, MailReputationStatus, MailReputationTier, MailReputationWorkspace, } from './mail-reputation-types.js';
20
29
  export type { MailAnalytics, MailAnalyticsInput, MailAttachmentInput, MailBatch, MailBatchItem, MailBatchSendInput, MailBatchTemplateInput, MailInboundDomain, MailInboundMessage, MailScheduledCreateInput, MailScheduledMessage, } from './mail-advanced-types.js';
30
+ export { AssetVideoClient } from './assets-video.js';
31
+ export type * from './assets-video-types.js';
32
+ export * from './mail-tracking.js';
33
+ export type { MailCampaignContent, MailCampaignInput } from './mail-campaigns.js';
34
+ export { AssetDAMClient } from './assets-dam.js';
35
+ export type * from './assets-dam-types.js';
36
+ export type * from './mail-subscribers.js';
37
+ export type { MailMode, MailSimulationOptions } from './mail-simulation.js';
38
+ export * from './mail-brands.js';
39
+ export * from './mail-billing.js';
40
+ export * from './mail-migration.js';
41
+ export * from './mail-marketing.js';
package/dist/index.js CHANGED
@@ -1,7 +1,18 @@
1
1
  export { StackShift, StackShiftAPIError } from './client.js';
2
2
  export { AssetsClient, assetTransformOptions, assetTransformPresets, assetTransformSpec, getAssetTransformPreset } from './assets.js';
3
+ export { AssetWorkflowsClient } from './asset-workflows.js';
4
+ export { AssetConnectionsClient, AssetMigrationsClient, AssetStorageClient, AssetTextClient, AssetUploadCapabilitiesClient } from './assets-platform.js';
5
+ export { ChunkedUploadController, UploadResumeInvalidError, putBlob, sha256Blob } from './upload-controller.js';
3
6
  export { createResponsiveImage, namedResponsiveSource, uploadBrowserFile } from './assets-framework.js';
4
7
  export { assetContractOperations } from './generated/assets-contract.js';
5
8
  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
9
  export { MailExportsClient } from './mail-exports.js';
7
10
  export { ProjectsClient } from './projects.js';
11
+ export { WorkloadSecurityClient } from './workload-security.js';
12
+ export { AssetVideoClient } from './assets-video.js';
13
+ export * from './mail-tracking.js';
14
+ export { AssetDAMClient } from './assets-dam.js';
15
+ export * from './mail-brands.js';
16
+ export * from './mail-billing.js';
17
+ export * from './mail-migration.js';
18
+ export * from './mail-marketing.js';
@@ -1,3 +1,5 @@
1
+ import type { MailMode, MailSimulationOptions } from './mail-simulation.js';
2
+ import type { MailTrackingOptions } from './mail-tracking.js';
1
3
  import type { JsonValue, MailAddress, MailAddressInput, MailRecipient, MailSendInput, MailSendResponse } from './types.js';
2
4
  import type { MailSendTemplateInput } from './mail-template-types.js';
3
5
  export interface MailAttachmentInput {
@@ -9,6 +11,8 @@ export interface MailAttachmentInput {
9
11
  contentId?: string;
10
12
  }
11
13
  export interface MailScheduledCreateInput {
14
+ simulation?: MailSimulationOptions;
15
+ tracking?: MailTrackingOptions;
12
16
  sendAt: string;
13
17
  message?: MailSendInput;
14
18
  template?: string;
@@ -23,6 +27,7 @@ export interface MailScheduledCreateInput {
23
27
  stream?: string;
24
28
  }
25
29
  export interface MailScheduledMessage {
30
+ mode?: MailMode;
26
31
  id: string;
27
32
  status: 'scheduled' | 'queued' | 'dispatched' | 'canceled' | 'failed';
28
33
  sendAt: string;
@@ -36,6 +41,8 @@ export interface MailBatchSendInput {
36
41
  messages: MailSendInput[];
37
42
  }
38
43
  export interface MailBatchTemplateInput {
44
+ simulation?: MailSimulationOptions;
45
+ tracking?: MailTrackingOptions;
39
46
  template: string;
40
47
  versionId?: string;
41
48
  from: string | MailAddress;
@@ -49,6 +56,7 @@ export interface MailBatchTemplateInput {
49
56
  stream?: string;
50
57
  }
51
58
  export interface MailBatch {
59
+ mode?: MailMode;
52
60
  id: string;
53
61
  status: 'queued' | 'processing' | 'completed' | 'failed';
54
62
  messageCount: number;
@@ -58,6 +66,7 @@ export interface MailBatch {
58
66
  suppressedCount: number;
59
67
  }
60
68
  export interface MailBatchItem {
69
+ mode?: MailMode;
61
70
  id: string;
62
71
  batchId: string;
63
72
  messageId?: string | null;
@@ -0,0 +1,34 @@
1
+ import type { StackShift } from './client.js';
2
+ import type { MailMode } from './mail-simulation.js';
3
+ export interface MailBillingSummary {
4
+ reconciliationRequired: boolean;
5
+ active: boolean;
6
+ mode: MailMode;
7
+ currency: 'NGN';
8
+ periodStart: string;
9
+ periodEnd: string;
10
+ rateVersion: number;
11
+ recipientPriceKobo: number;
12
+ included: number;
13
+ used: number;
14
+ reserved: number;
15
+ remaining: number;
16
+ prepaidBalanceKobo: number;
17
+ spentKobo: number;
18
+ reservedKobo: number;
19
+ settings: {
20
+ prepaidEnabled: boolean;
21
+ capKobo: number;
22
+ revision: number;
23
+ };
24
+ }
25
+ export interface MailCampaignEstimate extends MailBillingSummary {
26
+ recipientCount: number;
27
+ requiredCreditKobo: number;
28
+ blockingReasons: string[];
29
+ }
30
+ export declare class MailBillingClient {
31
+ private readonly client;
32
+ constructor(client: StackShift);
33
+ summary(): Promise<MailBillingSummary>;
34
+ }
@@ -0,0 +1,7 @@
1
+ export class MailBillingClient {
2
+ client;
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ summary() { return this.client.mailRequest('/mail/billing'); }
7
+ }
@@ -0,0 +1,35 @@
1
+ import type { StackShift } from './client.js';
2
+ import type { MailMode } from './mail-simulation.js';
3
+ export interface MailBrandFields {
4
+ name: string;
5
+ logoUrl?: string;
6
+ sendingDomainId?: string | null;
7
+ defaultFrom?: string;
8
+ replyTo?: string;
9
+ postalAddress?: string;
10
+ website?: string;
11
+ supportEmail?: string;
12
+ editableFields?: string[];
13
+ }
14
+ export interface MailBrand extends MailBrandFields {
15
+ id: string;
16
+ workspaceId: string;
17
+ mode: MailMode;
18
+ status: 'active' | 'archived';
19
+ revision: number;
20
+ createdAt: string;
21
+ updatedAt: string;
22
+ }
23
+ export declare class MailBrandsClient {
24
+ private readonly client;
25
+ constructor(client: StackShift);
26
+ create(input: MailBrandFields): Promise<MailBrand>;
27
+ list(): Promise<{
28
+ data: MailBrand[];
29
+ }>;
30
+ get(id: string): Promise<MailBrand>;
31
+ update(id: string, input: MailBrandFields & {
32
+ revision: number;
33
+ }): Promise<MailBrand>;
34
+ archive(id: string): Promise<MailBrand>;
35
+ }
@@ -0,0 +1,17 @@
1
+ export class MailBrandsClient {
2
+ client;
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ create(input) {
7
+ return this.client.mailRequest('/mail/brands', { method: 'POST', body: input });
8
+ }
9
+ list() { return this.client.mailRequest('/mail/brands'); }
10
+ get(id) { return this.client.mailRequest(`/mail/brands/${encodeURIComponent(id)}`); }
11
+ update(id, input) {
12
+ return this.client.mailRequest(`/mail/brands/${encodeURIComponent(id)}`, { method: 'PUT', body: input });
13
+ }
14
+ archive(id) {
15
+ return this.client.mailRequest(`/mail/brands/${encodeURIComponent(id)}/archive`, { method: 'POST' });
16
+ }
17
+ }
@@ -1,5 +1,14 @@
1
+ import type { MailCampaignEstimate } from './mail-billing.js';
2
+ import type { MailMode, MailSimulationOptions } from './mail-simulation.js';
3
+ import type { MailImportMode, MailImportResult } from './mail-subscribers.js';
4
+ import type { MailTrackingOptions, MailEngagementReport } from './mail-tracking.js';
5
+ import type { MailTemplatePreview } from './mail-template-types.js';
6
+ import type { MailTemplateDiagnosticResult } from './mail-diagnostics.js';
1
7
  import type { StackShift } from './client.js';
2
8
  export interface MailAudience {
9
+ brandId: string;
10
+ mode?: MailMode;
11
+ editableFields?: string[];
3
12
  id: string;
4
13
  workspaceId: string;
5
14
  name: string;
@@ -10,14 +19,18 @@ export interface MailAudience {
10
19
  updatedAt: string;
11
20
  }
12
21
  export interface MailAudienceMember {
22
+ brandId: string;
23
+ confirmedIp?: string;
24
+ confirmedAt?: string;
13
25
  id: string;
14
26
  audienceId: string;
15
27
  email: string;
16
28
  name?: string;
17
- status: 'subscribed' | 'unsubscribed' | 'complained' | 'hard_bounced';
29
+ status: 'pending_confirmation' | 'subscribed' | 'unsubscribed' | 'complained' | 'hard_bounced';
18
30
  consentSource: string;
19
31
  consentAt: string;
20
32
  consentIp?: string;
33
+ attributes?: Record<string, string>;
21
34
  }
22
35
  export interface MailAudienceMemberImport {
23
36
  email: string;
@@ -25,8 +38,43 @@ export interface MailAudienceMemberImport {
25
38
  consentSource: string;
26
39
  consentAt: string;
27
40
  consentIp?: string;
41
+ attributes?: Record<string, string>;
42
+ }
43
+ export interface MailCampaignContent {
44
+ subject: string;
45
+ previewText?: string;
46
+ html: string;
47
+ text: string;
48
+ editorMode: 'code' | 'visual';
49
+ editorState?: Record<string, unknown> | null;
50
+ }
51
+ export interface MailCampaignInput {
52
+ simulation?: MailSimulationOptions;
53
+ name: string;
54
+ audienceId: string;
55
+ segmentId?: string;
56
+ from?: string;
57
+ replyTo?: string;
58
+ template?: string;
59
+ versionId?: string;
60
+ content?: MailCampaignContent;
61
+ variantBVersionId?: string;
62
+ variantBContent?: MailCampaignContent | null;
63
+ variantBPercent?: number;
64
+ tracking?: MailTrackingOptions;
28
65
  }
29
66
  export interface MailCampaign {
67
+ approvedMaxKobo?: number;
68
+ billingBlockReason?: string;
69
+ simulation?: MailSimulationOptions;
70
+ brandId: string;
71
+ mode?: MailMode;
72
+ content?: MailCampaignContent;
73
+ variantBContent?: MailCampaignContent | null;
74
+ variantBPercent?: number;
75
+ replyTo?: string;
76
+ revision: number;
77
+ tracking?: MailTrackingOptions;
30
78
  id: string;
31
79
  audienceId: string;
32
80
  batchId?: string;
@@ -34,7 +82,7 @@ export interface MailCampaign {
34
82
  template: string;
35
83
  versionId?: string;
36
84
  from: string;
37
- status: 'draft' | 'processing' | 'queued' | 'completed' | 'failed';
85
+ status: 'draft' | 'scheduled' | 'processing' | 'queued' | 'completed' | 'failed' | 'blocked';
38
86
  createdAt: string;
39
87
  updatedAt: string;
40
88
  queuedAt?: string;
@@ -43,6 +91,7 @@ export declare class MailAudiencesClient {
43
91
  private readonly client;
44
92
  constructor(client: StackShift);
45
93
  create(input: {
94
+ brandId: string;
46
95
  name: string;
47
96
  description?: string;
48
97
  }): Promise<MailAudience>;
@@ -57,20 +106,33 @@ export declare class MailAudiencesClient {
57
106
  imported: number;
58
107
  skipped: number;
59
108
  }>;
109
+ previewImport(id: string, members: MailAudienceMemberImport[], mode?: MailImportMode): Promise<MailImportResult>;
110
+ importDetailed(id: string, members: MailAudienceMemberImport[], mode?: MailImportMode): Promise<MailImportResult>;
111
+ setEditableFields(id: string, editableFields: string[]): Promise<{
112
+ editableFields: string[];
113
+ }>;
60
114
  }
61
115
  export declare class MailCampaignsClient {
62
116
  private readonly client;
63
117
  constructor(client: StackShift);
64
- create(input: {
65
- name: string;
66
- audienceId: string;
67
- template: string;
68
- versionId?: string;
69
- from: string;
70
- }): Promise<MailCampaign>;
118
+ create(input: MailCampaignInput): Promise<MailCampaign>;
71
119
  list(): Promise<{
72
120
  data: MailCampaign[];
73
121
  }>;
74
122
  get(id: string): Promise<MailCampaign>;
75
- send(id: string): Promise<MailCampaign>;
123
+ update(id: string, input: MailCampaignInput & {
124
+ revision: number;
125
+ }): Promise<MailCampaign>;
126
+ preview(id: string, data?: Record<string, unknown>, variant?: string): Promise<MailTemplatePreview & {
127
+ diagnostics: MailTemplateDiagnosticResult;
128
+ }>;
129
+ test(id: string, to: string, data?: Record<string, unknown>, variant?: string, simulation?: MailSimulationOptions): Promise<{
130
+ id: string;
131
+ status: string;
132
+ mode: "live" | "test";
133
+ }>;
134
+ schedule(id: string, sendAt: string, revision?: number, approvedMaxKobo?: number): Promise<MailCampaign>;
135
+ engagement(id: string): Promise<MailEngagementReport>;
136
+ estimate(id: string): Promise<MailCampaignEstimate>;
137
+ send(id: string, revision?: number, approvedMaxKobo?: number): Promise<MailCampaign>;
76
138
  }
@@ -21,6 +21,15 @@ export class MailAudiencesClient {
21
21
  body: { members },
22
22
  });
23
23
  }
24
+ previewImport(id, members, mode = 'recorded_consent') {
25
+ return this.client.mailRequest(`/mail/audiences/${encodeURIComponent(id)}/imports/preview`, { method: 'POST', body: { members, mode } });
26
+ }
27
+ importDetailed(id, members, mode = 'recorded_consent') {
28
+ return this.client.mailRequest(`/mail/audiences/${encodeURIComponent(id)}/imports`, { method: 'POST', body: { members, mode } });
29
+ }
30
+ setEditableFields(id, editableFields) {
31
+ return this.client.mailRequest(`/mail/audiences/${encodeURIComponent(id)}/preferences`, { method: 'PUT', body: { editableFields } });
32
+ }
24
33
  }
25
34
  export class MailCampaignsClient {
26
35
  client;
@@ -36,7 +45,21 @@ export class MailCampaignsClient {
36
45
  get(id) {
37
46
  return this.client.mailRequest(`/mail/campaigns/${encodeURIComponent(id)}`);
38
47
  }
39
- send(id) {
40
- return this.client.mailRequest(`/mail/campaigns/${encodeURIComponent(id)}/send`, { method: 'POST' });
48
+ update(id, input) {
49
+ return this.client.mailRequest(`/mail/campaigns/${encodeURIComponent(id)}`, { method: 'PUT', body: input });
50
+ }
51
+ preview(id, data = {}, variant = 'a') {
52
+ return this.client.mailRequest(`/mail/campaigns/${encodeURIComponent(id)}/preview`, { method: 'POST', body: { data, variant } });
53
+ }
54
+ test(id, to, data = {}, variant = 'a', simulation) {
55
+ return this.client.mailRequest(`/mail/campaigns/${encodeURIComponent(id)}/test`, { method: 'POST', body: { to, data, variant, simulation } });
56
+ }
57
+ schedule(id, sendAt, revision, approvedMaxKobo) {
58
+ return this.client.mailRequest(`/mail/campaigns/${encodeURIComponent(id)}/schedule`, { method: 'POST', body: { sendAt, revision, approvedMaxKobo } });
59
+ }
60
+ engagement(id) { return this.client.mailRequest(`/mail/campaigns/${encodeURIComponent(id)}/engagement`); }
61
+ estimate(id) { return this.client.mailRequest(`/mail/campaigns/${encodeURIComponent(id)}/estimate`); }
62
+ send(id, revision, approvedMaxKobo) {
63
+ return this.client.mailRequest(`/mail/campaigns/${encodeURIComponent(id)}/send`, { method: 'POST', body: { revision, approvedMaxKobo } });
41
64
  }
42
65
  }
@@ -0,0 +1,84 @@
1
+ import type { MailBrand } from './mail-brands.js';
2
+ import type { StackShift } from './client.js';
3
+ import type { MailMode, MailSimulationOptions } from './mail-simulation.js';
4
+ export interface MailAutomationInput {
5
+ audienceId: string;
6
+ name: string;
7
+ template: string;
8
+ versionId?: string;
9
+ from: string;
10
+ delaySeconds?: number;
11
+ simulation?: MailSimulationOptions;
12
+ }
13
+ export interface MailAutomation extends MailAutomationInput {
14
+ triggerType: string;
15
+ runCount: number;
16
+ id: string;
17
+ workspaceId: string;
18
+ brandId: string;
19
+ mode: MailMode;
20
+ createdAt: string;
21
+ updatedAt: string;
22
+ status?: string;
23
+ }
24
+ export declare class MailAutomationsClient {
25
+ private readonly client;
26
+ constructor(client: StackShift);
27
+ create(input: MailAutomationInput): Promise<MailAutomation>;
28
+ list(): Promise<{
29
+ data: MailAutomation[];
30
+ }>;
31
+ }
32
+ export interface MailSignupFormInput {
33
+ audienceId: string;
34
+ name: string;
35
+ heading?: string;
36
+ description?: string;
37
+ buttonLabel?: string;
38
+ successMessage?: string;
39
+ }
40
+ export interface MailSignupForm extends MailSignupFormInput {
41
+ publicToken: string;
42
+ brand?: MailBrand;
43
+ id: string;
44
+ workspaceId: string;
45
+ brandId: string;
46
+ mode: MailMode;
47
+ createdAt: string;
48
+ updatedAt: string;
49
+ status?: string;
50
+ }
51
+ export declare class MailFormsClient {
52
+ private readonly client;
53
+ constructor(client: StackShift);
54
+ create(input: MailSignupFormInput): Promise<MailSignupForm>;
55
+ list(): Promise<{
56
+ data: MailSignupForm[];
57
+ }>;
58
+ }
59
+ export interface MailSegmentInput {
60
+ audienceId: string;
61
+ name: string;
62
+ description?: string;
63
+ field: string;
64
+ operator: string;
65
+ value?: string;
66
+ }
67
+ export interface MailSegment extends MailSegmentInput {
68
+ memberCount: number;
69
+ id: string;
70
+ workspaceId: string;
71
+ brandId: string;
72
+ mode: MailMode;
73
+ createdAt: string;
74
+ updatedAt: string;
75
+ status?: string;
76
+ }
77
+ export declare class MailSegmentsClient {
78
+ private readonly client;
79
+ constructor(client: StackShift);
80
+ create(input: MailSegmentInput): Promise<MailSegment>;
81
+ list(): Promise<{
82
+ data: MailSegment[];
83
+ }>;
84
+ }
@@ -0,0 +1,24 @@
1
+ export class MailAutomationsClient {
2
+ client;
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ create(input) { return this.client.mailRequest('/mail/automations', { method: 'POST', body: input }); }
7
+ list() { return this.client.mailRequest('/mail/automations'); }
8
+ }
9
+ export class MailFormsClient {
10
+ client;
11
+ constructor(client) {
12
+ this.client = client;
13
+ }
14
+ create(input) { return this.client.mailRequest('/mail/forms', { method: 'POST', body: input }); }
15
+ list() { return this.client.mailRequest('/mail/forms'); }
16
+ }
17
+ export class MailSegmentsClient {
18
+ client;
19
+ constructor(client) {
20
+ this.client = client;
21
+ }
22
+ create(input) { return this.client.mailRequest('/mail/segments', { method: 'POST', body: input }); }
23
+ list() { return this.client.mailRequest('/mail/segments'); }
24
+ }