@stackframe/stack-shared 2.8.60 → 2.8.61

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.
Files changed (69) hide show
  1. package/dist/config/schema-fuzzer.test.js +6 -5
  2. package/dist/config/schema-fuzzer.test.js.map +1 -1
  3. package/dist/config/schema.d.mts +277 -95
  4. package/dist/config/schema.d.ts +277 -95
  5. package/dist/config/schema.js +40 -24
  6. package/dist/config/schema.js.map +1 -1
  7. package/dist/esm/config/schema-fuzzer.test.js +6 -5
  8. package/dist/esm/config/schema-fuzzer.test.js.map +1 -1
  9. package/dist/esm/config/schema.js +40 -24
  10. package/dist/esm/config/schema.js.map +1 -1
  11. package/dist/esm/helpers/emails.js +73 -1
  12. package/dist/esm/helpers/emails.js.map +1 -1
  13. package/dist/esm/interface/admin-interface.js +70 -3
  14. package/dist/esm/interface/admin-interface.js.map +1 -1
  15. package/dist/esm/interface/client-interface.js +21 -4
  16. package/dist/esm/interface/client-interface.js.map +1 -1
  17. package/dist/esm/interface/crud/email-templates.js +1 -1
  18. package/dist/esm/interface/crud/email-templates.js.map +1 -1
  19. package/dist/esm/interface/crud/invoices.js +27 -0
  20. package/dist/esm/interface/crud/invoices.js.map +1 -0
  21. package/dist/esm/interface/server-interface.js.map +1 -1
  22. package/dist/esm/payments/payment-methods.js +101 -0
  23. package/dist/esm/payments/payment-methods.js.map +1 -0
  24. package/dist/esm/schema-fields.js +17 -0
  25. package/dist/esm/schema-fields.js.map +1 -1
  26. package/dist/esm/utils/objects.js +2 -2
  27. package/dist/esm/utils/objects.js.map +1 -1
  28. package/dist/helpers/emails.d.mts +12 -0
  29. package/dist/helpers/emails.d.ts +12 -0
  30. package/dist/helpers/emails.js +73 -1
  31. package/dist/helpers/emails.js.map +1 -1
  32. package/dist/index.d.mts +2 -1
  33. package/dist/index.d.ts +2 -1
  34. package/dist/interface/admin-interface.d.mts +22 -5
  35. package/dist/interface/admin-interface.d.ts +22 -5
  36. package/dist/interface/admin-interface.js +70 -3
  37. package/dist/interface/admin-interface.js.map +1 -1
  38. package/dist/interface/client-interface.d.mts +4 -2
  39. package/dist/interface/client-interface.d.ts +4 -2
  40. package/dist/interface/client-interface.js +21 -4
  41. package/dist/interface/client-interface.js.map +1 -1
  42. package/dist/interface/crud/email-templates.d.mts +5 -5
  43. package/dist/interface/crud/email-templates.d.ts +5 -5
  44. package/dist/interface/crud/email-templates.js +1 -1
  45. package/dist/interface/crud/email-templates.js.map +1 -1
  46. package/dist/interface/crud/invoices.d.mts +41 -0
  47. package/dist/interface/crud/invoices.d.ts +41 -0
  48. package/dist/interface/crud/invoices.js +53 -0
  49. package/dist/interface/crud/invoices.js.map +1 -0
  50. package/dist/interface/crud/project-api-keys.d.mts +2 -2
  51. package/dist/interface/crud/project-api-keys.d.ts +2 -2
  52. package/dist/interface/server-interface.d.mts +1 -0
  53. package/dist/interface/server-interface.d.ts +1 -0
  54. package/dist/interface/server-interface.js.map +1 -1
  55. package/dist/payments/payment-methods.d.mts +62 -0
  56. package/dist/payments/payment-methods.d.ts +62 -0
  57. package/dist/payments/payment-methods.js +135 -0
  58. package/dist/payments/payment-methods.js.map +1 -0
  59. package/dist/schema-fields.d.mts +13 -1
  60. package/dist/schema-fields.d.ts +13 -1
  61. package/dist/schema-fields.js +18 -0
  62. package/dist/schema-fields.js.map +1 -1
  63. package/dist/sessions.d.mts +1 -1
  64. package/dist/sessions.d.ts +1 -1
  65. package/dist/utils/objects.d.mts +6 -6
  66. package/dist/utils/objects.d.ts +6 -6
  67. package/dist/utils/objects.js +2 -2
  68. package/dist/utils/objects.js.map +1 -1
  69. package/package.json +1 -1
