@lukoweb/apitogo 0.1.51 → 0.1.54

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 (37) hide show
  1. package/dist/cli/cli.js +467 -197
  2. package/dist/declarations/config/apitogo-config-core.d.ts +35 -0
  3. package/dist/declarations/config/apitogo-config-loader.d.ts +2 -7
  4. package/dist/declarations/config/apitogo-config-loader.node.d.ts +4 -0
  5. package/dist/declarations/config/build-apitogo-config.d.ts +5 -4
  6. package/dist/declarations/config/loader.d.ts +2 -0
  7. package/dist/declarations/config/local-manifest.d.ts +22 -8
  8. package/dist/declarations/config/validators/ModulesSchema.d.ts +38 -0
  9. package/dist/declarations/config/validators/ZudokuConfig.d.ts +43 -2
  10. package/dist/declarations/index.d.ts +1 -1
  11. package/dist/declarations/lib/authentication/providers/dev-portal-auth-pages.d.ts +15 -0
  12. package/dist/declarations/lib/authentication/providers/dev-portal-constants.d.ts +19 -1
  13. package/dist/declarations/lib/authentication/providers/dev-portal-utils.d.ts +5 -1
  14. package/dist/declarations/lib/authentication/providers/dev-portal.d.ts +5 -0
  15. package/dist/declarations/lib/core/plugins.d.ts +1 -0
  16. package/dist/flat-config.d.ts +53 -24
  17. package/docs/configuration/authentication.md +11 -9
  18. package/docs/configuration/manifest.md +75 -74
  19. package/package.json +1 -1
  20. package/src/config/apitogo-config-core.ts +601 -0
  21. package/src/config/apitogo-config-loader.node.ts +88 -0
  22. package/src/config/apitogo-config-loader.ts +6 -224
  23. package/src/config/build-apitogo-config.ts +26 -17
  24. package/src/config/loader.ts +23 -2
  25. package/src/config/local-manifest.ts +58 -59
  26. package/src/config/resolve-modules.ts +16 -13
  27. package/src/config/validators/ModulesSchema.ts +17 -0
  28. package/src/config/validators/ZudokuConfig.ts +25 -1
  29. package/src/index.ts +3 -2
  30. package/src/lib/authentication/providers/dev-portal-auth-pages.tsx +439 -0
  31. package/src/lib/authentication/providers/dev-portal-constants.ts +15 -1
  32. package/src/lib/authentication/providers/dev-portal-utils.ts +124 -4
  33. package/src/lib/authentication/providers/dev-portal.tsx +41 -6
  34. package/src/lib/core/plugins.ts +1 -0
  35. package/src/vite/dev-portal-env.ts +12 -4
  36. package/src/vite/plugin-config.ts +20 -3
  37. package/src/vite/plugin-local-manifest.ts +15 -0
