@tachybase/module-event-source 0.23.47 → 0.23.48
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
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// ctx.action.params.values can get user body
|
|
3
3
|
// const { changed, data, error } = await ctx.getChanged(); can get changed fields and raw data
|
|
4
4
|
// ctx.body to pass your data to workflow or to client who invoke this.
|
|
5
|
-
// ctx.body = ctx.action.params.values
|
|
5
|
+
// ctx.body = ctx.action.params.values
|
|
6
|
+
// ctx.body=ctx.model`}}},{type:"boolean",name:"effect",interface:"radioGroup",uiSchema:{title:e("Real effect"),type:"string",required:!0,enum:[{label:e("On"),value:!0,color:"#52c41a"},{label:e("Off"),value:!1}],"x-component":"Radio.Group","x-decorator":"FormItem",default:!1}}]},L=o=>n.jsx(t.SchemaComponent,{schema:{properties:o.options}}),z=h=>{var s=h,{params:o,filter:c={}}=s,a=T(s,["params","filter"]);const y=t.useCollectionRecordData(),d=b(m({},a),{params:b(m({},o),{filter:b(m({},o==null?void 0:o.filter),{key:y.workflowKey})})});return n.jsx(t.TableBlockProvider,m({},d))},G=()=>{const o=x.useForm(),c=t.useCollectionRecordData(),a=t.useDataBlockResource();return{onClick(){return C(this,null,function*(){const s=yield a.test({values:{body:JSON.parse(o.values.body||"{}"),params:JSON.parse(o.values.params||"{}"),name:c.name}});alert(JSON.stringify(s.data))})}}},I={name:{type:"string","x-component":"CollectionField","x-decorator":"FormItem","x-collection-field":"webhooks.name","x-component-props":{}},enabled:{type:"string","x-component":"CollectionField","x-decorator":"FormItem","x-collection-field":"webhooks.enabled","x-component-props":{}},workflowKey:{type:"string","x-component":"CollectionField","x-decorator":"FormItem","x-collection-field":"webhooks.workflowKey"},type:{type:"string","x-component":"CollectionField","x-decorator":"FormItem","x-collection-field":"webhooks.type"},options:{type:"object","x-component":"CollectionField","x-decorator":"FormItem","x-reactions":{dependencies:["type"],fulfill:{schema:{"x-component-props":"{{ useTypeOptions($deps[0]) }}"}}},"x-collection-field":"webhooks.options"},code:{type:"string","x-component":"CollectionField","x-decorator":"FormItem","x-decorator-props":{tooltip:`ctx.request
|
|
6
7
|
ctx.body
|
|
7
8
|
lib.JSON
|
|
8
9
|
lib.Math
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@tachybase/client": "0.23.
|
|
3
|
-
"@tachybase/utils": "0.23.
|
|
4
|
-
"@tachybase/server": "0.23.
|
|
5
|
-
"@tachybase/module-workflow": "0.23.
|
|
6
|
-
"@tachybase/schema": "0.23.
|
|
2
|
+
"@tachybase/client": "0.23.48",
|
|
3
|
+
"@tachybase/utils": "0.23.48",
|
|
4
|
+
"@tachybase/server": "0.23.48",
|
|
5
|
+
"@tachybase/module-workflow": "0.23.48",
|
|
6
|
+
"@tachybase/schema": "0.23.48",
|
|
7
7
|
"react": "18.3.1",
|
|
8
|
-
"@tachybase/components": "0.23.
|
|
8
|
+
"@tachybase/components": "0.23.48",
|
|
9
9
|
"antd": "5.22.5",
|
|
10
|
-
"@tachybase/actions": "0.23.
|
|
10
|
+
"@tachybase/actions": "0.23.48",
|
|
11
11
|
"sequelize": "6.37.5",
|
|
12
|
-
"@tachybase/database": "0.23.
|
|
13
|
-
"@tachybase/data-source": "0.23.
|
|
14
|
-
"@tachybase/resourcer": "0.23.
|
|
12
|
+
"@tachybase/database": "0.23.48",
|
|
13
|
+
"@tachybase/data-source": "0.23.48",
|
|
14
|
+
"@tachybase/resourcer": "0.23.48",
|
|
15
15
|
"lodash": "4.17.21"
|
|
16
16
|
};
|
|
@@ -71,7 +71,6 @@ class ResourceEventTrigger extends import_Trigger.EventSourceTrigger {
|
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
getMatchList(list, resourceName, actionName) {
|
|
74
|
-
let targetResource = resourceName || "";
|
|
75
74
|
const matchList = [];
|
|
76
75
|
list.sort((a, b) => {
|
|
77
76
|
let diffSort = a.options.sort - b.options.sort;
|
|
@@ -81,7 +80,7 @@ class ResourceEventTrigger extends import_Trigger.EventSourceTrigger {
|
|
|
81
80
|
return a.id - b.id;
|
|
82
81
|
});
|
|
83
82
|
for (const item of list) {
|
|
84
|
-
targetResource =
|
|
83
|
+
let targetResource = resourceName || "";
|
|
85
84
|
if (item.options.triggerOnAssociation) {
|
|
86
85
|
const parts = resourceName.split(".");
|
|
87
86
|
if (parts.length === 2) {
|
|
@@ -89,7 +88,7 @@ class ResourceEventTrigger extends import_Trigger.EventSourceTrigger {
|
|
|
89
88
|
targetResource = collection == null ? void 0 : collection.name;
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
|
-
if (
|
|
91
|
+
if (item.options.resourceName === targetResource && item.options.actionName === actionName) {
|
|
93
92
|
matchList.push(item);
|
|
94
93
|
}
|
|
95
94
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/module-event-source",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.48",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"dependencies": {},
|
|
6
6
|
"devDependencies": {
|
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
"sequelize": "6.37.5"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@tachybase/actions": "0.23.
|
|
14
|
-
"@tachybase/
|
|
15
|
-
"@tachybase/components": "0.23.
|
|
16
|
-
"@tachybase/
|
|
17
|
-
"@tachybase/
|
|
18
|
-
"@tachybase/module-workflow": "0.23.
|
|
19
|
-
"@tachybase/
|
|
20
|
-
"@tachybase/server": "0.23.
|
|
21
|
-
"@tachybase/schema": "0.23.
|
|
22
|
-
"@tachybase/test": "0.23.
|
|
23
|
-
"@tachybase/utils": "0.23.
|
|
13
|
+
"@tachybase/actions": "0.23.48",
|
|
14
|
+
"@tachybase/client": "0.23.48",
|
|
15
|
+
"@tachybase/components": "0.23.48",
|
|
16
|
+
"@tachybase/data-source": "0.23.48",
|
|
17
|
+
"@tachybase/database": "0.23.48",
|
|
18
|
+
"@tachybase/module-workflow": "0.23.48",
|
|
19
|
+
"@tachybase/resourcer": "0.23.48",
|
|
20
|
+
"@tachybase/server": "0.23.48",
|
|
21
|
+
"@tachybase/schema": "0.23.48",
|
|
22
|
+
"@tachybase/test": "0.23.48",
|
|
23
|
+
"@tachybase/utils": "0.23.48"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "tachybase-build --no-dts @tachybase/module-event-source"
|