@learncard/core 8.0.3 → 8.0.4

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/core.d.ts CHANGED
@@ -1136,7 +1136,7 @@ declare const UnsignedVPValidator: z.ZodObject<{
1136
1136
  "@context": z.ZodArray<z.ZodString, "many">;
1137
1137
  id: z.ZodOptional<z.ZodString>;
1138
1138
  type: z.ZodArray<z.ZodString, "atleastone">;
1139
- verifiableCredential: z.ZodUnion<[
1139
+ verifiableCredential: z.ZodOptional<z.ZodUnion<[
1140
1140
  z.ZodObject<z.extendShape<{
1141
1141
  "@context": z.ZodArray<z.ZodString, "many">;
1142
1142
  id: z.ZodOptional<z.ZodString>;
@@ -2367,18 +2367,12 @@ declare const UnsignedVPValidator: z.ZodObject<{
2367
2367
  verificationMethod: string;
2368
2368
  }[];
2369
2369
  }>, "many">
2370
- ]>;
2370
+ ]>>;
2371
2371
  holder: z.ZodOptional<z.ZodString>;
2372
2372
  }, "strip", z.ZodAny, {
2373
2373
  [x: string]: any;
2374
2374
  id?: string | undefined;
2375
- holder?: string | undefined;
2376
- type: [
2377
- string,
2378
- ...string[]
2379
- ];
2380
- "@context": string[];
2381
- verifiableCredential: {
2375
+ verifiableCredential?: {
2382
2376
  [x: string]: any;
2383
2377
  id?: string | undefined;
2384
2378
  expirationDate?: string | undefined;
@@ -2596,17 +2590,17 @@ declare const UnsignedVPValidator: z.ZodObject<{
2596
2590
  proofPurpose: string;
2597
2591
  verificationMethod: string;
2598
2592
  }[];
2599
- }[];
2600
- }, {
2601
- [x: string]: any;
2602
- id?: string | undefined;
2593
+ }[] | undefined;
2603
2594
  holder?: string | undefined;
2604
2595
  type: [
2605
2596
  string,
2606
2597
  ...string[]
2607
2598
  ];
2608
2599
  "@context": string[];
2609
- verifiableCredential: {
2600
+ }, {
2601
+ [x: string]: any;
2602
+ id?: string | undefined;
2603
+ verifiableCredential?: {
2610
2604
  [x: string]: any;
2611
2605
  id?: string | undefined;
2612
2606
  expirationDate?: string | undefined;
@@ -2824,14 +2818,20 @@ declare const UnsignedVPValidator: z.ZodObject<{
2824
2818
  proofPurpose: string;
2825
2819
  verificationMethod: string;
2826
2820
  }[];
2827
- }[];
2821
+ }[] | undefined;
2822
+ holder?: string | undefined;
2823
+ type: [
2824
+ string,
2825
+ ...string[]
2826
+ ];
2827
+ "@context": string[];
2828
2828
  }>;
2829
2829
  export declare type UnsignedVP = z.infer<typeof UnsignedVPValidator>;
