@strimz/shared-types 0.6.0 → 0.8.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 (85) hide show
  1. package/README.md +7 -4
  2. package/dist/agents.cjs.map +1 -1
  3. package/dist/agents.d.cts +7 -5
  4. package/dist/agents.d.ts +7 -5
  5. package/dist/agents.js.map +1 -1
  6. package/dist/analytics.cjs +568 -0
  7. package/dist/analytics.cjs.map +1 -0
  8. package/dist/analytics.d.cts +1719 -0
  9. package/dist/analytics.d.ts +1719 -0
  10. package/dist/analytics.js +540 -0
  11. package/dist/analytics.js.map +1 -0
  12. package/dist/api-keys.cjs.map +1 -1
  13. package/dist/api-keys.d.cts +19 -17
  14. package/dist/api-keys.d.ts +19 -17
  15. package/dist/api-keys.js.map +1 -1
  16. package/dist/common.cjs.map +1 -1
  17. package/dist/common.d.cts +3 -2
  18. package/dist/common.d.ts +3 -2
  19. package/dist/common.js.map +1 -1
  20. package/dist/compliance.cjs.map +1 -1
  21. package/dist/compliance.d.cts +8 -8
  22. package/dist/compliance.d.ts +8 -8
  23. package/dist/compliance.js.map +1 -1
  24. package/dist/customers.cjs.map +1 -1
  25. package/dist/customers.d.cts +10 -9
  26. package/dist/customers.d.ts +10 -9
  27. package/dist/customers.js.map +1 -1
  28. package/dist/events.cjs.map +1 -1
  29. package/dist/events.d.cts +1936 -1936
  30. package/dist/events.d.ts +1936 -1936
  31. package/dist/events.js.map +1 -1
  32. package/dist/index.cjs +216 -0
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.cts +25 -22
  35. package/dist/index.d.ts +25 -22
  36. package/dist/index.js +190 -1
  37. package/dist/index.js.map +1 -1
  38. package/dist/invoices.cjs.map +1 -1
  39. package/dist/invoices.d.cts +19 -18
  40. package/dist/invoices.d.ts +19 -18
  41. package/dist/invoices.js.map +1 -1
  42. package/dist/merchants.cjs.map +1 -1
  43. package/dist/merchants.d.cts +42 -36
  44. package/dist/merchants.d.ts +42 -36
  45. package/dist/merchants.js.map +1 -1
  46. package/dist/payment-sessions.cjs.map +1 -1
  47. package/dist/payment-sessions.d.cts +24 -22
  48. package/dist/payment-sessions.d.ts +24 -22
  49. package/dist/payment-sessions.js.map +1 -1
  50. package/dist/refunds.cjs.map +1 -1
  51. package/dist/refunds.d.cts +55 -53
  52. package/dist/refunds.d.ts +55 -53
  53. package/dist/refunds.js.map +1 -1
  54. package/dist/storefronts.cjs.map +1 -1
  55. package/dist/storefronts.d.cts +31 -28
  56. package/dist/storefronts.d.ts +31 -28
  57. package/dist/storefronts.js.map +1 -1
  58. package/dist/subscriptions.cjs.map +1 -1
  59. package/dist/subscriptions.d.cts +49 -46
  60. package/dist/subscriptions.d.ts +49 -46
  61. package/dist/subscriptions.js.map +1 -1
  62. package/dist/transactions.cjs.map +1 -1
  63. package/dist/transactions.d.cts +14 -14
  64. package/dist/transactions.d.ts +14 -14
  65. package/dist/transactions.js.map +1 -1
  66. package/dist/webhooks.cjs.map +1 -1
  67. package/dist/webhooks.d.cts +33 -31
  68. package/dist/webhooks.d.ts +33 -31
  69. package/dist/webhooks.js.map +1 -1
  70. package/package.json +6 -1
  71. package/src/agents.ts +4 -2
  72. package/src/analytics.ts +275 -0
  73. package/src/api-keys.ts +4 -2
  74. package/src/common.ts +2 -1
  75. package/src/contact.ts +2 -1
  76. package/src/customers.ts +2 -1
  77. package/src/index.ts +1 -0
  78. package/src/invoices.ts +2 -1
  79. package/src/merchants.ts +12 -6
  80. package/src/notifications.ts +2 -1
  81. package/src/payment-sessions.ts +4 -2
  82. package/src/refunds.ts +4 -2
  83. package/src/storefronts.ts +6 -3
  84. package/src/subscriptions.ts +6 -3
  85. package/src/webhooks.ts +4 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.ts","../src/transactions.ts"],"names":["z"],"mappings":";;;;;AAQO,IAAM,QAAA,GAAWA,KAAA,CACrB,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI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a,QAAQ,CAAC;AAGzE,IAAM,iBAAA,GAAoBA,MAAE,MAAA,CAAO;AAAA,EACxC,EAAA,EAAI,QAAA;AAAA,EACJ,UAAA,EAAY,QAAA;AAAA,EACZ,IAAA,EAAM,qBAAA;AAAA,EACN,MAAA,EAAQ,uBAAA;AAAA,EACR,SAAA,EAAW,SAAS,QAAA,EAAS;AAAA,EAC7B,cAAA,EAAgB,SAAS,QAAA,EAAS;AAAA,EAClC,oBAAA,EAAsB,SAAS,QAAA,EAAS;AAAA,EACxC,QAAA,EAAU,SAAS,QAAA,EAAS;AAAA,EAC5B,UAAA,EAAY,SAAS,QAAA,EAAS;AAAA,EAC9B,MAAA,EAAQ,iBAAA;AAAA,EACR,SAAA,EAAW,iBAAA;AAAA,EACX,SAAA,EAAW,iBAAA;AAAA,EACX,QAAA,EAAU,qBAAA;AAAA,EACV,YAAA,EAAc,gBAAA;AAAA,EACd,eAAA,EAAiB,gBAAA;AAAA,EACjB,aAAA,EAAe,eAAA;AAAA,EACf,aAAaA,KAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,GAAM,WAAA,EAAY;AAAA,EAC1C,cAAA,EAAgB,kBAAA;AAAA,EAChB,SAAA,EAAW;AACb,CAAC","file":"transactions.cjs","sourcesContent":["/**\n * Primitive schemas shared across every entity.\n * Every higher-level schema builds on these so validation is consistent.\n */\n\nimport { z } from 'zod'\n\n/** CUID2 or UUID-style opaque identifier. */\nexport const idSchema = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'id must be URL-safe')\n\n/** EVM address. Hex-encoded, 0x-prefixed, 20 bytes. Normalised to lowercase. */\nexport const evmAddressSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{40}$/, 'must be a 0x-prefixed 40-character hex EVM address')\n .transform((v) => v.toLowerCase())\n\n/** EVM transaction hash. 32-byte hex. */\nexport const evmTxHashSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{64}$/, 'must be a 0x-prefixed 64-character hex EVM transaction hash')\n\n/** Email address, trimmed and lower-cased. */\nexport const emailSchema = z.string().email().trim().toLowerCase().max(320)\n\n/** HTTPS URL. No http:// allowed outside dev. */\nexport const httpsUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://'), {\n message: 'must be an https:// URL',\n })\n\n/** URL permitting http and https (dev + prod). */\nexport const httpUrlSchema = z.string().url()\n\n/**\n * Amount expressed in the token's smallest unit, serialised as a string to\n * preserve precision beyond `Number.MAX_SAFE_INTEGER`. For USDC (6 decimals),\n * 1 USDC is the string \"1000000\".\n */\nexport const tokenAmountSchema = z\n .string()\n .regex(/^[0-9]+$/, 'must be a non-negative integer string (base-10)')\n .refine((v) => BigInt(v) >= 0n, 'must be >= 0')\n\n/** Unsigned integer up to 2^53 - 1; validated and returned as number. */\nexport const uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\n/** ISO-8601 timestamp string (`.toISOString()`-compatible). */\nexport const isoTimestampSchema = z\n .string()\n .datetime({ offset: true, message: 'must be an ISO-8601 timestamp' })\n\n/** Two-letter ISO-3166 country code. */\nexport const countryCodeSchema = z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be an ISO-3166 alpha-2 country code')\n\n/** Pagination inputs used by every list endpoint. */\nexport const paginationInputSchema = z.object({\n limit: z.number().int().min(1).max(100).default(25),\n cursor: z.string().min(1).max(200).nullish(),\n})\nexport type PaginationInput = z.infer<typeof paginationInputSchema>\n\n/** Pagination envelope used by every list response. */\nexport const makePaginatedSchema = <T extends z.ZodTypeAny>(item: T) =>\n z.object({\n data: z.array(item),\n nextCursor: z.string().nullable(),\n hasMore: z.boolean(),\n })\n\n/** Free-form metadata bag the API round-trips for merchants. */\nexport const metadataSchema = z\n .record(\n z.string().min(1).max(40),\n z.union([z.string().max(500), z.number(), z.boolean(), z.null()]),\n )\n .refine((m) => Object.keys(m).length <= 50, 'at most 50 metadata keys')\n .default({})\n\n/** Environment mode carried on every mode-scoped resource. */\nexport const modeSchema = z.enum(['test', 'live'])\nexport type Mode = z.infer<typeof modeSchema>\n\n/** Payment token enum. */\nexport const paymentCurrencySchema = z.enum(['USDC', 'EURC'])\nexport type PaymentCurrency = z.infer<typeof paymentCurrencySchema>\n\n/** Every display-level currency (payment + treasury). */\nexport const tokenSymbolSchema = z.enum(['USDC', 'EURC', 'USYC'])\nexport type TokenSymbol = z.infer<typeof tokenSymbolSchema>\n\n/** Merchant tier enum. */\nexport const merchantTierSchema = z.enum(['free', 'growth', 'business', 'enterprise'])\nexport type MerchantTier = z.infer<typeof merchantTierSchema>\n\n/** Arc environment enum. */\nexport const arcEnvironmentSchema = z.enum(['testnet', 'mainnet'])\nexport type ArcEnvironment = z.infer<typeof arcEnvironmentSchema>\n\nexport type Id = z.infer<typeof idSchema>\nexport type EvmAddress = z.infer<typeof evmAddressSchema>\nexport type EvmTxHash = z.infer<typeof evmTxHashSchema>\nexport type TokenAmount = z.infer<typeof tokenAmountSchema>\nexport type IsoTimestamp = z.infer<typeof isoTimestampSchema>\nexport type Metadata = z.infer<typeof metadataSchema>\n","/**\n * Transaction. The record of a confirmed on-chain payment.\n *\n * Every transaction corresponds to either a paid PaymentSession, a\n * SubscriptionCharge, or a Refund. Records are derived from the\n * `PaymentExecuted`, `SubscriptionCharged`, and `RefundRecorded` events.\n */\n\nimport { z } from 'zod'\nimport {\n evmAddressSchema,\n evmTxHashSchema,\n idSchema,\n isoTimestampSchema,\n paymentCurrencySchema,\n tokenAmountSchema,\n} from './common.js'\n\nexport const transactionKindSchema = z.enum([\n 'one_shot',\n 'subscription_charge',\n 'refund',\n 'invoice_payment',\n 'storefront_purchase',\n])\nexport type TransactionKind = z.infer<typeof transactionKindSchema>\n\nexport const transactionStatusSchema = z.enum(['pending', 'confirmed', 'failed'])\nexport type TransactionStatus = z.infer<typeof transactionStatusSchema>\n\nexport const transactionSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n kind: transactionKindSchema,\n status: transactionStatusSchema,\n sessionId: idSchema.nullable(),\n subscriptionId: idSchema.nullable(),\n subscriptionChargeId: idSchema.nullable(),\n refundId: idSchema.nullable(),\n customerId: idSchema.nullable(),\n amount: tokenAmountSchema,\n feeAmount: tokenAmountSchema,\n netAmount: tokenAmountSchema,\n currency: paymentCurrencySchema,\n payerAddress: evmAddressSchema,\n merchantAddress: evmAddressSchema,\n onchainTxHash: evmTxHashSchema,\n blockNumber: z.number().int().nonnegative(),\n blockTimestamp: isoTimestampSchema,\n createdAt: isoTimestampSchema,\n})\nexport type Transaction = z.infer<typeof transactionSchema>\n"]}
