@wener/common 1.0.4 → 2.0.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/lib/cn/DivisionCode.js +55 -32
- package/lib/cn/DivisionCode.test.js +140 -0
- package/lib/cn/Mod11Checksum.js +80 -37
- package/lib/cn/Mod31Checksum.js +89 -40
- package/lib/cn/ResidentIdentityCardNumber.js +16 -16
- package/lib/cn/ResidentIdentityCardNumber.test.js +21 -0
- package/lib/cn/UnifiedSocialCreditCode.js +32 -26
- package/lib/cn/UnifiedSocialCreditCode.test.js +16 -0
- package/lib/cn/formatDate.js +5 -7
- package/lib/cn/index.js +0 -1
- package/lib/cn/parseSex.js +0 -2
- package/lib/cn/types.d.js +0 -2
- package/lib/consola/createStandardConsolaReporter.js +18 -0
- package/lib/consola/formatLogObject.js +226 -0
- package/lib/consola/index.js +2 -0
- package/lib/data/formatSort.js +5 -6
- package/lib/data/formatSort.test.js +34 -0
- package/lib/data/index.js +0 -1
- package/lib/data/maybeNumber.js +11 -5
- package/lib/data/parseSort.js +28 -22
- package/lib/data/parseSort.test.js +188 -0
- package/lib/data/resolvePagination.js +27 -16
- package/lib/data/resolvePagination.test.js +232 -0
- package/lib/data/types.d.js +0 -2
- package/lib/index.js +0 -1
- package/lib/jsonschema/JsonSchema.js +80 -54
- package/lib/jsonschema/JsonSchema.test.js +137 -0
- package/lib/jsonschema/index.js +0 -1
- package/lib/jsonschema/types.d.js +5 -3
- package/lib/meta/defineFileType.js +103 -20
- package/lib/meta/defineInit.js +250 -31
- package/lib/meta/defineMetadata.js +140 -24
- package/lib/meta/defineMetadata.test.js +13 -0
- package/lib/meta/index.js +0 -1
- package/lib/password/PHC.js +87 -63
- package/lib/password/PHC.test.js +539 -0
- package/lib/password/Password.js +291 -29
- package/lib/password/Password.test.js +362 -0
- package/lib/password/createArgon2PasswordAlgorithm.js +191 -35
- package/lib/password/createBase64PasswordAlgorithm.js +141 -8
- package/lib/password/createBcryptPasswordAlgorithm.js +168 -13
- package/lib/password/createPBKDF2PasswordAlgorithm.js +228 -46
- package/lib/password/createScryptPasswordAlgorithm.js +211 -55
- package/lib/password/index.js +0 -1
- package/lib/password/server/index.js +0 -1
- package/lib/resource/Identifiable.js +1 -0
- package/lib/resource/getTitleOfResource.js +10 -0
- package/lib/resource/index.js +1 -0
- package/lib/resource/schema/AnyResourceSchema.js +89 -0
- package/lib/resource/schema/BaseResourceSchema.js +29 -0
- package/lib/resource/schema/ResourceActionType.js +118 -0
- package/lib/resource/schema/ResourceStatus.js +93 -0
- package/lib/resource/schema/ResourceType.js +24 -0
- package/lib/resource/schema/SchemaRegistry.js +38 -0
- package/lib/resource/schema/SexType.js +10 -0
- package/lib/resource/schema/types.js +89 -0
- package/lib/resource/schema/types.test.js +14 -0
- package/lib/schema/TypeSchema.d.js +1 -0
- package/lib/schema/createSchemaData.js +173 -0
- package/lib/schema/findJsonSchemaByPath.js +49 -0
- package/lib/schema/getSchemaCache.js +11 -0
- package/lib/schema/getSchemaOptions.js +24 -0
- package/lib/schema/index.js +5 -0
- package/lib/schema/toJsonSchema.js +441 -0
- package/lib/schema/toJsonSchema.test.js +27 -0
- package/lib/schema/validate.js +124 -0
- package/lib/search/AdvanceSearch.js +0 -1
- package/lib/search/AdvanceSearch.test.js +435 -0
- package/lib/search/formatAdvanceSearch.js +41 -27
- package/lib/search/index.js +0 -1
- package/lib/search/optimizeAdvanceSearch.js +79 -25
- package/lib/search/parseAdvanceSearch.js +5 -5
- package/lib/search/parser.d.js +0 -2
- package/lib/search/parser.js +97 -74
- package/lib/search/types.d.js +0 -2
- package/lib/tools/generateSchema.js +201 -0
- package/lib/tools/renderJsonSchemaToMarkdownDoc.js +143 -55
- package/package.json +30 -9
- package/src/consola/createStandardConsolaReporter.ts +31 -0
- package/src/consola/formatLogObject.ts +171 -0
- package/src/consola/index.ts +2 -0
- package/src/data/maybeNumber.ts +5 -1
- package/src/data/resolvePagination.test.ts +1 -1
- package/src/data/resolvePagination.ts +18 -7
- package/src/data/types.d.ts +12 -0
- package/src/jsonschema/JsonSchema.test.ts +17 -0
- package/src/jsonschema/JsonSchema.ts +4 -4
- package/src/jsonschema/types.d.ts +63 -12
- package/src/resource/Identifiable.ts +3 -0
- package/src/resource/getTitleOfResource.tsx +6 -0
- package/src/resource/index.ts +3 -0
- package/src/resource/schema/AnyResourceSchema.ts +113 -0
- package/src/resource/schema/BaseResourceSchema.ts +32 -0
- package/src/resource/schema/ResourceActionType.ts +123 -0
- package/src/resource/schema/ResourceStatus.ts +94 -0
- package/src/resource/schema/ResourceType.ts +25 -0
- package/src/resource/schema/SchemaRegistry.ts +42 -0
- package/src/resource/schema/SexType.ts +13 -0
- package/src/resource/schema/types.test.ts +18 -0
- package/src/resource/schema/types.ts +105 -0
- package/src/schema/TypeSchema.d.ts +32 -0
- package/src/schema/createSchemaData.ts +81 -0
- package/src/schema/findJsonSchemaByPath.ts +37 -0
- package/src/schema/getSchemaCache.ts +21 -0
- package/src/schema/getSchemaOptions.ts +24 -0
- package/src/schema/index.ts +6 -0
- package/src/schema/toJsonSchema.test.ts +37 -0
- package/src/schema/toJsonSchema.ts +200 -0
- package/src/schema/validate.ts +135 -0
- package/src/tools/generateSchema.ts +39 -0
- package/lib/cn/DivisionCode.js.map +0 -1
- package/lib/cn/Mod11Checksum.js.map +0 -1
- package/lib/cn/Mod31Checksum.js.map +0 -1
- package/lib/cn/ResidentIdentityCardNumber.js.map +0 -1
- package/lib/cn/UnifiedSocialCreditCode.js.map +0 -1
- package/lib/cn/formatDate.js.map +0 -1
- package/lib/cn/index.js.map +0 -1
- package/lib/cn/parseSex.js.map +0 -1
- package/lib/cn/types.d.js.map +0 -1
- package/lib/data/formatSort.js.map +0 -1
- package/lib/data/index.js.map +0 -1
- package/lib/data/maybeNumber.js.map +0 -1
- package/lib/data/parseSort.js.map +0 -1
- package/lib/data/resolvePagination.js.map +0 -1
- package/lib/data/types.d.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/jsonschema/JsonSchema.js.map +0 -1
- package/lib/jsonschema/index.js.map +0 -1
- package/lib/jsonschema/types.d.js.map +0 -1
- package/lib/meta/defineFileType.js.map +0 -1
- package/lib/meta/defineInit.js.map +0 -1
- package/lib/meta/defineMetadata.js.map +0 -1
- package/lib/meta/index.js.map +0 -1
- package/lib/password/PHC.js.map +0 -1
- package/lib/password/Password.js.map +0 -1
- package/lib/password/createArgon2PasswordAlgorithm.js.map +0 -1
- package/lib/password/createBase64PasswordAlgorithm.js.map +0 -1
- package/lib/password/createBcryptPasswordAlgorithm.js.map +0 -1
- package/lib/password/createPBKDF2PasswordAlgorithm.js.map +0 -1
- package/lib/password/createScryptPasswordAlgorithm.js.map +0 -1
- package/lib/password/index.js.map +0 -1
- package/lib/password/server/index.js.map +0 -1
- package/lib/search/AdvanceSearch.js.map +0 -1
- package/lib/search/formatAdvanceSearch.js.map +0 -1
- package/lib/search/index.js.map +0 -1
- package/lib/search/optimizeAdvanceSearch.js.map +0 -1
- package/lib/search/parseAdvanceSearch.js.map +0 -1
- package/lib/search/parser.d.js.map +0 -1
- package/lib/search/parser.js.map +0 -1
- package/lib/search/types.d.js.map +0 -1
- package/lib/tools/renderJsonSchemaToMarkdownDoc.js.map +0 -1
|
@@ -1,66 +1,222 @@
|
|
|
1
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
|
+
try {
|
|
3
|
+
var info = gen[key](arg);
|
|
4
|
+
var value = info.value;
|
|
5
|
+
}
|
|
6
|
+
catch (error) {
|
|
7
|
+
reject(error);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (info.done) {
|
|
11
|
+
resolve(value);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
Promise.resolve(value).then(_next, _throw);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function _async_to_generator(fn) {
|
|
18
|
+
return function () {
|
|
19
|
+
var self = this, args = arguments;
|
|
20
|
+
return new Promise(function (resolve, reject) {
|
|
21
|
+
var gen = fn.apply(self, args);
|
|
22
|
+
function _next(value) {
|
|
23
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
24
|
+
}
|
|
25
|
+
function _throw(err) {
|
|
26
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
27
|
+
}
|
|
28
|
+
_next(undefined);
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function _ts_generator(thisArg, body) {
|
|
33
|
+
var f, y, t, _ = {
|
|
34
|
+
label: 0,
|
|
35
|
+
sent: function () {
|
|
36
|
+
if (t[0] & 1)
|
|
37
|
+
throw t[1];
|
|
38
|
+
return t[1];
|
|
39
|
+
},
|
|
40
|
+
trys: [],
|
|
41
|
+
ops: []
|
|
42
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
43
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
44
|
+
return this;
|
|
45
|
+
}), g;
|
|
46
|
+
function verb(n) {
|
|
47
|
+
return function (v) {
|
|
48
|
+
return step([
|
|
49
|
+
n,
|
|
50
|
+
v
|
|
51
|
+
]);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function step(op) {
|
|
55
|
+
if (f)
|
|
56
|
+
throw new TypeError("Generator is already executing.");
|
|
57
|
+
while (g && (g = 0, op[0] && (_ = 0)), _)
|
|
58
|
+
try {
|
|
59
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
60
|
+
return t;
|
|
61
|
+
if (y = 0, t)
|
|
62
|
+
op = [
|
|
63
|
+
op[0] & 2,
|
|
64
|
+
t.value
|
|
65
|
+
];
|
|
66
|
+
switch (op[0]) {
|
|
67
|
+
case 0:
|
|
68
|
+
case 1:
|
|
69
|
+
t = op;
|
|
70
|
+
break;
|
|
71
|
+
case 4:
|
|
72
|
+
_.label++;
|
|
73
|
+
return {
|
|
74
|
+
value: op[1],
|
|
75
|
+
done: false
|
|
76
|
+
};
|
|
77
|
+
case 5:
|
|
78
|
+
_.label++;
|
|
79
|
+
y = op[1];
|
|
80
|
+
op = [
|
|
81
|
+
0
|
|
82
|
+
];
|
|
83
|
+
continue;
|
|
84
|
+
case 7:
|
|
85
|
+
op = _.ops.pop();
|
|
86
|
+
_.trys.pop();
|
|
87
|
+
continue;
|
|
88
|
+
default:
|
|
89
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
90
|
+
_ = 0;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
94
|
+
_.label = op[1];
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
98
|
+
_.label = t[1];
|
|
99
|
+
t = op;
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
if (t && _.label < t[2]) {
|
|
103
|
+
_.label = t[2];
|
|
104
|
+
_.ops.push(op);
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
if (t[2])
|
|
108
|
+
_.ops.pop();
|
|
109
|
+
_.trys.pop();
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
op = body.call(thisArg, _);
|
|
113
|
+
}
|
|
114
|
+
catch (e) {
|
|
115
|
+
op = [
|
|
116
|
+
6,
|
|
117
|
+
e
|
|
118
|
+
];
|
|
119
|
+
y = 0;
|
|
120
|
+
}
|
|
121
|
+
finally {
|
|
122
|
+
f = t = 0;
|
|
123
|
+
}
|
|
124
|
+
if (op[0] & 5)
|
|
125
|
+
throw op[1];
|
|
126
|
+
return {
|
|
127
|
+
value: op[0] ? op[1] : void 0,
|
|
128
|
+
done: true
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
1
132
|
import { randomBytes, scrypt, timingSafeEqual } from "node:crypto";
|
|
2
133
|
import { Errors } from "@wener/utils";
|
|
3
134
|
import { PHC } from "./PHC.js";
|
|
4
|
-
export function createScryptPasswordAlgorithm(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
options.
|
|
8
|
-
options.
|
|
9
|
-
options.
|
|
10
|
-
options.
|
|
135
|
+
export function createScryptPasswordAlgorithm() {
|
|
136
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
137
|
+
var _options, _options1, _options2, _options3, _options4;
|
|
138
|
+
var id = options.id || "scrypt";
|
|
139
|
+
(_options = options).cost || (_options.cost = Math.pow(2, 14));
|
|
140
|
+
(_options1 = options).blocksize || (_options1.blocksize = 8);
|
|
141
|
+
(_options2 = options).parallelism || (_options2.parallelism = 1);
|
|
142
|
+
(_options3 = options).saltlen || (_options3.saltlen = 16);
|
|
143
|
+
(_options4 = options).keylen || (_options4.keylen = 32);
|
|
11
144
|
return {
|
|
12
145
|
name: id,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
146
|
+
hash: function hash(password, opts) {
|
|
147
|
+
return _async_to_generator(function () {
|
|
148
|
+
var salt;
|
|
149
|
+
return _ts_generator(this, function (_state) {
|
|
150
|
+
salt = (opts === null || opts === void 0 ? void 0 : opts.salt) || randomBytes(options.saltlen);
|
|
151
|
+
return [
|
|
152
|
+
2,
|
|
153
|
+
new Promise(function (resolve, reject) {
|
|
154
|
+
var N = options.cost;
|
|
155
|
+
var r = options.blocksize;
|
|
156
|
+
var p = options.parallelism;
|
|
157
|
+
scrypt(password, salt, options.keylen, {
|
|
158
|
+
N: N,
|
|
159
|
+
r: r,
|
|
160
|
+
p: p
|
|
161
|
+
}, function (err, derivedKey) {
|
|
162
|
+
if (err)
|
|
163
|
+
return reject(err);
|
|
164
|
+
var _opts_id;
|
|
165
|
+
resolve(PHC.serialize({
|
|
166
|
+
id: (_opts_id = opts === null || opts === void 0 ? void 0 : opts.id) !== null && _opts_id !== void 0 ? _opts_id : id,
|
|
167
|
+
params: {
|
|
168
|
+
ln: N,
|
|
169
|
+
r: r,
|
|
170
|
+
p: p
|
|
171
|
+
},
|
|
172
|
+
salt: salt,
|
|
173
|
+
hash: derivedKey
|
|
174
|
+
}));
|
|
175
|
+
});
|
|
176
|
+
})
|
|
177
|
+
];
|
|
36
178
|
});
|
|
37
|
-
});
|
|
179
|
+
})();
|
|
38
180
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
181
|
+
verify: function verify(password, hash, opts) {
|
|
182
|
+
return _async_to_generator(function () {
|
|
183
|
+
var _opts_params, _opts_params1, _opts_params2, salt, storedHash, N, r, p, keylen;
|
|
184
|
+
return _ts_generator(this, function (_state) {
|
|
185
|
+
try {
|
|
186
|
+
;
|
|
187
|
+
salt = Errors.BadRequest.require(opts.salt);
|
|
188
|
+
storedHash = Errors.BadRequest.require(opts.hash);
|
|
189
|
+
N = parseInt((_opts_params = opts.params) === null || _opts_params === void 0 ? void 0 : _opts_params.ln, 10);
|
|
190
|
+
r = parseInt((_opts_params1 = opts.params) === null || _opts_params1 === void 0 ? void 0 : _opts_params1.r, 10);
|
|
191
|
+
p = parseInt((_opts_params2 = opts.params) === null || _opts_params2 === void 0 ? void 0 : _opts_params2.p, 10);
|
|
192
|
+
keylen = storedHash.length;
|
|
193
|
+
return [
|
|
194
|
+
2,
|
|
195
|
+
new Promise(function (resolve, reject) {
|
|
196
|
+
scrypt(password, salt, keylen, {
|
|
197
|
+
N: N,
|
|
198
|
+
r: r,
|
|
199
|
+
p: p
|
|
200
|
+
}, function (err, derivedKey) {
|
|
201
|
+
if (err)
|
|
202
|
+
return reject(err);
|
|
203
|
+
var isMatch = timingSafeEqual(derivedKey, storedHash);
|
|
204
|
+
resolve(isMatch);
|
|
205
|
+
});
|
|
206
|
+
})
|
|
207
|
+
];
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
return [
|
|
211
|
+
2,
|
|
212
|
+
Promise.resolve(false)
|
|
213
|
+
];
|
|
214
|
+
}
|
|
215
|
+
return [
|
|
216
|
+
2
|
|
217
|
+
];
|
|
58
218
|
});
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
return Promise.resolve(false);
|
|
62
|
-
}
|
|
219
|
+
})();
|
|
63
220
|
}
|
|
64
221
|
};
|
|
65
222
|
}
|
|
66
|
-
//# sourceMappingURL=createScryptPasswordAlgorithm.js.map
|
package/lib/password/index.js
CHANGED
|
@@ -3,4 +3,3 @@ export { Password } from "./Password.js";
|
|
|
3
3
|
export { createArgon2PasswordAlgorithm } from "./createArgon2PasswordAlgorithm.js";
|
|
4
4
|
export { createBase64PasswordAlgorithm } from "./createBase64PasswordAlgorithm.js";
|
|
5
5
|
export { createBcryptPasswordAlgorithm } from "./createBcryptPasswordAlgorithm.js";
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function _type_of(obj) {
|
|
2
|
+
"@swc/helpers - typeof";
|
|
3
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
4
|
+
}
|
|
5
|
+
export function getTitleOfResource(res) {
|
|
6
|
+
if (res && (typeof res === "undefined" ? "undefined" : _type_of(res)) === 'object') {
|
|
7
|
+
return res.displayName || res.title || res.fullName || res.loginName || res.topic || res.code;
|
|
8
|
+
}
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getTitleOfResource } from "./getTitleOfResource.js";
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
import { SexTypeSchema } from "./SexType.js";
|
|
3
|
+
import { rz } from "./types.js";
|
|
4
|
+
export var AnyResourceSchema = z.object({
|
|
5
|
+
id: rz.resourceId.readonly().describe("ID"),
|
|
6
|
+
uid: z.guid().nullish().readonly().describe("\u552F\u4E00ID"),
|
|
7
|
+
tid: rz.resourceId.nullish().readonly().describe("\u79DF\u6237ID"),
|
|
8
|
+
sid: z.coerce.number().nullish().readonly().describe("\u5E8F\u53F7"),
|
|
9
|
+
eid: z.string().nullish().readonly().describe("\u5916\u90E8ID"),
|
|
10
|
+
cid: z.string().nullish().readonly().describe("\u670D\u52A1\u5546ID"),
|
|
11
|
+
rid: z.string().nullish().readonly().describe("\u670D\u52A1\u5546\u8D44\u6E90ID"),
|
|
12
|
+
code: z.string().nullish().describe("\u7F16\u53F7"),
|
|
13
|
+
fullName: rz.friendlyName.optional().describe("\u540D\u79F0"),
|
|
14
|
+
displayName: rz.friendlyName.nullish().describe("\u663E\u793A\u540D"),
|
|
15
|
+
loginName: rz.loginName.nullish().describe("\u767B\u5F55\u540D"),
|
|
16
|
+
email: z.string().nullish().describe("\u90AE\u7BB1"),
|
|
17
|
+
emailVerifiedAt: rz.date.nullish().describe("\u90AE\u7BB1\u9A8C\u8BC1\u65F6\u95F4"),
|
|
18
|
+
phoneNumber: rz.phoneNumber.nullish().describe("\u7535\u8BDD\u53F7\u7801"),
|
|
19
|
+
phoneNumberVerifiedAt: rz.date.nullish().describe("\u7535\u8BDD\u53F7\u7801\u9A8C\u8BC1\u65F6\u95F4"),
|
|
20
|
+
jobNumber: z.string().nullish().describe("\u5DE5\u53F7"),
|
|
21
|
+
jobTitle: z.string().nullish().describe("\u804C\u4F4D"),
|
|
22
|
+
birthDate: rz.date.nullish().describe("\u51FA\u751F\u65E5\u671F"),
|
|
23
|
+
password: rz.password.nullish().describe("\u5BC6\u7801"),
|
|
24
|
+
sex: SexTypeSchema.nullish().describe("\u6027\u522B"),
|
|
25
|
+
contactName: rz.friendlyName.nullish().describe("\u8054\u7CFB\u4EBA"),
|
|
26
|
+
contactPhone: rz.phoneNumber.nullish().describe("\u8054\u7CFB\u7535\u8BDD"),
|
|
27
|
+
contactEmail: z.string().nullish().describe("\u8054\u7CFB\u90AE\u7BB1"),
|
|
28
|
+
contactAddress: z.string().nullish().describe("\u8054\u7CFB\u5730\u5740"),
|
|
29
|
+
alternativeName: rz.friendlyName.nullish().describe("\u5907\u7528\u8054\u7CFB\u4EBA"),
|
|
30
|
+
alternativeEmail: z.string().nullish().describe("\u5907\u7528\u8054\u7CFB\u90AE\u7BB1"),
|
|
31
|
+
alternativePhone: rz.phoneNumber.nullish().describe("\u5907\u7528\u8054\u7CFB\u7535\u8BDD"),
|
|
32
|
+
alternativeAddress: z.string().nullish().describe("\u5907\u7528\u8054\u7CFB\u5730\u5740"),
|
|
33
|
+
title: z.string().trim().nullish().describe("\u6807\u9898"),
|
|
34
|
+
description: z.string().trim().nullish().describe("\u63CF\u8FF0"),
|
|
35
|
+
topic: z.string().nullish().describe("\u4E3B\u9898"),
|
|
36
|
+
summary: z.string().nullish().describe("\u6458\u8981"),
|
|
37
|
+
avatarUrl: z.string().nullish().describe("\u5934\u50CF"),
|
|
38
|
+
photoUrl: z.string().nullish().describe("\u7167\u7247"),
|
|
39
|
+
imageUrl: z.string().nullish().describe("\u56FE\u7247"),
|
|
40
|
+
bannerUrl: z.string().nullish().describe("\u6A2A\u5E45\u56FE\u7247"),
|
|
41
|
+
type: z.string().nullish().describe("\u7C7B\u578B"),
|
|
42
|
+
data: z.record(z.string(), z.any()).nullish().describe("\u6570\u636E"),
|
|
43
|
+
licenseNumber: z.string().nullish().describe("\u8BC1\u4EF6\u53F7\u7801"),
|
|
44
|
+
licenseStartDate: rz.date.nullish().describe("\u8BC1\u4EF6\u6709\u6548\u671F\u5F00\u59CB\u65E5\u671F"),
|
|
45
|
+
licenseEndDate: rz.date.nullish().describe("\u8BC1\u4EF6\u6709\u6548\u671F\u7ED3\u675F\u65E5\u671F"),
|
|
46
|
+
licenseAddress: z.string().nullish().describe("\u8BC1\u4EF6\u5730\u5740"),
|
|
47
|
+
licenseFrontUrl: z.string().nullish().describe("\u8BC1\u4EF6\u6B63\u9762\u7167\u7247"),
|
|
48
|
+
licenseBackUrl: z.string().nullish().describe("\u8BC1\u4EF6\u80CC\u9762\u7167\u7247"),
|
|
49
|
+
address: z.string().nullish().describe("\u5730\u5740"),
|
|
50
|
+
divisionCode: z.string().nullish().describe("\u884C\u653F\u533A\u5212\u4EE3\u7801"),
|
|
51
|
+
province: z.string().nullish().describe("\u7701"),
|
|
52
|
+
city: z.string().nullish().describe("\u5E02"),
|
|
53
|
+
startDate: rz.date.nullish().describe("\u5F00\u59CB\u65E5\u671F"),
|
|
54
|
+
endDate: rz.date.nullish().describe("\u7ED3\u675F\u65E5\u671F"),
|
|
55
|
+
startTime: rz.dateTime.nullish().describe("\u5F00\u59CB\u65F6\u95F4"),
|
|
56
|
+
endTime: rz.dateTime.nullish().describe("\u7ED3\u675F\u65F6\u95F4"),
|
|
57
|
+
userId: rz.resourceIdOf("User").nullish(),
|
|
58
|
+
entityId: rz.resourceId.nullish().describe("\u5173\u8054\u7684\u5B9E\u4F53"),
|
|
59
|
+
entityType: z.string().nullish().describe("\u5173\u8054\u7684\u5B9E\u4F53\u7C7B\u578B"),
|
|
60
|
+
customerId: rz.resourceId.nullish().describe("\u5BA2\u6237"),
|
|
61
|
+
customerType: z.string().nullish().describe("\u5BA2\u6237\u7C7B\u578B"),
|
|
62
|
+
contactId: rz.resourceId.nullish().describe("\u8054\u7CFB\u4EBA"),
|
|
63
|
+
accountId: rz.resourceId.nullish().describe("\u8D26\u6237"),
|
|
64
|
+
ownerId: rz.resourceId.nullish(),
|
|
65
|
+
ownerType: z.string().nullish().describe("\u8D1F\u8D23\u4EBA\u7C7B\u578B"),
|
|
66
|
+
owningUserId: rz.resourceId.nullish().describe("\u8D1F\u8D23\u4EBA"),
|
|
67
|
+
parentId: rz.resourceId.nullish().describe("\u7236\u7EA7"),
|
|
68
|
+
metadata: z.record(z.string(), z.any()).nullish().describe("\u5143\u6570\u636E"),
|
|
69
|
+
tags: z.array(z.string()).nullish().describe("\u6807\u8BB0"),
|
|
70
|
+
notes: z.string().nullish().describe("\u5907\u6CE8"),
|
|
71
|
+
state: z.string().nullish().describe("\u7CFB\u7EDF\u72B6\u6001"),
|
|
72
|
+
status: z.string().nullish().describe("\u72B6\u6001"),
|
|
73
|
+
statusReason: z.string().nullish().describe("\u72B6\u6001\u539F\u56E0"),
|
|
74
|
+
statusUpdatedAt: rz.dateTime.nullish().describe("\u72B6\u6001\u66F4\u65B0\u65F6\u95F4"),
|
|
75
|
+
statusUpdatedById: rz.resourceId.nullish().describe("\u72B6\u6001\u66F4\u65B0\u4EBA"),
|
|
76
|
+
createdAt: rz.dateTime.nullish().readonly().describe("\u521B\u5EFA\u65F6\u95F4"),
|
|
77
|
+
updatedAt: rz.dateTime.nullish().readonly().describe("\u66F4\u65B0\u65F6\u95F4"),
|
|
78
|
+
deletedAt: rz.dateTime.nullish().readonly().describe("\u5220\u9664\u65F6\u95F4"),
|
|
79
|
+
createdById: z.string().nullish().readonly().describe("\u521B\u5EFA\u4EBA"),
|
|
80
|
+
updatedById: z.string().nullish().readonly().describe("\u66F4\u65B0\u4EBA"),
|
|
81
|
+
deletedById: z.string().nullish().readonly().describe("\u5220\u9664\u4EBA"),
|
|
82
|
+
attributes: z.record(z.string(), z.any()).nullish().describe("\u81EA\u5B9A\u4E49\u5C5E\u6027"),
|
|
83
|
+
properties: z.record(z.string(), z.any()).nullish().describe("\u5C5E\u6027"),
|
|
84
|
+
extensions: z.record(z.string(), z.any()).nullish().describe("\u6269\u5C55\u5C5E\u6027"),
|
|
85
|
+
__typename: z.coerce.string().nullish().describe("\u7C7B\u578B")
|
|
86
|
+
}).meta({
|
|
87
|
+
title: "AnyResource",
|
|
88
|
+
description: "\u4EFB\u610F\u8D44\u6E90"
|
|
89
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AnyResourceSchema } from "./AnyResourceSchema.js";
|
|
2
|
+
export var BaseResourceSchema = AnyResourceSchema.pick({
|
|
3
|
+
id: true,
|
|
4
|
+
uid: true,
|
|
5
|
+
tid: true,
|
|
6
|
+
eid: true,
|
|
7
|
+
state: true,
|
|
8
|
+
status: true,
|
|
9
|
+
statusReason: true,
|
|
10
|
+
statusUpdatedAt: true,
|
|
11
|
+
statusUpdatedById: true,
|
|
12
|
+
createdAt: true,
|
|
13
|
+
updatedAt: true,
|
|
14
|
+
deletedAt: true,
|
|
15
|
+
createdById: true,
|
|
16
|
+
updatedById: true,
|
|
17
|
+
deletedById: true,
|
|
18
|
+
attributes: true,
|
|
19
|
+
properties: true
|
|
20
|
+
}).required({
|
|
21
|
+
uid: true,
|
|
22
|
+
tid: true,
|
|
23
|
+
state: true,
|
|
24
|
+
status: true,
|
|
25
|
+
createdAt: true,
|
|
26
|
+
updatedAt: true,
|
|
27
|
+
attributes: true,
|
|
28
|
+
properties: true
|
|
29
|
+
});
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
export var ResourceActionType = Object.freeze({
|
|
3
|
+
__proto__: null,
|
|
4
|
+
Approve: 'Approve',
|
|
5
|
+
AssignOwner: 'AssignOwner',
|
|
6
|
+
Bind: 'Bind',
|
|
7
|
+
BindCustomer: 'BindCustomer',
|
|
8
|
+
BindEntity: 'BindEntity',
|
|
9
|
+
BindUser: 'BindUser',
|
|
10
|
+
Cancel: 'Cancel',
|
|
11
|
+
ChangePassword: 'ChangePassword',
|
|
12
|
+
ClaimOwner: 'ClaimOwner',
|
|
13
|
+
Close: 'Close',
|
|
14
|
+
Communicate: 'Communicate',
|
|
15
|
+
Complete: 'Complete',
|
|
16
|
+
Create: 'Create',
|
|
17
|
+
Delete: 'Delete',
|
|
18
|
+
Deny: 'Deny',
|
|
19
|
+
Disable: 'Disable',
|
|
20
|
+
Download: 'Download',
|
|
21
|
+
Edit: 'Edit',
|
|
22
|
+
Enable: 'Enable',
|
|
23
|
+
List: 'List',
|
|
24
|
+
Login: 'Login',
|
|
25
|
+
Logout: 'Logout',
|
|
26
|
+
Manage: 'Manage',
|
|
27
|
+
Publish: 'Publish',
|
|
28
|
+
Purge: 'Purge',
|
|
29
|
+
Read: 'Read',
|
|
30
|
+
Reject: 'Reject',
|
|
31
|
+
ReleaseOwner: 'ReleaseOwner',
|
|
32
|
+
ResetPassword: 'ResetPassword',
|
|
33
|
+
ReturnForRevision: 'ReturnForRevision',
|
|
34
|
+
Revise: 'Revise',
|
|
35
|
+
SaveDraft: 'SaveDraft',
|
|
36
|
+
Signup: 'Signup',
|
|
37
|
+
Submit: 'Submit',
|
|
38
|
+
SubmitAgency: 'SubmitAgency',
|
|
39
|
+
SubmitVendor: 'SubmitVendor',
|
|
40
|
+
Suspend: 'Suspend',
|
|
41
|
+
Terminate: 'Terminate',
|
|
42
|
+
Timeout: 'Timeout',
|
|
43
|
+
Unbind: 'Unbind',
|
|
44
|
+
UnbindCustomer: 'UnbindCustomer',
|
|
45
|
+
UnbindEntity: 'UnbindEntity',
|
|
46
|
+
UnbindUser: 'UnbindUser',
|
|
47
|
+
Undelete: 'Undelete',
|
|
48
|
+
Unpublish: 'Unpublish',
|
|
49
|
+
Update: 'Update',
|
|
50
|
+
UpdateNotes: 'UpdateNotes',
|
|
51
|
+
UpdateTags: 'UpdateTags',
|
|
52
|
+
Upload: 'Upload',
|
|
53
|
+
Validate: 'Validate',
|
|
54
|
+
View: 'View',
|
|
55
|
+
Write: 'Write'
|
|
56
|
+
});
|
|
57
|
+
export var ResourceActionTypeSchema = z.union([
|
|
58
|
+
z.literal(ResourceActionType.Approve).describe('批准'),
|
|
59
|
+
z.literal(ResourceActionType.AssignOwner).describe('分配负责人'),
|
|
60
|
+
z.literal(ResourceActionType.Bind).describe('绑定'),
|
|
61
|
+
z.literal(ResourceActionType.BindCustomer).describe('绑定客户'),
|
|
62
|
+
z.literal(ResourceActionType.BindEntity).describe('绑定实体'),
|
|
63
|
+
z.literal(ResourceActionType.BindUser).describe('绑定用户'),
|
|
64
|
+
z.literal(ResourceActionType.Cancel).describe('取消'),
|
|
65
|
+
z.literal(ResourceActionType.ChangePassword).describe('修改密码'),
|
|
66
|
+
z.literal(ResourceActionType.ClaimOwner).describe('认领负责人'),
|
|
67
|
+
z.literal(ResourceActionType.Close).describe('关闭'),
|
|
68
|
+
z.literal(ResourceActionType.Communicate).describe('沟通'),
|
|
69
|
+
z.literal(ResourceActionType.Complete).describe('完成'),
|
|
70
|
+
z.literal(ResourceActionType.Create).describe('创建'),
|
|
71
|
+
z.literal(ResourceActionType.Delete).describe('删除'),
|
|
72
|
+
z.literal(ResourceActionType.Deny).describe('拒绝'),
|
|
73
|
+
z.literal(ResourceActionType.Disable).describe('禁用'),
|
|
74
|
+
z.literal(ResourceActionType.Download).describe('下载'),
|
|
75
|
+
z.literal(ResourceActionType.Edit).describe('编辑'),
|
|
76
|
+
z.literal(ResourceActionType.Enable).describe('启用'),
|
|
77
|
+
z.literal(ResourceActionType.List).describe('列表'),
|
|
78
|
+
z.literal(ResourceActionType.Login).describe('登录'),
|
|
79
|
+
z.literal(ResourceActionType.Logout).describe('登出'),
|
|
80
|
+
z.literal(ResourceActionType.Manage).describe('管理'),
|
|
81
|
+
z.literal(ResourceActionType.Publish).describe('发布'),
|
|
82
|
+
z.literal(ResourceActionType.Purge).describe('彻底删除'),
|
|
83
|
+
z.literal(ResourceActionType.Read).describe('读取'),
|
|
84
|
+
z.literal(ResourceActionType.Reject).describe('驳回'),
|
|
85
|
+
z.literal(ResourceActionType.ReleaseOwner).describe('释放负责人'),
|
|
86
|
+
z.literal(ResourceActionType.ResetPassword).describe('重置密码'),
|
|
87
|
+
z.literal(ResourceActionType.ReturnForRevision).describe('退回修订'),
|
|
88
|
+
z.literal(ResourceActionType.Revise).describe('修订'),
|
|
89
|
+
z.literal(ResourceActionType.SaveDraft).describe('保存草稿'),
|
|
90
|
+
z.literal(ResourceActionType.Signup).describe('注册'),
|
|
91
|
+
z.literal(ResourceActionType.Submit).describe('提交'),
|
|
92
|
+
z.literal(ResourceActionType.SubmitAgency).describe('提交机构'),
|
|
93
|
+
z.literal(ResourceActionType.SubmitVendor).describe('提交供应商'),
|
|
94
|
+
z.literal(ResourceActionType.Suspend).describe('暂停'),
|
|
95
|
+
z.literal(ResourceActionType.Terminate).describe('终止'),
|
|
96
|
+
z.literal(ResourceActionType.Timeout).describe('超时'),
|
|
97
|
+
z.literal(ResourceActionType.Unbind).describe('解绑'),
|
|
98
|
+
z.literal(ResourceActionType.UnbindCustomer).describe('解绑客户'),
|
|
99
|
+
z.literal(ResourceActionType.UnbindEntity).describe('解绑实体'),
|
|
100
|
+
z.literal(ResourceActionType.UnbindUser).describe('解绑用户'),
|
|
101
|
+
z.literal(ResourceActionType.Undelete).describe('恢复删除'),
|
|
102
|
+
z.literal(ResourceActionType.Unpublish).describe('取消发布'),
|
|
103
|
+
z.literal(ResourceActionType.Update).describe('更新'),
|
|
104
|
+
z.literal(ResourceActionType.UpdateNotes).describe('修改备注'),
|
|
105
|
+
z.literal(ResourceActionType.UpdateNotes).describe('更新备注'),
|
|
106
|
+
z.literal(ResourceActionType.UpdateTags).describe('更新标签'),
|
|
107
|
+
z.literal(ResourceActionType.Upload).describe('上传'),
|
|
108
|
+
z.literal(ResourceActionType.Validate).describe('校验'),
|
|
109
|
+
z.literal(ResourceActionType.View).describe('查看'),
|
|
110
|
+
z.literal(ResourceActionType.Write).describe('写入')
|
|
111
|
+
]).meta({
|
|
112
|
+
title: 'ResourceAction',
|
|
113
|
+
description: '资源操作',
|
|
114
|
+
type: 'string'
|
|
115
|
+
});
|
|
116
|
+
export var ResourceActionDataSchema = z.object({
|
|
117
|
+
reason: z.string().optional().describe('操作原因')
|
|
118
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
export var ResourceStatus = Object.freeze({
|
|
3
|
+
__proto__: null,
|
|
4
|
+
Active: 'Active',
|
|
5
|
+
Approved: 'Approved',
|
|
6
|
+
Cancelled: 'Cancelled',
|
|
7
|
+
Closed: 'Closed',
|
|
8
|
+
Completed: 'Completed',
|
|
9
|
+
Confirmed: 'Confirmed',
|
|
10
|
+
Contacted: 'Contacted',
|
|
11
|
+
Contacting: 'Contacting',
|
|
12
|
+
Deleted: 'Deleted',
|
|
13
|
+
Denied: 'Denied',
|
|
14
|
+
Disabled: 'Disabled',
|
|
15
|
+
Disqualified: 'Disqualified',
|
|
16
|
+
Draft: 'Draft',
|
|
17
|
+
Enabled: 'Enabled',
|
|
18
|
+
Expired: 'Expired',
|
|
19
|
+
Failed: 'Failed',
|
|
20
|
+
InProgress: 'InProgress',
|
|
21
|
+
Inactive: 'Inactive',
|
|
22
|
+
Initial: 'Initial',
|
|
23
|
+
Lost: 'Lost',
|
|
24
|
+
New: 'New',
|
|
25
|
+
Nurturing: 'Nurturing',
|
|
26
|
+
OnHold: 'OnHold',
|
|
27
|
+
Open: 'Open',
|
|
28
|
+
Overdue: 'Overdue',
|
|
29
|
+
Paid: 'Paid',
|
|
30
|
+
PartiallyPaid: 'PartiallyPaid',
|
|
31
|
+
Pending: 'Pending',
|
|
32
|
+
PendingAcceptance: 'PendingAcceptance',
|
|
33
|
+
PendingApproval: 'PendingApproval',
|
|
34
|
+
PendingConfirmation: 'PendingConfirmation',
|
|
35
|
+
PendingResubmission: 'PendingResubmission',
|
|
36
|
+
Posted: 'Posted',
|
|
37
|
+
Published: 'Published',
|
|
38
|
+
Qualified: 'Qualified',
|
|
39
|
+
Rejected: 'Rejected',
|
|
40
|
+
Submitted: 'Submitted',
|
|
41
|
+
Suspended: 'Suspended',
|
|
42
|
+
Terminated: 'Terminated',
|
|
43
|
+
Unqualified: 'Unqualified',
|
|
44
|
+
Void: 'Void',
|
|
45
|
+
Won: 'Won'
|
|
46
|
+
});
|
|
47
|
+
export var ResourceStatusSchema = z.union([
|
|
48
|
+
z.literal(ResourceStatus.Active).describe('活跃'),
|
|
49
|
+
z.literal(ResourceStatus.Approved).describe('已通过'),
|
|
50
|
+
z.literal(ResourceStatus.Cancelled).describe('已取消'),
|
|
51
|
+
z.literal(ResourceStatus.Closed).describe('已关闭'),
|
|
52
|
+
z.literal(ResourceStatus.Completed).describe('已完成'),
|
|
53
|
+
z.literal(ResourceStatus.Confirmed).describe('已确认'),
|
|
54
|
+
z.literal(ResourceStatus.Contacted).describe('已联系'),
|
|
55
|
+
z.literal(ResourceStatus.Contacting).describe('联系中'),
|
|
56
|
+
z.literal(ResourceStatus.Deleted).describe('已删除'),
|
|
57
|
+
z.literal(ResourceStatus.Denied).describe('已拒绝'),
|
|
58
|
+
z.literal(ResourceStatus.Disabled).describe('已禁用'),
|
|
59
|
+
z.literal(ResourceStatus.Disqualified).describe('不合格'),
|
|
60
|
+
z.literal(ResourceStatus.Draft).describe('草稿'),
|
|
61
|
+
z.literal(ResourceStatus.Enabled).describe('已启用'),
|
|
62
|
+
z.literal(ResourceStatus.Expired).describe('已过期'),
|
|
63
|
+
z.literal(ResourceStatus.InProgress).describe('进行中'),
|
|
64
|
+
z.literal(ResourceStatus.Inactive).describe('停用'),
|
|
65
|
+
z.literal(ResourceStatus.Initial).describe('初始'),
|
|
66
|
+
z.literal(ResourceStatus.Lost).describe('已失去'),
|
|
67
|
+
z.literal(ResourceStatus.New).describe('新建'),
|
|
68
|
+
z.literal(ResourceStatus.Nurturing).describe('培育中'),
|
|
69
|
+
z.literal(ResourceStatus.OnHold).describe('搁置'),
|
|
70
|
+
z.literal(ResourceStatus.Open).describe('开放'),
|
|
71
|
+
z.literal(ResourceStatus.Overdue).describe('逾期'),
|
|
72
|
+
z.literal(ResourceStatus.Paid).describe('已支付'),
|
|
73
|
+
z.literal(ResourceStatus.PartiallyPaid).describe('部分支付'),
|
|
74
|
+
z.literal(ResourceStatus.Pending).describe('待审核'),
|
|
75
|
+
z.literal(ResourceStatus.PendingAcceptance).describe('待接受'),
|
|
76
|
+
z.literal(ResourceStatus.PendingApproval).describe('待批准'),
|
|
77
|
+
z.literal(ResourceStatus.PendingConfirmation).describe('待确认'),
|
|
78
|
+
z.literal(ResourceStatus.PendingResubmission).describe('待重新提交'),
|
|
79
|
+
z.literal(ResourceStatus.Posted).describe('已过账'),
|
|
80
|
+
z.literal(ResourceStatus.Published).describe('已发布'),
|
|
81
|
+
z.literal(ResourceStatus.Qualified).describe('已合格'),
|
|
82
|
+
z.literal(ResourceStatus.Rejected).describe('已驳回'),
|
|
83
|
+
z.literal(ResourceStatus.Submitted).describe('已提交'),
|
|
84
|
+
z.literal(ResourceStatus.Suspended).describe('暂停'),
|
|
85
|
+
z.literal(ResourceStatus.Terminated).describe('终止'),
|
|
86
|
+
z.literal(ResourceStatus.Unqualified).describe('未达标'),
|
|
87
|
+
z.literal(ResourceStatus.Void).describe('作废'),
|
|
88
|
+
z.literal(ResourceStatus.Won).describe('已赢得')
|
|
89
|
+
]).meta({
|
|
90
|
+
title: 'ResourceStatus',
|
|
91
|
+
description: '资源状态',
|
|
92
|
+
type: 'string'
|
|
93
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
export var ResourceType = Object.freeze({
|
|
3
|
+
__proto__: null,
|
|
4
|
+
User: 'User',
|
|
5
|
+
Customer: 'Customer',
|
|
6
|
+
Contact: 'Contact',
|
|
7
|
+
Account: 'Account',
|
|
8
|
+
Order: 'Order',
|
|
9
|
+
Lead: 'Lead',
|
|
10
|
+
Opportunity: 'Opportunity'
|
|
11
|
+
});
|
|
12
|
+
export var ResourceTypeSchema = z.union([
|
|
13
|
+
z.literal(ResourceType.User).describe('用户'),
|
|
14
|
+
z.literal(ResourceType.Customer).describe('客户'),
|
|
15
|
+
z.literal(ResourceType.Contact).describe('联系人'),
|
|
16
|
+
z.literal(ResourceType.Account).describe('账户'),
|
|
17
|
+
z.literal(ResourceType.Order).describe('订单'),
|
|
18
|
+
z.literal(ResourceType.Lead).describe('线索'),
|
|
19
|
+
z.literal(ResourceType.Opportunity).describe('商机')
|
|
20
|
+
]).meta({
|
|
21
|
+
title: 'ResourceType',
|
|
22
|
+
description: '资源类型',
|
|
23
|
+
type: 'string'
|
|
24
|
+
});
|