@barekey/cli 0.4.0 → 0.5.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 +53 -12
- package/bun.lock +9 -3
- package/dist/auth-provider.js +7 -4
- package/dist/command-utils.js +6 -6
- package/dist/commands/audit.d.ts +2 -0
- package/dist/commands/audit.js +47 -0
- package/dist/commands/auth.js +22 -7
- package/dist/commands/billing.d.ts +2 -0
- package/dist/commands/billing.js +62 -0
- package/dist/commands/env.js +157 -125
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.js +32 -0
- package/dist/commands/org.d.ts +2 -0
- package/dist/commands/org.js +85 -0
- package/dist/commands/project.d.ts +2 -0
- package/dist/commands/project.js +99 -0
- package/dist/commands/stage.d.ts +2 -0
- package/dist/commands/stage.js +125 -0
- package/dist/commands/target-prompts.d.ts +184 -0
- package/dist/commands/target-prompts.js +312 -0
- package/dist/commands/typegen.d.ts +2 -2
- package/dist/commands/typegen.js +57 -32
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/context/session-id.d.ts +11 -0
- package/dist/context/session-id.js +14 -0
- package/dist/contracts/index.d.ts +491 -0
- package/dist/contracts/index.js +307 -0
- package/dist/credentials-store.js +70 -11
- package/dist/http.d.ts +34 -0
- package/dist/http.js +56 -2
- package/dist/index.js +12 -0
- package/dist/runtime-config.js +14 -26
- package/dist/typegen/core.d.ts +45 -0
- package/dist/typegen/core.js +219 -0
- package/dist/types.d.ts +5 -3
- package/package.json +2 -2
- package/src/auth-provider.ts +8 -5
- package/src/command-utils.ts +6 -6
- package/src/commands/audit.ts +63 -0
- package/src/commands/auth.ts +32 -37
- package/src/commands/billing.ts +73 -0
- package/src/commands/env.ts +211 -218
- package/src/commands/init.ts +47 -0
- package/src/commands/org.ts +104 -0
- package/src/commands/project.ts +130 -0
- package/src/commands/stage.ts +167 -0
- package/src/commands/target-prompts.ts +357 -0
- package/src/commands/typegen.ts +71 -45
- package/src/constants.ts +1 -1
- package/src/context/session-id.ts +14 -0
- package/src/contracts/index.ts +370 -0
- package/src/credentials-store.ts +86 -12
- package/src/http.ts +78 -2
- package/src/index.ts +12 -0
- package/src/runtime-config.ts +19 -32
- package/src/typegen/core.ts +311 -0
- package/src/types.ts +5 -3
- package/test/command-utils.test.ts +47 -0
- package/test/credentials-store.test.ts +40 -0
package/dist/commands/typegen.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { BarekeyClient } from "@barekey/sdk/server";
|
|
2
1
|
import pc from "picocolors";
|
|
2
|
+
import { createCliAuthProvider } from "../auth-provider.js";
|
|
3
3
|
import { addTargetOptions, requireLocalSession, resolveTarget, } from "../command-utils.js";
|
|
4
|
+
import { TypegenManifestSchema } from "../contracts/index.js";
|
|
5
|
+
import { getJson } from "../http.js";
|
|
4
6
|
import { loadRuntimeConfig } from "../runtime-config.js";
|
|
7
|
+
import { writeInstalledSdkGeneratedTypes, } from "../typegen/core.js";
|
|
5
8
|
const DEFAULT_TYPEGEN_WATCH_INTERVAL_MS = 5_000;
|
|
6
9
|
export function formatTypegenResultMessage(result) {
|
|
7
10
|
const title = result.written
|
|
@@ -39,50 +42,63 @@ function sleep(milliseconds) {
|
|
|
39
42
|
setTimeout(resolve, milliseconds);
|
|
40
43
|
});
|
|
41
44
|
}
|
|
42
|
-
async function
|
|
45
|
+
async function resolveTypegenContext(options) {
|
|
43
46
|
const runtime = await loadRuntimeConfig();
|
|
44
47
|
const local = runtime?.config.config?.mode === "standalone" ? null : await requireLocalSession();
|
|
45
48
|
const target = await resolveTarget(options, local);
|
|
46
|
-
const
|
|
47
|
-
const organization = target.orgSlug ?? local?.credentials.orgSlug;
|
|
48
|
-
if ((!organization || organization.trim().length === 0) && !isStandalone) {
|
|
49
|
-
throw new Error("Organization slug is required.");
|
|
50
|
-
}
|
|
51
|
-
const jsonConfig = {
|
|
52
|
-
...(organization && organization.trim().length > 0 ? { organization } : {}),
|
|
53
|
-
...(target.projectSlug.trim().length > 0 ? { project: target.projectSlug } : {}),
|
|
54
|
-
...(target.stageSlug.trim().length > 0 ? { environment: target.stageSlug } : {}),
|
|
55
|
-
...(runtime?.config.config?.typegen === undefined
|
|
56
|
-
? {}
|
|
57
|
-
: {
|
|
58
|
-
config: {
|
|
59
|
-
typegen: runtime.config.config.typegen,
|
|
60
|
-
mode: runtime.config.config.mode,
|
|
61
|
-
},
|
|
62
|
-
}),
|
|
63
|
-
};
|
|
49
|
+
const authProvider = local === null ? null : createCliAuthProvider();
|
|
64
50
|
return {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}),
|
|
69
|
-
organization: organization && organization.trim().length > 0 ? organization : "local",
|
|
51
|
+
baseUrl: local?.baseUrl ?? null,
|
|
52
|
+
accessToken: authProvider === null ? null : await authProvider.getAccessToken(),
|
|
53
|
+
organization: target.orgSlug ?? "local",
|
|
70
54
|
project: target.projectSlug.trim().length > 0 ? target.projectSlug : "standalone",
|
|
71
55
|
environment: target.stageSlug.trim().length > 0 ? target.stageSlug : "local",
|
|
56
|
+
runtimeMode: runtime?.config.config?.mode ?? "centralized",
|
|
57
|
+
typegenMode: runtime?.config.config?.typegen ?? "semantic",
|
|
58
|
+
localEnvRoot: runtime?.path ?? null,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
async function fetchManifest(options) {
|
|
62
|
+
const context = await resolveTypegenContext(options);
|
|
63
|
+
if (context.baseUrl === null || context.accessToken === null) {
|
|
64
|
+
throw new Error("Typegen currently requires centralized Barekey auth.");
|
|
65
|
+
}
|
|
66
|
+
const searchParams = new URLSearchParams({
|
|
67
|
+
orgSlug: context.organization,
|
|
68
|
+
projectSlug: context.project,
|
|
69
|
+
stageSlug: context.environment,
|
|
70
|
+
});
|
|
71
|
+
const manifest = await getJson({
|
|
72
|
+
baseUrl: context.baseUrl,
|
|
73
|
+
path: `/v1/typegen/manifest?${searchParams.toString()}`,
|
|
74
|
+
accessToken: context.accessToken,
|
|
75
|
+
schema: TypegenManifestSchema,
|
|
76
|
+
});
|
|
77
|
+
return {
|
|
78
|
+
manifest,
|
|
79
|
+
context,
|
|
72
80
|
};
|
|
73
81
|
}
|
|
74
82
|
async function runTypegen(options) {
|
|
75
|
-
const {
|
|
76
|
-
const result = await
|
|
83
|
+
const { manifest, context } = await fetchManifest(options);
|
|
84
|
+
const result = await writeInstalledSdkGeneratedTypes(manifest, {
|
|
85
|
+
baseUrl: context.baseUrl,
|
|
86
|
+
orgSlug: context.organization,
|
|
87
|
+
projectSlug: context.project,
|
|
88
|
+
stageSlug: context.environment,
|
|
89
|
+
typegenMode: context.typegenMode,
|
|
90
|
+
runtimeMode: context.runtimeMode,
|
|
91
|
+
localEnvRoot: context.localEnvRoot,
|
|
92
|
+
});
|
|
77
93
|
console.log(formatTypegenResultMessage(result));
|
|
78
94
|
}
|
|
79
95
|
async function runTypegenWatch(options) {
|
|
80
96
|
const intervalMs = parseTypegenWatchInterval(options.interval);
|
|
81
|
-
const {
|
|
97
|
+
const { context } = await fetchManifest(options);
|
|
82
98
|
console.log(formatTypegenWatchStartedMessage({
|
|
83
|
-
organization,
|
|
84
|
-
project,
|
|
85
|
-
environment,
|
|
99
|
+
organization: context.organization,
|
|
100
|
+
project: context.project,
|
|
101
|
+
environment: context.environment,
|
|
86
102
|
intervalMs,
|
|
87
103
|
}));
|
|
88
104
|
let stopped = false;
|
|
@@ -94,7 +110,16 @@ async function runTypegenWatch(options) {
|
|
|
94
110
|
try {
|
|
95
111
|
let isFirstRun = true;
|
|
96
112
|
while (!stopped) {
|
|
97
|
-
const
|
|
113
|
+
const { manifest, context: nextContext } = await fetchManifest(options);
|
|
114
|
+
const result = await writeInstalledSdkGeneratedTypes(manifest, {
|
|
115
|
+
baseUrl: nextContext.baseUrl,
|
|
116
|
+
orgSlug: nextContext.organization,
|
|
117
|
+
projectSlug: nextContext.project,
|
|
118
|
+
stageSlug: nextContext.environment,
|
|
119
|
+
typegenMode: nextContext.typegenMode,
|
|
120
|
+
runtimeMode: nextContext.runtimeMode,
|
|
121
|
+
localEnvRoot: nextContext.localEnvRoot,
|
|
122
|
+
});
|
|
98
123
|
if (isFirstRun || result.written) {
|
|
99
124
|
if (!isFirstRun) {
|
|
100
125
|
console.log("");
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the stable CLI session id for one base URL and Clerk user.
|
|
3
|
+
*
|
|
4
|
+
* @param baseUrl The Barekey API base URL.
|
|
5
|
+
* @param clerkUserId The authenticated Clerk user id.
|
|
6
|
+
* @returns The normalized CLI session id.
|
|
7
|
+
* @remarks CLI auth is global per user and base URL, not per organization.
|
|
8
|
+
* @lastModified 2026-03-19
|
|
9
|
+
* @author GPT-5.4
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildSessionId(baseUrl: string, clerkUserId: string): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the stable CLI session id for one base URL and Clerk user.
|
|
3
|
+
*
|
|
4
|
+
* @param baseUrl The Barekey API base URL.
|
|
5
|
+
* @param clerkUserId The authenticated Clerk user id.
|
|
6
|
+
* @returns The normalized CLI session id.
|
|
7
|
+
* @remarks CLI auth is global per user and base URL, not per organization.
|
|
8
|
+
* @lastModified 2026-03-19
|
|
9
|
+
* @author GPT-5.4
|
|
10
|
+
*/
|
|
11
|
+
export function buildSessionId(baseUrl, clerkUserId) {
|
|
12
|
+
const normalizedBaseUrl = baseUrl.replace(/\/$/, "");
|
|
13
|
+
return `${normalizedBaseUrl}::${clerkUserId}`;
|
|
14
|
+
}
|
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const DeclaredTypeSchema: Schema.Literal<["string", "boolean", "int64", "float", "date", "json"]>;
|
|
3
|
+
export declare const VisibilitySchema: Schema.Literal<["private", "public"]>;
|
|
4
|
+
export declare const RolloutFunctionSchema: Schema.Literal<["linear", "step", "ease_in_out"]>;
|
|
5
|
+
export declare const RuntimeModeSchema: Schema.Literal<["centralized", "standalone"]>;
|
|
6
|
+
export declare const TypegenModeSchema: Schema.Literal<["semantic", "minimal"]>;
|
|
7
|
+
export declare const RuntimeConfigSchema: Schema.Struct<{
|
|
8
|
+
organization: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
9
|
+
org: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
10
|
+
project: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
11
|
+
environment: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
12
|
+
stage: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
13
|
+
typegen: Schema.optional<Schema.NullOr<Schema.Literal<["semantic", "minimal"]>>>;
|
|
14
|
+
config: Schema.optional<Schema.Struct<{
|
|
15
|
+
typegen: Schema.optional<Schema.Literal<["semantic", "minimal"]>>;
|
|
16
|
+
mode: Schema.optional<Schema.Literal<["centralized", "standalone"]>>;
|
|
17
|
+
}>>;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const CliConfigSchema: Schema.Union<[Schema.Struct<{
|
|
20
|
+
baseUrl: Schema.filter<typeof Schema.String>;
|
|
21
|
+
activeSessionId: Schema.filter<typeof Schema.String>;
|
|
22
|
+
}>, Schema.Struct<{
|
|
23
|
+
baseUrl: Schema.filter<typeof Schema.String>;
|
|
24
|
+
activeAccountId: Schema.filter<typeof Schema.String>;
|
|
25
|
+
}>]>;
|
|
26
|
+
export declare const CliSessionSchema: Schema.Union<[Schema.Struct<{
|
|
27
|
+
accessToken: Schema.filter<typeof Schema.String>;
|
|
28
|
+
refreshToken: Schema.filter<typeof Schema.String>;
|
|
29
|
+
accessTokenExpiresAtMs: Schema.filter<typeof Schema.Number>;
|
|
30
|
+
refreshTokenExpiresAtMs: Schema.filter<typeof Schema.Number>;
|
|
31
|
+
clerkUserId: Schema.filter<typeof Schema.String>;
|
|
32
|
+
orgId: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
33
|
+
orgSlug: Schema.NullOr<Schema.filter<typeof Schema.String>>;
|
|
34
|
+
lastOrgId: Schema.optional<Schema.NullOr<Schema.filter<typeof Schema.String>>>;
|
|
35
|
+
lastOrgSlug: Schema.optional<Schema.NullOr<Schema.filter<typeof Schema.String>>>;
|
|
36
|
+
}>, Schema.Struct<{
|
|
37
|
+
accessToken: Schema.filter<typeof Schema.String>;
|
|
38
|
+
refreshToken: Schema.filter<typeof Schema.String>;
|
|
39
|
+
accessTokenExpiresAtMs: Schema.filter<typeof Schema.Number>;
|
|
40
|
+
refreshTokenExpiresAtMs: Schema.filter<typeof Schema.Number>;
|
|
41
|
+
clerkUserId: Schema.filter<typeof Schema.String>;
|
|
42
|
+
orgId: Schema.filter<typeof Schema.String>;
|
|
43
|
+
orgSlug: Schema.filter<typeof Schema.String>;
|
|
44
|
+
}>]>;
|
|
45
|
+
export declare const ErrorEnvelopeSchema: Schema.Struct<{
|
|
46
|
+
error: Schema.Struct<{
|
|
47
|
+
code: Schema.optional<typeof Schema.String>;
|
|
48
|
+
message: Schema.optional<typeof Schema.String>;
|
|
49
|
+
requestId: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
50
|
+
}>;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const CliSessionResponseSchema: Schema.Struct<{
|
|
53
|
+
clerkUserId: typeof Schema.String;
|
|
54
|
+
orgId: typeof Schema.String;
|
|
55
|
+
orgSlug: typeof Schema.String;
|
|
56
|
+
source: Schema.Literal<["clerk", "cli"]>;
|
|
57
|
+
requestId: Schema.optional<typeof Schema.String>;
|
|
58
|
+
}>;
|
|
59
|
+
export declare const DeviceStartResponseSchema: Schema.Struct<{
|
|
60
|
+
deviceCode: typeof Schema.String;
|
|
61
|
+
userCode: typeof Schema.String;
|
|
62
|
+
verificationUri: typeof Schema.String;
|
|
63
|
+
intervalSec: Schema.filter<typeof Schema.Number>;
|
|
64
|
+
expiresInSec: Schema.filter<typeof Schema.Number>;
|
|
65
|
+
requestId: Schema.optional<typeof Schema.String>;
|
|
66
|
+
}>;
|
|
67
|
+
export declare const DevicePollPendingSchema: Schema.Struct<{
|
|
68
|
+
status: Schema.Literal<["pending"]>;
|
|
69
|
+
intervalSec: Schema.filter<typeof Schema.Number>;
|
|
70
|
+
requestId: Schema.optional<typeof Schema.String>;
|
|
71
|
+
}>;
|
|
72
|
+
export declare const DevicePollApprovedSchema: Schema.Struct<{
|
|
73
|
+
status: Schema.Literal<["approved"]>;
|
|
74
|
+
intervalSec: Schema.filter<typeof Schema.Number>;
|
|
75
|
+
accessToken: typeof Schema.String;
|
|
76
|
+
refreshToken: typeof Schema.String;
|
|
77
|
+
accessTokenExpiresAtMs: Schema.filter<typeof Schema.Number>;
|
|
78
|
+
refreshTokenExpiresAtMs: Schema.filter<typeof Schema.Number>;
|
|
79
|
+
orgId: typeof Schema.String;
|
|
80
|
+
orgSlug: typeof Schema.String;
|
|
81
|
+
clerkUserId: typeof Schema.String;
|
|
82
|
+
requestId: Schema.optional<typeof Schema.String>;
|
|
83
|
+
}>;
|
|
84
|
+
export declare const DevicePollResponseSchema: Schema.Union<[Schema.Struct<{
|
|
85
|
+
status: Schema.Literal<["pending"]>;
|
|
86
|
+
intervalSec: Schema.filter<typeof Schema.Number>;
|
|
87
|
+
requestId: Schema.optional<typeof Schema.String>;
|
|
88
|
+
}>, Schema.Struct<{
|
|
89
|
+
status: Schema.Literal<["approved"]>;
|
|
90
|
+
intervalSec: Schema.filter<typeof Schema.Number>;
|
|
91
|
+
accessToken: typeof Schema.String;
|
|
92
|
+
refreshToken: typeof Schema.String;
|
|
93
|
+
accessTokenExpiresAtMs: Schema.filter<typeof Schema.Number>;
|
|
94
|
+
refreshTokenExpiresAtMs: Schema.filter<typeof Schema.Number>;
|
|
95
|
+
orgId: typeof Schema.String;
|
|
96
|
+
orgSlug: typeof Schema.String;
|
|
97
|
+
clerkUserId: typeof Schema.String;
|
|
98
|
+
requestId: Schema.optional<typeof Schema.String>;
|
|
99
|
+
}>]>;
|
|
100
|
+
export declare const RefreshResponseSchema: Schema.Struct<{
|
|
101
|
+
accessToken: typeof Schema.String;
|
|
102
|
+
refreshToken: typeof Schema.String;
|
|
103
|
+
accessTokenExpiresAtMs: Schema.filter<typeof Schema.Number>;
|
|
104
|
+
refreshTokenExpiresAtMs: Schema.filter<typeof Schema.Number>;
|
|
105
|
+
orgId: typeof Schema.String;
|
|
106
|
+
orgSlug: typeof Schema.String;
|
|
107
|
+
clerkUserId: typeof Schema.String;
|
|
108
|
+
requestId: Schema.optional<typeof Schema.String>;
|
|
109
|
+
}>;
|
|
110
|
+
export declare const EnvDecisionSchema: Schema.Struct<{
|
|
111
|
+
bucket: Schema.filter<typeof Schema.Number>;
|
|
112
|
+
chance: Schema.filter<typeof Schema.Number>;
|
|
113
|
+
seed: Schema.optional<typeof Schema.String>;
|
|
114
|
+
key: Schema.optional<typeof Schema.String>;
|
|
115
|
+
matchedRule: typeof Schema.String;
|
|
116
|
+
}>;
|
|
117
|
+
export declare const EnvResolvedValueSchema: Schema.Struct<{
|
|
118
|
+
name: typeof Schema.String;
|
|
119
|
+
kind: Schema.Literal<["secret", "ab_roll", "rollout"]>;
|
|
120
|
+
declaredType: Schema.Literal<["string", "boolean", "int64", "float", "date", "json"]>;
|
|
121
|
+
visibility: Schema.Literal<["private", "public"]>;
|
|
122
|
+
value: typeof Schema.Unknown;
|
|
123
|
+
decision: Schema.optional<Schema.Struct<{
|
|
124
|
+
bucket: Schema.filter<typeof Schema.Number>;
|
|
125
|
+
chance: Schema.filter<typeof Schema.Number>;
|
|
126
|
+
seed: Schema.optional<typeof Schema.String>;
|
|
127
|
+
key: Schema.optional<typeof Schema.String>;
|
|
128
|
+
matchedRule: typeof Schema.String;
|
|
129
|
+
}>>;
|
|
130
|
+
}>;
|
|
131
|
+
export declare const EnvEvaluateResponseSchema: Schema.Struct<{
|
|
132
|
+
name: typeof Schema.String;
|
|
133
|
+
kind: Schema.Literal<["secret", "ab_roll", "rollout"]>;
|
|
134
|
+
declaredType: Schema.Literal<["string", "boolean", "int64", "float", "date", "json"]>;
|
|
135
|
+
visibility: Schema.Literal<["private", "public"]>;
|
|
136
|
+
value: typeof Schema.Unknown;
|
|
137
|
+
decision: Schema.optional<Schema.Struct<{
|
|
138
|
+
bucket: Schema.filter<typeof Schema.Number>;
|
|
139
|
+
chance: Schema.filter<typeof Schema.Number>;
|
|
140
|
+
seed: Schema.optional<typeof Schema.String>;
|
|
141
|
+
key: Schema.optional<typeof Schema.String>;
|
|
142
|
+
matchedRule: typeof Schema.String;
|
|
143
|
+
}>>;
|
|
144
|
+
}>;
|
|
145
|
+
export declare const EnvEvaluateBatchResponseSchema: Schema.Struct<{
|
|
146
|
+
values: Schema.Array$<Schema.Struct<{
|
|
147
|
+
name: typeof Schema.String;
|
|
148
|
+
kind: Schema.Literal<["secret", "ab_roll", "rollout"]>;
|
|
149
|
+
declaredType: Schema.Literal<["string", "boolean", "int64", "float", "date", "json"]>;
|
|
150
|
+
visibility: Schema.Literal<["private", "public"]>;
|
|
151
|
+
value: typeof Schema.Unknown;
|
|
152
|
+
decision: Schema.optional<Schema.Struct<{
|
|
153
|
+
bucket: Schema.filter<typeof Schema.Number>;
|
|
154
|
+
chance: Schema.filter<typeof Schema.Number>;
|
|
155
|
+
seed: Schema.optional<typeof Schema.String>;
|
|
156
|
+
key: Schema.optional<typeof Schema.String>;
|
|
157
|
+
matchedRule: typeof Schema.String;
|
|
158
|
+
}>>;
|
|
159
|
+
}>>;
|
|
160
|
+
}>;
|
|
161
|
+
export declare const RolloutMilestoneSchema: Schema.Struct<{
|
|
162
|
+
at: typeof Schema.String;
|
|
163
|
+
percentage: Schema.filter<typeof Schema.Number>;
|
|
164
|
+
}>;
|
|
165
|
+
export declare const EnvVariableListItemSchema: Schema.Struct<{
|
|
166
|
+
name: typeof Schema.String;
|
|
167
|
+
visibility: Schema.Literal<["private", "public"]>;
|
|
168
|
+
kind: Schema.Literal<["secret", "ab_roll", "rollout"]>;
|
|
169
|
+
declaredType: Schema.Literal<["string", "boolean", "int64", "float", "date", "json"]>;
|
|
170
|
+
createdAtMs: Schema.filter<typeof Schema.Number>;
|
|
171
|
+
updatedAtMs: Schema.filter<typeof Schema.Number>;
|
|
172
|
+
chance: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
173
|
+
rolloutFunction: Schema.NullOr<Schema.Literal<["linear", "step", "ease_in_out"]>>;
|
|
174
|
+
rolloutMilestones: Schema.NullOr<Schema.Array$<Schema.Struct<{
|
|
175
|
+
at: typeof Schema.String;
|
|
176
|
+
percentage: Schema.filter<typeof Schema.Number>;
|
|
177
|
+
}>>>;
|
|
178
|
+
}>;
|
|
179
|
+
export declare const EnvListResponseSchema: Schema.Struct<{
|
|
180
|
+
variables: Schema.Array$<Schema.Struct<{
|
|
181
|
+
name: typeof Schema.String;
|
|
182
|
+
visibility: Schema.Literal<["private", "public"]>;
|
|
183
|
+
kind: Schema.Literal<["secret", "ab_roll", "rollout"]>;
|
|
184
|
+
declaredType: Schema.Literal<["string", "boolean", "int64", "float", "date", "json"]>;
|
|
185
|
+
createdAtMs: Schema.filter<typeof Schema.Number>;
|
|
186
|
+
updatedAtMs: Schema.filter<typeof Schema.Number>;
|
|
187
|
+
chance: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
188
|
+
rolloutFunction: Schema.NullOr<Schema.Literal<["linear", "step", "ease_in_out"]>>;
|
|
189
|
+
rolloutMilestones: Schema.NullOr<Schema.Array$<Schema.Struct<{
|
|
190
|
+
at: typeof Schema.String;
|
|
191
|
+
percentage: Schema.filter<typeof Schema.Number>;
|
|
192
|
+
}>>>;
|
|
193
|
+
}>>;
|
|
194
|
+
}>;
|
|
195
|
+
export declare const EnvWriteResponseSchema: Schema.Struct<{
|
|
196
|
+
createdCount: Schema.filter<typeof Schema.Number>;
|
|
197
|
+
updatedCount: Schema.filter<typeof Schema.Number>;
|
|
198
|
+
deletedCount: Schema.filter<typeof Schema.Number>;
|
|
199
|
+
}>;
|
|
200
|
+
export declare const EnvPullValueSchema: Schema.Struct<{
|
|
201
|
+
name: typeof Schema.String;
|
|
202
|
+
kind: Schema.Literal<["secret", "ab_roll", "rollout"]>;
|
|
203
|
+
declaredType: Schema.Literal<["string", "boolean", "int64", "float", "date", "json"]>;
|
|
204
|
+
value: typeof Schema.String;
|
|
205
|
+
}>;
|
|
206
|
+
export declare const EnvPullResponseSchema: Schema.Struct<{
|
|
207
|
+
values: Schema.Array$<Schema.Struct<{
|
|
208
|
+
name: typeof Schema.String;
|
|
209
|
+
kind: Schema.Literal<["secret", "ab_roll", "rollout"]>;
|
|
210
|
+
declaredType: Schema.Literal<["string", "boolean", "int64", "float", "date", "json"]>;
|
|
211
|
+
value: typeof Schema.String;
|
|
212
|
+
}>>;
|
|
213
|
+
byName: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
214
|
+
}>;
|
|
215
|
+
export declare const TypegenVariableSchema: Schema.Struct<{
|
|
216
|
+
name: typeof Schema.String;
|
|
217
|
+
visibility: Schema.Literal<["private", "public"]>;
|
|
218
|
+
kind: Schema.Literal<["secret", "ab_roll", "rollout"]>;
|
|
219
|
+
declaredType: Schema.Literal<["string", "boolean", "int64", "float", "date", "json"]>;
|
|
220
|
+
required: typeof Schema.Boolean;
|
|
221
|
+
updatedAtMs: Schema.filter<typeof Schema.Number>;
|
|
222
|
+
typeScriptType: typeof Schema.String;
|
|
223
|
+
valueATypeScriptType: Schema.NullOr<typeof Schema.String>;
|
|
224
|
+
valueBTypeScriptType: Schema.NullOr<typeof Schema.String>;
|
|
225
|
+
rolloutFunction: Schema.NullOr<Schema.Literal<["linear", "step", "ease_in_out"]>>;
|
|
226
|
+
rolloutMilestones: Schema.NullOr<Schema.Array$<Schema.Struct<{
|
|
227
|
+
at: typeof Schema.String;
|
|
228
|
+
percentage: Schema.filter<typeof Schema.Number>;
|
|
229
|
+
}>>>;
|
|
230
|
+
}>;
|
|
231
|
+
export declare const TypegenManifestSchema: Schema.Struct<{
|
|
232
|
+
orgId: typeof Schema.String;
|
|
233
|
+
orgSlug: typeof Schema.String;
|
|
234
|
+
projectSlug: typeof Schema.String;
|
|
235
|
+
stageSlug: typeof Schema.String;
|
|
236
|
+
generatedAtMs: Schema.filter<typeof Schema.Number>;
|
|
237
|
+
manifestVersion: typeof Schema.String;
|
|
238
|
+
variables: Schema.Array$<Schema.Struct<{
|
|
239
|
+
name: typeof Schema.String;
|
|
240
|
+
visibility: Schema.Literal<["private", "public"]>;
|
|
241
|
+
kind: Schema.Literal<["secret", "ab_roll", "rollout"]>;
|
|
242
|
+
declaredType: Schema.Literal<["string", "boolean", "int64", "float", "date", "json"]>;
|
|
243
|
+
required: typeof Schema.Boolean;
|
|
244
|
+
updatedAtMs: Schema.filter<typeof Schema.Number>;
|
|
245
|
+
typeScriptType: typeof Schema.String;
|
|
246
|
+
valueATypeScriptType: Schema.NullOr<typeof Schema.String>;
|
|
247
|
+
valueBTypeScriptType: Schema.NullOr<typeof Schema.String>;
|
|
248
|
+
rolloutFunction: Schema.NullOr<Schema.Literal<["linear", "step", "ease_in_out"]>>;
|
|
249
|
+
rolloutMilestones: Schema.NullOr<Schema.Array$<Schema.Struct<{
|
|
250
|
+
at: typeof Schema.String;
|
|
251
|
+
percentage: Schema.filter<typeof Schema.Number>;
|
|
252
|
+
}>>>;
|
|
253
|
+
}>>;
|
|
254
|
+
}>;
|
|
255
|
+
export declare const OrganizationSummarySchema: Schema.Struct<{
|
|
256
|
+
id: typeof Schema.String;
|
|
257
|
+
slug: typeof Schema.String;
|
|
258
|
+
name: typeof Schema.String;
|
|
259
|
+
role: typeof Schema.String;
|
|
260
|
+
imageUrl: typeof Schema.String;
|
|
261
|
+
}>;
|
|
262
|
+
export declare const OrganizationsResponseSchema: Schema.Struct<{
|
|
263
|
+
organizations: Schema.Array$<Schema.Struct<{
|
|
264
|
+
id: typeof Schema.String;
|
|
265
|
+
slug: typeof Schema.String;
|
|
266
|
+
name: typeof Schema.String;
|
|
267
|
+
role: typeof Schema.String;
|
|
268
|
+
imageUrl: typeof Schema.String;
|
|
269
|
+
}>>;
|
|
270
|
+
}>;
|
|
271
|
+
export declare const ProjectSummarySchema: Schema.Struct<{
|
|
272
|
+
id: typeof Schema.String;
|
|
273
|
+
orgId: typeof Schema.String;
|
|
274
|
+
orgSlug: typeof Schema.String;
|
|
275
|
+
name: typeof Schema.String;
|
|
276
|
+
slug: typeof Schema.String;
|
|
277
|
+
slugBase: typeof Schema.String;
|
|
278
|
+
createdByClerkUserId: typeof Schema.String;
|
|
279
|
+
createdAtMs: Schema.filter<typeof Schema.Number>;
|
|
280
|
+
updatedAtMs: Schema.filter<typeof Schema.Number>;
|
|
281
|
+
}>;
|
|
282
|
+
export declare const ProjectListItemSchema: Schema.Struct<{
|
|
283
|
+
id: typeof Schema.String;
|
|
284
|
+
orgId: typeof Schema.String;
|
|
285
|
+
orgSlug: typeof Schema.String;
|
|
286
|
+
name: typeof Schema.String;
|
|
287
|
+
slug: typeof Schema.String;
|
|
288
|
+
slugBase: typeof Schema.String;
|
|
289
|
+
createdByClerkUserId: typeof Schema.String;
|
|
290
|
+
createdAtMs: Schema.filter<typeof Schema.Number>;
|
|
291
|
+
updatedAtMs: Schema.filter<typeof Schema.Number>;
|
|
292
|
+
secretCount: Schema.filter<typeof Schema.Number>;
|
|
293
|
+
}>;
|
|
294
|
+
export declare const ProjectsListResponseSchema: Schema.Struct<{
|
|
295
|
+
projects: Schema.Array$<Schema.Struct<{
|
|
296
|
+
id: typeof Schema.String;
|
|
297
|
+
orgId: typeof Schema.String;
|
|
298
|
+
orgSlug: typeof Schema.String;
|
|
299
|
+
name: typeof Schema.String;
|
|
300
|
+
slug: typeof Schema.String;
|
|
301
|
+
slugBase: typeof Schema.String;
|
|
302
|
+
createdByClerkUserId: typeof Schema.String;
|
|
303
|
+
createdAtMs: Schema.filter<typeof Schema.Number>;
|
|
304
|
+
updatedAtMs: Schema.filter<typeof Schema.Number>;
|
|
305
|
+
secretCount: Schema.filter<typeof Schema.Number>;
|
|
306
|
+
}>>;
|
|
307
|
+
}>;
|
|
308
|
+
export declare const ProjectCreateResponseSchema: Schema.Struct<{
|
|
309
|
+
project: Schema.Struct<{
|
|
310
|
+
id: typeof Schema.String;
|
|
311
|
+
orgId: typeof Schema.String;
|
|
312
|
+
orgSlug: typeof Schema.String;
|
|
313
|
+
name: typeof Schema.String;
|
|
314
|
+
slug: typeof Schema.String;
|
|
315
|
+
slugBase: typeof Schema.String;
|
|
316
|
+
createdByClerkUserId: typeof Schema.String;
|
|
317
|
+
createdAtMs: Schema.filter<typeof Schema.Number>;
|
|
318
|
+
updatedAtMs: Schema.filter<typeof Schema.Number>;
|
|
319
|
+
}>;
|
|
320
|
+
}>;
|
|
321
|
+
export declare const ProjectDeleteResponseSchema: Schema.Struct<{
|
|
322
|
+
deletedProjectId: typeof Schema.String;
|
|
323
|
+
deletedProjectSlug: typeof Schema.String;
|
|
324
|
+
}>;
|
|
325
|
+
export declare const StageSummarySchema: Schema.Struct<{
|
|
326
|
+
id: typeof Schema.String;
|
|
327
|
+
projectId: typeof Schema.String;
|
|
328
|
+
orgId: typeof Schema.String;
|
|
329
|
+
slug: typeof Schema.String;
|
|
330
|
+
name: typeof Schema.String;
|
|
331
|
+
isDefault: typeof Schema.Boolean;
|
|
332
|
+
variableCount: Schema.filter<typeof Schema.Number>;
|
|
333
|
+
createdAtMs: Schema.filter<typeof Schema.Number>;
|
|
334
|
+
updatedAtMs: Schema.filter<typeof Schema.Number>;
|
|
335
|
+
}>;
|
|
336
|
+
export declare const StagesListResponseSchema: Schema.Struct<{
|
|
337
|
+
stages: Schema.Array$<Schema.Struct<{
|
|
338
|
+
id: typeof Schema.String;
|
|
339
|
+
projectId: typeof Schema.String;
|
|
340
|
+
orgId: typeof Schema.String;
|
|
341
|
+
slug: typeof Schema.String;
|
|
342
|
+
name: typeof Schema.String;
|
|
343
|
+
isDefault: typeof Schema.Boolean;
|
|
344
|
+
variableCount: Schema.filter<typeof Schema.Number>;
|
|
345
|
+
createdAtMs: Schema.filter<typeof Schema.Number>;
|
|
346
|
+
updatedAtMs: Schema.filter<typeof Schema.Number>;
|
|
347
|
+
}>>;
|
|
348
|
+
}>;
|
|
349
|
+
export declare const StageCreateResponseSchema: Schema.Struct<{
|
|
350
|
+
stage: Schema.Struct<{
|
|
351
|
+
id: typeof Schema.String;
|
|
352
|
+
projectId: typeof Schema.String;
|
|
353
|
+
orgId: typeof Schema.String;
|
|
354
|
+
slug: typeof Schema.String;
|
|
355
|
+
name: typeof Schema.String;
|
|
356
|
+
isDefault: typeof Schema.Boolean;
|
|
357
|
+
variableCount: Schema.filter<typeof Schema.Number>;
|
|
358
|
+
createdAtMs: Schema.filter<typeof Schema.Number>;
|
|
359
|
+
updatedAtMs: Schema.filter<typeof Schema.Number>;
|
|
360
|
+
}>;
|
|
361
|
+
}>;
|
|
362
|
+
export declare const StageRenameResponseSchema: Schema.Struct<{
|
|
363
|
+
stage: Schema.Struct<{
|
|
364
|
+
id: typeof Schema.String;
|
|
365
|
+
projectId: typeof Schema.String;
|
|
366
|
+
orgId: typeof Schema.String;
|
|
367
|
+
slug: typeof Schema.String;
|
|
368
|
+
name: typeof Schema.String;
|
|
369
|
+
isDefault: typeof Schema.Boolean;
|
|
370
|
+
variableCount: Schema.filter<typeof Schema.Number>;
|
|
371
|
+
createdAtMs: Schema.filter<typeof Schema.Number>;
|
|
372
|
+
updatedAtMs: Schema.filter<typeof Schema.Number>;
|
|
373
|
+
}>;
|
|
374
|
+
}>;
|
|
375
|
+
export declare const StageDeleteResponseSchema: Schema.Struct<{
|
|
376
|
+
deletedStageSlug: typeof Schema.String;
|
|
377
|
+
}>;
|
|
378
|
+
export declare const FeatureUsageSchema: Schema.Struct<{
|
|
379
|
+
featureId: typeof Schema.String;
|
|
380
|
+
allowed: typeof Schema.Boolean;
|
|
381
|
+
usage: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
382
|
+
includedUsage: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
383
|
+
usageLimit: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
384
|
+
overageAllowed: Schema.NullOr<typeof Schema.Boolean>;
|
|
385
|
+
nextResetAtMs: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
386
|
+
}>;
|
|
387
|
+
export declare const BillingCatalogResponseSchema: Schema.Struct<{
|
|
388
|
+
variants: Schema.Array$<typeof Schema.Unknown>;
|
|
389
|
+
featureIds: Schema.Struct<{
|
|
390
|
+
staticRequests: typeof Schema.String;
|
|
391
|
+
dynamicRequests: typeof Schema.String;
|
|
392
|
+
storageBytes: typeof Schema.String;
|
|
393
|
+
}>;
|
|
394
|
+
}>;
|
|
395
|
+
export declare const BillingStatusResponseSchema: Schema.Struct<{
|
|
396
|
+
orgId: typeof Schema.String;
|
|
397
|
+
orgRole: Schema.NullOr<typeof Schema.String>;
|
|
398
|
+
canManageBilling: typeof Schema.Boolean;
|
|
399
|
+
currentProductId: Schema.NullOr<typeof Schema.String>;
|
|
400
|
+
currentTier: Schema.NullOr<typeof Schema.String>;
|
|
401
|
+
currentInterval: Schema.NullOr<typeof Schema.String>;
|
|
402
|
+
currentOverageMode: Schema.NullOr<typeof Schema.String>;
|
|
403
|
+
hasScheduledPlanChange: typeof Schema.Boolean;
|
|
404
|
+
scheduledPlanChange: Schema.NullOr<typeof Schema.Unknown>;
|
|
405
|
+
usage: Schema.Struct<{
|
|
406
|
+
staticRequests: Schema.Struct<{
|
|
407
|
+
featureId: typeof Schema.String;
|
|
408
|
+
allowed: typeof Schema.Boolean;
|
|
409
|
+
usage: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
410
|
+
includedUsage: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
411
|
+
usageLimit: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
412
|
+
overageAllowed: Schema.NullOr<typeof Schema.Boolean>;
|
|
413
|
+
nextResetAtMs: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
414
|
+
}>;
|
|
415
|
+
dynamicRequests: Schema.Struct<{
|
|
416
|
+
featureId: typeof Schema.String;
|
|
417
|
+
allowed: typeof Schema.Boolean;
|
|
418
|
+
usage: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
419
|
+
includedUsage: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
420
|
+
usageLimit: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
421
|
+
overageAllowed: Schema.NullOr<typeof Schema.Boolean>;
|
|
422
|
+
nextResetAtMs: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
423
|
+
}>;
|
|
424
|
+
storageBytes: Schema.Struct<{
|
|
425
|
+
featureId: typeof Schema.String;
|
|
426
|
+
allowed: typeof Schema.Boolean;
|
|
427
|
+
usage: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
428
|
+
includedUsage: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
429
|
+
usageLimit: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
430
|
+
overageAllowed: Schema.NullOr<typeof Schema.Boolean>;
|
|
431
|
+
nextResetAtMs: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
432
|
+
}>;
|
|
433
|
+
}>;
|
|
434
|
+
storageMirrorBytes: Schema.filter<typeof Schema.Number>;
|
|
435
|
+
variants: Schema.Array$<typeof Schema.Unknown>;
|
|
436
|
+
}>;
|
|
437
|
+
export declare const AuditEventSchema: Schema.Struct<{
|
|
438
|
+
id: typeof Schema.String;
|
|
439
|
+
orgId: typeof Schema.String;
|
|
440
|
+
orgSlug: typeof Schema.String;
|
|
441
|
+
projectId: Schema.NullOr<typeof Schema.String>;
|
|
442
|
+
projectSlug: Schema.NullOr<typeof Schema.String>;
|
|
443
|
+
stageSlug: Schema.NullOr<typeof Schema.String>;
|
|
444
|
+
eventType: typeof Schema.String;
|
|
445
|
+
category: typeof Schema.String;
|
|
446
|
+
occurredAtMs: Schema.filter<typeof Schema.Number>;
|
|
447
|
+
actorSource: typeof Schema.String;
|
|
448
|
+
actorClerkUserId: Schema.NullOr<typeof Schema.String>;
|
|
449
|
+
actorDisplayName: Schema.NullOr<typeof Schema.String>;
|
|
450
|
+
actorEmail: Schema.NullOr<typeof Schema.String>;
|
|
451
|
+
subjectType: typeof Schema.String;
|
|
452
|
+
subjectId: Schema.NullOr<typeof Schema.String>;
|
|
453
|
+
subjectName: Schema.NullOr<typeof Schema.String>;
|
|
454
|
+
title: typeof Schema.String;
|
|
455
|
+
description: typeof Schema.String;
|
|
456
|
+
severity: typeof Schema.String;
|
|
457
|
+
payloadJson: typeof Schema.String;
|
|
458
|
+
retentionTier: typeof Schema.String;
|
|
459
|
+
expiresAtMs: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
460
|
+
}>;
|
|
461
|
+
export declare const AuditListResponseSchema: Schema.Struct<{
|
|
462
|
+
items: Schema.Array$<Schema.Struct<{
|
|
463
|
+
id: typeof Schema.String;
|
|
464
|
+
orgId: typeof Schema.String;
|
|
465
|
+
orgSlug: typeof Schema.String;
|
|
466
|
+
projectId: Schema.NullOr<typeof Schema.String>;
|
|
467
|
+
projectSlug: Schema.NullOr<typeof Schema.String>;
|
|
468
|
+
stageSlug: Schema.NullOr<typeof Schema.String>;
|
|
469
|
+
eventType: typeof Schema.String;
|
|
470
|
+
category: typeof Schema.String;
|
|
471
|
+
occurredAtMs: Schema.filter<typeof Schema.Number>;
|
|
472
|
+
actorSource: typeof Schema.String;
|
|
473
|
+
actorClerkUserId: Schema.NullOr<typeof Schema.String>;
|
|
474
|
+
actorDisplayName: Schema.NullOr<typeof Schema.String>;
|
|
475
|
+
actorEmail: Schema.NullOr<typeof Schema.String>;
|
|
476
|
+
subjectType: typeof Schema.String;
|
|
477
|
+
subjectId: Schema.NullOr<typeof Schema.String>;
|
|
478
|
+
subjectName: Schema.NullOr<typeof Schema.String>;
|
|
479
|
+
title: typeof Schema.String;
|
|
480
|
+
description: typeof Schema.String;
|
|
481
|
+
severity: typeof Schema.String;
|
|
482
|
+
payloadJson: typeof Schema.String;
|
|
483
|
+
retentionTier: typeof Schema.String;
|
|
484
|
+
expiresAtMs: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
485
|
+
}>>;
|
|
486
|
+
nextBeforeOccurredAtMs: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
|
|
487
|
+
hasMore: typeof Schema.Boolean;
|
|
488
|
+
}>;
|
|
489
|
+
export type CliConfigRecord = Schema.Schema.Type<typeof CliConfigSchema>;
|
|
490
|
+
export type CliSessionRecord = Schema.Schema.Type<typeof CliSessionSchema>;
|
|
491
|
+
export type TypegenManifest = Schema.Schema.Type<typeof TypegenManifestSchema>;
|