@strimz/shared-types 0.1.0 → 0.2.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 (97) hide show
  1. package/README.md +66 -36
  2. package/dist/agents.cjs.map +1 -1
  3. package/dist/agents.d.cts +1 -1
  4. package/dist/agents.d.ts +1 -1
  5. package/dist/agents.js.map +1 -1
  6. package/dist/api-keys.cjs +8 -3
  7. package/dist/api-keys.cjs.map +1 -1
  8. package/dist/api-keys.d.cts +15 -16
  9. package/dist/api-keys.d.ts +15 -16
  10. package/dist/api-keys.js +8 -3
  11. package/dist/api-keys.js.map +1 -1
  12. package/dist/common.cjs.map +1 -1
  13. package/dist/common.d.cts +2 -2
  14. package/dist/common.d.ts +2 -2
  15. package/dist/common.js.map +1 -1
  16. package/dist/compliance.cjs.map +1 -1
  17. package/dist/compliance.d.cts +1 -1
  18. package/dist/compliance.d.ts +1 -1
  19. package/dist/compliance.js.map +1 -1
  20. package/dist/customers.cjs.map +1 -1
  21. package/dist/customers.d.cts +1 -1
  22. package/dist/customers.d.ts +1 -1
  23. package/dist/customers.js.map +1 -1
  24. package/dist/events.cjs +24 -6
  25. package/dist/events.cjs.map +1 -1
  26. package/dist/events.d.cts +12 -12
  27. package/dist/events.d.ts +12 -12
  28. package/dist/events.js +24 -6
  29. package/dist/events.js.map +1 -1
  30. package/dist/index.cjs +188 -11
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.d.cts +302 -17
  33. package/dist/index.d.ts +302 -17
  34. package/dist/index.js +167 -12
  35. package/dist/index.js.map +1 -1
  36. package/dist/invoices.cjs.map +1 -1
  37. package/dist/invoices.d.cts +1 -1
  38. package/dist/invoices.d.ts +1 -1
  39. package/dist/invoices.js.map +1 -1
  40. package/dist/merchants.cjs +59 -1
  41. package/dist/merchants.cjs.map +1 -1
  42. package/dist/merchants.d.cts +171 -1
  43. package/dist/merchants.d.ts +171 -1
  44. package/dist/merchants.js +55 -2
  45. package/dist/merchants.js.map +1 -1
  46. package/dist/payment-sessions.cjs +6 -2
  47. package/dist/payment-sessions.cjs.map +1 -1
  48. package/dist/payment-sessions.d.cts +20 -4
  49. package/dist/payment-sessions.d.ts +20 -4
  50. package/dist/payment-sessions.js +6 -3
  51. package/dist/payment-sessions.js.map +1 -1
  52. package/dist/refunds.cjs +12 -0
  53. package/dist/refunds.cjs.map +1 -1
  54. package/dist/refunds.d.cts +135 -2
  55. package/dist/refunds.d.ts +135 -2
  56. package/dist/refunds.js +11 -1
  57. package/dist/refunds.js.map +1 -1
  58. package/dist/storefronts.cjs +16 -2
  59. package/dist/storefronts.cjs.map +1 -1
  60. package/dist/storefronts.d.cts +38 -2
  61. package/dist/storefronts.d.ts +38 -2
  62. package/dist/storefronts.js +15 -3
  63. package/dist/storefronts.js.map +1 -1
  64. package/dist/subscriptions.cjs +2 -2
  65. package/dist/subscriptions.cjs.map +1 -1
  66. package/dist/subscriptions.d.cts +3 -3
  67. package/dist/subscriptions.d.ts +3 -3
  68. package/dist/subscriptions.js +2 -2
  69. package/dist/subscriptions.js.map +1 -1
  70. package/dist/transactions.cjs.map +1 -1
  71. package/dist/transactions.d.cts +2 -2
  72. package/dist/transactions.d.ts +2 -2
  73. package/dist/transactions.js.map +1 -1
  74. package/dist/webhooks.cjs +7 -1
  75. package/dist/webhooks.cjs.map +1 -1
  76. package/dist/webhooks.d.cts +63 -4
  77. package/dist/webhooks.d.ts +63 -4
  78. package/dist/webhooks.js +7 -2
  79. package/dist/webhooks.js.map +1 -1
  80. package/package.json +2 -2
  81. package/src/agents.ts +1 -1
  82. package/src/api-keys.ts +9 -5
  83. package/src/common.ts +2 -2
  84. package/src/compliance.ts +1 -1
  85. package/src/contact.ts +26 -0
  86. package/src/customers.ts +1 -1
  87. package/src/index.ts +2 -0
  88. package/src/invoices.ts +1 -1
  89. package/src/merchants.ts +84 -0
  90. package/src/notifications.ts +88 -0
  91. package/src/payment-sessions.ts +25 -3
  92. package/src/refunds.ts +20 -1
  93. package/src/storefronts.ts +25 -1
  94. package/src/subscriptions.ts +3 -3
  95. package/src/tokens.ts +7 -7
  96. package/src/transactions.ts +2 -2
  97. package/src/webhooks.ts +15 -3
@@ -10,11 +10,10 @@ import { z } from 'zod';
10
10
  declare const apiKeyKindSchema: z.ZodEnum<["secret", "publishable"]>;
11
11
  type ApiKeyKind = z.infer<typeof apiKeyKindSchema>;
12
12
  /**
13
- * Underscore-separated to match the Prisma `ApiKeyScope` enum (Prisma
14
- * does not allow `:` in enum values). The DB and the wire format use the
15
- * same form so there is no boundary translation.
13
+ * Underscore-separated. The wire format and any database representation
14
+ * use the same form so there is no boundary translation.
16
15
  */
17
- declare const apiKeyScopeSchema: z.ZodEnum<["sessions_read", "sessions_write", "subscriptions_read", "subscriptions_write", "refunds_read", "refunds_write", "transactions_read", "webhooks_read", "webhooks_write", "invoices_read", "invoices_write", "storefronts_read", "storefronts_write", "agents_read", "agents_write", "relay_read", "relay_write"]>;
16
+ declare const apiKeyScopeSchema: z.ZodEnum<["sessions_read", "sessions_write", "subscriptions_read", "subscriptions_write", "refunds_read", "refunds_write", "transactions_read", "webhooks_read", "webhooks_write", "invoices_read", "invoices_write", "storefronts_read", "storefronts_write", "agents_read", "agents_write", "relay_read", "relay_write", "api_keys_read", "api_keys_write"]>;
18
17
  type ApiKeyScope = z.infer<typeof apiKeyScopeSchema>;
