@strimz/shared-types 0.1.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 (109) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +69 -0
  3. package/dist/agents.cjs +148 -0
  4. package/dist/agents.cjs.map +1 -0
  5. package/dist/agents.d.cts +317 -0
  6. package/dist/agents.d.ts +317 -0
  7. package/dist/agents.js +137 -0
  8. package/dist/agents.js.map +1 -0
  9. package/dist/api-keys.cjs +91 -0
  10. package/dist/api-keys.cjs.map +1 -0
  11. package/dist/api-keys.d.cts +155 -0
  12. package/dist/api-keys.d.ts +155 -0
  13. package/dist/api-keys.js +84 -0
  14. package/dist/api-keys.js.map +1 -0
  15. package/dist/common.cjs +56 -0
  16. package/dist/common.cjs.map +1 -0
  17. package/dist/common.d.cts +82 -0
  18. package/dist/common.d.ts +82 -0
  19. package/dist/common.js +37 -0
  20. package/dist/common.js.map +1 -0
  21. package/dist/compliance.cjs +61 -0
  22. package/dist/compliance.cjs.map +1 -0
  23. package/dist/compliance.d.cts +59 -0
  24. package/dist/compliance.d.ts +59 -0
  25. package/dist/compliance.js +56 -0
  26. package/dist/compliance.js.map +1 -0
  27. package/dist/customers.cjs +56 -0
  28. package/dist/customers.cjs.map +1 -0
  29. package/dist/customers.d.cts +64 -0
  30. package/dist/customers.d.ts +64 -0
  31. package/dist/customers.js +53 -0
  32. package/dist/customers.js.map +1 -0
  33. package/dist/events.cjs +675 -0
  34. package/dist/events.cjs.map +1 -0
  35. package/dist/events.d.cts +7907 -0
  36. package/dist/events.d.ts +7907 -0
  37. package/dist/events.js +650 -0
  38. package/dist/events.js.map +1 -0
  39. package/dist/index.cjs +976 -0
  40. package/dist/index.cjs.map +1 -0
  41. package/dist/index.d.cts +113 -0
  42. package/dist/index.d.ts +113 -0
  43. package/dist/index.js +858 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/invoices.cjs +72 -0
  46. package/dist/invoices.cjs.map +1 -0
  47. package/dist/invoices.d.cts +159 -0
  48. package/dist/invoices.d.ts +159 -0
  49. package/dist/invoices.js +67 -0
  50. package/dist/invoices.js.map +1 -0
  51. package/dist/merchants.cjs +104 -0
  52. package/dist/merchants.cjs.map +1 -0
  53. package/dist/merchants.d.cts +259 -0
  54. package/dist/merchants.d.ts +259 -0
  55. package/dist/merchants.js +93 -0
  56. package/dist/merchants.js.map +1 -0
  57. package/dist/payment-sessions.cjs +125 -0
  58. package/dist/payment-sessions.cjs.map +1 -0
  59. package/dist/payment-sessions.d.cts +180 -0
  60. package/dist/payment-sessions.d.ts +180 -0
  61. package/dist/payment-sessions.js +120 -0
  62. package/dist/payment-sessions.js.map +1 -0
  63. package/dist/refunds.cjs +81 -0
  64. package/dist/refunds.cjs.map +1 -0
  65. package/dist/refunds.d.cts +91 -0
  66. package/dist/refunds.d.ts +91 -0
  67. package/dist/refunds.js +75 -0
  68. package/dist/refunds.js.map +1 -0
  69. package/dist/storefronts.cjs +223 -0
  70. package/dist/storefronts.cjs.map +1 -0
  71. package/dist/storefronts.d.cts +177 -0
  72. package/dist/storefronts.d.ts +177 -0
  73. package/dist/storefronts.js +216 -0
  74. package/dist/storefronts.js.map +1 -0
  75. package/dist/subscriptions.cjs +175 -0
  76. package/dist/subscriptions.cjs.map +1 -0
  77. package/dist/subscriptions.d.cts +290 -0
  78. package/dist/subscriptions.d.ts +290 -0
  79. package/dist/subscriptions.js +163 -0
  80. package/dist/subscriptions.js.map +1 -0
  81. package/dist/transactions.cjs +67 -0
  82. package/dist/transactions.cjs.map +1 -0
  83. package/dist/transactions.d.cts +78 -0
  84. package/dist/transactions.d.ts +78 -0
  85. package/dist/transactions.js +63 -0
  86. package/dist/transactions.js.map +1 -0
  87. package/dist/webhooks.cjs +116 -0
  88. package/dist/webhooks.cjs.map +1 -0
  89. package/dist/webhooks.d.cts +201 -0
  90. package/dist/webhooks.d.ts +201 -0
  91. package/dist/webhooks.js +107 -0
  92. package/dist/webhooks.js.map +1 -0
  93. package/package.json +134 -0
  94. package/src/agents.ts +149 -0
  95. package/src/api-keys.ts +78 -0
  96. package/src/common.ts +113 -0
  97. package/src/compliance.ts +40 -0
  98. package/src/customers.ts +40 -0
  99. package/src/events.ts +176 -0
  100. package/src/index.ts +23 -0
  101. package/src/invoices.ts +53 -0
  102. package/src/merchants.ts +104 -0
  103. package/src/payment-sessions.ts +131 -0
  104. package/src/refunds.ts +68 -0
  105. package/src/storefronts.ts +89 -0
  106. package/src/subscriptions.ts +180 -0
  107. package/src/tokens.ts +60 -0
  108. package/src/transactions.ts +52 -0
  109. package/src/webhooks.ts +109 -0
