@supernova-studio/client 0.42.0 → 0.44.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.
- package/dist/index.d.mts +2089 -434
- package/dist/index.d.ts +2089 -434
- package/dist/index.js +80 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +510 -476
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/conversion/documentation/documentation-group-v2-to-dto.ts +1 -0
- package/src/api/conversion/documentation/documentation-page-v2-to-dto.ts +1 -0
- package/src/api/conversion/index.ts +1 -0
- package/src/api/conversion/integrations/index.ts +1 -0
- package/src/api/conversion/integrations/integration.ts +12 -0
- package/src/api/dto/elements/documentation/group-v2.ts +5 -7
- package/src/api/dto/elements/documentation/page-v2.ts +8 -9
- package/src/api/dto/workspaces/integrations.ts +12 -1
- package/src/api/payloads/liveblocks/auth.ts +1 -1
package/package.json
CHANGED
|
@@ -50,6 +50,7 @@ function elementGroupToDocumentationGroupStructureDTOV2(
|
|
|
50
50
|
createdAt: group.createdAt,
|
|
51
51
|
updatedAt: group.updatedAt,
|
|
52
52
|
title: group.meta.name,
|
|
53
|
+
configuration: documentationItemConfigurationToDTOV2(group?.data?.configuration),
|
|
53
54
|
childrenIds: childrenIds,
|
|
54
55
|
isRoot: !group.parentPersistentId,
|
|
55
56
|
groupBehavior: group.data?.behavior ?? "Group",
|
|
@@ -50,6 +50,7 @@ function documentationPageToStructureDTOV2(
|
|
|
50
50
|
title: page.meta.name,
|
|
51
51
|
slug: page.slug,
|
|
52
52
|
userSlug: page.userSlug,
|
|
53
|
+
configuration: documentationItemConfigurationToDTOV2(page.data.configuration),
|
|
53
54
|
createdAt: page.createdAt,
|
|
54
55
|
updatedAt: page.updatedAt,
|
|
55
56
|
path: path,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./integration";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Integration } from "@supernova-studio/model";
|
|
2
|
+
import { DTOIntegration } from "../../dto";
|
|
3
|
+
|
|
4
|
+
export function integrationToDto(integration: Integration): DTOIntegration {
|
|
5
|
+
return {
|
|
6
|
+
id: integration.id,
|
|
7
|
+
workspaceId: integration.workspaceId,
|
|
8
|
+
type: integration.type,
|
|
9
|
+
createdAt: integration.createdAt,
|
|
10
|
+
integrationCredentials: integration.integrationCredentials ?? undefined,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -10,7 +10,7 @@ import { DTODocumentationItemConfigurationV2 } from "./item-configuration-v2";
|
|
|
10
10
|
* Structure DTO is element properties minus element data (in other words data required
|
|
11
11
|
* to display the element in the left panel)
|
|
12
12
|
*/
|
|
13
|
-
export const
|
|
13
|
+
export const DTODocumentationGroupV2 = ElementGroup.omit({
|
|
14
14
|
sortOrder: true,
|
|
15
15
|
parentPersistentId: true,
|
|
16
16
|
brandPersistentId: true,
|
|
@@ -24,15 +24,13 @@ export const DTODocumentationGroupStructureV2 = ElementGroup.omit({
|
|
|
24
24
|
childrenIds: z.array(z.string()),
|
|
25
25
|
groupBehavior: DocumentationGroupBehavior,
|
|
26
26
|
shortPersistentId: z.string(),
|
|
27
|
-
type: z.literal("Group"),
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
export const DTODocumentationGroupV2 = DTODocumentationGroupStructureV2.extend({
|
|
31
27
|
configuration: DTODocumentationItemConfigurationV2,
|
|
28
|
+
type: z.literal("Group"),
|
|
32
29
|
});
|
|
33
30
|
|
|
34
|
-
export type DTODocumentationGroupStructureV2 = z.infer<typeof DTODocumentationGroupStructureV2>;
|
|
35
31
|
export type DTODocumentationGroupV2 = z.infer<typeof DTODocumentationGroupV2>;
|
|
32
|
+
export const DTODocumentationGroupStructureV2 = DTODocumentationGroupV2;
|
|
33
|
+
export type DTODocumentationGroupStructureV2 = DTODocumentationGroupV2;
|
|
36
34
|
|
|
37
35
|
//
|
|
38
36
|
// Write
|
|
@@ -57,7 +55,7 @@ export const DTOUpdateDocumentationGroupInput = z.object({
|
|
|
57
55
|
|
|
58
56
|
// Group properties
|
|
59
57
|
title: z.string().optional(),
|
|
60
|
-
configuration: DTODocumentationItemConfigurationV2.optional(),
|
|
58
|
+
configuration: DTODocumentationItemConfigurationV2.partial().optional(),
|
|
61
59
|
});
|
|
62
60
|
|
|
63
61
|
export const DTOMoveDocumentationGroupInput = z.object({
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { DocumentationPageV2 } from "@supernova-studio/model";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { DTODocumentationGroupStructureV2 } from "./group-v2";
|
|
4
3
|
import { DTODocumentationItemConfigurationV2 } from "./item-configuration-v2";
|
|
5
|
-
|
|
4
|
+
import { DTODocumentationGroupStructureV2 } from "./group-v2";
|
|
6
5
|
//
|
|
7
6
|
// Read
|
|
8
7
|
//
|
|
@@ -11,7 +10,7 @@ import { DTODocumentationItemConfigurationV2 } from "./item-configuration-v2";
|
|
|
11
10
|
* Structure DTO is element properties minus element data (in other words data required
|
|
12
11
|
* to display the element in the left panel)
|
|
13
12
|
*/
|
|
14
|
-
export const
|
|
13
|
+
export const DTODocumentationPageV2 = DocumentationPageV2.omit({
|
|
15
14
|
data: true,
|
|
16
15
|
meta: true,
|
|
17
16
|
parentPersistentId: true,
|
|
@@ -20,21 +19,21 @@ export const DTODocumentationPageStructureV2 = DocumentationPageV2.omit({
|
|
|
20
19
|
title: z.string(),
|
|
21
20
|
path: z.string(),
|
|
22
21
|
type: z.literal("Page"),
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export const DTODocumentationPageV2 = DTODocumentationPageStructureV2.extend({
|
|
26
22
|
configuration: DTODocumentationItemConfigurationV2,
|
|
27
23
|
});
|
|
24
|
+
export type DTODocumentationPageV2 = z.infer<typeof DTODocumentationPageV2>;
|
|
25
|
+
|
|
26
|
+
export const DTODocumentationPageStructureV2 = DTODocumentationPageV2;
|
|
27
|
+
export type DTODocumentationPageStructureV2 = DTODocumentationPageV2;
|
|
28
28
|
|
|
29
29
|
export const DTODocumentationHierarchyV2 = z.object({
|
|
30
30
|
pages: z.array(DTODocumentationPageStructureV2),
|
|
31
31
|
groups: z.array(DTODocumentationGroupStructureV2),
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
export type DTODocumentationPageV2 = z.infer<typeof DTODocumentationPageV2>;
|
|
35
|
-
export type DTODocumentationPageStructureV2 = z.infer<typeof DTODocumentationPageStructureV2>;
|
|
36
34
|
export type DTODocumentationHierarchyV2 = z.infer<typeof DTODocumentationHierarchyV2>;
|
|
37
35
|
|
|
36
|
+
|
|
38
37
|
//
|
|
39
38
|
// Write
|
|
40
39
|
//
|
|
@@ -58,7 +57,7 @@ export const DTOUpdateDocumentationPageInputV2 = z.object({
|
|
|
58
57
|
|
|
59
58
|
// Page properties
|
|
60
59
|
title: z.string().optional(),
|
|
61
|
-
configuration: DTODocumentationItemConfigurationV2.optional(),
|
|
60
|
+
configuration: DTODocumentationItemConfigurationV2.partial().optional(),
|
|
62
61
|
});
|
|
63
62
|
|
|
64
63
|
export const DTOMoveDocumentationPageInputV2 = z.object({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IntegrationType } from "@supernova-studio/model";
|
|
1
|
+
import { IntegrationCredentialsSchema, IntegrationType } from "@supernova-studio/model";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
export const DTOIntegration = z.object({
|
|
@@ -6,11 +6,22 @@ export const DTOIntegration = z.object({
|
|
|
6
6
|
workspaceId: z.string(),
|
|
7
7
|
type: IntegrationType,
|
|
8
8
|
createdAt: z.coerce.date(),
|
|
9
|
+
integrationCredentials: z.array(IntegrationCredentialsSchema).optional(),
|
|
9
10
|
});
|
|
10
11
|
|
|
11
12
|
export const DTOIntegrationOAuthGetResponse = z.object({
|
|
12
13
|
url: z.string(),
|
|
13
14
|
});
|
|
14
15
|
|
|
16
|
+
export const DTOIntegrationPostResponse = z.object({
|
|
17
|
+
integration: DTOIntegration,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const DTOIntegrationsGetListResponse = z.object({
|
|
21
|
+
integrations: DTOIntegration.array(),
|
|
22
|
+
});
|
|
23
|
+
|
|
15
24
|
export type DTOIntegration = z.infer<typeof DTOIntegration>;
|
|
16
25
|
export type DTOIntegrationOAuthGetResponse = z.infer<typeof DTOIntegrationOAuthGetResponse>;
|
|
26
|
+
export type DTOIntegrationPostResponse = z.infer<typeof DTOIntegrationPostResponse>;
|
|
27
|
+
export type DTOIntegrationsGetListResponse = z.infer<typeof DTOIntegrationsGetListResponse>;
|