@learncard/helpers 1.0.13 → 1.0.15

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/helpers.d.ts CHANGED
@@ -1,13 +1,136 @@
1
- // Generated by dts-bundle-generator v6.10.0
1
+ // Generated by dts-bundle-generator v6.13.0
2
2
 
3
- /**
4
- * Determines whether or not a string is a valid hexadecimal string
5
- *
6
- * E.g. 'abc123' is valid hex, 'zzz' is not
7
- */
8
- export declare const isHex: (str: string) => boolean;
9
- /** Determines whether or not an object is an encrypted JWE */
10
- export declare const isEncrypted: (item: Record<string, any>) => item is {
3
+ declare const JWEValidator: z.ZodObject<{
4
+ protected: z.ZodString;
5
+ iv: z.ZodString;
6
+ ciphertext: z.ZodString;
7
+ tag: z.ZodString;
8
+ aad: z.ZodOptional<z.ZodString>;
9
+ recipients: z.ZodOptional<z.ZodArray<z.ZodObject<{
10
+ header: z.ZodObject<{
11
+ alg: z.ZodString;
12
+ iv: z.ZodString;
13
+ tag: z.ZodString;
14
+ epk: z.ZodOptional<z.ZodObject<{
15
+ kty: z.ZodOptional<z.ZodString>;
16
+ crv: z.ZodOptional<z.ZodString>;
17
+ x: z.ZodOptional<z.ZodString>;
18
+ y: z.ZodOptional<z.ZodOptional<z.ZodString>>;
19
+ n: z.ZodOptional<z.ZodOptional<z.ZodString>>;
20
+ d: z.ZodOptional<z.ZodString>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ kty?: string | undefined;
23
+ crv?: string | undefined;
24
+ x?: string | undefined;
25
+ y?: string | undefined;
26
+ n?: string | undefined;
27
+ d?: string | undefined;
28
+ }, {
29
+ kty?: string | undefined;
30
+ crv?: string | undefined;
31
+ x?: string | undefined;
32
+ y?: string | undefined;
33
+ n?: string | undefined;
34
+ d?: string | undefined;
35
+ }>>;
36
+ kid: z.ZodOptional<z.ZodString>;
37
+ apv: z.ZodOptional<z.ZodString>;
38
+ apu: z.ZodOptional<z.ZodString>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ epk?: {
41
+ kty?: string | undefined;
42
+ crv?: string | undefined;
43
+ x?: string | undefined;
44
+ y?: string | undefined;
45
+ n?: string | undefined;
46
+ d?: string | undefined;
47
+ } | undefined;
48
+ kid?: string | undefined;
49
+ apv?: string | undefined;
50
+ apu?: string | undefined;
51
+ alg: string;
52
+ iv: string;
53
+ tag: string;
54
+ }, {
55
+ epk?: {
56
+ kty?: string | undefined;
57
+ crv?: string | undefined;
58
+ x?: string | undefined;
59
+ y?: string | undefined;
60
+ n?: string | undefined;
61
+ d?: string | undefined;
62
+ } | undefined;
63
+ kid?: string | undefined;
64
+ apv?: string | undefined;
65
+ apu?: string | undefined;
66
+ alg: string;
67
+ iv: string;
68
+ tag: string;
69
+ }>;
70
+ encrypted_key: z.ZodString;
71
+ }, "strip", z.ZodTypeAny, {
72
+ header: {
73
+ epk?: {
74
+ kty?: string | undefined;
75
+ crv?: string | undefined;
76
+ x?: string | undefined;
77
+ y?: string | undefined;
78
+ n?: string | undefined;
79
+ d?: string | undefined;
80
+ } | undefined;
81
+ kid?: string | undefined;
82
+ apv?: string | undefined;
83
+ apu?: string | undefined;
84
+ alg: string;
85
+ iv: string;
86
+ tag: string;
87
+ };
88
+ encrypted_key: string;
89
+ }, {
90
+ header: {
91
+ epk?: {
92
+ kty?: string | undefined;
93
+ crv?: string | undefined;
94
+ x?: string | undefined;
95
+ y?: string | undefined;
96
+ n?: string | undefined;
97
+ d?: string | undefined;
98
+ } | undefined;
99
+ kid?: string | undefined;
100
+ apv?: string | undefined;
101
+ apu?: string | undefined;
102
+ alg: string;
103
+ iv: string;
104
+ tag: string;
105
+ };
106
+ encrypted_key: string;
107
+ }>, "many">>;
108
+ }, "strip", z.ZodTypeAny, {
109
+ aad?: string | undefined;
110
+ recipients?: {
111
+ header: {
112
+ epk?: {
113
+ kty?: string | undefined;
114
+ crv?: string | undefined;
115
+ x?: string | undefined;
116
+ y?: string | undefined;
117
+ n?: string | undefined;
118
+ d?: string | undefined;
119
+ } | undefined;
120
+ kid?: string | undefined;
121
+ apv?: string | undefined;
122
+ apu?: string | undefined;
123
+ alg: string;
124
+ iv: string;
125
+ tag: string;
126
+ };
127
+ encrypted_key: string;
128
+ }[] | undefined;
129
+ iv: string;
130
+ tag: string;
131
+ protected: string;
132
+ ciphertext: string;
133
+ }, {
11
134
  aad?: string | undefined;
12
135
  recipients?: {
13
136
  header: {
@@ -32,6 +155,15 @@ export declare const isEncrypted: (item: Record<string, any>) => item is {
32
155
  tag: string;
33
156
  protected: string;
34
157
  ciphertext: string;
35
- };
158
+ }>;
159
+ export type JWE = z.infer<typeof JWEValidator>;
160
+ /**
161
+ * Determines whether or not a string is a valid hexadecimal string
162
+ *
163
+ * E.g. 'abc123' is valid hex, 'zzz' is not
164
+ */
165
+ export declare const isHex: (str: string) => boolean;
166
+ /** Determines whether or not an object is an encrypted JWE */
167
+ export declare const isEncrypted: (item: Record<string, any>) => item is JWE;
36
168
 
37
169
  export {};
@@ -16,7 +16,10 @@ var __copyProps = (to, from, except, desc) => {
16
16
  }
17
17
  return to;
18
18
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
+ mod
22
+ ));
20
23
 
21
24
  // ../learn-card-types/dist/types.cjs.development.js
22
25
  var require_types_cjs_development = __commonJS({
@@ -98,6 +101,8 @@ var require_types_cjs_development = __commonJS({
98
101
  LCNProfileValidator: () => LCNProfileValidator,
99
102
  LCNSigningAuthorityForUserValidator: () => LCNSigningAuthorityForUserValidator,
100
103
  LCNSigningAuthorityValidator: () => LCNSigningAuthorityValidator,
104
+ PaginatedBoostRecipientsValidator: () => PaginatedBoostRecipientsValidator,
105
+ PaginatedBoostsValidator: () => PaginatedBoostsValidator,
101
106
  PaginatedConsentFlowContractsValidator: () => PaginatedConsentFlowContractsValidator,
102
107
  PaginatedConsentFlowDataValidator: () => PaginatedConsentFlowDataValidator,
103
108
  PaginatedConsentFlowTermsValidator: () => PaginatedConsentFlowTermsValidator,
@@ -898,11 +903,14 @@ var require_types_cjs_development = __commonJS({
898
903
  const parsedType = this._getType(input);
899
904
  if (parsedType !== ZodParsedType.string) {
900
905
  const ctx2 = this._getOrReturnCtx(input);
901
- addIssueToContext(ctx2, {
902
- code: ZodIssueCode.invalid_type,
903
- expected: ZodParsedType.string,
904
- received: ctx2.parsedType
905
- });
906
+ addIssueToContext(
907
+ ctx2,
908
+ {
909
+ code: ZodIssueCode.invalid_type,
910
+ expected: ZodParsedType.string,
911
+ received: ctx2.parsedType
912
+ }
913
+ );
906
914
  return INVALID;
907
915
  }
908
916
  const status = new ParseStatus();
@@ -1910,7 +1918,9 @@ var require_types_cjs_development = __commonJS({
1910
1918
  const value = ctx.data[key];
1911
1919
  pairs.push({
1912
1920
  key: { status: "valid", value: key },
1913
- value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
1921
+ value: catchall._parse(
1922
+ new ParseInputLazyPath(ctx, value, ctx.path, key)
1923
+ ),
1914
1924
  alwaysSet: key in ctx.data
1915
1925
  });
1916
1926
  }
@@ -3465,11 +3475,13 @@ var require_types_cjs_development = __commonJS({
3465
3475
  type: mod.string().optional(),
3466
3476
  narrative: mod.string().optional()
3467
3477
  });
3468
- var ImageValidator = mod.string().or(mod.object({
3469
- id: mod.string(),
3470
- type: mod.string(),
3471
- caption: mod.string().optional()
3472
- }));
3478
+ var ImageValidator = mod.string().or(
3479
+ mod.object({
3480
+ id: mod.string(),
3481
+ type: mod.string(),
3482
+ caption: mod.string().optional()
3483
+ })
3484
+ );
3473
3485
  var GeoCoordinatesValidator = mod.object({
3474
3486
  type: mod.string().min(1).or(mod.string().array().nonempty()),
3475
3487
  latitude: mod.number(),
@@ -3511,29 +3523,31 @@ var require_types_cjs_development = __commonJS({
3511
3523
  identifier: mod.string(),
3512
3524
  identifierType: IdentifierTypeValidator
3513
3525
  });
3514
- var ProfileValidator = mod.string().or(mod.object({
3515
- id: mod.string().optional(),
3516
- type: mod.string().or(mod.string().array().nonempty().optional()),
3517
- name: mod.string().optional(),
3518
- url: mod.string().optional(),
3519
- phone: mod.string().optional(),
3520
- description: mod.string().optional(),
3521
- endorsement: mod.any().array().optional(),
3522
- image: ImageValidator.optional(),
3523
- email: mod.string().email().optional(),
3524
- address: AddressValidator.optional(),
3525
- otherIdentifier: IdentifierEntryValidator.array().optional(),
3526
- official: mod.string().optional(),
3527
- parentOrg: mod.any().optional(),
3528
- familyName: mod.string().optional(),
3529
- givenName: mod.string().optional(),
3530
- additionalName: mod.string().optional(),
3531
- patronymicName: mod.string().optional(),
3532
- honorificPrefix: mod.string().optional(),
3533
- honorificSuffix: mod.string().optional(),
3534
- familyNamePrefix: mod.string().optional(),
3535
- dateOfBirth: mod.string().optional()
3536
- }).catchall(mod.any()));
3526
+ var ProfileValidator = mod.string().or(
3527
+ mod.object({
3528
+ id: mod.string().optional(),
3529
+ type: mod.string().or(mod.string().array().nonempty().optional()),
3530
+ name: mod.string().optional(),
3531
+ url: mod.string().optional(),
3532
+ phone: mod.string().optional(),
3533
+ description: mod.string().optional(),
3534
+ endorsement: mod.any().array().optional(),
3535
+ image: ImageValidator.optional(),
3536
+ email: mod.string().email().optional(),
3537
+ address: AddressValidator.optional(),
3538
+ otherIdentifier: IdentifierEntryValidator.array().optional(),
3539
+ official: mod.string().optional(),
3540
+ parentOrg: mod.any().optional(),
3541
+ familyName: mod.string().optional(),
3542
+ givenName: mod.string().optional(),
3543
+ additionalName: mod.string().optional(),
3544
+ patronymicName: mod.string().optional(),
3545
+ honorificPrefix: mod.string().optional(),
3546
+ honorificSuffix: mod.string().optional(),
3547
+ familyNamePrefix: mod.string().optional(),
3548
+ dateOfBirth: mod.string().optional()
3549
+ }).catchall(mod.any())
3550
+ );
3537
3551
  var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
3538
3552
  var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() }).catchall(mod.any());
3539
3553
  var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() }).catchall(mod.any());
@@ -3602,15 +3616,17 @@ var require_types_cjs_development = __commonJS({
3602
3616
  aad: mod.string().optional(),
3603
3617
  recipients: JWERecipientValidator.array().optional()
3604
3618
  });
3605
- var VerificationMethodValidator = mod.string().or(mod.object({
3606
- "@context": ContextValidator.optional(),
3607
- id: mod.string(),
3608
- type: mod.string(),
3609
- controller: mod.string(),
3610
- publicKeyJwk: JWKValidator.optional(),
3611
- publicKeyBase58: mod.string().optional(),
3612
- blockChainAccountId: mod.string().optional()
3613
- }).catchall(mod.any()));
3619
+ var VerificationMethodValidator = mod.string().or(
3620
+ mod.object({
3621
+ "@context": ContextValidator.optional(),
3622
+ id: mod.string(),
3623
+ type: mod.string(),
3624
+ controller: mod.string(),
3625
+ publicKeyJwk: JWKValidator.optional(),
3626
+ publicKeyBase58: mod.string().optional(),
3627
+ blockChainAccountId: mod.string().optional()
3628
+ }).catchall(mod.any())
3629
+ );
3614
3630
  var ServiceValidator = mod.object({
3615
3631
  id: mod.string(),
3616
3632
  type: mod.string().or(mod.string().array().nonempty()),
@@ -3808,7 +3824,9 @@ var require_types_cjs_development = __commonJS({
3808
3824
  name: mod.string().optional(),
3809
3825
  description: mod.string().optional(),
3810
3826
  image: ImageValidator.optional(),
3811
- credentialSubject: AchievementSubjectValidator.or(AchievementSubjectValidator.array()),
3827
+ credentialSubject: AchievementSubjectValidator.or(
3828
+ AchievementSubjectValidator.array()
3829
+ ),
3812
3830
  endorsement: UnsignedVCValidator.array().optional(),
3813
3831
  evidence: EvidenceValidator.array().optional()
3814
3832
  });
@@ -3867,7 +3885,7 @@ var require_types_cjs_development = __commonJS({
3867
3885
  websiteLink: mod.string().optional(),
3868
3886
  isServiceProfile: mod.boolean().default(false).optional(),
3869
3887
  type: mod.string().optional(),
3870
- notificationsWebhook: mod.string().url().startsWith("https://").optional()
3888
+ notificationsWebhook: mod.string().url().startsWith("http").optional()
3871
3889
  });
3872
3890
  var PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({
3873
3891
  records: LCNProfileValidator.array()
@@ -3894,11 +3912,17 @@ var require_types_cjs_development = __commonJS({
3894
3912
  status: LCNBoostStatus.optional(),
3895
3913
  autoConnectRecipients: mod.boolean().optional()
3896
3914
  });
3915
+ var PaginatedBoostsValidator = PaginationResponseValidator.extend({
3916
+ records: BoostValidator.array()
3917
+ });
3897
3918
  var BoostRecipientValidator = mod.object({
3898
3919
  to: LCNProfileValidator,
3899
3920
  from: mod.string(),
3900
3921
  received: mod.string().optional()
3901
3922
  });
3923
+ var PaginatedBoostRecipientsValidator = PaginationResponseValidator.extend({
3924
+ records: BoostRecipientValidator.array()
3925
+ });
3902
3926
  var LCNBoostClaimLinkSigningAuthorityValidator = mod.object({
3903
3927
  endpoint: mod.string(),
3904
3928
  name: mod.string(),
@@ -4031,7 +4055,9 @@ var require_types_cjs_development = __commonJS({
4031
4055
  ]);
4032
4056
  var ConsentFlowTransactionsQueryValidator = mod.object({
4033
4057
  terms: ConsentFlowTermsQueryValidator.optional(),
4034
- action: ConsentFlowTransactionActionValidator.or(ConsentFlowTransactionActionValidator.array()).optional(),
4058
+ action: ConsentFlowTransactionActionValidator.or(
4059
+ ConsentFlowTransactionActionValidator.array()
4060
+ ).optional(),
4035
4061
  date: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
4036
4062
  expiresAt: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
4037
4063
  oneTime: mod.boolean().optional()