@modainteract/moda-interact-shared 3.0.0 → 3.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.
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+
3
+ /** Version shared by hosted Woo API and Shopify response-delay settings. */
4
+ declare const AI_RESPONSE_DELAY_SCHEMA_VERSION: 1;
5
+ /** Merchant-selected additional wait before an AI reply; human replies are not delayed. */
6
+ declare const AiResponseDelayMinutesSchema: z.ZodNumber;
7
+ /** Wire revision shape. Consumers must also validate that timestamp values parse as real dates. */
8
+ declare const AiResponseDelayRevisionSchema: z.ZodUnion<readonly [z.ZodLiteral<"UNCONFIGURED">, z.ZodString]>;
9
+ /** Canonical GET and successful PUT response shared by hosted Woo API and Shopify. */
10
+ declare const MerchantAiResponseDelayReadV1Schema: z.ZodObject<{
11
+ schemaVersion: z.ZodLiteral<1>;
12
+ revision: z.ZodUnion<readonly [z.ZodLiteral<"UNCONFIGURED">, z.ZodString]>;
13
+ aiResponseDelayMinutes: z.ZodNumber;
14
+ }, z.core.$strict>;
15
+ /** Canonical optimistic-concurrency PUT request shared by hosted Woo API and Shopify. */
16
+ declare const MerchantAiResponseDelayWriteV1Schema: z.ZodObject<{
17
+ schemaVersion: z.ZodLiteral<1>;
18
+ expectedRevision: z.ZodUnion<readonly [z.ZodLiteral<"UNCONFIGURED">, z.ZodString]>;
19
+ aiResponseDelayMinutes: z.ZodNumber;
20
+ }, z.core.$strict>;
21
+ type AiResponseDelayMinutes = z.infer<typeof AiResponseDelayMinutesSchema>;
22
+ type AiResponseDelayRevision = z.infer<typeof AiResponseDelayRevisionSchema>;
23
+ type MerchantAiResponseDelayReadV1 = z.infer<typeof MerchantAiResponseDelayReadV1Schema>;
24
+ type MerchantAiResponseDelayWriteV1 = z.infer<typeof MerchantAiResponseDelayWriteV1Schema>;
25
+
26
+ export { AI_RESPONSE_DELAY_SCHEMA_VERSION, type AiResponseDelayMinutes, AiResponseDelayMinutesSchema, type AiResponseDelayRevision, AiResponseDelayRevisionSchema, type MerchantAiResponseDelayReadV1, MerchantAiResponseDelayReadV1Schema, type MerchantAiResponseDelayWriteV1, MerchantAiResponseDelayWriteV1Schema };
@@ -0,0 +1,26 @@
1
+ // src/ai-response-delay.ts
2
+ import { z } from "zod";
3
+ var AI_RESPONSE_DELAY_SCHEMA_VERSION = 1;
4
+ var AiResponseDelayMinutesSchema = z.number().int().min(0).max(30);
5
+ var AiResponseDelayRevisionSchema = z.union([
6
+ z.literal("UNCONFIGURED"),
7
+ z.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/)
8
+ ]);
9
+ var MerchantAiResponseDelayReadV1Schema = z.strictObject({
10
+ schemaVersion: z.literal(AI_RESPONSE_DELAY_SCHEMA_VERSION),
11
+ revision: AiResponseDelayRevisionSchema,
12
+ aiResponseDelayMinutes: AiResponseDelayMinutesSchema
13
+ });
14
+ var MerchantAiResponseDelayWriteV1Schema = z.strictObject({
15
+ schemaVersion: z.literal(AI_RESPONSE_DELAY_SCHEMA_VERSION),
16
+ expectedRevision: AiResponseDelayRevisionSchema,
17
+ aiResponseDelayMinutes: AiResponseDelayMinutesSchema
18
+ });
19
+ export {
20
+ AI_RESPONSE_DELAY_SCHEMA_VERSION,
21
+ AiResponseDelayMinutesSchema,
22
+ AiResponseDelayRevisionSchema,
23
+ MerchantAiResponseDelayReadV1Schema,
24
+ MerchantAiResponseDelayWriteV1Schema
25
+ };
26
+ //# sourceMappingURL=ai-response-delay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ai-response-delay.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/** Version shared by hosted Woo API and Shopify response-delay settings. */\nexport const AI_RESPONSE_DELAY_SCHEMA_VERSION = 1 as const;\n\n/** Merchant-selected additional wait before an AI reply; human replies are not delayed. */\nexport const AiResponseDelayMinutesSchema = z.number().int().min(0).max(30);\n\n/** Wire revision shape. Consumers must also validate that timestamp values parse as real dates. */\nexport const AiResponseDelayRevisionSchema = z.union([\n z.literal(\"UNCONFIGURED\"),\n z.string().regex(/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$/),\n]);\n\n/** Canonical GET and successful PUT response shared by hosted Woo API and Shopify. */\nexport const MerchantAiResponseDelayReadV1Schema = z.strictObject({\n schemaVersion: z.literal(AI_RESPONSE_DELAY_SCHEMA_VERSION),\n revision: AiResponseDelayRevisionSchema,\n aiResponseDelayMinutes: AiResponseDelayMinutesSchema,\n});\n\n/** Canonical optimistic-concurrency PUT request shared by hosted Woo API and Shopify. */\nexport const MerchantAiResponseDelayWriteV1Schema = z.strictObject({\n schemaVersion: z.literal(AI_RESPONSE_DELAY_SCHEMA_VERSION),\n expectedRevision: AiResponseDelayRevisionSchema,\n aiResponseDelayMinutes: AiResponseDelayMinutesSchema,\n});\n\nexport type AiResponseDelayMinutes =\n z.infer<typeof AiResponseDelayMinutesSchema>;\nexport type AiResponseDelayRevision =\n z.infer<typeof AiResponseDelayRevisionSchema>;\nexport type MerchantAiResponseDelayReadV1 =\n z.infer<typeof MerchantAiResponseDelayReadV1Schema>;\nexport type MerchantAiResponseDelayWriteV1 =\n z.infer<typeof MerchantAiResponseDelayWriteV1Schema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAGX,IAAM,mCAAmC;AAGzC,IAAM,+BAA+B,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE;AAGnE,IAAM,gCAAgC,EAAE,MAAM;AAAA,EACnD,EAAE,QAAQ,cAAc;AAAA,EACxB,EAAE,OAAO,EAAE,MAAM,+CAA+C;AAClE,CAAC;AAGM,IAAM,sCAAsC,EAAE,aAAa;AAAA,EAChE,eAAe,EAAE,QAAQ,gCAAgC;AAAA,EACzD,UAAU;AAAA,EACV,wBAAwB;AAC1B,CAAC;AAGM,IAAM,uCAAuC,EAAE,aAAa;AAAA,EACjE,eAAe,EAAE,QAAQ,gCAAgC;AAAA,EACzD,kBAAkB;AAAA,EAClB,wBAAwB;AAC1B,CAAC;","names":[]}
package/dist/index.js CHANGED
@@ -1,3 +1,29 @@
1
+ import {
2
+ AuthoredSupportBodySchema,
3
+ MERCHANT_COMMUNICATIONS_JOB_NAMES,
4
+ MERCHANT_COMMUNICATIONS_QUEUE_NAME,
5
+ MERCHANT_COMMUNICATIONS_SCHEMA_VERSION,
6
+ MerchantMessageTranslationContractSchema,
7
+ MerchantMessageTranslationStatusSchema,
8
+ MerchantSupportMessageContractSchema,
9
+ MerchantSupportMessageKindSchema,
10
+ MerchantSupportMessageStateSchema,
11
+ MerchantTranslationBatchContractSchema,
12
+ MerchantTranslationBatchStatusSchema,
13
+ MerchantTranslationDirectionSchema,
14
+ MerchantTranslationReconciliationRequestContractSchema,
15
+ MerchantTranslationReconciliationScopeSchema,
16
+ MerchantTranslationReconciliationStatusSchema,
17
+ PLATFORM_SUPPORT_LANGUAGE_TAG,
18
+ TranslatedSupportBodySchema,
19
+ TranslationBatchPollJobSchema,
20
+ TranslationBatchResultsJobSchema,
21
+ TranslationBatchSubmitJobSchema,
22
+ TranslationDispatchJobSchema,
23
+ TranslationReconcileJobSchema,
24
+ countUnicodeGraphemes,
25
+ requiresMerchantTranslation
26
+ } from "./chunk-OU6ASX5V.js";
1
27
  import {
2
28
  CheckoutCreatedPayloadV2Schema,
3
29
  CheckoutObservedPayloadSchema,
@@ -106,32 +132,6 @@ import {
106
132
  parseEffectiveRecoveryPolicy,
107
133
  safeParseEffectiveRecoveryPolicy
108
134
  } from "./chunk-RVJPH6B7.js";
109
- import {
110
- AuthoredSupportBodySchema,
111
- MERCHANT_COMMUNICATIONS_JOB_NAMES,
112
- MERCHANT_COMMUNICATIONS_QUEUE_NAME,
113
- MERCHANT_COMMUNICATIONS_SCHEMA_VERSION,
114
- MerchantMessageTranslationContractSchema,
115
- MerchantMessageTranslationStatusSchema,
116
- MerchantSupportMessageContractSchema,
117
- MerchantSupportMessageKindSchema,
118
- MerchantSupportMessageStateSchema,
119
- MerchantTranslationBatchContractSchema,
120
- MerchantTranslationBatchStatusSchema,
121
- MerchantTranslationDirectionSchema,
122
- MerchantTranslationReconciliationRequestContractSchema,
123
- MerchantTranslationReconciliationScopeSchema,
124
- MerchantTranslationReconciliationStatusSchema,
125
- PLATFORM_SUPPORT_LANGUAGE_TAG,
126
- TranslatedSupportBodySchema,
127
- TranslationBatchPollJobSchema,
128
- TranslationBatchResultsJobSchema,
129
- TranslationBatchSubmitJobSchema,
130
- TranslationDispatchJobSchema,
131
- TranslationReconcileJobSchema,
132
- countUnicodeGraphemes,
133
- requiresMerchantTranslation
134
- } from "./chunk-OU6ASX5V.js";
135
135
  import {
136
136
  CountryCodeSchema,
137
137
  CurrencyCodeSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modainteract/moda-interact-shared",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -24,6 +24,10 @@
24
24
  "types": "./dist/recovery-policy.d.ts",
25
25
  "import": "./dist/recovery-policy.js"
26
26
  },
27
+ "./ai-response-delay": {
28
+ "types": "./dist/ai-response-delay.d.ts",
29
+ "import": "./dist/ai-response-delay.js"
30
+ },
27
31
  "./recovery-offer-proof": {
28
32
  "types": "./dist/recovery-offer-proof.d.ts",
29
33
  "import": "./dist/recovery-offer-proof.js"