openxiangda-contracts 2.0.0-alpha.94 → 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/LICENSE +21 -0
- package/dist/schemas.d.ts +436 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +38 -1
- package/dist/schemas.js.map +1 -1
- package/dist/types.d.ts +57 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -1
- package/package.json +10 -1
package/dist/schemas.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CONFIGURATION_COMPATIBILITY_CAPABILITY, OPENXIANGDA_COMPILER_CONTRACT_VERSION, DEPLOYMENT_ENVIRONMENTS, LOCAL_RUNTIME_MODE, OPENXIANGDA_CONTRACT_VERSION, PLATFORM_CAPABILITY_CONTRACT_VERSIONS, SCHEMA_VERSIONS, DATA_FIELD_TYPES, } from "./types.js";
|
|
1
|
+
import { CONFIGURATION_COMPATIBILITY_CAPABILITY, OPENXIANGDA_COMPILER_CONTRACT_VERSION, DEPLOYMENT_ENVIRONMENTS, LOCAL_RUNTIME_MODE, OPENXIANGDA_CONTRACT_VERSION, PLATFORM_CAPABILITY_CONTRACT_VERSIONS, SCHEMA_VERSIONS, RUNTIME_CAPACITY_PREFLIGHT_SCHEMA, DATA_FIELD_TYPES, } from "./types.js";
|
|
2
2
|
import { STUDIO_APPLICATION_AUTHORITY, STUDIO_CAPABILITIES_SCHEMA_VERSION, STUDIO_CLI_EVENT_SCHEMA_VERSION, STUDIO_CLI_EVENT_TYPES, STUDIO_CLI_RESULT_SCHEMA_VERSION, STUDIO_PLATFORM_CONTRACT_VERSION, STUDIO_SITE_PROFILE_ENDPOINT, STUDIO_SITE_PROFILE_SCHEMA_VERSION, STUDIO_SITE_PROFILE_UNAVAILABLE_CODES, STUDIO_WORKSPACE_BINDING_SCHEMA_VERSION, STUDIO_WORKSPACE_INITIALIZATION_SCHEMA_VERSION, STUDIO_WORKSPACE_PROTOCOL_VERSION, WORKSPACE_TEMPLATE_BINDING_SCHEMA_VERSION, } from "./studio.js";
|
|
3
3
|
import { aiCapabilityCatalogSchema } from "./ai.js";
|
|
4
4
|
import { departmentReferenceValueSchema, resourceReferenceValueSchema, userReferenceValueSchema, } from "./field-value-schemas.js";
|
|
@@ -4292,6 +4292,14 @@ export const platformCapabilitiesSchema = {
|
|
|
4292
4292
|
executionOwner: { const: "platform" },
|
|
4293
4293
|
durableRuns: { const: true },
|
|
4294
4294
|
clientCanCheckpoint: { const: false },
|
|
4295
|
+
runtimeCapacityPreflight: {
|
|
4296
|
+
type: 'object', additionalProperties: false, required: ['schemaVersion', 'endpointTemplate'],
|
|
4297
|
+
properties: {
|
|
4298
|
+
schemaVersion: { const: RUNTIME_CAPACITY_PREFLIGHT_SCHEMA },
|
|
4299
|
+
strategies: { type: 'array', minItems: 1, maxItems: 2, uniqueItems: true, items: { enum: ['rolling', 'maintenance-replace'] } },
|
|
4300
|
+
endpointTemplate: { const: '/openxiangda-api/v2/applications/{appCode}/runtime-capacity-preflight' },
|
|
4301
|
+
},
|
|
4302
|
+
},
|
|
4295
4303
|
backendImageBuild: {
|
|
4296
4304
|
type: "object",
|
|
4297
4305
|
additionalProperties: false,
|
|
@@ -7974,7 +7982,36 @@ export const contractBundleSchema = {
|
|
|
7974
7982
|
adminNavigation: appAdminNavigationContractSchema,
|
|
7975
7983
|
},
|
|
7976
7984
|
};
|
|
7985
|
+
export const runtimeCapacityPreflightSchema = {
|
|
7986
|
+
$id: SCHEMA_VERSIONS.runtimeCapacityPreflight,
|
|
7987
|
+
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
7988
|
+
type: 'object', additionalProperties: false,
|
|
7989
|
+
required: ['schemaVersion', 'observedAt', 'environmentKey', 'environmentId', 'basis', 'existingRun', 'sufficient', 'capacity'],
|
|
7990
|
+
properties: {
|
|
7991
|
+
schemaVersion: { const: RUNTIME_CAPACITY_PREFLIGHT_SCHEMA },
|
|
7992
|
+
deploymentStrategy: { enum: ['rolling', 'maintenance-replace'] },
|
|
7993
|
+
maintenance: { anyOf: [{ type: 'null' }, { type: 'object', additionalProperties: false, required: ['downtime', 'estimatedAfterStop', 'previousAppVersionId', 'previousDeploymentId', 'headRevision'], properties: { downtime: { const: true }, estimatedAfterStop: { const: true }, previousAppVersionId: nonEmptyString, previousDeploymentId: nonEmptyString, headRevision: { type: 'integer', minimum: 1 } } }] },
|
|
7994
|
+
observedAt: { type: 'string', minLength: 1 },
|
|
7995
|
+
environmentKey: { const: 'preproduction' }, environmentId: nonEmptyString,
|
|
7996
|
+
basis: { enum: ['new-candidate', 'existing-run', 'frontend-only'] },
|
|
7997
|
+
existingRun: { anyOf: [{ type: 'null' }, { type: 'object', additionalProperties: false, required: ['id', 'status'], properties: { id: nonEmptyString, status: nonEmptyString } }] },
|
|
7998
|
+
sufficient: { type: ['boolean', 'null'] },
|
|
7999
|
+
capacity: { anyOf: [{ type: 'null' }, {
|
|
8000
|
+
type: 'object', additionalProperties: false, required: ['checked', 'namespace', 'additionalReplicas', 'required', 'quotas', 'shortages'],
|
|
8001
|
+
properties: {
|
|
8002
|
+
checked: { type: 'boolean' }, namespace: nonEmptyString,
|
|
8003
|
+
additionalReplicas: { type: 'integer', minimum: 0, maximum: 1 },
|
|
8004
|
+
profile: { enum: ['light', 'standard'] },
|
|
8005
|
+
required: { type: 'object', maxProperties: 10, additionalProperties: nonEmptyString },
|
|
8006
|
+
quotas: { type: 'array', maxItems: 100, items: { type: 'object', additionalProperties: false, required: ['name', 'available'], properties: { name: nonEmptyString, available: { type: 'object', maxProperties: 10, additionalProperties: nonEmptyString } } } },
|
|
8007
|
+
shortages: { type: 'array', maxItems: 500, items: { type: 'object', additionalProperties: false, required: ['quota', 'resource', 'required', 'available'], properties: { quota: nonEmptyString, resource: nonEmptyString, required: nonEmptyString, available: nonEmptyString } } },
|
|
8008
|
+
},
|
|
8009
|
+
}] },
|
|
8010
|
+
},
|
|
8011
|
+
allOf: [{ if: { properties: { basis: { const: 'existing-run' } } }, then: { properties: { sufficient: { type: 'null' }, capacity: { type: 'null' }, existingRun: { type: 'object' } } }, else: { properties: { capacity: { type: 'object' }, existingRun: { type: 'null' } } } }],
|
|
8012
|
+
};
|
|
7977
8013
|
export const contractSchemas = {
|
|
8014
|
+
runtimeCapacityPreflight: runtimeCapacityPreflightSchema,
|
|
7978
8015
|
diagnostic: diagnosticSchema,
|
|
7979
8016
|
studioCapabilities: studioCapabilitiesSchema,
|
|
7980
8017
|
studioCliEvent: studioCliEventSchema,
|