@@ -0,0 +1,35 @@
1
+ export declare const APITOGO_CONFIG_FILENAME = "apitogo.config.json";
2
+ export type ApitogoJsonConfig = Record<string, unknown>;
3
+ export type AuthProviderPublicConfig = {
4
+ id: string;
5
+ displayName?: string;
6
+ authority?: string;
7
+ clientId?: string;
8
+ scopes?: string;
9
+ };
10
+ export type AuthenticationSecrets = {
11
+ email?: {
12
+ connectionString?: string;
13
+ };
14
+ providers?: Record<string, {
15
+ clientSecret?: string;
16
+ }>;
17
+ stripe?: {
18
+ secretKey?: string;
19
+ webhookSecret?: string;
20
+ };
21
+ };
22
+ export declare function applyEnvOverrides(config: ApitogoJsonConfig, env?: NodeJS.ProcessEnv): ApitogoJsonConfig;
23
+ type PlanCatalogItem = Record<string, unknown> & {
24
+ sku?: string;
25
+ };
26
+ export declare function readPlanCatalogItems(config: ApitogoJsonConfig): PlanCatalogItem[];
27
+ export declare function normalizeApitogoConfig(config: ApitogoJsonConfig): ApitogoJsonConfig;
28
+ export declare function isBillingEnabled(config: ApitogoJsonConfig): boolean;
29
+ export declare function readAuthProviders(config: ApitogoJsonConfig): AuthProviderPublicConfig[];
30
+ export declare function isNativeAuthEnabled(config: ApitogoJsonConfig): boolean;
31
+ export declare function deriveManifestFields(config: ApitogoJsonConfig): ApitogoJsonConfig;
32
+ export declare function extractManifest(config: ApitogoJsonConfig | null | undefined): ApitogoJsonConfig | null;
33
+ export declare function extractSiteConfig(config: ApitogoJsonConfig | null | undefined): ApitogoJsonConfig;
34
+ export declare function resolveProjectDisplayName(config: ApitogoJsonConfig): string;
35
+ export {};
@@ -1,7 +1,2 @@
1
- export declare const APITOGO_CONFIG_FILENAME = "apitogo.config.json";
2
- export type ApitogoJsonConfig = Record<string, unknown>;
3
- export declare function applyEnvOverrides(config: ApitogoJsonConfig, env?: NodeJS.ProcessEnv): ApitogoJsonConfig;
4
- export declare function loadApitogoConfig(rootDir?: string): ApitogoJsonConfig;
5
- export declare function extractManifest(config: ApitogoJsonConfig | null | undefined): ApitogoJsonConfig | null;
6
- export declare function extractSiteConfig(config: ApitogoJsonConfig | null | undefined): ApitogoJsonConfig;
7
- export declare function apitogoConfigPath(rootDir: string): string;
1
+ export * from "./apitogo-config-core.js";
2
+ export { apitogoConfigPath, loadApitogoConfig, readAuthenticationSecrets, } from "./apitogo-config-loader.node.js";
@@ -0,0 +1,4 @@
1
+ import { type ApitogoJsonConfig, type AuthenticationSecrets } from "./apitogo-config-core.js";
2
+ export declare function loadApitogoConfig(rootDir?: string): ApitogoJsonConfig;
3
+ export declare function readAuthenticationSecrets(env?: NodeJS.ProcessEnv): AuthenticationSecrets;
4
+ export declare function apitogoConfigPath(rootDir: string): string;
@@ -1,7 +1,8 @@
1
+ import type { ApitogoPlugin } from "../lib/core/plugins.js";
2
+ import { type ApitogoJsonConfig } from "./apitogo-config-core.js";
1
3
  import type { ApitogoConfig } from "./config.js";