19
18
  declare const apiKeySchema: z.ZodObject<{
20
19
  id: z.ZodString;
@@ -24,7 +23,7 @@ declare const apiKeySchema: z.ZodObject<{
24
23
  mode: z.ZodEnum<["test", "live"]>;
25
24
  prefix: z.ZodString;
26
25
  lastFour: z.ZodString;
27
- scopes: z.ZodArray<z.ZodEnum<["sessions_read", "sessions_write", "subscriptions_read", "subscriptions_write", "refunds_read", "refunds_write", "transactions_read", "webhooks_read", "webhooks_write", "invoices_read", "invoices_write", "storefronts_read", "storefronts_write", "agents_read", "agents_write", "relay_read", "relay_write"]>, "atleastone">;
26
+ scopes: z.ZodArray<z.ZodEnum<["sessions_read", "sessions_write", "subscriptions_read", "subscriptions_write", "refunds_read", "refunds_write", "transactions_read", "webhooks_read", "webhooks_write", "invoices_read", "invoices_write", "storefronts_read", "storefronts_write", "agents_read", "agents_write", "relay_read", "relay_write", "api_keys_read", "api_keys_write"]>, "atleastone">;
28
27
  createdAt: z.ZodString;
29
28
  lastUsedAt: z.ZodNullable<z.ZodString>;
30
29
  revokedAt: z.ZodNullable<z.ZodString>;
@@ -36,7 +35,7 @@ declare const apiKeySchema: z.ZodObject<{
36
35
  mode: "test" | "live";
37
36
  prefix: string;
38
37
  lastFour: string;
39
- scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write")[]];
38
+ scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write")[]];
40
39
  createdAt: string;
41
40
  lastUsedAt: string | null;
42
41
  revokedAt: string | null;
@@ -48,7 +47,7 @@ declare const apiKeySchema: z.ZodObject<{
48
47
  mode: "test" | "live";
49
48
  prefix: string;
50
49
  lastFour: string;
51
- scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write")[]];
50
+ scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write")[]];
52
51
  createdAt: string;
53
52
  lastUsedAt: string | null;
54
53
  revokedAt: string | null;
@@ -58,17 +57,17 @@ declare const createApiKeyInputSchema: z.ZodObject<{
58
57
  name: z.ZodString;
59
58
  kind: z.ZodEnum<["secret", "publishable"]>;
60
59
  mode: z.ZodEnum<["test", "live"]>;
61
- scopes: z.ZodArray<z.ZodEnum<["sessions_read", "sessions_write", "subscriptions_read", "subscriptions_write", "refunds_read", "refunds_write", "transactions_read", "webhooks_read", "webhooks_write", "invoices_read", "invoices_write", "storefronts_read", "storefronts_write", "agents_read", "agents_write", "relay_read", "relay_write"]>, "atleastone">;
60
+ scopes: z.ZodArray<z.ZodEnum<["sessions_read", "sessions_write", "subscriptions_read", "subscriptions_write", "refunds_read", "refunds_write", "transactions_read", "webhooks_read", "webhooks_write", "invoices_read", "invoices_write", "storefronts_read", "storefronts_write", "agents_read", "agents_write", "relay_read", "relay_write", "api_keys_read", "api_keys_write"]>, "atleastone">;
62
61
  }, "strip", z.ZodTypeAny, {
63
62
  name: string;
64
63
  kind: "secret" | "publishable";
65
64
  mode: "test" | "live";
66
- scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write")[]];
65
+ scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write")[]];
67
66
  }, {
68
67
  name: string;
69
68
  kind: "secret" | "publishable";
70
69
  mode: "test" | "live";
71
- scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write")[]];
70
+ scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write")[]];
72
71
  }>;
73
72
  type CreateApiKeyInput = z.infer<typeof createApiKeyInputSchema>;
74
73
  declare const createApiKeyOutputSchema: z.ZodObject<{
@@ -80,7 +79,7 @@ declare const createApiKeyOutputSchema: z.ZodObject<{
80
79
  mode: z.ZodEnum<["test", "live"]>;
81
80
  prefix: z.ZodString;
82
81
  lastFour: z.ZodString;
83
- scopes: z.ZodArray<z.ZodEnum<["sessions_read", "sessions_write", "subscriptions_read", "subscriptions_write", "refunds_read", "refunds_write", "transactions_read", "webhooks_read", "webhooks_write", "invoices_read", "invoices_write", "storefronts_read", "storefronts_write", "agents_read", "agents_write", "relay_read", "relay_write"]>, "atleastone">;
82
+ scopes: z.ZodArray<z.ZodEnum<["sessions_read", "sessions_write", "subscriptions_read", "subscriptions_write", "refunds_read", "refunds_write", "transactions_read", "webhooks_read", "webhooks_write", "invoices_read", "invoices_write", "storefronts_read", "storefronts_write", "agents_read", "agents_write", "relay_read", "relay_write", "api_keys_read", "api_keys_write"]>, "atleastone">;
84
83
  createdAt: z.ZodString;
85
84
  lastUsedAt: z.ZodNullable<z.ZodString>;
86
85
  revokedAt: z.ZodNullable<z.ZodString>;
@@ -92,7 +91,7 @@ declare const createApiKeyOutputSchema: z.ZodObject<{
92
91
  mode: "test" | "live";
93
92
  prefix: string;
94
93
  lastFour: string;
95
- scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write")[]];
94
+ scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write")[]];
96
95
  createdAt: string;
97
96
  lastUsedAt: string | null;
98
97
  revokedAt: string | null;
@@ -104,12 +103,12 @@ declare const createApiKeyOutputSchema: z.ZodObject<{
104
103
  mode: "test" | "live";
105
104
  prefix: string;
106
105
  lastFour: string;
107
- scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write")[]];
106
+ scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write")[]];
108
107
  createdAt: string;
109
108
  lastUsedAt: string | null;
110
109
  revokedAt: string | null;
111
110
  }>;
112
- /** Full plaintext key — shown exactly once. */
111
+ /** Full plaintext key. Shown exactly once. */
113
112
  secret: z.ZodString;
114
113
  }, "strip", z.ZodTypeAny, {
115
114
  secret: string;
@@ -121,7 +120,7 @@ declare const createApiKeyOutputSchema: z.ZodObject<{
121
120
  mode: "test" | "live";
122
121
  prefix: string;
123
122
  lastFour: string;
124
- scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write")[]];
123
+ scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write")[]];
125
124
  createdAt: string;
126
125
  lastUsedAt: string | null;
127
126
  revokedAt: string | null;
@@ -136,7 +135,7 @@ declare const createApiKeyOutputSchema: z.ZodObject<{
136
135
  mode: "test" | "live";
137
136
  prefix: string;
138
137
  lastFour: string;
139
- scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write")[]];
138
+ scopes: ["sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write", ...("sessions_read" | "sessions_write" | "subscriptions_read" | "subscriptions_write" | "refunds_read" | "refunds_write" | "transactions_read" | "webhooks_read" | "webhooks_write" | "invoices_read" | "invoices_write" | "storefronts_read" | "storefronts_write" | "agents_read" | "agents_write" | "relay_read" | "relay_write" | "api_keys_read" | "api_keys_write")[]];
140
139
  createdAt: string;
141
140
  lastUsedAt: string | null;
142
141
  revokedAt: string | null;
package/dist/api-keys.js CHANGED
@@ -45,11 +45,16 @@ var apiKeyScopeSchema = z.enum([
45
45
  "storefronts_write",
46
46
  "agents_read",
47
47
  "agents_write",
48
- // Meta-tx relayer — submitting payer-signed EIP-3009 / EIP-2612
48
+ // Meta-tx relayer. Submitting payer-signed EIP-3009 / EIP-2612
49
49
  // authorizations on the merchant's behalf. Granted to keys used by
50
50
  // hosted checkout and merchants embedding the SDK.
51
51
  "relay_read",
52
- "relay_write"
52
+ "relay_write",
53
+ // Self-service key management from an API key holder. Rarely used
54
+ // day-to-day; needed for partner onboarding flows that mint scoped
55
+ // keys per sub-tenant.
56
+ "api_keys_read",
57
+ "api_keys_write"
53
58
  ]);
54
59
  var apiKeySchema = z.object({
55
60
  id: idSchema,
@@ -72,7 +77,7 @@ var createApiKeyInputSchema = z.object({
72
77
  });
73
78
  var createApiKeyOutputSchema = z.object({
74
79
  apiKey: apiKeySchema,
75
- /** Full plaintext key — shown exactly once. */
80
+ /** Full plaintext key. Shown exactly once. */
76
81
  secret: z.string()
77
82
  });
78
83
  var rotateApiKeyInputSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.ts","../src/api-keys.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;AAGlE,CAAA,CAAE,MAAA,EAAO,CAAE,KAAA,EAAM,C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I,EAAE,CAAA;AAAA,EAC9B,IAAA,EAAM,gBAAA;AAAA,EACN,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQA,EAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA,CAAE,IAAI,EAAE,CAAA;AAAA,EAChC,QAAA,EAAUA,CAAAA,CAAE,MAAA,EAAO,CAAE,OAAO,CAAC,CAAA;AAAA,EAC7B,MAAA,EAAQA,CAAAA,CAAE,KAAA,CAAM,iBAAiB,EAAE,QAAA,EAAS;AAAA,EAC5C,SAAA,EAAW,kBAAA;AAAA,EACX,UAAA,EAAY,mBAAmB,QAAA,EAAS;AAAA,EACxC,SAAA,EAAW,mBAAmB,QAAA;AAChC,CAAC;AAKM,IAAM,uBAAA,GAA0BA,EAAE,MAAA,CAAO;AAAA,EAC9C,IAAA,EAAMA,EAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA,CAAE,IAAI,EAAE,CAAA;AAAA,EAC9B,IAAA,EAAM,gBAAA;AAAA,EACN,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQA,CAAAA,CAAE,KAAA,CAAM,iBAAiB,EAAE,QAAA;AACrC,CAAC;AAGM,IAAM,wBAAA,GAA2BA,EAAE,MAAA,CAAO;AAAA,EAC/C,MAAA,EAAQ,YAAA;AAAA;AAAA,EAER,MAAA,EAAQA,EAAE,MAAA;AACZ,CAAC;AAGM,IAAM,uBAAA,GAA0BA,EAAE,MAAA,CAAO;AAAA,EAC9C,EAAA,EAAI;AACN,CAAC","file":"api-keys.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 — mirrors `@strimz/shared-config`. */\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 — mirrors `@strimz/shared-config`. */\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 * API keys.\n *\n * A merchant has independent test and live keys. The full secret is shown\n * exactly once at creation; the backend stores only a hash and a display prefix.\n */\n\nimport { z } from 'zod'\nimport { idSchema, isoTimestampSchema, modeSchema } from './common.js'\n\nexport const apiKeyKindSchema = z.enum(['secret', 'publishable'])\nexport type ApiKeyKind = z.infer<typeof apiKeyKindSchema>\n\n/**\n * Underscore-separated to match the Prisma `ApiKeyScope` enum (Prisma\n * does not allow `:` in enum values). The DB and the wire format use the\n * same form so there is no boundary translation.\n */\nexport const apiKeyScopeSchema = z.enum([\n 'sessions_read',\n 'sessions_write',\n 'subscriptions_read',\n 'subscriptions_write',\n 'refunds_read',\n 'refunds_write',\n 'transactions_read',\n 'webhooks_read',\n 'webhooks_write',\n 'invoices_read',\n 'invoices_write',\n 'storefronts_read',\n 'storefronts_write',\n 'agents_read',\n 'agents_write',\n // Meta-tx relayer — submitting payer-signed EIP-3009 / EIP-2612\n // authorizations on the merchant's behalf. Granted to keys used by\n // hosted checkout and merchants embedding the SDK.\n 'relay_read',\n 'relay_write',\n])\nexport type ApiKeyScope = z.infer<typeof apiKeyScopeSchema>\n\nexport const apiKeySchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n name: z.string().min(1).max(60),\n kind: apiKeyKindSchema,\n mode: modeSchema,\n prefix: z.string().min(8).max(24),\n lastFour: z.string().length(4),\n scopes: z.array(apiKeyScopeSchema).nonempty(),\n createdAt: isoTimestampSchema,\n lastUsedAt: isoTimestampSchema.nullable(),\n revokedAt: isoTimestampSchema.nullable(),\n})\nexport type ApiKey = z.infer<typeof apiKeySchema>\n\n// ---------- DTOs ----------\n\nexport const createApiKeyInputSchema = z.object({\n name: z.string().min(1).max(60),\n kind: apiKeyKindSchema,\n mode: modeSchema,\n scopes: z.array(apiKeyScopeSchema).nonempty(),\n})\nexport type CreateApiKeyInput = z.infer<typeof createApiKeyInputSchema>\n\nexport const createApiKeyOutputSchema = z.object({\n apiKey: apiKeySchema,\n /** Full plaintext key — shown exactly once. */\n secret: z.string(),\n})\nexport type CreateApiKeyOutput = z.infer<typeof createApiKeyOutputSchema>\n\nexport const rotateApiKeyInputSchema = z.object({\n id: idSchema,\n})\nexport type RotateApiKeyInput = z.infer<typeof rotateApiKeyInputSchema>\n"]}
1
+ {"version":3,"sources":["../src/common.ts","../src/api-keys.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,k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O;AAAA,EAC9C,EAAA,EAAI;AACN,CAAC","file":"api-keys.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 * API keys.\n *\n * A merchant has independent test and live keys. The full secret is shown\n * exactly once at creation; the backend stores only a hash and a display prefix.\n */\n\nimport { z } from 'zod'\nimport { idSchema, isoTimestampSchema, modeSchema } from './common.js'\n\nexport const apiKeyKindSchema = z.enum(['secret', 'publishable'])\nexport type ApiKeyKind = z.infer<typeof apiKeyKindSchema>\n\n/**\n * Underscore-separated. The wire format and any database representation\n * use the same form so there is no boundary translation.\n */\nexport const apiKeyScopeSchema = z.enum([\n 'sessions_read',\n 'sessions_write',\n 'subscriptions_read',\n 'subscriptions_write',\n 'refunds_read',\n 'refunds_write',\n 'transactions_read',\n 'webhooks_read',\n 'webhooks_write',\n 'invoices_read',\n 'invoices_write',\n 'storefronts_read',\n 'storefronts_write',\n 'agents_read',\n 'agents_write',\n // Meta-tx relayer. Submitting payer-signed EIP-3009 / EIP-2612\n // authorizations on the merchant's behalf. Granted to keys used by\n // hosted checkout and merchants embedding the SDK.\n 'relay_read',\n 'relay_write',\n // Self-service key management from an API key holder. Rarely used\n // day-to-day; needed for partner onboarding flows that mint scoped\n // keys per sub-tenant.\n 'api_keys_read',\n 'api_keys_write',\n])\nexport type ApiKeyScope = z.infer<typeof apiKeyScopeSchema>\n\nexport const apiKeySchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n name: z.string().min(1).max(60),\n kind: apiKeyKindSchema,\n mode: modeSchema,\n prefix: z.string().min(8).max(24),\n lastFour: z.string().length(4),\n scopes: z.array(apiKeyScopeSchema).nonempty(),\n createdAt: isoTimestampSchema,\n lastUsedAt: isoTimestampSchema.nullable(),\n revokedAt: isoTimestampSchema.nullable(),\n})\nexport type ApiKey = z.infer<typeof apiKeySchema>\n\n// ---------- DTOs ----------\n\nexport const createApiKeyInputSchema = z.object({\n name: z.string().min(1).max(60),\n kind: apiKeyKindSchema,\n mode: modeSchema,\n scopes: z.array(apiKeyScopeSchema).nonempty(),\n})\nexport type CreateApiKeyInput = z.infer<typeof createApiKeyInputSchema>\n\nexport const createApiKeyOutputSchema = z.object({\n apiKey: apiKeySchema,\n /** Full plaintext key. Shown exactly once. */\n secret: z.string(),\n})\nexport type CreateApiKeyOutput = z.infer<typeof createApiKeyOutputSchema>\n\nexport const rotateApiKeyInputSchema = z.object({\n id: idSchema,\n})\nexport type RotateApiKeyInput = z.infer<typeof rotateApiKeyInputSchema>\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.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;AAG3C,IAAM,gBAAA,GAAmBA,KAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa;AAG5B,IAAM,kBAAkBA,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;AAGnE,IAAM,cAAA,GAAiBA,KAAA,CAC3B,MAAA,EAAO,CACP,GAAA,EAAI,CACJ,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,UAAA,CAAW,UAAU,CAAA,EAAG;AAAA,EACvC,OAAA,EAAS;AACX,CAAC;AAGI,IAAM,aAAA,GAAgBA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA;AAOjC,IAAM,iBAAA,GAAoBA,KAAA,CAC9B,MAAA,EAAO,CACP,MAAM,UAAA,EAAY,iDAAiD,CAAA,CACnE,MAAA,CAAO,CAAC,CAAA,KAAM,MAAA,CAAO,CAAC,CAAA,IAAK,IAAI,cAAc;AAGzC,IAAM,UAAA,GAAaA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CAAE,GAAA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,CAAC,CAAA,CAAE,MAAA,IAAU,EAAA,EAAI,0BAA0B,CAAA,CACrE,OAAA,CAAQ,EAAE;AAGN,IAAM,aAAaA,KAAA,CAAE,IAAA,CAAK,CAAC,MAAA,EAAQ,MAAM,CAAC;AAI1C,IAAM,wBAAwBA,KAAA,CAAE,IAAA,CAAK,CAAC,MAAA,EAAQ,MAAM,CAAC;AAIrD,IAAM,oBAAoBA,KAAA,CAAE,IAAA,CAAK,CAAC,MAAA,EAAQ,MAAA,EAAQ,MAAM,CAAC;AAIzD,IAAM,kBAAA,GAAqBA,MAAE,IAAA,CAAK,CAAC,QAAQ,QAAA,EAAU,UAAA,EAAY,YAAY,CAAC;AAI9E,IAAM,uBAAuBA,KAAA,CAAE,IAAA,CAAK,CAAC,SAAA,EAAW,SAAS,CAAC","file":"common.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 — mirrors `@strimz/shared-config`. */\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 — mirrors `@strimz/shared-config`. */\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"]}
1
+ {"version":3,"sources":["../src/common.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;AAG3C,IAAM,gBAAA,GAAmBA,KAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa;AAG5B,IAAM,kBAAkBA,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;AAGnE,IAAM,cAAA,GAAiBA,KAAA,CAC3B,MAAA,EAAO,CACP,GAAA,EAAI,CACJ,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,UAAA,CAAW,UAAU,CAAA,EAAG;AAAA,EACvC,OAAA,EAAS;AACX,CAAC;AAGI,IAAM,aAAA,GAAgBA,KAAA,CAA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I,CAAC,CAAA,CAAE,IAAI,EAAE,CAAA;AAAA,EACxBA,MAAE,KAAA,CAAM,CAACA,MAAE,MAAA,EAAO,CAAE,IAAI,GAAG,CAAA,EAAGA,KAAA,CAAE,MAAA,IAAUA,KAAA,CAAE,OAAA,IAAWA,KAAA,CAAE,IAAA,EAAM,CAAC;AAClE,CAAA,CACC,MAAA,CAAO,CAAC,CAAA,KAAM,MAAA,CAAO,IAAA,CAAK,CAAC,CAAA,CAAE,MAAA,IAAU,EAAA,EAAI,0BAA0B,CAAA,CACrE,OAAA,CAAQ,EAAE;AAGN,IAAM,aAAaA,KAAA,CAAE,IAAA,CAAK,CAAC,MAAA,EAAQ,MAAM,CAAC;AAI1C,IAAM,wBAAwBA,KAAA,CAAE,IAAA,CAAK,CAAC,MAAA,EAAQ,MAAM,CAAC;AAIrD,IAAM,oBAAoBA,KAAA,CAAE,IAAA,CAAK,CAAC,MAAA,EAAQ,MAAA,EAAQ,MAAM,CAAC;AAIzD,IAAM,kBAAA,GAAqBA,MAAE,IAAA,CAAK,CAAC,QAAQ,QAAA,EAAU,UAAA,EAAY,YAAY,CAAC;AAI9E,IAAM,uBAAuBA,KAAA,CAAE,IAAA,CAAK,CAAC,SAAA,EAAW,SAAS,CAAC","file":"common.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"]}
package/dist/common.d.cts CHANGED
@@ -60,13 +60,13 @@ declare const metadataSchema: z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString,
60
60
  /** Environment mode carried on every mode-scoped resource. */
61
61
  declare const modeSchema: z.ZodEnum<["test", "live"]>;
62
62
  type Mode = z.infer<typeof modeSchema>;
63
- /** Payment token enum — mirrors `@strimz/shared-config`. */
63
+ /** Payment token enum. */
64
64
  declare const paymentCurrencySchema: z.ZodEnum<["USDC", "EURC"]>;
65
65
  type PaymentCurrency = z.infer<typeof paymentCurrencySchema>;
66
66
  /** Every display-level currency (payment + treasury). */
67
67
  declare const tokenSymbolSchema: z.ZodEnum<["USDC", "EURC", "USYC"]>;
68
68
  type TokenSymbol = z.infer<typeof tokenSymbolSchema>;
69
- /** Merchant tier enum — mirrors `@strimz/shared-config`. */
69
+ /** Merchant tier enum. */
70
70
  declare const merchantTierSchema: z.ZodEnum<["free", "growth", "business", "enterprise"]>;
71
71
  type MerchantTier = z.infer<typeof merchantTierSchema>;
72
72
  /** Arc environment enum. */
package/dist/common.d.ts CHANGED
@@ -60,13 +60,13 @@ declare const metadataSchema: z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString,
60
60
  /** Environment mode carried on every mode-scoped resource. */
61
61
  declare const modeSchema: z.ZodEnum<["test", "live"]>;
62
62
  type Mode = z.infer<typeof modeSchema>;
63
- /** Payment token enum — mirrors `@strimz/shared-config`. */
63
+ /** Payment token enum. */
64
64
  declare const paymentCurrencySchema: z.ZodEnum<["USDC", "EURC"]>;
65
65
  type PaymentCurrency = z.infer<typeof paymentCurrencySchema>;
66
66
  /** Every display-level currency (payment + treasury). */
67
67
  declare const tokenSymbolSchema: z.ZodEnum<["USDC", "EURC", "USYC"]>;
68
68
  type TokenSymbol = z.infer<typeof tokenSymbolSchema>;
69
- /** Merchant tier enum — mirrors `@strimz/shared-config`. */
69
+ /** Merchant tier enum. */
70
70
  declare const merchantTierSchema: z.ZodEnum<["free", "growth", "business", "enterprise"]>;
71
71
  type MerchantTier = z.infer<typeof merchantTierSchema>;
72
72
  /** Arc environment enum. */
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.ts"],"names":[],"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;AAG3C,IAAM,gBAAA,GAAmB,CAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa;AAG5B,IAAM,kBAAkB,CAAA,CAC5B,MAAA,EAAO,CACP,KAAA,CAAM,uBAAuB,6DAA6D;AAGtF,IAAM,WAAA,GAAc,CAAA,CAAE,MAAA,EA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AA,KAC1D,CAAA,CAAE,MAAA,CAAO;AAAA,EACP,IAAA,EAAM,CAAA,CAAE,KAAA,CAAM,IAAI,CAAA;AAAA,EAClB,UAAA,EAAY,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAChC,OAAA,EAAS,EAAE,OAAA;AACb,CAAC;AAGI,IAAM,iBAAiB,CAAA,CAC3B,MAAA;AAAA,EACC,EAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA,CAAE,IAAI,EAAE,CAAA;AAAA,EACxB,EAAE,KAAA,CAAM,CAAC,EAAE,MAAA,EAAO,CAAE,IAAI,GAAG,CAAA,EAAG,CAAA,CAAE,MAAA,IAAU,CAAA,CAAE,OAAA,IAAW,CAAA,CAAE,IAAA,EAAM,CAAC;AAClE,CAAA,CACC,MAAA,CAAO,CAAC,CAAA,KAAM,MAAA,CAAO,IAAA,CAAK,CAAC,CAAA,CAAE,MAAA,IAAU,EAAA,EAAI,0BAA0B,CAAA,CACrE,OAAA,CAAQ,EAAE;AAGN,IAAM,aAAa,CAAA,CAAE,IAAA,CAAK,CAAC,MAAA,EAAQ,MAAM,CAAC;AAI1C,IAAM,wBAAwB,CAAA,CAAE,IAAA,CAAK,CAAC,MAAA,EAAQ,MAAM,CAAC;AAIrD,IAAM,oBAAoB,CAAA,CAAE,IAAA,CAAK,CAAC,MAAA,EAAQ,MAAA,EAAQ,MAAM,CAAC;AAIzD,IAAM,kBAAA,GAAqB,EAAE,IAAA,CAAK,CAAC,QAAQ,QAAA,EAAU,UAAA,EAAY,YAAY,CAAC;AAI9E,IAAM,uBAAuB,CAAA,CAAE,IAAA,CAAK,CAAC,SAAA,EAAW,SAAS,CAAC","file":"common.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 — mirrors `@strimz/shared-config`. */\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 — mirrors `@strimz/shared-config`. */\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"]}
1
+ {"version":3,"sources":["../src/common.ts"],"names":[],"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;AAG3C,IAAM,gBAAA,GAAmB,CAAA,CAC7B,M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,CAAA,CAAE,IAAA,CAAK,CAAC,SAAA,EAAW,SAAS,CAAC","file":"common.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"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src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AA,EAAW,SAAA,EAAW,OAAO,CAAC;AAG9E,IAAM,gCAAA,GAAmCA,MAAE,IAAA,CAAK;AAAA,EACrD,qBAAA;AAAA,EACA,gBAAA;AAAA,EACA,mBAAA;AAAA,EACA;AACF,CAAC;AAGM,IAAM,mBAAA,GAAsBA,MAAE,MAAA,CAAO;AAAA,EAC1C,EAAA,EAAI,QAAA;AAAA,EACJ,aAAA,EAAe,gBAAA;AAAA,EACf,QAAA,EAAU,wBAAA;AAAA,EACV,MAAA,EAAQ,sBAAA;AAAA,EACR,SAAA,EAAWA,KAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA,CAAE,QAAA,EAAS;AAAA,EAC/C,KAAA,EAAOA,KAAAA,CAAE,KAAA,CAAMA,KAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,GAAG,CAAC,CAAA,CAAE,OAAA,CAAQ,EAAE,CAAA;AAAA,EAC9C,OAAA,EAAS,gCAAA;AAAA,EACT,UAAA,EAAY,SAAS,QAAA,EAAS;AAAA,EAC9B,SAAA,EAAW,SAAS,QAAA,EAAS;AAAA,EAC7B,cAAA,EAAgB,SAAS,QAAA,EAAS;AAAA,EAClC,mBAAmBA,KAAAA,CAAE,MAAA,GAAS,GAAA,CAAI,GAAG,EAAE,QAAA,EAAS;AAAA,EAChD,SAAA,EAAW;AACb,CAAC","file":"compliance.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 — mirrors `@strimz/shared-config`. */\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 — mirrors `@strimz/shared-config`. */\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 * Compliance — sanctions/AML screening log.\n *\n * Every wallet address that interacts with Strimz (merchant payout,\n * subscriber, payer) is screened. Results are logged; provider and score\n * are recorded for later audit.\n */\n\nimport { z } from 'zod'\nimport { evmAddressSchema, idSchema, isoTimestampSchema } from './common.js'\n\nexport const complianceProviderSchema = z.enum(['trm', 'elliptic', 'disabled'])\nexport type ComplianceProvider = z.infer<typeof complianceProviderSchema>\n\nexport const complianceStatusSchema = z.enum(['clear', 'flagged', 'blocked', 'error'])\nexport type ComplianceStatus = z.infer<typeof complianceStatusSchema>\n\nexport const complianceScreeningContextSchema = z.enum([\n 'merchant_onboarding',\n 'payer_checkout',\n 'subscriber_signup',\n 'refund_recipient',\n])\nexport type ComplianceScreeningContext = z.infer<typeof complianceScreeningContextSchema>\n\nexport const complianceLogSchema = z.object({\n id: idSchema,\n walletAddress: evmAddressSchema,\n provider: complianceProviderSchema,\n status: complianceStatusSchema,\n riskScore: z.number().min(0).max(100).nullable(),\n flags: z.array(z.string().max(120)).default([]),\n context: complianceScreeningContextSchema,\n merchantId: idSchema.nullable(),\n sessionId: idSchema.nullable(),\n subscriptionId: idSchema.nullable(),\n providerRequestId: z.string().max(200).nullable(),\n createdAt: isoTimestampSchema,\n})\nexport type ComplianceLog = z.infer<typeof complianceLogSchema>\n"]}
1
+ {"version":3,"sources":["../src/common.ts","../src/compliance.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;AAGlEA,KAAA,CAAE,MAAA,EAAO,CAAE,KAAA,EAAM,CAAE,IAAA,EAAK,CAAE,WAAA,EAAY,CAAE,GAAA,CAAI,GAAG;AAG5CA,KAAA,CAC3B,MAAA,EAAO,CACP,GAAA,EAAI,CACJ,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,UAAA,CAAW,UAAU,CAAA,EAAG;AAAA,EACvC,OAAA,EAAS;AACX,CAAC;AAG0BA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA;AAOPA,KAAA,CAC9B,MAAA,EAAO,CACP,MAAM,UAAA,EAAY,iDAAiD,CAAA,C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AAA,CAAI,GAAG,EAAE,QAAA,EAAS;AAAA,EAChD,SAAA,EAAW;AACb,CAAC","file":"compliance.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 * Compliance: sanctions/AML screening log.\n *\n * Every wallet address that interacts with Strimz (merchant payout,\n * subscriber, payer) is screened. Results are logged; provider and score\n * are recorded for later audit.\n */\n\nimport { z } from 'zod'\nimport { evmAddressSchema, idSchema, isoTimestampSchema } from './common.js'\n\nexport const complianceProviderSchema = z.enum(['trm', 'elliptic', 'disabled'])\nexport type ComplianceProvider = z.infer<typeof complianceProviderSchema>\n\nexport const complianceStatusSchema = z.enum(['clear', 'flagged', 'blocked', 'error'])\nexport type ComplianceStatus = z.infer<typeof complianceStatusSchema>\n\nexport const complianceScreeningContextSchema = z.enum([\n 'merchant_onboarding',\n 'payer_checkout',\n 'subscriber_signup',\n 'refund_recipient',\n])\nexport type ComplianceScreeningContext = z.infer<typeof complianceScreeningContextSchema>\n\nexport const complianceLogSchema = z.object({\n id: idSchema,\n walletAddress: evmAddressSchema,\n provider: complianceProviderSchema,\n status: complianceStatusSchema,\n riskScore: z.number().min(0).max(100).nullable(),\n flags: z.array(z.string().max(120)).default([]),\n context: complianceScreeningContextSchema,\n merchantId: idSchema.nullable(),\n sessionId: idSchema.nullable(),\n subscriptionId: idSchema.nullable(),\n providerRequestId: z.string().max(200).nullable(),\n createdAt: isoTimestampSchema,\n})\nexport type ComplianceLog = z.infer<typeof complianceLogSchema>\n"]}
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  /**
4
- * Compliance — sanctions/AML screening log.
4
+ * Compliance: sanctions/AML screening log.
5
5
  *
6
6
  * Every wallet address that interacts with Strimz (merchant payout,
7
7
  * subscriber, payer) is screened. Results are logged; provider and score
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  /**
4
- * Compliance — sanctions/AML screening log.
4
+ * Compliance: sanctions/AML screening log.
5
5
  *
6
6
  * Every wallet address that interacts with Strimz (merchant payout,
7
7
  * subscriber, payer) is screened. Results are logged; provider and score
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.ts","../src/compliance.ts"],"names":["z"],"mappings":";;;AAQ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AAA,CAAK;AAAA,EACrD,qBAAA;AAAA,EACA,gBAAA;AAAA,EACA,mBAAA;AAAA,EACA;AACF,CAAC;AAGM,IAAM,mBAAA,GAAsBA,EAAE,MAAA,CAAO;AAAA,EAC1C,EAAA,EAAI,QAAA;AAAA,EACJ,aAAA,EAAe,gBAAA;AAAA,EACf,QAAA,EAAU,wBAAA;AAAA,EACV,MAAA,EAAQ,sBAAA;AAAA,EACR,SAAA,EAAWA,CAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA,CAAE,QAAA,EAAS;AAAA,EAC/C,KAAA,EAAOA,CAAAA,CAAE,KAAA,CAAMA,CAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,GAAG,CAAC,CAAA,CAAE,OAAA,CAAQ,EAAE,CAAA;AAAA,EAC9C,OAAA,EAAS,gCAAA;AAAA,EACT,UAAA,EAAY,SAAS,QAAA,EAAS;AAAA,EAC9B,SAAA,EAAW,SAAS,QAAA,EAAS;AAAA,EAC7B,cAAA,EAAgB,SAAS,QAAA,EAAS;AAAA,EAClC,mBAAmBA,CAAAA,CAAE,MAAA,GAAS,GAAA,CAAI,GAAG,EAAE,QAAA,EAAS;AAAA,EAChD,SAAA,EAAW;AACb,CAAC","file":"compliance.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 — mirrors `@strimz/shared-config`. */\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 — mirrors `@strimz/shared-config`. */\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 * Compliance — sanctions/AML screening log.\n *\n * Every wallet address that interacts with Strimz (merchant payout,\n * subscriber, payer) is screened. Results are logged; provider and score\n * are recorded for later audit.\n */\n\nimport { z } from 'zod'\nimport { evmAddressSchema, idSchema, isoTimestampSchema } from './common.js'\n\nexport const complianceProviderSchema = z.enum(['trm', 'elliptic', 'disabled'])\nexport type ComplianceProvider = z.infer<typeof complianceProviderSchema>\n\nexport const complianceStatusSchema = z.enum(['clear', 'flagged', 'blocked', 'error'])\nexport type ComplianceStatus = z.infer<typeof complianceStatusSchema>\n\nexport const complianceScreeningContextSchema = z.enum([\n 'merchant_onboarding',\n 'payer_checkout',\n 'subscriber_signup',\n 'refund_recipient',\n])\nexport type ComplianceScreeningContext = z.infer<typeof complianceScreeningContextSchema>\n\nexport const complianceLogSchema = z.object({\n id: idSchema,\n walletAddress: evmAddressSchema,\n provider: complianceProviderSchema,\n status: complianceStatusSchema,\n riskScore: z.number().min(0).max(100).nullable(),\n flags: z.array(z.string().max(120)).default([]),\n context: complianceScreeningContextSchema,\n merchantId: idSchema.nullable(),\n sessionId: idSchema.nullable(),\n subscriptionId: idSchema.nullable(),\n providerRequestId: z.string().max(200).nullable(),\n createdAt: isoTimestampSchema,\n})\nexport type ComplianceLog = z.infer<typeof complianceLogSchema>\n"]}
1
+ {"version":3,"sources":["../src/common.ts","../src/compliance.ts"],"names":["z"],"mappings":";;;AAQO,IAAM,QAAA,GAAW,CAAA,CACrB,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,EAAE,CAAA,CACN,KAAA,CAAM,kBAAA,EAAoB,qBAAqB,CAAA;AAG3C,IAAM,gBAAA,GAAmB,CAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;AAGJ,CAAA,CAC5B,MAAA,EAAO,CACP,KAAA,CAAM,uBAAuB,6DAA6D;AAGlE,CAAA,CAAE,MAAA,EAAO,CAAE,KAAA,EAAM,CAAE,IAAA,EAAK,CAAE,WAAA,EAAY,CAAE,GAAA,CAAI,GAAG;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;AAOP,CAAA,CAC9B,MAAA,EAAO,CACP,MAAM,UAAA,EAAY,iDAAiD,CAAA,CACnE,MAAA,CAAO,CAAC,CAAA,KAAM,MAAA,CAAO,CAAC,CAAA,IAAK,IAAI,cAAc;AAGt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ive 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 * Compliance: sanctions/AML screening log.\n *\n * Every wallet address that interacts with Strimz (merchant payout,\n * subscriber, payer) is screened. Results are logged; provider and score\n * are recorded for later audit.\n */\n\nimport { z } from 'zod'\nimport { evmAddressSchema, idSchema, isoTimestampSchema } from './common.js'\n\nexport const complianceProviderSchema = z.enum(['trm', 'elliptic', 'disabled'])\nexport type ComplianceProvider = z.infer<typeof complianceProviderSchema>\n\nexport const complianceStatusSchema = z.enum(['clear', 'flagged', 'blocked', 'error'])\nexport type ComplianceStatus = z.infer<typeof complianceStatusSchema>\n\nexport const complianceScreeningContextSchema = z.enum([\n 'merchant_onboarding',\n 'payer_checkout',\n 'subscriber_signup',\n 'refund_recipient',\n])\nexport type ComplianceScreeningContext = z.infer<typeof complianceScreeningContextSchema>\n\nexport const complianceLogSchema = z.object({\n id: idSchema,\n walletAddress: evmAddressSchema,\n provider: complianceProviderSchema,\n status: complianceStatusSchema,\n riskScore: z.number().min(0).max(100).nullable(),\n flags: z.array(z.string().max(120)).default([]),\n context: complianceScreeningContextSchema,\n merchantId: idSchema.nullable(),\n sessionId: idSchema.nullable(),\n subscriptionId: idSchema.nullable(),\n providerRequestId: z.string().max(200).nullable(),\n createdAt: isoTimestampSchema,\n})\nexport type ComplianceLog = z.infer<typeof complianceLogSchema>\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.ts","../src/customers.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,WAA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KAAA,EAAO,YAAY,QAAA,EAAS;AAAA,EAC5B,WAAA,EAAaA,KAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA,CAAE,QAAA,EAAS;AAAA,EACjD,WAAA,EAAaA,KAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA,CAAE,QAAA,EAAS;AAAA,EACjD,QAAA,EAAU,eAAe,QAAA;AAC3B,CAAC","file":"customers.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 — mirrors `@strimz/shared-config`. */\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 — mirrors `@strimz/shared-config`. */\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 * Customer — the payer on the merchant's side.\n *\n * Customers are uniquely identified by (merchantId, walletAddress). Email and\n * externalRef are optional; merchants can associate their own customer id.\n */\n\nimport { z } from 'zod'\nimport {\n emailSchema,\n evmAddressSchema,\n idSchema,\n isoTimestampSchema,\n metadataSchema,\n} from './common.js'\n\nexport const customerSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n walletAddress: evmAddressSchema,\n email: emailSchema.nullable(),\n /** Merchant-provided external identifier (e.g. their own user id). */\n externalRef: z.string().min(1).max(120).nullable(),\n displayName: z.string().min(1).max(120).nullable(),\n metadata: metadataSchema,\n firstSeenAt: isoTimestampSchema,\n lastSeenAt: isoTimestampSchema,\n})\nexport type Customer = z.infer<typeof customerSchema>\n\n// ---------- DTOs ----------\n\nexport const upsertCustomerInputSchema = z.object({\n walletAddress: evmAddressSchema,\n email: emailSchema.optional(),\n externalRef: z.string().min(1).max(120).optional(),\n displayName: z.string().min(1).max(120).optional(),\n metadata: metadataSchema.optional(),\n})\nexport type UpsertCustomerInput = z.infer<typeof upsertCustomerInputSchema>\n"]}
1
+ {"version":3,"sources":["../src/common.ts","../src/customers.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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AAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA,CAAE,QAAA,EAAS;AAAA,EACjD,QAAA,EAAU,cAAA;AAAA,EACV,WAAA,EAAa,kBAAA;AAAA,EACb,UAAA,EAAY;AACd,CAAC;AAKM,IAAM,yBAAA,GAA4BA,MAAE,MAAA,CAAO;AAAA,EAChD,aAAA,EAAe,gBAAA;AAAA,EACf,KAAA,EAAO,YAAY,QAAA,EAAS;AAAA,EAC5B,WAAA,EAAaA,KAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA,CAAE,QAAA,EAAS;AAAA,EACjD,WAAA,EAAaA,KAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA,CAAE,QAAA,EAAS;AAAA,EACjD,QAAA,EAAU,eAAe,QAAA;AAC3B,CAAC","file":"customers.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 * Customer. The payer on the merchant's side.\n *\n * Customers are uniquely identified by (merchantId, walletAddress). Email and\n * externalRef are optional; merchants can associate their own customer id.\n */\n\nimport { z } from 'zod'\nimport {\n emailSchema,\n evmAddressSchema,\n idSchema,\n isoTimestampSchema,\n metadataSchema,\n} from './common.js'\n\nexport const customerSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n walletAddress: evmAddressSchema,\n email: emailSchema.nullable(),\n /** Merchant-provided external identifier (e.g. their own user id). */\n externalRef: z.string().min(1).max(120).nullable(),\n displayName: z.string().min(1).max(120).nullable(),\n metadata: metadataSchema,\n firstSeenAt: isoTimestampSchema,\n lastSeenAt: isoTimestampSchema,\n})\nexport type Customer = z.infer<typeof customerSchema>\n\n// ---------- DTOs ----------\n\nexport const upsertCustomerInputSchema = z.object({\n walletAddress: evmAddressSchema,\n email: emailSchema.optional(),\n externalRef: z.string().min(1).max(120).optional(),\n displayName: z.string().min(1).max(120).optional(),\n metadata: metadataSchema.optional(),\n})\nexport type UpsertCustomerInput = z.infer<typeof upsertCustomerInputSchema>\n"]}
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  /**
4
- * Customer — the payer on the merchant's side.
4
+ * Customer. The payer on the merchant's side.
5
5
  *
6
6
  * Customers are uniquely identified by (merchantId, walletAddress). Email and
7
7
  * externalRef are optional; merchants can associate their own customer id.
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  /**
4
- * Customer — the payer on the merchant's side.
4
+ * Customer. The payer on the merchant's side.
5
5
  *
6
6
  * Customers are uniquely identified by (merchantId, walletAddress). Email and
7
7
  * externalRef are optional; merchants can associate their own customer id.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.ts","../src/customers.ts"],"names":["z"],"mappings":";;;AAQO,IAAM,QAAA,GAAW,CAAA,CACrB,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,EAAE,CAAA,CACN,KAAA,CAAM,kBAAA,EAAoB,qBAAqB,CAAA;AAG3C,IAAM,gBAAA,GAAmB,CAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;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;AAOP,CAAA,CAC9B,MAAA,EAAO,CACP,MAAM,UAAA,EAAY,iDAAiD,CAAA,CACnE,MAAA,CAAO,CAAC,CAAA,KAAM,MAAA,CAAO,CAAC,CAAA,IA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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 — mirrors `@strimz/shared-config`. */\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 — mirrors `@strimz/shared-config`. */\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 * Customer — the payer on the merchant's side.\n *\n * Customers are uniquely identified by (merchantId, walletAddress). Email and\n * externalRef are optional; merchants can associate their own customer id.\n */\n\nimport { z } from 'zod'\nimport {\n emailSchema,\n evmAddressSchema,\n idSchema,\n isoTimestampSchema,\n metadataSchema,\n} from './common.js'\n\nexport const customerSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n walletAddress: evmAddressSchema,\n email: emailSchema.nullable(),\n /** Merchant-provided external identifier (e.g. their own user id). */\n externalRef: z.string().min(1).max(120).nullable(),\n displayName: z.string().min(1).max(120).nullable(),\n metadata: metadataSchema,\n firstSeenAt: isoTimestampSchema,\n lastSeenAt: isoTimestampSchema,\n})\nexport type Customer = z.infer<typeof customerSchema>\n\n// ---------- DTOs ----------\n\nexport const upsertCustomerInputSchema = z.object({\n walletAddress: evmAddressSchema,\n email: emailSchema.optional(),\n externalRef: z.string().min(1).max(120).optional(),\n displayName: z.string().min(1).max(120).optional(),\n metadata: metadataSchema.optional(),\n})\nexport type UpsertCustomerInput = z.infer<typeof upsertCustomerInputSchema>\n"]}
1
+ {"version":3,"sources":["../src/common.ts","../src/customers.ts"],"names":["z"],"mappings":";;;AAQO,IAAM,QAAA,GAAW,CAAA,CACrB,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,EAAE,CAAA,CACN,KAAA,CAAM,kBAAA,EAAoB,qBAAqB,CAAA;AAG3C,IAAM,gBAAA,GAAmB,CAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;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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jD,WAAA,EAAaA,CAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,GAAG,CAAA,CAAE,QAAA,EAAS;AAAA,EACjD,QAAA,EAAU,eAAe,QAAA;AAC3B,CAAC","file":"customers.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 * Customer. The payer on the merchant's side.\n *\n * Customers are uniquely identified by (merchantId, walletAddress). Email and\n * externalRef are optional; merchants can associate their own customer id.\n */\n\nimport { z } from 'zod'\nimport {\n emailSchema,\n evmAddressSchema,\n idSchema,\n isoTimestampSchema,\n metadataSchema,\n} from './common.js'\n\nexport const customerSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n walletAddress: evmAddressSchema,\n email: emailSchema.nullable(),\n /** Merchant-provided external identifier (e.g. their own user id). */\n externalRef: z.string().min(1).max(120).nullable(),\n displayName: z.string().min(1).max(120).nullable(),\n metadata: metadataSchema,\n firstSeenAt: isoTimestampSchema,\n lastSeenAt: isoTimestampSchema,\n})\nexport type Customer = z.infer<typeof customerSchema>\n\n// ---------- DTOs ----------\n\nexport const upsertCustomerInputSchema = z.object({\n walletAddress: evmAddressSchema,\n email: emailSchema.optional(),\n externalRef: z.string().min(1).max(120).optional(),\n displayName: z.string().min(1).max(120).optional(),\n metadata: metadataSchema.optional(),\n})\nexport type UpsertCustomerInput = z.infer<typeof upsertCustomerInputSchema>\n"]}