@meshery/schemas 1.3.36 → 1.3.38
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/api.d.mts +5 -39
- package/dist/api.d.ts +5 -39
- package/dist/api.js +2 -2
- package/dist/api.mjs +2 -2
- package/dist/cloudApi.d.mts +1 -1
- package/dist/cloudApi.d.ts +1 -1
- package/dist/cloudApi.js +1 -1
- package/dist/cloudApi.mjs +1 -1
- package/dist/constructs/v1alpha1/core/Core.d.ts +9 -0
- package/dist/constructs/v1alpha1/core/CoreSchema.js +1 -1
- package/dist/constructs/v1alpha1/core/CoreSchema.mjs +1 -1
- package/dist/constructs/v1alpha2/catalog/Catalog.d.ts +2 -2
- package/dist/constructs/v1alpha2/catalog/CatalogSchema.js +1 -1
- package/dist/constructs/v1alpha2/catalog/CatalogSchema.mjs +1 -1
- package/dist/constructs/v1beta2/core/Core.d.ts +9 -0
- package/dist/constructs/v1beta2/core/CoreSchema.js +1 -1
- package/dist/constructs/v1beta2/core/CoreSchema.mjs +1 -1
- package/dist/constructs/v1beta2/organization/Organization.d.ts +90 -0
- package/dist/constructs/v1beta2/organization/OrganizationSchema.js +1 -1
- package/dist/constructs/v1beta2/organization/OrganizationSchema.mjs +1 -1
- package/dist/constructs/v1beta2/team/Team.d.ts +81 -0
- package/dist/constructs/v1beta2/team/TeamSchema.js +1 -1
- package/dist/constructs/v1beta2/team/TeamSchema.mjs +1 -1
- package/dist/constructs/v1beta2/user/User.d.ts +90 -0
- package/dist/constructs/v1beta2/user/UserSchema.js +1 -1
- package/dist/constructs/v1beta2/user/UserSchema.mjs +1 -1
- package/dist/index.d.mts +20 -2
- package/dist/index.d.ts +20 -2
- package/dist/mesheryApi.d.mts +1 -1
- package/dist/mesheryApi.d.ts +1 -1
- package/dist/mesheryApi.js +1 -1
- package/dist/mesheryApi.mjs +1 -1
- package/dist/meshkitError-Dfcgbi6X.d.mts +71 -0
- package/dist/meshkitError-Dfcgbi6X.d.ts +71 -0
- package/package.json +3 -2
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { FetchBaseQueryError, BaseQueryFn } from '@reduxjs/toolkit/query/react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Pure MeshKit error-envelope handling, deliberately isolated from the
|
|
5
|
+
* React-coupled RTK Query runtime in {@link ./api}.
|
|
6
|
+
*
|
|
7
|
+
* `./api` value-imports `createApi`/`fetchBaseQuery` from
|
|
8
|
+
* `@reduxjs/toolkit/query/react`, whose entry point transitively requires
|
|
9
|
+
* `react-redux` (and `react`) — peer dependencies that are present in a
|
|
10
|
+
* consuming UI but not installed in this schema repo's test/CI environment.
|
|
11
|
+
* Keeping this module's only RTK dependency an `import type` (fully erased at
|
|
12
|
+
* runtime) lets {@link withMeshkitErrorTransform} be exercised under Node's
|
|
13
|
+
* native TypeScript test runner without pulling in that runtime graph. `./api`
|
|
14
|
+
* re-exports this surface so package consumers see no change.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Structured MeshKit error metadata extracted from a non-2xx JSON response body.
|
|
18
|
+
*
|
|
19
|
+
* Field names are JS-side camelCase, matching the server's camelCase wire
|
|
20
|
+
* fields one-to-one. Pairs with the meshery server migration that promotes
|
|
21
|
+
* every non-2xx response from `text/plain` to `application/json` with a MeshKit
|
|
22
|
+
* error envelope.
|
|
23
|
+
*/
|
|
24
|
+
interface MeshkitError {
|
|
25
|
+
/** Human-readable short description (`error` on the wire). */
|
|
26
|
+
message: string;
|
|
27
|
+
/** Structured error code, e.g. `meshery-server-1033`. */
|
|
28
|
+
code?: string;
|
|
29
|
+
/** Severity level, e.g. `ERROR`, `WARNING`, `FATAL`. */
|
|
30
|
+
severity?: string;
|
|
31
|
+
/** Probable causes that produced the error (`probableCause` on the wire). */
|
|
32
|
+
probableCause?: string[];
|
|
33
|
+
/** Suggested remediations to recover (`suggestedRemediation` on the wire). */
|
|
34
|
+
suggestedRemediation?: string[];
|
|
35
|
+
/** Long-form description lines (`longDescription` on the wire). */
|
|
36
|
+
longDescription?: string[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Extension of {@link FetchBaseQueryError} that carries optional MeshKit
|
|
40
|
+
* metadata on `meshkit`. The raw response body is still available on `data`
|
|
41
|
+
* for backward compatibility — `meshkit` is undefined when the response was
|
|
42
|
+
* not a MeshKit JSON envelope.
|
|
43
|
+
*
|
|
44
|
+
* Defined as an intersection rather than an `interface ... extends` because
|
|
45
|
+
* `FetchBaseQueryError` is a discriminated union (HTTP status / FETCH_ERROR /
|
|
46
|
+
* PARSING_ERROR / TIMEOUT_ERROR / CUSTOM_ERROR), and TypeScript only allows
|
|
47
|
+
* extending object types with statically known members.
|
|
48
|
+
*/
|
|
49
|
+
type MeshkitFetchBaseQueryError = FetchBaseQueryError & {
|
|
50
|
+
meshkit?: MeshkitError;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Wraps a {@link BaseQueryFn} so non-2xx responses carrying a MeshKit JSON
|
|
54
|
+
* envelope have their structured fields surfaced onto `error.meshkit`.
|
|
55
|
+
*
|
|
56
|
+
* The error type widens from {@link FetchBaseQueryError} to
|
|
57
|
+
* {@link MeshkitFetchBaseQueryError} — that propagates through `createApi`'s
|
|
58
|
+
* type inference into endpoint hooks so consumers read `error?.meshkit.*`
|
|
59
|
+
* with full IntelliSense. Non-MeshKit error bodies pass through untouched
|
|
60
|
+
* (just typed under the wider error type with `meshkit` left undefined).
|
|
61
|
+
*
|
|
62
|
+
* The structured array fields are read in camelCase (the server's actual wire
|
|
63
|
+
* form), falling back to the legacy snake_case spelling only if a deployed
|
|
64
|
+
* producer still emits it. camelCase always wins when both are present.
|
|
65
|
+
*
|
|
66
|
+
* Exported for regression testing - the failure mode is invisible (optional
|
|
67
|
+
* fields silently resolve to `undefined` when the casing is wrong).
|
|
68
|
+
*/
|
|
69
|
+
declare function withMeshkitErrorTransform<Args, Result, DefinitionExtraOptions, Meta>(inner: BaseQueryFn<Args, Result, FetchBaseQueryError, DefinitionExtraOptions, Meta>): BaseQueryFn<Args, Result, MeshkitFetchBaseQueryError, DefinitionExtraOptions, Meta>;
|
|
70
|
+
|
|
71
|
+
export { type MeshkitFetchBaseQueryError as M, type MeshkitError as a, withMeshkitErrorTransform as w };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { FetchBaseQueryError, BaseQueryFn } from '@reduxjs/toolkit/query/react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Pure MeshKit error-envelope handling, deliberately isolated from the
|
|
5
|
+
* React-coupled RTK Query runtime in {@link ./api}.
|
|
6
|
+
*
|
|
7
|
+
* `./api` value-imports `createApi`/`fetchBaseQuery` from
|
|
8
|
+
* `@reduxjs/toolkit/query/react`, whose entry point transitively requires
|
|
9
|
+
* `react-redux` (and `react`) — peer dependencies that are present in a
|
|
10
|
+
* consuming UI but not installed in this schema repo's test/CI environment.
|
|
11
|
+
* Keeping this module's only RTK dependency an `import type` (fully erased at
|
|
12
|
+
* runtime) lets {@link withMeshkitErrorTransform} be exercised under Node's
|
|
13
|
+
* native TypeScript test runner without pulling in that runtime graph. `./api`
|
|
14
|
+
* re-exports this surface so package consumers see no change.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Structured MeshKit error metadata extracted from a non-2xx JSON response body.
|
|
18
|
+
*
|
|
19
|
+
* Field names are JS-side camelCase, matching the server's camelCase wire
|
|
20
|
+
* fields one-to-one. Pairs with the meshery server migration that promotes
|
|
21
|
+
* every non-2xx response from `text/plain` to `application/json` with a MeshKit
|
|
22
|
+
* error envelope.
|
|
23
|
+
*/
|
|
24
|
+
interface MeshkitError {
|
|
25
|
+
/** Human-readable short description (`error` on the wire). */
|
|
26
|
+
message: string;
|
|
27
|
+
/** Structured error code, e.g. `meshery-server-1033`. */
|
|
28
|
+
code?: string;
|
|
29
|
+
/** Severity level, e.g. `ERROR`, `WARNING`, `FATAL`. */
|
|
30
|
+
severity?: string;
|
|
31
|
+
/** Probable causes that produced the error (`probableCause` on the wire). */
|
|
32
|
+
probableCause?: string[];
|
|
33
|
+
/** Suggested remediations to recover (`suggestedRemediation` on the wire). */
|
|
34
|
+
suggestedRemediation?: string[];
|
|
35
|
+
/** Long-form description lines (`longDescription` on the wire). */
|
|
36
|
+
longDescription?: string[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Extension of {@link FetchBaseQueryError} that carries optional MeshKit
|
|
40
|
+
* metadata on `meshkit`. The raw response body is still available on `data`
|
|
41
|
+
* for backward compatibility — `meshkit` is undefined when the response was
|
|
42
|
+
* not a MeshKit JSON envelope.
|
|
43
|
+
*
|
|
44
|
+
* Defined as an intersection rather than an `interface ... extends` because
|
|
45
|
+
* `FetchBaseQueryError` is a discriminated union (HTTP status / FETCH_ERROR /
|
|
46
|
+
* PARSING_ERROR / TIMEOUT_ERROR / CUSTOM_ERROR), and TypeScript only allows
|
|
47
|
+
* extending object types with statically known members.
|
|
48
|
+
*/
|
|
49
|
+
type MeshkitFetchBaseQueryError = FetchBaseQueryError & {
|
|
50
|
+
meshkit?: MeshkitError;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Wraps a {@link BaseQueryFn} so non-2xx responses carrying a MeshKit JSON
|
|
54
|
+
* envelope have their structured fields surfaced onto `error.meshkit`.
|
|
55
|
+
*
|
|
56
|
+
* The error type widens from {@link FetchBaseQueryError} to
|
|
57
|
+
* {@link MeshkitFetchBaseQueryError} — that propagates through `createApi`'s
|
|
58
|
+
* type inference into endpoint hooks so consumers read `error?.meshkit.*`
|
|
59
|
+
* with full IntelliSense. Non-MeshKit error bodies pass through untouched
|
|
60
|
+
* (just typed under the wider error type with `meshkit` left undefined).
|
|
61
|
+
*
|
|
62
|
+
* The structured array fields are read in camelCase (the server's actual wire
|
|
63
|
+
* form), falling back to the legacy snake_case spelling only if a deployed
|
|
64
|
+
* producer still emits it. camelCase always wins when both are present.
|
|
65
|
+
*
|
|
66
|
+
* Exported for regression testing - the failure mode is invisible (optional
|
|
67
|
+
* fields silently resolve to `undefined` when the casing is wrong).
|
|
68
|
+
*/
|
|
69
|
+
declare function withMeshkitErrorTransform<Args, Result, DefinitionExtraOptions, Meta>(inner: BaseQueryFn<Args, Result, FetchBaseQueryError, DefinitionExtraOptions, Meta>): BaseQueryFn<Args, Result, MeshkitFetchBaseQueryError, DefinitionExtraOptions, Meta>;
|
|
70
|
+
|
|
71
|
+
export { type MeshkitFetchBaseQueryError as M, type MeshkitError as a, withMeshkitErrorTransform as w };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshery/schemas",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.38",
|
|
4
4
|
"description": "<p style=\"text-align:center;\" align=\"center\"><a href=\"https://meshery.io\"><picture> <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/meshery/meshery/master/.github/assets/images/readme/meshery-logo-light-text-side.svg\"> <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/meshery/meshery/master/.github/assets/images/readme/meshery-logo-dark-text-side.svg\"> <img src=\"https://raw.githubusercontent.com/meshery/meshery/master/.github/assets/images/readme/meshery-logo-dark-text-side.svg\" alt=\"Meshery Logo\" width=\"70%\" /></picture></a><br /><br /></p> <p align=\"center\"> <a href=\"https://hub.docker.com/r/meshery/meshery\" alt=\"Docker pulls\"> <img src=\"https://img.shields.io/docker/pulls/meshery/meshery.svg\" /></a> <a href=\"https://github.com/issues?q=is%3Aopen+is%3Aissue+archived%3Afalse+org%meshery+org%3Ameshery+org%3Aservice-mesh-performance+org%3Aservice-mesh-patterns+org%3A+label%3A%22help+wanted%22+\" alt=\"GitHub issues by-label\"> <img src=\"https://img.shields.io/github/issues/meshery/meshery/help%20wanted.svg?color=informational\" /></a> <a href=\"https://github.com/meshery/meshery/blob/master/LICENSE\" alt=\"LICENSE\"> <img src=\"https://img.shields.io/github/license/meshery/meshery?color=brightgreen\" /></a> <a href=\"https://artifacthub.io/packages/helm/meshery/meshery\" alt=\"Artifact Hub Meshery\"> <img src=\"https://img.shields.io/endpoint?color=brightgreen&label=Helm%20Chart&style=plastic&url=https%3A%2F%2Fartifacthub.io%2Fbadge%2Frepository%2Fartifact-hub\" /></a> <a href=\"https://goreportcard.com/report/github.com/meshery/meshery\" alt=\"Go Report Card\"> <img src=\"https://goreportcard.com/badge/github.com/meshery/meshery\" /></a> <a href=\"https://github.com/meshery/meshery/actions\" alt=\"Build Status\"> <img src=\"https://img.shields.io/github/actions/workflow/status/meshery/meshery/release-drafter.yml\" /></a> <a href=\"https://bestpractices.coreinfrastructure.org/projects/3564\" alt=\"CLI Best Practices\"> <img src=\"https://bestpractices.coreinfrastructure.org/projects/3564/badge\" /></a> <a href=\"http://discuss.meshery.io\" alt=\"Discuss Users\"> <img src=\"https://img.shields.io/discourse/users?label=discuss&logo=discourse&server=https%3A%2F%2Fdiscuss.meshery.io\" /></a> <a href=\"https://slack.meshery.io\" alt=\"Join Slack\"> <img src=\"https://img.shields.io/badge/Slack-@meshery.svg?logo=slack\" /></a> <a href=\"https://twitter.com/intent/follow?screen_name=mesheryio\" alt=\"Twitter Follow\"> <img src=\"https://img.shields.io/twitter/follow/mesheryio.svg?label=Follow+Meshery&style=social\" /></a> <a href=\"https://github.com/meshery/meshery/releases\" alt=\"Meshery Downloads\"> <img src=\"https://img.shields.io/github/downloads/meshery/meshery/total\" /></a> <!-- <a href=\"https://app.fossa.com/projects/git%2Bgithub.com%2Fmeshery%2Fmeshery?ref=badge_shield\" alt=\"License Scan Report\"> <img src=\"https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmeshery%2Fmeshery.svg?type=shield\"/></a> --> </p>",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"build:golang": "node ./build/generate-golang.js",
|
|
55
55
|
"build:rtk": "node ./build/generate-rtk.js",
|
|
56
56
|
"build:all": "node ./build/index.js all",
|
|
57
|
+
"test": "node --test \"typescript/**/*.test.ts\"",
|
|
57
58
|
"test:validate-schemas": "go test ./validation/...",
|
|
58
59
|
"generate:types": "node ./build/generate-typescript.js",
|
|
59
60
|
"generate:permissions:ts": "node ./build/generate-permissions-ts.js",
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
"csv-parse": "^6.1.0",
|
|
72
73
|
"esbuild-runner": "^2.2.2",
|
|
73
74
|
"glob": "^11.1.0",
|
|
74
|
-
"js-yaml": "^4.
|
|
75
|
+
"js-yaml": "^4.3.0",
|
|
75
76
|
"json-schema-default": "^1.0.2",
|
|
76
77
|
"json-schema-empty-strings": "^1.0.5",
|
|
77
78
|
"json-schema-faker": "^0.6.2",
|