@peac/schema 0.12.4 → 0.12.5

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
@@ -3226,6 +3226,13 @@ function zodPathToPointer(groupKey, zodPath) {
3226
3226
  }
3227
3227
  var COMMERCE_EXTENSION_KEY = "org.peacprotocol/commerce";
3228
3228
  var AMOUNT_MINOR_PATTERN = /^-?[0-9]+$/;
3229
+ var AmountMinorStringSchema = zod.z.string().min(1).max(EXTENSION_LIMITS.maxAmountMinorLength).regex(
3230
+ AMOUNT_MINOR_PATTERN,
3231
+ 'amount_minor must be a base-10 integer string (e.g., "1000", "-50")'
3232
+ );
3233
+ function isValidAmountMinor(value) {
3234
+ return AmountMinorStringSchema.safeParse(value).success;
3235
+ }
3229
3236
  var CommerceExtensionSchema = zod.z.object({
3230
3237
  /** Payment rail identifier (e.g., 'stripe', 'x402', 'lightning') */
3231
3238
  payment_rail: zod.z.string().min(1).max(EXTENSION_LIMITS.maxPaymentRailLength),
@@ -3234,10 +3241,7 @@ var CommerceExtensionSchema = zod.z.object({
3234
3241
  * Base-10 integer: optional leading minus, one or more digits.
3235
3242
  * Decimals and empty strings are rejected.
3236
3243
  */
3237
- amount_minor: zod.z.string().min(1).max(EXTENSION_LIMITS.maxAmountMinorLength).regex(
3238
- AMOUNT_MINOR_PATTERN,
3239
- 'amount_minor must be a base-10 integer string (e.g., "1000", "-50")'
3240
- ),
3244
+ amount_minor: AmountMinorStringSchema,
3241
3245
  /** ISO 4217 currency code or asset identifier */
3242
3246
  currency: zod.z.string().min(1).max(EXTENSION_LIMITS.maxCurrencyLength),
3243
3247
  /** Caller-assigned payment reference */
@@ -4281,6 +4285,7 @@ exports.AgentIdentityAttestationSchema = AgentIdentityAttestationSchema;
4281
4285
  exports.AgentIdentityEvidenceSchema = AgentIdentityEvidenceSchema;
4282
4286
  exports.AgentIdentityVerifiedSchema = AgentIdentityVerifiedSchema;
4283
4287
  exports.AgentProofSchema = AgentProofSchema;
4288
+ exports.AmountMinorStringSchema = AmountMinorStringSchema;
4284
4289
  exports.AttestationExtensionsSchema = AttestationExtensionsSchema;
4285
4290
  exports.AttestationReceiptClaimsSchema = AttestationReceiptClaimsSchema;
4286
4291
  exports.AttestationSchema = AttestationSchema;
@@ -4595,6 +4600,7 @@ exports.isReservedKindPrefix = isReservedKindPrefix;
4595
4600
  exports.isTerminalState = isTerminalState;
4596
4601
  exports.isTerminalWorkflowStatus = isTerminalWorkflowStatus;
4597
4602
  exports.isUndeclaredPurpose = isUndeclaredPurpose;
4603
+ exports.isValidAmountMinor = isValidAmountMinor;
4598
4604
  exports.isValidDisputeAttestation = isValidDisputeAttestation;
4599
4605
  exports.isValidExtensionKey = isValidExtensionKey;
4600
4606
  exports.isValidInteractionEvidence = isValidInteractionEvidence;