@tachybase/module-hera 1.6.8-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/README.md +1 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/components/PDFViewer.d.ts +11 -0
- package/dist/client/components/SignatureInput.d.ts +2 -0
- package/dist/client/components/SignaturePad.d.ts +240 -0
- package/dist/client/components/custom-components/CustomAssociatedField.d.ts +1 -0
- package/dist/client/components/custom-components/CustomComponentDispatcher.d.ts +4 -0
- package/dist/client/components/custom-components/CustomField.d.ts +1 -0
- package/dist/client/components/custom-components/ErrorBoundary.d.ts +1 -0
- package/dist/client/components/custom-components/custom-components.d.ts +21 -0
- package/dist/client/components/excel-table/ExcelFile.d.ts +2 -0
- package/dist/client/components/excel-table/Sheet.d.ts +10 -0
- package/dist/client/components/fields/AssociatedField.d.ts +7 -0
- package/dist/client/components/fields/CalcResult.d.ts +1 -0
- package/dist/client/components/fields/Expression.d.ts +2 -0
- package/dist/client/components/index.d.ts +11 -0
- package/dist/client/components/modal-full-screen/ModalFullScreen.d.ts +15 -0
- package/dist/client/components/modal-full-screen/ModalFullScreenChild.d.ts +1 -0
- package/dist/client/features/custom-components/index.d.ts +5 -0
- package/dist/client/features/embed/EmbedLayout.d.ts +1 -0
- package/dist/client/features/embed/EmbedPage.d.ts +1 -0
- package/dist/client/features/embed/EmbedSchemaComponent.d.ts +1 -0
- package/dist/client/features/embed/NotAuthorityResult.d.ts +1 -0
- package/dist/client/features/embed/index.d.ts +4 -0
- package/dist/client/features/embed/useEmbedToken.d.ts +1 -0
- package/dist/client/features/embed/usePageSettingsProps.d.ts +4 -0
- package/dist/client/features/field-appends/index.d.ts +4 -0
- package/dist/client/features/field-appends/show-code/Code.interface.d.ts +74 -0
- package/dist/client/features/field-appends/show-code/Code.view.d.ts +2 -0
- package/dist/client/features/field-appends/show-formula/Formula.interface.d.ts +75 -0
- package/dist/client/features/field-appends/show-formula/Formula.view.d.ts +2 -0
- package/dist/client/features/hera-version/HeraVersion.provider.d.ts +3 -0
- package/dist/client/features/hera-version/index.d.ts +4 -0
- package/dist/client/features/mode-highlight/ModeHighlight.provider.d.ts +3 -0
- package/dist/client/features/mode-highlight/index.d.ts +4 -0
- package/dist/client/features/outbound/OutboundLinkActionInitializer.d.ts +6 -0
- package/dist/client/features/outbound/OutboundPage.d.ts +1 -0
- package/dist/client/features/outbound/index.d.ts +4 -0
- package/dist/client/features/outbound/useOutboundActionProps.d.ts +3 -0
- package/dist/client/features/pdf/PDFVIewerBlockInitializer.d.ts +9 -0
- package/dist/client/features/pdf/PDFViewer.d.ts +1 -0
- package/dist/client/features/pdf/index.d.ts +4 -0
- package/dist/client/features/sheet/SheetBlockInitializer.d.ts +8 -0
- package/dist/client/features/sheet/index.d.ts +4 -0
- package/dist/client/hooks/useCustomComponent.d.ts +5 -0
- package/dist/client/hooks/useGetCustomAssociatedComponents.d.ts +4 -0
- package/dist/client/hooks/useGetCustomComponents.d.ts +4 -0
- package/dist/client/hooks/useNotifications.d.ts +2 -0
- package/dist/client/hooks/usePluginVersion.d.ts +1 -0
- package/dist/client/hooks/useTokenConfiguration.d.ts +3 -0
- package/dist/client/index.d.ts +16 -0
- package/dist/client/index.js +79 -0
- package/dist/client/interfaces/AssociatedFieldInterface.d.ts +118 -0
- package/dist/client/interfaces/CalcFieldInterface.d.ts +120 -0
- package/dist/client/interfaces/CustomAssociatedFieldInterface.d.ts +69 -0
- package/dist/client/interfaces/CustomFieldInterface.d.ts +45 -0
- package/dist/client/interfaces/ExcelFieldInterface.d.ts +38 -0
- package/dist/client/interfaces/SignaturePadFieldInterface.d.ts +38 -0
- package/dist/client/interfaces/TstzrangeFieldInterface.d.ts +41 -0
- package/dist/client/interfaces/index.d.ts +6 -0
- package/dist/client/locale.d.ts +9 -0
- package/dist/client/schema-initializer/blocks/SettingBlockInitializer.d.ts +1 -0
- package/dist/client/schema-initializer/index.d.ts +1 -0
- package/dist/client/schema-settings/SchemaSettingsDatePickerType.d.ts +2 -0
- package/dist/client/schema-settings/SchemaSettingsDatePresets.d.ts +11 -0
- package/dist/client/schema-settings/SchemaSettingsSubmitDataType.d.ts +4 -0
- package/dist/client/schema-settings/index.d.ts +3 -0
- package/dist/client/settings-manager-components/LinkManager.d.ts +1 -0
- package/dist/client/settings-manager-components/TokenConfiguration.d.ts +5 -0
- package/dist/client/settings-manager-components/index.d.ts +8 -0
- package/dist/client/utils.d.ts +2 -0
- package/dist/externalVersion.js +15 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/locale/en-US.json +94 -0
- package/dist/locale/zh-CN.json +94 -0
- package/dist/node_modules/fs-extra/LICENSE +15 -0
- package/dist/node_modules/fs-extra/lib/copy/copy-sync.js +171 -0
- package/dist/node_modules/fs-extra/lib/copy/copy.js +182 -0
- package/dist/node_modules/fs-extra/lib/copy/index.js +7 -0
- package/dist/node_modules/fs-extra/lib/empty/index.js +39 -0
- package/dist/node_modules/fs-extra/lib/ensure/file.js +66 -0
- package/dist/node_modules/fs-extra/lib/ensure/index.js +23 -0
- package/dist/node_modules/fs-extra/lib/ensure/link.js +64 -0
- package/dist/node_modules/fs-extra/lib/ensure/symlink-paths.js +101 -0
- package/dist/node_modules/fs-extra/lib/ensure/symlink-type.js +34 -0
- package/dist/node_modules/fs-extra/lib/ensure/symlink.js +67 -0
- package/dist/node_modules/fs-extra/lib/fs/index.js +146 -0
- package/dist/node_modules/fs-extra/lib/index.js +1 -0
- package/dist/node_modules/fs-extra/lib/json/index.js +16 -0
- package/dist/node_modules/fs-extra/lib/json/jsonfile.js +11 -0
- package/dist/node_modules/fs-extra/lib/json/output-json-sync.js +12 -0
- package/dist/node_modules/fs-extra/lib/json/output-json.js +12 -0
- package/dist/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
- package/dist/node_modules/fs-extra/lib/mkdirs/make-dir.js +27 -0
- package/dist/node_modules/fs-extra/lib/mkdirs/utils.js +21 -0
- package/dist/node_modules/fs-extra/lib/move/index.js +7 -0
- package/dist/node_modules/fs-extra/lib/move/move-sync.js +55 -0
- package/dist/node_modules/fs-extra/lib/move/move.js +59 -0
- package/dist/node_modules/fs-extra/lib/output-file/index.js +31 -0
- package/dist/node_modules/fs-extra/lib/path-exists/index.js +12 -0
- package/dist/node_modules/fs-extra/lib/remove/index.js +17 -0
- package/dist/node_modules/fs-extra/lib/util/stat.js +158 -0
- package/dist/node_modules/fs-extra/lib/util/utimes.js +36 -0
- package/dist/node_modules/fs-extra/package.json +1 -0
- package/dist/server/actions/index.d.ts +5 -0
- package/dist/server/actions/index.js +29 -0
- package/dist/server/actions/link-manager-controller.d.ts +6 -0
- package/dist/server/actions/link-manager-controller.js +133 -0
- package/dist/server/actions/plugin-version.d.ts +6 -0
- package/dist/server/actions/plugin-version.js +90 -0
- package/dist/server/actions/robot-controller.d.ts +5 -0
- package/dist/server/actions/robot-controller.js +134 -0
- package/dist/server/actions/system-message-controller.d.ts +5 -0
- package/dist/server/actions/system-message-controller.js +106 -0
- package/dist/server/actions/token-configuration-controller.d.ts +5 -0
- package/dist/server/actions/token-configuration-controller.js +120 -0
- package/dist/server/collections/link-manage.d.ts +2 -0
- package/dist/server/collections/link-manage.js +42 -0
- package/dist/server/collections/systemSettings.d.ts +2 -0
- package/dist/server/collections/systemSettings.js +33 -0
- package/dist/server/collections/system_message.d.ts +2 -0
- package/dist/server/collections/system_message.js +67 -0
- package/dist/server/collections/token-configuration.d.ts +2 -0
- package/dist/server/collections/token-configuration.js +54 -0
- package/dist/server/fields/calc.d.ts +11 -0
- package/dist/server/fields/calc.js +43 -0
- package/dist/server/fields/tstzrange.d.ts +7 -0
- package/dist/server/fields/tstzrange.js +28 -0
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +41 -0
- package/dist/server/migrations/20250102010713-add-plugin-department.d.ts +6 -0
- package/dist/server/migrations/20250102010713-add-plugin-department.js +58 -0
- package/dist/server/plugin.d.ts +6 -0
- package/dist/server/plugin.js +117 -0
- package/dist/server/services/plugin-version.d.ts +5 -0
- package/dist/server/services/plugin-version.js +88 -0
- package/dist/server/services/sql-loader.d.ts +10 -0
- package/dist/server/services/sql-loader.js +128 -0
- package/dist/server/services/system-setting-service.d.ts +7 -0
- package/dist/server/services/system-setting-service.js +86 -0
- package/dist/server/utils/curren-formula.d.ts +1 -0
- package/dist/server/utils/curren-formula.js +30 -0
- package/dist/server/utils/multiprocess.d.ts +2 -0
- package/dist/server/utils/multiprocess.js +38 -0
- package/package.json +50 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
|
@@ -0,0 +1,134 @@
|
|
|
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 __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
8
|
+
var __typeError = (msg) => {
|
|
9
|
+
throw TypeError(msg);
|
|
10
|
+
};
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
13
|
+
var __export = (target, all) => {
|
|
14
|
+
for (var name in all)
|
|
15
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(from))
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
26
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
27
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
28
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
29
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
30
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
31
|
+
mod
|
|
32
|
+
));
|
|
33
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
34
|
+
var __decoratorStart = (base) => [, , , __create((base == null ? void 0 : base[__knownSymbol("metadata")]) ?? null)];
|
|
35
|
+
var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
36
|
+
var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
|
|
37
|
+
var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) });
|
|
38
|
+
var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
|
|
39
|
+
var __runInitializers = (array, flags, self, value) => {
|
|
40
|
+
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
41
|
+
return value;
|
|
42
|
+
};
|
|
43
|
+
var __decorateElement = (array, flags, name, decorators, target, extra) => {
|
|
44
|
+
var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
|
|
45
|
+
var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
|
|
46
|
+
var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
|
|
47
|
+
var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : { get [name]() {
|
|
48
|
+
return __privateGet(this, extra);
|
|
49
|
+
}, set [name](x) {
|
|
50
|
+
return __privateSet(this, extra, x);
|
|
51
|
+
} }, name));
|
|
52
|
+
k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
|
|
53
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
54
|
+
ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
|
|
55
|
+
if (k) {
|
|
56
|
+
ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x };
|
|
57
|
+
if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
|
|
58
|
+
if (k > 2) access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
|
|
59
|
+
}
|
|
60
|
+
it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1;
|
|
61
|
+
if (k ^ 4 || it === void 0) __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
|
|
62
|
+
else if (typeof it !== "object" || it === null) __typeError("Object expected");
|
|
63
|
+
else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
|
|
64
|
+
}
|
|
65
|
+
return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
|
|
66
|
+
};
|
|
67
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
68
|
+
var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
|
|
69
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
70
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
71
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
72
|
+
var robot_controller_exports = {};
|
|
73
|
+
__export(robot_controller_exports, {
|
|
74
|
+
RobotController: () => RobotController
|
|
75
|
+
});
|
|
76
|
+
module.exports = __toCommonJS(robot_controller_exports);
|
|
77
|
+
var import_server = require("@tego/server");
|
|
78
|
+
var import_axios = __toESM(require("axios"));
|
|
79
|
+
var _sendMessage_dec, _RobotController_decorators, _init;
|
|
80
|
+
_RobotController_decorators = [(0, import_server.Controller)("robot")], _sendMessage_dec = [(0, import_server.Action)("sendMessage")];
|
|
81
|
+
class RobotController {
|
|
82
|
+
constructor() {
|
|
83
|
+
__runInitializers(_init, 5, this);
|
|
84
|
+
}
|
|
85
|
+
async getFeishuToken(app_id, app_secret) {
|
|
86
|
+
const url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal";
|
|
87
|
+
const requestData = {
|
|
88
|
+
app_id,
|
|
89
|
+
app_secret
|
|
90
|
+
};
|
|
91
|
+
const headers = {
|
|
92
|
+
"Content-Type": "application/json; charset=utf-8"
|
|
93
|
+
};
|
|
94
|
+
const response = await import_axios.default.post(url, requestData, { headers });
|
|
95
|
+
return response.data.tenant_access_token;
|
|
96
|
+
}
|
|
97
|
+
async sendMessage(ctx, next) {
|
|
98
|
+
const url = "https://open.feishu.cn/open-apis/im/v1/messages";
|
|
99
|
+
const repo = ctx.db.getRepository("tokenConfiguration");
|
|
100
|
+
const record = await repo.findOne({
|
|
101
|
+
filter: {
|
|
102
|
+
type: "feishu"
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
const chat_id = record.chat_id;
|
|
106
|
+
const access_token = await this.getFeishuToken(record.app_id, record.app_secret);
|
|
107
|
+
const content = {
|
|
108
|
+
text: ctx.action.params.values.message
|
|
109
|
+
};
|
|
110
|
+
const requestData = {
|
|
111
|
+
msg_type: "text",
|
|
112
|
+
content: JSON.stringify(content),
|
|
113
|
+
receive_id: chat_id
|
|
114
|
+
// chat id
|
|
115
|
+
};
|
|
116
|
+
const headers = {
|
|
117
|
+
Authorization: "Bearer " + access_token
|
|
118
|
+
// your access token
|
|
119
|
+
};
|
|
120
|
+
const response = await import_axios.default.post(url, requestData, { headers, params: { receive_id_type: "chat_id" } });
|
|
121
|
+
ctx.body = {
|
|
122
|
+
data: response.data
|
|
123
|
+
};
|
|
124
|
+
await next();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
_init = __decoratorStart(null);
|
|
128
|
+
__decorateElement(_init, 1, "sendMessage", _sendMessage_dec, RobotController);
|
|
129
|
+
RobotController = __decorateElement(_init, 0, "RobotController", _RobotController_decorators, RobotController);
|
|
130
|
+
__runInitializers(_init, 1, RobotController);
|
|
131
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
132
|
+
0 && (module.exports = {
|
|
133
|
+
RobotController
|
|
134
|
+
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
7
|
+
var __typeError = (msg) => {
|
|
8
|
+
throw TypeError(msg);
|
|
9
|
+
};
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name in all)
|
|
14
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var __decoratorStart = (base) => [, , , __create((base == null ? void 0 : base[__knownSymbol("metadata")]) ?? null)];
|
|
26
|
+
var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
27
|
+
var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
|
|
28
|
+
var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) });
|
|
29
|
+
var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
|
|
30
|
+
var __runInitializers = (array, flags, self, value) => {
|
|
31
|
+
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
32
|
+
return value;
|
|
33
|
+
};
|
|
34
|
+
var __decorateElement = (array, flags, name, decorators, target, extra) => {
|
|
35
|
+
var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
|
|
36
|
+
var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
|
|
37
|
+
var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
|
|
38
|
+
var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : { get [name]() {
|
|
39
|
+
return __privateGet(this, extra);
|
|
40
|
+
}, set [name](x) {
|
|
41
|
+
return __privateSet(this, extra, x);
|
|
42
|
+
} }, name));
|
|
43
|
+
k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
|
|
44
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
45
|
+
ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
|
|
46
|
+
if (k) {
|
|
47
|
+
ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x };
|
|
48
|
+
if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
|
|
49
|
+
if (k > 2) access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
|
|
50
|
+
}
|
|
51
|
+
it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1;
|
|
52
|
+
if (k ^ 4 || it === void 0) __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
|
|
53
|
+
else if (typeof it !== "object" || it === null) __typeError("Object expected");
|
|
54
|
+
else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
|
|
55
|
+
}
|
|
56
|
+
return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
|
|
57
|
+
};
|
|
58
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
59
|
+
var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
|
|
60
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
61
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
62
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
63
|
+
var system_message_controller_exports = {};
|
|
64
|
+
__export(system_message_controller_exports, {
|
|
65
|
+
SystemMessageController: () => SystemMessageController
|
|
66
|
+
});
|
|
67
|
+
module.exports = __toCommonJS(system_message_controller_exports);
|
|
68
|
+
var import_server = require("@tego/server");
|
|
69
|
+
var _updateNotificationList_dec, _getNotificationList_dec, _SystemMessageController_decorators, _init;
|
|
70
|
+
_SystemMessageController_decorators = [(0, import_server.Controller)("system_notifications")], _getNotificationList_dec = [(0, import_server.Action)("get")], _updateNotificationList_dec = [(0, import_server.Action)("update")];
|
|
71
|
+
class SystemMessageController {
|
|
72
|
+
constructor() {
|
|
73
|
+
__runInitializers(_init, 5, this);
|
|
74
|
+
}
|
|
75
|
+
async getNotificationList(ctx, next) {
|
|
76
|
+
const data = await ctx.db.sequelize.query(`
|
|
77
|
+
select sm.*
|
|
78
|
+
from system_message sm
|
|
79
|
+
where sm.user_id = ${ctx.state.currentUser.id} and sm.read is not true
|
|
80
|
+
`);
|
|
81
|
+
ctx.body = data[0];
|
|
82
|
+
return next();
|
|
83
|
+
}
|
|
84
|
+
async updateNotificationList(ctx, next) {
|
|
85
|
+
const {
|
|
86
|
+
params: { ids }
|
|
87
|
+
} = ctx.action;
|
|
88
|
+
if (ids == null ? void 0 : ids.length) {
|
|
89
|
+
await ctx.db.sequelize.query(`
|
|
90
|
+
update system_message
|
|
91
|
+
set read = true
|
|
92
|
+
where id in (${ids == null ? void 0 : ids.map(Number).join(",")})
|
|
93
|
+
`);
|
|
94
|
+
}
|
|
95
|
+
return next();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
_init = __decoratorStart(null);
|
|
99
|
+
__decorateElement(_init, 1, "getNotificationList", _getNotificationList_dec, SystemMessageController);
|
|
100
|
+
__decorateElement(_init, 1, "updateNotificationList", _updateNotificationList_dec, SystemMessageController);
|
|
101
|
+
SystemMessageController = __decorateElement(_init, 0, "SystemMessageController", _SystemMessageController_decorators, SystemMessageController);
|
|
102
|
+
__runInitializers(_init, 1, SystemMessageController);
|
|
103
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
104
|
+
0 && (module.exports = {
|
|
105
|
+
SystemMessageController
|
|
106
|
+
});
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
7
|
+
var __typeError = (msg) => {
|
|
8
|
+
throw TypeError(msg);
|
|
9
|
+
};
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name in all)
|
|
14
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var __decoratorStart = (base) => [, , , __create((base == null ? void 0 : base[__knownSymbol("metadata")]) ?? null)];
|
|
26
|
+
var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
27
|
+
var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
|
|
28
|
+
var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) });
|
|
29
|
+
var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
|
|
30
|
+
var __runInitializers = (array, flags, self, value) => {
|
|
31
|
+
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
32
|
+
return value;
|
|
33
|
+
};
|
|
34
|
+
var __decorateElement = (array, flags, name, decorators, target, extra) => {
|
|
35
|
+
var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
|
|
36
|
+
var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
|
|
37
|
+
var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
|
|
38
|
+
var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : { get [name]() {
|
|
39
|
+
return __privateGet(this, extra);
|
|
40
|
+
}, set [name](x) {
|
|
41
|
+
return __privateSet(this, extra, x);
|
|
42
|
+
} }, name));
|
|
43
|
+
k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
|
|
44
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
45
|
+
ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
|
|
46
|
+
if (k) {
|
|
47
|
+
ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x };
|
|
48
|
+
if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
|
|
49
|
+
if (k > 2) access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
|
|
50
|
+
}
|
|
51
|
+
it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1;
|
|
52
|
+
if (k ^ 4 || it === void 0) __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
|
|
53
|
+
else if (typeof it !== "object" || it === null) __typeError("Object expected");
|
|
54
|
+
else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
|
|
55
|
+
}
|
|
56
|
+
return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
|
|
57
|
+
};
|
|
58
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
59
|
+
var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
|
|
60
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
61
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
62
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
63
|
+
var token_configuration_controller_exports = {};
|
|
64
|
+
__export(token_configuration_controller_exports, {
|
|
65
|
+
TokenConfigurationController: () => TokenConfigurationController
|
|
66
|
+
});
|
|
67
|
+
module.exports = __toCommonJS(token_configuration_controller_exports);
|
|
68
|
+
var import_server = require("@tego/server");
|
|
69
|
+
var _setConfiguration_dec, _getConfiguration_dec, _TokenConfigurationController_decorators, _init;
|
|
70
|
+
_TokenConfigurationController_decorators = [(0, import_server.Controller)("token-configuration")], _getConfiguration_dec = [(0, import_server.Action)("get")], _setConfiguration_dec = [(0, import_server.Action)("set")];
|
|
71
|
+
class TokenConfigurationController {
|
|
72
|
+
constructor() {
|
|
73
|
+
__runInitializers(_init, 5, this);
|
|
74
|
+
}
|
|
75
|
+
async getConfiguration(ctx, next) {
|
|
76
|
+
const {
|
|
77
|
+
params: { type }
|
|
78
|
+
} = ctx.action;
|
|
79
|
+
const repo = ctx.db.getRepository("tokenConfiguration");
|
|
80
|
+
const record = await repo.findOne({
|
|
81
|
+
filter: {
|
|
82
|
+
type
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
ctx.body = record;
|
|
86
|
+
return next();
|
|
87
|
+
}
|
|
88
|
+
async setConfiguration(ctx, next) {
|
|
89
|
+
const { params: values } = ctx.action;
|
|
90
|
+
const repo = ctx.db.getRepository("tokenConfiguration");
|
|
91
|
+
const record = await repo.findOne({
|
|
92
|
+
filter: {
|
|
93
|
+
type: values.type
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
if (record) {
|
|
97
|
+
await repo.update({
|
|
98
|
+
values,
|
|
99
|
+
filter: {
|
|
100
|
+
type: values.type
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
} else {
|
|
104
|
+
await repo.create({
|
|
105
|
+
values
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
ctx.body = "ok";
|
|
109
|
+
return next();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
_init = __decoratorStart(null);
|
|
113
|
+
__decorateElement(_init, 1, "getConfiguration", _getConfiguration_dec, TokenConfigurationController);
|
|
114
|
+
__decorateElement(_init, 1, "setConfiguration", _setConfiguration_dec, TokenConfigurationController);
|
|
115
|
+
TokenConfigurationController = __decorateElement(_init, 0, "TokenConfigurationController", _TokenConfigurationController_decorators, TokenConfigurationController);
|
|
116
|
+
__runInitializers(_init, 1, TokenConfigurationController);
|
|
117
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
118
|
+
0 && (module.exports = {
|
|
119
|
+
TokenConfigurationController
|
|
120
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
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 link_manage_exports = {};
|
|
19
|
+
__export(link_manage_exports, {
|
|
20
|
+
default: () => link_manage_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(link_manage_exports);
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
|
+
var link_manage_default = (0, import_server.defineCollection)({
|
|
25
|
+
dumpRules: {
|
|
26
|
+
group: "required"
|
|
27
|
+
},
|
|
28
|
+
name: "linkManage",
|
|
29
|
+
title: "\u94FE\u63A5\u7BA1\u7406",
|
|
30
|
+
fields: [
|
|
31
|
+
{
|
|
32
|
+
title: "Name",
|
|
33
|
+
name: "name",
|
|
34
|
+
type: "string"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
title: "Link",
|
|
38
|
+
name: "link",
|
|
39
|
+
type: "string"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
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 systemSettings_exports = {};
|
|
19
|
+
__export(systemSettings_exports, {
|
|
20
|
+
default: () => systemSettings_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(systemSettings_exports);
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
|
+
var systemSettings_default = (0, import_server.extendCollection)({
|
|
25
|
+
name: "systemSettings",
|
|
26
|
+
fields: [
|
|
27
|
+
{
|
|
28
|
+
type: "json",
|
|
29
|
+
name: "features",
|
|
30
|
+
defaultValue: []
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
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 system_message_exports = {};
|
|
19
|
+
__export(system_message_exports, {
|
|
20
|
+
default: () => system_message_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(system_message_exports);
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
|
+
var system_message_default = (0, import_server.defineCollection)({
|
|
25
|
+
dumpRules: {
|
|
26
|
+
group: "required"
|
|
27
|
+
},
|
|
28
|
+
name: "system_message",
|
|
29
|
+
title: "\u6D88\u606F\u901A\u77E5",
|
|
30
|
+
createdBy: true,
|
|
31
|
+
updatedBy: true,
|
|
32
|
+
origin: "@tachybase/module-hera",
|
|
33
|
+
fields: [
|
|
34
|
+
{
|
|
35
|
+
title: "\u5DF2\u8BFB",
|
|
36
|
+
name: "read",
|
|
37
|
+
type: "boolean",
|
|
38
|
+
interface: "checkbox",
|
|
39
|
+
parentKey: null,
|
|
40
|
+
reverseKey: null,
|
|
41
|
+
uiSchema: {
|
|
42
|
+
type: "boolean",
|
|
43
|
+
"x-component": "Checkbox",
|
|
44
|
+
title: "\u662F\u5426\u542F\u7528(\u52FE\u9009)"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: "\u4EE3\u529E",
|
|
49
|
+
name: "title",
|
|
50
|
+
type: "string"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
title: "\u5185\u5BB9",
|
|
54
|
+
name: "content",
|
|
55
|
+
type: "string"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
interface: "m2o",
|
|
59
|
+
type: "belongsTo",
|
|
60
|
+
name: "\u7528\u6237",
|
|
61
|
+
target: "users",
|
|
62
|
+
sourceKey: "id",
|
|
63
|
+
foreignKey: "user_id",
|
|
64
|
+
onDelete: "SET NUll"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
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 token_configuration_exports = {};
|
|
19
|
+
__export(token_configuration_exports, {
|
|
20
|
+
default: () => token_configuration_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(token_configuration_exports);
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
|
+
var token_configuration_default = (0, import_server.defineCollection)({
|
|
25
|
+
dumpRules: {
|
|
26
|
+
group: "required"
|
|
27
|
+
},
|
|
28
|
+
name: "tokenConfiguration",
|
|
29
|
+
title: "\u5F00\u653E\u5E73\u53F0 Token \u7BA1\u7406",
|
|
30
|
+
fields: [
|
|
31
|
+
{
|
|
32
|
+
title: "App ID",
|
|
33
|
+
name: "app_id",
|
|
34
|
+
type: "string"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
title: "App Secret",
|
|
38
|
+
name: "app_secret",
|
|
39
|
+
type: "string"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: "chat_id",
|
|
43
|
+
comment: "\u6682\u65F6\u8BBE\u7F6E\u5728\u8FD9\u91CC",
|
|
44
|
+
name: "chat_id",
|
|
45
|
+
type: "string"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: "Token Type",
|
|
49
|
+
comment: "\u79D8\u94A5\u7C7B\u578B",
|
|
50
|
+
name: "type",
|
|
51
|
+
type: "string"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseColumnFieldOptions, DataTypes, Field, Model } from '@tego/server';
|
|
2
|
+
export interface CalcFieldOptions extends BaseColumnFieldOptions {
|
|
3
|
+
type: 'calc';
|
|
4
|
+
}
|
|
5
|
+
export default class CalcField extends Field {
|
|
6
|
+
get dataType(): DataTypes.StringDataTypeConstructor;
|
|
7
|
+
constructor(options: CalcFieldOptions, context: any);
|
|
8
|
+
setValue: (instance: Model) => void;
|
|
9
|
+
bind(): void;
|
|
10
|
+
unbind(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 calc_exports = {};
|
|
19
|
+
__export(calc_exports, {
|
|
20
|
+
default: () => CalcField
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(calc_exports);
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
|
+
class CalcField extends import_server.Field {
|
|
25
|
+
constructor(options, context) {
|
|
26
|
+
super(options, context);
|
|
27
|
+
this.setValue = (instance) => {
|
|
28
|
+
const { name } = this.options;
|
|
29
|
+
instance.set(name, "hello world");
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
get dataType() {
|
|
33
|
+
return import_server.DataTypes.STRING;
|
|
34
|
+
}
|
|
35
|
+
bind() {
|
|
36
|
+
super.bind();
|
|
37
|
+
this.on("beforeCreate", this.setValue);
|
|
38
|
+
}
|
|
39
|
+
unbind() {
|
|
40
|
+
super.unbind();
|
|
41
|
+
this.off("beforeCreate", this.setValue);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseColumnFieldOptions, DataTypes, Field } from '@tego/server';
|
|
2
|
+
export interface TstzrangeFieldOptions extends BaseColumnFieldOptions {
|
|
3
|
+
type: 'tstzrange';
|
|
4
|
+
}
|
|
5
|
+
export default class TstzrangeField extends Field {
|
|
6
|
+
get dataType(): DataTypes.RangeDataType<DataTypes.DateDataTypeConstructor>;
|
|
7
|
+
}
|