@shipeasy/openapi 1.5.0 → 1.6.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/dist/index.d.ts +24 -0
- package/dist/index.js +1913 -1
- package/dist/node-context.d.ts +37 -0
- package/dist/node-context.js +56 -0
- package/dist/operations/attributes.d.ts +33 -0
- package/dist/operations/attributes.js +16 -0
- package/dist/operations/cli-adapter.d.ts +35 -0
- package/dist/operations/cli-adapter.js +91 -0
- package/dist/operations/coerce.d.ts +32 -0
- package/dist/operations/coerce.js +53 -0
- package/dist/operations/configs.d.ts +28 -0
- package/dist/operations/configs.js +119 -0
- package/dist/operations/docs.d.ts +37 -0
- package/dist/operations/docs.js +39 -0
- package/dist/operations/events.d.ts +28 -0
- package/dist/operations/events.js +121 -0
- package/dist/operations/experiments.d.ts +28 -0
- package/dist/operations/experiments.js +280 -0
- package/dist/operations/gates.d.ts +28 -0
- package/dist/operations/gates.js +132 -0
- package/dist/operations/i18n.d.ts +28 -0
- package/dist/operations/i18n.js +121 -0
- package/dist/operations/index.d.ts +63 -0
- package/dist/operations/index.js +1751 -0
- package/dist/operations/killswitches.d.ts +28 -0
- package/dist/operations/killswitches.js +126 -0
- package/dist/operations/mcp-adapter.d.ts +35 -0
- package/dist/operations/mcp-adapter.js +94 -0
- package/dist/operations/metrics.d.ts +30 -0
- package/dist/operations/metrics.js +114 -0
- package/dist/operations/ops.d.ts +28 -0
- package/dist/operations/ops.js +313 -0
- package/dist/operations/projects.d.ts +28 -0
- package/dist/operations/projects.js +36 -0
- package/dist/operations/sdk-docs.d.ts +28 -0
- package/dist/operations/sdk-docs.js +160 -0
- package/dist/operations/types.d.ts +138 -0
- package/dist/operations/types.js +9 -0
- package/dist/operations/universes.d.ts +28 -0
- package/dist/operations/universes.js +93 -0
- package/dist/operations/util.d.ts +33 -0
- package/dist/operations/util.js +9 -0
- package/dist/resources/attributes.d.ts +19 -0
- package/dist/resources/attributes.js +10 -0
- package/dist/resources/events.d.ts +61 -0
- package/dist/resources/events.js +42 -0
- package/dist/resources/i18n.d.ts +84 -0
- package/dist/resources/i18n.js +60 -0
- package/dist/resources/index.d.ts +22 -4
- package/dist/resources/index.js +173 -1
- package/dist/resources/metrics.d.ts +54 -0
- package/dist/resources/metrics.js +40 -0
- package/dist/resources/ops.d.ts +88 -0
- package/dist/resources/ops.js +36 -0
- package/dist/resources/projects.d.ts +54 -0
- package/dist/resources/projects.js +14 -0
- package/package.json +10 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// src/operations/util.ts
|
|
2
|
+
var str = (i, k) => i[k] === void 0 ? void 0 : i[k];
|
|
3
|
+
|
|
4
|
+
// src/operations/i18n.ts
|
|
5
|
+
var I18N = ["i18n"];
|
|
6
|
+
var PROFILES = ["i18n", "profiles"];
|
|
7
|
+
var DRAFTS = ["i18n", "drafts"];
|
|
8
|
+
var i18nOperations = [
|
|
9
|
+
{
|
|
10
|
+
group: PROFILES,
|
|
11
|
+
name: "list",
|
|
12
|
+
mutates: false,
|
|
13
|
+
summary: "List i18n locale profiles",
|
|
14
|
+
description: "List the project's i18n locale profiles (name, default locale, locales).",
|
|
15
|
+
params: [],
|
|
16
|
+
examples: [{ run: "shipeasy i18n profiles list" }],
|
|
17
|
+
run: (client) => client.i18n.listProfiles()
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
group: PROFILES,
|
|
21
|
+
name: "create",
|
|
22
|
+
mutates: true,
|
|
23
|
+
summary: "Create an i18n locale profile",
|
|
24
|
+
description: "Create an i18n profile (e.g. 'en:prod', 'fr:prod') with one or more locales.",
|
|
25
|
+
params: [
|
|
26
|
+
{ name: "name", type: "string", description: "Profile name.", required: true, positional: true },
|
|
27
|
+
{ name: "locales", type: "json", description: `Locales as a JSON array, e.g. '["fr","fr-CA"]'. Defaults to ["en"].` },
|
|
28
|
+
{ name: "defaultLocale", type: "string", description: "Default locale (defaults to the first locale)." }
|
|
29
|
+
],
|
|
30
|
+
examples: [
|
|
31
|
+
{ run: "shipeasy i18n profiles create en:prod" },
|
|
32
|
+
{ note: "Multiple locales with a default", run: `shipeasy i18n profiles create fr:prod --locales '["fr","fr-CA"]' --default-locale fr` }
|
|
33
|
+
],
|
|
34
|
+
run: (client, i) => {
|
|
35
|
+
const locales = i.locales ?? ["en"];
|
|
36
|
+
return client.i18n.createProfile({
|
|
37
|
+
name: i.name,
|
|
38
|
+
locales,
|
|
39
|
+
default_locale: str(i, "defaultLocale") ?? locales[0]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
group: I18N,
|
|
45
|
+
name: "push",
|
|
46
|
+
mutates: true,
|
|
47
|
+
summary: "Add new i18n keys (insert-only)",
|
|
48
|
+
description: "Add NEW keys to a profile. Insert-only \u2014 existing keys are never overwritten (use `i18n update` to change a value). Keys are a JSON array of {key,value}.",
|
|
49
|
+
params: [
|
|
50
|
+
{ name: "profile", type: "string", description: "Profile name (e.g. 'en:prod').", required: true },
|
|
51
|
+
{ name: "keys", type: "json", description: `Keys as a JSON array, e.g. '[{"key":"home.cta","value":"Get started"}]'.`, required: true },
|
|
52
|
+
{ name: "chunk", type: "string", description: "Logical grouping for the keys. Defaults to 'default'." }
|
|
53
|
+
],
|
|
54
|
+
examples: [
|
|
55
|
+
{ note: "Add keys to a profile", run: `shipeasy i18n push --profile en:prod --keys '[{"key":"home.cta","value":"Get started"}]'` }
|
|
56
|
+
],
|
|
57
|
+
run: async (client, i) => {
|
|
58
|
+
const profile = await client.i18n.resolveProfile(i.profile);
|
|
59
|
+
return client.i18n.pushKeys({
|
|
60
|
+
profile_id: profile.id,
|
|
61
|
+
chunk: str(i, "chunk") ?? "default",
|
|
62
|
+
keys: i.keys
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
group: I18N,
|
|
68
|
+
name: "update",
|
|
69
|
+
mutates: true,
|
|
70
|
+
summary: "Update one i18n key's value",
|
|
71
|
+
description: "Change the value of a single existing key (the only overwrite path; `push` only adds). One key per call.",
|
|
72
|
+
params: [
|
|
73
|
+
{ name: "key", type: "string", description: "Key name.", required: true, positional: true },
|
|
74
|
+
{ name: "value", type: "string", description: "New value.", required: true, positional: true },
|
|
75
|
+
{ name: "profile", type: "string", description: "Profile name (e.g. 'en:prod').", required: true },
|
|
76
|
+
{ name: "description", type: "string", description: "Optional description to store with the key." }
|
|
77
|
+
],
|
|
78
|
+
examples: [
|
|
79
|
+
{ note: "Change one key's value", run: "shipeasy i18n update home.cta 'Get started' --profile en:prod" }
|
|
80
|
+
],
|
|
81
|
+
run: async (client, i) => {
|
|
82
|
+
const profile = await client.i18n.resolveProfile(i.profile);
|
|
83
|
+
return client.i18n.updateKeyByName(profile.id, i.key, {
|
|
84
|
+
value: i.value,
|
|
85
|
+
...i.description !== void 0 ? { description: i.description } : {}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
group: I18N,
|
|
91
|
+
name: "publish",
|
|
92
|
+
mutates: true,
|
|
93
|
+
summary: "Publish a profile chunk to the CDN",
|
|
94
|
+
description: "Publish a profile chunk (rebuilds the KV manifest and purges the CDN).",
|
|
95
|
+
params: [
|
|
96
|
+
{ name: "profile", type: "string", description: "Profile name (e.g. 'en:prod').", required: true },
|
|
97
|
+
{ name: "chunk", type: "string", description: "Chunk to publish. Defaults to 'default'." }
|
|
98
|
+
],
|
|
99
|
+
examples: [
|
|
100
|
+
{ note: "Publish the default chunk", run: "shipeasy i18n publish --profile en:prod" },
|
|
101
|
+
{ note: "Publish a specific chunk", run: "shipeasy i18n publish --profile fr:prod --chunk marketing" }
|
|
102
|
+
],
|
|
103
|
+
run: async (client, i) => {
|
|
104
|
+
const profile = await client.i18n.resolveProfile(i.profile);
|
|
105
|
+
return client.i18n.publish(profile.id, { chunk: str(i, "chunk") ?? "default" });
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
group: DRAFTS,
|
|
110
|
+
name: "list",
|
|
111
|
+
mutates: false,
|
|
112
|
+
summary: "List staged i18n drafts",
|
|
113
|
+
description: "List staged translation drafts. Replaces the `drafts` kind of the deleted MCP generic read.",
|
|
114
|
+
params: [],
|
|
115
|
+
examples: [{ run: "shipeasy i18n drafts list" }],
|
|
116
|
+
run: (client) => client.i18n.listDrafts()
|
|
117
|
+
}
|
|
118
|
+
];
|
|
119
|
+
export {
|
|
120
|
+
i18nOperations
|
|
121
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import '../transport.js';
|
|
2
|
+
import '../schemas/pagination.js';
|
|
3
|
+
import '../resources/index.js';
|
|
4
|
+
import '../resources/metrics.js';
|
|
5
|
+
import '../resources/events.js';
|
|
6
|
+
import '../resources/ops.js';
|
|
7
|
+
import '../resources/projects.js';
|
|
8
|
+
import '../resources/i18n.js';
|
|
9
|
+
import '../resources/attributes.js';
|
|
10
|
+
import '../resources/gates.js';
|
|
11
|
+
import '../resources/killswitches.js';
|
|
12
|
+
import '../resources/experiments.js';
|
|
13
|
+
import '../resources/configs.js';
|
|
14
|
+
import '../resources/universes.js';
|
|
15
|
+
import '../resources/alert-rules.js';
|
|
16
|
+
import { Operation } from './types.js';
|
|
17
|
+
export { CliContext, CommandLike, McpTool, OpExample, OpInput, Param, ParamType, opCli, opId, opMcpName } from './types.js';
|
|
18
|
+
export { coerceInput } from './coerce.js';
|
|
19
|
+
export { mountOperations } from './cli-adapter.js';
|
|
20
|
+
export { operationsToDispatch, operationsToMcpTools } from './mcp-adapter.js';
|
|
21
|
+
export { renderOperationsMarkdown } from './docs.js';
|
|
22
|
+
export { gateOperations } from './gates.js';
|
|
23
|
+
export { killswitchOperations } from './killswitches.js';
|
|
24
|
+
export { configOperations } from './configs.js';
|
|
25
|
+
export { experimentOperations } from './experiments.js';
|
|
26
|
+
export { universeOperations } from './universes.js';
|
|
27
|
+
export { METRIC_GRAMMAR, metricOperations } from './metrics.js';
|
|
28
|
+
export { eventOperations } from './events.js';
|
|
29
|
+
export { opsOperations } from './ops.js';
|
|
30
|
+
export { projectOperations } from './projects.js';
|
|
31
|
+
export { i18nOperations } from './i18n.js';
|
|
32
|
+
export { attributeOperations } from './attributes.js';
|
|
33
|
+
export { docsOperations } from './sdk-docs.js';
|
|
34
|
+
import '../schemas/gates.js';
|
|
35
|
+
import '../schemas/universes.js';
|
|
36
|
+
import 'zod';
|
|
37
|
+
import 'zod/v4/core';
|
|
38
|
+
import '../schemas/alert-rules.js';
|
|
39
|
+
import '../schemas/killswitches.js';
|
|
40
|
+
import '../schemas/configs.js';
|
|
41
|
+
import '../schemas/experiments.js';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Operation registry + surface adapters.
|
|
45
|
+
*
|
|
46
|
+
* One declarative `Operation[]` per resource drives three surfaces:
|
|
47
|
+
* - CLI — `mountOperations(group, ops, ctx)` builds commander subcommands.
|
|
48
|
+
* - MCP — `operationsToMcpTools(ops)` + `operationsToDispatch(ops)`.
|
|
49
|
+
* - Docs — `renderOperationsMarkdown(ops)`.
|
|
50
|
+
*
|
|
51
|
+
* The `release` module was the pilot; the registry now spans the whole
|
|
52
|
+
* migratable surface (doc 21 §A2/§A3): metrics, events, ops (queue + alert
|
|
53
|
+
* rules), projects, i18n (API parts), attributes, and SDK-docs. What stays
|
|
54
|
+
* permanently hand-written in the fs-having consumers: i18n fs/AST ops, SDK key
|
|
55
|
+
* minting, `detect_project`, and auth login/logout/bind.
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
/** The `release` module — feature flags, kill switches, configs, experiments, universes. */
|
|
59
|
+
declare const RELEASE_OPERATIONS: Operation[];
|
|
60
|
+
/** Every operation across every registry-driven module. Adapters iterate this. */
|
|
61
|
+
declare const ALL_OPERATIONS: Operation[];
|
|
62
|
+
|
|
63
|
+
export { ALL_OPERATIONS, Operation, RELEASE_OPERATIONS };
|