@supernova-studio/client 0.4.3 → 0.4.5
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 +3932 -19
- package/dist/index.d.ts +3932 -19
- package/dist/index.js +124 -529
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +879 -1284
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -2
- package/src/api/index.ts +1 -0
- package/src/api/requests/index.ts +2 -0
- package/src/api/requests/post-bulk-doc-page-elements.ts +51 -0
- package/src/api/requests/post-liveblocks-auth.ts +6 -0
- package/src/docs-editor/prosemirror/schema.ts +9 -0
- package/src/index.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supernova-studio/client",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "Supernova Data Models",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,11 +26,15 @@
|
|
|
26
26
|
"build": "tsup",
|
|
27
27
|
"typecheck": "tsc --noEmit",
|
|
28
28
|
"publish": "npm run build && npm publish",
|
|
29
|
-
"test:unit": "vitest run"
|
|
29
|
+
"test:unit": "vitest run",
|
|
30
|
+
"index": "node ./create-indexes.js"
|
|
30
31
|
},
|
|
31
32
|
"author": "",
|
|
32
33
|
"license": "ISC",
|
|
33
34
|
"dependencies": {
|
|
35
|
+
"@supernova-studio/model": "*",
|
|
36
|
+
"prosemirror-model": "^1.19.4",
|
|
37
|
+
"typescript": "^5.0.4",
|
|
34
38
|
"y-prosemirror": "^1.2.2",
|
|
35
39
|
"yjs": "^13.6.10",
|
|
36
40
|
"zod": "^3.22.4"
|
package/src/api/index.ts
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { DocumentationItemConfiguration } from "@supernova-studio/model"
|
|
4
|
+
|
|
5
|
+
export const CreateBulkElementsInput = z.object({
|
|
6
|
+
persistentId: z.string().uuid(),
|
|
7
|
+
title: z.string(),
|
|
8
|
+
configuration: DocumentationItemConfiguration,
|
|
9
|
+
parentPersistentId: z.string().nullish(),
|
|
10
|
+
afterPersistentId: z.string().nullish(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type CreateBulkElementsInput = z.infer<typeof CreateBulkElementsInput>;
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export const UpdateBulkElementsInput = z.object({
|
|
17
|
+
id: z.string(),
|
|
18
|
+
title: z.string().optional(),
|
|
19
|
+
configuration: DocumentationItemConfiguration.optional(),
|
|
20
|
+
parentPersistentId: z.string().optional(),
|
|
21
|
+
afterPersistentId: z.string().optional(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type UpdateBulkElementsInput = z.infer<typeof UpdateBulkElementsInput>;
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
export const DeleteBulkElementsInput = z.array(z.string());
|
|
28
|
+
|
|
29
|
+
export type DeleteBulkElementsInput = z.infer<typeof DeleteBulkElementsInput>;
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export const DuplicateBulkElementsInput = z.object({
|
|
33
|
+
id: z.string(),
|
|
34
|
+
persistentId: z.string().uuid(),
|
|
35
|
+
parentPersistentId: z.string().uuid(),
|
|
36
|
+
afterPersistentId: z.string().uuid().nullish(),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export type DuplicateBulkElementsInput = z.infer<typeof DuplicateBulkElementsInput>;
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
export const BulkEditDocPageElementsInput = z.object({
|
|
43
|
+
documentationPages: z.object({
|
|
44
|
+
create: z.array(CreateBulkElementsInput).optional(),
|
|
45
|
+
update: z.array(UpdateBulkElementsInput).optional(),
|
|
46
|
+
delete: DeleteBulkElementsInput.optional(),
|
|
47
|
+
duplicate: z.array(DuplicateBulkElementsInput).optional()
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export type BulkEditDocPageElementsInput = z.infer<typeof BulkEditDocPageElementsInput>;
|
|
@@ -144,6 +144,9 @@ const newSchema = {
|
|
|
144
144
|
content: "(paragraph|image)+",
|
|
145
145
|
isolating: true,
|
|
146
146
|
attrs: {
|
|
147
|
+
id: {
|
|
148
|
+
default: null,
|
|
149
|
+
},
|
|
147
150
|
textAlign: {
|
|
148
151
|
default: "left",
|
|
149
152
|
},
|
|
@@ -204,6 +207,9 @@ const newSchema = {
|
|
|
204
207
|
content: "(paragraph|image)+",
|
|
205
208
|
isolating: true,
|
|
206
209
|
attrs: {
|
|
210
|
+
id: {
|
|
211
|
+
default: null,
|
|
212
|
+
},
|
|
207
213
|
textAlign: {
|
|
208
214
|
default: "left",
|
|
209
215
|
},
|
|
@@ -753,6 +759,9 @@ const newSchema = {
|
|
|
753
759
|
group: "block",
|
|
754
760
|
defining: true,
|
|
755
761
|
attrs: {
|
|
762
|
+
id: {
|
|
763
|
+
default: null,
|
|
764
|
+
},
|
|
756
765
|
definitionId: {
|
|
757
766
|
default: "io.supernova.block.blockquote",
|
|
758
767
|
},
|
package/src/index.ts
CHANGED