@loczer/storefront-sdk 0.155.0 → 0.156.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.
- package/dist/index.d.ts +8 -0
- package/dist/lib/contactForm.d.ts +8 -0
- package/dist/lib/contactForm.d.ts.map +1 -1
- package/dist/lib/contactForm.js +21 -13
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2494,6 +2494,14 @@ export declare type ResponsePayload = z.infer<typeof responseSchema>;
|
|
|
2494
2494
|
export declare const responseSchema: z.ZodObject<{
|
|
2495
2495
|
success: z.ZodBoolean;
|
|
2496
2496
|
error: z.ZodOptional<z.ZodString>;
|
|
2497
|
+
emailPayload: z.ZodOptional<z.ZodObject<{
|
|
2498
|
+
from: z.ZodString;
|
|
2499
|
+
replyTo: z.ZodOptional<z.ZodString>;
|
|
2500
|
+
to: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
2501
|
+
subject: z.ZodString;
|
|
2502
|
+
html: z.ZodOptional<z.ZodString>;
|
|
2503
|
+
text: z.ZodOptional<z.ZodString>;
|
|
2504
|
+
}, z.core.$strip>>;
|
|
2497
2505
|
}, z.core.$strip>;
|
|
2498
2506
|
|
|
2499
2507
|
export declare type RichText = z.infer<typeof richTextSchema>;
|
|
@@ -11,6 +11,14 @@ export type RequestPayload = z.infer<typeof requestSchema>;
|
|
|
11
11
|
export declare const responseSchema: z.ZodObject<{
|
|
12
12
|
success: z.ZodBoolean;
|
|
13
13
|
error: z.ZodOptional<z.ZodString>;
|
|
14
|
+
emailPayload: z.ZodOptional<z.ZodObject<{
|
|
15
|
+
from: z.ZodString;
|
|
16
|
+
replyTo: z.ZodOptional<z.ZodString>;
|
|
17
|
+
to: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
18
|
+
subject: z.ZodString;
|
|
19
|
+
html: z.ZodOptional<z.ZodString>;
|
|
20
|
+
text: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
14
22
|
}, z.core.$strip>;
|
|
15
23
|
export type ResponsePayload = z.infer<typeof responseSchema>;
|
|
16
24
|
//# sourceMappingURL=contactForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contactForm.d.ts","sourceRoot":"","sources":["../../src/lib/contactForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,KAAK,wCAAwC,CAAA;AAE1D,eAAO,MAAM,aAAa;;;;;;iBAMxB,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"contactForm.d.ts","sourceRoot":"","sources":["../../src/lib/contactForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,KAAK,wCAAwC,CAAA;AAE1D,eAAO,MAAM,aAAa;;;;;;iBAMxB,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAW1D,eAAO,MAAM,cAAc;;;;;;;;;;;iBAIzB,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
|
package/dist/lib/contactForm.js
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import { z as
|
|
2
|
-
const
|
|
3
|
-
storeSlug:
|
|
4
|
-
name:
|
|
5
|
-
emailAddress:
|
|
6
|
-
phoneNumber:
|
|
7
|
-
message:
|
|
8
|
-
}),
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { z as t } from "zod";
|
|
2
|
+
const i = "/api/public/storefront/contact-form", n = t.object({
|
|
3
|
+
storeSlug: t.string().trim().min(1).toLowerCase(),
|
|
4
|
+
name: t.string().trim().min(1),
|
|
5
|
+
emailAddress: t.string().trim().email(),
|
|
6
|
+
phoneNumber: t.string().trim().min(6),
|
|
7
|
+
message: t.string().trim().min(1).max(8192)
|
|
8
|
+
}), o = t.object({
|
|
9
|
+
from: t.string(),
|
|
10
|
+
replyTo: t.string().optional(),
|
|
11
|
+
to: t.union([t.string(), t.array(t.string())]),
|
|
12
|
+
subject: t.string(),
|
|
13
|
+
html: t.string().optional(),
|
|
14
|
+
text: t.string().optional()
|
|
15
|
+
}), e = t.object({
|
|
16
|
+
success: t.boolean(),
|
|
17
|
+
error: t.string().optional(),
|
|
18
|
+
emailPayload: o.optional()
|
|
11
19
|
});
|
|
12
20
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
21
|
+
i as ROUTE,
|
|
22
|
+
n as requestSchema,
|
|
23
|
+
e as responseSchema
|
|
16
24
|
};
|