@did-space/core 1.0.49 → 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.
- package/dist/cjs/meta/template/preview/base.d.ts +1 -1
- package/dist/cjs/meta/template/preview/base.js +7 -1
- package/dist/cjs/meta/template/preview/blog.d.ts +3 -3
- package/dist/cjs/meta/template/preview/bookmark.d.ts +3 -3
- package/dist/cjs/meta/template/preview/default.d.ts +12 -12
- package/dist/cjs/meta/template/preview/docs.d.ts +3 -3
- package/dist/cjs/meta/template/preview/post.d.ts +3 -3
- package/dist/es/meta/template/preview/base.d.ts +1 -1
- package/dist/es/meta/template/preview/base.js +7 -1
- package/dist/es/meta/template/preview/blog.d.ts +3 -3
- package/dist/es/meta/template/preview/bookmark.d.ts +3 -3
- package/dist/es/meta/template/preview/default.d.ts +12 -12
- package/dist/es/meta/template/preview/docs.d.ts +3 -3
- package/dist/es/meta/template/preview/post.d.ts +3 -3
- package/package.json +6 -6
|
@@ -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
|
|
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));
|
|
@@ -3,7 +3,7 @@ export declare const BlogPreviewTemplateSchema: z.ZodObject<{
|
|
|
3
3
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
4
4
|
} & {
|
|
5
5
|
template: z.ZodLiteral<"blog">;
|
|
6
|
-
title: z.ZodString
|
|
6
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
7
7
|
image: z.ZodString;
|
|
8
8
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
9
9
|
url: z.ZodString;
|
|
@@ -11,18 +11,18 @@ export declare const BlogPreviewTemplateSchema: z.ZodObject<{
|
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
12
|
template: "blog";
|
|
13
13
|
did: string;
|
|
14
|
-
title: string;
|
|
15
14
|
image: string;
|
|
16
15
|
tags: string[];
|
|
17
16
|
url: string;
|
|
18
17
|
createdAt: string;
|
|
18
|
+
title?: string | undefined;
|
|
19
19
|
}, {
|
|
20
20
|
template: "blog";
|
|
21
21
|
did: string;
|
|
22
|
-
title: string;
|
|
23
22
|
image: string;
|
|
24
23
|
url: string;
|
|
25
24
|
createdAt: string;
|
|
25
|
+
title?: string | undefined;
|
|
26
26
|
tags?: string[] | undefined;
|
|
27
27
|
}>;
|
|
28
28
|
export type BlogPreviewTemplate = z.TypeOf<typeof BlogPreviewTemplateSchema>;
|
|
@@ -3,7 +3,7 @@ export declare const BookmarkPreviewTemplateSchema: z.ZodObject<{
|
|
|
3
3
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
4
4
|
} & {
|
|
5
5
|
template: z.ZodLiteral<"bookmark">;
|
|
6
|
-
title: z.ZodString
|
|
6
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
7
7
|
image: z.ZodString;
|
|
8
8
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
9
9
|
url: z.ZodString;
|
|
@@ -11,18 +11,18 @@ export declare const BookmarkPreviewTemplateSchema: z.ZodObject<{
|
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
12
|
template: "bookmark";
|
|
13
13
|
did: string;
|
|
14
|
-
title: string;
|
|
15
14
|
image: string;
|
|
16
15
|
tags: string[];
|
|
17
16
|
url: string;
|
|
18
17
|
createdAt: string;
|
|
18
|
+
title?: string | undefined;
|
|
19
19
|
}, {
|
|
20
20
|
template: "bookmark";
|
|
21
21
|
did: string;
|
|
22
|
-
title: string;
|
|
23
22
|
image: string;
|
|
24
23
|
url: string;
|
|
25
24
|
createdAt: string;
|
|
25
|
+
title?: string | undefined;
|
|
26
26
|
tags?: string[] | undefined;
|
|
27
27
|
}>;
|
|
28
28
|
export type BookmarkPreviewTemplate = z.TypeOf<typeof BookmarkPreviewTemplateSchema>;
|
|
@@ -88,29 +88,29 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
88
88
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
89
89
|
} & {
|
|
90
90
|
template: z.ZodLiteral<"post">;
|
|
91
|
-
title: z.ZodString
|
|
91
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
92
92
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
93
93
|
url: z.ZodString;
|
|
94
94
|
createdAt: z.ZodEffects<z.ZodString, string, string>;
|
|
95
95
|
}, "strip", z.ZodTypeAny, {
|
|
96
96
|
template: "post";
|
|
97
97
|
did: string;
|
|
98
|
-
title: string;
|
|
99
98
|
tags: string[];
|
|
100
99
|
url: string;
|
|
101
100
|
createdAt: string;
|
|
101
|
+
title?: string | undefined;
|
|
102
102
|
}, {
|
|
103
103
|
template: "post";
|
|
104
104
|
did: string;
|
|
105
|
-
title: string;
|
|
106
105
|
url: string;
|
|
107
106
|
createdAt: string;
|
|
107
|
+
title?: string | undefined;
|
|
108
108
|
tags?: string[] | undefined;
|
|
109
109
|
}>, z.ZodObject<{
|
|
110
110
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
111
111
|
} & {
|
|
112
112
|
template: z.ZodLiteral<"blog">;
|
|
113
|
-
title: z.ZodString
|
|
113
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
114
114
|
image: z.ZodString;
|
|
115
115
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
116
116
|
url: z.ZodString;
|
|
@@ -118,24 +118,24 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
118
118
|
}, "strip", z.ZodTypeAny, {
|
|
119
119
|
template: "blog";
|
|
120
120
|
did: string;
|
|
121
|
-
title: string;
|
|
122
121
|
image: string;
|
|
123
122
|
tags: string[];
|
|
124
123
|
url: string;
|
|
125
124
|
createdAt: string;
|
|
125
|
+
title?: string | undefined;
|
|
126
126
|
}, {
|
|
127
127
|
template: "blog";
|
|
128
128
|
did: string;
|
|
129
|
-
title: string;
|
|
130
129
|
image: string;
|
|
131
130
|
url: string;
|
|
132
131
|
createdAt: string;
|
|
132
|
+
title?: string | undefined;
|
|
133
133
|
tags?: string[] | undefined;
|
|
134
134
|
}>, z.ZodObject<{
|
|
135
135
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
136
136
|
} & {
|
|
137
137
|
template: z.ZodLiteral<"bookmark">;
|
|
138
|
-
title: z.ZodString
|
|
138
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
139
139
|
image: z.ZodString;
|
|
140
140
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
141
141
|
url: z.ZodString;
|
|
@@ -143,18 +143,18 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
143
143
|
}, "strip", z.ZodTypeAny, {
|
|
144
144
|
template: "bookmark";
|
|
145
145
|
did: string;
|
|
146
|
-
title: string;
|
|
147
146
|
image: string;
|
|
148
147
|
tags: string[];
|
|
149
148
|
url: string;
|
|
150
149
|
createdAt: string;
|
|
150
|
+
title?: string | undefined;
|
|
151
151
|
}, {
|
|
152
152
|
template: "bookmark";
|
|
153
153
|
did: string;
|
|
154
|
-
title: string;
|
|
155
154
|
image: string;
|
|
156
155
|
url: string;
|
|
157
156
|
createdAt: string;
|
|
157
|
+
title?: string | undefined;
|
|
158
158
|
tags?: string[] | undefined;
|
|
159
159
|
}>, z.ZodObject<{
|
|
160
160
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
@@ -185,7 +185,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
185
185
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
186
186
|
} & {
|
|
187
187
|
template: z.ZodLiteral<"doc">;
|
|
188
|
-
title: z.ZodString
|
|
188
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
189
189
|
image: z.ZodString;
|
|
190
190
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
191
191
|
url: z.ZodString;
|
|
@@ -193,18 +193,18 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
193
193
|
}, "strip", z.ZodTypeAny, {
|
|
194
194
|
template: "doc";
|
|
195
195
|
did: string;
|
|
196
|
-
title: string;
|
|
197
196
|
image: string;
|
|
198
197
|
tags: string[];
|
|
199
198
|
url: string;
|
|
200
199
|
createdAt: string;
|
|
200
|
+
title?: string | undefined;
|
|
201
201
|
}, {
|
|
202
202
|
template: "doc";
|
|
203
203
|
did: string;
|
|
204
|
-
title: string;
|
|
205
204
|
image: string;
|
|
206
205
|
url: string;
|
|
207
206
|
createdAt: string;
|
|
207
|
+
title?: string | undefined;
|
|
208
208
|
tags?: string[] | undefined;
|
|
209
209
|
}>]>;
|
|
210
210
|
export type PreviewTemplate = z.infer<typeof PreviewTemplateSchema>;
|
|
@@ -3,7 +3,7 @@ export declare const DocPreviewTemplateSchema: z.ZodObject<{
|
|
|
3
3
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
4
4
|
} & {
|
|
5
5
|
template: z.ZodLiteral<"doc">;
|
|
6
|
-
title: z.ZodString
|
|
6
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
7
7
|
image: z.ZodString;
|
|
8
8
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
9
9
|
url: z.ZodString;
|
|
@@ -11,18 +11,18 @@ export declare const DocPreviewTemplateSchema: z.ZodObject<{
|
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
12
|
template: "doc";
|
|
13
13
|
did: string;
|
|
14
|
-
title: string;
|
|
15
14
|
image: string;
|
|
16
15
|
tags: string[];
|
|
17
16
|
url: string;
|
|
18
17
|
createdAt: string;
|
|
18
|
+
title?: string | undefined;
|
|
19
19
|
}, {
|
|
20
20
|
template: "doc";
|
|
21
21
|
did: string;
|
|
22
|
-
title: string;
|
|
23
22
|
image: string;
|
|
24
23
|
url: string;
|
|
25
24
|
createdAt: string;
|
|
25
|
+
title?: string | undefined;
|
|
26
26
|
tags?: string[] | undefined;
|
|
27
27
|
}>;
|
|
28
28
|
export type DocPreviewTemplate = z.TypeOf<typeof DocPreviewTemplateSchema>;
|
|
@@ -3,23 +3,23 @@ export declare const PostPreviewTemplateSchema: z.ZodObject<{
|
|
|
3
3
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
4
4
|
} & {
|
|
5
5
|
template: z.ZodLiteral<"post">;
|
|
6
|
-
title: z.ZodString
|
|
6
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
7
7
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
8
8
|
url: z.ZodString;
|
|
9
9
|
createdAt: z.ZodEffects<z.ZodString, string, string>;
|
|
10
10
|
}, "strip", z.ZodTypeAny, {
|
|
11
11
|
template: "post";
|
|
12
12
|
did: string;
|
|
13
|
-
title: string;
|
|
14
13
|
tags: string[];
|
|
15
14
|
url: string;
|
|
16
15
|
createdAt: string;
|
|
16
|
+
title?: string | undefined;
|
|
17
17
|
}, {
|
|
18
18
|
template: "post";
|
|
19
19
|
did: string;
|
|
20
|
-
title: string;
|
|
21
20
|
url: string;
|
|
22
21
|
createdAt: string;
|
|
22
|
+
title?: string | undefined;
|
|
23
23
|
tags?: string[] | undefined;
|
|
24
24
|
}>;
|
|
25
25
|
export type PostPreviewTemplate = z.TypeOf<typeof PostPreviewTemplateSchema>;
|
|
@@ -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
|
|
35
|
+
export const TitleSchema = z
|
|
36
|
+
.string()
|
|
37
|
+
.min(0)
|
|
38
|
+
.max(512)
|
|
39
|
+
.optional()
|
|
40
|
+
.transform((title) => (isEmpty(title) ? 'Untitled' : title));
|
|
@@ -3,7 +3,7 @@ export declare const BlogPreviewTemplateSchema: z.ZodObject<{
|
|
|
3
3
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
4
4
|
} & {
|
|
5
5
|
template: z.ZodLiteral<"blog">;
|
|
6
|
-
title: z.ZodString
|
|
6
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
7
7
|
image: z.ZodString;
|
|
8
8
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
9
9
|
url: z.ZodString;
|
|
@@ -11,18 +11,18 @@ export declare const BlogPreviewTemplateSchema: z.ZodObject<{
|
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
12
|
template: "blog";
|
|
13
13
|
did: string;
|
|
14
|
-
title: string;
|
|
15
14
|
image: string;
|
|
16
15
|
tags: string[];
|
|
17
16
|
url: string;
|
|
18
17
|
createdAt: string;
|
|
18
|
+
title?: string | undefined;
|
|
19
19
|
}, {
|
|
20
20
|
template: "blog";
|
|
21
21
|
did: string;
|
|
22
|
-
title: string;
|
|
23
22
|
image: string;
|
|
24
23
|
url: string;
|
|
25
24
|
createdAt: string;
|
|
25
|
+
title?: string | undefined;
|
|
26
26
|
tags?: string[] | undefined;
|
|
27
27
|
}>;
|
|
28
28
|
export type BlogPreviewTemplate = z.TypeOf<typeof BlogPreviewTemplateSchema>;
|
|
@@ -3,7 +3,7 @@ export declare const BookmarkPreviewTemplateSchema: z.ZodObject<{
|
|
|
3
3
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
4
4
|
} & {
|
|
5
5
|
template: z.ZodLiteral<"bookmark">;
|
|
6
|
-
title: z.ZodString
|
|
6
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
7
7
|
image: z.ZodString;
|
|
8
8
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
9
9
|
url: z.ZodString;
|
|
@@ -11,18 +11,18 @@ export declare const BookmarkPreviewTemplateSchema: z.ZodObject<{
|
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
12
|
template: "bookmark";
|
|
13
13
|
did: string;
|
|
14
|
-
title: string;
|
|
15
14
|
image: string;
|
|
16
15
|
tags: string[];
|
|
17
16
|
url: string;
|
|
18
17
|
createdAt: string;
|
|
18
|
+
title?: string | undefined;
|
|
19
19
|
}, {
|
|
20
20
|
template: "bookmark";
|
|
21
21
|
did: string;
|
|
22
|
-
title: string;
|
|
23
22
|
image: string;
|
|
24
23
|
url: string;
|
|
25
24
|
createdAt: string;
|
|
25
|
+
title?: string | undefined;
|
|
26
26
|
tags?: string[] | undefined;
|
|
27
27
|
}>;
|
|
28
28
|
export type BookmarkPreviewTemplate = z.TypeOf<typeof BookmarkPreviewTemplateSchema>;
|
|
@@ -88,29 +88,29 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
88
88
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
89
89
|
} & {
|
|
90
90
|
template: z.ZodLiteral<"post">;
|
|
91
|
-
title: z.ZodString
|
|
91
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
92
92
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
93
93
|
url: z.ZodString;
|
|
94
94
|
createdAt: z.ZodEffects<z.ZodString, string, string>;
|
|
95
95
|
}, "strip", z.ZodTypeAny, {
|
|
96
96
|
template: "post";
|
|
97
97
|
did: string;
|
|
98
|
-
title: string;
|
|
99
98
|
tags: string[];
|
|
100
99
|
url: string;
|
|
101
100
|
createdAt: string;
|
|
101
|
+
title?: string | undefined;
|
|
102
102
|
}, {
|
|
103
103
|
template: "post";
|
|
104
104
|
did: string;
|
|
105
|
-
title: string;
|
|
106
105
|
url: string;
|
|
107
106
|
createdAt: string;
|
|
107
|
+
title?: string | undefined;
|
|
108
108
|
tags?: string[] | undefined;
|
|
109
109
|
}>, z.ZodObject<{
|
|
110
110
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
111
111
|
} & {
|
|
112
112
|
template: z.ZodLiteral<"blog">;
|
|
113
|
-
title: z.ZodString
|
|
113
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
114
114
|
image: z.ZodString;
|
|
115
115
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
116
116
|
url: z.ZodString;
|
|
@@ -118,24 +118,24 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
118
118
|
}, "strip", z.ZodTypeAny, {
|
|
119
119
|
template: "blog";
|
|
120
120
|
did: string;
|
|
121
|
-
title: string;
|
|
122
121
|
image: string;
|
|
123
122
|
tags: string[];
|
|
124
123
|
url: string;
|
|
125
124
|
createdAt: string;
|
|
125
|
+
title?: string | undefined;
|
|
126
126
|
}, {
|
|
127
127
|
template: "blog";
|
|
128
128
|
did: string;
|
|
129
|
-
title: string;
|
|
130
129
|
image: string;
|
|
131
130
|
url: string;
|
|
132
131
|
createdAt: string;
|
|
132
|
+
title?: string | undefined;
|
|
133
133
|
tags?: string[] | undefined;
|
|
134
134
|
}>, z.ZodObject<{
|
|
135
135
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
136
136
|
} & {
|
|
137
137
|
template: z.ZodLiteral<"bookmark">;
|
|
138
|
-
title: z.ZodString
|
|
138
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
139
139
|
image: z.ZodString;
|
|
140
140
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
141
141
|
url: z.ZodString;
|
|
@@ -143,18 +143,18 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
143
143
|
}, "strip", z.ZodTypeAny, {
|
|
144
144
|
template: "bookmark";
|
|
145
145
|
did: string;
|
|
146
|
-
title: string;
|
|
147
146
|
image: string;
|
|
148
147
|
tags: string[];
|
|
149
148
|
url: string;
|
|
150
149
|
createdAt: string;
|
|
150
|
+
title?: string | undefined;
|
|
151
151
|
}, {
|
|
152
152
|
template: "bookmark";
|
|
153
153
|
did: string;
|
|
154
|
-
title: string;
|
|
155
154
|
image: string;
|
|
156
155
|
url: string;
|
|
157
156
|
createdAt: string;
|
|
157
|
+
title?: string | undefined;
|
|
158
158
|
tags?: string[] | undefined;
|
|
159
159
|
}>, z.ZodObject<{
|
|
160
160
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
@@ -185,7 +185,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
185
185
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
186
186
|
} & {
|
|
187
187
|
template: z.ZodLiteral<"doc">;
|
|
188
|
-
title: z.ZodString
|
|
188
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
189
189
|
image: z.ZodString;
|
|
190
190
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
191
191
|
url: z.ZodString;
|
|
@@ -193,18 +193,18 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
193
193
|
}, "strip", z.ZodTypeAny, {
|
|
194
194
|
template: "doc";
|
|
195
195
|
did: string;
|
|
196
|
-
title: string;
|
|
197
196
|
image: string;
|
|
198
197
|
tags: string[];
|
|
199
198
|
url: string;
|
|
200
199
|
createdAt: string;
|
|
200
|
+
title?: string | undefined;
|
|
201
201
|
}, {
|
|
202
202
|
template: "doc";
|
|
203
203
|
did: string;
|
|
204
|
-
title: string;
|
|
205
204
|
image: string;
|
|
206
205
|
url: string;
|
|
207
206
|
createdAt: string;
|
|
207
|
+
title?: string | undefined;
|
|
208
208
|
tags?: string[] | undefined;
|
|
209
209
|
}>]>;
|
|
210
210
|
export type PreviewTemplate = z.infer<typeof PreviewTemplateSchema>;
|
|
@@ -3,7 +3,7 @@ export declare const DocPreviewTemplateSchema: z.ZodObject<{
|
|
|
3
3
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
4
4
|
} & {
|
|
5
5
|
template: z.ZodLiteral<"doc">;
|
|
6
|
-
title: z.ZodString
|
|
6
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
7
7
|
image: z.ZodString;
|
|
8
8
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
9
9
|
url: z.ZodString;
|
|
@@ -11,18 +11,18 @@ export declare const DocPreviewTemplateSchema: z.ZodObject<{
|
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
12
|
template: "doc";
|
|
13
13
|
did: string;
|
|
14
|
-
title: string;
|
|
15
14
|
image: string;
|
|
16
15
|
tags: string[];
|
|
17
16
|
url: string;
|
|
18
17
|
createdAt: string;
|
|
18
|
+
title?: string | undefined;
|
|
19
19
|
}, {
|
|
20
20
|
template: "doc";
|
|
21
21
|
did: string;
|
|
22
|
-
title: string;
|
|
23
22
|
image: string;
|
|
24
23
|
url: string;
|
|
25
24
|
createdAt: string;
|
|
25
|
+
title?: string | undefined;
|
|
26
26
|
tags?: string[] | undefined;
|
|
27
27
|
}>;
|
|
28
28
|
export type DocPreviewTemplate = z.TypeOf<typeof DocPreviewTemplateSchema>;
|
|
@@ -3,23 +3,23 @@ export declare const PostPreviewTemplateSchema: z.ZodObject<{
|
|
|
3
3
|
did: z.ZodEffects<z.ZodString, string, string>;
|
|
4
4
|
} & {
|
|
5
5
|
template: z.ZodLiteral<"post">;
|
|
6
|
-
title: z.ZodString
|
|
6
|
+
title: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
7
7
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
8
8
|
url: z.ZodString;
|
|
9
9
|
createdAt: z.ZodEffects<z.ZodString, string, string>;
|
|
10
10
|
}, "strip", z.ZodTypeAny, {
|
|
11
11
|
template: "post";
|
|
12
12
|
did: string;
|
|
13
|
-
title: string;
|
|
14
13
|
tags: string[];
|
|
15
14
|
url: string;
|
|
16
15
|
createdAt: string;
|
|
16
|
+
title?: string | undefined;
|
|
17
17
|
}, {
|
|
18
18
|
template: "post";
|
|
19
19
|
did: string;
|
|
20
|
-
title: string;
|
|
21
20
|
url: string;
|
|
22
21
|
createdAt: string;
|
|
22
|
+
title?: string | undefined;
|
|
23
23
|
tags?: string[] | undefined;
|
|
24
24
|
}>;
|
|
25
25
|
export type PostPreviewTemplate = z.TypeOf<typeof PostPreviewTemplateSchema>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@did-space/core",
|
|
3
|
-
"version": "1.0.
|
|
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.
|
|
118
|
+
"@arcblock/did": "^1.20.6",
|
|
119
119
|
"@arcblock/ipfs-only-hash": "^0.0.2",
|
|
120
|
-
"@arcblock/validator": "^1.20.
|
|
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.
|
|
134
|
+
"zod": "^3.24.4"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
137
|
"@arcblock/eslint-config-ts": "^0.3.3",
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"ts-jest": "^28.0.8",
|
|
147
147
|
"typescript": "^4.9.5",
|
|
148
148
|
"vite": "^5.4.19",
|
|
149
|
-
"vitest": "^3.1.
|
|
149
|
+
"vitest": "^3.1.3"
|
|
150
150
|
},
|
|
151
|
-
"gitHead": "
|
|
151
|
+
"gitHead": "c75ad031a81d00ddc1d93bedb8a459ec5e46cbb1"
|
|
152
152
|
}
|