@originator-profile/model 0.5.0-beta.3 → 0.5.1

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
@@ -56,7 +56,7 @@ const DateTimeStamp = zod.z.iso.datetime({
56
56
  error: "Must be an xsd:dateTimeStamp string (e.g. 2024-01-01T00:00:00Z or 2024-01-01T00:00:00+09:00)"
57
57
  });
58
58
 
59
- const DNS_URI_PATTERN = /^dns:([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
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])?$/;
60
60
  const OpId = zod.z.string().regex(DNS_URI_PATTERN, {
61
61
  error: "Invalid OP ID: must be dns:<valid-domain>"
62
62
  });
@@ -400,13 +400,15 @@ const WebsiteProfile = zod.z.looseObject({
400
400
  credentialSubject: zod.z.union([deprecatedSubject, subject$1])
401
401
  });
402
402
 
403
- const UnsignedWebsiteProfile = WebsiteProfile.and(
404
- zod.z.object({
405
- credentialSubject: zod.z.object({
403
+ const UnsignedWebsiteProfile = zod.z.looseObject({
404
+ ...WebsiteProfile.shape,
405
+ credentialSubject: zod.z.union([
406
+ ...WebsiteProfile.shape.credentialSubject.options,
407
+ WebsiteProfile.shape.credentialSubject.options.at(-1)?.safeExtend({
406
408
  image: zod.z.union([RawImage, Image])
407
- })
408
- })
409
- );
409
+ }) ?? zod.z.never()
410
+ ])
411
+ });
410
412
 
