@nebutra/contracts 0.1.2 → 2.0.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/.turbo/turbo-build.log +44 -34
- package/.turbo/turbo-test.log +15 -0
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +11 -0
- package/dist/admin.d.ts +416 -0
- package/dist/admin.js +51 -0
- package/dist/admin.js.map +1 -0
- package/dist/chunk-ERZTZ3PW.js +257 -0
- package/dist/chunk-ERZTZ3PW.js.map +1 -0
- package/dist/chunk-PU65L2HQ.js +218 -0
- package/dist/chunk-PU65L2HQ.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +107 -1
- package/dist/notifications.d.ts +1 -1
- package/dist/sleptons.d.ts +510 -0
- package/dist/sleptons.js +61 -0
- package/dist/sleptons.js.map +1 -0
- package/package.json +18 -3
- package/src/__tests__/admin.test.ts +120 -0
- package/src/admin.ts +297 -0
- package/src/index.ts +2 -0
- package/src/sleptons.test.ts +62 -0
- package/src/sleptons.ts +242 -0
- package/tsup.config.ts +2 -0
- package/vitest.config.ts +10 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,37 +1,47 @@
|
|
|
1
1
|
|
|
2
|
-
> @nebutra/contracts@0.
|
|
2
|
+
> @nebutra/contracts@2.0.0 build /home/runner/work/Nebutra-Sailor/Nebutra-Sailor/packages/commerce/contracts
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
5
|
+
[34mCLI[39m Building entry: src/admin.ts, src/billing.ts, src/events.ts, src/identity.ts, src/index.ts, src/notifications.ts, src/sleptons.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.5.1
|
|
8
|
+
[34mCLI[39m Using tsup config: /home/runner/work/Nebutra-Sailor/Nebutra-Sailor/packages/commerce/contracts/tsup.config.ts
|
|
9
|
+
[34mCLI[39m Target: es2022
|
|
10
|
+
[34mCLI[39m Cleaning output folder
|
|
11
|
+
[34mESM[39m Build start
|
|
12
|
+
[32mESM[39m [1mdist/admin.js [22m[32m1.04 KB[39m
|
|
13
|
+
[32mESM[39m [1mdist/billing.js [22m[32m332.00 B[39m
|
|
14
|
+
[32mESM[39m [1mdist/events.js [22m[32m173.00 B[39m
|
|
15
|
+
[32mESM[39m [1mdist/identity.js [22m[32m563.00 B[39m
|
|
16
|
+
[32mESM[39m [1mdist/index.js [22m[32m4.36 KB[39m
|
|
17
|
+
[32mESM[39m [1mdist/chunk-ERZTZ3PW.js [22m[32m8.13 KB[39m
|
|
18
|
+
[32mESM[39m [1mdist/chunk-NFJTVIKD.js [22m[32m1.32 KB[39m
|
|
19
|
+
[32mESM[39m [1mdist/chunk-2NXI4PJM.js [22m[32m565.00 B[39m
|
|
20
|
+
[32mESM[39m [1mdist/chunk-5JNQ2KAT.js [22m[32m2.07 KB[39m
|
|
21
|
+
[32mESM[39m [1mdist/notifications.js [22m[32m1.11 KB[39m
|
|
22
|
+
[32mESM[39m [1mdist/chunk-F4BR76CX.js [22m[32m2.91 KB[39m
|
|
23
|
+
[32mESM[39m [1mdist/sleptons.js [22m[32m1.40 KB[39m
|
|
24
|
+
[32mESM[39m [1mdist/chunk-PU65L2HQ.js [22m[32m6.74 KB[39m
|
|
25
|
+
[32mESM[39m [1mdist/admin.js.map [22m[32m71.00 B[39m
|
|
26
|
+
[32mESM[39m [1mdist/billing.js.map [22m[32m71.00 B[39m
|
|
27
|
+
[32mESM[39m [1mdist/events.js.map [22m[32m71.00 B[39m
|
|
28
|
+
[32mESM[39m [1mdist/identity.js.map [22m[32m71.00 B[39m
|
|
29
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m71.00 B[39m
|
|
30
|
+
[32mESM[39m [1mdist/chunk-ERZTZ3PW.js.map [22m[32m16.58 KB[39m
|
|
31
|
+
[32mESM[39m [1mdist/chunk-NFJTVIKD.js.map [22m[32m2.78 KB[39m
|
|
32
|
+
[32mESM[39m [1mdist/chunk-2NXI4PJM.js.map [22m[32m1.16 KB[39m
|
|
33
|
+
[32mESM[39m [1mdist/chunk-5JNQ2KAT.js.map [22m[32m4.47 KB[39m
|
|
34
|
+
[32mESM[39m [1mdist/notifications.js.map [22m[32m71.00 B[39m
|
|
35
|
+
[32mESM[39m [1mdist/chunk-F4BR76CX.js.map [22m[32m6.05 KB[39m
|
|
36
|
+
[32mESM[39m [1mdist/sleptons.js.map [22m[32m71.00 B[39m
|
|
37
|
+
[32mESM[39m [1mdist/chunk-PU65L2HQ.js.map [22m[32m14.02 KB[39m
|
|
38
|
+
[32mESM[39m ⚡️ Build success in 94ms
|
|
39
|
+
[34mDTS[39m Build start
|
|
40
|
+
[32mDTS[39m ⚡️ Build success in 22232ms
|
|
41
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m3.15 KB[39m
|
|
42
|
+
[32mDTS[39m [1mdist/admin.d.ts [22m[32m14.76 KB[39m
|
|
43
|
+
[32mDTS[39m [1mdist/billing.d.ts [22m[32m2.11 KB[39m
|
|
44
|
+
[32mDTS[39m [1mdist/events.d.ts [22m[32m1020.00 B[39m
|
|
45
|
+
[32mDTS[39m [1mdist/identity.d.ts [22m[32m4.03 KB[39m
|
|
46
|
+
[32mDTS[39m [1mdist/notifications.d.ts [22m[32m6.09 KB[39m
|
|
47
|
+
[32mDTS[39m [1mdist/sleptons.d.ts [22m[32m21.11 KB[39m
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
> @nebutra/contracts@2.0.0 test /home/runner/work/Nebutra-Sailor/Nebutra-Sailor/packages/commerce/contracts
|
|
3
|
+
> vitest run
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[1m[30m[46m RUN [49m[39m[22m [36mv4.1.4 [39m[90m/home/runner/work/Nebutra-Sailor/Nebutra-Sailor/packages/commerce/contracts[39m
|
|
7
|
+
|
|
8
|
+
[32m✓[39m src/__tests__/admin.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 91[2mms[22m[39m
|
|
9
|
+
[32m✓[39m src/sleptons.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 50[2mms[22m[39m
|
|
10
|
+
|
|
11
|
+
[2m Test Files [22m [1m[32m2 passed[39m[22m[90m (2)[39m
|
|
12
|
+
[2m Tests [22m [1m[32m11 passed[39m[22m[90m (11)[39m
|
|
13
|
+
[2m Start at [22m 02:31:07
|
|
14
|
+
[2m Duration [22m 1.49s[2m (transform 388ms, setup 0ms, import 1.34s, tests 141ms, environment 0ms)[22m
|
|
15
|
+
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @nebutra/contracts
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#541](https://github.com/Nebutra/Nebutra-Sailor/pull/541) [`a29746f`](https://github.com/Nebutra/Nebutra-Sailor/commit/a29746fdd9eabdfb9c1692a2dc43fc7d5810779c) Thanks [@TsekaLuk](https://github.com/TsekaLuk)! - Sleptons résumé R0: schema, storage, and owner read/write.
|
|
8
|
+
- `@nebutra/contracts/sleptons` — `ResumeContentV1Schema` (the structured "track record" attached to a member profile), `ResumeWriteSchema`, `ResumeDerivedSchema`. Additive subpath export; nothing else in the package changes.
|
|
9
|
+
- `@nebutra/db` — `SleptonsResume` model + `ResumeLang` enum (migration `20260907000000_sleptons_resume`), 1:1 on `sleptons_member_profiles`, cascade delete. Not tenant-scoped, same as the other Sleptons tables.
|
|
10
|
+
- `@nebutra/sleptons` — `GET/PUT /api/resume` for the signed-in member: validate → derive (`headline`, `skills_flat`, `highlights`, `years_active`, `completeness`) → upsert. Plus a one-time importer for legacy CVise JSON exports.
|
|
11
|
+
|
|
12
|
+
Spec: `docs/superpowers/specs/2026-09-07-sleptons-resume-system-design.md`.
|
|
13
|
+
|
|
3
14
|
## 0.1.2
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/admin.d.ts
ADDED
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Admin Contract — `nebutra.admin/v1`.
|
|
5
|
+
*
|
|
6
|
+
* Every Nebutra SaaS exposes one manifest describing the admin surface it
|
|
7
|
+
* owns: resources (nouns), actions (audited verbs, plan → apply), signals
|
|
8
|
+
* (probed facts) and policies (actions the system runs by itself). The
|
|
9
|
+
* platform admin renders any product from its manifest; an agent derives
|
|
10
|
+
* tools from it. Nothing product-specific lives in the renderer.
|
|
11
|
+
*
|
|
12
|
+
* See docs/plans/2026-09-08-admin-of-admins-model.md.
|
|
13
|
+
*/
|
|
14
|
+
declare const ADMIN_CONTRACT_VERSION: "nebutra.admin/v1";
|
|
15
|
+
/** One status vocabulary. `unknown` is first-class and never renders green. */
|
|
16
|
+
declare const AdminStatusSchema: z.ZodEnum<{
|
|
17
|
+
healthy: "healthy";
|
|
18
|
+
degraded: "degraded";
|
|
19
|
+
down: "down";
|
|
20
|
+
unknown: "unknown";
|
|
21
|
+
}>;
|
|
22
|
+
type AdminStatus = z.infer<typeof AdminStatusSchema>;
|
|
23
|
+
/** One role ladder; product roles map onto it, staff grants mean the same everywhere. */
|
|
24
|
+
declare const StaffRoleSchema: z.ZodEnum<{
|
|
25
|
+
platform_readonly: "platform_readonly";
|
|
26
|
+
platform_support: "platform_support";
|
|
27
|
+
platform_operator: "platform_operator";
|
|
28
|
+
platform_owner: "platform_owner";
|
|
29
|
+
}>;
|
|
30
|
+
type StaffRole = z.infer<typeof StaffRoleSchema>;
|
|
31
|
+
declare const STAFF_ROLE_RANK: Record<StaffRole, number>;
|
|
32
|
+
declare function roleAtLeast(role: StaffRole, required: StaffRole): boolean;
|
|
33
|
+
declare const AdminSeveritySchema: z.ZodEnum<{
|
|
34
|
+
info: "info";
|
|
35
|
+
warn: "warn";
|
|
36
|
+
critical: "critical";
|
|
37
|
+
}>;
|
|
38
|
+
type AdminSeverity = z.infer<typeof AdminSeveritySchema>;
|
|
39
|
+
/** The canonical eleven. A product declares the subset it has. */
|
|
40
|
+
declare const AdminDomainIdSchema: z.ZodEnum<{
|
|
41
|
+
identity: "identity";
|
|
42
|
+
access: "access";
|
|
43
|
+
commerce: "commerce";
|
|
44
|
+
usage: "usage";
|
|
45
|
+
catalog: "catalog";
|
|
46
|
+
operations: "operations";
|
|
47
|
+
integrations: "integrations";
|
|
48
|
+
trust: "trust";
|
|
49
|
+
support: "support";
|
|
50
|
+
growth: "growth";
|
|
51
|
+
settings: "settings";
|
|
52
|
+
supply: "supply";
|
|
53
|
+
}>;
|
|
54
|
+
type AdminDomainId = z.infer<typeof AdminDomainIdSchema>;
|
|
55
|
+
declare const AdminColumnSchema: z.ZodObject<{
|
|
56
|
+
key: z.ZodString;
|
|
57
|
+
label: z.ZodString;
|
|
58
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
59
|
+
number: "number";
|
|
60
|
+
text: "text";
|
|
61
|
+
mono: "mono";
|
|
62
|
+
status: "status";
|
|
63
|
+
badge: "badge";
|
|
64
|
+
time: "time";
|
|
65
|
+
link: "link";
|
|
66
|
+
}>>;
|
|
67
|
+
align: z.ZodDefault<z.ZodEnum<{
|
|
68
|
+
start: "start";
|
|
69
|
+
end: "end";
|
|
70
|
+
}>>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
type AdminColumn = z.infer<typeof AdminColumnSchema>;
|
|
73
|
+
declare const AdminResourceSchema: z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
label: z.ZodString;
|
|
76
|
+
list: z.ZodString;
|
|
77
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
78
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
79
|
+
key: z.ZodString;
|
|
80
|
+
label: z.ZodString;
|
|
81
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
82
|
+
number: "number";
|
|
83
|
+
text: "text";
|
|
84
|
+
mono: "mono";
|
|
85
|
+
status: "status";
|
|
86
|
+
badge: "badge";
|
|
87
|
+
time: "time";
|
|
88
|
+
link: "link";
|
|
89
|
+
}>>;
|
|
90
|
+
align: z.ZodDefault<z.ZodEnum<{
|
|
91
|
+
start: "start";
|
|
92
|
+
end: "end";
|
|
93
|
+
}>>;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
key: z.ZodDefault<z.ZodString>;
|
|
96
|
+
search: z.ZodDefault<z.ZodBoolean>;
|
|
97
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
type AdminResource = z.infer<typeof AdminResourceSchema>;
|
|
100
|
+
declare const AdminActionSchema: z.ZodObject<{
|
|
101
|
+
id: z.ZodString;
|
|
102
|
+
verb: z.ZodString;
|
|
103
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
104
|
+
role: z.ZodEnum<{
|
|
105
|
+
platform_readonly: "platform_readonly";
|
|
106
|
+
platform_support: "platform_support";
|
|
107
|
+
platform_operator: "platform_operator";
|
|
108
|
+
platform_owner: "platform_owner";
|
|
109
|
+
}>;
|
|
110
|
+
url: z.ZodString;
|
|
111
|
+
plan: z.ZodDefault<z.ZodBoolean>;
|
|
112
|
+
destructive: z.ZodDefault<z.ZodBoolean>;
|
|
113
|
+
input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
114
|
+
description: z.ZodOptional<z.ZodString>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
type AdminAction = z.infer<typeof AdminActionSchema>;
|
|
117
|
+
declare const AdminSignalSchema: z.ZodObject<{
|
|
118
|
+
id: z.ZodString;
|
|
119
|
+
label: z.ZodString;
|
|
120
|
+
severity: z.ZodEnum<{
|
|
121
|
+
info: "info";
|
|
122
|
+
warn: "warn";
|
|
123
|
+
critical: "critical";
|
|
124
|
+
}>;
|
|
125
|
+
probe: z.ZodString;
|
|
126
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
127
|
+
action: z.ZodOptional<z.ZodString>;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
type AdminSignal = z.infer<typeof AdminSignalSchema>;
|
|
130
|
+
declare const AdminPolicySchema: z.ZodObject<{
|
|
131
|
+
id: z.ZodString;
|
|
132
|
+
label: z.ZodString;
|
|
133
|
+
on: z.ZodString;
|
|
134
|
+
runs: z.ZodString;
|
|
135
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
136
|
+
intent: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
type AdminPolicy = z.infer<typeof AdminPolicySchema>;
|
|
139
|
+
declare const AdminDomainSchema: z.ZodObject<{
|
|
140
|
+
id: z.ZodEnum<{
|
|
141
|
+
identity: "identity";
|
|
142
|
+
access: "access";
|
|
143
|
+
commerce: "commerce";
|
|
144
|
+
usage: "usage";
|
|
145
|
+
catalog: "catalog";
|
|
146
|
+
operations: "operations";
|
|
147
|
+
integrations: "integrations";
|
|
148
|
+
trust: "trust";
|
|
149
|
+
support: "support";
|
|
150
|
+
growth: "growth";
|
|
151
|
+
settings: "settings";
|
|
152
|
+
supply: "supply";
|
|
153
|
+
}>;
|
|
154
|
+
label: z.ZodString;
|
|
155
|
+
resources: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
label: z.ZodString;
|
|
158
|
+
list: z.ZodString;
|
|
159
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
160
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
161
|
+
key: z.ZodString;
|
|
162
|
+
label: z.ZodString;
|
|
163
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
164
|
+
number: "number";
|
|
165
|
+
text: "text";
|
|
166
|
+
mono: "mono";
|
|
167
|
+
status: "status";
|
|
168
|
+
badge: "badge";
|
|
169
|
+
time: "time";
|
|
170
|
+
link: "link";
|
|
171
|
+
}>>;
|
|
172
|
+
align: z.ZodDefault<z.ZodEnum<{
|
|
173
|
+
start: "start";
|
|
174
|
+
end: "end";
|
|
175
|
+
}>>;
|
|
176
|
+
}, z.core.$strip>>;
|
|
177
|
+
key: z.ZodDefault<z.ZodString>;
|
|
178
|
+
search: z.ZodDefault<z.ZodBoolean>;
|
|
179
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
180
|
+
}, z.core.$strip>>>;
|
|
181
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
182
|
+
id: z.ZodString;
|
|
183
|
+
verb: z.ZodString;
|
|
184
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
185
|
+
role: z.ZodEnum<{
|
|
186
|
+
platform_readonly: "platform_readonly";
|
|
187
|
+
platform_support: "platform_support";
|
|
188
|
+
platform_operator: "platform_operator";
|
|
189
|
+
platform_owner: "platform_owner";
|
|
190
|
+
}>;
|
|
191
|
+
url: z.ZodString;
|
|
192
|
+
plan: z.ZodDefault<z.ZodBoolean>;
|
|
193
|
+
destructive: z.ZodDefault<z.ZodBoolean>;
|
|
194
|
+
input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
195
|
+
description: z.ZodOptional<z.ZodString>;
|
|
196
|
+
}, z.core.$strip>>>;
|
|
197
|
+
signals: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
198
|
+
id: z.ZodString;
|
|
199
|
+
label: z.ZodString;
|
|
200
|
+
severity: z.ZodEnum<{
|
|
201
|
+
info: "info";
|
|
202
|
+
warn: "warn";
|
|
203
|
+
critical: "critical";
|
|
204
|
+
}>;
|
|
205
|
+
probe: z.ZodString;
|
|
206
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
207
|
+
action: z.ZodOptional<z.ZodString>;
|
|
208
|
+
}, z.core.$strip>>>;
|
|
209
|
+
policies: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
210
|
+
id: z.ZodString;
|
|
211
|
+
label: z.ZodString;
|
|
212
|
+
on: z.ZodString;
|
|
213
|
+
runs: z.ZodString;
|
|
214
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
215
|
+
intent: z.ZodOptional<z.ZodString>;
|
|
216
|
+
}, z.core.$strip>>>;
|
|
217
|
+
slot: z.ZodOptional<z.ZodString>;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
type AdminDomain = z.infer<typeof AdminDomainSchema>;
|
|
220
|
+
declare const AdminManifestSchema: z.ZodObject<{
|
|
221
|
+
contract: z.ZodLiteral<"nebutra.admin/v1">;
|
|
222
|
+
product: z.ZodString;
|
|
223
|
+
label: z.ZodString;
|
|
224
|
+
version: z.ZodString;
|
|
225
|
+
origin: z.ZodString;
|
|
226
|
+
graph: z.ZodEnum<{
|
|
227
|
+
core: "core";
|
|
228
|
+
runtime: "runtime";
|
|
229
|
+
labs: "labs";
|
|
230
|
+
}>;
|
|
231
|
+
status: z.ZodEnum<{
|
|
232
|
+
stable: "stable";
|
|
233
|
+
foundation: "foundation";
|
|
234
|
+
wip: "wip";
|
|
235
|
+
experimental: "experimental";
|
|
236
|
+
}>;
|
|
237
|
+
health: z.ZodString;
|
|
238
|
+
audit: z.ZodOptional<z.ZodString>;
|
|
239
|
+
domains: z.ZodArray<z.ZodObject<{
|
|
240
|
+
id: z.ZodEnum<{
|
|
241
|
+
identity: "identity";
|
|
242
|
+
access: "access";
|
|
243
|
+
commerce: "commerce";
|
|
244
|
+
usage: "usage";
|
|
245
|
+
catalog: "catalog";
|
|
246
|
+
operations: "operations";
|
|
247
|
+
integrations: "integrations";
|
|
248
|
+
trust: "trust";
|
|
249
|
+
support: "support";
|
|
250
|
+
growth: "growth";
|
|
251
|
+
settings: "settings";
|
|
252
|
+
supply: "supply";
|
|
253
|
+
}>;
|
|
254
|
+
label: z.ZodString;
|
|
255
|
+
resources: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
256
|
+
id: z.ZodString;
|
|
257
|
+
label: z.ZodString;
|
|
258
|
+
list: z.ZodString;
|
|
259
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
260
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
261
|
+
key: z.ZodString;
|
|
262
|
+
label: z.ZodString;
|
|
263
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
264
|
+
number: "number";
|
|
265
|
+
text: "text";
|
|
266
|
+
mono: "mono";
|
|
267
|
+
status: "status";
|
|
268
|
+
badge: "badge";
|
|
269
|
+
time: "time";
|
|
270
|
+
link: "link";
|
|
271
|
+
}>>;
|
|
272
|
+
align: z.ZodDefault<z.ZodEnum<{
|
|
273
|
+
start: "start";
|
|
274
|
+
end: "end";
|
|
275
|
+
}>>;
|
|
276
|
+
}, z.core.$strip>>;
|
|
277
|
+
key: z.ZodDefault<z.ZodString>;
|
|
278
|
+
search: z.ZodDefault<z.ZodBoolean>;
|
|
279
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
280
|
+
}, z.core.$strip>>>;
|
|
281
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
282
|
+
id: z.ZodString;
|
|
283
|
+
verb: z.ZodString;
|
|
284
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
285
|
+
role: z.ZodEnum<{
|
|
286
|
+
platform_readonly: "platform_readonly";
|
|
287
|
+
platform_support: "platform_support";
|
|
288
|
+
platform_operator: "platform_operator";
|
|
289
|
+
platform_owner: "platform_owner";
|
|
290
|
+
}>;
|
|
291
|
+
url: z.ZodString;
|
|
292
|
+
plan: z.ZodDefault<z.ZodBoolean>;
|
|
293
|
+
destructive: z.ZodDefault<z.ZodBoolean>;
|
|
294
|
+
input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
295
|
+
description: z.ZodOptional<z.ZodString>;
|
|
296
|
+
}, z.core.$strip>>>;
|
|
297
|
+
signals: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
298
|
+
id: z.ZodString;
|
|
299
|
+
label: z.ZodString;
|
|
300
|
+
severity: z.ZodEnum<{
|
|
301
|
+
info: "info";
|
|
302
|
+
warn: "warn";
|
|
303
|
+
critical: "critical";
|
|
304
|
+
}>;
|
|
305
|
+
probe: z.ZodString;
|
|
306
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
307
|
+
action: z.ZodOptional<z.ZodString>;
|
|
308
|
+
}, z.core.$strip>>>;
|
|
309
|
+
policies: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
310
|
+
id: z.ZodString;
|
|
311
|
+
label: z.ZodString;
|
|
312
|
+
on: z.ZodString;
|
|
313
|
+
runs: z.ZodString;
|
|
314
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
315
|
+
intent: z.ZodOptional<z.ZodString>;
|
|
316
|
+
}, z.core.$strip>>>;
|
|
317
|
+
slot: z.ZodOptional<z.ZodString>;
|
|
318
|
+
}, z.core.$strip>>;
|
|
319
|
+
}, z.core.$strip>;
|
|
320
|
+
type AdminManifest = z.infer<typeof AdminManifestSchema>;
|
|
321
|
+
declare const ResourceListSchema: z.ZodObject<{
|
|
322
|
+
items: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
323
|
+
total: z.ZodNumber;
|
|
324
|
+
probedAt: z.ZodOptional<z.ZodString>;
|
|
325
|
+
}, z.core.$strip>;
|
|
326
|
+
type ResourceList = z.infer<typeof ResourceListSchema>;
|
|
327
|
+
declare const ActionRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
328
|
+
mode: z.ZodLiteral<"plan">;
|
|
329
|
+
input: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
330
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
331
|
+
mode: z.ZodLiteral<"apply">;
|
|
332
|
+
input: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
333
|
+
planId: z.ZodOptional<z.ZodString>;
|
|
334
|
+
}, z.core.$strip>], "mode">;
|
|
335
|
+
type ActionRequest = z.infer<typeof ActionRequestSchema>;
|
|
336
|
+
declare const PlanDiffEntrySchema: z.ZodObject<{
|
|
337
|
+
op: z.ZodEnum<{
|
|
338
|
+
add: "add";
|
|
339
|
+
remove: "remove";
|
|
340
|
+
change: "change";
|
|
341
|
+
}>;
|
|
342
|
+
path: z.ZodString;
|
|
343
|
+
from: z.ZodOptional<z.ZodUnknown>;
|
|
344
|
+
to: z.ZodOptional<z.ZodUnknown>;
|
|
345
|
+
}, z.core.$strip>;
|
|
346
|
+
declare const ActionPlanSchema: z.ZodObject<{
|
|
347
|
+
planId: z.ZodString;
|
|
348
|
+
summary: z.ZodString;
|
|
349
|
+
diff: z.ZodArray<z.ZodObject<{
|
|
350
|
+
op: z.ZodEnum<{
|
|
351
|
+
add: "add";
|
|
352
|
+
remove: "remove";
|
|
353
|
+
change: "change";
|
|
354
|
+
}>;
|
|
355
|
+
path: z.ZodString;
|
|
356
|
+
from: z.ZodOptional<z.ZodUnknown>;
|
|
357
|
+
to: z.ZodOptional<z.ZodUnknown>;
|
|
358
|
+
}, z.core.$strip>>;
|
|
359
|
+
affected: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
360
|
+
resource: z.ZodString;
|
|
361
|
+
id: z.ZodString;
|
|
362
|
+
label: z.ZodOptional<z.ZodString>;
|
|
363
|
+
}, z.core.$strip>>>;
|
|
364
|
+
warnings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
365
|
+
expiresAt: z.ZodString;
|
|
366
|
+
}, z.core.$strip>;
|
|
367
|
+
type ActionPlan = z.infer<typeof ActionPlanSchema>;
|
|
368
|
+
declare const ActionResultSchema: z.ZodObject<{
|
|
369
|
+
auditId: z.ZodString;
|
|
370
|
+
summary: z.ZodString;
|
|
371
|
+
result: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
372
|
+
}, z.core.$strip>;
|
|
373
|
+
type ActionResult = z.infer<typeof ActionResultSchema>;
|
|
374
|
+
declare const SignalReadingSchema: z.ZodObject<{
|
|
375
|
+
id: z.ZodString;
|
|
376
|
+
status: z.ZodEnum<{
|
|
377
|
+
unknown: "unknown";
|
|
378
|
+
ok: "ok";
|
|
379
|
+
raised: "raised";
|
|
380
|
+
}>;
|
|
381
|
+
severity: z.ZodEnum<{
|
|
382
|
+
info: "info";
|
|
383
|
+
warn: "warn";
|
|
384
|
+
critical: "critical";
|
|
385
|
+
}>;
|
|
386
|
+
probedAt: z.ZodString;
|
|
387
|
+
title: z.ZodOptional<z.ZodString>;
|
|
388
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
389
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
390
|
+
action: z.ZodOptional<z.ZodString>;
|
|
391
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
392
|
+
}, z.core.$strip>;
|
|
393
|
+
type SignalReading = z.infer<typeof SignalReadingSchema>;
|
|
394
|
+
/** Standard error body for contract endpoints. */
|
|
395
|
+
declare const AdminErrorSchema: z.ZodObject<{
|
|
396
|
+
error: z.ZodObject<{
|
|
397
|
+
code: z.ZodEnum<{
|
|
398
|
+
unauthenticated: "unauthenticated";
|
|
399
|
+
forbidden: "forbidden";
|
|
400
|
+
not_found: "not_found";
|
|
401
|
+
invalid_input: "invalid_input";
|
|
402
|
+
plan_required: "plan_required";
|
|
403
|
+
plan_expired: "plan_expired";
|
|
404
|
+
upstream_unavailable: "upstream_unavailable";
|
|
405
|
+
internal: "internal";
|
|
406
|
+
}>;
|
|
407
|
+
message: z.ZodString;
|
|
408
|
+
}, z.core.$strip>;
|
|
409
|
+
}, z.core.$strip>;
|
|
410
|
+
type AdminError = z.infer<typeof AdminErrorSchema>;
|
|
411
|
+
/** Validate an apply against its action: destructive applies must reference a plan. */
|
|
412
|
+
declare function assertApplyAllowed(action: AdminAction, request: ActionRequest): AdminError | null;
|
|
413
|
+
/** Resolve a contract path against the manifest origin. */
|
|
414
|
+
declare function resolveContractUrl(manifest: Pick<AdminManifest, "origin">, path: string): string;
|
|
415
|
+
|
|
416
|
+
export { ADMIN_CONTRACT_VERSION, type ActionPlan, ActionPlanSchema, type ActionRequest, ActionRequestSchema, type ActionResult, ActionResultSchema, type AdminAction, AdminActionSchema, type AdminColumn, AdminColumnSchema, type AdminDomain, type AdminDomainId, AdminDomainIdSchema, AdminDomainSchema, type AdminError, AdminErrorSchema, type AdminManifest, AdminManifestSchema, type AdminPolicy, AdminPolicySchema, type AdminResource, AdminResourceSchema, type AdminSeverity, AdminSeveritySchema, type AdminSignal, AdminSignalSchema, type AdminStatus, AdminStatusSchema, PlanDiffEntrySchema, type ResourceList, ResourceListSchema, STAFF_ROLE_RANK, type SignalReading, SignalReadingSchema, type StaffRole, StaffRoleSchema, assertApplyAllowed, resolveContractUrl, roleAtLeast };
|
package/dist/admin.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ADMIN_CONTRACT_VERSION,
|
|
3
|
+
ActionPlanSchema,
|
|
4
|
+
ActionRequestSchema,
|
|
5
|
+
ActionResultSchema,
|
|
6
|
+
AdminActionSchema,
|
|
7
|
+
AdminColumnSchema,
|
|
8
|
+
AdminDomainIdSchema,
|
|
9
|
+
AdminDomainSchema,
|
|
10
|
+
AdminErrorSchema,
|
|
11
|
+
AdminManifestSchema,
|
|
12
|
+
AdminPolicySchema,
|
|
13
|
+
AdminResourceSchema,
|
|
14
|
+
AdminSeveritySchema,
|
|
15
|
+
AdminSignalSchema,
|
|
16
|
+
AdminStatusSchema,
|
|
17
|
+
PlanDiffEntrySchema,
|
|
18
|
+
ResourceListSchema,
|
|
19
|
+
STAFF_ROLE_RANK,
|
|
20
|
+
SignalReadingSchema,
|
|
21
|
+
StaffRoleSchema,
|
|
22
|
+
assertApplyAllowed,
|
|
23
|
+
resolveContractUrl,
|
|
24
|
+
roleAtLeast
|
|
25
|
+
} from "./chunk-ERZTZ3PW.js";
|
|
26
|
+
export {
|
|
27
|
+
ADMIN_CONTRACT_VERSION,
|
|
28
|
+
ActionPlanSchema,
|
|
29
|
+
ActionRequestSchema,
|
|
30
|
+
ActionResultSchema,
|
|
31
|
+
AdminActionSchema,
|
|
32
|
+
AdminColumnSchema,
|
|
33
|
+
AdminDomainIdSchema,
|
|
34
|
+
AdminDomainSchema,
|
|
35
|
+
AdminErrorSchema,
|
|
36
|
+
AdminManifestSchema,
|
|
37
|
+
AdminPolicySchema,
|
|
38
|
+
AdminResourceSchema,
|
|
39
|
+
AdminSeveritySchema,
|
|
40
|
+
AdminSignalSchema,
|
|
41
|
+
AdminStatusSchema,
|
|
42
|
+
PlanDiffEntrySchema,
|
|
43
|
+
ResourceListSchema,
|
|
44
|
+
STAFF_ROLE_RANK,
|
|
45
|
+
SignalReadingSchema,
|
|
46
|
+
StaffRoleSchema,
|
|
47
|
+
assertApplyAllowed,
|
|
48
|
+
resolveContractUrl,
|
|
49
|
+
roleAtLeast
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=admin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|