@absolutejs/commerce 0.3.0-beta.0 → 0.5.0-beta.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/core/email.d.ts +51 -0
- package/dist/drizzle/index.d.ts +1737 -424
- package/dist/drizzle/index.js +163 -2
- package/dist/drizzle/queries.d.ts +1784 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +79 -0
- package/package.json +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type EmailMessage = {
|
|
2
|
+
to: string;
|
|
3
|
+
subject: string;
|
|
4
|
+
html: string;
|
|
5
|
+
};
|
|
6
|
+
export type EmailProvider = {
|
|
7
|
+
send(message: EmailMessage): Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
export type EmailTheme = {
|
|
10
|
+
brandName: string;
|
|
11
|
+
tagline?: string;
|
|
12
|
+
footerNote?: string;
|
|
13
|
+
colors: {
|
|
14
|
+
ink: string;
|
|
15
|
+
accent: string;
|
|
16
|
+
gold: string;
|
|
17
|
+
paper: string;
|
|
18
|
+
card: string;
|
|
19
|
+
muted: string;
|
|
20
|
+
hairline: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare const DEFAULT_EMAIL_THEME: EmailTheme;
|
|
24
|
+
/** A short, human order reference derived from a session id. */
|
|
25
|
+
export declare const orderNumber: (sessionId: string) => string;
|
|
26
|
+
/** Format a minor-unit amount for display (null → em dash). */
|
|
27
|
+
export declare const formatMoneyCents: (cents: number | null, currency?: string | null) => string;
|
|
28
|
+
/** A carrier tracking URL, or '' for an unknown carrier. */
|
|
29
|
+
export declare const carrierTrackingUrl: (carrier: string, trackingNumber: string) => string;
|
|
30
|
+
/** A branded call-to-action button (inline-styled for email clients). */
|
|
31
|
+
export declare const emailButton: (theme: EmailTheme, href: string, label: string) => string;
|
|
32
|
+
export type EmailLineItem = {
|
|
33
|
+
label: string;
|
|
34
|
+
amountCents: number;
|
|
35
|
+
};
|
|
36
|
+
export type LineItemsOptions = {
|
|
37
|
+
currency?: string | null;
|
|
38
|
+
totalCents?: number | null;
|
|
39
|
+
totalLabel?: string;
|
|
40
|
+
};
|
|
41
|
+
/** A line-items table with an optional total row. */
|
|
42
|
+
export declare const emailLineItems: (theme: EmailTheme, items: EmailLineItem[], options?: LineItemsOptions) => string;
|
|
43
|
+
export type RenderEmailArgs = {
|
|
44
|
+
preheader: string;
|
|
45
|
+
heading: string;
|
|
46
|
+
intro: string;
|
|
47
|
+
/** Pre-built inner HTML (line tables, buttons, paragraphs). */
|
|
48
|
+
inner?: string;
|
|
49
|
+
};
|
|
50
|
+
/** Wrap content in the branded, responsive email shell. */
|
|
51
|
+
export declare const renderEmail: (theme: EmailTheme, { preheader, heading, intro, inner }: RenderEmailArgs) => string;
|