411
413
  const subject = zod.z.looseObject({
412
414
  id: OpId.describe("OP ID of the WMP holding organization"),
package/dist/index.d.cts CHANGED
@@ -524,12 +524,7 @@ declare const Target: z.ZodUnion<readonly [z.ZodObject<{
524
524
  }, z.core.$loose>]>;
525
525
  type Target = z.infer<typeof Target>;
526
526
 
527
- declare const UnsignedWebsiteProfile: z.ZodIntersection<z.ZodObject<{
528
- "@context": z.ZodTuple<[z.ZodLiteral<"https://www.w3.org/ns/credentials/v2">, z.ZodLiteral<"https://originator-profile.org/ns/credentials/v1">, z.ZodLiteral<"https://originator-profile.org/ns/cip/v1">, z.ZodObject<{
529
- "@language": z.ZodString;
530
- }, z.core.$strip>], null>;
531
- type: z.ZodTuple<[z.ZodLiteral<"VerifiableCredential">, z.ZodLiteral<"WebsiteProfile">], null>;
532
- issuer: z.ZodString;
527
+ declare const UnsignedWebsiteProfile: z.ZodObject<{
533
528
  credentialSubject: z.ZodUnion<readonly [z.ZodObject<{
534
529
  id: z.ZodURL;
535
530
  type: z.ZodLiteral<"WebSite">;
@@ -550,9 +545,12 @@ declare const UnsignedWebsiteProfile: z.ZodIntersection<z.ZodObject<{
550
545
  }, z.core.$strip>>;
551
546
  description: z.ZodOptional<z.ZodString>;
552
547
  allowedOrigin: z.ZodUnion<readonly [z.ZodCustomStringFormat<"origin">, z.ZodArray<z.ZodCustomStringFormat<"origin">>]>;
553
- }, z.core.$loose>]>;
554
- }, z.core.$loose>, z.ZodObject<{
555
- credentialSubject: z.ZodObject<{
548
+ }, z.core.$loose>, z.ZodObject<{
549
+ id: z.ZodURL;
550
+ type: z.ZodLiteral<"WebSite">;
551
+ name: z.ZodString;
552
+ description: z.ZodOptional<z.ZodString>;
553
+ url: z.ZodUnion<readonly [z.ZodCustomStringFormat<"origin">, z.ZodArray<z.ZodCustomStringFormat<"origin">>]>;
556
554
  image: z.ZodUnion<readonly [z.ZodObject<{
557
555
  id: z.ZodURL;
558
556
  content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
@@ -560,8 +558,26 @@ declare const UnsignedWebsiteProfile: z.ZodIntersection<z.ZodObject<{
560
558
  id: z.ZodURL;
561
559
  digestSRI: z.ZodOptional<z.ZodCustomStringFormat<"sri">>;
562
560
  }, z.core.$strip>]>;
563
- }, z.core.$strip>;
564
- }, z.core.$strip>>;
561
+ }, z.core.$loose> | z.ZodObject<{
562
+ id: z.ZodURL;
563
+ type: z.ZodLiteral<"WebSite">;
564
+ name: z.ZodString;
565
+ description: z.ZodOptional<z.ZodString>;
566
+ allowedOrigin: z.ZodUnion<readonly [z.ZodCustomStringFormat<"origin">, z.ZodArray<z.ZodCustomStringFormat<"origin">>]>;
567
+ image: z.ZodUnion<readonly [z.ZodObject<{
568
+ id: z.ZodURL;
569
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
570
+ }, z.core.$strip>, z.ZodObject<{
571
+ id: z.ZodURL;
572
+ digestSRI: z.ZodOptional<z.ZodCustomStringFormat<"sri">>;
573
+ }, z.core.$strip>]>;
574
+ }, z.core.$loose> | z.ZodNever]>;
575
+ "@context": z.ZodTuple<[z.ZodLiteral<"https://www.w3.org/ns/credentials/v2">, z.ZodLiteral<"https://originator-profile.org/ns/credentials/v1">, z.ZodLiteral<"https://originator-profile.org/ns/cip/v1">, z.ZodObject<{
576
+ "@language": z.ZodString;
577
+ }, z.core.$strip>], null>;
578
+ type: z.ZodTuple<[z.ZodLiteral<"VerifiableCredential">, z.ZodLiteral<"WebsiteProfile">], null>;
579
+ issuer: z.ZodString;
580
+ }, z.core.$loose>;
565
581
  type UnsignedWebsiteProfile = z.infer<typeof UnsignedWebsiteProfile>;
566
582
 
567
583
  declare const WebMediaProfile: z.ZodObject<{
@@ -644,4 +660,5 @@ declare const WebsiteProfile: z.ZodObject<{
644
660
  }, z.core.$loose>;
645
661
  type WebsiteProfile = z.infer<typeof WebsiteProfile>;
646
662
 
647
- export { AdvertisementCA, type AdvertisementSubject, 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 };
663
+ 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 };
664
+ export type { AdvertisementSubject };
package/dist/index.d.mts CHANGED
@@ -524,12 +524,7 @@ declare const Target: z.ZodUnion<readonly [z.ZodObject<{
524
524
  }, z.core.$loose>]>;
525
525
  type Target = z.infer<typeof Target>;
526
526
 
527
- declare const UnsignedWebsiteProfile: z.ZodIntersection<z.ZodObject<{
528
- "@context": z.ZodTuple<[z.ZodLiteral<"https://www.w3.org/ns/credentials/v2">, z.ZodLiteral<"https://originator-profile.org/ns/credentials/v1">, z.ZodLiteral<"https://originator-profile.org/ns/cip/v1">, z.ZodObject<{
529
- "@language": z.ZodString;
530
- }, z.core.$strip>], null>;
531
- type: z.ZodTuple<[z.ZodLiteral<"VerifiableCredential">, z.ZodLiteral<"WebsiteProfile">], null>;
532
- issuer: z.ZodString;
527
+ declare const UnsignedWebsiteProfile: z.ZodObject<{
533
528
  credentialSubject: z.ZodUnion<readonly [z.ZodObject<{
534
529
  id: z.ZodURL;
535
530
  type: z.ZodLiteral<"WebSite">;
@@ -550,9 +545,12 @@ declare const UnsignedWebsiteProfile: z.ZodIntersection<z.ZodObject<{
550
545
  }, z.core.$strip>>;
551
546
  description: z.ZodOptional<z.ZodString>;
552
547
  allowedOrigin: z.ZodUnion<readonly [z.ZodCustomStringFormat<"origin">, z.ZodArray<z.ZodCustomStringFormat<"origin">>]>;
553
- }, z.core.$loose>]>;
554
- }, z.core.$loose>, z.ZodObject<{
555
- credentialSubject: z.ZodObject<{
548
+ }, z.core.$loose>, z.ZodObject<{
549
+ id: z.ZodURL;
550
+ type: z.ZodLiteral<"WebSite">;
551
+ name: z.ZodString;
552
+ description: z.ZodOptional<z.ZodString>;
553
+ url: z.ZodUnion<readonly [z.ZodCustomStringFormat<"origin">, z.ZodArray<z.ZodCustomStringFormat<"origin">>]>;
556
554
  image: z.ZodUnion<readonly [z.ZodObject<{
557
555
  id: z.ZodURL;
558
556
  content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
@@ -560,8 +558,26 @@ declare const UnsignedWebsiteProfile: z.ZodIntersection<z.ZodObject<{
560
558
  id: z.ZodURL;
561
559
  digestSRI: z.ZodOptional<z.ZodCustomStringFormat<"sri">>;
562
560
  }, z.core.$strip>]>;
563
- }, z.core.$strip>;
564
- }, z.core.$strip>>;
561
+ }, z.core.$loose> | z.ZodObject<{
562
+ id: z.ZodURL;
563
+ type: z.ZodLiteral<"WebSite">;
564
+ name: z.ZodString;
565
+ description: z.ZodOptional<z.ZodString>;
566
+ allowedOrigin: z.ZodUnion<readonly [z.ZodCustomStringFormat<"origin">, z.ZodArray<z.ZodCustomStringFormat<"origin">>]>;
567
+ image: z.ZodUnion<readonly [z.ZodObject<{
568
+ id: z.ZodURL;
569
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
570
+ }, z.core.$strip>, z.ZodObject<{
571
+ id: z.ZodURL;
572
+ digestSRI: z.ZodOptional<z.ZodCustomStringFormat<"sri">>;
573
+ }, z.core.$strip>]>;
574
+ }, z.core.$loose> | z.ZodNever]>;
575
+ "@context": z.ZodTuple<[z.ZodLiteral<"https://www.w3.org/ns/credentials/v2">, z.ZodLiteral<"https://originator-profile.org/ns/credentials/v1">, z.ZodLiteral<"https://originator-profile.org/ns/cip/v1">, z.ZodObject<{
576
+ "@language": z.ZodString;
577
+ }, z.core.$strip>], null>;
578
+ type: z.ZodTuple<[z.ZodLiteral<"VerifiableCredential">, z.ZodLiteral<"WebsiteProfile">], null>;
579
+ issuer: z.ZodString;
580
+ }, z.core.$loose>;
565
581
  type UnsignedWebsiteProfile = z.infer<typeof UnsignedWebsiteProfile>;
