@did-space/core 1.0.48 → 1.0.51

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.
@@ -1,12 +1,11 @@
1
1
  import { z } from 'zod';
2
- export declare const AppPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const AppPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"app">;
7
6
  name: z.ZodString;
8
7
  logo: z.ZodString;
9
- }>, "strip", z.ZodTypeAny, {
8
+ }, "strip", z.ZodTypeAny, {
10
9
  template: "app";
11
10
  did: string;
12
11
  name: string;
@@ -15,6 +15,6 @@ export declare const BasePreviewTemplateSchema: z.ZodObject<{
15
15
  export declare const TagSchema: z.ZodString;
16
16
  export declare const TagsSchema: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
17
17
  export declare const UrlSchema: z.ZodString;
18
- export declare const TitleSchema: z.ZodString;
18
+ export declare const TitleSchema: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
19
19
  export type TemplateType = z.infer<typeof TemplateTypeSchema>;
20
20
  export type BasePreviewTemplate = z.infer<typeof BasePreviewTemplateSchema>;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.TitleSchema = exports.UrlSchema = exports.TagsSchema = exports.TagSchema = exports.BasePreviewTemplateSchema = exports.TemplateTypeSchema = exports.DateSchema = exports.DidSchema = void 0;
7
7
  const did_1 = require("@arcblock/did");
8
8
  const dayjs_1 = __importDefault(require("dayjs"));
9
+ const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
9
10
  const zod_1 = require("zod");
10
11
  exports.DidSchema = zod_1.z.string().refine((value) => (0, did_1.isValid)(value), (value) => {
11
12
  return {
@@ -37,4 +38,9 @@ exports.BasePreviewTemplateSchema = zod_1.z.object({
37
38
  exports.TagSchema = zod_1.z.string().min(1).max(64);
38
39
  exports.TagsSchema = zod_1.z.array(exports.TagSchema).max(16).optional().default([]);
39
40
  exports.UrlSchema = zod_1.z.string().url().max(2048);
40
- exports.TitleSchema = zod_1.z.string().min(1).max(512);
41
+ exports.TitleSchema = zod_1.z
42
+ .string()
43
+ .min(0)
44
+ .max(512)
45
+ .optional()
46
+ .transform((title) => ((0, isEmpty_1.default)(title) ? 'Untitled' : title));
@@ -1,29 +1,28 @@
1
1
  import { z } from 'zod';
2
- export declare const BlogPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const BlogPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"blog">;
7
- title: z.ZodString;
6
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
8
7
  image: z.ZodString;
9
8
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
10
9
  url: z.ZodString;
11
10
  createdAt: z.ZodEffects<z.ZodString, string, string>;
12
- }>, "strip", z.ZodTypeAny, {
11
+ }, "strip", z.ZodTypeAny, {
13
12
  template: "blog";
14
13
  did: string;
15
- title: string;
16
14
  image: string;
17
15
  tags: string[];
18
16
  url: string;
19
17
  createdAt: string;
18
+ title?: string | undefined;
20
19
  }, {
21
20
  template: "blog";
22
21
  did: string;
23
- title: string;
24
22
  image: string;
25
23
  url: string;
26
24
  createdAt: string;
25
+ title?: string | undefined;
27
26
  tags?: string[] | undefined;
28
27
  }>;
29
28
  export type BlogPreviewTemplate = z.TypeOf<typeof BlogPreviewTemplateSchema>;
@@ -1,29 +1,28 @@
1
1
  import { z } from 'zod';
2
- export declare const BookmarkPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const BookmarkPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"bookmark">;
7
- title: z.ZodString;
6
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
8
7
  image: z.ZodString;
9
8
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
10
9
  url: z.ZodString;
11
10
  createdAt: z.ZodEffects<z.ZodString, string, string>;
12
- }>, "strip", z.ZodTypeAny, {
11
+ }, "strip", z.ZodTypeAny, {
13
12
  template: "bookmark";
14
13
  did: string;
15
- title: string;
16
14
  image: string;
17
15
  tags: string[];
18
16
  url: string;
19
17
  createdAt: string;
18
+ title?: string | undefined;
20
19
  }, {
21
20
  template: "bookmark";
22
21
  did: string;
23
- title: string;
24
22
  image: string;
25
23
  url: string;
26
24
  createdAt: string;
25
+ title?: string | undefined;
27
26
  tags?: string[] | undefined;
28
27
  }>;
29
28
  export type BookmarkPreviewTemplate = z.TypeOf<typeof BookmarkPreviewTemplateSchema>;
@@ -1,12 +1,11 @@
1
1
  import z from 'zod';
2
- export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"app">;
7
6
  name: z.ZodString;
8
7
  logo: z.ZodString;
9
- }>, "strip", z.ZodTypeAny, {
8
+ }, "strip", z.ZodTypeAny, {
10
9
  template: "app";
11
10
  did: string;
12
11
  name: string;
@@ -16,15 +15,14 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
16
15
  did: string;
17
16
  name: string;
18
17
  logo: string;
19
- }>, z.ZodObject<z.objectUtil.extendShape<{
20
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
18
+ }>, z.ZodObject<{
21
19
  did: z.ZodEffects<z.ZodString, string, string>;
22
- }, {
20
+ } & {
23
21
  template: z.ZodLiteral<"nft">;
24
22
  name: z.ZodString;
25
23
  image: z.ZodString;
26
24
  chainHost: z.ZodString;
27
- }>, "strip", z.ZodTypeAny, {
25
+ }, "strip", z.ZodTypeAny, {
28
26
  template: "nft";
29
27
  did: string;
30
28
  name: string;
@@ -36,15 +34,14 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
36
34
  name: string;
37
35
  image: string;
38
36
  chainHost: string;
39
- }>, z.ZodObject<z.objectUtil.extendShape<{
40
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
37
+ }>, z.ZodObject<{
41
38
  did: z.ZodEffects<z.ZodString, string, string>;
42
- }, {
39
+ } & {
43
40
  template: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"profile">>>;
44
41
  avatar: z.ZodString;
45
42
  fullname: z.ZodString;
46
43
  email: z.ZodString;
47
- }>, "strip", z.ZodTypeAny, {
44
+ }, "strip", z.ZodTypeAny, {
48
45
  template: "profile";
49
46
  did: string;
50
47
  avatar: string;
@@ -56,10 +53,9 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
56
53
  fullname: string;
57
54
  email: string;
58
55
  template?: "profile" | undefined;
59
- }>, z.ZodObject<z.objectUtil.extendShape<{
60
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
56
+ }>, z.ZodObject<{
61
57
  did: z.ZodEffects<z.ZodString, string, string>;
62
- }, {
58
+ } & {
63
59
  template: z.ZodLiteral<"passport">;
64
60
  image: z.ZodString;
65
61
  type: z.ZodArray<z.ZodString, "many">;
@@ -68,7 +64,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
68
64
  issuedAt: z.ZodString;
69
65
  issuedTo: z.ZodString;
70
66
  verified: z.ZodBoolean;
71
- }>, "strip", z.ZodTypeAny, {
67
+ }, "strip", z.ZodTypeAny, {
72
68
  type: string[];
73
69
  template: "passport";
74
70
  did: string;
@@ -88,92 +84,88 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
88
84
  issuedAt: string;
89
85
  issuedTo: string;
90
86
  verified: boolean;
91
- }>, z.ZodObject<z.objectUtil.extendShape<{
92
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
87
+ }>, z.ZodObject<{
93
88
  did: z.ZodEffects<z.ZodString, string, string>;
94
- }, {
89
+ } & {
95
90
  template: z.ZodLiteral<"post">;
96
- title: z.ZodString;
91
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
97
92
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
98
93
  url: z.ZodString;
99
94
  createdAt: z.ZodEffects<z.ZodString, string, string>;
100
- }>, "strip", z.ZodTypeAny, {
95
+ }, "strip", z.ZodTypeAny, {
101
96
  template: "post";
102
97
  did: string;
103
- title: string;
104
98
  tags: string[];
105
99
  url: string;
106
100
  createdAt: string;
101
+ title?: string | undefined;
107
102
  }, {
108
103
  template: "post";
109
104
  did: string;
110
- title: string;
111
105
  url: string;
112
106
  createdAt: string;
107
+ title?: string | undefined;
113
108
  tags?: string[] | undefined;
114
- }>, z.ZodObject<z.objectUtil.extendShape<{
115
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
109
+ }>, z.ZodObject<{
116
110
  did: z.ZodEffects<z.ZodString, string, string>;
117
- }, {
111
+ } & {
118
112
  template: z.ZodLiteral<"blog">;
119
- title: z.ZodString;
113
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
120
114
  image: z.ZodString;
121
115
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
122
116
  url: z.ZodString;
123
117
  createdAt: z.ZodEffects<z.ZodString, string, string>;
124
- }>, "strip", z.ZodTypeAny, {
118
+ }, "strip", z.ZodTypeAny, {
125
119
  template: "blog";
126
120
  did: string;
127
- title: string;
128
121
  image: string;
129
122
  tags: string[];
130
123
  url: string;
131
124
  createdAt: string;
125
+ title?: string | undefined;
132
126
  }, {
133
127
  template: "blog";
134
128
  did: string;
135
- title: string;
136
129
  image: string;
137
130
  url: string;
138
131
  createdAt: string;
132
+ title?: string | undefined;
139
133
  tags?: string[] | undefined;
140
- }>, z.ZodObject<z.objectUtil.extendShape<{
141
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
134
+ }>, z.ZodObject<{
142
135
  did: z.ZodEffects<z.ZodString, string, string>;
143
- }, {
136
+ } & {
144
137
  template: z.ZodLiteral<"bookmark">;
145
- title: z.ZodString;
138
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
146
139
  image: z.ZodString;
147
140
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
148
141
  url: z.ZodString;
149
142
  createdAt: z.ZodEffects<z.ZodString, string, string>;
150
- }>, "strip", z.ZodTypeAny, {
143
+ }, "strip", z.ZodTypeAny, {
151
144
  template: "bookmark";
152
145
  did: string;
153
- title: string;
154
146
  image: string;
155
147
  tags: string[];
156
148
  url: string;
157
149
  createdAt: string;
150
+ title?: string | undefined;
158
151
  }, {
159
152
  template: "bookmark";
160
153
  did: string;
161
- title: string;
162
154
  image: string;
163
155
  url: string;
164
156
  createdAt: string;
157
+ title?: string | undefined;
165
158
  tags?: string[] | undefined;
166
- }>, z.ZodObject<z.objectUtil.extendShape<{
167
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
159
+ }>, z.ZodObject<{
168
160
  did: z.ZodEffects<z.ZodString, string, string>;
169
- }, {
161
+ } & {
170
162
  template: z.ZodLiteral<"project">;
171
163
  name: z.ZodString;
172
164
  description: z.ZodOptional<z.ZodString>;
173
165
  image: z.ZodString;
174
166
  url: z.ZodString;
175
167
  createdAt: z.ZodEffects<z.ZodString, string, string>;
176
- }>, "strip", z.ZodTypeAny, {
168
+ }, "strip", z.ZodTypeAny, {
177
169
  template: "project";
178
170
  did: string;
179
171
  name: string;
@@ -189,31 +181,30 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
189
181
  url: string;
190
182
  createdAt: string;
191
183
  description?: string | undefined;
192
- }>, z.ZodObject<z.objectUtil.extendShape<{
193
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
184
+ }>, z.ZodObject<{
194
185
  did: z.ZodEffects<z.ZodString, string, string>;
195
- }, {
186
+ } & {
196
187
  template: z.ZodLiteral<"doc">;
197
- title: z.ZodString;
188
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
198
189
  image: z.ZodString;
199
190
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
200
191
  url: z.ZodString;
201
192
  createdAt: z.ZodEffects<z.ZodString, string, string>;
202
- }>, "strip", z.ZodTypeAny, {
193
+ }, "strip", z.ZodTypeAny, {
203
194
  template: "doc";
204
195
  did: string;
205
- title: string;
206
196
  image: string;
207
197
  tags: string[];
208
198
  url: string;
209
199
  createdAt: string;
200
+ title?: string | undefined;
210
201
  }, {
211
202
  template: "doc";
212
203
  did: string;
213
- title: string;
214
204
  image: string;
215
205
  url: string;
216
206
  createdAt: string;
207
+ title?: string | undefined;
217
208
  tags?: string[] | undefined;
218
209
  }>]>;
219
210
  export type PreviewTemplate = z.infer<typeof PreviewTemplateSchema>;
@@ -1,29 +1,28 @@
1
1
  import { z } from 'zod';
2
- export declare const DocPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const DocPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"doc">;
7
- title: z.ZodString;
6
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
8
7
  image: z.ZodString;
9
8
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
10
9
  url: z.ZodString;
11
10
  createdAt: z.ZodEffects<z.ZodString, string, string>;
12
- }>, "strip", z.ZodTypeAny, {
11
+ }, "strip", z.ZodTypeAny, {
13
12
  template: "doc";
14
13
  did: string;
15
- title: string;
16
14
  image: string;
17
15
  tags: string[];
18
16
  url: string;
19
17
  createdAt: string;
18
+ title?: string | undefined;
20
19
  }, {
21
20
  template: "doc";
22
21
  did: string;
23
- title: string;
24
22
  image: string;
25
23
  url: string;
26
24
  createdAt: string;
25
+ title?: string | undefined;
27
26
  tags?: string[] | undefined;
28
27
  }>;
29
28
  export type DocPreviewTemplate = z.TypeOf<typeof DocPreviewTemplateSchema>;
@@ -1,13 +1,12 @@
1
1
  import z from 'zod';
2
- export declare const NftPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const NftPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"nft">;
7
6
  name: z.ZodString;
8
7
  image: z.ZodString;
9
8
  chainHost: z.ZodString;
10
- }>, "strip", z.ZodTypeAny, {
9
+ }, "strip", z.ZodTypeAny, {
11
10
  template: "nft";
12
11
  did: string;
13
12
  name: string;
@@ -1,8 +1,7 @@
1
1
  import z from 'zod';
2
- export declare const PassportPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const PassportPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"passport">;
7
6
  image: z.ZodString;
8
7
  type: z.ZodArray<z.ZodString, "many">;
@@ -11,7 +10,7 @@ export declare const PassportPreviewTemplateSchema: z.ZodObject<z.objectUtil.ext
11
10
  issuedAt: z.ZodString;
12
11
  issuedTo: z.ZodString;
13
12
  verified: z.ZodBoolean;
14
- }>, "strip", z.ZodTypeAny, {
13
+ }, "strip", z.ZodTypeAny, {
15
14
  type: string[];
16
15
  template: "passport";
17
16
  did: string;
@@ -1,26 +1,25 @@
1
1
  import { z } from 'zod';
2
- export declare const PostPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const PostPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"post">;
7
- title: z.ZodString;
6
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
8
7
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
9
8
  url: z.ZodString;
10
9
  createdAt: z.ZodEffects<z.ZodString, string, string>;
11
- }>, "strip", z.ZodTypeAny, {
10
+ }, "strip", z.ZodTypeAny, {
12
11
  template: "post";
13
12
  did: string;
14
- title: string;
15
13
  tags: string[];
16
14
  url: string;
17
15
  createdAt: string;
16
+ title?: string | undefined;
18
17
  }, {
19
18
  template: "post";
20
19
  did: string;
21
- title: string;
22
20
  url: string;
23
21
  createdAt: string;
22
+ title?: string | undefined;
24
23
  tags?: string[] | undefined;
25
24
  }>;
26
25
  export type PostPreviewTemplate = z.TypeOf<typeof PostPreviewTemplateSchema>;
@@ -1,13 +1,12 @@
1
1
  import { z } from 'zod';
2
- export declare const ProfilePreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const ProfilePreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"profile">>>;
7
6
  avatar: z.ZodString;
8
7
  fullname: z.ZodString;
9
8
  email: z.ZodString;
10
- }>, "strip", z.ZodTypeAny, {
9
+ }, "strip", z.ZodTypeAny, {
11
10
  template: "profile";
12
11
  did: string;
13
12
  avatar: string;
@@ -1,15 +1,14 @@
1
1
  import { z } from 'zod';
2
- export declare const ProjectPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const ProjectPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"project">;
7
6
  name: z.ZodString;
8
7
  description: z.ZodOptional<z.ZodString>;
9
8
  image: z.ZodString;
10
9
  url: z.ZodString;
11
10
  createdAt: z.ZodEffects<z.ZodString, string, string>;
12
- }>, "strip", z.ZodTypeAny, {
11
+ }, "strip", z.ZodTypeAny, {
13
12
  template: "project";
14
13
  did: string;
15
14
  name: string;
@@ -363,8 +363,7 @@ export declare const AuditLogSchema: z.ZodObject<{
363
363
  reason?: string | undefined;
364
364
  env?: Record<string, any> | undefined;
365
365
  }>;
366
- export declare const CreationAuditLogSchema: z.ZodObject<z.objectUtil.extendShape<{
367
- id: z.ZodString;
366
+ export declare const CreationAuditLogSchema: z.ZodObject<{
368
367
  actionType: z.ZodNativeEnum<typeof AuditLogAction>;
369
368
  entityId: z.ZodString;
370
369
  entityName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -494,9 +493,9 @@ export declare const CreationAuditLogSchema: z.ZodObject<z.objectUtil.extendShap
494
493
  env: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
495
494
  createdAt: z.ZodDefault<z.ZodOptional<z.ZodString>>;
496
495
  updatedAt: z.ZodDefault<z.ZodOptional<z.ZodString>>;
497
- }, {
496
+ } & {
498
497
  id: z.ZodOptional<z.ZodString>;
499
- }>, "strip", z.ZodTypeAny, {
498
+ }, "strip", z.ZodTypeAny, {
500
499
  status: AuditLogStatus;
501
500
  createdAt: string;
502
501
  updatedAt: string;
@@ -1,12 +1,11 @@
1
1
  import { z } from 'zod';
2
- export declare const AppPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const AppPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"app">;
7
6
  name: z.ZodString;
8
7
  logo: z.ZodString;
9
- }>, "strip", z.ZodTypeAny, {
8
+ }, "strip", z.ZodTypeAny, {
10
9
  template: "app";
11
10
  did: string;
12
11
  name: string;
@@ -15,6 +15,6 @@ export declare const BasePreviewTemplateSchema: z.ZodObject<{
15
15
  export declare const TagSchema: z.ZodString;
16
16
  export declare const TagsSchema: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
17
17
  export declare const UrlSchema: z.ZodString;
18
- export declare const TitleSchema: z.ZodString;
18
+ export declare const TitleSchema: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
19
19
  export type TemplateType = z.infer<typeof TemplateTypeSchema>;
20
20
  export type BasePreviewTemplate = z.infer<typeof BasePreviewTemplateSchema>;
@@ -1,5 +1,6 @@
1
1
  import { isValid } from '@arcblock/did';
2
2
  import dayjs from 'dayjs';
3
+ import isEmpty from 'lodash/isEmpty';
3
4
  import { z } from 'zod';
4
5
  export const DidSchema = z.string().refine((value) => isValid(value), (value) => {
5
6
  return {
@@ -31,4 +32,9 @@ export const BasePreviewTemplateSchema = z.object({
31
32
  export const TagSchema = z.string().min(1).max(64);
32
33
  export const TagsSchema = z.array(TagSchema).max(16).optional().default([]);
33
34
  export const UrlSchema = z.string().url().max(2048);
34
- export const TitleSchema = z.string().min(1).max(512);
35
+ export const TitleSchema = z
36
+ .string()
37
+ .min(0)
38
+ .max(512)
39
+ .optional()
40
+ .transform((title) => (isEmpty(title) ? 'Untitled' : title));
@@ -1,29 +1,28 @@
1
1
  import { z } from 'zod';
2
- export declare const BlogPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const BlogPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"blog">;
7
- title: z.ZodString;
6
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
8
7
  image: z.ZodString;
9
8
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
10
9
  url: z.ZodString;
11
10
  createdAt: z.ZodEffects<z.ZodString, string, string>;
12
- }>, "strip", z.ZodTypeAny, {
11
+ }, "strip", z.ZodTypeAny, {
13
12
  template: "blog";
14
13
  did: string;
15
- title: string;
16
14
  image: string;
17
15
  tags: string[];
18
16
  url: string;
19
17
  createdAt: string;
18
+ title?: string | undefined;
20
19
  }, {
21
20
  template: "blog";
22
21
  did: string;
23
- title: string;
24
22
  image: string;
25
23
  url: string;
26
24
  createdAt: string;
25
+ title?: string | undefined;
27
26
  tags?: string[] | undefined;
28
27
  }>;
29
28
  export type BlogPreviewTemplate = z.TypeOf<typeof BlogPreviewTemplateSchema>;
@@ -1,29 +1,28 @@
1
1
  import { z } from 'zod';
2
- export declare const BookmarkPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const BookmarkPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"bookmark">;
7
- title: z.ZodString;
6
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
8
7
  image: z.ZodString;
9
8
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
10
9
  url: z.ZodString;
11
10
  createdAt: z.ZodEffects<z.ZodString, string, string>;
12
- }>, "strip", z.ZodTypeAny, {
11
+ }, "strip", z.ZodTypeAny, {
13
12
  template: "bookmark";
14
13
  did: string;
15
- title: string;
16
14
  image: string;
17
15
  tags: string[];
18
16
  url: string;
19
17
  createdAt: string;
18
+ title?: string | undefined;
20
19
  }, {
21
20
  template: "bookmark";
22
21
  did: string;
23
- title: string;
24
22
  image: string;
25
23
  url: string;
26
24
  createdAt: string;
25
+ title?: string | undefined;
27
26
  tags?: string[] | undefined;
28
27
  }>;
29
28
  export type BookmarkPreviewTemplate = z.TypeOf<typeof BookmarkPreviewTemplateSchema>;
@@ -1,12 +1,11 @@
1
1
  import z from 'zod';
2
- export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"app">;
7
6
  name: z.ZodString;
8
7
  logo: z.ZodString;
9
- }>, "strip", z.ZodTypeAny, {
8
+ }, "strip", z.ZodTypeAny, {
10
9
  template: "app";
11
10
  did: string;
12
11
  name: string;
@@ -16,15 +15,14 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
16
15
  did: string;
17
16
  name: string;
18
17
  logo: string;
19
- }>, z.ZodObject<z.objectUtil.extendShape<{
20
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
18
+ }>, z.ZodObject<{
21
19
  did: z.ZodEffects<z.ZodString, string, string>;
22
- }, {
20
+ } & {
23
21
  template: z.ZodLiteral<"nft">;
24
22
  name: z.ZodString;
25
23
  image: z.ZodString;
26
24
  chainHost: z.ZodString;
27
- }>, "strip", z.ZodTypeAny, {
25
+ }, "strip", z.ZodTypeAny, {
28
26
  template: "nft";
29
27
  did: string;
30
28
  name: string;
@@ -36,15 +34,14 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
36
34
  name: string;
37
35
  image: string;
38
36
  chainHost: string;
39
- }>, z.ZodObject<z.objectUtil.extendShape<{
40
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
37
+ }>, z.ZodObject<{
41
38
  did: z.ZodEffects<z.ZodString, string, string>;
42
- }, {
39
+ } & {
43
40
  template: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"profile">>>;
44
41
  avatar: z.ZodString;
45
42
  fullname: z.ZodString;
46
43
  email: z.ZodString;
47
- }>, "strip", z.ZodTypeAny, {
44
+ }, "strip", z.ZodTypeAny, {
48
45
  template: "profile";
49
46
  did: string;
50
47
  avatar: string;
@@ -56,10 +53,9 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
56
53
  fullname: string;
57
54
  email: string;
58
55
  template?: "profile" | undefined;
59
- }>, z.ZodObject<z.objectUtil.extendShape<{
60
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
56
+ }>, z.ZodObject<{
61
57
  did: z.ZodEffects<z.ZodString, string, string>;
62
- }, {
58
+ } & {
63
59
  template: z.ZodLiteral<"passport">;
64
60
  image: z.ZodString;
65
61
  type: z.ZodArray<z.ZodString, "many">;
@@ -68,7 +64,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
68
64
  issuedAt: z.ZodString;
69
65
  issuedTo: z.ZodString;
70
66
  verified: z.ZodBoolean;
71
- }>, "strip", z.ZodTypeAny, {
67
+ }, "strip", z.ZodTypeAny, {
72
68
  type: string[];
73
69
  template: "passport";
74
70
  did: string;
@@ -88,92 +84,88 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
88
84
  issuedAt: string;
89
85
  issuedTo: string;
90
86
  verified: boolean;
91
- }>, z.ZodObject<z.objectUtil.extendShape<{
92
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
87
+ }>, z.ZodObject<{
93
88
  did: z.ZodEffects<z.ZodString, string, string>;
94
- }, {
89
+ } & {
95
90
  template: z.ZodLiteral<"post">;
96
- title: z.ZodString;
91
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
97
92
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
98
93
  url: z.ZodString;
99
94
  createdAt: z.ZodEffects<z.ZodString, string, string>;
100
- }>, "strip", z.ZodTypeAny, {
95
+ }, "strip", z.ZodTypeAny, {
101
96
  template: "post";
102
97
  did: string;
103
- title: string;
104
98
  tags: string[];
105
99
  url: string;
106
100
  createdAt: string;
101
+ title?: string | undefined;
107
102
  }, {
108
103
  template: "post";
109
104
  did: string;
110
- title: string;
111
105
  url: string;
112
106
  createdAt: string;
107
+ title?: string | undefined;
113
108
  tags?: string[] | undefined;
114
- }>, z.ZodObject<z.objectUtil.extendShape<{
115
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
109
+ }>, z.ZodObject<{
116
110
  did: z.ZodEffects<z.ZodString, string, string>;
117
- }, {
111
+ } & {
118
112
  template: z.ZodLiteral<"blog">;
119
- title: z.ZodString;
113
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
120
114
  image: z.ZodString;
121
115
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
122
116
  url: z.ZodString;
123
117
  createdAt: z.ZodEffects<z.ZodString, string, string>;
124
- }>, "strip", z.ZodTypeAny, {
118
+ }, "strip", z.ZodTypeAny, {
125
119
  template: "blog";
126
120
  did: string;
127
- title: string;
128
121
  image: string;
129
122
  tags: string[];
130
123
  url: string;
131
124
  createdAt: string;
125
+ title?: string | undefined;
132
126
  }, {
133
127
  template: "blog";
134
128
  did: string;
135
- title: string;
136
129
  image: string;
137
130
  url: string;
138
131
  createdAt: string;
132
+ title?: string | undefined;
139
133
  tags?: string[] | undefined;
140
- }>, z.ZodObject<z.objectUtil.extendShape<{
141
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
134
+ }>, z.ZodObject<{
142
135
  did: z.ZodEffects<z.ZodString, string, string>;
143
- }, {
136
+ } & {
144
137
  template: z.ZodLiteral<"bookmark">;
145
- title: z.ZodString;
138
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
146
139
  image: z.ZodString;
147
140
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
148
141
  url: z.ZodString;
149
142
  createdAt: z.ZodEffects<z.ZodString, string, string>;
150
- }>, "strip", z.ZodTypeAny, {
143
+ }, "strip", z.ZodTypeAny, {
151
144
  template: "bookmark";
152
145
  did: string;
153
- title: string;
154
146
  image: string;
155
147
  tags: string[];
156
148
  url: string;
157
149
  createdAt: string;
150
+ title?: string | undefined;
158
151
  }, {
159
152
  template: "bookmark";
160
153
  did: string;
161
- title: string;
162
154
  image: string;
163
155
  url: string;
164
156
  createdAt: string;
157
+ title?: string | undefined;
165
158
  tags?: string[] | undefined;
166
- }>, z.ZodObject<z.objectUtil.extendShape<{
167
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
159
+ }>, z.ZodObject<{
168
160
  did: z.ZodEffects<z.ZodString, string, string>;
169
- }, {
161
+ } & {
170
162
  template: z.ZodLiteral<"project">;
171
163
  name: z.ZodString;
172
164
  description: z.ZodOptional<z.ZodString>;
173
165
  image: z.ZodString;
174
166
  url: z.ZodString;
175
167
  createdAt: z.ZodEffects<z.ZodString, string, string>;
176
- }>, "strip", z.ZodTypeAny, {
168
+ }, "strip", z.ZodTypeAny, {
177
169
  template: "project";
178
170
  did: string;
179
171
  name: string;
@@ -189,31 +181,30 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
189
181
  url: string;
190
182
  createdAt: string;
191
183
  description?: string | undefined;
192
- }>, z.ZodObject<z.objectUtil.extendShape<{
193
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
184
+ }>, z.ZodObject<{
194
185
  did: z.ZodEffects<z.ZodString, string, string>;
195
- }, {
186
+ } & {
196
187
  template: z.ZodLiteral<"doc">;
197
- title: z.ZodString;
188
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
198
189
  image: z.ZodString;
199
190
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
200
191
  url: z.ZodString;
201
192
  createdAt: z.ZodEffects<z.ZodString, string, string>;
202
- }>, "strip", z.ZodTypeAny, {
193
+ }, "strip", z.ZodTypeAny, {
203
194
  template: "doc";
204
195
  did: string;
205
- title: string;
206
196
  image: string;
207
197
  tags: string[];
208
198
  url: string;
209
199
  createdAt: string;
200
+ title?: string | undefined;
210
201
  }, {
211
202
  template: "doc";
212
203
  did: string;
213
- title: string;
214
204
  image: string;
215
205
  url: string;
216
206
  createdAt: string;
207
+ title?: string | undefined;
217
208
  tags?: string[] | undefined;
218
209
  }>]>;
219
210
  export type PreviewTemplate = z.infer<typeof PreviewTemplateSchema>;
@@ -1,29 +1,28 @@
1
1
  import { z } from 'zod';
2
- export declare const DocPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const DocPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"doc">;
7
- title: z.ZodString;
6
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
8
7
  image: z.ZodString;
9
8
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
10
9
  url: z.ZodString;
11
10
  createdAt: z.ZodEffects<z.ZodString, string, string>;
12
- }>, "strip", z.ZodTypeAny, {
11
+ }, "strip", z.ZodTypeAny, {
13
12
  template: "doc";
14
13
  did: string;
15
- title: string;
16
14
  image: string;
17
15
  tags: string[];
18
16
  url: string;
19
17
  createdAt: string;
18
+ title?: string | undefined;
20
19
  }, {
21
20
  template: "doc";
22
21
  did: string;
23
- title: string;
24
22
  image: string;
25
23
  url: string;
26
24
  createdAt: string;
25
+ title?: string | undefined;
27
26
  tags?: string[] | undefined;
28
27
  }>;
29
28
  export type DocPreviewTemplate = z.TypeOf<typeof DocPreviewTemplateSchema>;
@@ -1,13 +1,12 @@
1
1
  import z from 'zod';
2
- export declare const NftPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const NftPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"nft">;
7
6
  name: z.ZodString;
8
7
  image: z.ZodString;
9
8
  chainHost: z.ZodString;
10
- }>, "strip", z.ZodTypeAny, {
9
+ }, "strip", z.ZodTypeAny, {
11
10
  template: "nft";
12
11
  did: string;
13
12
  name: string;
@@ -1,8 +1,7 @@
1
1
  import z from 'zod';
2
- export declare const PassportPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const PassportPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"passport">;
7
6
  image: z.ZodString;
8
7
  type: z.ZodArray<z.ZodString, "many">;
@@ -11,7 +10,7 @@ export declare const PassportPreviewTemplateSchema: z.ZodObject<z.objectUtil.ext
11
10
  issuedAt: z.ZodString;
12
11
  issuedTo: z.ZodString;
13
12
  verified: z.ZodBoolean;
14
- }>, "strip", z.ZodTypeAny, {
13
+ }, "strip", z.ZodTypeAny, {
15
14
  type: string[];
16
15
  template: "passport";
17
16
  did: string;
@@ -1,26 +1,25 @@
1
1
  import { z } from 'zod';
2
- export declare const PostPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const PostPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"post">;
7
- title: z.ZodString;
6
+ title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
8
7
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
9
8
  url: z.ZodString;
10
9
  createdAt: z.ZodEffects<z.ZodString, string, string>;
11
- }>, "strip", z.ZodTypeAny, {
10
+ }, "strip", z.ZodTypeAny, {
12
11
  template: "post";
13
12
  did: string;
14
- title: string;
15
13
  tags: string[];
16
14
  url: string;
17
15
  createdAt: string;
16
+ title?: string | undefined;
18
17
  }, {
19
18
  template: "post";
20
19
  did: string;
21
- title: string;
22
20
  url: string;
23
21
  createdAt: string;
22
+ title?: string | undefined;
24
23
  tags?: string[] | undefined;
25
24
  }>;
26
25
  export type PostPreviewTemplate = z.TypeOf<typeof PostPreviewTemplateSchema>;
@@ -1,13 +1,12 @@
1
1
  import { z } from 'zod';
2
- export declare const ProfilePreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const ProfilePreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"profile">>>;
7
6
  avatar: z.ZodString;
8
7
  fullname: z.ZodString;
9
8
  email: z.ZodString;
10
- }>, "strip", z.ZodTypeAny, {
9
+ }, "strip", z.ZodTypeAny, {
11
10
  template: "profile";
12
11
  did: string;
13
12
  avatar: string;
@@ -1,15 +1,14 @@
1
1
  import { z } from 'zod';
2
- export declare const ProjectPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"post">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">, z.ZodLiteral<"doc">]>;
2
+ export declare const ProjectPreviewTemplateSchema: z.ZodObject<{
4
3
  did: z.ZodEffects<z.ZodString, string, string>;
5
- }, {
4
+ } & {
6
5
  template: z.ZodLiteral<"project">;
7
6
  name: z.ZodString;
8
7
  description: z.ZodOptional<z.ZodString>;
9
8
  image: z.ZodString;
10
9
  url: z.ZodString;
11
10
  createdAt: z.ZodEffects<z.ZodString, string, string>;
12
- }>, "strip", z.ZodTypeAny, {
11
+ }, "strip", z.ZodTypeAny, {
13
12
  template: "project";
14
13
  did: string;
15
14
  name: string;
@@ -363,8 +363,7 @@ export declare const AuditLogSchema: z.ZodObject<{
363
363
  reason?: string | undefined;
364
364
  env?: Record<string, any> | undefined;
365
365
  }>;
366
- export declare const CreationAuditLogSchema: z.ZodObject<z.objectUtil.extendShape<{
367
- id: z.ZodString;
366
+ export declare const CreationAuditLogSchema: z.ZodObject<{
368
367
  actionType: z.ZodNativeEnum<typeof AuditLogAction>;
369
368
  entityId: z.ZodString;
370
369
  entityName: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -494,9 +493,9 @@ export declare const CreationAuditLogSchema: z.ZodObject<z.objectUtil.extendShap
494
493
  env: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
495
494
  createdAt: z.ZodDefault<z.ZodOptional<z.ZodString>>;
496
495
  updatedAt: z.ZodDefault<z.ZodOptional<z.ZodString>>;
497
- }, {
496
+ } & {
498
497
  id: z.ZodOptional<z.ZodString>;
499
- }>, "strip", z.ZodTypeAny, {
498
+ }, "strip", z.ZodTypeAny, {
500
499
  status: AuditLogStatus;
501
500
  createdAt: string;
502
501
  updatedAt: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@did-space/core",
3
- "version": "1.0.48",
3
+ "version": "1.0.51",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -115,9 +115,9 @@
115
115
  "watch": "npm run build -- -w"
116
116
  },
117
117
  "dependencies": {
118
- "@arcblock/did": "^1.20.0",
118
+ "@arcblock/did": "^1.20.6",
119
119
  "@arcblock/ipfs-only-hash": "^0.0.2",
120
- "@arcblock/validator": "^1.20.0",
120
+ "@arcblock/validator": "^1.20.6",
121
121
  "dayjs": "^1.11.13",
122
122
  "debug": "^4.4.0",
123
123
  "destroy": "^1.2.0",
@@ -131,7 +131,7 @@
131
131
  "sequelize": "^6.37.7",
132
132
  "validator": "^13.15.0",
133
133
  "xbytes": "^1.9.1",
134
- "zod": "^3.24.2"
134
+ "zod": "^3.24.4"
135
135
  },
136
136
  "devDependencies": {
137
137
  "@arcblock/eslint-config-ts": "^0.3.3",
@@ -145,8 +145,8 @@
145
145
  "lint-staged": "^13.3.0",
146
146
  "ts-jest": "^28.0.8",
147
147
  "typescript": "^4.9.5",
148
- "vite": "^5.4.18",
149
- "vitest": "^3.1.1"
148
+ "vite": "^5.4.19",
149
+ "vitest": "^3.1.3"
150
150
  },
151
- "gitHead": "8fba6ef619a1693e1d2cad3fac3eb42b2ccc6807"
151
+ "gitHead": "c75ad031a81d00ddc1d93bedb8a459ec5e46cbb1"
152
152
  }