televerse-dao-typechain-types 1.0.8-alpha.4 → 1.0.8-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/televerse-utils/index.d.ts +95 -0
- package/televerse-utils/index.js +67 -1
package/package.json
CHANGED
|
@@ -166,4 +166,99 @@ export declare const networksSchema: z.ZodRecord<z.ZodEnum<{
|
|
|
166
166
|
apiKeyRequired: z.ZodBoolean;
|
|
167
167
|
}, z.core.$strip>>;
|
|
168
168
|
}, z.core.$strip>>;
|
|
169
|
+
export declare const issuerTypeSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
170
|
+
id: z.ZodString;
|
|
171
|
+
}, z.core.$strip>, z.ZodString]>;
|
|
172
|
+
export declare const credentialSubjectSchema: z.ZodObject<{
|
|
173
|
+
id: z.ZodOptional<z.ZodString>;
|
|
174
|
+
message: z.ZodOptional<z.ZodString>;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
export declare const contextTypeSchema: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>>]>;
|
|
177
|
+
export declare const credentialStatusReferenceSchema: z.ZodObject<{
|
|
178
|
+
id: z.ZodString;
|
|
179
|
+
type: z.ZodString;
|
|
180
|
+
}, z.core.$strip>;
|
|
181
|
+
export declare const unsignedCredentialSchema: z.ZodObject<{
|
|
182
|
+
issuer: z.ZodUnion<readonly [z.ZodObject<{
|
|
183
|
+
id: z.ZodString;
|
|
184
|
+
}, z.core.$strip>, z.ZodString]>;
|
|
185
|
+
credentialSubject: z.ZodObject<{
|
|
186
|
+
id: z.ZodOptional<z.ZodString>;
|
|
187
|
+
message: z.ZodOptional<z.ZodString>;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
credentialSchema: z.ZodOptional<z.ZodObject<{
|
|
190
|
+
id: z.ZodOptional<z.ZodString>;
|
|
191
|
+
type: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.core.$strip>>;
|
|
193
|
+
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodString]>>;
|
|
194
|
+
'@context': z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>>]>;
|
|
195
|
+
issuanceDate: z.ZodString;
|
|
196
|
+
expirationDate: z.ZodOptional<z.ZodString>;
|
|
197
|
+
credentialStatus: z.ZodOptional<z.ZodObject<{
|
|
198
|
+
id: z.ZodString;
|
|
199
|
+
type: z.ZodString;
|
|
200
|
+
}, z.core.$strip>>;
|
|
201
|
+
id: z.ZodOptional<z.ZodString>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
export declare const proofTypeSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
204
|
+
type: z.ZodOptional<z.ZodString>;
|
|
205
|
+
jwt: z.ZodOptional<z.ZodString>;
|
|
206
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
207
|
+
type: z.ZodOptional<z.ZodString>;
|
|
208
|
+
verificationMethod: z.ZodOptional<z.ZodString>;
|
|
209
|
+
created: z.ZodOptional<z.ZodString>;
|
|
210
|
+
proofPurpose: z.ZodOptional<z.ZodString>;
|
|
211
|
+
proofValue: z.ZodOptional<z.ZodString>;
|
|
212
|
+
eip712: z.ZodOptional<z.ZodObject<{
|
|
213
|
+
domain: z.ZodOptional<z.ZodObject<{
|
|
214
|
+
chainId: z.ZodNumber;
|
|
215
|
+
name: z.ZodString;
|
|
216
|
+
version: z.ZodString;
|
|
217
|
+
}, z.core.$strip>>;
|
|
218
|
+
types: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
219
|
+
primaryType: z.ZodOptional<z.ZodString>;
|
|
220
|
+
}, z.core.$strip>>;
|
|
221
|
+
}, z.core.$strip>]>;
|
|
222
|
+
export declare const VerifiableCredentialSchema: z.ZodIntersection<z.ZodObject<{
|
|
223
|
+
issuer: z.ZodUnion<readonly [z.ZodObject<{
|
|
224
|
+
id: z.ZodString;
|
|
225
|
+
}, z.core.$strip>, z.ZodString]>;
|
|
226
|
+
credentialSubject: z.ZodObject<{
|
|
227
|
+
id: z.ZodOptional<z.ZodString>;
|
|
228
|
+
message: z.ZodOptional<z.ZodString>;
|
|
229
|
+
}, z.core.$strip>;
|
|
230
|
+
credentialSchema: z.ZodOptional<z.ZodObject<{
|
|
231
|
+
id: z.ZodOptional<z.ZodString>;
|
|
232
|
+
type: z.ZodOptional<z.ZodString>;
|
|
233
|
+
}, z.core.$strip>>;
|
|
234
|
+
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodString]>>;
|
|
235
|
+
'@context': z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>>]>;
|
|
236
|
+
issuanceDate: z.ZodString;
|
|
237
|
+
expirationDate: z.ZodOptional<z.ZodString>;
|
|
238
|
+
credentialStatus: z.ZodOptional<z.ZodObject<{
|
|
239
|
+
id: z.ZodString;
|
|
240
|
+
type: z.ZodString;
|
|
241
|
+
}, z.core.$strip>>;
|
|
242
|
+
id: z.ZodOptional<z.ZodString>;
|
|
243
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
244
|
+
proof: z.ZodUnion<readonly [z.ZodObject<{
|
|
245
|
+
type: z.ZodOptional<z.ZodString>;
|
|
246
|
+
jwt: z.ZodOptional<z.ZodString>;
|
|
247
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
248
|
+
type: z.ZodOptional<z.ZodString>;
|
|
249
|
+
verificationMethod: z.ZodOptional<z.ZodString>;
|
|
250
|
+
created: z.ZodOptional<z.ZodString>;
|
|
251
|
+
proofPurpose: z.ZodOptional<z.ZodString>;
|
|
252
|
+
proofValue: z.ZodOptional<z.ZodString>;
|
|
253
|
+
eip712: z.ZodOptional<z.ZodObject<{
|
|
254
|
+
domain: z.ZodOptional<z.ZodObject<{
|
|
255
|
+
chainId: z.ZodNumber;
|
|
256
|
+
name: z.ZodString;
|
|
257
|
+
version: z.ZodString;
|
|
258
|
+
}, z.core.$strip>>;
|
|
259
|
+
types: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
260
|
+
primaryType: z.ZodOptional<z.ZodString>;
|
|
261
|
+
}, z.core.$strip>>;
|
|
262
|
+
}, z.core.$strip>]>;
|
|
263
|
+
}, z.core.$strip>>;
|
|
169
264
|
export {};
|
package/televerse-utils/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.networksSchema = exports.configJsonSchema = exports.supportedNetworkEnumSchema = exports.jwtSchema = exports.searchRequestSchema = exports.QuoteSchema = exports.DIDCommQuoteMessageSchema = exports.GisPointSchema = exports.nniPayloadSchema = exports.postMessagePayloadSchema = exports.postMessageSchema = exports.ChargeFrequency = void 0;
|
|
3
|
+
exports.VerifiableCredentialSchema = exports.proofTypeSchema = exports.unsignedCredentialSchema = exports.credentialStatusReferenceSchema = exports.contextTypeSchema = exports.credentialSubjectSchema = exports.issuerTypeSchema = exports.networksSchema = exports.configJsonSchema = exports.supportedNetworkEnumSchema = exports.jwtSchema = exports.searchRequestSchema = exports.QuoteSchema = exports.DIDCommQuoteMessageSchema = exports.GisPointSchema = exports.nniPayloadSchema = exports.postMessagePayloadSchema = exports.postMessageSchema = exports.ChargeFrequency = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.ChargeFrequency = {
|
|
6
6
|
DAILY: 'DAILY',
|
|
@@ -95,3 +95,69 @@ exports.configJsonSchema = zod_1.z.object({
|
|
|
95
95
|
selectedNetwork: networkConfigSchema.optional(),
|
|
96
96
|
});
|
|
97
97
|
exports.networksSchema = zod_1.z.record(exports.supportedNetworkEnumSchema, networkConfigSchema);
|
|
98
|
+
exports.issuerTypeSchema = zod_1.z.union([
|
|
99
|
+
zod_1.z.object({
|
|
100
|
+
id: zod_1.z.string(),
|
|
101
|
+
}),
|
|
102
|
+
zod_1.z.string(),
|
|
103
|
+
]);
|
|
104
|
+
exports.credentialSubjectSchema = zod_1.z.object({
|
|
105
|
+
id: zod_1.z.string().optional(),
|
|
106
|
+
message: zod_1.z.string().optional(),
|
|
107
|
+
});
|
|
108
|
+
exports.contextTypeSchema = zod_1.z.union([
|
|
109
|
+
zod_1.z.string(),
|
|
110
|
+
zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
|
|
111
|
+
zod_1.z.array(zod_1.z.union([zod_1.z.string(), zod_1.z.record(zod_1.z.string(), zod_1.z.any())])),
|
|
112
|
+
]);
|
|
113
|
+
exports.credentialStatusReferenceSchema = zod_1.z.object({
|
|
114
|
+
id: zod_1.z.string(),
|
|
115
|
+
type: zod_1.z.string(),
|
|
116
|
+
});
|
|
117
|
+
// Derived from generated VC upon passing to veramo API with the payload
|
|
118
|
+
const credentialSchema = zod_1.z.object({
|
|
119
|
+
id: zod_1.z.string().optional(),
|
|
120
|
+
type: zod_1.z.string().optional(),
|
|
121
|
+
});
|
|
122
|
+
exports.unsignedCredentialSchema = zod_1.z.object({
|
|
123
|
+
issuer: exports.issuerTypeSchema,
|
|
124
|
+
credentialSubject: exports.credentialSubjectSchema,
|
|
125
|
+
credentialSchema: credentialSchema.optional(),
|
|
126
|
+
type: zod_1.z.union([zod_1.z.array(zod_1.z.string()), zod_1.z.string()]).optional(),
|
|
127
|
+
'@context': exports.contextTypeSchema,
|
|
128
|
+
issuanceDate: zod_1.z.string(),
|
|
129
|
+
expirationDate: zod_1.z.string().optional(),
|
|
130
|
+
credentialStatus: exports.credentialStatusReferenceSchema.optional(),
|
|
131
|
+
id: zod_1.z.string().optional(),
|
|
132
|
+
});
|
|
133
|
+
const jwtProofTypeSchema = zod_1.z.object({
|
|
134
|
+
type: zod_1.z.string().optional(),
|
|
135
|
+
jwt: zod_1.z.string().optional(),
|
|
136
|
+
});
|
|
137
|
+
const eip712ProofTypeSchema = zod_1.z.object({
|
|
138
|
+
type: zod_1.z.string().optional(),
|
|
139
|
+
verificationMethod: zod_1.z.string().optional(),
|
|
140
|
+
created: zod_1.z.string().optional(),
|
|
141
|
+
proofPurpose: zod_1.z.string().optional(),
|
|
142
|
+
proofValue: zod_1.z.string().optional(),
|
|
143
|
+
eip712: zod_1.z
|
|
144
|
+
.object({
|
|
145
|
+
domain: zod_1.z
|
|
146
|
+
.object({
|
|
147
|
+
chainId: zod_1.z.number(),
|
|
148
|
+
name: zod_1.z.string(),
|
|
149
|
+
version: zod_1.z.string(),
|
|
150
|
+
})
|
|
151
|
+
.optional(),
|
|
152
|
+
types: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
153
|
+
primaryType: zod_1.z.string().optional(),
|
|
154
|
+
})
|
|
155
|
+
.optional(),
|
|
156
|
+
});
|
|
157
|
+
exports.proofTypeSchema = zod_1.z.union([
|
|
158
|
+
jwtProofTypeSchema,
|
|
159
|
+
eip712ProofTypeSchema,
|
|
160
|
+
]);
|
|
161
|
+
exports.VerifiableCredentialSchema = exports.unsignedCredentialSchema.and(zod_1.z.object({
|
|
162
|
+
proof: exports.proofTypeSchema,
|
|
163
|
+
}));
|