Skip to content

Commit

Permalink
EXPERIMENT: create basic elements for Miroir Action Script (MAS), mig…
Browse files Browse the repository at this point in the history
…rate Tools.submit to MAS #28. Migrate all Tools.submit actions to use only Action Templates.
  • Loading branch information
miroir-framework committed May 14, 2024
1 parent bb079ee commit a5a48e7
Show file tree
Hide file tree
Showing 9 changed files with 768 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export function getMiroirFundamentalJzodSchema(
jzodSchemajzodMiroirBootstrapSchema: JzodSchema,
entityDefinitionApplicationV1 : EntityDefinition,
entityDefinitionApplicationVersionV1 : EntityDefinition,
entityDefinitionDeployment : EntityDefinition,
entityDefinitionEntity : EntityDefinition,
entityDefinitionEntityDefinitionV1 : EntityDefinition,
entityDefinitionJzodSchemaV1 : EntityDefinition,
Expand Down Expand Up @@ -495,6 +496,7 @@ export function getMiroirFundamentalJzodSchema(
"application": entityDefinitionApplicationV1.jzodSchema as JzodObject,
"applicationVersion": entityDefinitionApplicationVersionV1.jzodSchema as JzodObject,
"bundle": entityDefinitionBundleV1.jzodSchema as JzodObject,
"deployment": entityDefinitionDeployment.jzodSchema as JzodObject,
"entity": entityDefinitionEntity.jzodSchema as JzodObject,
"entityDefinition": entityDefinitionEntityDefinitionV1.jzodSchema as JzodObject,
...(entityDefinitionMenu.jzodSchema.definition.definition as any).context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1714,6 +1714,163 @@ export const miroirFundamentalJzodSchema = {
}
}
},
"deployment": {
"type": "object",
"definition": {
"uuid": {
"type": "simpleType",
"definition": "string",
"validations": [
{
"type": "uuid"
}
],
"extra": {
"id": 1,
"defaultLabel": "Uuid",
"editable": false
}
},
"parentName": {
"type": "simpleType",
"definition": "string",
"optional": true,
"extra": {
"id": 2,
"defaultLabel": "Entity Name",
"editable": false
}
},
"parentUuid": {
"type": "simpleType",
"definition": "string",
"validations": [
{
"type": "uuid"
}
],
"extra": {
"id": 3,
"defaultLabel": "Entity Uuid",
"editable": false
}
},
"parentDefinitionVersionUuid": {
"type": "simpleType",
"definition": "string",
"optional": true,
"validations": [
{
"type": "uuid"
}
],
"extra": {
"id": 4,
"defaultLabel": "Entity Definition Version Uuid",
"editable": false
}
},
"name": {
"type": "simpleType",
"definition": "string",
"extra": {
"id": 5,
"defaultLabel": "Name",
"editable": true
}
},
"defaultLabel": {
"type": "simpleType",
"definition": "string",
"extra": {
"id": 6,
"defaultLabel": "Default Label",
"editable": true
}
},
"description": {
"type": "simpleType",
"definition": "string",
"optional": true,
"extra": {
"id": 7,
"defaultLabel": "Description",
"editable": true
}
},
"application": {
"type": "simpleType",
"definition": "string",
"validations": [
{
"type": "uuid"
}
],
"extra": {
"id": 8,
"defaultLabel": "Application",
"description": "The Application of the Branch.",
"targetEntity": "25d935e7-9e93-42c2-aade-0472b883492b",
"editable": false
}
},
"bundle": {
"type": "simpleType",
"definition": "string",
"validations": [
{
"type": "uuid"
}
],
"extra": {
"id": 8,
"defaultLabel": "Bundle",
"description": "The deployed bundle.",
"targetEntity": "",
"editable": false
}
},
"configuration": {
"type": "schemaReference",
"optional": true,
"extra": {
"id": 9,
"defaultLabel": "Deployment Configuration",
"editable": true
},
"definition": {
"absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739",
"relativePath": "storeUnitConfiguration"
}
},
"model": {
"type": "schemaReference",
"optional": true,
"extra": {
"id": 9,
"defaultLabel": "Application Deployment Model",
"editable": true
},
"definition": {
"absolutePath": "1e8dab4b-65a3-4686-922e-ce89a2d62aa9",
"relativePath": "jzodObject"
}
},
"data": {
"type": "schemaReference",
"optional": true,
"extra": {
"id": 10,
"defaultLabel": "Application Deployment Data",
"editable": true
},
"definition": {
"absolutePath": "1e8dab4b-65a3-4686-922e-ce89a2d62aa9",
"relativePath": "jzodObject"
}
}
}
},
"entity": {
"type": "object",
"definition": {
Expand Down Expand Up @@ -5258,6 +5415,10 @@ export const miroirFundamentalJzodSchema = {
"type": "literal",
"definition": "FailedToDeleteStore"
},
{
"type": "literal",
"definition": "FailedToResetAndInitMiroirAndApplicationDatabase"
},
{
"type": "literal",
"definition": "FailedToOpenStore"
Expand Down Expand Up @@ -7332,6 +7493,46 @@ export const miroirFundamentalJzodSchema = {
}
}
},
{
"type": "object",
"definition": {
"actionType": {
"type": "literal",
"definition": "storeManagementAction"
},
"actionName": {
"type": "literal",
"definition": "resetAndInitMiroirAndApplicationDatabase"
},
"endpoint": {
"type": "literal",
"definition": "bbd08cbb-79ff-4539-b91f-7a14f15ac55f"
},
"deployments": {
"type": "array",
"definition": {
"type": "schemaReference",
"definition": {
"absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739",
"relativePath": "deployment"
}
}
},
"deploymentUuid": {
"type": "simpleType",
"definition": "string",
"validations": [
{
"type": "uuid"
}
],
"extra": {
"defaultLabel": "Module Deployment Uuid",
"editable": false
}
}
}
},
{
"type": "object",
"definition": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,20 @@ export type Bundle = {
applicationVersion: ApplicationVersion;
};
};
export type Deployment = {
uuid: string;
parentName?: string | undefined;
parentUuid: string;
parentDefinitionVersionUuid?: string | undefined;
name: string;
defaultLabel: string;
description?: string | undefined;
application: string;
bundle: string;
configuration?: StoreUnitConfiguration | undefined;
model?: JzodObject | undefined;
data?: JzodObject | undefined;
};
export type Entity = {
uuid: string;
parentName?: string | undefined;
Expand Down Expand Up @@ -875,7 +889,7 @@ export type ______________________________________________actions_______________
export type ActionError = {
status: "error";
error: {
errorType: ("FailedToCreateStore" | "FailedToDeployModule") | "FailedToDeleteStore" | "FailedToOpenStore" | "FailedToCloseStore" | "FailedToCreateInstance" | "FailedToGetInstance" | "FailedToGetInstances";
errorType: ("FailedToCreateStore" | "FailedToDeployModule") | "FailedToDeleteStore" | "FailedToResetAndInitMiroirAndApplicationDatabase" | "FailedToOpenStore" | "FailedToCloseStore" | "FailedToCreateInstance" | "FailedToGetInstance" | "FailedToGetInstances";
errorMessage?: string | undefined;
error?: {
errorMessage?: string | undefined;
Expand Down Expand Up @@ -1192,6 +1206,12 @@ export type StoreManagementAction = {
endpoint: "bbd08cbb-79ff-4539-b91f-7a14f15ac55f";
deploymentUuid: string;
configuration: StoreUnitConfiguration;
} | {
actionType: "storeManagementAction";
actionName: "resetAndInitMiroirAndApplicationDatabase";
endpoint: "bbd08cbb-79ff-4539-b91f-7a14f15ac55f";
deployments: Deployment[];
deploymentUuid: string;
} | {
actionType: "storeManagementAction";
actionName: "openStore";
Expand Down Expand Up @@ -1302,6 +1322,7 @@ export const ______________________________________________entities_____________
export const application: z.ZodType<Application> = z.object({uuid:z.string().uuid(), parentName:z.string().optional(), parentUuid:z.string().uuid(), parentDefinitionVersionUuid:z.string().uuid().optional(), name:z.string(), defaultLabel:z.string(), description:z.string().optional(), selfApplication:z.string().uuid()}).strict();
export const applicationVersion: z.ZodType<ApplicationVersion> = z.object({uuid:z.string().uuid(), parentName:z.string().optional(), parentUuid:z.string().uuid(), parentDefinitionVersionUuid:z.string().uuid().optional(), name:z.string(), defaultLabel:z.string().optional(), description:z.string().optional(), type:z.string().optional(), application:z.string().uuid(), branch:z.string().uuid(), previousVersion:z.string().uuid().optional(), modelStructureMigration:z.array(z.record(z.string(),z.any())).optional(), modelCUDMigration:z.array(z.record(z.string(),z.any())).optional()}).strict();
export const bundle: z.ZodType<Bundle> = z.object({uuid:z.string().uuid(), parentName:z.string().optional(), parentUuid:z.string().uuid(), parentDefinitionVersionUuid:z.string().uuid(), name:z.string(), contents:z.union([z.object({type:z.literal("runtime")}).strict(), z.object({type:z.literal("development"), applicationVersion:z.lazy(() =>applicationVersion)}).strict()])}).strict();
export const deployment: z.ZodType<Deployment> = z.object({uuid:z.string().uuid(), parentName:z.string().optional(), parentUuid:z.string().uuid(), parentDefinitionVersionUuid:z.string().uuid().optional(), name:z.string(), defaultLabel:z.string(), description:z.string().optional(), application:z.string().uuid(), bundle:z.string().uuid(), configuration:z.lazy(() =>storeUnitConfiguration).optional(), model:z.lazy(() =>jzodObject).optional(), data:z.lazy(() =>jzodObject).optional()}).strict();
export const entity: z.ZodType<Entity> = z.object({uuid:z.string().uuid(), parentName:z.string().optional(), parentUuid:z.string().uuid(), parentDefinitionVersionUuid:z.string().uuid().optional(), conceptLevel:z.enum(["MetaModel","Model","Data"]).optional(), application:z.string().uuid().optional(), name:z.string(), author:z.string().uuid().optional(), description:z.string().optional()}).strict();
export const entityDefinition: z.ZodType<EntityDefinition> = z.object({uuid:z.string().uuid(), parentName:z.string(), parentUuid:z.string().uuid(), parentDefinitionVersionUuid:z.string().uuid().optional(), name:z.string(), entityUuid:z.string().uuid(), conceptLevel:z.enum(["MetaModel","Model","Data"]).optional(), description:z.string().optional(), defaultInstanceDetailsReportUuid:z.string().uuid().optional(), viewAttributes:z.array(z.string()).optional(), jzodSchema:z.lazy(() =>jzodObject)}).strict();
export const miroirMenuItem: z.ZodType<MiroirMenuItem> = z.object({label:z.string(), section:z.lazy(() =>applicationSection), application:z.string().uuid(), reportUuid:z.string().uuid(), instanceUuid:z.string().uuid().optional(), icon:z.string().uuid()}).strict();
Expand Down Expand Up @@ -1379,7 +1400,7 @@ export const domainModelGetSingleSelectQueryJzodSchemaQueryParams: z.ZodType<Dom
export const domainModelQueryJzodSchemaParams: z.ZodType<DomainModelQueryJzodSchemaParams> = z.union([z.lazy(() =>domainModelGetEntityDefinitionQueryParams), z.lazy(() =>domainModelGetFetchParamJzodSchemaQueryParams), z.lazy(() =>domainModelGetSingleSelectQueryJzodSchemaQueryParams)]);
export const miroirSelectorQueryParams: z.ZodType<MiroirSelectorQueryParams> = z.union([z.lazy(() =>domainSingleSelectQueryWithDeployment), z.lazy(() =>domainModelGetSingleSelectQueryQueryParams), z.lazy(() =>domainModelGetSingleSelectObjectListQueryQueryParams), z.lazy(() =>domainManyQueriesWithDeploymentUuid), z.lazy(() =>localCacheQueryParams), z.lazy(() =>miroirCustomQueryParams), z.lazy(() =>domainModelGetEntityDefinitionQueryParams), z.lazy(() =>domainModelGetFetchParamJzodSchemaQueryParams), z.lazy(() =>domainModelGetSingleSelectQueryJzodSchemaQueryParams)]);
export const ______________________________________________actions_____________________________________________: z.ZodType<______________________________________________actions_____________________________________________> = z.never();
export const actionError: z.ZodType<ActionError> = z.object({status:z.literal("error"), error:z.object({errorType:z.union([z.enum(["FailedToCreateStore","FailedToDeployModule"]), z.literal("FailedToDeleteStore"), z.literal("FailedToOpenStore"), z.literal("FailedToCloseStore"), z.literal("FailedToCreateInstance"), z.literal("FailedToGetInstance"), z.literal("FailedToGetInstances")]), errorMessage:z.string().optional(), error:z.object({errorMessage:z.string().optional(), stack:z.array(z.string().optional())}).strict().optional()}).strict()}).strict();
export const actionError: z.ZodType<ActionError> = z.object({status:z.literal("error"), error:z.object({errorType:z.union([z.enum(["FailedToCreateStore","FailedToDeployModule"]), z.literal("FailedToDeleteStore"), z.literal("FailedToResetAndInitMiroirAndApplicationDatabase"), z.literal("FailedToOpenStore"), z.literal("FailedToCloseStore"), z.literal("FailedToCreateInstance"), z.literal("FailedToGetInstance"), z.literal("FailedToGetInstances")]), errorMessage:z.string().optional(), error:z.object({errorMessage:z.string().optional(), stack:z.array(z.string().optional())}).strict().optional()}).strict()}).strict();
export const actionVoidSuccess: z.ZodType<ActionVoidSuccess> = z.object({status:z.literal("ok"), returnedDomainElement:z.lazy(() =>domainElementVoid)}).strict();
export const actionVoidReturnType: z.ZodType<ActionVoidReturnType> = z.union([z.lazy(() =>actionError), z.lazy(() =>actionVoidSuccess)]);
export const actionEntityInstanceSuccess: z.ZodType<ActionEntityInstanceSuccess> = z.object({status:z.literal("ok"), returnedDomainElement:z.lazy(() =>domainElementEntityInstance)}).strict();
Expand All @@ -1405,7 +1426,7 @@ export const undoRedoAction: z.ZodType<UndoRedoAction> = z.union([z.object({acti
export const transactionalInstanceAction: z.ZodType<TransactionalInstanceAction> = z.object({actionType:z.literal("transactionalInstanceAction"), deploymentUuid:z.string().uuid().optional(), instanceAction:z.lazy(() =>instanceCUDAction)}).strict();
export const domainAction: z.ZodType<DomainAction> = z.union([z.lazy(() =>undoRedoAction), z.lazy(() =>storeOrBundleAction), z.lazy(() =>modelAction), z.lazy(() =>instanceAction), z.object({actionType:z.literal("transactionalInstanceAction"), deploymentUuid:z.string().uuid().optional(), instanceAction:z.lazy(() =>instanceCUDAction)}).strict()]);
export const localCacheAction: z.ZodType<LocalCacheAction> = z.union([z.lazy(() =>undoRedoAction), z.lazy(() =>modelAction), z.lazy(() =>instanceAction), z.lazy(() =>transactionalInstanceAction)]);
export const storeManagementAction: z.ZodType<StoreManagementAction> = z.union([z.object({actionType:z.literal("storeManagementAction"), actionName:z.literal("createStore"), endpoint:z.literal("bbd08cbb-79ff-4539-b91f-7a14f15ac55f"), configuration:z.lazy(() =>storeUnitConfiguration), deploymentUuid:z.string().uuid()}).strict(), z.object({actionType:z.literal("storeManagementAction"), actionName:z.literal("deleteStore"), endpoint:z.literal("bbd08cbb-79ff-4539-b91f-7a14f15ac55f"), deploymentUuid:z.string().uuid(), configuration:z.lazy(() =>storeUnitConfiguration)}).strict(), z.object({actionType:z.literal("storeManagementAction"), actionName:z.literal("openStore"), endpoint:z.literal("bbd08cbb-79ff-4539-b91f-7a14f15ac55f"), configuration:z.record(z.string(),z.lazy(() =>storeUnitConfiguration)), deploymentUuid:z.string().uuid()}).strict(), z.object({actionType:z.literal("storeManagementAction"), actionName:z.literal("closeStore"), endpoint:z.literal("bbd08cbb-79ff-4539-b91f-7a14f15ac55f"), deploymentUuid:z.string().uuid()}).strict()]);
export const storeManagementAction: z.ZodType<StoreManagementAction> = z.union([z.object({actionType:z.literal("storeManagementAction"), actionName:z.literal("createStore"), endpoint:z.literal("bbd08cbb-79ff-4539-b91f-7a14f15ac55f"), configuration:z.lazy(() =>storeUnitConfiguration), deploymentUuid:z.string().uuid()}).strict(), z.object({actionType:z.literal("storeManagementAction"), actionName:z.literal("deleteStore"), endpoint:z.literal("bbd08cbb-79ff-4539-b91f-7a14f15ac55f"), deploymentUuid:z.string().uuid(), configuration:z.lazy(() =>storeUnitConfiguration)}).strict(), z.object({actionType:z.literal("storeManagementAction"), actionName:z.literal("resetAndInitMiroirAndApplicationDatabase"), endpoint:z.literal("bbd08cbb-79ff-4539-b91f-7a14f15ac55f"), deployments:z.array(z.lazy(() =>deployment)), deploymentUuid:z.string().uuid()}).strict(), z.object({actionType:z.literal("storeManagementAction"), actionName:z.literal("openStore"), endpoint:z.literal("bbd08cbb-79ff-4539-b91f-7a14f15ac55f"), configuration:z.record(z.string(),z.lazy(() =>storeUnitConfiguration)), deploymentUuid:z.string().uuid()}).strict(), z.object({actionType:z.literal("storeManagementAction"), actionName:z.literal("closeStore"), endpoint:z.literal("bbd08cbb-79ff-4539-b91f-7a14f15ac55f"), deploymentUuid:z.string().uuid()}).strict()]);
export const persistenceAction: z.ZodType<PersistenceAction> = z.union([z.object({actionType:z.literal("RestPersistenceAction"), actionName:z.enum(["create","read","update","delete"]), endpoint:z.literal("a93598b3-19b6-42e8-828c-f02042d212d4"), section:z.lazy(() =>applicationSection), deploymentUuid:z.string().uuid(), parentName:z.string().optional(), parentUuid:z.string().uuid().optional(), uuid:z.string().uuid().optional(), objects:z.array(z.lazy(() =>entityInstance).optional()).optional()}).strict(), z.lazy(() =>queryAction), z.lazy(() =>bundleAction), z.lazy(() =>instanceAction), z.lazy(() =>modelAction), z.lazy(() =>storeManagementAction)]);
export const restPersistenceAction: z.ZodType<RestPersistenceAction> = z.object({actionType:z.literal("RestPersistenceAction"), actionName:z.enum(["create","read","update","delete"]), endpoint:z.literal("a93598b3-19b6-42e8-828c-f02042d212d4"), section:z.lazy(() =>applicationSection), deploymentUuid:z.string().uuid(), parentName:z.string().optional(), parentUuid:z.string().uuid().optional(), uuid:z.string().uuid().optional(), objects:z.array(z.lazy(() =>entityInstance).optional()).optional()}).strict();
export const queryAction: z.ZodType<QueryAction> = z.object({actionType:z.literal("queryAction"), actionName:z.literal("runQuery"), endpoint:z.literal("9e404b3c-368c-40cb-be8b-e3c28550c25e"), deploymentUuid:z.string().uuid(), query:z.lazy(() =>domainManyQueriesWithDeploymentUuid)}).strict();
Expand Down
Loading

0 comments on commit a5a48e7

Please sign in to comment.