@strimz/shared-types 0.11.2 → 0.12.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 (96) hide show
  1. package/dist/agents.cjs +1 -1
  2. package/dist/agents.cjs.map +1 -1
  3. package/dist/agents.js +1 -1
  4. package/dist/agents.js.map +1 -1
  5. package/dist/analytics.cjs +1 -1
  6. package/dist/analytics.cjs.map +1 -1
  7. package/dist/analytics.d.cts +136 -136
  8. package/dist/analytics.d.ts +136 -136
  9. package/dist/analytics.js +1 -1
  10. package/dist/analytics.js.map +1 -1
  11. package/dist/api-keys.cjs +1 -1
  12. package/dist/api-keys.cjs.map +1 -1
  13. package/dist/api-keys.d.cts +20 -20
  14. package/dist/api-keys.d.ts +20 -20
  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.d.cts +4 -4
  26. package/dist/compliance.d.ts +4 -4
  27. package/dist/compliance.js +1 -1
  28. package/dist/compliance.js.map +1 -1
  29. package/dist/customers.cjs +1 -1
  30. package/dist/customers.cjs.map +1 -1
  31. package/dist/customers.d.cts +6 -6
  32. package/dist/customers.d.ts +6 -6
  33. package/dist/customers.js +1 -1
  34. package/dist/customers.js.map +1 -1
  35. package/dist/events.cjs +1 -1
  36. package/dist/events.cjs.map +1 -1
  37. package/dist/events.d.cts +1433 -1433
  38. package/dist/events.d.ts +1433 -1433
  39. package/dist/events.js +1 -1
  40. package/dist/events.js.map +1 -1
  41. package/dist/index.cjs +1 -1
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/index.d.cts +14 -14
  44. package/dist/index.d.ts +14 -14
  45. package/dist/index.js +1 -1
  46. package/dist/index.js.map +1 -1
  47. package/dist/invoices.cjs +1 -1
  48. package/dist/invoices.cjs.map +1 -1
  49. package/dist/invoices.d.cts +10 -10
  50. package/dist/invoices.d.ts +10 -10
  51. package/dist/invoices.js +1 -1
  52. package/dist/invoices.js.map +1 -1
  53. package/dist/merchants.cjs +1 -1
  54. package/dist/merchants.cjs.map +1 -1
  55. package/dist/merchants.d.cts +31 -31
  56. package/dist/merchants.d.ts +31 -31
  57. package/dist/merchants.js +1 -1
  58. package/dist/merchants.js.map +1 -1
  59. package/dist/payment-sessions.cjs +1 -1
  60. package/dist/payment-sessions.cjs.map +1 -1
  61. package/dist/payment-sessions.d.cts +16 -16
  62. package/dist/payment-sessions.d.ts +16 -16
  63. package/dist/payment-sessions.js +1 -1
  64. package/dist/payment-sessions.js.map +1 -1
  65. package/dist/refunds.cjs +1 -1
  66. package/dist/refunds.cjs.map +1 -1
  67. package/dist/refunds.d.cts +36 -36
  68. package/dist/refunds.d.ts +36 -36
  69. package/dist/refunds.js +1 -1
  70. package/dist/refunds.js.map +1 -1
  71. package/dist/storefronts.cjs +1 -1
  72. package/dist/storefronts.cjs.map +1 -1
  73. package/dist/storefronts.d.cts +27 -27
  74. package/dist/storefronts.d.ts +27 -27
  75. package/dist/storefronts.js +1 -1
  76. package/dist/storefronts.js.map +1 -1
  77. package/dist/subscriptions.cjs +1 -1
  78. package/dist/subscriptions.cjs.map +1 -1
  79. package/dist/subscriptions.d.cts +30 -30
  80. package/dist/subscriptions.d.ts +30 -30
  81. package/dist/subscriptions.js +1 -1
  82. package/dist/subscriptions.js.map +1 -1
  83. package/dist/transactions.cjs +1 -1
  84. package/dist/transactions.cjs.map +1 -1
  85. package/dist/transactions.d.cts +12 -12
  86. package/dist/transactions.d.ts +12 -12
  87. package/dist/transactions.js +1 -1
  88. package/dist/transactions.js.map +1 -1
  89. package/dist/webhooks.cjs +1 -1
  90. package/dist/webhooks.cjs.map +1 -1
  91. package/dist/webhooks.d.cts +22 -22
  92. package/dist/webhooks.d.ts +22 -22
  93. package/dist/webhooks.js +1 -1
  94. package/dist/webhooks.js.map +1 -1
  95. package/package.json +4 -4
  96. package/src/common.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.ts","../src/invoices.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;AAGtF,IAAM,WAAA,GAAcA,KAAA,CAAE,MAAA,EAAO,CAAE,KAAA,EAAM,CAAE,IAAA,EAAK,CAAE,WAAA,EAAY,CAAE,GAAA,CAAI,GAAG,CAAA;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,oBAAoBA,KAAA,CAC9B,MAAA,EAAO,CACP,KAAA,CAAM,YAAY,iDAAiD,CAAA;AAG5CA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,MAAA,CAAO,gBAAgB;AAGtE,IAAM,kBAAA,GAAqBA,KAAA,CAC/B,MAAA,EAAO,CACP,QAAA,CAAS,EAAE,MAAA,EAAQ,IAAA,EAAM,OAAA,EAAS,+BAAA,EAAiC,CAAA;AAGrC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,CAAC;AAGM,IAAM,wBAAA,GAA2BA,MAAE,MAAA,CAAO;AAAA,EAC/C,YAAA,EAAcA,KAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA,CAAE,QAAA,EAAS;AAAA,EAClD,aAAA,EAAe,YAAY,QAAA,EAAS;AAAA,EACpC,SAAA,EAAWA,KAAAA,CAAE,KAAA,CAAM,qBAAqB,EAAE,QAAA,EAAS;AAAA,EACnD,QAAA,EAAU,qBAAA;AAAA,EACV,MAAMA,KAAAA,CAAE,MAAA,GAAS,GAAA,CAAI,GAAI,EAAE,QAAA,EAAS;AAAA,EACpC,SAAA,EAAWA,KAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,EAAE,CAAA,CAAE,QAAQ,CAAC;AACtD,CAAC","file":"invoices.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\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 * Invoices. Shareable, expirable payment requests with structured line items.\n */\n\nimport { z } from 'zod'\nimport {\n emailSchema,\n idSchema,\n isoTimestampSchema,\n paymentCurrencySchema,\n tokenAmountSchema,\n} from './common.js'\n\nexport const invoiceStatusSchema = z.enum(['draft', 'sent', 'paid', 'overdue', 'void'])\nexport type InvoiceStatus = z.infer<typeof invoiceStatusSchema>\n\nexport const invoiceLineItemSchema = z.object({\n description: z.string().min(1).max(500),\n quantity: z.number().int().min(1).max(10_000),\n unitAmount: tokenAmountSchema,\n})\nexport type InvoiceLineItem = z.infer<typeof invoiceLineItemSchema>\n\nexport const invoiceSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n number: z.string().min(1).max(40),\n customerName: z.string().min(1).max(200).nullable(),\n customerEmail: emailSchema.nullable(),\n lineItems: z.array(invoiceLineItemSchema).nonempty(),\n subtotal: tokenAmountSchema,\n total: tokenAmountSchema,\n currency: paymentCurrencySchema,\n status: invoiceStatusSchema,\n note: z.string().max(2000).nullable(),\n sessionId: idSchema.nullable(),\n dueAt: isoTimestampSchema,\n paidAt: isoTimestampSchema.nullable(),\n sentAt: isoTimestampSchema.nullable(),\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type Invoice = z.infer<typeof invoiceSchema>\n\nexport const createInvoiceInputSchema = z.object({\n customerName: z.string().min(1).max(200).optional(),\n customerEmail: emailSchema.optional(),\n lineItems: z.array(invoiceLineItemSchema).nonempty(),\n currency: paymentCurrencySchema,\n note: z.string().max(2000).optional(),\n dueInDays: z.number().int().min(1).max(90).default(7),\n})\nexport type CreateInvoiceInput = z.input<typeof createInvoiceInputSchema>\nexport type CreateInvoiceParsed = z.output<typeof createInvoiceInputSchema>\n"]}
