@did-space/core 1.0.17 → 1.0.19

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,6 +1,6 @@
1
1
  import { z } from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"app">;
@@ -1,14 +1,16 @@
1
1
  import { z } from 'zod';
2
2
  export declare const DidSchema: z.ZodEffects<z.ZodString, string, string>;
3
3
  export declare const DateSchema: z.ZodEffects<z.ZodString, string, string>;
4
+ export declare const TemplateTypeSchema: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
5
  export declare const BasePreviewTemplateSchema: z.ZodObject<{
5
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
6
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
6
7
  did: z.ZodEffects<z.ZodString, string, string>;
7
8
  }, "strip", z.ZodTypeAny, {
8
- template: "nft" | "profile" | "passport" | "discuss" | "blog" | "bookmark" | "project";
9
+ template: "app" | "nft" | "profile" | "passport" | "discuss" | "blog" | "bookmark" | "project";
9
10
  did: string;
10
11
  }, {
11
- template: "nft" | "profile" | "passport" | "discuss" | "blog" | "bookmark" | "project";
12
+ template: "app" | "nft" | "profile" | "passport" | "discuss" | "blog" | "bookmark" | "project";
12
13
  did: string;
13
14
  }>;
15
+ export type TemplateType = z.infer<typeof TemplateTypeSchema>;
14
16
  export type BasePreviewTemplate = z.infer<typeof BasePreviewTemplateSchema>;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.BasePreviewTemplateSchema = exports.DateSchema = exports.DidSchema = void 0;
6
+ 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
9
  const zod_1 = require("zod");
@@ -19,15 +19,17 @@ exports.DateSchema = zod_1.z.string().refine((value) => (0, dayjs_1.default)(val
19
19
  message: `createdAt(${value}) is not a valid date`,
20
20
  };
21
21
  });
22
+ exports.TemplateTypeSchema = zod_1.z.union([
23
+ zod_1.z.literal('nft'),
24
+ zod_1.z.literal('profile'),
25
+ zod_1.z.literal('passport'),
26
+ zod_1.z.literal('discuss'),
27
+ zod_1.z.literal('blog'),
28
+ zod_1.z.literal('bookmark'),
29
+ zod_1.z.literal('project'),
30
+ zod_1.z.literal('app'),
31
+ ]);
22
32
  exports.BasePreviewTemplateSchema = zod_1.z.object({
23
- template: zod_1.z.union([
24
- zod_1.z.literal('nft'),
25
- zod_1.z.literal('profile'),
26
- zod_1.z.literal('passport'),
27
- zod_1.z.literal('discuss'),
28
- zod_1.z.literal('blog'),
29
- zod_1.z.literal('bookmark'),
30
- zod_1.z.literal('project'),
31
- ]),
33
+ template: exports.TemplateTypeSchema,
32
34
  did: exports.DidSchema,
33
35
  });
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"blog">;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"bookmark">;
@@ -1,6 +1,6 @@
1
1
  import z from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"app">;
@@ -17,7 +17,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
17
17
  name: string;
18
18
  logo: string;