2830
2830
  declare const VPValidator: z.ZodObject<z.extendShape<{
2831
2831
  "@context": z.ZodArray<z.ZodString, "many">;
2832
2832
  id: z.ZodOptional<z.ZodString>;
2833
2833
  type: z.ZodArray<z.ZodString, "atleastone">;
2834
- verifiableCredential: z.ZodUnion<[
2834
+ verifiableCredential: z.ZodOptional<z.ZodUnion<[
2835
2835
  z.ZodObject<z.extendShape<{
2836
2836
  "@context": z.ZodArray<z.ZodString, "many">;
2837
2837
  id: z.ZodOptional<z.ZodString>;
@@ -4062,7 +4062,7 @@ declare const VPValidator: z.ZodObject<z.extendShape<{
4062
4062
  verificationMethod: string;
4063
4063
  }[];
4064
4064
  }>, "many">
4065
- ]>;
4065
+ ]>>;
4066
4066
  holder: z.ZodOptional<z.ZodString>;
4067
4067
  }, {
4068
4068
  proof: z.ZodUnion<[
@@ -4130,34 +4130,7 @@ declare const VPValidator: z.ZodObject<z.extendShape<{
4130
4130
  }>, "strip", z.ZodAny, {
4131
4131
  [x: string]: any;
4132
4132
  id?: string | undefined;
4133
- holder?: string | undefined;
4134
- type: [
4135
- string,
4136
- ...string[]
4137
- ];
4138
- "@context": string[];
4139
- proof: {
4140
- [x: string]: any;
4141
- challenge?: string | undefined;
4142
- domain?: string | undefined;
4143
- nonce?: string | undefined;
4144
- jws?: string | undefined;
4145
- type: string;
4146
- created: string;
4147
- proofPurpose: string;
4148
- verificationMethod: string;
4149
- } | {
4150
- [x: string]: any;
4151
- challenge?: string | undefined;
4152
- domain?: string | undefined;
4153
- nonce?: string | undefined;
4154
- jws?: string | undefined;
4155
- type: string;
4156
- created: string;
4157
- proofPurpose: string;
4158
- verificationMethod: string;
4159
- }[];
4160
- verifiableCredential: {
4133
+ verifiableCredential?: {
4161
4134
  [x: string]: any;
4162
4135
  id?: string | undefined;
4163
4136
  expirationDate?: string | undefined;
@@ -4375,10 +4348,7 @@ declare const VPValidator: z.ZodObject<z.extendShape<{
4375
4348
  proofPurpose: string;
4376
4349
  verificationMethod: string;
4377
4350
  }[];
4378
- }[];
4379
- }, {
4380
- [x: string]: any;
4381
- id?: string | undefined;
4351
+ }[] | undefined;
4382
4352
  holder?: string | undefined;
4383
4353
  type: [
4384
4354
  string,
@@ -4406,7 +4376,10 @@ declare const VPValidator: z.ZodObject<z.extendShape<{
4406
4376
  proofPurpose: string;
4407
4377
  verificationMethod: string;
4408
4378
  }[];
4409
- verifiableCredential: {
4379
+ }, {
4380
+ [x: string]: any;
4381
+ id?: string | undefined;
4382
+ verifiableCredential?: {
4410
4383
  [x: string]: any;
4411
4384
  id?: string | undefined;
4412
4385
  expirationDate?: string | undefined;
@@ -4624,6 +4597,33 @@ declare const VPValidator: z.ZodObject<z.extendShape<{
4624
4597
  proofPurpose: string;
4625
4598
  verificationMethod: string;
4626
4599
  }[];
4600
+ }[] | undefined;
4601
+ holder?: string | undefined;
4602
+ type: [
4603
+ string,
4604
+ ...string[]
4605
+ ];
4606
+ "@context": string[];
4607
+ proof: {
4608
+ [x: string]: any;
4609
+ challenge?: string | undefined;
4610
+ domain?: string | undefined;
4611
+ nonce?: string | undefined;
4612
+ jws?: string | undefined;
4613
+ type: string;
4614
+ created: string;
4615
+ proofPurpose: string;
4616
+ verificationMethod: string;
4617
+ } | {
4618
+ [x: string]: any;
4619
+ challenge?: string | undefined;
4620
+ domain?: string | undefined;
4621
+ nonce?: string | undefined;
4622
+ jws?: string | undefined;
4623
+ type: string;
4624
+ created: string;
4625
+ proofPurpose: string;
4626
+ verificationMethod: string;
4627
4627
  }[];
4628
4628
  }>;
4629
4629
  export declare type VP = z.infer<typeof VPValidator>;
@@ -4954,6 +4954,11 @@ export declare type VcTemplates = {
4954
4954
  criteriaNarrative?: string;
4955
4955
  issuanceDate?: string;
4956
4956
  };
4957
+ jff2: {
4958
+ did?: string;
4959
+ subject?: string;
4960
+ issuanceDate?: string;
4961
+ };
4957
4962
  };
4958
4963
  /** @group VC Templates Plugin */
4959
4964
  export declare type NewCredentialFunction = (args?: DiscriminatedUnionize<VcTemplates>) => UnsignedVC;
package/dist/core.esm.js CHANGED
@@ -41450,6 +41450,47 @@ var VC_TEMPLATES = {
41450
41450
  name: achievementName
41451
41451
  }
41452
41452
  }
41453
+ }),
41454
+ jff2: ({
41455
+ did = "did:example:d23dd687a7dc6787646f2eb98d0",
41456
+ subject = "did:example:d23dd687a7dc6787646f2eb98d0",
41457
+ issuanceDate = "2020-08-19T21:41:50Z"
41458
+ } = {}) => ({
41459
+ "@context": [
41460
+ "https://www.w3.org/2018/credentials/v1",
41461
+ "https://purl.imsglobal.org/spec/ob/v3p0/context.json",
41462
+ "https://w3id.org/security/suites/ed25519-2020/v1"
41463
+ ],
41464
+ id: "urn:uuid:a63a60be-f4af-491c-87fc-2c8fd3007a58",
41465
+ type: ["VerifiableCredential", "OpenBadgeCredential"],
41466
+ name: "JFF x vc-edu PlugFest 2 Interoperability",
41467
+ issuer: {
41468
+ type: ["Profile"],
41469
+ id: did,
41470
+ name: "Jobs for the Future (JFF)",
41471
+ image: {
41472
+ id: "https://w3c-ccg.github.io/vc-ed/plugfest-1-2022/images/JFF_LogoLockup.png",
41473
+ type: "Image"
41474
+ }
41475
+ },
41476
+ issuanceDate,
41477
+ credentialSubject: {
41478
+ type: ["AchievementSubject"],
41479
+ id: subject,
41480
+ achievement: {
41481
+ id: "urn:uuid:bd6d9316-f7ae-4073-a1e5-2f7f5bd22922",
41482
+ type: ["Achievement"],
41483
+ name: "JFF x vc-edu PlugFest 2 Interoperability",
41484
+ description: "This credential solution supports the use of OBv3 and w3c Verifiable Credentials and is interoperable with at least two other solutions. This was demonstrated successfully during JFF x vc-edu PlugFest 2.",
41485
+ criteria: {
41486
+ narrative: "Solutions providers earned this badge by demonstrating interoperability between multiple providers based on the OBv3 candidate final standard, with some additional required fields. Credential issuers earning this badge successfully issued a credential into at least two wallets. Wallet implementers earning this badge successfully displayed credentials issued by at least two different credential issuers."
41487
+ },
41488
+ image: {
41489
+ id: "https://w3c-ccg.github.io/vc-ed/plugfest-2-2022/images/JFF-VC-EDU-PLUGFEST2-badge-image.png",
41490
+ type: "Image"
41491
+ }
41492
+ }
41493
+ }
41453
41494
  })
41454
41495
  };
41455
41496
 
@@ -46053,7 +46094,7 @@ var UnsignedVPValidator = mod.object({
46053
46094
  "@context": ContextValidator,
46054
46095
  id: mod.string().optional(),
46055
46096
  type: mod.string().array().nonempty(),
46056
- verifiableCredential: VCValidator.or(VCValidator.array()),
46097
+ verifiableCredential: VCValidator.or(VCValidator.array()).optional(),
46057
46098
  holder: mod.string().optional()
46058
46099
  }).catchall(mod.any());
46059
46100
  var VPValidator = UnsignedVPValidator.extend({