1
+ {"version":3,"sources":["../src/common.ts","../src/transactions.ts"],"names":["z"],"mappings":";;;;;AAQO,IAAM,QAAA,GAAWA,KAAA,CACrB,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,EAAE,CAAA,CACN,KAAA,CAAM,kBAAA,EAAoB,qBAAqB,CAAA;AAG3C,IAAM,gBAAA,GAAmBA,KAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;AAG5B,IAAM,kBAAkBA,KAAA,CAC5B,MAAA,EAAO,CACP,KAAA,CAAM,uBAAuB,6DAA6D,CAAA;AAGlEA,KAAA,CAAE,MAAA,EAAO,CAAE,KAAA,EAAM,CAAE,IAAA,EAAK,CAAE,WAAA,EAAY,CAAE,GAAA,CAAI,GAAG;AAG5CA,KAAA,CAC3B,MAAA,EAAO,CACP,GAAA,EAAI,CACJ,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,UAAA,CAAW,UAAU,CAAA,EAAG;AAAA,EACvC,OAAA,EAAS;AACX,CAAC;AAG0BA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA;AAOjC,IAAM,iBAAA,GAAoBA,KAAA,CAC9B,MAAA,EAAO,CACP,MAAM,UAAA,EAAY,iDAAiD,CAAA,CACnE,MA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AA,EAChB,SAAA,EAAW;AACb,CAAC","file":"transactions.cjs","sourcesContent":["/**\n * Primitive schemas shared across every entity.\n * Every higher-level schema builds on these so validation is consistent.\n */\n\nimport { z } from 'zod'\n\n/** CUID2 or UUID-style opaque identifier. */\nexport const idSchema = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'id must be URL-safe')\n\n/** EVM address. Hex-encoded, 0x-prefixed, 20 bytes. Normalised to lowercase. */\nexport const evmAddressSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{40}$/, 'must be a 0x-prefixed 40-character hex EVM address')\n .transform((v) => v.toLowerCase())\n\n/** EVM transaction hash. 32-byte hex. */\nexport const evmTxHashSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{64}$/, 'must be a 0x-prefixed 64-character hex EVM transaction hash')\n\n/** Email address, trimmed and lower-cased. */\nexport const emailSchema = z.string().email().trim().toLowerCase().max(320)\n\n/** HTTPS URL. No http:// allowed outside dev. */\nexport const httpsUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://'), {\n message: 'must be an https:// URL',\n })\n\n/** URL permitting http and https (dev + prod). */\nexport const httpUrlSchema = z.string().url()\n\n/**\n * Amount expressed in the token's smallest unit, serialised as a string to\n * preserve precision beyond `Number.MAX_SAFE_INTEGER`. For USDC (6 decimals),\n * 1 USDC is the string \"1000000\".\n */\nexport const tokenAmountSchema = z\n .string()\n .regex(/^[0-9]+$/, 'must be a non-negative integer string (base-10)')\n .refine((v) => BigInt(v) >= 0n, 'must be >= 0')\n\n/** Unsigned integer up to 2^53 - 1; validated and returned as number. */\nexport const uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\n/** ISO-8601 timestamp string (`.toISOString()`-compatible). */\nexport const isoTimestampSchema = z\n .string()\n .datetime({ offset: true, message: 'must be an ISO-8601 timestamp' })\n\n/** Two-letter ISO-3166 country code. */\nexport const countryCodeSchema = z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be an ISO-3166 alpha-2 country code')\n\n/** Pagination inputs used by every list endpoint. */\nexport const paginationInputSchema = z.object({\n limit: z.number().int().min(1).max(100).default(25),\n cursor: z.string().min(1).max(200).nullish(),\n})\nexport type PaginationInput = z.input<typeof paginationInputSchema>\nexport type PaginationParsed = z.output<typeof paginationInputSchema>\n\n/** Pagination envelope used by every list response. */\nexport const makePaginatedSchema = <T extends z.ZodTypeAny>(item: T) =>\n z.object({\n data: z.array(item),\n nextCursor: z.string().nullable(),\n hasMore: z.boolean(),\n })\n\n/** Free-form metadata bag the API round-trips for merchants. */\nexport const metadataSchema = z\n .record(\n z.string().min(1).max(40),\n z.union([z.string().max(500), z.number(), z.boolean(), z.null()]),\n )\n .refine((m) => Object.keys(m).length <= 50, 'at most 50 metadata keys')\n .default({})\n\n/** Environment mode carried on every mode-scoped resource. */\nexport const modeSchema = z.enum(['test', 'live'])\nexport type Mode = z.infer<typeof modeSchema>\n\n/** Payment token enum. */\nexport const paymentCurrencySchema = z.enum(['USDC', 'EURC'])\nexport type PaymentCurrency = z.infer<typeof paymentCurrencySchema>\n\n/** Every display-level currency (payment + treasury). */\nexport const tokenSymbolSchema = z.enum(['USDC', 'EURC', 'USYC'])\nexport type TokenSymbol = z.infer<typeof tokenSymbolSchema>\n\n/** Merchant tier enum. */\nexport const merchantTierSchema = z.enum(['free', 'growth', 'business', 'enterprise'])\nexport type MerchantTier = z.infer<typeof merchantTierSchema>\n\n/** Arc environment enum. */\nexport const arcEnvironmentSchema = z.enum(['testnet', 'mainnet'])\nexport type ArcEnvironment = z.infer<typeof arcEnvironmentSchema>\n\nexport type Id = z.infer<typeof idSchema>\nexport type EvmAddress = z.infer<typeof evmAddressSchema>\nexport type EvmTxHash = z.infer<typeof evmTxHashSchema>\nexport type TokenAmount = z.infer<typeof tokenAmountSchema>\nexport type IsoTimestamp = z.infer<typeof isoTimestampSchema>\nexport type Metadata = z.infer<typeof metadataSchema>\n","/**\n * Transaction. The record of a confirmed on-chain payment.\n *\n * Every transaction corresponds to either a paid PaymentSession, a\n * SubscriptionCharge, or a Refund. Records are derived from the\n * `PaymentExecuted`, `SubscriptionCharged`, and `RefundRecorded` events.\n */\n\nimport { z } from 'zod'\nimport {\n evmAddressSchema,\n evmTxHashSchema,\n idSchema,\n isoTimestampSchema,\n paymentCurrencySchema,\n tokenAmountSchema,\n} from './common.js'\n\nexport const transactionKindSchema = z.enum([\n 'one_shot',\n 'subscription_charge',\n 'refund',\n 'invoice_payment',\n 'storefront_purchase',\n])\nexport type TransactionKind = z.infer<typeof transactionKindSchema>\n\nexport const transactionStatusSchema = z.enum(['pending', 'confirmed', 'failed'])\nexport type TransactionStatus = z.infer<typeof transactionStatusSchema>\n\nexport const transactionSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n kind: transactionKindSchema,\n status: transactionStatusSchema,\n sessionId: idSchema.nullable(),\n subscriptionId: idSchema.nullable(),\n subscriptionChargeId: idSchema.nullable(),\n refundId: idSchema.nullable(),\n customerId: idSchema.nullable(),\n amount: tokenAmountSchema,\n feeAmount: tokenAmountSchema,\n netAmount: tokenAmountSchema,\n currency: paymentCurrencySchema,\n payerAddress: evmAddressSchema,\n merchantAddress: evmAddressSchema,\n onchainTxHash: evmTxHashSchema,\n blockNumber: z.number().int().nonnegative(),\n blockTimestamp: isoTimestampSchema,\n createdAt: isoTimestampSchema,\n})\nexport type Transaction = z.infer<typeof transactionSchema>\n"]}
@@ -34,41 +34,41 @@ declare const transactionSchema: z.ZodObject<{
34
34
  createdAt: z.ZodString;
35
35
  }, "strip", z.ZodTypeAny, {
36
36
  status: "confirmed" | "failed" | "pending";
37
- id: string;
37
+ amount: string;
38
+ currency: "USDC" | "EURC";
39
+ customerId: string | null;
38
40
  merchantId: string;
41
+ id: string;
39
42
  sessionId: string | null;
40
- subscriptionId: string | null;
41
43
  createdAt: string;
42
- kind: "one_shot" | "subscription_charge" | "refund" | "invoice_payment" | "storefront_purchase";
43
- customerId: string | null;
44
- amount: string;
45
- currency: "USDC" | "EURC";
46
44
  feeAmount: string;
47
45
  netAmount: string;
48
46
  onchainTxHash: string;
47
+ payerAddress: string;
48
+ subscriptionId: string | null;
49
+ kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
49
50
  subscriptionChargeId: string | null;
50
51
  refundId: string | null;
51
- payerAddress: string;
52
52
  merchantAddress: string;
53
53
  blockNumber: number;
54
54
  blockTimestamp: string;
55
55
  }, {
56
56
  status: "confirmed" | "failed" | "pending";
57
- id: string;
57
+ amount: string;
58
+ currency: "USDC" | "EURC";
59
+ customerId: string | null;
58
60
  merchantId: string;
61
+ id: string;
59
62
  sessionId: string | null;
60
- subscriptionId: string | null;
61
63
  createdAt: string;
62
- kind: "one_shot" | "subscription_charge" | "refund" | "invoice_payment" | "storefront_purchase";
63
- customerId: string | null;
64
- amount: string;
65
- currency: "USDC" | "EURC";
66
64
  feeAmount: string;
67
65
  netAmount: string;
68
66
  onchainTxHash: string;
67
+ payerAddress: string;
68
+ subscriptionId: string | null;
69
+ kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
69
70
  subscriptionChargeId: string | null;
70
71
  refundId: string | null;
71
- payerAddress: string;
72
72
  merchantAddress: string;
73
73
  blockNumber: number;
74
74
  blockTimestamp: string;
@@ -34,41 +34,41 @@ declare const transactionSchema: z.ZodObject<{
34
34
  createdAt: z.ZodString;
35
35
  }, "strip", z.ZodTypeAny, {
36
36
  status: "confirmed" | "failed" | "pending";
37
- id: string;
37
+ amount: string;
38
+ currency: "USDC" | "EURC";
39
+ customerId: string | null;
38
40
  merchantId: string;
41
+ id: string;
39
42
  sessionId: string | null;
40
- subscriptionId: string | null;
41
43
  createdAt: string;
42
- kind: "one_shot" | "subscription_charge" | "refund" | "invoice_payment" | "storefront_purchase";
43
- customerId: string | null;
44
- amount: string;
45
- currency: "USDC" | "EURC";
46
44
  feeAmount: string;
47
45
  netAmount: string;
48
46
  onchainTxHash: string;
47
+ payerAddress: string;
48
+ subscriptionId: string | null;
49
+ kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
49
50
  subscriptionChargeId: string | null;
50
51
  refundId: string | null;
51
- payerAddress: string;
52
52
  merchantAddress: string;
53
53
  blockNumber: number;
54
54
  blockTimestamp: string;
55
55
  }, {
56
56
  status: "confirmed" | "failed" | "pending";
57
- id: string;
57
+ amount: string;
58
+ currency: "USDC" | "EURC";
59
+ customerId: string | null;
58
60
  merchantId: string;
61
+ id: string;
59
62
  sessionId: string | null;
60
- subscriptionId: string | null;
61
63
  createdAt: string;
62
- kind: "one_shot" | "subscription_charge" | "refund" | "invoice_payment" | "storefront_purchase";
63
- customerId: string | null;
64
- amount: string;
65
- currency: "USDC" | "EURC";
66
64
  feeAmount: string;
67
65
  netAmount: string;
68
66
  onchainTxHash: string;
67
+ payerAddress: string;
68
+ subscriptionId: string | null;
69
+ kind: "refund" | "one_shot" | "subscription_charge" | "invoice_payment" | "storefront_purchase";
69
70
  subscriptionChargeId: string | null;
70
71
  refundId: string | null;
71
- payerAddress: string;
72
72
  merchantAddress: string;
73
73
  blockNumber: number;
74
74
  blockTimestamp: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.ts","../src/transactions.ts"],"names":["z"],"mappings":";;;AAQO,IAAM,QAAA,GAAW,CAAA,CACrB,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,EAAE,CAAA,CACN,KAAA,CAAM,kBAAA,EAAoB,qBAAqB,CAAA;AAG3C,IAAM,gBAAA,GAAmB,CAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;AAG5B,IAAM,kBAAkB,CAAA,CAC5B,MAAA,EAAO,CACP,KAAA,CAAM,uBAAuB,6DAA6D,CAAA;AAGlE,CAAA,CAAE,MAAA,EAAO,CAAE,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B,UAAA,EAAY,SAAS,QAAA,EAAS;AAAA,EAC9B,MAAA,EAAQ,iBAAA;AAAA,EACR,SAAA,EAAW,iBAAA;AAAA,EACX,SAAA,EAAW,iBAAA;AAAA,EACX,QAAA,EAAU,qBAAA;AAAA,EACV,YAAA,EAAc,gBAAA;AAAA,EACd,eAAA,EAAiB,gBAAA;AAAA,EACjB,aAAA,EAAe,eAAA;AAAA,EACf,aAAaA,CAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,GAAM,WAAA,EAAY;AAAA,EAC1C,cAAA,EAAgB,kBAAA;AAAA,EAChB,SAAA,EAAW;AACb,CAAC","file":"transactions.js","sourcesContent":["/**\n * Primitive schemas shared across every entity.\n * Every higher-level schema builds on these so validation is consistent.\n */\n\nimport { z } from 'zod'\n\n/** CUID2 or UUID-style opaque identifier. */\nexport const idSchema = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'id must be URL-safe')\n\n/** EVM address. Hex-encoded, 0x-prefixed, 20 bytes. Normalised to lowercase. */\nexport const evmAddressSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{40}$/, 'must be a 0x-prefixed 40-character hex EVM address')\n .transform((v) => v.toLowerCase())\n\n/** EVM transaction hash. 32-byte hex. */\nexport const evmTxHashSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{64}$/, 'must be a 0x-prefixed 64-character hex EVM transaction hash')\n\n/** Email address, trimmed and lower-cased. */\nexport const emailSchema = z.string().email().trim().toLowerCase().max(320)\n\n/** HTTPS URL. No http:// allowed outside dev. */\nexport const httpsUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://'), {\n message: 'must be an https:// URL',\n })\n\n/** URL permitting http and https (dev + prod). */\nexport const httpUrlSchema = z.string().url()\n\n/**\n * Amount expressed in the token's smallest unit, serialised as a string to\n * preserve precision beyond `Number.MAX_SAFE_INTEGER`. For USDC (6 decimals),\n * 1 USDC is the string \"1000000\".\n */\nexport const tokenAmountSchema = z\n .string()\n .regex(/^[0-9]+$/, 'must be a non-negative integer string (base-10)')\n .refine((v) => BigInt(v) >= 0n, 'must be >= 0')\n\n/** Unsigned integer up to 2^53 - 1; validated and returned as number. */\nexport const uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\n/** ISO-8601 timestamp string (`.toISOString()`-compatible). */\nexport const isoTimestampSchema = z\n .string()\n .datetime({ offset: true, message: 'must be an ISO-8601 timestamp' })\n\n/** Two-letter ISO-3166 country code. */\nexport const countryCodeSchema = z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be an ISO-3166 alpha-2 country code')\n\n/** Pagination inputs used by every list endpoint. */\nexport const paginationInputSchema = z.object({\n limit: z.number().int().min(1).max(100).default(25),\n cursor: z.string().min(1).max(200).nullish(),\n})\nexport type PaginationInput = z.infer<typeof paginationInputSchema>\n\n/** Pagination envelope used by every list response. */\nexport const makePaginatedSchema = <T extends z.ZodTypeAny>(item: T) =>\n z.object({\n data: z.array(item),\n nextCursor: z.string().nullable(),\n hasMore: z.boolean(),\n })\n\n/** Free-form metadata bag the API round-trips for merchants. */\nexport const metadataSchema = z\n .record(\n z.string().min(1).max(40),\n z.union([z.string().max(500), z.number(), z.boolean(), z.null()]),\n )\n .refine((m) => Object.keys(m).length <= 50, 'at most 50 metadata keys')\n .default({})\n\n/** Environment mode carried on every mode-scoped resource. */\nexport const modeSchema = z.enum(['test', 'live'])\nexport type Mode = z.infer<typeof modeSchema>\n\n/** Payment token enum. */\nexport const paymentCurrencySchema = z.enum(['USDC', 'EURC'])\nexport type PaymentCurrency = z.infer<typeof paymentCurrencySchema>\n\n/** Every display-level currency (payment + treasury). */\nexport const tokenSymbolSchema = z.enum(['USDC', 'EURC', 'USYC'])\nexport type TokenSymbol = z.infer<typeof tokenSymbolSchema>\n\n/** Merchant tier enum. */\nexport const merchantTierSchema = z.enum(['free', 'growth', 'business', 'enterprise'])\nexport type MerchantTier = z.infer<typeof merchantTierSchema>\n\n/** Arc environment enum. */\nexport const arcEnvironmentSchema = z.enum(['testnet', 'mainnet'])\nexport type ArcEnvironment = z.infer<typeof arcEnvironmentSchema>\n\nexport type Id = z.infer<typeof idSchema>\nexport type EvmAddress = z.infer<typeof evmAddressSchema>\nexport type EvmTxHash = z.infer<typeof evmTxHashSchema>\nexport type TokenAmount = z.infer<typeof tokenAmountSchema>\nexport type IsoTimestamp = z.infer<typeof isoTimestampSchema>\nexport type Metadata = z.infer<typeof metadataSchema>\n","/**\n * Transaction. The record of a confirmed on-chain payment.\n *\n * Every transaction corresponds to either a paid PaymentSession, a\n * SubscriptionCharge, or a Refund. Records are derived from the\n * `PaymentExecuted`, `SubscriptionCharged`, and `RefundRecorded` events.\n */\n\nimport { z } from 'zod'\nimport {\n evmAddressSchema,\n evmTxHashSchema,\n idSchema,\n isoTimestampSchema,\n paymentCurrencySchema,\n tokenAmountSchema,\n} from './common.js'\n\nexport const transactionKindSchema = z.enum([\n 'one_shot',\n 'subscription_charge',\n 'refund',\n 'invoice_payment',\n 'storefront_purchase',\n])\nexport type TransactionKind = z.infer<typeof transactionKindSchema>\n\nexport const transactionStatusSchema = z.enum(['pending', 'confirmed', 'failed'])\nexport type TransactionStatus = z.infer<typeof transactionStatusSchema>\n\nexport const transactionSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n kind: transactionKindSchema,\n status: transactionStatusSchema,\n sessionId: idSchema.nullable(),\n subscriptionId: idSchema.nullable(),\n subscriptionChargeId: idSchema.nullable(),\n refundId: idSchema.nullable(),\n customerId: idSchema.nullable(),\n amount: tokenAmountSchema,\n feeAmount: tokenAmountSchema,\n netAmount: tokenAmountSchema,\n currency: paymentCurrencySchema,\n payerAddress: evmAddressSchema,\n merchantAddress: evmAddressSchema,\n onchainTxHash: evmTxHashSchema,\n blockNumber: z.number().int().nonnegative(),\n blockTimestamp: isoTimestampSchema,\n createdAt: isoTimestampSchema,\n})\nexport type Transaction = z.infer<typeof transactionSchema>\n"]}