19
19
  }>, z.ZodObject<z.objectUtil.extendShape<{
20
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
20
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
21
21
  did: z.ZodEffects<z.ZodString, string, string>;
22
22
  }, {
23
23
  template: z.ZodLiteral<"nft">;
@@ -37,7 +37,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
37
37
  image: string;
38
38
  chainHost: string;
39
39
  }>, z.ZodObject<z.objectUtil.extendShape<{
40
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
40
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
41
41
  did: z.ZodEffects<z.ZodString, string, string>;
42
42
  }, {
43
43
  template: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"profile">>>;
@@ -57,7 +57,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
57
57
  email: string;
58
58
  template?: "profile" | undefined;
59
59
  }>, z.ZodObject<z.objectUtil.extendShape<{
60
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
60
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
61
61
  did: z.ZodEffects<z.ZodString, string, string>;
62
62
  }, {
63
63
  template: z.ZodLiteral<"passport">;
@@ -69,8 +69,8 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
69
69
  issuedTo: z.ZodString;
70
70
  verified: z.ZodBoolean;
71
71
  }>, "strip", z.ZodTypeAny, {
72
- template: "passport";
73
72
  type: string[];
73
+ template: "passport";
74
74
  did: string;
75
75
  image: string;
76
76
  issuerDid: string;
@@ -79,8 +79,8 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
79
79
  issuedTo: string;
80
80
  verified: boolean;
81
81
  }, {
82
- template: "passport";
83
82
  type: string[];
83
+ template: "passport";
84
84
  did: string;
85
85
  image: string;
86
86
  issuerDid: string;
@@ -89,7 +89,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
89
89
  issuedTo: string;
90
90
  verified: boolean;
91
91
  }>, z.ZodObject<z.objectUtil.extendShape<{
92
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
92
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
93
93
  did: z.ZodEffects<z.ZodString, string, string>;
94
94
  }, {
95
95
  template: z.ZodLiteral<"discuss">;
@@ -112,7 +112,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
112
112
  url: string;
113
113
  createdAt: string;
114
114
  }>, z.ZodObject<z.objectUtil.extendShape<{
115
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
115
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
116
116
  did: z.ZodEffects<z.ZodString, string, string>;
117
117
  }, {
118
118
  template: z.ZodLiteral<"blog">;
@@ -138,7 +138,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
138
138
  url: string;
139
139
  createdAt: string;
140
140
  }>, z.ZodObject<z.objectUtil.extendShape<{
141
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
141
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
142
142
  did: z.ZodEffects<z.ZodString, string, string>;
143
143
  }, {
144
144
  template: z.ZodLiteral<"bookmark">;
@@ -164,7 +164,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
164
164
  url: string;
165
165
  createdAt: string;
166
166
  }>, z.ZodObject<z.objectUtil.extendShape<{
167
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
167
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
168
168
  did: z.ZodEffects<z.ZodString, string, string>;
169
169
  }, {
170
170
  template: z.ZodLiteral<"project">;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  export declare const DiscussPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"discuss">;
@@ -1,6 +1,6 @@
1
1
  import z from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"nft">;
@@ -1,6 +1,6 @@
1
1
  import z from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"passport">;
@@ -12,8 +12,8 @@ export declare const PassportPreviewTemplateSchema: z.ZodObject<z.objectUtil.ext
12
12
  issuedTo: z.ZodString;
13
13
  verified: z.ZodBoolean;
14
14
  }>, "strip", z.ZodTypeAny, {
15
- template: "passport";
16
15
  type: string[];
16
+ template: "passport";
17
17
  did: string;
18
18
  image: string;
19
19
  issuerDid: string;
@@ -22,8 +22,8 @@ export declare const PassportPreviewTemplateSchema: z.ZodObject<z.objectUtil.ext
22
22
  issuedTo: string;
23
23
  verified: boolean;
24
24
  }, {
25
- template: "passport";
26
25
  type: string[];
26
+ template: "passport";
27
27
  did: string;
28
28
  image: string;
29
29
  issuerDid: string;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"profile">>>;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"project">;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"app">;
@@ -1,14 +1,16 @@
1
1
  import { z } from 'zod';
2
2
  export declare const DidSchema: z.ZodEffects<z.ZodString, string, string>;
3
3
  export declare const DateSchema: z.ZodEffects<z.ZodString, string, string>;
4
+ export declare const TemplateTypeSchema: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
5
  export declare const BasePreviewTemplateSchema: z.ZodObject<{
5
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
6
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
6
7
  did: z.ZodEffects<z.ZodString, string, string>;
7
8
  }, "strip", z.ZodTypeAny, {
8
- template: "nft" | "profile" | "passport" | "discuss" | "blog" | "bookmark" | "project";
9
+ template: "app" | "nft" | "profile" | "passport" | "discuss" | "blog" | "bookmark" | "project";
9
10
  did: string;
10
11
  }, {
11
- template: "nft" | "profile" | "passport" | "discuss" | "blog" | "bookmark" | "project";
12
+ template: "app" | "nft" | "profile" | "passport" | "discuss" | "blog" | "bookmark" | "project";
12
13
  did: string;
13
14
  }>;
15
+ export type TemplateType = z.infer<typeof TemplateTypeSchema>;
14
16
  export type BasePreviewTemplate = z.infer<typeof BasePreviewTemplateSchema>;
@@ -13,15 +13,17 @@ export const DateSchema = z.string().refine((value) => dayjs(value).isValid(), (
13
13
  message: `createdAt(${value}) is not a valid date`,
14
14
  };
15
15
  });
16
+ export const TemplateTypeSchema = z.union([
17
+ z.literal('nft'),
18
+ z.literal('profile'),
19
+ z.literal('passport'),
20
+ z.literal('discuss'),
21
+ z.literal('blog'),
22
+ z.literal('bookmark'),
23
+ z.literal('project'),
24
+ z.literal('app'),
25
+ ]);
16
26
  export const BasePreviewTemplateSchema = z.object({
17
- template: z.union([
18
- z.literal('nft'),
19
- z.literal('profile'),
20
- z.literal('passport'),
21
- z.literal('discuss'),
22
- z.literal('blog'),
23
- z.literal('bookmark'),
24
- z.literal('project'),
25
- ]),
27
+ template: TemplateTypeSchema,
26
28
  did: DidSchema,
27
29
  });
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"blog">;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"bookmark">;
@@ -1,6 +1,6 @@
1
1
  import z from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"app">;
@@ -17,7 +17,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
17
17
  name: string;
18
18
  logo: string;
