@originator-profile/model 0.4.0 → 0.5.0-beta.2
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/index.cjs +424 -1755
- package/dist/index.d.cts +632 -7865
- package/dist/index.d.mts +632 -7865
- package/dist/index.mjs +418 -1736
- package/package.json +7 -5
package/dist/index.cjs
CHANGED
|
@@ -1,1746 +1,428 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
{
|
|
12
|
-
type: "array",
|
|
13
|
-
items: Item$1
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
description: "@deprecated Content Attestation \u3067\u306F allowedOrigin \u306F\u975E\u63A8\u5968\u3067\u3059\u3002\u4EE3\u308F\u308A\u306B allowedUrl \u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u30022026\u5E749\u6708\u307E\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u307E\u3059\u3002\n\n\u8868\u660E\u3055\u308C\u308B\u60C5\u5831\u306E\u5BFE\u8C61\u3068\u306A\u308B [origin](https://www.rfc-editor.org/rfc/rfc6454#section-7)"
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const Item = {
|
|
20
|
-
type: "string",
|
|
21
|
-
format: "uri"
|
|
22
|
-
};
|
|
23
|
-
const AllowedUrl = {
|
|
24
|
-
title: "Allowed URLs",
|
|
25
|
-
anyOf: [
|
|
26
|
-
Item,
|
|
27
|
-
{
|
|
28
|
-
type: "array",
|
|
29
|
-
items: Item,
|
|
30
|
-
minItems: 1
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
|
-
description: "Content Attestation \u306B\u3088\u3063\u3066\u8868\u660E\u3055\u308C\u308B\u60C5\u5831\u306E\u5BFE\u8C61\u3068\u306A\u308B URL \u3067\u3059\u3002 \u6587\u5B57\u5217\u306F\u5FC5\u305A URL Pattern string \u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093 (MUST)\u3002\u7A7A\u914D\u5217\u306B\u3057\u3066\u306F\u306A\u308A\u307E\u305B\u3093 (MUST NOT)\u3002"
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const CertificationSystem = {
|
|
37
|
-
type: "object",
|
|
38
|
-
title: "\u8A8D\u8A3C\u30B7\u30B9\u30C6\u30E0",
|
|
39
|
-
properties: {
|
|
40
|
-
id: {
|
|
41
|
-
type: "string",
|
|
42
|
-
title: "\u8A8D\u8A3C\u30B7\u30B9\u30C6\u30E0\u306E ID",
|
|
43
|
-
format: "uri"
|
|
44
|
-
},
|
|
45
|
-
type: {
|
|
46
|
-
type: "string",
|
|
47
|
-
title: "\u8A8D\u8A3C\u30B7\u30B9\u30C6\u30E0\u306E\u7A2E\u985E",
|
|
48
|
-
const: "CertificationSystem"
|
|
49
|
-
},
|
|
50
|
-
name: { type: "string", title: "\u8A8D\u8A3C\u30B7\u30B9\u30C6\u30E0\u540D" },
|
|
51
|
-
description: { type: "string", title: "\u8AAC\u660E" },
|
|
52
|
-
ref: {
|
|
53
|
-
type: "string",
|
|
54
|
-
title: "\u8A8D\u8A3C\u5236\u5EA6\u306E\u8A73\u7D30\u30DA\u30FC\u30B8",
|
|
55
|
-
description: "\u8A8D\u8A3C\u5236\u5EA6\u306E\u8A73\u7D30\u3092\u77E5\u308B\u305F\u3081\u306E\u4EBA\u304C\u8AAD\u3080\u305F\u3081\u306E\u30DA\u30FC\u30B8\u306E URL \u3067\u3059\u3002",
|
|
56
|
-
format: "uri"
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
required: ["id", "type", "name"]
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const OpContextHead = {
|
|
63
|
-
type: "array",
|
|
64
|
-
allOf: [
|
|
65
|
-
{
|
|
66
|
-
contains: {
|
|
67
|
-
const: "https://www.w3.org/ns/credentials/v2"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
contains: {
|
|
72
|
-
const: "https://originator-profile.org/ns/credentials/v1"
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const OpVc = {
|
|
79
|
-
type: "object",
|
|
80
|
-
additionalProperties: true,
|
|
81
|
-
properties: {
|
|
82
|
-
"@context": OpContextHead,
|
|
83
|
-
type: {
|
|
84
|
-
type: "array",
|
|
85
|
-
contains: {
|
|
86
|
-
const: "VerifiableCredential"
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
issuer: { type: "string", format: "uri" },
|
|
90
|
-
credentialSubject: {
|
|
91
|
-
type: "object",
|
|
92
|
-
additionalProperties: true,
|
|
93
|
-
properties: {
|
|
94
|
-
id: { type: "string", format: "uri" }
|
|
95
|
-
},
|
|
96
|
-
required: ["id"]
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
required: ["@context", "type", "issuer", "credentialSubject"]
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const Image = {
|
|
103
|
-
title: "\u753B\u50CF",
|
|
104
|
-
type: "object",
|
|
105
|
-
properties: {
|
|
106
|
-
id: {
|
|
107
|
-
type: "string",
|
|
108
|
-
format: "uri"
|
|
109
|
-
},
|
|
110
|
-
digestSRI: {
|
|
111
|
-
type: "string",
|
|
112
|
-
title: "Integrity Metadata",
|
|
113
|
-
description: "Subresource Integrity (SRI) digest"
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
required: ["id"]
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const CertificateProperties = {
|
|
120
|
-
type: "object",
|
|
121
|
-
additionalProperties: false,
|
|
122
|
-
properties: {
|
|
123
|
-
id: { type: "string", title: "subject \u306E OP ID", format: "uri" },
|
|
124
|
-
type: { type: "string", const: "CertificateProperties" },
|
|
125
|
-
description: { type: "string", title: "\u8AAC\u660E" },
|
|
126
|
-
image: Image,
|
|
127
|
-
certifier: {
|
|
128
|
-
type: "string",
|
|
129
|
-
title: "\u8A8D\u8A3C\u6A5F\u95A2\u540D"
|
|
130
|
-
},
|
|
131
|
-
verifier: {
|
|
132
|
-
type: "string",
|
|
133
|
-
title: "\u691C\u8A3C\u6A5F\u95A2\u540D"
|
|
134
|
-
},
|
|
135
|
-
certificationSystem: CertificationSystem
|
|
136
|
-
},
|
|
137
|
-
required: ["id", "type", "certificationSystem"]
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
const OpCipContext = {
|
|
141
|
-
type: "array",
|
|
142
|
-
additionalItems: false,
|
|
143
|
-
minItems: 4,
|
|
144
|
-
items: [
|
|
145
|
-
{
|
|
146
|
-
type: "string",
|
|
147
|
-
const: "https://www.w3.org/ns/credentials/v2"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
type: "string",
|
|
151
|
-
const: "https://originator-profile.org/ns/credentials/v1"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
type: "string",
|
|
155
|
-
const: "https://originator-profile.org/ns/cip/v1"
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
type: "object",
|
|
159
|
-
properties: {
|
|
160
|
-
"@language": {
|
|
161
|
-
type: "string",
|
|
162
|
-
title: "\u8A00\u8A9E\u30B3\u30FC\u30C9"
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
required: ["@language"]
|
|
166
|
-
}
|
|
167
|
-
]
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
const Certificate = {
|
|
171
|
-
type: "object",
|
|
172
|
-
allOf: [
|
|
173
|
-
OpVc,
|
|
174
|
-
{
|
|
175
|
-
type: "object",
|
|
176
|
-
properties: {
|
|
177
|
-
"@context": OpCipContext,
|
|
178
|
-
type: {
|
|
179
|
-
type: "array",
|
|
180
|
-
additionalItems: false,
|
|
181
|
-
minItems: 1,
|
|
182
|
-
items: [{ const: "VerifiableCredential" }, { const: "Certificate" }]
|
|
183
|
-
},
|
|
184
|
-
issuer: { type: "string", format: "uri" },
|
|
185
|
-
validFrom: {
|
|
186
|
-
type: "string",
|
|
187
|
-
title: "\u6709\u52B9\u958B\u59CB\u65E5\u6642",
|
|
188
|
-
description: "http://www.w3.org/2001/XMLSchema#dateTime \u5F62\u5F0F\u306E\u6709\u52B9\u958B\u59CB\u65E5\u6642"
|
|
189
|
-
},
|
|
190
|
-
validUntil: {
|
|
191
|
-
type: "string",
|
|
192
|
-
title: "\u6709\u52B9\u7D42\u4E86\u65E5\u6642",
|
|
193
|
-
description: "http://www.w3.org/2001/XMLSchema#dateTime \u5F62\u5F0F\u306E\u6709\u52B9\u7D42\u4E86\u65E5\u6642"
|
|
194
|
-
},
|
|
195
|
-
credentialSubject: CertificateProperties
|
|
196
|
-
},
|
|
197
|
-
required: ["@context", "type", "issuer", "credentialSubject"]
|
|
198
|
-
}
|
|
199
|
-
]
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
const JapaneseExistenceCertificateProperties = {
|
|
203
|
-
type: "object",
|
|
204
|
-
properties: {
|
|
205
|
-
id: { type: "string", title: "subject \u306E OP ID", format: "uri" },
|
|
206
|
-
type: { type: "string", const: "ECJPProperties" },
|
|
207
|
-
name: {
|
|
208
|
-
title: "\u6CD5\u4EBA\u540D",
|
|
209
|
-
type: "string"
|
|
210
|
-
},
|
|
211
|
-
description: { type: "string", title: "\u8AAC\u660E" },
|
|
212
|
-
corporateNumber: {
|
|
213
|
-
title: "\u6CD5\u4EBA\u756A\u53F7",
|
|
214
|
-
type: "string"
|
|
215
|
-
},
|
|
216
|
-
postalCode: {
|
|
217
|
-
title: "\u90F5\u4FBF\u756A\u53F7",
|
|
218
|
-
type: "string"
|
|
219
|
-
},
|
|
220
|
-
addressCountry: {
|
|
221
|
-
title: "\u56FD",
|
|
222
|
-
type: "string"
|
|
223
|
-
},
|
|
224
|
-
addressRegion: {
|
|
225
|
-
title: "\u90FD\u9053\u5E9C\u770C",
|
|
226
|
-
type: "string"
|
|
227
|
-
},
|
|
228
|
-
addressLocality: {
|
|
229
|
-
title: "\u5E02\u533A\u753A\u6751",
|
|
230
|
-
type: "string"
|
|
231
|
-
},
|
|
232
|
-
streetAddress: {
|
|
233
|
-
title: "\u756A\u5730\u30FB\u30D3\u30EB\u540D",
|
|
234
|
-
type: "string"
|
|
235
|
-
},
|
|
236
|
-
certificationSystem: CertificationSystem
|
|
237
|
-
},
|
|
238
|
-
required: [
|
|
239
|
-
"id",
|
|
240
|
-
"type",
|
|
241
|
-
"name",
|
|
242
|
-
"corporateNumber",
|
|
243
|
-
"postalCode",
|
|
244
|
-
"addressCountry",
|
|
245
|
-
"addressRegion",
|
|
246
|
-
"addressLocality",
|
|
247
|
-
"streetAddress",
|
|
248
|
-
"certificationSystem"
|
|
249
|
-
]
|
|
250
|
-
};
|
|
251
|
-
const JapaneseExistenceCertificate = {
|
|
252
|
-
allOf: [
|
|
253
|
-
OpVc,
|
|
254
|
-
{
|
|
255
|
-
type: "object",
|
|
256
|
-
properties: {
|
|
257
|
-
"@context": OpCipContext,
|
|
258
|
-
type: {
|
|
259
|
-
type: "array",
|
|
260
|
-
additionalItems: false,
|
|
261
|
-
minItems: 1,
|
|
262
|
-
items: [{ const: "VerifiableCredential" }, { const: "Certificate" }]
|
|
263
|
-
},
|
|
264
|
-
issuer: { type: "string", format: "uri" },
|
|
265
|
-
credentialSubject: JapaneseExistenceCertificateProperties,
|
|
266
|
-
validFrom: {
|
|
267
|
-
type: "string",
|
|
268
|
-
title: "\u6709\u52B9\u958B\u59CB\u65E5\u6642",
|
|
269
|
-
description: "http://www.w3.org/2001/XMLSchema#dateTime \u5F62\u5F0F\u306E\u6709\u52B9\u958B\u59CB\u65E5\u6642"
|
|
270
|
-
},
|
|
271
|
-
validUntil: {
|
|
272
|
-
type: "string",
|
|
273
|
-
title: "\u6709\u52B9\u7D42\u4E86\u65E5\u6642",
|
|
274
|
-
description: "http://www.w3.org/2001/XMLSchema#dateTime \u5F62\u5F0F\u306E\u6709\u52B9\u7D42\u4E86\u65E5\u6642"
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
required: ["@context", "type", "issuer", "credentialSubject"]
|
|
278
|
-
}
|
|
279
|
-
]
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
const BasicTarget = {
|
|
283
|
-
title: "Basic Target",
|
|
284
|
-
type: "object",
|
|
285
|
-
additionalProperties: true,
|
|
286
|
-
properties: {
|
|
287
|
-
type: {
|
|
288
|
-
type: "string",
|
|
289
|
-
enum: [
|
|
290
|
-
"TextTargetIntegrity",
|
|
291
|
-
"VisibleTextTargetIntegrity",
|
|
292
|
-
"HtmlTargetIntegrity"
|
|
293
|
-
]
|
|
294
|
-
},
|
|
295
|
-
integrity: {
|
|
296
|
-
type: "string",
|
|
297
|
-
description: "\u30CF\u30C3\u30B7\u30E5\u5024\u306E\u5F62\u5F0F\u306F Subresource Integrity \u30BB\u30AF\u30B7\u30E7\u30F3 3.1 \u306E Integrity metadata \u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093 (MUST)\u3002"
|
|
298
|
-
},
|
|
299
|
-
cssSelector: {
|
|
300
|
-
type: "string",
|
|
301
|
-
description: "CSS \u30BB\u30EC\u30AF\u30BF\u30FC"
|
|
302
|
-
}
|
|
303
|
-
},
|
|
304
|
-
required: ["type", "integrity", "cssSelector"]
|
|
305
|
-
};
|
|
306
|
-
|
|
307
|
-
const ExternalResourceTarget = {
|
|
308
|
-
title: "External Resource Target",
|
|
309
|
-
type: "object",
|
|
310
|
-
additionalProperties: true,
|
|
311
|
-
properties: {
|
|
312
|
-
type: {
|
|
313
|
-
type: "string",
|
|
314
|
-
const: "ExternalResourceTargetIntegrity"
|
|
315
|
-
},
|
|
316
|
-
integrity: {
|
|
317
|
-
type: "string",
|
|
318
|
-
description: "\u30CF\u30C3\u30B7\u30E5\u5024\u306E\u5F62\u5F0F\u306F Subresource Integrity \u30BB\u30AF\u30B7\u30E7\u30F3 3.1 \u306E Integrity metadata \u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093 (MUST)\u3002"
|
|
319
|
-
}
|
|
320
|
-
},
|
|
321
|
-
required: ["type", "integrity"]
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
const RawTarget = {
|
|
325
|
-
type: "object",
|
|
326
|
-
description: "\u672A\u52A0\u5DE5\u306E\u30BF\u30FC\u30B2\u30C3\u30C8",
|
|
327
|
-
properties: {
|
|
328
|
-
type: {
|
|
329
|
-
type: "string",
|
|
330
|
-
description: "Target Integrity\u306E\u7A2E\u5225 (e.g., TextTargetIntegrity)",
|
|
331
|
-
enum: [
|
|
332
|
-
"TextTargetIntegrity",
|
|
333
|
-
"VisibleTextTargetIntegrity",
|
|
334
|
-
"HtmlTargetIntegrity",
|
|
335
|
-
"ExternalResourceTargetIntegrity"
|
|
336
|
-
]
|
|
337
|
-
},
|
|
338
|
-
content: {
|
|
339
|
-
anyOf: [
|
|
340
|
-
{
|
|
341
|
-
type: "array",
|
|
342
|
-
items: {
|
|
343
|
-
type: "string",
|
|
344
|
-
description: "\u30B3\u30F3\u30C6\u30F3\u30C4\u672C\u4F53 (text/html or URL)"
|
|
345
|
-
}
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
type: "string",
|
|
349
|
-
description: "\u30B3\u30F3\u30C6\u30F3\u30C4\u672C\u4F53 (text/html or URL)"
|
|
350
|
-
}
|
|
351
|
-
]
|
|
352
|
-
},
|
|
353
|
-
cssSelector: {
|
|
354
|
-
type: "string",
|
|
355
|
-
description: "CSS \u30BB\u30EC\u30AF\u30BF\u30FC (optional)"
|
|
356
|
-
}
|
|
357
|
-
},
|
|
358
|
-
required: ["type"],
|
|
359
|
-
additionalProperties: true
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
const Target = {
|
|
363
|
-
title: "Target",
|
|
364
|
-
oneOf: [BasicTarget, ExternalResourceTarget]
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
const subject$5 = {
|
|
368
|
-
type: "object",
|
|
369
|
-
additionalProperties: true,
|
|
370
|
-
properties: {
|
|
371
|
-
id: {
|
|
372
|
-
title: "CA ID",
|
|
373
|
-
type: "string",
|
|
374
|
-
format: "uri"
|
|
375
|
-
},
|
|
376
|
-
type: {
|
|
377
|
-
title: "JSON-LD \u30BF\u30A4\u30D7",
|
|
378
|
-
type: "string"
|
|
379
|
-
}
|
|
380
|
-
},
|
|
381
|
-
required: ["id", "type"]
|
|
382
|
-
};
|
|
383
|
-
const ContentAttestation = {
|
|
384
|
-
type: "object",
|
|
385
|
-
additionalProperties: true,
|
|
386
|
-
allOf: [
|
|
387
|
-
OpVc,
|
|
388
|
-
{
|
|
389
|
-
type: "object",
|
|
390
|
-
additionalProperties: true,
|
|
391
|
-
properties: {
|
|
392
|
-
"@context": OpContextHead,
|
|
393
|
-
type: {
|
|
394
|
-
type: "array",
|
|
395
|
-
contains: {
|
|
396
|
-
const: "ContentAttestation"
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
credentialSubject: subject$5,
|
|
400
|
-
allowedUrl: AllowedUrl,
|
|
401
|
-
allowedOrigin: AllowedOrigin,
|
|
402
|
-
target: {
|
|
403
|
-
type: "array",
|
|
404
|
-
items: Target,
|
|
405
|
-
minItems: 1
|
|
406
|
-
}
|
|
407
|
-
},
|
|
408
|
-
required: ["@context", "type", "credentialSubject", "target"]
|
|
409
|
-
}
|
|
410
|
-
]
|
|
411
|
-
};
|
|
412
|
-
|
|
413
|
-
const Page = {
|
|
414
|
-
title: "\u30DA\u30FC\u30B8",
|
|
415
|
-
type: "object",
|
|
416
|
-
properties: {
|
|
417
|
-
id: { title: "\u30DA\u30FC\u30B8 URL", type: "string", format: "uri" },
|
|
418
|
-
name: { title: "\u30DA\u30FC\u30B8\u8868\u793A\u540D", type: "string" }
|
|
419
|
-
},
|
|
420
|
-
required: ["id", "name"]
|
|
421
|
-
};
|
|
422
|
-
|
|
423
|
-
const subject$4 = {
|
|
424
|
-
type: "object",
|
|
425
|
-
additionalProperties: false,
|
|
426
|
-
properties: {
|
|
427
|
-
id: {
|
|
428
|
-
type: "string",
|
|
429
|
-
format: "uri",
|
|
430
|
-
description: "CA ID"
|
|
431
|
-
},
|
|
432
|
-
type: {
|
|
433
|
-
type: "string",
|
|
434
|
-
const: "Article"
|
|
435
|
-
},
|
|
436
|
-
headline: {
|
|
437
|
-
type: "string",
|
|
438
|
-
description: "\u30B3\u30F3\u30C6\u30F3\u30C4\u306E\u30BF\u30A4\u30C8\u30EB\u3002"
|
|
439
|
-
},
|
|
440
|
-
description: {
|
|
441
|
-
type: "string",
|
|
442
|
-
description: "\u30B3\u30F3\u30C6\u30F3\u30C4\u306E\u8AAC\u660E\uFF08\u6587\u5B57\u5217\uFF09\u3002"
|
|
443
|
-
},
|
|
444
|
-
image: Image,
|
|
445
|
-
datePublished: {
|
|
446
|
-
title: "\u516C\u958B\u65E5\u6642",
|
|
447
|
-
type: "string",
|
|
448
|
-
description: "http://www.w3.org/2001/XMLSchema#dateTime \u5F62\u5F0F\u306E\u516C\u958B\u65E5\u6642"
|
|
449
|
-
},
|
|
450
|
-
dateModified: {
|
|
451
|
-
title: "\u6700\u7D42\u66F4\u65B0\u65E5\u6642",
|
|
452
|
-
type: "string",
|
|
453
|
-
description: "http://www.w3.org/2001/XMLSchema#dateTime \u5F62\u5F0F\u306E\u6700\u7D42\u66F4\u65B0\u65E5\u6642"
|
|
454
|
-
},
|
|
455
|
-
author: {
|
|
456
|
-
title: "\u8457\u8005\u540D",
|
|
457
|
-
type: "array",
|
|
458
|
-
items: {
|
|
459
|
-
type: "string"
|
|
460
|
-
}
|
|
461
|
-
},
|
|
462
|
-
editor: {
|
|
463
|
-
title: "\u7DE8\u96C6\u8005\u540D",
|
|
464
|
-
type: "array",
|
|
465
|
-
items: {
|
|
466
|
-
type: "string"
|
|
467
|
-
}
|
|
468
|
-
},
|
|
469
|
-
genre: {
|
|
470
|
-
title: "\u30B8\u30E3\u30F3\u30EB",
|
|
471
|
-
type: "string"
|
|
472
|
-
}
|
|
473
|
-
},
|
|
474
|
-
required: ["id", "type", "headline", "description"]
|
|
475
|
-
};
|
|
476
|
-
const ArticleCA = {
|
|
477
|
-
type: "object",
|
|
478
|
-
additionalProperties: true,
|
|
479
|
-
allOf: [
|
|
480
|
-
ContentAttestation,
|
|
481
|
-
{
|
|
482
|
-
type: "object",
|
|
483
|
-
additionalProperties: true,
|
|
484
|
-
properties: {
|
|
485
|
-
"@context": OpCipContext,
|
|
486
|
-
credentialSubject: subject$4,
|
|
487
|
-
allowedUrl: AllowedUrl
|
|
488
|
-
},
|
|
489
|
-
required: ["@context", "type", "credentialSubject", "allowedUrl"]
|
|
490
|
-
}
|
|
491
|
-
],
|
|
492
|
-
not: {
|
|
493
|
-
properties: {
|
|
494
|
-
allowedOrigin: {}
|
|
495
|
-
},
|
|
496
|
-
required: ["allowedOrigin"]
|
|
3
|
+
var zod = require('zod');
|
|
4
|
+
var websri = require('websri');
|
|
5
|
+
|
|
6
|
+
function isValidOrigin(val) {
|
|
7
|
+
try {
|
|
8
|
+
return new URL(val).origin === val;
|
|
9
|
+
} catch {
|
|
10
|
+
return false;
|
|
497
11
|
}
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
}
|
|
513
|
-
},
|
|
514
|
-
required: ["id", "type"]
|
|
515
|
-
};
|
|
516
|
-
const UnsignedContentAttestation = {
|
|
517
|
-
type: "object",
|
|
518
|
-
additionalProperties: true,
|
|
519
|
-
allOf: [
|
|
520
|
-
OpVc,
|
|
521
|
-
{
|
|
522
|
-
type: "object",
|
|
523
|
-
additionalProperties: true,
|
|
524
|
-
properties: {
|
|
525
|
-
"@context": OpContextHead,
|
|
526
|
-
type: {
|
|
527
|
-
type: "array",
|
|
528
|
-
contains: {
|
|
529
|
-
const: "ContentAttestation"
|
|
530
|
-
}
|
|
531
|
-
},
|
|
532
|
-
credentialSubject: subject$3,
|
|
533
|
-
allowedUrl: AllowedUrl,
|
|
534
|
-
allowedOrigin: AllowedOrigin,
|
|
535
|
-
target: {
|
|
536
|
-
type: "array",
|
|
537
|
-
items: RawTarget,
|
|
538
|
-
minItems: 1
|
|
539
|
-
}
|
|
540
|
-
},
|
|
541
|
-
required: ["@context", "type", "credentialSubject", "target"]
|
|
542
|
-
}
|
|
543
|
-
]
|
|
544
|
-
};
|
|
545
|
-
|
|
546
|
-
const subject$2 = {
|
|
547
|
-
type: "object",
|
|
548
|
-
additionalProperties: false,
|
|
549
|
-
properties: {
|
|
550
|
-
id: {
|
|
551
|
-
type: "string",
|
|
552
|
-
format: "uri",
|
|
553
|
-
description: "CA ID"
|
|
554
|
-
},
|
|
555
|
-
type: {
|
|
556
|
-
type: "string",
|
|
557
|
-
const: "Advertorial"
|
|
558
|
-
},
|
|
559
|
-
headline: {
|
|
560
|
-
type: "string",
|
|
561
|
-
description: "\u8A18\u4E8B\u5E83\u544A\u306E\u30BF\u30A4\u30C8\u30EB\u3002"
|
|
562
|
-
},
|
|
563
|
-
description: {
|
|
564
|
-
type: "string",
|
|
565
|
-
description: "\u8A18\u4E8B\u5E83\u544A\u306E\u8AAC\u660E\uFF08\u6587\u5B57\u5217\uFF09\u3002"
|
|
566
|
-
},
|
|
567
|
-
image: Image,
|
|
568
|
-
datePublished: {
|
|
569
|
-
title: "\u516C\u958B\u65E5\u6642",
|
|
570
|
-
type: "string",
|
|
571
|
-
description: "http://www.w3.org/2001/XMLSchema#dateTime \u5F62\u5F0F\u306E\u516C\u958B\u65E5\u6642"
|
|
572
|
-
},
|
|
573
|
-
dateModified: {
|
|
574
|
-
title: "\u6700\u7D42\u66F4\u65B0\u65E5\u6642",
|
|
575
|
-
type: "string",
|
|
576
|
-
description: "http://www.w3.org/2001/XMLSchema#dateTime \u5F62\u5F0F\u306E\u6700\u7D42\u66F4\u65B0\u65E5\u6642"
|
|
577
|
-
},
|
|
578
|
-
author: {
|
|
579
|
-
title: "\u8457\u8005\u540D",
|
|
580
|
-
type: "array",
|
|
581
|
-
items: {
|
|
582
|
-
type: "string"
|
|
583
|
-
}
|
|
584
|
-
},
|
|
585
|
-
editor: {
|
|
586
|
-
title: "\u7DE8\u96C6\u8005\u540D",
|
|
587
|
-
type: "array",
|
|
588
|
-
items: {
|
|
589
|
-
type: "string"
|
|
590
|
-
}
|
|
591
|
-
},
|
|
592
|
-
sponsor: {
|
|
593
|
-
title: "\u30B9\u30DD\u30F3\u30B5\u30FC\u540D",
|
|
594
|
-
type: "array",
|
|
595
|
-
items: {
|
|
596
|
-
type: "string"
|
|
597
|
-
}
|
|
598
|
-
},
|
|
599
|
-
genre: {
|
|
600
|
-
title: "\u30B8\u30E3\u30F3\u30EB",
|
|
601
|
-
type: "string"
|
|
602
|
-
}
|
|
603
|
-
},
|
|
604
|
-
required: ["id", "type", "headline", "description"]
|
|
605
|
-
};
|
|
606
|
-
const AdvertorialCA = {
|
|
607
|
-
type: "object",
|
|
608
|
-
additionalProperties: true,
|
|
609
|
-
allOf: [
|
|
610
|
-
ContentAttestation,
|
|
611
|
-
{
|
|
612
|
-
type: "object",
|
|
613
|
-
additionalProperties: true,
|
|
614
|
-
properties: {
|
|
615
|
-
"@context": OpCipContext,
|
|
616
|
-
credentialSubject: subject$2,
|
|
617
|
-
allowedUrl: AllowedUrl
|
|
618
|
-
},
|
|
619
|
-
required: ["@context", "type", "credentialSubject", "allowedUrl"]
|
|
620
|
-
}
|
|
621
|
-
],
|
|
622
|
-
not: {
|
|
623
|
-
properties: {
|
|
624
|
-
allowedOrigin: {}
|
|
625
|
-
},
|
|
626
|
-
required: ["allowedOrigin"]
|
|
627
|
-
}
|
|
628
|
-
};
|
|
629
|
-
|
|
630
|
-
const ContentAttestationSetItem = {
|
|
631
|
-
title: "Content Attestation Set Item",
|
|
632
|
-
oneOf: [
|
|
633
|
-
{
|
|
634
|
-
type: "object",
|
|
635
|
-
additionalProperties: true,
|
|
636
|
-
properties: {
|
|
637
|
-
main: {
|
|
638
|
-
type: "boolean",
|
|
639
|
-
const: true,
|
|
640
|
-
title: "\u30E1\u30A4\u30F3\u30B3\u30F3\u30C6\u30F3\u30C4"
|
|
641
|
-
},
|
|
642
|
-
attestation: {
|
|
643
|
-
title: "Content Attestation",
|
|
644
|
-
type: "string"
|
|
645
|
-
}
|
|
646
|
-
},
|
|
647
|
-
required: ["attestation", "main"]
|
|
648
|
-
},
|
|
649
|
-
{
|
|
650
|
-
type: "string",
|
|
651
|
-
title: "Content Attestation"
|
|
652
|
-
}
|
|
653
|
-
]
|
|
654
|
-
};
|
|
655
|
-
const ContentAttestationSet = {
|
|
656
|
-
title: "Content Attestation Set",
|
|
657
|
-
type: "array",
|
|
658
|
-
items: ContentAttestationSetItem
|
|
659
|
-
};
|
|
660
|
-
|
|
661
|
-
const Jwk = {
|
|
662
|
-
title: "JSON Web Key",
|
|
663
|
-
type: "object",
|
|
664
|
-
properties: {
|
|
665
|
-
kty: {
|
|
666
|
-
type: "string"
|
|
667
|
-
},
|
|
668
|
-
use: {
|
|
669
|
-
type: "string"
|
|
670
|
-
},
|
|
671
|
-
key_ops: {
|
|
672
|
-
type: "array",
|
|
673
|
-
items: { type: "string" }
|
|
674
|
-
},
|
|
675
|
-
alg: {
|
|
676
|
-
type: "string"
|
|
677
|
-
},
|
|
678
|
-
kid: {
|
|
679
|
-
type: "string"
|
|
680
|
-
},
|
|
681
|
-
x5u: {
|
|
682
|
-
type: "string"
|
|
683
|
-
},
|
|
684
|
-
x5c: {
|
|
685
|
-
type: "array",
|
|
686
|
-
items: {
|
|
687
|
-
type: "string"
|
|
688
|
-
}
|
|
689
|
-
},
|
|
690
|
-
x5t: {
|
|
691
|
-
type: "string"
|
|
692
|
-
},
|
|
693
|
-
"x5t#S256": {
|
|
694
|
-
type: "string"
|
|
695
|
-
}
|
|
696
|
-
},
|
|
697
|
-
required: ["kty", "kid"],
|
|
698
|
-
additionalProperties: true
|
|
699
|
-
};
|
|
700
|
-
|
|
701
|
-
const Jwks = {
|
|
702
|
-
title: "JSON Web Key Set",
|
|
703
|
-
description: "JSON Web Key Set (JWK Set)",
|
|
704
|
-
type: "object",
|
|
705
|
-
properties: {
|
|
706
|
-
keys: {
|
|
707
|
-
title: Jwk.title,
|
|
708
|
-
type: "array",
|
|
709
|
-
items: Jwk
|
|
710
|
-
}
|
|
711
|
-
},
|
|
712
|
-
required: ["keys"],
|
|
713
|
-
additionalProperties: true
|
|
714
|
-
};
|
|
715
|
-
|
|
716
|
-
const CpContext = {
|
|
717
|
-
type: "array",
|
|
718
|
-
additionalItems: false,
|
|
719
|
-
minItems: 2,
|
|
720
|
-
items: [
|
|
721
|
-
{
|
|
722
|
-
const: "https://www.w3.org/ns/credentials/v2"
|
|
723
|
-
},
|
|
724
|
-
{
|
|
725
|
-
const: "https://originator-profile.org/ns/credentials/v1"
|
|
726
|
-
}
|
|
727
|
-
]
|
|
728
|
-
};
|
|
729
|
-
|
|
730
|
-
const CoreProfile = {
|
|
731
|
-
type: "object",
|
|
732
|
-
additionalProperties: false,
|
|
733
|
-
properties: {
|
|
734
|
-
...OpVc.properties,
|
|
735
|
-
"@context": CpContext,
|
|
736
|
-
type: {
|
|
737
|
-
type: "array",
|
|
738
|
-
additionalItems: false,
|
|
739
|
-
minItems: 2,
|
|
740
|
-
items: [{ const: "VerifiableCredential" }, { const: "CoreProfile" }]
|
|
741
|
-
},
|
|
742
|
-
issuer: { type: "string" },
|
|
743
|
-
credentialSubject: {
|
|
744
|
-
type: "object",
|
|
745
|
-
additionalProperties: false,
|
|
746
|
-
properties: {
|
|
747
|
-
id: { type: "string", format: "uri" },
|
|
748
|
-
type: {
|
|
749
|
-
const: "Core"
|
|
750
|
-
},
|
|
751
|
-
jwks: {
|
|
752
|
-
...Jwks,
|
|
753
|
-
title: "\u4FDD\u6709\u7D44\u7E54\u306E\u516C\u958B\u9375\u306E JSON Web Key Set"
|
|
754
|
-
}
|
|
755
|
-
},
|
|
756
|
-
required: ["id", "type", "jwks"]
|
|
757
|
-
}
|
|
758
|
-
},
|
|
759
|
-
required: ["@context", "type", "issuer", "credentialSubject"]
|
|
760
|
-
};
|
|
761
|
-
|
|
762
|
-
const Advertisement = {
|
|
763
|
-
deprecated: true,
|
|
764
|
-
title: "Advertisement",
|
|
765
|
-
description: "Advertisement",
|
|
766
|
-
type: "object",
|
|
767
|
-
properties: {
|
|
768
|
-
type: { const: "advertisement" },
|
|
769
|
-
url: {
|
|
770
|
-
title: "Published URL",
|
|
771
|
-
type: "string",
|
|
772
|
-
description: "\u63B2\u8F09\u5148 URL"
|
|
773
|
-
},
|
|
774
|
-
title: { title: "Title", type: "string" },
|
|
775
|
-
description: { title: "Description", type: "string" },
|
|
776
|
-
image: {
|
|
777
|
-
title: "Image URL",
|
|
778
|
-
type: "string",
|
|
779
|
-
description: "\u5E83\u544A\u306E\u30B5\u30E0\u30CD\u30A4\u30EB\u8868\u793A\u7528 URL"
|
|
780
|
-
}
|
|
781
|
-
},
|
|
782
|
-
required: ["type"]
|
|
783
|
-
};
|
|
784
|
-
|
|
785
|
-
const DpUrl = {
|
|
786
|
-
title: "URL",
|
|
787
|
-
description: "\u5BFE\u8C61\u306E\u8981\u7D20\u304C\u5B58\u5728\u3059\u308B\u30DA\u30FC\u30B8\u306E URL",
|
|
788
|
-
type: "string"
|
|
789
|
-
};
|
|
790
|
-
|
|
791
|
-
const DpLocation = {
|
|
792
|
-
deprecated: true,
|
|
793
|
-
title: "Location",
|
|
794
|
-
description: "\u5BFE\u8C61\u306E\u8981\u7D20\u306E\u5834\u6240\u3092\u7279\u5B9A\u3059\u308B CSS \u30BB\u30EC\u30AF\u30BF\u30FC",
|
|
795
|
-
type: "string"
|
|
796
|
-
};
|
|
797
|
-
|
|
798
|
-
const DpProof = {
|
|
799
|
-
title: "Proof",
|
|
800
|
-
description: "\u5BFE\u8C61\u306E\u30C6\u30AD\u30B9\u30C8\u3078\u306E\u7F72\u540D",
|
|
801
|
-
type: "object",
|
|
802
|
-
properties: {
|
|
803
|
-
jws: {
|
|
804
|
-
title: "Detached JSON Web Signature",
|
|
805
|
-
type: "string"
|
|
806
|
-
}
|
|
807
|
-
},
|
|
808
|
-
required: ["jws"],
|
|
809
|
-
additionalProperties: false
|
|
810
|
-
};
|
|
811
|
-
|
|
812
|
-
const DpVisibleText = {
|
|
813
|
-
title: "Document Profile Visible Text",
|
|
814
|
-
description: "\u5BFE\u8C61\u306E\u8981\u7D20\u306E\u305D\u306E\u5B50\u5B6B\u306E\u30EC\u30F3\u30C0\u30EA\u30F3\u30B0\u3055\u308C\u305F\u30C6\u30AD\u30B9\u30C8\u3068\u305D\u306E\u30C6\u30AD\u30B9\u30C8\u3078\u306E\u7F72\u540D",
|
|
815
|
-
type: "object",
|
|
816
|
-
properties: {
|
|
817
|
-
type: { const: "visibleText" },
|
|
818
|
-
url: DpUrl,
|
|
819
|
-
location: DpLocation,
|
|
820
|
-
proof: DpProof
|
|
821
|
-
},
|
|
822
|
-
required: ["type", "proof"],
|
|
823
|
-
additionalProperties: false
|
|
824
|
-
};
|
|
825
|
-
|
|
826
|
-
const DpText = {
|
|
827
|
-
title: "Document Profile Text",
|
|
828
|
-
description: "\u5BFE\u8C61\u306E\u8981\u7D20\u306E\u5B50\u5B6B\u306E\u30C6\u30AD\u30B9\u30C8\u3068\u305D\u306E\u30C6\u30AD\u30B9\u30C8\u3078\u306E\u7F72\u540D",
|
|
829
|
-
type: "object",
|
|
830
|
-
properties: {
|
|
831
|
-
type: { const: "text" },
|
|
832
|
-
url: DpUrl,
|
|
833
|
-
location: DpLocation,
|
|
834
|
-
proof: DpProof
|
|
835
|
-
},
|
|
836
|
-
required: ["type", "proof"],
|
|
837
|
-
additionalProperties: false
|
|
838
|
-
};
|
|
839
|
-
|
|
840
|
-
const DpHtml = {
|
|
841
|
-
title: "Document Profile HTML",
|
|
842
|
-
description: "\u5BFE\u8C61\u306E\u8981\u7D20\u3068\u305D\u306E\u5B50\u5B6B\u3092\u542B\u3080\u90E8\u5206\u306E HTML \u3068\u305D\u306E HTML \u3078\u306E\u7F72\u540D",
|
|
843
|
-
type: "object",
|
|
844
|
-
properties: {
|
|
845
|
-
type: { const: "html" },
|
|
846
|
-
url: DpUrl,
|
|
847
|
-
location: DpLocation,
|
|
848
|
-
proof: DpProof
|
|
849
|
-
},
|
|
850
|
-
required: ["type", "proof"],
|
|
851
|
-
additionalProperties: false
|
|
852
|
-
};
|
|
853
|
-
|
|
854
|
-
const OgWebsite = {
|
|
855
|
-
deprecated: true,
|
|
856
|
-
title: "Website",
|
|
857
|
-
description: "Website",
|
|
858
|
-
type: "object",
|
|
859
|
-
properties: {
|
|
860
|
-
type: { const: "website" },
|
|
861
|
-
url: { title: "URL", type: "string" },
|
|
862
|
-
title: { title: "Title", type: "string" },
|
|
863
|
-
image: { title: "Image URL", type: "string" },
|
|
864
|
-
description: { title: "Description", type: "string" },
|
|
865
|
-
"https://schema.org/author": { title: "Author", type: "string" },
|
|
866
|
-
"https://schema.org/editor": { title: "Editor", type: "string" },
|
|
867
|
-
"https://schema.org/datePublished": {
|
|
868
|
-
title: "DatePublished",
|
|
869
|
-
type: "string",
|
|
870
|
-
format: "date-time"
|
|
871
|
-
},
|
|
872
|
-
"https://schema.org/dateModified": {
|
|
873
|
-
title: "DateModified",
|
|
874
|
-
type: "string",
|
|
875
|
-
format: "date-time"
|
|
876
|
-
}
|
|
877
|
-
},
|
|
878
|
-
required: ["type"]
|
|
879
|
-
};
|
|
880
|
-
|
|
881
|
-
const DpItem = {
|
|
882
|
-
title: "Document Profile Item",
|
|
883
|
-
anyOf: [DpVisibleText, DpText, DpHtml, OgWebsite, Advertisement]
|
|
884
|
-
};
|
|
885
|
-
|
|
886
|
-
const DpAllowedOrigins = {
|
|
887
|
-
title: "Allowed Origins",
|
|
888
|
-
description: "\u5229\u7528\u53EF\u80FD\u306A\u30AA\u30EA\u30B8\u30F3\u306E\u30EA\u30B9\u30C8",
|
|
889
|
-
type: "array",
|
|
890
|
-
items: {
|
|
891
|
-
title: "Allowed Origin",
|
|
892
|
-
description: "\u5229\u7528\u53EF\u80FD\u306A\u30AA\u30EA\u30B8\u30F3",
|
|
893
|
-
type: "string"
|
|
12
|
+
}
|
|
13
|
+
const Item$1 = zod.z.stringFormat("origin", isValidOrigin, {
|
|
14
|
+
error: "Origin MUST be in the format scheme://host[:port] (do not include a trailing slash or path. e.g. https://example.com)"
|
|
15
|
+
});
|
|
16
|
+
const AllowedOrigin = zod.z.union([Item$1, zod.z.array(Item$1).min(1)]).describe(
|
|
17
|
+
"@deprecated allowedOrigin is deprecated in Content Attestation. Use allowedUrl instead. Supported until September 2026.\n\nThe [origin](https://www.rfc-editor.org/rfc/rfc6454#section-7) of the information being asserted."
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
function isValidUrlPattern(val) {
|
|
21
|
+
try {
|
|
22
|
+
new URLPattern(val);
|
|
23
|
+
return true;
|
|
24
|
+
} catch {
|
|
25
|
+
return false;
|
|
894
26
|
}
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
description: "[RFC 7519 Section 4.1.1](https://www.rfc-editor.org/rfc/rfc7519#section-4.1.1)",
|
|
940
|
-
type: "string"
|
|
941
|
-
},
|
|
942
|
-
sub: {
|
|
943
|
-
title: "JWT Subject",
|
|
944
|
-
description: "[RFC 7519 Section 4.1.2](https://www.rfc-editor.org/rfc/rfc7519#section-4.1.2)",
|
|
945
|
-
type: "string"
|
|
946
|
-
},
|
|
947
|
-
exp: {
|
|
948
|
-
title: "JWT Expiration Time",
|
|
949
|
-
description: "[RFC 7519 Section 4.1.4](https://www.rfc-editor.org/rfc/rfc7519#section-4.1.4)",
|
|
950
|
-
type: "number"
|
|
951
|
-
},
|
|
952
|
-
iat: {
|
|
953
|
-
title: "JWT Issued At",
|
|
954
|
-
description: "[RFC 7519 Section 4.1.6](https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6)",
|
|
955
|
-
type: "number"
|
|
956
|
-
},
|
|
957
|
-
"https://originator-profile.org/dp": {
|
|
958
|
-
type: "object",
|
|
959
|
-
properties: {
|
|
960
|
-
item: { type: "array", items: DpItem },
|
|
961
|
-
allowedOrigins: DpAllowedOrigins
|
|
962
|
-
},
|
|
963
|
-
required: ["item"],
|
|
964
|
-
additionalProperties: false
|
|
965
|
-
}
|
|
966
|
-
},
|
|
967
|
-
required: ["iss", "sub", "exp", "iat", "https://originator-profile.org/dp"],
|
|
968
|
-
additionalProperties: false
|
|
969
|
-
};
|
|
970
|
-
|
|
971
|
-
const BusinessCategory = {
|
|
972
|
-
title: "Business Category",
|
|
973
|
-
type: "array",
|
|
974
|
-
items: {
|
|
975
|
-
title: "\u4E8B\u696D\u7A2E\u76EE",
|
|
976
|
-
type: "string"
|
|
27
|
+
}
|
|
28
|
+
const Item = zod.z.stringFormat("url-pattern", isValidUrlPattern, {
|
|
29
|
+
error: "Invalid URL Pattern string (* alone is not allowed. Specify a URL Pattern string such as https://example.com/*)"
|
|
30
|
+
});
|
|
31
|
+
const AllowedUrl = zod.z.union([Item, zod.z.array(Item).min(1)]).describe(
|
|
32
|
+
"The URL for which information is asserted by this Content Attestation. The string MUST be a URL Pattern string. It MUST NOT be an empty array."
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const CertificationSystem = zod.z.object({
|
|
36
|
+
id: zod.z.url().describe("Certification system ID"),
|
|
37
|
+
type: zod.z.literal("CertificationSystem"),
|
|
38
|
+
name: zod.z.string().describe("Name of the certification system"),
|
|
39
|
+
description: zod.z.string().optional().describe("Description"),
|
|
40
|
+
ref: zod.z.url().optional().describe(
|
|
41
|
+
"A URL for people to read to find out more about the certification system."
|
|
42
|
+
)
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const OpCipContext = zod.z.tuple([
|
|
46
|
+
zod.z.literal("https://www.w3.org/ns/credentials/v2"),
|
|
47
|
+
zod.z.literal("https://originator-profile.org/ns/credentials/v1"),
|
|
48
|
+
zod.z.literal("https://originator-profile.org/ns/cip/v1"),
|
|
49
|
+
zod.z.object({
|
|
50
|
+
"@language": zod.z.string().describe("Language code")
|
|
51
|
+
})
|
|
52
|
+
]);
|
|
53
|
+
|
|
54
|
+
const DNS_URI_PATTERN = /^dns:([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
|
|
55
|
+
const OpId = zod.z.string().regex(DNS_URI_PATTERN, {
|
|
56
|
+
error: "Invalid OP ID: must be dns:<valid-domain>"
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const SubresourceIntegrity = zod.z.stringFormat(
|
|
60
|
+
"sri",
|
|
61
|
+
(val) => {
|
|
62
|
+
try {
|
|
63
|
+
const integrity = new websri.IntegrityMetadataSet(val);
|
|
64
|
+
return integrity.size > 0 && [...integrity].every((m) => m.alg in websri.supportedHashAlgorithms);
|
|
65
|
+
} catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
error: "Must be in the format sha256-<base64>, sha384-<base64>, or sha512-<base64>."
|
|
977
71
|
}
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
const
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
72
|
+
).describe("Subresource Integrity (SRI) string");
|
|
73
|
+
|
|
74
|
+
const RawImage = zod.z.object({
|
|
75
|
+
id: zod.z.url(),
|
|
76
|
+
content: zod.z.union([zod.z.string(), zod.z.array(zod.z.string())]).describe("Transient content for digestSRI auto-calculation")
|
|
77
|
+
});
|
|
78
|
+
const Image = zod.z.object({
|
|
79
|
+
id: zod.z.url(),
|
|
80
|
+
digestSRI: SubresourceIntegrity.optional()
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const CertificateProperties = zod.z.object({
|
|
84
|
+
id: OpId.describe("OP ID of the subject"),
|
|
85
|
+
type: zod.z.literal("CertificateProperties"),
|
|
86
|
+
description: zod.z.string().optional().describe("Description"),
|
|
87
|
+
image: Image.optional(),
|
|
88
|
+
certifier: zod.z.string().optional().describe("Name of the certification authority"),
|
|
89
|
+
verifier: zod.z.string().optional().describe("Name of the verification authority"),
|
|
90
|
+
certificationSystem: CertificationSystem
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const Certificate = zod.z.object({
|
|
94
|
+
"@context": OpCipContext,
|
|
95
|
+
type: zod.z.tuple([zod.z.literal("VerifiableCredential"), zod.z.literal("Certificate")]),
|
|
96
|
+
issuer: OpId,
|
|
97
|
+
validFrom: zod.z.string().datetime().optional().describe("Validity period start date"),
|
|
98
|
+
validUntil: zod.z.string().datetime().optional().describe("Validity period end date"),
|
|
99
|
+
credentialSubject: CertificateProperties
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const JapaneseExistenceCertificateProperties = zod.z.object({
|
|
103
|
+
id: OpId.describe("OP ID of the subject"),
|
|
104
|
+
type: zod.z.literal("JP-OrganizationExistenceCertificate"),
|
|
105
|
+
name: zod.z.string().describe("PA name"),
|
|
106
|
+
description: zod.z.string().optional().describe("Description"),
|
|
107
|
+
image: Image.optional(),
|
|
108
|
+
corporateName: zod.z.string().describe("Corporate name"),
|
|
109
|
+
corporateNumber: zod.z.string().describe("Corporate number"),
|
|
110
|
+
postalCode: zod.z.string().describe("Postal code"),
|
|
111
|
+
addressCountry: zod.z.string().describe("Country"),
|
|
112
|
+
addressRegion: zod.z.string().describe("Prefecture / State"),
|
|
113
|
+
addressLocality: zod.z.string().describe("City / Municipality"),
|
|
114
|
+
streetAddress: zod.z.string().describe("Street address"),
|
|
115
|
+
certificationSystem: CertificationSystem
|
|
116
|
+
});
|
|
117
|
+
const JapaneseExistenceCertificate = zod.z.looseObject({
|
|
118
|
+
"@context": OpCipContext,
|
|
119
|
+
type: zod.z.tuple([zod.z.literal("VerifiableCredential"), zod.z.literal("Certificate")]),
|
|
120
|
+
issuer: OpId,
|
|
121
|
+
credentialSubject: JapaneseExistenceCertificateProperties,
|
|
122
|
+
validFrom: zod.z.string().datetime().optional().describe("Validity period start date"),
|
|
123
|
+
validUntil: zod.z.string().datetime().optional().describe("Validity period end date")
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
const Page = zod.z.object({
|
|
127
|
+
id: zod.z.url(),
|
|
128
|
+
name: zod.z.string()
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
const OpContextHead = zod.z.array(zod.z.unknown()).refine(
|
|
132
|
+
(arr) => arr.includes("https://www.w3.org/ns/credentials/v2") && arr.includes("https://originator-profile.org/ns/credentials/v1"),
|
|
133
|
+
{
|
|
134
|
+
error: "Context must include both W3C credentials v2 and OP credentials v1"
|
|
999
135
|
}
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
const
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
const
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
title: "\u96FB\u8A71\u756A\u53F7",
|
|
1176
|
-
type: "string"
|
|
1177
|
-
},
|
|
1178
|
-
postalCode: {
|
|
1179
|
-
title: "\u90F5\u4FBF\u756A\u53F7",
|
|
1180
|
-
type: "string"
|
|
1181
|
-
},
|
|
1182
|
-
addressCountry: {
|
|
1183
|
-
title: "\u56FD",
|
|
1184
|
-
type: "string"
|
|
1185
|
-
},
|
|
1186
|
-
addressRegion: {
|
|
1187
|
-
title: "\u90FD\u9053\u5E9C\u770C",
|
|
1188
|
-
type: "string"
|
|
1189
|
-
},
|
|
1190
|
-
addressLocality: {
|
|
1191
|
-
title: "\u5E02\u533A\u753A\u6751",
|
|
1192
|
-
type: "string"
|
|
1193
|
-
},
|
|
1194
|
-
streetAddress: {
|
|
1195
|
-
title: "\u756A\u5730\u30FB\u30D3\u30EB\u540D",
|
|
1196
|
-
type: "string"
|
|
1197
|
-
},
|
|
1198
|
-
contactTitle: {
|
|
1199
|
-
title: "\u9023\u7D61\u5148\u8868\u793A\u540D",
|
|
1200
|
-
type: "string"
|
|
1201
|
-
},
|
|
1202
|
-
contactUrl: {
|
|
1203
|
-
title: "\u9023\u7D61\u5148URL",
|
|
1204
|
-
type: "string"
|
|
1205
|
-
},
|
|
1206
|
-
privacyPolicyTitle: {
|
|
1207
|
-
title: "\u30D7\u30E9\u30A4\u30D0\u30B7\u30FC\u30DD\u30EA\u30B7\u30FC\u8868\u793A\u540D",
|
|
1208
|
-
type: "string"
|
|
1209
|
-
},
|
|
1210
|
-
privacyPolicyUrl: {
|
|
1211
|
-
title: "\u30D7\u30E9\u30A4\u30D0\u30B7\u30FC\u30DD\u30EA\u30B7\u30FCURL",
|
|
1212
|
-
type: "string"
|
|
1213
|
-
},
|
|
1214
|
-
publishingPrincipleTitle: {
|
|
1215
|
-
title: "\u7DE8\u96C6\u30AC\u30A4\u30C9\u30E9\u30A4\u30F3\u8868\u793A\u540D",
|
|
1216
|
-
type: "string"
|
|
1217
|
-
},
|
|
1218
|
-
publishingPrincipleUrl: {
|
|
1219
|
-
title: "\u7DE8\u96C6\u30AC\u30A4\u30C9\u30E9\u30A4\u30F3URL",
|
|
1220
|
-
type: "string"
|
|
1221
|
-
},
|
|
1222
|
-
logos: Logo
|
|
1223
|
-
},
|
|
1224
|
-
required: [
|
|
1225
|
-
"type",
|
|
1226
|
-
"domainName",
|
|
1227
|
-
"name",
|
|
1228
|
-
"url",
|
|
1229
|
-
"postalCode",
|
|
1230
|
-
"addressCountry",
|
|
1231
|
-
"addressRegion",
|
|
1232
|
-
"addressLocality",
|
|
1233
|
-
"streetAddress"
|
|
1234
|
-
],
|
|
1235
|
-
additionalProperties: false
|
|
1236
|
-
};
|
|
1237
|
-
|
|
1238
|
-
const OpVerifier = {
|
|
1239
|
-
deprecated: true,
|
|
1240
|
-
title: "Originator Profile Verifier",
|
|
1241
|
-
description: "\u8CC7\u683C\u60C5\u5831\u3092\u691C\u8A3C\u3059\u308B\u691C\u8A3C\u6A5F\u95A2",
|
|
1242
|
-
type: "object",
|
|
1243
|
-
properties: {
|
|
1244
|
-
type: { const: "verifier" },
|
|
1245
|
-
domainName: {
|
|
1246
|
-
title: "\u30C9\u30E1\u30A4\u30F3\u540D",
|
|
1247
|
-
type: "string"
|
|
1248
|
-
},
|
|
1249
|
-
url: {
|
|
1250
|
-
title: "\u30A6\u30A7\u30D6\u30B5\u30A4\u30C8\u306EURL",
|
|
1251
|
-
type: "string"
|
|
1252
|
-
},
|
|
1253
|
-
name: {
|
|
1254
|
-
title: "\u6CD5\u4EBA\u540D",
|
|
1255
|
-
type: "string"
|
|
1256
|
-
},
|
|
1257
|
-
description: {
|
|
1258
|
-
title: "\u8AAC\u660E",
|
|
1259
|
-
description: "\u30A6\u30A7\u30D6\u30E1\u30C7\u30A3\u30A2\u305D\u308C\u3092\u904B\u7528\u3059\u308B\u6CD5\u4EBA\u3001\u8A8D\u5B9A\u6A5F\u95A2\u3001\u696D\u754C\u56E3\u4F53\u7B49\u3067\u3042\u308B\u3053\u3068\u306E\u8A18\u8FF0",
|
|
1260
|
-
type: "string"
|
|
1261
|
-
},
|
|
1262
|
-
corporateNumber: {
|
|
1263
|
-
title: "\u6CD5\u4EBA\u756A\u53F7",
|
|
1264
|
-
type: "string"
|
|
1265
|
-
},
|
|
1266
|
-
businessCategory: BusinessCategory,
|
|
1267
|
-
email: {
|
|
1268
|
-
title: "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",
|
|
1269
|
-
type: "string"
|
|
1270
|
-
},
|
|
1271
|
-
phoneNumber: {
|
|
1272
|
-
title: "\u96FB\u8A71\u756A\u53F7",
|
|
1273
|
-
type: "string"
|
|
1274
|
-
},
|
|
1275
|
-
postalCode: {
|
|
1276
|
-
title: "\u90F5\u4FBF\u756A\u53F7",
|
|
1277
|
-
type: "string"
|
|
1278
|
-
},
|
|
1279
|
-
addressCountry: {
|
|
1280
|
-
title: "\u56FD",
|
|
1281
|
-
type: "string"
|
|
1282
|
-
},
|
|
1283
|
-
addressRegion: {
|
|
1284
|
-
title: "\u90FD\u9053\u5E9C\u770C",
|
|
1285
|
-
type: "string"
|
|
1286
|
-
},
|
|
1287
|
-
addressLocality: {
|
|
1288
|
-
title: "\u5E02\u533A\u753A\u6751",
|
|
1289
|
-
type: "string"
|
|
1290
|
-
},
|
|
1291
|
-
streetAddress: {
|
|
1292
|
-
title: "\u756A\u5730\u30FB\u30D3\u30EB\u540D",
|
|
1293
|
-
type: "string"
|
|
1294
|
-
},
|
|
1295
|
-
contactTitle: {
|
|
1296
|
-
title: "\u9023\u7D61\u5148\u8868\u793A\u540D",
|
|
1297
|
-
type: "string"
|
|
1298
|
-
},
|
|
1299
|
-
contactUrl: {
|
|
1300
|
-
title: "\u9023\u7D61\u5148URL",
|
|
1301
|
-
type: "string"
|
|
1302
|
-
},
|
|
1303
|
-
privacyPolicyTitle: {
|
|
1304
|
-
title: "\u30D7\u30E9\u30A4\u30D0\u30B7\u30FC\u30DD\u30EA\u30B7\u30FC\u8868\u793A\u540D",
|
|
1305
|
-
type: "string"
|
|
1306
|
-
},
|
|
1307
|
-
privacyPolicyUrl: {
|
|
1308
|
-
title: "\u30D7\u30E9\u30A4\u30D0\u30B7\u30FC\u30DD\u30EA\u30B7\u30FCURL",
|
|
1309
|
-
type: "string"
|
|
1310
|
-
},
|
|
1311
|
-
publishingPrincipleTitle: {
|
|
1312
|
-
title: "\u7DE8\u96C6\u30AC\u30A4\u30C9\u30E9\u30A4\u30F3\u8868\u793A\u540D",
|
|
1313
|
-
type: "string"
|
|
1314
|
-
},
|
|
1315
|
-
publishingPrincipleUrl: {
|
|
1316
|
-
title: "\u7DE8\u96C6\u30AC\u30A4\u30C9\u30E9\u30A4\u30F3URL",
|
|
1317
|
-
type: "string"
|
|
1318
|
-
},
|
|
1319
|
-
logos: Logo
|
|
1320
|
-
},
|
|
1321
|
-
required: [
|
|
1322
|
-
"type",
|
|
1323
|
-
"domainName",
|
|
1324
|
-
"name",
|
|
1325
|
-
"url",
|
|
1326
|
-
"postalCode",
|
|
1327
|
-
"addressCountry",
|
|
1328
|
-
"addressRegion",
|
|
1329
|
-
"addressLocality",
|
|
1330
|
-
"streetAddress"
|
|
1331
|
-
],
|
|
1332
|
-
additionalProperties: false
|
|
1333
|
-
};
|
|
1334
|
-
|
|
1335
|
-
const OpItem = {
|
|
1336
|
-
deprecated: true,
|
|
1337
|
-
title: "Originator Profile Item",
|
|
1338
|
-
anyOf: [OpHolder, OpCredential, OpCertifier, OpVerifier]
|
|
1339
|
-
};
|
|
1340
|
-
|
|
1341
|
-
const JwtOpPayload = {
|
|
1342
|
-
deprecated: true,
|
|
1343
|
-
title: "OP JWT Claims Set object",
|
|
1344
|
-
type: "object",
|
|
1345
|
-
properties: {
|
|
1346
|
-
iss: {
|
|
1347
|
-
title: "JWT Issuer",
|
|
1348
|
-
description: "[RFC 7519 Section 4.1.1](https://www.rfc-editor.org/rfc/rfc7519#section-4.1.1)",
|
|
1349
|
-
type: "string"
|
|
1350
|
-
},
|
|
1351
|
-
sub: {
|
|
1352
|
-
title: "JWT Subject",
|
|
1353
|
-
description: "[RFC 7519 Section 4.1.2](https://www.rfc-editor.org/rfc/rfc7519#section-4.1.2)",
|
|
1354
|
-
type: "string"
|
|
1355
|
-
},
|
|
1356
|
-
exp: {
|
|
1357
|
-
title: "JWT Expiration Time",
|
|
1358
|
-
description: "[RFC 7519 Section 4.1.4](https://www.rfc-editor.org/rfc/rfc7519#section-4.1.4)",
|
|
1359
|
-
type: "number"
|
|
1360
|
-
},
|
|
1361
|
-
iat: {
|
|
1362
|
-
title: "JWT Issued At",
|
|
1363
|
-
description: "[RFC 7519 Section 4.1.6](https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6)",
|
|
1364
|
-
type: "number"
|
|
1365
|
-
},
|
|
1366
|
-
"https://originator-profile.org/op": {
|
|
1367
|
-
type: "object",
|
|
1368
|
-
properties: {
|
|
1369
|
-
item: { type: "array", items: OpItem },
|
|
1370
|
-
jwks: Jwks
|
|
1371
|
-
},
|
|
1372
|
-
required: ["item"],
|
|
1373
|
-
additionalProperties: false
|
|
1374
|
-
}
|
|
1375
|
-
},
|
|
1376
|
-
required: ["iss", "sub", "exp", "iat", "https://originator-profile.org/op"],
|
|
1377
|
-
additionalProperties: false
|
|
1378
|
-
};
|
|
1379
|
-
|
|
1380
|
-
const JwtProfilePayload = {
|
|
1381
|
-
deprecated: true,
|
|
1382
|
-
title: "Profile JWT Claims Set object",
|
|
1383
|
-
anyOf: [JwtOpPayload, JwtDpPayload]
|
|
1384
|
-
};
|
|
1385
|
-
|
|
1386
|
-
const Op = {
|
|
1387
|
-
deprecated: true,
|
|
1388
|
-
title: "Originator Profile",
|
|
1389
|
-
type: "object",
|
|
1390
|
-
properties: {
|
|
1391
|
-
type: { const: "op" },
|
|
1392
|
-
issuer: {
|
|
1393
|
-
title: "Issuer",
|
|
1394
|
-
description: "\u8A8D\u8A3C\u6A5F\u95A2\u307E\u305F\u306F\u7D44\u7E54\u3092\u8868\u3059\u4E00\u7FA9\u7684\u306A\u8B58\u5225\u5B50",
|
|
1395
|
-
type: "string"
|
|
1396
|
-
},
|
|
1397
|
-
subject: {
|
|
1398
|
-
title: "Subject",
|
|
1399
|
-
description: "\u30E1\u30C7\u30A3\u30A2\u30FB\u5E83\u544A\u306A\u3069\u306B\u95A2\u308F\u308B\u7D44\u7E54\u306E\u8EAB\u5143\u307E\u305F\u306F\u305D\u306E\u7D44\u7E54\u306E\u4E3B\u8981\u306A\u51FA\u7248\u7269\u3092\u8868\u3059\u4E00\u7FA9\u7684\u306A\u8B58\u5225\u5B50",
|
|
1400
|
-
type: "string"
|
|
1401
|
-
},
|
|
1402
|
-
issuedAt: {
|
|
1403
|
-
title: "\u767A\u884C\u65E5\u6642",
|
|
1404
|
-
type: "string",
|
|
1405
|
-
format: "date-time"
|
|
1406
|
-
},
|
|
1407
|
-
expiredAt: {
|
|
1408
|
-
title: "\u671F\u9650\u5207\u308C\u65E5\u6642",
|
|
1409
|
-
type: "string",
|
|
1410
|
-
format: "date-time"
|
|
1411
|
-
},
|
|
1412
|
-
item: {
|
|
1413
|
-
title: OpItem.title,
|
|
1414
|
-
type: "array",
|
|
1415
|
-
items: OpItem
|
|
1416
|
-
},
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
const BasicTarget = zod.z.looseObject({
|
|
139
|
+
type: zod.z.enum([
|
|
140
|
+
"TextTargetIntegrity",
|
|
141
|
+
"VisibleTextTargetIntegrity",
|
|
142
|
+
"HtmlTargetIntegrity"
|
|
143
|
+
]),
|
|
144
|
+
integrity: SubresourceIntegrity,
|
|
145
|
+
cssSelector: zod.z.string().describe("CSS selector")
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
const ExternalResourceTarget = zod.z.looseObject({
|
|
149
|
+
type: zod.z.literal("ExternalResourceTargetIntegrity"),
|
|
150
|
+
integrity: SubresourceIntegrity
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
const RawTarget = zod.z.looseObject({
|
|
154
|
+
type: zod.z.enum([
|
|
155
|
+
"TextTargetIntegrity",
|
|
156
|
+
"VisibleTextTargetIntegrity",
|
|
157
|
+
"HtmlTargetIntegrity",
|
|
158
|
+
"ExternalResourceTargetIntegrity"
|
|
159
|
+
]).describe("Target Integrity type (e.g., TextTargetIntegrity)"),
|
|
160
|
+
content: zod.z.union([
|
|
161
|
+
zod.z.array(zod.z.string().describe("Content body (text/html or URL)")),
|
|
162
|
+
zod.z.string().describe("Content body (text/html or URL)")
|
|
163
|
+
]).optional(),
|
|
164
|
+
cssSelector: zod.z.string().optional().describe("CSS selector")
|
|
165
|
+
}).describe("Raw target");
|
|
166
|
+
|
|
167
|
+
const Target = zod.z.union([BasicTarget, ExternalResourceTarget]);
|
|
168
|
+
|
|
169
|
+
const subject$5 = zod.z.looseObject({
|
|
170
|
+
id: zod.z.url().describe("CA ID"),
|
|
171
|
+
type: zod.z.string().describe("JSON-LD type")
|
|
172
|
+
});
|
|
173
|
+
const ContentAttestation = zod.z.looseObject({
|
|
174
|
+
"@context": OpContextHead,
|
|
175
|
+
type: zod.z.array(zod.z.unknown()).refine((arr) => arr.includes("ContentAttestation"), {
|
|
176
|
+
error: `type must include "ContentAttestation"`
|
|
177
|
+
}),
|
|
178
|
+
issuer: OpId,
|
|
179
|
+
credentialSubject: subject$5,
|
|
180
|
+
allowedUrl: AllowedUrl.optional(),
|
|
181
|
+
allowedOrigin: AllowedOrigin.optional(),
|
|
182
|
+
target: zod.z.array(Target).min(1)
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
const subject$4 = zod.z.looseObject({
|
|
186
|
+
id: zod.z.url().describe("CA ID"),
|
|
187
|
+
type: zod.z.literal("OnlineAd"),
|
|
188
|
+
name: zod.z.string().optional().describe("Title of the ad."),
|
|
189
|
+
description: zod.z.string().optional().describe("Ad description (plain text)."),
|
|
190
|
+
image: Image.optional(),
|
|
191
|
+
genre: zod.z.string().optional().describe("Genre"),
|
|
192
|
+
landingPageUrl: zod.z.url().optional().describe("Landing page URL"),
|
|
193
|
+
adReportContact: Page.optional(),
|
|
194
|
+
adReviewGuidelines: Page.optional(),
|
|
195
|
+
targetingPolicy: Page.optional(),
|
|
196
|
+
adDataHandlingPolicy: Page.optional(),
|
|
197
|
+
adDisplayRationale: zod.z.object({
|
|
198
|
+
page: Page.optional(),
|
|
199
|
+
description: zod.z.string().optional()
|
|
200
|
+
}).refine(
|
|
201
|
+
(obj) => obj.page !== void 0 || obj.description !== void 0,
|
|
202
|
+
{ error: "Either page or description must be provided" }
|
|
203
|
+
).optional().describe("The reason this ad is being displayed")
|
|
204
|
+
}).refine(
|
|
205
|
+
(obj) => obj.name !== void 0 || obj.description !== void 0 || obj.image !== void 0,
|
|
206
|
+
{ error: "At least one of name, description, or image must be provided" }
|
|
207
|
+
);
|
|
208
|
+
const withAllowedUrl = zod.z.object({
|
|
209
|
+
allowedUrl: AllowedUrl,
|
|
210
|
+
allowedOrigin: zod.z.never().optional()
|
|
211
|
+
});
|
|
212
|
+
const withAllowedOrigin = zod.z.object({
|
|
213
|
+
allowedUrl: zod.z.never().optional(),
|
|
214
|
+
allowedOrigin: AllowedOrigin
|
|
215
|
+
});
|
|
216
|
+
const AdvertisementCA = ContentAttestation.extend({
|
|
217
|
+
"@context": OpCipContext,
|
|
218
|
+
credentialSubject: subject$4
|
|
219
|
+
}).and(zod.z.union([withAllowedUrl, withAllowedOrigin]));
|
|
220
|
+
|
|
221
|
+
const subject$3 = zod.z.object({
|
|
222
|
+
id: zod.z.url().describe("CA ID"),
|
|
223
|
+
type: zod.z.literal("Advertorial"),
|
|
224
|
+
headline: zod.z.string().describe("Title of the advertorial."),
|
|
225
|
+
description: zod.z.string().describe("A description of the advertorial (string)."),
|
|
226
|
+
image: Image.optional(),
|
|
227
|
+
datePublished: zod.z.string().datetime().optional().describe("Publication date and time"),
|
|
228
|
+
dateModified: zod.z.string().datetime().optional().describe("Last modified date and time"),
|
|
229
|
+
author: zod.z.array(zod.z.string()).optional().describe("Author names"),
|
|
230
|
+
editor: zod.z.array(zod.z.string()).optional().describe("Editor names"),
|
|
231
|
+
sponsor: zod.z.array(zod.z.string()).optional().describe("Sponsor names"),
|
|
232
|
+
genre: zod.z.string().optional().describe("Genre")
|
|
233
|
+
});
|
|
234
|
+
const AdvertorialCA = ContentAttestation.extend({
|
|
235
|
+
"@context": OpCipContext,
|
|
236
|
+
credentialSubject: subject$3,
|
|
237
|
+
allowedUrl: AllowedUrl
|
|
238
|
+
}).refine((obj) => !("allowedOrigin" in obj), {
|
|
239
|
+
error: "allowedOrigin is not allowed in AdvertorialCA"
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
const subject$2 = zod.z.object({
|
|
243
|
+
id: zod.z.url().describe("CA ID"),
|
|
244
|
+
type: zod.z.literal("Article"),
|
|
245
|
+
headline: zod.z.string().describe("Title of the content."),
|
|
246
|
+
description: zod.z.string().describe("A description of the content (plain text)."),
|
|
247
|
+
image: Image.optional(),
|
|
248
|
+
datePublished: zod.z.string().datetime().optional().describe("Publication date and time"),
|
|
249
|
+
dateModified: zod.z.string().datetime().optional().describe("Last modified date and time"),
|
|
250
|
+
author: zod.z.array(zod.z.string()).optional().describe("Author names"),
|
|
251
|
+
editor: zod.z.array(zod.z.string()).optional().describe("Editor names"),
|
|
252
|
+
genre: zod.z.string().optional().describe("Genre")
|
|
253
|
+
});
|
|
254
|
+
const ArticleCA = ContentAttestation.extend({
|
|
255
|
+
"@context": OpCipContext,
|
|
256
|
+
credentialSubject: subject$2,
|
|
257
|
+
allowedUrl: AllowedUrl
|
|
258
|
+
}).refine((obj) => !("allowedOrigin" in obj), {
|
|
259
|
+
error: "allowedOrigin is not allowed in ArticleCA"
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
const UnsignedContentAttestation = zod.z.looseObject({
|
|
263
|
+
"@context": OpContextHead,
|
|
264
|
+
type: zod.z.array(zod.z.unknown()).refine((arr) => arr.includes("ContentAttestation"), {
|
|
265
|
+
error: `type must include "ContentAttestation"`
|
|
266
|
+
}),
|
|
267
|
+
issuer: OpId,
|
|
268
|
+
credentialSubject: subject$5,
|
|
269
|
+
allowedUrl: AllowedUrl.optional(),
|
|
270
|
+
allowedOrigin: AllowedOrigin.optional(),
|
|
271
|
+
target: zod.z.array(RawTarget).min(1)
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
const ContentAttestationSetItem = zod.z.union([
|
|
275
|
+
zod.z.looseObject({
|
|
276
|
+
main: zod.z.literal(true).describe("Main content"),
|
|
277
|
+
attestation: zod.z.string().describe("Content Attestation")
|
|
278
|
+
}),
|
|
279
|
+
zod.z.string().describe("Content Attestation")
|
|
280
|
+
]);
|
|
281
|
+
const ContentAttestationSet = zod.z.array(ContentAttestationSetItem);
|
|
282
|
+
|
|
283
|
+
const CpContext = zod.z.tuple([
|
|
284
|
+
zod.z.literal("https://www.w3.org/ns/credentials/v2"),
|
|
285
|
+
zod.z.literal("https://originator-profile.org/ns/credentials/v1")
|
|
286
|
+
]);
|
|
287
|
+
|
|
288
|
+
const Jwk = zod.z.looseObject({
|
|
289
|
+
kty: zod.z.string(),
|
|
290
|
+
use: zod.z.string().optional(),
|
|
291
|
+
key_ops: zod.z.array(zod.z.string()).optional(),
|
|
292
|
+
alg: zod.z.string().optional(),
|
|
293
|
+
kid: zod.z.string(),
|
|
294
|
+
x5u: zod.z.string().optional(),
|
|
295
|
+
x5c: zod.z.array(zod.z.string()).optional(),
|
|
296
|
+
x5t: zod.z.string().optional(),
|
|
297
|
+
"x5t#S256": zod.z.string().optional()
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
const Jwks = zod.z.looseObject({
|
|
301
|
+
keys: zod.z.array(Jwk)
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
const CoreProfile = zod.z.object({
|
|
305
|
+
"@context": CpContext,
|
|
306
|
+
type: zod.z.tuple([zod.z.literal("VerifiableCredential"), zod.z.literal("CoreProfile")]),
|
|
307
|
+
issuer: OpId,
|
|
308
|
+
credentialSubject: zod.z.object({
|
|
309
|
+
id: OpId,
|
|
310
|
+
type: zod.z.literal("Core"),
|
|
1417
311
|
jwks: Jwks
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
};
|
|
1477
|
-
const
|
|
1478
|
-
|
|
1479
|
-
type:
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
}
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
updatedAt: {
|
|
1533
|
-
title: "\u66F4\u65B0\u65E5\u6642",
|
|
1534
|
-
type: "string",
|
|
1535
|
-
format: "date-time"
|
|
1536
|
-
}
|
|
1537
|
-
},
|
|
1538
|
-
required: ["group", "status", "reviewComments", "createdAt", "updatedAt"],
|
|
1539
|
-
additionalProperties: false
|
|
1540
|
-
};
|
|
1541
|
-
|
|
1542
|
-
const SiteProfile = {
|
|
1543
|
-
title: "Site Profile",
|
|
1544
|
-
type: "object",
|
|
1545
|
-
additionalProperties: true,
|
|
1546
|
-
properties: {
|
|
1547
|
-
originators: {
|
|
1548
|
-
type: "array",
|
|
1549
|
-
items: OriginatorProfileSetItem,
|
|
1550
|
-
minItems: 1
|
|
1551
|
-
},
|
|
1552
|
-
credential: {
|
|
1553
|
-
type: "string",
|
|
1554
|
-
title: "Credential"
|
|
1555
|
-
}
|
|
1556
|
-
},
|
|
1557
|
-
required: ["originators", "credential"]
|
|
1558
|
-
};
|
|
1559
|
-
|
|
1560
|
-
const User = {
|
|
1561
|
-
title: "\u30E6\u30FC\u30B6\u30FC",
|
|
1562
|
-
description: "\u30E6\u30FC\u30B6\u30FC",
|
|
1563
|
-
type: "object",
|
|
1564
|
-
properties: {
|
|
1565
|
-
id: {
|
|
1566
|
-
title: "\u30E6\u30FC\u30B6\u30FC\u30A2\u30AB\u30A6\u30F3\u30C8\u8B58\u5225\u5B50",
|
|
1567
|
-
type: "string"
|
|
1568
|
-
},
|
|
1569
|
-
email: {
|
|
1570
|
-
title: "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",
|
|
1571
|
-
type: "string"
|
|
1572
|
-
},
|
|
1573
|
-
name: {
|
|
1574
|
-
title: "\u540D\u524D",
|
|
1575
|
-
type: "string"
|
|
1576
|
-
},
|
|
1577
|
-
picture: {
|
|
1578
|
-
title: "\u753B\u50CF",
|
|
1579
|
-
type: "string"
|
|
1580
|
-
}
|
|
1581
|
-
},
|
|
1582
|
-
required: ["id", "name", "picture"],
|
|
1583
|
-
additionalProperties: false
|
|
1584
|
-
};
|
|
1585
|
-
|
|
1586
|
-
const subject$1 = {
|
|
1587
|
-
type: "object",
|
|
1588
|
-
additionalProperties: true,
|
|
1589
|
-
properties: {
|
|
1590
|
-
id: { title: "WMP \u4FDD\u6709\u7D44\u7E54\u306E OP ID", type: "string", format: "uri" },
|
|
1591
|
-
type: { const: "OnlineBusiness" },
|
|
1592
|
-
url: { title: "Web \u30E1\u30C7\u30A3\u30A2 URL", type: "string", format: "uri" },
|
|
1593
|
-
name: { title: "Web \u30E1\u30C7\u30A3\u30A2\u540D", type: "string" },
|
|
1594
|
-
logo: Image,
|
|
1595
|
-
email: { title: "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9", type: "string", format: "email" },
|
|
1596
|
-
telephone: { title: "\u96FB\u8A71\u756A\u53F7", type: "string" },
|
|
1597
|
-
contactPoint: {
|
|
1598
|
-
type: "object",
|
|
1599
|
-
properties: {
|
|
1600
|
-
id: { title: "\u9023\u7D61\u5148\u30DA\u30FC\u30B8 URL", type: "string", format: "uri" },
|
|
1601
|
-
name: { title: "\u9023\u7D61\u5148\u30DA\u30FC\u30B8\u8868\u793A\u540D", type: "string" }
|
|
1602
|
-
},
|
|
1603
|
-
required: ["id", "name"]
|
|
1604
|
-
},
|
|
1605
|
-
informationTransmissionPolicy: {
|
|
1606
|
-
type: "object",
|
|
1607
|
-
properties: {
|
|
1608
|
-
id: { title: "\u60C5\u5831\u767A\u4FE1\u30DD\u30EA\u30B7\u30FC URL", type: "string", format: "uri" },
|
|
1609
|
-
name: { title: "\u60C5\u5831\u767A\u4FE1\u30DD\u30EA\u30B7\u30FC\u8868\u793A\u540D", type: "string" }
|
|
1610
|
-
},
|
|
1611
|
-
required: ["id", "name"]
|
|
1612
|
-
},
|
|
1613
|
-
publishingPrinciple: {
|
|
1614
|
-
type: "object",
|
|
1615
|
-
properties: {
|
|
1616
|
-
id: { title: "\u7DE8\u96C6\u30AC\u30A4\u30C9\u30E9\u30A4\u30F3 URL", type: "string", format: "uri" },
|
|
1617
|
-
name: { title: "\u7DE8\u96C6\u30AC\u30A4\u30C9\u30E9\u30A4\u30F3\u8868\u793A\u540D", type: "string" }
|
|
1618
|
-
},
|
|
1619
|
-
required: ["id", "name"]
|
|
1620
|
-
},
|
|
1621
|
-
privacyPolicy: {
|
|
1622
|
-
type: "object",
|
|
1623
|
-
properties: {
|
|
1624
|
-
id: {
|
|
1625
|
-
title: "\u30D7\u30E9\u30A4\u30D0\u30B7\u30FC\u30DD\u30EA\u30B7\u30FC\u30DA\u30FC\u30B8 URL",
|
|
1626
|
-
type: "string",
|
|
1627
|
-
format: "uri"
|
|
1628
|
-
},
|
|
1629
|
-
name: { title: "\u30D7\u30E9\u30A4\u30D0\u30B7\u30FC\u30DD\u30EA\u30B7\u30FC\u30DA\u30FC\u30B8\u8868\u793A\u540D", type: "string" }
|
|
1630
|
-
},
|
|
1631
|
-
required: ["id", "name"]
|
|
1632
|
-
},
|
|
1633
|
-
description: {
|
|
1634
|
-
anyOf: [Description, { type: "array", items: Description }]
|
|
1635
|
-
}
|
|
1636
|
-
},
|
|
1637
|
-
required: ["id", "type", "url", "name"]
|
|
1638
|
-
};
|
|
1639
|
-
const WebMediaProfile = {
|
|
1640
|
-
title: "Web Media Profile",
|
|
1641
|
-
type: "object",
|
|
1642
|
-
additionalProperties: true,
|
|
1643
|
-
allOf: [
|
|
1644
|
-
OpVc,
|
|
1645
|
-
{
|
|
1646
|
-
type: "object",
|
|
1647
|
-
properties: {
|
|
1648
|
-
type: {
|
|
1649
|
-
type: "array",
|
|
1650
|
-
minItems: 2,
|
|
1651
|
-
items: [
|
|
1652
|
-
{ const: "VerifiableCredential" },
|
|
1653
|
-
{ const: "WebMediaProfile" }
|
|
1654
|
-
],
|
|
1655
|
-
additionalItems: false
|
|
1656
|
-
},
|
|
1657
|
-
credentialSubject: subject$1
|
|
1658
|
-
},
|
|
1659
|
-
required: ["type", "credentialSubject"]
|
|
1660
|
-
}
|
|
1661
|
-
],
|
|
1662
|
-
required: ["type", "credentialSubject"]
|
|
1663
|
-
};
|
|
1664
|
-
|
|
1665
|
-
const deprecatedSubject = {
|
|
1666
|
-
deprecated: true,
|
|
1667
|
-
type: "object",
|
|
1668
|
-
additionalProperties: true,
|
|
1669
|
-
properties: {
|
|
1670
|
-
id: {
|
|
1671
|
-
type: "string",
|
|
1672
|
-
title: "Web \u30B5\u30A4\u30C8\u306E\u30AA\u30EA\u30B8\u30F3 (\u5F62\u5F0F: https://<\u30DB\u30B9\u30C8\u540D>)",
|
|
1673
|
-
format: "uri"
|
|
1674
|
-
},
|
|
1675
|
-
type: {
|
|
1676
|
-
const: "WebSite"
|
|
1677
|
-
},
|
|
1678
|
-
name: {
|
|
1679
|
-
type: "string",
|
|
1680
|
-
title: "Web \u30B5\u30A4\u30C8\u306E\u540D\u79F0"
|
|
1681
|
-
},
|
|
1682
|
-
image: Image,
|
|
1683
|
-
description: {
|
|
1684
|
-
type: "string",
|
|
1685
|
-
title: "Web \u30B5\u30A4\u30C8\u306E\u8AAC\u660E"
|
|
1686
|
-
},
|
|
1687
|
-
url: AllowedOrigin
|
|
1688
|
-
},
|
|
1689
|
-
required: ["id", "type", "name", "url"]
|
|
1690
|
-
};
|
|
1691
|
-
const subject = {
|
|
1692
|
-
type: "object",
|
|
1693
|
-
additionalProperties: true,
|
|
1694
|
-
properties: {
|
|
1695
|
-
id: {
|
|
1696
|
-
type: "string",
|
|
1697
|
-
title: "Web \u30B5\u30A4\u30C8\u306E\u30AA\u30EA\u30B8\u30F3 (\u5F62\u5F0F: https://<\u30DB\u30B9\u30C8\u540D>)",
|
|
1698
|
-
format: "uri"
|
|
1699
|
-
},
|
|
1700
|
-
type: {
|
|
1701
|
-
const: "WebSite"
|
|
1702
|
-
},
|
|
1703
|
-
name: {
|
|
1704
|
-
type: "string",
|
|
1705
|
-
title: "Web \u30B5\u30A4\u30C8\u306E\u540D\u79F0"
|
|
1706
|
-
},
|
|
1707
|
-
image: Image,
|
|
1708
|
-
description: {
|
|
1709
|
-
type: "string",
|
|
1710
|
-
title: "Web \u30B5\u30A4\u30C8\u306E\u8AAC\u660E"
|
|
1711
|
-
},
|
|
1712
|
-
allowedOrigin: AllowedOrigin
|
|
1713
|
-
},
|
|
1714
|
-
required: ["id", "type", "name", "allowedOrigin"]
|
|
1715
|
-
};
|
|
1716
|
-
const WebsiteProfile = {
|
|
1717
|
-
title: "Website Profile",
|
|
1718
|
-
type: "object",
|
|
1719
|
-
additionalProperties: true,
|
|
1720
|
-
allOf: [
|
|
1721
|
-
OpVc,
|
|
1722
|
-
{
|
|
1723
|
-
type: "object",
|
|
1724
|
-
properties: {
|
|
1725
|
-
"@context": OpCipContext,
|
|
1726
|
-
type: {
|
|
1727
|
-
type: "array",
|
|
1728
|
-
minItems: 2,
|
|
1729
|
-
items: [
|
|
1730
|
-
{ const: "VerifiableCredential" },
|
|
1731
|
-
{ const: "WebsiteProfile" }
|
|
1732
|
-
]
|
|
1733
|
-
},
|
|
1734
|
-
credentialSubject: {
|
|
1735
|
-
anyOf: [deprecatedSubject, subject]
|
|
1736
|
-
}
|
|
1737
|
-
},
|
|
1738
|
-
required: ["@context", "type", "credentialSubject"]
|
|
1739
|
-
}
|
|
1740
|
-
]
|
|
1741
|
-
};
|
|
1742
|
-
|
|
1743
|
-
exports.Advertisement = Advertisement;
|
|
312
|
+
})
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
const Description = zod.z.union([
|
|
316
|
+
zod.z.string(),
|
|
317
|
+
zod.z.looseObject({
|
|
318
|
+
text: zod.z.string().describe("Text value."),
|
|
319
|
+
encodingFormat: zod.z.enum(["text/plain", "text/html"]).describe(
|
|
320
|
+
"MIME type. Allowed values: 'text/plain' and 'text/html' (only br, p, ol, ul, li allowed)."
|
|
321
|
+
)
|
|
322
|
+
})
|
|
323
|
+
]);
|
|
324
|
+
|
|
325
|
+
const OpMeta = zod.z.object({
|
|
326
|
+
targetopid: zod.z.string()
|
|
327
|
+
}).passthrough();
|
|
328
|
+
|
|
329
|
+
const OpVc = zod.z.looseObject({
|
|
330
|
+
"@context": OpContextHead,
|
|
331
|
+
type: zod.z.array(zod.z.unknown()).refine((arr) => arr.includes("VerifiableCredential"), {
|
|
332
|
+
error: `type must include "VerifiableCredential"`
|
|
333
|
+
}),
|
|
334
|
+
issuer: OpId,
|
|
335
|
+
credentialSubject: zod.z.looseObject({
|
|
336
|
+
id: OpId
|
|
337
|
+
})
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
const OriginatorProfileSetItem = zod.z.looseObject({
|
|
341
|
+
core: zod.z.string().describe("Core Profile"),
|
|
342
|
+
annotations: zod.z.array(zod.z.string().describe("Profile Annotation")).optional().describe("An array of Profile Annotation"),
|
|
343
|
+
media: zod.z.union([zod.z.string(), zod.z.array(zod.z.string())]).optional().describe("Web Media Profile or an array of Web Media Profile")
|
|
344
|
+
});
|
|
345
|
+
const OriginatorProfileSet = zod.z.array(OriginatorProfileSetItem);
|
|
346
|
+
|
|
347
|
+
const SiteProfile = zod.z.looseObject({
|
|
348
|
+
originators: zod.z.array(OriginatorProfileSetItem).min(1),
|
|
349
|
+
sites: zod.z.array(zod.z.string().describe("Website Profile")).optional().describe("An array of Website Profile"),
|
|
350
|
+
credential: zod.z.string().optional().describe("Credential")
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
const deprecatedSubject = zod.z.looseObject({
|
|
354
|
+
id: zod.z.url().describe("Web site origin (format: https://<hostname>)"),
|
|
355
|
+
type: zod.z.literal("WebSite"),
|
|
356
|
+
name: zod.z.string().describe("The name of the Web site."),
|
|
357
|
+
image: Image.optional(),
|
|
358
|
+
description: zod.z.string().optional().describe("A description of the Web site."),
|
|
359
|
+
url: AllowedOrigin
|
|
360
|
+
});
|
|
361
|
+
const subject$1 = zod.z.looseObject({
|
|
362
|
+
id: zod.z.url().describe(
|
|
363
|
+
"It MUST be the Web site URL. If the same content exists on multiple URLs, specify the most representative URL."
|
|
364
|
+
),
|
|
365
|
+
type: zod.z.literal("WebSite"),
|
|
366
|
+
name: zod.z.string().describe("The name of the Web site."),
|
|
367
|
+
image: Image.optional(),
|
|
368
|
+
description: zod.z.string().optional().describe("A description of the Web site."),
|
|
369
|
+
allowedOrigin: AllowedOrigin
|
|
370
|
+
});
|
|
371
|
+
const WebsiteProfile = zod.z.looseObject({
|
|
372
|
+
"@context": OpCipContext,
|
|
373
|
+
type: zod.z.tuple([
|
|
374
|
+
zod.z.literal("VerifiableCredential"),
|
|
375
|
+
zod.z.literal("WebsiteProfile")
|
|
376
|
+
]),
|
|
377
|
+
issuer: OpId,
|
|
378
|
+
credentialSubject: zod.z.union([deprecatedSubject, subject$1])
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
const UnsignedWebsiteProfile = WebsiteProfile.and(
|
|
382
|
+
zod.z.object({
|
|
383
|
+
credentialSubject: zod.z.object({
|
|
384
|
+
image: zod.z.union([RawImage, Image])
|
|
385
|
+
})
|
|
386
|
+
})
|
|
387
|
+
);
|
|
388
|
+
|
|
389
|
+
const subject = zod.z.looseObject({
|
|
390
|
+
id: OpId.describe("OP ID of the WMP holding organization"),
|
|
391
|
+
type: zod.z.literal("OnlineBusiness"),
|
|
392
|
+
url: zod.z.url().describe("Web media URL"),
|
|
393
|
+
name: zod.z.string().describe("Organization name"),
|
|
394
|
+
logo: Image.optional(),
|
|
395
|
+
email: zod.z.email().optional().describe("Email address"),
|
|
396
|
+
telephone: zod.z.string().optional().describe("Phone number"),
|
|
397
|
+
contactPoint: zod.z.object({
|
|
398
|
+
id: zod.z.url().describe("Contact page URL"),
|
|
399
|
+
name: zod.z.string().describe("Contact page display name")
|
|
400
|
+
}).optional(),
|
|
401
|
+
informationTransmissionPolicy: zod.z.object({
|
|
402
|
+
id: zod.z.url().describe("Information transmission policy URL"),
|
|
403
|
+
name: zod.z.string().describe("Information transmission policy display name")
|
|
404
|
+
}).optional(),
|
|
405
|
+
publishingPrinciple: zod.z.object({
|
|
406
|
+
id: zod.z.url().describe("Editorial guidelines URL"),
|
|
407
|
+
name: zod.z.string().describe("Editorial guidelines display name")
|
|
408
|
+
}).optional(),
|
|
409
|
+
privacyPolicy: zod.z.object({
|
|
410
|
+
id: zod.z.url().describe("Privacy policy page URL"),
|
|
411
|
+
name: zod.z.string().describe("Privacy policy page display name")
|
|
412
|
+
}).optional(),
|
|
413
|
+
description: zod.z.union([Description, zod.z.array(Description)]).optional()
|
|
414
|
+
});
|
|
415
|
+
const WebMediaProfile = zod.z.looseObject({
|
|
416
|
+
"@context": OpCipContext,
|
|
417
|
+
type: zod.z.tuple([
|
|
418
|
+
zod.z.literal("VerifiableCredential"),
|
|
419
|
+
zod.z.literal("WebMediaProfile")
|
|
420
|
+
]),
|
|
421
|
+
issuer: OpId,
|
|
422
|
+
credentialSubject: subject
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
exports.AdvertisementCA = AdvertisementCA;
|
|
1744
426
|
exports.AdvertorialCA = AdvertorialCA;
|
|
1745
427
|
exports.AllowedOrigin = AllowedOrigin;
|
|
1746
428
|
exports.AllowedUrl = AllowedUrl;
|
|
@@ -1753,38 +435,25 @@ exports.ContentAttestationSet = ContentAttestationSet;
|
|
|
1753
435
|
exports.ContentAttestationSetItem = ContentAttestationSetItem;
|
|
1754
436
|
exports.CoreProfile = CoreProfile;
|
|
1755
437
|
exports.Description = Description;
|
|
1756
|
-
exports.Dp = Dp;
|
|
1757
|
-
exports.DpAllowedOrigins = DpAllowedOrigins;
|
|
1758
|
-
exports.DpHtml = DpHtml;
|
|
1759
|
-
exports.DpItem = DpItem;
|
|
1760
|
-
exports.DpText = DpText;
|
|
1761
|
-
exports.DpVisibleText = DpVisibleText;
|
|
1762
438
|
exports.ExternalResourceTarget = ExternalResourceTarget;
|
|
1763
439
|
exports.Image = Image;
|
|
1764
440
|
exports.JapaneseExistenceCertificate = JapaneseExistenceCertificate;
|
|
1765
441
|
exports.JapaneseExistenceCertificateProperties = JapaneseExistenceCertificateProperties;
|
|
1766
442
|
exports.Jwk = Jwk;
|
|
1767
443
|
exports.Jwks = Jwks;
|
|
1768
|
-
exports.
|
|
1769
|
-
exports.
|
|
1770
|
-
exports.JwtProfilePayload = JwtProfilePayload;
|
|
1771
|
-
exports.OgWebsite = OgWebsite;
|
|
1772
|
-
exports.Op = Op;
|
|
1773
|
-
exports.OpCertifier = OpCertifier;
|
|
1774
|
-
exports.OpCredential = OpCredential;
|
|
1775
|
-
exports.OpHolder = OpHolder;
|
|
1776
|
-
exports.OpItem = OpItem;
|
|
444
|
+
exports.OpId = OpId;
|
|
445
|
+
exports.OpMeta = OpMeta;
|
|
1777
446
|
exports.OpVc = OpVc;
|
|
1778
|
-
exports.OpVerifier = OpVerifier;
|
|
1779
447
|
exports.OriginatorProfileSet = OriginatorProfileSet;
|
|
1780
448
|
exports.OriginatorProfileSetItem = OriginatorProfileSetItem;
|
|
1781
449
|
exports.Page = Page;
|
|
1782
|
-
exports.
|
|
450
|
+
exports.RawImage = RawImage;
|
|
1783
451
|
exports.RawTarget = RawTarget;
|
|
1784
|
-
exports.Request = Request;
|
|
1785
452
|
exports.SiteProfile = SiteProfile;
|
|
453
|
+
exports.SubresourceIntegrity = SubresourceIntegrity;
|
|
1786
454
|
exports.Target = Target;
|
|
1787
455
|
exports.UnsignedContentAttestation = UnsignedContentAttestation;
|
|
1788
|
-
exports.
|
|
456
|
+
exports.UnsignedWebsiteProfile = UnsignedWebsiteProfile;
|
|
1789
457
|
exports.WebMediaProfile = WebMediaProfile;
|
|
1790
458
|
exports.WebsiteProfile = WebsiteProfile;
|
|
459
|
+
exports.subject = subject$5;
|