From 9c0e709740e3e470c46bace0bf5715bb84ecca65 Mon Sep 17 00:00:00 2001 From: Yi Nuo <218099172+yi-nuo426@users.noreply.github.com> Date: Mon, 4 May 2026 22:54:02 -0500 Subject: [PATCH 1/3] flip publishCatalogItem to canonical, stage TODOs for 9 pending forms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part of the meshery/schemas#866 cascade. Once `@meshery/schemas` ships the canonical RJSF form schemas (PR meshery/schemas#867 + follow-ups), Sistent flips its hand-authored `src/schemas//schema.tsx` files to re-exports from `@meshery/schemas`. Phase 1 of #866 ships only `CatalogPublishRjsfSchemaV1Beta2` and `CatalogPublishRjsfUiSchemaV1Beta2`, so: - publishCatalogItem/{schema,uiSchema}.tsx: fully flipped to re-export from `@meshery/schemas`. The published Sistent export names (`publishCatalogItemSchema`, `publishCatalogItemUiSchema`) are unchanged; only the source flips. Consumers in `meshery` and `meshery-cloud` keep working without source changes. - The other 9 schema.tsx files (importDesign, importFilter, importModel, createAndEditEnvironment, createAndEditWorkspace, kubernetesCredential, grafanaCredential, prometheusCredential, helmConnection) are left in place but each gets a TODO header referencing #866 and the canonical name to use once Phase 2 follow-up PRs ship those forms. - helpAndSupportModal stays Sistent-local — there's no canonical construct upstream. Bumps `@sistent/sistent` to 0.22.0 (minor) to reflect the source-of- truth change for `publishCatalogItem`. The `@meshery/schemas` dependency range is unchanged (`^1.2.7`). The flipped re-export will fail to type-check until the consuming `@meshery/schemas` release ships PR #867 and exports `CatalogPublishRjsfSchemaV1Beta2` / `CatalogPublishRjsfUiSchemaV1Beta2` from its top-level index. Coordinate the dep bump (and this branch's merge) with that release. Branch is intentionally left local pending that publication. Signed-off-by: Yi Nuo <218099172+yi-nuo426@users.noreply.github.com> --- package-lock.json | 4 +- package.json | 2 +- .../createAndEditEnvironment/schema.tsx | 8 +++ src/schemas/createAndEditWorkspace/schema.tsx | 14 ++++ src/schemas/grafanaCredential/schema.tsx | 8 +++ src/schemas/helmConnection/schema.tsx | 8 +++ src/schemas/importDesign/schema.tsx | 8 +++ src/schemas/importFilter/schema.tsx | 9 +++ src/schemas/importModel/schema.tsx | 8 +++ src/schemas/kubernetesCredential/schema.tsx | 10 ++- src/schemas/prometheusCredential/schema.tsx | 8 +++ src/schemas/publishCatalogItem/schema.tsx | 72 ++++--------------- src/schemas/publishCatalogItem/uiSchema.tsx | 16 +++-- 13 files changed, 109 insertions(+), 66 deletions(-) diff --git a/package-lock.json b/package-lock.json index e242fff4a..6342037cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@sistent/sistent", - "version": "0.21.0", + "version": "0.22.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@sistent/sistent", - "version": "0.21.0", + "version": "0.22.0", "dependencies": { "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.1", diff --git a/package.json b/package.json index 53c3fb88a..b32962be4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sistent/sistent", - "version": "0.21.0", + "version": "0.22.0", "description": "Reusable React Components and SVG Icons library", "repository": { "type": "git", diff --git a/src/schemas/createAndEditEnvironment/schema.tsx b/src/schemas/createAndEditEnvironment/schema.tsx index 91b5edc4b..c821bd178 100644 --- a/src/schemas/createAndEditEnvironment/schema.tsx +++ b/src/schemas/createAndEditEnvironment/schema.tsx @@ -1,3 +1,11 @@ +// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships +// `EnvironmentCreateOrEditRjsfSchemaV1Beta3` (canonical home: +// `typescript/forms/v1beta3/environment/`), flip this file to: +// +// export { EnvironmentCreateOrEditRjsfSchemaV1Beta3 as default } from '@meshery/schemas'; +// +// The published Sistent export name (`createAndEditEnvironmentSchema`) +// MUST stay the same; only the source flips. import EnvironmentDefinitionV1Beta3OpenApiSchema from '@meshery/schemas/constructs/v1beta3/environment/EnvironmentSchema'; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/src/schemas/createAndEditWorkspace/schema.tsx b/src/schemas/createAndEditWorkspace/schema.tsx index 9cba424af..702312ae7 100644 --- a/src/schemas/createAndEditWorkspace/schema.tsx +++ b/src/schemas/createAndEditWorkspace/schema.tsx @@ -1,6 +1,20 @@ /** * Schema for create or edit workspace modals */ +// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships +// `WorkspaceCreateOrEditRjsfSchemaV1Beta3` (canonical home: +// `typescript/forms/v1beta3/workspace/`), flip this file to: +// +// export { +// WorkspaceCreateOrEditRjsfSchemaV1Beta3 as default, +// WorkspaceEditRjsfSchemaV1Beta3 as editWorkspace, +// } from '@meshery/schemas'; +// +// The published Sistent export names (`createAndEditWorkspaceSchema` +// and the named `editWorkspaceSchema`) MUST stay the same; only the +// source flips. Coordinate with the schemas PR so the canonical +// upstream ships BOTH the create-or-edit form and the relaxed +// edit-only variant. import WorkspaceDefinitionV1Beta3OpenApiSchema from '@meshery/schemas/constructs/v1beta3/workspace/WorkspaceSchema'; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/src/schemas/grafanaCredential/schema.tsx b/src/schemas/grafanaCredential/schema.tsx index 8607fbcf4..f5ec53a53 100644 --- a/src/schemas/grafanaCredential/schema.tsx +++ b/src/schemas/grafanaCredential/schema.tsx @@ -1,6 +1,14 @@ /** * Schema for creating grafana credential; */ +// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships +// `GrafanaCredentialRjsfSchemaV1Beta1` (canonical home: +// `typescript/forms/v1beta1/credential/`), flip this file to: +// +// export { GrafanaCredentialRjsfSchemaV1Beta1 as default } from '@meshery/schemas'; +// +// The published Sistent export name (`grafanaCredentialSchema`) MUST +// stay the same; only the source flips. const grafanaCredentialSchema = { type: 'object', title: 'Grafana', diff --git a/src/schemas/helmConnection/schema.tsx b/src/schemas/helmConnection/schema.tsx index 18d0798e2..1e25fc38a 100644 --- a/src/schemas/helmConnection/schema.tsx +++ b/src/schemas/helmConnection/schema.tsx @@ -2,6 +2,14 @@ * Schema for configuring Helm repository connections. This schema is designed for use in a wizard or form * where users can provide information about connecting to a Helm repository for initiating connection. */ +// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships +// `HelmConnectionRjsfSchemaV1Beta2` (canonical home: +// `typescript/forms/v1beta2/connection/`), flip this file to: +// +// export { HelmConnectionRjsfSchemaV1Beta2 as default } from '@meshery/schemas'; +// +// The published Sistent export name (`helmConnectionSchema`) MUST +// stay the same; only the source flips. const helmConnectionSchema = { type: 'object', properties: { diff --git a/src/schemas/importDesign/schema.tsx b/src/schemas/importDesign/schema.tsx index 2c026d351..3b16ed2c9 100644 --- a/src/schemas/importDesign/schema.tsx +++ b/src/schemas/importDesign/schema.tsx @@ -1,3 +1,11 @@ +// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships +// `DesignImportRjsfSchemaV1Beta3` (canonical home: `typescript/forms/v1beta3/design/`), +// flip this file to: +// +// export { DesignImportRjsfSchemaV1Beta3 as default } from '@meshery/schemas'; +// +// The published Sistent export name (`importDesignSchema`) MUST stay +// the same; only the source flips. import { DesignDefinitionV1Beta1OpenApiSchema } from '@meshery/schemas'; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/src/schemas/importFilter/schema.tsx b/src/schemas/importFilter/schema.tsx index d1204b119..97d4a7838 100644 --- a/src/schemas/importFilter/schema.tsx +++ b/src/schemas/importFilter/schema.tsx @@ -1,3 +1,12 @@ +// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships +// `FilterImportRjsfSchemaV1Beta2` (canonical home: `typescript/forms/v1beta2/catalog/` +// — filter is part of the catalog/design family per the form-schemas +// roadmap), flip this file to: +// +// export { FilterImportRjsfSchemaV1Beta2 as default } from '@meshery/schemas'; +// +// The published Sistent export name (`importFilterSchema`) MUST stay +// the same; only the source flips. const importFilterSchema = { type: 'object', properties: { diff --git a/src/schemas/importModel/schema.tsx b/src/schemas/importModel/schema.tsx index 5c8564055..7aba1c1cb 100644 --- a/src/schemas/importModel/schema.tsx +++ b/src/schemas/importModel/schema.tsx @@ -1,3 +1,11 @@ +// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships +// `ModelImportRjsfSchemaV1Beta2` (canonical home: `typescript/forms/v1beta2/model/`), +// flip this file to: +// +// export { ModelImportRjsfSchemaV1Beta2 as default } from '@meshery/schemas'; +// +// The published Sistent export name (`importModelSchema`) MUST stay +// the same; only the source flips. import ModelDefinitionV1Beta2OpenApiSchema from '@meshery/schemas/constructs/v1beta2/model/ModelSchema'; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/src/schemas/kubernetesCredential/schema.tsx b/src/schemas/kubernetesCredential/schema.tsx index b11f10ee8..1b668ab99 100644 --- a/src/schemas/kubernetesCredential/schema.tsx +++ b/src/schemas/kubernetesCredential/schema.tsx @@ -1,6 +1,14 @@ /** - * Schema for creating grafana credential; + * Schema for creating kubernetes credential. */ +// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships +// `KubernetesCredentialRjsfSchemaV1Beta1` (canonical home: +// `typescript/forms/v1beta1/credential/`), flip this file to: +// +// export { KubernetesCredentialRjsfSchemaV1Beta1 as default } from '@meshery/schemas'; +// +// The published Sistent export name (`kubernetesCredentialSchema`) +// MUST stay the same; only the source flips. const kubernetesCredentialSchema = { type: 'object', title: 'Kubernetes', diff --git a/src/schemas/prometheusCredential/schema.tsx b/src/schemas/prometheusCredential/schema.tsx index f1ecf146d..9f1a1587a 100644 --- a/src/schemas/prometheusCredential/schema.tsx +++ b/src/schemas/prometheusCredential/schema.tsx @@ -1,6 +1,14 @@ /** * Schema for creating prometheus credential; */ +// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships +// `PrometheusCredentialRjsfSchemaV1Beta1` (canonical home: +// `typescript/forms/v1beta1/credential/`), flip this file to: +// +// export { PrometheusCredentialRjsfSchemaV1Beta1 as default } from '@meshery/schemas'; +// +// The published Sistent export name (`prometheusCredentialSchema`) +// MUST stay the same; only the source flips. const prometheusCredentialSchema = { type: 'object', title: 'Prometheus', diff --git a/src/schemas/publishCatalogItem/schema.tsx b/src/schemas/publishCatalogItem/schema.tsx index 8f570b935..7460fdf4f 100644 --- a/src/schemas/publishCatalogItem/schema.tsx +++ b/src/schemas/publishCatalogItem/schema.tsx @@ -1,60 +1,18 @@ /** * Schema for publish catalog item modal; - * Can be use for publishing filters and designs + * Can be used for publishing filters and designs. + * + * Source-of-truth: re-exported from `@meshery/schemas` per the form-schema + * canonicalization tracked in + * https://github.com/meshery/schemas/issues/866 (Phase 1). + * + * The previously hand-authored object literal has moved to + * `meshery/schemas` at `typescript/forms/v1beta2/catalog/publish.json`, + * where a Go subset-validator (`validation/forms_test.go`) keeps it + * structurally aligned with the canonical OpenAPI Catalog construct. + * + * The published Sistent export name (`publishCatalogItemSchema`) is + * unchanged — only the source of the schema has flipped. Consumers in + * `meshery` and `meshery-cloud` keep working without source changes. */ -const publishCatalogItemSchema = { - type: 'object', - properties: { - compatibility: { - type: 'array', - title: 'Technology', - items: { - enum: ['kubernetes'], - type: 'string' - }, - uniqueItems: true, - minItems: 1, - description: - 'A list of technologies included in or implicated by this design; a list of relevant technology tags.', - 'x-rjsf-grid-area': 6 - }, - patternCaveats: { - type: 'string', - title: 'Caveats and Considerations', - description: - 'Specific stipulations to consider and known behaviors to be aware of when using this design.', - format: 'textarea', - 'x-rjsf-grid-area': 12, - 'x-encode-in-uri': true - }, - patternInfo: { - type: 'string', - title: 'Description', - description: 'Purpose of the design along with its intended and unintended uses.', - format: 'textarea', - 'x-rjsf-grid-area': 12, - 'x-encode-in-uri': true - }, - type: { - type: 'string', - title: 'Type', - enum: [ - 'Deployment', - 'Observability', - 'Resiliency', - 'Scaling', - 'Security', - 'Traffic-management', - 'Troubleshooting', - 'Workloads' - ], - default: 'Deployment', - description: - 'Categorization of the type of design or operational flow depicted in this design.', - 'x-rjsf-grid-area': 6 - } - }, - required: ['compatibility', 'patternCaveats', 'patternInfo', 'type'] -}; - -export default publishCatalogItemSchema; +export { CatalogPublishRjsfSchemaV1Beta2 as default } from '@meshery/schemas'; diff --git a/src/schemas/publishCatalogItem/uiSchema.tsx b/src/schemas/publishCatalogItem/uiSchema.tsx index 6fe804fac..d96731010 100644 --- a/src/schemas/publishCatalogItem/uiSchema.tsx +++ b/src/schemas/publishCatalogItem/uiSchema.tsx @@ -1,5 +1,11 @@ -const publishCatalogItemUiSchema = { - 'ui:order': ['type', 'compatibility', 'patternInfo', 'patternCaveats'] -}; - -export default publishCatalogItemUiSchema; +/** + * UI schema for publish catalog item modal. + * + * Source-of-truth: re-exported from `@meshery/schemas` per the + * form-schema canonicalization tracked in + * https://github.com/meshery/schemas/issues/866 (Phase 1). + * + * The published Sistent export name (`publishCatalogItemUiSchema`) is + * unchanged. + */ +export { CatalogPublishRjsfUiSchemaV1Beta2 as default } from '@meshery/schemas'; From 95982fb2491c8d6b5222456f94f90d50d5cd4e71 Mon Sep 17 00:00:00 2001 From: Yi Nuo <218099172+yi-nuo426@users.noreply.github.com> Date: Tue, 5 May 2026 11:50:21 -0500 Subject: [PATCH 2/3] chore(deps): bump @meshery/schemas to ^1.2.8 (form schemas land) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @meshery/schemas v1.2.8 ships the canonical RJSF form schemas under schemas/constructs///forms/, exported from the package as e.g. CatalogPublishRjsfSchemaV1Beta2. Pairs with the prior commit on this branch (9c0e7097) which flipped publishCatalogItem to re-export from @meshery/schemas. With v1.2.7 that re-export failed at TS compile time (the canonical export didn't exist yet); v1.2.8 makes it resolve cleanly. The remaining 9 forms in src/schemas/ still carry TODO headers referencing meshery/schemas#866 — they ship as canonical schemas land upstream (deferred forms tracked in meshery/schemas#868 and #869), at which point each gets the same flip. Verified -------- - npm test: 11 suites / 29 tests pass. - npm run build: tsup + dts builds green. - node -e "require('@meshery/schemas').CatalogPublishRjsfSchemaV1Beta2" resolves to a valid object with the 4 expected fields (compatibility, patternCaveats, patternInfo, type). - npx tsc --noEmit: src/schemas/ is clean. (Errors elsewhere in examples/next-16/lib/palette.ts and src/__testing__/*.test.tsx are pre-existing on master and unrelated.) Signed-off-by: Yi Nuo <218099172+yi-nuo426@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6342037cc..319ea930c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "@emotion/cache": "^11.14.0", "@eslint/eslintrc": "^3.3.5", "@eslint/js": "^10.0.1", - "@meshery/schemas": "^1.2.7", + "@meshery/schemas": "^1.2.8", "@mui/icons-material": "^9.0.0", "@mui/material": "^9.0.0", "@mui/system": "^9.0.0", @@ -3119,9 +3119,9 @@ } }, "node_modules/@meshery/schemas": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@meshery/schemas/-/schemas-1.2.7.tgz", - "integrity": "sha512-thB6yJv2wYYSWo2bxvFTciW17tvMLemN6xikQYmfw+Wz7g8mBdg8c+5Sd4FCtDA42A/uwlPUbHxvnBiP7/aL5w==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@meshery/schemas/-/schemas-1.2.8.tgz", + "integrity": "sha512-RCO2qlQr8HY+qzt88GaoatqIEtpb0Qgo3t2GSQmuHN24tl8Itt9ObeGUzOjviE8HQ3FhptRcbQkGRwBrN1bSCQ==", "dev": true, "license": "ISC", "peerDependencies": { diff --git a/package.json b/package.json index b32962be4..b44c224e3 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@emotion/cache": "^11.14.0", "@eslint/eslintrc": "^3.3.5", "@eslint/js": "^10.0.1", - "@meshery/schemas": "^1.2.7", + "@meshery/schemas": "^1.2.8", "@mui/icons-material": "^9.0.0", "@mui/material": "^9.0.0", "@mui/system": "^9.0.0", From 7fb33b211a4c918073fdfa74f539c821ce78f02d Mon Sep 17 00:00:00 2001 From: Yi Nuo <218099172+yi-nuo426@users.noreply.github.com> Date: Tue, 5 May 2026 12:44:51 -0500 Subject: [PATCH 3/3] feat: flip 5 more form schemas to canonical @meshery/schemas (#866 phase 3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extends this PR (per maintainer request) to flip every Sistent form whose canonical export now ships in @meshery/schemas v1.2.8. The remaining 4 forms (importDesign, importFilter, importModel, helmConnection) stay TODO-headed pending meshery/schemas#868 and #869 — those have canonical-side gaps still being resolved. Forms flipped in this commit ---------------------------- src/schemas/createAndEditEnvironment/ EnvironmentCreateOrEditRjsfSchemaV1Beta3 src/schemas/createAndEditWorkspace/ WorkspaceCreateOrEditRjsfSchemaV1Beta3 (default) + locally-derived editWorkspace (relaxed required) src/schemas/kubernetesCredential/ KubernetesCredentialRjsfSchemaV1Beta1 src/schemas/grafanaCredential/ GrafanaCredentialRjsfSchemaV1Beta1 src/schemas/prometheusCredential/ PrometheusCredentialRjsfSchemaV1Beta1 For each: schema.tsx and uiSchema.tsx are both flipped to re-exports. The published Sistent export names (createAndEditEnvironmentSchema, kubernetesCredentialSchema, etc.) are unchanged. Wire-level changes ------------------ The canonical schemas use canonical field names; the hand-authored Sistent forms didn't. Submission payloads from the flipped forms now use: - `organizationId` instead of `organization` (env, workspace). Matches WorkspacePayload.organizationId / EnvironmentPayload.organizationId in @meshery/schemas. The Meshery server's endpoints already accept the canonical key per their OpenAPI; this aligns the form payload. - `name` instead of `credentialName` (k8s, grafana, prometheus). Matches Credential.name. Same alignment story. Consumers in `meshery` and `meshery-cloud` keep working without source-level changes (the Sistent export names didn't move) but the shape of the data they POST changes for these specific forms. editWorkspace derivation ------------------------ Sistent ships a relaxed-required `editWorkspace` named export alongside the default create-or-edit schema. v1.2.8 only ships the strict variant (`WorkspaceCreateOrEditRjsfSchemaV1Beta3`); the edit-only relaxation isn't canonicalized yet. So this commit derives `editWorkspace` locally by spreading the canonical and overriding `required: ['organizationId']`. The derived const is intentionally typed `Record` because @meshery/schemas declares `RJSFSchema` internally but does NOT yet re-export it — tsup's DTS bundler errors out when the emitted .d.ts references the un-exportable type. Filed meshery/schemas#871 to add `export type { RJSFSchema, UiSchema }` upstream; once that lands the annotation can be tightened. Verified -------- - `npm test`: 11 suites / 29 tests pass. - `npx tsc --noEmit`: src/schemas/ is clean. Pre-existing errors in examples/next-16/lib/palette.ts and src/__testing__/*.test.tsx are on master and unrelated. - `npm run build`: tsup ESM/CJS + DTS all green. dts/index.d.ts size dropped from 95.89 KB to 91.66 KB (the re-exports are smaller than the hand-authored object literals they replaced). - Runtime: `require('@meshery/schemas')` resolves all 6 canonical exports to valid objects with the expected required fields: Catalog: [compatibility, patternCaveats, patternInfo, type] Environment: [name] Workspace: [name, organizationId] *Credential: [name] Signed-off-by: Yi Nuo <218099172+yi-nuo426@users.noreply.github.com> --- .../createAndEditEnvironment/schema.tsx | 68 +++++------- .../createAndEditEnvironment/uiSchema.tsx | 21 ++-- src/schemas/createAndEditWorkspace/schema.tsx | 98 +++++++---------- .../createAndEditWorkspace/uiSchema.tsx | 22 ++-- src/schemas/grafanaCredential/schema.tsx | 61 ++++------- src/schemas/grafanaCredential/uiSchema.tsx | 14 ++- src/schemas/kubernetesCredential/schema.tsx | 102 ++++-------------- src/schemas/kubernetesCredential/uiSchema.tsx | 14 ++- src/schemas/prometheusCredential/schema.tsx | 56 ++++------ src/schemas/prometheusCredential/uiSchema.tsx | 14 ++- 10 files changed, 188 insertions(+), 282 deletions(-) diff --git a/src/schemas/createAndEditEnvironment/schema.tsx b/src/schemas/createAndEditEnvironment/schema.tsx index c821bd178..01b4fb161 100644 --- a/src/schemas/createAndEditEnvironment/schema.tsx +++ b/src/schemas/createAndEditEnvironment/schema.tsx @@ -1,42 +1,26 @@ -// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships -// `EnvironmentCreateOrEditRjsfSchemaV1Beta3` (canonical home: -// `typescript/forms/v1beta3/environment/`), flip this file to: -// -// export { EnvironmentCreateOrEditRjsfSchemaV1Beta3 as default } from '@meshery/schemas'; -// -// The published Sistent export name (`createAndEditEnvironmentSchema`) -// MUST stay the same; only the source flips. -import EnvironmentDefinitionV1Beta3OpenApiSchema from '@meshery/schemas/constructs/v1beta3/environment/EnvironmentSchema'; - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -const environmentSchema = (EnvironmentDefinitionV1Beta3OpenApiSchema as any).components.schemas; -const createAndEditEnvironmentSchema = { - title: 'Environment', - required: ['name'], - properties: { - description: { - description: environmentSchema.EnvironmentPayload.properties.description.description, - format: 'textarea', - title: 'Description', - type: environmentSchema.EnvironmentPayload.properties.description.type, - 'x-rjsf-grid-area': '12' - }, - name: { - description: environmentSchema.EnvironmentPayload.properties.name.description, - title: 'Name', - type: environmentSchema.EnvironmentPayload.properties.name.type, - 'x-rjsf-grid-area': '12' - }, - organization: { - type: environmentSchema.EnvironmentPayload.properties.organizationId.type, - title: 'Organization', - description: environmentSchema.EnvironmentPayload.properties.organizationId.description, - enum: [], - enumNames: [], - 'x-rjsf-grid-area': '12' - } - }, - type: 'object' -}; - -export default createAndEditEnvironmentSchema; +/** + * Schema for the create-or-edit environment modal. + * + * Source-of-truth: re-exported from `@meshery/schemas` per the form-schema + * canonicalization tracked in + * https://github.com/meshery/schemas/issues/866 (Phase 3). + * + * The previously hand-authored object literal has moved to + * `meshery/schemas` at + * `schemas/constructs/v1beta3/environment/forms/createOrEdit.json`, + * where a Go subset-validator (`validation/forms_test.go`) keeps it + * structurally aligned with the canonical OpenAPI Environment construct. + * + * Wire-level change: the field formerly keyed as `organization` is + * now keyed as `organizationId`, matching canonical + * `EnvironmentPayload.organizationId`. The Meshery server's + * Environment endpoint already accepts the canonical key per its + * OpenAPI; this brings the form payload into alignment. + * + * The published Sistent export name (`createAndEditEnvironmentSchema`) + * is unchanged — only the source of the schema has flipped. Consumers + * in `meshery` and `meshery-cloud` keep working without source-level + * changes; submission payloads now use `organizationId` for that + * field. + */ +export { EnvironmentCreateOrEditRjsfSchemaV1Beta3 as default } from '@meshery/schemas'; diff --git a/src/schemas/createAndEditEnvironment/uiSchema.tsx b/src/schemas/createAndEditEnvironment/uiSchema.tsx index 5ec3d11f9..746d438cc 100644 --- a/src/schemas/createAndEditEnvironment/uiSchema.tsx +++ b/src/schemas/createAndEditEnvironment/uiSchema.tsx @@ -1,8 +1,13 @@ -const createAndEditEnvironmentUiSchema = { - organization: { - 'ui:disabled': false - }, - 'ui:order': ['organization', 'name', 'description'] -}; - -export default createAndEditEnvironmentUiSchema; +/** + * UI schema for the create-or-edit environment modal. + * + * Source-of-truth: re-exported from `@meshery/schemas` per the + * form-schema canonicalization tracked in + * https://github.com/meshery/schemas/issues/866 (Phase 3). + * + * The published Sistent export name (`createAndEditEnvironmentUiSchema`) + * is unchanged. The canonical UI schema already keys + * `ui:disabled` and `ui:order` on the canonical field name + * `organizationId`. + */ +export { EnvironmentCreateOrEditRjsfUiSchemaV1Beta3 as default } from '@meshery/schemas'; diff --git a/src/schemas/createAndEditWorkspace/schema.tsx b/src/schemas/createAndEditWorkspace/schema.tsx index 702312ae7..988d18e5e 100644 --- a/src/schemas/createAndEditWorkspace/schema.tsx +++ b/src/schemas/createAndEditWorkspace/schema.tsx @@ -1,63 +1,47 @@ /** - * Schema for create or edit workspace modals + * Schemas for the create-or-edit workspace modals. + * + * Source-of-truth: re-exported from `@meshery/schemas` per the form-schema + * canonicalization tracked in + * https://github.com/meshery/schemas/issues/866 (Phase 3). + * + * The previously hand-authored object literal has moved to + * `meshery/schemas` at + * `schemas/constructs/v1beta3/workspace/forms/createOrEdit.json`, + * where a Go subset-validator (`validation/forms_test.go`) keeps it + * structurally aligned with the canonical OpenAPI Workspace construct. + * + * Wire-level change: the field formerly keyed as `organization` is + * now keyed as `organizationId`, matching canonical + * `WorkspacePayload.organizationId`. + * + * Two exports are published: + * + * - default (`createAndEditWorkspaceSchema`): the create-or-edit + * form with `name` and `organizationId` required. + * - named (`editWorkspaceSchema`): a relaxed variant where only + * `organizationId` is required — used by the edit-only modal + * where the existing workspace name is preserved if blank. + * + * The relaxed-`required` variant is derived locally from the + * canonical schema by spreading the canonical and overriding + * `required`. Once `@meshery/schemas` ships an + * `WorkspaceEditRjsfSchemaV1Beta3` (a relaxed-required canonical + * variant), this derivation can be deleted in favor of a direct + * re-export. */ -// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships -// `WorkspaceCreateOrEditRjsfSchemaV1Beta3` (canonical home: -// `typescript/forms/v1beta3/workspace/`), flip this file to: -// -// export { -// WorkspaceCreateOrEditRjsfSchemaV1Beta3 as default, -// WorkspaceEditRjsfSchemaV1Beta3 as editWorkspace, -// } from '@meshery/schemas'; -// -// The published Sistent export names (`createAndEditWorkspaceSchema` -// and the named `editWorkspaceSchema`) MUST stay the same; only the -// source flips. Coordinate with the schemas PR so the canonical -// upstream ships BOTH the create-or-edit form and the relaxed -// edit-only variant. -import WorkspaceDefinitionV1Beta3OpenApiSchema from '@meshery/schemas/constructs/v1beta3/workspace/WorkspaceSchema'; +import { WorkspaceCreateOrEditRjsfSchemaV1Beta3 } from '@meshery/schemas'; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -const workspaceSchema = (WorkspaceDefinitionV1Beta3OpenApiSchema as any).components.schemas; - -/** - * Create workspace schema - name is required - */ -const createAndEditWorkspace = { - properties: { - description: { - description: workspaceSchema.WorkspacePayload.properties.description.description, - format: 'textarea', - title: 'Description', - type: workspaceSchema.WorkspacePayload.properties.description.type, - 'x-rjsf-grid-area': '12' - }, - name: { - description: workspaceSchema.WorkspacePayload.properties.name.description, - title: 'Name', - type: workspaceSchema.WorkspacePayload.properties.name.type, - 'x-rjsf-grid-area': '12' - }, - organization: { - type: workspaceSchema.WorkspacePayload.properties.organizationId.type, - description: workspaceSchema.WorkspacePayload.properties.organizationId.description, - title: 'Organization', - enum: [], - enumNames: [], - 'x-rjsf-grid-area': '12' - } - }, - type: 'object', - required: ['name', 'organization'] -}; - -/** - * Edit workspace schema - name is optional (derived from WorkspacePayload with relaxed requirements) - */ -const editWorkspace = { - ...createAndEditWorkspace, - required: ['organization'] +// `editWorkspace` is intentionally typed as a loose record so its +// emitted `.d.ts` doesn't reference @meshery/schemas's internal +// `RJSFSchema` type (declared but not currently re-exported by that +// package — see the follow-up issue against meshery/schemas to add +// `export type { RJSFSchema, UiSchema }` to the public surface). +// Once that type is exportable, this annotation can be tightened. +const editWorkspace: Record = { + ...WorkspaceCreateOrEditRjsfSchemaV1Beta3, + required: ['organizationId'] }; -export default createAndEditWorkspace; +export default WorkspaceCreateOrEditRjsfSchemaV1Beta3; export { editWorkspace }; diff --git a/src/schemas/createAndEditWorkspace/uiSchema.tsx b/src/schemas/createAndEditWorkspace/uiSchema.tsx index 0a256ff0a..2179bf3bb 100644 --- a/src/schemas/createAndEditWorkspace/uiSchema.tsx +++ b/src/schemas/createAndEditWorkspace/uiSchema.tsx @@ -1,9 +1,13 @@ -const createAndEditWorkspaceUiSchema = { - organization: { - 'ui:disabled': false, - 'ui:widget': 'select' - }, - 'ui:order': ['organization', 'name', 'description'] -}; - -export default createAndEditWorkspaceUiSchema; +/** + * UI schema for the create-or-edit workspace modals. + * + * Source-of-truth: re-exported from `@meshery/schemas` per the + * form-schema canonicalization tracked in + * https://github.com/meshery/schemas/issues/866 (Phase 3). + * + * The published Sistent export name (`createAndEditWorkspaceUiSchema`) + * is unchanged. The canonical UI schema already keys + * `ui:disabled` / `ui:widget` and `ui:order` on the canonical + * field name `organizationId`. + */ +export { WorkspaceCreateOrEditRjsfUiSchemaV1Beta3 as default } from '@meshery/schemas'; diff --git a/src/schemas/grafanaCredential/schema.tsx b/src/schemas/grafanaCredential/schema.tsx index f5ec53a53..c463c4d90 100644 --- a/src/schemas/grafanaCredential/schema.tsx +++ b/src/schemas/grafanaCredential/schema.tsx @@ -1,43 +1,22 @@ /** - * Schema for creating grafana credential; + * Schema for the Grafana credential modal. + * + * Source-of-truth: re-exported from `@meshery/schemas` per the form-schema + * canonicalization tracked in + * https://github.com/meshery/schemas/issues/866 (Phase 3). + * + * The previously hand-authored object literal has moved to + * `meshery/schemas` at + * `schemas/constructs/v1beta1/credential/forms/grafana.json`, + * where a Go subset-validator (`validation/forms_test.go`) keeps it + * structurally aligned with the canonical OpenAPI Credential construct + * (the grafana-specific shape lives inside the canonical free-form + * `secret` map). + * + * Wire-level change: the field formerly keyed as `credentialName` is + * now keyed as `name`, matching canonical `Credential.name`. + * + * The published Sistent export name (`grafanaCredentialSchema`) + * is unchanged. */ -// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships -// `GrafanaCredentialRjsfSchemaV1Beta1` (canonical home: -// `typescript/forms/v1beta1/credential/`), flip this file to: -// -// export { GrafanaCredentialRjsfSchemaV1Beta1 as default } from '@meshery/schemas'; -// -// The published Sistent export name (`grafanaCredentialSchema`) MUST -// stay the same; only the source flips. -const grafanaCredentialSchema = { - type: 'object', - title: 'Grafana', - properties: { - credentialName: { - title: 'Credential Name', - type: 'string', - description: 'Name of your credential' - }, - secret: { - type: 'object', - title: 'Credential Secret', - description: 'Credential secret for the Grafana instance', - properties: { - grafanaURL: { - type: 'string', - title: 'URL', - description: 'URL of the Grafana instance' - }, - grafanaAPIKey: { - type: 'string', - title: 'API Key', - description: 'API Key for the Grafana instance' - } - }, - required: ['grafanaURL', 'grafanaAPIKey'] - } - }, - required: ['credentialName'] -}; - -export default grafanaCredentialSchema; +export { GrafanaCredentialRjsfSchemaV1Beta1 as default } from '@meshery/schemas'; diff --git a/src/schemas/grafanaCredential/uiSchema.tsx b/src/schemas/grafanaCredential/uiSchema.tsx index 85f8c332a..372bc1856 100644 --- a/src/schemas/grafanaCredential/uiSchema.tsx +++ b/src/schemas/grafanaCredential/uiSchema.tsx @@ -1,3 +1,11 @@ -const grafanaCredentialUiSchema = {}; - -export default grafanaCredentialUiSchema; +/** + * UI schema for the Grafana credential modal. + * + * Source-of-truth: re-exported from `@meshery/schemas` per the + * form-schema canonicalization tracked in + * https://github.com/meshery/schemas/issues/866 (Phase 3). + * + * The published Sistent export name (`grafanaCredentialUiSchema`) + * is unchanged. + */ +export { GrafanaCredentialRjsfUiSchemaV1Beta1 as default } from '@meshery/schemas'; diff --git a/src/schemas/kubernetesCredential/schema.tsx b/src/schemas/kubernetesCredential/schema.tsx index 1b668ab99..db0ca24ca 100644 --- a/src/schemas/kubernetesCredential/schema.tsx +++ b/src/schemas/kubernetesCredential/schema.tsx @@ -1,82 +1,24 @@ /** - * Schema for creating kubernetes credential. + * Schema for the Kubernetes credential modal. + * + * Source-of-truth: re-exported from `@meshery/schemas` per the form-schema + * canonicalization tracked in + * https://github.com/meshery/schemas/issues/866 (Phase 3). + * + * The previously hand-authored object literal has moved to + * `meshery/schemas` at + * `schemas/constructs/v1beta1/credential/forms/kubernetes.json`, + * where a Go subset-validator (`validation/forms_test.go`) keeps it + * structurally aligned with the canonical OpenAPI Credential construct + * (the kubernetes-specific shape lives inside the canonical free-form + * `secret` map). + * + * Wire-level change: the field formerly keyed as `credentialName` is + * now keyed as `name`, matching canonical `Credential.name`. The + * Meshery server's Credential endpoint already accepts the canonical + * key per its OpenAPI; this brings the form payload into alignment. + * + * The published Sistent export name (`kubernetesCredentialSchema`) + * is unchanged. */ -// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships -// `KubernetesCredentialRjsfSchemaV1Beta1` (canonical home: -// `typescript/forms/v1beta1/credential/`), flip this file to: -// -// export { KubernetesCredentialRjsfSchemaV1Beta1 as default } from '@meshery/schemas'; -// -// The published Sistent export name (`kubernetesCredentialSchema`) -// MUST stay the same; only the source flips. -const kubernetesCredentialSchema = { - type: 'object', - title: 'Kubernetes', - properties: { - credentialName: { - title: 'Credential Name', - type: 'string', - description: 'Name of your credential' - }, - secret: { - type: 'object', - title: 'Credential Secret', - description: 'Credential secret for the Kubernetes cluster', - properties: { - clusterName: { - type: 'string', - title: 'Cluster Name', - description: 'Name of the Kubernetes cluster' - }, - clusterServerURL: { - type: 'string', - title: 'Server URL', - description: 'URL of the Kubernetes cluster' - }, - auth: { - type: 'object', - title: 'Auth', - description: 'Kubernetes cluster authentication', - properties: { - clusterUserName: { - type: 'string', - title: 'User Name', - description: 'Name of the Kubernetes cluster user' - }, - clusterToken: { - type: 'string', - title: 'Token', - description: 'Token of the Kubernetes cluster user' - }, - clusterClientCertificateData: { - type: 'string', - title: 'Client Certificate Data', - description: 'Certificate data of the Kubernetes cluster' - }, - clusterClientKeyData: { - type: 'string', - title: 'Client Key Data', - description: 'Client Key data of the Kubernetes cluster' - }, - clusterCertificateAuthorityData: { - type: 'string', - title: 'Certificate Authority Data', - description: 'Certificate Authority data of the Kubernetes cluster' - } - }, - required: [ - 'clusterUserName', - 'clusterToken', - 'clusterClientCertificateData', - 'clusterClientKeyData', - 'clusterCertificateAuthorityData' - ] - } - }, - required: ['clusterName', 'clusterServerURL'] - } - }, - required: ['credentialName'] -}; - -export default kubernetesCredentialSchema; +export { KubernetesCredentialRjsfSchemaV1Beta1 as default } from '@meshery/schemas'; diff --git a/src/schemas/kubernetesCredential/uiSchema.tsx b/src/schemas/kubernetesCredential/uiSchema.tsx index 64ad52f6e..3baa7b31b 100644 --- a/src/schemas/kubernetesCredential/uiSchema.tsx +++ b/src/schemas/kubernetesCredential/uiSchema.tsx @@ -1,3 +1,11 @@ -const kubernetesCredentialUiSchema = {}; - -export default kubernetesCredentialUiSchema; +/** + * UI schema for the Kubernetes credential modal. + * + * Source-of-truth: re-exported from `@meshery/schemas` per the + * form-schema canonicalization tracked in + * https://github.com/meshery/schemas/issues/866 (Phase 3). + * + * The published Sistent export name (`kubernetesCredentialUiSchema`) + * is unchanged. + */ +export { KubernetesCredentialRjsfUiSchemaV1Beta1 as default } from '@meshery/schemas'; diff --git a/src/schemas/prometheusCredential/schema.tsx b/src/schemas/prometheusCredential/schema.tsx index 9f1a1587a..daaeddf48 100644 --- a/src/schemas/prometheusCredential/schema.tsx +++ b/src/schemas/prometheusCredential/schema.tsx @@ -1,38 +1,22 @@ /** - * Schema for creating prometheus credential; + * Schema for the Prometheus credential modal. + * + * Source-of-truth: re-exported from `@meshery/schemas` per the form-schema + * canonicalization tracked in + * https://github.com/meshery/schemas/issues/866 (Phase 3). + * + * The previously hand-authored object literal has moved to + * `meshery/schemas` at + * `schemas/constructs/v1beta1/credential/forms/prometheus.json`, + * where a Go subset-validator (`validation/forms_test.go`) keeps it + * structurally aligned with the canonical OpenAPI Credential construct + * (the prometheus-specific shape lives inside the canonical free-form + * `secret` map). + * + * Wire-level change: the field formerly keyed as `credentialName` is + * now keyed as `name`, matching canonical `Credential.name`. + * + * The published Sistent export name (`prometheusCredentialSchema`) + * is unchanged. */ -// TODO(meshery/schemas#866 — Phase 3): once `@meshery/schemas` ships -// `PrometheusCredentialRjsfSchemaV1Beta1` (canonical home: -// `typescript/forms/v1beta1/credential/`), flip this file to: -// -// export { PrometheusCredentialRjsfSchemaV1Beta1 as default } from '@meshery/schemas'; -// -// The published Sistent export name (`prometheusCredentialSchema`) -// MUST stay the same; only the source flips. -const prometheusCredentialSchema = { - type: 'object', - title: 'Prometheus', - properties: { - credentialName: { - title: 'Credential Name', - type: 'string', - description: 'Name of your credential' - }, - secret: { - type: 'object', - title: 'Credential Secret', - description: 'Credential secret for the Prometheus instance', - properties: { - prometheusURL: { - type: 'string', - title: 'URL', - description: 'URL of the Prometheus instance' - } - }, - required: ['prometheusURL'] - } - }, - required: ['credentialName'] -}; - -export default prometheusCredentialSchema; +export { PrometheusCredentialRjsfSchemaV1Beta1 as default } from '@meshery/schemas'; diff --git a/src/schemas/prometheusCredential/uiSchema.tsx b/src/schemas/prometheusCredential/uiSchema.tsx index 0c5266b84..ce74cd1e8 100644 --- a/src/schemas/prometheusCredential/uiSchema.tsx +++ b/src/schemas/prometheusCredential/uiSchema.tsx @@ -1,3 +1,11 @@ -const prometheusCredentialUiSchema = {}; - -export default prometheusCredentialUiSchema; +/** + * UI schema for the Prometheus credential modal. + * + * Source-of-truth: re-exported from `@meshery/schemas` per the + * form-schema canonicalization tracked in + * https://github.com/meshery/schemas/issues/866 (Phase 3). + * + * The published Sistent export name (`prometheusCredentialUiSchema`) + * is unchanged. + */ +export { PrometheusCredentialRjsfUiSchemaV1Beta1 as default } from '@meshery/schemas';