@@ -38,6 +38,16 @@ declare const DEFAULT_EMAIL_TEMPLATES: {
38
38
  tsxSource: string;
39
39
  themeId: undefined;
40
40
  };
41
+ "70372aee-0441-4d80-974c-2e858e40123a": {
42
+ displayName: string;
43
+ tsxSource: string;
44
+ themeId: undefined;
45
+ };
46
+ "f64b1afe-27ec-4a28-a277-7178f3261f9a": {
47
+ displayName: string;
48
+ tsxSource: string;
49
+ themeId: undefined;
50
+ };
41
51
  };
42
52
  declare const DEFAULT_TEMPLATE_IDS: {
43
53
  readonly email_verification: "e7d009ce-8d47-4528-b245-5bf119f2ffa3";
@@ -45,6 +55,8 @@ declare const DEFAULT_TEMPLATE_IDS: {
45
55
  readonly magic_link: "822687fe-8d0a-4467-a0d1-416b6e639478";
46
56
  readonly team_invitation: "e84de395-2076-4831-9c19-8e9a96a868e4";
47
57
  readonly sign_in_invitation: "066dd73c-36da-4fd0-b6d6-ebf87683f8bc";
58
+ readonly payment_receipt: "70372aee-0441-4d80-974c-2e858e40123a";
59
+ readonly payment_failed: "f64b1afe-27ec-4a28-a277-7178f3261f9a";
48
60
  };
49
61
 
50
62
  export { DEFAULT_EMAIL_TEMPLATES, DEFAULT_EMAIL_THEMES, DEFAULT_EMAIL_THEME_ID, DEFAULT_TEMPLATE_IDS, LightEmailTheme, emptyEmailTheme, previewTemplateSource };
@@ -144,6 +144,8 @@ var EMAIL_TEMPLATE_PASSWORD_RESET_ID = "a70fb3a4-56c1-4e42-af25-49d25603abd0";
144
144
  var EMAIL_TEMPLATE_MAGIC_LINK_ID = "822687fe-8d0a-4467-a0d1-416b6e639478";
145
145
  var EMAIL_TEMPLATE_TEAM_INVITATION_ID = "e84de395-2076-4831-9c19-8e9a96a868e4";
146
146
  var EMAIL_TEMPLATE_SIGN_IN_INVITATION_ID = "066dd73c-36da-4fd0-b6d6-ebf87683f8bc";
147
+ var EMAIL_TEMPLATE_PAYMENT_RECEIPT_ID = "70372aee-0441-4d80-974c-2e858e40123a";
148
+ var EMAIL_TEMPLATE_PAYMENT_FAILED_ID = "f64b1afe-27ec-4a28-a277-7178f3261f9a";
147
149
  var DEFAULT_EMAIL_TEMPLATES = {
148
150
  [EMAIL_TEMPLATE_EMAIL_VERIFICATION_ID]: {
149
151
  "displayName": "Email Verification",
@@ -220,6 +222,74 @@ EmailTemplate.PreviewVariables = {
220
222
  "displayName": "Sign In Invitation",
221
223
  "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',
222
224
  "themeId": void 0
225
+ },
226
+ [EMAIL_TEMPLATE_PAYMENT_RECEIPT_ID]: {
227
+ "displayName": "Payment Receipt",
228
+ "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 productName: "string",\n quantity: "number",\n amount: "string",\n receiptLink: "string?"\n});\n\nexport function EmailTemplate({ user, project, variables }: Props<typeof variablesSchema.infer>) {\n return (\n <>\n <Subject value={"Your receipt from " + 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 Thanks for your purchase\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) : ""}! Your payment for {variables.productName} is complete.\n </p>\n <div className="px-6">\n <p className="text-black font-sans font-bold text-[16px] text-center m-0">\n Total paid: {variables.amount}\n </p>\n <p className="text-[#474849] font-sans text-[13px] text-center mt-2 mb-0">\n Quantity: {variables.quantity}\n </p>\n </div>\n {variables.receiptLink ? (\n <div className="text-center py-4 px-6">\n <Button\n href={variables.receiptLink}\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 View receipt\n </Button>\n </div>\n ) : null}\n <div className="py-4 px-6">\n <Hr />\n </div>\n </Section>\n </div>\n </>\n );\n}\n\nEmailTemplate.PreviewVariables = {\n productName: "Pro Plan",\n quantity: 1,\n amount: "$29.00",\n receiptLink: "https://example.com/receipt"\n} satisfies typeof variablesSchema.infer;\n',
229
+ "themeId": void 0
230
+ },
231
+ [EMAIL_TEMPLATE_PAYMENT_FAILED_ID]: {
232
+ "displayName": "Payment Failed",
233
+ "tsxSource": `import { type } from "arktype";
234
+ import { Button, Section, Hr } from "@react-email/components";
235
+ import { Subject, NotificationCategory, Props } from "@stackframe/emails";
236
+
237
+ export const variablesSchema = type({
238
+ productName: "string",
239
+ amount: "string",
240
+ invoiceUrl: "string?",
241
+ failureReason: "string?"
242
+ });
243
+
244
+ export function EmailTemplate({ user, project, variables }: Props<typeof variablesSchema.infer>) {
245
+ return (
246
+ <>
247
+ <Subject value={"Payment failed for " + project.displayName} />
248
+ <NotificationCategory value="Transactional" />
249
+ <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">
250
+ <Section className="bg-white">
251
+ <h3 className="text-black font-sans font-bold text-[20px] text-center py-4 px-6 m-0">
252
+ We couldn't process your payment
253
+ </h3>
254
+ <p className="text-[#474849] font-sans font-normal text-[14px] text-center pt-2 px-6 pb-4 m-0">
255
+ Hi{user.displayName ? (", " + user.displayName) : ""}! Your payment for {variables.productName} ({variables.amount}) did not go through.
256
+ </p>
257
+ {variables.failureReason ? (
258
+ <p className="text-[#8a8b8b] font-sans text-[12px] text-center px-6 pb-2 m-0">
259
+ Reason: {variables.failureReason}
260
+ </p>
261
+ ) : null}
262
+ {variables.invoiceUrl ? (
263
+ <div className="text-center py-3 px-6">
264
+ <Button
265
+ href={variables.invoiceUrl}
266
+ target="_blank"
267
+ className="text-black font-sans font-bold text-[14px] inline-block bg-[#f0f0f0] rounded-[4px] py-3 px-5 no-underline border-0"
268
+ >
269
+ View invoice
270
+ </Button>
271
+ </div>
272
+ ) : null}
273
+ <div className="py-4 px-6">
274
+ <Hr />
275
+ </div>
276
+ <p className="text-[#474849] font-sans font-normal text-[12px] text-center pt-1 px-6 pb-6 m-0">
277
+ Please update your payment details to avoid service interruption.
278
+ </p>
279
+ </Section>
280
+ </div>
281
+ </>
282
+ );
283
+ }
284
+
285
+ EmailTemplate.PreviewVariables = {
286
+ productName: "Pro Plan",
287
+ amount: "$29.00",
288
+ invoiceUrl: "https://example.com/billing",
289
+ failureReason: "Your card was declined"
290
+ } satisfies typeof variablesSchema.infer;
291
+ `,
292
+ "themeId": void 0
223
293
  }
224
294
  };
225
295
  var DEFAULT_TEMPLATE_IDS = {
@@ -227,7 +297,9 @@ var DEFAULT_TEMPLATE_IDS = {
227
297
  password_reset: EMAIL_TEMPLATE_PASSWORD_RESET_ID,
228
298
  magic_link: EMAIL_TEMPLATE_MAGIC_LINK_ID,
229
299
  team_invitation: EMAIL_TEMPLATE_TEAM_INVITATION_ID,
230
- sign_in_invitation: EMAIL_TEMPLATE_SIGN_IN_INVITATION_ID
300
+ sign_in_invitation: EMAIL_TEMPLATE_SIGN_IN_INVITATION_ID,
301
+ payment_receipt: EMAIL_TEMPLATE_PAYMENT_RECEIPT_ID,
302
+ payment_failed: EMAIL_TEMPLATE_PAYMENT_FAILED_ID
231
303
  };
232
304
  // Annotate the CommonJS export names for ESM import in node:
233
305
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/helpers/emails.ts"],"sourcesContent":["import { deindent } from \"../utils/strings\";\n\nexport const previewTemplateSource = deindent`\n import { Heading, Section, Row, 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, Link } from '@react-email/components';\nimport { ThemeProps, ProjectLogo } from \"@stackframe/emails\";\n\nexport function EmailTheme({ children, unsubscribeLink, projectLogos }: ThemeProps) {\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 <ProjectLogo data={projectLogos} mode=\"light\" />\n {children}\n </Container>\n {unsubscribeLink && (\n <div className=\"p-4\">\n <Link href={unsubscribeLink}>Click here{\" \"}</Link>\n to unsubscribe from these emails\n </div>\n )}\n </Body>\n </Tailwind>\n </Html>\n );\n}\n\nEmailTheme.PreviewProps = {\n unsubscribeLink: \"https://example.com\",\n} satisfies Partial<ThemeProps>\n`;\n\n\nconst DarkEmailTheme = `import { Html, Head, Tailwind, Body, Container, Link } from '@react-email/components';\nimport { ThemeProps, ProjectLogo } from \"@stackframe/emails\";\n\nexport function EmailTheme({ children, unsubscribeLink, projectLogos }: ThemeProps) {\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 <ProjectLogo data={projectLogos} mode=\"dark\" />\n {children}\n </Container>\n {unsubscribeLink && (\n <div className=\"p-4\">\n <Link href={unsubscribeLink} className=\"text-gray-300\">Click here{\" \"}</Link>\n to unsubscribe from these emails\n </div>\n )}\n </Body>\n </Tailwind>\n </Html>\n );\n}\n\nEmailTheme.PreviewProps = {\n unsubscribeLink: \"https://example.com\",\n} satisfies Partial<ThemeProps>\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+B/B,IAAM,iBAAiB;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;AA+BhB,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":[]}
1
+ {"version":3,"sources":["../../src/helpers/emails.ts"],"sourcesContent":["import { deindent } from \"../utils/strings\";\n\nexport const previewTemplateSource = deindent`\n import { Heading, Section, Row, 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, Link } from '@react-email/components';\nimport { ThemeProps, ProjectLogo } from \"@stackframe/emails\";\n\nexport function EmailTheme({ children, unsubscribeLink, projectLogos }: ThemeProps) {\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 <ProjectLogo data={projectLogos} mode=\"light\" />\n {children}\n </Container>\n {unsubscribeLink && (\n <div className=\"p-4\">\n <Link href={unsubscribeLink}>Click here{\" \"}</Link>\n to unsubscribe from these emails\n </div>\n )}\n </Body>\n </Tailwind>\n </Html>\n );\n}\n\nEmailTheme.PreviewProps = {\n unsubscribeLink: \"https://example.com\",\n} satisfies Partial<ThemeProps>\n`;\n\n\nconst DarkEmailTheme = `import { Html, Head, Tailwind, Body, Container, Link } from '@react-email/components';\nimport { ThemeProps, ProjectLogo } from \"@stackframe/emails\";\n\nexport function EmailTheme({ children, unsubscribeLink, projectLogos }: ThemeProps) {\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 <ProjectLogo data={projectLogos} mode=\"dark\" />\n {children}\n </Container>\n {unsubscribeLink && (\n <div className=\"p-4\">\n <Link href={unsubscribeLink} className=\"text-gray-300\">Click here{\" \"}</Link>\n to unsubscribe from these emails\n </div>\n )}\n </Body>\n </Tailwind>\n </Html>\n );\n}\n\nEmailTheme.PreviewProps = {\n unsubscribeLink: \"https://example.com\",\n} satisfies Partial<ThemeProps>\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\";\nconst EMAIL_TEMPLATE_PAYMENT_RECEIPT_ID = \"70372aee-0441-4d80-974c-2e858e40123a\";\nconst EMAIL_TEMPLATE_PAYMENT_FAILED_ID = \"f64b1afe-27ec-4a28-a277-7178f3261f9a\";\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 [EMAIL_TEMPLATE_PAYMENT_RECEIPT_ID]: {\n \"displayName\": \"Payment Receipt\",\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 productName: \\\"string\\\",\\n quantity: \\\"number\\\",\\n amount: \\\"string\\\",\\n receiptLink: \\\"string?\\\"\\n});\\n\\nexport function EmailTemplate({ user, project, variables }: Props<typeof variablesSchema.infer>) {\\n return (\\n <>\\n <Subject value={\\\"Your receipt from \\\" + 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 Thanks for your purchase\\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) : \\\"\\\"}! Your payment for {variables.productName} is complete.\\n </p>\\n <div className=\\\"px-6\\\">\\n <p className=\\\"text-black font-sans font-bold text-[16px] text-center m-0\\\">\\n Total paid: {variables.amount}\\n </p>\\n <p className=\\\"text-[#474849] font-sans text-[13px] text-center mt-2 mb-0\\\">\\n Quantity: {variables.quantity}\\n </p>\\n </div>\\n {variables.receiptLink ? (\\n <div className=\\\"text-center py-4 px-6\\\">\\n <Button\\n href={variables.receiptLink}\\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 View receipt\\n </Button>\\n </div>\\n ) : null}\\n <div className=\\\"py-4 px-6\\\">\\n <Hr />\\n </div>\\n </Section>\\n </div>\\n </>\\n );\\n}\\n\\nEmailTemplate.PreviewVariables = {\\n productName: \\\"Pro Plan\\\",\\n quantity: 1,\\n amount: \\\"$29.00\\\",\\n receiptLink: \\\"https://example.com/receipt\\\"\\n} satisfies typeof variablesSchema.infer;\\n\",\n \"themeId\": undefined,\n },\n [EMAIL_TEMPLATE_PAYMENT_FAILED_ID]: {\n \"displayName\": \"Payment Failed\",\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 productName: \\\"string\\\",\\n amount: \\\"string\\\",\\n invoiceUrl: \\\"string?\\\",\\n failureReason: \\\"string?\\\"\\n});\\n\\nexport function EmailTemplate({ user, project, variables }: Props<typeof variablesSchema.infer>) {\\n return (\\n <>\\n <Subject value={\\\"Payment failed for \\\" + 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 We couldn't process your payment\\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) : \\\"\\\"}! Your payment for {variables.productName} ({variables.amount}) did not go through.\\n </p>\\n {variables.failureReason ? (\\n <p className=\\\"text-[#8a8b8b] font-sans text-[12px] text-center px-6 pb-2 m-0\\\">\\n Reason: {variables.failureReason}\\n </p>\\n ) : null}\\n {variables.invoiceUrl ? (\\n <div className=\\\"text-center py-3 px-6\\\">\\n <Button\\n href={variables.invoiceUrl}\\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 View invoice\\n </Button>\\n </div>\\n ) : null}\\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 Please update your payment details to avoid service interruption.\\n </p>\\n </Section>\\n </div>\\n </>\\n );\\n}\\n\\nEmailTemplate.PreviewVariables = {\\n productName: \\\"Pro Plan\\\",\\n amount: \\\"$29.00\\\",\\n invoiceUrl: \\\"https://example.com/billing\\\",\\n failureReason: \\\"Your card was declined\\\"\\n} satisfies typeof variablesSchema.infer;\\n\",\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 payment_receipt: EMAIL_TEMPLATE_PAYMENT_RECEIPT_ID,\n payment_failed: EMAIL_TEMPLATE_PAYMENT_FAILED_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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+B/B,IAAM,iBAAiB;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;AA+BhB,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;AAC7C,IAAM,oCAAoC;AAC1C,IAAM,mCAAmC;AAElC,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;AAAA,EACA,CAAC,iCAAiC,GAAG;AAAA,IACnC,eAAe;AAAA,IACf,aAAa;AAAA,IACb,WAAW;AAAA,EACb;AAAA,EACA,CAAC,gCAAgC,GAAG;AAAA,IAClC,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;AAAA;AAAA;AAAA;AAAA;AAAA;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;AAAA,EACpB,iBAAiB;AAAA,EACjB,gBAAgB;AAClB;","names":[]}
package/dist/index.d.mts CHANGED
@@ -2,11 +2,11 @@ export { StackAdminInterface } from './interface/admin-interface.mjs';
2
2
  export { StackClientInterface } from './interface/client-interface.mjs';
3
3
  export { StackServerInterface } from './interface/server-interface.mjs';
4
4
  export { KnownError, KnownErrors } from './known-errors.mjs';
5
- import './sessions.mjs';
6
5
  import 'yup';
7
6
  import './schema-fields.mjs';
8
7
  import './utils/currency-constants.mjs';
9
8
  import './utils/dates.mjs';
9
+ import './sessions.mjs';
10
10
  import './utils/results.mjs';
11
11
  import './interface/crud/email-outbox.mjs';
12
12
  import './crud.mjs';
@@ -34,5 +34,6 @@ import './interface/crud/team-memberships.mjs';
34
34
  import './interface/crud/teams.mjs';
35
35
  import './interface/crud/users.mjs';
36
36
  import '@simplewebauthn/types';
37
+ import './interface/crud/invoices.mjs';
37
38
  import './interface/crud/products.mjs';
38
39
  import './interface/crud/project-api-keys.mjs';
package/dist/index.d.ts CHANGED
@@ -2,11 +2,11 @@ export { StackAdminInterface } from './interface/admin-interface.js';
2
2
  export { StackClientInterface } from './interface/client-interface.js';
3
3
  export { StackServerInterface } from './interface/server-interface.js';
4
4
  export { KnownError, KnownErrors } from './known-errors.js';
5
- import './sessions.js';
6
5
  import 'yup';
7
6
  import './schema-fields.js';
8
7
  import './utils/currency-constants.js';
9
8
  import './utils/dates.js';
9
+ import './sessions.js';
10
10
  import './utils/results.js';
11
11
  import './interface/crud/email-outbox.js';
12
12
  import './crud.js';
@@ -34,5 +34,6 @@ import './interface/crud/team-memberships.js';
34
34
  import './interface/crud/teams.js';
35
35
  import './interface/crud/users.js';
36
36
  import '@simplewebauthn/types';
37
+ import './interface/crud/invoices.js';
37
38
  import './interface/crud/products.js';
38
39
  import './interface/crud/project-api-keys.js';
@@ -1,4 +1,6 @@
1
+ import * as yup from 'yup';
1
2
  import { KnownErrors } from '../known-errors.mjs';
3
+ import { branchConfigSourceSchema } from '../schema-fields.mjs';
2
4
  import { InternalSession, AccessToken, RefreshToken } from '../sessions.mjs';
3
5
  import { Result } from '../utils/results.mjs';
4
6
  import { EmailOutboxCrud } from './crud/email-outbox.mjs';
@@ -13,8 +15,6 @@ import { ServerAuthApplicationOptions, StackServerInterface } from './server-int
13
15
  import './client-interface.mjs';
14
16
  import '../utils/errors.mjs';
15
17
  import '../utils/json.mjs';
16
- import 'yup';
17
- import '../schema-fields.mjs';
18
18
  import '../utils/currency-constants.mjs';
19
19
  import '../utils/dates.mjs';
20
20
  import '../crud.mjs';
@@ -33,9 +33,11 @@ import './crud/team-memberships.mjs';
33
33
  import './crud/teams.mjs';
34
34
  import './crud/users.mjs';
35
35
  import '@simplewebauthn/types';
36
+ import './crud/invoices.mjs';
36
37
  import './crud/products.mjs';
37
38
  import './crud/project-api-keys.mjs';
38
39
 
40
+ type BranchConfigSourceApi = yup.InferType<typeof branchConfigSourceSchema>;
39
41
  type ChatContent = Array<{
40
42
  type: "text";
41
43
  text: string;
@@ -180,9 +182,13 @@ declare class StackAdminInterface extends StackServerInterface {
180
182
  getConfig(): Promise<{
181
183
  config_string: string;
182
184
  }>;
183
- updateConfig(data: {
184
- configOverride: any;
185
- }): Promise<void>;
185
+ getConfigOverride(level: "branch" | "environment"): Promise<{
186
+ config_string: string;
187
+ }>;
188
+ setConfigOverride(level: "branch" | "environment", configOverride: any, source?: BranchConfigSourceApi): Promise<void>;
189
+ updateConfigOverride(level: "branch" | "environment", configOverrideOverride: any): Promise<void>;
190
+ getPushedConfigSource(): Promise<BranchConfigSourceApi>;
191
+ unlinkPushedConfigSource(): Promise<void>;
186
192
  createEmailTemplate(displayName: string): Promise<{
187
193
  id: string;
188
194
  }>;
@@ -195,6 +201,17 @@ declare class StackAdminInterface extends StackServerInterface {
195
201
  details_submitted: boolean;
196
202
  payouts_enabled: boolean;
197
203
  }>;
204
+ getPaymentMethodConfigs(): Promise<{
205
+ configId: string;
206
+ methods: Array<{
207
+ id: string;
208
+ name: string;
209
+ enabled: boolean;
210
+ available: boolean;
211
+ overridable: boolean;
212
+ }>;
213
+ } | null>;
214
+ updatePaymentMethodConfigs(configId: string, updates: Record<string, 'on' | 'off'>): Promise<void>;
198
215
  createStripeWidgetAccountSession(): Promise<{
199
216
  client_secret: string;
200
217
  }>;
@@ -1,4 +1,6 @@
1
+ import * as yup from 'yup';
1
2
  import { KnownErrors } from '../known-errors.js';
3
+ import { branchConfigSourceSchema } from '../schema-fields.js';
2
4
  import { InternalSession, AccessToken, RefreshToken } from '../sessions.js';
3
5
  import { Result } from '../utils/results.js';
4
6
  import { EmailOutboxCrud } from './crud/email-outbox.js';
@@ -13,8 +15,6 @@ import { ServerAuthApplicationOptions, StackServerInterface } from './server-int
13
15
  import './client-interface.js';
14
16
  import '../utils/errors.js';
15
17
  import '../utils/json.js';
16
- import 'yup';
17
- import '../schema-fields.js';
18
18
  import '../utils/currency-constants.js';
19
19
  import '../utils/dates.js';
20
20
  import '../crud.js';
@@ -33,9 +33,11 @@ import './crud/team-memberships.js';
33
33
  import './crud/teams.js';
34
34
  import './crud/users.js';
35
35
  import '@simplewebauthn/types';
36
+ import './crud/invoices.js';
36
37
  import './crud/products.js';
37
38
  import './crud/project-api-keys.js';
38
39
 
40
+ type BranchConfigSourceApi = yup.InferType<typeof branchConfigSourceSchema>;
39
41
  type ChatContent = Array<{
40
42
  type: "text";
41
43
  text: string;
@@ -180,9 +182,13 @@ declare class StackAdminInterface extends StackServerInterface {
180
182
  getConfig(): Promise<{
181
183
  config_string: string;
182
184
  }>;
183
- updateConfig(data: {
184
- configOverride: any;
185
- }): Promise<void>;
185
+ getConfigOverride(level: "branch" | "environment"): Promise<{
186
+ config_string: string;
187
+ }>;
188
+ setConfigOverride(level: "branch" | "environment", configOverride: any, source?: BranchConfigSourceApi): Promise<void>;
189
+ updateConfigOverride(level: "branch" | "environment", configOverrideOverride: any): Promise<void>;
190
+ getPushedConfigSource(): Promise<BranchConfigSourceApi>;
191
+ unlinkPushedConfigSource(): Promise<void>;
186
192
  createEmailTemplate(displayName: string): Promise<{
187
193
  id: string;
188
194
  }>;
@@ -195,6 +201,17 @@ declare class StackAdminInterface extends StackServerInterface {
195
201
  details_submitted: boolean;
196
202
  payouts_enabled: boolean;
197
203
  }>;
204
+ getPaymentMethodConfigs(): Promise<{
205
+ configId: string;
206
+ methods: Array<{
207
+ id: string;
208
+ name: string;
209
+ enabled: boolean;
210
+ available: boolean;
211
+ overridable: boolean;
212
+ }>;
213
+ } | null>;
214
+ updatePaymentMethodConfigs(configId: string, updates: Record<string, 'on' | 'off'>): Promise<void>;
198
215
  createStripeWidgetAccountSession(): Promise<{
199
216
  client_secret: string;
200
217
  }>;
@@ -434,19 +434,59 @@ var StackAdminInterface = class extends import_server_interface.StackServerInter
434
434
  );
435
435
  return await response.json();
436
436
  }
437
- async updateConfig(data) {
437
+ async getConfigOverride(level) {
438
438
  const response = await this.sendAdminRequest(
439
- `/internal/config/override`,
439
+ `/internal/config/override/${level}`,
440
+ { method: "GET" },
441
+ null
442
+ );
443
+ return await response.json();
444
+ }
445
+ async setConfigOverride(level, configOverride, source) {
446
+ await this.sendAdminRequest(
447
+ `/internal/config/override/${level}`,
448
+ {
449
+ method: "PUT",
450
+ headers: {
451
+ "content-type": "application/json"
452
+ },
453
+ body: JSON.stringify({
454
+ config_string: JSON.stringify(configOverride),
455
+ ...source && { source }
456
+ })
457
+ },
458
+ null
459
+ );
460
+ }
461
+ async updateConfigOverride(level, configOverrideOverride) {
462
+ await this.sendAdminRequest(
463
+ `/internal/config/override/${level}`,
440
464
  {
441
465
  method: "PATCH",
442
466
  headers: {
443
467
  "content-type": "application/json"
444
468
  },
445
- body: JSON.stringify({ config_override_string: JSON.stringify(data.configOverride) })
469
+ body: JSON.stringify({ config_override_string: JSON.stringify(configOverrideOverride) })
446
470
  },
447
471
  null
448
472
  );
449
473
  }
474
+ async getPushedConfigSource() {
475
+ const response = await this.sendAdminRequest(
476
+ `/internal/config/source`,
477
+ { method: "GET" },
478
+ null
479
+ );
480
+ const data = await response.json();
481
+ return data.source;
482
+ }
483
+ async unlinkPushedConfigSource() {
484
+ await this.sendAdminRequest(
485
+ `/internal/config/source`,
486
+ { method: "DELETE" },
487
+ null
488
+ );
489
+ }
450
490
  async createEmailTemplate(displayName) {
451
491
  const response = await this.sendAdminRequest(
452
492
  `/internal/email-templates`,
@@ -489,6 +529,33 @@ var StackAdminInterface = class extends import_server_interface.StackServerInter
489
529
  }
490
530
  return await response.data.json();
491
531
  }
532
+ async getPaymentMethodConfigs() {
533
+ const response = await this.sendAdminRequestAndCatchKnownError(
534
+ "/internal/payments/method-configs",
535
+ { method: "GET" },
536
+ null,
537
+ [import_known_errors.KnownErrors.StripeAccountInfoNotFound]
538
+ );
539
+ if (response.status === "error") {
540
+ return null;
541
+ }
542
+ const data = await response.data.json();
543
+ return {
544
+ configId: data.config_id,
545
+ methods: data.methods
546
+ };
547
+ }
548
+ async updatePaymentMethodConfigs(configId, updates) {
549
+ await this.sendAdminRequest(
550
+ "/internal/payments/method-configs",
551
+ {
552
+ method: "PATCH",
553
+ headers: { "content-type": "application/json" },
554
+ body: JSON.stringify({ config_id: configId, updates })
555
+ },
556
+ null
557
+ );
558
+ }
492
559
  async createStripeWidgetAccountSession() {
493
560
  const response = await this.sendAdminRequest(
494
561
  "/internal/payments/stripe-widgets/account-session",