@originator-profile/model 0.5.2 → 0.5.3

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.
@@ -361,78 +361,6 @@ const OriginatorProfile = z.looseObject({
361
361
  });
362
362
  const OriginatorProfileSet = z.array(OriginatorProfile);
363
363
 
364
- const ProfileAnnotationPolicy = z.object({
365
- id: z.url().describe("Profile Annotation Policy ID"),
366
- type: z.literal("ProfileAnnotationPolicy"),
367
- name: z.string().describe("Name of the Profile Annotation Policy"),
368
- description: z.string().optional().describe("Description"),
369
- ref: z.url().optional().describe(
370
- "A URL for people to read to find out more about the Profile Annotation Policy."
371
- )
372
- });
373
-
374
- const ProfileAnnotationProperties = z.looseObject({
375
- id: OpId.describe("OP ID of the subject"),
376
- type: z.string().describe("PA-specific subtype identifier"),
377
- name: z.string().optional().describe("PA name"),
378
- description: z.string().optional().describe("Description"),
379
- image: Image.optional(),
380
- annotationScheme: z.array(z.url()).optional().describe("URIs identifying related PA sets"),
381
- annotation: ProfileAnnotationPolicy
382
- });
383
-
384
- const ProfileAnnotation = z.looseObject({
385
- "@context": OpContextHead,
386
- type: z.tuple([
387
- z.literal("VerifiableCredential"),
388
- z.literal("ProfileAnnotation")
389
- ]),
390
- issuer: OpId,
391
- validFrom: DateTimeStamp.optional().describe(
392
- "Validity period start and time"
393
- ),
394
- validUntil: DateTimeStamp.optional().describe("Validity period end and time"),
395
- credentialSubject: ProfileAnnotationProperties
396
- });
397
-
398
- const AdvertisingQualityPAProperties = ProfileAnnotationProperties.extend({
399
- type: z.literal("AdvertisingQualityCertificate"),
400
- verifier: z.string().optional().describe("Verifier name")
401
- });
402
- const AdvertisingQualityPA = ProfileAnnotation.extend({
403
- "@context": OpCipContext,
404
- credentialSubject: AdvertisingQualityPAProperties
405
- });
406
-
407
- const JapaneseExistencePAProperties = ProfileAnnotationProperties.extend(
408
- {
409
- type: z.literal("JP-OrganizationExistenceCertificate"),
410
- corporateName: z.string().describe("Corporate name"),
411
- corporateNumber: z.string().describe("Corporate number"),
412
- postalCode: z.string().describe("Postal code"),
413
- addressCountry: z.string().describe("Country"),
414
- addressRegion: z.string().describe("Prefecture / State"),
415
- addressLocality: z.string().describe("City / Municipality"),
416
- streetAddress: z.string().describe("Street address")
417
- }
418
- );
419
- const JapaneseExistencePA = ProfileAnnotation.extend({
420
- "@context": OpCipContext,
421
- credentialSubject: JapaneseExistencePAProperties
422
- });
423
-
424
- const ProfileAnnotationIssuerRegistrationProperties = ProfileAnnotationProperties.extend({
425
- type: z.literal("ProfileAnnotationIssuerRegistration"),
426
- annotationIssuerName: z.string().describe("Name of the Profile Annotation Issuer"),
427
- annotationScheme: z.array(z.url()).describe(
428
- "URIs identifying Profile Annotations the issuer is authorized to issue"
429
- )
430
- });
431
- const ProfileAnnotationIssuerRegistration = ProfileAnnotation.extend({
432
- "@context": OpCipContext,
433
- credentialSubject: ProfileAnnotationIssuerRegistrationProperties
434
- });
435
-
436
364
  const SiteProfile = z.looseObject({
437
365
  originators: z.array(OriginatorProfile).min(1),
438
366
  sites: z.array(z.string().describe("Website Profile")).optional().describe("An array of Website Profile"),
@@ -480,37 +408,6 @@ const UnsignedWebsiteProfile = z.looseObject({
480
408
  ])
481
409
  });
482
410
 
