@nocobase/plugin-workflow-test 1.2.13-alpha → 1.3.0-alpha.20240710084543
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/package.json +2 -2
- package/dist/client/index.d.ts +0 -11
- package/dist/client/index.js +0 -10
- package/dist/e2e/e2eCollectionModel.d.ts +0 -2838
- package/dist/e2e/e2eCollectionModel.js +0 -4273
- package/dist/e2e/e2ePageObjectModel.d.ts +0 -358
- package/dist/e2e/e2ePageObjectModel.js +0 -716
- package/dist/e2e/e2eUtils.d.ts +0 -52
- package/dist/e2e/e2eUtils.js +0 -428
- package/dist/e2e/index.d.ts +0 -12
- package/dist/e2e/index.js +0 -52
- package/dist/externalVersion.js +0 -19
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -48
- package/dist/server/collections/categories.d.ts +0 -11
- package/dist/server/collections/categories.js +0 -44
- package/dist/server/collections/comments.d.ts +0 -11
- package/dist/server/collections/comments.js +0 -53
- package/dist/server/collections/posts.d.ts +0 -11
- package/dist/server/collections/posts.js +0 -69
- package/dist/server/collections/replies.d.ts +0 -16
- package/dist/server/collections/replies.js +0 -40
- package/dist/server/collections/tags.d.ts +0 -11
- package/dist/server/collections/tags.js +0 -44
- package/dist/server/functions.d.ts +0 -12
- package/dist/server/functions.js +0 -34
- package/dist/server/index.d.ts +0 -18
- package/dist/server/index.js +0 -111
- package/dist/server/instructions.d.ts +0 -49
- package/dist/server/instructions.js +0 -91
- package/dist/server/triggers.d.ts +0 -28
- package/dist/server/triggers.js +0 -58
package/dist/e2e/e2eUtils.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { Browser } from '@nocobase/test/e2e';
|
|
10
|
-
export declare const apiCreateWorkflow: (data: any) => Promise<any>;
|
|
11
|
-
export declare const apiUpdateWorkflow: (id: number, data: any) => Promise<any>;
|
|
12
|
-
export declare const apiDeleteWorkflow: (id: number) => Promise<any>;
|
|
13
|
-
export declare const apiGetWorkflow: (id: number) => Promise<any>;
|
|
14
|
-
export declare const apiUpdateWorkflowTrigger: (id: number, data: any) => Promise<any>;
|
|
15
|
-
export declare const apiCreateWorkflowNode: (workflowId: number, data: any) => Promise<any>;
|
|
16
|
-
export declare const apiGetWorkflowNode: (id: number) => Promise<any>;
|
|
17
|
-
export declare const apiUpdateWorkflowNode: (id: number, data: any) => Promise<any>;
|
|
18
|
-
export declare const apiGetWorkflowNodeExecutions: (id: number) => Promise<any>;
|
|
19
|
-
export declare const apiUpdateRecord: (collectionName: string, id: number, data: any) => Promise<any>;
|
|
20
|
-
export declare const apiGetRecord: (collectionName: string, id: number) => Promise<any>;
|
|
21
|
-
export declare const apiGetList: (collectionName: string) => Promise<any>;
|
|
22
|
-
export declare const apiFilterList: (collectionName: string, filter: string) => Promise<any>;
|
|
23
|
-
export declare const apiCreateRecordTriggerFormEvent: (collectionName: string, triggerWorkflows: string, data: any) => Promise<any>;
|
|
24
|
-
export declare const apiSubmitRecordTriggerFormEvent: (triggerWorkflows: string, data: any) => Promise<any>;
|
|
25
|
-
export declare const apiGetDataSourceCount: () => Promise<any>;
|
|
26
|
-
export declare const apiCreateRecordTriggerActionEvent: (collectionName: string, triggerWorkflows: string, data: any) => Promise<any>;
|
|
27
|
-
export declare const apiApplyApprovalEvent: (data: any) => Promise<any>;
|
|
28
|
-
export declare const apiCreateField: (collectionName: string, data: any) => Promise<any>;
|
|
29
|
-
export declare const userLogin: (browser: Browser, approvalUserEmail: string, approvalUser: string) => Promise<import("playwright-core").BrowserContext>;
|
|
30
|
-
declare const _default: {
|
|
31
|
-
apiCreateWorkflow: (data: any) => Promise<any>;
|
|
32
|
-
apiUpdateWorkflow: (id: number, data: any) => Promise<any>;
|
|
33
|
-
apiDeleteWorkflow: (id: number) => Promise<any>;
|
|
34
|
-
apiGetWorkflow: (id: number) => Promise<any>;
|
|
35
|
-
apiUpdateWorkflowTrigger: (id: number, data: any) => Promise<any>;
|
|
36
|
-
apiGetWorkflowNodeExecutions: (id: number) => Promise<any>;
|
|
37
|
-
apiCreateWorkflowNode: (workflowId: number, data: any) => Promise<any>;
|
|
38
|
-
apiUpdateWorkflowNode: (id: number, data: any) => Promise<any>;
|
|
39
|
-
apiGetWorkflowNode: (id: number) => Promise<any>;
|
|
40
|
-
apiUpdateRecord: (collectionName: string, id: number, data: any) => Promise<any>;
|
|
41
|
-
apiGetRecord: (collectionName: string, id: number) => Promise<any>;
|
|
42
|
-
apiGetList: (collectionName: string) => Promise<any>;
|
|
43
|
-
apiCreateRecordTriggerFormEvent: (collectionName: string, triggerWorkflows: string, data: any) => Promise<any>;
|
|
44
|
-
apiSubmitRecordTriggerFormEvent: (triggerWorkflows: string, data: any) => Promise<any>;
|
|
45
|
-
apiFilterList: (collectionName: string, filter: string) => Promise<any>;
|
|
46
|
-
apiGetDataSourceCount: () => Promise<any>;
|
|
47
|
-
apiCreateRecordTriggerActionEvent: (collectionName: string, triggerWorkflows: string, data: any) => Promise<any>;
|
|
48
|
-
apiApplyApprovalEvent: (data: any) => Promise<any>;
|
|
49
|
-
userLogin: (browser: Browser, approvalUserEmail: string, approvalUser: string) => Promise<import("playwright-core").BrowserContext>;
|
|
50
|
-
apiCreateField: (collectionName: string, data: any) => Promise<any>;
|
|
51
|
-
};
|
|
52
|
-
export default _default;
|
package/dist/e2e/e2eUtils.js
DELETED
|
@@ -1,428 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var e2eUtils_exports = {};
|
|
28
|
-
__export(e2eUtils_exports, {
|
|
29
|
-
apiApplyApprovalEvent: () => apiApplyApprovalEvent,
|
|
30
|
-
apiCreateField: () => apiCreateField,
|
|
31
|
-
apiCreateRecordTriggerActionEvent: () => apiCreateRecordTriggerActionEvent,
|
|
32
|
-
apiCreateRecordTriggerFormEvent: () => apiCreateRecordTriggerFormEvent,
|
|
33
|
-
apiCreateWorkflow: () => apiCreateWorkflow,
|
|
34
|
-
apiCreateWorkflowNode: () => apiCreateWorkflowNode,
|
|
35
|
-
apiDeleteWorkflow: () => apiDeleteWorkflow,
|
|
36
|
-
apiFilterList: () => apiFilterList,
|
|
37
|
-
apiGetDataSourceCount: () => apiGetDataSourceCount,
|
|
38
|
-
apiGetList: () => apiGetList,
|
|
39
|
-
apiGetRecord: () => apiGetRecord,
|
|
40
|
-
apiGetWorkflow: () => apiGetWorkflow,
|
|
41
|
-
apiGetWorkflowNode: () => apiGetWorkflowNode,
|
|
42
|
-
apiGetWorkflowNodeExecutions: () => apiGetWorkflowNodeExecutions,
|
|
43
|
-
apiSubmitRecordTriggerFormEvent: () => apiSubmitRecordTriggerFormEvent,
|
|
44
|
-
apiUpdateRecord: () => apiUpdateRecord,
|
|
45
|
-
apiUpdateWorkflow: () => apiUpdateWorkflow,
|
|
46
|
-
apiUpdateWorkflowNode: () => apiUpdateWorkflowNode,
|
|
47
|
-
apiUpdateWorkflowTrigger: () => apiUpdateWorkflowTrigger,
|
|
48
|
-
default: () => e2eUtils_default,
|
|
49
|
-
userLogin: () => userLogin
|
|
50
|
-
});
|
|
51
|
-
module.exports = __toCommonJS(e2eUtils_exports);
|
|
52
|
-
var import_e2e = require("@nocobase/test/e2e");
|
|
53
|
-
const PORT = process.env.APP_PORT || 2e4;
|
|
54
|
-
const APP_BASE_URL = process.env.APP_BASE_URL || `http://localhost:${PORT}`;
|
|
55
|
-
const apiCreateWorkflow = async (data) => {
|
|
56
|
-
const api = await import_e2e.request.newContext({
|
|
57
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
58
|
-
});
|
|
59
|
-
const state = await api.storageState();
|
|
60
|
-
const headers = getHeaders(state);
|
|
61
|
-
const result = await api.post(`/api/workflows:create`, {
|
|
62
|
-
headers,
|
|
63
|
-
data
|
|
64
|
-
});
|
|
65
|
-
if (!result.ok()) {
|
|
66
|
-
throw new Error(await result.text());
|
|
67
|
-
}
|
|
68
|
-
return (await result.json()).data;
|
|
69
|
-
};
|
|
70
|
-
const apiUpdateWorkflow = async (id, data) => {
|
|
71
|
-
const api = await import_e2e.request.newContext({
|
|
72
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
73
|
-
});
|
|
74
|
-
const state = await api.storageState();
|
|
75
|
-
const headers = getHeaders(state);
|
|
76
|
-
const result = await api.post(`/api/workflows:update?filterByTk=${id}`, {
|
|
77
|
-
headers,
|
|
78
|
-
data
|
|
79
|
-
});
|
|
80
|
-
if (!result.ok()) {
|
|
81
|
-
throw new Error(await result.text());
|
|
82
|
-
}
|
|
83
|
-
return (await result.json()).data;
|
|
84
|
-
};
|
|
85
|
-
const apiDeleteWorkflow = async (id) => {
|
|
86
|
-
const api = await import_e2e.request.newContext({
|
|
87
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
88
|
-
});
|
|
89
|
-
const state = await api.storageState();
|
|
90
|
-
const headers = getHeaders(state);
|
|
91
|
-
const result = await api.post(`/api/workflows:destroy?filterByTk=${id}`, {
|
|
92
|
-
headers
|
|
93
|
-
});
|
|
94
|
-
if (!result.ok()) {
|
|
95
|
-
throw new Error(await result.text());
|
|
96
|
-
}
|
|
97
|
-
return (await result.json()).data;
|
|
98
|
-
};
|
|
99
|
-
const apiGetWorkflow = async (id) => {
|
|
100
|
-
const api = await import_e2e.request.newContext({
|
|
101
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
102
|
-
});
|
|
103
|
-
const state = await api.storageState();
|
|
104
|
-
const headers = getHeaders(state);
|
|
105
|
-
const result = await api.get(`/api/workflows:get?filterByTk=${id}`, {
|
|
106
|
-
headers
|
|
107
|
-
});
|
|
108
|
-
if (!result.ok()) {
|
|
109
|
-
throw new Error(await result.text());
|
|
110
|
-
}
|
|
111
|
-
return (await result.json()).data;
|
|
112
|
-
};
|
|
113
|
-
const apiUpdateWorkflowTrigger = async (id, data) => {
|
|
114
|
-
const api = await import_e2e.request.newContext({
|
|
115
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
116
|
-
});
|
|
117
|
-
const state = await api.storageState();
|
|
118
|
-
const headers = getHeaders(state);
|
|
119
|
-
const result = await api.post(`/api/workflows:update?filterByTk=${id}`, {
|
|
120
|
-
headers,
|
|
121
|
-
data
|
|
122
|
-
});
|
|
123
|
-
if (!result.ok()) {
|
|
124
|
-
throw new Error(await result.text());
|
|
125
|
-
}
|
|
126
|
-
return (await result.json()).data;
|
|
127
|
-
};
|
|
128
|
-
const apiCreateWorkflowNode = async (workflowId, data) => {
|
|
129
|
-
const api = await import_e2e.request.newContext({
|
|
130
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
131
|
-
});
|
|
132
|
-
const state = await api.storageState();
|
|
133
|
-
const headers = getHeaders(state);
|
|
134
|
-
const result = await api.post(`/api/workflows/${workflowId}/nodes:create`, {
|
|
135
|
-
headers,
|
|
136
|
-
data
|
|
137
|
-
});
|
|
138
|
-
if (!result.ok()) {
|
|
139
|
-
throw new Error(await result.text());
|
|
140
|
-
}
|
|
141
|
-
return (await result.json()).data;
|
|
142
|
-
};
|
|
143
|
-
const apiGetWorkflowNode = async (id) => {
|
|
144
|
-
const api = await import_e2e.request.newContext({
|
|
145
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
146
|
-
});
|
|
147
|
-
const state = await api.storageState();
|
|
148
|
-
const headers = getHeaders(state);
|
|
149
|
-
const result = await api.get(`/api/flow_nodes:get?filterByTk=${id}`, {
|
|
150
|
-
headers
|
|
151
|
-
});
|
|
152
|
-
if (!result.ok()) {
|
|
153
|
-
throw new Error(await result.text());
|
|
154
|
-
}
|
|
155
|
-
return (await result.json()).data;
|
|
156
|
-
};
|
|
157
|
-
const apiUpdateWorkflowNode = async (id, data) => {
|
|
158
|
-
const api = await import_e2e.request.newContext({
|
|
159
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
160
|
-
});
|
|
161
|
-
const state = await api.storageState();
|
|
162
|
-
const headers = getHeaders(state);
|
|
163
|
-
const result = await api.post(`/api/flow_nodes:update?filterByTk=${id}`, {
|
|
164
|
-
headers,
|
|
165
|
-
data
|
|
166
|
-
});
|
|
167
|
-
if (!result.ok()) {
|
|
168
|
-
throw new Error(await result.text());
|
|
169
|
-
}
|
|
170
|
-
return (await result.json()).data;
|
|
171
|
-
};
|
|
172
|
-
const apiGetWorkflowNodeExecutions = async (id) => {
|
|
173
|
-
const api = await import_e2e.request.newContext({
|
|
174
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
175
|
-
});
|
|
176
|
-
const state = await api.storageState();
|
|
177
|
-
const headers = getHeaders(state);
|
|
178
|
-
const url = `/api/executions:list?appends[]=jobs&filter[workflowId]=${id}&fields=id,createdAt,updatedAt,key,status,workflowId,jobs`;
|
|
179
|
-
const result = await api.get(url, {
|
|
180
|
-
headers
|
|
181
|
-
});
|
|
182
|
-
if (!result.ok()) {
|
|
183
|
-
throw new Error(await result.text());
|
|
184
|
-
}
|
|
185
|
-
return (await result.json()).data;
|
|
186
|
-
};
|
|
187
|
-
const apiUpdateRecord = async (collectionName, id, data) => {
|
|
188
|
-
const api = await import_e2e.request.newContext({
|
|
189
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
190
|
-
});
|
|
191
|
-
const state = await api.storageState();
|
|
192
|
-
const headers = getHeaders(state);
|
|
193
|
-
const result = await api.post(`/api/${collectionName}:update?filterByTk=${id}`, {
|
|
194
|
-
headers,
|
|
195
|
-
data
|
|
196
|
-
});
|
|
197
|
-
if (!result.ok()) {
|
|
198
|
-
throw new Error(await result.text());
|
|
199
|
-
}
|
|
200
|
-
return (await result.json()).data;
|
|
201
|
-
};
|
|
202
|
-
const apiGetRecord = async (collectionName, id) => {
|
|
203
|
-
const api = await import_e2e.request.newContext({
|
|
204
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
205
|
-
});
|
|
206
|
-
const state = await api.storageState();
|
|
207
|
-
const headers = getHeaders(state);
|
|
208
|
-
const result = await api.get(`/api/${collectionName}:get?filterByTk=${id}`, {
|
|
209
|
-
headers
|
|
210
|
-
});
|
|
211
|
-
if (!result.ok()) {
|
|
212
|
-
throw new Error(await result.text());
|
|
213
|
-
}
|
|
214
|
-
return (await result.json()).data;
|
|
215
|
-
};
|
|
216
|
-
const apiGetList = async (collectionName) => {
|
|
217
|
-
const api = await import_e2e.request.newContext({
|
|
218
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
219
|
-
});
|
|
220
|
-
const state = await api.storageState();
|
|
221
|
-
const headers = getHeaders(state);
|
|
222
|
-
const result = await api.get(`/api/${collectionName}:list`, {
|
|
223
|
-
headers
|
|
224
|
-
});
|
|
225
|
-
if (!result.ok()) {
|
|
226
|
-
throw new Error(await result.text());
|
|
227
|
-
}
|
|
228
|
-
return await result.json();
|
|
229
|
-
};
|
|
230
|
-
const apiFilterList = async (collectionName, filter) => {
|
|
231
|
-
const api = await import_e2e.request.newContext({
|
|
232
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
233
|
-
});
|
|
234
|
-
const state = await api.storageState();
|
|
235
|
-
const headers = getHeaders(state);
|
|
236
|
-
const result = await api.get(`/api/${collectionName}:list?${filter}`, {
|
|
237
|
-
headers
|
|
238
|
-
});
|
|
239
|
-
if (!result.ok()) {
|
|
240
|
-
throw new Error(await result.text());
|
|
241
|
-
}
|
|
242
|
-
return await result.json();
|
|
243
|
-
};
|
|
244
|
-
const apiCreateRecordTriggerFormEvent = async (collectionName, triggerWorkflows, data) => {
|
|
245
|
-
const api = await import_e2e.request.newContext({
|
|
246
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
247
|
-
});
|
|
248
|
-
const state = await api.storageState();
|
|
249
|
-
const headers = getHeaders(state);
|
|
250
|
-
const result = await api.post(`/api/${collectionName}:create?triggerWorkflows=${triggerWorkflows}`, {
|
|
251
|
-
headers,
|
|
252
|
-
data
|
|
253
|
-
});
|
|
254
|
-
if (!result.ok()) {
|
|
255
|
-
throw new Error(await result.text());
|
|
256
|
-
}
|
|
257
|
-
return (await result.json()).data;
|
|
258
|
-
};
|
|
259
|
-
const apiSubmitRecordTriggerFormEvent = async (triggerWorkflows, data) => {
|
|
260
|
-
const api = await import_e2e.request.newContext({
|
|
261
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
262
|
-
});
|
|
263
|
-
const state = await api.storageState();
|
|
264
|
-
const headers = getHeaders(state);
|
|
265
|
-
const result = await api.post(`/api/workflows:trigger?triggerWorkflows=${triggerWorkflows}`, {
|
|
266
|
-
headers,
|
|
267
|
-
data
|
|
268
|
-
});
|
|
269
|
-
if (!result.ok()) {
|
|
270
|
-
throw new Error(await result.text());
|
|
271
|
-
}
|
|
272
|
-
return await result.json();
|
|
273
|
-
};
|
|
274
|
-
const apiGetDataSourceCount = async () => {
|
|
275
|
-
const api = await import_e2e.request.newContext({
|
|
276
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
277
|
-
});
|
|
278
|
-
const state = await api.storageState();
|
|
279
|
-
const headers = getHeaders(state);
|
|
280
|
-
const result = await api.get(`/api/dataSources:list?pageSize=50`, {
|
|
281
|
-
headers
|
|
282
|
-
});
|
|
283
|
-
if (!result.ok()) {
|
|
284
|
-
throw new Error(await result.text());
|
|
285
|
-
}
|
|
286
|
-
return (await result.json()).meta.count;
|
|
287
|
-
};
|
|
288
|
-
const apiCreateRecordTriggerActionEvent = async (collectionName, triggerWorkflows, data) => {
|
|
289
|
-
const api = await import_e2e.request.newContext({
|
|
290
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
291
|
-
});
|
|
292
|
-
const state = await api.storageState();
|
|
293
|
-
const headers = getHeaders(state);
|
|
294
|
-
const result = await api.post(`/api/${collectionName}:create?triggerWorkflows=${triggerWorkflows}`, {
|
|
295
|
-
headers,
|
|
296
|
-
data
|
|
297
|
-
});
|
|
298
|
-
if (!result.ok()) {
|
|
299
|
-
throw new Error(await result.text());
|
|
300
|
-
}
|
|
301
|
-
return (await result.json()).data;
|
|
302
|
-
};
|
|
303
|
-
const apiApplyApprovalEvent = async (data) => {
|
|
304
|
-
const api = await import_e2e.request.newContext({
|
|
305
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
306
|
-
});
|
|
307
|
-
const state = await api.storageState();
|
|
308
|
-
const headers = getHeaders(state);
|
|
309
|
-
const result = await api.post("/api/approvals:create", {
|
|
310
|
-
headers,
|
|
311
|
-
data
|
|
312
|
-
});
|
|
313
|
-
if (!result.ok()) {
|
|
314
|
-
throw new Error(await result.text());
|
|
315
|
-
}
|
|
316
|
-
return (await result.json()).data;
|
|
317
|
-
};
|
|
318
|
-
const apiCreateField = async (collectionName, data) => {
|
|
319
|
-
const api = await import_e2e.request.newContext({
|
|
320
|
-
storageState: process.env.PLAYWRIGHT_AUTH_FILE
|
|
321
|
-
});
|
|
322
|
-
const state = await api.storageState();
|
|
323
|
-
const headers = getHeaders(state);
|
|
324
|
-
const result = await api.post(`/api/collections/${collectionName}/fields:create`, {
|
|
325
|
-
headers,
|
|
326
|
-
data
|
|
327
|
-
});
|
|
328
|
-
if (!result.ok()) {
|
|
329
|
-
throw new Error(await result.text());
|
|
330
|
-
}
|
|
331
|
-
return (await result.json()).data;
|
|
332
|
-
};
|
|
333
|
-
const getStorageItem = (key, storageState) => {
|
|
334
|
-
var _a, _b;
|
|
335
|
-
return (_b = (_a = storageState.origins.find((item) => item.origin === APP_BASE_URL)) == null ? void 0 : _a.localStorage.find((item) => item.name === key)) == null ? void 0 : _b.value;
|
|
336
|
-
};
|
|
337
|
-
function getHeaders(storageState) {
|
|
338
|
-
var _a;
|
|
339
|
-
const headers = {};
|
|
340
|
-
const token = getStorageItem("NOCOBASE_TOKEN", storageState);
|
|
341
|
-
const auth = getStorageItem("NOCOBASE_AUTH", storageState);
|
|
342
|
-
const subAppName = (_a = new URL(APP_BASE_URL).pathname.match(/^\/apps\/([^/]*)\/*/)) == null ? void 0 : _a[1];
|
|
343
|
-
const hostName = new URL(APP_BASE_URL).host;
|
|
344
|
-
const locale = getStorageItem("NOCOBASE_LOCALE", storageState);
|
|
345
|
-
const timezone = "+08:00";
|
|
346
|
-
const withAclMeta = "true";
|
|
347
|
-
const role = getStorageItem("NOCOBASE_ROLE", storageState);
|
|
348
|
-
if (token) {
|
|
349
|
-
headers.Authorization = `Bearer ${token}`;
|
|
350
|
-
}
|
|
351
|
-
if (auth) {
|
|
352
|
-
headers["X-Authenticator"] = auth;
|
|
353
|
-
}
|
|
354
|
-
if (subAppName) {
|
|
355
|
-
headers["X-App"] = subAppName;
|
|
356
|
-
}
|
|
357
|
-
if (hostName) {
|
|
358
|
-
headers["X-Hostname"] = hostName;
|
|
359
|
-
}
|
|
360
|
-
if (locale) {
|
|
361
|
-
headers["X-Locale"] = locale;
|
|
362
|
-
}
|
|
363
|
-
if (timezone) {
|
|
364
|
-
headers["X-Timezone"] = timezone;
|
|
365
|
-
}
|
|
366
|
-
if (withAclMeta) {
|
|
367
|
-
headers["X-With-Acl-Meta"] = withAclMeta;
|
|
368
|
-
}
|
|
369
|
-
if (role) {
|
|
370
|
-
headers["X-Role"] = role;
|
|
371
|
-
}
|
|
372
|
-
return headers;
|
|
373
|
-
}
|
|
374
|
-
const userLogin = async (browser, approvalUserEmail, approvalUser) => {
|
|
375
|
-
const context = await browser.newContext();
|
|
376
|
-
const page = await context.newPage();
|
|
377
|
-
await page.goto("signin");
|
|
378
|
-
await page.getByPlaceholder("Email").fill(approvalUserEmail);
|
|
379
|
-
await page.getByPlaceholder("Password").fill(approvalUser);
|
|
380
|
-
await page.getByRole("button", { name: "Sign in" }).click();
|
|
381
|
-
await page.waitForLoadState("networkidle");
|
|
382
|
-
return context;
|
|
383
|
-
};
|
|
384
|
-
var e2eUtils_default = module.exports = {
|
|
385
|
-
apiCreateWorkflow,
|
|
386
|
-
apiUpdateWorkflow,
|
|
387
|
-
apiDeleteWorkflow,
|
|
388
|
-
apiGetWorkflow,
|
|
389
|
-
apiUpdateWorkflowTrigger,
|
|
390
|
-
apiGetWorkflowNodeExecutions,
|
|
391
|
-
apiCreateWorkflowNode,
|
|
392
|
-
apiUpdateWorkflowNode,
|
|
393
|
-
apiGetWorkflowNode,
|
|
394
|
-
apiUpdateRecord,
|
|
395
|
-
apiGetRecord,
|
|
396
|
-
apiGetList,
|
|
397
|
-
apiCreateRecordTriggerFormEvent,
|
|
398
|
-
apiSubmitRecordTriggerFormEvent,
|
|
399
|
-
apiFilterList,
|
|
400
|
-
apiGetDataSourceCount,
|
|
401
|
-
apiCreateRecordTriggerActionEvent,
|
|
402
|
-
apiApplyApprovalEvent,
|
|
403
|
-
userLogin,
|
|
404
|
-
apiCreateField
|
|
405
|
-
};
|
|
406
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
407
|
-
0 && (module.exports = {
|
|
408
|
-
apiApplyApprovalEvent,
|
|
409
|
-
apiCreateField,
|
|
410
|
-
apiCreateRecordTriggerActionEvent,
|
|
411
|
-
apiCreateRecordTriggerFormEvent,
|
|
412
|
-
apiCreateWorkflow,
|
|
413
|
-
apiCreateWorkflowNode,
|
|
414
|
-
apiDeleteWorkflow,
|
|
415
|
-
apiFilterList,
|
|
416
|
-
apiGetDataSourceCount,
|
|
417
|
-
apiGetList,
|
|
418
|
-
apiGetRecord,
|
|
419
|
-
apiGetWorkflow,
|
|
420
|
-
apiGetWorkflowNode,
|
|
421
|
-
apiGetWorkflowNodeExecutions,
|
|
422
|
-
apiSubmitRecordTriggerFormEvent,
|
|
423
|
-
apiUpdateRecord,
|
|
424
|
-
apiUpdateWorkflow,
|
|
425
|
-
apiUpdateWorkflowNode,
|
|
426
|
-
apiUpdateWorkflowTrigger,
|
|
427
|
-
userLogin
|
|
428
|
-
});
|
package/dist/e2e/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export * from './e2eCollectionModel';
|
|
10
|
-
export * from './e2ePageObjectModel';
|
|
11
|
-
export { default } from './e2ePageObjectModel';
|
|
12
|
-
export * from './e2eUtils';
|
package/dist/e2e/index.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
-
mod
|
|
36
|
-
));
|
|
37
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
-
var e2e_exports = {};
|
|
39
|
-
__export(e2e_exports, {
|
|
40
|
-
default: () => import_e2ePageObjectModel.default
|
|
41
|
-
});
|
|
42
|
-
module.exports = __toCommonJS(e2e_exports);
|
|
43
|
-
__reExport(e2e_exports, require("./e2eCollectionModel"), module.exports);
|
|
44
|
-
__reExport(e2e_exports, require("./e2ePageObjectModel"), module.exports);
|
|
45
|
-
var import_e2ePageObjectModel = __toESM(require("./e2ePageObjectModel"));
|
|
46
|
-
__reExport(e2e_exports, require("./e2eUtils"), module.exports);
|
|
47
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
-
0 && (module.exports = {
|
|
49
|
-
...require("./e2eCollectionModel"),
|
|
50
|
-
...require("./e2ePageObjectModel"),
|
|
51
|
-
...require("./e2eUtils")
|
|
52
|
-
});
|
package/dist/externalVersion.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.2.13-alpha",
|
|
12
|
-
"@nocobase/utils": "1.2.13-alpha",
|
|
13
|
-
"lodash": "4.17.21",
|
|
14
|
-
"@nocobase/test": "1.2.13-alpha",
|
|
15
|
-
"@nocobase/server": "1.2.13-alpha",
|
|
16
|
-
"@nocobase/resourcer": "1.2.13-alpha",
|
|
17
|
-
"@nocobase/data-source-manager": "1.2.13-alpha",
|
|
18
|
-
"@nocobase/database": "1.2.13-alpha"
|
|
19
|
-
};
|
package/dist/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export * from './server';
|
|
10
|
-
export { default } from './server';
|
package/dist/index.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
-
mod
|
|
36
|
-
));
|
|
37
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
-
var src_exports = {};
|
|
39
|
-
__export(src_exports, {
|
|
40
|
-
default: () => import_server.default
|
|
41
|
-
});
|
|
42
|
-
module.exports = __toCommonJS(src_exports);
|
|
43
|
-
__reExport(src_exports, require("./server"), module.exports);
|
|
44
|
-
var import_server = __toESM(require("./server"));
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
...require("./server")
|
|
48
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { CollectionOptions } from '@nocobase/database';
|
|
10
|
-
declare const _default: CollectionOptions;
|
|
11
|
-
export default _default;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var categories_exports = {};
|
|
28
|
-
__export(categories_exports, {
|
|
29
|
-
default: () => categories_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(categories_exports);
|
|
32
|
-
var categories_default = {
|
|
33
|
-
name: "categories",
|
|
34
|
-
fields: [
|
|
35
|
-
{
|
|
36
|
-
type: "string",
|
|
37
|
-
name: "title"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
type: "hasMany",
|
|
41
|
-
name: "posts"
|
|
42
|
-
}
|
|
43
|
-
]
|
|
44
|
-
};
|