@stackframe/stack-shared 2.8.25 → 2.8.27
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/CHANGELOG.md +12 -0
- package/dist/config/format.d.mts +20 -5
- package/dist/config/format.d.ts +20 -5
- package/dist/config/format.js +39 -14
- package/dist/config/format.js.map +1 -1
- package/dist/config/schema.d.mts +795 -317
- package/dist/config/schema.d.ts +795 -317
- package/dist/config/schema.js +471 -84
- package/dist/config/schema.js.map +1 -1
- package/dist/crud.d.mts +1 -0
- package/dist/crud.d.ts +1 -0
- package/dist/esm/config/format.js +37 -14
- package/dist/esm/config/format.js.map +1 -1
- package/dist/esm/config/schema.js +460 -80
- package/dist/esm/config/schema.js.map +1 -1
- package/dist/esm/helpers/emails.js +136 -30
- package/dist/esm/helpers/emails.js.map +1 -1
- package/dist/esm/interface/admin-interface.js +19 -29
- package/dist/esm/interface/admin-interface.js.map +1 -1
- package/dist/esm/known-errors.js +24 -1
- package/dist/esm/known-errors.js.map +1 -1
- package/dist/esm/schema-fields.js +92 -27
- package/dist/esm/schema-fields.js.map +1 -1
- package/dist/esm/utils/currencies.js +52 -0
- package/dist/esm/utils/currencies.js.map +1 -0
- package/dist/esm/utils/dates.js +55 -1
- package/dist/esm/utils/dates.js.map +1 -1
- package/dist/esm/utils/errors.js.map +1 -1
- package/dist/esm/utils/objects.js +2 -0
- package/dist/esm/utils/objects.js.map +1 -1
- package/dist/esm/utils/strings.js +4 -0
- package/dist/esm/utils/strings.js.map +1 -1
- package/dist/esm/utils/types.js +45 -0
- package/dist/esm/utils/types.js.map +1 -1
- package/dist/helpers/emails.d.mts +32 -6
- package/dist/helpers/emails.d.ts +32 -6
- package/dist/helpers/emails.js +138 -30
- package/dist/helpers/emails.js.map +1 -1
- package/dist/helpers/password.d.mts +1 -0
- package/dist/helpers/password.d.ts +1 -0
- package/dist/helpers/production-mode.d.mts +1 -0
- package/dist/helpers/production-mode.d.ts +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/interface/admin-interface.d.mts +8 -8
- package/dist/interface/admin-interface.d.ts +8 -8
- package/dist/interface/admin-interface.js +19 -29
- package/dist/interface/admin-interface.js.map +1 -1
- package/dist/interface/client-interface.d.mts +1 -0
- package/dist/interface/client-interface.d.ts +1 -0
- package/dist/interface/crud/connected-accounts.d.mts +1 -0
- package/dist/interface/crud/connected-accounts.d.ts +1 -0
- package/dist/interface/crud/contact-channels.d.mts +1 -0
- package/dist/interface/crud/contact-channels.d.ts +1 -0
- package/dist/interface/crud/current-user.d.mts +1 -0
- package/dist/interface/crud/current-user.d.ts +1 -0
- package/dist/interface/crud/email-templates.d.mts +1 -0
- package/dist/interface/crud/email-templates.d.ts +1 -0
- package/dist/interface/crud/emails.d.mts +1 -0
- package/dist/interface/crud/emails.d.ts +1 -0
- package/dist/interface/crud/internal-api-keys.d.mts +1 -0
- package/dist/interface/crud/internal-api-keys.d.ts +1 -0
- package/dist/interface/crud/notification-preferences.d.mts +1 -0
- package/dist/interface/crud/notification-preferences.d.ts +1 -0
- package/dist/interface/crud/oauth-providers.d.mts +5 -4
- package/dist/interface/crud/oauth-providers.d.ts +5 -4
- package/dist/interface/crud/project-api-keys.d.mts +3 -2
- package/dist/interface/crud/project-api-keys.d.ts +3 -2
- package/dist/interface/crud/project-permissions.d.mts +1 -0
- package/dist/interface/crud/project-permissions.d.ts +1 -0
- package/dist/interface/crud/projects.d.mts +8 -7
- package/dist/interface/crud/projects.d.ts +8 -7
- package/dist/interface/crud/sessions.d.mts +1 -0
- package/dist/interface/crud/sessions.d.ts +1 -0
- package/dist/interface/crud/svix-token.d.mts +1 -0
- package/dist/interface/crud/svix-token.d.ts +1 -0
- package/dist/interface/crud/team-invitation-details.d.mts +1 -0
- package/dist/interface/crud/team-invitation-details.d.ts +1 -0
- package/dist/interface/crud/team-invitation.d.mts +1 -0
- package/dist/interface/crud/team-invitation.d.ts +1 -0
- package/dist/interface/crud/team-member-profiles.d.mts +1 -0
- package/dist/interface/crud/team-member-profiles.d.ts +1 -0
- package/dist/interface/crud/team-memberships.d.mts +1 -0
- package/dist/interface/crud/team-memberships.d.ts +1 -0
- package/dist/interface/crud/team-permissions.d.mts +1 -0
- package/dist/interface/crud/team-permissions.d.ts +1 -0
- package/dist/interface/crud/teams.d.mts +1 -0
- package/dist/interface/crud/teams.d.ts +1 -0
- package/dist/interface/crud/users.d.mts +1 -0
- package/dist/interface/crud/users.d.ts +1 -0
- package/dist/interface/server-interface.d.mts +1 -0
- package/dist/interface/server-interface.d.ts +1 -0
- package/dist/known-errors.d.mts +6 -0
- package/dist/known-errors.d.ts +6 -0
- package/dist/known-errors.js +24 -1
- package/dist/known-errors.js.map +1 -1
- package/dist/schema-fields.d.mts +39 -8
- package/dist/schema-fields.d.ts +39 -8
- package/dist/schema-fields.js +101 -27
- package/dist/schema-fields.js.map +1 -1
- package/dist/utils/currencies.d.mts +39 -0
- package/dist/utils/currencies.d.ts +39 -0
- package/dist/utils/currencies.js +78 -0
- package/dist/utils/currencies.js.map +1 -0
- package/dist/utils/dates.d.mts +5 -1
- package/dist/utils/dates.d.ts +5 -1
- package/dist/utils/dates.js +58 -2
- package/dist/utils/dates.js.map +1 -1
- package/dist/utils/errors.d.mts +9 -0
- package/dist/utils/errors.d.ts +9 -0
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/objects.d.mts +23 -8
- package/dist/utils/objects.d.ts +23 -8
- package/dist/utils/objects.js +2 -0
- package/dist/utils/objects.js.map +1 -1
- package/dist/utils/strings.d.mts +3 -1
- package/dist/utils/strings.d.ts +3 -1
- package/dist/utils/strings.js +5 -0
- package/dist/utils/strings.js.map +1 -1
- package/dist/utils/types.d.mts +73 -2
- package/dist/utils/types.d.ts +73 -2
- package/dist/utils/types.js +54 -0
- package/dist/utils/types.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/utils/types.js
CHANGED
|
@@ -1 +1,46 @@
|
|
|
1
|
+
// src/utils/types.tsx
|
|
2
|
+
typeAssertIs()();
|
|
3
|
+
typeAssertIs()();
|
|
4
|
+
typeAssertIs()();
|
|
5
|
+
function typeAssert() {
|
|
6
|
+
return () => void 0;
|
|
7
|
+
}
|
|
8
|
+
typeAssertExtends()();
|
|
9
|
+
typeAssertExtends()();
|
|
10
|
+
typeAssertExtends()();
|
|
11
|
+
typeAssertExtends()();
|
|
12
|
+
function typeAssertExtends() {
|
|
13
|
+
return () => void 0;
|
|
14
|
+
}
|
|
15
|
+
typeAssertExtends()();
|
|
16
|
+
typeAssertExtends()();
|
|
17
|
+
typeAssertExtends()();
|
|
18
|
+
typeAssertExtends()();
|
|
19
|
+
typeAssertExtends()();
|
|
20
|
+
typeAssertExtends()();
|
|
21
|
+
typeAssertExtends()();
|
|
22
|
+
typeAssertExtends()();
|
|
23
|
+
typeAssertExtends()();
|
|
24
|
+
typeAssertExtends()();
|
|
25
|
+
typeAssertExtends()();
|
|
26
|
+
function typeAssertIs() {
|
|
27
|
+
return () => void 0;
|
|
28
|
+
}
|
|
29
|
+
typeAssertExtends()();
|
|
30
|
+
typeAssertExtends()();
|
|
31
|
+
typeAssertExtends()();
|
|
32
|
+
typeAssertExtends()();
|
|
33
|
+
typeAssertExtends()();
|
|
34
|
+
typeAssertExtends()();
|
|
35
|
+
typeAssertExtends()();
|
|
36
|
+
typeAssertExtends()();
|
|
37
|
+
typeAssertExtends()();
|
|
38
|
+
typeAssertExtends()();
|
|
39
|
+
typeAssertExtends()();
|
|
40
|
+
typeAssertExtends()();
|
|
41
|
+
export {
|
|
42
|
+
typeAssert,
|
|
43
|
+
typeAssertExtends,
|
|
44
|
+
typeAssertIs
|
|
45
|
+
};
|
|
1
46
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/types.tsx"],"sourcesContent":["import { DeepPartial } from \"./objects\";\nimport { Join } from \"./strings\";\n\nexport type IsAny<T> = 0 extends (1 & T) ? true : false;\nexport type IsNever<T> = [T] extends [never] ? true : false;\nexport type IsNullish<T> = [T] extends [null | undefined] ? true : false;\nexport type IsUnion<T, U = T> =\n IsNever<T> extends true ? false\n : IsAny<T> extends true ? false\n : T extends U // distributive conditional https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types\n ? /* if the *whole* original type (`U`) still fits inside the current variant, then `T` wasn’t a union */ ([U] extends [T] ? false : true)\n : never;\n\nexport type NullishCoalesce<T, U> = T extends null | undefined ? U : T;\n\nexport type LastUnionElement<U> = UnionToIntersection<U extends any ? (x: U) => 0 : never> extends (x: infer L) => 0 ? L & U : never;\n\n/**\n * Makes a type prettier by recursively expanding all object types. For example, `Omit<{ a: 1 }, \"a\">` becomes just `{}`.\n */\nexport type Expand<T> = T extends (...args: infer A) => infer R\n ? (\n ((...args: A) => R) extends T\n ? (...args: Expand<A>) => Expand<R>\n : ((...args: Expand<A>) => Expand<R>) & { [K in keyof T]: Expand<T[K]> }\n )\n : (\n T extends object\n ? { [K in keyof T]: Expand<T[K]> }\n : T\n );\n\n\n/**\n * Removes all optional undefined/never keys from an object.\n */\nexport type DeepRemoveOptionalUndefined<T> = T extends object ? { [K in keyof T]: DeepRemoveOptionalUndefined<T[K]> } : T;\n\n// why this works: https://stackoverflow.com/a/50375286\nexport type UnionToIntersection<U> =\n (U extends any ? (x: U) => void : never) extends ((x: infer I) => void) ? I : never\n\ntype _UnionToTupleInner<U, R extends any[], Last> = UnionToTuple<Exclude<U, Last>, [...R, Last]>\nexport type UnionToTuple<U, R extends any[] = []> = [U] extends [never] ? R : _UnionToTupleInner<U, R, LastUnionElement<U>>;\n\nexport type CollapseObjectUnion<T extends object> = {\n [K in AllUnionKeys<T>]?: T extends Record<K, infer V> ? V : never;\n};\ntypeAssertIs<CollapseObjectUnion<{ a: string } | { b: number }>, { a?: string, b?: number }>()();\ntypeAssertIs<CollapseObjectUnion<{ a: string } | { a: number }>, { a?: string | number }>()();\n\nexport type IntersectAll<T extends any[]> = UnionToIntersection<T[number]>;\n\nexport type OptionalKeys<T> = {\n [K in keyof T]: {} extends Pick<T, K> ? K : never;\n}[keyof T];\nexport type RequiredKeys<T> = {\n [K in keyof T]: {} extends Pick<T, K> ? never : K;\n}[keyof T];\n\n/**\n * Returns ALL keys of all union elements.\n */\nexport type AllUnionKeys<T extends object> = T extends T ? keyof T : never;\ntypeAssertIs<AllUnionKeys<{ a: string } | { b: number }>, \"a\" | \"b\">()();\n\nexport type SubtractType<T, U> = T extends object ? { [K in keyof T]: K extends keyof U ? SubtractType<T[K], U[K]> : T[K] } : (T extends U ? never : T); // note: this only works due to the distributive property of conditional types https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types\n\n\ntype _AntiIntersectInner<T, U> = T extends object ? (\n & Omit<U, keyof T>\n & { [K in keyof Pick<U, { [K in keyof T & keyof U]: U[K] extends T[K] ? (T[K] extends U[K] ? never : K) : never }[keyof T & keyof U]>]: PseudoAntiIntersect<T[K], U[K]> }\n & { [K in keyof Pick<U, keyof T & keyof U>]?: PseudoAntiIntersect<T[K], U[K]> }\n) : U;\n/**\n * Returns a type R such that T & R = U.\n */\nexport type AntiIntersect<T, U> = U extends T ? _AntiIntersectInner<T, U> : \"Cannot anti-intersect a type with a type that is not a subtype of it\"; // NOTE: This type is mostly untested — not sure how well it works on the edge cases\nexport type PseudoAntiIntersect<T, U> = _AntiIntersectInner<T, T & U>;\n\n/**\n * A variation of TypeScript's conditionals with slightly different semantics. It is the perfect type for cases where:\n *\n * - If all possible values are contained in `Extends`, then it will be mapped to `Then`.\n * - If all possible values are not contained in `Extends`, then it will be mapped to `Otherwise`.\n * - If some possible values are contained in `Extends` and some are not, then it will be mapped to `Then | Otherwise`.\n *\n * This is different from TypeScript's built-in conditional types (`Value extends Extends ? Then : Otherwise`), which\n * returns `Otherwise` for the third case (causing unsoundness in many real-world cases).\n */\nexport type IfAndOnlyIf<Value, Extends, Then, Otherwise> =\n | (Value extends Extends ? never : Otherwise)\n | (Value & Extends extends never ? never : Then);\n\n\n/**\n * Can be used to prettify a type in the IDE; for example, some complicated intersected types can be flattened into a single type.\n */\nexport type PrettifyType<T> = T extends object ? { [K in keyof T]: T[K] } & {} : T;\n\ntype _ToStringAndJoin<T extends any[], Separator extends string> =\n T extends [infer U, ...infer Rest extends any[]]\n ? `${TypeToString<U>}${Rest extends [any, ...any[]] ? `${Separator}${_ToStringAndJoin<Rest, Separator>}` : \"\"}`\n : \"<error-joining-tuple-elements>\";\ntype _TypeToStringInner<T> =\n IsAny<T> extends true ? \"any\"\n : IsNever<T> extends true ? \"never\"\n : IsUnion<T> extends true ? _ToStringAndJoin<UnionToTuple<T>, \" | \">\n : [T] extends [number] ? (number extends T ? \"number\" : `${T}`)\n : [T] extends [boolean] ? `${T}`\n : [T] extends [undefined] ? \"undefined\"\n : [T] extends [null] ? \"null\"\n : [T] extends [string] ? (string extends T ? \"string\" : `'${T}'`)\n : [T] extends [[]] ? \"[]\"\n : [T] extends [[any, ...any[]]] ? `[${_ToStringAndJoin<T, \", \">}]`\n : [T] extends [(infer E)[]] ? `${TypeToString<E>}[]`\n : [T] extends [Function] ? \"function\"\n : [T] extends [symbol] ? `symbol(${T['description']})`\n : [T] extends [object] ? `{ ${Join<UnionToTuple<{ [K in keyof T]: `${TypeToString<K>}: ${TypeToString<T[K]>}` }[keyof T]>, \", \">} }`\n : \"<unknown-type>\"\nexport type TypeToString<T> = _TypeToStringInner<T> extends `${infer S}` ? S : never;\n\n/**\n * Can be used to create assertions on types. For example, if passed any T other than `true`, the following will\n * show a type error:\n *\n * ```ts\n * typeAssert<T>()(); // the second pair of braces is important!\n * ```\n */\nexport function typeAssert<T>(): (\n IsAny<T> extends true ? TypeAssertionError<`Type assertion failed. Expected true, but got any.`>\n : IsNever<T> extends true ? TypeAssertionError<`Type assertion failed. Expected true, but got never.`>\n : T extends true ? (() => undefined)\n : TypeAssertionError<`Type assertion failed. Expected true, but got: ${TypeToString<T>}`>\n) {\n return (() => undefined) as any;\n}\ntype TypeAssertionError<T> =\n & [T]\n & /* this promise makes sure that if we accidentally forget the second pair of braces, eslint will complain (if we have no-floating-promises enabled) */ Promise<any>;\n\n\ntypeAssertExtends<ReturnType<typeof typeAssert<true>>, () => undefined>()();\ntypeAssertExtends<ReturnType<typeof typeAssert<false>>, TypeAssertionError<`Type assertion failed. Expected true, but got: false`>>()();\ntypeAssertExtends<ReturnType<typeof typeAssert<never>>, TypeAssertionError<`Type assertion failed. Expected true, but got never.`>>()();\ntypeAssertExtends<ReturnType<typeof typeAssert<any>>, TypeAssertionError<`Type assertion failed. Expected true, but got any.`>>()();\n\n/**\n * Functionally equivalent to `typeAssert<T extends S ? true : false>()()`, but with better error messages.\n */\nexport function typeAssertExtends<T, S>(): (\n [T] extends [S] ? (() => undefined) : TypeAssertionError<`Type assertion failed. Expected ${TypeToString<T>} to extend ${TypeToString<S>}`>\n) {\n return (() => undefined) as any;\n}\n\ntypeAssertExtends<ReturnType<typeof typeAssertExtends<never, true>>, () => undefined>()();\ntypeAssertExtends<ReturnType<typeof typeAssertExtends<any, true>>, () => undefined>()();\ntypeAssertExtends<ReturnType<typeof typeAssertExtends<false, false>>, () => undefined>()();\ntypeAssertExtends<ReturnType<typeof typeAssertExtends<\"abc\", string>>, () => undefined>()();\ntypeAssertExtends<ReturnType<typeof typeAssertExtends<{a: 1, b: 123}, {a: number}>>, () => undefined>()();\ntypeAssertExtends<ReturnType<typeof typeAssertExtends<never, never>>, () => undefined>()();\ntypeAssertExtends<ReturnType<typeof typeAssertExtends<true, any>>, () => undefined>()();\n\ntypeAssertExtends<ReturnType<typeof typeAssertExtends<{a: number}, {a: 1}>>, [\"Type assertion failed. Expected { 'a': number } to extend { 'a': 1 }\"]>()();\ntypeAssertExtends<ReturnType<typeof typeAssertExtends<any, never>>, [\"Type assertion failed. Expected any to extend never\"]>()();\ntypeAssertExtends<ReturnType<typeof typeAssertExtends<false, true>>, [\"Type assertion failed. Expected false to extend true\"]>()();\ntypeAssertExtends<ReturnType<typeof typeAssertExtends<false, never>>, [\"Type assertion failed. Expected false to extend never\"]>()();\n\n\nexport function typeAssertIs<T, U>(): (\n IsAny<T> extends true ? (IsAny<U> extends true ? (() => undefined) : TypeAssertionError<`Type assertion failed. Expected ${TypeToString<T>} to be ${TypeToString<U>}`>)\n : IsAny<U> extends true ? TypeAssertionError<`Type assertion failed. Expected ${TypeToString<T>} to be ${TypeToString<U>}`>\n : [T] extends [U] ? ([U] extends [T] ? (() => undefined) : TypeAssertionError<`Type assertion failed. Expected ${TypeToString<T>} to be ${TypeToString<U>}`>)\n : TypeAssertionError<`Type assertion failed. Expected ${TypeToString<T>} to be ${TypeToString<U>}`>\n) {\n return (() => undefined) as any;\n}\n\ntypeAssertExtends<ReturnType<typeof typeAssertIs<\"123\", \"123\">>, () => undefined>()();\ntypeAssertExtends<ReturnType<typeof typeAssertIs<{a: 1}, {a: 1}>>, () => undefined>()();\ntypeAssertExtends<ReturnType<typeof typeAssertIs<DeepPartial<{a: 1}>, {a?: 1}>>, () => undefined>()();\ntypeAssertExtends<ReturnType<typeof typeAssertIs<any, any>>, () => undefined>()();\ntypeAssertExtends<ReturnType<typeof typeAssertIs<never, never>>, () => undefined>()();\ntypeAssertExtends<ReturnType<typeof typeAssertIs<1, any>>, [\"Type assertion failed. Expected 1 to be any\"]>()();\ntypeAssertExtends<ReturnType<typeof typeAssertIs<any, 1>>, [\"Type assertion failed. Expected any to be 1\"]>()();\ntypeAssertExtends<ReturnType<typeof typeAssertIs<false, true>>, [\"Type assertion failed. Expected false to be true\"]>()();\ntypeAssertExtends<ReturnType<typeof typeAssertIs<{a: number}, {a: 1}>>, [\"Type assertion failed. Expected { 'a': number } to be { 'a': 1 }\"]>()();\ntypeAssertExtends<ReturnType<typeof typeAssertIs<any, never>>, [\"Type assertion failed. Expected any to be never\"]>()();\ntypeAssertExtends<ReturnType<typeof typeAssertIs<false, true>>, [\"Type assertion failed. Expected false to be true\"]>()();\ntypeAssertExtends<ReturnType<typeof typeAssertIs<false, never>>, [\"Type assertion failed. Expected false to be never\"]>()();\n"],"mappings":";AAgDA,aAA6F,EAAE;AAC/F,aAA0F,EAAE;AAe5F,aAAqE,EAAE;AAkEhE,SAAS,aAKd;AACA,SAAQ,MAAM;AAChB;AAMA,kBAAwE,EAAE;AAC1E,kBAAoI,EAAE;AACtI,kBAAoI,EAAE;AACtI,kBAAgI,EAAE;AAK3H,SAAS,oBAEd;AACA,SAAQ,MAAM;AAChB;AAEA,kBAAsF,EAAE;AACxF,kBAAoF,EAAE;AACtF,kBAAuF,EAAE;AACzF,kBAAwF,EAAE;AAC1F,kBAAsG,EAAE;AACxG,kBAAuF,EAAE;AACzF,kBAAoF,EAAE;AAEtF,kBAAuJ,EAAE;AACzJ,kBAA6H,EAAE;AAC/H,kBAA+H,EAAE;AACjI,kBAAiI,EAAE;AAG5H,SAAS,eAKd;AACA,SAAQ,MAAM;AAChB;AAEA,kBAAkF,EAAE;AACpF,kBAAoF,EAAE;AACtF,kBAAkG,EAAE;AACpG,kBAA8E,EAAE;AAChF,kBAAkF,EAAE;AACpF,kBAA4G,EAAE;AAC9G,kBAA4G,EAAE;AAC9G,kBAAsH,EAAE;AACxH,kBAA8I,EAAE;AAChJ,kBAAoH,EAAE;AACtH,kBAAsH,EAAE;AACxH,kBAAwH,EAAE;","names":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
declare const previewTemplateSource
|
|
2
|
-
declare const
|
|
1
|
+
declare const previewTemplateSource: string;
|
|
2
|
+
declare const emptyEmailTheme: string;
|
|
3
|
+
declare const LightEmailTheme = "import { Html, Head, Tailwind, Body, Container } from '@react-email/components';\n\nexport function EmailTheme({ children }: { children: React.ReactNode }) {\n return (\n <Html>\n <Head />\n <Tailwind>\n <Body className=\"bg-[#fafbfb] font-sans text-base\">\n <Container className=\"bg-white p-[45px] rounded-lg\">\n {children}\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n}";
|
|
3
4
|
declare const DEFAULT_EMAIL_THEME_ID = "1df07ae6-abf3-4a40-83a5-a1a2cbe336ac";
|
|
4
5
|
declare const DEFAULT_EMAIL_THEMES: {
|
|
5
6
|
"1df07ae6-abf3-4a40-83a5-a1a2cbe336ac": {
|
|
@@ -14,11 +15,36 @@ declare const DEFAULT_EMAIL_THEMES: {
|
|
|
14
15
|
declare const DEFAULT_EMAIL_TEMPLATES: {
|
|
15
16
|
"e7d009ce-8d47-4528-b245-5bf119f2ffa3": {
|
|
16
17
|
displayName: string;
|
|
17
|
-
description: string;
|
|
18
|
-
variables: string[];
|
|
19
|
-
subject: string;
|
|
20
18
|
tsxSource: string;
|
|
19
|
+
themeId: undefined;
|
|
21
20
|
};
|
|
21
|
+
"a70fb3a4-56c1-4e42-af25-49d25603abd0": {
|
|
22
|
+
displayName: string;
|
|
23
|
+
tsxSource: string;
|
|
24
|
+
themeId: undefined;
|
|
25
|
+
};
|
|
26
|
+
"822687fe-8d0a-4467-a0d1-416b6e639478": {
|
|
27
|
+
displayName: string;
|
|
28
|
+
tsxSource: string;
|
|
29
|
+
themeId: undefined;
|
|
30
|
+
};
|
|
31
|
+
"e84de395-2076-4831-9c19-8e9a96a868e4": {
|
|
32
|
+
displayName: string;
|
|
33
|
+
tsxSource: string;
|
|
34
|
+
themeId: undefined;
|
|
35
|
+
};
|
|
36
|
+
"066dd73c-36da-4fd0-b6d6-ebf87683f8bc": {
|
|
37
|
+
displayName: string;
|
|
38
|
+
tsxSource: string;
|
|
39
|
+
themeId: undefined;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
declare const DEFAULT_TEMPLATE_IDS: {
|
|
43
|
+
readonly email_verification: "e7d009ce-8d47-4528-b245-5bf119f2ffa3";
|
|
44
|
+
readonly password_reset: "a70fb3a4-56c1-4e42-af25-49d25603abd0";
|
|
45
|
+
readonly magic_link: "822687fe-8d0a-4467-a0d1-416b6e639478";
|
|
46
|
+
readonly team_invitation: "e84de395-2076-4831-9c19-8e9a96a868e4";
|
|
47
|
+
readonly sign_in_invitation: "066dd73c-36da-4fd0-b6d6-ebf87683f8bc";
|
|
22
48
|
};
|
|
23
49
|
|
|
24
|
-
export { DEFAULT_EMAIL_TEMPLATES, DEFAULT_EMAIL_THEMES, DEFAULT_EMAIL_THEME_ID, LightEmailTheme, previewTemplateSource };
|
|
50
|
+
export { DEFAULT_EMAIL_TEMPLATES, DEFAULT_EMAIL_THEMES, DEFAULT_EMAIL_THEME_ID, DEFAULT_TEMPLATE_IDS, LightEmailTheme, emptyEmailTheme, previewTemplateSource };
|
package/dist/helpers/emails.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
declare const previewTemplateSource
|
|
2
|
-
declare const
|
|
1
|
+
declare const previewTemplateSource: string;
|
|
2
|
+
declare const emptyEmailTheme: string;
|
|
3
|
+
declare const LightEmailTheme = "import { Html, Head, Tailwind, Body, Container } from '@react-email/components';\n\nexport function EmailTheme({ children }: { children: React.ReactNode }) {\n return (\n <Html>\n <Head />\n <Tailwind>\n <Body className=\"bg-[#fafbfb] font-sans text-base\">\n <Container className=\"bg-white p-[45px] rounded-lg\">\n {children}\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n}";
|
|
3
4
|
declare const DEFAULT_EMAIL_THEME_ID = "1df07ae6-abf3-4a40-83a5-a1a2cbe336ac";
|
|
4
5
|
declare const DEFAULT_EMAIL_THEMES: {
|
|
5
6
|
"1df07ae6-abf3-4a40-83a5-a1a2cbe336ac": {
|
|
@@ -14,11 +15,36 @@ declare const DEFAULT_EMAIL_THEMES: {
|
|
|
14
15
|
declare const DEFAULT_EMAIL_TEMPLATES: {
|
|
15
16
|
"e7d009ce-8d47-4528-b245-5bf119f2ffa3": {
|
|
16
17
|
displayName: string;
|
|
17
|
-
description: string;
|
|
18
|
-
variables: string[];
|
|
19
|
-
subject: string;
|
|
20
18
|
tsxSource: string;
|
|
19
|
+
themeId: undefined;
|
|
21
20
|
};
|
|
21
|
+
"a70fb3a4-56c1-4e42-af25-49d25603abd0": {
|
|
22
|
+
displayName: string;
|
|
23
|
+
tsxSource: string;
|
|
24
|
+
themeId: undefined;
|
|
25
|
+
};
|
|
26
|
+
"822687fe-8d0a-4467-a0d1-416b6e639478": {
|
|
27
|
+
displayName: string;
|
|
28
|
+
tsxSource: string;
|
|
29
|
+
themeId: undefined;
|
|
30
|
+
};
|
|
31
|
+
"e84de395-2076-4831-9c19-8e9a96a868e4": {
|
|
32
|
+
displayName: string;
|
|
33
|
+
tsxSource: string;
|
|
34
|
+
themeId: undefined;
|
|
35
|
+
};
|
|
36
|
+
"066dd73c-36da-4fd0-b6d6-ebf87683f8bc": {
|
|
37
|
+
displayName: string;
|
|
38
|
+
tsxSource: string;
|
|
39
|
+
themeId: undefined;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
declare const DEFAULT_TEMPLATE_IDS: {
|
|
43
|
+
readonly email_verification: "e7d009ce-8d47-4528-b245-5bf119f2ffa3";
|
|
44
|
+
readonly password_reset: "a70fb3a4-56c1-4e42-af25-49d25603abd0";
|
|
45
|
+
readonly magic_link: "822687fe-8d0a-4467-a0d1-416b6e639478";
|
|
46
|
+
readonly team_invitation: "e84de395-2076-4831-9c19-8e9a96a868e4";
|
|
47
|
+
readonly sign_in_invitation: "066dd73c-36da-4fd0-b6d6-ebf87683f8bc";
|
|
22
48
|
};
|
|
23
49
|
|
|
24
|
-
export { DEFAULT_EMAIL_TEMPLATES, DEFAULT_EMAIL_THEMES, DEFAULT_EMAIL_THEME_ID, LightEmailTheme, previewTemplateSource };
|
|
50
|
+
export { DEFAULT_EMAIL_TEMPLATES, DEFAULT_EMAIL_THEMES, DEFAULT_EMAIL_THEME_ID, DEFAULT_TEMPLATE_IDS, LightEmailTheme, emptyEmailTheme, previewTemplateSource };
|
package/dist/helpers/emails.js
CHANGED
|
@@ -23,47 +23,80 @@ __export(emails_exports, {
|
|
|
23
23
|
DEFAULT_EMAIL_TEMPLATES: () => DEFAULT_EMAIL_TEMPLATES,
|
|
24
24
|
DEFAULT_EMAIL_THEMES: () => DEFAULT_EMAIL_THEMES,
|
|
25
25
|
DEFAULT_EMAIL_THEME_ID: () => DEFAULT_EMAIL_THEME_ID,
|
|
26
|
+
DEFAULT_TEMPLATE_IDS: () => DEFAULT_TEMPLATE_IDS,
|
|
26
27
|
LightEmailTheme: () => LightEmailTheme,
|
|
28
|
+
emptyEmailTheme: () => emptyEmailTheme,
|
|
27
29
|
previewTemplateSource: () => previewTemplateSource
|
|
28
30
|
});
|
|
29
31
|
module.exports = __toCommonJS(emails_exports);
|
|
30
|
-
var
|
|
32
|
+
var import_strings = require("../utils/strings.js");
|
|
33
|
+
var previewTemplateSource = import_strings.deindent`
|
|
34
|
+
import { Heading, Section, Button, Link, Column } from "@react-email/components";
|
|
35
|
+
export const variablesSchema = v => v;
|
|
31
36
|
export function EmailTemplate() {
|
|
32
|
-
return
|
|
33
|
-
<
|
|
34
|
-
<h2 className="mb-4 text-2xl font-bold">
|
|
37
|
+
return <>
|
|
38
|
+
<Heading as="h2" className="mb-4 text-2xl font-bold">
|
|
35
39
|
Header text
|
|
36
|
-
</
|
|
37
|
-
<
|
|
40
|
+
</Heading>
|
|
41
|
+
<Section className="mb-4">
|
|
38
42
|
Body text content with some additional information.
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
</Section>
|
|
44
|
+
<Row className="mb-4">
|
|
45
|
+
<Column>
|
|
46
|
+
<Button href="https://example.com">
|
|
47
|
+
A button
|
|
48
|
+
</Button>
|
|
49
|
+
</Column>
|
|
50
|
+
<Column>
|
|
51
|
+
<Link href="https://example.com">
|
|
52
|
+
A link
|
|
53
|
+
</Link>
|
|
54
|
+
</Column>
|
|
55
|
+
</Row>
|
|
56
|
+
</>;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
var emptyEmailTheme = import_strings.deindent`
|
|
60
|
+
import { Html, Tailwind, Body } from '@react-email/components';
|
|
61
|
+
export function EmailTheme({ children }: { children: React.ReactNode }) {
|
|
62
|
+
return (
|
|
63
|
+
<Html>
|
|
64
|
+
<Tailwind>
|
|
65
|
+
<Body>
|
|
66
|
+
{children}
|
|
67
|
+
</Body>
|
|
68
|
+
</Tailwind>
|
|
69
|
+
</Html>
|
|
41
70
|
);
|
|
42
71
|
}
|
|
43
72
|
`;
|
|
44
|
-
var LightEmailTheme = `import { Html, Tailwind, Body } from '@react-email/components';
|
|
73
|
+
var LightEmailTheme = `import { Html, Head, Tailwind, Body, Container } from '@react-email/components';
|
|
74
|
+
|
|
45
75
|
export function EmailTheme({ children }: { children: React.ReactNode }) {
|
|
46
76
|
return (
|
|
47
77
|
<Html>
|
|
78
|
+
<Head />
|
|
48
79
|
<Tailwind>
|
|
49
|
-
<Body>
|
|
50
|
-
<
|
|
80
|
+
<Body className="bg-[#fafbfb] font-sans text-base">
|
|
81
|
+
<Container className="bg-white p-[45px] rounded-lg">
|
|
51
82
|
{children}
|
|
52
|
-
</
|
|
83
|
+
</Container>
|
|
53
84
|
</Body>
|
|
54
85
|
</Tailwind>
|
|
55
86
|
</Html>
|
|
56
87
|
);
|
|
57
88
|
}`;
|
|
58
|
-
var DarkEmailTheme = `import { Html, Tailwind, Body } from '@react-email/components';
|
|
89
|
+
var DarkEmailTheme = `import { Html, Head, Tailwind, Body, Container } from '@react-email/components';
|
|
90
|
+
|
|
59
91
|
export function EmailTheme({ children }: { children: React.ReactNode }) {
|
|
60
92
|
return (
|
|
61
93
|
<Html>
|
|
94
|
+
<Head />
|
|
62
95
|
<Tailwind>
|
|
63
|
-
<Body>
|
|
64
|
-
<
|
|
96
|
+
<Body className="bg-[#323232] font-sans text-white">
|
|
97
|
+
<Container className="bg-black p-[45px] rounded-lg">
|
|
65
98
|
{children}
|
|
66
|
-
</
|
|
99
|
+
</Container>
|
|
67
100
|
</Body>
|
|
68
101
|
</Tailwind>
|
|
69
102
|
</Html>
|
|
@@ -80,29 +113,104 @@ var DEFAULT_EMAIL_THEMES = {
|
|
|
80
113
|
tsxSource: DarkEmailTheme
|
|
81
114
|
}
|
|
82
115
|
};
|
|
116
|
+
var EMAIL_TEMPLATE_EMAIL_VERIFICATION_ID = "e7d009ce-8d47-4528-b245-5bf119f2ffa3";
|
|
117
|
+
var EMAIL_TEMPLATE_PASSWORD_RESET_ID = "a70fb3a4-56c1-4e42-af25-49d25603abd0";
|
|
118
|
+
var EMAIL_TEMPLATE_MAGIC_LINK_ID = "822687fe-8d0a-4467-a0d1-416b6e639478";
|
|
119
|
+
var EMAIL_TEMPLATE_TEAM_INVITATION_ID = "e84de395-2076-4831-9c19-8e9a96a868e4";
|
|
120
|
+
var EMAIL_TEMPLATE_SIGN_IN_INVITATION_ID = "066dd73c-36da-4fd0-b6d6-ebf87683f8bc";
|
|
83
121
|
var DEFAULT_EMAIL_TEMPLATES = {
|
|
84
|
-
|
|
85
|
-
displayName: "Email Verification",
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
122
|
+
[EMAIL_TEMPLATE_EMAIL_VERIFICATION_ID]: {
|
|
123
|
+
"displayName": "Email Verification",
|
|
124
|
+
"tsxSource": 'import { type } from "arktype"\nimport { Button, Section, Hr } from "@react-email/components";\nimport { Subject, NotificationCategory, Props } from "@stackframe/emails";\n\nexport const variablesSchema = type({\n emailVerificationLink: "string"\n})\n\nexport function EmailTemplate({ user, project, variables }: Props<typeof variablesSchema.infer>) {\n return (\n <>\n <Subject value={`Verify your email at ${project.displayName}`} />\n <NotificationCategory value="Transactional" />\n <div className="bg-white text-[#242424] font-sans text-base font-normal tracking-[0.15008px] leading-[1.5] m-0 py-8 w-full min-h-full">\n <Section className="bg-white">\n <h3 className="text-black font-sans font-bold text-[20px] text-center py-4 px-6 m-0">\n Verify your email at {project.displayName}\n </h3>\n <p className="text-[#474849] font-sans font-normal text-[14px] text-center pt-2 px-6 pb-4 m-0">\n Hi{user.displayName ? (", " + user.displayName) : \'\'}! Please click on the following button to verify your email.\n </p>\n <div className="text-center py-3 px-6">\n <Button\n href={variables.emailVerificationLink}\n target="_blank"\n className="text-black font-sans font-bold text-[14px] inline-block bg-[#f0f0f0] rounded-[4px] py-3 px-5 no-underline border-0"\n >\n Verify my email\n </Button>\n </div>\n <div className="py-4 px-6">\n <Hr />\n </div>\n <p className="text-[#474849] font-sans font-normal text-[12px] text-center pt-1 px-6 pb-6 m-0">\n If you were not expecting this email, you can safely ignore it. \n </p>\n </Section>\n </div>\n </>\n )\n}\n\nEmailTemplate.PreviewVariables = {\n emailVerificationLink: "<email verification link>"\n} satisfies typeof variablesSchema.infer',
|
|
125
|
+
"themeId": void 0
|
|
126
|
+
},
|
|
127
|
+
[EMAIL_TEMPLATE_PASSWORD_RESET_ID]: {
|
|
128
|
+
"displayName": "Password Reset",
|
|
129
|
+
"tsxSource": 'import { type } from "arktype"\nimport { Button, Section, Hr } from "@react-email/components"\nimport { Subject, NotificationCategory, Props} from "@stackframe/emails"\n\nexport const variablesSchema = type({\n passwordResetLink: "string"\n})\n\nexport function EmailTemplate({ user, project, variables }: Props<typeof variablesSchema.infer>) {\n return (\n <>\n <Subject value={"Reset your password at " + project.displayName} />\n <NotificationCategory value="Transactional" />\n <div className="bg-white text-[#242424] font-sans text-base font-normal tracking-tight leading-relaxed py-8 w-full min-h-full">\n <Section>\n <h3 className="text-black bg-transparent font-sans font-bold text-[20px] text-center py-4 px-6 m-0">\n Reset your password at {project.displayName}\n </h3>\n\n <p className="text-[#474849] bg-transparent text-sm font-sans font-normal text-center pt-2 pb-4 px-6 m-0">\n Hi{user.displayName ? (", " + user.displayName) : ""}! Please click on the following button to start the password reset process.\n </p>\n\n <div className="bg-transparent text-center px-6 py-3">\n <Button\n href={variables.passwordResetLink}\n className="text-black text-sm font-sans font-bold bg-[#f0f0f0] rounded-[4px] inline-block py-3 px-5 no-underline border-none"\n target="_blank"\n >\n Reset my password\n </Button>\n </div>\n\n <div className="px-6 py-4">\n <Hr />\n </div>\n\n <p className="text-[#474849] bg-transparent text-xs font-sans font-normal text-center pt-1 pb-6 px-6 m-0">\n If you were not expecting this email, you can safely ignore it.\n </p>\n </Section>\n </div>\n </>\n )\n}\n\nEmailTemplate.PreviewVariables = {\n passwordResetLink: "<password reset link>"\n} satisfies typeof variablesSchema.infer',
|
|
130
|
+
"themeId": void 0
|
|
131
|
+
},
|
|
132
|
+
[EMAIL_TEMPLATE_MAGIC_LINK_ID]: {
|
|
133
|
+
"displayName": "Magic Link/OTP",
|
|
134
|
+
"tsxSource": `import { type } from 'arktype';
|
|
135
|
+
import { Section, Hr } from '@react-email/components';
|
|
136
|
+
import { Subject, NotificationCategory, Props } from '@stackframe/emails';
|
|
137
|
+
|
|
138
|
+
export const variablesSchema = type({
|
|
139
|
+
magicLink: 'string',
|
|
140
|
+
otp: 'string',
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
export function EmailTemplate({ user, project, variables }: Props<typeof variablesSchema.infer>) {
|
|
144
|
+
return (
|
|
145
|
+
<>
|
|
146
|
+
<Subject value={"Sign in to " + project.displayName + ": Your code is " + variables.otp} />
|
|
147
|
+
<NotificationCategory value="Transactional" />
|
|
148
|
+
<div className="bg-white text-[#242424] font-sans text-base font-normal tracking-[0.15008px] leading-6 m-0 py-8 w-full min-h-full">
|
|
149
|
+
<Section className="mx-auto bg-white">
|
|
150
|
+
<h3 className="text-black bg-transparent font-sans font-bold text-xl text-center px-6 py-4 m-0">
|
|
151
|
+
Sign in to {project.displayName}
|
|
152
|
+
</h3>
|
|
153
|
+
<p className="text-[#474849] bg-transparent text-sm font-sans font-normal text-center px-6 py-4 m-0">
|
|
154
|
+
Hi{user.displayName ? ", " + user.displayName : ""}! This is your one-time-password for signing in:
|
|
155
|
+
</p>
|
|
156
|
+
<p className="text-black bg-transparent text-2xl font-mono font-bold text-center px-6 py-4 m-0">
|
|
157
|
+
{variables.otp}
|
|
158
|
+
</p>
|
|
159
|
+
<p className="text-black bg-transparent text-sm font-sans font-normal text-center px-6 py-4 m-0">
|
|
160
|
+
Or you can click on{' '}
|
|
161
|
+
<a
|
|
162
|
+
key={20}
|
|
163
|
+
href={variables.magicLink}
|
|
164
|
+
target="_blank"
|
|
165
|
+
rel="noopener noreferrer"
|
|
166
|
+
className="text-blue-600 underline"
|
|
167
|
+
>
|
|
168
|
+
this link
|
|
169
|
+
</a>{' '}
|
|
170
|
+
to sign in
|
|
171
|
+
</p>
|
|
172
|
+
<Hr className="px-6 py-4 bg-transparent" />
|
|
173
|
+
<p className="text-[#474849] bg-transparent text-xs font-sans font-normal text-center px-6 pt-1 pb-6 m-0">
|
|
174
|
+
If you were not expecting this email, you can safely ignore it.
|
|
175
|
+
</p>
|
|
176
|
+
</Section>
|
|
177
|
+
</div>
|
|
178
|
+
</>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
EmailTemplate.PreviewVariables = {
|
|
183
|
+
magicLink: "<magic link>",
|
|
184
|
+
otp: "3SLSWZ"
|
|
185
|
+
} satisfies typeof variablesSchema.infer`,
|
|
186
|
+
"themeId": void 0
|
|
187
|
+
},
|
|
188
|
+
[EMAIL_TEMPLATE_TEAM_INVITATION_ID]: {
|
|
189
|
+
"displayName": "Team Invitation",
|
|
190
|
+
"tsxSource": 'import { type } from "arktype";\nimport { Button, Section, Hr } from "@react-email/components";\nimport { Subject, NotificationCategory, Props } from "@stackframe/emails";\n\n\nexport const variablesSchema = type({\n teamDisplayName: "string",\n teamInvitationLink: "string"\n});\n\nexport function EmailTemplate({ user, variables }: Props<typeof variablesSchema.infer>) {\n return (\n <>\n <Subject value={"You have been invited to join " + variables.teamDisplayName} />\n <NotificationCategory value="Transactional" />\n <div className="bg-white text-[#242424] font-sans text-base font-normal tracking-[0.15008px] leading-[1.5] m-0 py-8 w-full min-h-full">\n <Section className="mx-auto max-w-lg bg-white">\n <h3 className="text-black bg-transparent font-sans font-bold text-xl text-center px-6 pt-8 m-0">\n You are invited to {variables.teamDisplayName}\n </h3>\n <p className="text-[#474849] bg-transparent text-sm font-sans font-normal text-center px-6 pt-2 pb-4 m-0">\n Hi{user.displayName ? ", " + user.displayName : ""}! Please click the button below to join the team {variables.teamDisplayName}\n </p>\n <div className="bg-transparent text-center px-6 py-3">\n <Button\n href={variables.teamInvitationLink}\n target="_blank"\n className="text-black text-sm font-sans font-bold bg-[#f0f0f0] rounded-md inline-block px-5 py-3 no-underline border-0"\n >\n Join team\n </Button>\n </div>\n <div className="px-6 py-4 bg-transparent">\n <Hr />\n </div>\n <p className="text-[#474849] bg-transparent text-xs font-sans font-normal text-center px-6 pb-6 pt-1 m-0">\n If you were not expecting this email, you can safely ignore it.\n </p>\n </Section>\n </div>\n </>\n );\n}\n\nEmailTemplate.PreviewVariables = {\n teamDisplayName: "My Team",\n teamInvitationLink: "<team invitation link>"\n} satisfies typeof variablesSchema.infer ',
|
|
191
|
+
"themeId": void 0
|
|
192
|
+
},
|
|
193
|
+
[EMAIL_TEMPLATE_SIGN_IN_INVITATION_ID]: {
|
|
194
|
+
"displayName": "Sign In Invitation",
|
|
195
|
+
"tsxSource": 'import { type } from "arktype"\nimport { Button, Section, Hr } from "@react-email/components";\nimport { Subject, NotificationCategory, Props } from "@stackframe/emails";\n\nexport const variablesSchema = type({\n signInInvitationLink: "string",\n teamDisplayName: "string"\n})\n\nexport function EmailTemplate({ user, project, variables }: Props<typeof variablesSchema.infer>) {\n return (\n <>\n <Subject\n value={"You have been invited to sign in to " + project.displayName}\n />\n <NotificationCategory value="Transactional" />\n\n <div className="bg-white text-gray-900 font-sans text-base font-normal leading-normal w-full min-h-full m-0 py-8">\n <Section>\n <h3 className="text-black bg-transparent font-sans font-bold text-xl text-center pt-8 px-6 m-0">\n You are invited to sign in to {variables.teamDisplayName}\n </h3>\n\n <p className="text-gray-700 bg-transparent text-sm font-sans font-normal text-center pt-2 pb-4 px-6 m-0">\n Hi\n {user.displayName ? ", " + user.displayName : ""}! Please click on the following\n link to sign in to your account\n </p>\n\n <div className="bg-transparent text-center px-6 py-3">\n <Button\n href={variables.signInInvitationLink}\n className="text-black text-sm font-sans font-bold bg-gray-200 rounded-md inline-block py-3 px-5 no-underline border-none"\n target="_blank"\n >\n Sign in\n </Button>\n </div>\n\n <div className="px-6 py-4 bg-transparent">\n <Hr />\n </div>\n\n <p className="text-gray-700 bg-transparent text-xs font-sans font-normal text-center pt-1 pb-6 px-6 m-0">\n If you were not expecting this email, you can safely ignore it.\n </p>\n </Section>\n </div>\n </>\n )\n}\n\nEmailTemplate.PreviewVariables = {\n signInInvitationLink: "<sign in invitation link>",\n teamDisplayName: "My Team"\n} satisfies typeof variablesSchema.infer',
|
|
196
|
+
"themeId": void 0
|
|
90
197
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
// },
|
|
198
|
+
};
|
|
199
|
+
var DEFAULT_TEMPLATE_IDS = {
|
|
200
|
+
email_verification: EMAIL_TEMPLATE_EMAIL_VERIFICATION_ID,
|
|
201
|
+
password_reset: EMAIL_TEMPLATE_PASSWORD_RESET_ID,
|
|
202
|
+
magic_link: EMAIL_TEMPLATE_MAGIC_LINK_ID,
|
|
203
|
+
team_invitation: EMAIL_TEMPLATE_TEAM_INVITATION_ID,
|
|
204
|
+
sign_in_invitation: EMAIL_TEMPLATE_SIGN_IN_INVITATION_ID
|
|
99
205
|
};
|
|
100
206
|
// Annotate the CommonJS export names for ESM import in node:
|
|
101
207
|
0 && (module.exports = {
|
|
102
208
|
DEFAULT_EMAIL_TEMPLATES,
|
|
103
209
|
DEFAULT_EMAIL_THEMES,
|
|
104
210
|
DEFAULT_EMAIL_THEME_ID,
|
|
211
|
+
DEFAULT_TEMPLATE_IDS,
|
|
105
212
|
LightEmailTheme,
|
|
213
|
+
emptyEmailTheme,
|
|
106
214
|
previewTemplateSource
|
|
107
215
|
});
|
|
108
216
|
//# sourceMappingURL=emails.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/helpers/emails.ts"],"sourcesContent":["export const previewTemplateSource = `\n export function EmailTemplate() {\n return (\n <div>\n <h2 className=\"mb-4 text-2xl font-bold\">\n Header text\n </h2>\n <p className=\"mb-4\">\n Body text content with some additional information.\n </p>\n </div>\n );\n }\n`;\n\nexport const LightEmailTheme = `import { Html, Tailwind, Body } from '@react-email/components';\nexport function EmailTheme({ children }: { children: React.ReactNode }) {\n return (\n <Html>\n <Tailwind>\n <Body>\n <div className=\"bg-white text-slate-800 p-4 rounded-lg max-w-[600px] mx-auto leading-relaxed\">\n {children}\n </div>\n </Body>\n </Tailwind>\n </Html>\n );\n}`;\n\n\nconst DarkEmailTheme = `import { Html, Tailwind, Body } from '@react-email/components';\nexport function EmailTheme({ children }: { children: React.ReactNode }) {\n return (\n <Html>\n <Tailwind>\n <Body>\n <div className=\"bg-slate-900 text-slate-100 p-4 rounded-lg max-w-[600px] mx-auto leading-relaxed\">\n {children}\n </div>\n </Body>\n </Tailwind>\n </Html>\n );\n}`;\n\nexport const DEFAULT_EMAIL_THEME_ID = \"1df07ae6-abf3-4a40-83a5-a1a2cbe336ac\";\n\nexport const DEFAULT_EMAIL_THEMES = {\n [DEFAULT_EMAIL_THEME_ID]: {\n displayName: 'Default Light',\n tsxSource: LightEmailTheme,\n },\n \"a0172b5d-cff0-463b-83bb-85124697373a\": {\n displayName: 'Default Dark',\n tsxSource: DarkEmailTheme,\n },\n};\n\nexport const DEFAULT_EMAIL_TEMPLATES = {\n \"e7d009ce-8d47-4528-b245-5bf119f2ffa3\": {\n displayName: \"Email Verification\",\n description: \"Will be sent to the user when they sign-up with email/password\",\n variables: [\"projectDisplayName\"],\n subject: \"Welcome to {{ projectDisplayName }}\",\n tsxSource: \"export function EmailTemplate({ projectDisplayName }) {\\n return <div>Email Verification for { projectDisplayName }</div>; \\n}\",\n },\n // \"a70fb3a4-56c1-4e42-af25-49d25603abd0\": {\n\n // },\n // \"822687fe-8d0a-4467-a0d1-416b6e639478\": {\n\n // },\n // \"066dd73c-36da-4fd0-b6d6-ebf87683f8bc\": {\n\n // },\n // \"e84de395-2076-4831-9c19-8e9a96a868e4\": {\n\n // },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAe9B,IAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgB/B,IAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAehB,IAAM,yBAAyB;AAE/B,IAAM,uBAAuB;AAAA,EAClC,CAAC,sBAAsB,GAAG;AAAA,IACxB,aAAa;AAAA,IACb,WAAW;AAAA,EACb;AAAA,EACA,wCAAwC;AAAA,IACtC,aAAa;AAAA,IACb,WAAW;AAAA,EACb;AACF;AAEO,IAAM,0BAA0B;AAAA,EACrC,wCAAwC;AAAA,IACtC,aAAa;AAAA,IACb,aAAa;AAAA,IACb,WAAW,CAAC,oBAAoB;AAAA,IAChC,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/helpers/emails.ts"],"sourcesContent":["import { deindent } from \"../utils/strings\";\n\nexport const previewTemplateSource = deindent`\n import { Heading, Section, Button, Link, Column } from \"@react-email/components\";\n export const variablesSchema = v => v;\n export function EmailTemplate() {\n return <>\n <Heading as=\"h2\" className=\"mb-4 text-2xl font-bold\">\n Header text\n </Heading>\n <Section className=\"mb-4\">\n Body text content with some additional information.\n </Section>\n <Row className=\"mb-4\">\n <Column>\n <Button href=\"https://example.com\">\n A button\n </Button>\n </Column>\n <Column>\n <Link href=\"https://example.com\">\n A link\n </Link>\n </Column>\n </Row>\n </>;\n }\n`;\n\nexport const emptyEmailTheme = deindent`\n import { Html, Tailwind, Body } from '@react-email/components';\n export function EmailTheme({ children }: { children: React.ReactNode }) {\n return (\n <Html>\n <Tailwind>\n <Body>\n {children}\n </Body>\n </Tailwind>\n </Html>\n );\n }\n`;\n\nexport const LightEmailTheme = `import { Html, Head, Tailwind, Body, Container } from '@react-email/components';\n\nexport function EmailTheme({ children }: { children: React.ReactNode }) {\n return (\n <Html>\n <Head />\n <Tailwind>\n <Body className=\"bg-[#fafbfb] font-sans text-base\">\n <Container className=\"bg-white p-[45px] rounded-lg\">\n {children}\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n}`;\n\n\nconst DarkEmailTheme = `import { Html, Head, Tailwind, Body, Container } from '@react-email/components';\n\nexport function EmailTheme({ children }: { children: React.ReactNode }) {\n return (\n <Html>\n <Head />\n <Tailwind>\n <Body className=\"bg-[#323232] font-sans text-white\">\n <Container className=\"bg-black p-[45px] rounded-lg\">\n {children}\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n}`;\n\n\nexport const DEFAULT_EMAIL_THEME_ID = \"1df07ae6-abf3-4a40-83a5-a1a2cbe336ac\";\n\nexport const DEFAULT_EMAIL_THEMES = {\n [DEFAULT_EMAIL_THEME_ID]: {\n displayName: 'Default Light',\n tsxSource: LightEmailTheme,\n },\n \"a0172b5d-cff0-463b-83bb-85124697373a\": {\n displayName: 'Default Dark',\n tsxSource: DarkEmailTheme,\n },\n};\n\nconst EMAIL_TEMPLATE_EMAIL_VERIFICATION_ID = \"e7d009ce-8d47-4528-b245-5bf119f2ffa3\";\nconst EMAIL_TEMPLATE_PASSWORD_RESET_ID = \"a70fb3a4-56c1-4e42-af25-49d25603abd0\";\nconst EMAIL_TEMPLATE_MAGIC_LINK_ID = \"822687fe-8d0a-4467-a0d1-416b6e639478\";\nconst EMAIL_TEMPLATE_TEAM_INVITATION_ID = \"e84de395-2076-4831-9c19-8e9a96a868e4\";\nconst EMAIL_TEMPLATE_SIGN_IN_INVITATION_ID = \"066dd73c-36da-4fd0-b6d6-ebf87683f8bc\";\n\nexport const DEFAULT_EMAIL_TEMPLATES = {\n [EMAIL_TEMPLATE_EMAIL_VERIFICATION_ID]: {\n \"displayName\": \"Email Verification\",\n \"tsxSource\": \"import { type } from \\\"arktype\\\"\\nimport { Button, Section, Hr } from \\\"@react-email/components\\\";\\nimport { Subject, NotificationCategory, Props } from \\\"@stackframe/emails\\\";\\n\\nexport const variablesSchema = type({\\n emailVerificationLink: \\\"string\\\"\\n})\\n\\nexport function EmailTemplate({ user, project, variables }: Props<typeof variablesSchema.infer>) {\\n return (\\n <>\\n <Subject value={`Verify your email at ${project.displayName}`} />\\n <NotificationCategory value=\\\"Transactional\\\" />\\n <div className=\\\"bg-white text-[#242424] font-sans text-base font-normal tracking-[0.15008px] leading-[1.5] m-0 py-8 w-full min-h-full\\\">\\n <Section className=\\\"bg-white\\\">\\n <h3 className=\\\"text-black font-sans font-bold text-[20px] text-center py-4 px-6 m-0\\\">\\n Verify your email at {project.displayName}\\n </h3>\\n <p className=\\\"text-[#474849] font-sans font-normal text-[14px] text-center pt-2 px-6 pb-4 m-0\\\">\\n Hi{user.displayName ? (\\\", \\\" + user.displayName) : ''}! Please click on the following button to verify your email.\\n </p>\\n <div className=\\\"text-center py-3 px-6\\\">\\n <Button\\n href={variables.emailVerificationLink}\\n target=\\\"_blank\\\"\\n className=\\\"text-black font-sans font-bold text-[14px] inline-block bg-[#f0f0f0] rounded-[4px] py-3 px-5 no-underline border-0\\\"\\n >\\n Verify my email\\n </Button>\\n </div>\\n <div className=\\\"py-4 px-6\\\">\\n <Hr />\\n </div>\\n <p className=\\\"text-[#474849] font-sans font-normal text-[12px] text-center pt-1 px-6 pb-6 m-0\\\">\\n If you were not expecting this email, you can safely ignore it. \\n </p>\\n </Section>\\n </div>\\n </>\\n )\\n}\\n\\nEmailTemplate.PreviewVariables = {\\n emailVerificationLink: \\\"<email verification link>\\\"\\n} satisfies typeof variablesSchema.infer\",\n \"themeId\": undefined,\n },\n [EMAIL_TEMPLATE_PASSWORD_RESET_ID]: {\n \"displayName\": \"Password Reset\",\n \"tsxSource\": \"import { type } from \\\"arktype\\\"\\nimport { Button, Section, Hr } from \\\"@react-email/components\\\"\\nimport { Subject, NotificationCategory, Props} from \\\"@stackframe/emails\\\"\\n\\nexport const variablesSchema = type({\\n passwordResetLink: \\\"string\\\"\\n})\\n\\nexport function EmailTemplate({ user, project, variables }: Props<typeof variablesSchema.infer>) {\\n return (\\n <>\\n <Subject value={\\\"Reset your password at \\\" + project.displayName} />\\n <NotificationCategory value=\\\"Transactional\\\" />\\n <div className=\\\"bg-white text-[#242424] font-sans text-base font-normal tracking-tight leading-relaxed py-8 w-full min-h-full\\\">\\n <Section>\\n <h3 className=\\\"text-black bg-transparent font-sans font-bold text-[20px] text-center py-4 px-6 m-0\\\">\\n Reset your password at {project.displayName}\\n </h3>\\n\\n <p className=\\\"text-[#474849] bg-transparent text-sm font-sans font-normal text-center pt-2 pb-4 px-6 m-0\\\">\\n Hi{user.displayName ? (\\\", \\\" + user.displayName) : \\\"\\\"}! Please click on the following button to start the password reset process.\\n </p>\\n\\n <div className=\\\"bg-transparent text-center px-6 py-3\\\">\\n <Button\\n href={variables.passwordResetLink}\\n className=\\\"text-black text-sm font-sans font-bold bg-[#f0f0f0] rounded-[4px] inline-block py-3 px-5 no-underline border-none\\\"\\n target=\\\"_blank\\\"\\n >\\n Reset my password\\n </Button>\\n </div>\\n\\n <div className=\\\"px-6 py-4\\\">\\n <Hr />\\n </div>\\n\\n <p className=\\\"text-[#474849] bg-transparent text-xs font-sans font-normal text-center pt-1 pb-6 px-6 m-0\\\">\\n If you were not expecting this email, you can safely ignore it.\\n </p>\\n </Section>\\n </div>\\n </>\\n )\\n}\\n\\nEmailTemplate.PreviewVariables = {\\n passwordResetLink: \\\"<password reset link>\\\"\\n} satisfies typeof variablesSchema.infer\",\n \"themeId\": undefined,\n },\n [EMAIL_TEMPLATE_MAGIC_LINK_ID]: {\n \"displayName\": \"Magic Link/OTP\",\n \"tsxSource\": \"import { type } from 'arktype';\\nimport { Section, Hr } from '@react-email/components';\\nimport { Subject, NotificationCategory, Props } from '@stackframe/emails';\\n\\nexport const variablesSchema = type({\\n magicLink: 'string',\\n otp: 'string',\\n});\\n\\nexport function EmailTemplate({ user, project, variables }: Props<typeof variablesSchema.infer>) {\\n return (\\n <>\\n <Subject value={\\\"Sign in to \\\" + project.displayName + \\\": Your code is \\\" + variables.otp} />\\n <NotificationCategory value=\\\"Transactional\\\" />\\n <div className=\\\"bg-white text-[#242424] font-sans text-base font-normal tracking-[0.15008px] leading-6 m-0 py-8 w-full min-h-full\\\">\\n <Section className=\\\"mx-auto bg-white\\\">\\n <h3 className=\\\"text-black bg-transparent font-sans font-bold text-xl text-center px-6 py-4 m-0\\\">\\n Sign in to {project.displayName}\\n </h3>\\n <p className=\\\"text-[#474849] bg-transparent text-sm font-sans font-normal text-center px-6 py-4 m-0\\\">\\n Hi{user.displayName ? \\\", \\\" + user.displayName : \\\"\\\"}! This is your one-time-password for signing in:\\n </p>\\n <p className=\\\"text-black bg-transparent text-2xl font-mono font-bold text-center px-6 py-4 m-0\\\">\\n {variables.otp}\\n </p>\\n <p className=\\\"text-black bg-transparent text-sm font-sans font-normal text-center px-6 py-4 m-0\\\">\\n Or you can click on{' '}\\n <a\\n key={20}\\n href={variables.magicLink}\\n target=\\\"_blank\\\"\\n rel=\\\"noopener noreferrer\\\"\\n className=\\\"text-blue-600 underline\\\"\\n >\\n this link\\n </a>{' '}\\n to sign in\\n </p>\\n <Hr className=\\\"px-6 py-4 bg-transparent\\\" />\\n <p className=\\\"text-[#474849] bg-transparent text-xs font-sans font-normal text-center px-6 pt-1 pb-6 m-0\\\">\\n If you were not expecting this email, you can safely ignore it.\\n </p>\\n </Section>\\n </div>\\n </>\\n );\\n}\\n\\nEmailTemplate.PreviewVariables = {\\n magicLink: \\\"<magic link>\\\",\\n otp: \\\"3SLSWZ\\\"\\n} satisfies typeof variablesSchema.infer\",\n \"themeId\": undefined,\n },\n [EMAIL_TEMPLATE_TEAM_INVITATION_ID]: {\n \"displayName\": \"Team Invitation\",\n \"tsxSource\": \"import { type } from \\\"arktype\\\";\\nimport { Button, Section, Hr } from \\\"@react-email/components\\\";\\nimport { Subject, NotificationCategory, Props } from \\\"@stackframe/emails\\\";\\n\\n\\nexport const variablesSchema = type({\\n teamDisplayName: \\\"string\\\",\\n teamInvitationLink: \\\"string\\\"\\n});\\n\\nexport function EmailTemplate({ user, variables }: Props<typeof variablesSchema.infer>) {\\n return (\\n <>\\n <Subject value={\\\"You have been invited to join \\\" + variables.teamDisplayName} />\\n <NotificationCategory value=\\\"Transactional\\\" />\\n <div className=\\\"bg-white text-[#242424] font-sans text-base font-normal tracking-[0.15008px] leading-[1.5] m-0 py-8 w-full min-h-full\\\">\\n <Section className=\\\"mx-auto max-w-lg bg-white\\\">\\n <h3 className=\\\"text-black bg-transparent font-sans font-bold text-xl text-center px-6 pt-8 m-0\\\">\\n You are invited to {variables.teamDisplayName}\\n </h3>\\n <p className=\\\"text-[#474849] bg-transparent text-sm font-sans font-normal text-center px-6 pt-2 pb-4 m-0\\\">\\n Hi{user.displayName ? \\\", \\\" + user.displayName : \\\"\\\"}! Please click the button below to join the team {variables.teamDisplayName}\\n </p>\\n <div className=\\\"bg-transparent text-center px-6 py-3\\\">\\n <Button\\n href={variables.teamInvitationLink}\\n target=\\\"_blank\\\"\\n className=\\\"text-black text-sm font-sans font-bold bg-[#f0f0f0] rounded-md inline-block px-5 py-3 no-underline border-0\\\"\\n >\\n Join team\\n </Button>\\n </div>\\n <div className=\\\"px-6 py-4 bg-transparent\\\">\\n <Hr />\\n </div>\\n <p className=\\\"text-[#474849] bg-transparent text-xs font-sans font-normal text-center px-6 pb-6 pt-1 m-0\\\">\\n If you were not expecting this email, you can safely ignore it.\\n </p>\\n </Section>\\n </div>\\n </>\\n );\\n}\\n\\nEmailTemplate.PreviewVariables = {\\n teamDisplayName: \\\"My Team\\\",\\n teamInvitationLink: \\\"<team invitation link>\\\"\\n} satisfies typeof variablesSchema.infer \",\n \"themeId\": undefined,\n },\n [EMAIL_TEMPLATE_SIGN_IN_INVITATION_ID]: {\n \"displayName\": \"Sign In Invitation\",\n \"tsxSource\": \"import { type } from \\\"arktype\\\"\\nimport { Button, Section, Hr } from \\\"@react-email/components\\\";\\nimport { Subject, NotificationCategory, Props } from \\\"@stackframe/emails\\\";\\n\\nexport const variablesSchema = type({\\n signInInvitationLink: \\\"string\\\",\\n teamDisplayName: \\\"string\\\"\\n})\\n\\nexport function EmailTemplate({ user, project, variables }: Props<typeof variablesSchema.infer>) {\\n return (\\n <>\\n <Subject\\n value={\\\"You have been invited to sign in to \\\" + project.displayName}\\n />\\n <NotificationCategory value=\\\"Transactional\\\" />\\n\\n <div className=\\\"bg-white text-gray-900 font-sans text-base font-normal leading-normal w-full min-h-full m-0 py-8\\\">\\n <Section>\\n <h3 className=\\\"text-black bg-transparent font-sans font-bold text-xl text-center pt-8 px-6 m-0\\\">\\n You are invited to sign in to {variables.teamDisplayName}\\n </h3>\\n\\n <p className=\\\"text-gray-700 bg-transparent text-sm font-sans font-normal text-center pt-2 pb-4 px-6 m-0\\\">\\n Hi\\n {user.displayName ? \\\", \\\" + user.displayName : \\\"\\\"}! Please click on the following\\n link to sign in to your account\\n </p>\\n\\n <div className=\\\"bg-transparent text-center px-6 py-3\\\">\\n <Button\\n href={variables.signInInvitationLink}\\n className=\\\"text-black text-sm font-sans font-bold bg-gray-200 rounded-md inline-block py-3 px-5 no-underline border-none\\\"\\n target=\\\"_blank\\\"\\n >\\n Sign in\\n </Button>\\n </div>\\n\\n <div className=\\\"px-6 py-4 bg-transparent\\\">\\n <Hr />\\n </div>\\n\\n <p className=\\\"text-gray-700 bg-transparent text-xs font-sans font-normal text-center pt-1 pb-6 px-6 m-0\\\">\\n If you were not expecting this email, you can safely ignore it.\\n </p>\\n </Section>\\n </div>\\n </>\\n )\\n}\\n\\nEmailTemplate.PreviewVariables = {\\n signInInvitationLink: \\\"<sign in invitation link>\\\",\\n teamDisplayName: \\\"My Team\\\"\\n} satisfies typeof variablesSchema.infer\",\n \"themeId\": undefined,\n }\n};\n\nexport const DEFAULT_TEMPLATE_IDS = {\n email_verification: EMAIL_TEMPLATE_EMAIL_VERIFICATION_ID,\n password_reset: EMAIL_TEMPLATE_PASSWORD_RESET_ID,\n magic_link: EMAIL_TEMPLATE_MAGIC_LINK_ID,\n team_invitation: EMAIL_TEMPLATE_TEAM_INVITATION_ID,\n sign_in_invitation: EMAIL_TEMPLATE_SIGN_IN_INVITATION_ID,\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAyB;AAElB,IAAM,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2B9B,IAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAexB,IAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkB/B,IAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBhB,IAAM,yBAAyB;AAE/B,IAAM,uBAAuB;AAAA,EAClC,CAAC,sBAAsB,GAAG;AAAA,IACxB,aAAa;AAAA,IACb,WAAW;AAAA,EACb;AAAA,EACA,wCAAwC;AAAA,IACtC,aAAa;AAAA,IACb,WAAW;AAAA,EACb;AACF;AAEA,IAAM,uCAAuC;AAC7C,IAAM,mCAAmC;AACzC,IAAM,+BAA+B;AACrC,IAAM,oCAAoC;AAC1C,IAAM,uCAAuC;AAEtC,IAAM,0BAA0B;AAAA,EACrC,CAAC,oCAAoC,GAAG;AAAA,IACtC,eAAe;AAAA,IACf,aAAa;AAAA,IACb,WAAW;AAAA,EACb;AAAA,EACA,CAAC,gCAAgC,GAAG;AAAA,IAClC,eAAe;AAAA,IACf,aAAa;AAAA,IACb,WAAW;AAAA,EACb;AAAA,EACA,CAAC,4BAA4B,GAAG;AAAA,IAC9B,eAAe;AAAA,IACf,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IACb,WAAW;AAAA,EACb;AAAA,EACA,CAAC,iCAAiC,GAAG;AAAA,IACnC,eAAe;AAAA,IACf,aAAa;AAAA,IACb,WAAW;AAAA,EACb;AAAA,EACA,CAAC,oCAAoC,GAAG;AAAA,IACtC,eAAe;AAAA,IACf,aAAa;AAAA,IACb,WAAW;AAAA,EACb;AACF;AAEO,IAAM,uBAAuB;AAAA,EAClC,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,oBAAoB;AACtB;","names":[]}
|
package/dist/index.d.mts
CHANGED
|
@@ -4,11 +4,11 @@ export { StackServerInterface } from './interface/server-interface.mjs';
|
|
|
4
4
|
export { KnownError, KnownErrors } from './known-errors.mjs';
|
|
5
5
|
import './sessions.mjs';
|
|
6
6
|
import 'jose';
|
|
7
|
-
import './interface/crud/
|
|
7
|
+
import './interface/crud/emails.mjs';
|
|
8
8
|
import './crud.mjs';
|
|
9
9
|
import 'yup';
|
|
10
10
|
import './utils/types.mjs';
|
|
11
|
-
import './
|
|
11
|
+
import './utils/strings.mjs';
|
|
12
12
|
import './interface/crud/internal-api-keys.mjs';
|
|
13
13
|
import './interface/crud/project-permissions.mjs';
|
|
14
14
|
import './interface/crud/projects.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ export { StackServerInterface } from './interface/server-interface.js';
|
|
|
4
4
|
export { KnownError, KnownErrors } from './known-errors.js';
|
|
5
5
|
import './sessions.js';
|
|
6
6
|
import 'jose';
|
|
7
|
-
import './interface/crud/
|
|
7
|
+
import './interface/crud/emails.js';
|
|
8
8
|
import './crud.js';
|
|
9
9
|
import 'yup';
|
|
10
10
|
import './utils/types.js';
|
|
11
|
-
import './
|
|
11
|
+
import './utils/strings.js';
|
|
12
12
|
import './interface/crud/internal-api-keys.js';
|
|
13
13
|
import './interface/crud/project-permissions.js';
|
|
14
14
|
import './interface/crud/projects.js';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InternalSession, AccessToken, RefreshToken } from '../sessions.mjs';
|
|
2
|
-
import { EmailTemplateCrud, EmailTemplateType } from './crud/email-templates.mjs';
|
|
3
2
|
import { InternalEmailsCrud } from './crud/emails.mjs';
|
|
4
3
|
import { InternalApiKeysCrud } from './crud/internal-api-keys.mjs';
|
|
5
4
|
import { ProjectPermissionDefinitionsCrud } from './crud/project-permissions.mjs';
|
|
@@ -13,6 +12,7 @@ import 'jose';
|
|
|
13
12
|
import '../crud.mjs';
|
|
14
13
|
import 'yup';
|
|
15
14
|
import '../utils/types.mjs';
|
|
15
|
+
import '../utils/strings.mjs';
|
|
16
16
|
import '../utils/results.mjs';
|
|
17
17
|
import './crud/connected-accounts.mjs';
|
|
18
18
|
import './crud/contact-channels.mjs';
|
|
@@ -72,19 +72,16 @@ declare class StackAdminInterface extends StackServerInterface {
|
|
|
72
72
|
listInternalApiKeys(): Promise<InternalApiKeysCrud["Admin"]["Read"][]>;
|
|
73
73
|
revokeInternalApiKeyById(id: string): Promise<void>;
|
|
74
74
|
getInternalApiKey(id: string, session: InternalSession): Promise<InternalApiKeysCrud["Admin"]["Read"]>;
|
|
75
|
-
|
|
76
|
-
listInternalEmailTemplatesNew(): Promise<{
|
|
75
|
+
listInternalEmailTemplates(): Promise<{
|
|
77
76
|
id: string;
|
|
78
|
-
subject: string;
|
|
79
77
|
display_name: string;
|
|
78
|
+
theme_id?: string;
|
|
80
79
|
tsx_source: string;
|
|
81
80
|
}[]>;
|
|
82
81
|
listEmailThemes(): Promise<{
|
|
83
82
|
id: string;
|
|
84
83
|
display_name: string;
|
|
85
84
|
}[]>;
|
|
86
|
-
updateEmailTemplate(type: EmailTemplateType, data: EmailTemplateCrud['Admin']['Update']): Promise<EmailTemplateCrud['Admin']['Read']>;
|
|
87
|
-
resetEmailTemplate(type: EmailTemplateType): Promise<void>;
|
|
88
85
|
listTeamPermissionDefinitions(): Promise<TeamPermissionDefinitionsCrud['Admin']['Read'][]>;
|
|
89
86
|
createTeamPermissionDefinition(data: TeamPermissionDefinitionsCrud['Admin']['Create']): Promise<TeamPermissionDefinitionsCrud['Admin']['Read']>;
|
|
90
87
|
updateTeamPermissionDefinition(permissionId: string, data: TeamPermissionDefinitionsCrud['Admin']['Update']): Promise<TeamPermissionDefinitionsCrud['Admin']['Read']>;
|
|
@@ -129,7 +126,7 @@ declare class StackAdminInterface extends StackServerInterface {
|
|
|
129
126
|
messages: Array<any>;
|
|
130
127
|
}>;
|
|
131
128
|
renderEmailPreview(options: {
|
|
132
|
-
themeId?: string;
|
|
129
|
+
themeId?: string | null | false;
|
|
133
130
|
themeTsxSource?: string;
|
|
134
131
|
templateId?: string;
|
|
135
132
|
templateTsxSource?: string;
|
|
@@ -144,9 +141,12 @@ declare class StackAdminInterface extends StackServerInterface {
|
|
|
144
141
|
tsx_source: string;
|
|
145
142
|
}>;
|
|
146
143
|
updateEmailTheme(id: string, tsxSource: string): Promise<void>;
|
|
147
|
-
|
|
144
|
+
updateEmailTemplate(id: string, tsxSource: string, themeId: string | null | false): Promise<{
|
|
148
145
|
rendered_html: string;
|
|
149
146
|
}>;
|
|
147
|
+
createEmailTemplate(displayName: string): Promise<{
|
|
148
|
+
id: string;
|
|
149
|
+
}>;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
export { type AdminAuthApplicationOptions, type ChatContent, type InternalApiKeyCreateCrudRequest, type InternalApiKeyCreateCrudResponse, StackAdminInterface };
|