@webiny/api-workflows 0.0.0-unstable.6f45466a1d → 0.0.0-unstable.df7a8bb475
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.
|
@@ -3,7 +3,10 @@ import { WORKFLOW_MODEL_ID } from "../../constants.js";
|
|
|
3
3
|
export { WORKFLOW_MODEL_ID };
|
|
4
4
|
class WorkflowModelImpl {
|
|
5
5
|
async execute(builder) {
|
|
6
|
-
return [builder.private(
|
|
6
|
+
return [builder.private({
|
|
7
|
+
modelId: WORKFLOW_MODEL_ID,
|
|
8
|
+
name: "Workflow"
|
|
9
|
+
}).fields(fields => ({
|
|
7
10
|
name: fields.text().label("Name").required("Workflow name is required."),
|
|
8
11
|
app: fields.text().label("App").required("App is required."),
|
|
9
12
|
steps: fields.object().label("Steps").list().required("Steps are required.").listMinLength(1, "At least one step is required.").fields(fields => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ModelFactory","WORKFLOW_MODEL_ID","WorkflowModelImpl","execute","builder","private","modelId","name","fields","text","label","required","app","steps","object","list","listMinLength","id","title","color","description","teams","teamFields","notifications","WorkflowModel","createImplementation","implementation","dependencies"],"sources":["workflowModel.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\nimport { WORKFLOW_MODEL_ID } from \"~/constants.js\";\n\nexport { WORKFLOW_MODEL_ID };\n\nclass WorkflowModelImpl implements ModelFactory.Interface {\n public async execute(builder: ModelFactory.Builder) {\n return [\n builder\n .private(
|
|
1
|
+
{"version":3,"names":["ModelFactory","WORKFLOW_MODEL_ID","WorkflowModelImpl","execute","builder","private","modelId","name","fields","text","label","required","app","steps","object","list","listMinLength","id","title","color","description","teams","teamFields","notifications","WorkflowModel","createImplementation","implementation","dependencies"],"sources":["workflowModel.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\nimport { WORKFLOW_MODEL_ID } from \"~/constants.js\";\n\nexport { WORKFLOW_MODEL_ID };\n\nclass WorkflowModelImpl implements ModelFactory.Interface {\n public async execute(builder: ModelFactory.Builder) {\n return [\n builder\n .private({\n modelId: WORKFLOW_MODEL_ID,\n name: \"Workflow\"\n })\n .fields(fields => ({\n name: fields.text().label(\"Name\").required(\"Workflow name is required.\"),\n app: fields.text().label(\"App\").required(\"App is required.\"),\n steps: fields\n .object()\n .label(\"Steps\")\n .list()\n .required(\"Steps are required.\")\n .listMinLength(1, \"At least one step is required.\")\n .fields(fields => ({\n id: fields.text().label(\"ID\").required(\"ID is required.\"),\n title: fields.text().label(\"Title\").required(\"Title is required.\"),\n color: fields.text().label(\"Color\"),\n description: fields.text().label(\"Description\"),\n teams: fields\n .object()\n .label(\"Teams\")\n .list()\n .fields(teamFields => ({\n id: teamFields.text().label(\"ID\").required(\"ID is required.\")\n })),\n notifications: fields\n .object()\n .list()\n .label(\"Notifications\")\n .fields(fields => ({\n id: fields.text().label(\"Id\").required(\"Id is required.\")\n }))\n }))\n }))\n ];\n }\n}\n\nexport const WorkflowModel = ModelFactory.createImplementation({\n implementation: WorkflowModelImpl,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,yDAAyD;AACtF,SAASC,iBAAiB;AAE1B,SAASA,iBAAiB;AAE1B,MAAMC,iBAAiB,CAAmC;EACtD,MAAaC,OAAOA,CAACC,OAA6B,EAAE;IAChD,OAAO,CACHA,OAAO,CACFC,OAAO,CAAC;MACLC,OAAO,EAAEL,iBAAiB;MAC1BM,IAAI,EAAE;IACV,CAAC,CAAC,CACDC,MAAM,CAACA,MAAM,KAAK;MACfD,IAAI,EAAEC,MAAM,CAACC,IAAI,CAAC,CAAC,CAACC,KAAK,CAAC,MAAM,CAAC,CAACC,QAAQ,CAAC,4BAA4B,CAAC;MACxEC,GAAG,EAAEJ,MAAM,CAACC,IAAI,CAAC,CAAC,CAACC,KAAK,CAAC,KAAK,CAAC,CAACC,QAAQ,CAAC,k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a,GAAGxB,YAAY,CAACyB,oBAAoB,CAAC;EAC3DC,cAAc,EAAExB,iBAAiB;EACjCyB,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -16,7 +16,10 @@ const states = [{
|
|
|
16
16
|
}];
|
|
17
17
|
class WorkflowStateModelImpl {
|
|
18
18
|
async execute(builder) {
|
|
19
|
-
return [builder.private(
|
|
19
|
+
return [builder.private({
|
|
20
|
+
modelId: WORKFLOW_STATE_MODEL_ID,
|
|
21
|
+
name: "RecordWorkflow State"
|
|
22
|
+
}).fields(fields => ({
|
|
20
23
|
workflowId: fields.text().label("Workflow ID"),
|
|
21
24
|
app: fields.text().label("App").required("App is required."),
|
|
22
25
|
title: fields.text().label("Title").required("Title is required."),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ModelFactory","WorkflowStateRecordState","WORKFLOW_STATE_MODEL_ID","states","label","value","pending","inReview","approved","rejected","WorkflowStateModelImpl","execute","builder","private","modelId","name","fields","workflowId","text","app","required","title","targetRevisionId","targetId","isActive","boolean","comment","state","predefinedValues","steps","object","list","listMinLength","stepFields","id","color","description","teams","teamFields","notifications","notificationFields","savedBy","userFields","displayName","type","WorkflowStateModel","createImplementation","implementation","dependencies"],"sources":["stateModel.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\nimport { WorkflowStateRecordState } from \"~/domain/workflowState/abstractions.js\";\n\nexport const WORKFLOW_STATE_MODEL_ID = \"wbyWorkflowState\";\n\nconst states = [\n {\n label: \"Pending\",\n value: WorkflowStateRecordState.pending\n },\n {\n label: \"In Review\",\n value: WorkflowStateRecordState.inReview\n },\n {\n label: \"Approved\",\n value: WorkflowStateRecordState.approved\n },\n {\n label: \"Rejected\",\n value: WorkflowStateRecordState.rejected\n }\n];\n\nclass WorkflowStateModelImpl implements ModelFactory.Interface {\n public async execute(builder: ModelFactory.Builder) {\n return [\n builder\n .private(
|
|
1
|
+
{"version":3,"names":["ModelFactory","WorkflowStateRecordState","WORKFLOW_STATE_MODEL_ID","states","label","value","pending","inReview","approved","rejected","WorkflowStateModelImpl","execute","builder","private","modelId","name","fields","workflowId","text","app","required","title","targetRevisionId","targetId","isActive","boolean","comment","state","predefinedValues","steps","object","list","listMinLength","stepFields","id","color","description","teams","teamFields","notifications","notificationFields","savedBy","userFields","displayName","type","WorkflowStateModel","createImplementation","implementation","dependencies"],"sources":["stateModel.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\nimport { WorkflowStateRecordState } from \"~/domain/workflowState/abstractions.js\";\n\nexport const WORKFLOW_STATE_MODEL_ID = \"wbyWorkflowState\";\n\nconst states = [\n {\n label: \"Pending\",\n value: WorkflowStateRecordState.pending\n },\n {\n label: \"In Review\",\n value: WorkflowStateRecordState.inReview\n },\n {\n label: \"Approved\",\n value: WorkflowStateRecordState.approved\n },\n {\n label: \"Rejected\",\n value: WorkflowStateRecordState.rejected\n }\n];\n\nclass WorkflowStateModelImpl implements ModelFactory.Interface {\n public async execute(builder: ModelFactory.Builder) {\n return [\n builder\n .private({\n modelId: WORKFLOW_STATE_MODEL_ID,\n name: \"RecordWorkflow State\"\n })\n .fields(fields => ({\n workflowId: fields.text().label(\"Workflow ID\"),\n app: fields.text().label(\"App\").required(\"App is required.\"),\n title: fields.text().label(\"Title\").required(\"Title is required.\"),\n targetRevisionId: fields.text().label(\"Target Revision ID\"),\n targetId: fields.text().label(\"Target ID\"),\n isActive: fields.boolean().label(\"Is Active\"),\n comment: fields.text().label(\"Comment\"),\n state: fields.text().label(\"State\").predefinedValues(states),\n steps: fields\n .object()\n .label(\"Steps\")\n .list()\n .required(\"Steps are required.\")\n .listMinLength(1, \"At least one step is required.\")\n .fields(stepFields => ({\n id: stepFields.text().label(\"ID\").required(\"ID is required.\"),\n title: stepFields.text().label(\"Title\").required(\"Title is required.\"),\n color: stepFields.text().label(\"Color\").required(\"Color is required.\"),\n description: stepFields.text().label(\"Description\"),\n teams: stepFields\n .object()\n .label(\"Teams\")\n .list()\n .required(\"At least one team is required.\")\n .listMinLength(1, \"At least one team is required.\")\n .fields(teamFields => ({\n id: teamFields.text().label(\"ID\").required(\"ID is required.\")\n })),\n notifications: stepFields\n .object()\n .label(\"Notifications\")\n .list()\n .fields(notificationFields => ({\n id: notificationFields\n .text()\n .label(\"ID\")\n .required(\"ID is required.\")\n })),\n state: stepFields.text().label(\"State\").predefinedValues(states),\n savedBy: stepFields\n .object()\n .label(\"User\")\n .fields(userFields => ({\n id: userFields.text().label(\"ID\").required(\"ID is required.\"),\n displayName: userFields\n .text()\n .label(\"Display Name\")\n .required(\"Display name is required.\"),\n type: userFields\n .text()\n .label(\"Type\")\n .required(\"Type is required.\")\n })),\n comment: stepFields.text().label(\"Comment\")\n }))\n }))\n ];\n }\n}\n\nexport const WorkflowStateModel = ModelFactory.createImplementation({\n implementation: WorkflowStateModelImpl,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,yDAAyD;AACtF,SAASC,wBAAwB;AAEjC,OAAO,MAAMC,uBAAuB,GAAG,kBAAkB;AAEzD,MAAMC,MAAM,GAAG,CACX;EACIC,KAAK,EAAE,SAAS;EAChBC,KAAK,EAAEJ,wBAAwB,CAACK;AACpC,CAAC,EACD;EACIF,KAAK,EAAE,WAAW;EAClBC,KAAK,EAAEJ,wBAAwB,CAACM;AACpC,CAAC,EACD;EACIH,KAAK,EAAE,UAAU;EACjBC,KAAK,EAAEJ,wBAAwB,CAACO;AACpC,CAAC,EACD;EACIJ,KAAK,EAAE,UAAU;EACjBC,KAAK,EAAEJ,wBAAwB,CAACQ;AACpC,CAAC,CACJ;AAED,MAAMC,sBAAsB,CAAmC;EAC3D,MAAaC,OAAOA,CAACC,OAA6B,EAAE;IAChD,OAAO,CACHA,OAAO,CACFC,OAAO,CAAC;MACLC,OAAO,EAAEZ,uBAAuB;MAChCa,IAAI,EAAE;IACV,CAAC,CAAC,CACDC,MAAM,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AI,CAAC,CAAC,CACNd,KAAK,CAAC,cAAc,CAAC,CACrBgB,QAAQ,CAAC,2BAA2B,CAAC;UAC1CwB,IAAI,EAAEF,UAAU,CACXxB,IAAI,CAAC,CAAC,CACNd,KAAK,CAAC,MAAM,CAAC,CACbgB,QAAQ,CAAC,mBAAmB;QACrC,CAAC,CAAC,CAAC;QACPM,OAAO,EAAEO,UAAU,CAACf,IAAI,CAAC,CAAC,CAACd,KAAK,CAAC,SAAS;MAC9C,CAAC,CAAC;IACV,CAAC,CAAC,CAAC,CACV;EACL;AACJ;AAEA,OAAO,MAAMyC,kBAAkB,GAAG7C,YAAY,CAAC8C,oBAAoB,CAAC;EAChEC,cAAc,EAAErC,sBAAsB;EACtCsC,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-workflows",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.df7a8bb475",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"description": "Workflows API",
|
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@webiny/api": "0.0.0-unstable.
|
|
18
|
-
"@webiny/api-core": "0.0.0-unstable.
|
|
19
|
-
"@webiny/api-headless-cms": "0.0.0-unstable.
|
|
20
|
-
"@webiny/api-mailer": "0.0.0-unstable.
|
|
21
|
-
"@webiny/feature": "0.0.0-unstable.
|
|
22
|
-
"@webiny/handler": "0.0.0-unstable.
|
|
23
|
-
"@webiny/handler-graphql": "0.0.0-unstable.
|
|
24
|
-
"@webiny/utils": "0.0.0-unstable.
|
|
17
|
+
"@webiny/api": "0.0.0-unstable.df7a8bb475",
|
|
18
|
+
"@webiny/api-core": "0.0.0-unstable.df7a8bb475",
|
|
19
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.df7a8bb475",
|
|
20
|
+
"@webiny/api-mailer": "0.0.0-unstable.df7a8bb475",
|
|
21
|
+
"@webiny/feature": "0.0.0-unstable.df7a8bb475",
|
|
22
|
+
"@webiny/handler": "0.0.0-unstable.df7a8bb475",
|
|
23
|
+
"@webiny/handler-graphql": "0.0.0-unstable.df7a8bb475",
|
|
24
|
+
"@webiny/utils": "0.0.0-unstable.df7a8bb475",
|
|
25
25
|
"zod": "3.25.76"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@webiny/build-tools": "0.0.0-unstable.
|
|
29
|
-
"@webiny/plugins": "0.0.0-unstable.
|
|
30
|
-
"@webiny/project-utils": "0.0.0-unstable.
|
|
31
|
-
"@webiny/testing": "0.0.0-unstable.
|
|
28
|
+
"@webiny/build-tools": "0.0.0-unstable.df7a8bb475",
|
|
29
|
+
"@webiny/plugins": "0.0.0-unstable.df7a8bb475",
|
|
30
|
+
"@webiny/project-utils": "0.0.0-unstable.df7a8bb475",
|
|
31
|
+
"@webiny/testing": "0.0.0-unstable.df7a8bb475",
|
|
32
32
|
"type-fest": "5.4.4",
|
|
33
33
|
"typescript": "5.9.3",
|
|
34
34
|
"vitest": "3.2.4"
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"access": "public",
|
|
38
38
|
"directory": "dist"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "df7a8bb4755a1da047f0af8c56bdb649cc81bf7d"
|
|
41
41
|
}
|