@tollwyn/baukasten 0.0.2 → 1.2.2

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 (213) hide show
  1. package/README.md +254 -1
  2. package/dist/bin/check.d.ts +2 -0
  3. package/dist/bin/check.js +38 -0
  4. package/dist/bin/migrate.d.ts +2 -0
  5. package/dist/bin/migrate.js +111 -0
  6. package/dist/bin/stubs.d.ts +2 -0
  7. package/dist/bin/stubs.js +38 -0
  8. package/dist/bin/test-accounts.d.ts +2 -0
  9. package/dist/bin/test-accounts.js +62 -0
  10. package/dist/check.d.ts +20 -0
  11. package/dist/check.js +285 -0
  12. package/dist/index.d.ts +7 -0
  13. package/dist/index.js +9 -0
  14. package/dist/product.d.ts +161 -0
  15. package/dist/product.js +152 -0
  16. package/dist/server/accounts.d.ts +128 -0
  17. package/dist/server/accounts.js +282 -0
  18. package/dist/server/adapter/db.d.ts +5 -0
  19. package/dist/server/adapter/db.js +63 -0
  20. package/dist/server/adapter/log.d.ts +3 -0
  21. package/dist/server/adapter/log.js +12 -0
  22. package/dist/server/adapter/mailer.d.ts +4 -0
  23. package/dist/server/adapter/mailer.js +56 -0
  24. package/dist/server/adapter/migrate.d.ts +21 -0
  25. package/dist/server/adapter/migrate.js +113 -0
  26. package/dist/server/adapter/secrets.d.ts +2 -0
  27. package/dist/server/adapter/secrets.js +40 -0
  28. package/dist/server/adapter/stripe.d.ts +11 -0
  29. package/dist/server/adapter/stripe.js +333 -0
  30. package/dist/server/api.d.ts +25 -0
  31. package/dist/server/api.js +98 -0
  32. package/dist/server/baukasten-migrations.d.ts +4 -0
  33. package/dist/server/baukasten-migrations.js +126 -0
  34. package/dist/server/billing.d.ts +94 -0
  35. package/dist/server/billing.js +349 -0
  36. package/dist/server/catalog.d.ts +39 -0
  37. package/dist/server/catalog.js +193 -0
  38. package/dist/server/config.d.ts +108 -0
  39. package/dist/server/config.js +244 -0
  40. package/dist/server/endpoints.d.ts +44 -0
  41. package/dist/server/endpoints.js +159 -0
  42. package/dist/server/fields.d.ts +7 -0
  43. package/dist/server/fields.js +18 -0
  44. package/dist/server/headers.d.ts +1 -0
  45. package/dist/server/headers.js +9 -0
  46. package/dist/server/health.d.ts +34 -0
  47. package/dist/server/health.js +116 -0
  48. package/dist/server/hook.d.ts +92 -0
  49. package/dist/server/hook.js +293 -0
  50. package/dist/server/index.d.ts +18 -0
  51. package/dist/server/index.js +11 -0
  52. package/dist/server/legal/de.d.ts +2 -0
  53. package/dist/server/legal/de.js +251 -0
  54. package/dist/server/legal/document.d.ts +37 -0
  55. package/dist/server/legal/document.js +30 -0
  56. package/dist/server/legal/en.d.ts +2 -0
  57. package/dist/server/legal/en.js +251 -0
  58. package/dist/server/legal/fleet.d.ts +114 -0
  59. package/dist/server/legal/fleet.js +89 -0
  60. package/dist/server/legal/index.d.ts +3 -0
  61. package/dist/server/legal/index.js +11 -0
  62. package/dist/server/limits.d.ts +58 -0
  63. package/dist/server/limits.js +76 -0
  64. package/dist/server/log.d.ts +26 -0
  65. package/dist/server/log.js +61 -0
  66. package/dist/server/machine.d.ts +4 -0
  67. package/dist/server/machine.js +57 -0
  68. package/dist/server/mail.d.ts +20 -0
  69. package/dist/server/mail.js +29 -0
  70. package/dist/server/messages.d.ts +105 -0
  71. package/dist/server/messages.js +232 -0
  72. package/dist/server/migrations.d.ts +28 -0
  73. package/dist/server/migrations.js +59 -0
  74. package/dist/server/openapi.d.ts +24 -0
  75. package/dist/server/openapi.js +173 -0
  76. package/dist/server/pages.d.ts +158 -0
  77. package/dist/server/pages.js +491 -0
  78. package/dist/server/ports.d.ts +273 -0
  79. package/dist/server/ports.js +1 -0
  80. package/dist/server/runs.d.ts +30 -0
  81. package/dist/server/runs.js +55 -0
  82. package/dist/server/sales.d.ts +38 -0
  83. package/dist/server/sales.js +132 -0
  84. package/dist/server/services.d.ts +57 -0
  85. package/dist/server/services.js +44 -0
  86. package/dist/server/start.d.ts +14 -0
  87. package/dist/server/start.js +65 -0
  88. package/dist/server/stripe.d.ts +33 -0
  89. package/dist/server/stripe.js +29 -0
  90. package/dist/server/terms.d.ts +7 -0
  91. package/dist/server/terms.js +9 -0
  92. package/dist/server/test-accounts.d.ts +28 -0
  93. package/dist/server/test-accounts.js +62 -0
  94. package/dist/server/via.d.ts +9 -0
  95. package/dist/server/via.js +15 -0
  96. package/dist/server/web.d.ts +48 -0
  97. package/dist/server/web.js +105 -0
  98. package/dist/shopify/adapter/shopify.d.ts +8 -0
  99. package/dist/shopify/adapter/shopify.js +232 -0
  100. package/dist/shopify/admin.d.ts +33 -0
  101. package/dist/shopify/admin.js +47 -0
  102. package/dist/shopify/app.d.ts +60 -0
  103. package/dist/shopify/app.js +67 -0
  104. package/dist/shopify/config.d.ts +53 -0
  105. package/dist/shopify/config.js +133 -0
  106. package/dist/shopify/constants.d.ts +27 -0
  107. package/dist/shopify/constants.js +27 -0
  108. package/dist/shopify/headers.d.ts +1 -0
  109. package/dist/shopify/headers.js +8 -0
  110. package/dist/shopify/hmac.d.ts +1 -0
  111. package/dist/shopify/hmac.js +9 -0
  112. package/dist/shopify/hook.d.ts +60 -0
  113. package/dist/shopify/hook.js +508 -0
  114. package/dist/shopify/id-token.d.ts +12 -0
  115. package/dist/shopify/id-token.js +66 -0
  116. package/dist/shopify/index.d.ts +19 -0
  117. package/dist/shopify/index.js +15 -0
  118. package/dist/shopify/legal/de.d.ts +3 -0
  119. package/dist/shopify/legal/de.js +123 -0
  120. package/dist/shopify/legal/en.d.ts +3 -0
  121. package/dist/shopify/legal/en.js +121 -0
  122. package/dist/shopify/legal/index.d.ts +19 -0
  123. package/dist/shopify/legal/index.js +8 -0
  124. package/dist/shopify/legal/shopify.d.ts +16 -0
  125. package/dist/shopify/legal/shopify.js +21 -0
  126. package/dist/shopify/migrations.d.ts +4 -0
  127. package/dist/shopify/migrations.js +67 -0
  128. package/dist/shopify/pages.d.ts +45 -0
  129. package/dist/shopify/pages.js +146 -0
  130. package/dist/shopify/ports.d.ts +77 -0
  131. package/dist/shopify/ports.js +1 -0
  132. package/dist/shopify/sales.d.ts +4 -0
  133. package/dist/shopify/sales.js +27 -0
  134. package/dist/shopify/scopes.d.ts +2 -0
  135. package/dist/shopify/scopes.js +13 -0
  136. package/dist/shopify/seal.d.ts +12 -0
  137. package/dist/shopify/seal.js +60 -0
  138. package/dist/shopify/shop.d.ts +4 -0
  139. package/dist/shopify/shop.js +15 -0
  140. package/dist/shopify/shops.d.ts +76 -0
  141. package/dist/shopify/shops.js +256 -0
  142. package/dist/shopify/sveltekit.d.ts +19 -0
  143. package/dist/shopify/sveltekit.js +18 -0
  144. package/dist/shopify/texts.d.ts +28 -0
  145. package/dist/shopify/texts.js +49 -0
  146. package/dist/shopify/toml.d.ts +22 -0
  147. package/dist/shopify/toml.js +125 -0
  148. package/dist/shopify/webhooks.d.ts +65 -0
  149. package/dist/shopify/webhooks.js +220 -0
  150. package/dist/stubs.d.ts +15 -0
  151. package/dist/stubs.js +287 -0
  152. package/dist/sveltekit.d.ts +20 -0
  153. package/dist/sveltekit.js +18 -0
  154. package/dist/testing/app.d.ts +36 -0
  155. package/dist/testing/app.js +155 -0
  156. package/dist/testing/browser.d.ts +21 -0
  157. package/dist/testing/browser.js +21 -0
  158. package/dist/testing/connection.d.ts +7 -0
  159. package/dist/testing/connection.js +303 -0
  160. package/dist/testing/database.d.ts +21 -0
  161. package/dist/testing/database.js +54 -0
  162. package/dist/testing/env-example.d.ts +4 -0
  163. package/dist/testing/env-example.js +33 -0
  164. package/dist/testing/index.d.ts +9 -0
  165. package/dist/testing/index.js +9 -0
  166. package/dist/testing/shopify-connection.d.ts +8 -0
  167. package/dist/testing/shopify-connection.js +313 -0
  168. package/dist/testing/shopify.d.ts +71 -0
  169. package/dist/testing/shopify.js +278 -0
  170. package/dist/testing/smtp.d.ts +38 -0
  171. package/dist/testing/smtp.js +165 -0
  172. package/dist/testing/stripe.d.ts +128 -0
  173. package/dist/testing/stripe.js +511 -0
  174. package/dist/texts.d.ts +139 -0
  175. package/dist/texts.js +265 -0
  176. package/dist/ui/AccountPage.svelte +143 -0
  177. package/dist/ui/AccountPage.svelte.d.ts +10 -0
  178. package/dist/ui/ConfirmEmailPage.svelte +21 -0
  179. package/dist/ui/ConfirmEmailPage.svelte.d.ts +10 -0
  180. package/dist/ui/ErrorPage.svelte +14 -0
  181. package/dist/ui/ErrorPage.svelte.d.ts +3 -0
  182. package/dist/ui/Field.svelte +12 -0
  183. package/dist/ui/Field.svelte.d.ts +10 -0
  184. package/dist/ui/ForgotPasswordPage.svelte +32 -0
  185. package/dist/ui/ForgotPasswordPage.svelte.d.ts +7 -0
  186. package/dist/ui/Form.svelte +30 -0
  187. package/dist/ui/Form.svelte.d.ts +11 -0
  188. package/dist/ui/Frame.svelte +84 -0
  189. package/dist/ui/Frame.svelte.d.ts +12 -0
  190. package/dist/ui/LegalPage.svelte +38 -0
  191. package/dist/ui/LegalPage.svelte.d.ts +9 -0
  192. package/dist/ui/Linked.svelte +5 -0
  193. package/dist/ui/Linked.svelte.d.ts +8 -0
  194. package/dist/ui/LoginPage.svelte +41 -0
  195. package/dist/ui/LoginPage.svelte.d.ts +10 -0
  196. package/dist/ui/LogoutPage.svelte +19 -0
  197. package/dist/ui/LogoutPage.svelte.d.ts +9 -0
  198. package/dist/ui/ResetPasswordPage.svelte +30 -0
  199. package/dist/ui/ResetPasswordPage.svelte.d.ts +10 -0
  200. package/dist/ui/SignupPage.svelte +52 -0
  201. package/dist/ui/SignupPage.svelte.d.ts +10 -0
  202. package/dist/ui/VerifyEmailPage.svelte +50 -0
  203. package/dist/ui/VerifyEmailPage.svelte.d.ts +10 -0
  204. package/dist/ui/base.css +287 -0
  205. package/dist/ui/data.d.ts +167 -0
  206. package/dist/ui/data.js +1 -0
  207. package/dist/ui/frame.d.ts +17 -0
  208. package/dist/ui/frame.js +27 -0
  209. package/dist/ui/index.d.ts +15 -0
  210. package/dist/ui/index.js +15 -0
  211. package/dist/variables.d.ts +20 -0
  212. package/dist/variables.js +62 -0
  213. package/package.json +88 -4
