@modainteract/moda-interact-shared 0.7.2 → 0.7.3
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.
- package/dist/billing.d.ts +86 -0
- package/dist/billing.js +39 -0
- package/dist/billing.js.map +1 -0
- package/dist/chunk-WVVP7IUY.js +117 -0
- package/dist/chunk-WVVP7IUY.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +36 -0
- package/dist/internationalization.d.ts +2 -2
- package/dist/merchant-communications.d.ts +6 -6
- package/dist/shopify/index.d.ts +12 -12
- package/package.json +5 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const ARCH007_BILLING_CONTRACT_SCHEMA_VERSION: 1;
|
|
4
|
+
declare const WHATSAPP_PROVIDER_STATUS_SCHEMA_VERSION: 1;
|
|
5
|
+
declare const BILLING_PLAN_KINDS: readonly ["FREE", "PAID_METERED"];
|
|
6
|
+
declare const BillingPlanKindSchema: z.ZodEnum<{
|
|
7
|
+
FREE: "FREE";
|
|
8
|
+
PAID_METERED: "PAID_METERED";
|
|
9
|
+
}>;
|
|
10
|
+
type BillingPlanKind = z.infer<typeof BillingPlanKindSchema>;
|
|
11
|
+
declare const BILLING_USAGE_METRICS: readonly ["RECOVERY_CONVERSATION", "OUTBOUND_AUTOMATED_MESSAGE", "DELIVERED_WHATSAPP_MESSAGE"];
|
|
12
|
+
declare const BillingUsageMetricSchema: z.ZodEnum<{
|
|
13
|
+
RECOVERY_CONVERSATION: "RECOVERY_CONVERSATION";
|
|
14
|
+
OUTBOUND_AUTOMATED_MESSAGE: "OUTBOUND_AUTOMATED_MESSAGE";
|
|
15
|
+
DELIVERED_WHATSAPP_MESSAGE: "DELIVERED_WHATSAPP_MESSAGE";
|
|
16
|
+
}>;
|
|
17
|
+
type BillingUsageMetric = z.infer<typeof BillingUsageMetricSchema>;
|
|
18
|
+
declare const BILLING_SYSTEM_MESSAGE_CODES: {
|
|
19
|
+
readonly FREE_ALLOWANCE_WARNING: "BILLING_FREE_ALLOWANCE_WARNING";
|
|
20
|
+
readonly FREE_ALLOWANCE_EXHAUSTED: "BILLING_FREE_ALLOWANCE_EXHAUSTED";
|
|
21
|
+
readonly PLAN_UPGRADED: "BILLING_PLAN_UPGRADED";
|
|
22
|
+
readonly PLAN_DOWNGRADE_SCHEDULED: "BILLING_PLAN_DOWNGRADE_SCHEDULED";
|
|
23
|
+
readonly SUBSCRIPTION_ENDED: "BILLING_SUBSCRIPTION_ENDED";
|
|
24
|
+
readonly SAFETY_LIMIT_REACHED: "BILLING_SAFETY_LIMIT_REACHED";
|
|
25
|
+
};
|
|
26
|
+
declare const BillingSystemMessageCodeSchema: z.ZodEnum<{
|
|
27
|
+
BILLING_FREE_ALLOWANCE_WARNING: "BILLING_FREE_ALLOWANCE_WARNING";
|
|
28
|
+
BILLING_FREE_ALLOWANCE_EXHAUSTED: "BILLING_FREE_ALLOWANCE_EXHAUSTED";
|
|
29
|
+
BILLING_PLAN_UPGRADED: "BILLING_PLAN_UPGRADED";
|
|
30
|
+
BILLING_PLAN_DOWNGRADE_SCHEDULED: "BILLING_PLAN_DOWNGRADE_SCHEDULED";
|
|
31
|
+
BILLING_SUBSCRIPTION_ENDED: "BILLING_SUBSCRIPTION_ENDED";
|
|
32
|
+
BILLING_SAFETY_LIMIT_REACHED: "BILLING_SAFETY_LIMIT_REACHED";
|
|
33
|
+
}>;
|
|
34
|
+
type BillingSystemMessageCode = z.infer<typeof BillingSystemMessageCodeSchema>;
|
|
35
|
+
declare const WHATSAPP_PROVIDER_STATUSES: readonly ["SENT", "DELIVERED", "READ", "FAILED"];
|
|
36
|
+
declare const WhatsAppProviderStatusSchema: z.ZodEnum<{
|
|
37
|
+
SENT: "SENT";
|
|
38
|
+
DELIVERED: "DELIVERED";
|
|
39
|
+
READ: "READ";
|
|
40
|
+
FAILED: "FAILED";
|
|
41
|
+
}>;
|
|
42
|
+
type WhatsAppProviderStatus = z.infer<typeof WhatsAppProviderStatusSchema>;
|
|
43
|
+
declare const WhatsAppProviderPricingMetadataSchema: z.ZodObject<{
|
|
44
|
+
billable: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
category: z.ZodOptional<z.ZodString>;
|
|
46
|
+
model: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
type WhatsAppProviderPricingMetadata = z.infer<typeof WhatsAppProviderPricingMetadataSchema>;
|
|
49
|
+
declare const NormalizedWhatsAppStatusSchema: z.ZodObject<{
|
|
50
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
51
|
+
shopId: z.ZodString;
|
|
52
|
+
providerAccountId: z.ZodString;
|
|
53
|
+
providerMessageId: z.ZodString;
|
|
54
|
+
status: z.ZodEnum<{
|
|
55
|
+
SENT: "SENT";
|
|
56
|
+
DELIVERED: "DELIVERED";
|
|
57
|
+
READ: "READ";
|
|
58
|
+
FAILED: "FAILED";
|
|
59
|
+
}>;
|
|
60
|
+
occurredAt: z.ZodISODateTime;
|
|
61
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
billable: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
category: z.ZodOptional<z.ZodString>;
|
|
64
|
+
model: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strict>>;
|
|
66
|
+
}, z.core.$strict>;
|
|
67
|
+
type NormalizedWhatsAppStatus = z.infer<typeof NormalizedWhatsAppStatusSchema>;
|
|
68
|
+
declare function parseNormalizedWhatsAppStatus(input: unknown): NormalizedWhatsAppStatus;
|
|
69
|
+
declare function safeParseNormalizedWhatsAppStatus(input: unknown): z.ZodSafeParseResult<{
|
|
70
|
+
schemaVersion: 1;
|
|
71
|
+
shopId: string;
|
|
72
|
+
providerAccountId: string;
|
|
73
|
+
providerMessageId: string;
|
|
74
|
+
status: "SENT" | "DELIVERED" | "READ" | "FAILED";
|
|
75
|
+
occurredAt: string;
|
|
76
|
+
pricing?: {
|
|
77
|
+
billable?: boolean | undefined;
|
|
78
|
+
category?: string | undefined;
|
|
79
|
+
model?: string | undefined;
|
|
80
|
+
} | undefined;
|
|
81
|
+
}>;
|
|
82
|
+
declare function createMerchantBillingSystemSourceKey(shopId: string, code: BillingSystemMessageCode, eventIdentity: string, version?: number): string;
|
|
83
|
+
declare function createRecoveryIdempotencyKey(shopId: string, recoveryId: string): string;
|
|
84
|
+
declare function createShopifyUsageIdempotencyKey(shopId: string, usageEventId: string): string;
|
|
85
|
+
|
|
86
|
+
export { ARCH007_BILLING_CONTRACT_SCHEMA_VERSION, BILLING_PLAN_KINDS, BILLING_SYSTEM_MESSAGE_CODES, BILLING_USAGE_METRICS, type BillingPlanKind, BillingPlanKindSchema, type BillingSystemMessageCode, BillingSystemMessageCodeSchema, type BillingUsageMetric, BillingUsageMetricSchema, type NormalizedWhatsAppStatus, NormalizedWhatsAppStatusSchema, WHATSAPP_PROVIDER_STATUSES, WHATSAPP_PROVIDER_STATUS_SCHEMA_VERSION, type WhatsAppProviderPricingMetadata, WhatsAppProviderPricingMetadataSchema, type WhatsAppProviderStatus, WhatsAppProviderStatusSchema, createMerchantBillingSystemSourceKey, createRecoveryIdempotencyKey, createShopifyUsageIdempotencyKey, parseNormalizedWhatsAppStatus, safeParseNormalizedWhatsAppStatus };
|
package/dist/billing.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ARCH007_BILLING_CONTRACT_SCHEMA_VERSION,
|
|
3
|
+
BILLING_PLAN_KINDS,
|
|
4
|
+
BILLING_SYSTEM_MESSAGE_CODES,
|
|
5
|
+
BILLING_USAGE_METRICS,
|
|
6
|
+
BillingPlanKindSchema,
|
|
7
|
+
BillingSystemMessageCodeSchema,
|
|
8
|
+
BillingUsageMetricSchema,
|
|
9
|
+
NormalizedWhatsAppStatusSchema,
|
|
10
|
+
WHATSAPP_PROVIDER_STATUSES,
|
|
11
|
+
WHATSAPP_PROVIDER_STATUS_SCHEMA_VERSION,
|
|
12
|
+
WhatsAppProviderPricingMetadataSchema,
|
|
13
|
+
WhatsAppProviderStatusSchema,
|
|
14
|
+
createMerchantBillingSystemSourceKey,
|
|
15
|
+
createRecoveryIdempotencyKey,
|
|
16
|
+
createShopifyUsageIdempotencyKey,
|
|
17
|
+
parseNormalizedWhatsAppStatus,
|
|
18
|
+
safeParseNormalizedWhatsAppStatus
|
|
19
|
+
} from "./chunk-WVVP7IUY.js";
|
|
20
|
+
export {
|
|
21
|
+
ARCH007_BILLING_CONTRACT_SCHEMA_VERSION,
|
|
22
|
+
BILLING_PLAN_KINDS,
|
|
23
|
+
BILLING_SYSTEM_MESSAGE_CODES,
|
|
24
|
+
BILLING_USAGE_METRICS,
|
|
25
|
+
BillingPlanKindSchema,
|
|
26
|
+
BillingSystemMessageCodeSchema,
|
|
27
|
+
BillingUsageMetricSchema,
|
|
28
|
+
NormalizedWhatsAppStatusSchema,
|
|
29
|
+
WHATSAPP_PROVIDER_STATUSES,
|
|
30
|
+
WHATSAPP_PROVIDER_STATUS_SCHEMA_VERSION,
|
|
31
|
+
WhatsAppProviderPricingMetadataSchema,
|
|
32
|
+
WhatsAppProviderStatusSchema,
|
|
33
|
+
createMerchantBillingSystemSourceKey,
|
|
34
|
+
createRecoveryIdempotencyKey,
|
|
35
|
+
createShopifyUsageIdempotencyKey,
|
|
36
|
+
parseNormalizedWhatsAppStatus,
|
|
37
|
+
safeParseNormalizedWhatsAppStatus
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=billing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// src/billing.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var ARCH007_BILLING_CONTRACT_SCHEMA_VERSION = 1;
|
|
4
|
+
var WHATSAPP_PROVIDER_STATUS_SCHEMA_VERSION = 1;
|
|
5
|
+
var BILLING_PLAN_KINDS = ["FREE", "PAID_METERED"];
|
|
6
|
+
var BillingPlanKindSchema = z.enum(BILLING_PLAN_KINDS);
|
|
7
|
+
var BILLING_USAGE_METRICS = [
|
|
8
|
+
"RECOVERY_CONVERSATION",
|
|
9
|
+
"OUTBOUND_AUTOMATED_MESSAGE",
|
|
10
|
+
"DELIVERED_WHATSAPP_MESSAGE"
|
|
11
|
+
];
|
|
12
|
+
var BillingUsageMetricSchema = z.enum(BILLING_USAGE_METRICS);
|
|
13
|
+
var BILLING_SYSTEM_MESSAGE_CODES = {
|
|
14
|
+
FREE_ALLOWANCE_WARNING: "BILLING_FREE_ALLOWANCE_WARNING",
|
|
15
|
+
FREE_ALLOWANCE_EXHAUSTED: "BILLING_FREE_ALLOWANCE_EXHAUSTED",
|
|
16
|
+
PLAN_UPGRADED: "BILLING_PLAN_UPGRADED",
|
|
17
|
+
PLAN_DOWNGRADE_SCHEDULED: "BILLING_PLAN_DOWNGRADE_SCHEDULED",
|
|
18
|
+
SUBSCRIPTION_ENDED: "BILLING_SUBSCRIPTION_ENDED",
|
|
19
|
+
SAFETY_LIMIT_REACHED: "BILLING_SAFETY_LIMIT_REACHED"
|
|
20
|
+
};
|
|
21
|
+
var BILLING_SYSTEM_MESSAGE_CODE_VALUES = [
|
|
22
|
+
BILLING_SYSTEM_MESSAGE_CODES.FREE_ALLOWANCE_WARNING,
|
|
23
|
+
BILLING_SYSTEM_MESSAGE_CODES.FREE_ALLOWANCE_EXHAUSTED,
|
|
24
|
+
BILLING_SYSTEM_MESSAGE_CODES.PLAN_UPGRADED,
|
|
25
|
+
BILLING_SYSTEM_MESSAGE_CODES.PLAN_DOWNGRADE_SCHEDULED,
|
|
26
|
+
BILLING_SYSTEM_MESSAGE_CODES.SUBSCRIPTION_ENDED,
|
|
27
|
+
BILLING_SYSTEM_MESSAGE_CODES.SAFETY_LIMIT_REACHED
|
|
28
|
+
];
|
|
29
|
+
var BillingSystemMessageCodeSchema = z.enum(BILLING_SYSTEM_MESSAGE_CODE_VALUES);
|
|
30
|
+
var WHATSAPP_PROVIDER_STATUSES = [
|
|
31
|
+
"SENT",
|
|
32
|
+
"DELIVERED",
|
|
33
|
+
"READ",
|
|
34
|
+
"FAILED"
|
|
35
|
+
];
|
|
36
|
+
var WhatsAppProviderStatusSchema = z.enum(WHATSAPP_PROVIDER_STATUSES);
|
|
37
|
+
var MAX_ID_LENGTH = 128;
|
|
38
|
+
var MAX_SHORT_TEXT_LENGTH = 128;
|
|
39
|
+
var WhatsAppProviderPricingMetadataSchema = z.object({
|
|
40
|
+
billable: z.boolean().optional(),
|
|
41
|
+
category: z.string().trim().min(1).max(MAX_SHORT_TEXT_LENGTH).optional(),
|
|
42
|
+
model: z.string().trim().min(1).max(MAX_SHORT_TEXT_LENGTH).optional()
|
|
43
|
+
}).strict().refine((value) => Object.keys(value).length > 0, "pricing metadata must not be empty");
|
|
44
|
+
var NormalizedWhatsAppStatusSchema = z.object({
|
|
45
|
+
schemaVersion: z.literal(WHATSAPP_PROVIDER_STATUS_SCHEMA_VERSION),
|
|
46
|
+
shopId: z.string().trim().min(1).max(MAX_ID_LENGTH),
|
|
47
|
+
providerAccountId: z.string().trim().min(1).max(MAX_ID_LENGTH),
|
|
48
|
+
providerMessageId: z.string().trim().min(1).max(MAX_ID_LENGTH),
|
|
49
|
+
status: WhatsAppProviderStatusSchema,
|
|
50
|
+
occurredAt: z.iso.datetime({ offset: true }),
|
|
51
|
+
pricing: WhatsAppProviderPricingMetadataSchema.optional()
|
|
52
|
+
}).strict();
|
|
53
|
+
function parseNormalizedWhatsAppStatus(input) {
|
|
54
|
+
return NormalizedWhatsAppStatusSchema.parse(input);
|
|
55
|
+
}
|
|
56
|
+
function safeParseNormalizedWhatsAppStatus(input) {
|
|
57
|
+
return NormalizedWhatsAppStatusSchema.safeParse(input);
|
|
58
|
+
}
|
|
59
|
+
function assertKeyPart(name, value) {
|
|
60
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
61
|
+
throw new Error(`${name} must be a non-empty string`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function fnv1a64(value) {
|
|
65
|
+
let hash = 0xcbf29ce484222325n;
|
|
66
|
+
for (const character of value) {
|
|
67
|
+
hash ^= BigInt(character.codePointAt(0) ?? 0);
|
|
68
|
+
hash = BigInt.asUintN(64, hash * 0x100000001b3n);
|
|
69
|
+
}
|
|
70
|
+
return hash.toString(16).padStart(16, "0");
|
|
71
|
+
}
|
|
72
|
+
function boundedKey(prefix, parts, maxLength) {
|
|
73
|
+
const canonical = parts.map((part) => part.trim()).join(":");
|
|
74
|
+
const readable = `${prefix}:${canonical}`;
|
|
75
|
+
if (readable.length <= maxLength) return readable;
|
|
76
|
+
return `${prefix}:h${fnv1a64(canonical)}`;
|
|
77
|
+
}
|
|
78
|
+
function createMerchantBillingSystemSourceKey(shopId, code, eventIdentity, version = 1) {
|
|
79
|
+
assertKeyPart("shopId", shopId);
|
|
80
|
+
assertKeyPart("code", code);
|
|
81
|
+
assertKeyPart("eventIdentity", eventIdentity);
|
|
82
|
+
if (!Number.isInteger(version) || version < 1) {
|
|
83
|
+
throw new Error("version must be a positive integer");
|
|
84
|
+
}
|
|
85
|
+
return boundedKey("billing-system", [shopId, code, eventIdentity, String(version)], 255);
|
|
86
|
+
}
|
|
87
|
+
function createRecoveryIdempotencyKey(shopId, recoveryId) {
|
|
88
|
+
assertKeyPart("shopId", shopId);
|
|
89
|
+
assertKeyPart("recoveryId", recoveryId);
|
|
90
|
+
return boundedKey("recovery", [shopId, recoveryId], 255);
|
|
91
|
+
}
|
|
92
|
+
function createShopifyUsageIdempotencyKey(shopId, usageEventId) {
|
|
93
|
+
assertKeyPart("shopId", shopId);
|
|
94
|
+
assertKeyPart("usageEventId", usageEventId);
|
|
95
|
+
return boundedKey("shopify", [shopId, usageEventId], 64);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export {
|
|
99
|
+
ARCH007_BILLING_CONTRACT_SCHEMA_VERSION,
|
|
100
|
+
WHATSAPP_PROVIDER_STATUS_SCHEMA_VERSION,
|
|
101
|
+
BILLING_PLAN_KINDS,
|
|
102
|
+
BillingPlanKindSchema,
|
|
103
|
+
BILLING_USAGE_METRICS,
|
|
104
|
+
BillingUsageMetricSchema,
|
|
105
|
+
BILLING_SYSTEM_MESSAGE_CODES,
|
|
106
|
+
BillingSystemMessageCodeSchema,
|
|
107
|
+
WHATSAPP_PROVIDER_STATUSES,
|
|
108
|
+
WhatsAppProviderStatusSchema,
|
|
109
|
+
WhatsAppProviderPricingMetadataSchema,
|
|
110
|
+
NormalizedWhatsAppStatusSchema,
|
|
111
|
+
parseNormalizedWhatsAppStatus,
|
|
112
|
+
safeParseNormalizedWhatsAppStatus,
|
|
113
|
+
createMerchantBillingSystemSourceKey,
|
|
114
|
+
createRecoveryIdempotencyKey,
|
|
115
|
+
createShopifyUsageIdempotencyKey
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=chunk-WVVP7IUY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/billing.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const ARCH007_BILLING_CONTRACT_SCHEMA_VERSION = 1 as const;\nexport const WHATSAPP_PROVIDER_STATUS_SCHEMA_VERSION = 1 as const;\n\nexport const BILLING_PLAN_KINDS = [\"FREE\", \"PAID_METERED\"] as const;\nexport const BillingPlanKindSchema = z.enum(BILLING_PLAN_KINDS);\nexport type BillingPlanKind = z.infer<typeof BillingPlanKindSchema>;\n\nexport const BILLING_USAGE_METRICS = [\n \"RECOVERY_CONVERSATION\",\n \"OUTBOUND_AUTOMATED_MESSAGE\",\n \"DELIVERED_WHATSAPP_MESSAGE\",\n] as const;\nexport const BillingUsageMetricSchema = z.enum(BILLING_USAGE_METRICS);\nexport type BillingUsageMetric = z.infer<typeof BillingUsageMetricSchema>;\n\nexport const BILLING_SYSTEM_MESSAGE_CODES = {\n FREE_ALLOWANCE_WARNING: \"BILLING_FREE_ALLOWANCE_WARNING\",\n FREE_ALLOWANCE_EXHAUSTED: \"BILLING_FREE_ALLOWANCE_EXHAUSTED\",\n PLAN_UPGRADED: \"BILLING_PLAN_UPGRADED\",\n PLAN_DOWNGRADE_SCHEDULED: \"BILLING_PLAN_DOWNGRADE_SCHEDULED\",\n SUBSCRIPTION_ENDED: \"BILLING_SUBSCRIPTION_ENDED\",\n SAFETY_LIMIT_REACHED: \"BILLING_SAFETY_LIMIT_REACHED\",\n} as const;\n\nconst BILLING_SYSTEM_MESSAGE_CODE_VALUES = [\n BILLING_SYSTEM_MESSAGE_CODES.FREE_ALLOWANCE_WARNING,\n BILLING_SYSTEM_MESSAGE_CODES.FREE_ALLOWANCE_EXHAUSTED,\n BILLING_SYSTEM_MESSAGE_CODES.PLAN_UPGRADED,\n BILLING_SYSTEM_MESSAGE_CODES.PLAN_DOWNGRADE_SCHEDULED,\n BILLING_SYSTEM_MESSAGE_CODES.SUBSCRIPTION_ENDED,\n BILLING_SYSTEM_MESSAGE_CODES.SAFETY_LIMIT_REACHED,\n] as const;\n\nexport const BillingSystemMessageCodeSchema = z.enum(BILLING_SYSTEM_MESSAGE_CODE_VALUES);\nexport type BillingSystemMessageCode = z.infer<typeof BillingSystemMessageCodeSchema>;\n\nexport const WHATSAPP_PROVIDER_STATUSES = [\n \"SENT\",\n \"DELIVERED\",\n \"READ\",\n \"FAILED\",\n] as const;\nexport const WhatsAppProviderStatusSchema = z.enum(WHATSAPP_PROVIDER_STATUSES);\nexport type WhatsAppProviderStatus = z.infer<typeof WhatsAppProviderStatusSchema>;\n\nconst MAX_ID_LENGTH = 128;\nconst MAX_SHORT_TEXT_LENGTH = 128;\n\nexport const WhatsAppProviderPricingMetadataSchema = z\n .object({\n billable: z.boolean().optional(),\n category: z.string().trim().min(1).max(MAX_SHORT_TEXT_LENGTH).optional(),\n model: z.string().trim().min(1).max(MAX_SHORT_TEXT_LENGTH).optional(),\n })\n .strict()\n .refine((value) => Object.keys(value).length > 0, \"pricing metadata must not be empty\");\n\nexport type WhatsAppProviderPricingMetadata = z.infer<\n typeof WhatsAppProviderPricingMetadataSchema\n>;\n\nexport const NormalizedWhatsAppStatusSchema = z\n .object({\n schemaVersion: z.literal(WHATSAPP_PROVIDER_STATUS_SCHEMA_VERSION),\n shopId: z.string().trim().min(1).max(MAX_ID_LENGTH),\n providerAccountId: z.string().trim().min(1).max(MAX_ID_LENGTH),\n providerMessageId: z.string().trim().min(1).max(MAX_ID_LENGTH),\n status: WhatsAppProviderStatusSchema,\n occurredAt: z.iso.datetime({ offset: true }),\n pricing: WhatsAppProviderPricingMetadataSchema.optional(),\n })\n .strict();\n\nexport type NormalizedWhatsAppStatus = z.infer<typeof NormalizedWhatsAppStatusSchema>;\n\nexport function parseNormalizedWhatsAppStatus(input: unknown): NormalizedWhatsAppStatus {\n return NormalizedWhatsAppStatusSchema.parse(input);\n}\n\nexport function safeParseNormalizedWhatsAppStatus(input: unknown) {\n return NormalizedWhatsAppStatusSchema.safeParse(input);\n}\n\nfunction assertKeyPart(name: string, value: string): void {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new Error(`${name} must be a non-empty string`);\n }\n}\n\nfunction fnv1a64(value: string): string {\n let hash = 0xcbf29ce484222325n;\n for (const character of value) {\n hash ^= BigInt(character.codePointAt(0) ?? 0);\n hash = BigInt.asUintN(64, hash * 0x100000001b3n);\n }\n return hash.toString(16).padStart(16, \"0\");\n}\n\nfunction boundedKey(prefix: string, parts: string[], maxLength: number): string {\n const canonical = parts.map((part) => part.trim()).join(\":\");\n const readable = `${prefix}:${canonical}`;\n if (readable.length <= maxLength) return readable;\n return `${prefix}:h${fnv1a64(canonical)}`;\n}\n\nexport function createMerchantBillingSystemSourceKey(\n shopId: string,\n code: BillingSystemMessageCode,\n eventIdentity: string,\n version = 1,\n): string {\n assertKeyPart(\"shopId\", shopId);\n assertKeyPart(\"code\", code);\n assertKeyPart(\"eventIdentity\", eventIdentity);\n if (!Number.isInteger(version) || version < 1) {\n throw new Error(\"version must be a positive integer\");\n }\n return boundedKey(\"billing-system\", [shopId, code, eventIdentity, String(version)], 255);\n}\n\nexport function createRecoveryIdempotencyKey(shopId: string, recoveryId: string): string {\n assertKeyPart(\"shopId\", shopId);\n assertKeyPart(\"recoveryId\", recoveryId);\n return boundedKey(\"recovery\", [shopId, recoveryId], 255);\n}\n\nexport function createShopifyUsageIdempotencyKey(\n shopId: string,\n usageEventId: string,\n): string {\n assertKeyPart(\"shopId\", shopId);\n assertKeyPart(\"usageEventId\", usageEventId);\n return boundedKey(\"shopify\", [shopId, usageEventId], 64);\n}"],"mappings":"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","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { CatalogueValidationOptions, CountryCode, CountryCodeSchema, CurrencyCode, CurrencyCodeSchema, IcuMessageCatalogue, IcuMessageValues, InternationalContext, InternationalContextSchema, InternationalizationRuntime, InternationalizationRuntimeOptions, LanguageSource, LanguageSourceSchema, LanguageTag, LanguageTagSchema, TimeZoneId, TimeZoneIdSchema, canonicaliseLanguageTag, createInternationalizationRuntime, mergeInternationalContext, normalizeCountryCode, normalizeCurrencyCode, normalizeTimeZone, resolveLocaleDirection, validateIcuCatalogue } from './internationalization.js';
|
|
2
|
+
export { ARCH007_BILLING_CONTRACT_SCHEMA_VERSION, BILLING_PLAN_KINDS, BILLING_SYSTEM_MESSAGE_CODES, BILLING_USAGE_METRICS, BillingPlanKind, BillingPlanKindSchema, BillingSystemMessageCode, BillingSystemMessageCodeSchema, BillingUsageMetric, BillingUsageMetricSchema, NormalizedWhatsAppStatus, NormalizedWhatsAppStatusSchema, WHATSAPP_PROVIDER_STATUSES, WHATSAPP_PROVIDER_STATUS_SCHEMA_VERSION, WhatsAppProviderPricingMetadata, WhatsAppProviderPricingMetadataSchema, WhatsAppProviderStatus, WhatsAppProviderStatusSchema, createMerchantBillingSystemSourceKey, createRecoveryIdempotencyKey, createShopifyUsageIdempotencyKey, parseNormalizedWhatsAppStatus, safeParseNormalizedWhatsAppStatus } from './billing.js';
|
|
2
3
|
export { AuthoredSupportBodySchema, MERCHANT_COMMUNICATIONS_JOB_NAMES, MERCHANT_COMMUNICATIONS_QUEUE_NAME, MERCHANT_COMMUNICATIONS_SCHEMA_VERSION, MerchantMessageTranslationContract, MerchantMessageTranslationContractSchema, MerchantMessageTranslationStatus, MerchantMessageTranslationStatusSchema, MerchantSupportMessageContract, MerchantSupportMessageContractSchema, MerchantSupportMessageKind, MerchantSupportMessageKindSchema, MerchantSupportMessageState, MerchantSupportMessageStateSchema, MerchantTranslationBatchContract, MerchantTranslationBatchContractSchema, MerchantTranslationBatchStatus, MerchantTranslationBatchStatusSchema, MerchantTranslationDirection, MerchantTranslationDirectionSchema, MerchantTranslationReconciliationRequestContract, MerchantTranslationReconciliationRequestContractSchema, MerchantTranslationReconciliationScope, MerchantTranslationReconciliationScopeSchema, MerchantTranslationReconciliationStatus, MerchantTranslationReconciliationStatusSchema, PLATFORM_SUPPORT_LANGUAGE_TAG, TranslatedSupportBodySchema, TranslationBatchPollJob, TranslationBatchPollJobSchema, TranslationBatchResultsJob, TranslationBatchResultsJobSchema, TranslationBatchSubmitJob, TranslationBatchSubmitJobSchema, TranslationDispatchJob, TranslationDispatchJobSchema, TranslationReconcileJob, TranslationReconcileJobSchema, countUnicodeGraphemes, requiresMerchantTranslation } from './merchant-communications.js';
|
|
3
4
|
export { CheckoutCreatedPayloadV2, CheckoutCreatedPayloadV2Schema, CheckoutObservedPayload, CheckoutObservedPayloadSchema, CheckoutUpdatedPayloadV2, CheckoutUpdatedPayloadV2Schema, MAX_LINE_ITEMS, MAX_URL_LENGTH, OrderCompletedPayload, OrderCompletedPayloadSchema, OrderCompletedPayloadV2, OrderCompletedPayloadV2Schema, SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION, SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION_V1, SHOPIFY_COMMERCE_EVENT_SCHEMA_VERSION_V2, SHOPIFY_COMMERCE_EVENT_TYPES, SHOPIFY_RECOVERY_EVENT_TYPES_V2, SHOPIFY_WEBHOOK_OUTBOX_DESTINATIONS, SHOPIFY_WEBHOOK_QUEUE_CONTRACTS, ShopifyCartActivityEventV2, ShopifyCartActivityEventV2Schema, ShopifyCartActivityPayloadV2, ShopifyCartActivityPayloadV2Schema, ShopifyCheckoutCreatedEventV2, ShopifyCheckoutCreatedEventV2Schema, ShopifyCheckoutLineItem, ShopifyCheckoutLineItemSchema, ShopifyCheckoutLineItemsSchema, ShopifyCheckoutObservedEvent, ShopifyCheckoutObservedEventSchema, ShopifyCheckoutUpdatedEventV2, ShopifyCheckoutUpdatedEventV2Schema, ShopifyCommerceEvent, ShopifyCommerceEventSchema, ShopifyCommerceEventType, ShopifyCustomerReference, ShopifyCustomerReferenceSchema, ShopifyMoney, ShopifyMoneySchema, ShopifyOrderCompletedEvent, ShopifyOrderCompletedEventSchema, ShopifyOrderCompletedEventV2, ShopifyOrderCompletedEventV2Schema, ShopifyRecoveryEventTypeV2, ShopifyRecoveryEventV2, ShopifyRecoveryEventV2Schema, ShopifyTenant, ShopifyTenantSchema, createShopifyCartActivityOrderingKey, createShopifyCommerceOrderingKey, createShopifyOrderCorrelationOrderingKey, createShopifyOrderOrderingKey, createShopifyPendingRecoveryOrderingKey, isCartActivityEventV2, isCheckoutCreatedEventV2, isCheckoutObservedEvent, isCheckoutUpdatedEventV2, isOrderCompletedEvent, isOrderCompletedEventV2, parseShopifyCommerceEvent, parseShopifyRecoveryEventV2, safeParseShopifyCommerceEvent, safeParseShopifyRecoveryEventV2 } from './shopify/index.js';
|
|
4
5
|
import 'zod';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ARCH007_BILLING_CONTRACT_SCHEMA_VERSION,
|
|
3
|
+
BILLING_PLAN_KINDS,
|
|
4
|
+
BILLING_SYSTEM_MESSAGE_CODES,
|
|
5
|
+
BILLING_USAGE_METRICS,
|
|
6
|
+
BillingPlanKindSchema,
|
|
7
|
+
BillingSystemMessageCodeSchema,
|
|
8
|
+
BillingUsageMetricSchema,
|
|
9
|
+
NormalizedWhatsAppStatusSchema,
|
|
10
|
+
WHATSAPP_PROVIDER_STATUSES,
|
|
11
|
+
WHATSAPP_PROVIDER_STATUS_SCHEMA_VERSION,
|
|
12
|
+
WhatsAppProviderPricingMetadataSchema,
|
|
13
|
+
WhatsAppProviderStatusSchema,
|
|
14
|
+
createMerchantBillingSystemSourceKey,
|
|
15
|
+
createRecoveryIdempotencyKey,
|
|
16
|
+
createShopifyUsageIdempotencyKey,
|
|
17
|
+
parseNormalizedWhatsAppStatus,
|
|
18
|
+
safeParseNormalizedWhatsAppStatus
|
|
19
|
+
} from "./chunk-WVVP7IUY.js";
|
|
1
20
|
import {
|
|
2
21
|
AuthoredSupportBodySchema,
|
|
3
22
|
MERCHANT_COMMUNICATIONS_JOB_NAMES,
|
|
@@ -86,7 +105,14 @@ import {
|
|
|
86
105
|
validateIcuCatalogue
|
|
87
106
|
} from "./chunk-B6Y3QQLI.js";
|
|
88
107
|
export {
|
|
108
|
+
ARCH007_BILLING_CONTRACT_SCHEMA_VERSION,
|
|
89
109
|
AuthoredSupportBodySchema,
|
|
110
|
+
BILLING_PLAN_KINDS,
|
|
111
|
+
BILLING_SYSTEM_MESSAGE_CODES,
|
|
112
|
+
BILLING_USAGE_METRICS,
|
|
113
|
+
BillingPlanKindSchema,
|
|
114
|
+
BillingSystemMessageCodeSchema,
|
|
115
|
+
BillingUsageMetricSchema,
|
|
90
116
|
CheckoutCreatedPayloadV2Schema,
|
|
91
117
|
CheckoutObservedPayloadSchema,
|
|
92
118
|
CheckoutUpdatedPayloadV2Schema,
|
|
@@ -111,6 +137,7 @@ export {
|
|
|
111
137
|
MerchantTranslationReconciliationRequestContractSchema,
|
|
112
138
|
MerchantTranslationReconciliationScopeSchema,
|
|
113
139
|
MerchantTranslationReconciliationStatusSchema,
|
|
140
|
+
NormalizedWhatsAppStatusSchema,
|
|
114
141
|
OrderCompletedPayloadSchema,
|
|
115
142
|
OrderCompletedPayloadV2Schema,
|
|
116
143
|
PLATFORM_SUPPORT_LANGUAGE_TAG,
|
|
@@ -142,14 +169,21 @@ export {
|
|
|
142
169
|
TranslationBatchSubmitJobSchema,
|
|
143
170
|
TranslationDispatchJobSchema,
|
|
144
171
|
TranslationReconcileJobSchema,
|
|
172
|
+
WHATSAPP_PROVIDER_STATUSES,
|
|
173
|
+
WHATSAPP_PROVIDER_STATUS_SCHEMA_VERSION,
|
|
174
|
+
WhatsAppProviderPricingMetadataSchema,
|
|
175
|
+
WhatsAppProviderStatusSchema,
|
|
145
176
|
canonicaliseLanguageTag,
|
|
146
177
|
countUnicodeGraphemes,
|
|
147
178
|
createInternationalizationRuntime,
|
|
179
|
+
createMerchantBillingSystemSourceKey,
|
|
180
|
+
createRecoveryIdempotencyKey,
|
|
148
181
|
createShopifyCartActivityOrderingKey,
|
|
149
182
|
createShopifyCommerceOrderingKey,
|
|
150
183
|
createShopifyOrderCorrelationOrderingKey,
|
|
151
184
|
createShopifyOrderOrderingKey,
|
|
152
185
|
createShopifyPendingRecoveryOrderingKey,
|
|
186
|
+
createShopifyUsageIdempotencyKey,
|
|
153
187
|
isCartActivityEventV2,
|
|
154
188
|
isCheckoutCreatedEventV2,
|
|
155
189
|
isCheckoutObservedEvent,
|
|
@@ -160,10 +194,12 @@ export {
|
|
|
160
194
|
normalizeCountryCode,
|
|
161
195
|
normalizeCurrencyCode,
|
|
162
196
|
normalizeTimeZone,
|
|
197
|
+
parseNormalizedWhatsAppStatus,
|
|
163
198
|
parseShopifyCommerceEvent,
|
|
164
199
|
parseShopifyRecoveryEventV2,
|
|
165
200
|
requiresMerchantTranslation,
|
|
166
201
|
resolveLocaleDirection,
|
|
202
|
+
safeParseNormalizedWhatsAppStatus,
|
|
167
203
|
safeParseShopifyCommerceEvent,
|
|
168
204
|
safeParseShopifyRecoveryEventV2,
|
|
169
205
|
validateIcuCatalogue
|
|
@@ -2,9 +2,9 @@ import { z } from 'zod';
|
|
|
2
2
|
import { PrimitiveType } from 'intl-messageformat';
|
|
3
3
|
|
|
4
4
|
declare const LanguageSourceSchema: z.ZodEnum<{
|
|
5
|
+
shopify: "shopify";
|
|
5
6
|
"customer-explicit": "customer-explicit";
|
|
6
7
|
detected: "detected";
|
|
7
|
-
shopify: "shopify";
|
|
8
8
|
"merchant-default": "merchant-default";
|
|
9
9
|
"platform-default": "platform-default";
|
|
10
10
|
}>;
|
|
@@ -20,9 +20,9 @@ declare const TimeZoneIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<string, st
|
|
|
20
20
|
declare const InternationalContextSchema: z.ZodObject<{
|
|
21
21
|
languageTag: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
22
22
|
languageSource: z.ZodNullable<z.ZodEnum<{
|
|
23
|
+
shopify: "shopify";
|
|
23
24
|
"customer-explicit": "customer-explicit";
|
|
24
25
|
detected: "detected";
|
|
25
|
-
shopify: "shopify";
|
|
26
26
|
"merchant-default": "merchant-default";
|
|
27
27
|
"platform-default": "platform-default";
|
|
28
28
|
}>>;
|
|
@@ -9,9 +9,9 @@ declare const MerchantSupportMessageKindSchema: z.ZodEnum<{
|
|
|
9
9
|
MERCHANT: "MERCHANT";
|
|
10
10
|
}>;
|
|
11
11
|
declare const MerchantSupportMessageStateSchema: z.ZodEnum<{
|
|
12
|
+
FAILED: "FAILED";
|
|
12
13
|
PROCESSING: "PROCESSING";
|
|
13
14
|
AVAILABLE: "AVAILABLE";
|
|
14
|
-
FAILED: "FAILED";
|
|
15
15
|
}>;
|
|
16
16
|
declare const MerchantTranslationDirectionSchema: z.ZodEnum<{
|
|
17
17
|
MERCHANT_TO_ADMIN: "MERCHANT_TO_ADMIN";
|
|
@@ -19,8 +19,8 @@ declare const MerchantTranslationDirectionSchema: z.ZodEnum<{
|
|
|
19
19
|
SYSTEM_TO_MERCHANT: "SYSTEM_TO_MERCHANT";
|
|
20
20
|
}>;
|
|
21
21
|
declare const MerchantMessageTranslationStatusSchema: z.ZodEnum<{
|
|
22
|
-
AVAILABLE: "AVAILABLE";
|
|
23
22
|
FAILED: "FAILED";
|
|
23
|
+
AVAILABLE: "AVAILABLE";
|
|
24
24
|
PENDING: "PENDING";
|
|
25
25
|
}>;
|
|
26
26
|
declare const MerchantTranslationBatchStatusSchema: z.ZodEnum<{
|
|
@@ -39,8 +39,8 @@ declare const MerchantTranslationReconciliationScopeSchema: z.ZodEnum<{
|
|
|
39
39
|
FAILED_TRANSLATIONS: "FAILED_TRANSLATIONS";
|
|
40
40
|
}>;
|
|
41
41
|
declare const MerchantTranslationReconciliationStatusSchema: z.ZodEnum<{
|
|
42
|
-
PROCESSING: "PROCESSING";
|
|
43
42
|
FAILED: "FAILED";
|
|
43
|
+
PROCESSING: "PROCESSING";
|
|
44
44
|
PENDING: "PENDING";
|
|
45
45
|
COMPLETED: "COMPLETED";
|
|
46
46
|
}>;
|
|
@@ -61,9 +61,9 @@ declare const MerchantSupportMessageContractSchema: z.ZodObject<{
|
|
|
61
61
|
MERCHANT: "MERCHANT";
|
|
62
62
|
}>;
|
|
63
63
|
state: z.ZodEnum<{
|
|
64
|
+
FAILED: "FAILED";
|
|
64
65
|
PROCESSING: "PROCESSING";
|
|
65
66
|
AVAILABLE: "AVAILABLE";
|
|
66
|
-
FAILED: "FAILED";
|
|
67
67
|
}>;
|
|
68
68
|
originalBody: z.ZodString;
|
|
69
69
|
sourceLanguageTag: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
@@ -78,8 +78,8 @@ declare const MerchantMessageTranslationContractSchema: z.ZodObject<{
|
|
|
78
78
|
sourceLanguageTag: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
79
79
|
targetLanguageTag: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
80
80
|
status: z.ZodEnum<{
|
|
81
|
-
AVAILABLE: "AVAILABLE";
|
|
82
81
|
FAILED: "FAILED";
|
|
82
|
+
AVAILABLE: "AVAILABLE";
|
|
83
83
|
PENDING: "PENDING";
|
|
84
84
|
}>;
|
|
85
85
|
translatedBody: z.ZodNullable<z.ZodString>;
|
|
@@ -110,8 +110,8 @@ declare const MerchantTranslationReconciliationRequestContractSchema: z.ZodObjec
|
|
|
110
110
|
}>;
|
|
111
111
|
translationId: z.ZodNullable<z.ZodString>;
|
|
112
112
|
status: z.ZodEnum<{
|
|
113
|
-
PROCESSING: "PROCESSING";
|
|
114
113
|
FAILED: "FAILED";
|
|
114
|
+
PROCESSING: "PROCESSING";
|
|
115
115
|
PENDING: "PENDING";
|
|
116
116
|
COMPLETED: "COMPLETED";
|
|
117
117
|
}>;
|
package/dist/shopify/index.d.ts
CHANGED
|
@@ -384,9 +384,9 @@ declare const ShopifyCheckoutCreatedEventV2Schema: z.ZodObject<{
|
|
|
384
384
|
internationalContext: z.ZodOptional<z.ZodObject<{
|
|
385
385
|
languageTag: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
386
386
|
languageSource: z.ZodNullable<z.ZodEnum<{
|
|
387
|
+
shopify: "shopify";
|
|
387
388
|
"customer-explicit": "customer-explicit";
|
|
388
389
|
detected: "detected";
|
|
389
|
-
shopify: "shopify";
|
|
390
390
|
"merchant-default": "merchant-default";
|
|
391
391
|
"platform-default": "platform-default";
|
|
392
392
|
}>>;
|
|
@@ -421,9 +421,9 @@ declare const ShopifyCartActivityEventV2Schema: z.ZodObject<{
|
|
|
421
421
|
internationalContext: z.ZodOptional<z.ZodObject<{
|
|
422
422
|
languageTag: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
423
423
|
languageSource: z.ZodNullable<z.ZodEnum<{
|
|
424
|
+
shopify: "shopify";
|
|
424
425
|
"customer-explicit": "customer-explicit";
|
|
425
426
|
detected: "detected";
|
|
426
|
-
shopify: "shopify";
|
|
427
427
|
"merchant-default": "merchant-default";
|
|
428
428
|
"platform-default": "platform-default";
|
|
429
429
|
}>>;
|
|
@@ -456,9 +456,9 @@ declare const ShopifyCheckoutUpdatedEventV2Schema: z.ZodObject<{
|
|
|
456
456
|
internationalContext: z.ZodOptional<z.ZodObject<{
|
|
457
457
|
languageTag: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
458
458
|
languageSource: z.ZodNullable<z.ZodEnum<{
|
|
459
|
+
shopify: "shopify";
|
|
459
460
|
"customer-explicit": "customer-explicit";
|
|
460
461
|
detected: "detected";
|
|
461
|
-
shopify: "shopify";
|
|
462
462
|
"merchant-default": "merchant-default";
|
|
463
463
|
"platform-default": "platform-default";
|
|
464
464
|
}>>;
|
|
@@ -490,9 +490,9 @@ declare const ShopifyOrderCompletedEventV2Schema: z.ZodObject<{
|
|
|
490
490
|
internationalContext: z.ZodOptional<z.ZodObject<{
|
|
491
491
|
languageTag: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
492
492
|
languageSource: z.ZodNullable<z.ZodEnum<{
|
|
493
|
+
shopify: "shopify";
|
|
493
494
|
"customer-explicit": "customer-explicit";
|
|
494
495
|
detected: "detected";
|
|
495
|
-
shopify: "shopify";
|
|
496
496
|
"merchant-default": "merchant-default";
|
|
497
497
|
"platform-default": "platform-default";
|
|
498
498
|
}>>;
|
|
@@ -527,9 +527,9 @@ declare const ShopifyRecoveryEventV2Schema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
527
527
|
internationalContext: z.ZodOptional<z.ZodObject<{
|
|
528
528
|
languageTag: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
529
529
|
languageSource: z.ZodNullable<z.ZodEnum<{
|
|
530
|
+
shopify: "shopify";
|
|
530
531
|
"customer-explicit": "customer-explicit";
|
|
531
532
|
detected: "detected";
|
|
532
|
-
shopify: "shopify";
|
|
533
533
|
"merchant-default": "merchant-default";
|
|
534
534
|
"platform-default": "platform-default";
|
|
535
535
|
}>>;
|
|
@@ -560,9 +560,9 @@ declare const ShopifyRecoveryEventV2Schema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
560
560
|
internationalContext: z.ZodOptional<z.ZodObject<{
|
|
561
561
|
languageTag: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
562
562
|
languageSource: z.ZodNullable<z.ZodEnum<{
|
|
563
|
+
shopify: "shopify";
|
|
563
564
|
"customer-explicit": "customer-explicit";
|
|
564
565
|
detected: "detected";
|
|
565
|
-
shopify: "shopify";
|
|
566
566
|
"merchant-default": "merchant-default";
|
|
567
567
|
"platform-default": "platform-default";
|
|
568
568
|
}>>;
|
|
@@ -595,9 +595,9 @@ declare const ShopifyRecoveryEventV2Schema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
595
595
|
internationalContext: z.ZodOptional<z.ZodObject<{
|
|
596
596
|
languageTag: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
597
597
|
languageSource: z.ZodNullable<z.ZodEnum<{
|
|
598
|
+
shopify: "shopify";
|
|
598
599
|
"customer-explicit": "customer-explicit";
|
|
599
600
|
detected: "detected";
|
|
600
|
-
shopify: "shopify";
|
|
601
601
|
"merchant-default": "merchant-default";
|
|
602
602
|
"platform-default": "platform-default";
|
|
603
603
|
}>>;
|
|
@@ -627,9 +627,9 @@ declare const ShopifyRecoveryEventV2Schema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
627
627
|
internationalContext: z.ZodOptional<z.ZodObject<{
|
|
628
628
|
languageTag: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
629
629
|
languageSource: z.ZodNullable<z.ZodEnum<{
|
|
630
|
+
shopify: "shopify";
|
|
630
631
|
"customer-explicit": "customer-explicit";
|
|
631
632
|
detected: "detected";
|
|
632
|
-
shopify: "shopify";
|
|
633
633
|
"merchant-default": "merchant-default";
|
|
634
634
|
"platform-default": "platform-default";
|
|
635
635
|
}>>;
|
|
@@ -672,7 +672,7 @@ declare function safeParseShopifyRecoveryEventV2(input: unknown): z.ZodSafeParse
|
|
|
672
672
|
};
|
|
673
673
|
internationalContext?: {
|
|
674
674
|
languageTag: string | null;
|
|
675
|
-
languageSource: "
|
|
675
|
+
languageSource: "shopify" | "customer-explicit" | "detected" | "merchant-default" | "platform-default" | null;
|
|
676
676
|
countryCode: string | null;
|
|
677
677
|
currencyCode: string | null;
|
|
678
678
|
timeZone: string | null;
|
|
@@ -699,7 +699,7 @@ declare function safeParseShopifyRecoveryEventV2(input: unknown): z.ZodSafeParse
|
|
|
699
699
|
};
|
|
700
700
|
internationalContext?: {
|
|
701
701
|
languageTag: string | null;
|
|
702
|
-
languageSource: "
|
|
702
|
+
languageSource: "shopify" | "customer-explicit" | "detected" | "merchant-default" | "platform-default" | null;
|
|
703
703
|
countryCode: string | null;
|
|
704
704
|
currencyCode: string | null;
|
|
705
705
|
timeZone: string | null;
|
|
@@ -725,7 +725,7 @@ declare function safeParseShopifyRecoveryEventV2(input: unknown): z.ZodSafeParse
|
|
|
725
725
|
};
|
|
726
726
|
internationalContext?: {
|
|
727
727
|
languageTag: string | null;
|
|
728
|
-
languageSource: "
|
|
728
|
+
languageSource: "shopify" | "customer-explicit" | "detected" | "merchant-default" | "platform-default" | null;
|
|
729
729
|
countryCode: string | null;
|
|
730
730
|
currencyCode: string | null;
|
|
731
731
|
timeZone: string | null;
|
|
@@ -754,7 +754,7 @@ declare function safeParseShopifyRecoveryEventV2(input: unknown): z.ZodSafeParse
|
|
|
754
754
|
};
|
|
755
755
|
internationalContext?: {
|
|
756
756
|
languageTag: string | null;
|
|
757
|
-
languageSource: "
|
|
757
|
+
languageSource: "shopify" | "customer-explicit" | "detected" | "merchant-default" | "platform-default" | null;
|
|
758
758
|
countryCode: string | null;
|
|
759
759
|
currencyCode: string | null;
|
|
760
760
|
timeZone: string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modainteract/moda-interact-shared",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"types": "./dist/internationalization.d.ts",
|
|
17
17
|
"import": "./dist/internationalization.js"
|
|
18
18
|
},
|
|
19
|
+
"./billing": {
|
|
20
|
+
"types": "./dist/billing.d.ts",
|
|
21
|
+
"import": "./dist/billing.js"
|
|
22
|
+
},
|
|
19
23
|
"./merchant-communications": {
|
|
20
24
|
"types": "./dist/merchant-communications.d.ts",
|
|
21
25
|
"import": "./dist/merchant-communications.js"
|