@nocobase/plugin-field-sort 1.5.0-alpha.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/LICENSE.txt +159 -0
- package/README.md +1 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/index.d.ts +15 -0
- package/dist/client/index.js +10 -0
- package/dist/client/locale.d.ts +10 -0
- package/dist/client/sort-interface.d.ts +131 -0
- package/dist/externalVersion.js +18 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +48 -0
- package/dist/locale/en-US.json +1 -0
- package/dist/locale/zh-CN.json +1 -0
- package/dist/node_modules/@nocobase/lock-manager/LICENSE +661 -0
- package/dist/node_modules/@nocobase/lock-manager/lib/index.d.ts +10 -0
- package/dist/node_modules/@nocobase/lock-manager/lib/index.js +1 -0
- package/dist/node_modules/@nocobase/lock-manager/lib/lock-manager.d.ts +46 -0
- package/dist/node_modules/@nocobase/lock-manager/lib/lock-manager.js +171 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/client.js +12 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/assign.d.ts +17 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/assign.js +143 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/client.d.ts +30 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/client.js +88 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/collections-graph.d.ts +24 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/collections-graph.js +107 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/common.d.ts +14 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/common.js +87 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/date.d.ts +38 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/date.js +214 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/dayjs.d.ts +10 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/dayjs.js +72 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/forEach.d.ts +9 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/forEach.js +45 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/fs-exists.d.ts +9 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/fs-exists.js +46 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/getValuesByPath.d.ts +9 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/getValuesByPath.js +71 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/handlebars.d.ts +10 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/handlebars.js +73 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/i18n.d.ts +10 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/i18n.js +43 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/index.d.ts +38 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/index.js +105 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/isPortalInBody.d.ts +13 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/isPortalInBody.js +54 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/isValidFilter.d.ts +9 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/isValidFilter.js +63 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/json-templates.d.ts +9 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/json-templates.js +141 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/koa-multer.d.ts +15 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/koa-multer.js +92 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/log.d.ts +9 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/log.js +39 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/measure-execution-time.d.ts +9 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/measure-execution-time.js +44 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/merge.d.ts +9 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/merge.js +55 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/mixin/AsyncEmitter.d.ts +11 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/mixin/AsyncEmitter.js +80 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/mixin/index.d.ts +9 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/mixin/index.js +48 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/notification.d.ts +9 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/notification.js +43 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/number.d.ts +9 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/number.js +45 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/parse-date.d.ts +15 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/parse-date.js +262 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/parse-filter.d.ts +67 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/parse-filter.js +320 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/parseHTML.d.ts +15 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/parseHTML.js +42 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/perf-hooks.d.ts +14 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/perf-hooks.js +69 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/registry.d.ts +22 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/registry.js +69 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/requireModule.d.ts +12 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/requireModule.js +90 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/server.d.ts +19 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/server.js +50 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/toposort.d.ts +18 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/toposort.js +83 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/uid.d.ts +9 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/uid.js +44 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/url.d.ts +14 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/url.js +46 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/wrap-middleware.d.ts +1 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/wrap-middleware.js +63 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/package.json +20 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/plugin-symlink.d.ts +6 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/plugin-symlink.js +102 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/server.d.ts +2 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/server.js +12 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/.eslintrc.js +5 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/.github/workflows/ci.yml +24 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/.github/workflows/lint.yml +23 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/bench/bench-multipart-fields-100mb-big.js +149 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/bench/bench-multipart-fields-100mb-small.js +143 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/bench/bench-multipart-files-100mb-big.js +154 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/bench/bench-multipart-files-100mb-small.js +148 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/bench/bench-urlencoded-fields-100pairs-small.js +101 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/bench/bench-urlencoded-fields-900pairs-small-alt.js +84 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/lib/index.js +57 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/lib/types/multipart.js +653 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/lib/types/urlencoded.js +350 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/lib/utils.js +596 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/package.json +22 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/test/common.js +109 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/test/test-types-multipart-charsets.js +94 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/test/test-types-multipart-stream-pause.js +102 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/test/test-types-multipart.js +1053 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/test/test-types-urlencoded.js +488 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/busboy/test/test.js +20 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/index.js +104 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/lib/counter.js +28 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/lib/file-appender.js +67 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/lib/make-middleware.js +173 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/lib/multer-error.js +24 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/lib/remove-uploaded-files.js +28 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/package.json +52 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/storage/disk.js +66 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/multer/storage/memory.js +21 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/streamsearch/.eslintrc.js +5 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/streamsearch/.github/workflows/ci.yml +24 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/streamsearch/.github/workflows/lint.yml +23 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/streamsearch/lib/sbmh.js +267 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/streamsearch/package.json +34 -0
- package/dist/node_modules/@nocobase/lock-manager/node_modules/streamsearch/test/test.js +70 -0
- package/dist/node_modules/@nocobase/lock-manager/package.json +1 -0
- package/dist/node_modules/@nocobase/lock-manager/src/__tests__/lock-manager.test.ts +169 -0
- package/dist/node_modules/@nocobase/lock-manager/src/index.ts +11 -0
- package/dist/node_modules/@nocobase/lock-manager/src/lock-manager.ts +169 -0
- package/dist/server/action.d.ts +26 -0
- package/dist/server/action.js +168 -0
- package/dist/server/index.d.ts +10 -0
- package/dist/server/index.js +48 -0
- package/dist/server/plugin.d.ts +19 -0
- package/dist/server/plugin.js +69 -0
- package/dist/server/sort-field.d.ts +24 -0
- package/dist/server/sort-field.js +197 -0
- package/package.json +16 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/parseHTML.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
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 __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
+
var __export = (target, all) => {
|
|
16
|
+
for (var name in all)
|
|
17
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
+
};
|
|
19
|
+
var __copyProps = (to, from, except, desc) => {
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
+
for (let key of __getOwnPropNames(from))
|
|
22
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var parseHTML_exports = {};
|
|
29
|
+
__export(parseHTML_exports, {
|
|
30
|
+
parseHTML: () => parseHTML
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(parseHTML_exports);
|
|
33
|
+
function parseHTML(html, variables) {
|
|
34
|
+
return html.replace(/\{\{(\w+)\}\}/g, function(match, key) {
|
|
35
|
+
return typeof variables[key] !== "undefined" ? variables[key] : match;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
__name(parseHTML, "parseHTML");
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
parseHTML
|
|
42
|
+
});
|
package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/perf-hooks.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
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 declare const prePerfHooksWrap: (handler: any, options?: {
|
|
10
|
+
name?: string;
|
|
11
|
+
}) => (ctx: any, next: any) => Promise<any>;
|
|
12
|
+
export declare const postPerfHooksWrap: (handler: any, options: {
|
|
13
|
+
name?: string;
|
|
14
|
+
}) => (ctx: any, next: any) => Promise<any>;
|
package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/perf-hooks.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
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 __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
+
var __export = (target, all) => {
|
|
16
|
+
for (var name in all)
|
|
17
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
+
};
|
|
19
|
+
var __copyProps = (to, from, except, desc) => {
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
+
for (let key of __getOwnPropNames(from))
|
|
22
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var perf_hooks_exports = {};
|
|
29
|
+
__export(perf_hooks_exports, {
|
|
30
|
+
postPerfHooksWrap: () => postPerfHooksWrap,
|
|
31
|
+
prePerfHooksWrap: () => prePerfHooksWrap
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(perf_hooks_exports);
|
|
34
|
+
var import_perf_hooks = require("perf_hooks");
|
|
35
|
+
const prePerfHooksWrap = /* @__PURE__ */ __name((handler, options) => {
|
|
36
|
+
const { name } = options || {};
|
|
37
|
+
return async (ctx, next) => {
|
|
38
|
+
if (!ctx.getPerfHistogram) {
|
|
39
|
+
return await handler(ctx, next);
|
|
40
|
+
}
|
|
41
|
+
const histogram = ctx.getPerfHistogram(name || handler);
|
|
42
|
+
const start = import_perf_hooks.performance.now();
|
|
43
|
+
await handler(ctx, async () => {
|
|
44
|
+
const duration = import_perf_hooks.performance.now() - start;
|
|
45
|
+
histogram.record(Math.ceil(duration * 1e6));
|
|
46
|
+
await next();
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
}, "prePerfHooksWrap");
|
|
50
|
+
const postPerfHooksWrap = /* @__PURE__ */ __name((handler, options) => {
|
|
51
|
+
const { name } = options || {};
|
|
52
|
+
return async (ctx, next) => {
|
|
53
|
+
if (!ctx.getPerfHistogram) {
|
|
54
|
+
return await handler(ctx, next);
|
|
55
|
+
}
|
|
56
|
+
await next();
|
|
57
|
+
const histogram = ctx.getPerfHistogram(name || handler);
|
|
58
|
+
const start = import_perf_hooks.performance.now();
|
|
59
|
+
await handler(ctx, async () => {
|
|
60
|
+
});
|
|
61
|
+
const duration = import_perf_hooks.performance.now() - start;
|
|
62
|
+
histogram.record(Math.ceil(duration * 1e6));
|
|
63
|
+
};
|
|
64
|
+
}, "postPerfHooksWrap");
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
postPerfHooksWrap,
|
|
68
|
+
prePerfHooksWrap
|
|
69
|
+
});
|
package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/registry.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
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 interface RegistryOptions {
|
|
10
|
+
override: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare class Registry<T> {
|
|
13
|
+
private map;
|
|
14
|
+
options: RegistryOptions;
|
|
15
|
+
constructor(options?: RegistryOptions);
|
|
16
|
+
register(key: string, value: T): void;
|
|
17
|
+
get(key: string): T;
|
|
18
|
+
getKeys(): Iterable<string>;
|
|
19
|
+
getValues(): Iterable<T>;
|
|
20
|
+
getEntities(): Iterable<[string, T]>;
|
|
21
|
+
}
|
|
22
|
+
export default Registry;
|
|
@@ -0,0 +1,69 @@
|
|
|
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 __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
+
var __export = (target, all) => {
|
|
16
|
+
for (var name in all)
|
|
17
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
+
};
|
|
19
|
+
var __copyProps = (to, from, except, desc) => {
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
+
for (let key of __getOwnPropNames(from))
|
|
22
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var registry_exports = {};
|
|
29
|
+
__export(registry_exports, {
|
|
30
|
+
Registry: () => Registry,
|
|
31
|
+
default: () => registry_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(registry_exports);
|
|
34
|
+
const _Registry = class _Registry {
|
|
35
|
+
map = /* @__PURE__ */ new Map();
|
|
36
|
+
options;
|
|
37
|
+
constructor(options = { override: false }) {
|
|
38
|
+
this.options = options;
|
|
39
|
+
}
|
|
40
|
+
register(key, value) {
|
|
41
|
+
if (!this.options.override && this.map.has(key)) {
|
|
42
|
+
throw new Error(`this registry does not allow to override existing keys: "${key}"`);
|
|
43
|
+
}
|
|
44
|
+
this.map.set(key, value);
|
|
45
|
+
}
|
|
46
|
+
// async import({ directory, extensions = ['.js', '.ts', '.json'] }) {
|
|
47
|
+
// const files = await fs.readdir(directory);
|
|
48
|
+
// return files.filter(file => extensions.includes(path.extname(file)))
|
|
49
|
+
// }
|
|
50
|
+
get(key) {
|
|
51
|
+
return this.map.get(key);
|
|
52
|
+
}
|
|
53
|
+
getKeys() {
|
|
54
|
+
return this.map.keys();
|
|
55
|
+
}
|
|
56
|
+
getValues() {
|
|
57
|
+
return this.map.values();
|
|
58
|
+
}
|
|
59
|
+
getEntities() {
|
|
60
|
+
return this.map.entries();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
__name(_Registry, "Registry");
|
|
64
|
+
let Registry = _Registry;
|
|
65
|
+
var registry_default = Registry;
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
Registry
|
|
69
|
+
});
|
package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/requireModule.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
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 declare function requireResolve(m: any): Promise<string>;
|
|
10
|
+
export declare function requireModule(m: any): any;
|
|
11
|
+
export default requireModule;
|
|
12
|
+
export declare function importModule(m: string): Promise<any>;
|
package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/requireModule.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
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 __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
17
|
+
var __export = (target, all) => {
|
|
18
|
+
for (var name in all)
|
|
19
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
20
|
+
};
|
|
21
|
+
var __copyProps = (to, from, except, desc) => {
|
|
22
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(from))
|
|
24
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
25
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
26
|
+
}
|
|
27
|
+
return to;
|
|
28
|
+
};
|
|
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 requireModule_exports = {};
|
|
39
|
+
__export(requireModule_exports, {
|
|
40
|
+
default: () => requireModule_default,
|
|
41
|
+
importModule: () => importModule,
|
|
42
|
+
requireModule: () => requireModule,
|
|
43
|
+
requireResolve: () => requireResolve
|
|
44
|
+
});
|
|
45
|
+
module.exports = __toCommonJS(requireModule_exports);
|
|
46
|
+
var import_fs = __toESM(require("fs"));
|
|
47
|
+
var import_path = __toESM(require("path"));
|
|
48
|
+
var import_url = require("url");
|
|
49
|
+
async function requireResolve(m) {
|
|
50
|
+
if (!process.env.VITEST) {
|
|
51
|
+
return require.resolve(m);
|
|
52
|
+
}
|
|
53
|
+
const json = JSON.parse(
|
|
54
|
+
await import_fs.default.promises.readFile(import_path.default.resolve(process.cwd(), "./tsconfig.paths.json"), { encoding: "utf8" })
|
|
55
|
+
);
|
|
56
|
+
const paths = json.compilerOptions.paths;
|
|
57
|
+
if (paths[m]) {
|
|
58
|
+
return require.resolve(import_path.default.resolve(process.cwd(), paths[m][0], "index.ts"));
|
|
59
|
+
}
|
|
60
|
+
return require.resolve(m);
|
|
61
|
+
}
|
|
62
|
+
__name(requireResolve, "requireResolve");
|
|
63
|
+
function requireModule(m) {
|
|
64
|
+
if (typeof m === "string") {
|
|
65
|
+
m = require(m);
|
|
66
|
+
}
|
|
67
|
+
if (typeof m !== "object") {
|
|
68
|
+
return m;
|
|
69
|
+
}
|
|
70
|
+
return m.__esModule ? m.default : m;
|
|
71
|
+
}
|
|
72
|
+
__name(requireModule, "requireModule");
|
|
73
|
+
var requireModule_default = requireModule;
|
|
74
|
+
async function importModule(m) {
|
|
75
|
+
if (!process.env.VITEST) {
|
|
76
|
+
return requireModule(m);
|
|
77
|
+
}
|
|
78
|
+
if (import_path.default.isAbsolute(m)) {
|
|
79
|
+
m = (0, import_url.pathToFileURL)(m).href;
|
|
80
|
+
}
|
|
81
|
+
const r = (await import(m)).default;
|
|
82
|
+
return r.__esModule ? r.default : r;
|
|
83
|
+
}
|
|
84
|
+
__name(importModule, "importModule");
|
|
85
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
86
|
+
0 && (module.exports = {
|
|
87
|
+
importModule,
|
|
88
|
+
requireModule,
|
|
89
|
+
requireResolve
|
|
90
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
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 './date';
|
|
10
|
+
export * from './fs-exists';
|
|
11
|
+
export * from './merge';
|
|
12
|
+
export * from './mixin';
|
|
13
|
+
export * from './mixin/AsyncEmitter';
|
|
14
|
+
export * from './number';
|
|
15
|
+
export * from './registry';
|
|
16
|
+
export * from './requireModule';
|
|
17
|
+
export * from './toposort';
|
|
18
|
+
export * from './uid';
|
|
19
|
+
export * from './url';
|
|
@@ -0,0 +1,50 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var server_exports = {};
|
|
25
|
+
module.exports = __toCommonJS(server_exports);
|
|
26
|
+
__reExport(server_exports, require("./date"), module.exports);
|
|
27
|
+
__reExport(server_exports, require("./fs-exists"), module.exports);
|
|
28
|
+
__reExport(server_exports, require("./merge"), module.exports);
|
|
29
|
+
__reExport(server_exports, require("./mixin"), module.exports);
|
|
30
|
+
__reExport(server_exports, require("./mixin/AsyncEmitter"), module.exports);
|
|
31
|
+
__reExport(server_exports, require("./number"), module.exports);
|
|
32
|
+
__reExport(server_exports, require("./registry"), module.exports);
|
|
33
|
+
__reExport(server_exports, require("./requireModule"), module.exports);
|
|
34
|
+
__reExport(server_exports, require("./toposort"), module.exports);
|
|
35
|
+
__reExport(server_exports, require("./uid"), module.exports);
|
|
36
|
+
__reExport(server_exports, require("./url"), module.exports);
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
...require("./date"),
|
|
40
|
+
...require("./fs-exists"),
|
|
41
|
+
...require("./merge"),
|
|
42
|
+
...require("./mixin"),
|
|
43
|
+
...require("./mixin/AsyncEmitter"),
|
|
44
|
+
...require("./number"),
|
|
45
|
+
...require("./registry"),
|
|
46
|
+
...require("./requireModule"),
|
|
47
|
+
...require("./toposort"),
|
|
48
|
+
...require("./uid"),
|
|
49
|
+
...require("./url")
|
|
50
|
+
});
|
package/dist/node_modules/@nocobase/lock-manager/node_modules/@nocobase/utils/lib/toposort.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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 Topo from '@hapi/topo';
|
|
10
|
+
export interface ToposortOptions extends Topo.Options {
|
|
11
|
+
tag?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class Toposort<T> extends Topo.Sorter<T> {
|
|
14
|
+
unshift(...items: any[]): void;
|
|
15
|
+
push(...items: any[]): void;
|
|
16
|
+
add(nodes: T | T[], options?: ToposortOptions): T[];
|
|
17
|
+
}
|
|
18
|
+
export default Toposort;
|
|
@@ -0,0 +1,83 @@
|
|
|
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 __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
17
|
+
var __export = (target, all) => {
|
|
18
|
+
for (var name in all)
|
|
19
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
20
|
+
};
|
|
21
|
+
var __copyProps = (to, from, except, desc) => {
|
|
22
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(from))
|
|
24
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
25
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
26
|
+
}
|
|
27
|
+
return to;
|
|
28
|
+
};
|
|
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 toposort_exports = {};
|
|
39
|
+
__export(toposort_exports, {
|
|
40
|
+
Toposort: () => Toposort,
|
|
41
|
+
default: () => toposort_default
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(toposort_exports);
|
|
44
|
+
var import_topo = __toESM(require("@hapi/topo"));
|
|
45
|
+
const _Toposort = class _Toposort extends import_topo.default.Sorter {
|
|
46
|
+
unshift(...items) {
|
|
47
|
+
this._items.unshift(
|
|
48
|
+
...items.map((node) => ({
|
|
49
|
+
node,
|
|
50
|
+
seq: this._items.length,
|
|
51
|
+
sort: 0,
|
|
52
|
+
before: [],
|
|
53
|
+
after: [],
|
|
54
|
+
group: "?"
|
|
55
|
+
}))
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
push(...items) {
|
|
59
|
+
this._items.push(
|
|
60
|
+
...items.map((node) => ({
|
|
61
|
+
node,
|
|
62
|
+
seq: this._items.length,
|
|
63
|
+
sort: 0,
|
|
64
|
+
before: [],
|
|
65
|
+
after: [],
|
|
66
|
+
group: "?"
|
|
67
|
+
}))
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
add(nodes, options) {
|
|
71
|
+
if (options == null ? void 0 : options.tag) {
|
|
72
|
+
options.group = options.tag;
|
|
73
|
+
}
|
|
74
|
+
return super.add(nodes, options);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
__name(_Toposort, "Toposort");
|
|
78
|
+
let Toposort = _Toposort;
|
|
79
|
+
var toposort_default = Toposort;
|
|
80
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
+
0 && (module.exports = {
|
|
82
|
+
Toposort
|
|
83
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
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 declare function uid(len?: number): string;
|
|
@@ -0,0 +1,44 @@
|
|
|
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 __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
+
var __export = (target, all) => {
|
|
16
|
+
for (var name in all)
|
|
17
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
+
};
|
|
19
|
+
var __copyProps = (to, from, except, desc) => {
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
+
for (let key of __getOwnPropNames(from))
|
|
22
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var uid_exports = {};
|
|
29
|
+
__export(uid_exports, {
|
|
30
|
+
uid: () => uid
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(uid_exports);
|
|
33
|
+
let IDX = 36, HEX = "";
|
|
34
|
+
while (IDX--) HEX += IDX.toString(36);
|
|
35
|
+
function uid(len) {
|
|
36
|
+
let str = "", num = len || 11;
|
|
37
|
+
while (num--) str += HEX[Math.random() * 36 | 0];
|
|
38
|
+
return str;
|
|
39
|
+
}
|
|
40
|
+
__name(uid, "uid");
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
uid
|
|
44
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
* 是否是完整的 URL(带协议的)
|
|
11
|
+
* @param string
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function isURL(string: any): boolean;
|
|
@@ -0,0 +1,46 @@
|
|
|
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 __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
+
var __export = (target, all) => {
|
|
16
|
+
for (var name in all)
|
|
17
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
+
};
|
|
19
|
+
var __copyProps = (to, from, except, desc) => {
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
+
for (let key of __getOwnPropNames(from))
|
|
22
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var url_exports = {};
|
|
29
|
+
__export(url_exports, {
|
|
30
|
+
isURL: () => isURL
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(url_exports);
|
|
33
|
+
function isURL(string) {
|
|
34
|
+
let url;
|
|
35
|
+
try {
|
|
36
|
+
url = new URL(string);
|
|
37
|
+
} catch (e) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
return url.protocol === "http:" || url.protocol === "https:";
|
|
41
|
+
}
|
|
42
|
+
__name(isURL, "isURL");
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
isURL
|
|
46
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function wrapMiddlewareWithLogging(fn: any, logger?: any): any;
|