@supernova-studio/client 0.47.17 → 0.47.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supernova-studio/client",
3
- "version": "0.47.17",
3
+ "version": "0.47.19",
4
4
  "description": "Supernova Data Models",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -0,0 +1 @@
1
+ export * from "./pipeline";
@@ -0,0 +1,23 @@
1
+ import { Pipeline } from "@supernova-studio/model";
2
+ import { DTOPipeline } from "../../dto/export/pipeline";
3
+
4
+ export function pipelineToDto(pipeline: Pipeline): DTOPipeline {
5
+ return {
6
+ id: pipeline.id,
7
+ name: pipeline.name,
8
+ eventType: pipeline.eventType,
9
+ isEnabled: pipeline.isEnabled,
10
+ workspaceId: pipeline.workspaceId,
11
+ designSystemId: pipeline.designSystemId,
12
+ exporterId: pipeline.exporterId,
13
+ brandPersistentId: pipeline.brandPersistentId,
14
+ themePersistentId: pipeline.themePersistentId,
15
+ destinationAzure: pipeline.destinationAzure,
16
+ destinationBitbucket: pipeline.destinationBitbucket,
17
+ destinationSnDocs: pipeline.destinationSnDocs,
18
+ destinationGithub: pipeline.destinationGithub,
19
+ destinationGitlab: pipeline.destinationGitlab,
20
+ destinationS3: pipeline.destinationS3,
21
+ webhookUrl: pipeline.webhookUrl,
22
+ };
23
+ }
@@ -1,2 +1,3 @@
1
1
  export * from "./documentation";
2
+ export * from "./export";
2
3
  export * from "./integrations";
