@strimz/shared-types 0.8.0 → 0.10.0

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.
Files changed (90) hide show
  1. package/dist/agents.cjs +42 -13
  2. package/dist/agents.cjs.map +1 -1
  3. package/dist/agents.d.cts +37 -37
  4. package/dist/agents.d.ts +37 -37
  5. package/dist/agents.js +42 -13
  6. package/dist/agents.js.map +1 -1
  7. package/dist/analytics.cjs +1 -11
  8. package/dist/analytics.cjs.map +1 -1
  9. package/dist/analytics.d.cts +78 -78
  10. package/dist/analytics.d.ts +78 -78
  11. package/dist/analytics.js +1 -11
  12. package/dist/analytics.js.map +1 -1
  13. package/dist/api-keys.cjs +1 -1
  14. package/dist/api-keys.cjs.map +1 -1
  15. package/dist/api-keys.js +1 -1
  16. package/dist/api-keys.js.map +1 -1
  17. package/dist/common.cjs +1 -1
  18. package/dist/common.cjs.map +1 -1
  19. package/dist/common.d.cts +1 -1
  20. package/dist/common.d.ts +1 -1
  21. package/dist/common.js +1 -1
  22. package/dist/common.js.map +1 -1
  23. package/dist/compliance.cjs +1 -1
  24. package/dist/compliance.cjs.map +1 -1
  25. package/dist/compliance.js +1 -1
  26. package/dist/compliance.js.map +1 -1
  27. package/dist/customers.cjs +1 -1
  28. package/dist/customers.cjs.map +1 -1
  29. package/dist/customers.js +1 -1
  30. package/dist/customers.js.map +1 -1
  31. package/dist/events.cjs +43 -24
  32. package/dist/events.cjs.map +1 -1
  33. package/dist/events.d.cts +90 -90
  34. package/dist/events.d.ts +90 -90
  35. package/dist/events.js +43 -24
  36. package/dist/events.js.map +1 -1
  37. package/dist/index.cjs +42 -24
  38. package/dist/index.cjs.map +1 -1
  39. package/dist/index.d.cts +1 -1
  40. package/dist/index.d.ts +1 -1
  41. package/dist/index.js +43 -24
  42. package/dist/index.js.map +1 -1
  43. package/dist/invoices.cjs +1 -1
  44. package/dist/invoices.cjs.map +1 -1
  45. package/dist/invoices.d.cts +5 -5
  46. package/dist/invoices.d.ts +5 -5
  47. package/dist/invoices.js +1 -1
  48. package/dist/invoices.js.map +1 -1
  49. package/dist/merchants.cjs +1 -1
  50. package/dist/merchants.cjs.map +1 -1
  51. package/dist/merchants.js +1 -1
  52. package/dist/merchants.js.map +1 -1
  53. package/dist/payment-sessions.cjs +1 -1
  54. package/dist/payment-sessions.cjs.map +1 -1
  55. package/dist/payment-sessions.d.cts +4 -4
  56. package/dist/payment-sessions.d.ts +4 -4
  57. package/dist/payment-sessions.js +1 -1
  58. package/dist/payment-sessions.js.map +1 -1
  59. package/dist/refunds.cjs +1 -1
  60. package/dist/refunds.cjs.map +1 -1
  61. package/dist/refunds.d.cts +5 -5
  62. package/dist/refunds.d.ts +5 -5
  63. package/dist/refunds.js +1 -1
  64. package/dist/refunds.js.map +1 -1
  65. package/dist/storefronts.cjs +1 -11
  66. package/dist/storefronts.cjs.map +1 -1
  67. package/dist/storefronts.d.cts +2 -2
  68. package/dist/storefronts.d.ts +2 -2
  69. package/dist/storefronts.js +1 -11
  70. package/dist/storefronts.js.map +1 -1
  71. package/dist/subscriptions.cjs +1 -12
  72. package/dist/subscriptions.cjs.map +1 -1
  73. package/dist/subscriptions.d.cts +5 -43
  74. package/dist/subscriptions.d.ts +5 -43
  75. package/dist/subscriptions.js +2 -12
  76. package/dist/subscriptions.js.map +1 -1
  77. package/dist/transactions.cjs +1 -1
  78. package/dist/transactions.cjs.map +1 -1
  79. package/dist/transactions.d.cts +3 -3
  80. package/dist/transactions.d.ts +3 -3
  81. package/dist/transactions.js +1 -1
  82. package/dist/transactions.js.map +1 -1
  83. package/dist/webhooks.cjs +1 -1
  84. package/dist/webhooks.cjs.map +1 -1
  85. package/dist/webhooks.js +1 -1
  86. package/dist/webhooks.js.map +1 -1
  87. package/package.json +1 -1
  88. package/src/agents.ts +49 -14
  89. package/src/common.ts +0 -1
  90. package/src/subscriptions.ts +0 -13
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var httpsUrlSchema = z.string().url().refine((v) => v.startsWith("https://"), {
9
9
  message: "must be an https:// URL"
10
10
  });
