@meshery/schemas 0.8.133 → 0.8.134
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 +119 -0
- package/dist/cloudApi.d.mts +5011 -2369
- package/dist/cloudApi.d.ts +5011 -2369
- package/dist/cloudApi.js +1 -1
- package/dist/cloudApi.mjs +1 -1
- package/dist/constructs/v1beta1/badge/Badge.d.mts +37 -18
- package/dist/constructs/v1beta1/badge/Badge.d.ts +37 -18
- package/dist/constructs/v1beta1/badge/BadgeSchema.js +1 -1
- package/dist/constructs/v1beta1/badge/BadgeSchema.mjs +1 -1
- package/dist/constructs/v1beta1/category/Category.d.mts +1 -0
- package/dist/constructs/v1beta1/category/Category.d.ts +1 -0
- package/dist/constructs/v1beta1/category/CategorySchema.js +1 -1
- package/dist/constructs/v1beta1/category/CategorySchema.mjs +1 -1
- package/dist/constructs/v1beta1/component/Component.d.mts +12 -4
- package/dist/constructs/v1beta1/component/Component.d.ts +12 -4
- package/dist/constructs/v1beta1/component/ComponentSchema.js +1 -1
- package/dist/constructs/v1beta1/component/ComponentSchema.mjs +1 -1
- package/dist/constructs/v1beta1/connection/Connection.d.mts +84 -42
- package/dist/constructs/v1beta1/connection/Connection.d.ts +84 -42
- package/dist/constructs/v1beta1/connection/ConnectionSchema.js +1 -1
- package/dist/constructs/v1beta1/connection/ConnectionSchema.mjs +1 -1
- package/dist/constructs/v1beta1/environment/Environment.d.mts +65 -22
- package/dist/constructs/v1beta1/environment/Environment.d.ts +65 -22
- package/dist/constructs/v1beta1/environment/EnvironmentSchema.js +1 -1
- package/dist/constructs/v1beta1/environment/EnvironmentSchema.mjs +1 -1
- package/dist/constructs/v1beta1/evaluation/Evaluation.d.mts +48 -16
- package/dist/constructs/v1beta1/evaluation/Evaluation.d.ts +48 -16
- package/dist/constructs/v1beta1/evaluation/EvaluationSchema.js +8 -8
- package/dist/constructs/v1beta1/evaluation/EvaluationSchema.mjs +8 -8
- package/dist/constructs/v1beta1/event/Event.d.mts +5 -3
- package/dist/constructs/v1beta1/event/Event.d.ts +5 -3
- package/dist/constructs/v1beta1/event/EventSchema.js +1 -1
- package/dist/constructs/v1beta1/event/EventSchema.mjs +1 -1
- package/dist/constructs/v1beta1/invitation/Invitation.d.mts +56 -54
- package/dist/constructs/v1beta1/invitation/Invitation.d.ts +56 -54
- package/dist/constructs/v1beta1/invitation/InvitationSchema.js +1 -1
- package/dist/constructs/v1beta1/invitation/InvitationSchema.mjs +1 -1
- package/dist/constructs/v1beta1/key/Key.d.mts +3 -3
- package/dist/constructs/v1beta1/key/Key.d.ts +3 -3
- package/dist/constructs/v1beta1/key/KeySchema.js +1 -1
- package/dist/constructs/v1beta1/key/KeySchema.mjs +1 -1
- package/dist/constructs/v1beta1/keychain/Keychain.d.mts +12 -36
- package/dist/constructs/v1beta1/keychain/Keychain.d.ts +12 -36
- package/dist/constructs/v1beta1/keychain/KeychainSchema.js +1 -1
- package/dist/constructs/v1beta1/keychain/KeychainSchema.mjs +1 -1
- package/dist/constructs/v1beta1/model/Model.d.mts +14 -6
- package/dist/constructs/v1beta1/model/Model.d.ts +14 -6
- package/dist/constructs/v1beta1/model/ModelSchema.js +2 -2
- package/dist/constructs/v1beta1/model/ModelSchema.mjs +2 -2
- package/dist/constructs/v1beta1/organization/Organization.d.mts +884 -9
- package/dist/constructs/v1beta1/organization/Organization.d.ts +884 -9
- package/dist/constructs/v1beta1/organization/OrganizationSchema.js +1 -1
- package/dist/constructs/v1beta1/organization/OrganizationSchema.mjs +1 -1
- package/dist/constructs/v1beta1/pattern/Pattern.d.mts +113 -39
- package/dist/constructs/v1beta1/pattern/Pattern.d.ts +113 -39
- package/dist/constructs/v1beta1/pattern/PatternSchema.js +18 -18
- package/dist/constructs/v1beta1/pattern/PatternSchema.mjs +18 -18
- package/dist/constructs/v1beta1/role/Role.d.mts +17 -17
- package/dist/constructs/v1beta1/role/Role.d.ts +17 -17
- package/dist/constructs/v1beta1/role/RoleSchema.js +1 -1
- package/dist/constructs/v1beta1/role/RoleSchema.mjs +1 -1
- package/dist/constructs/v1beta1/team/Team.d.mts +16 -16
- package/dist/constructs/v1beta1/team/Team.d.ts +16 -16
- package/dist/constructs/v1beta1/team/TeamSchema.js +1 -1
- package/dist/constructs/v1beta1/team/TeamSchema.mjs +1 -1
- package/dist/constructs/v1beta1/user/User.d.mts +1238 -169
- package/dist/constructs/v1beta1/user/User.d.ts +1238 -169
- package/dist/constructs/v1beta1/user/UserSchema.js +1 -1
- package/dist/constructs/v1beta1/user/UserSchema.mjs +1 -1
- package/dist/constructs/v1beta1/workspace/Workspace.d.mts +35 -12
- package/dist/constructs/v1beta1/workspace/Workspace.d.ts +35 -12
- package/dist/constructs/v1beta1/workspace/WorkspaceSchema.js +4 -4
- package/dist/constructs/v1beta1/workspace/WorkspaceSchema.mjs +4 -4
- package/dist/index.js +25 -25
- package/dist/index.mjs +25 -25
- package/dist/mesheryApi.d.mts +4226 -1565
- package/dist/mesheryApi.d.ts +4226 -1565
- package/dist/mesheryApi.js +1 -1
- package/dist/mesheryApi.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -171,6 +171,125 @@ schemas/
|
|
|
171
171
|
|
|
172
172
|
---
|
|
173
173
|
|
|
174
|
+
## Schema Design Principles: The Dual-Schema Pattern
|
|
175
|
+
|
|
176
|
+
Every persisted entity in Meshery follows a strict two-schema contract. Violating this contract causes generated Go structs and API clients to be incorrect.
|
|
177
|
+
|
|
178
|
+
### Rule 1 — Entity schema = response schema only
|
|
179
|
+
|
|
180
|
+
The `<construct>.yaml` file represents the **full server-side object** as returned in API responses. It must:
|
|
181
|
+
|
|
182
|
+
- Include **all** server-generated fields: `id`, `created_at`, `updated_at`, `deleted_at`
|
|
183
|
+
- List server-generated required fields in `required` (they are always present in responses)
|
|
184
|
+
- Have `additionalProperties: false` at the top level
|
|
185
|
+
|
|
186
|
+
```yaml
|
|
187
|
+
# keychain.yaml — response schema ✅
|
|
188
|
+
type: object
|
|
189
|
+
additionalProperties: false
|
|
190
|
+
required:
|
|
191
|
+
- id
|
|
192
|
+
- name
|
|
193
|
+
- owner
|
|
194
|
+
- created_at
|
|
195
|
+
- updated_at
|
|
196
|
+
properties:
|
|
197
|
+
id:
|
|
198
|
+
$ref: ../../v1alpha1/core/api.yml#/components/schemas/uuid
|
|
199
|
+
name:
|
|
200
|
+
type: string
|
|
201
|
+
owner:
|
|
202
|
+
$ref: ../../v1alpha1/core/api.yml#/components/schemas/uuid
|
|
203
|
+
created_at:
|
|
204
|
+
$ref: ../../v1alpha1/core/api.yml#/components/schemas/created_at
|
|
205
|
+
updated_at:
|
|
206
|
+
$ref: ../../v1alpha1/core/api.yml#/components/schemas/updated_at
|
|
207
|
+
deleted_at:
|
|
208
|
+
$ref: ../../v1alpha1/core/api.yml#/components/schemas/nullTime
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Rule 2 — Write operations use a separate `*Payload` schema
|
|
212
|
+
|
|
213
|
+
Every entity that supports `POST` or `PUT` must define a dedicated `{Entity}Payload` schema in `api.yml`. The payload schema:
|
|
214
|
+
|
|
215
|
+
- Contains **only client-settable fields** (no `created_at`, `updated_at`, `deleted_at`)
|
|
216
|
+
- Makes `id` optional with `omitempty` for upsert patterns, or omits it entirely for create-only
|
|
217
|
+
- Is referenced by `requestBody` in `POST`/`PUT` operations
|
|
218
|
+
- Is **never** reused as a response body
|
|
219
|
+
|
|
220
|
+
```yaml
|
|
221
|
+
# In api.yml — write schema ✅
|
|
222
|
+
components:
|
|
223
|
+
schemas:
|
|
224
|
+
KeychainPayload:
|
|
225
|
+
type: object
|
|
226
|
+
description: Payload for creating or updating a keychain.
|
|
227
|
+
required:
|
|
228
|
+
- name
|
|
229
|
+
properties:
|
|
230
|
+
id:
|
|
231
|
+
$ref: ../../v1alpha1/core/api.yml#/components/schemas/uuid
|
|
232
|
+
description: Existing keychain ID for updates; omit on create.
|
|
233
|
+
x-oapi-codegen-extra-tags:
|
|
234
|
+
json: "id,omitempty"
|
|
235
|
+
name:
|
|
236
|
+
type: string
|
|
237
|
+
description: Name of the keychain.
|
|
238
|
+
owner:
|
|
239
|
+
$ref: ../../v1alpha1/core/api.yml#/components/schemas/uuid
|
|
240
|
+
description: Owner UUID; set server-side from auth context if omitted.
|
|
241
|
+
x-oapi-codegen-extra-tags:
|
|
242
|
+
json: "owner,omitempty"
|
|
243
|
+
|
|
244
|
+
paths:
|
|
245
|
+
/api/auth/keychains:
|
|
246
|
+
post:
|
|
247
|
+
requestBody:
|
|
248
|
+
required: true
|
|
249
|
+
content:
|
|
250
|
+
application/json:
|
|
251
|
+
schema:
|
|
252
|
+
$ref: "#/components/schemas/KeychainPayload" # ← Payload, not Keychain
|
|
253
|
+
responses:
|
|
254
|
+
"200":
|
|
255
|
+
content:
|
|
256
|
+
application/json:
|
|
257
|
+
schema:
|
|
258
|
+
$ref: "#/components/schemas/Keychain" # ← Full entity in response
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Rule 3 — Never use the entity schema as a POST/PUT request body
|
|
262
|
+
|
|
263
|
+
Using the full entity schema as a `requestBody` forces clients to supply server-generated fields (`id`, `created_at`, `updated_at`) and produces incorrect generated client code.
|
|
264
|
+
|
|
265
|
+
```yaml
|
|
266
|
+
# ❌ Wrong — exposes server-generated required fields to clients
|
|
267
|
+
post:
|
|
268
|
+
requestBody:
|
|
269
|
+
content:
|
|
270
|
+
application/json:
|
|
271
|
+
schema:
|
|
272
|
+
$ref: "#/components/schemas/Keychain"
|
|
273
|
+
|
|
274
|
+
# ✅ Correct — separate payload type for writes
|
|
275
|
+
post:
|
|
276
|
+
requestBody:
|
|
277
|
+
content:
|
|
278
|
+
application/json:
|
|
279
|
+
schema:
|
|
280
|
+
$ref: "#/components/schemas/KeychainPayload"
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Checklist when adding a new entity
|
|
284
|
+
|
|
285
|
+
- [ ] `<construct>.yaml` has `additionalProperties: false`
|
|
286
|
+
- [ ] `<construct>.yaml` lists all server-generated fields in `properties` and `required`
|
|
287
|
+
- [ ] `api.yml` defines a `{Construct}Payload` schema with only client-settable fields
|
|
288
|
+
- [ ] All `POST`/`PUT` `requestBody` entries reference `{Construct}Payload`, not `{Construct}`
|
|
289
|
+
- [ ] `GET` responses reference the full `{Construct}` entity schema
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
174
293
|
## Naming Conventions
|
|
175
294
|
|
|
176
295
|
- Property names
|