@supernova-studio/client 0.4.2 → 0.4.4

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.4.2",
3
+ "version": "0.4.4",
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
@@ -1 +1,2 @@
1
+ export * from "./requests";
1
2
  export * from "./responses";
@@ -0,0 +1,2 @@
1
+ export * from "./post-bulk-doc-page-elements";
2
+ export * from "./post-liveblocks-auth";
@@ -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>;
@@ -0,0 +1,6 @@
1
+ import { z } from "zod";
2
+ import { RoomTypeSchema } from "@supernova-studio/model";
3
+
4
+ export const PostLiveblocksAuth = z.object({
5
+ room: z.string(),
6
+ });
@@ -517,7 +517,7 @@ function serializeTextSpan(span: PageBlockTextSpan): ProsemirrorNode[] {
517
517
  );
518
518
  }
519
519
 
520
- return interspersed;
520
+ return interspersed.filter(t => !!t.text);
521
521
  }
522
522
 
523
523
  function serializeTextSpanAttribute(spanAttribute: PageBlockTextSpanAttribute): ProsemirrorMark {
@@ -753,6 +753,9 @@ const newSchema = {
753
753
  group: "block",
754
754
  defining: true,
755
755
  attrs: {
756
+ id: {
757
+ default: null,
758
+ },
756
759
  definitionId: {
757
760
  default: "io.supernova.block.blockquote",
758
761
  },
package/src/index.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  export * from "./api";
2
2
  export * from "./docs-editor";
3
- export * from "@supernova-studio/model";