566
582
 
567
583
  declare const WebMediaProfile: z.ZodObject<{
@@ -644,4 +660,5 @@ declare const WebsiteProfile: z.ZodObject<{
644
660
  }, z.core.$loose>;
645
661
  type WebsiteProfile = z.infer<typeof WebsiteProfile>;
646
662
 
647
- export { AdvertisementCA, type AdvertisementSubject, 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 };
663
+ 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 };
664
+ export type { AdvertisementSubject };
package/dist/index.mjs CHANGED
@@ -54,7 +54,7 @@ const DateTimeStamp = z.iso.datetime({
54
54
  error: "Must be an xsd:dateTimeStamp string (e.g. 2024-01-01T00:00:00Z or 2024-01-01T00:00:00+09:00)"
55
55
  });
56
56
 
57
- const DNS_URI_PATTERN = /^dns:([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
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])?$/;
58
58
  const OpId = z.string().regex(DNS_URI_PATTERN, {
59
59
  error: "Invalid OP ID: must be dns:<valid-domain>"
60
60
  });
@@ -398,13 +398,15 @@ const WebsiteProfile = z.looseObject({
398
398
  credentialSubject: z.union([deprecatedSubject, subject$1])
399
399
  });
400
400
 
401
- const UnsignedWebsiteProfile = WebsiteProfile.and(
402
- z.object({
403
- credentialSubject: z.object({
401
+ const UnsignedWebsiteProfile = z.looseObject({
402
+ ...WebsiteProfile.shape,
403
+ credentialSubject: z.union([
404
+ ...WebsiteProfile.shape.credentialSubject.options,
405
+ WebsiteProfile.shape.credentialSubject.options.at(-1)?.safeExtend({
404
406
  image: z.union([RawImage, Image])
405
- })
406
- })
407
- );
407
+ }) ?? z.never()
408
+ ])
409
+ });
408
410
 
409
411
  const subject = z.looseObject({
410
412
  id: OpId.describe("OP ID of the WMP holding organization"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@originator-profile/model",
3
- "version": "0.5.0-beta.3",
3
+ "version": "0.5.1",
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.3",
41
- "eslint-config-originator-profile": "0.5.0-beta.3"
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.1",
41
+ "eslint-config-originator-profile": "0.5.1"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "pkgroll --clean-dist --target=node20",