@supernova-studio/client 0.47.18 → 0.47.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1561 -364
- package/dist/index.d.ts +1561 -364
- package/dist/index.js +80 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +61 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/conversion/export/pipeline.ts +1 -0
- package/src/api/conversion/integrations/integration.ts +26 -10
- package/src/api/dto/export/exporter.ts +7 -2
- package/src/api/dto/export/pipeline.ts +3 -0
- package/src/api/dto/workspaces/integrations.ts +8 -2
package/package.json
CHANGED
|
@@ -1,20 +1,36 @@
|
|
|
1
|
-
import { ExtendedIntegration } from "@supernova-studio/model";
|
|
2
|
-
import { DTOIntegration } from "../../dto";
|
|
1
|
+
import { ExtendedIntegration, IntegrationCredentials } from "@supernova-studio/model";
|
|
2
|
+
import { DTOIntegration, DTOIntegrationCredentials } from "../../dto";
|
|
3
3
|
|
|
4
4
|
export function integrationToDto(integration: ExtendedIntegration): DTOIntegration {
|
|
5
|
-
// Remove access token and refresh token from the response
|
|
6
|
-
if (integration.integrationCredentials) {
|
|
7
|
-
integration.integrationCredentials.forEach(credential => {
|
|
8
|
-
credential.accessToken = "";
|
|
9
|
-
delete credential.refreshToken;
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
5
|
return {
|
|
13
6
|
id: integration.id,
|
|
14
7
|
workspaceId: integration.workspaceId,
|
|
15
8
|
type: integration.type,
|
|
16
9
|
createdAt: integration.createdAt,
|
|
17
|
-
integrationCredentials: integration.integrationCredentials
|
|
10
|
+
integrationCredentials: integration.integrationCredentials?.map(integrationCredentialToDto),
|
|
18
11
|
integrationDesignSystems: integration.integrationDesignSystems ?? undefined,
|
|
19
12
|
};
|
|
20
13
|
}
|
|
14
|
+
|
|
15
|
+
export function integrationCredentialToDto(credential: IntegrationCredentials): DTOIntegrationCredentials {
|
|
16
|
+
return {
|
|
17
|
+
id: credential.id,
|
|
18
|
+
|
|
19
|
+
createdAt: credential.createdAt,
|
|
20
|
+
refreshedAt: credential.refreshedAt,
|
|
21
|
+
expiresAt: credential.expiresAt,
|
|
22
|
+
|
|
23
|
+
integrationId: credential.integrationId,
|
|
24
|
+
type: credential.type,
|
|
25
|
+
|
|
26
|
+
userId: credential.userId,
|
|
27
|
+
user: credential.user,
|
|
28
|
+
|
|
29
|
+
customUrl: credential.customUrl,
|
|
30
|
+
|
|
31
|
+
profile: credential.profile,
|
|
32
|
+
tokenName: credential.tokenName,
|
|
33
|
+
username: credential.username,
|
|
34
|
+
appInstallationId: credential.appInstallationId,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -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,8 +61,13 @@ 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
|
|
64
|
+
provider: DTOExporterGitProviderEnum,
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export const DTOExporterUpdateInput = z.object({
|
|
68
|
+
url: z.string().optional(),
|
|
65
69
|
});
|
|
66
70
|
|
|
67
71
|
export type DTOExporterGitProviderEnum = z.infer<typeof DTOExporterGitProviderEnum>;
|
|
68
72
|
export type DTOExporterCreateInput = z.infer<typeof DTOExporterCreateInput>;
|
|
73
|
+
export type DTOExporterUpdateInput = z.infer<typeof DTOExporterUpdateInput>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ExportDestinationsMap, PipelineEventType } from "@supernova-studio/model";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
import { DTOExportJob } from "./job";
|
|
3
4
|
|
|
4
5
|
export const DTOPipeline = z.object({
|
|
5
6
|
id: z.string(),
|
|
@@ -12,6 +13,8 @@ export const DTOPipeline = z.object({
|
|
|
12
13
|
brandPersistentId: z.string().optional(),
|
|
13
14
|
themePersistentId: z.string().optional(),
|
|
14
15
|
...ExportDestinationsMap.shape,
|
|
16
|
+
|
|
17
|
+
latestJobs: DTOExportJob.array(),
|
|
15
18
|
});
|
|
16
19
|
|
|
17
20
|
export type DTOPipeline = z.infer<typeof DTOPipeline>;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { IntegrationCredentials, IntegrationDesignSystem
|
|
1
|
+
import { ExtendedIntegrationType, IntegrationCredentials, IntegrationDesignSystem } from "@supernova-studio/model";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
|
+
export const DTOIntegrationCredentials = IntegrationCredentials.omit({
|
|
5
|
+
accessToken: true,
|
|
6
|
+
refreshToken: true,
|
|
7
|
+
});
|
|
8
|
+
|
|
4
9
|
export const DTOIntegration = z.object({
|
|
5
10
|
id: z.string(),
|
|
6
11
|
workspaceId: z.string(),
|
|
7
12
|
type: ExtendedIntegrationType,
|
|
8
13
|
createdAt: z.coerce.date(),
|
|
9
|
-
integrationCredentials: z.array(
|
|
14
|
+
integrationCredentials: z.array(DTOIntegrationCredentials).optional(),
|
|
10
15
|
integrationDesignSystems: z.array(IntegrationDesignSystem).optional(),
|
|
11
16
|
});
|
|
12
17
|
|
|
@@ -23,6 +28,7 @@ export const DTOIntegrationsGetListResponse = z.object({
|
|
|
23
28
|
});
|
|
24
29
|
|
|
25
30
|
export type DTOIntegration = z.infer<typeof DTOIntegration>;
|
|
31
|
+
export type DTOIntegrationCredentials = z.infer<typeof DTOIntegrationCredentials>;
|
|
26
32
|
export type DTOIntegrationOAuthGetResponse = z.infer<typeof DTOIntegrationOAuthGetResponse>;
|
|
27
33
|
export type DTOIntegrationPostResponse = z.infer<typeof DTOIntegrationPostResponse>;
|
|
28
34
|
export type DTOIntegrationsGetListResponse = z.infer<typeof DTOIntegrationsGetListResponse>;
|