2
- type BuildApitogoConfigOptions = {
3
- rootDir?: string;
4
- overrides?: Partial<ApitogoConfig>;
4
+ type BuildApitogoConfigOptions = Partial<ApitogoConfig> & ApitogoJsonConfig & {
5
+ plugins?: ApitogoPlugin[];
5
6
  };
6
- export declare function buildApitogoConfig({ rootDir, overrides, }?: BuildApitogoConfigOptions): ApitogoConfig;
7
+ export declare function buildApitogoConfig({ plugins, plans: _legacyPlans, ...jsonOverrides }?: BuildApitogoConfigOptions): ApitogoConfig;
7
8
  export {};
@@ -1,5 +1,6 @@
1
1
  import type { RollupOutput, RollupWatcher } from "rollup";
2
2
  import { type ConfigEnv } from "vite";
3
+ import { type DevPortalPreviewPlan } from "./local-manifest.js";
3
4
  import type { ResolvedModulesConfig } from "./validators/ModulesSchema.js";
4
5
  import type { ZudokuConfig } from "./validators/ZudokuConfig.js";
5
6
  export type ConfigWithMeta = ZudokuConfig & {
@@ -11,6 +12,7 @@ export type ConfigWithMeta = ZudokuConfig & {
11
12
  dependencies: string[];
12
13
  pricingEnabled?: boolean;
13
14
  authenticationEnabled?: boolean;
15
+ previewPlans?: DevPortalPreviewPlan[];
14
16
  };
15
17
  __resolvedModules: ResolvedModulesConfig;
16
18
  };
@@ -1,6 +1,5 @@
1
1
  import { z } from "zod";
2
2
  import { APITOGO_CONFIG_FILENAME } from "./apitogo-config-loader.js";
3
- export declare const DEV_PORTAL_MANIFEST_FILENAME = "apitogo.local.json";
4
3
  export declare const APITOGO_MANIFEST_BASE_FILENAME = "apitogo.json";
5
4
  export declare const APITOGO_MANIFEST_ENV_FILES: {
6
5
  readonly development: "apitogo.local.json";
@@ -11,8 +10,7 @@ export type ApitogoManifestEnv = keyof typeof APITOGO_MANIFEST_ENV_FILES;
11
10
  export declare const ManifestPlanInputSchema: z.ZodObject<{
12
11
  sku: z.ZodString;
13
12
  displayName: z.ZodString;
14
- isFree: z.ZodBoolean;
15
- priceAmount: z.ZodOptional<z.ZodNumber>;
13
+ priceAmount: z.ZodDefault<z.ZodNumber>;
16
14
  priceCurrency: z.ZodOptional<z.ZodString>;
17
15
  billingPeriod: z.ZodOptional<z.ZodEnum<{
18
16
  month: "month";
@@ -23,6 +21,9 @@ export declare const ManifestPlanInputSchema: z.ZodObject<{
23
21
  limitsJson: z.ZodOptional<z.ZodString>;
24
22
  includedActionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
25
23
  }, z.core.$strip>;
24
+ export declare function isPlanFree(plan: {
25
+ priceAmount?: number;
26
+ }): boolean;
26
27
  export declare const DevPortalLocalManifestSchema: z.ZodObject<{
27
28
  siteName: z.ZodOptional<z.ZodString>;
28
29
  branding: z.ZodOptional<z.ZodObject<{
@@ -34,12 +35,26 @@ export declare const DevPortalLocalManifestSchema: z.ZodObject<{
34
35
  }, z.core.$strip>>;
35
36
  authentication: z.ZodOptional<z.ZodObject<{
36
37
  enabled: z.ZodOptional<z.ZodBoolean>;
38
+ apiBaseUrl: z.ZodOptional<z.ZodString>;
39
+ native: z.ZodOptional<z.ZodObject<{
40
+ enabled: z.ZodOptional<z.ZodBoolean>;
41
+ }, z.core.$strip>>;
42
+ email: z.ZodOptional<z.ZodObject<{
43
+ provider: z.ZodOptional<z.ZodString>;
44
+ from: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>>;
46
+ providers: z.ZodOptional<z.ZodArray<z.ZodObject<{
47
+ id: z.ZodString;
48
+ displayName: z.ZodOptional<z.ZodString>;
49
+ authority: z.ZodOptional<z.ZodString>;
50
+ clientId: z.ZodOptional<z.ZodString>;
51
+ scopes: z.ZodOptional<z.ZodString>;
52
+ }, z.core.$strip>>>;
37
53
  }, z.core.$strip>>;
38
54
  plans: z.ZodOptional<z.ZodArray<z.ZodObject<{
39
55
  sku: z.ZodString;
40
56
  displayName: z.ZodString;
41
- isFree: z.ZodBoolean;
42
- priceAmount: z.ZodOptional<z.ZodNumber>;
57
+ priceAmount: z.ZodDefault<z.ZodNumber>;
43
58
  priceCurrency: z.ZodOptional<z.ZodString>;
44
59
  billingPeriod: z.ZodOptional<z.ZodEnum<{
45
60
  month: "month";
@@ -70,14 +85,12 @@ export declare const DevPortalLocalManifestSchema: z.ZodObject<{
70
85
  publicHealthActionKey: z.ZodOptional<z.ZodString>;
71
86
  }, z.core.$strip>>;
72
87
  projectId: z.ZodOptional<z.ZodString>;
73
- projectName: z.ZodOptional<z.ZodString>;
74
88
  }, z.core.$strip>;
75
89
  export type ManifestPlanInput = z.infer<typeof ManifestPlanInputSchema>;
76
90
  export type DevPortalLocalManifest = z.infer<typeof DevPortalLocalManifestSchema>;
77
91
  export type DevPortalPreviewPlan = {
78
92
  sku: string;
79
93
  displayName: string;
80
- isFree: boolean;
81
94
  priceAmount: number;
82
95
  priceCurrency: string;
83
96
  billingPeriod: string;
@@ -91,6 +104,7 @@ export type DevPortalPreviewPlanCatalog = {
91
104
  };
92
105
  export declare function isPricingEnabled(manifest: DevPortalLocalManifest | null | undefined): boolean;
93
106
  export declare function isAuthenticationEnabled(manifest: DevPortalLocalManifest | null | undefined): boolean;
107
+ export declare function isNativeAuthEnabledInManifest(manifest: DevPortalLocalManifest | null | undefined): boolean;
94
108
  export declare function manifestToPreviewCatalog(manifest: DevPortalLocalManifest | null | undefined): DevPortalPreviewPlanCatalog;
95
109
  export declare function normalizeBillingPeriod(period?: string): string;
96
110
  export declare function plansToPreviewCatalog(plans: ManifestPlanInput[] | undefined): Pick<DevPortalPreviewPlanCatalog, "plans">;
@@ -105,5 +119,5 @@ export declare function manifestPathsForEnv(rootDir: string, _env: ApitogoManife
105
119
  };
106
120
  export declare function parseLocalManifestJson(raw: string): DevPortalLocalManifest | null;
107
121
  export declare function readManifestFile(rootDir: string, filename: string): Promise<DevPortalLocalManifest | null>;
108
- export declare function readEffectiveManifest(rootDir: string, env: ApitogoManifestEnv): Promise<DevPortalLocalManifest | null>;
122
+ export declare function readEffectiveManifest(rootDir: string, _env: ApitogoManifestEnv): Promise<DevPortalLocalManifest | null>;
109
123
  export declare function readLocalManifest(rootDir: string): Promise<DevPortalLocalManifest | null>;
@@ -134,6 +134,15 @@ export declare const ApiKeysModuleSchema: z.ZodObject<{
134
134
  enabled: z.ZodOptional<z.ZodBoolean>;
135
135
  path: z.ZodDefault<z.ZodString>;
136
136
  }, z.core.$strip>;
137
+ declare const PlanCatalogItemSchema: z.ZodObject<{
138
+ sku: z.ZodString;
139
+ displayName: z.ZodString;
140
+ priceAmount: z.ZodDefault<z.ZodNumber>;
141
+ priceCurrency: z.ZodOptional<z.ZodString>;
142
+ billingPeriod: z.ZodOptional<z.ZodString>;
143
+ limitsJson: z.ZodOptional<z.ZodString>;
144
+ includedActionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
145
+ }, z.core.$strip>;
137
146
  export declare const PlansModuleSchema: z.ZodObject<{
138
147
  enabled: z.ZodOptional<z.ZodBoolean>;
139
148
  path: z.ZodDefault<z.ZodString>;
@@ -148,6 +157,15 @@ export declare const PlansModuleSchema: z.ZodObject<{
148
157
  description: z.ZodOptional<z.ZodString>;
149
158
  }, z.core.$strip>>>;
150
159
  }, z.core.$strip>>;
160
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
161
+ sku: z.ZodString;
162
+ displayName: z.ZodString;
163
+ priceAmount: z.ZodDefault<z.ZodNumber>;
164
+ priceCurrency: z.ZodOptional<z.ZodString>;
165
+ billingPeriod: z.ZodOptional<z.ZodString>;
166
+ limitsJson: z.ZodOptional<z.ZodString>;
167
+ includedActionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
168
+ }, z.core.$strip>>>;
151
169
  }, z.core.$strip>;
152
170
  export declare const DashboardModuleSchema: z.ZodObject<{
153
171
  enabled: z.ZodOptional<z.ZodBoolean>;
@@ -215,6 +233,15 @@ export declare const UserPanelModuleSchema: z.ZodObject<{
215
233
  description: z.ZodOptional<z.ZodString>;
216
234
  }, z.core.$strip>>>;
217
235
  }, z.core.$strip>>;
236
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
237
+ sku: z.ZodString;
238
+ displayName: z.ZodString;
239
+ priceAmount: z.ZodDefault<z.ZodNumber>;
240
+ priceCurrency: z.ZodOptional<z.ZodString>;
241
+ billingPeriod: z.ZodOptional<z.ZodString>;
242
+ limitsJson: z.ZodOptional<z.ZodString>;
243
+ includedActionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
244
+ }, z.core.$strip>>>;
218
245
  }, z.core.$strip>>;
219
246
  }, z.core.$strip>;
220
247
  export declare const ModulesSchema: z.ZodOptional<z.ZodObject<{
@@ -320,6 +347,15 @@ export declare const ModulesSchema: z.ZodOptional<z.ZodObject<{
320
347
  description: z.ZodOptional<z.ZodString>;
321
348
  }, z.core.$strip>>>;
322
349
  }, z.core.$strip>>;
350
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
351
+ sku: z.ZodString;
352
+ displayName: z.ZodString;
353
+ priceAmount: z.ZodDefault<z.ZodNumber>;
354
+ priceCurrency: z.ZodOptional<z.ZodString>;
355
+ billingPeriod: z.ZodOptional<z.ZodString>;
356
+ limitsJson: z.ZodOptional<z.ZodString>;
357
+ includedActionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
358
+ }, z.core.$strip>>>;
323
359
  }, z.core.$strip>>;
324
360
  }, z.core.$strip>>;
325
361
  }, z.core.$strip>>;
