anhedral 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -232
- package/assets/patches/audit-deps.mjs +12 -2
- package/assets/ui/LICENSE.shadcn +21 -0
- package/assets/ui/UPSTREAM.json +33 -0
- package/assets/ui/native/button.tsx +85 -0
- package/assets/ui/native/card.tsx +33 -0
- package/assets/ui/native/dialog.tsx +75 -0
- package/assets/ui/native/input.tsx +27 -0
- package/assets/ui/native/label.tsx +4 -0
- package/assets/ui/native/layout.tsx +26 -0
- package/assets/ui/native/text.tsx +20 -0
- package/assets/ui/native/theme-switcher.tsx +22 -0
- package/assets/ui/theme-storage.ts +25 -0
- package/assets/ui/theme.tsx +66 -0
- package/assets/ui/web/button.tsx +59 -0
- package/assets/ui/web/input.tsx +21 -0
- package/assets/ui/web/label.tsx +19 -0
- package/dist/capabilities.d.ts +5 -5
- package/dist/capabilities.js +3 -21
- package/dist/capability-contract.d.ts +3 -3
- package/dist/capability-contract.js +11 -50
- package/dist/cli-delivery.d.ts +1 -1
- package/dist/cli-delivery.js +5 -65
- package/dist/cli-output.js +3 -3
- package/dist/command-schema.js +35 -86
- package/dist/delivery-evidence.d.ts +1 -1
- package/dist/delivery-evidence.js +7 -36
- package/dist/delivery.d.ts +2 -8
- package/dist/delivery.js +20 -101
- package/dist/dependencies.d.ts +6 -57
- package/dist/dependencies.js +54 -188
- package/dist/index.d.ts +1 -4
- package/dist/index.js +1 -4
- package/dist/inspector-model.d.ts +2 -2
- package/dist/integration-service-readers.d.ts +1 -2
- package/dist/integration-service-readers.js +3 -84
- package/dist/lifecycle-model.d.ts +1 -1
- package/dist/lifecycle-model.js +1 -1
- package/dist/mobile-delivery.d.ts +1 -1
- package/dist/mobile-delivery.js +4 -0
- package/dist/platforms/mobile.js +30 -121
- package/dist/platforms/web.d.ts +3 -0
- package/dist/platforms/web.js +299 -0
- package/dist/project-config.d.ts +1 -1
- package/dist/project-config.js +0 -1
- package/dist/project-inspector.js +5 -36
- package/dist/project-state.d.ts +1 -3
- package/dist/project-state.js +2 -85
- package/dist/provider-auth.js +3 -38
- package/dist/provider-readiness.d.ts +1 -1
- package/dist/provider-readiness.js +5 -24
- package/dist/providers/adapters.js +0 -175
- package/dist/providers/api.d.ts +1 -1
- package/dist/providers/api.js +3 -3
- package/dist/providers/config.js +2 -48
- package/dist/providers/definitions.d.ts +1 -204
- package/dist/providers/definitions.js +0 -85
- package/dist/providers/provision.d.ts +1 -1
- package/dist/providers/receipts.js +1 -11
- package/dist/providers/recovery-verification.js +1 -61
- package/dist/providers/runtime.js +4 -35
- package/dist/providers/state.js +1 -7
- package/dist/provision.d.ts +5 -13
- package/dist/provision.js +4 -80
- package/dist/readiness.d.ts +1 -1
- package/dist/readiness.js +3 -8
- package/dist/registry/add.js +10 -70
- package/dist/registry/bootstrap.d.ts +3 -2
- package/dist/registry/bootstrap.js +4 -13
- package/dist/registry/commands.js +8 -10
- package/dist/registry/context.js +0 -1
- package/dist/registry/options.js +8 -38
- package/dist/registry/resolve.d.ts +3 -4
- package/dist/registry/resolve.js +26 -108
- package/dist/registry/types.d.ts +1 -7
- package/dist/registry/usage.js +2 -2
- package/dist/runtime-policy.d.ts +0 -2
- package/dist/runtime-policy.js +0 -16
- package/dist/scaffold/auth.d.ts +1 -2
- package/dist/scaffold/auth.js +55 -130
- package/dist/scaffold/backend.d.ts +0 -4
- package/dist/scaffold/backend.js +1 -186
- package/dist/scaffold/billing-schema.d.ts +1 -1
- package/dist/scaffold/billing-schema.js +4 -4
- package/dist/scaffold/billing.js +11 -19
- package/dist/scaffold/bootstrap.d.ts +2 -3
- package/dist/scaffold/bootstrap.js +37 -43
- package/dist/scaffold/compose.js +2 -14
- package/dist/scaffold/database.d.ts +1 -1
- package/dist/scaffold/database.js +18 -126
- package/dist/scaffold/documentation.d.ts +0 -1
- package/dist/scaffold/documentation.js +22 -86
- package/dist/scaffold/expo-auth.js +33 -22
- package/dist/scaffold/expo-billing.js +17 -52
- package/dist/scaffold/expo-runtime.d.ts +2 -2
- package/dist/scaffold/expo-runtime.js +6 -97
- package/dist/scaffold/integrations.d.ts +1 -3
- package/dist/scaffold/integrations.js +9 -10
- package/dist/scaffold/managed-email.d.ts +3 -0
- package/dist/scaffold/managed-email.js +47 -0
- package/dist/scaffold/native-ui.d.ts +2 -0
- package/dist/scaffold/native-ui.js +69 -0
- package/dist/scaffold/password-reset.d.ts +1 -0
- package/dist/scaffold/password-reset.js +99 -0
- package/dist/scaffold/private-files.d.ts +2 -0
- package/dist/scaffold/private-files.js +78 -0
- package/dist/scaffold/stack-documentation.d.ts +0 -1
- package/dist/scaffold/stack-documentation.js +3 -49
- package/dist/scaffold/styling.d.ts +1 -1
- package/dist/scaffold/styling.js +20 -28
- package/dist/scaffold/web-billing.d.ts +2 -0
- package/dist/scaffold/web-billing.js +48 -0
- package/dist/scaffold/workspace.js +53 -194
- package/dist/service-deletion.js +1 -1
- package/dist/service-descriptor.js +5 -12
- package/dist/service-model.d.ts +1 -1
- package/dist/service-operations.js +2 -32
- package/dist/service-readers.js +1 -32
- package/dist/services-command.d.ts +1 -1
- package/dist/services-command.js +3 -9
- package/dist/ship.d.ts +3 -316
- package/dist/ship.js +10 -142
- package/dist/stack-registry.d.ts +2 -52
- package/dist/stack-registry.js +55 -403
- package/dist/standard.js +7 -14
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/anhedral-stack.md +23 -122
- package/docs/assets/anhedral-stack-light.png +0 -0
- package/docs/assets/anhedral-stack.png +0 -0
- package/docs/software-factory.md +24 -557
- package/docs/stack-standard.md +47 -294
- package/docs/verification.md +320 -0
- package/package.json +20 -22
- package/dist/neon-service-data.d.ts +0 -8
- package/dist/neon-service-data.js +0 -117
- package/dist/platforms/desktop.d.ts +0 -2
- package/dist/platforms/desktop.js +0 -415
- package/dist/platforms/extension.d.ts +0 -2
- package/dist/platforms/extension.js +0 -328
- package/dist/registry/presets.d.ts +0 -4
- package/dist/registry/presets.js +0 -41
- package/dist/scaffold/cloudflare-services.d.ts +0 -8
- package/dist/scaffold/cloudflare-services.js +0 -198
- package/dist/scaffold/lint.d.ts +0 -4
- package/dist/scaffold/lint.js +0 -56
- package/dist/scaffold/neon-realtime.d.ts +0 -2
- package/dist/scaffold/neon-realtime.js +0 -97
- package/dist/scaffold/services.d.ts +0 -5
- package/dist/scaffold/services.js +0 -108
- package/dist/scaffold/stream.d.ts +0 -2
- package/dist/scaffold/stream.js +0 -114
- package/dist/scaffold/void.d.ts +0 -4
- package/dist/scaffold/void.js +0 -264
- package/dist/scaffold/web.d.ts +0 -2
- package/dist/scaffold/web.js +0 -130
- package/dist/vercel-project.d.ts +0 -101
- package/dist/vercel-project.js +0 -305
- package/dist/vercel.d.ts +0 -67
- package/dist/vercel.js +0 -581
- package/dist/vinext.d.ts +0 -2
- package/dist/vinext.js +0 -86
- package/dist/void-execution.d.ts +0 -10
- package/dist/void-execution.js +0 -94
- package/dist/void-migrations.d.ts +0 -6
- package/dist/void-migrations.js +0 -110
- package/dist/void-state.d.ts +0 -16
- package/dist/void-state.js +0 -65
- package/dist/void.d.ts +0 -3
- package/dist/void.js +0 -5
|
@@ -1,25 +1,4 @@
|
|
|
1
1
|
import type { StandardProduct } from '../stack-registry.js';
|
|
2
|
-
/** Public provider configuration describes resources, never credentials. Empty strings are
|
|
3
|
-
* permitted for scaffolding; provisioning separately checks the required choices. */
|
|
4
|
-
export interface NeonSettings {
|
|
5
|
-
projectId?: string;
|
|
6
|
-
name?: string;
|
|
7
|
-
organizationId?: string;
|
|
8
|
-
region?: string;
|
|
9
|
-
database?: string;
|
|
10
|
-
role?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface ClerkSettings {
|
|
13
|
-
workspaceId?: string;
|
|
14
|
-
applicationId?: string;
|
|
15
|
-
name?: string;
|
|
16
|
-
environment?: '' | 'development' | 'production';
|
|
17
|
-
}
|
|
18
|
-
export interface ResendSettings {
|
|
19
|
-
domainId?: string;
|
|
20
|
-
domain?: string;
|
|
21
|
-
region?: string;
|
|
22
|
-
}
|
|
23
2
|
export interface StripeSettings {
|
|
24
3
|
accountId?: string;
|
|
25
4
|
mode?: '' | 'test' | 'live';
|
|
@@ -36,40 +15,14 @@ export interface RevenueCatSettings {
|
|
|
36
15
|
bundleId?: string;
|
|
37
16
|
packageName?: string;
|
|
38
17
|
}
|
|
39
|
-
export interface SentrySettings {
|
|
40
|
-
organization?: string;
|
|
41
|
-
team?: string;
|
|
42
|
-
project?: string;
|
|
43
|
-
name?: string;
|
|
44
|
-
platform?: string;
|
|
45
|
-
}
|
|
46
|
-
export interface PostHogSettings {
|
|
47
|
-
organizationId?: string;
|
|
48
|
-
projectId?: string;
|
|
49
|
-
name?: string;
|
|
50
|
-
region?: '' | 'us' | 'eu';
|
|
51
|
-
}
|
|
52
|
-
export interface OpenAISettings {
|
|
53
|
-
projectId?: string;
|
|
54
|
-
name?: string;
|
|
55
|
-
serviceAccountName?: string;
|
|
56
|
-
}
|
|
57
18
|
export interface ProviderSettingsById {
|
|
58
|
-
neon: NeonSettings;
|
|
59
|
-
clerk: ClerkSettings;
|
|
60
|
-
resend: ResendSettings;
|
|
61
19
|
stripe: StripeSettings;
|
|
62
20
|
revenuecat: RevenueCatSettings;
|
|
63
|
-
sentry: SentrySettings;
|
|
64
|
-
posthog: PostHogSettings;
|
|
65
|
-
openai: OpenAISettings;
|
|
66
21
|
}
|
|
67
22
|
export type IntegrationProvider = keyof ProviderSettingsById;
|
|
68
23
|
/** Shared adapter access remains bounded to known fields; provider configuration itself
|
|
69
24
|
* uses ProviderSettingsById so fields cannot leak between providers. */
|
|
70
|
-
export type ProviderSettings =
|
|
71
|
-
region?: string;
|
|
72
|
-
};
|
|
25
|
+
export type ProviderSettings = StripeSettings & RevenueCatSettings;
|
|
73
26
|
export type ProviderField = keyof ProviderSettings;
|
|
74
27
|
export type FieldKind = 'text' | 'identity' | 'https-url' | 'events';
|
|
75
28
|
export interface ProviderFieldDefinition {
|
|
@@ -94,83 +47,6 @@ export interface ProviderDefinition {
|
|
|
94
47
|
ownerSteps: readonly string[];
|
|
95
48
|
}
|
|
96
49
|
export declare const PROVIDER_DEFINITIONS: {
|
|
97
|
-
readonly neon: {
|
|
98
|
-
readonly credential: "NEON_API_KEY";
|
|
99
|
-
readonly auth: {
|
|
100
|
-
readonly path: "/api/v2/projects";
|
|
101
|
-
};
|
|
102
|
-
readonly origin: "https://console.neon.tech";
|
|
103
|
-
readonly fields: {
|
|
104
|
-
readonly projectId: {
|
|
105
|
-
readonly kind: "identity";
|
|
106
|
-
};
|
|
107
|
-
readonly name: {
|
|
108
|
-
readonly kind: "text";
|
|
109
|
-
};
|
|
110
|
-
readonly organizationId: {
|
|
111
|
-
readonly kind: "identity";
|
|
112
|
-
};
|
|
113
|
-
readonly region: {
|
|
114
|
-
readonly kind: "text";
|
|
115
|
-
};
|
|
116
|
-
readonly database: {
|
|
117
|
-
readonly kind: "text";
|
|
118
|
-
};
|
|
119
|
-
readonly role: {
|
|
120
|
-
readonly kind: "text";
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
readonly resources: readonly ["project", "database connection"];
|
|
124
|
-
readonly ownerSteps: readonly ["Choose an organization and region; approve any provider billing requirements."];
|
|
125
|
-
};
|
|
126
|
-
readonly clerk: {
|
|
127
|
-
readonly credential: "CLERK_PLATFORM_API_KEY";
|
|
128
|
-
readonly auth: {
|
|
129
|
-
readonly path: "/v1/platform/me";
|
|
130
|
-
readonly runtime: {
|
|
131
|
-
readonly credential: "CLERK_SECRET_KEY";
|
|
132
|
-
readonly path: "/v1/users/count";
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
readonly origin: "https://api.clerk.com";
|
|
136
|
-
readonly fields: {
|
|
137
|
-
readonly workspaceId: {
|
|
138
|
-
readonly kind: "identity";
|
|
139
|
-
};
|
|
140
|
-
readonly applicationId: {
|
|
141
|
-
readonly kind: "identity";
|
|
142
|
-
};
|
|
143
|
-
readonly name: {
|
|
144
|
-
readonly kind: "text";
|
|
145
|
-
};
|
|
146
|
-
readonly environment: {
|
|
147
|
-
readonly kind: "text";
|
|
148
|
-
readonly choices: readonly ["", "development", "production"];
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
readonly resources: readonly ["application", "environment keys"];
|
|
152
|
-
readonly ownerSteps: readonly ["Obtain Platform API access; configure production domains, DNS, and OAuth credentials."];
|
|
153
|
-
};
|
|
154
|
-
readonly resend: {
|
|
155
|
-
readonly credential: "RESEND_API_KEY";
|
|
156
|
-
readonly auth: {
|
|
157
|
-
readonly path: "/domains";
|
|
158
|
-
};
|
|
159
|
-
readonly origin: "https://api.resend.com";
|
|
160
|
-
readonly fields: {
|
|
161
|
-
readonly domainId: {
|
|
162
|
-
readonly kind: "identity";
|
|
163
|
-
};
|
|
164
|
-
readonly domain: {
|
|
165
|
-
readonly kind: "text";
|
|
166
|
-
};
|
|
167
|
-
readonly region: {
|
|
168
|
-
readonly kind: "text";
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
readonly resources: readonly ["domain", "sending key"];
|
|
172
|
-
readonly ownerSteps: readonly ["Publish domain verification DNS records and wait for verification."];
|
|
173
|
-
};
|
|
174
50
|
readonly stripe: {
|
|
175
51
|
readonly credential: "STRIPE_SECRET_KEY";
|
|
176
52
|
readonly auth: {
|
|
@@ -230,85 +106,6 @@ export declare const PROVIDER_DEFINITIONS: {
|
|
|
230
106
|
readonly resources: readonly ["project", "application", "SDK keys"];
|
|
231
107
|
readonly ownerSteps: readonly ["Configure store credentials or Stripe, products, offerings, and entitlements; verify purchases."];
|
|
232
108
|
};
|
|
233
|
-
readonly sentry: {
|
|
234
|
-
readonly credential: "SENTRY_AUTH_TOKEN";
|
|
235
|
-
readonly auth: {
|
|
236
|
-
readonly path: "/api/0/organizations/";
|
|
237
|
-
};
|
|
238
|
-
readonly origin: "https://sentry.io";
|
|
239
|
-
readonly fields: {
|
|
240
|
-
readonly organization: {
|
|
241
|
-
readonly kind: "identity";
|
|
242
|
-
};
|
|
243
|
-
readonly team: {
|
|
244
|
-
readonly kind: "identity";
|
|
245
|
-
};
|
|
246
|
-
readonly project: {
|
|
247
|
-
readonly kind: "identity";
|
|
248
|
-
};
|
|
249
|
-
readonly name: {
|
|
250
|
-
readonly kind: "text";
|
|
251
|
-
};
|
|
252
|
-
readonly platform: {
|
|
253
|
-
readonly kind: "text";
|
|
254
|
-
};
|
|
255
|
-
};
|
|
256
|
-
readonly resources: readonly ["project", "DSN"];
|
|
257
|
-
readonly ownerSteps: readonly ["Choose organization and team access; configure source maps and application instrumentation."];
|
|
258
|
-
};
|
|
259
|
-
readonly posthog: {
|
|
260
|
-
readonly credential: "POSTHOG_PERSONAL_API_KEY";
|
|
261
|
-
readonly auth: {
|
|
262
|
-
readonly path: "/api/organizations/";
|
|
263
|
-
};
|
|
264
|
-
readonly origin: "https://us.posthog.com";
|
|
265
|
-
readonly regionalOrigins: {
|
|
266
|
-
readonly us: "https://us.posthog.com";
|
|
267
|
-
readonly eu: "https://eu.posthog.com";
|
|
268
|
-
};
|
|
269
|
-
readonly fields: {
|
|
270
|
-
readonly organizationId: {
|
|
271
|
-
readonly kind: "identity";
|
|
272
|
-
};
|
|
273
|
-
readonly projectId: {
|
|
274
|
-
readonly kind: "identity";
|
|
275
|
-
};
|
|
276
|
-
readonly name: {
|
|
277
|
-
readonly kind: "text";
|
|
278
|
-
};
|
|
279
|
-
readonly region: {
|
|
280
|
-
readonly kind: "text";
|
|
281
|
-
readonly choices: readonly ["", "us", "eu"];
|
|
282
|
-
};
|
|
283
|
-
};
|
|
284
|
-
readonly resources: readonly ["project", "ingestion configuration"];
|
|
285
|
-
readonly ownerSteps: readonly ["Choose organization and region; define analytics events and consent behavior."];
|
|
286
|
-
};
|
|
287
|
-
readonly openai: {
|
|
288
|
-
readonly credential: "OPENAI_ADMIN_KEY";
|
|
289
|
-
readonly auth: {
|
|
290
|
-
readonly path: "/v1/organization/projects";
|
|
291
|
-
readonly products: readonly ["openai", "ai-sdk"];
|
|
292
|
-
readonly runtime: {
|
|
293
|
-
readonly credential: "OPENAI_API_KEY";
|
|
294
|
-
readonly path: "/v1/models";
|
|
295
|
-
};
|
|
296
|
-
};
|
|
297
|
-
readonly origin: "https://api.openai.com";
|
|
298
|
-
readonly fields: {
|
|
299
|
-
readonly projectId: {
|
|
300
|
-
readonly kind: "identity";
|
|
301
|
-
};
|
|
302
|
-
readonly name: {
|
|
303
|
-
readonly kind: "text";
|
|
304
|
-
};
|
|
305
|
-
readonly serviceAccountName: {
|
|
306
|
-
readonly kind: "text";
|
|
307
|
-
};
|
|
308
|
-
};
|
|
309
|
-
readonly resources: readonly ["project", "service account", "runtime key"];
|
|
310
|
-
readonly ownerSteps: readonly ["Obtain organization administration access; configure billing and application usage limits."];
|
|
311
|
-
};
|
|
312
109
|
};
|
|
313
110
|
export declare const INTEGRATION_PROVIDERS: IntegrationProvider[];
|
|
314
111
|
export declare const PROVIDER_TEXT_PATTERN = "^(?:[a-zA-Z0-9][a-zA-Z0-9_. -]*)?$";
|
|
@@ -1,47 +1,6 @@
|
|
|
1
1
|
const text = { kind: 'text' };
|
|
2
2
|
const identity = { kind: 'identity' };
|
|
3
3
|
export const PROVIDER_DEFINITIONS = {
|
|
4
|
-
neon: {
|
|
5
|
-
credential: 'NEON_API_KEY',
|
|
6
|
-
auth: { path: '/api/v2/projects' },
|
|
7
|
-
origin: 'https://console.neon.tech',
|
|
8
|
-
fields: {
|
|
9
|
-
projectId: identity,
|
|
10
|
-
name: text,
|
|
11
|
-
organizationId: identity,
|
|
12
|
-
region: text,
|
|
13
|
-
database: text,
|
|
14
|
-
role: text,
|
|
15
|
-
},
|
|
16
|
-
resources: ['project', 'database connection'],
|
|
17
|
-
ownerSteps: ['Choose an organization and region; approve any provider billing requirements.'],
|
|
18
|
-
},
|
|
19
|
-
clerk: {
|
|
20
|
-
credential: 'CLERK_PLATFORM_API_KEY',
|
|
21
|
-
auth: {
|
|
22
|
-
path: '/v1/platform/me',
|
|
23
|
-
runtime: { credential: 'CLERK_SECRET_KEY', path: '/v1/users/count' },
|
|
24
|
-
},
|
|
25
|
-
origin: 'https://api.clerk.com',
|
|
26
|
-
fields: {
|
|
27
|
-
workspaceId: identity,
|
|
28
|
-
applicationId: identity,
|
|
29
|
-
name: text,
|
|
30
|
-
environment: { kind: 'text', choices: ['', 'development', 'production'] },
|
|
31
|
-
},
|
|
32
|
-
resources: ['application', 'environment keys'],
|
|
33
|
-
ownerSteps: [
|
|
34
|
-
'Obtain Platform API access; configure production domains, DNS, and OAuth credentials.',
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
resend: {
|
|
38
|
-
credential: 'RESEND_API_KEY',
|
|
39
|
-
auth: { path: '/domains' },
|
|
40
|
-
origin: 'https://api.resend.com',
|
|
41
|
-
fields: { domainId: identity, domain: text, region: text },
|
|
42
|
-
resources: ['domain', 'sending key'],
|
|
43
|
-
ownerSteps: ['Publish domain verification DNS records and wait for verification.'],
|
|
44
|
-
},
|
|
45
4
|
stripe: {
|
|
46
5
|
credential: 'STRIPE_SECRET_KEY',
|
|
47
6
|
auth: { path: '/v1/account' },
|
|
@@ -74,50 +33,6 @@ export const PROVIDER_DEFINITIONS = {
|
|
|
74
33
|
'Configure store credentials or Stripe, products, offerings, and entitlements; verify purchases.',
|
|
75
34
|
],
|
|
76
35
|
},
|
|
77
|
-
sentry: {
|
|
78
|
-
credential: 'SENTRY_AUTH_TOKEN',
|
|
79
|
-
auth: { path: '/api/0/organizations/' },
|
|
80
|
-
origin: 'https://sentry.io',
|
|
81
|
-
fields: {
|
|
82
|
-
organization: identity,
|
|
83
|
-
team: identity,
|
|
84
|
-
project: identity,
|
|
85
|
-
name: text,
|
|
86
|
-
platform: text,
|
|
87
|
-
},
|
|
88
|
-
resources: ['project', 'DSN'],
|
|
89
|
-
ownerSteps: [
|
|
90
|
-
'Choose organization and team access; configure source maps and application instrumentation.',
|
|
91
|
-
],
|
|
92
|
-
},
|
|
93
|
-
posthog: {
|
|
94
|
-
credential: 'POSTHOG_PERSONAL_API_KEY',
|
|
95
|
-
auth: { path: '/api/organizations/' },
|
|
96
|
-
origin: 'https://us.posthog.com',
|
|
97
|
-
regionalOrigins: { us: 'https://us.posthog.com', eu: 'https://eu.posthog.com' },
|
|
98
|
-
fields: {
|
|
99
|
-
organizationId: identity,
|
|
100
|
-
projectId: identity,
|
|
101
|
-
name: text,
|
|
102
|
-
region: { kind: 'text', choices: ['', 'us', 'eu'] },
|
|
103
|
-
},
|
|
104
|
-
resources: ['project', 'ingestion configuration'],
|
|
105
|
-
ownerSteps: ['Choose organization and region; define analytics events and consent behavior.'],
|
|
106
|
-
},
|
|
107
|
-
openai: {
|
|
108
|
-
credential: 'OPENAI_ADMIN_KEY',
|
|
109
|
-
auth: {
|
|
110
|
-
path: '/v1/organization/projects',
|
|
111
|
-
products: ['openai', 'ai-sdk'],
|
|
112
|
-
runtime: { credential: 'OPENAI_API_KEY', path: '/v1/models' },
|
|
113
|
-
},
|
|
114
|
-
origin: 'https://api.openai.com',
|
|
115
|
-
fields: { projectId: identity, name: text, serviceAccountName: text },
|
|
116
|
-
resources: ['project', 'service account', 'runtime key'],
|
|
117
|
-
ownerSteps: [
|
|
118
|
-
'Obtain organization administration access; configure billing and application usage limits.',
|
|
119
|
-
],
|
|
120
|
-
},
|
|
121
36
|
};
|
|
122
37
|
export const INTEGRATION_PROVIDERS = Object.keys(PROVIDER_DEFINITIONS);
|
|
123
38
|
export const PROVIDER_TEXT_PATTERN = '^(?:[a-zA-Z0-9][a-zA-Z0-9_. -]*)?$';
|
|
@@ -3,7 +3,7 @@ export declare function planProviderProvisioning(root: string): {
|
|
|
3
3
|
schemaVersion: number;
|
|
4
4
|
providers: {
|
|
5
5
|
provider: keyof import("./definitions.js").ProviderSettingsById;
|
|
6
|
-
settings: import("./definitions.js").
|
|
6
|
+
settings: import("./definitions.js").StripeSettings | import("./definitions.js").RevenueCatSettings;
|
|
7
7
|
credential: string;
|
|
8
8
|
missing: string[];
|
|
9
9
|
}[];
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { object, resourceId, text } from './api.js';
|
|
2
2
|
const allowedCredentials = {
|
|
3
|
-
resend: 'token',
|
|
4
3
|
stripe: 'secret',
|
|
5
|
-
openai: 'api_key',
|
|
6
4
|
};
|
|
7
5
|
function identity(value) {
|
|
8
6
|
resourceId(value);
|
|
@@ -15,10 +13,6 @@ export function splitReceipt(id, value) {
|
|
|
15
13
|
const receipt = {};
|
|
16
14
|
if (Object.hasOwn(response, 'id'))
|
|
17
15
|
receipt.id = identity(response.id);
|
|
18
|
-
if (id === 'neon' && Object.hasOwn(response, 'project'))
|
|
19
|
-
receipt.project = { id: identity(object(response.project).id) };
|
|
20
|
-
if (id === 'clerk' && Object.hasOwn(response, 'application_id'))
|
|
21
|
-
receipt.application_id = identity(response.application_id);
|
|
22
16
|
if (!Object.keys(receipt).length)
|
|
23
17
|
throw new Error('Provider returned no creation identity.');
|
|
24
18
|
const credentials = {};
|
|
@@ -30,11 +24,7 @@ export function splitReceipt(id, value) {
|
|
|
30
24
|
export function validReceipt(id, value) {
|
|
31
25
|
try {
|
|
32
26
|
const response = object(value);
|
|
33
|
-
const allowed = [
|
|
34
|
-
'id',
|
|
35
|
-
...(id === 'neon' ? ['project'] : []),
|
|
36
|
-
...(id === 'clerk' ? ['application_id'] : []),
|
|
37
|
-
];
|
|
27
|
+
const allowed = ['id'];
|
|
38
28
|
if (Object.keys(response).some((key) => !allowed.includes(key)))
|
|
39
29
|
return false;
|
|
40
30
|
if (response.project && Object.keys(object(response.project)).some((key) => key !== 'id'))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { object,
|
|
1
|
+
import { object, resourceId } from './api.js';
|
|
2
2
|
import { setting } from './config.js';
|
|
3
3
|
function same(actual, expected, label) {
|
|
4
4
|
if (!expected || actual !== expected)
|
|
@@ -14,66 +14,6 @@ export async function verifyRecoveredResource(provider, descriptor, requested, s
|
|
|
14
14
|
const id = resourceId(requested);
|
|
15
15
|
if (['sending-key', 'webhook', 'service-account'].includes(descriptor.key))
|
|
16
16
|
throw new Error('This operation creates a one-time credential. Restore its securely retained credential and verify it with the provider; resource-only recovery is unavailable.');
|
|
17
|
-
if (provider === 'neon') {
|
|
18
|
-
route(descriptor, 'project', '/api/v2/projects');
|
|
19
|
-
const project = object(object(await api(`/api/v2/projects/${id}`)).project);
|
|
20
|
-
same(resourceId(project.id), id, 'Neon identity');
|
|
21
|
-
same(project.org_id, setting(settings, 'organizationId'), 'Neon organization');
|
|
22
|
-
same(project.name, setting(settings, 'name'), 'Neon project name');
|
|
23
|
-
same(project.region_id, setting(settings, 'region'), 'Neon region');
|
|
24
|
-
return { project: { id } };
|
|
25
|
-
}
|
|
26
|
-
if (provider === 'clerk') {
|
|
27
|
-
route(descriptor, 'application', '/v1/platform/applications');
|
|
28
|
-
same(object(await api('/v1/platform/me')).subject, setting(settings, 'workspaceId'), 'Clerk workspace');
|
|
29
|
-
const application = object(await api(`/v1/platform/applications/${id}`));
|
|
30
|
-
same(application.application_id, id, 'Clerk application identity');
|
|
31
|
-
same(application.name, setting(settings, 'name'), 'Clerk application name');
|
|
32
|
-
const instances = list(application.instances).filter((entry) => entry.environment_type === settings.environment);
|
|
33
|
-
if (instances.length !== 1)
|
|
34
|
-
throw new Error('Recovered Clerk application does not have exactly one selected environment.');
|
|
35
|
-
return { application_id: id };
|
|
36
|
-
}
|
|
37
|
-
if (provider === 'resend') {
|
|
38
|
-
route(descriptor, 'domain', '/domains');
|
|
39
|
-
const domain = object(await api(`/domains/${id}`));
|
|
40
|
-
same(domain.id, id, 'Resend domain identity');
|
|
41
|
-
same(domain.name, setting(settings, 'domain'), 'Resend domain name');
|
|
42
|
-
if (setting(settings, 'region'))
|
|
43
|
-
same(domain.region, setting(settings, 'region'), 'Resend region');
|
|
44
|
-
return { id };
|
|
45
|
-
}
|
|
46
|
-
if (provider === 'posthog') {
|
|
47
|
-
const organization = resourceId(setting(settings, 'organizationId'));
|
|
48
|
-
route(descriptor, 'project', `/api/organizations/${organization}/projects/`);
|
|
49
|
-
const project = object(await api(`/api/organizations/${organization}/projects/${id}/`));
|
|
50
|
-
same(resourceId(project.id), id, 'PostHog project identity');
|
|
51
|
-
same(project.organization, organization, 'PostHog organization');
|
|
52
|
-
same(project.name, setting(settings, 'name'), 'PostHog project name');
|
|
53
|
-
return { id };
|
|
54
|
-
}
|
|
55
|
-
if (provider === 'openai') {
|
|
56
|
-
route(descriptor, 'project', '/v1/organization/projects');
|
|
57
|
-
const project = object(await api(`/v1/organization/projects/${id}`));
|
|
58
|
-
same(project.id, id, 'OpenAI project identity');
|
|
59
|
-
same(project.name, setting(settings, 'name'), 'OpenAI project name');
|
|
60
|
-
same(project.status, 'active', 'OpenAI project status');
|
|
61
|
-
return { id };
|
|
62
|
-
}
|
|
63
|
-
if (provider === 'sentry') {
|
|
64
|
-
const organization = resourceId(setting(settings, 'organization'));
|
|
65
|
-
const team = resourceId(setting(settings, 'team'));
|
|
66
|
-
const slug = resourceId(setting(settings, 'project'));
|
|
67
|
-
route(descriptor, 'project', `/api/0/teams/${organization}/${team}/projects/`);
|
|
68
|
-
const project = object(await api(`/api/0/projects/${organization}/${slug}/`));
|
|
69
|
-
same(resourceId(project.id), id, 'Sentry project identity');
|
|
70
|
-
same(object(project.organization).slug, organization, 'Sentry organization');
|
|
71
|
-
same(project.slug, slug, 'Sentry project slug');
|
|
72
|
-
same(project.platform, setting(settings, 'platform'), 'Sentry platform');
|
|
73
|
-
if (!list(project.teams).some((entry) => entry.slug === team))
|
|
74
|
-
throw new Error('Recovered Sentry project does not belong to the selected team.');
|
|
75
|
-
return { id };
|
|
76
|
-
}
|
|
77
17
|
if (provider === 'revenuecat') {
|
|
78
18
|
if (descriptor.key === 'project') {
|
|
79
19
|
route(descriptor, 'project', '/v2/projects');
|
|
@@ -8,21 +8,13 @@ import { digest } from './api.js';
|
|
|
8
8
|
import { validateSetupPlan } from '../readiness.js';
|
|
9
9
|
import { isIP } from 'node:net';
|
|
10
10
|
import { providerConfiguration } from './config.js';
|
|
11
|
-
function serverRuntimeFile(
|
|
11
|
+
function serverRuntimeFile(_root, runtime, _hosting) {
|
|
12
12
|
const directory = `apps/${runtime}`;
|
|
13
|
-
|
|
14
|
-
return `${directory}/.env.local`;
|
|
15
|
-
return `${directory}/${existsSync(path.join(root, directory, 'void.config.ts')) ? '.env' : '.dev.vars'}`;
|
|
13
|
+
return `${directory}/.dev.vars`;
|
|
16
14
|
}
|
|
17
15
|
export const RUNTIME_KEYS = [
|
|
18
16
|
'BETTER_AUTH_SECRET',
|
|
19
17
|
'BETTER_AUTH_URL',
|
|
20
|
-
'NEON_REALTIME_SECRET',
|
|
21
|
-
'DATABASE_URL',
|
|
22
|
-
'CLERK_SECRET_KEY',
|
|
23
|
-
'CLERK_PUBLISHABLE_KEY',
|
|
24
|
-
'NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY',
|
|
25
|
-
'RESEND_API_KEY',
|
|
26
18
|
'STRIPE_SECRET_KEY',
|
|
27
19
|
'STRIPE_WEBHOOK_SECRET',
|
|
28
20
|
'BILLING_ORIGIN',
|
|
@@ -35,10 +27,6 @@ export const RUNTIME_KEYS = [
|
|
|
35
27
|
'REVENUECAT_WEBHOOK_SIGNING_SECRET',
|
|
36
28
|
'REVENUECAT_APP_IDS_JSON',
|
|
37
29
|
'REVENUECAT_PROJECT_ID',
|
|
38
|
-
'SENTRY_DSN',
|
|
39
|
-
'POSTHOG_API_KEY',
|
|
40
|
-
'POSTHOG_HOST',
|
|
41
|
-
'OPENAI_API_KEY',
|
|
42
30
|
'EXPO_PUBLIC_API_URL',
|
|
43
31
|
'EXPO_PUBLIC_REVENUECAT_IOS_API_KEY',
|
|
44
32
|
'EXPO_PUBLIC_REVENUECAT_ANDROID_API_KEY',
|
|
@@ -63,17 +51,8 @@ export function runtimeTargets(root, values) {
|
|
|
63
51
|
const server = Object.fromEntries(Object.entries(values).filter(([key]) => !key.startsWith('EXPO_PUBLIC_')));
|
|
64
52
|
if (existsSync(path.join(root, `apps/${runtime}`)))
|
|
65
53
|
targets[serverRuntimeFile(root, runtime, setup.hosting)] = server;
|
|
66
|
-
if (runtime === 'api' &&
|
|
67
|
-
existsSync(path.join(root, 'apps/web')) &&
|
|
68
|
-
values.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY)
|
|
69
|
-
targets[serverRuntimeFile(root, 'web', setup.hosting)] = {
|
|
70
|
-
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: values.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY,
|
|
71
|
-
...(values.CLERK_SECRET_KEY ? { CLERK_SECRET_KEY: values.CLERK_SECRET_KEY } : {}),
|
|
72
|
-
};
|
|
73
54
|
if (setup.products.includes('expo')) {
|
|
74
55
|
const mobile = Object.fromEntries(Object.entries(values).filter(([key]) => key.startsWith('EXPO_PUBLIC_')));
|
|
75
|
-
if (values.CLERK_PUBLISHABLE_KEY)
|
|
76
|
-
mobile.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY = values.CLERK_PUBLISHABLE_KEY;
|
|
77
56
|
if (Object.keys(mobile).length)
|
|
78
57
|
targets['apps/mobile/.env.local'] = mobile;
|
|
79
58
|
}
|
|
@@ -210,11 +189,7 @@ export async function applicationRuntime(root, run) {
|
|
|
210
189
|
const setup = readProjectSection(root, 'setup');
|
|
211
190
|
validateSetupPlan(setup);
|
|
212
191
|
const betterAuth = setup.products.includes('better-auth');
|
|
213
|
-
const
|
|
214
|
-
const keys = [
|
|
215
|
-
...(betterAuth ? ['BETTER_AUTH_SECRET', 'BETTER_AUTH_URL'] : []),
|
|
216
|
-
...(neonRealtime ? ['NEON_REALTIME_SECRET'] : []),
|
|
217
|
-
];
|
|
192
|
+
const keys = [...(betterAuth ? ['BETTER_AUTH_SECRET', 'BETTER_AUTH_URL'] : [])];
|
|
218
193
|
if (!keys.length)
|
|
219
194
|
return {};
|
|
220
195
|
const runtime = setup.products.includes('hono') ? 'api' : 'web';
|
|
@@ -240,7 +215,7 @@ export async function applicationRuntime(root, run) {
|
|
|
240
215
|
if (config.vars &&
|
|
241
216
|
typeof config.vars === 'object' &&
|
|
242
217
|
keys.some((key) => Object.hasOwn(config.vars, key)))
|
|
243
|
-
throw new Error(`Remove
|
|
218
|
+
throw new Error(`Remove Better Auth values from tracked Wrangler vars, review and commit that change, then configure the private runtime file before shipping.`);
|
|
244
219
|
}
|
|
245
220
|
const content = readBoundedFile(file, MAX_PROJECT_JSON_BYTES).toString('utf8');
|
|
246
221
|
const values = {};
|
|
@@ -255,11 +230,5 @@ export async function applicationRuntime(root, run) {
|
|
|
255
230
|
throw new Error('BETTER_AUTH_URL must be an HTTPS public origin without credentials, path, query or fragment.');
|
|
256
231
|
Object.assign(values, { BETTER_AUTH_SECRET: secret, BETTER_AUTH_URL: origin });
|
|
257
232
|
}
|
|
258
|
-
if (neonRealtime) {
|
|
259
|
-
const secret = applicationValue(content, 'NEON_REALTIME_SECRET');
|
|
260
|
-
if (/change.?me|replace.?me|placeholder|your.?secret|example|generate.?me/i.test(secret))
|
|
261
|
-
throw new Error('Configure the nonplaceholder NEON_REALTIME_SECRET from the intended Neon Realtime service.');
|
|
262
|
-
values.NEON_REALTIME_SECRET = secret;
|
|
263
|
-
}
|
|
264
233
|
return { [relative]: values };
|
|
265
234
|
}
|
package/dist/providers/state.js
CHANGED
|
@@ -257,13 +257,7 @@ export class ProvisioningState {
|
|
|
257
257
|
throw error;
|
|
258
258
|
}
|
|
259
259
|
const { receipt, credentials } = splitReceipt(id, value);
|
|
260
|
-
const expected = id === '
|
|
261
|
-
? 'token'
|
|
262
|
-
: id === 'stripe' && key === 'webhook'
|
|
263
|
-
? 'secret'
|
|
264
|
-
: id === 'openai' && key === 'service-account'
|
|
265
|
-
? 'api_key'
|
|
266
|
-
: undefined;
|
|
260
|
+
const expected = id === 'stripe' && key === 'webhook' ? 'secret' : undefined;
|
|
267
261
|
if (expected && !credentials[expected])
|
|
268
262
|
throw new Error('Provider omitted the one-time creation credential. Inspect the pending operation before retrying.');
|
|
269
263
|
this.retainCredentials(id, operation, credentials);
|
package/dist/provision.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type DeliveryRunner } from './project-state.js';
|
|
2
2
|
import { type CloudflareRequest } from './cloudflare.js';
|
|
3
3
|
interface Resource {
|
|
4
|
-
kind: 'd1' | 'r2'
|
|
4
|
+
kind: 'd1' | 'r2';
|
|
5
5
|
name: string;
|
|
6
6
|
id?: string;
|
|
7
7
|
target: string;
|
|
@@ -11,7 +11,7 @@ export declare function planProvisioning(root: string): {
|
|
|
11
11
|
projectId: string;
|
|
12
12
|
accountId: string | null;
|
|
13
13
|
resources: Resource[];
|
|
14
|
-
externalIntegrations:
|
|
14
|
+
externalIntegrations: never[];
|
|
15
15
|
};
|
|
16
16
|
export declare function provisionApplication(root: string, dryRun?: boolean, run?: DeliveryRunner, suppliedRequest?: CloudflareRequest): Promise<{
|
|
17
17
|
schemaVersion: number;
|
|
@@ -26,21 +26,13 @@ export declare function provisionApplication(root: string, dryRun?: boolean, run
|
|
|
26
26
|
createdByProject: boolean;
|
|
27
27
|
}[];
|
|
28
28
|
state: string;
|
|
29
|
-
externalIntegrations:
|
|
29
|
+
externalIntegrations: never[];
|
|
30
30
|
} | {
|
|
31
31
|
mutation: boolean;
|
|
32
32
|
projectId: string;
|
|
33
33
|
accountId: string | null;
|
|
34
34
|
resources: Resource[];
|
|
35
|
-
externalIntegrations:
|
|
36
|
-
} | {
|
|
37
|
-
mutation: boolean;
|
|
38
|
-
writer: "void";
|
|
39
|
-
deferredToDeployment: boolean;
|
|
40
|
-
projectId: string;
|
|
41
|
-
accountId: string | null;
|
|
42
|
-
resources: Resource[];
|
|
43
|
-
externalIntegrations: string[];
|
|
35
|
+
externalIntegrations: never[];
|
|
44
36
|
}>;
|
|
45
37
|
/** Reconcile committed identities against the customer account without creating resources or rewriting configuration. */
|
|
46
38
|
export declare function inspectApplicationResources(root: string, request: CloudflareRequest): Promise<{
|
|
@@ -50,6 +42,6 @@ export declare function inspectApplicationResources(root: string, request: Cloud
|
|
|
50
42
|
id: string;
|
|
51
43
|
target: string;
|
|
52
44
|
}[];
|
|
53
|
-
externalIntegrations:
|
|
45
|
+
externalIntegrations: never[];
|
|
54
46
|
}>;
|
|
55
47
|
export {};
|