@nocobase/plugin-workflow-test 1.5.0-alpha.4 → 1.5.0-beta.1
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 +1 -1
- package/dist/externalVersion.js +6 -6
- package/dist/server/index.d.ts +4 -8
- package/dist/server/index.js +15 -35
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
(function(e,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("@nocobase/client")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client"],n):(e=typeof globalThis!="undefined"?globalThis:e||self,n(e["@nocobase/plugin-workflow-test"]={},e["@nocobase/client"]))})(this,function(e,n){"use strict";class o extends n.Plugin{}e.default=o,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.5.0-
|
|
12
|
-
"@nocobase/utils": "1.5.0-
|
|
11
|
+
"@nocobase/client": "1.5.0-beta.1",
|
|
12
|
+
"@nocobase/utils": "1.5.0-beta.1",
|
|
13
13
|
"lodash": "4.17.21",
|
|
14
|
-
"@nocobase/test": "1.5.0-
|
|
15
|
-
"@nocobase/server": "1.5.0-
|
|
16
|
-
"@nocobase/data-source-manager": "1.5.0-
|
|
17
|
-
"@nocobase/database": "1.5.0-
|
|
14
|
+
"@nocobase/test": "1.5.0-beta.1",
|
|
15
|
+
"@nocobase/server": "1.5.0-beta.1",
|
|
16
|
+
"@nocobase/data-source-manager": "1.5.0-beta.1",
|
|
17
|
+
"@nocobase/database": "1.5.0-beta.1"
|
|
18
18
|
};
|
package/dist/server/index.d.ts
CHANGED
|
@@ -7,16 +7,12 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { ApplicationOptions, Plugin } from '@nocobase/server';
|
|
10
|
-
import {
|
|
11
|
-
export
|
|
12
|
-
interface WorkflowMockServerOptions extends ApplicationOptions {
|
|
10
|
+
import { MockServer } from '@nocobase/test';
|
|
11
|
+
export interface MockServerOptions extends ApplicationOptions {
|
|
13
12
|
collectionsPath?: string;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
export declare function getApp({ plugins, collectionsPath, ...options }?: WorkflowMockServerOptions): Promise<MockServer>;
|
|
19
|
-
export declare function getCluster({ plugins, collectionsPath, ...options }: WorkflowMockClusterOptions): Promise<import("@nocobase/test").MockCluster>;
|
|
14
|
+
export declare function sleep(ms: number): Promise<unknown>;
|
|
15
|
+
export declare function getApp(options?: MockServerOptions): Promise<MockServer>;
|
|
20
16
|
export default class WorkflowTestPlugin extends Plugin {
|
|
21
17
|
load(): Promise<void>;
|
|
22
18
|
}
|
package/dist/server/index.js
CHANGED
|
@@ -38,8 +38,7 @@ var server_exports = {};
|
|
|
38
38
|
__export(server_exports, {
|
|
39
39
|
default: () => WorkflowTestPlugin,
|
|
40
40
|
getApp: () => getApp,
|
|
41
|
-
|
|
42
|
-
sleep: () => import_test2.sleep
|
|
41
|
+
sleep: () => sleep
|
|
43
42
|
});
|
|
44
43
|
module.exports = __toCommonJS(server_exports);
|
|
45
44
|
var import_path = __toESM(require("path"));
|
|
@@ -50,23 +49,23 @@ var import_triggers = __toESM(require("./triggers"));
|
|
|
50
49
|
var import_instructions = __toESM(require("./instructions"));
|
|
51
50
|
var import_data_source_manager = require("@nocobase/data-source-manager");
|
|
52
51
|
var import_utils = require("@nocobase/utils");
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
function sleep(ms) {
|
|
53
|
+
return new Promise((resolve) => {
|
|
54
|
+
setTimeout(resolve, ms);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
async function getApp(options = {}) {
|
|
58
|
+
const { plugins = [], collectionsPath, ...others } = options;
|
|
59
|
+
class TestCollectionPlugin extends import_server.Plugin {
|
|
60
|
+
async load() {
|
|
61
|
+
if (collectionsPath) {
|
|
62
|
+
await this.db.import({ directory: collectionsPath });
|
|
63
|
+
}
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
|
-
}
|
|
61
|
-
async function getApp({
|
|
62
|
-
plugins = [],
|
|
63
|
-
collectionsPath,
|
|
64
|
-
...options
|
|
65
|
-
} = {}) {
|
|
66
66
|
const app = await (0, import_test.createMockServer)({
|
|
67
|
-
...
|
|
67
|
+
...others,
|
|
68
68
|
plugins: [
|
|
69
|
-
"field-sort",
|
|
70
69
|
[
|
|
71
70
|
"workflow",
|
|
72
71
|
{
|
|
@@ -76,7 +75,7 @@ async function getApp({
|
|
|
76
75
|
}
|
|
77
76
|
],
|
|
78
77
|
"workflow-test",
|
|
79
|
-
|
|
78
|
+
TestCollectionPlugin,
|
|
80
79
|
...plugins
|
|
81
80
|
]
|
|
82
81
|
});
|
|
@@ -100,24 +99,6 @@ async function getApp({
|
|
|
100
99
|
another.acl.allow("*", "*");
|
|
101
100
|
return app;
|
|
102
101
|
}
|
|
103
|
-
async function getCluster({ plugins = [], collectionsPath, ...options }) {
|
|
104
|
-
return (0, import_test.createMockCluster)({
|
|
105
|
-
...options,
|
|
106
|
-
plugins: [
|
|
107
|
-
[
|
|
108
|
-
"workflow",
|
|
109
|
-
{
|
|
110
|
-
triggers: import_triggers.default,
|
|
111
|
-
instructions: import_instructions.default,
|
|
112
|
-
functions: import_functions.default
|
|
113
|
-
}
|
|
114
|
-
],
|
|
115
|
-
"workflow-test",
|
|
116
|
-
[TestCollectionPlugin, { collectionsPath }],
|
|
117
|
-
...plugins
|
|
118
|
-
]
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
102
|
class WorkflowTestPlugin extends import_server.Plugin {
|
|
122
103
|
async load() {
|
|
123
104
|
await this.importCollections(import_path.default.resolve(__dirname, "collections"));
|
|
@@ -126,6 +107,5 @@ class WorkflowTestPlugin extends import_server.Plugin {
|
|
|
126
107
|
// Annotate the CommonJS export names for ESM import in node:
|
|
127
108
|
0 && (module.exports = {
|
|
128
109
|
getApp,
|
|
129
|
-
getCluster,
|
|
130
110
|
sleep
|
|
131
111
|
});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@nocobase/plugin-workflow-test",
|
|
3
3
|
"displayName": "Workflow: test kit",
|
|
4
4
|
"displayName.zh-CN": "工作流:测试工具包",
|
|
5
|
-
"version": "1.5.0-
|
|
5
|
+
"version": "1.5.0-beta.1",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
7
7
|
"main": "dist/server/index.js",
|
|
8
8
|
"types": "./dist/server/index.d.ts",
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
"@nocobase/server": "1.x",
|
|
12
12
|
"@nocobase/test": "1.x"
|
|
13
13
|
},
|
|
14
|
-
"gitHead": "
|
|
14
|
+
"gitHead": "10c6f1f3d90e91f3aabfa80449c7ef062e90f6af"
|
|
15
15
|
}
|