19
19
  }>, z.ZodObject<z.objectUtil.extendShape<{
20
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
20
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
21
21
  did: z.ZodEffects<z.ZodString, string, string>;
22
22
  }, {
23
23
  template: z.ZodLiteral<"nft">;
@@ -37,7 +37,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
37
37
  image: string;
38
38
  chainHost: string;
39
39
  }>, z.ZodObject<z.objectUtil.extendShape<{
40
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
40
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
41
41
  did: z.ZodEffects<z.ZodString, string, string>;
42
42
  }, {
43
43
  template: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"profile">>>;
@@ -57,7 +57,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
57
57
  email: string;
58
58
  template?: "profile" | undefined;
59
59
  }>, z.ZodObject<z.objectUtil.extendShape<{
60
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
60
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
61
61
  did: z.ZodEffects<z.ZodString, string, string>;
62
62
  }, {
63
63
  template: z.ZodLiteral<"passport">;
@@ -69,8 +69,8 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
69
69
  issuedTo: z.ZodString;
70
70
  verified: z.ZodBoolean;
71
71
  }>, "strip", z.ZodTypeAny, {
72
- template: "passport";
73
72
  type: string[];
73
+ template: "passport";
74
74
  did: string;
75
75
  image: string;
76
76
  issuerDid: string;
@@ -79,8 +79,8 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
79
79
  issuedTo: string;
80
80
  verified: boolean;
81
81
  }, {
82
- template: "passport";
83
82
  type: string[];
83
+ template: "passport";
84
84
  did: string;
85
85
  image: string;
86
86
  issuerDid: string;
@@ -89,7 +89,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
89
89
  issuedTo: string;
90
90
  verified: boolean;
91
91
  }>, z.ZodObject<z.objectUtil.extendShape<{
92
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
92
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
93
93
  did: z.ZodEffects<z.ZodString, string, string>;
94
94
  }, {
95
95
  template: z.ZodLiteral<"discuss">;
@@ -112,7 +112,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
112
112
  url: string;
113
113
  createdAt: string;
114
114
  }>, z.ZodObject<z.objectUtil.extendShape<{
115
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
115
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
116
116
  did: z.ZodEffects<z.ZodString, string, string>;
117
117
  }, {
118
118
  template: z.ZodLiteral<"blog">;
@@ -138,7 +138,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
138
138
  url: string;
139
139
  createdAt: string;
140
140
  }>, z.ZodObject<z.objectUtil.extendShape<{
141
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
141
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
142
142
  did: z.ZodEffects<z.ZodString, string, string>;
143
143
  }, {
144
144
  template: z.ZodLiteral<"bookmark">;
@@ -164,7 +164,7 @@ export declare const PreviewTemplateSchema: z.ZodUnion<[z.ZodObject<z.objectUtil
164
164
  url: string;
165
165
  createdAt: string;
166
166
  }>, z.ZodObject<z.objectUtil.extendShape<{
167
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
167
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
168
168
  did: z.ZodEffects<z.ZodString, string, string>;
169
169
  }, {
170
170
  template: z.ZodLiteral<"project">;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  export declare const DiscussPreviewTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"discuss">;
@@ -1,6 +1,6 @@
1
1
  import z from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"nft">;
@@ -1,6 +1,6 @@
1
1
  import z from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"passport">;
@@ -12,8 +12,8 @@ export declare const PassportPreviewTemplateSchema: z.ZodObject<z.objectUtil.ext
12
12
  issuedTo: z.ZodString;
13
13
  verified: z.ZodBoolean;
14
14
  }>, "strip", z.ZodTypeAny, {
15
- template: "passport";
16
15
  type: string[];
16
+ template: "passport";
17
17
  did: string;
18
18
  image: string;
19
19
  issuerDid: string;
@@ -22,8 +22,8 @@ export declare const PassportPreviewTemplateSchema: z.ZodObject<z.objectUtil.ext
22
22
  issuedTo: string;
23
23
  verified: boolean;
24
24
  }, {
25
- template: "passport";
26
25
  type: string[];
26
+ template: "passport";
27
27
  did: string;
28
28
  image: string;
29
29
  issuerDid: string;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"profile">>>;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
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<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">]>;
3
+ template: z.ZodUnion<[z.ZodLiteral<"nft">, z.ZodLiteral<"profile">, z.ZodLiteral<"passport">, z.ZodLiteral<"discuss">, z.ZodLiteral<"blog">, z.ZodLiteral<"bookmark">, z.ZodLiteral<"project">, z.ZodLiteral<"app">]>;
4
4
  did: z.ZodEffects<z.ZodString, string, string>;
5
5
  }, {
6
6
  template: z.ZodLiteral<"project">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@did-space/core",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
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.19.9",
118
+ "@arcblock/did": "^1.19.10",
119
119
  "@arcblock/ipfs-only-hash": "^0.0.2",
120
- "@arcblock/validator": "^1.19.9",
120
+ "@arcblock/validator": "^1.19.10",
121
121
  "dayjs": "^1.11.13",
122
122
  "debug": "^4.4.0",
123
123
  "destroy": "^1.2.0",
@@ -148,5 +148,5 @@
148
148
  "vite": "^5.4.14",
149
149
  "vitest": "^3.0.6"
150
150
  },
151
- "gitHead": "704646f1b9b235f3dd901658ec7152ec7916358a"
151
+ "gitHead": "7095b964ee70b16ff170a94fb11da1bdd40d8d86"
152
152
  }