@webiny/api-workflows 0.0.0-unstable.6f45466a1d → 0.0.0-unstable.81ae05e56b
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/domain/workflow/workflowModel.js +4 -1
- package/domain/workflow/workflowModel.js.map +1 -1
- package/domain/workflowState/errors.js +1 -1
- package/domain/workflowState/errors.js.map +1 -1
- package/domain/workflowState/stateModel.js +4 -1
- package/domain/workflowState/stateModel.js.map +1 -1
- package/features/notifications/ListNotificationTypes/ListNotificationTypesUseCase.js +1 -2
- package/features/notifications/ListNotificationTypes/ListNotificationTypesUseCase.js.map +1 -1
- package/features/workflow/CreateWorkflow/CreateWorkflowUseCase.js +1 -2
- package/features/workflow/CreateWorkflow/CreateWorkflowUseCase.js.map +1 -1
- package/features/workflow/DeleteWorkflow/DeleteWorkflowUseCase.js +1 -2
- package/features/workflow/DeleteWorkflow/DeleteWorkflowUseCase.js.map +1 -1
- package/features/workflow/UpdateWorkflow/UpdateWorkflowUseCase.js +1 -2
- package/features/workflow/UpdateWorkflow/UpdateWorkflowUseCase.js.map +1 -1
- package/features/workflowState/ListWorkflowStates/abstractions.d.ts +18 -3
- package/features/workflowState/ListWorkflowStates/abstractions.js.map +1 -1
- package/graphql/validation/approveWorkflowState.d.ts +1 -7
- package/graphql/validation/cancelWorkflowState.d.ts +1 -5
- package/graphql/validation/createWorkflowState.d.ts +1 -9
- package/graphql/validation/deleteWorkflow.d.ts +1 -7
- package/graphql/validation/getTargetWorkflowState.d.ts +1 -7
- package/graphql/validation/getWorkflow.d.ts +1 -7
- package/graphql/validation/getWorkflowState.d.ts +1 -5
- package/graphql/validation/listWorkflowStates.d.ts +14 -96
- package/graphql/validation/listWorkflows.d.ts +6 -36
- package/graphql/validation/rejectWorkflowState.d.ts +1 -7
- package/graphql/validation/startWorkflowState.d.ts +1 -5
- package/graphql/validation/step.d.ts +8 -36
- package/graphql/validation/storeWorkflow.d.ts +14 -86
- package/graphql/validation/takeOverWorkflowStateStep.d.ts +1 -5
- package/graphql/validation/workflow.d.ts +13 -60
- package/graphql/workflowState.js +36 -7
- package/graphql/workflowState.js.map +1 -1
- package/index.js +6 -4
- package/index.js.map +1 -1
- package/package.json +17 -17
- package/types.d.ts +11 -4
- package/types.js +1 -5
- package/types.js.map +1 -1
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ContextPlugin","TenantContext","IdentityContext","WcpContext","GetModelUseCase","WorkflowModel","WorkflowPrivateModel","WORKFLOW_MODEL_ID","WorkflowStateModel","WorkflowStatePrivateModel","WORKFLOW_STATE_MODEL_ID","createWorkflowsSchema","createWorkflowStateSchema","WorkflowMapper","WorkflowStateMapper","GetWorkflowFeature","ListWorkflowsFeature","CreateWorkflowFeature","DeleteWorkflowFeature","UpdateWorkflowFeature","StoreWorkflowFeature","GetWorkflowStateFeature","GetTargetWorkflowStateFeature","ListOwnWorkflowStatesFeature","ListWorkflowStatesFeature","ListRequestedWorkflowStatesFeature","CreateWorkflowStateFeature","UpdateWorkflowStateFeature","CancelWorkflowStateFeature","DeleteWorkflowStateFeature","DeleteTargetWorkflowStateFeature","StartWorkflowStateStepFeature","ApproveWorkflowStateStepFeature","RejectWorkflowStateStepFeature","TakeOverWorkflowStateStepFeature","GetUserTeamsFeature","ListNotificationTypesFeature","NotificationTransportFeature","createNotificationsGraphQL","createWorkflows","plugin","context","tenantContext","container","resolve","identityContext","wcpContext","getTenant","canUseWorkflows","register","getModel","withoutAuthorization","workflowModel","workflowStateModel","Promise","all","execute","registerInstance","value","plugins","name"],"sources":["index.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/handler\";\nimport { TenantContext } from \"@webiny/api-core/features/TenantContext\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { WcpContext } from \"@webiny/api-core/features/wcp/WcpContext/index.js\";\nimport { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\nimport {\n WorkflowModel as WorkflowPrivateModel,\n WORKFLOW_MODEL_ID\n} from \"./domain/workflow/workflowModel.js\";\nimport {\n WorkflowStateModel as WorkflowStatePrivateModel,\n WORKFLOW_STATE_MODEL_ID\n} from \"./domain/workflowState/stateModel.js\";\nimport { createWorkflowsSchema } from \"~/graphql/workflows.js\";\nimport { createWorkflowStateSchema } from \"~/graphql/workflowState.js\";\nimport { WorkflowModel } from \"./domain/workflow/abstractions.js\";\nimport { WorkflowStateModel } from \"./domain/workflowState/abstractions.js\";\nimport { WorkflowMapper } from \"~/domain/workflow/WorkflowMapper.js\";\nimport { WorkflowStateMapper } from \"~/domain/workflowState/WorkflowStateMapper.js\";\nimport { GetWorkflowFeature } from \"~/features/workflow/GetWorkflow/feature.js\";\nimport { ListWorkflowsFeature } from \"~/features/workflow/ListWorkflows/feature.js\";\nimport { CreateWorkflowFeature } from \"~/features/workflow/CreateWorkflow/feature.js\";\nimport { DeleteWorkflowFeature } from \"~/features/workflow/DeleteWorkflow/feature.js\";\nimport { UpdateWorkflowFeature } from \"~/features/workflow/UpdateWorkflow/feature.js\";\nimport { StoreWorkflowFeature } from \"~/features/workflow/StoreWorkflow/feature.js\";\nimport { GetWorkflowStateFeature } from \"~/features/workflowState/GetWorkflowState/feature.js\";\nimport { GetTargetWorkflowStateFeature } from \"~/features/workflowState/GetTargetWorkflowState/feature.js\";\nimport { ListOwnWorkflowStatesFeature } from \"~/features/workflowState/ListOwnWorkflowStates/feature.js\";\nimport { ListWorkflowStatesFeature } from \"~/features/workflowState/ListWorkflowStates/feature.js\";\nimport { ListRequestedWorkflowStatesFeature } from \"~/features/workflowState/ListRequestedWorkflowStates/feature.js\";\nimport { CreateWorkflowStateFeature } from \"~/features/workflowState/CreateWorkflowState/feature.js\";\nimport { UpdateWorkflowStateFeature } from \"~/features/workflowState/UpdateWorkflowState/feature.js\";\nimport { CancelWorkflowStateFeature } from \"~/features/workflowState/CancelWorkflowState/feature.js\";\nimport { DeleteWorkflowStateFeature } from \"~/features/workflowState/DeleteWorkflowState/feature.js\";\nimport { DeleteTargetWorkflowStateFeature } from \"~/features/workflowState/DeleteTargetWorkflowState/feature.js\";\nimport { StartWorkflowStateStepFeature } from \"~/features/workflowState/StartWorkflowStateStep/feature.js\";\nimport { ApproveWorkflowStateStepFeature } from \"~/features/workflowState/ApproveWorkflowStateStep/feature.js\";\nimport { RejectWorkflowStateStepFeature } from \"~/features/workflowState/RejectWorkflowStateStep/feature.js\";\nimport { TakeOverWorkflowStateStepFeature } from \"~/features/workflowState/TakeOverWorkflowStateStep/feature.js\";\nimport { GetUserTeamsFeature } from \"~/features/internal/GetUserTeams/feature.js\";\nimport { ListNotificationTypesFeature } from \"~/features/notifications/ListNotificationTypes/index.js\";\nimport { NotificationTransportFeature } from \"./features/notifications/NotificationTransport/index.js\";\nimport { createNotificationsGraphQL } from \"~/graphql/notifications.js\";\n\nexport const createWorkflows = () => {\n const plugin = new ContextPlugin(async context => {\n const tenantContext = context.container.resolve(TenantContext);\n const identityContext = context.container.resolve(IdentityContext);\n const wcpContext = context.container.resolve(WcpContext);\n\n if (!tenantContext.getTenant()) {\n return;\n }\n\n if (!wcpContext.canUseWorkflows()) {\n return;\n }\n\n // Register private models\n context.container.register(WorkflowPrivateModel);\n context.container.register(WorkflowStatePrivateModel);\n\n // Fetch and register CMS models\n const getModel = context.container.resolve(GetModelUseCase);\n\n await identityContext.withoutAuthorization(async () => {\n const [workflowModel, workflowStateModel] = await Promise.all([\n getModel.execute(WORKFLOW_MODEL_ID),\n getModel.execute(WORKFLOW_STATE_MODEL_ID)\n ]);\n\n context.container.registerInstance(WorkflowModel, workflowModel.value);\n context.container.registerInstance(WorkflowStateModel, workflowStateModel.value);\n });\n\n // Register mappers\n context.container.register(WorkflowMapper);\n context.container.register(WorkflowStateMapper);\n\n // Register notification features\n ListNotificationTypesFeature.register(context.container);\n NotificationTransportFeature.register(context.container);\n\n // Register workflow features\n GetWorkflowFeature.register(context.container);\n ListWorkflowsFeature.register(context.container);\n CreateWorkflowFeature.register(context.container);\n DeleteWorkflowFeature.register(context.container);\n UpdateWorkflowFeature.register(context.container);\n StoreWorkflowFeature.register(context.container);\n\n // Register internal features\n GetUserTeamsFeature.register(context.container);\n\n // Register workflow state features\n GetWorkflowStateFeature.register(context.container);\n GetTargetWorkflowStateFeature.register(context.container);\n ListOwnWorkflowStatesFeature.register(context.container);\n ListWorkflowStatesFeature.register(context.container);\n ListRequestedWorkflowStatesFeature.register(context.container);\n CreateWorkflowStateFeature.register(context.container);\n UpdateWorkflowStateFeature.register(context.container);\n CancelWorkflowStateFeature.register(context.container);\n DeleteWorkflowStateFeature.register(context.container);\n DeleteTargetWorkflowStateFeature.register(context.container);\n StartWorkflowStateStepFeature.register(context.container);\n ApproveWorkflowStateStepFeature.register(context.container);\n RejectWorkflowStateStepFeature.register(context.container);\n TakeOverWorkflowStateStepFeature.register(context.container);\n\n context.plugins.register(\n createNotificationsGraphQL(),\n createWorkflowsSchema(),\n createWorkflowStateSchema()\n );\n });\n\n plugin.name = \"workflows.context\";\n\n return plugin;\n};\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,aAAa,QAAQ,yCAAyC;AACvE,SAASC,eAAe,QAAQ,6DAA6D;AAC7F,SAASC,UAAU,QAAQ,mDAAmD;AAC9E,SAASC,eAAe,QAAQ,kEAAkE;AAClG,SACIC,aAAa,IAAIC,oBAAoB,EACrCC,iBAAiB;AAErB,SACIC,kBAAkB,IAAIC,yBAAyB,EAC/CC,uBAAuB;AAE3B,SAASC,qBAAqB;AAC9B,SAASC,yBAAyB;AAClC,SAASP,aAAa;AACtB,SAASG,kBAAkB;AAC3B,SAASK,cAAc;AACvB,SAASC,mBAAmB;AAC5B,SAASC,kBAAkB;AAC3B,SAASC,oBAAoB;AAC7B,SAASC,qBAAqB;AAC9B,SAASC,qBAAqB;AAC9B,SAASC,qBAAqB;AAC9B,SAASC,oBAAoB;AAC7B,SAASC,uBAAuB;AAChC,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Q,CAACR,OAAO,CAACE,SAAS,CAAC;IAC9DjB,0BAA0B,CAACuB,QAAQ,CAACR,OAAO,CAACE,SAAS,CAAC;IACtDhB,0BAA0B,CAACsB,QAAQ,CAACR,OAAO,CAACE,SAAS,CAAC;IACtDf,0BAA0B,CAACqB,QAAQ,CAACR,OAAO,CAACE,SAAS,CAAC;IACtDd,0BAA0B,CAACoB,QAAQ,CAACR,OAAO,CAACE,SAAS,CAAC;IACtDb,gCAAgC,CAACmB,QAAQ,CAACR,OAAO,CAACE,SAAS,CAAC;IAC5DZ,6BAA6B,CAACkB,QAAQ,CAACR,OAAO,CAACE,SAAS,CAAC;IACzDX,+BAA+B,CAACiB,QAAQ,CAACR,OAAO,CAACE,SAAS,CAAC;IAC3DV,8BAA8B,CAACgB,QAAQ,CAACR,OAAO,CAACE,SAAS,CAAC;IAC1DT,gCAAgC,CAACe,QAAQ,CAACR,OAAO,CAACE,SAAS,CAAC;IAE5DF,OAAO,CAACkB,OAAO,CAACV,QAAQ,CACpBX,0BAA0B,CAAC,CAAC,EAC5B3B,qBAAqB,CAAC,CAAC,EACvBC,yBAAyB,CAAC,CAC9B,CAAC;EACL,CAAC,CAAC;EAEF4B,MAAM,CAACoB,IAAI,GAAG,mBAAmB;EAEjC,OAAOpB,MAAM;AACjB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["ContextPlugin","TenantContext","IdentityContext","WcpContext","GetModelUseCase","WORKFLOW_MODEL_ID","WorkflowModel","WorkflowPrivateModel","WORKFLOW_STATE_MODEL_ID","WorkflowStateModel","WorkflowStatePrivateModel","createWorkflowsSchema","createWorkflowStateSchema","WorkflowMapper","WorkflowStateMapper","GetWorkflowFeature","ListWorkflowsFeature","CreateWorkflowFeature","DeleteWorkflowFeature","UpdateWorkflowFeature","StoreWorkflowFeature","GetWorkflowStateFeature","GetTargetWorkflowStateFeature","ListOwnWorkflowStatesFeature","ListWorkflowStatesFeature","ListRequestedWorkflowStatesFeature","CreateWorkflowStateFeature","UpdateWorkflowStateFeature","CancelWorkflowStateFeature","DeleteWorkflowStateFeature","DeleteTargetWorkflowStateFeature","StartWorkflowStateStepFeature","ApproveWorkflowStateStepFeature","RejectWorkflowStateStepFeature","TakeOverWorkflowStateStepFeature","GetUserTeamsFeature","ListNotificationTypesFeature","NotificationTransportFeature","createNotificationsGraphQL","createWorkflows","plugin","context","tenantContext","container","resolve","identityContext","wcpContext","hasTenant","getTenant","canUseWorkflows","register","getModel","withoutAuthorization","workflowModel","workflowStateModel","Promise","all","execute","registerInstance","value","plugins","name"],"sources":["index.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/handler\";\nimport { TenantContext } from \"@webiny/api-core/features/TenantContext\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { WcpContext } from \"@webiny/api-core/features/wcp/WcpContext/index.js\";\nimport { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\nimport {\n WORKFLOW_MODEL_ID,\n WorkflowModel as WorkflowPrivateModel\n} from \"./domain/workflow/workflowModel.js\";\nimport {\n WORKFLOW_STATE_MODEL_ID,\n WorkflowStateModel as WorkflowStatePrivateModel\n} from \"./domain/workflowState/stateModel.js\";\nimport { createWorkflowsSchema } from \"~/graphql/workflows.js\";\nimport { createWorkflowStateSchema } from \"~/graphql/workflowState.js\";\nimport { WorkflowModel } from \"./domain/workflow/abstractions.js\";\nimport { WorkflowStateModel } from \"./domain/workflowState/abstractions.js\";\nimport { WorkflowMapper } from \"~/domain/workflow/WorkflowMapper.js\";\nimport { WorkflowStateMapper } from \"~/domain/workflowState/WorkflowStateMapper.js\";\nimport { GetWorkflowFeature } from \"~/features/workflow/GetWorkflow/feature.js\";\nimport { ListWorkflowsFeature } from \"~/features/workflow/ListWorkflows/feature.js\";\nimport { CreateWorkflowFeature } from \"~/features/workflow/CreateWorkflow/feature.js\";\nimport { DeleteWorkflowFeature } from \"~/features/workflow/DeleteWorkflow/feature.js\";\nimport { UpdateWorkflowFeature } from \"~/features/workflow/UpdateWorkflow/feature.js\";\nimport { StoreWorkflowFeature } from \"~/features/workflow/StoreWorkflow/feature.js\";\nimport { GetWorkflowStateFeature } from \"~/features/workflowState/GetWorkflowState/feature.js\";\nimport { GetTargetWorkflowStateFeature } from \"~/features/workflowState/GetTargetWorkflowState/feature.js\";\nimport { ListOwnWorkflowStatesFeature } from \"~/features/workflowState/ListOwnWorkflowStates/feature.js\";\nimport { ListWorkflowStatesFeature } from \"~/features/workflowState/ListWorkflowStates/feature.js\";\nimport { ListRequestedWorkflowStatesFeature } from \"~/features/workflowState/ListRequestedWorkflowStates/feature.js\";\nimport { CreateWorkflowStateFeature } from \"~/features/workflowState/CreateWorkflowState/feature.js\";\nimport { UpdateWorkflowStateFeature } from \"~/features/workflowState/UpdateWorkflowState/feature.js\";\nimport { CancelWorkflowStateFeature } from \"~/features/workflowState/CancelWorkflowState/feature.js\";\nimport { DeleteWorkflowStateFeature } from \"~/features/workflowState/DeleteWorkflowState/feature.js\";\nimport { DeleteTargetWorkflowStateFeature } from \"~/features/workflowState/DeleteTargetWorkflowState/feature.js\";\nimport { StartWorkflowStateStepFeature } from \"~/features/workflowState/StartWorkflowStateStep/feature.js\";\nimport { ApproveWorkflowStateStepFeature } from \"~/features/workflowState/ApproveWorkflowStateStep/feature.js\";\nimport { RejectWorkflowStateStepFeature } from \"~/features/workflowState/RejectWorkflowStateStep/feature.js\";\nimport { TakeOverWorkflowStateStepFeature } from \"~/features/workflowState/TakeOverWorkflowStateStep/feature.js\";\nimport { GetUserTeamsFeature } from \"~/features/internal/GetUserTeams/feature.js\";\nimport { ListNotificationTypesFeature } from \"~/features/notifications/ListNotificationTypes/index.js\";\nimport { NotificationTransportFeature } from \"./features/notifications/NotificationTransport/index.js\";\nimport { createNotificationsGraphQL } from \"~/graphql/notifications.js\";\n\nexport const createWorkflows = () => {\n const plugin = new ContextPlugin(async context => {\n const tenantContext = context.container.resolve(TenantContext);\n const identityContext = context.container.resolve(IdentityContext);\n const wcpContext = context.container.resolve(WcpContext);\n\n const hasTenant = tenantContext.getTenant();\n const canUseWorkflows = wcpContext.canUseWorkflows();\n if (!hasTenant) {\n return;\n }\n\n if (!canUseWorkflows) {\n return;\n }\n\n // Register private models\n context.container.register(WorkflowPrivateModel);\n context.container.register(WorkflowStatePrivateModel);\n\n // Fetch and register CMS models\n const getModel = context.container.resolve(GetModelUseCase);\n\n await identityContext.withoutAuthorization(async () => {\n const [workflowModel, workflowStateModel] = await Promise.all([\n getModel.execute(WORKFLOW_MODEL_ID),\n getModel.execute(WORKFLOW_STATE_MODEL_ID)\n ]);\n\n context.container.registerInstance(WorkflowModel, workflowModel.value);\n context.container.registerInstance(WorkflowStateModel, workflowStateModel.value);\n });\n\n // Register mappers\n context.container.register(WorkflowMapper);\n context.container.register(WorkflowStateMapper);\n\n // Register notification features\n ListNotificationTypesFeature.register(context.container);\n NotificationTransportFeature.register(context.container);\n\n // Register workflow features\n GetWorkflowFeature.register(context.container);\n ListWorkflowsFeature.register(context.container);\n CreateWorkflowFeature.register(context.container);\n DeleteWorkflowFeature.register(context.container);\n UpdateWorkflowFeature.register(context.container);\n StoreWorkflowFeature.register(context.container);\n\n // Register internal features\n GetUserTeamsFeature.register(context.container);\n\n // Register workflow state features\n GetWorkflowStateFeature.register(context.container);\n GetTargetWorkflowStateFeature.register(context.container);\n ListOwnWorkflowStatesFeature.register(context.container);\n ListWorkflowStatesFeature.register(context.container);\n ListRequestedWorkflowStatesFeature.register(context.container);\n CreateWorkflowStateFeature.register(context.container);\n UpdateWorkflowStateFeature.register(context.container);\n CancelWorkflowStateFeature.register(context.container);\n DeleteWorkflowStateFeature.register(context.container);\n DeleteTargetWorkflowStateFeature.register(context.container);\n StartWorkflowStateStepFeature.register(context.container);\n ApproveWorkflowStateStepFeature.register(context.container);\n RejectWorkflowStateStepFeature.register(context.container);\n TakeOverWorkflowStateStepFeature.register(context.container);\n\n context.plugins.register(\n createNotificationsGraphQL(),\n createWorkflowsSchema(),\n createWorkflowStateSchema()\n );\n });\n\n plugin.name = \"workflows.context\";\n\n return plugin;\n};\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,aAAa,QAAQ,yCAAyC;AACvE,SAASC,eAAe,QAAQ,6DAA6D;AAC7F,SAASC,UAAU,QAAQ,mDAAmD;AAC9E,SAASC,eAAe,QAAQ,kEAAkE;AAClG,SACIC,iBAAiB,EACjBC,aAAa,IAAIC,oBAAoB;AAEzC,SACIC,uBAAuB,EACvBC,kBAAkB,IAAIC,yBAAyB;AAEnD,SAASC,qBAAqB;AAC9B,SAASC,yBAAyB;AAClC,SAASN,aAAa;AACtB,SAASG,kBAAkB;AAC3B,SAASI,cAAc;AACvB,SAASC,mBAAmB;AAC5B,SAASC,kBAAkB;AAC3B,SAASC,oBAAoB;AAC7B,SAASC,qBAAqB;AAC9B,SAASC,qBAAqB;AAC9B,SAASC,qBAAqB;AAC9B,SAASC,oBAAoB;AAC7B,SAASC,uBAAuB;AAChC,SAASC,6BAA6B;AACtC,SAASC,4BAA4B;AACrC,SAASC,yBAAyB;AAClC,SAASC,kCAAkC;AAC3C,SAASC,0BAA0B;AACnC,SAASC,0BAA0B;AACnC,SAASC,0BAA0B;AACnC,SAASC,0BAA0B;AACnC,SAASC,gCAAgC;AACzC,SAASC,6BAA6B;AACtC,SAASC,+BAA+B;AACxC,SAASC,8BAA8B;AACvC,SAASC,gCAAgC;AACzC,SAASC,mBAAmB;AAC5B,SAASC,4BAA4B;AACrC,SAASC,4BAA4B;AACrC,SAASC,0BAA0B;AAEnC,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM;EACjC,MAAMC,MAAM,GAAG,IAAIxC,aAAa,CAAC,MAAMyC,OAAO,IAAI;IAC9C,MAAMC,aAAa,GAAGD,OAAO,CAACE,SAAS,CAACC,OAAO,CAAC3C,aAAa,CAAC;IAC9D,MAAM4C,eAAe,GAAGJ,OAAO,CAACE,SAAS,CAACC,OAAO,CAAC1C,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ACgB,QAAQ,CAACT,OAAO,CAACE,SAAS,CAAC;IAE5DF,OAAO,CAACmB,OAAO,CAACV,QAAQ,CACpBZ,0BAA0B,CAAC,CAAC,EAC5B3B,qBAAqB,CAAC,CAAC,EACvBC,yBAAyB,CAAC,CAC9B,CAAC;EACL,CAAC,CAAC;EAEF4B,MAAM,CAACqB,IAAI,GAAG,mBAAmB;EAEjC,OAAOrB,MAAM;AACjB,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.81ae05e56b",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"description": "Workflows API",
|
|
@@ -14,28 +14,28 @@
|
|
|
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.
|
|
25
|
-
"zod": "3.
|
|
17
|
+
"@webiny/api": "0.0.0-unstable.81ae05e56b",
|
|
18
|
+
"@webiny/api-core": "0.0.0-unstable.81ae05e56b",
|
|
19
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.81ae05e56b",
|
|
20
|
+
"@webiny/api-mailer": "0.0.0-unstable.81ae05e56b",
|
|
21
|
+
"@webiny/feature": "0.0.0-unstable.81ae05e56b",
|
|
22
|
+
"@webiny/handler": "0.0.0-unstable.81ae05e56b",
|
|
23
|
+
"@webiny/handler-graphql": "0.0.0-unstable.81ae05e56b",
|
|
24
|
+
"@webiny/utils": "0.0.0-unstable.81ae05e56b",
|
|
25
|
+
"zod": "4.3.6"
|
|
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.
|
|
32
|
-
"type-fest": "5.
|
|
28
|
+
"@webiny/build-tools": "0.0.0-unstable.81ae05e56b",
|
|
29
|
+
"@webiny/plugins": "0.0.0-unstable.81ae05e56b",
|
|
30
|
+
"@webiny/project-utils": "0.0.0-unstable.81ae05e56b",
|
|
31
|
+
"@webiny/testing": "0.0.0-unstable.81ae05e56b",
|
|
32
|
+
"type-fest": "5.5.0",
|
|
33
33
|
"typescript": "5.9.3",
|
|
34
|
-
"vitest": "
|
|
34
|
+
"vitest": "4.1.0"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public",
|
|
38
38
|
"directory": "dist"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "81ae05e56bcc774d1e077ca615a0005e736aa5a6"
|
|
41
41
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import type { SecurityPermission } from "@webiny/api-core/types/security.js";
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export interface ICmsEntryWorkflowState {
|
|
3
|
+
state: string;
|
|
4
|
+
workflowId: string;
|
|
5
|
+
stepId: string;
|
|
6
|
+
stepName: string;
|
|
5
7
|
}
|
|
6
8
|
export interface IWorkflowsSecurityPermission extends SecurityPermission {
|
|
7
|
-
editor:
|
|
9
|
+
editor: boolean;
|
|
8
10
|
}
|
|
9
11
|
export interface IMeta {
|
|
10
12
|
totalCount: number;
|
|
11
13
|
hasMoreItems: boolean;
|
|
12
14
|
cursor: string | null;
|
|
13
15
|
}
|
|
16
|
+
declare module "@webiny/api-headless-cms/types/types.js" {
|
|
17
|
+
interface IEntrySystem {
|
|
18
|
+
workflow?: ICmsEntryWorkflowState | null;
|
|
19
|
+
}
|
|
20
|
+
}
|
package/types.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
WorkflowsSecurityPermissionAccessLevel["NO"] = "no";
|
|
3
|
-
WorkflowsSecurityPermissionAccessLevel["YES"] = "yes";
|
|
4
|
-
return WorkflowsSecurityPermissionAccessLevel;
|
|
5
|
-
}({});
|
|
1
|
+
export {};
|
|
6
2
|
|
|
7
3
|
//# sourceMappingURL=types.js.map
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { SecurityPermission } from \"@webiny/api-core/types/security.js\";\n\nexport interface ICmsEntryWorkflowState {\n state: string;\n workflowId: string;\n stepId: string;\n stepName: string;\n}\n\nexport interface IWorkflowsSecurityPermission extends SecurityPermission {\n editor: boolean;\n}\n\nexport interface IMeta {\n totalCount: number;\n hasMoreItems: boolean;\n cursor: string | null;\n}\n\ndeclare module \"@webiny/api-headless-cms/types/types.js\" {\n export interface IEntrySystem {\n workflow?: ICmsEntryWorkflowState | null;\n }\n}\n"],"mappings":"","ignoreList":[]}
|