@shipeasy/openapi 1.6.0 → 2.1.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 +37 -0
- package/dist/chunk-EPLLHLZN.js +1616 -0
- package/dist/chunk-EPLLHLZN.js.map +1 -0
- package/dist/chunk-SPH5HWCD.js +3326 -0
- package/dist/chunk-SPH5HWCD.js.map +1 -0
- package/dist/client-pVkoo3Bf.d.ts +11186 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.js +215 -0
- package/dist/client.js.map +1 -0
- package/dist/custom.d.ts +64 -0
- package/dist/custom.js +292 -0
- package/dist/custom.js.map +1 -0
- package/dist/index.d.ts +29 -41
- package/dist/index.js +258 -4375
- package/dist/index.js.map +1 -0
- package/dist/node-context.d.ts +81 -33
- package/dist/node-context.js +98 -44
- package/dist/node-context.js.map +1 -0
- package/dist/schemas.d.ts +7920 -0
- package/dist/schemas.js +1083 -0
- package/dist/schemas.js.map +1 -0
- package/openapi.json +15297 -3044
- package/openapi.yaml +13979 -0
- package/package.json +33 -26
- package/spec/components/errors.yaml +53 -0
- package/spec/components/parameters.yaml +24 -0
- package/spec/components/responses.yaml +107 -0
- package/spec/components/schemas/alert-rules.yaml +175 -0
- package/spec/components/schemas/attributes.yaml +157 -0
- package/spec/components/schemas/common.yaml +87 -0
- package/spec/components/schemas/configs.yaml +371 -0
- package/spec/components/schemas/connectors.yaml +593 -0
- package/spec/components/schemas/errors-api.yaml +209 -0
- package/spec/components/schemas/events.yaml +321 -0
- package/spec/components/schemas/experiments.yaml +865 -0
- package/spec/components/schemas/gate-templates.yaml +198 -0
- package/spec/components/schemas/gates.yaml +890 -0
- package/spec/components/schemas/i18n.yaml +478 -0
- package/spec/components/schemas/keys.yaml +186 -0
- package/spec/components/schemas/killswitches.yaml +309 -0
- package/spec/components/schemas/metrics.yaml +547 -0
- package/spec/components/schemas/ops.yaml +1011 -0
- package/spec/components/schemas/projects.yaml +222 -0
- package/spec/components/schemas/search.yaml +46 -0
- package/spec/components/schemas/universes.yaml +127 -0
- package/spec/openapi.yaml +348 -0
- package/spec/paths/alert-rules.yaml +250 -0
- package/spec/paths/attributes.yaml +261 -0
- package/spec/paths/configs.yaml +744 -0
- package/spec/paths/connectors.yaml +748 -0
- package/spec/paths/errors.yaml +382 -0
- package/spec/paths/events.yaml +366 -0
- package/spec/paths/experiments.yaml +777 -0
- package/spec/paths/gate-templates.yaml +263 -0
- package/spec/paths/gates.yaml +451 -0
- package/spec/paths/i18n.yaml +544 -0
- package/spec/paths/keys.yaml +181 -0
- package/spec/paths/killswitches.yaml +557 -0
- package/spec/paths/metrics.yaml +302 -0
- package/spec/paths/ops.yaml +446 -0
- package/spec/paths/projects.yaml +210 -0
- package/spec/paths/search.yaml +62 -0
- package/spec/paths/universes.yaml +247 -0
- package/dist/operations/attributes.d.ts +0 -33
- package/dist/operations/attributes.js +0 -16
- package/dist/operations/cli-adapter.d.ts +0 -35
- package/dist/operations/cli-adapter.js +0 -91
- package/dist/operations/coerce.d.ts +0 -32
- package/dist/operations/coerce.js +0 -53
- package/dist/operations/configs.d.ts +0 -28
- package/dist/operations/configs.js +0 -119
- package/dist/operations/docs.d.ts +0 -37
- package/dist/operations/docs.js +0 -39
- package/dist/operations/events.d.ts +0 -28
- package/dist/operations/events.js +0 -121
- package/dist/operations/experiments.d.ts +0 -28
- package/dist/operations/experiments.js +0 -280
- package/dist/operations/gates.d.ts +0 -28
- package/dist/operations/gates.js +0 -132
- package/dist/operations/i18n.d.ts +0 -28
- package/dist/operations/i18n.js +0 -121
- package/dist/operations/index.d.ts +0 -63
- package/dist/operations/index.js +0 -1751
- package/dist/operations/killswitches.d.ts +0 -28
- package/dist/operations/killswitches.js +0 -126
- package/dist/operations/mcp-adapter.d.ts +0 -35
- package/dist/operations/mcp-adapter.js +0 -94
- package/dist/operations/metrics.d.ts +0 -30
- package/dist/operations/metrics.js +0 -114
- package/dist/operations/ops.d.ts +0 -28
- package/dist/operations/ops.js +0 -313
- package/dist/operations/projects.d.ts +0 -28
- package/dist/operations/projects.js +0 -36
- package/dist/operations/sdk-docs.d.ts +0 -28
- package/dist/operations/sdk-docs.js +0 -160
- package/dist/operations/types.d.ts +0 -138
- package/dist/operations/types.js +0 -9
- package/dist/operations/universes.d.ts +0 -28
- package/dist/operations/universes.js +0 -93
- package/dist/operations/util.d.ts +0 -33
- package/dist/operations/util.js +0 -9
- package/dist/resources/alert-rules.d.ts +0 -50
- package/dist/resources/alert-rules.js +0 -75
- package/dist/resources/attributes.d.ts +0 -19
- package/dist/resources/attributes.js +0 -10
- package/dist/resources/configs.d.ts +0 -681
- package/dist/resources/configs.js +0 -509
- package/dist/resources/events.d.ts +0 -61
- package/dist/resources/events.js +0 -42
- package/dist/resources/experiments.d.ts +0 -849
- package/dist/resources/experiments.js +0 -707
- package/dist/resources/gates.d.ts +0 -808
- package/dist/resources/gates.js +0 -522
- package/dist/resources/i18n.d.ts +0 -84
- package/dist/resources/i18n.js +0 -60
- package/dist/resources/index.d.ts +0 -2767
- package/dist/resources/index.js +0 -2563
- package/dist/resources/killswitches.d.ts +0 -436
- package/dist/resources/killswitches.js +0 -514
- package/dist/resources/metrics.d.ts +0 -54
- package/dist/resources/metrics.js +0 -40
- package/dist/resources/ops.d.ts +0 -88
- package/dist/resources/ops.js +0 -36
- package/dist/resources/projects.d.ts +0 -54
- package/dist/resources/projects.js +0 -14
- package/dist/resources/universes.d.ts +0 -185
- package/dist/resources/universes.js +0 -234
- package/dist/schemas/alert-rules.d.ts +0 -65
- package/dist/schemas/alert-rules.js +0 -37
- package/dist/schemas/configs.d.ts +0 -154
- package/dist/schemas/configs.js +0 -134
- package/dist/schemas/constants.d.ts +0 -6
- package/dist/schemas/constants.js +0 -7
- package/dist/schemas/experiments.d.ts +0 -229
- package/dist/schemas/experiments.js +0 -221
- package/dist/schemas/folder.d.ts +0 -10
- package/dist/schemas/folder.js +0 -8
- package/dist/schemas/gates.d.ts +0 -386
- package/dist/schemas/gates.js +0 -190
- package/dist/schemas/index.d.ts +0 -11
- package/dist/schemas/index.js +0 -762
- package/dist/schemas/killswitches.d.ts +0 -110
- package/dist/schemas/killswitches.js +0 -226
- package/dist/schemas/metric-name.d.ts +0 -5
- package/dist/schemas/metric-name.js +0 -6
- package/dist/schemas/pagination.d.ts +0 -37
- package/dist/schemas/pagination.js +0 -44
- package/dist/schemas/universes.d.ts +0 -35
- package/dist/schemas/universes.js +0 -55
- package/dist/transport.d.ts +0 -30
- package/dist/transport.js +0 -44
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// src/schemas/alert-rules.ts
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
var ALERT_COMPARATORS = ["gt", "gte", "lt", "lte"];
|
|
4
|
-
var ALERT_SEVERITIES = ["danger", "warn", "info"];
|
|
5
|
-
var notificationTargetSchema = z.object({
|
|
6
|
-
slackChannel: z.object({
|
|
7
|
-
id: z.string().min(1).describe("Slack channel id (e.g. C0123ABCD)."),
|
|
8
|
-
name: z.string().min(1).describe("Slack channel name (without the leading #).")
|
|
9
|
-
}).nullish().describe("Slack channel to post this rule's alert to. Requires a Slack connector."),
|
|
10
|
-
email: z.string().email().nullish().describe("Email address to notify for this rule (overrides the default recipient).")
|
|
11
|
-
}).strict();
|
|
12
|
-
var alertRuleCreateSchema = z.object({
|
|
13
|
-
name: z.string().min(1).max(120).describe("Human label for the rule, shown on the alert and the rules list."),
|
|
14
|
-
metricId: z.string().min(1).describe("Id of the metric to evaluate."),
|
|
15
|
-
comparator: z.enum(ALERT_COMPARATORS).describe("How the metric value is compared to the threshold (gt/gte/lt/lte)."),
|
|
16
|
-
threshold: z.number().finite().describe("Threshold the metric value is compared against."),
|
|
17
|
-
windowHours: z.number().int().min(1).max(720).default(24).describe("Lookback window (hours) the metric is aggregated over. 1\u2013720."),
|
|
18
|
-
severity: z.enum(ALERT_SEVERITIES).default("warn").describe("Severity of the raised alert."),
|
|
19
|
-
enabled: z.boolean().default(true).describe("Whether the rule is evaluated by the cron."),
|
|
20
|
-
notify: notificationTargetSchema.nullish().describe("Where to deliver this rule's alert (Slack channel and/or email target).")
|
|
21
|
-
}).strict();
|
|
22
|
-
var alertRuleUpdateSchema = z.object({
|
|
23
|
-
name: z.string().min(1).max(120),
|
|
24
|
-
comparator: z.enum(ALERT_COMPARATORS),
|
|
25
|
-
threshold: z.number().finite(),
|
|
26
|
-
windowHours: z.number().int().min(1).max(720),
|
|
27
|
-
severity: z.enum(ALERT_SEVERITIES),
|
|
28
|
-
enabled: z.boolean(),
|
|
29
|
-
notify: notificationTargetSchema.nullish()
|
|
30
|
-
}).partial().strict();
|
|
31
|
-
export {
|
|
32
|
-
ALERT_COMPARATORS,
|
|
33
|
-
ALERT_SEVERITIES,
|
|
34
|
-
alertRuleCreateSchema,
|
|
35
|
-
alertRuleUpdateSchema,
|
|
36
|
-
notificationTargetSchema
|
|
37
|
-
};
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
/** Names are exactly two segments — `<folder>.<name>` — so the dashboard can
|
|
4
|
-
* group rows by folder. `_default` is reserved for the migration that lifts
|
|
5
|
-
* legacy single-segment names and is the only segment allowed to start with
|
|
6
|
-
* an underscore. */
|
|
7
|
-
declare const configNameSchema: z.ZodString;
|
|
8
|
-
declare const configKindSchema: z.ZodEnum<{
|
|
9
|
-
config: "config";
|
|
10
|
-
killswitch: "killswitch";
|
|
11
|
-
}>;
|
|
12
|
-
declare const configEnvSchema: z.ZodEnum<{
|
|
13
|
-
dev: "dev";
|
|
14
|
-
staging: "staging";
|
|
15
|
-
prod: "prod";
|
|
16
|
-
}>;
|
|
17
|
-
/** JSON Schema describing the shape of a config value.
|
|
18
|
-
* Configs are object-only; the top-level `type` must be `"object"`. */
|
|
19
|
-
declare const jsonSchemaSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
20
|
-
type JsonSchemaInput = z.infer<typeof jsonSchemaSchema>;
|
|
21
|
-
declare const configCreateSchema: z.ZodObject<{
|
|
22
|
-
name: z.ZodString;
|
|
23
|
-
description: z.ZodOptional<z.ZodString>;
|
|
24
|
-
folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
|
-
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
26
|
-
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnknown, z.ZodRecord<z.ZodEnum<{
|
|
27
|
-
dev: "dev";
|
|
28
|
-
staging: "staging";
|
|
29
|
-
prod: "prod";
|
|
30
|
-
}>, z.ZodUnknown>]>>;
|
|
31
|
-
}, z.core.$strip>;
|
|
32
|
-
/** Flat update — accepts an optional new schema and/or a flat value applied to all envs. */
|
|
33
|
-
declare const configUpdateSchema: z.ZodObject<{
|
|
34
|
-
schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
35
|
-
value: z.ZodOptional<z.ZodUnknown>;
|
|
36
|
-
folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
-
}, z.core.$strip>;
|
|
38
|
-
/** Schema-only update — does not bump value versions or rebuild KV. */
|
|
39
|
-
declare const configSchemaUpdateSchema: z.ZodObject<{
|
|
40
|
-
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
41
|
-
}, z.core.$strip>;
|
|
42
|
-
declare const configDraftUpsertSchema: z.ZodObject<{
|
|
43
|
-
env: z.ZodEnum<{
|
|
44
|
-
dev: "dev";
|
|
45
|
-
staging: "staging";
|
|
46
|
-
prod: "prod";
|
|
47
|
-
}>;
|
|
48
|
-
value: z.ZodUnknown;
|
|
49
|
-
}, z.core.$strip>;
|
|
50
|
-
declare const configPublishSchema: z.ZodObject<{
|
|
51
|
-
env: z.ZodEnum<{
|
|
52
|
-
dev: "dev";
|
|
53
|
-
staging: "staging";
|
|
54
|
-
prod: "prod";
|
|
55
|
-
}>;
|
|
56
|
-
}, z.core.$strip>;
|
|
57
|
-
declare const configResponseSchema: z.ZodObject<{
|
|
58
|
-
id: z.ZodString;
|
|
59
|
-
name: z.ZodString;
|
|
60
|
-
description: z.ZodNullable<z.ZodString>;
|
|
61
|
-
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
62
|
-
updatedAt: z.ZodString;
|
|
63
|
-
envs: z.ZodRecord<z.ZodEnum<{
|
|
64
|
-
dev: "dev";
|
|
65
|
-
staging: "staging";
|
|
66
|
-
prod: "prod";
|
|
67
|
-
}>, z.ZodObject<{
|
|
68
|
-
version: z.ZodNumber;
|
|
69
|
-
publishedAt: z.ZodString;
|
|
70
|
-
publishedBy: z.ZodString;
|
|
71
|
-
}, z.core.$strip>>;
|
|
72
|
-
drafts: z.ZodRecord<z.ZodEnum<{
|
|
73
|
-
dev: "dev";
|
|
74
|
-
staging: "staging";
|
|
75
|
-
prod: "prod";
|
|
76
|
-
}>, z.ZodObject<{
|
|
77
|
-
updatedAt: z.ZodString;
|
|
78
|
-
authorEmail: z.ZodString;
|
|
79
|
-
baseVersion: z.ZodNumber;
|
|
80
|
-
}, z.core.$strip>>;
|
|
81
|
-
values: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
82
|
-
dev: "dev";
|
|
83
|
-
staging: "staging";
|
|
84
|
-
prod: "prod";
|
|
85
|
-
}>, z.ZodUnknown>>;
|
|
86
|
-
draftValues: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
87
|
-
dev: "dev";
|
|
88
|
-
staging: "staging";
|
|
89
|
-
prod: "prod";
|
|
90
|
-
}>, z.ZodUnknown>>;
|
|
91
|
-
}, z.core.$strip>;
|
|
92
|
-
declare const configCreateResponseSchema: z.ZodObject<{
|
|
93
|
-
id: z.ZodString;
|
|
94
|
-
name: z.ZodString;
|
|
95
|
-
}, z.core.$strip>;
|
|
96
|
-
declare const configUpdateResponseSchema: z.ZodObject<{
|
|
97
|
-
id: z.ZodString;
|
|
98
|
-
}, z.core.$strip>;
|
|
99
|
-
declare const configDeleteResponseSchema: z.ZodObject<{
|
|
100
|
-
ok: z.ZodLiteral<true>;
|
|
101
|
-
}, z.core.$strip>;
|
|
102
|
-
declare const configDraftSaveResponseSchema: z.ZodObject<{
|
|
103
|
-
id: z.ZodString;
|
|
104
|
-
env: z.ZodEnum<{
|
|
105
|
-
dev: "dev";
|
|
106
|
-
staging: "staging";
|
|
107
|
-
prod: "prod";
|
|
108
|
-
}>;
|
|
109
|
-
baseVersion: z.ZodNumber;
|
|
110
|
-
updatedAt: z.ZodString;
|
|
111
|
-
}, z.core.$strip>;
|
|
112
|
-
declare const configDraftDiscardResponseSchema: z.ZodObject<{
|
|
113
|
-
ok: z.ZodLiteral<true>;
|
|
114
|
-
}, z.core.$strip>;
|
|
115
|
-
declare const configPublishResponseSchema: z.ZodObject<{
|
|
116
|
-
id: z.ZodString;
|
|
117
|
-
env: z.ZodEnum<{
|
|
118
|
-
dev: "dev";
|
|
119
|
-
staging: "staging";
|
|
120
|
-
prod: "prod";
|
|
121
|
-
}>;
|
|
122
|
-
version: z.ZodNumber;
|
|
123
|
-
}, z.core.$strip>;
|
|
124
|
-
declare const configActivityEntrySchema: z.ZodObject<{
|
|
125
|
-
id: z.ZodString;
|
|
126
|
-
action: z.ZodString;
|
|
127
|
-
actorEmail: z.ZodString;
|
|
128
|
-
actorType: z.ZodEnum<{
|
|
129
|
-
user: "user";
|
|
130
|
-
cli: "cli";
|
|
131
|
-
system: "system";
|
|
132
|
-
}>;
|
|
133
|
-
payload: z.ZodNullable<z.ZodUnknown>;
|
|
134
|
-
createdAt: z.ZodString;
|
|
135
|
-
}, z.core.$strip>;
|
|
136
|
-
declare const configActivityResponseSchema: z.ZodArray<z.ZodObject<{
|
|
137
|
-
id: z.ZodString;
|
|
138
|
-
action: z.ZodString;
|
|
139
|
-
actorEmail: z.ZodString;
|
|
140
|
-
actorType: z.ZodEnum<{
|
|
141
|
-
user: "user";
|
|
142
|
-
cli: "cli";
|
|
143
|
-
system: "system";
|
|
144
|
-
}>;
|
|
145
|
-
payload: z.ZodNullable<z.ZodUnknown>;
|
|
146
|
-
createdAt: z.ZodString;
|
|
147
|
-
}, z.core.$strip>>;
|
|
148
|
-
type ConfigCreateInput = z.infer<typeof configCreateSchema>;
|
|
149
|
-
type ConfigUpdateInput = z.infer<typeof configUpdateSchema>;
|
|
150
|
-
type ConfigSchemaUpdateInput = z.infer<typeof configSchemaUpdateSchema>;
|
|
151
|
-
type ConfigDraftUpsertInput = z.infer<typeof configDraftUpsertSchema>;
|
|
152
|
-
type ConfigPublishInput = z.infer<typeof configPublishSchema>;
|
|
153
|
-
|
|
154
|
-
export { type ConfigCreateInput, type ConfigDraftUpsertInput, type ConfigPublishInput, type ConfigSchemaUpdateInput, type ConfigUpdateInput, type JsonSchemaInput, configActivityEntrySchema, configActivityResponseSchema, configCreateResponseSchema, configCreateSchema, configDeleteResponseSchema, configDraftDiscardResponseSchema, configDraftSaveResponseSchema, configDraftUpsertSchema, configEnvSchema, configKindSchema, configNameSchema, configPublishResponseSchema, configPublishSchema, configResponseSchema, configSchemaUpdateSchema, configUpdateResponseSchema, configUpdateSchema, jsonSchemaSchema };
|
package/dist/schemas/configs.js
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
// src/schemas/configs.ts
|
|
2
|
-
import { z as z2 } from "zod";
|
|
3
|
-
|
|
4
|
-
// src/schemas/constants.ts
|
|
5
|
-
var CONFIG_ENVS = ["dev", "staging", "prod"];
|
|
6
|
-
var CONFIG_KINDS = ["config", "killswitch"];
|
|
7
|
-
|
|
8
|
-
// src/schemas/folder.ts
|
|
9
|
-
import { z } from "zod";
|
|
10
|
-
var folderSchema = z.string().max(256).regex(/^[a-zA-Z0-9_-]+$/, "Folder must be alphanumeric, `_` or `-` (no `/`).").nullable().optional().describe(
|
|
11
|
-
"Optional folder name used to group items in the dashboard. Part of the SDK lookup key: an item in folder `checkout` named `new-cart` is referenced as `checkout/new-cart` from the SDK."
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
// src/schemas/configs.ts
|
|
15
|
-
var SEGMENT = /^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?$/;
|
|
16
|
-
var RESERVED_FOLDER = "_default";
|
|
17
|
-
var configNameSchema = z2.string().max(128).refine(
|
|
18
|
-
(s) => {
|
|
19
|
-
const parts = s.split(".");
|
|
20
|
-
if (parts.length !== 2) return false;
|
|
21
|
-
return parts.every((p, i) => p === RESERVED_FOLDER && i === 0 ? true : SEGMENT.test(p));
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
message: "Must be `folder.name` \u2014 exactly two lowercase segments separated by a dot (e.g. `pricing.tiers`)."
|
|
25
|
-
}
|
|
26
|
-
).describe(
|
|
27
|
-
"Stable config key in `folder.name` form (two lowercase segments separated by a dot, e.g. `pricing.tiers`). Used by SDKs as `Shipeasy.getConfig('<name>')`. Immutable after create."
|
|
28
|
-
);
|
|
29
|
-
var configKindSchema = z2.enum(CONFIG_KINDS);
|
|
30
|
-
var configEnvSchema = z2.enum(CONFIG_ENVS).describe("Target environment. One of the project's configured envs (`dev`, `stage`, `prod`).");
|
|
31
|
-
var jsonSchemaSchema = z2.record(z2.string(), z2.unknown()).refine((s) => s.type === "object", { message: "Top-level schema type must be 'object'" }).describe(
|
|
32
|
-
"JSON Schema (draft 2020-12) describing the shape of the config value. Top-level `type` must be `'object'`; every published value is validated against this schema."
|
|
33
|
-
);
|
|
34
|
-
var initialValuesSchema = z2.union([z2.unknown(), z2.record(configEnvSchema, z2.unknown())]).describe(
|
|
35
|
-
"Initial config value. Either a single JSON object applied to every env, or a `{ env: value }` map seeding per-env values. Must match `schema`. Defaults to `{}` on every env when omitted."
|
|
36
|
-
);
|
|
37
|
-
var configCreateSchema = z2.object({
|
|
38
|
-
name: configNameSchema,
|
|
39
|
-
description: z2.string().max(512).optional().describe("Optional free-form description shown in the dashboard. Max 512 chars."),
|
|
40
|
-
folder: folderSchema,
|
|
41
|
-
schema: jsonSchemaSchema,
|
|
42
|
-
value: initialValuesSchema.optional()
|
|
43
|
-
}).describe("Body for `POST /api/admin/configs`. `name` + `schema` required.");
|
|
44
|
-
var configUpdateSchema = z2.object({
|
|
45
|
-
schema: jsonSchemaSchema.optional().describe(
|
|
46
|
-
"Replacement schema. When supplied, the new schema is validated against every published value before it lands."
|
|
47
|
-
),
|
|
48
|
-
value: z2.unknown().optional().describe(
|
|
49
|
-
"Flat value applied to **every** env. Publishes a new version per env. To target one env, use `PUT /{id}/drafts` then `POST /{id}/publish`."
|
|
50
|
-
),
|
|
51
|
-
folder: folderSchema
|
|
52
|
-
}).describe(
|
|
53
|
-
"Body for `PATCH /api/admin/configs/{id}`. Partial \u2014 only supplied fields change. `value` republishes on every env."
|
|
54
|
-
);
|
|
55
|
-
var configSchemaUpdateSchema = z2.object({ schema: jsonSchemaSchema }).describe("Schema-only update. Does not bump value versions or rebuild KV.");
|
|
56
|
-
var configDraftUpsertSchema = z2.object({
|
|
57
|
-
env: configEnvSchema,
|
|
58
|
-
value: z2.unknown().describe("Draft value to stage on `env`. Validated against the config's current schema.")
|
|
59
|
-
}).describe(
|
|
60
|
-
"Body for `PUT /api/admin/configs/{id}/drafts`. Stages a value for a single env without publishing."
|
|
61
|
-
);
|
|
62
|
-
var configPublishSchema = z2.object({ env: configEnvSchema }).describe(
|
|
63
|
-
"Body for `POST /api/admin/configs/{id}/publish` and `DELETE /api/admin/configs/{id}/drafts`. Names the target env."
|
|
64
|
-
);
|
|
65
|
-
var configEnvPublishedSchema = z2.object({
|
|
66
|
-
version: z2.number().int().describe("Monotonically increasing version per env."),
|
|
67
|
-
publishedAt: z2.string().describe("ISO-8601 publish timestamp."),
|
|
68
|
-
publishedBy: z2.string().describe("Email/id of the actor who published this version.")
|
|
69
|
-
});
|
|
70
|
-
var configDraftSummarySchema = z2.object({
|
|
71
|
-
updatedAt: z2.string().describe("ISO-8601 last-edit timestamp on the draft."),
|
|
72
|
-
authorEmail: z2.string().describe("Email/id of the actor who last edited the draft."),
|
|
73
|
-
baseVersion: z2.number().int().describe("Published version the draft was forked from.")
|
|
74
|
-
});
|
|
75
|
-
var configResponseSchema = z2.object({
|
|
76
|
-
id: z2.string().describe("Stable opaque config id (`cfg_\u2026`)."),
|
|
77
|
-
name: configNameSchema,
|
|
78
|
-
description: z2.string().nullable(),
|
|
79
|
-
schema: jsonSchemaSchema,
|
|
80
|
-
updatedAt: z2.string().describe("ISO-8601 timestamp of last mutation."),
|
|
81
|
-
envs: z2.record(configEnvSchema, configEnvPublishedSchema).describe("Per-env latest published version metadata."),
|
|
82
|
-
drafts: z2.record(configEnvSchema, configDraftSummarySchema).describe("Per-env active drafts (if any)."),
|
|
83
|
-
values: z2.record(configEnvSchema, z2.unknown()).optional().describe("Per-env latest published values (only returned by `GET /{id}`, not list)."),
|
|
84
|
-
draftValues: z2.record(configEnvSchema, z2.unknown()).optional().describe("Per-env draft values (only returned by `GET /{id}`).")
|
|
85
|
-
});
|
|
86
|
-
var configCreateResponseSchema = z2.object({
|
|
87
|
-
id: z2.string().describe("Newly assigned config id."),
|
|
88
|
-
name: configNameSchema
|
|
89
|
-
});
|
|
90
|
-
var configUpdateResponseSchema = z2.object({
|
|
91
|
-
id: z2.string().describe("Config id that was updated.")
|
|
92
|
-
});
|
|
93
|
-
var configDeleteResponseSchema = z2.object({ ok: z2.literal(true) });
|
|
94
|
-
var configDraftSaveResponseSchema = z2.object({
|
|
95
|
-
id: z2.string(),
|
|
96
|
-
env: configEnvSchema,
|
|
97
|
-
baseVersion: z2.number().int().describe("Published version the draft is based on."),
|
|
98
|
-
updatedAt: z2.string()
|
|
99
|
-
});
|
|
100
|
-
var configDraftDiscardResponseSchema = z2.object({ ok: z2.literal(true) });
|
|
101
|
-
var configPublishResponseSchema = z2.object({
|
|
102
|
-
id: z2.string(),
|
|
103
|
-
env: configEnvSchema,
|
|
104
|
-
version: z2.number().int().describe("Newly published version on `env`.")
|
|
105
|
-
});
|
|
106
|
-
var configActivityEntrySchema = z2.object({
|
|
107
|
-
id: z2.string(),
|
|
108
|
-
action: z2.string().describe("Audit action (e.g. `config.create`, `config.publish`)."),
|
|
109
|
-
actorEmail: z2.string(),
|
|
110
|
-
actorType: z2.enum(["user", "cli", "system"]),
|
|
111
|
-
payload: z2.unknown().nullable(),
|
|
112
|
-
createdAt: z2.string().describe("ISO-8601 timestamp.")
|
|
113
|
-
});
|
|
114
|
-
var configActivityResponseSchema = z2.array(configActivityEntrySchema).describe("Recent audit rows for one config, newest first.");
|
|
115
|
-
export {
|
|
116
|
-
configActivityEntrySchema,
|
|
117
|
-
configActivityResponseSchema,
|
|
118
|
-
configCreateResponseSchema,
|
|
119
|
-
configCreateSchema,
|
|
120
|
-
configDeleteResponseSchema,
|
|
121
|
-
configDraftDiscardResponseSchema,
|
|
122
|
-
configDraftSaveResponseSchema,
|
|
123
|
-
configDraftUpsertSchema,
|
|
124
|
-
configEnvSchema,
|
|
125
|
-
configKindSchema,
|
|
126
|
-
configNameSchema,
|
|
127
|
-
configPublishResponseSchema,
|
|
128
|
-
configPublishSchema,
|
|
129
|
-
configResponseSchema,
|
|
130
|
-
configSchemaUpdateSchema,
|
|
131
|
-
configUpdateResponseSchema,
|
|
132
|
-
configUpdateSchema,
|
|
133
|
-
jsonSchemaSchema
|
|
134
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
declare const CONFIG_ENVS: readonly ["dev", "staging", "prod"];
|
|
2
|
-
type ConfigEnv = (typeof CONFIG_ENVS)[number];
|
|
3
|
-
declare const CONFIG_KINDS: readonly ["config", "killswitch"];
|
|
4
|
-
type ConfigKind = (typeof CONFIG_KINDS)[number];
|
|
5
|
-
|
|
6
|
-
export { CONFIG_ENVS, CONFIG_KINDS, type ConfigEnv, type ConfigKind };
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
declare const experimentInlineMetricSchema: z.ZodObject<{
|
|
4
|
-
name: z.ZodOptional<z.ZodString>;
|
|
5
|
-
query: z.ZodString;
|
|
6
|
-
}, z.core.$strip>;
|
|
7
|
-
type ExperimentInlineMetric = z.infer<typeof experimentInlineMetricSchema>;
|
|
8
|
-
declare const experimentNameSchema: z.ZodString;
|
|
9
|
-
declare const experimentGroupSchema: z.ZodObject<{
|
|
10
|
-
name: z.ZodString;
|
|
11
|
-
weight: z.ZodNumber;
|
|
12
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
13
|
-
}, z.core.$strip>;
|
|
14
|
-
declare const paramSchemaSchema: z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
15
|
-
string: "string";
|
|
16
|
-
number: "number";
|
|
17
|
-
bool: "bool";
|
|
18
|
-
}>>;
|
|
19
|
-
declare const bucketBySchema: z.ZodString;
|
|
20
|
-
declare const experimentCreateSchema: z.ZodObject<{
|
|
21
|
-
name: z.ZodString;
|
|
22
|
-
description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
23
|
-
hypothesis: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
24
|
-
tag: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
25
|
-
owner_email: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
26
|
-
audience: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
27
|
-
bucket_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
28
|
-
folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
-
universe: z.ZodString;
|
|
30
|
-
targeting_gate: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
31
|
-
allocation_pct: z.ZodDefault<z.ZodNumber>;
|
|
32
|
-
salt: z.ZodOptional<z.ZodString>;
|
|
33
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
34
|
-
string: "string";
|
|
35
|
-
number: "number";
|
|
36
|
-
bool: "bool";
|
|
37
|
-
}>>>;
|
|
38
|
-
groups: z.ZodArray<z.ZodObject<{
|
|
39
|
-
name: z.ZodString;
|
|
40
|
-
weight: z.ZodNumber;
|
|
41
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
42
|
-
}, z.core.$strip>>;
|
|
43
|
-
significance_threshold: z.ZodDefault<z.ZodNumber>;
|
|
44
|
-
min_runtime_days: z.ZodDefault<z.ZodNumber>;
|
|
45
|
-
min_sample_size: z.ZodDefault<z.ZodNumber>;
|
|
46
|
-
sequential_testing: z.ZodDefault<z.ZodBoolean>;
|
|
47
|
-
goal_metric: z.ZodOptional<z.ZodObject<{
|
|
48
|
-
name: z.ZodOptional<z.ZodString>;
|
|
49
|
-
query: z.ZodString;
|
|
50
|
-
}, z.core.$strip>>;
|
|
51
|
-
guardrail_metrics: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
52
|
-
name: z.ZodOptional<z.ZodString>;
|
|
53
|
-
query: z.ZodString;
|
|
54
|
-
}, z.core.$strip>>>;
|
|
55
|
-
}, z.core.$strip>;
|
|
56
|
-
declare const experimentUpdateSchema: z.ZodObject<{
|
|
57
|
-
name: z.ZodOptional<z.ZodString>;
|
|
58
|
-
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
|
-
hypothesis: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
|
-
tag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
61
|
-
owner_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
62
|
-
audience: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
|
-
bucket_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
|
-
folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
65
|
-
targeting_gate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
|
-
allocation_pct: z.ZodOptional<z.ZodNumber>;
|
|
67
|
-
salt: z.ZodOptional<z.ZodString>;
|
|
68
|
-
universe: z.ZodOptional<z.ZodString>;
|
|
69
|
-
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
70
|
-
string: "string";
|
|
71
|
-
number: "number";
|
|
72
|
-
bool: "bool";
|
|
73
|
-
}>>>;
|
|
74
|
-
groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
75
|
-
name: z.ZodString;
|
|
76
|
-
weight: z.ZodNumber;
|
|
77
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
78
|
-
}, z.core.$strip>>>;
|
|
79
|
-
significance_threshold: z.ZodOptional<z.ZodNumber>;
|
|
80
|
-
min_runtime_days: z.ZodOptional<z.ZodNumber>;
|
|
81
|
-
min_sample_size: z.ZodOptional<z.ZodNumber>;
|
|
82
|
-
sequential_testing: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
-
goal_metric: z.ZodOptional<z.ZodObject<{
|
|
84
|
-
name: z.ZodOptional<z.ZodString>;
|
|
85
|
-
query: z.ZodString;
|
|
86
|
-
}, z.core.$strip>>;
|
|
87
|
-
guardrail_metrics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
88
|
-
name: z.ZodOptional<z.ZodString>;
|
|
89
|
-
query: z.ZodString;
|
|
90
|
-
}, z.core.$strip>>>;
|
|
91
|
-
}, z.core.$strip>;
|
|
92
|
-
declare const experimentStatusUpdateSchema: z.ZodObject<{
|
|
93
|
-
status: z.ZodEnum<{
|
|
94
|
-
draft: "draft";
|
|
95
|
-
running: "running";
|
|
96
|
-
stopped: "stopped";
|
|
97
|
-
archived: "archived";
|
|
98
|
-
}>;
|
|
99
|
-
}, z.core.$strip>;
|
|
100
|
-
declare const experimentMetricsUpdateSchema: z.ZodObject<{
|
|
101
|
-
metrics: z.ZodArray<z.ZodObject<{
|
|
102
|
-
metric_id: z.ZodString;
|
|
103
|
-
role: z.ZodEnum<{
|
|
104
|
-
goal: "goal";
|
|
105
|
-
guardrail: "guardrail";
|
|
106
|
-
secondary: "secondary";
|
|
107
|
-
}>;
|
|
108
|
-
}, z.core.$strip>>;
|
|
109
|
-
}, z.core.$strip>;
|
|
110
|
-
declare const experimentResponseSchema: z.ZodObject<{
|
|
111
|
-
id: z.ZodString;
|
|
112
|
-
name: z.ZodString;
|
|
113
|
-
description: z.ZodNullable<z.ZodString>;
|
|
114
|
-
hypothesis: z.ZodNullable<z.ZodString>;
|
|
115
|
-
tag: z.ZodNullable<z.ZodString>;
|
|
116
|
-
ownerEmail: z.ZodNullable<z.ZodString>;
|
|
117
|
-
audience: z.ZodNullable<z.ZodString>;
|
|
118
|
-
bucketBy: z.ZodNullable<z.ZodString>;
|
|
119
|
-
folder: z.ZodNullable<z.ZodString>;
|
|
120
|
-
status: z.ZodEnum<{
|
|
121
|
-
draft: "draft";
|
|
122
|
-
running: "running";
|
|
123
|
-
stopped: "stopped";
|
|
124
|
-
archived: "archived";
|
|
125
|
-
}>;
|
|
126
|
-
universe: z.ZodString;
|
|
127
|
-
targetingGate: z.ZodNullable<z.ZodString>;
|
|
128
|
-
allocationPct: z.ZodNumber;
|
|
129
|
-
salt: z.ZodString;
|
|
130
|
-
params: z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
131
|
-
string: "string";
|
|
132
|
-
number: "number";
|
|
133
|
-
bool: "bool";
|
|
134
|
-
}>>;
|
|
135
|
-
groups: z.ZodArray<z.ZodObject<{
|
|
136
|
-
name: z.ZodString;
|
|
137
|
-
weight: z.ZodNumber;
|
|
138
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
139
|
-
}, z.core.$strip>>;
|
|
140
|
-
significanceThreshold: z.ZodNumber;
|
|
141
|
-
minRuntimeDays: z.ZodNumber;
|
|
142
|
-
minSampleSize: z.ZodNumber;
|
|
143
|
-
sequentialTesting: z.ZodBoolean;
|
|
144
|
-
startedAt: z.ZodNullable<z.ZodString>;
|
|
145
|
-
stoppedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
146
|
-
updatedAt: z.ZodString;
|
|
147
|
-
}, z.core.$strip>;
|
|
148
|
-
declare const experimentCreateResponseSchema: z.ZodObject<{
|
|
149
|
-
id: z.ZodString;
|
|
150
|
-
name: z.ZodString;
|
|
151
|
-
}, z.core.$strip>;
|
|
152
|
-
declare const experimentUpdateResponseSchema: z.ZodObject<{
|
|
153
|
-
id: z.ZodString;
|
|
154
|
-
}, z.core.$strip>;
|
|
155
|
-
declare const experimentDeleteResponseSchema: z.ZodObject<{
|
|
156
|
-
ok: z.ZodLiteral<true>;
|
|
157
|
-
}, z.core.$strip>;
|
|
158
|
-
declare const experimentStatusResponseSchema: z.ZodObject<{
|
|
159
|
-
id: z.ZodString;
|
|
160
|
-
status: z.ZodEnum<{
|
|
161
|
-
draft: "draft";
|
|
162
|
-
running: "running";
|
|
163
|
-
stopped: "stopped";
|
|
164
|
-
archived: "archived";
|
|
165
|
-
}>;
|
|
166
|
-
}, z.core.$strip>;
|
|
167
|
-
declare const experimentMetricsResponseSchema: z.ZodObject<{
|
|
168
|
-
id: z.ZodString;
|
|
169
|
-
metrics: z.ZodArray<z.ZodObject<{
|
|
170
|
-
metric_id: z.ZodString;
|
|
171
|
-
role: z.ZodEnum<{
|
|
172
|
-
goal: "goal";
|
|
173
|
-
guardrail: "guardrail";
|
|
174
|
-
secondary: "secondary";
|
|
175
|
-
}>;
|
|
176
|
-
}, z.core.$strip>>;
|
|
177
|
-
}, z.core.$strip>;
|
|
178
|
-
declare const experimentResultsResponseSchema: z.ZodObject<{
|
|
179
|
-
experiment: z.ZodObject<{
|
|
180
|
-
id: z.ZodString;
|
|
181
|
-
name: z.ZodString;
|
|
182
|
-
status: z.ZodEnum<{
|
|
183
|
-
draft: "draft";
|
|
184
|
-
running: "running";
|
|
185
|
-
stopped: "stopped";
|
|
186
|
-
archived: "archived";
|
|
187
|
-
}>;
|
|
188
|
-
}, z.core.$strip>;
|
|
189
|
-
results: z.ZodArray<z.ZodObject<{
|
|
190
|
-
metric: z.ZodString;
|
|
191
|
-
group_name: z.ZodString;
|
|
192
|
-
ds: z.ZodString;
|
|
193
|
-
n: z.ZodNullable<z.ZodNumber>;
|
|
194
|
-
mean: z.ZodNullable<z.ZodNumber>;
|
|
195
|
-
delta_pct: z.ZodNullable<z.ZodNumber>;
|
|
196
|
-
p_value: z.ZodNullable<z.ZodNumber>;
|
|
197
|
-
srm_detected: z.ZodNullable<z.ZodNumber>;
|
|
198
|
-
}, z.core.$strip>>;
|
|
199
|
-
}, z.core.$strip>;
|
|
200
|
-
declare const experimentTimeseriesResponseSchema: z.ZodObject<{
|
|
201
|
-
experiment: z.ZodObject<{
|
|
202
|
-
id: z.ZodString;
|
|
203
|
-
name: z.ZodString;
|
|
204
|
-
status: z.ZodEnum<{
|
|
205
|
-
draft: "draft";
|
|
206
|
-
running: "running";
|
|
207
|
-
stopped: "stopped";
|
|
208
|
-
archived: "archived";
|
|
209
|
-
}>;
|
|
210
|
-
}, z.core.$strip>;
|
|
211
|
-
series: z.ZodArray<z.ZodObject<{
|
|
212
|
-
metric: z.ZodString;
|
|
213
|
-
group_name: z.ZodString;
|
|
214
|
-
ds: z.ZodString;
|
|
215
|
-
n: z.ZodNullable<z.ZodNumber>;
|
|
216
|
-
mean: z.ZodNullable<z.ZodNumber>;
|
|
217
|
-
delta_pct: z.ZodNullable<z.ZodNumber>;
|
|
218
|
-
p_value: z.ZodNullable<z.ZodNumber>;
|
|
219
|
-
srm_detected: z.ZodNullable<z.ZodNumber>;
|
|
220
|
-
}, z.core.$strip>>;
|
|
221
|
-
}, z.core.$strip>;
|
|
222
|
-
declare const experimentReanalyzeResponseSchema: z.ZodObject<{
|
|
223
|
-
id: z.ZodString;
|
|
224
|
-
queued: z.ZodLiteral<true>;
|
|
225
|
-
}, z.core.$strip>;
|
|
226
|
-
type ExperimentCreateInput = z.infer<typeof experimentCreateSchema>;
|
|
227
|
-
type ExperimentUpdateInput = z.infer<typeof experimentUpdateSchema>;
|
|
228
|
-
|
|
229
|
-
export { type ExperimentCreateInput, type ExperimentInlineMetric, type ExperimentUpdateInput, bucketBySchema, experimentCreateResponseSchema, experimentCreateSchema, experimentDeleteResponseSchema, experimentGroupSchema, experimentInlineMetricSchema, experimentMetricsResponseSchema, experimentMetricsUpdateSchema, experimentNameSchema, experimentReanalyzeResponseSchema, experimentResponseSchema, experimentResultsResponseSchema, experimentStatusResponseSchema, experimentStatusUpdateSchema, experimentTimeseriesResponseSchema, experimentUpdateResponseSchema, experimentUpdateSchema, paramSchemaSchema };
|