@@ -396,6 +432,7 @@ export type ResolvedPlansModule = {
396
432
  enabled: boolean;
397
433
  path: string;
398
434
  content: ResolvedPlansContent;
435
+ items?: z.infer<typeof PlanCatalogItemSchema>[];
399
436
  };
400
437
  export type ResolvedDashboardModule = {
401
438
  enabled: boolean;
@@ -415,3 +452,4 @@ export type ResolvedModulesConfig = {
415
452
  landing: ResolvedLandingModule;
416
453
  userPanel: ResolvedUserPanelModule;
417
454
  };
455
+ export {};
@@ -367,8 +367,24 @@ declare const AuthenticationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
367
367
  redirectToAfterSignIn: z.ZodOptional<z.ZodString>;
368
368
  redirectToAfterSignOut: z.ZodOptional<z.ZodString>;
369
369
  }, z.core.$strip>, z.ZodObject<{
370
- type: z.ZodLiteral<"dev-portal">;
370
+ type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"dev-portal">>>;
371
371
  apiBaseUrl: z.ZodOptional<z.ZodString>;
372
+ native: z.ZodOptional<z.ZodObject<{
373
+ enabled: z.ZodOptional<z.ZodBoolean>;
374
+ }, z.core.$strip>>;
375
+ email: z.ZodOptional<z.ZodObject<{
376
+ provider: z.ZodOptional<z.ZodString>;
377
+ from: z.ZodOptional<z.ZodString>;
378
+ connectionString: z.ZodOptional<z.ZodString>;
379
+ }, z.core.$strip>>;
380
+ providers: z.ZodOptional<z.ZodArray<z.ZodObject<{
381
+ id: z.ZodString;
382
+ displayName: z.ZodOptional<z.ZodString>;
383
+ authority: z.ZodOptional<z.ZodString>;
384
+ clientId: z.ZodOptional<z.ZodString>;
385
+ clientSecret: z.ZodOptional<z.ZodString>;
386
+ scopes: z.ZodOptional<z.ZodString>;
387
+ }, z.core.$strip>>>;
372
388
  redirectToAfterSignUp: z.ZodOptional<z.ZodString>;
373
389
  redirectToAfterSignIn: z.ZodOptional<z.ZodString>;
374
390
  redirectToAfterSignOut: z.ZodOptional<z.ZodString>;
@@ -6771,8 +6787,24 @@ export declare const ZudokuConfig: z.ZodObject<{
6771
6787
  redirectToAfterSignIn: z.ZodOptional<z.ZodString>;
6772
6788
  redirectToAfterSignOut: z.ZodOptional<z.ZodString>;
6773
6789
  }, z.core.$strip>, z.ZodObject<{
6774
- type: z.ZodLiteral<"dev-portal">;
6790
+ type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"dev-portal">>>;
6775
6791
  apiBaseUrl: z.ZodOptional<z.ZodString>;
6792
+ native: z.ZodOptional<z.ZodObject<{
6793
+ enabled: z.ZodOptional<z.ZodBoolean>;
6794
+ }, z.core.$strip>>;
6795
+ email: z.ZodOptional<z.ZodObject<{
6796
+ provider: z.ZodOptional<z.ZodString>;
6797
+ from: z.ZodOptional<z.ZodString>;
6798
+ connectionString: z.ZodOptional<z.ZodString>;
6799
+ }, z.core.$strip>>;
6800
+ providers: z.ZodOptional<z.ZodArray<z.ZodObject<{
6801
+ id: z.ZodString;
6802
+ displayName: z.ZodOptional<z.ZodString>;
6803
+ authority: z.ZodOptional<z.ZodString>;
6804
+ clientId: z.ZodOptional<z.ZodString>;
6805
+ clientSecret: z.ZodOptional<z.ZodString>;
6806
+ scopes: z.ZodOptional<z.ZodString>;
6807
+ }, z.core.$strip>>>;
6776
6808
  redirectToAfterSignUp: z.ZodOptional<z.ZodString>;
6777
6809
  redirectToAfterSignIn: z.ZodOptional<z.ZodString>;
6778
6810
  redirectToAfterSignOut: z.ZodOptional<z.ZodString>;
@@ -6926,6 +6958,15 @@ export declare const ZudokuConfig: z.ZodObject<{
6926
6958
  description: z.ZodOptional<z.ZodString>;
6927
6959
  }, z.core.$strip>>>;
6928
6960
  }, z.core.$strip>>;
6961
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
6962
+ sku: z.ZodString;
6963
+ displayName: z.ZodString;
6964
+ priceAmount: z.ZodDefault<z.ZodNumber>;
6965
+ priceCurrency: z.ZodOptional<z.ZodString>;
6966
+ billingPeriod: z.ZodOptional<z.ZodString>;
6967
+ limitsJson: z.ZodOptional<z.ZodString>;
6968
+ includedActionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
6969
+ }, z.core.$strip>>>;
6929
6970
  }, z.core.$strip>>;
