@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
@@ -53,13 +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;
57
- merchantId: string;
58
- sessionId: string | null;
59
- createdAt: string;
56
+ total: string;
60
57
  currency: "USDC" | "EURC";
61
- updatedAt: string;
62
- note: string | null;
58
+ merchantId: string;
59
+ id: string;
63
60
  customerName: string | null;
64
61
  customerEmail: string | null;
65
62
  lineItems: [{
@@ -72,20 +69,20 @@ declare const invoiceSchema: z.ZodObject<{
72
69
  unitAmount: string;
73
70
  }[]];
74
71
  subtotal: string;
75
- total: string;
72
+ note: string | null;
73
+ sessionId: string | null;
76
74
  dueAt: string;
77
75
  paidAt: string | null;
78
76
  sentAt: string | null;
77
+ createdAt: string;
78
+ updatedAt: string;
79
79
  }, {
80
80
  number: string;
81
81
  status: "void" | "draft" | "sent" | "paid" | "overdue";
82
- id: string;
83
- merchantId: string;
84
- sessionId: string | null;
85
- createdAt: string;
82
+ total: string;
86
83
  currency: "USDC" | "EURC";
87
- updatedAt: string;
88
- note: string | null;
84
+ merchantId: string;
85
+ id: string;
89
86
  customerName: string | null;
90
87
  customerEmail: string | null;
91
88
  lineItems: [{
@@ -98,10 +95,13 @@ declare const invoiceSchema: z.ZodObject<{
98
95
  unitAmount: string;
99
96
  }[]];
100
97
  subtotal: string;
101
- total: string;
98
+ note: string | null;
99
+ sessionId: string | null;
102
100
  dueAt: string;
103
101
  paidAt: string | null;
104
102
  sentAt: string | null;
103
+ createdAt: string;
104
+ updatedAt: string;
105
105
  }>;
106
106
  type Invoice = z.infer<typeof invoiceSchema>;
107
107
  declare const createInvoiceInputSchema: z.ZodObject<{
@@ -135,9 +135,9 @@ declare const createInvoiceInputSchema: z.ZodObject<{
135
135
  unitAmount: string;
136
136
  }[]];
137
137
  dueInDays: number;
138
- note?: string | undefined;
139
138
  customerName?: string | undefined;
140
139
  customerEmail?: string | undefined;
140
+ note?: string | undefined;
141
141
  }, {
142
142
  currency: "USDC" | "EURC";
143
143
  lineItems: [{
@@ -149,11 +149,12 @@ declare const createInvoiceInputSchema: z.ZodObject<{
149
149
  quantity: number;
150
150
  unitAmount: string;
151
151
  }[]];
152
- note?: string | undefined;
153
152
  customerName?: string | undefined;
154
153
  customerEmail?: string | undefined;
154
+ note?: string | undefined;
155
155
  dueInDays?: number | undefined;
156
156
  }>;
157
- type CreateInvoiceInput = z.infer<typeof createInvoiceInputSchema>;
157
+ type CreateInvoiceInput = z.input<typeof createInvoiceInputSchema>;
158
+ type CreateInvoiceParsed = z.output<typeof createInvoiceInputSchema>;
158
159
 
159
- export { type CreateInvoiceInput, type Invoice, type InvoiceLineItem, type InvoiceStatus, createInvoiceInputSchema, invoiceLineItemSchema, invoiceSchema, invoiceStatusSchema };
160
+ export { type CreateInvoiceInput, type CreateInvoiceParsed, type Invoice, type InvoiceLineItem, type InvoiceStatus, createInvoiceInputSchema, invoiceLineItemSchema, invoiceSchema, invoiceStatusSchema };
@@ -53,13 +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;
57
- merchantId: string;
58
- sessionId: string | null;
59
- createdAt: string;
56
+ total: string;
60
57
  currency: "USDC" | "EURC";
61
- updatedAt: string;
62
- note: string | null;
58
+ merchantId: string;
59
+ id: string;
63
60
  customerName: string | null;
64
61
  customerEmail: string | null;
65
62
  lineItems: [{
@@ -72,20 +69,20 @@ declare const invoiceSchema: z.ZodObject<{
72
69
  unitAmount: string;
73
70
  }[]];
74
71
  subtotal: string;
75
- total: string;
72
+ note: string | null;
73
+ sessionId: string | null;
76
74
  dueAt: string;
77
75
  paidAt: string | null;
78
76
  sentAt: string | null;
77
+ createdAt: string;
78
+ updatedAt: string;
79
79
  }, {
80
80
  number: string;
81
81
  status: "void" | "draft" | "sent" | "paid" | "overdue";
82
- id: string;
83
- merchantId: string;
84
- sessionId: string | null;
85
- createdAt: string;
82
+ total: string;
86
83
  currency: "USDC" | "EURC";
87
- updatedAt: string;
88
- note: string | null;
84
+ merchantId: string;
85
+ id: string;
89
86
  customerName: string | null;
90
87
  customerEmail: string | null;
91
88
  lineItems: [{
@@ -98,10 +95,13 @@ declare const invoiceSchema: z.ZodObject<{
98
95
  unitAmount: string;
99
96
  }[]];
100
97
  subtotal: string;
101
- total: string;
98
+ note: string | null;
99
+ sessionId: string | null;
102
100
  dueAt: string;
103
101
  paidAt: string | null;
104
102
  sentAt: string | null;
103
+ createdAt: string;
104
+ updatedAt: string;
105
105
  }>;
106
106
  type Invoice = z.infer<typeof invoiceSchema>;
107
107
  declare const createInvoiceInputSchema: z.ZodObject<{
@@ -135,9 +135,9 @@ declare const createInvoiceInputSchema: z.ZodObject<{
135
135
  unitAmount: string;
136
136
  }[]];
137
137
  dueInDays: number;
138
- note?: string | undefined;
139
138
  customerName?: string | undefined;
140
139
  customerEmail?: string | undefined;
140
+ note?: string | undefined;
141
141
  }, {
142
142
  currency: "USDC" | "EURC";
143
143
  lineItems: [{
@@ -149,11 +149,12 @@ declare const createInvoiceInputSchema: z.ZodObject<{
149
149
  quantity: number;
150
150
  unitAmount: string;
151
151
  }[]];
152
- note?: string | undefined;
153
152
  customerName?: string | undefined;
154
153
  customerEmail?: string | undefined;
154
+ note?: string | undefined;
155
155
  dueInDays?: number | undefined;
156
156
  }>;
157
- type CreateInvoiceInput = z.infer<typeof createInvoiceInputSchema>;
157
+ type CreateInvoiceInput = z.input<typeof createInvoiceInputSchema>;
158
+ type CreateInvoiceParsed = z.output<typeof createInvoiceInputSchema>;
158
159
 
159
- export { type CreateInvoiceInput, type Invoice, type InvoiceLineItem, type InvoiceStatus, createInvoiceInputSchema, invoiceLineItemSchema, invoiceSchema, invoiceStatusSchema };
160
+ export { type CreateInvoiceInput, type CreateInvoiceParsed, type Invoice, type InvoiceLineItem, type InvoiceStatus, createInvoiceInputSchema, invoiceLineItemSchema, invoiceSchema, invoiceStatusSchema };
@@ -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,CA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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 .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 * 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.infer<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,MAAA,EAAO,CAAE,GAAA;AAOjC,IAAM,iBAAA,GAAoB,CAAA,CAC9B,MAAA,EAAO,CACP,MAAM,UAAA,EAAY,iDAAiD,CAAA,CACnE,MAAA,CAAO,CAAC,CAAA,KAAM,MAAA,CAAO,CAAC,CAAA,IAAK,IAAI,cAAc,CAAA;AAGtB,CAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,MAAA,CAAO,gBAAgB;AAGtE,IAAM,kBAAA,GAAqB,CAAA,CAC/B,MAAA,EAAO,CACP,QAAA,CAAS,EAAE,MAAA,EAAQ,IAAA,EAAM,OAAA,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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 .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 * 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 +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,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,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;AAOPA,KAAA,CAC9B,MAAA,EAAO,CACP,MAAM,UAAA,EAAY,iDAAiD,C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,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA,CAAE,IAAI,GAAG;AACrC,CAAC;AAGM,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 .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 * 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.infer<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.infer<typeof updateMerchantInputSchema>\n\nexport const changeTierInputSchema = z.object({\n tier: merchantTierSchema,\n})\nexport type ChangeTierInput = z.infer<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.infer<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.infer<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.infer<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.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AAAA,MACP,UAAUA,KAAAA,CAAE,IAAA,CAAK,CAAC,MAAA,EAAQ,MAAM,CAAC,CAAA;AAAA,MACjC,eAAA,EAAiB,gBAAA;AAAA;AAAA,MAEjB,GAAA,EAAKA,MAAE,MAAA,EAAO;AAAA;AAAA,MAEd,SAAA,EAAWA,MAAE,MAAA,EAAO;AAAA,MACpB,QAAA,EAAUA,KAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,GAAM,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,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 .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 * 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"]}
@@ -32,14 +32,14 @@ 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
- walletAddress: string | null;
37
38
  createdAt: string;
38
- email: string;
39
- metadata: Record<string, string | number | boolean | null>;
40
39
  updatedAt: string;
40
+ metadata: Record<string, string | number | boolean | null>;
41
+ walletAddress: string | null;
41
42
  onchainMerchantId: number | null;
42
- businessName: string;
43
43
  tier: "free" | "growth" | "business" | "enterprise";
44
44
  payoutAddress: string | null;
45
45
  onboardingCompleted: boolean;
@@ -50,13 +50,13 @@ 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
- walletAddress: string | null;
55
56
  createdAt: string;
56
- email: string;
57
57
  updatedAt: string;
58
+ walletAddress: string | null;
58
59
  onchainMerchantId: number | null;
59
- businessName: string;
60
60
  tier: "free" | "growth" | "business" | "enterprise";
61
61
  payoutAddress: string | null;
62
62
  onboardingCompleted: boolean;
@@ -75,19 +75,20 @@ 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;
89
89
  }>;
90
- type CreateMerchantInput = z.infer<typeof createMerchantInputSchema>;
90
+ type CreateMerchantInput = z.input<typeof createMerchantInputSchema>;
91
+ type CreateMerchantParsed = z.output<typeof createMerchantInputSchema>;
91
92
  /**
92
93
  * Merchant email opt-outs, persisted at `Merchant.metadata.emailPrefs`.
93
94
  * Both default to true. Welcome, refunds, and admin broadcasts always send.
@@ -125,8 +126,8 @@ declare const updateMerchantInputSchema: z.ZodObject<{
125
126
  subscriptionCharged?: boolean | undefined;
126
127
  }>>;
127
128
  }, "strip", z.ZodTypeAny, {
128
- metadata?: Record<string, string | number | boolean | null> | undefined;
129
129
  businessName?: string | undefined;
130
+ metadata?: Record<string, string | number | boolean | null> | undefined;
130
131
  payoutAddress?: string | undefined;
131
132
  defaultCurrency?: "USDC" | "EURC" | undefined;
132
133
  countryCode?: string | null | undefined;
@@ -137,8 +138,8 @@ declare const updateMerchantInputSchema: z.ZodObject<{
137
138
  subscriptionCharged?: boolean | undefined;
138
139
  } | undefined;
139
140
  }, {
140
- metadata?: Record<string, string | number | boolean | null> | undefined;
141
141
  businessName?: string | undefined;
142
+ metadata?: Record<string, string | number | boolean | null> | undefined;
142
143
  payoutAddress?: string | undefined;
143
144
  defaultCurrency?: "USDC" | "EURC" | undefined;
144
145
  countryCode?: string | null | undefined;
@@ -149,7 +150,8 @@ declare const updateMerchantInputSchema: z.ZodObject<{
149
150
  subscriptionCharged?: boolean | undefined;
150
151
  } | undefined;
151
152
  }>;
152
- type UpdateMerchantInput = z.infer<typeof updateMerchantInputSchema>;
153
+ type UpdateMerchantInput = z.input<typeof updateMerchantInputSchema>;
154
+ type UpdateMerchantParsed = z.output<typeof updateMerchantInputSchema>;
153
155
  declare const changeTierInputSchema: z.ZodObject<{
154
156
  tier: z.ZodEnum<["free", "growth", "business", "enterprise"]>;
155
157
  }, "strip", z.ZodTypeAny, {
@@ -157,7 +159,8 @@ declare const changeTierInputSchema: z.ZodObject<{
157
159
  }, {
158
160
  tier: "free" | "growth" | "business" | "enterprise";
159
161
  }>;
160
- type ChangeTierInput = z.infer<typeof changeTierInputSchema>;
162
+ type ChangeTierInput = z.input<typeof changeTierInputSchema>;
163
+ type ChangeTierParsed = z.output<typeof changeTierInputSchema>;
161
164
  /**
162
165
  * Self-attested onboarding form the dashboard collects after a
163
166
  * merchant first logs in via Privy. On success the API stamps
@@ -193,21 +196,22 @@ declare const onboardMerchantInputSchema: z.ZodObject<{
193
196
  logoUrl?: string | undefined;
194
197
  phone?: string | undefined;
195
198
  }>;
196
- type OnboardMerchantInput = z.infer<typeof onboardMerchantInputSchema>;
199
+ type OnboardMerchantInput = z.input<typeof onboardMerchantInputSchema>;
200
+ type OnboardMerchantParsed = z.output<typeof onboardMerchantInputSchema>;
197
201
  declare const merchantPublicBrandSchema: z.ZodObject<{
198
202
  id: z.ZodString;
199
203
  businessName: z.ZodString;
200
204
  logoUrl: z.ZodNullable<z.ZodString>;
201
205
  walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
202
206
  }, "strip", z.ZodTypeAny, {
207
+ businessName: string;
203
208
  id: string;
204
209
  walletAddress: string | null;
205
- businessName: string;
206
210
  logoUrl: string | null;
207
211
  }, {
212
+ businessName: string;
208
213
  id: string;
209
214
  walletAddress: string | null;
210
- businessName: string;
211
215
  logoUrl: string | null;
212
216
  }>;
213
217
  type MerchantPublicBrand = z.infer<typeof merchantPublicBrandSchema>;
@@ -284,16 +288,16 @@ declare const merchantMemberSchema: z.ZodObject<{
284
288
  invitedAt: z.ZodString;
285
289
  acceptedAt: z.ZodNullable<z.ZodString>;
286
290
  }, "strip", z.ZodTypeAny, {
287
- id: string;
288
291
  merchantId: string;
289
292
  email: string;
293
+ id: string;
290
294
  role: "owner" | "admin" | "developer" | "read_only";
291
295
  invitedAt: string;
292
296
  acceptedAt: string | null;
293
297
  }, {
294
- id: string;
295
298
  merchantId: string;
296
299
  email: string;
300
+ id: string;
297
301
  role: "owner" | "admin" | "developer" | "read_only";
298
302
  invitedAt: string;
299
303
  acceptedAt: string | null;
@@ -309,7 +313,8 @@ declare const inviteMemberInputSchema: z.ZodObject<{
309
313
  email: string;
310
314
  role: "owner" | "admin" | "developer" | "read_only";
311
315
  }>;
312
- type InviteMemberInput = z.infer<typeof inviteMemberInputSchema>;
316
+ type InviteMemberInput = z.input<typeof inviteMemberInputSchema>;
317
+ type InviteMemberParsed = z.output<typeof inviteMemberInputSchema>;
313
318
  declare const loginInputSchema: z.ZodObject<{
314
319
  email: z.ZodString;
315
320
  password: z.ZodString;
@@ -320,7 +325,8 @@ declare const loginInputSchema: z.ZodObject<{
320
325
  email: string;
321
326
  password: string;
322
327
  }>;
323
- type LoginInput = z.infer<typeof loginInputSchema>;
328
+ type LoginInput = z.input<typeof loginInputSchema>;
329
+ type LoginParsed = z.output<typeof loginInputSchema>;
324
330
  declare const loginOutputSchema: z.ZodObject<{
325
331
  accessToken: z.ZodString;
326
332
  refreshToken: z.ZodString;
@@ -344,14 +350,14 @@ declare const loginOutputSchema: z.ZodObject<{
344
350
  updatedAt: z.ZodString;
345
351
  }, "strip", z.ZodTypeAny, {
346
352
  status: "active" | "suspended" | "closed";
353
+ businessName: string;
354
+ email: string;
347
355
  id: string;
348
- walletAddress: string | null;
349
356
  createdAt: string;
350
- email: string;
351
- metadata: Record<string, string | number | boolean | null>;
352
357
  updatedAt: string;
358
+ metadata: Record<string, string | number | boolean | null>;
359
+ walletAddress: string | null;
353
360
  onchainMerchantId: number | null;
354
- businessName: string;
355
361
  tier: "free" | "growth" | "business" | "enterprise";
356
362
  payoutAddress: string | null;
357
363
  onboardingCompleted: boolean;
@@ -362,13 +368,13 @@ declare const loginOutputSchema: z.ZodObject<{
362
368
  whitelabelEnabled: boolean;
363
369
  }, {
364
370
  status: "active" | "suspended" | "closed";
371
+ businessName: string;
372
+ email: string;
365
373
  id: string;
366
- walletAddress: string | null;
367
374
  createdAt: string;
368
- email: string;
369
375
  updatedAt: string;
376
+ walletAddress: string | null;
370
377
  onchainMerchantId: number | null;
371
- businessName: string;
372
378
  tier: "free" | "growth" | "business" | "enterprise";
373
379
  payoutAddress: string | null;
374
380
  onboardingCompleted: boolean;
@@ -384,14 +390,14 @@ declare const loginOutputSchema: z.ZodObject<{
384
390
  refreshToken: string;
385
391
  merchant: {
386
392
  status: "active" | "suspended" | "closed";
393
+ businessName: string;
394
+ email: string;
387
395
  id: string;
388
- walletAddress: string | null;
389
396
  createdAt: string;
390
- email: string;
391
- metadata: Record<string, string | number | boolean | null>;
392
397
  updatedAt: string;
398
+ metadata: Record<string, string | number | boolean | null>;
399
+ walletAddress: string | null;
393
400
  onchainMerchantId: number | null;
394
- businessName: string;
395
401
  tier: "free" | "growth" | "business" | "enterprise";
396
402
  payoutAddress: string | null;
397
403
  onboardingCompleted: boolean;
@@ -406,13 +412,13 @@ declare const loginOutputSchema: z.ZodObject<{
406
412
  refreshToken: string;
407
413
  merchant: {
408
414
  status: "active" | "suspended" | "closed";
415
+ businessName: string;
416
+ email: string;
409
417
  id: string;
410
- walletAddress: string | null;
411
418
  createdAt: string;
412
- email: string;
413
419
  updatedAt: string;
420
+ walletAddress: string | null;
414
421
  onchainMerchantId: number | null;
415
- businessName: string;
416
422
  tier: "free" | "growth" | "business" | "enterprise";
417
423
  payoutAddress: string | null;
418
424
  onboardingCompleted: boolean;
@@ -426,4 +432,4 @@ declare const loginOutputSchema: z.ZodObject<{
426
432
  }>;
427
433
  type LoginOutput = z.infer<typeof loginOutputSchema>;
428
434
 
429
- export { type ChangeTierInput, type CreateMerchantInput, DEFAULT_MERCHANT_EMAIL_PREFS, type InviteMemberInput, type LoginInput, type LoginOutput, type Merchant, type MerchantBalanceView, type MerchantEmailPrefs, type MerchantMember, type MerchantPublicBrand, type MerchantRole, type MerchantStatus, type OnboardMerchantInput, type UpdateMerchantInput, changeTierInputSchema, createMerchantInputSchema, inviteMemberInputSchema, loginInputSchema, loginOutputSchema, merchantBalanceSchema, merchantEmailPrefsSchema, merchantMemberSchema, merchantPublicBrandSchema, merchantRoleSchema, merchantSchema, merchantStatusSchema, onboardMerchantInputSchema, updateMerchantInputSchema };
435
+ export { type ChangeTierInput, type ChangeTierParsed, type CreateMerchantInput, type CreateMerchantParsed, DEFAULT_MERCHANT_EMAIL_PREFS, type InviteMemberInput, type InviteMemberParsed, type LoginInput, type LoginOutput, type LoginParsed, type Merchant, type MerchantBalanceView, type MerchantEmailPrefs, type MerchantMember, type MerchantPublicBrand, type MerchantRole, type MerchantStatus, type OnboardMerchantInput, type OnboardMerchantParsed, type UpdateMerchantInput, type UpdateMerchantParsed, changeTierInputSchema, createMerchantInputSchema, inviteMemberInputSchema, loginInputSchema, loginOutputSchema, merchantBalanceSchema, merchantEmailPrefsSchema, merchantMemberSchema, merchantPublicBrandSchema, merchantRoleSchema, merchantSchema, merchantStatusSchema, onboardMerchantInputSchema, updateMerchantInputSchema };