@meshery/schemas 1.2.7 → 1.2.8

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.mts CHANGED
@@ -50,6 +50,96 @@ export { default as RelationshipDefinitionV1Beta2OpenApiSchema } from './constru
50
50
  export { default as RelationshipDefinitionV1Alpha3OpenApiSchema } from './constructs/v1alpha3/relationship/RelationshipSchema.mjs';
51
51
  export { C as core } from './Core-CwYNKnjf.mjs';
52
52
 
53
+ /**
54
+ * Minimal structural types for the form-schema artifacts. Defined
55
+ * locally rather than imported from `@rjsf/utils` because:
56
+ * - `@meshery/schemas` should not pull a runtime UI dependency
57
+ * into consumers that just want the JSON shape.
58
+ * - The full RJSF type surface is overkill — consumers either
59
+ * pass the JSON straight to RJSF (which accepts JSON Schema
60
+ * directly) or read individual fields.
61
+ *
62
+ * Consumers wanting the strict `@rjsf/utils` type can cast at the
63
+ * call site:
64
+ * `MyForm schema={CatalogPublishRjsfSchemaV1Beta2 as RJSFSchema}`
65
+ * with their own `RJSFSchema` import from `@rjsf/utils`.
66
+ */
67
+ /**
68
+ * RJSFSchema mirrors a JSON Schema node well enough that consumers
69
+ * can navigate the structure (`.properties.foo.enum`,
70
+ * `.items.type`, …) with type-safety. It is recursive because the
71
+ * RJSF / JSON Schema model is recursive — `properties` values are
72
+ * themselves schemas, `items` is a schema, and `oneOf` / `allOf` /
73
+ * `anyOf` are arrays of schemas.
74
+ *
75
+ * It deliberately stays narrower than `@rjsf/utils`'s full type — it
76
+ * captures the fields we actually surface in canonical form schemas
77
+ * — and falls back to `unknown` for unrecognized keys so it doesn't
78
+ * pretend to enumerate every JSON-Schema vocabulary keyword.
79
+ */
80
+ type RJSFSchema = {
81
+ type?: string;
82
+ title?: string;
83
+ description?: string;
84
+ format?: string;
85
+ default?: unknown;
86
+ properties?: Record<string, RJSFSchema>;
87
+ required?: string[];
88
+ items?: RJSFSchema;
89
+ enum?: unknown[];
90
+ oneOf?: RJSFSchema[];
91
+ allOf?: RJSFSchema[];
92
+ anyOf?: RJSFSchema[];
93
+ minimum?: number;
94
+ maximum?: number;
95
+ minLength?: number;
96
+ maxLength?: number;
97
+ minItems?: number;
98
+ maxItems?: number;
99
+ uniqueItems?: boolean;
100
+ "x-rjsf-grid-area"?: number | string;
101
+ "x-encode-in-uri"?: boolean;
102
+ [key: string]: unknown;
103
+ };
104
+ type UiSchema = {
105
+ "ui:order"?: string[];
106
+ [key: string]: unknown;
107
+ };
108
+
109
+ /**
110
+ * Top-level barrel for canonical RJSF form schemas.
111
+ *
112
+ * Form schemas are authored as JSON files under
113
+ * `schemas/constructs/<version>/<construct>/forms/<action>.json` —
114
+ * co-located with the canonical OpenAPI yaml and templates that
115
+ * define the construct. This module imports those JSON files
116
+ * directly and re-exports them under the canonical
117
+ * `<Construct><Action>RjsfSchemaV<Version>` naming.
118
+ *
119
+ * - `validation/forms_test.go` (`TestFormSchemasAreSubsetOfCanonical`)
120
+ * enforces each form is a strict subset of its canonical OpenAPI
121
+ * construct.
122
+ * - `validation/forms_test.go` (`TestFormSchemasIndexExportsExist`)
123
+ * enforces every JSON file under any `forms/` directory is
124
+ * exported from this module.
125
+ *
126
+ * See `docs/form-schemas-roadmap.md` for the migration plan and
127
+ * `AGENTS.md` § Canonical RJSF form schemas for authoring conventions.
128
+ */
129
+
130
+ declare const CatalogPublishRjsfSchemaV1Beta2: RJSFSchema;
131
+ declare const CatalogPublishRjsfUiSchemaV1Beta2: UiSchema;
132
+ declare const EnvironmentCreateOrEditRjsfSchemaV1Beta3: RJSFSchema;
133
+ declare const EnvironmentCreateOrEditRjsfUiSchemaV1Beta3: UiSchema;
134
+ declare const WorkspaceCreateOrEditRjsfSchemaV1Beta3: RJSFSchema;
135
+ declare const WorkspaceCreateOrEditRjsfUiSchemaV1Beta3: UiSchema;
136
+ declare const KubernetesCredentialRjsfSchemaV1Beta1: RJSFSchema;
137
+ declare const KubernetesCredentialRjsfUiSchemaV1Beta1: UiSchema;
138
+ declare const GrafanaCredentialRjsfSchemaV1Beta1: RJSFSchema;
139
+ declare const GrafanaCredentialRjsfUiSchemaV1Beta1: UiSchema;
140
+ declare const PrometheusCredentialRjsfSchemaV1Beta1: RJSFSchema;
141
+ declare const PrometheusCredentialRjsfUiSchemaV1Beta1: UiSchema;
142
+
53
143
  declare namespace v1alpha1 {
54
144
  type CatalogData = components["schemas"]["CatalogData"];
55
145
  type Capability = components$1["schemas"];
@@ -81,6 +171,7 @@ declare namespace v1beta1 {
81
171
  type User = components$l["schemas"]["User"];
82
172
  type Workspace = components$m["schemas"]["Workspace"];
83
173
  }
174
+
84
175
  declare namespace v1beta2 {
85
176
  type Academy = components$n["schemas"]["AcademyCurricula"];
86
177
  type CatalogData = components$o["schemas"]["CatalogData"];
@@ -96,4 +187,4 @@ declare namespace v1beta2 {
96
187
  type Token = components$y["schemas"]["UserToken"];
97
188
  }
98
189
 
99
- export { v1alpha1, v1alpha2, v1beta1, v1beta2 };
190
+ export { CatalogPublishRjsfSchemaV1Beta2, CatalogPublishRjsfUiSchemaV1Beta2, EnvironmentCreateOrEditRjsfSchemaV1Beta3, EnvironmentCreateOrEditRjsfUiSchemaV1Beta3, GrafanaCredentialRjsfSchemaV1Beta1, GrafanaCredentialRjsfUiSchemaV1Beta1, KubernetesCredentialRjsfSchemaV1Beta1, KubernetesCredentialRjsfUiSchemaV1Beta1, PrometheusCredentialRjsfSchemaV1Beta1, PrometheusCredentialRjsfUiSchemaV1Beta1, WorkspaceCreateOrEditRjsfSchemaV1Beta3, WorkspaceCreateOrEditRjsfUiSchemaV1Beta3, v1alpha1, v1alpha2, v1beta1, v1beta2 };
package/dist/index.d.ts CHANGED
@@ -50,6 +50,96 @@ export { default as RelationshipDefinitionV1Beta2OpenApiSchema } from './constru
50
50
  export { default as RelationshipDefinitionV1Alpha3OpenApiSchema } from './constructs/v1alpha3/relationship/RelationshipSchema.js';
51
51
  export { C as core } from './Core-CwYNKnjf.js';
52
52
 
53
+ /**
54
+ * Minimal structural types for the form-schema artifacts. Defined
55
+ * locally rather than imported from `@rjsf/utils` because:
56
+ * - `@meshery/schemas` should not pull a runtime UI dependency
57
+ * into consumers that just want the JSON shape.
58
+ * - The full RJSF type surface is overkill — consumers either
59
+ * pass the JSON straight to RJSF (which accepts JSON Schema
60
+ * directly) or read individual fields.
61
+ *
62
+ * Consumers wanting the strict `@rjsf/utils` type can cast at the
63
+ * call site:
64
+ * `MyForm schema={CatalogPublishRjsfSchemaV1Beta2 as RJSFSchema}`
65
+ * with their own `RJSFSchema` import from `@rjsf/utils`.
66
+ */
67
+ /**
68
+ * RJSFSchema mirrors a JSON Schema node well enough that consumers
69
+ * can navigate the structure (`.properties.foo.enum`,
70
+ * `.items.type`, …) with type-safety. It is recursive because the
71
+ * RJSF / JSON Schema model is recursive — `properties` values are
72
+ * themselves schemas, `items` is a schema, and `oneOf` / `allOf` /
73
+ * `anyOf` are arrays of schemas.
74
+ *
75
+ * It deliberately stays narrower than `@rjsf/utils`'s full type — it
76
+ * captures the fields we actually surface in canonical form schemas
77
+ * — and falls back to `unknown` for unrecognized keys so it doesn't
78
+ * pretend to enumerate every JSON-Schema vocabulary keyword.
79
+ */
80
+ type RJSFSchema = {
81
+ type?: string;
82
+ title?: string;
83
+ description?: string;
84
+ format?: string;
85
+ default?: unknown;
86
+ properties?: Record<string, RJSFSchema>;
87
+ required?: string[];
88
+ items?: RJSFSchema;
89
+ enum?: unknown[];
90
+ oneOf?: RJSFSchema[];
91
+ allOf?: RJSFSchema[];
92
+ anyOf?: RJSFSchema[];
93
+ minimum?: number;
94
+ maximum?: number;
95
+ minLength?: number;
96
+ maxLength?: number;
97
+ minItems?: number;
98
+ maxItems?: number;
99
+ uniqueItems?: boolean;
100
+ "x-rjsf-grid-area"?: number | string;
101
+ "x-encode-in-uri"?: boolean;
102
+ [key: string]: unknown;
103
+ };
104
+ type UiSchema = {
105
+ "ui:order"?: string[];
106
+ [key: string]: unknown;
107
+ };
108
+
109
+ /**
110
+ * Top-level barrel for canonical RJSF form schemas.
111
+ *
112
+ * Form schemas are authored as JSON files under
113
+ * `schemas/constructs/<version>/<construct>/forms/<action>.json` —
114
+ * co-located with the canonical OpenAPI yaml and templates that
115
+ * define the construct. This module imports those JSON files
116
+ * directly and re-exports them under the canonical
117
+ * `<Construct><Action>RjsfSchemaV<Version>` naming.
118
+ *
119
+ * - `validation/forms_test.go` (`TestFormSchemasAreSubsetOfCanonical`)
120
+ * enforces each form is a strict subset of its canonical OpenAPI
121
+ * construct.
122
+ * - `validation/forms_test.go` (`TestFormSchemasIndexExportsExist`)
123
+ * enforces every JSON file under any `forms/` directory is
124
+ * exported from this module.
125
+ *
126
+ * See `docs/form-schemas-roadmap.md` for the migration plan and
127
+ * `AGENTS.md` § Canonical RJSF form schemas for authoring conventions.
128
+ */
129
+
130
+ declare const CatalogPublishRjsfSchemaV1Beta2: RJSFSchema;
131
+ declare const CatalogPublishRjsfUiSchemaV1Beta2: UiSchema;
132
+ declare const EnvironmentCreateOrEditRjsfSchemaV1Beta3: RJSFSchema;
133
+ declare const EnvironmentCreateOrEditRjsfUiSchemaV1Beta3: UiSchema;
134
+ declare const WorkspaceCreateOrEditRjsfSchemaV1Beta3: RJSFSchema;
135
+ declare const WorkspaceCreateOrEditRjsfUiSchemaV1Beta3: UiSchema;
136
+ declare const KubernetesCredentialRjsfSchemaV1Beta1: RJSFSchema;
137
+ declare const KubernetesCredentialRjsfUiSchemaV1Beta1: UiSchema;
138
+ declare const GrafanaCredentialRjsfSchemaV1Beta1: RJSFSchema;
139
+ declare const GrafanaCredentialRjsfUiSchemaV1Beta1: UiSchema;
140
+ declare const PrometheusCredentialRjsfSchemaV1Beta1: RJSFSchema;
141
+ declare const PrometheusCredentialRjsfUiSchemaV1Beta1: UiSchema;
142
+
53
143
  declare namespace v1alpha1 {
54
144
  type CatalogData = components["schemas"]["CatalogData"];
55
145
  type Capability = components$1["schemas"];
@@ -81,6 +171,7 @@ declare namespace v1beta1 {
81
171
  type User = components$l["schemas"]["User"];
82
172
  type Workspace = components$m["schemas"]["Workspace"];
83
173
  }
174
+
84
175
  declare namespace v1beta2 {
85
176
  type Academy = components$n["schemas"]["AcademyCurricula"];
86
177
  type CatalogData = components$o["schemas"]["CatalogData"];
@@ -96,4 +187,4 @@ declare namespace v1beta2 {
96
187
  type Token = components$y["schemas"]["UserToken"];
97
188
  }
98
189
 
99
- export { v1alpha1, v1alpha2, v1beta1, v1beta2 };
190
+ export { CatalogPublishRjsfSchemaV1Beta2, CatalogPublishRjsfUiSchemaV1Beta2, EnvironmentCreateOrEditRjsfSchemaV1Beta3, EnvironmentCreateOrEditRjsfUiSchemaV1Beta3, GrafanaCredentialRjsfSchemaV1Beta1, GrafanaCredentialRjsfUiSchemaV1Beta1, KubernetesCredentialRjsfSchemaV1Beta1, KubernetesCredentialRjsfUiSchemaV1Beta1, PrometheusCredentialRjsfSchemaV1Beta1, PrometheusCredentialRjsfUiSchemaV1Beta1, WorkspaceCreateOrEditRjsfSchemaV1Beta3, WorkspaceCreateOrEditRjsfUiSchemaV1Beta3, v1alpha1, v1alpha2, v1beta1, v1beta2 };