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