@originator-profile/model 0.5.0-beta.2 → 0.5.0

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
@@ -51,7 +51,12 @@ const OpCipContext = zod.z.tuple([
51
51
  })
52
52
  ]);
53
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,}$/;
54
+ const DateTimeStamp = zod.z.iso.datetime({
55
+ offset: true,
56
+ error: "Must be an xsd:dateTimeStamp string (e.g. 2024-01-01T00:00:00Z or 2024-01-01T00:00:00+09:00)"
57
+ });
58
+
59
+ const DNS_URI_PATTERN = /^dns:([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)*[a-zA-Z](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/;
55
60
  const OpId = zod.z.string().regex(DNS_URI_PATTERN, {
56
61
  error: "Invalid OP ID: must be dns:<valid-domain>"
57
62
  });
@@ -94,8 +99,10 @@ const Certificate = zod.z.object({
94
99
  "@context": OpCipContext,
95
100
  type: zod.z.tuple([zod.z.literal("VerifiableCredential"), zod.z.literal("Certificate")]),
96
101
  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"),
102
+ validFrom: DateTimeStamp.optional().describe(
103
+ "Validity period start and time"
104
+ ),
105
+ validUntil: DateTimeStamp.optional().describe("Validity period end and time"),
99
106
  credentialSubject: CertificateProperties
100
107
  });
101
108
 
@@ -119,8 +126,10 @@ const JapaneseExistenceCertificate = zod.z.looseObject({
119
126
  type: zod.z.tuple([zod.z.literal("VerifiableCredential"), zod.z.literal("Certificate")]),
120
127
  issuer: OpId,
121
128
  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")
129
+ validFrom: DateTimeStamp.optional().describe(
130
+ "Validity period start and time"
131
+ ),
132
+ validUntil: DateTimeStamp.optional().describe("Validity period end and time")
124
133
  });
125
134
 
126
135
  const Page = zod.z.object({
@@ -224,8 +233,10 @@ const subject$3 = zod.z.object({
224
233
  headline: zod.z.string().describe("Title of the advertorial."),
225
234
  description: zod.z.string().describe("A description of the advertorial (string)."),
226
235
  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"),
236
+ datePublished: DateTimeStamp.optional().describe("Publication date and time"),
237
+ dateModified: DateTimeStamp.optional().describe(
238
+ "Last modified date and time"
239
+ ),
229
240
  author: zod.z.array(zod.z.string()).optional().describe("Author names"),
230
241
  editor: zod.z.array(zod.z.string()).optional().describe("Editor names"),
231
242
  sponsor: zod.z.array(zod.z.string()).optional().describe("Sponsor names"),
@@ -245,8 +256,10 @@ const subject$2 = zod.z.object({
245
256
  headline: zod.z.string().describe("Title of the content."),
246
257
  description: zod.z.string().describe("A description of the content (plain text)."),
247
258
  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"),
259
+ datePublished: DateTimeStamp.optional().describe("Publication date and time"),
260
+ dateModified: DateTimeStamp.optional().describe(
261
+ "Last modified date and time"
262
+ ),
250
263
  author: zod.z.array(zod.z.string()).optional().describe("Author names"),
251
264
  editor: zod.z.array(zod.z.string()).optional().describe("Editor names"),
252
265
  genre: zod.z.string().optional().describe("Genre")
@@ -337,17 +350,26 @@ const OpVc = zod.z.looseObject({
337
350
  })
338
351
  });
339
352
 
340
- const OriginatorProfileSetItem = zod.z.looseObject({
353
+ const OriginatorProfile = zod.z.looseObject({
341
354
  core: zod.z.string().describe("Core Profile"),
342
355
  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")
356
+ /** @deprecated 後方互換性のため 2026-11-01 まで非配列 WMP を許容。代わりに配列を使用してください。 */
357
+ media: zod.z.union([zod.z.string(), zod.z.array(zod.z.string())]).optional().describe(
358
+ `An array of Web Media Profile
359
+
360
+ @deprecated \u5F8C\u65B9\u4E92\u63DB\u6027\u306E\u305F\u3081 2026-11-01 \u307E\u3067\u975E\u914D\u5217 WMP \u3092\u8A31\u5BB9\u3002\u4EE3\u308F\u308A\u306B\u914D\u5217\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002
361
+ `
362
+ )
344
363
  });
345
- const OriginatorProfileSet = zod.z.array(OriginatorProfileSetItem);
364
+ const OriginatorProfileSet = zod.z.array(OriginatorProfile);
346
365
 
347
366
  const SiteProfile = zod.z.looseObject({
348
- originators: zod.z.array(OriginatorProfileSetItem).min(1),
367
+ originators: zod.z.array(OriginatorProfile).min(1),
349
368
  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")
369
+ /** @deprecated 後方互換性のため 2026-11-01 まで許容。sites が優先され、存在しない場合に credential を使用。 */
370
+ credential: zod.z.string().optional().describe(
371
+ "@deprecated \u5F8C\u65B9\u4E92\u63DB\u6027\u306E\u305F\u3081 2026-11-01 \u307E\u3067\u8A31\u5BB9\u3002sites \u304C\u512A\u5148\u3055\u308C\u3001\u5B58\u5728\u3057\u306A\u3044\u5834\u5408\u306B credential \u3092\u4F7F\u7528\u3002"
372
+ )
351
373
  });
352
374
 
353
375
  const deprecatedSubject = zod.z.looseObject({
@@ -434,6 +456,7 @@ exports.ContentAttestation = ContentAttestation;
434
456
  exports.ContentAttestationSet = ContentAttestationSet;
435
457
  exports.ContentAttestationSetItem = ContentAttestationSetItem;
436
458
  exports.CoreProfile = CoreProfile;
459
+ exports.DateTimeStamp = DateTimeStamp;
437
460
  exports.Description = Description;
438
461
  exports.ExternalResourceTarget = ExternalResourceTarget;
439
462
  exports.Image = Image;
@@ -444,8 +467,8 @@ exports.Jwks = Jwks;
444
467
  exports.OpId = OpId;
445
468
  exports.OpMeta = OpMeta;
446
469
  exports.OpVc = OpVc;
470
+ exports.OriginatorProfile = OriginatorProfile;
447
471
  exports.OriginatorProfileSet = OriginatorProfileSet;
448
- exports.OriginatorProfileSetItem = OriginatorProfileSetItem;
449
472
  exports.Page = Page;
450
473
  exports.RawImage = RawImage;
451
474
  exports.RawTarget = RawTarget;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,9 @@
1
1
  import { z } from 'zod';
2
2
 
3
+ /**
4
+ * 後方互換性のため 2026-09-01 まで許容
5
+ * Content Attestation では allowedOrigin は非推奨です。代わりに allowedUrl を使用してください。
6
+ */
3
7
  declare const AllowedOrigin: z.ZodUnion<readonly [z.ZodCustomStringFormat<"origin">, z.ZodArray<z.ZodCustomStringFormat<"origin">>]>;
4
8
  type AllowedOrigin = z.infer<typeof AllowedOrigin>;
5
9
 
@@ -21,8 +25,8 @@ declare const Certificate: z.ZodObject<{
21
25
  }, z.core.$strip>], null>;
22
26
  type: z.ZodTuple<[z.ZodLiteral<"VerifiableCredential">, z.ZodLiteral<"Certificate">], null>;
23
27
  issuer: z.ZodString;
24
- validFrom: z.ZodOptional<z.ZodString>;
25
- validUntil: z.ZodOptional<z.ZodString>;
28
+ validFrom: z.ZodOptional<z.ZodISODateTime>;
29
+ validUntil: z.ZodOptional<z.ZodISODateTime>;
26
30
  credentialSubject: z.ZodObject<{
27
31
  id: z.ZodString;
28
32
  type: z.ZodLiteral<"CertificateProperties">;
@@ -98,8 +102,8 @@ declare const JapaneseExistenceCertificate: z.ZodObject<{
98
102
  ref: z.ZodOptional<z.ZodURL>;
99
103
  }, z.core.$strip>;
100
104
  }, z.core.$strip>;
101
- validFrom: z.ZodOptional<z.ZodString>;
102
- validUntil: z.ZodOptional<z.ZodString>;
105
+ validFrom: z.ZodOptional<z.ZodISODateTime>;
106
+ validUntil: z.ZodOptional<z.ZodISODateTime>;
103
107
  }, z.core.$loose>;
104
108
  type JapaneseExistenceCertificate = z.infer<typeof JapaneseExistenceCertificate>;
105
109
 
@@ -231,8 +235,8 @@ declare const AdvertorialCA: z.ZodObject<{
231
235
  id: z.ZodURL;
232
236
  digestSRI: z.ZodOptional<z.ZodCustomStringFormat<"sri">>;
233
237
  }, z.core.$strip>>;
234
- datePublished: z.ZodOptional<z.ZodString>;
235
- dateModified: z.ZodOptional<z.ZodString>;
238
+ datePublished: z.ZodOptional<z.ZodISODateTime>;
239
+ dateModified: z.ZodOptional<z.ZodISODateTime>;
236
240
  author: z.ZodOptional<z.ZodArray<z.ZodString>>;
237
241
  editor: z.ZodOptional<z.ZodArray<z.ZodString>>;
238
242
  sponsor: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -270,8 +274,8 @@ declare const ArticleCA: z.ZodObject<{
270
274
  id: z.ZodURL;
271
275
  digestSRI: z.ZodOptional<z.ZodCustomStringFormat<"sri">>;
272
276
  }, z.core.$strip>>;
273
- datePublished: z.ZodOptional<z.ZodString>;
274
- dateModified: z.ZodOptional<z.ZodString>;
277
+ datePublished: z.ZodOptional<z.ZodISODateTime>;
278
+ dateModified: z.ZodOptional<z.ZodISODateTime>;
275
279
  author: z.ZodOptional<z.ZodArray<z.ZodString>>;
276
280
  editor: z.ZodOptional<z.ZodArray<z.ZodString>>;
277
281
  genre: z.ZodOptional<z.ZodString>;
@@ -367,6 +371,14 @@ declare const CoreProfile: z.ZodObject<{
367
371
  }, z.core.$strip>;
368
372
  type CoreProfile = z.infer<typeof CoreProfile>;
369
373
 
374
+ /**
375
+ * xsd:dateTimeStamp 形式の文字列スキーマ。
376
+ * タイムゾーン指定(Z または ±HH:MM)を必須とする。
377
+ * @see https://www.w3.org/TR/xmlschema11-2/#dateTimeStamp
378
+ */
379
+ declare const DateTimeStamp: z.ZodISODateTime;
380
+ type DateTimeStamp = z.infer<typeof DateTimeStamp>;
381
+
370
382
  declare const Description: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
371
383
  text: z.ZodString;
372
384
  encodingFormat: z.ZodEnum<{
@@ -433,15 +445,17 @@ declare const OpVc: z.ZodObject<{
433
445
  }, z.core.$loose>;
434
446
  type OpVc = z.infer<typeof OpVc>;
435
447
 
436
- declare const OriginatorProfileSetItem: z.ZodObject<{
448
+ declare const OriginatorProfile: z.ZodObject<{
437
449
  core: z.ZodString;
438
450
  annotations: z.ZodOptional<z.ZodArray<z.ZodString>>;
451
+ /** @deprecated 後方互換性のため 2026-11-01 まで非配列 WMP を許容。代わりに配列を使用してください。 */
439
452
  media: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
440
453
  }, z.core.$loose>;
441
- type OriginatorProfileSetItem = z.infer<typeof OriginatorProfileSetItem>;
454
+ type OriginatorProfile = z.infer<typeof OriginatorProfile>;
442
455
  declare const OriginatorProfileSet: z.ZodArray<z.ZodObject<{
443
456
  core: z.ZodString;
444
457
  annotations: z.ZodOptional<z.ZodArray<z.ZodString>>;
458
+ /** @deprecated 後方互換性のため 2026-11-01 まで非配列 WMP を許容。代わりに配列を使用してください。 */
445
459
  media: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
446
460
  }, z.core.$loose>>;
447
461
  type OriginatorProfileSet = z.infer<typeof OriginatorProfileSet>;
@@ -459,6 +473,7 @@ declare const SiteProfile: z.ZodObject<{
459
473
  media: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
460
474
  }, z.core.$loose>>;
461
475
  sites: z.ZodOptional<z.ZodArray<z.ZodString>>;
476
+ /** @deprecated 後方互換性のため 2026-11-01 まで許容。sites が優先され、存在しない場合に credential を使用。 */
462
477
  credential: z.ZodOptional<z.ZodString>;
463
478
  }, z.core.$loose>;
464
479
  type SiteProfile = z.infer<typeof SiteProfile>;
@@ -629,4 +644,5 @@ declare const WebsiteProfile: z.ZodObject<{
629
644
  }, z.core.$loose>;
630
645
  type WebsiteProfile = z.infer<typeof WebsiteProfile>;
631
646
 
632
- export { AdvertisementCA, type AdvertisementSubject, 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 };
647
+ export { AdvertisementCA, AdvertorialCA, AllowedOrigin, AllowedUrl, ArticleCA, BasicTarget, Certificate, CertificationSystem, ContentAttestation, ContentAttestationSet, ContentAttestationSetItem, CoreProfile, DateTimeStamp, Description, ExternalResourceTarget, Image, JapaneseExistenceCertificate, JapaneseExistenceCertificateProperties, Jwk, Jwks, OpId, OpMeta, OpVc, OriginatorProfile, OriginatorProfileSet, Page, RawImage, RawTarget, SiteProfile, SubresourceIntegrity, Target, UnsignedContentAttestation, UnsignedWebsiteProfile, WebMediaProfile, WebsiteProfile, subject };
648
+ export type { AdvertisementSubject };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,9 @@
1
1
  import { z } from 'zod';
2
2
 
3
+ /**
4
+ * 後方互換性のため 2026-09-01 まで許容
5
+ * Content Attestation では allowedOrigin は非推奨です。代わりに allowedUrl を使用してください。
6
+ */
3
7
  declare const AllowedOrigin: z.ZodUnion<readonly [z.ZodCustomStringFormat<"origin">, z.ZodArray<z.ZodCustomStringFormat<"origin">>]>;
4
8
  type AllowedOrigin = z.infer<typeof AllowedOrigin>;
5
9
 
@@ -21,8 +25,8 @@ declare const Certificate: z.ZodObject<{
21
25
  }, z.core.$strip>], null>;
22
26
  type: z.ZodTuple<[z.ZodLiteral<"VerifiableCredential">, z.ZodLiteral<"Certificate">], null>;
23
27
  issuer: z.ZodString;
24
- validFrom: z.ZodOptional<z.ZodString>;
25
- validUntil: z.ZodOptional<z.ZodString>;
28
+ validFrom: z.ZodOptional<z.ZodISODateTime>;
29
+ validUntil: z.ZodOptional<z.ZodISODateTime>;
26
30
  credentialSubject: z.ZodObject<{
27
31
  id: z.ZodString;
28
32
  type: z.ZodLiteral<"CertificateProperties">;
@@ -98,8 +102,8 @@ declare const JapaneseExistenceCertificate: z.ZodObject<{
98
102
  ref: z.ZodOptional<z.ZodURL>;
99
103
  }, z.core.$strip>;
100
104
  }, z.core.$strip>;
101
- validFrom: z.ZodOptional<z.ZodString>;
102
- validUntil: z.ZodOptional<z.ZodString>;
105
+ validFrom: z.ZodOptional<z.ZodISODateTime>;
106
+ validUntil: z.ZodOptional<z.ZodISODateTime>;
103
107
  }, z.core.$loose>;
104
108
  type JapaneseExistenceCertificate = z.infer<typeof JapaneseExistenceCertificate>;
105
109
 
@@ -231,8 +235,8 @@ declare const AdvertorialCA: z.ZodObject<{
231
235
  id: z.ZodURL;
232
236
  digestSRI: z.ZodOptional<z.ZodCustomStringFormat<"sri">>;
233
237
  }, z.core.$strip>>;
234
- datePublished: z.ZodOptional<z.ZodString>;
235
- dateModified: z.ZodOptional<z.ZodString>;
238
+ datePublished: z.ZodOptional<z.ZodISODateTime>;
239
+ dateModified: z.ZodOptional<z.ZodISODateTime>;
236
240
  author: z.ZodOptional<z.ZodArray<z.ZodString>>;
237
241
  editor: z.ZodOptional<z.ZodArray<z.ZodString>>;
238
242
  sponsor: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -270,8 +274,8 @@ declare const ArticleCA: z.ZodObject<{
270
274
  id: z.ZodURL;
271
275
  digestSRI: z.ZodOptional<z.ZodCustomStringFormat<"sri">>;
272
276
  }, z.core.$strip>>;
273
- datePublished: z.ZodOptional<z.ZodString>;
274
- dateModified: z.ZodOptional<z.ZodString>;
277
+ datePublished: z.ZodOptional<z.ZodISODateTime>;
278
+ dateModified: z.ZodOptional<z.ZodISODateTime>;
275
279
  author: z.ZodOptional<z.ZodArray<z.ZodString>>;
276
280
  editor: z.ZodOptional<z.ZodArray<z.ZodString>>;
277
281
  genre: z.ZodOptional<z.ZodString>;
@@ -367,6 +371,14 @@ declare const CoreProfile: z.ZodObject<{
367
371
  }, z.core.$strip>;
368
372
  type CoreProfile = z.infer<typeof CoreProfile>;
369
373
 
374
+ /**
375
+ * xsd:dateTimeStamp 形式の文字列スキーマ。
376
+ * タイムゾーン指定(Z または ±HH:MM)を必須とする。
377
+ * @see https://www.w3.org/TR/xmlschema11-2/#dateTimeStamp
378
+ */
379
+ declare const DateTimeStamp: z.ZodISODateTime;
380
+ type DateTimeStamp = z.infer<typeof DateTimeStamp>;
381
+
370
382
  declare const Description: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
371
383
  text: z.ZodString;
372
384
  encodingFormat: z.ZodEnum<{
@@ -433,15 +445,17 @@ declare const OpVc: z.ZodObject<{
433
445
  }, z.core.$loose>;
434
446
  type OpVc = z.infer<typeof OpVc>;
435
447
 
436
- declare const OriginatorProfileSetItem: z.ZodObject<{
448
+ declare const OriginatorProfile: z.ZodObject<{
437
449
  core: z.ZodString;
438
450
  annotations: z.ZodOptional<z.ZodArray<z.ZodString>>;
451
+ /** @deprecated 後方互換性のため 2026-11-01 まで非配列 WMP を許容。代わりに配列を使用してください。 */
439
452
  media: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
440
453
  }, z.core.$loose>;
441
- type OriginatorProfileSetItem = z.infer<typeof OriginatorProfileSetItem>;
454
+ type OriginatorProfile = z.infer<typeof OriginatorProfile>;
442
455
  declare const OriginatorProfileSet: z.ZodArray<z.ZodObject<{
443
456
  core: z.ZodString;
444
457
  annotations: z.ZodOptional<z.ZodArray<z.ZodString>>;
458
+ /** @deprecated 後方互換性のため 2026-11-01 まで非配列 WMP を許容。代わりに配列を使用してください。 */
445
459
  media: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
446
460
  }, z.core.$loose>>;
447
461
  type OriginatorProfileSet = z.infer<typeof OriginatorProfileSet>;
@@ -459,6 +473,7 @@ declare const SiteProfile: z.ZodObject<{
459
473
  media: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
460
474
  }, z.core.$loose>>;
461
475
  sites: z.ZodOptional<z.ZodArray<z.ZodString>>;
476
+ /** @deprecated 後方互換性のため 2026-11-01 まで許容。sites が優先され、存在しない場合に credential を使用。 */
462
477
  credential: z.ZodOptional<z.ZodString>;
463
478
  }, z.core.$loose>;
464
479
  type SiteProfile = z.infer<typeof SiteProfile>;
@@ -629,4 +644,5 @@ declare const WebsiteProfile: z.ZodObject<{
629
644
  }, z.core.$loose>;
630
645
  type WebsiteProfile = z.infer<typeof WebsiteProfile>;
631
646
 
632
- export { AdvertisementCA, type AdvertisementSubject, 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 };
647
+ export { AdvertisementCA, AdvertorialCA, AllowedOrigin, AllowedUrl, ArticleCA, BasicTarget, Certificate, CertificationSystem, ContentAttestation, ContentAttestationSet, ContentAttestationSetItem, CoreProfile, DateTimeStamp, Description, ExternalResourceTarget, Image, JapaneseExistenceCertificate, JapaneseExistenceCertificateProperties, Jwk, Jwks, OpId, OpMeta, OpVc, OriginatorProfile, OriginatorProfileSet, Page, RawImage, RawTarget, SiteProfile, SubresourceIntegrity, Target, UnsignedContentAttestation, UnsignedWebsiteProfile, WebMediaProfile, WebsiteProfile, subject };
648
+ export type { AdvertisementSubject };
package/dist/index.mjs CHANGED
@@ -49,7 +49,12 @@ const OpCipContext = z.tuple([
49
49
  })
50
50
  ]);
51
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,}$/;
52
+ const DateTimeStamp = z.iso.datetime({
53
+ offset: true,
54
+ error: "Must be an xsd:dateTimeStamp string (e.g. 2024-01-01T00:00:00Z or 2024-01-01T00:00:00+09:00)"
55
+ });
56
+
57
+ const DNS_URI_PATTERN = /^dns:([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)*[a-zA-Z](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/;
53
58
  const OpId = z.string().regex(DNS_URI_PATTERN, {
54
59
  error: "Invalid OP ID: must be dns:<valid-domain>"
55
60
  });
@@ -92,8 +97,10 @@ const Certificate = z.object({
92
97
  "@context": OpCipContext,
93
98
  type: z.tuple([z.literal("VerifiableCredential"), z.literal("Certificate")]),
94
99
  issuer: OpId,
95
- validFrom: z.string().datetime().optional().describe("Validity period start date"),
96
- validUntil: z.string().datetime().optional().describe("Validity period end date"),
100
+ validFrom: DateTimeStamp.optional().describe(
101
+ "Validity period start and time"
102
+ ),
103
+ validUntil: DateTimeStamp.optional().describe("Validity period end and time"),
97
104
  credentialSubject: CertificateProperties
98
105
  });
99
106
 
@@ -117,8 +124,10 @@ const JapaneseExistenceCertificate = z.looseObject({
117
124
  type: z.tuple([z.literal("VerifiableCredential"), z.literal("Certificate")]),
118
125
  issuer: OpId,
119
126
  credentialSubject: JapaneseExistenceCertificateProperties,
120
- validFrom: z.string().datetime().optional().describe("Validity period start date"),
121
- validUntil: z.string().datetime().optional().describe("Validity period end date")
127
+ validFrom: DateTimeStamp.optional().describe(
128
+ "Validity period start and time"
129
+ ),
130
+ validUntil: DateTimeStamp.optional().describe("Validity period end and time")
122
131
  });
123
132
 
124
133
  const Page = z.object({
@@ -222,8 +231,10 @@ const subject$3 = z.object({
222
231
  headline: z.string().describe("Title of the advertorial."),
223
232
  description: z.string().describe("A description of the advertorial (string)."),
224
233
  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"),
234
+ datePublished: DateTimeStamp.optional().describe("Publication date and time"),
235
+ dateModified: DateTimeStamp.optional().describe(
236
+ "Last modified date and time"
237
+ ),
227
238
  author: z.array(z.string()).optional().describe("Author names"),
228
239
  editor: z.array(z.string()).optional().describe("Editor names"),
229
240
  sponsor: z.array(z.string()).optional().describe("Sponsor names"),
@@ -243,8 +254,10 @@ const subject$2 = z.object({
243
254
  headline: z.string().describe("Title of the content."),
244
255
  description: z.string().describe("A description of the content (plain text)."),
245
256
  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"),
257
+ datePublished: DateTimeStamp.optional().describe("Publication date and time"),
258
+ dateModified: DateTimeStamp.optional().describe(
259
+ "Last modified date and time"
260
+ ),
248
261
  author: z.array(z.string()).optional().describe("Author names"),
249
262
  editor: z.array(z.string()).optional().describe("Editor names"),
250
263
  genre: z.string().optional().describe("Genre")
@@ -335,17 +348,26 @@ const OpVc = z.looseObject({
335
348
  })
336
349
  });
337
350
 
338
- const OriginatorProfileSetItem = z.looseObject({
351
+ const OriginatorProfile = z.looseObject({
339
352
  core: z.string().describe("Core Profile"),
340
353
  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")
354
+ /** @deprecated 後方互換性のため 2026-11-01 まで非配列 WMP を許容。代わりに配列を使用してください。 */
355
+ media: z.union([z.string(), z.array(z.string())]).optional().describe(
356
+ `An array of Web Media Profile
357
+
358
+ @deprecated \u5F8C\u65B9\u4E92\u63DB\u6027\u306E\u305F\u3081 2026-11-01 \u307E\u3067\u975E\u914D\u5217 WMP \u3092\u8A31\u5BB9\u3002\u4EE3\u308F\u308A\u306B\u914D\u5217\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002
359
+ `
360
+ )
342
361
  });
343
- const OriginatorProfileSet = z.array(OriginatorProfileSetItem);
362
+ const OriginatorProfileSet = z.array(OriginatorProfile);
344
363
 
345
364
  const SiteProfile = z.looseObject({
346
- originators: z.array(OriginatorProfileSetItem).min(1),
365
+ originators: z.array(OriginatorProfile).min(1),
347
366
  sites: z.array(z.string().describe("Website Profile")).optional().describe("An array of Website Profile"),
348
- credential: z.string().optional().describe("Credential")
367
+ /** @deprecated 後方互換性のため 2026-11-01 まで許容。sites が優先され、存在しない場合に credential を使用。 */
368
+ credential: z.string().optional().describe(
369
+ "@deprecated \u5F8C\u65B9\u4E92\u63DB\u6027\u306E\u305F\u3081 2026-11-01 \u307E\u3067\u8A31\u5BB9\u3002sites \u304C\u512A\u5148\u3055\u308C\u3001\u5B58\u5728\u3057\u306A\u3044\u5834\u5408\u306B credential \u3092\u4F7F\u7528\u3002"
370
+ )
349
371
  });
350
372
 
351
373
  const deprecatedSubject = z.looseObject({
@@ -420,4 +442,4 @@ const WebMediaProfile = z.looseObject({
420
442
  credentialSubject: subject
421
443
  });
422
444
 
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 };
445
+ export { AdvertisementCA, AdvertorialCA, AllowedOrigin, AllowedUrl, ArticleCA, BasicTarget, Certificate, CertificationSystem, ContentAttestation, ContentAttestationSet, ContentAttestationSetItem, CoreProfile, DateTimeStamp, Description, ExternalResourceTarget, Image, JapaneseExistenceCertificate, JapaneseExistenceCertificateProperties, Jwk, Jwks, OpId, OpMeta, OpVc, OriginatorProfile, OriginatorProfileSet, Page, RawImage, RawTarget, SiteProfile, SubresourceIntegrity, Target, UnsignedContentAttestation, UnsignedWebsiteProfile, WebMediaProfile, WebsiteProfile, subject$5 as subject };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@originator-profile/model",
3
- "version": "0.5.0-beta.2",
3
+ "version": "0.5.0",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://docs.originator-profile.org",
6
6
  "repository": {
@@ -33,12 +33,12 @@
33
33
  "zod": "^4.3.6"
34
34
  },
35
35
  "devDependencies": {
36
- "eslint": "^9.25.1",
37
- "pkgroll": "^2.12.2",
38
- "typescript": "^5.8.3",
39
- "vitest": "^4.0.0",
40
- "@originator-profile/tsconfig": "0.5.0-beta.2",
41
- "eslint-config-originator-profile": "0.5.0-beta.2"
36
+ "eslint": "^10.1.0",
37
+ "pkgroll": "^2.27.0",
38
+ "typescript": "^6.0.2",
39
+ "vitest": "^4.1.2",
40
+ "@originator-profile/tsconfig": "0.5.0",
41
+ "eslint-config-originator-profile": "0.5.0"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "pkgroll --clean-dist --target=node20",