1
+ {"version":3,"sources":["../src/common.ts","../src/invoices.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;AAGtF,IAAM,WAAA,GAAcA,KAAA,CAAE,MAAA,EAAO,CAAE,KAAA,EAAM,CAAE,IAAA,EAAK,CAAE,WAAA,EAAY,CAAE,GAAA,CAAI,GAAG,CAAA;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,oBAAoBA,KAAA,CAC9B,MAAA,EAAO,CACP,KAAA,CAAM,YAAY,iDAAiD,CAAA;AAG5CA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CAAE,GAAA,CAAI,C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AA,EAAS;AAAA,EAC7B,KAAA,EAAO,kBAAA;AAAA,EACP,MAAA,EAAQ,mBAAmB,QAAA,EAAS;AAAA,EACpC,MAAA,EAAQ,mBAAmB,QAAA,EAAS;AAAA,EACpC,SAAA,EAAW,kBAAA;AAAA,EACX,SAAA,EAAW;AACb,CAAC;AAGM,IAAM,wBAAA,GAA2BA,MAAE,MAAA,CAAO;AAAA,EAC/C,YAAA,EAAcA,KAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA,CAAE,QAAA,EAAS;AAAA,EAClD,aAAA,EAAe,YAAY,QAAA,EAAS;AAAA,EACpC,SAAA,EAAWA,KAAAA,CAAE,KAAA,CAAM,qBAAqB,EAAE,QAAA,EAAS;AAAA,EACnD,QAAA,EAAU,qBAAA;AAAA,EACV,MAAMA,KAAAA,CAAE,MAAA,GAAS,GAAA,CAAI,GAAI,EAAE,QAAA,EAAS;AAAA,EACpC,SAAA,EAAWA,KAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,EAAE,CAAA,CAAE,QAAQ,CAAC;AACtD,CAAC","file":"invoices.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\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', 'starter', 'growth', '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 * Invoices. Shareable, expirable payment requests with structured line items.\n */\n\nimport { z } from 'zod'\nimport {\n emailSchema,\n idSchema,\n isoTimestampSchema,\n paymentCurrencySchema,\n tokenAmountSchema,\n} from './common.js'\n\nexport const invoiceStatusSchema = z.enum(['draft', 'sent', 'paid', 'overdue', 'void'])\nexport type InvoiceStatus = z.infer<typeof invoiceStatusSchema>\n\nexport const invoiceLineItemSchema = z.object({\n description: z.string().min(1).max(500),\n quantity: z.number().int().min(1).max(10_000),\n unitAmount: tokenAmountSchema,\n})\nexport type InvoiceLineItem = z.infer<typeof invoiceLineItemSchema>\n\nexport const invoiceSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n number: z.string().min(1).max(40),\n customerName: z.string().min(1).max(200).nullable(),\n customerEmail: emailSchema.nullable(),\n lineItems: z.array(invoiceLineItemSchema).nonempty(),\n subtotal: tokenAmountSchema,\n total: tokenAmountSchema,\n currency: paymentCurrencySchema,\n status: invoiceStatusSchema,\n note: z.string().max(2000).nullable(),\n sessionId: idSchema.nullable(),\n dueAt: isoTimestampSchema,\n paidAt: isoTimestampSchema.nullable(),\n sentAt: isoTimestampSchema.nullable(),\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type Invoice = z.infer<typeof invoiceSchema>\n\nexport const createInvoiceInputSchema = z.object({\n customerName: z.string().min(1).max(200).optional(),\n customerEmail: emailSchema.optional(),\n lineItems: z.array(invoiceLineItemSchema).nonempty(),\n currency: paymentCurrencySchema,\n note: z.string().max(2000).optional(),\n dueInDays: z.number().int().min(1).max(90).default(7),\n})\nexport type CreateInvoiceInput = z.input<typeof createInvoiceInputSchema>\nexport type CreateInvoiceParsed = z.output<typeof createInvoiceInputSchema>\n"]}
@@ -53,9 +53,10 @@ declare const invoiceSchema: z.ZodObject<{
53
53
  }, "strip", z.ZodTypeAny, {
54
54
  number: string;
55
55
  status: "void" | "draft" | "sent" | "paid" | "overdue";
56
- id: string;
56
+ total: string;
57
+ currency: "USDC" | "EURC";
57
58
  merchantId: string;
58
- createdAt: string;
59
+ id: string;
59
60
  customerName: string | null;
60
61
  customerEmail: string | null;
61
62
  lineItems: [{
@@ -68,20 +69,20 @@ declare const invoiceSchema: z.ZodObject<{
68
69
  unitAmount: string;
69
70
  }[]];
70
71
  subtotal: string;
71
- total: string;
72
- currency: "USDC" | "EURC";
73
72
  note: string | null;
74
73
  sessionId: string | null;
75
74
  dueAt: string;
76
75
  paidAt: string | null;
77
76
  sentAt: string | null;
77
+ createdAt: string;
78
78
  updatedAt: string;
79
79
  }, {
80
80
  number: string;
81
81
  status: "void" | "draft" | "sent" | "paid" | "overdue";
82
- id: string;
82
+ total: string;
83
+ currency: "USDC" | "EURC";
83
84
  merchantId: string;
84
- createdAt: string;
85
+ id: string;
85
86
  customerName: string | null;
86
87
  customerEmail: string | null;
87
88
  lineItems: [{
@@ -94,13 +95,12 @@ declare const invoiceSchema: z.ZodObject<{
94
95
  unitAmount: string;
95
96
  }[]];
96
97
  subtotal: string;
97
- total: string;
98
- currency: "USDC" | "EURC";
99
98
  note: string | null;
100
99
  sessionId: string | null;
101
100
  dueAt: string;
102
101
  paidAt: string | null;
103
102
  sentAt: string | null;
103
+ createdAt: string;
104
104
  updatedAt: string;
105
105
  }>;
106
106
  type Invoice = z.infer<typeof invoiceSchema>;
@@ -124,6 +124,7 @@ declare const createInvoiceInputSchema: z.ZodObject<{
124
124
  note: z.ZodOptional<z.ZodString>;
125
125
  dueInDays: z.ZodDefault<z.ZodNumber>;
126
126
  }, "strip", z.ZodTypeAny, {
127
+ currency: "USDC" | "EURC";
127
128
  lineItems: [{
128
129
  description: string;
129
130
  quantity: number;
@@ -133,12 +134,12 @@ declare const createInvoiceInputSchema: z.ZodObject<{
133
134
  quantity: number;
134
135
  unitAmount: string;
135
136
  }[]];
136
- currency: "USDC" | "EURC";
137
137
  dueInDays: number;
138
138
  customerName?: string | undefined;
139
139
  customerEmail?: string | undefined;
140
140
  note?: string | undefined;
141
141
  }, {
142
+ currency: "USDC" | "EURC";
142
143
  lineItems: [{
143
144
  description: string;
144
145
  quantity: number;
@@ -148,7 +149,6 @@ declare const createInvoiceInputSchema: z.ZodObject<{
148
149
  quantity: number;
149
150
  unitAmount: string;
150
151
  }[]];
151
- currency: "USDC" | "EURC";
152
152
  customerName?: string | undefined;
153
153
  customerEmail?: string | undefined;
154
154
  note?: string | undefined;
@@ -53,9 +53,10 @@ declare const invoiceSchema: z.ZodObject<{
53
53
  }, "strip", z.ZodTypeAny, {
54
54
  number: string;
55
55
  status: "void" | "draft" | "sent" | "paid" | "overdue";
56
- id: string;
56
+ total: string;
57
+ currency: "USDC" | "EURC";
57
58
  merchantId: string;
58
- createdAt: string;
59
+ id: string;
59
60
  customerName: string | null;
60
61
  customerEmail: string | null;
61
62
  lineItems: [{
@@ -68,20 +69,20 @@ declare const invoiceSchema: z.ZodObject<{
68
69
  unitAmount: string;
69
70
  }[]];
70
71
  subtotal: string;
71
- total: string;
72
- currency: "USDC" | "EURC";
73
72
  note: string | null;
74
73
  sessionId: string | null;
75
74
  dueAt: string;
76
75
  paidAt: string | null;
77
76
  sentAt: string | null;
77
+ createdAt: string;
78
78
  updatedAt: string;
79
79
  }, {
80
80
  number: string;
81
81
  status: "void" | "draft" | "sent" | "paid" | "overdue";
82
- id: string;
82
+ total: string;
83
+ currency: "USDC" | "EURC";
83
84
  merchantId: string;
84
- createdAt: string;
85
+ id: string;
85
86
  customerName: string | null;
86
87
  customerEmail: string | null;
87
88
  lineItems: [{
@@ -94,13 +95,12 @@ declare const invoiceSchema: z.ZodObject<{
94
95
  unitAmount: string;
95
96
  }[]];
96
97
  subtotal: string;
97
- total: string;
98
- currency: "USDC" | "EURC";
99
98
  note: string | null;
100
99
  sessionId: string | null;
101
100
  dueAt: string;
102
101
  paidAt: string | null;
103
102
  sentAt: string | null;
103
+ createdAt: string;
104
104
  updatedAt: string;
105
105
  }>;
106
106
  type Invoice = z.infer<typeof invoiceSchema>;
@@ -124,6 +124,7 @@ declare const createInvoiceInputSchema: z.ZodObject<{
124
124
  note: z.ZodOptional<z.ZodString>;
125
125
  dueInDays: z.ZodDefault<z.ZodNumber>;
126
126
  }, "strip", z.ZodTypeAny, {
127
+ currency: "USDC" | "EURC";
127
128
  lineItems: [{
128
129
  description: string;
129
130
  quantity: number;
@@ -133,12 +134,12 @@ declare const createInvoiceInputSchema: z.ZodObject<{
133
134
  quantity: number;
134
135
  unitAmount: string;
135
136
  }[]];
136
- currency: "USDC" | "EURC";
137
137
  dueInDays: number;
138
138
  customerName?: string | undefined;
139
139
  customerEmail?: string | undefined;
140
140
  note?: string | undefined;
141
141
  }, {
142
+ currency: "USDC" | "EURC";
142
143
  lineItems: [{
143
144
  description: string;
144
145
  quantity: number;
@@ -148,7 +149,6 @@ declare const createInvoiceInputSchema: z.ZodObject<{
148
149
  quantity: number;
149
150
  unitAmount: string;
150
151
  }[]];
151
- currency: "USDC" | "EURC";
152
152
  customerName?: string | undefined;
153
153
  customerEmail?: string | undefined;
154
154
  note?: string | undefined;
package/dist/invoices.js CHANGED
@@ -24,7 +24,7 @@ z.record(
24
24
  z.enum(["test", "live"]);
25
25
  var paymentCurrencySchema = z.enum(["USDC", "EURC"]);
26
26
  z.enum(["USDC", "EURC", "USYC"]);
27
- z.enum(["free", "growth", "business", "enterprise"]);
27
+ z.enum(["free", "starter", "growth", "enterprise"]);
28
28
  z.enum(["testnet", "mainnet"]);
29
29
 
30
30
  // src/invoices.ts
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.ts","../src/invoices.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;AAGlB,CAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa;AAGJ,CAAA,CAC5B,MAAA,EAAO,CACP,KAAA,CAAM,uBAAuB,6DAA6D;AAGtF,IAAM,WAAA,GAAc,CAAA,CAAE,MAAA,EAAO,CAAE,KAAA,EAAM,CAAE,IAAA,EAAK,CAAE,WAAA,EAAY,CAAE,GAAA,CAAI,GAAG,CAAA;AAG5C,CAAA,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;AAG0B,CAAA,CAAE,MAAA,EAAO,CAAE,GAAA;AAOjC,IAAM,oBAAoB,CAAA,CAC9B,MAAA,EAAO,CACP,KAAA,CAAM,YAAY,iDAAiD,CAAA;AAG5C,CAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CAA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,EAAS;AAAA,EAC7B,KAAA,EAAO,kBAAA;AAAA,EACP,MAAA,EAAQ,mBAAmB,QAAA,EAAS;AAAA,EACpC,MAAA,EAAQ,mBAAmB,QAAA,EAAS;AAAA,EACpC,SAAA,EAAW,kBAAA;AAAA,EACX,SAAA,EAAW;AACb,CAAC;AAGM,IAAM,wBAAA,GAA2BA,EAAE,MAAA,CAAO;AAAA,EAC/C,YAAA,EAAcA,CAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA,CAAE,QAAA,EAAS;AAAA,EAClD,aAAA,EAAe,YAAY,QAAA,EAAS;AAAA,EACpC,SAAA,EAAWA,CAAAA,CAAE,KAAA,CAAM,qBAAqB,EAAE,QAAA,EAAS;AAAA,EACnD,QAAA,EAAU,qBAAA;AAAA,EACV,MAAMA,CAAAA,CAAE,MAAA,GAAS,GAAA,CAAI,GAAI,EAAE,QAAA,EAAS;AAAA,EACpC,SAAA,EAAWA,CAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,EAAE,CAAA,CAAE,QAAQ,CAAC;AACtD,CAAC","file":"invoices.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\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 * Invoices. Shareable, expirable payment requests with structured line items.\n */\n\nimport { z } from 'zod'\nimport {\n emailSchema,\n idSchema,\n isoTimestampSchema,\n paymentCurrencySchema,\n tokenAmountSchema,\n} from './common.js'\n\nexport const invoiceStatusSchema = z.enum(['draft', 'sent', 'paid', 'overdue', 'void'])\nexport type InvoiceStatus = z.infer<typeof invoiceStatusSchema>\n\nexport const invoiceLineItemSchema = z.object({\n description: z.string().min(1).max(500),\n quantity: z.number().int().min(1).max(10_000),\n unitAmount: tokenAmountSchema,\n})\nexport type InvoiceLineItem = z.infer<typeof invoiceLineItemSchema>\n\nexport const invoiceSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n number: z.string().min(1).max(40),\n customerName: z.string().min(1).max(200).nullable(),\n customerEmail: emailSchema.nullable(),\n lineItems: z.array(invoiceLineItemSchema).nonempty(),\n subtotal: tokenAmountSchema,\n total: tokenAmountSchema,\n currency: paymentCurrencySchema,\n status: invoiceStatusSchema,\n note: z.string().max(2000).nullable(),\n sessionId: idSchema.nullable(),\n dueAt: isoTimestampSchema,\n paidAt: isoTimestampSchema.nullable(),\n sentAt: isoTimestampSchema.nullable(),\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type Invoice = z.infer<typeof invoiceSchema>\n\nexport const createInvoiceInputSchema = z.object({\n customerName: z.string().min(1).max(200).optional(),\n customerEmail: emailSchema.optional(),\n lineItems: z.array(invoiceLineItemSchema).nonempty(),\n currency: paymentCurrencySchema,\n note: z.string().max(2000).optional(),\n dueInDays: z.number().int().min(1).max(90).default(7),\n})\nexport type CreateInvoiceInput = z.input<typeof createInvoiceInputSchema>\nexport type CreateInvoiceParsed = z.output<typeof createInvoiceInputSchema>\n"]}
1
+ {"version":3,"sources":["../src/common.ts","../src/invoices.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;AAGlB,CAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa;AAGJ,CAAA,CAC5B,MAAA,EAAO,CACP,KAAA,CAAM,uBAAuB,6DAA6D;AAGtF,IAAM,WAAA,GAAc,CAAA,CAAE,MAAA,EAAO,CAAE,KAAA,EAAM,CAAE,IAAA,EAAK,CAAE,WAAA,EAAY,CAAE,GAAA,CAAI,GAAG,CAAA;AAG5C,CAAA,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;AAG0B,CAAA,CAAE,MA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EAAU,qBAAA;AAAA,EACV,MAAA,EAAQ,mBAAA;AAAA,EACR,MAAMA,CAAAA,CAAE,MAAA,GAAS,GAAA,CAAI,GAAI,EAAE,QAAA,EAAS;AAAA,EACpC,SAAA,EAAW,SAAS,QAAA,EAAS;AAAA,EAC7B,KAAA,EAAO,kBAAA;AAAA,EACP,MAAA,EAAQ,mBAAmB,QAAA,EAAS;AAAA,EACpC,MAAA,EAAQ,mBAAmB,QAAA,EAAS;AAAA,EACpC,SAAA,EAAW,kBAAA;AAAA,EACX,SAAA,EAAW;AACb,CAAC;AAGM,IAAM,wBAAA,GAA2BA,EAAE,MAAA,CAAO;AAAA,EAC/C,YAAA,EAAcA,CAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA,CAAE,QAAA,EAAS;AAAA,EAClD,aAAA,EAAe,YAAY,QAAA,EAAS;AAAA,EACpC,SAAA,EAAWA,CAAAA,CAAE,KAAA,CAAM,qBAAqB,EAAE,QAAA,EAAS;AAAA,EACnD,QAAA,EAAU,qBAAA;AAAA,EACV,MAAMA,CAAAA,CAAE,MAAA,GAAS,GAAA,CAAI,GAAI,EAAE,QAAA,EAAS;AAAA,EACpC,SAAA,EAAWA,CAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,EAAE,CAAA,CAAE,QAAQ,CAAC;AACtD,CAAC","file":"invoices.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\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', 'starter', 'growth', '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 * Invoices. Shareable, expirable payment requests with structured line items.\n */\n\nimport { z } from 'zod'\nimport {\n emailSchema,\n idSchema,\n isoTimestampSchema,\n paymentCurrencySchema,\n tokenAmountSchema,\n} from './common.js'\n\nexport const invoiceStatusSchema = z.enum(['draft', 'sent', 'paid', 'overdue', 'void'])\nexport type InvoiceStatus = z.infer<typeof invoiceStatusSchema>\n\nexport const invoiceLineItemSchema = z.object({\n description: z.string().min(1).max(500),\n quantity: z.number().int().min(1).max(10_000),\n unitAmount: tokenAmountSchema,\n})\nexport type InvoiceLineItem = z.infer<typeof invoiceLineItemSchema>\n\nexport const invoiceSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n number: z.string().min(1).max(40),\n customerName: z.string().min(1).max(200).nullable(),\n customerEmail: emailSchema.nullable(),\n lineItems: z.array(invoiceLineItemSchema).nonempty(),\n subtotal: tokenAmountSchema,\n total: tokenAmountSchema,\n currency: paymentCurrencySchema,\n status: invoiceStatusSchema,\n note: z.string().max(2000).nullable(),\n sessionId: idSchema.nullable(),\n dueAt: isoTimestampSchema,\n paidAt: isoTimestampSchema.nullable(),\n sentAt: isoTimestampSchema.nullable(),\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type Invoice = z.infer<typeof invoiceSchema>\n\nexport const createInvoiceInputSchema = z.object({\n customerName: z.string().min(1).max(200).optional(),\n customerEmail: emailSchema.optional(),\n lineItems: z.array(invoiceLineItemSchema).nonempty(),\n currency: paymentCurrencySchema,\n note: z.string().max(2000).optional(),\n dueInDays: z.number().int().min(1).max(90).default(7),\n})\nexport type CreateInvoiceInput = z.input<typeof createInvoiceInputSchema>\nexport type CreateInvoiceParsed = z.output<typeof createInvoiceInputSchema>\n"]}
@@ -26,7 +26,7 @@ var metadataSchema = zod.z.record(
26
26
  zod.z.enum(["test", "live"]);
27
27
  zod.z.enum(["USDC", "EURC"]);
28
28
  zod.z.enum(["USDC", "EURC", "USYC"]);
29
- var merchantTierSchema = zod.z.enum(["free", "growth", "business", "enterprise"]);
29
+ var merchantTierSchema = zod.z.enum(["free", "starter", "growth", "enterprise"]);
30
30
  zod.z.enum(["testnet", "mainnet"]);
31
31
 
32
32
  // src/merchants.ts
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.ts","../src/merchants.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,E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,EAAE;AAAA,KACzC;AAAA;AAEL,CAAC;AAKM,IAAM,oBAAA,GAAuBA,MAAE,MAAA,CAAO;AAAA,EAC3C,EAAA,EAAI,QAAA;AAAA,EACJ,UAAA,EAAY,QAAA;AAAA,EACZ,KAAA,EAAO,WAAA;AAAA,EACP,IAAA,EAAM,kBAAA;AAAA,EACN,SAAA,EAAW,kBAAA;AAAA,EACX,UAAA,EAAY,mBAAmB,QAAA;AACjC,CAAC;AAGM,IAAM,uBAAA,GAA0BA,MAAE,MAAA,CAAO;AAAA,EAC9C,KAAA,EAAO,WAAA;AAAA,EACP,IAAA,EAAM;AACR,CAAC;AAMM,IAAM,gBAAA,GAAmBA,MAAE,MAAA,CAAO;AAAA,EACvC,KAAA,EAAO,WAAA;AAAA,EACP,QAAA,EAAUA,MAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA,CAAE,IAAI,GAAG;AACrC,CAAC;AAIM,IAAM,iBAAA,GAAoBA,MAAE,MAAA,CAAO;AAAA,EACxC,WAAA,EAAaA,MAAE,MAAA,EAAO;AAAA,EACtB,YAAA,EAAcA,MAAE,MAAA,EAAO;AAAA,EACvB,QAAA,EAAU;AACZ,CAAC","file":"merchants.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\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 * Merchant entity and lifecycle DTOs.\n *\n * A merchant is the platform's first-class tenant. Merchants have a tier,\n * a payout wallet address, and an on-chain merchantId registered in the\n * StrimzRegistry contract.\n */\n\nimport { z } from 'zod'\nimport {\n emailSchema,\n evmAddressSchema,\n idSchema,\n isoTimestampSchema,\n merchantTierSchema,\n metadataSchema,\n} from './common.js'\n\nexport const merchantStatusSchema = z.enum(['active', 'suspended', 'closed'])\nexport type MerchantStatus = z.infer<typeof merchantStatusSchema>\n\nexport const merchantRoleSchema = z.enum(['owner', 'admin', 'developer', 'read_only'])\nexport type MerchantRole = z.infer<typeof merchantRoleSchema>\n\nexport const merchantSchema = z.object({\n id: idSchema,\n onchainMerchantId: z.number().int().nonnegative().nullable(),\n businessName: z.string().min(2).max(120),\n email: emailSchema,\n tier: merchantTierSchema,\n status: merchantStatusSchema,\n payoutAddress: evmAddressSchema.nullable(),\n walletAddress: evmAddressSchema.nullable(),\n onboardingCompleted: z.boolean(),\n defaultCurrency: z.enum(['USDC', 'EURC']),\n countryCode: z.string().length(2).nullable(),\n websiteUrl: z.string().url().nullable(),\n logoUrl: z.string().url().nullable(),\n whitelabelEnabled: z.boolean(),\n metadata: metadataSchema,\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type Merchant = z.infer<typeof merchantSchema>\n\n// ---------- DTOs ----------\n\nexport const createMerchantInputSchema = z.object({\n businessName: z.string().min(2).max(120),\n email: emailSchema,\n password: z.string().min(12).max(128),\n countryCode: z.string().length(2).optional(),\n websiteUrl: z.string().url().optional(),\n})\nexport type CreateMerchantInput = z.input<typeof createMerchantInputSchema>\nexport type CreateMerchantParsed = z.output<typeof createMerchantInputSchema>\n\n/**\n * Merchant email opt-outs, persisted at `Merchant.metadata.emailPrefs`.\n * Both default to true. Welcome, refunds, and admin broadcasts always send.\n */\nexport const merchantEmailPrefsSchema = z.object({\n /** \"You received X USDC\" one-off payment notifications. */\n paymentReceived: z.boolean(),\n /** \"You were paid X for subscription Y\" per-charge notifications. */\n subscriptionCharged: z.boolean(),\n})\nexport type MerchantEmailPrefs = z.infer<typeof merchantEmailPrefsSchema>\n\nexport const DEFAULT_MERCHANT_EMAIL_PREFS: MerchantEmailPrefs = {\n paymentReceived: true,\n subscriptionCharged: true,\n}\n\nexport const updateMerchantInputSchema = z\n .object({\n businessName: z.string().min(2).max(120),\n payoutAddress: evmAddressSchema,\n defaultCurrency: z.enum(['USDC', 'EURC']),\n websiteUrl: z.string().url().nullable(),\n logoUrl: z.string().url().nullable(),\n countryCode: z.string().length(2).nullable(),\n metadata: metadataSchema,\n emailPrefs: merchantEmailPrefsSchema.partial(),\n })\n .partial()\nexport type UpdateMerchantInput = z.input<typeof updateMerchantInputSchema>\nexport type UpdateMerchantParsed = z.output<typeof updateMerchantInputSchema>\n\nexport const changeTierInputSchema = z.object({\n tier: merchantTierSchema,\n})\nexport type ChangeTierInput = z.input<typeof changeTierInputSchema>\nexport type ChangeTierParsed = z.output<typeof changeTierInputSchema>\n\n/**\n * Self-attested onboarding form the dashboard collects after a\n * merchant first logs in via Privy. On success the API stamps\n * `onboardingCompleted: true` on the row, and the dashboard exits\n * the wizard. Shared here so the API's DTO and the web client's\n * hook can enforce the same shape.\n */\nexport const onboardMerchantInputSchema = z.object({\n businessName: z.string().min(2).max(120),\n businessSector: z.string().min(2).max(80),\n countryCode: z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be a 2-letter ISO country code'),\n websiteUrl: z.string().url().optional(),\n logoUrl: z.string().url().optional(),\n phone: z.string().min(6).max(20).optional(),\n payoutAddress: evmAddressSchema,\n defaultCurrency: z.enum(['USDC', 'EURC']).optional(),\n})\nexport type OnboardMerchantInput = z.input<typeof onboardMerchantInputSchema>\nexport type OnboardMerchantParsed = z.output<typeof onboardMerchantInputSchema>\n\nexport const merchantPublicBrandSchema = z.object({\n id: idSchema,\n businessName: z.string().min(2).max(120),\n logoUrl: z.string().url().nullable(),\n walletAddress: evmAddressSchema.nullable(),\n})\nexport type MerchantPublicBrand = z.infer<typeof merchantPublicBrandSchema>\n\n/**\n * On-chain balance view for the withdraw page. Strimz is\n * non-custodial: payments settle directly into the merchant's\n * `payoutAddress`, and \"withdrawal\" means the merchant transferring\n * out with their own wallet. This shape reports current on-chain\n * state so the dashboard renders live balances + decides whether to\n * offer the signing UI.\n */\nexport const merchantBalanceSchema = z.object({\n /** Payout wallet, checksummed; null when the merchant hasn't set one. */\n payoutAddress: evmAddressSchema.nullable(),\n /** Privy embedded wallet, checksummed if resolvable. */\n walletAddress: evmAddressSchema.nullable(),\n /**\n * True when `payoutAddress === walletAddress`, i.e. the merchant\n * can sign a transfer from the dashboard via Privy. False for\n * merchants using an external wallet as payout — the UI falls back\n * to \"copy the address, transfer with your wallet.\"\n */\n canSignFromDashboard: z.boolean(),\n balances: z.array(\n z.object({\n currency: z.enum(['USDC', 'EURC']),\n contractAddress: evmAddressSchema,\n /** Base-6 integer as string. */\n raw: z.string(),\n /** Human-formatted, e.g. `1234.56`. */\n formatted: z.string(),\n decimals: z.number().int().min(0).max(30),\n }),\n ),\n})\nexport type MerchantBalanceView = z.infer<typeof merchantBalanceSchema>\n\n// ---------- Team members ----------\n\nexport const merchantMemberSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n email: emailSchema,\n role: merchantRoleSchema,\n invitedAt: isoTimestampSchema,\n acceptedAt: isoTimestampSchema.nullable(),\n})\nexport type MerchantMember = z.infer<typeof merchantMemberSchema>\n\nexport const inviteMemberInputSchema = z.object({\n email: emailSchema,\n role: merchantRoleSchema,\n})\nexport type InviteMemberInput = z.input<typeof inviteMemberInputSchema>\nexport type InviteMemberParsed = z.output<typeof inviteMemberInputSchema>\n\n// ---------- Auth ----------\n\nexport const loginInputSchema = z.object({\n email: emailSchema,\n password: z.string().min(1).max(128),\n})\nexport type LoginInput = z.input<typeof loginInputSchema>\nexport type LoginParsed = z.output<typeof loginInputSchema>\n\nexport const loginOutputSchema = z.object({\n accessToken: z.string(),\n refreshToken: z.string(),\n merchant: merchantSchema,\n})\nexport type LoginOutput = z.infer<typeof loginOutputSchema>\n"]}
1
+ {"version":3,"sources":["../src/common.ts","../src/merchants.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;AAGJA,KAAA,CAC5B,MAAA,EAAO,CACP,KAAA,CAAM,uBAAuB,6DAA6D;AAGtF,IAAM,WAAA,GAAcA,KAAA,CAAE,MAAA,EAAO,CAAE,KAAA,EAAM,CAAE,IAAA,EAAK,C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,QAAA;AACjC,CAAC;AAGM,IAAM,uBAAA,GAA0BA,MAAE,MAAA,CAAO;AAAA,EAC9C,KAAA,EAAO,WAAA;AAAA,EACP,IAAA,EAAM;AACR,CAAC;AAMM,IAAM,gBAAA,GAAmBA,MAAE,MAAA,CAAO;AAAA,EACvC,KAAA,EAAO,WAAA;AAAA,EACP,QAAA,EAAUA,MAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA,CAAE,IAAI,GAAG;AACrC,CAAC;AAIM,IAAM,iBAAA,GAAoBA,MAAE,MAAA,CAAO;AAAA,EACxC,WAAA,EAAaA,MAAE,MAAA,EAAO;AAAA,EACtB,YAAA,EAAcA,MAAE,MAAA,EAAO;AAAA,EACvB,QAAA,EAAU;AACZ,CAAC","file":"merchants.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\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', 'starter', 'growth', '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 * Merchant entity and lifecycle DTOs.\n *\n * A merchant is the platform's first-class tenant. Merchants have a tier,\n * a payout wallet address, and an on-chain merchantId registered in the\n * StrimzRegistry contract.\n */\n\nimport { z } from 'zod'\nimport {\n emailSchema,\n evmAddressSchema,\n idSchema,\n isoTimestampSchema,\n merchantTierSchema,\n metadataSchema,\n} from './common.js'\n\nexport const merchantStatusSchema = z.enum(['active', 'suspended', 'closed'])\nexport type MerchantStatus = z.infer<typeof merchantStatusSchema>\n\nexport const merchantRoleSchema = z.enum(['owner', 'admin', 'developer', 'read_only'])\nexport type MerchantRole = z.infer<typeof merchantRoleSchema>\n\nexport const merchantSchema = z.object({\n id: idSchema,\n onchainMerchantId: z.number().int().nonnegative().nullable(),\n businessName: z.string().min(2).max(120),\n email: emailSchema,\n tier: merchantTierSchema,\n status: merchantStatusSchema,\n payoutAddress: evmAddressSchema.nullable(),\n walletAddress: evmAddressSchema.nullable(),\n onboardingCompleted: z.boolean(),\n defaultCurrency: z.enum(['USDC', 'EURC']),\n countryCode: z.string().length(2).nullable(),\n websiteUrl: z.string().url().nullable(),\n logoUrl: z.string().url().nullable(),\n whitelabelEnabled: z.boolean(),\n metadata: metadataSchema,\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type Merchant = z.infer<typeof merchantSchema>\n\n// ---------- DTOs ----------\n\nexport const createMerchantInputSchema = z.object({\n businessName: z.string().min(2).max(120),\n email: emailSchema,\n password: z.string().min(12).max(128),\n countryCode: z.string().length(2).optional(),\n websiteUrl: z.string().url().optional(),\n})\nexport type CreateMerchantInput = z.input<typeof createMerchantInputSchema>\nexport type CreateMerchantParsed = z.output<typeof createMerchantInputSchema>\n\n/**\n * Merchant email opt-outs, persisted at `Merchant.metadata.emailPrefs`.\n * Both default to true. Welcome, refunds, and admin broadcasts always send.\n */\nexport const merchantEmailPrefsSchema = z.object({\n /** \"You received X USDC\" one-off payment notifications. */\n paymentReceived: z.boolean(),\n /** \"You were paid X for subscription Y\" per-charge notifications. */\n subscriptionCharged: z.boolean(),\n})\nexport type MerchantEmailPrefs = z.infer<typeof merchantEmailPrefsSchema>\n\nexport const DEFAULT_MERCHANT_EMAIL_PREFS: MerchantEmailPrefs = {\n paymentReceived: true,\n subscriptionCharged: true,\n}\n\nexport const updateMerchantInputSchema = z\n .object({\n businessName: z.string().min(2).max(120),\n payoutAddress: evmAddressSchema,\n defaultCurrency: z.enum(['USDC', 'EURC']),\n websiteUrl: z.string().url().nullable(),\n logoUrl: z.string().url().nullable(),\n countryCode: z.string().length(2).nullable(),\n metadata: metadataSchema,\n emailPrefs: merchantEmailPrefsSchema.partial(),\n })\n .partial()\nexport type UpdateMerchantInput = z.input<typeof updateMerchantInputSchema>\nexport type UpdateMerchantParsed = z.output<typeof updateMerchantInputSchema>\n\nexport const changeTierInputSchema = z.object({\n tier: merchantTierSchema,\n})\nexport type ChangeTierInput = z.input<typeof changeTierInputSchema>\nexport type ChangeTierParsed = z.output<typeof changeTierInputSchema>\n\n/**\n * Self-attested onboarding form the dashboard collects after a\n * merchant first logs in via Privy. On success the API stamps\n * `onboardingCompleted: true` on the row, and the dashboard exits\n * the wizard. Shared here so the API's DTO and the web client's\n * hook can enforce the same shape.\n */\nexport const onboardMerchantInputSchema = z.object({\n businessName: z.string().min(2).max(120),\n businessSector: z.string().min(2).max(80),\n countryCode: z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be a 2-letter ISO country code'),\n websiteUrl: z.string().url().optional(),\n logoUrl: z.string().url().optional(),\n phone: z.string().min(6).max(20).optional(),\n payoutAddress: evmAddressSchema,\n defaultCurrency: z.enum(['USDC', 'EURC']).optional(),\n})\nexport type OnboardMerchantInput = z.input<typeof onboardMerchantInputSchema>\nexport type OnboardMerchantParsed = z.output<typeof onboardMerchantInputSchema>\n\nexport const merchantPublicBrandSchema = z.object({\n id: idSchema,\n businessName: z.string().min(2).max(120),\n logoUrl: z.string().url().nullable(),\n walletAddress: evmAddressSchema.nullable(),\n})\nexport type MerchantPublicBrand = z.infer<typeof merchantPublicBrandSchema>\n\n/**\n * On-chain balance view for the withdraw page. Strimz is\n * non-custodial: payments settle directly into the merchant's\n * `payoutAddress`, and \"withdrawal\" means the merchant transferring\n * out with their own wallet. This shape reports current on-chain\n * state so the dashboard renders live balances + decides whether to\n * offer the signing UI.\n */\nexport const merchantBalanceSchema = z.object({\n /** Payout wallet, checksummed; null when the merchant hasn't set one. */\n payoutAddress: evmAddressSchema.nullable(),\n /** Privy embedded wallet, checksummed if resolvable. */\n walletAddress: evmAddressSchema.nullable(),\n /**\n * True when `payoutAddress === walletAddress`, i.e. the merchant\n * can sign a transfer from the dashboard via Privy. False for\n * merchants using an external wallet as payout — the UI falls back\n * to \"copy the address, transfer with your wallet.\"\n */\n canSignFromDashboard: z.boolean(),\n balances: z.array(\n z.object({\n currency: z.enum(['USDC', 'EURC']),\n contractAddress: evmAddressSchema,\n /** Base-6 integer as string. */\n raw: z.string(),\n /** Human-formatted, e.g. `1234.56`. */\n formatted: z.string(),\n decimals: z.number().int().min(0).max(30),\n }),\n ),\n})\nexport type MerchantBalanceView = z.infer<typeof merchantBalanceSchema>\n\n// ---------- Team members ----------\n\nexport const merchantMemberSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n email: emailSchema,\n role: merchantRoleSchema,\n invitedAt: isoTimestampSchema,\n acceptedAt: isoTimestampSchema.nullable(),\n})\nexport type MerchantMember = z.infer<typeof merchantMemberSchema>\n\nexport const inviteMemberInputSchema = z.object({\n email: emailSchema,\n role: merchantRoleSchema,\n})\nexport type InviteMemberInput = z.input<typeof inviteMemberInputSchema>\nexport type InviteMemberParsed = z.output<typeof inviteMemberInputSchema>\n\n// ---------- Auth ----------\n\nexport const loginInputSchema = z.object({\n email: emailSchema,\n password: z.string().min(1).max(128),\n})\nexport type LoginInput = z.input<typeof loginInputSchema>\nexport type LoginParsed = z.output<typeof loginInputSchema>\n\nexport const loginOutputSchema = z.object({\n accessToken: z.string(),\n refreshToken: z.string(),\n merchant: merchantSchema,\n})\nexport type LoginOutput = z.infer<typeof loginOutputSchema>\n"]}
@@ -17,7 +17,7 @@ declare const merchantSchema: z.ZodObject<{
17
17
  onchainMerchantId: z.ZodNullable<z.ZodNumber>;
18
18
  businessName: z.ZodString;
19
19
  email: z.ZodString;
20
- tier: z.ZodEnum<["free", "growth", "business", "enterprise"]>;
20
+ tier: z.ZodEnum<["free", "starter", "growth", "enterprise"]>;
21
21
  status: z.ZodEnum<["active", "suspended", "closed"]>;
22
22
  payoutAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
23
23
  walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
@@ -32,15 +32,15 @@ declare const merchantSchema: z.ZodObject<{
32
32
  updatedAt: z.ZodString;
33
33
  }, "strip", z.ZodTypeAny, {
34
34
  status: "active" | "suspended" | "closed";
35
+ businessName: string;
36
+ email: string;
35
37
  id: string;
36
38
  createdAt: string;
37
39
  updatedAt: string;
38
40
  metadata: Record<string, string | number | boolean | null>;
39
41
  walletAddress: string | null;
40
- email: string;
41
- businessName: string;
42
42
  onchainMerchantId: number | null;
43
- tier: "free" | "growth" | "business" | "enterprise";
43
+ tier: "free" | "starter" | "growth" | "enterprise";
44
44
  payoutAddress: string | null;
45
45
  onboardingCompleted: boolean;
46
46
  defaultCurrency: "USDC" | "EURC";
@@ -50,14 +50,14 @@ declare const merchantSchema: z.ZodObject<{
50
50
  whitelabelEnabled: boolean;
51
51
  }, {
52
52
  status: "active" | "suspended" | "closed";
53
+ businessName: string;
54
+ email: string;
53
55
  id: string;
54
56
  createdAt: string;
55
57
  updatedAt: string;
56
58
  walletAddress: string | null;
57
- email: string;
58
- businessName: string;
59
59
  onchainMerchantId: number | null;
60
- tier: "free" | "growth" | "business" | "enterprise";
60
+ tier: "free" | "starter" | "growth" | "enterprise";
61
61
  payoutAddress: string | null;
62
62
  onboardingCompleted: boolean;
63
63
  defaultCurrency: "USDC" | "EURC";
@@ -75,14 +75,14 @@ declare const createMerchantInputSchema: z.ZodObject<{
75
75
  countryCode: z.ZodOptional<z.ZodString>;
76
76
  websiteUrl: z.ZodOptional<z.ZodString>;
77
77
  }, "strip", z.ZodTypeAny, {
78
- email: string;
79
78
  businessName: string;
79
+ email: string;
80
80
  password: string;
81
81
  countryCode?: string | undefined;
82
82
  websiteUrl?: string | undefined;
83
83
  }, {
84
- email: string;
85
84
  businessName: string;
85
+ email: string;
86
86
  password: string;
87
87
  countryCode?: string | undefined;
88
88
  websiteUrl?: string | undefined;
@@ -126,8 +126,8 @@ declare const updateMerchantInputSchema: z.ZodObject<{
126
126
  subscriptionCharged?: boolean | undefined;
127
127
  }>>;
128
128
  }, "strip", z.ZodTypeAny, {
129
- metadata?: Record<string, string | number | boolean | null> | undefined;
130
129
  businessName?: string | undefined;
130
+ metadata?: Record<string, string | number | boolean | null> | undefined;
131
131
  payoutAddress?: string | undefined;
132
132
  defaultCurrency?: "USDC" | "EURC" | undefined;
133
133
  countryCode?: string | null | undefined;
@@ -138,8 +138,8 @@ declare const updateMerchantInputSchema: z.ZodObject<{
138
138
  subscriptionCharged?: boolean | undefined;
139
139
  } | undefined;
140
140
  }, {
141
- metadata?: Record<string, string | number | boolean | null> | undefined;
142
141
  businessName?: string | undefined;
142
+ metadata?: Record<string, string | number | boolean | null> | undefined;
143
143
  payoutAddress?: string | undefined;
144
144
  defaultCurrency?: "USDC" | "EURC" | undefined;
145
145
  countryCode?: string | null | undefined;
@@ -153,11 +153,11 @@ declare const updateMerchantInputSchema: z.ZodObject<{
153
153
  type UpdateMerchantInput = z.input<typeof updateMerchantInputSchema>;
154
154
  type UpdateMerchantParsed = z.output<typeof updateMerchantInputSchema>;
155
155
  declare const changeTierInputSchema: z.ZodObject<{
156
- tier: z.ZodEnum<["free", "growth", "business", "enterprise"]>;
156
+ tier: z.ZodEnum<["free", "starter", "growth", "enterprise"]>;
157
157
  }, "strip", z.ZodTypeAny, {
158
- tier: "free" | "growth" | "business" | "enterprise";
158
+ tier: "free" | "starter" | "growth" | "enterprise";
159
159
  }, {
160
- tier: "free" | "growth" | "business" | "enterprise";
160
+ tier: "free" | "starter" | "growth" | "enterprise";
161
161
  }>;
162
162
  type ChangeTierInput = z.input<typeof changeTierInputSchema>;
163
163
  type ChangeTierParsed = z.output<typeof changeTierInputSchema>;
@@ -204,14 +204,14 @@ declare const merchantPublicBrandSchema: z.ZodObject<{
204
204
  logoUrl: z.ZodNullable<z.ZodString>;
205
205
  walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
206
206
  }, "strip", z.ZodTypeAny, {
207
+ businessName: string;
207
208
  id: string;
208
209
  walletAddress: string | null;
209
- businessName: string;
210
210
  logoUrl: string | null;
211
211
  }, {
212
+ businessName: string;
212
213
  id: string;
213
214
  walletAddress: string | null;
214
- businessName: string;
215
215
  logoUrl: string | null;
216
216
  }>;
217
217
  type MerchantPublicBrand = z.infer<typeof merchantPublicBrandSchema>;
@@ -288,16 +288,16 @@ declare const merchantMemberSchema: z.ZodObject<{
288
288
  invitedAt: z.ZodString;
289
289
  acceptedAt: z.ZodNullable<z.ZodString>;
290
290
  }, "strip", z.ZodTypeAny, {
291
- id: string;
292
291
  merchantId: string;
293
292
  email: string;
293
+ id: string;
294
294
  role: "owner" | "admin" | "developer" | "read_only";
295
295
  invitedAt: string;
296
296
  acceptedAt: string | null;
297
297
  }, {
298
- id: string;
299
298
  merchantId: string;
300
299
  email: string;
300
+ id: string;
301
301
  role: "owner" | "admin" | "developer" | "read_only";
302
302
  invitedAt: string;
303
303
  acceptedAt: string | null;
@@ -335,7 +335,7 @@ declare const loginOutputSchema: z.ZodObject<{
335
335
  onchainMerchantId: z.ZodNullable<z.ZodNumber>;
336
336
  businessName: z.ZodString;
337
337
  email: z.ZodString;
338
- tier: z.ZodEnum<["free", "growth", "business", "enterprise"]>;
338
+ tier: z.ZodEnum<["free", "starter", "growth", "enterprise"]>;
339
339
  status: z.ZodEnum<["active", "suspended", "closed"]>;
340
340
  payoutAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
341
341
  walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
@@ -350,15 +350,15 @@ declare const loginOutputSchema: z.ZodObject<{
350
350
  updatedAt: z.ZodString;
351
351
  }, "strip", z.ZodTypeAny, {
352
352
  status: "active" | "suspended" | "closed";
353
+ businessName: string;
354
+ email: string;
353
355
  id: string;
354
356
  createdAt: string;
355
357
  updatedAt: string;
356
358
  metadata: Record<string, string | number | boolean | null>;
357
359
  walletAddress: string | null;
358
- email: string;
359
- businessName: string;
360
360
  onchainMerchantId: number | null;
361
- tier: "free" | "growth" | "business" | "enterprise";
361
+ tier: "free" | "starter" | "growth" | "enterprise";
362
362
  payoutAddress: string | null;
363
363
  onboardingCompleted: boolean;
364
364
  defaultCurrency: "USDC" | "EURC";
@@ -368,14 +368,14 @@ declare const loginOutputSchema: z.ZodObject<{
368
368
  whitelabelEnabled: boolean;
369
369
  }, {
370
370
  status: "active" | "suspended" | "closed";
371
+ businessName: string;
372
+ email: string;
371
373
  id: string;
372
374
  createdAt: string;
373
375
  updatedAt: string;
374
376
  walletAddress: string | null;
375
- email: string;
376
- businessName: string;
377
377
  onchainMerchantId: number | null;
378
- tier: "free" | "growth" | "business" | "enterprise";
378
+ tier: "free" | "starter" | "growth" | "enterprise";
379
379
  payoutAddress: string | null;
380
380
  onboardingCompleted: boolean;
381
381
  defaultCurrency: "USDC" | "EURC";
@@ -390,15 +390,15 @@ declare const loginOutputSchema: z.ZodObject<{
390
390
  refreshToken: string;
391
391
  merchant: {
392
392
  status: "active" | "suspended" | "closed";
393
+ businessName: string;
394
+ email: string;
393
395
  id: string;
394
396
  createdAt: string;
395
397
  updatedAt: string;
396
398
  metadata: Record<string, string | number | boolean | null>;
397
399
  walletAddress: string | null;
398
- email: string;
399
- businessName: string;
400
400
  onchainMerchantId: number | null;
401
- tier: "free" | "growth" | "business" | "enterprise";
401
+ tier: "free" | "starter" | "growth" | "enterprise";
402
402
  payoutAddress: string | null;
403
403
  onboardingCompleted: boolean;
404
404
  defaultCurrency: "USDC" | "EURC";
@@ -412,14 +412,14 @@ declare const loginOutputSchema: z.ZodObject<{
412
412
  refreshToken: string;
413
413
  merchant: {
414
414
  status: "active" | "suspended" | "closed";
415
+ businessName: string;
416
+ email: string;
415
417
  id: string;
416
418
  createdAt: string;
417
419
  updatedAt: string;
418
420
  walletAddress: string | null;
419
- email: string;
420
- businessName: string;
421
421
  onchainMerchantId: number | null;
422
- tier: "free" | "growth" | "business" | "enterprise";
422
+ tier: "free" | "starter" | "growth" | "enterprise";
423
423
  payoutAddress: string | null;
424
424
  onboardingCompleted: boolean;
425
425
  defaultCurrency: "USDC" | "EURC";