@@ -23,7 +23,7 @@ export const DTOExporter = z.object({
23
23
  iconURL: z.string().optional(),
24
24
  configurationProperties: PulsarContributionConfigurationProperty.array(),
25
25
  customBlocks: PulsarCustomBlock.array(),
26
- blockVariants: PulsarContributionVariant.array(),
26
+ blockVariants: z.record(z.string(), PulsarContributionVariant.array()),
27
27
 
28
28
  usesBrands: z.boolean(),
29
29
  usesThemes: z.boolean(),
@@ -61,7 +61,7 @@ export const DTOExporterGitProviderEnum = z.enum(["github", "gitlab", "bitbucket
61
61
 
62
62
  export const DTOExporterCreateInput = z.object({
63
63
  url: z.string(),
64
- provider: DTOExporterGitProviderEnum.optional(),
64
+ provider: DTOExporterGitProviderEnum,
65
65
  });
66
66
 
67
67
  export type DTOExporterGitProviderEnum = z.infer<typeof DTOExporterGitProviderEnum>;
@@ -1,2 +1,3 @@
1
1
  export * from "./exporter";
2
2
  export * from "./job";
3
+ export * from "./pipeline";
@@ -48,20 +48,25 @@ export const DTOExportJob = z.object({
48
48
  status: ExportJobStatus,
49
49
  estimatedExecutionTime: z.number().optional(),
50
50
 
51
- createdBy: DTOExportJobCreatedBy,
51
+ createdBy: DTOExportJobCreatedBy.optional(),
52
52
  designSystem: DTOExportJobDesignSystemPreview,
53
53
  designSystemVersion: DTOExportJobDesignSystemVersionPreview,
54
54
 
55
55
  destinations: DTOExportJobDestinations,
56
56
 
57
57
  exporterId: z.string(),
58
- scheduleId: z.string(),
58
+ scheduleId: z.string().optional(),
59
59
 
60
60
  result: ExportJobResult.optional(),
61
61
  });
62
62
 
63
+ export const DTOExportJobResponse = z.object({
64
+ job: DTOExportJob,
65
+ });
66
+
63
67
  export type DTOExportJobCreatedBy = z.infer<typeof DTOExportJobCreatedBy>;
64
68
  export type DTOExportJobDesignSystemPreview = z.infer<typeof DTOExportJobDesignSystemPreview>;
65
69
  export type DTOExportJobDesignSystemVersionPreview = z.infer<typeof DTOExportJobDesignSystemVersionPreview>;
66
70
  export type DTOExportJobDestinations = z.infer<typeof DTOExportJobDestinations>;
67
71
  export type DTOExportJob = z.infer<typeof DTOExportJob>;
72
+ export type DTOExportJobResponse = z.infer<typeof DTOExportJobResponse>;
@@ -0,0 +1,17 @@
1
+ import { ExportDestinationsMap, PipelineEventType } from "@supernova-studio/model";
2
+ import { z } from "zod";
3
+
4
+ export const DTOPipeline = z.object({
5
+ id: z.string(),
6
+ name: z.string(),
7
+ eventType: PipelineEventType,
8
+ isEnabled: z.boolean(),
9
+ workspaceId: z.string(),
10
+ designSystemId: z.string(),
11
+ exporterId: z.string(),
12
+ brandPersistentId: z.string().optional(),
13
+ themePersistentId: z.string().optional(),
14
+ ...ExportDestinationsMap.shape,
15
+ });
16
+
17
+ export type DTOPipeline = z.infer<typeof DTOPipeline>;
@@ -0,0 +1 @@
1
+ export * from "./pipeline";
@@ -0,0 +1,46 @@
1
+ import {
2
+ ExporterDestinationAzure,
3
+ ExporterDestinationBitbucket,
4
+ ExporterDestinationDocs,
5
+ ExporterDestinationGithub,
6
+ ExporterDestinationGitlab,
7
+ ExporterDestinationS3,
8
+ GitObjectsQuery,
9
+ PipelineDestinationType,
10
+ PipelineEventType,
11
+ } from "@supernova-studio/model";
12
+ import { z } from "zod";
13
+
14
+ export const DTOPipelineCreateBody = z.object({
15
+ name: z.string(),
16
+ exporterId: z.string(),
17
+ designSystemId: z.string(),
18
+ isEnabled: z.boolean(),
19
+ eventType: PipelineEventType,
20
+ brandPersistentId: z.string().optional(),
21
+ themePersistentId: z.string().optional(),
22
+
23
+ destination: PipelineDestinationType,
24
+ gitQuery: GitObjectsQuery,
25
+ destinations: z.object({
26
+ s3: ExporterDestinationS3.nullish(),
27
+ azure: ExporterDestinationAzure.nullish(),
28
+ bitbucket: ExporterDestinationBitbucket.nullish(),
29
+ github: ExporterDestinationGithub.nullish(),
30
+ gitlab: ExporterDestinationGitlab.nullish(),
31
+ documentation: ExporterDestinationDocs.nullish(),
32
+ webhookUrl: z.string().nullish(),
33
+ }),
34
+ });
35
+
36
+ export const DTOPipelineUpdateBody = DTOPipelineCreateBody.extend({
37
+ id: z.string(),
38
+ });
39
+
40
+ export const DTOPipelineTriggerBody = z.object({
41
+ designSystemVersionId: z.string(),
42
+ });
43
+
44
+ export type DTOPipelineCreateBody = z.infer<typeof DTOPipelineCreateBody>;
45
+ export type DTOPipelineUpdateBody = z.infer<typeof DTOPipelineUpdateBody>;
46
+ export type DTOPipelineTriggerBody = z.infer<typeof DTOPipelineTriggerBody>;
@@ -1,5 +1,6 @@
1
1
  export * from "./design-systems";
2
2
  export * from "./documentation";
3
+ export * from "./export";
3
4
  export * from "./liveblocks";
4
5
  export * from "./users";
5
6
  export * from "./workspaces";
@@ -16,11 +16,11 @@ export const DTOWorkspaceIntegrationPATInput = z.object({
16
16
  export type DTOWorkspaceIntegrationPATInput = z.infer<typeof DTOWorkspaceIntegrationPATInput>;
17
17
 
18
18
  export const DTOWorkspaceIntegrationGetGitObjectsInput = z.object({
19
- organization: z.string().optional(), // Azure Organization | Bitbucket Workspace slug | Gitlab Group | Github Account (User or Organization)
19
+ organization: z.string().optional(), // Azure Organization | Bitbucket Workspace slug | Gitlab Group and Sub-Groups | Github Account (User or Organization)
20
20
  project: z.string().optional(), // Only for Bitbucket and Azure
21
21
  repository: z.string().optional(), // For all providers. Pay attention for Gitlab, they call repositories "projects".
22
- branch: z.string().optional(), // For all providers.
23
- user: z.string().optional(), // Only for Gitlab
22
+ branch: z.string().optional(), // For all providers, useful for PR creations.
23
+ user: z.string().optional(), // Only for Gitlab User Repositories
24
24
  });
25
25
 
26
26
  export type DTOWorkspaceIntegrationGetGitObjectsInput = z.infer<typeof DTOWorkspaceIntegrationGetGitObjectsInput>;