@nocobase/plugin-workflow 1.2.2-alpha → 1.2.3-alpha
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/dist/client/index.js
CHANGED
|
@@ -566,4 +566,4 @@
|
|
|
566
566
|
.ant-form-item-control-input-content {
|
|
567
567
|
display: flex;
|
|
568
568
|
}
|
|
569
|
-
`,children:[r.jsx(i.Variable.Input,{scope:u,value:e[S.name],changeOnSelect:!0,onChange:T=>{o(O(C({},e),{[S.name]:T}))},children:r.jsx(i.SchemaComponent,{schema:{type:"void",properties:{[S.name]:{"x-component":M,"x-validator"(){return""}}}}})}),F?null:r.jsx(b.Button,{"aria-label":"icon-close",type:"link",icon:r.jsx($.CloseCircleOutlined,{}),onClick:()=>{var A;const P=e,{[A=S.name]:T}=P,I=X(P,[Yo(A)]);o(I)}})]},S.name)}),k.length?r.jsx(b.Dropdown,{menu:E,children:r.jsx(b.Button,{icon:r.jsx($.PlusOutlined,{}),children:a("Add field")})}):null]}):r.jsx("p",{style:{color:s.colorText},children:N("Please select collection first")})})},{displayName:"CollectionFieldSet"});function To(e,t){t(e),e!=null&&e.properties&&Object.values(e.properties).forEach(o=>{To(o,t)})}function No(){return{name:He.uid(),type:"void","x-component":"Grid","x-initializer":"assignFieldValuesForm:configureFields"}}function Eo(e){const{workflow:t}=q(),{setFormValueChanged:o}=i.useActionContext();i.useAPIClient();const n=me(),s=j.useForm(),{values:a,setValuesIn:l}=s,c=ft.toJS(a.params),[d,u]=i.parseCollectionName(a.collection),f=i.useSchemaOptionsContext(),[h,x]=g.useState(e.value&&Object.keys(e.value).length?e.value:No()),y=g.useMemo(()=>ie.createForm({initialValues:c.values,disabled:t.executed,effects(){ie.onFormValuesChange(k=>{l("params.values",ft.toJS(k.values)),o(!0)})}}),[t.executed]);j.useFormEffects(()=>{ie.onFieldValueChange("collection",k=>G(this,null,function*(){y.clearFormGraph("*");const F=No();l("params.values",{}),x(F)}))});const m=g.useCallback(k=>{const[F]=Object.values(k.toJSON().properties);e.onChange(F);const E=new Set;To(F,M=>{var W;if(M["x-component"]==="AssignedField"&&(W=M["x-collection-field"])!=null&&W.startsWith(`${u}.`)){const[,J]=M["x-collection-field"].split(".");E.add(J)}});const S={};Array.from(E).forEach(M=>{M in y.values&&(S[M]=y.values[M])}),l("params.values",S)},[u,e.onChange]);return r.jsx(i.CollectionManagerProvider,{dataSource:d,children:r.jsx(i.CollectionProvider,{name:u,children:r.jsx(i.FormProvider,{form:y,children:r.jsx(Pt.FormLayout,{layout:"vertical",children:r.jsx(i.VariableScopeProvider,{scope:n,children:r.jsx(i.SchemaComponentProvider,{form:y,designable:!0,children:r.jsx(i.SchemaComponentOptions,O(C({},f),{children:r.jsx(i.SchemaComponent,{schema:h,onChange:m})}))})})})})})})}function xr({key:e,title:t,config:o},n){var u,f;const[s,a]=i.parseCollectionName(o.collection),l=i.useCompile(),c=je(s),[d]=Ae(O(C({appends:[e,...((f=(u=o.params)==null?void 0:u.appends)==null?void 0:f.map(h=>`${e}.${h}`))||[]]},n),{fields:[{collectionName:a,name:e,type:"hasOne",target:a,uiSchema:{title:t}}],compile:l,getCollectionFields:c}));return d}class wr extends ge{constructor(){super(...arguments);w(this,"title",`{{t("Create record", { ns: "${p}" })}}`);w(this,"type","create");w(this,"group","collection");w(this,"description",`{{t("Add new record to a collection. You can use variables from upstream nodes to assign values to fields.", { ns: "${p}" })}}`);w(this,"fieldset",{collection:O(C({},ae),{"x-disabled":'{{ useNodeSavedConfig(["collection"]) }}',"x-reactions":[...ae["x-reactions"],{target:"params",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}}]}),assignFormSchema:{type:"object",title:'{{t("Fields values")}}',"x-decorator":"FormItem","x-component":"AssignedFieldsFormSchemaConfig","x-reactions":[{dependencies:["collection"],fulfill:{state:{display:'{{($deps[0] && $self.value) ? "visible" : "hidden"}}'}}}]},params:{type:"object",properties:{values:O(C({},Rt),{"x-reactions":[{dependencies:["collection","assignFormSchema"],fulfill:{state:{display:'{{($deps[0] && !$deps[1]) ? "visible" : "hidden"}}'}}}]}),appends:Ve}}});w(this,"scope",{useCollectionDataSource:i.useCollectionDataSource,useNodeSavedConfig:Pe});w(this,"components",{CollectionFieldset:Fo,AssignedFieldsFormSchemaConfig:Eo});w(this,"useVariables",xr)}createDefaultConfig(){return{assignFormSchema:{}}}useInitializers(o){var n,s;return o.config.collection?{name:(n=o.title)!=null?n:`#${o.id}`,type:"item",title:(s=o.title)!=null?s:`#${o.id}`,Component:Be,collection:o.config.collection,dataPath:`$jobsMapByNodeKey.${o.key}`}:null}}class Cr extends ge{constructor(){super(...arguments);w(this,"title",`{{t("Update record", { ns: "${p}" })}}`);w(this,"type","update");w(this,"group","collection");w(this,"description",`{{t("Update records of a collection. You can use variables from upstream nodes as query conditions and field values.", { ns: "${p}" })}}`);w(this,"fieldset",{collection:O(C({},ae),{"x-disabled":'{{ useNodeSavedConfig(["collection"]) }}',"x-reactions":[...ae["x-reactions"],{target:"params",fulfill:{state:{visible:"{{!!$self.value}}"}}},{target:"params.filter",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}},{target:"params.values",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}}]}),params:{type:"object",properties:{individualHooks:{type:"boolean",title:`{{t("Update mode", { ns: "${p}" })}}`,"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{options:[{label:`{{t("Update in a batch", { ns: "${p}" })}}`,value:!1,tooltip:`{{t("Update all eligible data at one time, which has better performance when the amount of data is large. But the updated data will not trigger other workflows, and will not record audit logs.", { ns: "${p}" })}}`},{label:`{{t("Update one by one", { ns: "${p}" })}}`,value:!0,tooltip:`{{t("The updated data can trigger other workflows, and the audit log will also be recorded. But it is usually only applicable to several or dozens of pieces of data, otherwise there will be performance problems.", { ns: "${p}" })}}`}]},default:!1},filter:O(C({},Ze),{title:`{{t("Only update records matching conditions", { ns: "${p}" })}}`,"x-validator"(o){return U.isValidFilter(o)?"":N("Please add at least one condition")}}),values:O(C({},Rt),{"x-reactions":[{dependencies:["collection","assignFormSchema"],fulfill:{state:{display:'{{($deps[0] && !$deps[1]) ? "visible" : "hidden"}}'}}}]})}},assignFormSchema:{type:"object",title:'{{t("Fields values")}}',"x-decorator":"FormItem","x-component":"AssignedFieldsFormSchemaConfig","x-reactions":[{dependencies:["collection"],fulfill:{state:{display:'{{($deps[0] && $self.value) ? "visible" : "hidden"}}'}}}]}});w(this,"scope",{useCollectionDataSource:i.useCollectionDataSource,useNodeSavedConfig:Pe});w(this,"components",{FilterDynamicComponent:ot,CollectionFieldset:Fo,AssignedFieldsFormSchemaConfig:Eo,RadioWithTooltip:Te})}createDefaultConfig(){return{assignForm:He.uid()}}}class kr extends ge{constructor(){super(...arguments);w(this,"title",'{{t("Delete record")}}');w(this,"type","destroy");w(this,"group","collection");w(this,"description",`{{t("Delete records of a collection. Could use variables in workflow context as filter. All records match the filter will be deleted.", { ns: "${p}" })}}`);w(this,"fieldset",{collection:O(C({},ae),{"x-disabled":'{{ useNodeSavedConfig(["collection"]) }}',"x-reactions":[...ae["x-reactions"],{target:"params",fulfill:{state:{visible:"{{!!$self.value}}"}}},{target:"params",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}}]}),params:{type:"object",properties:{filter:O(C({},Ze),{"x-validator"(o){return U.isValidFilter(o)?"":N("Please add at least one condition")}})}}});w(this,"scope",{useNodeSavedConfig:Pe,useCollectionDataSource:i.useCollectionDataSource});w(this,"components",{FilterDynamicComponent:ot})}}const Sr=new i.SchemaSettings({name:"actionSettings:submitToWorkflow",items:[{name:"editButton",Component:i.ButtonEditor,useComponentProps(){const{buttonEditorProps:e}=i.useSchemaToolbar();return e}},{name:"secondConfirmation",Component:i.SecondConFirm},{name:"assignFieldValues",Component:i.AssignedFieldValues},{name:"skipRequiredValidation",Component:i.SkipValidation},{name:"afterSuccessfulSubmission",Component:i.AfterSuccess,useVisible(){var t;const e=j.useFieldSchema();return He.isValid((t=e==null?void 0:e["x-action-settings"])==null?void 0:t.onSuccess)}},{name:"bindWorkflow",Component:i.WorkflowConfig},{name:"delete",sort:100,Component:i.RemoveButton,useComponentProps(){const{removeButtonProps:e}=i.useSchemaToolbar();return e}}]});function Ar({children:e,workflow:t,execution:o,nodes:n}){const s=i.usePlugin(ue),a=s.triggers.get(t.type).components,l=n.reduce((c,{type:d})=>Object.assign(c,s.instructions.get(d).components),{});return r.jsx(Me.Provider,{value:{workflow:t,nodes:n,execution:o},children:r.jsx(i.SchemaComponentOptions,{components:C(C({},a),l),children:e})})}class ue extends i.Plugin{constructor(){super(...arguments);w(this,"triggers",new U.Registry);w(this,"instructions",new U.Registry);w(this,"getTriggersOptions",()=>Array.from(this.triggers.getEntities()).map(a=>{var[o,l]=a,c=l,{title:n}=c,s=X(c,["title"]);return{value:o,label:n,color:"gold",options:s}}))}isWorkflowSync(o){var n;return(n=this.triggers.get(o.type).sync)!=null?n:o.sync}registerTrigger(o,n){if(typeof n=="function")this.triggers.register(o,new n);else if(n)this.triggers.register(o,n);else throw new TypeError("invalid trigger type to register")}registerInstruction(o,n){if(typeof n=="function")this.instructions.register(o,new n);else if(n instanceof ge)this.instructions.register(o,n);else throw new TypeError("invalid instruction type to register")}load(){return G(this,null,function*(){this.app.router.add("admin.workflow.workflows.id",{path:xe(":id"),element:r.jsx(Qt,{})}),this.app.router.add("admin.workflow.executions.id",{path:_e(":id"),element:r.jsx(Gt,{})}),this.app.addComponents({WorkflowPage:Qt,ExecutionPage:Gt}),this.app.pluginSettingsManager.add(p,{icon:"PartitionOutlined",title:`{{t("Workflow", { ns: "${p}" })}}`,Component:On,aclSnippet:"pm.workflow.workflows"}),this.app.schemaSettingsManager.add(Sr),this.registerTrigger("collection",Wn),this.registerTrigger("schedule",rr),this.registerInstruction("calculation",lr),this.registerInstruction("condition",pr),this.registerInstruction("end",mr),this.registerInstruction("query",br),this.registerInstruction("create",wr),this.registerInstruction("update",Cr),this.registerInstruction("destroy",kr)})}}v.BaseTypeSets=Qe,v.Branch=Ke,v.CheckboxGroupWithTooltip=yr,v.CollectionBlockInitializer=Be,v.DetailsBlockProvider=hr,v.EXECUTION_STATUS=pe,v.ExecutionContextProvider=Ar,v.ExecutionStatusOptions=Ge,v.ExecutionStatusOptionsMap=qe,v.FieldsSelect=At,v.FilterDynamicComponent=ot,v.FlowContext=Me,v.Instruction=ge,v.JOB_STATUS=le,v.JobButton=Ut,v.JobStatusOptions=bt,v.JobStatusOptionsMap=Ye,v.Node=zt,v.NodeContext=vt,v.NodeDefaultView=xt,v.RadioWithTooltip=Te,v.RemoveButton=Jt,v.SimpleDesigner=ko,v.Trigger=wt,v.ValueBlock=Ne,v.WorkflowVariableInput=so,v.WorkflowVariableJSON=Mn,v.WorkflowVariableRawTextArea=$n,v.WorkflowVariableTextArea=Et,v.default=ue,v.defaultFieldNames=Se,v.getCollectionFieldOptions=Ae,v.getWorkflowDetailPath=xe,v.getWorkflowExecutionsPath=_e,v.linkNodes=kt,v.nodesOptions=eo,v.scopeOptions=oo,v.systemOptions=no,v.traverseSchema=St,v.triggerOptions=to,v.useAvailableUpstreams=Wt,v.useFlowContext=q,v.useGetAriaLabelOfAddButton=gt,v.useGetCollectionFields=je,v.useNodeContext=ve,v.useNodeSavedConfig=Pe,v.useRecordTriggerWorkflowsActionProps=Pn,v.useStyles=ne,v.useTrigger=Ct,v.useTriggerWorkflowsActionProps=In,v.useUpstreamScopes=Lt,v.useWorkflowAnyExecuted=io,v.useWorkflowExecuted=Bn,v.useWorkflowVariableOptions=me,Object.defineProperties(v,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
569
|
+
`,children:[r.jsx(i.Variable.Input,{scope:u,value:e[S.name],changeOnSelect:!0,onChange:T=>{o(O(C({},e),{[S.name]:T}))},children:r.jsx(i.SchemaComponent,{schema:{type:"void",properties:{[S.name]:{"x-component":M,"x-validator"(){return""}}}}})}),F?null:r.jsx(b.Button,{"aria-label":"icon-close",type:"link",icon:r.jsx($.CloseCircleOutlined,{}),onClick:()=>{var A;const P=e,{[A=S.name]:T}=P,I=X(P,[Yo(A)]);o(I)}})]},S.name)}),k.length?r.jsx(b.Dropdown,{menu:E,children:r.jsx(b.Button,{icon:r.jsx($.PlusOutlined,{}),children:a("Add field")})}):null]}):r.jsx("p",{style:{color:s.colorText},children:N("Please select collection first")})})},{displayName:"CollectionFieldSet"});function To(e,t){t(e),e!=null&&e.properties&&Object.values(e.properties).forEach(o=>{To(o,t)})}function No(){return{name:He.uid(),type:"void","x-component":"Grid","x-initializer":"assignFieldValuesForm:configureFields"}}function Eo(e){const{workflow:t}=q(),{setFormValueChanged:o}=i.useActionContext();i.useAPIClient();const n=me(),s=j.useForm(),{values:a,setValuesIn:l}=s,c=ft.toJS(a.params),[d,u]=i.parseCollectionName(a.collection),f=i.useSchemaOptionsContext(),[h,x]=g.useState(e.value&&Object.keys(e.value).length?e.value:No()),y=g.useMemo(()=>ie.createForm({initialValues:c.values,disabled:t.executed,effects(){ie.onFormValuesChange(k=>{l("params.values",ft.toJS(k.values)),o(!0)})}}),[t.executed]);j.useFormEffects(()=>{ie.onFieldValueChange("collection",k=>G(this,null,function*(){y.clearFormGraph("*");const F=No();l("params.values",{}),x(F)}))});const m=g.useCallback(k=>{const[F]=Object.values(k.toJSON().properties);e.onChange(F);const E=new Set;To(F,M=>{var W;if(M["x-component"]==="AssignedField"&&(W=M["x-collection-field"])!=null&&W.startsWith(`${u}.`)){const[,J]=M["x-collection-field"].split(".");E.add(J)}});const S={};Array.from(E).forEach(M=>{M in y.values&&(S[M]=y.values[M])}),l("params.values",S)},[u,e.onChange]);return r.jsx(b.Card,{children:r.jsx(i.CollectionManagerProvider,{dataSource:d,children:r.jsx(i.CollectionProvider,{name:u,children:r.jsx(i.FormProvider,{form:y,children:r.jsx(Pt.FormLayout,{layout:"vertical",children:r.jsx(i.VariableScopeProvider,{scope:n,children:r.jsx(i.SchemaComponentProvider,{form:y,designable:!0,children:r.jsx(i.SchemaComponentOptions,O(C({},f),{children:r.jsx(i.SchemaComponent,{schema:h,onChange:m})}))})})})})})})})}function xr({key:e,title:t,config:o},n){var u,f;const[s,a]=i.parseCollectionName(o.collection),l=i.useCompile(),c=je(s),[d]=Ae(O(C({appends:[e,...((f=(u=o.params)==null?void 0:u.appends)==null?void 0:f.map(h=>`${e}.${h}`))||[]]},n),{fields:[{collectionName:a,name:e,type:"hasOne",target:a,uiSchema:{title:t}}],compile:l,getCollectionFields:c}));return d}class wr extends ge{constructor(){super(...arguments);w(this,"title",`{{t("Create record", { ns: "${p}" })}}`);w(this,"type","create");w(this,"group","collection");w(this,"description",`{{t("Add new record to a collection. You can use variables from upstream nodes to assign values to fields.", { ns: "${p}" })}}`);w(this,"fieldset",{collection:O(C({},ae),{"x-disabled":'{{ useNodeSavedConfig(["collection"]) }}',"x-reactions":[...ae["x-reactions"],{target:"params",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}}]}),assignFormSchema:{type:"object",title:'{{t("Fields values")}}',"x-decorator":"FormItem","x-component":"AssignedFieldsFormSchemaConfig","x-reactions":[{dependencies:["collection"],fulfill:{state:{display:'{{($deps[0] && $self.value) ? "visible" : "hidden"}}'}}}]},params:{type:"object",properties:{values:O(C({},Rt),{"x-reactions":[{dependencies:["collection","assignFormSchema"],fulfill:{state:{display:'{{($deps[0] && !$deps[1]) ? "visible" : "hidden"}}'}}}]}),appends:Ve}}});w(this,"scope",{useCollectionDataSource:i.useCollectionDataSource,useNodeSavedConfig:Pe});w(this,"components",{CollectionFieldset:Fo,AssignedFieldsFormSchemaConfig:Eo});w(this,"useVariables",xr)}createDefaultConfig(){return{assignFormSchema:{}}}useInitializers(o){var n,s;return o.config.collection?{name:(n=o.title)!=null?n:`#${o.id}`,type:"item",title:(s=o.title)!=null?s:`#${o.id}`,Component:Be,collection:o.config.collection,dataPath:`$jobsMapByNodeKey.${o.key}`}:null}}class Cr extends ge{constructor(){super(...arguments);w(this,"title",`{{t("Update record", { ns: "${p}" })}}`);w(this,"type","update");w(this,"group","collection");w(this,"description",`{{t("Update records of a collection. You can use variables from upstream nodes as query conditions and field values.", { ns: "${p}" })}}`);w(this,"fieldset",{collection:O(C({},ae),{"x-disabled":'{{ useNodeSavedConfig(["collection"]) }}',"x-reactions":[...ae["x-reactions"],{target:"params",fulfill:{state:{visible:"{{!!$self.value}}"}}},{target:"params.filter",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}},{target:"params.values",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}}]}),params:{type:"object",properties:{individualHooks:{type:"boolean",title:`{{t("Update mode", { ns: "${p}" })}}`,"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{options:[{label:`{{t("Update in a batch", { ns: "${p}" })}}`,value:!1,tooltip:`{{t("Update all eligible data at one time, which has better performance when the amount of data is large. But the updated data will not trigger other workflows, and will not record audit logs.", { ns: "${p}" })}}`},{label:`{{t("Update one by one", { ns: "${p}" })}}`,value:!0,tooltip:`{{t("The updated data can trigger other workflows, and the audit log will also be recorded. But it is usually only applicable to several or dozens of pieces of data, otherwise there will be performance problems.", { ns: "${p}" })}}`}]},default:!1},filter:O(C({},Ze),{title:`{{t("Only update records matching conditions", { ns: "${p}" })}}`,"x-validator"(o){return U.isValidFilter(o)?"":N("Please add at least one condition")}}),values:O(C({},Rt),{"x-reactions":[{dependencies:["collection","assignFormSchema"],fulfill:{state:{display:'{{($deps[0] && !$deps[1]) ? "visible" : "hidden"}}'}}}]})}},assignFormSchema:{type:"object",title:'{{t("Fields values")}}',"x-decorator":"FormItem","x-component":"AssignedFieldsFormSchemaConfig","x-reactions":[{dependencies:["collection"],fulfill:{state:{display:'{{($deps[0] && $self.value) ? "visible" : "hidden"}}'}}}]}});w(this,"scope",{useCollectionDataSource:i.useCollectionDataSource,useNodeSavedConfig:Pe});w(this,"components",{FilterDynamicComponent:ot,CollectionFieldset:Fo,AssignedFieldsFormSchemaConfig:Eo,RadioWithTooltip:Te})}createDefaultConfig(){return{assignForm:He.uid()}}}class kr extends ge{constructor(){super(...arguments);w(this,"title",'{{t("Delete record")}}');w(this,"type","destroy");w(this,"group","collection");w(this,"description",`{{t("Delete records of a collection. Could use variables in workflow context as filter. All records match the filter will be deleted.", { ns: "${p}" })}}`);w(this,"fieldset",{collection:O(C({},ae),{"x-disabled":'{{ useNodeSavedConfig(["collection"]) }}',"x-reactions":[...ae["x-reactions"],{target:"params",fulfill:{state:{visible:"{{!!$self.value}}"}}},{target:"params",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}}]}),params:{type:"object",properties:{filter:O(C({},Ze),{"x-validator"(o){return U.isValidFilter(o)?"":N("Please add at least one condition")}})}}});w(this,"scope",{useNodeSavedConfig:Pe,useCollectionDataSource:i.useCollectionDataSource});w(this,"components",{FilterDynamicComponent:ot})}}const Sr=new i.SchemaSettings({name:"actionSettings:submitToWorkflow",items:[{name:"editButton",Component:i.ButtonEditor,useComponentProps(){const{buttonEditorProps:e}=i.useSchemaToolbar();return e}},{name:"secondConfirmation",Component:i.SecondConFirm},{name:"assignFieldValues",Component:i.AssignedFieldValues},{name:"skipRequiredValidation",Component:i.SkipValidation},{name:"afterSuccessfulSubmission",Component:i.AfterSuccess,useVisible(){var t;const e=j.useFieldSchema();return He.isValid((t=e==null?void 0:e["x-action-settings"])==null?void 0:t.onSuccess)}},{name:"bindWorkflow",Component:i.WorkflowConfig},{name:"delete",sort:100,Component:i.RemoveButton,useComponentProps(){const{removeButtonProps:e}=i.useSchemaToolbar();return e}}]});function Ar({children:e,workflow:t,execution:o,nodes:n}){const s=i.usePlugin(ue),a=s.triggers.get(t.type).components,l=n.reduce((c,{type:d})=>Object.assign(c,s.instructions.get(d).components),{});return r.jsx(Me.Provider,{value:{workflow:t,nodes:n,execution:o},children:r.jsx(i.SchemaComponentOptions,{components:C(C({},a),l),children:e})})}class ue extends i.Plugin{constructor(){super(...arguments);w(this,"triggers",new U.Registry);w(this,"instructions",new U.Registry);w(this,"getTriggersOptions",()=>Array.from(this.triggers.getEntities()).map(a=>{var[o,l]=a,c=l,{title:n}=c,s=X(c,["title"]);return{value:o,label:n,color:"gold",options:s}}))}isWorkflowSync(o){var n;return(n=this.triggers.get(o.type).sync)!=null?n:o.sync}registerTrigger(o,n){if(typeof n=="function")this.triggers.register(o,new n);else if(n)this.triggers.register(o,n);else throw new TypeError("invalid trigger type to register")}registerInstruction(o,n){if(typeof n=="function")this.instructions.register(o,new n);else if(n instanceof ge)this.instructions.register(o,n);else throw new TypeError("invalid instruction type to register")}load(){return G(this,null,function*(){this.app.router.add("admin.workflow.workflows.id",{path:xe(":id"),element:r.jsx(Qt,{})}),this.app.router.add("admin.workflow.executions.id",{path:_e(":id"),element:r.jsx(Gt,{})}),this.app.addComponents({WorkflowPage:Qt,ExecutionPage:Gt}),this.app.pluginSettingsManager.add(p,{icon:"PartitionOutlined",title:`{{t("Workflow", { ns: "${p}" })}}`,Component:On,aclSnippet:"pm.workflow.workflows"}),this.app.schemaSettingsManager.add(Sr),this.registerTrigger("collection",Wn),this.registerTrigger("schedule",rr),this.registerInstruction("calculation",lr),this.registerInstruction("condition",pr),this.registerInstruction("end",mr),this.registerInstruction("query",br),this.registerInstruction("create",wr),this.registerInstruction("update",Cr),this.registerInstruction("destroy",kr)})}}v.BaseTypeSets=Qe,v.Branch=Ke,v.CheckboxGroupWithTooltip=yr,v.CollectionBlockInitializer=Be,v.DetailsBlockProvider=hr,v.EXECUTION_STATUS=pe,v.ExecutionContextProvider=Ar,v.ExecutionStatusOptions=Ge,v.ExecutionStatusOptionsMap=qe,v.FieldsSelect=At,v.FilterDynamicComponent=ot,v.FlowContext=Me,v.Instruction=ge,v.JOB_STATUS=le,v.JobButton=Ut,v.JobStatusOptions=bt,v.JobStatusOptionsMap=Ye,v.Node=zt,v.NodeContext=vt,v.NodeDefaultView=xt,v.RadioWithTooltip=Te,v.RemoveButton=Jt,v.SimpleDesigner=ko,v.Trigger=wt,v.ValueBlock=Ne,v.WorkflowVariableInput=so,v.WorkflowVariableJSON=Mn,v.WorkflowVariableRawTextArea=$n,v.WorkflowVariableTextArea=Et,v.default=ue,v.defaultFieldNames=Se,v.getCollectionFieldOptions=Ae,v.getWorkflowDetailPath=xe,v.getWorkflowExecutionsPath=_e,v.linkNodes=kt,v.nodesOptions=eo,v.scopeOptions=oo,v.systemOptions=no,v.traverseSchema=St,v.triggerOptions=to,v.useAvailableUpstreams=Wt,v.useFlowContext=q,v.useGetAriaLabelOfAddButton=gt,v.useGetCollectionFields=je,v.useNodeContext=ve,v.useNodeSavedConfig=Pe,v.useRecordTriggerWorkflowsActionProps=Pn,v.useStyles=ne,v.useTrigger=Ct,v.useTriggerWorkflowsActionProps=In,v.useUpstreamScopes=Lt,v.useWorkflowAnyExecuted=io,v.useWorkflowExecuted=Bn,v.useWorkflowVariableOptions=me,Object.defineProperties(v,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -11,24 +11,24 @@ module.exports = {
|
|
|
11
11
|
"react": "18.2.0",
|
|
12
12
|
"antd": "5.12.8",
|
|
13
13
|
"@ant-design/icons": "5.2.6",
|
|
14
|
-
"@nocobase/client": "1.2.
|
|
14
|
+
"@nocobase/client": "1.2.3-alpha",
|
|
15
15
|
"react-router-dom": "6.21.0",
|
|
16
|
-
"@nocobase/utils": "1.2.
|
|
16
|
+
"@nocobase/utils": "1.2.3-alpha",
|
|
17
17
|
"react-i18next": "11.18.6",
|
|
18
18
|
"@formily/core": "2.3.0",
|
|
19
19
|
"@formily/react": "2.3.0",
|
|
20
20
|
"lodash": "4.17.21",
|
|
21
|
-
"@nocobase/database": "1.2.
|
|
22
|
-
"@nocobase/server": "1.2.
|
|
23
|
-
"@nocobase/logger": "1.2.
|
|
24
|
-
"@nocobase/evaluators": "1.2.
|
|
21
|
+
"@nocobase/database": "1.2.3-alpha",
|
|
22
|
+
"@nocobase/server": "1.2.3-alpha",
|
|
23
|
+
"@nocobase/logger": "1.2.3-alpha",
|
|
24
|
+
"@nocobase/evaluators": "1.2.3-alpha",
|
|
25
25
|
"@formily/antd-v5": "1.1.9",
|
|
26
26
|
"@formily/reactive": "2.3.0",
|
|
27
27
|
"@formily/shared": "2.3.0",
|
|
28
|
-
"@nocobase/actions": "1.2.
|
|
29
|
-
"@nocobase/data-source-manager": "1.2.
|
|
28
|
+
"@nocobase/actions": "1.2.3-alpha",
|
|
29
|
+
"@nocobase/data-source-manager": "1.2.3-alpha",
|
|
30
30
|
"sequelize": "6.35.2",
|
|
31
|
-
"@nocobase/plugin-workflow-test": "1.2.
|
|
32
|
-
"@nocobase/test": "1.2.
|
|
31
|
+
"@nocobase/plugin-workflow-test": "1.2.3-alpha",
|
|
32
|
+
"@nocobase/test": "1.2.3-alpha",
|
|
33
33
|
"dayjs": "1.11.10"
|
|
34
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2024-06-
|
|
1
|
+
{"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2024-06-13T03:59:01.279Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"8.0.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","preprepare":"rm -rf dist","prepare":"tsc -p tsconfig.json && tsc -p tsconfig-esm.json","postprepare":"bash fixup.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"c8 tap","snap":"c8 tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig tsconfig-esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile"},"main":"./dist/cjs/index-cjs.js","module":"./dist/mjs/index.js","types":"./dist/mjs/index.d.ts","exports":{"./min":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.min.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.min.js"}},".":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index-cjs.js"}}},"repository":"git://github.com/isaacs/node-lru-cache.git","devDependencies":{"@size-limit/preset-small-lib":"^7.0.8","@types/node":"^17.0.31","@types/tap":"^15.0.6","benchmark":"^2.1.4","c8":"^7.11.2","clock-mock":"^1.0.6","esbuild":"^0.17.11","eslint-config-prettier":"^8.5.0","marked":"^4.2.12","mkdirp":"^2.1.5","prettier":"^2.6.2","size-limit":"^7.0.8","tap":"^16.3.4","ts-node":"^10.7.0","tslib":"^2.4.0","typedoc":"^0.23.24","typescript":"^4.6.4"},"license":"ISC","files":["dist"],"engines":{"node":">=16.14"},"prettier":{"semi":false,"printWidth":70,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"coverage":false,"node-arg":["--expose-gc","--no-warnings","--loader","ts-node/esm"],"ts":false},"size-limit":[{"path":"./dist/mjs/index.js"}],"_lastModified":"2024-06-
|
|
1
|
+
{"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"8.0.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","preprepare":"rm -rf dist","prepare":"tsc -p tsconfig.json && tsc -p tsconfig-esm.json","postprepare":"bash fixup.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"c8 tap","snap":"c8 tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig tsconfig-esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile"},"main":"./dist/cjs/index-cjs.js","module":"./dist/mjs/index.js","types":"./dist/mjs/index.d.ts","exports":{"./min":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.min.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.min.js"}},".":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index-cjs.js"}}},"repository":"git://github.com/isaacs/node-lru-cache.git","devDependencies":{"@size-limit/preset-small-lib":"^7.0.8","@types/node":"^17.0.31","@types/tap":"^15.0.6","benchmark":"^2.1.4","c8":"^7.11.2","clock-mock":"^1.0.6","esbuild":"^0.17.11","eslint-config-prettier":"^8.5.0","marked":"^4.2.12","mkdirp":"^2.1.5","prettier":"^2.6.2","size-limit":"^7.0.8","tap":"^16.3.4","ts-node":"^10.7.0","tslib":"^2.4.0","typedoc":"^0.23.24","typescript":"^4.6.4"},"license":"ISC","files":["dist"],"engines":{"node":">=16.14"},"prettier":{"semi":false,"printWidth":70,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"coverage":false,"node-arg":["--expose-gc","--no-warnings","--loader","ts-node/esm"],"ts":false},"size-limit":[{"path":"./dist/mjs/index.js"}],"_lastModified":"2024-06-13T03:59:00.937Z"}
|
package/package.json
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
"displayName.zh-CN": "工作流",
|
|
5
5
|
"description": "A powerful BPM tool that provides foundational support for business automation, with the capability to extend unlimited triggers and nodes.",
|
|
6
6
|
"description.zh-CN": "一个强大的 BPM 工具,为业务自动化提供基础支持,并且可任意扩展更多的触发器和节点。",
|
|
7
|
-
"version": "1.2.
|
|
7
|
+
"version": "1.2.3-alpha",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/workflow",
|
|
11
11
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/workflow",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@nocobase/plugin-workflow-test": "1.2.
|
|
13
|
+
"@nocobase/plugin-workflow-test": "1.2.3-alpha"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@ant-design/icons": "5.x",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@nocobase/test": "1.x",
|
|
45
45
|
"@nocobase/utils": "1.x"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "a9167db4051c276bdad81f1a98c3d77987af983d",
|
|
48
48
|
"keywords": [
|
|
49
49
|
"Workflow"
|
|
50
50
|
]
|