483
- const UnsignedWebsiteProfileSet = z.array(UnsignedWebsiteProfile).min(1, "At least one UnsignedWebsiteProfile is required.").superRefine((value, ctx) => {
484
- const [head] = value;
485
- const languages = /* @__PURE__ */ new Set();
486
- for (const [index, uwsp] of value.entries()) {
487
- if (uwsp.issuer !== head.issuer) {
488
- ctx.addIssue({
489
- code: "custom",
490
- message: `UnsignedWebsiteProfile entries must share the same issuer (entries[${index}] differs from entries[0]).`,
491
- path: [index, "issuer"]
492
- });
493
- }
494
- if (uwsp.credentialSubject.id !== head.credentialSubject.id) {
495
- ctx.addIssue({
496
- code: "custom",
497
- message: `UnsignedWebsiteProfile entries must share the same credentialSubject.id (entries[${index}] differs from entries[0]).`,
498
- path: [index, "credentialSubject", "id"]
499
- });
500
- }
501
- const tail = uwsp["@context"].at(-1);
502
- const language = tail["@language"];
503
- if (languages.has(language)) {
504
- ctx.addIssue({
505
- code: "custom",
506
- message: `Duplicate @language "${language}" at entries[${index}].`,
507
- path: [index, "@context", uwsp["@context"].length - 1, "@language"]
508
- });
509
- }
510
- languages.add(language);
511
- }
512
- });
513
-
514
411
  const subject = z.looseObject({
515
412
  id: OpId.describe("OP ID of the WMP holding organization"),
516
413
  type: z.literal("OnlineBusiness"),
@@ -547,4 +444,4 @@ const WebMediaProfile = z.looseObject({
547
444
  credentialSubject: subject
548
445
  });
549
446
 
550
- export { AdvertisementCA, AdvertisingQualityPA, AdvertisingQualityPAProperties, AdvertorialCA, AllowedOrigin, AllowedUrl, ArticleCA, BasicTarget, Certificate, CertificationSystem, ContentAttestation, ContentAttestationSet, ContentAttestationSetItem, CoreProfile, DateTimeStamp, Description, ExternalResourceTarget, Image, JapaneseExistenceCertificate, JapaneseExistenceCertificateProperties, JapaneseExistencePA, JapaneseExistencePAProperties, Jwk, Jwks, OpId, OpMeta, OpVc, OriginatorProfile, OriginatorProfileSet, Page, ProfileAnnotation, ProfileAnnotationIssuerRegistration, ProfileAnnotationIssuerRegistrationProperties, ProfileAnnotationPolicy, ProfileAnnotationProperties, RawImage, RawTarget, SiteProfile, SubresourceIntegrity, Target, UnsignedContentAttestation, UnsignedWebsiteProfile, UnsignedWebsiteProfileSet, WebMediaProfile, WebsiteProfile, subject$5 as subject };
447
+ 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.2",
3
+ "version": "0.5.3",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://docs.originator-profile.org",
6
6
  "repository": {
@@ -13,8 +13,14 @@
13
13
  },
14
14
  "type": "module",
15
15
  "exports": {
16
- "types": "./dist/index.d.ts",
17
- "default": "./dist/index.js"
16
+ "require": {
17
+ "types": "./dist/index.d.cts",
18
+ "default": "./dist/index.cjs"
19
+ },
20
+ "import": {
21
+ "types": "./dist/index.d.mts",
22
+ "default": "./dist/index.mjs"
23
+ }
18
24
  },
19
25
  "files": [
20
26
  "dist",
@@ -27,15 +33,15 @@
27
33
  "zod": "^4.3.6"
28
34
  },
29
35
  "devDependencies": {
30
- "eslint": "10.2.0",
31
- "pkgroll": "2.27.0",
32
- "typescript": "6.0.2",
33
- "vitest": "4.1.4",
34
- "@originator-profile/tsconfig": "0.5.2",
35
- "eslint-config-originator-profile": "0.5.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.3",
41
+ "eslint-config-originator-profile": "0.5.3"
36
42
  },
37
43
  "scripts": {
38
- "build": "pkgroll --clean-dist",
44
+ "build": "pkgroll --clean-dist --target=node20",
39
45
  "test": "vitest run",
40
46
  "lint": "eslint --fix .",
41
47
  "type-check": "tsc --noEmit"