@tachybase/plugin-workflow-test 0.23.8

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