@stackshift-cloud/sdk 1.1.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 (43) hide show
  1. package/README.md +58 -1
  2. package/dist/assets-dam-types.d.ts +225 -0
  3. package/dist/assets-dam-types.js +1 -0
  4. package/dist/assets-dam.d.ts +96 -0
  5. package/dist/assets-dam.js +47 -0
  6. package/dist/assets-video-types.d.ts +116 -0
  7. package/dist/assets-video-types.js +1 -0
  8. package/dist/assets-video.d.ts +25 -0
  9. package/dist/assets-video.js +19 -0
  10. package/dist/assets.d.ts +5 -1
  11. package/dist/assets.js +11 -2
  12. package/dist/client.d.ts +4 -0
  13. package/dist/client.js +11 -0
  14. package/dist/generated/assets-contract.d.ts +246 -1
  15. package/dist/generated/assets-contract.js +49 -0
  16. package/dist/index.d.ts +14 -0
  17. package/dist/index.js +8 -0
  18. package/dist/mail-advanced-types.d.ts +9 -0
  19. package/dist/mail-billing.d.ts +34 -0
  20. package/dist/mail-billing.js +7 -0
  21. package/dist/mail-brands.d.ts +35 -0
  22. package/dist/mail-brands.js +17 -0
  23. package/dist/mail-campaigns.d.ts +72 -10
  24. package/dist/mail-campaigns.js +25 -2
  25. package/dist/mail-marketing.d.ts +84 -0
  26. package/dist/mail-marketing.js +24 -0
  27. package/dist/mail-migration.d.ts +16 -0
  28. package/dist/mail-migration.js +10 -0
  29. package/dist/mail-otp-types.d.ts +4 -0
  30. package/dist/mail-simulation.d.ts +4 -0
  31. package/dist/mail-simulation.js +1 -0
  32. package/dist/mail-subscribers.d.ts +39 -0
  33. package/dist/mail-subscribers.js +1 -0
  34. package/dist/mail-template-types.d.ts +8 -0
  35. package/dist/mail-tracking.d.ts +59 -0
  36. package/dist/mail-tracking.js +14 -0
  37. package/dist/mail-webhook-types.d.ts +4 -1
  38. package/dist/mail.d.ts +12 -0
  39. package/dist/mail.js +19 -0
  40. package/dist/types.d.ts +13 -0
  41. package/dist/workload-security.d.ts +172 -0
  42. package/dist/workload-security.js +50 -0
  43. package/package.json +2 -2
package/dist/assets.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { AssetDAMClient } from './assets-dam.js';
2
+ import { AssetVideoClient } from './assets-video.js';
1
3
  import { AssetConnectionsClient, AssetMigrationsClient, AssetStorageClient, AssetTextClient, AssetUploadCapabilitiesClient } from './assets-platform.js';
2
4
  import { AssetWorkflowsClient } from './asset-workflows.js';
3
5
  import { ChunkedUploadController, putBlob, sha256Blob } from './upload-controller.js';
@@ -44,6 +46,8 @@ export function assetTransformSpec(options) {
44
46
  }