6930
6971
  }, z.core.$strip>>;
6931
6972
  }, z.core.$strip>>>;
@@ -18,4 +18,4 @@ export { cn } from "./lib/ui/util.js";
18
18
  export { joinUrl } from "./lib/util/joinUrl.js";
19
19
  export { type ProblemJson, throwIfProblemJson, } from "./lib/util/problemJson.js";
20
20
  export { buildApitogoConfig } from "./config/build-apitogo-config.js";
21
- export { APITOGO_CONFIG_FILENAME, applyEnvOverrides, extractManifest, extractSiteConfig, loadApitogoConfig, } from "./config/apitogo-config-loader.js";
21
+ export { APITOGO_CONFIG_FILENAME, applyEnvOverrides, extractManifest, extractSiteConfig, normalizeApitogoConfig, resolveProjectDisplayName, } from "./config/apitogo-config-core.js";
@@ -0,0 +1,15 @@
1
+ export declare function DevPortalLoginPage({ apiBaseUrl, }: {
2
+ apiBaseUrl?: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ export declare function DevPortalRegisterPage({ apiBaseUrl, }: {
5
+ apiBaseUrl?: string;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ export declare function DevPortalVerifyEmailPage({ apiBaseUrl }: {
8
+ apiBaseUrl?: string;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export declare function DevPortalForgotPasswordPage({ apiBaseUrl }: {
11
+ apiBaseUrl?: string;
12
+ }): import("react/jsx-runtime").JSX.Element;
13
+ export declare function DevPortalResetPasswordPage({ apiBaseUrl }: {
14
+ apiBaseUrl?: string;
15
+ }): import("react/jsx-runtime").JSX.Element;
@@ -14,5 +14,23 @@ export type EndUserMeResponse = {
14
14
  };
15
15
  export type DevPortalAuthStatusResponse = {
16
16
  available: boolean;
17
- oidcConfigured: boolean;
17
+ nativeEnabled?: boolean;
18
+ oidcConfigured?: boolean;
19
+ providerCount?: number;
20
+ };
21
+ export type DevPortalAuthConfigResponse = {
22
+ native: {
23
+ enabled: boolean;
24
+ };
25
+ email?: {
26
+ provider: string;
27
+ from: string;
28
+ } | null;
29
+ providers: Array<{
30
+ id: string;
31
+ displayName: string;
32
+ authority: string;
33
+ clientId: string;
34
+ scopes: string[];
35
+ }>;
18
36
  };
@@ -3,7 +3,11 @@ import { type EndUserMeResponse } from "./dev-portal-constants.js";
3
3
  export declare function resolveDevPortalApiBaseUrl(config: Pick<DevPortalAuthenticationConfig, "apiBaseUrl">): string | undefined;
4
4
  export declare function isPlaceholderDevPortalApiUrl(apiBaseUrl: string | undefined): boolean;
5
5
  export declare function toAbsoluteReturnUrl(pathOrUrl: string): string;
6
- export declare function buildDevPortalLoginUrl(apiBaseUrl: string, returnUrl: string): string;
6
+ export declare function buildDevPortalOidcChallengeUrl(apiBaseUrl: string, providerId: string, returnUrl: string): string;
7
7
  export declare function buildDevPortalLogoutUrl(apiBaseUrl: string, returnUrl: string): string;
8
+ export declare function normalizeDevPortalAuthConfig(raw: unknown): import("./dev-portal-constants.js").DevPortalAuthConfigResponse;
9
+ export declare function isNativeAuthEnabled(config: import("./dev-portal-constants.js").DevPortalAuthConfigResponse | null | undefined): boolean;
10
+ export declare function fetchDevPortalAuthConfig(apiBaseUrl: string, fetchImpl?: typeof fetch): Promise<import("./dev-portal-constants.js").DevPortalAuthConfigResponse>;
11
+ export declare function postDevPortalAuth<T>(apiBaseUrl: string, path: string, body: unknown, fetchImpl?: typeof fetch): Promise<T>;
8
12
  export declare function probeDevPortalBackend(apiBaseUrl: string, fetchImpl?: typeof fetch): Promise<boolean>;
9
13
  export declare function mapEndUserMeToProfile(me: EndUserMeResponse): import("../state.js").UserProfile;
@@ -21,7 +21,12 @@ export declare class DevPortalAuthenticationProvider extends CoreAuthenticationP
21
21
  private backendAvailable;
22
22
  private refreshGeneration;
23
23
  private refreshInFlight;
24
+ private authConfigNativeEnabled;
24
25
  constructor({ apiBaseUrl, redirectToAfterSignIn, redirectToAfterSignUp, redirectToAfterSignOut, }: DevPortalAuthenticationConfig);
26
+ getRoutes(): {
27
+ path: string;
28
+ element: import("react/jsx-runtime").JSX.Element;
29
+ }[];
25
30
  initialize(_context: ZudokuContext): Promise<void>;
26
31
  onPageLoad: () => Promise<void>;
27
32
  private syncBackendAvailability;
@@ -7,6 +7,7 @@ import type { ZudokuConfig } from "../../config/validators/ZudokuConfig.js";
7
7
  import type { AuthenticationPlugin } from "../authentication/authentication.js";
8
8
  import type { MdxComponentsType } from "../util/MdxComponents.js";
9
9
  import type { ApiIdentity, ApitogoEvents, ZudokuContext } from "./ZudokuContext.js";
10
+ export { createPlugin } from "../../config/create-plugin.js";
10
11
  export { runPluginTransformConfig } from "./transform-config.js";
11
12
  export type ApitogoPlugin = CommonPlugin | ProfileMenuPlugin | NavigationPlugin | ApiIdentityPlugin | SearchProviderPlugin | EventConsumerPlugin | AuthenticationPlugin | TransformConfigPlugin;
12
13
  export type { AuthenticationPlugin, RouteObject };
@@ -61,31 +61,43 @@ export type _Schema9 = (("Inter" | "Roboto" | "Open Sans" | "Poppins" | "Montser
61
61
  * Whether this module is active in the application.
62
62
  */
63
63
  export type _Schema15 = boolean
64
- export type _Schema35 = ({
64
+ /**
65
+ * Gateway plan catalog for /pricing preview and publish (canonical storage).
66
+ */
67
+ export type _Schema35 = {
68
+ sku: string
69
+ displayName: string
70
+ priceAmount?: number
71
+ priceCurrency?: string
72
+ billingPeriod?: string
73
+ limitsJson?: string
74
+ includedActionKeys?: string[]
75
+ }[]
76
+ export type _Schema36 = ({
65
77
  type: "url"
66
- input: (string | _Schema36[])
67
- server?: _Schema37
68
- path?: _Schema38
69
- categories?: _Schema39
70
- options?: _Schema41
78
+ input: (string | _Schema37[])
79
+ server?: _Schema38
80
+ path?: _Schema39
81
+ categories?: _Schema40
82
+ options?: _Schema42
71
83
  } | {
72
84
  type: "file"
73
- input: (string | (string | _Schema36)[])
74
- server?: _Schema37
75
- path?: _Schema38
76
- categories?: _Schema39
77
- options?: _Schema41
85
+ input: (string | (string | _Schema37)[])
86
+ server?: _Schema38
87
+ path?: _Schema39
88
+ categories?: _Schema40
89
+ options?: _Schema42
78
90
  } | {
79
91
  type: "raw"
80
92
  input: string
81
- server?: _Schema37
82
- path?: _Schema38
83
- categories?: _Schema39
84
- options?: _Schema41
93
+ server?: _Schema38
94
+ path?: _Schema39
95
+ categories?: _Schema40
96
+ options?: _Schema42
85
97
  })
86
- export type _Schema37 = string
87
98
  export type _Schema38 = string
88
- export type _Schema39 = {
99
+ export type _Schema39 = string
100
+ export type _Schema40 = {
89
101
  label: string
90
102
  tags: string[]
91
103
  }[]
@@ -307,8 +319,24 @@ export interface FlatZudokuConfig {
307
319
  redirectToAfterSignIn?: string
308
320
  redirectToAfterSignOut?: string
309
321
  } | {
310
- type: "dev-portal"
322
+ type?: "dev-portal"
311
323
  apiBaseUrl?: string
324
+ native?: {
325
+ enabled?: boolean
326
+ }
327
+ email?: {
328
+ provider?: string
329
+ from?: string
330
+ connectionString?: string
331
+ }
332
+ providers?: {
333
+ id: string
334
+ displayName?: string
335
+ authority?: string
336
+ clientId?: string
337
+ clientSecret?: string
338
+ scopes?: string
339
+ }[]
312
340
  redirectToAfterSignUp?: string
313
341
  redirectToAfterSignIn?: string
314
342
  redirectToAfterSignOut?: string
@@ -369,8 +397,8 @@ export interface FlatZudokuConfig {
369
397
  landing?: _Schema16
370
398
  userPanel?: _Schema23
371
399
  }
372
- apis?: (_Schema35 | _Schema35[])
373
- catalogs?: (_Schema42 | _Schema42[])
400
+ apis?: (_Schema36 | _Schema36[])
401
+ catalogs?: (_Schema43 | _Schema43[])
374
402
  apiKeys?: {
375
403
  enabled: boolean
376
404
  getConsumers?: unknown
@@ -398,7 +426,7 @@ export interface FlatZudokuConfig {
398
426
  }
399
427
  enableStatusPages?: boolean
400
428
  defaults?: {
401
- apis: _Schema41
429
+ apis: _Schema42
402
430
  examplesLanguage?: string
403
431
  }
404
432
  __pluginDirs?: string[]
@@ -589,6 +617,7 @@ export interface _Schema23 {
589
617
  [k: string]: unknown
590
618
  }
591
619
  content?: _Schema34
620
+ items?: _Schema35
592
621
  }
593
622
  }
594
623
  /**
@@ -619,12 +648,12 @@ export interface _Schema34 {
619
648
  description?: string
620
649
  }[]
621
650
  }
622
- export interface _Schema36 {
651
+ export interface _Schema37 {
623
652
  path: string
624
653
  input: string
625
654
  label?: string
626
655
  }
627
- export interface _Schema41 {
656
+ export interface _Schema42 {
628
657
  examplesLanguage?: string
629
658
  supportedLanguages?: {
630
659
  value: string
@@ -641,7 +670,7 @@ export interface _Schema41 {
641
670
  transformExamples?: unknown
642
671
  generateCodeSnippet?: unknown
643
672
  }
644
- export interface _Schema42 {
673
+ export interface _Schema43 {
645
674
  path: string
646
675
  label: string
647
676
  items?: string[]
@@ -41,22 +41,24 @@ only.
41
41
  Set the backend API URL via environment variable (MCP writes this at scaffold/publish):
42
42
 
43
43
  ```bash
44
- VITE_APITOGO_DEV_PORTAL_API_URL=https://your-dev-portal-api.example.com
44
+ VITE_APITOGO_AUTHENTICATION_API_BASE_URL=https://your-dev-portal-api.example.com
45
45
  ```
46
46
 
47
+ You can also set `authentication.apiBaseUrl` in `apitogo.config.json` or
48
+ `APITOGO_CONFIG_authentication__apiBaseUrl` in `.env`.
49
+
47
50
  **Local preview:** When the backend URL is a placeholder or unreachable, the account area shows a
48
51
  message that sign-in unlocks after publish. Docs and API reference remain public. Plans on
49
- `/pricing` load from `apitogo.config.json` (overridable via `.env` — see
50
- [Manifest](./manifest.md), including `includedActionKeys` per plan). Plan edits hot-reload without
51
- restarting the dev server.
52
+ `/pricing` load from `apitogo.config.json` (overridable via `.env` — see [Manifest](./manifest.md),
53
+ including `includedActionKeys` per plan). Plan edits hot-reload without restarting the dev server.
52
54
 
53
55
  ### Dev portal configuration files
54
56
 
55
- | Concern | File |
56
- | ----------------------------------------------------------------- | ---------------------------------------------------------------- |
57
- | Site, plans, modules, branding, backend/gateway metadata | `apitogo.config.json` (+ `.env` overrides — see [Manifest](./manifest.md)) |
58
- | Plugins and custom code | `apitogo.config.tsx` |
59
- | OIDC and Stripe for publish | `.env.local` via `APITOGO_CONFIG_*` (or legacy `apitogo.local.secrets.json`) |
57
+ | Concern | File |
58
+ | -------------------------------------------------------- | -------------------------------------------------------------------------- |
59
+ | Site, plans, modules, branding, backend/gateway metadata | `apitogo.config.json` (+ `.env` overrides — see [Manifest](./manifest.md)) |
60
+ | Plugins and custom code | `apitogo.config.tsx` |
61
+ | OIDC and Stripe for publish | `.env.local` via `APITOGO_CONFIG_authentication__*` |
60
62
 
61
63
  **Production:** Register one OIDC app with redirect URI `https://{backend}/signin-oidc` (see MCP
62
64
  `manualSteps.oidcRedirectUri`). The frontend uses cookie sessions via `credentials: "include"` on