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