11
11
  var httpUrlSchema = z.string().url();
12
- var tokenAmountSchema = z.string().regex(/^[0-9]+$/, "must be a non-negative integer string (base-10)").refine((v) => BigInt(v) >= 0n, "must be >= 0");
12
+ var tokenAmountSchema = z.string().regex(/^[0-9]+$/, "must be a non-negative integer string (base-10)");
13
13
  var uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
14
14
  var isoTimestampSchema = z.string().datetime({ offset: true, message: "must be an ISO-8601 timestamp" });
15
15
  var countryCodeSchema = z.string().length(2).regex(/^[A-Z]{2}$/, "must be an ISO-3166 alpha-2 country code");
@@ -429,16 +429,6 @@ var subscriptionEnrolmentTermsSchema = z.object({
429
429
  trialDays: z.number().int().min(0),
430
430
  trialEndsAt: isoTimestampSchema.nullable()
431
431
  });
432
- var createSubscriptionInputSchema = z.object({
433
- planId: idSchema,
434
- customer: z.object({
435
- walletAddress: evmAddressSchema,
436
- email: z.string().email().optional(),
437
- externalRef: z.string().max(120).optional()
438
- }),
439
- gracePeriodHours: z.union([z.literal(24), z.literal(48), z.literal(72)]).default(48),
440
- metadata: metadataSchema.optional()
441
- });
442
432
  var cancelSubscriptionInputSchema = z.object({
443
433
  id: idSchema,
444
434
  reason: z.string().max(500).optional()
@@ -653,28 +643,57 @@ var agentCapabilitySchema = z.enum([
653
643
  "commerce",
654
644
  "pricing_intelligence"
655
645
  ]);
646
+ var enabledCapabilitiesSchema = z.array(agentCapabilitySchema);
647
+ var recoveryGracePeriodHoursSchema = z.union([z.literal(24), z.literal(48), z.literal(72)]);
648
+ var recoveryStrategySchema = z.enum(["once", "twice", "until_grace_ends"]);
649
+ var recoveryNotificationTemplateSchema = z.string().max(2e3).nullable();
650
+ var cashflowDigestEnabledSchema = z.boolean();
651
+ var cashflowAnomalySensitivitySchema = z.enum(["low", "medium", "high"]);
652
+ var cashflowAutoConvertToYieldSchema = z.boolean();
653
+ var cashflowMinimumLiquidReserveCentsSchema = z.number().int().nonnegative();
654
+ var commerceRequireHumanApprovalAboveUsdCentsSchema = z.number().int().nonnegative();
655
+ var commerceApprovedVendorsSchema = z.array(evmAddressSchema);
656
+ var commerceMonthlySpendCapUsdCentsSchema = z.number().int().nonnegative().nullable();
656
657
  var agentMerchantConfigSchema = z.object({
657
658
  merchantId: idSchema,
658
- enabledCapabilities: z.array(agentCapabilitySchema).default([]),
659
+ enabledCapabilities: enabledCapabilitiesSchema.default([]),
659
660
  recovery: z.object({
660
- gracePeriodHours: z.union([z.literal(24), z.literal(48), z.literal(72)]).default(48),
661
- strategy: z.enum(["once", "twice", "until_grace_ends"]).default("twice"),
662
- notificationTemplate: z.string().max(2e3).nullable()
661
+ gracePeriodHours: recoveryGracePeriodHoursSchema.default(48),
662
+ strategy: recoveryStrategySchema.default("twice"),
663
+ notificationTemplate: recoveryNotificationTemplateSchema
663
664
  }),
664
665
  cashflow: z.object({
665
- digestEnabled: z.boolean().default(false),
666
- anomalySensitivity: z.enum(["low", "medium", "high"]).default("medium"),
667
- autoConvertToYield: z.boolean().default(false),
668
- minimumLiquidReserveCents: z.number().int().nonnegative().default(1e5)
666
+ digestEnabled: cashflowDigestEnabledSchema.default(false),
667
+ anomalySensitivity: cashflowAnomalySensitivitySchema.default("medium"),
668
+ autoConvertToYield: cashflowAutoConvertToYieldSchema.default(false),
669
+ minimumLiquidReserveCents: cashflowMinimumLiquidReserveCentsSchema.default(1e5)
669
670
  }),
670
671
  commerce: z.object({
671
- requireHumanApprovalAboveUsdCents: z.number().int().nonnegative().default(1e5),
672
- approvedVendors: z.array(evmAddressSchema).default([]),
673
- monthlySpendCapUsdCents: z.number().int().nonnegative().nullable()
672
+ requireHumanApprovalAboveUsdCents: commerceRequireHumanApprovalAboveUsdCentsSchema.default(1e5),
673
+ approvedVendors: commerceApprovedVendorsSchema.default([]),
674
+ monthlySpendCapUsdCents: commerceMonthlySpendCapUsdCentsSchema
674
675
  }),
675
676
  updatedAt: isoTimestampSchema
676
677
  });
677
- var updateAgentConfigInputSchema = agentMerchantConfigSchema.omit({ merchantId: true, updatedAt: true }).partial();
678
+ var updateAgentConfigInputSchema = z.object({
679
+ enabledCapabilities: enabledCapabilitiesSchema.optional(),
680
+ recovery: z.object({
681
+ gracePeriodHours: recoveryGracePeriodHoursSchema.optional(),
682
+ strategy: recoveryStrategySchema.optional(),
683
+ notificationTemplate: recoveryNotificationTemplateSchema.optional()
684
+ }).optional(),
685
+ cashflow: z.object({
686
+ digestEnabled: cashflowDigestEnabledSchema.optional(),
687
+ anomalySensitivity: cashflowAnomalySensitivitySchema.optional(),
688
+ autoConvertToYield: cashflowAutoConvertToYieldSchema.optional(),
689
+ minimumLiquidReserveCents: cashflowMinimumLiquidReserveCentsSchema.optional()
690
+ }).optional(),
691
+ commerce: z.object({
692
+ requireHumanApprovalAboveUsdCents: commerceRequireHumanApprovalAboveUsdCentsSchema.optional(),
693
+ approvedVendors: commerceApprovedVendorsSchema.optional(),
694
+ monthlySpendCapUsdCents: commerceMonthlySpendCapUsdCentsSchema.optional()
695
+ }).optional()
696
+ });
678
697
  var agentActionTypeSchema = z.enum([
679
698
  "recovery_notification_sent",
680
699
  "recovery_retry_scheduled",
@@ -1235,6 +1254,6 @@ var adminTopMerchantsSchema = z.object({
1235
1254
  data: z.array(adminTopMerchantSchema)
1236
1255
  });
1237
1256
 
1238
- export { DEFAULT_MERCHANT_EMAIL_PREFS, STATS_VOLUME_DEFAULT_DAYS, STATS_VOLUME_MAX_DAYS, adminMerchantStatsSchema, adminOverviewSchema, adminStatsModeQuerySchema, adminTopMerchantSchema, adminTopMerchantsQuerySchema, adminTopMerchantsSchema, adminVolumeDaySchema, adminVolumeQuerySchema, adminVolumeSeriesSchema, agentActionExecutedEventSchema, agentActionOutcomeSchema, agentActionTypeSchema, agentActivityLogSchema, agentCapabilitySchema, agentIdentitySchema, agentJobCompletedEventSchema, agentJobDisputedEventSchema, agentJobProposedEventSchema, agentJobSchema, agentJobStatusSchema, agentMerchantConfigSchema, apiKeyKindSchema, apiKeySchema, apiKeyScopeSchema, arcEnvironmentSchema, broadcastAudienceSchema, broadcastListResponseSchema, broadcastSchema, callbackUrlSchema, cancelSubscriptionInputSchema, changeTierInputSchema, complianceLogSchema, complianceProviderSchema, complianceScreeningContextSchema, complianceStatusSchema, complianceWalletBlockedEventSchema, complianceWalletFlaggedEventSchema, contactRequestInputSchema, contactRequestOutputSchema, contactTopicSchema, countryCodeSchema, createAgentJobInputSchema, createApiKeyInputSchema, createApiKeyOutputSchema, createBroadcastInputSchema, createInvoiceInputSchema, createMerchantInputSchema, createPaymentSessionInputSchema, createRefundInputSchema, createStorefrontInputSchema, createStorefrontProductInputSchema, createSubscriptionInputSchema, createSubscriptionPlanInputSchema, createWebhookEndpointInputSchema, createWebhookEndpointOutputSchema, currencyAmountsSchema, customerSchema, emailSchema, evmAddressSchema, evmTxHashSchema, forecastConfidenceSchema, forecastSchema, httpUrlSchema, httpsUrlSchema, idSchema, inviteMemberInputSchema, invoiceCreatedEventSchema, invoiceLineItemSchema, invoiceOverdueEventSchema, invoicePaidEventSchema, invoiceSchema, invoiceStatusSchema, isoTimestampSchema, loginInputSchema, loginOutputSchema, makePaginatedSchema, markNotificationsReadResponseSchema, merchantBalanceSchema, merchantEmailPrefsSchema, merchantMemberSchema, merchantPublicBrandSchema, merchantRoleSchema, merchantSchema, merchantStatusSchema, merchantTierSchema, metadataSchema, modeSchema, moneySchema, notificationKindSchema, notificationListResponseSchema, notificationSchema, onboardMerchantInputSchema, paginationInputSchema, paymentCompletedEventSchema, paymentCreatedEventSchema, paymentCurrencies, paymentCurrencySchema, paymentFailedEventSchema, paymentSessionSchema, paymentSessionStatusSchema, refundCompletedEventSchema, refundCreateOutputSchema, refundCreatedEventSchema, refundFailedEventSchema, refundReasonSchema, refundSchema, refundSigningInstructionsSchema, refundStatusSchema, replayDeliveryInputSchema, resolveStatsVolumeRange, rotateApiKeyInputSchema, statsForecastSchema, statsLtvQuerySchema, statsLtvRowSchema, statsLtvSchema, statsMrrSchema, statsSummarySchema, statsVolumeDaySchema, statsVolumeQuerySchema, statsVolumeSchema, storefrontCheckoutInputSchema, storefrontCheckoutResponseSchema, storefrontProductSchema, storefrontProductTypeSchema, storefrontSchema, storefrontStatusSchema, submitPaymentSessionInputSchema, submitRefundSignatureInputSchema, subscriptionCancelledEventSchema, subscriptionChargeFailedEventSchema, subscriptionChargeOutcomeSchema, subscriptionChargeSchema, subscriptionChargeStatusSchema, subscriptionChargedEventSchema, subscriptionCreatedEventSchema, subscriptionEnrolmentTermsSchema, subscriptionIntervalSchema, subscriptionLapsedEventSchema, subscriptionPlanSchema, subscriptionPlanStatusSchema, subscriptionRecoveryAttemptEventSchema, subscriptionRecoveryOutcomeEventSchema, subscriptionSchema, subscriptionStatusResultSchema, subscriptionStatusSchema, tokenAmountSchema, tokenCapabilitiesSchema, tokenMetadataSchema, tokenPermitNonceSchema, tokenSymbolSchema, transactionKindSchema, transactionSchema, transactionStatusSchema, uintSchema, updateAgentConfigInputSchema, updateMerchantInputSchema, upsertCustomerInputSchema, volumeWindowSchema, webhookDeliveryDetailSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEndpointSchema, webhookEndpointStatusSchema, webhookEventNameSchema, webhookEventSchema };
1257
+ export { DEFAULT_MERCHANT_EMAIL_PREFS, STATS_VOLUME_DEFAULT_DAYS, STATS_VOLUME_MAX_DAYS, adminMerchantStatsSchema, adminOverviewSchema, adminStatsModeQuerySchema, adminTopMerchantSchema, adminTopMerchantsQuerySchema, adminTopMerchantsSchema, adminVolumeDaySchema, adminVolumeQuerySchema, adminVolumeSeriesSchema, agentActionExecutedEventSchema, agentActionOutcomeSchema, agentActionTypeSchema, agentActivityLogSchema, agentCapabilitySchema, agentIdentitySchema, agentJobCompletedEventSchema, agentJobDisputedEventSchema, agentJobProposedEventSchema, agentJobSchema, agentJobStatusSchema, agentMerchantConfigSchema, apiKeyKindSchema, apiKeySchema, apiKeyScopeSchema, arcEnvironmentSchema, broadcastAudienceSchema, broadcastListResponseSchema, broadcastSchema, callbackUrlSchema, cancelSubscriptionInputSchema, changeTierInputSchema, complianceLogSchema, complianceProviderSchema, complianceScreeningContextSchema, complianceStatusSchema, complianceWalletBlockedEventSchema, complianceWalletFlaggedEventSchema, contactRequestInputSchema, contactRequestOutputSchema, contactTopicSchema, countryCodeSchema, createAgentJobInputSchema, createApiKeyInputSchema, createApiKeyOutputSchema, createBroadcastInputSchema, createInvoiceInputSchema, createMerchantInputSchema, createPaymentSessionInputSchema, createRefundInputSchema, createStorefrontInputSchema, createStorefrontProductInputSchema, createSubscriptionPlanInputSchema, createWebhookEndpointInputSchema, createWebhookEndpointOutputSchema, currencyAmountsSchema, customerSchema, emailSchema, evmAddressSchema, evmTxHashSchema, forecastConfidenceSchema, forecastSchema, httpUrlSchema, httpsUrlSchema, idSchema, inviteMemberInputSchema, invoiceCreatedEventSchema, invoiceLineItemSchema, invoiceOverdueEventSchema, invoicePaidEventSchema, invoiceSchema, invoiceStatusSchema, isoTimestampSchema, loginInputSchema, loginOutputSchema, makePaginatedSchema, markNotificationsReadResponseSchema, merchantBalanceSchema, merchantEmailPrefsSchema, merchantMemberSchema, merchantPublicBrandSchema, merchantRoleSchema, merchantSchema, merchantStatusSchema, merchantTierSchema, metadataSchema, modeSchema, moneySchema, notificationKindSchema, notificationListResponseSchema, notificationSchema, onboardMerchantInputSchema, paginationInputSchema, paymentCompletedEventSchema, paymentCreatedEventSchema, paymentCurrencies, paymentCurrencySchema, paymentFailedEventSchema, paymentSessionSchema, paymentSessionStatusSchema, refundCompletedEventSchema, refundCreateOutputSchema, refundCreatedEventSchema, refundFailedEventSchema, refundReasonSchema, refundSchema, refundSigningInstructionsSchema, refundStatusSchema, replayDeliveryInputSchema, resolveStatsVolumeRange, rotateApiKeyInputSchema, statsForecastSchema, statsLtvQuerySchema, statsLtvRowSchema, statsLtvSchema, statsMrrSchema, statsSummarySchema, statsVolumeDaySchema, statsVolumeQuerySchema, statsVolumeSchema, storefrontCheckoutInputSchema, storefrontCheckoutResponseSchema, storefrontProductSchema, storefrontProductTypeSchema, storefrontSchema, storefrontStatusSchema, submitPaymentSessionInputSchema, submitRefundSignatureInputSchema, subscriptionCancelledEventSchema, subscriptionChargeFailedEventSchema, subscriptionChargeOutcomeSchema, subscriptionChargeSchema, subscriptionChargeStatusSchema, subscriptionChargedEventSchema, subscriptionCreatedEventSchema, subscriptionEnrolmentTermsSchema, subscriptionIntervalSchema, subscriptionLapsedEventSchema, subscriptionPlanSchema, subscriptionPlanStatusSchema, subscriptionRecoveryAttemptEventSchema, subscriptionRecoveryOutcomeEventSchema, subscriptionSchema, subscriptionStatusResultSchema, subscriptionStatusSchema, tokenAmountSchema, tokenCapabilitiesSchema, tokenMetadataSchema, tokenPermitNonceSchema, tokenSymbolSchema, transactionKindSchema, transactionSchema, transactionStatusSchema, uintSchema, updateAgentConfigInputSchema, updateMerchantInputSchema, upsertCustomerInputSchema, volumeWindowSchema, webhookDeliveryDetailSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEndpointSchema, webhookEndpointStatusSchema, webhookEventNameSchema, webhookEventSchema };
1239
1258
  //# sourceMappingURL=index.js.map
1240
1259
  //# sourceMappingURL=index.js.map