@@ -0,0 +1,82 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Primitive schemas shared across every entity.
5
+ * Every higher-level schema builds on these so validation is consistent.
6
+ */
7
+
8
+ /** CUID2 or UUID-style opaque identifier. */
9
+ declare const idSchema: z.ZodString;
10
+ /** EVM address. Hex-encoded, 0x-prefixed, 20 bytes. Normalised to lowercase. */
11
+ declare const evmAddressSchema: z.ZodEffects<z.ZodString, string, string>;
12
+ /** EVM transaction hash. 32-byte hex. */
13
+ declare const evmTxHashSchema: z.ZodString;
14
+ /** Email address, trimmed and lower-cased. */
15
+ declare const emailSchema: z.ZodString;
16
+ /** HTTPS URL. No http:// allowed outside dev. */
17
+ declare const httpsUrlSchema: z.ZodEffects<z.ZodString, string, string>;
18
+ /** URL permitting http and https (dev + prod). */
19
+ declare const httpUrlSchema: z.ZodString;
20
+ /**
21
+ * Amount expressed in the token's smallest unit, serialised as a string to
22
+ * preserve precision beyond `Number.MAX_SAFE_INTEGER`. For USDC (6 decimals),
23
+ * 1 USDC is the string "1000000".
24
+ */
25
+ declare const tokenAmountSchema: z.ZodEffects<z.ZodString, string, string>;
26
+ /** Unsigned integer up to 2^53 - 1; validated and returned as number. */
27
+ declare const uintSchema: z.ZodNumber;
28
+ /** ISO-8601 timestamp string (`.toISOString()`-compatible). */
29
+ declare const isoTimestampSchema: z.ZodString;
30
+ /** Two-letter ISO-3166 country code. */
31
+ declare const countryCodeSchema: z.ZodString;
32
+ /** Pagination inputs used by every list endpoint. */
33
+ declare const paginationInputSchema: z.ZodObject<{
34
+ limit: z.ZodDefault<z.ZodNumber>;
35
+ cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
36
+ }, "strip", z.ZodTypeAny, {
37
+ limit: number;
38
+ cursor?: string | null | undefined;
39
+ }, {
40
+ limit?: number | undefined;
41
+ cursor?: string | null | undefined;
42
+ }>;
43
+ type PaginationInput = z.infer<typeof paginationInputSchema>;
44
+ /** Pagination envelope used by every list response. */
45
+ declare const makePaginatedSchema: <T extends z.ZodTypeAny>(item: T) => z.ZodObject<{
46
+ data: z.ZodArray<T, "many">;
47
+ nextCursor: z.ZodNullable<z.ZodString>;
48
+ hasMore: z.ZodBoolean;
49
+ }, "strip", z.ZodTypeAny, {
50
+ data: T["_output"][];
51
+ nextCursor: string | null;
52
+ hasMore: boolean;
53
+ }, {
54
+ data: T["_input"][];
55
+ nextCursor: string | null;
56
+ hasMore: boolean;
57
+ }>;
58
+ /** Free-form metadata bag the API round-trips for merchants. */
59
+ declare const metadataSchema: z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>;
60
+ /** Environment mode carried on every mode-scoped resource. */
61
+ declare const modeSchema: z.ZodEnum<["test", "live"]>;
62
+ type Mode = z.infer<typeof modeSchema>;
63
+ /** Payment token enum — mirrors `@strimz/shared-config`. */
64
+ declare const paymentCurrencySchema: z.ZodEnum<["USDC", "EURC"]>;
65
+ type PaymentCurrency = z.infer<typeof paymentCurrencySchema>;
66
+ /** Every display-level currency (payment + treasury). */
67
+ declare const tokenSymbolSchema: z.ZodEnum<["USDC", "EURC", "USYC"]>;
68
+ type TokenSymbol = z.infer<typeof tokenSymbolSchema>;
69
+ /** Merchant tier enum — mirrors `@strimz/shared-config`. */
70
+ declare const merchantTierSchema: z.ZodEnum<["free", "growth", "business", "enterprise"]>;
71
+ type MerchantTier = z.infer<typeof merchantTierSchema>;
72
+ /** Arc environment enum. */
73
+ declare const arcEnvironmentSchema: z.ZodEnum<["testnet", "mainnet"]>;
74
+ type ArcEnvironment = z.infer<typeof arcEnvironmentSchema>;
75
+ type Id = z.infer<typeof idSchema>;
76
+ type EvmAddress = z.infer<typeof evmAddressSchema>;
77
+ type EvmTxHash = z.infer<typeof evmTxHashSchema>;
78
+ type TokenAmount = z.infer<typeof tokenAmountSchema>;
79
+ type IsoTimestamp = z.infer<typeof isoTimestampSchema>;
80
+ type Metadata = z.infer<typeof metadataSchema>;
81
+
82
+ export { type ArcEnvironment, type EvmAddress, type EvmTxHash, type Id, type IsoTimestamp, type MerchantTier, type Metadata, type Mode, type PaginationInput, type PaymentCurrency, type TokenAmount, type TokenSymbol, arcEnvironmentSchema, countryCodeSchema, emailSchema, evmAddressSchema, evmTxHashSchema, httpUrlSchema, httpsUrlSchema, idSchema, isoTimestampSchema, makePaginatedSchema, merchantTierSchema, metadataSchema, modeSchema, paginationInputSchema, paymentCurrencySchema, tokenAmountSchema, tokenSymbolSchema, uintSchema };
package/dist/common.js ADDED
@@ -0,0 +1,37 @@
1
+ import { z } from 'zod';
2
+
3
+ // src/common.ts
4
+ var idSchema = z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/, "id must be URL-safe");
5
+ var evmAddressSchema = z.string().regex(/^0x[a-fA-F0-9]{40}$/, "must be a 0x-prefixed 40-character hex EVM address").transform((v) => v.toLowerCase());
6
+ var evmTxHashSchema = z.string().regex(/^0x[a-fA-F0-9]{64}$/, "must be a 0x-prefixed 64-character hex EVM transaction hash");
7
+ var emailSchema = z.string().email().trim().toLowerCase().max(320);
8
+ var httpsUrlSchema = z.string().url().refine((v) => v.startsWith("https://"), {
9
+ message: "must be an https:// URL"
10
+ });
11
+ var httpUrlSchema = z.string().url();
12
+ var tokenAmountSchema = z.string().regex(/^[0-9]+$/, "must be a non-negative integer string (base-10)").refine((v) => BigInt(v) >= 0n, "must be >= 0");
13
+ var uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
14
+ var isoTimestampSchema = z.string().datetime({ offset: true, message: "must be an ISO-8601 timestamp" });
15
+ var countryCodeSchema = z.string().length(2).regex(/^[A-Z]{2}$/, "must be an ISO-3166 alpha-2 country code");
16
+ var paginationInputSchema = z.object({
17
+ limit: z.number().int().min(1).max(100).default(25),
18
+ cursor: z.string().min(1).max(200).nullish()
19
+ });
20
+ var makePaginatedSchema = (item) => z.object({
21
+ data: z.array(item),
22
+ nextCursor: z.string().nullable(),
23
+ hasMore: z.boolean()
24
+ });
25
+ var metadataSchema = z.record(
26
+ z.string().min(1).max(40),
27
+ z.union([z.string().max(500), z.number(), z.boolean(), z.null()])
28
+ ).refine((m) => Object.keys(m).length <= 50, "at most 50 metadata keys").default({});
29
+ var modeSchema = z.enum(["test", "live"]);
30
+ var paymentCurrencySchema = z.enum(["USDC", "EURC"]);
31
+ var tokenSymbolSchema = z.enum(["USDC", "EURC", "USYC"]);
32
+ var merchantTierSchema = z.enum(["free", "growth", "business", "enterprise"]);
33
+ var arcEnvironmentSchema = z.enum(["testnet", "mainnet"]);
34
+
35
+ export { arcEnvironmentSchema, countryCodeSchema, emailSchema, evmAddressSchema, evmTxHashSchema, httpUrlSchema, httpsUrlSchema, idSchema, isoTimestampSchema, makePaginatedSchema, merchantTierSchema, metadataSchema, modeSchema, paginationInputSchema, paymentCurrencySchema, tokenAmountSchema, tokenSymbolSchema, uintSchema };
36
+ //# sourceMappingURL=common.js.map
37
+ //# sourceMappingURL=common.js.map
@@ -0,0 +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,EAAo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A,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"]}
@@ -0,0 +1,61 @@
1
+ 'use strict';
2
+
3
+ var zod = require('zod');
4
+
5
+ // src/compliance.ts
6
+ var idSchema = zod.z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/, "id must be URL-safe");
7
+ var evmAddressSchema = zod.z.string().regex(/^0x[a-fA-F0-9]{40}$/, "must be a 0x-prefixed 40-character hex EVM address").transform((v) => v.toLowerCase());
8
+ zod.z.string().regex(/^0x[a-fA-F0-9]{64}$/, "must be a 0x-prefixed 64-character hex EVM transaction hash");
9
+ zod.z.string().email().trim().toLowerCase().max(320);
10
+ zod.z.string().url().refine((v) => v.startsWith("https://"), {
11
+ message: "must be an https:// URL"
12
+ });
13
+ zod.z.string().url();
14
+ zod.z.string().regex(/^[0-9]+$/, "must be a non-negative integer string (base-10)").refine((v) => BigInt(v) >= 0n, "must be >= 0");
15
+ zod.z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
16
+ var isoTimestampSchema = zod.z.string().datetime({ offset: true, message: "must be an ISO-8601 timestamp" });
17
+ zod.z.string().length(2).regex(/^[A-Z]{2}$/, "must be an ISO-3166 alpha-2 country code");
18
+ zod.z.object({
19
+ limit: zod.z.number().int().min(1).max(100).default(25),
20
+ cursor: zod.z.string().min(1).max(200).nullish()
21
+ });
22
+ zod.z.record(
23
+ zod.z.string().min(1).max(40),
24
+ zod.z.union([zod.z.string().max(500), zod.z.number(), zod.z.boolean(), zod.z.null()])
25
+ ).refine((m) => Object.keys(m).length <= 50, "at most 50 metadata keys").default({});
26
+ zod.z.enum(["test", "live"]);
27
+ zod.z.enum(["USDC", "EURC"]);
28
+ zod.z.enum(["USDC", "EURC", "USYC"]);
29
+ zod.z.enum(["free", "growth", "business", "enterprise"]);
30
+ zod.z.enum(["testnet", "mainnet"]);
31
+
32
+ // src/compliance.ts
33
+ var complianceProviderSchema = zod.z.enum(["trm", "elliptic", "disabled"]);
34
+ var complianceStatusSchema = zod.z.enum(["clear", "flagged", "blocked", "error"]);
35
+ var complianceScreeningContextSchema = zod.z.enum([
36
+ "merchant_onboarding",
37
+ "payer_checkout",
38
+ "subscriber_signup",
39
+ "refund_recipient"
40
+ ]);
41
+ var complianceLogSchema = zod.z.object({
42
+ id: idSchema,
43
+ walletAddress: evmAddressSchema,
44
+ provider: complianceProviderSchema,
45
+ status: complianceStatusSchema,
46
+ riskScore: zod.z.number().min(0).max(100).nullable(),
47
+ flags: zod.z.array(zod.z.string().max(120)).default([]),
48
+ context: complianceScreeningContextSchema,
49
+ merchantId: idSchema.nullable(),
50
+ sessionId: idSchema.nullable(),
51
+ subscriptionId: idSchema.nullable(),
52
+ providerRequestId: zod.z.string().max(200).nullable(),
53
+ createdAt: isoTimestampSchema
54
+ });
55
+
56
+ exports.complianceLogSchema = complianceLogSchema;
57
+ exports.complianceProviderSchema = complianceProviderSchema;
58
+ exports.complianceScreeningContextSchema = complianceScreeningContextSchema;
59
+ exports.complianceStatusSchema = complianceStatusSchema;
60
+ //# sourceMappingURL=compliance.cjs.map
61
+ //# sourceMappingURL=compliance.cjs.map
@@ -0,0 +1 @@
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,W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AAA,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"]}
@@ -0,0 +1,59 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Compliance — sanctions/AML screening log.
5
+ *
6
+ * Every wallet address that interacts with Strimz (merchant payout,
7
+ * subscriber, payer) is screened. Results are logged; provider and score
8
+ * are recorded for later audit.
9
+ */
10
+
11
+ declare const complianceProviderSchema: z.ZodEnum<["trm", "elliptic", "disabled"]>;
12
+ type ComplianceProvider = z.infer<typeof complianceProviderSchema>;
13
+ declare const complianceStatusSchema: z.ZodEnum<["clear", "flagged", "blocked", "error"]>;
14
+ type ComplianceStatus = z.infer<typeof complianceStatusSchema>;
15
+ declare const complianceScreeningContextSchema: z.ZodEnum<["merchant_onboarding", "payer_checkout", "subscriber_signup", "refund_recipient"]>;
16
+ type ComplianceScreeningContext = z.infer<typeof complianceScreeningContextSchema>;
17
+ declare const complianceLogSchema: z.ZodObject<{
18
+ id: z.ZodString;
19
+ walletAddress: z.ZodEffects<z.ZodString, string, string>;
20
+ provider: z.ZodEnum<["trm", "elliptic", "disabled"]>;
21
+ status: z.ZodEnum<["clear", "flagged", "blocked", "error"]>;
22
+ riskScore: z.ZodNullable<z.ZodNumber>;
23
+ flags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
24
+ context: z.ZodEnum<["merchant_onboarding", "payer_checkout", "subscriber_signup", "refund_recipient"]>;
25
+ merchantId: z.ZodNullable<z.ZodString>;
26
+ sessionId: z.ZodNullable<z.ZodString>;
27
+ subscriptionId: z.ZodNullable<z.ZodString>;
28
+ providerRequestId: z.ZodNullable<z.ZodString>;
29
+ createdAt: z.ZodString;
30
+ }, "strip", z.ZodTypeAny, {
31
+ status: "clear" | "flagged" | "blocked" | "error";
32
+ id: string;
33
+ merchantId: string | null;
34
+ createdAt: string;
35
+ walletAddress: string;
36
+ provider: "trm" | "elliptic" | "disabled";
37
+ riskScore: number | null;
38
+ flags: string[];
39
+ context: "merchant_onboarding" | "payer_checkout" | "subscriber_signup" | "refund_recipient";
40
+ sessionId: string | null;
41
+ subscriptionId: string | null;
42
+ providerRequestId: string | null;
43
+ }, {
44
+ status: "clear" | "flagged" | "blocked" | "error";
45
+ id: string;
46
+ merchantId: string | null;
47
+ createdAt: string;
48
+ walletAddress: string;
49
+ provider: "trm" | "elliptic" | "disabled";
50
+ riskScore: number | null;
51
+ context: "merchant_onboarding" | "payer_checkout" | "subscriber_signup" | "refund_recipient";
52
+ sessionId: string | null;
53
+ subscriptionId: string | null;
54
+ providerRequestId: string | null;
55
+ flags?: string[] | undefined;
56
+ }>;
57
+ type ComplianceLog = z.infer<typeof complianceLogSchema>;
58
+
59
+ export { type ComplianceLog, type ComplianceProvider, type ComplianceScreeningContext, type ComplianceStatus, complianceLogSchema, complianceProviderSchema, complianceScreeningContextSchema, complianceStatusSchema };
@@ -0,0 +1,59 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Compliance — sanctions/AML screening log.
5
+ *
6
+ * Every wallet address that interacts with Strimz (merchant payout,
7
+ * subscriber, payer) is screened. Results are logged; provider and score
8
+ * are recorded for later audit.
9
+ */
10
+
11
+ declare const complianceProviderSchema: z.ZodEnum<["trm", "elliptic", "disabled"]>;
12
+ type ComplianceProvider = z.infer<typeof complianceProviderSchema>;
13
+ declare const complianceStatusSchema: z.ZodEnum<["clear", "flagged", "blocked", "error"]>;
14
+ type ComplianceStatus = z.infer<typeof complianceStatusSchema>;
15
+ declare const complianceScreeningContextSchema: z.ZodEnum<["merchant_onboarding", "payer_checkout", "subscriber_signup", "refund_recipient"]>;
16
+ type ComplianceScreeningContext = z.infer<typeof complianceScreeningContextSchema>;
17
+ declare const complianceLogSchema: z.ZodObject<{
18
+ id: z.ZodString;
19
+ walletAddress: z.ZodEffects<z.ZodString, string, string>;
20
+ provider: z.ZodEnum<["trm", "elliptic", "disabled"]>;
21
+ status: z.ZodEnum<["clear", "flagged", "blocked", "error"]>;
22
+ riskScore: z.ZodNullable<z.ZodNumber>;
23
+ flags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
24
+ context: z.ZodEnum<["merchant_onboarding", "payer_checkout", "subscriber_signup", "refund_recipient"]>;
25
+ merchantId: z.ZodNullable<z.ZodString>;
26
+ sessionId: z.ZodNullable<z.ZodString>;
27
+ subscriptionId: z.ZodNullable<z.ZodString>;
28
+ providerRequestId: z.ZodNullable<z.ZodString>;
29
+ createdAt: z.ZodString;
30
+ }, "strip", z.ZodTypeAny, {
31
+ status: "clear" | "flagged" | "blocked" | "error";
32
+ id: string;
33
+ merchantId: string | null;
34
+ createdAt: string;
35
+ walletAddress: string;
36
+ provider: "trm" | "elliptic" | "disabled";
37
+ riskScore: number | null;
38
+ flags: string[];
39
+ context: "merchant_onboarding" | "payer_checkout" | "subscriber_signup" | "refund_recipient";
40
+ sessionId: string | null;
41
+ subscriptionId: string | null;
42
+ providerRequestId: string | null;
43
+ }, {
44
+ status: "clear" | "flagged" | "blocked" | "error";
45
+ id: string;
46
+ merchantId: string | null;
47
+ createdAt: string;
48
+ walletAddress: string;
49
+ provider: "trm" | "elliptic" | "disabled";
50
+ riskScore: number | null;
51
+ context: "merchant_onboarding" | "payer_checkout" | "subscriber_signup" | "refund_recipient";
52
+ sessionId: string | null;
53
+ subscriptionId: string | null;
54
+ providerRequestId: string | null;
55
+ flags?: string[] | undefined;
56
+ }>;
57
+ type ComplianceLog = z.infer<typeof complianceLogSchema>;
58
+
59
+ export { type ComplianceLog, type ComplianceProvider, type ComplianceScreeningContext, type ComplianceStatus, complianceLogSchema, complianceProviderSchema, complianceScreeningContextSchema, complianceStatusSchema };
@@ -0,0 +1,56 @@
1
+ import { z } from 'zod';
2
+
3
+ // src/compliance.ts
4
+ var idSchema = z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/, "id must be URL-safe");
5
+ var evmAddressSchema = z.string().regex(/^0x[a-fA-F0-9]{40}$/, "must be a 0x-prefixed 40-character hex EVM address").transform((v) => v.toLowerCase());
6
+ z.string().regex(/^0x[a-fA-F0-9]{64}$/, "must be a 0x-prefixed 64-character hex EVM transaction hash");
7
+ z.string().email().trim().toLowerCase().max(320);
8
+ z.string().url().refine((v) => v.startsWith("https://"), {
9
+ message: "must be an https:// URL"
10
+ });
11
+ z.string().url();
12
+ z.string().regex(/^[0-9]+$/, "must be a non-negative integer string (base-10)").refine((v) => BigInt(v) >= 0n, "must be >= 0");
13
+ z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
14
+ var isoTimestampSchema = z.string().datetime({ offset: true, message: "must be an ISO-8601 timestamp" });
15
+ z.string().length(2).regex(/^[A-Z]{2}$/, "must be an ISO-3166 alpha-2 country code");
16
+ z.object({
17
+ limit: z.number().int().min(1).max(100).default(25),
18
+ cursor: z.string().min(1).max(200).nullish()
19
+ });
20
+ z.record(
21
+ z.string().min(1).max(40),
22
+ z.union([z.string().max(500), z.number(), z.boolean(), z.null()])
23
+ ).refine((m) => Object.keys(m).length <= 50, "at most 50 metadata keys").default({});
24
+ z.enum(["test", "live"]);
25
+ z.enum(["USDC", "EURC"]);
26
+ z.enum(["USDC", "EURC", "USYC"]);
27
+ z.enum(["free", "growth", "business", "enterprise"]);
28
+ z.enum(["testnet", "mainnet"]);
29
+
30
+ // src/compliance.ts
31
+ var complianceProviderSchema = z.enum(["trm", "elliptic", "disabled"]);
32
+ var complianceStatusSchema = z.enum(["clear", "flagged", "blocked", "error"]);
33
+ var complianceScreeningContextSchema = z.enum([
34
+ "merchant_onboarding",
35
+ "payer_checkout",
36
+ "subscriber_signup",
37
+ "refund_recipient"
38
+ ]);
39
+ var complianceLogSchema = z.object({
40
+ id: idSchema,
41
+ walletAddress: evmAddressSchema,
42
+ provider: complianceProviderSchema,
43
+ status: complianceStatusSchema,
44
+ riskScore: z.number().min(0).max(100).nullable(),
45
+ flags: z.array(z.string().max(120)).default([]),
46
+ context: complianceScreeningContextSchema,
47
+ merchantId: idSchema.nullable(),
48
+ sessionId: idSchema.nullable(),
49
+ subscriptionId: idSchema.nullable(),
50
+ providerRequestId: z.string().max(200).nullable(),
51
+ createdAt: isoTimestampSchema
52
+ });
53
+
54
+ export { complianceLogSchema, complianceProviderSchema, complianceScreeningContextSchema, complianceStatusSchema };
55
+ //# sourceMappingURL=compli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AA,GAAyBA,EAAE,IAAA,CAAK,CAAC,SAAS,SAAA,EAAW,SAAA,EAAW,OAAO,CAAC;AAG9E,IAAM,gCAAA,GAAmCA,EAAE,IAAA,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"]}
@@ -0,0 +1,56 @@
1
+ 'use strict';
2
+
3
+ var zod = require('zod');
4
+
5
+ // src/customers.ts
6
+ var idSchema = zod.z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/, "id must be URL-safe");
7
+ var evmAddressSchema = zod.z.string().regex(/^0x[a-fA-F0-9]{40}$/, "must be a 0x-prefixed 40-character hex EVM address").transform((v) => v.toLowerCase());
8
+ zod.z.string().regex(/^0x[a-fA-F0-9]{64}$/, "must be a 0x-prefixed 64-character hex EVM transaction hash");
9
+ var emailSchema = zod.z.string().email().trim().toLowerCase().max(320);
10
+ zod.z.string().url().refine((v) => v.startsWith("https://"), {
11
+ message: "must be an https:// URL"
12
+ });
13
+ zod.z.string().url();
14
+ zod.z.string().regex(/^[0-9]+$/, "must be a non-negative integer string (base-10)").refine((v) => BigInt(v) >= 0n, "must be >= 0");
15
+ zod.z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
16
+ var isoTimestampSchema = zod.z.string().datetime({ offset: true, message: "must be an ISO-8601 timestamp" });
17
+ zod.z.string().length(2).regex(/^[A-Z]{2}$/, "must be an ISO-3166 alpha-2 country code");
18
+ zod.z.object({
19
+ limit: zod.z.number().int().min(1).max(100).default(25),
20
+ cursor: zod.z.string().min(1).max(200).nullish()
21
+ });
22
+ var metadataSchema = zod.z.record(
23
+ zod.z.string().min(1).max(40),
24
+ zod.z.union([zod.z.string().max(500), zod.z.number(), zod.z.boolean(), zod.z.null()])
25
+ ).refine((m) => Object.keys(m).length <= 50, "at most 50 metadata keys").default({});
26
+ zod.z.enum(["test", "live"]);
27
+ zod.z.enum(["USDC", "EURC"]);
28
+ zod.z.enum(["USDC", "EURC", "USYC"]);
29
+ zod.z.enum(["free", "growth", "business", "enterprise"]);
30
+ zod.z.enum(["testnet", "mainnet"]);
31
+
32
+ // src/customers.ts
33
+ var customerSchema = zod.z.object({
34
+ id: idSchema,
35
+ merchantId: idSchema,
36
+ walletAddress: evmAddressSchema,
37
+ email: emailSchema.nullable(),
38
+ /** Merchant-provided external identifier (e.g. their own user id). */
39
+ externalRef: zod.z.string().min(1).max(120).nullable(),
40
+ displayName: zod.z.string().min(1).max(120).nullable(),
41
+ metadata: metadataSchema,
42
+ firstSeenAt: isoTimestampSchema,
43
+ lastSeenAt: isoTimestampSchema
44
+ });
45
+ var upsertCustomerInputSchema = zod.z.object({
46
+ walletAddress: evmAddressSchema,
47
+ email: emailSchema.optional(),
48
+ externalRef: zod.z.string().min(1).max(120).optional(),
49
+ displayName: zod.z.string().min(1).max(120).optional(),
50
+ metadata: metadataSchema.optional()
51
+ });
52
+
53
+ exports.customerSchema = customerSchema;
54
+ exports.upsertCustomerInputSchema = upsertCustomerInputSchema;
55
+ //# sourceMappingURL=customers.cjs.map
56
+ //# sourceMappingURL=customers.cjs.map
@@ -0,0 +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,CAA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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 — 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"]}
@@ -0,0 +1,64 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Customer — the payer on the merchant's side.
5
+ *
6
+ * Customers are uniquely identified by (merchantId, walletAddress). Email and
7
+ * externalRef are optional; merchants can associate their own customer id.
8
+ */
9
+
10
+ declare const customerSchema: z.ZodObject<{
11
+ id: z.ZodString;
12
+ merchantId: z.ZodString;
13
+ walletAddress: z.ZodEffects<z.ZodString, string, string>;
14
+ email: z.ZodNullable<z.ZodString>;
15
+ /** Merchant-provided external identifier (e.g. their own user id). */
16
+ externalRef: z.ZodNullable<z.ZodString>;
17
+ displayName: z.ZodNullable<z.ZodString>;
18
+ metadata: z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>;
19
+ firstSeenAt: z.ZodString;
20
+ lastSeenAt: z.ZodString;
21
+ }, "strip", z.ZodTypeAny, {
22
+ id: string;
23
+ merchantId: string;
24
+ walletAddress: string;
25
+ email: string | null;
26
+ externalRef: string | null;
27
+ displayName: string | null;
28
+ metadata: Record<string, string | number | boolean | null>;
29
+ firstSeenAt: string;
30
+ lastSeenAt: string;
31
+ }, {
32
+ id: string;
33
+ merchantId: string;
34
+ walletAddress: string;
35
+ email: string | null;
36
+ externalRef: string | null;
37
+ displayName: string | null;
38
+ firstSeenAt: string;
39
+ lastSeenAt: string;
40
+ metadata?: Record<string, string | number | boolean | null> | undefined;
41
+ }>;
42
+ type Customer = z.infer<typeof customerSchema>;
43
+ declare const upsertCustomerInputSchema: z.ZodObject<{
44
+ walletAddress: z.ZodEffects<z.ZodString, string, string>;
45
+ email: z.ZodOptional<z.ZodString>;
46
+ externalRef: z.ZodOptional<z.ZodString>;
47
+ displayName: z.ZodOptional<z.ZodString>;
48
+ metadata: z.ZodOptional<z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ walletAddress: string;
51
+ email?: string | undefined;
52
+ externalRef?: string | undefined;
53
+ displayName?: string | undefined;
54
+ metadata?: Record<string, string | number | boolean | null> | undefined;
55
+ }, {
56
+ walletAddress: string;
57
+ email?: string | undefined;
58
+ externalRef?: string | undefined;
59
+ displayName?: string | undefined;
60
+ metadata?: Record<string, string | number | boolean | null> | undefined;
61
+ }>;
62
+ type UpsertCustomerInput = z.infer<typeof upsertCustomerInputSchema>;
63
+
64
+ export { type Customer, type UpsertCustomerInput, customerSchema, upsertCustomerInputSchema };
@@ -0,0 +1,64 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Customer — the payer on the merchant's side.
5
+ *
6
+ * Customers are uniquely identified by (merchantId, walletAddress). Email and
7
+ * externalRef are optional; merchants can associate their own customer id.
8
+ */
9
+
10
+ declare const customerSchema: z.ZodObject<{
11
+ id: z.ZodString;
12
+ merchantId: z.ZodString;
13
+ walletAddress: z.ZodEffects<z.ZodString, string, string>;
14
+ email: z.ZodNullable<z.ZodString>;
15
+ /** Merchant-provided external identifier (e.g. their own user id). */
16
+ externalRef: z.ZodNullable<z.ZodString>;
17
+ displayName: z.ZodNullable<z.ZodString>;
18
+ metadata: z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>;
19
+ firstSeenAt: z.ZodString;
20
+ lastSeenAt: z.ZodString;
21
+ }, "strip", z.ZodTypeAny, {
22
+ id: string;
23
+ merchantId: string;
24
+ walletAddress: string;
25
+ email: string | null;
26
+ externalRef: string | null;
27
+ displayName: string | null;
28
+ metadata: Record<string, string | number | boolean | null>;
29
+ firstSeenAt: string;
30
+ lastSeenAt: string;
31
+ }, {
32
+ id: string;
33
+ merchantId: string;
34
+ walletAddress: string;
35
+ email: string | null;
36
+ externalRef: string | null;
37
+ displayName: string | null;
38
+ firstSeenAt: string;
39
+ lastSeenAt: string;
40
+ metadata?: Record<string, string | number | boolean | null> | undefined;
41
+ }>;
42
+ type Customer = z.infer<typeof customerSchema>;
43
+ declare const upsertCustomerInputSchema: z.ZodObject<{
44
+ walletAddress: z.ZodEffects<z.ZodString, string, string>;
45
+ email: z.ZodOptional<z.ZodString>;
46
+ externalRef: z.ZodOptional<z.ZodString>;
47
+ displayName: z.ZodOptional<z.ZodString>;
48
+ metadata: z.ZodOptional<z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ walletAddress: string;
51
+ email?: string | undefined;
52
+ externalRef?: string | undefined;
53
+ displayName?: string | undefined;
54
+ metadata?: Record<string, string | number | boolean | null> | undefined;
55
+ }, {
56
+ walletAddress: string;
57
+ email?: string | undefined;
58
+ externalRef?: string | undefined;
59
+ displayName?: string | undefined;
60
+ metadata?: Record<string, string | number | boolean | null> | undefined;
61
+ }>;
62
+ type UpsertCustomerInput = z.infer<typeof upsertCustomerInputSchema>;
63
+
64
+ export { type Customer, type UpsertCustomerInput, customerSchema, upsertCustomerInputSchema };