@@ -0,0 +1,167 @@
1
+ import type { Language, NavigationLink } from '../product.js';
2
+ export interface FrameData {
3
+ language: Language;
4
+ /** The name of the product: MAIL_FROM_NAME. */
5
+ name: string;
6
+ navigation: readonly NavigationLink[];
7
+ /** The referral tag of the link this page was opened with; its links carry it on. */
8
+ via: string | null;
9
+ account: {
10
+ email: string;
11
+ emailVerified: boolean;
12
+ } | null;
13
+ /** The marks of the product, the picture of a shared link at its whole address; null without. */
14
+ brand: {
15
+ logo: {
16
+ src: string;
17
+ width: number;
18
+ height: number;
19
+ };
20
+ icon: {
21
+ href: string;
22
+ type: 'image/svg+xml' | 'image/png';
23
+ };
24
+ image: string;
25
+ } | null;
26
+ }
27
+ export interface SignupData {
28
+ heading: string;
29
+ lead: string;
30
+ /** The referral tag the sign-up records; null without one. */
31
+ via: string | null;
32
+ }
33
+ export interface SignupForm {
34
+ email: string;
35
+ error: string;
36
+ taken?: boolean;
37
+ }
38
+ export interface LoginData {
39
+ notice: 'verified' | 'emailChanged' | null;
40
+ }
41
+ export interface LoginForm {
42
+ email: string;
43
+ error: string;
44
+ }
45
+ export interface LogoutData {
46
+ loggedIn: boolean;
47
+ deleted: boolean;
48
+ }
49
+ export interface ForgotForm {
50
+ email: string;
51
+ error?: string;
52
+ sent?: boolean;
53
+ }
54
+ export interface ResetData {
55
+ token: string;
56
+ valid: boolean;
57
+ }
58
+ export interface ResetForm {
59
+ error: string;
60
+ }
61
+ export type VerifyData =
62
+ /** Opened from the mail. */
63
+ {
64
+ kind: 'link';
65
+ token: string;
66
+ valid: boolean;
67
+ needsPassword: boolean;
68
+ }
69
+ /** Logged in and not confirmed yet; `unsent` when the mail of the sign-up failed. */
70
+ | {
71
+ kind: 'pending';
72
+ email: string;
73
+ unsent: boolean;
74
+ }
75
+ /** Logged in and confirmed. */
76
+ | {
77
+ kind: 'confirmed';
78
+ }
79
+ /** Neither a link nor a login. */
80
+ | {
81
+ kind: 'none';
82
+ };
83
+ export interface VerifyForm {
84
+ error?: string;
85
+ /** The address a new link went to. */
86
+ resent?: string;
87
+ }
88
+ export interface ConfirmData {
89
+ token: string;
90
+ /** The address the link makes the login address; null for a link that is not usable. */
91
+ newEmail: string | null;
92
+ }
93
+ export interface ConfirmForm {
94
+ error: string;
95
+ }
96
+ export interface AccountData {
97
+ email: string;
98
+ emailVerified: boolean;
99
+ hasPassword: boolean;
100
+ /** How a key of the product looks, for the explanation. */
101
+ keyExample: string;
102
+ /** Whether the account is a customer at Stripe, with something to see in the customer portal. */
103
+ customer: boolean;
104
+ keys: {
105
+ id: string;
106
+ name: string;
107
+ prefix: string;
108
+ created: string;
109
+ }[];
110
+ notice: 'verified' | 'emailChanged' | null;
111
+ }
112
+ export type AccountForm = {
113
+ action: 'createKey';
114
+ key?: string;
115
+ error?: string;
116
+ } | {
117
+ action: 'revokeKey';
118
+ } | {
119
+ action: 'changePassword';
120
+ error?: string;
121
+ done?: boolean;
122
+ } | {
123
+ action: 'changeEmail';
124
+ email: string;
125
+ error?: string;
126
+ sentTo?: string;
127
+ } | {
128
+ action: 'delete';
129
+ error: string;
130
+ };
131
+ /** A piece of a sentence on a legal page. */
132
+ export type LegalInline = string | {
133
+ kind: 'strong';
134
+ text: string;
135
+ } | {
136
+ kind: 'code';
137
+ text: string;
138
+ } | {
139
+ kind: 'link';
140
+ text: string;
141
+ href: string;
142
+ };
143
+ export type LegalBlock = {
144
+ kind: 'heading';
145
+ text: string;
146
+ } | {
147
+ kind: 'paragraph';
148
+ parts: LegalInline[];
149
+ }
150
+ /** A paragraph set apart, like the version of a text. */
151
+ | {
152
+ kind: 'note';
153
+ parts: LegalInline[];
154
+ } | {
155
+ kind: 'list';
156
+ items: LegalInline[][];
157
+ }
158
+ /** A list counted a, b, c. */
159
+ | {
160
+ kind: 'lettered';
161
+ items: LegalInline[][];
162
+ };
163
+ /** An imprint, a privacy policy or terms, as the server writes them for the product. */
164
+ export interface LegalData {
165
+ title: string;
166
+ blocks: LegalBlock[];
167
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { Texts } from '../texts.js';
2
+ export interface FrameContext {
3
+ t: Texts;
4
+ /** The name of the product, for the titles of the pages. */
5
+ name: string;
6
+ /** A path of the product with the referral tag of this page, if it has one. */
7
+ link: (path: string) => string;
8
+ }
9
+ export declare function provideFrame(context: FrameContext): void;
10
+ /**
11
+ * `path` with the referral tag `via`: the page opened with `?via=` hands it to every link, until the
12
+ * sign-up; nothing keeps it in the browser.
13
+ */
14
+ export declare function withVia(path: string, via: string | null): string;
15
+ /** For the pages of the product: its links carry the referral tag like those of the baukasten. */
16
+ export declare function useLink(): (path: string) => string;
17
+ export declare function useFrame(): FrameContext;
@@ -0,0 +1,27 @@
1
+ import { getContext, setContext } from 'svelte';
2
+ const KEY = Symbol('baukasten frame');
3
+ export function provideFrame(context) {
4
+ setContext(KEY, context);
5
+ }
6
+ /**
7
+ * `path` with the referral tag `via`: the page opened with `?via=` hands it to every link, until the
8
+ * sign-up; nothing keeps it in the browser.
9
+ */
10
+ export function withVia(path, via) {
11
+ if (via === null)
12
+ return path;
13
+ const at = path.indexOf('#');
14
+ const [base, fragment] = at < 0 ? [path, ''] : [path.slice(0, at), path.slice(at)];
15
+ return `${base}${base.includes('?') ? '&' : '?'}via=${via}${fragment}`;
16
+ }
17
+ /** For the pages of the product: its links carry the referral tag like those of the baukasten. */
18
+ export function useLink() {
19
+ return useFrame().link;
20
+ }
21
+ export function useFrame() {
22
+ const context = getContext(KEY);
23
+ if (context === undefined) {
24
+ throw new Error('a page of the baukasten outside its frame: the root layout is the Frame');
25
+ }
26
+ return context;
27
+ }
@@ -0,0 +1,15 @@
1
+ export { default as AccountPage } from './AccountPage.svelte';
2
+ export { default as ConfirmEmailPage } from './ConfirmEmailPage.svelte';
3
+ export { default as ErrorPage } from './ErrorPage.svelte';
4
+ export { default as Field } from './Field.svelte';
5
+ export { default as ForgotPasswordPage } from './ForgotPasswordPage.svelte';
6
+ export { default as Form } from './Form.svelte';
7
+ export { default as Frame } from './Frame.svelte';
8
+ export { default as LegalPage } from './LegalPage.svelte';
9
+ export { useLink } from './frame.js';
10
+ export { default as LoginPage } from './LoginPage.svelte';
11
+ export { default as LogoutPage } from './LogoutPage.svelte';
12
+ export { default as ResetPasswordPage } from './ResetPasswordPage.svelte';
13
+ export { default as SignupPage } from './SignupPage.svelte';
14
+ export { default as VerifyEmailPage } from './VerifyEmailPage.svelte';
15
+ export type * from './data.js';
@@ -0,0 +1,15 @@
1
+ // Everything here runs in the browser too, and lives inside the Frame, the root layout.
2
+ export { default as AccountPage } from './AccountPage.svelte';
3
+ export { default as ConfirmEmailPage } from './ConfirmEmailPage.svelte';
4
+ export { default as ErrorPage } from './ErrorPage.svelte';
5
+ export { default as Field } from './Field.svelte';
6
+ export { default as ForgotPasswordPage } from './ForgotPasswordPage.svelte';
7
+ export { default as Form } from './Form.svelte';
8
+ export { default as Frame } from './Frame.svelte';
9
+ export { default as LegalPage } from './LegalPage.svelte';
10
+ export { useLink } from './frame.js';
11
+ export { default as LoginPage } from './LoginPage.svelte';
12
+ export { default as LogoutPage } from './LogoutPage.svelte';
13
+ export { default as ResetPasswordPage } from './ResetPasswordPage.svelte';
14
+ export { default as SignupPage } from './SignupPage.svelte';
15
+ export { default as VerifyEmailPage } from './VerifyEmailPage.svelte';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The variables the delivery service sets for every web app, in its order
3
+ * (`standard-variables.test.ts` holds them against the delivery service).
4
+ */
5
+ export declare const STANDARD_VARIABLES: readonly ["PUBLIC_ORIGIN", "PORT", "DATABASE_URL", "SMTP_HOST", "SMTP_PORT", "MAIL_FROM", "MAIL_FROM_NAME", "OPERATOR_NAME", "OPERATOR_ADDRESS", "OPERATOR_REGISTER", "OPERATOR_VAT", "OPERATOR_JURISDICTION", "HOSTING_LOCATION", "STRIPE_SECRET_KEY", "STRIPE_WEBHOOK_SECRET", "VERTRIEB_TOKEN"];
6
+ export type StandardVariable = (typeof STANDARD_VARIABLES)[number];
7
+ /**
8
+ * The variables the delivery service sets for every Shopify app, in its order; the Partner API alone
9
+ * says the plan of a shop.
10
+ */
11
+ export declare const SHOPIFY_STANDARD_VARIABLES: readonly ["PUBLIC_ORIGIN", "PORT", "DATABASE_URL", "SMTP_HOST", "SMTP_PORT", "MAIL_FROM", "MAIL_FROM_NAME", "OPERATOR_NAME", "OPERATOR_ADDRESS", "HOSTING_LOCATION", "VERTRIEB_TOKEN", "SHOPIFY_API_SECRET", "SHOPIFY_TOKEN_KEY", "SHOPIFY_PARTNER_TOKEN", "SHOPIFY_PARTNER_ORG"];
12
+ export type ShopifyStandardVariable = (typeof SHOPIFY_STANDARD_VARIABLES)[number];
13
+ /**
14
+ * Every variable the baukasten reads in a web app. NODE_ENV comes from the image, and the server sets
15
+ * ORIGIN from PUBLIC_ORIGIN.
16
+ */
17
+ export declare const WEBAPP_VARIABLES: readonly ["PUBLIC_ORIGIN", "PORT", "DATABASE_URL", "SMTP_HOST", "SMTP_PORT", "MAIL_FROM", "MAIL_FROM_NAME", "OPERATOR_NAME", "OPERATOR_ADDRESS", "OPERATOR_REGISTER", "OPERATOR_VAT", "OPERATOR_JURISDICTION", "HOSTING_LOCATION", "STRIPE_SECRET_KEY", "STRIPE_WEBHOOK_SECRET", "VERTRIEB_TOKEN", "LOG_LEVEL", "TEST_DATABASE_URL", "STRIPE_API_BASE"];
18
+ export declare const SHOPIFY_VARIABLES: readonly ["PUBLIC_ORIGIN", "PORT", "DATABASE_URL", "SMTP_HOST", "SMTP_PORT", "MAIL_FROM", "MAIL_FROM_NAME", "OPERATOR_NAME", "OPERATOR_ADDRESS", "HOSTING_LOCATION", "VERTRIEB_TOKEN", "SHOPIFY_API_SECRET", "SHOPIFY_TOKEN_KEY", "SHOPIFY_PARTNER_TOKEN", "SHOPIFY_PARTNER_ORG", "LOG_LEVEL", "TEST_DATABASE_URL", "SHOPIFY_API_BASE", "SHOPIFY_CLIENT_ID"];
19
+ /** Every variable the baukasten reads in a product of either art: no product takes one for its own. */
20
+ export declare const BAUKASTEN_VARIABLES: ("PUBLIC_ORIGIN" | "PORT" | "DATABASE_URL" | "SMTP_HOST" | "SMTP_PORT" | "MAIL_FROM" | "MAIL_FROM_NAME" | "OPERATOR_NAME" | "OPERATOR_ADDRESS" | "OPERATOR_REGISTER" | "OPERATOR_VAT" | "OPERATOR_JURISDICTION" | "HOSTING_LOCATION" | "STRIPE_SECRET_KEY" | "STRIPE_WEBHOOK_SECRET" | "VERTRIEB_TOKEN" | "SHOPIFY_API_SECRET" | "SHOPIFY_TOKEN_KEY" | "SHOPIFY_PARTNER_TOKEN" | "SHOPIFY_PARTNER_ORG" | "LOG_LEVEL" | "TEST_DATABASE_URL" | "STRIPE_API_BASE" | "SHOPIFY_API_BASE" | "SHOPIFY_CLIENT_ID")[];
@@ -0,0 +1,62 @@
1
+ /**
2
+ * The variables the delivery service sets for every web app, in its order
3
+ * (`standard-variables.test.ts` holds them against the delivery service).
4
+ */
5
+ export const STANDARD_VARIABLES = [
6
+ 'PUBLIC_ORIGIN',
7
+ 'PORT',
8
+ 'DATABASE_URL',
9
+ 'SMTP_HOST',
10
+ 'SMTP_PORT',
11
+ 'MAIL_FROM',
12
+ 'MAIL_FROM_NAME',
13
+ 'OPERATOR_NAME',
14
+ 'OPERATOR_ADDRESS',
15
+ 'OPERATOR_REGISTER',
16
+ 'OPERATOR_VAT',
17
+ 'OPERATOR_JURISDICTION',
18
+ 'HOSTING_LOCATION',
19
+ 'STRIPE_SECRET_KEY',
20
+ 'STRIPE_WEBHOOK_SECRET',
21
+ 'VERTRIEB_TOKEN'
22
+ ];
23
+ /**
24
+ * The variables the delivery service sets for every Shopify app, in its order; the Partner API alone
25
+ * says the plan of a shop.
26
+ */
27
+ export const SHOPIFY_STANDARD_VARIABLES = [
28
+ 'PUBLIC_ORIGIN',
29
+ 'PORT',
30
+ 'DATABASE_URL',
31
+ 'SMTP_HOST',
32
+ 'SMTP_PORT',
33
+ 'MAIL_FROM',
34
+ 'MAIL_FROM_NAME',
35
+ 'OPERATOR_NAME',
36
+ 'OPERATOR_ADDRESS',
37
+ 'HOSTING_LOCATION',
38
+ 'VERTRIEB_TOKEN',
39
+ 'SHOPIFY_API_SECRET',
40
+ 'SHOPIFY_TOKEN_KEY',
41
+ 'SHOPIFY_PARTNER_TOKEN',
42
+ 'SHOPIFY_PARTNER_ORG'
43
+ ];
44
+ /**
45
+ * Every variable the baukasten reads in a web app. NODE_ENV comes from the image, and the server sets
46
+ * ORIGIN from PUBLIC_ORIGIN.
47
+ */
48
+ export const WEBAPP_VARIABLES = [
49
+ ...STANDARD_VARIABLES,
50
+ 'LOG_LEVEL',
51
+ 'TEST_DATABASE_URL',
52
+ 'STRIPE_API_BASE'
53
+ ];
54
+ export const SHOPIFY_VARIABLES = [
55
+ ...SHOPIFY_STANDARD_VARIABLES,
56
+ 'LOG_LEVEL',
57
+ 'TEST_DATABASE_URL',
58
+ 'SHOPIFY_API_BASE',
59
+ 'SHOPIFY_CLIENT_ID'
60
+ ];
61
+ /** Every variable the baukasten reads in a product of either art: no product takes one for its own. */
62
+ export const BAUKASTEN_VARIABLES = [...new Set([...WEBAPP_VARIABLES, ...SHOPIFY_VARIABLES])];
package/package.json CHANGED
@@ -1,9 +1,93 @@
1
1
  {
2
2
  "name": "@tollwyn/baukasten",
3
- "version": "0.0.2",
4
- "description": "Placeholder. Use a 1.x version of @tollwyn/baukasten.",
3
+ "version": "1.2.2",
4
+ "description": "What every product built on this kit shares: configuration, log and server, database with two-layer migrations, health, accounts with sessions and API keys, limits, mail, payment through Stripe, the numbers for sales, the frame and pages, the stubs that hang them into a product and the check of a product, and the tools to test one, its connection test among them; and for a Shopify app its installation with tokens, the frame of the admin, its webhooks, its plan through the Partner API and its privacy text.",
5
5
  "license": "UNLICENSED",
6
+ "type": "module",
7
+ "engines": {
8
+ "node": ">=24"
9
+ },
6
10
  "files": [
7
- "README.md"
8
- ]
11
+ "dist",
12
+ "!dist/**/*.test.*"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.js"
18
+ },
19
+ "./server": {
20
+ "types": "./dist/server/index.d.ts",
21
+ "browser": "./server-code-is-not-for-the-browser",
22
+ "default": "./dist/server/index.js"
23
+ },
24
+ "./shopify": {
25
+ "types": "./dist/shopify/index.d.ts",
26
+ "browser": "./server-code-is-not-for-the-browser",
27
+ "default": "./dist/shopify/index.js"
28
+ },
29
+ "./testing": {
30
+ "types": "./dist/testing/index.d.ts",
31
+ "browser": "./server-code-is-not-for-the-browser",
32
+ "default": "./dist/testing/index.js"
33
+ },
34
+ "./ui": {
35
+ "types": "./dist/ui/index.d.ts",
36
+ "svelte": "./dist/ui/index.js",
37
+ "default": "./dist/ui/index.js"
38
+ }
39
+ },
40
+ "bin": {
41
+ "baukasten-check": "dist/bin/check.js",
42
+ "baukasten-migrate": "dist/bin/migrate.js",
43
+ "baukasten-stubs": "dist/bin/stubs.js",
44
+ "baukasten-test-accounts": "dist/bin/test-accounts.js"
45
+ },
46
+ "scripts": {
47
+ "build": "svelte-package --input src/lib --output dist",
48
+ "prepack": "npm run build",
49
+ "muster": "npm run build && npm --prefix muster ci --no-audit --no-fund && npm --prefix muster-shopify ci --no-audit --no-fund",
50
+ "test": "vitest run && npm --prefix muster test && npm --prefix muster-shopify test",
51
+ "test:watch": "vitest",
52
+ "test:db": "node ../scripts/test-db.mjs mit vitest run --config vitest.db.config.ts",
53
+ "test:e2e": "npm run muster && npm --prefix muster run test:e2e && npm --prefix muster-shopify run test:e2e",
54
+ "typecheck": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings && npm --prefix muster run check && npm --prefix muster-shopify run check",
55
+ "lint": "eslint . --max-warnings 0 && prettier --check . && npm --prefix muster run lint && npm --prefix muster-shopify run lint",
56
+ "check:version": "node scripts/npm-version.ts"
57
+ },
58
+ "peerDependencies": {
59
+ "@sveltejs/kit": "^2.70.0",
60
+ "svelte": "^5.57.0"
61
+ },
62
+ "dependencies": {
63
+ "nodemailer": "10.0.16",
64
+ "pg": "8.23.1",
65
+ "smol-toml": "1.9.0",
66
+ "stripe": "22.6.2",
67
+ "zod": "4.6.5"
68
+ },
69
+ "devDependencies": {
70
+ "@eslint-community/eslint-plugin-eslint-comments": "4.7.2",
71
+ "@eslint/js": "10.0.1",
72
+ "@playwright/test": "1.62.1",
73
+ "@sveltejs/kit": "2.70.3",
74
+ "@sveltejs/package": "2.5.8",
75
+ "@sveltejs/vite-plugin-svelte": "7.3.0",
76
+ "@types/node": "24.19.1",
77
+ "@types/pg": "8.23.1",
78
+ "@types/smtp-server": "3.5.13",
79
+ "eslint": "10.9.1",
80
+ "eslint-config-prettier": "10.1.8",
81
+ "eslint-plugin-svelte": "3.23.0",
82
+ "globals": "17.12.0",
83
+ "prettier": "3.9.6",
84
+ "prettier-plugin-svelte": "4.1.1",
85
+ "smtp-server": "3.19.17",
86
+ "svelte": "5.57.2",
87
+ "svelte-check": "4.7.6",
88
+ "typescript": "6.0.3",
89
+ "typescript-eslint": "8.69.0",
90
+ "vite": "8.2.2",
91
+ "vitest": "5.0.3"
92
+ }
9
93
  }