45
47
  export class AssetsClient {
46
48
  client;
49
+ dam;
50
+ video;
47
51
  connections;
48
52
  storage;
49
53
  migrations;
@@ -52,6 +56,8 @@ export class AssetsClient {
52
56
  workflows;
53
57
  constructor(client) {
54
58
  this.client = client;
59
+ this.dam = new AssetDAMClient(client);
60
+ this.video = new AssetVideoClient(client);
55
61
  this.connections = new AssetConnectionsClient(client);
56
62
  this.storage = new AssetStorageClient(client);
57
63
  this.migrations = new AssetMigrationsClient(client);
@@ -76,6 +82,9 @@ export class AssetsClient {
76
82
  append(query, 'type', options.type);
77
83
  append(query, 'folder', options.folder);
78
84
  append(query, 'checksum', options.checksum);
85
+ append(query, 'collection_id', options.collectionId);
86
+ append(query, 'duplicates', options.duplicates === undefined ? undefined : String(options.duplicates));
87
+ append(query, 'security', options.security);
79
88
  append(query, 'status', options.status);
80
89
  append(query, 'scan_status', options.scanStatus);
81
90
  append(query, 'replication_status', options.replicationStatus);
@@ -300,8 +309,8 @@ export class AssetsClient {
300
309
  createCollection(input) {
301
310
  return this.client.request('/assets/collections', { method: 'POST', body: input });
302
311
  }
303
- updateCollection(collectionId, input) {
304
- return this.client.request(`/assets/collections/${encodeURIComponent(collectionId)}`, { method: 'PUT', body: input });
312
+ updateCollection(collectionId, revision, input) {
313
+ return this.client.request(`/assets/collections/${encodeURIComponent(collectionId)}`, { method: 'PUT', body: input, headers: { 'If-Match': `"${revision}"` } });
305
314
  }
306
315
  deleteCollection(collectionId) {
307
316
  return this.client.request(`/assets/collections/${encodeURIComponent(collectionId)}`, { method: 'DELETE' });
package/dist/client.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import { AssetsClient } from './assets.js';
2
2
  import { MailClient } from './mail.js';
3
3
  import { ProjectsClient } from './projects.js';
4
+ import { WorkloadSecurityClient } from './workload-security.js';
4
5
  import type { StackShiftOptions } from './types.js';
5
6
  export declare class StackShift {
7
+ readonly assetSpaceId?: string;
6
8
  readonly apiKey: string;
7
9
  readonly baseUrl: string;
8
10
  readonly mailBaseUrl: string;
@@ -10,6 +12,7 @@ export declare class StackShift {
10
12
  readonly projects: ProjectsClient;
11
13
  readonly assets: AssetsClient;
12
14
  readonly mail: MailClient;
15
+ readonly workloadSecurity: WorkloadSecurityClient;
13
16
  private readonly fetcher;
14
17
  constructor(options?: StackShiftOptions);
15
18
  request<T>(path: string, init?: {
@@ -27,6 +30,7 @@ export declare class StackShift {
27
30
  body?: unknown;
28
31
  headers?: Record<string, string>;
29
32
  }): Promise<T>;
33
+ playbackRequest<T>(path: '/sessions/renew' | '/events', credential: string, body: unknown): Promise<T>;
30
34
  private requestFrom;
31
35
  private fetchFrom;
32
36
  }
package/dist/client.js CHANGED
@@ -1,10 +1,12 @@
1
1
  import { AssetsClient } from './assets.js';
2
2
  import { MailClient } from './mail.js';
3
3
  import { ProjectsClient } from './projects.js';
4
+ import { WorkloadSecurityClient } from './workload-security.js';
4
5
  const defaultBaseUrl = 'https://api.stackshift.cloud/api/v1';
5
6
  const defaultMailBaseUrl = 'https://api.stackshift.cloud/v1';
6
7
  const defaultCdnBaseUrl = 'https://cdn.stackshift.cloud';
7
8
  export class StackShift {
9
+ assetSpaceId;
8
10
  apiKey;
9
11
  baseUrl;
10
12
  mailBaseUrl;
@@ -12,12 +14,14 @@ export class StackShift {
12
14
  projects;
13
15
  assets;
14
16
  mail;
17
+ workloadSecurity;
15
18
  fetcher;
16
19
  constructor(options = {}) {
17
20
  const apiKey = options.apiKey ?? env('STACKSHIFT_API_KEY');
18
21
  if (!apiKey) {
19
22
  throw new Error('StackShift SDK requires an apiKey');
20
23
  }
24
+ this.assetSpaceId = options.assetSpaceId;
21
25
  this.apiKey = apiKey;
22
26
  this.baseUrl = (options.baseUrl ?? defaultBaseUrl).replace(/\/$/, '');
23
27
  this.mailBaseUrl = (options.mailBaseUrl ?? defaultMailBaseUrl).replace(/\/$/, '');
@@ -26,6 +30,7 @@ export class StackShift {
26
30
  this.projects = new ProjectsClient(this);
27
31
  this.assets = new AssetsClient(this);
28
32
  this.mail = new MailClient(this);
33
+ this.workloadSecurity = new WorkloadSecurityClient(this);
29
34
  }
30
35
  async request(path, init = {}) {
31
36
  return this.requestFrom(this.baseUrl, path, init);
@@ -36,6 +41,11 @@ export class StackShift {
36
41
  async mailRequest(path, init = {}) {
37
42
  return this.requestFrom(this.mailBaseUrl, path, init);
38
43
  }
44
+ playbackRequest(path, credential, body) {
45
+ return this.requestFrom(new URL(this.baseUrl).origin, `/playback${path}`, {
46
+ method: 'POST', body, headers: { Authorization: `Bearer ${credential}` },
47
+ });
48
+ }
39
49
  async requestFrom(baseUrl, path, init) {
40
50
  const response = await this.fetchFrom(baseUrl, path, init);
41
51
  const raw = await response.text();
@@ -51,6 +61,7 @@ export class StackShift {
51
61
  method: init.method ?? 'GET',
52
62
  headers: stripUndefined({
53
63
  Authorization: `Bearer ${this.apiKey}`,
64
+ 'X-Asset-Space-ID': path.startsWith('/assets') ? this.assetSpaceId : undefined,
54
65
  'Content-Type': isFormData ? undefined : 'application/json',
55
66
  ...init.headers,
56
67
  }),
@@ -1,4 +1,4 @@
1
- export type AssetOperationId = 'uploadAsset' | 'createUploadSession' | 'getUploadSession' | 'completeUploadSession' | 'cancelUploadSession' | 'createSignedUploadUrl' | 'createBucket' | 'listBuckets' | 'updateBucket' | 'deleteBucket' | 'configureBucketStorage' | 'startBucketRelocation' | 'createAssetConnection' | 'listAssetConnections' | 'getAssetConnection' | 'updateAssetConnection' | 'verifyAssetConnection' | 'deleteAssetConnection' | 'listOwnedS2Buckets' | 'createOwnedS2Bucket' | 'startAssetMigration' | 'listAssetMigrations' | 'getAssetMigration' | 'cancelAssetMigration' | 'retryAssetMigrationItem' | 'downloadAssetMigrationReport' | 'createAssetUploadCapability' | 'getContentPolicy' | 'updateContentPolicy' | 'upsertTransformation' | 'listTransformations' | 'materializeAssetTransform' | 'listAssetDerivatives' | 'generateAsset' | 'getAssetAutomation' | 'assetMCP' | 'getAssetWorkflowCatalog' | 'listAssetWorkflows' | 'createAssetWorkflow' | 'getAssetWorkflow' | 'updateAssetWorkflowDraft' | 'validateAssetWorkflow' | 'publishAssetWorkflow' | 'activateAssetWorkflow' | 'startAssetWorkflowRun' | 'listAssetWorkflowVersions' | 'listAssetWorkflowRuns' | 'getAssetWorkflowRun' | 'cancelAssetWorkflowRun' | 'retryAssetWorkflowRun' | 'listAssetWorkflowApprovals' | 'approveAssetWorkflow' | 'rejectAssetWorkflow' | 'listAssetWorkflowConnections' | 'createAssetWorkflowConnection' | 'rotateAssetWorkflowConnectionCredential' | 'rotateAssetWorkflowInboundHook' | 'receiveAssetWorkflowInboundHook' | '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' | 'startAssetTextExtraction' | 'getAssetTextExtraction' | 'retryAssetTextExtraction' | 'patchAsset' | 'getAssetAI' | 'analyzeAsset' | 'moderateAsset' | 'getTranscript' | 'transcribeAsset' | 'smartCropAsset' | 'removeAssetBackground' | 'listAssetVersions' | 'createAssetBranch' | 'restoreAssetVersion' | 'promoteAssetBranch' | 'deleteAsset' | 'replaceAsset' | 'createSignedAssetUrl' | 'createSignedTransformUrl' | 'setAssetTags' | 'patchAssetMetadata' | 'purgeAsset' | 'widgetCreateUploadSession' | 'widgetGetUploadSession' | 'widgetUploadPart' | 'widgetCompleteUploadSession' | 'widgetCancelUploadSession' | 'widgetIngestRemoteUrl';
1
+ export type AssetOperationId = 'putAssetAICredential' | 'deleteAssetAICredential' | 'openAssetAIOutput' | 'getVideoWorkspace' | 'processVideoVersion' | 'createVideoPlaybackSession' | 'revokeVideoPlaybackSession' | 'reviewVideoVersion' | 'listVideoCaptions' | 'addVideoCaption' | 'removeVideoCaption' | 'getVideoAnalytics' | 'createPublicVideoPlaybackSession' | 'renewVideoPlaybackSession' | 'recordVideoPlaybackEvents' | 'uploadAsset' | 'createUploadSession' | 'getUploadSession' | 'completeUploadSession' | 'cancelUploadSession' | 'createSignedUploadUrl' | 'createBucket' | 'listBuckets' | 'updateBucket' | 'deleteBucket' | 'configureBucketStorage' | 'startBucketRelocation' | 'createAssetConnection' | 'listAssetConnections' | 'getAssetConnection' | 'updateAssetConnection' | 'verifyAssetConnection' | 'deleteAssetConnection' | 'listOwnedS2Buckets' | 'createOwnedS2Bucket' | 'startAssetMigration' | 'listAssetMigrations' | 'getAssetMigration' | 'cancelAssetMigration' | 'retryAssetMigrationItem' | 'downloadAssetMigrationReport' | 'createAssetUploadCapability' | 'getContentPolicy' | 'updateContentPolicy' | 'upsertTransformation' | 'listTransformations' | 'materializeAssetTransform' | 'listAssetDerivatives' | 'generateAsset' | 'getAssetAutomation' | 'assetMCP' | 'getAssetWorkflowCatalog' | 'listAssetWorkflows' | 'createAssetWorkflow' | 'getAssetWorkflow' | 'updateAssetWorkflowDraft' | 'validateAssetWorkflow' | 'publishAssetWorkflow' | 'activateAssetWorkflow' | 'startAssetWorkflowRun' | 'listAssetWorkflowVersions' | 'listAssetWorkflowRuns' | 'getAssetWorkflowRun' | 'cancelAssetWorkflowRun' | 'retryAssetWorkflowRun' | 'listAssetWorkflowApprovals' | 'approveAssetWorkflow' | 'rejectAssetWorkflow' | 'listAssetWorkflowConnections' | 'createAssetWorkflowConnection' | 'rotateAssetWorkflowConnectionCredential' | 'rotateAssetWorkflowInboundHook' | 'receiveAssetWorkflowInboundHook' | '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' | 'startAssetTextExtraction' | 'getAssetTextExtraction' | 'retryAssetTextExtraction' | 'patchAsset' | 'getAssetAI' | 'analyzeAsset' | 'moderateAsset' | 'getTranscript' | 'transcribeAsset' | 'smartCropAsset' | 'removeAssetBackground' | 'listAssetVersions' | 'createAssetBranch' | 'restoreAssetVersion' | 'promoteAssetBranch' | 'deleteAsset' | 'replaceAsset' | 'createSignedAssetUrl' | 'createSignedTransformUrl' | 'setAssetTags' | 'patchAssetMetadata' | 'purgeAsset' | 'widgetCreateUploadSession' | 'widgetGetUploadSession' | 'widgetUploadPart' | 'widgetCompleteUploadSession' | 'widgetCancelUploadSession' | 'widgetIngestRemoteUrl' | 'listAssetSpaces' | 'listAssetCollaborators' | 'inviteAssetCollaborator' | 'updateAssetCollaborator' | 'revokeAssetCollaborator' | 'acceptAssetInvitation' | 'listAssetMetadataSchemas' | 'createAssetMetadataSchema' | 'updateAssetMetadataSchema' | 'publishAssetMetadataSchema' | 'getAssetBucketGovernance' | 'updateAssetBucketGovernance' | 'getAssetMetadataEditor' | 'listAssetPublications' | 'createAssetPublication' | 'updateAssetPublication' | 'transitionAssetPublication' | 'resolveAssetPublication' | 'listAssetPublicationRenditions' | 'previewAssetPublication' | 'migrateAssetBucketGovernance' | 'createAssetPickerCapability' | 'revokeAssetPickerCapability' | 'listAssetModels' | 'processAssetModel' | 'resolveAssetPublicationAR' | 'listAssetGalleries' | 'createAssetGallery' | 'updateAssetGallery' | 'transitionAssetGallery' | 'resolveAssetGallery' | 'resolveAssetGalleryAR' | 'searchAssetPicker' | 'selectAssetPicker';
2
2
  export type AssetAPIScope = 'assets:read' | 'assets:write' | 'assets:process' | 'assets:generate' | 'assets:publish' | 'assets:admin' | 'assets:any';
3
3
  export interface AssetContractOperation {
4
4
  readonly id: AssetOperationId;
@@ -7,6 +7,81 @@ export interface AssetContractOperation {
7
7
  readonly scope: AssetAPIScope;
8
8
  }
9
9
  export declare const assetContractOperations: readonly [{
10
+ readonly id: "putAssetAICredential";
11
+ readonly method: "PUT";
12
+ readonly path: "/api/v1/assets/ai/credential";
13
+ readonly scope: "assets:process";
14
+ }, {
15
+ readonly id: "deleteAssetAICredential";
16
+ readonly method: "DELETE";
17
+ readonly path: "/api/v1/assets/ai/credential";
18
+ readonly scope: "assets:process";
19
+ }, {
20
+ readonly id: "openAssetAIOutput";
21
+ readonly method: "GET";
22
+ readonly path: "/api/v1/assets/{assetID}/ai/outputs/{outputID}";
23
+ readonly scope: "assets:read";
24
+ }, {
25
+ readonly id: "getVideoWorkspace";
26
+ readonly method: "GET";
27
+ readonly path: "/api/v1/assets/{assetID}/video";
28
+ readonly scope: "assets:read";
29
+ }, {
30
+ readonly id: "processVideoVersion";
31
+ readonly method: "POST";
32
+ readonly path: "/api/v1/assets/{assetID}/versions/{versionID}/video";
33
+ readonly scope: "assets:process";
34
+ }, {
35
+ readonly id: "createVideoPlaybackSession";
36
+ readonly method: "POST";
37
+ readonly path: "/api/v1/assets/{assetID}/playback-sessions";
38
+ readonly scope: "assets:read";
39
+ }, {
40
+ readonly id: "revokeVideoPlaybackSession";
41
+ readonly method: "DELETE";
42
+ readonly path: "/api/v1/assets/{assetID}/playback-sessions/{sessionID}";
43
+ readonly scope: "assets:write";
44
+ }, {
45
+ readonly id: "reviewVideoVersion";
46
+ readonly method: "POST";
47
+ readonly path: "/api/v1/assets/{assetID}/versions/{versionID}/video/review";
48
+ readonly scope: "assets:admin";
49
+ }, {
50
+ readonly id: "listVideoCaptions";
51
+ readonly method: "GET";
52
+ readonly path: "/api/v1/assets/{assetID}/versions/{versionID}/video/captions";
53
+ readonly scope: "assets:read";
54
+ }, {
55
+ readonly id: "addVideoCaption";
56
+ readonly method: "POST";
57
+ readonly path: "/api/v1/assets/{assetID}/versions/{versionID}/video/captions";
58
+ readonly scope: "assets:write";
59
+ }, {
60
+ readonly id: "removeVideoCaption";
61
+ readonly method: "DELETE";
62
+ readonly path: "/api/v1/assets/{assetID}/versions/{versionID}/video/captions/{captionID}";
63
+ readonly scope: "assets:write";
64
+ }, {
65
+ readonly id: "getVideoAnalytics";
66
+ readonly method: "GET";
67
+ readonly path: "/api/v1/assets/{assetID}/video/analytics";
68
+ readonly scope: "assets:read";
69
+ }, {
70
+ readonly id: "createPublicVideoPlaybackSession";
71
+ readonly method: "POST";
72
+ readonly path: "/playback/assets/{assetID}/sessions";
73
+ readonly scope: "assets:read";
74
+ }, {
75
+ readonly id: "renewVideoPlaybackSession";
76
+ readonly method: "POST";
77
+ readonly path: "/playback/sessions/renew";
78
+ readonly scope: "assets:read";
79
+ }, {
80
+ readonly id: "recordVideoPlaybackEvents";
81
+ readonly method: "POST";
82
+ readonly path: "/playback/events";
83
+ readonly scope: "assets:read";
84
+ }, {
10
85
  readonly id: "uploadAsset";
11
86
  readonly method: "POST";
12
87
  readonly path: "/api/v1/assets/upload";
@@ -591,4 +666,174 @@ export declare const assetContractOperations: readonly [{
591
666
  readonly method: "POST";
592
667
  readonly path: "/assets/widget/remote-url";
593
668
  readonly scope: "assets:write";
669
+ }, {
670
+ readonly id: "listAssetSpaces";
671
+ readonly method: "GET";
672
+ readonly path: "/api/v1/assets/spaces";
673
+ readonly scope: "assets:read";
674
+ }, {
675
+ readonly id: "listAssetCollaborators";
676
+ readonly method: "GET";
677
+ readonly path: "/api/v1/assets/collaborators";
678
+ readonly scope: "assets:admin";
679
+ }, {
680
+ readonly id: "inviteAssetCollaborator";
681
+ readonly method: "POST";
682
+ readonly path: "/api/v1/assets/collaborators";
683
+ readonly scope: "assets:admin";
684
+ }, {
685
+ readonly id: "updateAssetCollaborator";
686
+ readonly method: "PUT";
687
+ readonly path: "/api/v1/assets/collaborators/{collaboratorID}";
688
+ readonly scope: "assets:admin";
689
+ }, {
690
+ readonly id: "revokeAssetCollaborator";
691
+ readonly method: "DELETE";
692
+ readonly path: "/api/v1/assets/collaborators/{collaboratorID}";
693
+ readonly scope: "assets:admin";
694
+ }, {
695
+ readonly id: "acceptAssetInvitation";
696
+ readonly method: "POST";
697
+ readonly path: "/api/v1/assets/invitations/{invitationID}/accept";
698
+ readonly scope: "assets:read";
699
+ }, {
700
+ readonly id: "listAssetMetadataSchemas";
701
+ readonly method: "GET";
702
+ readonly path: "/api/v1/assets/metadata-schemas";
703
+ readonly scope: "assets:read";
704
+ }, {
705
+ readonly id: "createAssetMetadataSchema";
706
+ readonly method: "POST";
707
+ readonly path: "/api/v1/assets/metadata-schemas";
708
+ readonly scope: "assets:admin";
709
+ }, {
710
+ readonly id: "updateAssetMetadataSchema";
711
+ readonly method: "PUT";
712
+ readonly path: "/api/v1/assets/metadata-schemas/{schemaID}";
713
+ readonly scope: "assets:admin";
714
+ }, {
715
+ readonly id: "publishAssetMetadataSchema";
716
+ readonly method: "POST";
717
+ readonly path: "/api/v1/assets/metadata-schemas/{schemaID}/publish";
718
+ readonly scope: "assets:admin";
719
+ }, {
720
+ readonly id: "getAssetBucketGovernance";
721
+ readonly method: "GET";
722
+ readonly path: "/api/v1/assets/buckets/{bucketID}/governance";
723
+ readonly scope: "assets:admin";
724
+ }, {
725
+ readonly id: "updateAssetBucketGovernance";
726
+ readonly method: "PUT";
727
+ readonly path: "/api/v1/assets/buckets/{bucketID}/governance";
728
+ readonly scope: "assets:admin";
729
+ }, {
730
+ readonly id: "getAssetMetadataEditor";
731
+ readonly method: "GET";
732
+ readonly path: "/api/v1/assets/{assetID}/metadata-editor";
733
+ readonly scope: "assets:read";
734
+ }, {
735
+ readonly id: "listAssetPublications";
736
+ readonly method: "GET";
737
+ readonly path: "/api/v1/assets/publications";
738
+ readonly scope: "assets:read";
739
+ }, {
740
+ readonly id: "createAssetPublication";
741
+ readonly method: "POST";
742
+ readonly path: "/api/v1/assets/publications";
743
+ readonly scope: "assets:write";
744
+ }, {
745
+ readonly id: "updateAssetPublication";
746
+ readonly method: "PUT";
747
+ readonly path: "/api/v1/assets/publications/{publicationID}";
748
+ readonly scope: "assets:write";
749
+ }, {
750
+ readonly id: "transitionAssetPublication";
751
+ readonly method: "POST";
752
+ readonly path: "/api/v1/assets/publications/{publicationID}/{action}";
753
+ readonly scope: "assets:publish";
754
+ }, {
755
+ readonly id: "resolveAssetPublication";
756
+ readonly method: "GET";
757
+ readonly path: "/api/v1/assets/publications/{publicationID}/resolve";
758
+ readonly scope: "assets:read";
759
+ }, {
760
+ readonly id: "listAssetPublicationRenditions";
761
+ readonly method: "GET";
762
+ readonly path: "/api/v1/assets/{assetID}/publication-renditions";
763
+ readonly scope: "assets:read";
764
+ }, {
765
+ readonly id: "previewAssetPublication";
766
+ readonly method: "GET";
767
+ readonly path: "/api/v1/assets/publications/{publicationID}/preview";
768
+ readonly scope: "assets:read";
769
+ }, {
770
+ readonly id: "migrateAssetBucketGovernance";
771
+ readonly method: "POST";
772
+ readonly path: "/api/v1/assets/buckets/{bucketID}/governance/migrate";
773
+ readonly scope: "assets:admin";
774
+ }, {
775
+ readonly id: "createAssetPickerCapability";
776
+ readonly method: "POST";
777
+ readonly path: "/api/v1/assets/picker-capabilities";
778
+ readonly scope: "assets:read";
779
+ }, {
780
+ readonly id: "revokeAssetPickerCapability";
781
+ readonly method: "DELETE";
782
+ readonly path: "/api/v1/assets/picker-capabilities/{capabilityID}";
783
+ readonly scope: "assets:read";
784
+ }, {
785
+ readonly id: "listAssetModels";
786
+ readonly method: "GET";
787
+ readonly path: "/api/v1/assets/{assetID}/models";
788
+ readonly scope: "assets:read";
789
+ }, {
790
+ readonly id: "processAssetModel";
791
+ readonly method: "POST";
792
+ readonly path: "/api/v1/assets/{assetID}/models";
793
+ readonly scope: "assets:process";
794
+ }, {
795
+ readonly id: "resolveAssetPublicationAR";
796
+ readonly method: "POST";
797
+ readonly path: "/api/v1/assets/publications/{publicationID}/ar";
798
+ readonly scope: "assets:read";
799
+ }, {
800
+ readonly id: "listAssetGalleries";
801
+ readonly method: "GET";
802
+ readonly path: "/api/v1/assets/galleries";
803
+ readonly scope: "assets:read";
804
+ }, {
805
+ readonly id: "createAssetGallery";
806
+ readonly method: "POST";
807
+ readonly path: "/api/v1/assets/galleries";
808
+ readonly scope: "assets:write";
809
+ }, {
810
+ readonly id: "updateAssetGallery";
811
+ readonly method: "PUT";
812
+ readonly path: "/api/v1/assets/galleries/{galleryID}";
813
+ readonly scope: "assets:write";
814
+ }, {
815
+ readonly id: "transitionAssetGallery";
816
+ readonly method: "POST";
817
+ readonly path: "/api/v1/assets/galleries/{galleryID}/{action}";
818
+ readonly scope: "assets:publish";
819
+ }, {
820
+ readonly id: "resolveAssetGallery";
821
+ readonly method: "GET";
822
+ readonly path: "/api/v1/assets/galleries/{galleryID}/resolve";
823
+ readonly scope: "assets:read";
824
+ }, {
825
+ readonly id: "resolveAssetGalleryAR";
826
+ readonly method: "POST";
827
+ readonly path: "/api/v1/assets/galleries/{galleryID}/ar";
828
+ readonly scope: "assets:read";
829
+ }, {
830
+ readonly id: "searchAssetPicker";
831
+ readonly method: "POST";
832
+ readonly path: "/assets/picker/search";
833
+ readonly scope: "assets:read";
834
+ }, {
835
+ readonly id: "selectAssetPicker";
836
+ readonly method: "POST";
837
+ readonly path: "/assets/picker/select";
838
+ readonly scope: "assets:read";
594
839
  }];
@@ -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' },
@@ -116,4 +131,38 @@ export const assetContractOperations = [
116
131
  { id: 'widgetCompleteUploadSession', method: 'POST', path: '/assets/widget/sessions/current/complete', scope: 'assets:write' },
117
132
  { id: 'widgetCancelUploadSession', method: 'DELETE', path: '/assets/widget/sessions/current', scope: 'assets:write' },
118
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' },
119
168
  ];
package/dist/index.d.ts CHANGED
@@ -17,6 +17,8 @@ export { MailExportsClient } from './mail-exports.js';
17
17
  export type { MailExport, MailExportCreateInput } from './mail-exports.js';
18
18
  export type { MailDiagnosticFinding, MailTemplateDiagnosticInput, MailTemplateDiagnosticResult } from './mail-diagnostics.js';
19
19
  export { ProjectsClient } from './projects.js';
20
+ export { WorkloadSecurityClient } from './workload-security.js';
21
+ export type * from './workload-security.js';
20
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';
21
23
  export type { MailBounce, MailBounceListOptions, MailBounceListResult, MailBounceType, MailSuppression, MailSuppressionCreateInput, MailSuppressionListOptions, MailSuppressionListResult, MailSuppressionReason, MailSuppressionSource, } from './mail-delivery-types.js';
22
24
  export type { MailOtpChallenge, MailOtpChallengeListOptions, MailOtpChallengeListResult, MailOtpSendInput, MailOtpSendResponse, MailOtpStatus, MailOtpVerifyInput, MailOtpVerifyResponse, } from './mail-otp-types.js';
@@ -25,3 +27,15 @@ export type { MailEvent, MailEventListOptions, MailEventListResult, MailEventTyp
25
27
  export type { MailMessageStream, MailMessageStreamCreateInput, MailMessageStreamListResult } from './mail-streams.js';
26
28
  export type { MailDomainReputation, MailLimits, MailManualReviewStatus, MailReputation, MailReputationEvent, MailReputationEventListOptions, MailReputationEventListResult, MailReputationEventSeverity, MailReputationStatus, MailReputationTier, MailReputationWorkspace, } from './mail-reputation-types.js';
27
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
@@ -8,3 +8,11 @@ export { assetContractOperations } from './generated/assets-contract.js';
8
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';
9
9
  export { MailExportsClient } from './mail-exports.js';
10
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
+ }