@learncard/vc-api-plugin 1.0.51 → 1.0.53

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.
@@ -4438,7 +4438,14 @@ var RegExpValidator = z.instanceof(RegExp).or(
4438
4438
  }
4439
4439
  })
4440
4440
  );
4441
- var StringQuery = z.string().or(z.object({ $in: z.string().array() })).or(z.object({ $regex: RegExpValidator }));
4441
+ var BaseStringQuery = z.string().or(z.object({ $in: z.string().array() })).or(z.object({ $regex: RegExpValidator }));
4442
+ var StringQuery = z.union([
4443
+ BaseStringQuery,
4444
+ z.object({
4445
+ $or: BaseStringQuery.array()
4446
+ })
4447
+ ]);
4448
+ extendZodWithOpenApi(z);
4442
4449
  var LCNProfileDisplayValidator = z.object({
4443
4450
  backgroundColor: z.string().optional(),
4444
4451
  backgroundImage: z.string().optional(),
@@ -4596,7 +4603,7 @@ var BoostValidator = z.object({
4596
4603
  claimPermissions: BoostPermissionsValidator.optional(),
4597
4604
  allowAnyoneToCreateChildren: z.boolean().optional()
4598
4605
  });
4599
- var BoostQueryValidator = z.object({
4606
+ var BaseBoostQueryValidator = z.object({
4600
4607
  uri: StringQuery,
4601
4608
  name: StringQuery,
4602
4609
  type: StringQuery,
@@ -4605,6 +4612,12 @@ var BoostQueryValidator = z.object({
4605
4612
  status: LCNBoostStatus.or(z.object({ $in: LCNBoostStatus.array() })),
4606
4613
  autoConnectRecipients: z.boolean()
4607
4614
  }).partial();
4615
+ var BoostQueryValidator = z.union([
4616
+ z.object({
4617
+ $or: BaseBoostQueryValidator.array()
4618
+ }),
4619
+ BaseBoostQueryValidator
4620
+ ]);
4608
4621
  var PaginatedBoostsValidator = PaginationResponseValidator.extend({
4609
4622
  records: BoostValidator.array()
4610
4623
  });
@@ -4660,11 +4673,25 @@ var ConsentFlowTermsStatusValidator = z.enum(["live", "stale", "withdrawn"]);
4660
4673
  var ConsentFlowContractValidator = z.object({
4661
4674
  read: z.object({
4662
4675
  anonymize: z.boolean().optional(),
4663
- credentials: z.object({ categories: z.record(z.object({ required: z.boolean(), defaultEnabled: z.boolean().optional() })).default({}) }).default({}),
4676
+ credentials: z.object({
4677
+ categories: z.record(
4678
+ z.object({
4679
+ required: z.boolean(),
4680
+ defaultEnabled: z.boolean().optional()
4681
+ })
4682
+ ).default({})
4683
+ }).default({}),
4664
4684
  personal: z.record(z.object({ required: z.boolean(), defaultEnabled: z.boolean().optional() })).default({})
4665
4685
  }).default({}),
4666
4686
  write: z.object({
4667
- credentials: z.object({ categories: z.record(z.object({ required: z.boolean(), defaultEnabled: z.boolean().optional() })).default({}) }).default({}),
4687
+ credentials: z.object({
4688
+ categories: z.record(
4689
+ z.object({
4690
+ required: z.boolean(),
4691
+ defaultEnabled: z.boolean().optional()
4692
+ })
4693
+ ).default({})
4694
+ }).default({}),
4668
4695
  personal: z.record(z.object({ required: z.boolean(), defaultEnabled: z.boolean().optional() })).default({})
4669
4696
  }).default({})
4670
4697
  });
@@ -4807,6 +4834,17 @@ var ConsentFlowTransactionValidator = z.object({
4807
4834
  var PaginatedConsentFlowTransactionsValidator = PaginationResponseValidator.extend({
4808
4835
  records: ConsentFlowTransactionValidator.array()
4809
4836
  });
4837
+ var BaseSkillFrameworkQueryValidator = z.object({
4838
+ id: StringQuery,
4839
+ name: StringQuery,
4840
+ description: StringQuery,
4841
+ sourceURI: StringQuery,
4842
+ status: StringQuery
4843
+ }).partial();
4844
+ var SkillFrameworkQueryValidator = z.union([
4845
+ z.object({ $or: BaseSkillFrameworkQueryValidator.array() }),
4846
+ BaseSkillFrameworkQueryValidator
4847
+ ]);
4810
4848
  var ContractCredentialValidator = z.object({
4811
4849
  credentialUri: z.string(),
4812
4850
  termsUri: z.string(),
@@ -4841,7 +4879,13 @@ var LCNInboxContactMethodValidator = z.object({
4841
4879
  type: z.string(),
4842
4880
  value: z.string()
4843
4881
  });
4844
- var LCNInboxStatusEnumValidator = z.enum(["PENDING", "DELIVERED", "CLAIMED", "EXPIRED"]);
4882
+ var LCNInboxStatusEnumValidator = z.enum([
4883
+ "PENDING",
4884
+ "ISSUED",
4885
+ "EXPIRED",
4886
+ "DELIVERED",
4887
+ "CLAIMED"
4888
+ ]);
4845
4889
  var LCNNotificationInboxValidator = z.object({
4846
4890
  issuanceId: z.string(),
4847
4891
  status: LCNInboxStatusEnumValidator,
@@ -4939,11 +4983,19 @@ var ContactMethodVerificationValidator = z.object({
4939
4983
  var SetPrimaryContactMethodValidator = z.object({
4940
4984
  contactMethodId: z.string()
4941
4985
  });
4986
+ var CreateContactMethodSessionValidator = z.object({
4987
+ contactMethod: ContactMethodVerificationRequestValidator,
4988
+ otpChallenge: z.string()
4989
+ });
4990
+ var CreateContactMethodSessionResponseValidator = z.object({
4991
+ sessionJwt: z.string()
4992
+ });
4942
4993
  var InboxCredentialValidator = z.object({
4943
4994
  id: z.string(),
4944
4995
  credential: z.string(),
4945
4996
  isSigned: z.boolean(),
4946
4997
  currentStatus: LCNInboxStatusEnumValidator,
4998
+ isAccepted: z.boolean().optional(),
4947
4999
  expiresAt: z.string(),
4948
5000
  createdAt: z.string(),
4949
5001
  issuerDid: z.string(),
@@ -4962,6 +5014,7 @@ var InboxCredentialQueryValidator = z.object({
4962
5014
  currentStatus: LCNInboxStatusEnumValidator,
4963
5015
  id: z.string(),
4964
5016
  isSigned: z.boolean(),
5017
+ isAccepted: z.boolean().optional(),
4965
5018
  issuerDid: z.string()
4966
5019
  }).partial();
4967
5020
  var IssueInboxSigningAuthorityValidator = z.object({
@@ -4970,31 +5023,55 @@ var IssueInboxSigningAuthorityValidator = z.object({
4970
5023
  });
4971
5024
  var IssueInboxCredentialValidator = z.object({
4972
5025
  recipient: ContactMethodQueryValidator.describe("The recipient of the credential"),
4973
- credential: VCValidator.passthrough().or(VPValidator.passthrough()).or(UnsignedVCValidator.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),
5026
+ credential: VCValidator.passthrough().or(VPValidator.passthrough()).or(UnsignedVCValidator.passthrough()).describe(
5027
+ "The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."
5028
+ ),
4974
5029
  configuration: z.object({
4975
- signingAuthority: IssueInboxSigningAuthorityValidator.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),
5030
+ signingAuthority: IssueInboxSigningAuthorityValidator.optional().describe(
5031
+ "The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."
5032
+ ),
4976
5033
  webhookUrl: z.string().url().optional().describe("The webhook URL to receive credential issuance events."),
4977
5034
  expiresInDays: z.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),
4978
5035
  delivery: z.object({
4979
- suppress: z.boolean().optional().default(false).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),
5036
+ suppress: z.boolean().optional().default(false).describe(
5037
+ "Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."
5038
+ ),
4980
5039
  template: z.object({
4981
- id: z.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),
5040
+ id: z.enum(["universal-inbox-claim"]).optional().describe(
5041
+ "The template ID to use for the credential delivery. If not provided, the default template will be used."
5042
+ ),
4982
5043
  model: z.object({
4983
5044
  issuer: z.object({
4984
- name: z.string().optional().describe('The name of the organization (e.g., "State University").'),
5045
+ name: z.string().optional().describe(
5046
+ 'The name of the organization (e.g., "State University").'
5047
+ ),
4985
5048
  logoUrl: z.string().url().optional().describe("The URL of the organization's logo.")
4986
5049
  }).optional(),
4987
5050
  credential: z.object({
4988
- name: z.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),
4989
- type: z.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')
5051
+ name: z.string().optional().describe(
5052
+ 'The name of the credential (e.g., "Bachelor of Science").'
5053
+ ),
5054
+ type: z.string().optional().describe(
5055
+ 'The type of the credential (e.g., "degree", "certificate").'
5056
+ )
4990
5057
  }).optional(),
4991
5058
  recipient: z.object({
4992
- name: z.string().optional().describe('The name of the recipient (e.g., "John Doe").')
5059
+ name: z.string().optional().describe(
5060
+ 'The name of the recipient (e.g., "John Doe").'
5061
+ )
4993
5062
  }).optional()
4994
- }).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")
4995
- }).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")
4996
- }).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")
4997
- }).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")
5063
+ }).describe(
5064
+ "The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used."
5065
+ )
5066
+ }).optional().describe(
5067
+ "The template to use for the credential delivery. If not provided, the default template will be used."
5068
+ )
5069
+ }).optional().describe(
5070
+ "Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used."
5071
+ )
5072
+ }).optional().describe(
5073
+ "Configuration for the credential issuance. If not provided, the default configuration will be used."
5074
+ )
4998
5075
  });
4999
5076
  var IssueInboxCredentialResponseValidator = z.object({
5000
5077
  issuanceId: z.string(),
@@ -5003,6 +5080,51 @@ var IssueInboxCredentialResponseValidator = z.object({
5003
5080
  claimUrl: z.string().url().optional(),
5004
5081
  recipientDid: z.string().optional()
5005
5082
  });
5083
+ var ClaimInboxCredentialValidator = z.object({
5084
+ credential: VCValidator.passthrough().or(VPValidator.passthrough()).or(UnsignedVCValidator.passthrough()).describe("The credential to issue."),
5085
+ configuration: z.object({
5086
+ publishableKey: z.string(),
5087
+ signingAuthorityName: z.string().optional()
5088
+ }).optional()
5089
+ });
5090
+ var LCNDomainOrOriginValidator = z.union([
5091
+ z.string().regex(
5092
+ /^(?:(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,63}|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d{1,5})?$/,
5093
+ {
5094
+ message: "Must be a valid domain (incl. subdomains), localhost, or IPv4, optionally with port"
5095
+ }
5096
+ ),
5097
+ z.string().regex(
5098
+ /^https?:\/\/(?:(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,63}|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d{1,5})?$/,
5099
+ { message: "Must be a valid http(s) origin" }
5100
+ )
5101
+ ]);
5102
+ var LCNIntegrationValidator = z.object({
5103
+ id: z.string(),
5104
+ name: z.string(),
5105
+ description: z.string().optional(),
5106
+ publishableKey: z.string(),
5107
+ whitelistedDomains: z.array(LCNDomainOrOriginValidator).default([])
5108
+ });
5109
+ var LCNIntegrationCreateValidator = z.object({
5110
+ name: z.string(),
5111
+ description: z.string().optional(),
5112
+ whitelistedDomains: z.array(LCNDomainOrOriginValidator).default([])
5113
+ });
5114
+ var LCNIntegrationUpdateValidator = z.object({
5115
+ name: z.string().optional(),
5116
+ description: z.string().optional(),
5117
+ whitelistedDomains: z.array(LCNDomainOrOriginValidator).optional(),
5118
+ rotatePublishableKey: z.boolean().optional()
5119
+ });
5120
+ var LCNIntegrationQueryValidator = z.object({
5121
+ id: StringQuery,
5122
+ name: StringQuery,
5123
+ description: StringQuery
5124
+ }).partial();
5125
+ var PaginatedLCNIntegrationsValidator = PaginationResponseValidator.extend({
5126
+ records: LCNIntegrationValidator.array()
5127
+ });
5006
5128
  var ClaimTokenValidator = z.object({
5007
5129
  token: z.string(),
5008
5130
  contactMethodId: z.string(),
@@ -5011,6 +5133,191 @@ var ClaimTokenValidator = z.object({
5011
5133
  expiresAt: z.string(),
5012
5134
  used: z.boolean()
5013
5135
  });
5136
+ var TagValidator = z.object({
5137
+ id: z.string(),
5138
+ name: z.string().min(1),
5139
+ slug: z.string().min(1),
5140
+ createdAt: z.string().optional(),
5141
+ updatedAt: z.string().optional()
5142
+ });
5143
+ var SkillStatusEnum = z.enum(["active", "archived"]);
5144
+ var SkillValidator = z.object({
5145
+ id: z.string(),
5146
+ statement: z.string(),
5147
+ description: z.string().optional(),
5148
+ code: z.string().optional(),
5149
+ icon: z.string().optional(),
5150
+ type: z.string().default("skill"),
5151
+ status: SkillStatusEnum.default("active"),
5152
+ frameworkId: z.string().optional(),
5153
+ createdAt: z.string().optional(),
5154
+ updatedAt: z.string().optional()
5155
+ });
5156
+ var BaseSkillQueryValidator = z.object({
5157
+ id: StringQuery,
5158
+ statement: StringQuery,
5159
+ description: StringQuery,
5160
+ code: StringQuery,
5161
+ type: StringQuery,
5162
+ status: SkillStatusEnum.or(z.object({ $in: SkillStatusEnum.array() }))
5163
+ }).partial();
5164
+ var SkillQueryValidator = z.union([
5165
+ z.object({
5166
+ $or: BaseSkillQueryValidator.array()
5167
+ }),
5168
+ BaseSkillQueryValidator
5169
+ ]);
5170
+ var SkillFrameworkStatusEnum = z.enum(["active", "archived"]);
5171
+ var SkillFrameworkValidator = z.object({
5172
+ id: z.string(),
5173
+ name: z.string(),
5174
+ description: z.string().optional(),
5175
+ image: z.string().optional(),
5176
+ sourceURI: z.string().url().optional(),
5177
+ status: SkillFrameworkStatusEnum.default("active"),
5178
+ createdAt: z.string().optional(),
5179
+ updatedAt: z.string().optional()
5180
+ });
5181
+ var PaginatedSkillFrameworksValidator = PaginationResponseValidator.extend({
5182
+ records: SkillFrameworkValidator.array()
5183
+ });
5184
+ var SkillTreeNodeValidator = SkillValidator.extend({
5185
+ children: z.array(z.lazy(() => SkillTreeNodeValidator)),
5186
+ hasChildren: z.boolean(),
5187
+ childrenCursor: z.string().nullable().optional()
5188
+ }).openapi({ ref: "SkillTreeNode" });
5189
+ var PaginatedSkillTreeValidator = z.object({
5190
+ hasMore: z.boolean(),
5191
+ cursor: z.string().nullable(),
5192
+ records: z.array(SkillTreeNodeValidator)
5193
+ });
5194
+ var SkillTreeNodeInputValidator = z.lazy(
5195
+ () => z.object({
5196
+ id: z.string().optional(),
5197
+ statement: z.string(),
5198
+ description: z.string().optional(),
5199
+ code: z.string().optional(),
5200
+ icon: z.string().optional(),
5201
+ type: z.string().optional(),
5202
+ status: SkillStatusEnum.optional(),
5203
+ children: z.array(SkillTreeNodeInputValidator).optional()
5204
+ })
5205
+ ).openapi({ ref: "SkillTreeNodeInput" });
5206
+ var LinkProviderFrameworkInputValidator = z.object({
5207
+ frameworkId: z.string()
5208
+ });
5209
+ var CreateManagedFrameworkInputValidator = z.object({
5210
+ id: z.string().optional(),
5211
+ name: z.string().min(1),
5212
+ description: z.string().optional(),
5213
+ image: z.string().optional(),
5214
+ sourceURI: z.string().url().optional(),
5215
+ status: SkillFrameworkStatusEnum.optional(),
5216
+ skills: z.array(SkillTreeNodeInputValidator).optional(),
5217
+ boostUris: z.array(z.string()).optional()
5218
+ });
5219
+ var UpdateFrameworkInputValidator = z.object({
5220
+ id: z.string(),
5221
+ name: z.string().min(1).optional(),
5222
+ description: z.string().optional(),
5223
+ image: z.string().optional(),
5224
+ sourceURI: z.string().url().optional(),
5225
+ status: SkillFrameworkStatusEnum.optional()
5226
+ }).refine(
5227
+ (data) => data.name !== void 0 || data.description !== void 0 || data.image !== void 0 || data.sourceURI !== void 0 || data.status !== void 0,
5228
+ {
5229
+ message: "At least one field must be provided to update",
5230
+ path: ["name"]
5231
+ }
5232
+ );
5233
+ var DeleteFrameworkInputValidator = z.object({ id: z.string() });
5234
+ var CreateManagedFrameworkBatchInputValidator = z.object({
5235
+ frameworks: z.array(
5236
+ CreateManagedFrameworkInputValidator.extend({
5237
+ skills: z.array(SkillTreeNodeInputValidator).optional()
5238
+ })
5239
+ ).min(1)
5240
+ });
5241
+ var SkillFrameworkAdminInputValidator = z.object({
5242
+ frameworkId: z.string(),
5243
+ profileId: z.string()
5244
+ });
5245
+ var SkillFrameworkIdInputValidator = z.object({ frameworkId: z.string() });
5246
+ var SkillFrameworkAdminsValidator = LCNProfileValidator.array();
5247
+ var SyncFrameworkInputValidator = z.object({ id: z.string() });
5248
+ var AddTagInputValidator = z.object({
5249
+ slug: z.string().min(1),
5250
+ name: z.string().min(1)
5251
+ });
5252
+ var CreateSkillInputValidator = z.object({
5253
+ frameworkId: z.string(),
5254
+ skill: SkillTreeNodeInputValidator,
5255
+ parentId: z.string().nullable().optional()
5256
+ });
5257
+ var UpdateSkillInputValidator = z.object({
5258
+ frameworkId: z.string(),
5259
+ id: z.string(),
5260
+ statement: z.string().optional(),
5261
+ description: z.string().optional(),
5262
+ code: z.string().optional(),
5263
+ icon: z.string().optional(),
5264
+ type: z.string().optional(),
5265
+ status: SkillStatusEnum.optional()
5266
+ }).refine(
5267
+ (data) => data.statement !== void 0 || data.description !== void 0 || data.code !== void 0 || data.icon !== void 0 || data.type !== void 0 || data.status !== void 0,
5268
+ {
5269
+ message: "At least one field must be provided to update a skill",
5270
+ path: ["statement"]
5271
+ }
5272
+ );
5273
+ var SkillDeletionStrategyValidator = z.enum(["recursive", "reparent"]);
5274
+ var DeleteSkillInputValidator = z.object({
5275
+ frameworkId: z.string(),
5276
+ id: z.string(),
5277
+ strategy: SkillDeletionStrategyValidator.optional().default("reparent")
5278
+ });
5279
+ var CreateSkillsBatchInputValidator = z.object({
5280
+ frameworkId: z.string(),
5281
+ skills: z.array(SkillTreeNodeInputValidator).min(1),
5282
+ parentId: z.string().nullable().optional()
5283
+ });
5284
+ var ReplaceSkillFrameworkSkillsInputValidator = z.object({
5285
+ frameworkId: z.string(),
5286
+ skills: z.array(SkillTreeNodeInputValidator).min(0)
5287
+ });
5288
+ var ReplaceSkillFrameworkSkillsResultValidator = z.object({
5289
+ created: z.number().int().min(0),
5290
+ updated: z.number().int().min(0),
5291
+ deleted: z.number().int().min(0),
5292
+ unchanged: z.number().int().min(0),
5293
+ total: z.number().int().min(0)
5294
+ });
5295
+ var CountSkillsInputValidator = z.object({
5296
+ frameworkId: z.string(),
5297
+ skillId: z.string().optional(),
5298
+ recursive: z.boolean().optional().default(false),
5299
+ onlyCountCompetencies: z.boolean().optional().default(false)
5300
+ });
5301
+ var CountSkillsResultValidator = z.object({
5302
+ count: z.number().int().min(0)
5303
+ });
5304
+ var GetFullSkillTreeInputValidator = z.object({
5305
+ frameworkId: z.string()
5306
+ });
5307
+ var GetFullSkillTreeResultValidator = z.object({
5308
+ skills: z.array(SkillTreeNodeValidator)
5309
+ });
5310
+ var GetSkillPathInputValidator = z.object({
5311
+ frameworkId: z.string(),
5312
+ skillId: z.string()
5313
+ });
5314
+ var GetSkillPathResultValidator = z.object({
5315
+ path: z.array(SkillValidator)
5316
+ });
5317
+ var FrameworkWithSkillsValidator = z.object({
5318
+ framework: SkillFrameworkValidator,
5319
+ skills: PaginatedSkillTreeValidator
5320
+ });
5014
5321
 
5015
5322
  // src/helpers.ts
5016
5323
  var post = /* @__PURE__ */ __name(async (url, data) => fetch(url, {