1
+ {"version":3,"sources":["../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A,iBAAA;AAAA,EACA;AACF,CAAC;AAGM,IAAM,0BAA0BA,CAAAA,CAAE,IAAA,CAAK,CAAC,SAAA,EAAW,WAAA,EAAa,QAAQ,CAAC;AAGzE,IAAM,iBAAA,GAAoBA,EAAE,MAAA,CAAO;AAAA,EACxC,EAAA,EAAI,QAAA;AAAA,EACJ,UAAA,EAAY,QAAA;AAAA,EACZ,IAAA,EAAM,qBAAA;AAAA,EACN,MAAA,EAAQ,uBAAA;AAAA,EACR,SAAA,EAAW,SAAS,QAAA,EAAS;AAAA,EAC7B,cAAA,EAAgB,SAAS,QAAA,EAAS;AAAA,EAClC,oBAAA,EAAsB,SAAS,QAAA,EAAS;AAAA,EACxC,QAAA,EAAU,SAAS,QAAA,EAAS;AAAA,EAC5B,UAAA,EAAY,SAAS,QAAA,EAAS;AAAA,EAC9B,MAAA,EAAQ,iBAAA;AAAA,EACR,SAAA,EAAW,iBAAA;AAAA,EACX,SAAA,EAAW,iBAAA;AAAA,EACX,QAAA,EAAU,qBAAA;AAAA,EACV,YAAA,EAAc,gBAAA;AAAA,EACd,eAAA,EAAiB,gBAAA;AAAA,EACjB,aAAA,EAAe,eAAA;AAAA,EACf,aAAaA,CAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,GAAM,WAAA,EAAY;AAAA,EAC1C,cAAA,EAAgB,kBAAA;AAAA,EAChB,SAAA,EAAW;AACb,CAAC","file":"transactions.js","sourcesContent":["/**\n * Primitive schemas shared across every entity.\n * Every higher-level schema builds on these so validation is consistent.\n */\n\nimport { z } from 'zod'\n\n/** CUID2 or UUID-style opaque identifier. */\nexport const idSchema = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'id must be URL-safe')\n\n/** EVM address. Hex-encoded, 0x-prefixed, 20 bytes. Normalised to lowercase. */\nexport const evmAddressSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{40}$/, 'must be a 0x-prefixed 40-character hex EVM address')\n .transform((v) => v.toLowerCase())\n\n/** EVM transaction hash. 32-byte hex. */\nexport const evmTxHashSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{64}$/, 'must be a 0x-prefixed 64-character hex EVM transaction hash')\n\n/** Email address, trimmed and lower-cased. */\nexport const emailSchema = z.string().email().trim().toLowerCase().max(320)\n\n/** HTTPS URL. No http:// allowed outside dev. */\nexport const httpsUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://'), {\n message: 'must be an https:// URL',\n })\n\n/** URL permitting http and https (dev + prod). */\nexport const httpUrlSchema = z.string().url()\n\n/**\n * Amount expressed in the token's smallest unit, serialised as a string to\n * preserve precision beyond `Number.MAX_SAFE_INTEGER`. For USDC (6 decimals),\n * 1 USDC is the string \"1000000\".\n */\nexport const tokenAmountSchema = z\n .string()\n .regex(/^[0-9]+$/, 'must be a non-negative integer string (base-10)')\n .refine((v) => BigInt(v) >= 0n, 'must be >= 0')\n\n/** Unsigned integer up to 2^53 - 1; validated and returned as number. */\nexport const uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\n/** ISO-8601 timestamp string (`.toISOString()`-compatible). */\nexport const isoTimestampSchema = z\n .string()\n .datetime({ offset: true, message: 'must be an ISO-8601 timestamp' })\n\n/** Two-letter ISO-3166 country code. */\nexport const countryCodeSchema = z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be an ISO-3166 alpha-2 country code')\n\n/** Pagination inputs used by every list endpoint. */\nexport const paginationInputSchema = z.object({\n limit: z.number().int().min(1).max(100).default(25),\n cursor: z.string().min(1).max(200).nullish(),\n})\nexport type PaginationInput = z.input<typeof paginationInputSchema>\nexport type PaginationParsed = z.output<typeof paginationInputSchema>\n\n/** Pagination envelope used by every list response. */\nexport const makePaginatedSchema = <T extends z.ZodTypeAny>(item: T) =>\n z.object({\n data: z.array(item),\n nextCursor: z.string().nullable(),\n hasMore: z.boolean(),\n })\n\n/** Free-form metadata bag the API round-trips for merchants. */\nexport const metadataSchema = z\n .record(\n z.string().min(1).max(40),\n z.union([z.string().max(500), z.number(), z.boolean(), z.null()]),\n )\n .refine((m) => Object.keys(m).length <= 50, 'at most 50 metadata keys')\n .default({})\n\n/** Environment mode carried on every mode-scoped resource. */\nexport const modeSchema = z.enum(['test', 'live'])\nexport type Mode = z.infer<typeof modeSchema>\n\n/** Payment token enum. */\nexport const paymentCurrencySchema = z.enum(['USDC', 'EURC'])\nexport type PaymentCurrency = z.infer<typeof paymentCurrencySchema>\n\n/** Every display-level currency (payment + treasury). */\nexport const tokenSymbolSchema = z.enum(['USDC', 'EURC', 'USYC'])\nexport type TokenSymbol = z.infer<typeof tokenSymbolSchema>\n\n/** Merchant tier enum. */\nexport const merchantTierSchema = z.enum(['free', 'growth', 'business', 'enterprise'])\nexport type MerchantTier = z.infer<typeof merchantTierSchema>\n\n/** Arc environment enum. */\nexport const arcEnvironmentSchema = z.enum(['testnet', 'mainnet'])\nexport type ArcEnvironment = z.infer<typeof arcEnvironmentSchema>\n\nexport type Id = z.infer<typeof idSchema>\nexport type EvmAddress = z.infer<typeof evmAddressSchema>\nexport type EvmTxHash = z.infer<typeof evmTxHashSchema>\nexport type TokenAmount = z.infer<typeof tokenAmountSchema>\nexport type IsoTimestamp = z.infer<typeof isoTimestampSchema>\nexport type Metadata = z.infer<typeof metadataSchema>\n","/**\n * Transaction. The record of a confirmed on-chain payment.\n *\n * Every transaction corresponds to either a paid PaymentSession, a\n * SubscriptionCharge, or a Refund. Records are derived from the\n * `PaymentExecuted`, `SubscriptionCharged`, and `RefundRecorded` events.\n */\n\nimport { z } from 'zod'\nimport {\n evmAddressSchema,\n evmTxHashSchema,\n idSchema,\n isoTimestampSchema,\n paymentCurrencySchema,\n tokenAmountSchema,\n} from './common.js'\n\nexport const transactionKindSchema = z.enum([\n 'one_shot',\n 'subscription_charge',\n 'refund',\n 'invoice_payment',\n 'storefront_purchase',\n])\nexport type TransactionKind = z.infer<typeof transactionKindSchema>\n\nexport const transactionStatusSchema = z.enum(['pending', 'confirmed', 'failed'])\nexport type TransactionStatus = z.infer<typeof transactionStatusSchema>\n\nexport const transactionSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n kind: transactionKindSchema,\n status: transactionStatusSchema,\n sessionId: idSchema.nullable(),\n subscriptionId: idSchema.nullable(),\n subscriptionChargeId: idSchema.nullable(),\n refundId: idSchema.nullable(),\n customerId: idSchema.nullable(),\n amount: tokenAmountSchema,\n feeAmount: tokenAmountSchema,\n netAmount: tokenAmountSchema,\n currency: paymentCurrencySchema,\n payerAddress: evmAddressSchema,\n merchantAddress: evmAddressSchema,\n onchainTxHash: evmTxHashSchema,\n blockNumber: z.number().int().nonnegative(),\n blockTimestamp: isoTimestampSchema,\n createdAt: isoTimestampSchema,\n})\nexport type Transaction = z.infer<typeof transactionSchema>\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.ts","../src/webhooks.ts"],"names":["z"],"mappings":";;;;;AAQO,IAAM,QAAA,GAAWA,KAAA,CACrB,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,EAAE,CAAA,CACN,KAAA,CAAM,kBAAA,EAAoB,qBAAqB,CAAA;AAGlBA,KAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa;AAGJA,KAAA,CAC5B,MAAA,EAAO,CACP,KAAA,CAAM,uBAAuB,6DAA6D;AAGlEA,KAAA,CAAE,MAAA,EAAO,CAAE,KAAA,EAAM,CAAE,IAAA,EAAK,CAAE,WAAA,EAAY,CAAE,GAAA,CAAI,GAAG;AAGnE,IAAM,cAAA,GAAiBA,KAAA,CAC3B,MAAA,EAAO,CACP,GAAA,EAAI,CACJ,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,UAAA,CAAW,UAAU,CAAA,EAAG;AAAA,EACvC,OAAA,EAAS;AACX,CAAC,CAAA;AAG0BA,KAAA,C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AG,CAAA,CAAE,QAAA,EAAS;AAAA,EAC1D,UAAA,EAAYA,MAAE,MAAA,EAAO,CAAE,KAAI,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,QAAA,EAAS;AAAA,EAC7C,WAAWA,KAAAA,CAAE,MAAA,GAAS,GAAA,CAAI,GAAI,EAAE,QAAA,EAAS;AAAA,EACzC,aAAA,EAAe,mBAAmB,QAAA,EAAS;AAAA,EAC3C,WAAA,EAAa,mBAAmB,QAAA,EAAS;AAAA,EACzC,SAAA,EAAW;AACb,CAAC;AAQM,IAAM,2BAAA,GAA8B,sBAAsB,MAAA,CAAO;AAAA,EACtE,UAAA,EAAYA,MAAE,MAAA,EAAO;AAAA,EACrB,YAAA,EAAcA,KAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAClC,cAAA,EAAgBA,MAAE,MAAA,CAAOA,KAAAA,CAAE,QAAO,EAAGA,KAAAA,CAAE,SAAS;AAClD,CAAC;AAGM,IAAM,yBAAA,GAA4BA,MAAE,MAAA,CAAO;AAAA,EAChD,EAAA,EAAI;AACN,CAAC","file":"webhooks.cjs","sourcesContent":["/**\n * Primitive schemas shared across every entity.\n * Every higher-level schema builds on these so validation is consistent.\n */\n\nimport { z } from 'zod'\n\n/** CUID2 or UUID-style opaque identifier. */\nexport const idSchema = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'id must be URL-safe')\n\n/** EVM address. Hex-encoded, 0x-prefixed, 20 bytes. Normalised to lowercase. */\nexport const evmAddressSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{40}$/, 'must be a 0x-prefixed 40-character hex EVM address')\n .transform((v) => v.toLowerCase())\n\n/** EVM transaction hash. 32-byte hex. */\nexport const evmTxHashSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{64}$/, 'must be a 0x-prefixed 64-character hex EVM transaction hash')\n\n/** Email address, trimmed and lower-cased. */\nexport const emailSchema = z.string().email().trim().toLowerCase().max(320)\n\n/** HTTPS URL. No http:// allowed outside dev. */\nexport const httpsUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://'), {\n message: 'must be an https:// URL',\n })\n\n/** URL permitting http and https (dev + prod). */\nexport const httpUrlSchema = z.string().url()\n\n/**\n * Amount expressed in the token's smallest unit, serialised as a string to\n * preserve precision beyond `Number.MAX_SAFE_INTEGER`. For USDC (6 decimals),\n * 1 USDC is the string \"1000000\".\n */\nexport const tokenAmountSchema = z\n .string()\n .regex(/^[0-9]+$/, 'must be a non-negative integer string (base-10)')\n .refine((v) => BigInt(v) >= 0n, 'must be >= 0')\n\n/** Unsigned integer up to 2^53 - 1; validated and returned as number. */\nexport const uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\n/** ISO-8601 timestamp string (`.toISOString()`-compatible). */\nexport const isoTimestampSchema = z\n .string()\n .datetime({ offset: true, message: 'must be an ISO-8601 timestamp' })\n\n/** Two-letter ISO-3166 country code. */\nexport const countryCodeSchema = z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be an ISO-3166 alpha-2 country code')\n\n/** Pagination inputs used by every list endpoint. */\nexport const paginationInputSchema = z.object({\n limit: z.number().int().min(1).max(100).default(25),\n cursor: z.string().min(1).max(200).nullish(),\n})\nexport type PaginationInput = z.infer<typeof paginationInputSchema>\n\n/** Pagination envelope used by every list response. */\nexport const makePaginatedSchema = <T extends z.ZodTypeAny>(item: T) =>\n z.object({\n data: z.array(item),\n nextCursor: z.string().nullable(),\n hasMore: z.boolean(),\n })\n\n/** Free-form metadata bag the API round-trips for merchants. */\nexport const metadataSchema = z\n .record(\n z.string().min(1).max(40),\n z.union([z.string().max(500), z.number(), z.boolean(), z.null()]),\n )\n .refine((m) => Object.keys(m).length <= 50, 'at most 50 metadata keys')\n .default({})\n\n/** Environment mode carried on every mode-scoped resource. */\nexport const modeSchema = z.enum(['test', 'live'])\nexport type Mode = z.infer<typeof modeSchema>\n\n/** Payment token enum. */\nexport const paymentCurrencySchema = z.enum(['USDC', 'EURC'])\nexport type PaymentCurrency = z.infer<typeof paymentCurrencySchema>\n\n/** Every display-level currency (payment + treasury). */\nexport const tokenSymbolSchema = z.enum(['USDC', 'EURC', 'USYC'])\nexport type TokenSymbol = z.infer<typeof tokenSymbolSchema>\n\n/** Merchant tier enum. */\nexport const merchantTierSchema = z.enum(['free', 'growth', 'business', 'enterprise'])\nexport type MerchantTier = z.infer<typeof merchantTierSchema>\n\n/** Arc environment enum. */\nexport const arcEnvironmentSchema = z.enum(['testnet', 'mainnet'])\nexport type ArcEnvironment = z.infer<typeof arcEnvironmentSchema>\n\nexport type Id = z.infer<typeof idSchema>\nexport type EvmAddress = z.infer<typeof evmAddressSchema>\nexport type EvmTxHash = z.infer<typeof evmTxHashSchema>\nexport type TokenAmount = z.infer<typeof tokenAmountSchema>\nexport type IsoTimestamp = z.infer<typeof isoTimestampSchema>\nexport type Metadata = z.infer<typeof metadataSchema>\n","/**\n * Webhook endpoints and deliveries.\n *\n * Endpoint = the URL the merchant registered.\n * Event = the thing that happened.\n * Delivery = one attempt to POST a specific event to a specific endpoint.\n */\n\nimport { z } from 'zod'\nimport { httpsUrlSchema, idSchema, isoTimestampSchema, modeSchema } from './common.js'\n\n// ---------- Event name ----------\n\n/**\n * Every webhook event name in the system. Listed inline so Zod can\n * produce a concrete string union.\n */\nexport const webhookEventNameSchema = z.enum([\n 'payment.created',\n 'payment.completed',\n 'payment.failed',\n 'subscription.created',\n 'subscription.charged',\n 'subscription.charge_failed',\n 'subscription.recovery_attempt',\n 'subscription.recovery_outcome',\n 'subscription.cancelled',\n 'subscription.lapsed',\n 'refund.created',\n 'refund.completed',\n 'refund.failed',\n 'invoice.created',\n 'invoice.paid',\n 'invoice.overdue',\n 'agent.action_executed',\n 'agent.job_proposed',\n 'agent.job_completed',\n 'agent.job_disputed',\n 'compliance.wallet_flagged',\n 'compliance.wallet_blocked',\n])\nexport type WebhookEventName = z.infer<typeof webhookEventNameSchema>\n\n// ---------- Endpoints ----------\n\nexport const webhookEndpointStatusSchema = z.enum(['active', 'disabled'])\nexport type WebhookEndpointStatus = z.infer<typeof webhookEndpointStatusSchema>\n\nexport const webhookEndpointSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n mode: modeSchema,\n url: httpsUrlSchema,\n description: z.string().max(200).nullable(),\n events: z.array(webhookEventNameSchema).nonempty(),\n status: webhookEndpointStatusSchema,\n signingSecretPrefix: z.string().min(4).max(12),\n lastDeliveredAt: isoTimestampSchema.nullable(),\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type WebhookEndpoint = z.infer<typeof webhookEndpointSchema>\n\nexport const createWebhookEndpointInputSchema = z.object({\n url: httpsUrlSchema,\n events: z.array(webhookEventNameSchema).nonempty(),\n description: z.string().max(200).optional(),\n mode: modeSchema,\n})\nexport type CreateWebhookEndpointInput = z.infer<typeof createWebhookEndpointInputSchema>\n\nexport const createWebhookEndpointOutputSchema = z.object({\n endpoint: webhookEndpointSchema,\n /** Full signing secret. Shown exactly once. */\n signingSecret: z.string(),\n})\nexport type CreateWebhookEndpointOutput = z.infer<typeof createWebhookEndpointOutputSchema>\n\n// ---------- Deliveries ----------\n\nexport const webhookDeliveryStatusSchema = z.enum([\n 'pending',\n 'delivered',\n 'retrying',\n 'permanently_failed',\n])\nexport type WebhookDeliveryStatus = z.infer<typeof webhookDeliveryStatusSchema>\n\nexport const webhookDeliverySchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n endpointId: idSchema,\n eventId: idSchema,\n eventName: webhookEventNameSchema,\n status: webhookDeliveryStatusSchema,\n attempt: z.number().int().min(1).max(6),\n responseCode: z.number().int().min(100).max(599).nullable(),\n responseMs: z.number().int().min(0).nullable(),\n lastError: z.string().max(1000).nullable(),\n nextAttemptAt: isoTimestampSchema.nullable(),\n deliveredAt: isoTimestampSchema.nullable(),\n createdAt: isoTimestampSchema,\n})\nexport type WebhookDelivery = z.infer<typeof webhookDeliverySchema>\n\n/**\n * Detail projection returned by GET /v1/webhook-deliveries/:id.\n * Carries the payload envelope, response body, and the deliveryId\n * header the receiver saw. Kept separate so list responses stay slim.\n */\nexport const webhookDeliveryDetailSchema = webhookDeliverySchema.extend({\n deliveryId: z.string(),\n responseBody: z.string().nullable(),\n requestPayload: z.record(z.string(), z.unknown()),\n})\nexport type WebhookDeliveryDetail = z.infer<typeof webhookDeliveryDetailSchema>\n\nexport const replayDeliveryInputSchema = z.object({\n id: idSchema,\n})\nexport type ReplayDeliveryInput = z.infer<typeof replayDeliveryInputSchema>\n"]}
1
+ {"version":3,"sources":["../src/common.ts","../src/webhooks.ts"],"names":["z"],"mappings":";;;;;AAQO,IAAM,QAAA,GAAWA,KAAA,CACrB,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,EAAE,CAAA,CACN,KAAA,CAAM,kBAAA,EAAoB,qBAAqB,CAAA;AAGlBA,KAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa;AAGJA,KAAA,CAC5B,MAAA,EAAO,CACP,KAAA,CAAM,uBAAuB,6DAA6D;AAGlEA,KAAA,CAAE,MAAA,EAAO,CAAE,KAAA,EAAM,CAAE,IAAA,EAAK,CAAE,WAAA,EAAY,CAAE,GAAA,CAAI,GAAG;AAGnE,IAAM,cAAA,GAAiBA,KAAA,CAC3B,MAAA,EAAO,CACP,GAAA,EAAI,CACJ,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,UAAA,CAAW,UAAU,CAAA,EAAG;AAAA,EACvC,OAAA,EAAS;AACX,CAAC,CAAA;AAG0BA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA;AAOPA,KAAA,CAC9B,MAAA,EAAO,CACP,MAAM,UAAA,EAAY,iDAAiD,CAAA,CACnE,MAAA,CAAO,CAAC,CAAA,KAAM,MAAA,CAAO,CAAC,CA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AAA,CAAE,MAAA,GAAS,GAAA,CAAI,GAAI,EAAE,QAAA,EAAS;AAAA,EACzC,aAAA,EAAe,mBAAmB,QAAA,EAAS;AAAA,EAC3C,WAAA,EAAa,mBAAmB,QAAA,EAAS;AAAA,EACzC,SAAA,EAAW;AACb,CAAC;AAQM,IAAM,2BAAA,GAA8B,sBAAsB,MAAA,CAAO;AAAA,EACtE,UAAA,EAAYA,MAAE,MAAA,EAAO;AAAA,EACrB,YAAA,EAAcA,KAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAClC,cAAA,EAAgBA,MAAE,MAAA,CAAOA,KAAAA,CAAE,QAAO,EAAGA,KAAAA,CAAE,SAAS;AAClD,CAAC;AAGM,IAAM,yBAAA,GAA4BA,MAAE,MAAA,CAAO;AAAA,EAChD,EAAA,EAAI;AACN,CAAC","file":"webhooks.cjs","sourcesContent":["/**\n * Primitive schemas shared across every entity.\n * Every higher-level schema builds on these so validation is consistent.\n */\n\nimport { z } from 'zod'\n\n/** CUID2 or UUID-style opaque identifier. */\nexport const idSchema = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'id must be URL-safe')\n\n/** EVM address. Hex-encoded, 0x-prefixed, 20 bytes. Normalised to lowercase. */\nexport const evmAddressSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{40}$/, 'must be a 0x-prefixed 40-character hex EVM address')\n .transform((v) => v.toLowerCase())\n\n/** EVM transaction hash. 32-byte hex. */\nexport const evmTxHashSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{64}$/, 'must be a 0x-prefixed 64-character hex EVM transaction hash')\n\n/** Email address, trimmed and lower-cased. */\nexport const emailSchema = z.string().email().trim().toLowerCase().max(320)\n\n/** HTTPS URL. No http:// allowed outside dev. */\nexport const httpsUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://'), {\n message: 'must be an https:// URL',\n })\n\n/** URL permitting http and https (dev + prod). */\nexport const httpUrlSchema = z.string().url()\n\n/**\n * Amount expressed in the token's smallest unit, serialised as a string to\n * preserve precision beyond `Number.MAX_SAFE_INTEGER`. For USDC (6 decimals),\n * 1 USDC is the string \"1000000\".\n */\nexport const tokenAmountSchema = z\n .string()\n .regex(/^[0-9]+$/, 'must be a non-negative integer string (base-10)')\n .refine((v) => BigInt(v) >= 0n, 'must be >= 0')\n\n/** Unsigned integer up to 2^53 - 1; validated and returned as number. */\nexport const uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\n/** ISO-8601 timestamp string (`.toISOString()`-compatible). */\nexport const isoTimestampSchema = z\n .string()\n .datetime({ offset: true, message: 'must be an ISO-8601 timestamp' })\n\n/** Two-letter ISO-3166 country code. */\nexport const countryCodeSchema = z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be an ISO-3166 alpha-2 country code')\n\n/** Pagination inputs used by every list endpoint. */\nexport const paginationInputSchema = z.object({\n limit: z.number().int().min(1).max(100).default(25),\n cursor: z.string().min(1).max(200).nullish(),\n})\nexport type PaginationInput = z.input<typeof paginationInputSchema>\nexport type PaginationParsed = z.output<typeof paginationInputSchema>\n\n/** Pagination envelope used by every list response. */\nexport const makePaginatedSchema = <T extends z.ZodTypeAny>(item: T) =>\n z.object({\n data: z.array(item),\n nextCursor: z.string().nullable(),\n hasMore: z.boolean(),\n })\n\n/** Free-form metadata bag the API round-trips for merchants. */\nexport const metadataSchema = z\n .record(\n z.string().min(1).max(40),\n z.union([z.string().max(500), z.number(), z.boolean(), z.null()]),\n )\n .refine((m) => Object.keys(m).length <= 50, 'at most 50 metadata keys')\n .default({})\n\n/** Environment mode carried on every mode-scoped resource. */\nexport const modeSchema = z.enum(['test', 'live'])\nexport type Mode = z.infer<typeof modeSchema>\n\n/** Payment token enum. */\nexport const paymentCurrencySchema = z.enum(['USDC', 'EURC'])\nexport type PaymentCurrency = z.infer<typeof paymentCurrencySchema>\n\n/** Every display-level currency (payment + treasury). */\nexport const tokenSymbolSchema = z.enum(['USDC', 'EURC', 'USYC'])\nexport type TokenSymbol = z.infer<typeof tokenSymbolSchema>\n\n/** Merchant tier enum. */\nexport const merchantTierSchema = z.enum(['free', 'growth', 'business', 'enterprise'])\nexport type MerchantTier = z.infer<typeof merchantTierSchema>\n\n/** Arc environment enum. */\nexport const arcEnvironmentSchema = z.enum(['testnet', 'mainnet'])\nexport type ArcEnvironment = z.infer<typeof arcEnvironmentSchema>\n\nexport type Id = z.infer<typeof idSchema>\nexport type EvmAddress = z.infer<typeof evmAddressSchema>\nexport type EvmTxHash = z.infer<typeof evmTxHashSchema>\nexport type TokenAmount = z.infer<typeof tokenAmountSchema>\nexport type IsoTimestamp = z.infer<typeof isoTimestampSchema>\nexport type Metadata = z.infer<typeof metadataSchema>\n","/**\n * Webhook endpoints and deliveries.\n *\n * Endpoint = the URL the merchant registered.\n * Event = the thing that happened.\n * Delivery = one attempt to POST a specific event to a specific endpoint.\n */\n\nimport { z } from 'zod'\nimport { httpsUrlSchema, idSchema, isoTimestampSchema, modeSchema } from './common.js'\n\n// ---------- Event name ----------\n\n/**\n * Every webhook event name in the system. Listed inline so Zod can\n * produce a concrete string union.\n */\nexport const webhookEventNameSchema = z.enum([\n 'payment.created',\n 'payment.completed',\n 'payment.failed',\n 'subscription.created',\n 'subscription.charged',\n 'subscription.charge_failed',\n 'subscription.recovery_attempt',\n 'subscription.recovery_outcome',\n 'subscription.cancelled',\n 'subscription.lapsed',\n 'refund.created',\n 'refund.completed',\n 'refund.failed',\n 'invoice.created',\n 'invoice.paid',\n 'invoice.overdue',\n 'agent.action_executed',\n 'agent.job_proposed',\n 'agent.job_completed',\n 'agent.job_disputed',\n 'compliance.wallet_flagged',\n 'compliance.wallet_blocked',\n])\nexport type WebhookEventName = z.infer<typeof webhookEventNameSchema>\n\n// ---------- Endpoints ----------\n\nexport const webhookEndpointStatusSchema = z.enum(['active', 'disabled'])\nexport type WebhookEndpointStatus = z.infer<typeof webhookEndpointStatusSchema>\n\nexport const webhookEndpointSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n mode: modeSchema,\n url: httpsUrlSchema,\n description: z.string().max(200).nullable(),\n events: z.array(webhookEventNameSchema).nonempty(),\n status: webhookEndpointStatusSchema,\n signingSecretPrefix: z.string().min(4).max(12),\n lastDeliveredAt: isoTimestampSchema.nullable(),\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type WebhookEndpoint = z.infer<typeof webhookEndpointSchema>\n\nexport const createWebhookEndpointInputSchema = z.object({\n url: httpsUrlSchema,\n events: z.array(webhookEventNameSchema).nonempty(),\n description: z.string().max(200).optional(),\n mode: modeSchema,\n})\nexport type CreateWebhookEndpointInput = z.input<typeof createWebhookEndpointInputSchema>\nexport type CreateWebhookEndpointParsed = z.output<typeof createWebhookEndpointInputSchema>\n\nexport const createWebhookEndpointOutputSchema = z.object({\n endpoint: webhookEndpointSchema,\n /** Full signing secret. Shown exactly once. */\n signingSecret: z.string(),\n})\nexport type CreateWebhookEndpointOutput = z.infer<typeof createWebhookEndpointOutputSchema>\n\n// ---------- Deliveries ----------\n\nexport const webhookDeliveryStatusSchema = z.enum([\n 'pending',\n 'delivered',\n 'retrying',\n 'permanently_failed',\n])\nexport type WebhookDeliveryStatus = z.infer<typeof webhookDeliveryStatusSchema>\n\nexport const webhookDeliverySchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n endpointId: idSchema,\n eventId: idSchema,\n eventName: webhookEventNameSchema,\n status: webhookDeliveryStatusSchema,\n attempt: z.number().int().min(1).max(6),\n responseCode: z.number().int().min(100).max(599).nullable(),\n responseMs: z.number().int().min(0).nullable(),\n lastError: z.string().max(1000).nullable(),\n nextAttemptAt: isoTimestampSchema.nullable(),\n deliveredAt: isoTimestampSchema.nullable(),\n createdAt: isoTimestampSchema,\n})\nexport type WebhookDelivery = z.infer<typeof webhookDeliverySchema>\n\n/**\n * Detail projection returned by GET /v1/webhook-deliveries/:id.\n * Carries the payload envelope, response body, and the deliveryId\n * header the receiver saw. Kept separate so list responses stay slim.\n */\nexport const webhookDeliveryDetailSchema = webhookDeliverySchema.extend({\n deliveryId: z.string(),\n responseBody: z.string().nullable(),\n requestPayload: z.record(z.string(), z.unknown()),\n})\nexport type WebhookDeliveryDetail = z.infer<typeof webhookDeliveryDetailSchema>\n\nexport const replayDeliveryInputSchema = z.object({\n id: idSchema,\n})\nexport type ReplayDeliveryInput = z.input<typeof replayDeliveryInputSchema>\nexport type ReplayDeliveryParsed = z.output<typeof replayDeliveryInputSchema>\n"]}
@@ -29,24 +29,24 @@ declare const webhookEndpointSchema: z.ZodObject<{
29
29
  createdAt: z.ZodString;
30
30
  updatedAt: z.ZodString;
31
31
  }, "strip", z.ZodTypeAny, {
32
- status: "disabled" | "active";
33
- id: string;
34
- merchantId: string;
35
- createdAt: string;
32
+ status: "active" | "disabled";
36
33
  mode: "test" | "live";
34
+ merchantId: string;
37
35
  description: string | null;
36
+ id: string;
37
+ createdAt: string;
38
38
  updatedAt: string;
39
39
  url: string;
40
40
  events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
41
41
  signingSecretPrefix: string;
42
42
  lastDeliveredAt: string | null;
43
43
  }, {
44
- status: "disabled" | "active";
45
- id: string;
46
- merchantId: string;
47
- createdAt: string;
44
+ status: "active" | "disabled";
48
45
  mode: "test" | "live";
46
+ merchantId: string;
49
47
  description: string | null;
48
+ id: string;
49
+ createdAt: string;
50
50
  updatedAt: string;
51
51
  url: string;
52
52
  events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
@@ -70,7 +70,8 @@ declare const createWebhookEndpointInputSchema: z.ZodObject<{
70
70
  events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
71
71
  description?: string | undefined;
72
72
  }>;
73
- type CreateWebhookEndpointInput = z.infer<typeof createWebhookEndpointInputSchema>;
73
+ type CreateWebhookEndpointInput = z.input<typeof createWebhookEndpointInputSchema>;
74
+ type CreateWebhookEndpointParsed = z.output<typeof createWebhookEndpointInputSchema>;
74
75
  declare const createWebhookEndpointOutputSchema: z.ZodObject<{
75
76
  endpoint: z.ZodObject<{
76
77
  id: z.ZodString;
@@ -85,24 +86,24 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
85
86
  createdAt: z.ZodString;
86
87
  updatedAt: z.ZodString;
87
88
  }, "strip", z.ZodTypeAny, {
88
- status: "disabled" | "active";
89
- id: string;
90
- merchantId: string;
91
- createdAt: string;
89
+ status: "active" | "disabled";
92
90
  mode: "test" | "live";
91
+ merchantId: string;
93
92
  description: string | null;
93
+ id: string;
94
+ createdAt: string;
94
95
  updatedAt: string;
95
96
  url: string;
96
97
  events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
97
98
  signingSecretPrefix: string;
98
99
  lastDeliveredAt: string | null;
99
100
  }, {
100
- status: "disabled" | "active";
101
- id: string;
102
- merchantId: string;
103
- createdAt: string;
101
+ status: "active" | "disabled";
104
102
  mode: "test" | "live";
103
+ merchantId: string;
105
104
  description: string | null;
105
+ id: string;
106
+ createdAt: string;
106
107
  updatedAt: string;
107
108
  url: string;
108
109
  events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
@@ -113,12 +114,12 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
113
114
  signingSecret: z.ZodString;
114
115
  }, "strip", z.ZodTypeAny, {
115
116
  endpoint: {
116
- status: "disabled" | "active";
117
- id: string;
118
- merchantId: string;
119
- createdAt: string;
117
+ status: "active" | "disabled";
120
118
  mode: "test" | "live";
119
+ merchantId: string;
121
120
  description: string | null;
121
+ id: string;
122
+ createdAt: string;
122
123
  updatedAt: string;
123
124
  url: string;
124
125
  events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
@@ -128,12 +129,12 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
128
129
  signingSecret: string;
129
130
  }, {
130
131
  endpoint: {
131
- status: "disabled" | "active";
132
- id: string;
133
- merchantId: string;
134
- createdAt: string;
132
+ status: "active" | "disabled";
135
133
  mode: "test" | "live";
134
+ merchantId: string;
136
135
  description: string | null;
136
+ id: string;
137
+ createdAt: string;
137
138
  updatedAt: string;
138
139
  url: string;
139
140
  events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
@@ -161,8 +162,8 @@ declare const webhookDeliverySchema: z.ZodObject<{
161
162
  createdAt: z.ZodString;
162
163
  }, "strip", z.ZodTypeAny, {
163
164
  status: "pending" | "retrying" | "delivered" | "permanently_failed";
164
- id: string;
165
165
  merchantId: string;
166
+ id: string;
166
167
  createdAt: string;
167
168
  endpointId: string;
168
169
  eventId: string;
@@ -175,8 +176,8 @@ declare const webhookDeliverySchema: z.ZodObject<{
175
176
  deliveredAt: string | null;
176
177
  }, {
177
178
  status: "pending" | "retrying" | "delivered" | "permanently_failed";
178
- id: string;
179
179
  merchantId: string;
180
+ id: string;
180
181
  createdAt: string;
181
182
  endpointId: string;
182
183
  eventId: string;
@@ -214,8 +215,8 @@ declare const webhookDeliveryDetailSchema: z.ZodObject<{
214
215
  requestPayload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
215
216
  }, "strip", z.ZodTypeAny, {
216
217
  status: "pending" | "retrying" | "delivered" | "permanently_failed";
217
- id: string;
218
218
  merchantId: string;
219
+ id: string;
219
220
  createdAt: string;
220
221
  endpointId: string;
221
222
  eventId: string;
@@ -231,8 +232,8 @@ declare const webhookDeliveryDetailSchema: z.ZodObject<{
231
232
  requestPayload: Record<string, unknown>;
232
233
  }, {
233
234
  status: "pending" | "retrying" | "delivered" | "permanently_failed";
234
- id: string;
235
235
  merchantId: string;
236
+ id: string;
236
237
  createdAt: string;
237
238
  endpointId: string;
238
239
  eventId: string;
@@ -255,6 +256,7 @@ declare const replayDeliveryInputSchema: z.ZodObject<{
255
256
  }, {
256
257
  id: string;
257
258
  }>;
258
- type ReplayDeliveryInput = z.infer<typeof replayDeliveryInputSchema>;
259
+ type ReplayDeliveryInput = z.input<typeof replayDeliveryInputSchema>;
260
+ type ReplayDeliveryParsed = z.output<typeof replayDeliveryInputSchema>;
259
261
 
260
- export { type CreateWebhookEndpointInput, type CreateWebhookEndpointOutput, type ReplayDeliveryInput, type WebhookDelivery, type WebhookDeliveryDetail, type WebhookDeliveryStatus, type WebhookEndpoint, type WebhookEndpointStatus, type WebhookEventName, createWebhookEndpointInputSchema, createWebhookEndpointOutputSchema, replayDeliveryInputSchema, webhookDeliveryDetailSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEndpointSchema, webhookEndpointStatusSchema, webhookEventNameSchema };
262
+ export { type CreateWebhookEndpointInput, type CreateWebhookEndpointOutput, type CreateWebhookEndpointParsed, type ReplayDeliveryInput, type ReplayDeliveryParsed, type WebhookDelivery, type WebhookDeliveryDetail, type WebhookDeliveryStatus, type WebhookEndpoint, type WebhookEndpointStatus, type WebhookEventName, createWebhookEndpointInputSchema, createWebhookEndpointOutputSchema, replayDeliveryInputSchema, webhookDeliveryDetailSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEndpointSchema, webhookEndpointStatusSchema, webhookEventNameSchema };
@@ -29,24 +29,24 @@ declare const webhookEndpointSchema: z.ZodObject<{
29
29
  createdAt: z.ZodString;
30
30
  updatedAt: z.ZodString;
31
31
  }, "strip", z.ZodTypeAny, {
32
- status: "disabled" | "active";
33
- id: string;
34
- merchantId: string;
35
- createdAt: string;
32
+ status: "active" | "disabled";
36
33
  mode: "test" | "live";
34
+ merchantId: string;
37
35
  description: string | null;
36
+ id: string;
37
+ createdAt: string;
38
38
  updatedAt: string;
39
39
  url: string;
40
40
  events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
41
41
  signingSecretPrefix: string;
42
42
  lastDeliveredAt: string | null;
43
43
  }, {
44
- status: "disabled" | "active";
45
- id: string;
46
- merchantId: string;
47
- createdAt: string;
44
+ status: "active" | "disabled";
48
45
  mode: "test" | "live";
46
+ merchantId: string;
49
47
  description: string | null;
48
+ id: string;
49
+ createdAt: string;
50
50
  updatedAt: string;
51
51
  url: string;
52
52
  events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
@@ -70,7 +70,8 @@ declare const createWebhookEndpointInputSchema: z.ZodObject<{
70
70
  events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
71
71
  description?: string | undefined;
72
72
  }>;
73
- type CreateWebhookEndpointInput = z.infer<typeof createWebhookEndpointInputSchema>;
73
+ type CreateWebhookEndpointInput = z.input<typeof createWebhookEndpointInputSchema>;
74
+ type CreateWebhookEndpointParsed = z.output<typeof createWebhookEndpointInputSchema>;
74
75
  declare const createWebhookEndpointOutputSchema: z.ZodObject<{
75
76
  endpoint: z.ZodObject<{
76
77
  id: z.ZodString;
@@ -85,24 +86,24 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
85
86
  createdAt: z.ZodString;
86
87
  updatedAt: z.ZodString;
87
88
  }, "strip", z.ZodTypeAny, {
88
- status: "disabled" | "active";
89
- id: string;
90
- merchantId: string;
91
- createdAt: string;
89
+ status: "active" | "disabled";
92
90
  mode: "test" | "live";
91
+ merchantId: string;
93
92
  description: string | null;
93
+ id: string;
94
+ createdAt: string;
94
95
  updatedAt: string;
95
96
  url: string;
96
97
  events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
97
98
  signingSecretPrefix: string;
98
99
  lastDeliveredAt: string | null;
99
100
  }, {
100
- status: "disabled" | "active";
101
- id: string;
102
- merchantId: string;
103
- createdAt: string;
101
+ status: "active" | "disabled";
104
102
  mode: "test" | "live";
103
+ merchantId: string;
105
104
  description: string | null;
105
+ id: string;
106
+ createdAt: string;
106
107
  updatedAt: string;
107
108
  url: string;
108
109
  events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
@@ -113,12 +114,12 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
113
114
  signingSecret: z.ZodString;
114
115
  }, "strip", z.ZodTypeAny, {
115
116
  endpoint: {
116
- status: "disabled" | "active";
117
- id: string;
118
- merchantId: string;
119
- createdAt: string;
117
+ status: "active" | "disabled";
120
118
  mode: "test" | "live";
119
+ merchantId: string;
121
120
  description: string | null;
121
+ id: string;
122
+ createdAt: string;
122
123
  updatedAt: string;
123
124
  url: string;
124
125
  events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
@@ -128,12 +129,12 @@ declare const createWebhookEndpointOutputSchema: z.ZodObject<{
128
129
  signingSecret: string;
129
130
  }, {
130
131
  endpoint: {
131
- status: "disabled" | "active";
132
- id: string;
133
- merchantId: string;
134
- createdAt: string;
132
+ status: "active" | "disabled";
135
133
  mode: "test" | "live";
134
+ merchantId: string;
136
135
  description: string | null;
136
+ id: string;
137
+ createdAt: string;
137
138
  updatedAt: string;
138
139
  url: string;
139
140
  events: ["payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked", ...("payment.created" | "payment.completed" | "payment.failed" | "subscription.created" | "subscription.charged" | "subscription.charge_failed" | "subscription.recovery_attempt" | "subscription.recovery_outcome" | "subscription.cancelled" | "subscription.lapsed" | "refund.created" | "refund.completed" | "refund.failed" | "invoice.created" | "invoice.paid" | "invoice.overdue" | "agent.action_executed" | "agent.job_proposed" | "agent.job_completed" | "agent.job_disputed" | "compliance.wallet_flagged" | "compliance.wallet_blocked")[]];
@@ -161,8 +162,8 @@ declare const webhookDeliverySchema: z.ZodObject<{
161
162
  createdAt: z.ZodString;
162
163
  }, "strip", z.ZodTypeAny, {
163
164
  status: "pending" | "retrying" | "delivered" | "permanently_failed";
164
- id: string;
165
165
  merchantId: string;
166
+ id: string;
166
167
  createdAt: string;
167
168
  endpointId: string;
168
169
  eventId: string;
@@ -175,8 +176,8 @@ declare const webhookDeliverySchema: z.ZodObject<{
175
176
  deliveredAt: string | null;
176
177
  }, {
177
178
  status: "pending" | "retrying" | "delivered" | "permanently_failed";
178
- id: string;
179
179
  merchantId: string;
180
+ id: string;
180
181
  createdAt: string;
181
182
  endpointId: string;
182
183
  eventId: string;
@@ -214,8 +215,8 @@ declare const webhookDeliveryDetailSchema: z.ZodObject<{
214
215
  requestPayload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
215
216
  }, "strip", z.ZodTypeAny, {
216
217
  status: "pending" | "retrying" | "delivered" | "permanently_failed";
217
- id: string;
218
218
  merchantId: string;
219
+ id: string;
219
220
  createdAt: string;
220
221
  endpointId: string;
221
222
  eventId: string;
@@ -231,8 +232,8 @@ declare const webhookDeliveryDetailSchema: z.ZodObject<{
231
232
  requestPayload: Record<string, unknown>;
232
233
  }, {
233
234
  status: "pending" | "retrying" | "delivered" | "permanently_failed";
234
- id: string;
235
235
  merchantId: string;
236
+ id: string;
236
237
  createdAt: string;
237
238
  endpointId: string;
238
239
  eventId: string;
@@ -255,6 +256,7 @@ declare const replayDeliveryInputSchema: z.ZodObject<{
255
256
  }, {
256
257
  id: string;
257
258
  }>;
258
- type ReplayDeliveryInput = z.infer<typeof replayDeliveryInputSchema>;
259
+ type ReplayDeliveryInput = z.input<typeof replayDeliveryInputSchema>;
260
+ type ReplayDeliveryParsed = z.output<typeof replayDeliveryInputSchema>;
259
261
 
260
- export { type CreateWebhookEndpointInput, type CreateWebhookEndpointOutput, type ReplayDeliveryInput, type WebhookDelivery, type WebhookDeliveryDetail, type WebhookDeliveryStatus, type WebhookEndpoint, type WebhookEndpointStatus, type WebhookEventName, createWebhookEndpointInputSchema, createWebhookEndpointOutputSchema, replayDeliveryInputSchema, webhookDeliveryDetailSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEndpointSchema, webhookEndpointStatusSchema, webhookEventNameSchema };
262
+ export { type CreateWebhookEndpointInput, type CreateWebhookEndpointOutput, type CreateWebhookEndpointParsed, type ReplayDeliveryInput, type ReplayDeliveryParsed, type WebhookDelivery, type WebhookDeliveryDetail, type WebhookDeliveryStatus, type WebhookEndpoint, type WebhookEndpointStatus, type WebhookEventName, createWebhookEndpointInputSchema, createWebhookEndpointOutputSchema, replayDeliveryInputSchema, webhookDeliveryDetailSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEndpointSchema, webhookEndpointStatusSchema, webhookEventNameSchema };