@nocobase/plugin-verification 0.13.0-alpha.4 → 0.13.0-alpha.5
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/dist/client/index.js +1 -519
- package/dist/index.js +37 -16
- package/dist/locale/pt-BR.js +22 -4
- package/dist/locale/zh-CN.js +22 -4
- package/dist/node_modules/@alicloud/dysmsapi20170525/dist/client.js +2 -2
- package/dist/node_modules/@alicloud/dysmsapi20170525/package.json +1 -1
- package/dist/node_modules/@alicloud/openapi-client/dist/client.js +1 -1
- package/dist/node_modules/@alicloud/openapi-client/package.json +1 -1
- package/dist/node_modules/@alicloud/tea-util/dist/client.js +1 -1
- package/dist/node_modules/@alicloud/tea-util/package.json +1 -1
- package/dist/node_modules/tencentcloud-sdk-nodejs/package.json +1 -1
- package/dist/node_modules/tencentcloud-sdk-nodejs/tencentcloud/index.js +4 -4
- package/dist/server/Plugin.js +53 -32
- package/dist/server/actions/index.js +33 -26
- package/dist/server/actions/verifications.js +55 -29
- package/dist/server/collections/verifications.js +22 -4
- package/dist/server/collections/verifications_providers.js +22 -4
- package/dist/server/constants.js +32 -7
- package/dist/server/index.js +46 -32
- package/dist/server/locale/index.js +36 -13
- package/dist/server/locale/zh-CN.js +22 -4
- package/dist/server/providers/index.js +42 -17
- package/dist/server/providers/sms-aliyun.js +40 -36
- package/dist/server/providers/sms-tencent.js +35 -28
- package/dist/swagger/index.json +117 -0
- package/package.json +2 -2
- package/dist/swagger/index.js +0 -131
package/dist/client/index.js
CHANGED
|
@@ -1,519 +1 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@nocobase/client"), require("react"), require("react-i18next"), require("antd"), require("@formily/shared"), require("@formily/antd-v5"), require("@formily/react"), require("@nocobase/utils/client")) : typeof define === "function" && define.amd ? define(["exports", "@nocobase/client", "react", "react-i18next", "antd", "@formily/shared", "@formily/antd-v5", "@formily/react", "@nocobase/utils/client"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["@nocobase/plugin-verification"] = {}, global["@nocobase/client"], global.react, global["react-i18next"], global.antd, global["@formily/shared"], global["@formily/antd-v5"], global["@formily/react"], global["@nocobase/utils"]));
|
|
3
|
-
})(this, function(exports2, client, require$$0, reactI18next, antd, shared, antdV5, react, client$1) {
|
|
4
|
-
"use strict";
|
|
5
|
-
var jsxRuntime = { exports: {} };
|
|
6
|
-
var reactJsxRuntime_production_min = {};
|
|
7
|
-
/**
|
|
8
|
-
* @license React
|
|
9
|
-
* react-jsx-runtime.production.min.js
|
|
10
|
-
*
|
|
11
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
12
|
-
*
|
|
13
|
-
* This source code is licensed under the MIT license found in the
|
|
14
|
-
* LICENSE file in the root directory of this source tree.
|
|
15
|
-
*/
|
|
16
|
-
var f = require$$0, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true };
|
|
17
|
-
function q(c, a, g) {
|
|
18
|
-
var b, d = {}, e = null, h = null;
|
|
19
|
-
void 0 !== g && (e = "" + g);
|
|
20
|
-
void 0 !== a.key && (e = "" + a.key);
|
|
21
|
-
void 0 !== a.ref && (h = a.ref);
|
|
22
|
-
for (b in a)
|
|
23
|
-
m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
24
|
-
if (c && c.defaultProps)
|
|
25
|
-
for (b in a = c.defaultProps, a)
|
|
26
|
-
void 0 === d[b] && (d[b] = a[b]);
|
|
27
|
-
return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
28
|
-
}
|
|
29
|
-
reactJsxRuntime_production_min.Fragment = l;
|
|
30
|
-
reactJsxRuntime_production_min.jsx = q;
|
|
31
|
-
reactJsxRuntime_production_min.jsxs = q;
|
|
32
|
-
{
|
|
33
|
-
jsxRuntime.exports = reactJsxRuntime_production_min;
|
|
34
|
-
}
|
|
35
|
-
var jsxRuntimeExports = jsxRuntime.exports;
|
|
36
|
-
const NAMESPACE = "verification";
|
|
37
|
-
const collection = {
|
|
38
|
-
name: "verifications_providers",
|
|
39
|
-
fields: [
|
|
40
|
-
{
|
|
41
|
-
type: "string",
|
|
42
|
-
name: "id",
|
|
43
|
-
interface: "input",
|
|
44
|
-
uiSchema: {
|
|
45
|
-
title: '{{t("ID")}}',
|
|
46
|
-
type: "string",
|
|
47
|
-
"x-component": "Input",
|
|
48
|
-
required: true
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
type: "string",
|
|
53
|
-
name: "title",
|
|
54
|
-
interface: "input",
|
|
55
|
-
uiSchema: {
|
|
56
|
-
title: '{{t("Title")}}',
|
|
57
|
-
type: "string",
|
|
58
|
-
"x-component": "Input",
|
|
59
|
-
required: true
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
type: "string",
|
|
64
|
-
name: "type",
|
|
65
|
-
interface: "select",
|
|
66
|
-
uiSchema: {
|
|
67
|
-
title: `{{t("Provider type", { ns: "${NAMESPACE}" })}}`,
|
|
68
|
-
type: "string",
|
|
69
|
-
"x-component": "Select",
|
|
70
|
-
required: true,
|
|
71
|
-
enum: [
|
|
72
|
-
{ label: `{{t("Aliyun SMS", { ns: "${NAMESPACE}" })}}`, value: "sms-aliyun" },
|
|
73
|
-
{ label: `{{t("Tencent SMS", { ns: "${NAMESPACE}" })}}`, value: "sms-tencent" }
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
type: "radio",
|
|
79
|
-
name: "default",
|
|
80
|
-
interface: "checkbox",
|
|
81
|
-
uiSchema: {
|
|
82
|
-
title: '{{t("Default")}}',
|
|
83
|
-
type: "boolean",
|
|
84
|
-
"x-component": "Checkbox"
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
]
|
|
88
|
-
};
|
|
89
|
-
const providers = {
|
|
90
|
-
type: "void",
|
|
91
|
-
name: "providers",
|
|
92
|
-
"x-decorator": "ResourceActionProvider",
|
|
93
|
-
"x-decorator-props": {
|
|
94
|
-
collection,
|
|
95
|
-
resourceName: "verifications_providers",
|
|
96
|
-
request: {
|
|
97
|
-
resource: "verifications_providers",
|
|
98
|
-
action: "list",
|
|
99
|
-
params: {
|
|
100
|
-
pageSize: 50,
|
|
101
|
-
sort: ["-default", "id"],
|
|
102
|
-
appends: []
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
"x-component": "CollectionProvider",
|
|
107
|
-
"x-component-props": {
|
|
108
|
-
collection
|
|
109
|
-
},
|
|
110
|
-
properties: {
|
|
111
|
-
actions: {
|
|
112
|
-
type: "void",
|
|
113
|
-
"x-component": "ActionBar",
|
|
114
|
-
"x-component-props": {
|
|
115
|
-
style: {
|
|
116
|
-
marginBottom: 16
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
properties: {
|
|
120
|
-
delete: {
|
|
121
|
-
type: "void",
|
|
122
|
-
title: '{{t("Delete")}}',
|
|
123
|
-
"x-component": "Action",
|
|
124
|
-
"x-component-props": {
|
|
125
|
-
useAction: "{{ cm.useBulkDestroyAction }}",
|
|
126
|
-
confirm: {
|
|
127
|
-
title: "{{t('Delete')}}",
|
|
128
|
-
content: "{{t('Are you sure you want to delete it?')}}"
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
create: {
|
|
133
|
-
type: "void",
|
|
134
|
-
title: '{{t("Add new")}}',
|
|
135
|
-
"x-component": "Action",
|
|
136
|
-
"x-component-props": {
|
|
137
|
-
type: "primary"
|
|
138
|
-
},
|
|
139
|
-
properties: {
|
|
140
|
-
drawer: {
|
|
141
|
-
type: "void",
|
|
142
|
-
"x-component": "Action.Drawer",
|
|
143
|
-
"x-decorator": "Form",
|
|
144
|
-
"x-decorator-props": {
|
|
145
|
-
useValues(options) {
|
|
146
|
-
const ctx = client.useActionContext();
|
|
147
|
-
return client.useRequest(
|
|
148
|
-
() => Promise.resolve({
|
|
149
|
-
data: {
|
|
150
|
-
name: `s_${shared.uid()}`
|
|
151
|
-
}
|
|
152
|
-
}),
|
|
153
|
-
{ ...options, refreshDeps: [ctx.visible] }
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
title: '{{t("Add new")}}',
|
|
158
|
-
properties: {
|
|
159
|
-
id: {
|
|
160
|
-
"x-component": "CollectionField",
|
|
161
|
-
"x-decorator": "FormItem",
|
|
162
|
-
description: '{{t("Identifier for program usage. Support letters, numbers and underscores, must start with an letter.")}}'
|
|
163
|
-
},
|
|
164
|
-
title: {
|
|
165
|
-
"x-component": "CollectionField",
|
|
166
|
-
"x-decorator": "FormItem"
|
|
167
|
-
},
|
|
168
|
-
type: {
|
|
169
|
-
"x-component": "CollectionField",
|
|
170
|
-
"x-decorator": "FormItem"
|
|
171
|
-
},
|
|
172
|
-
options: {
|
|
173
|
-
type: "object",
|
|
174
|
-
"x-component": "ProviderOptions"
|
|
175
|
-
},
|
|
176
|
-
default: {
|
|
177
|
-
"x-component": "CollectionField",
|
|
178
|
-
"x-decorator": "FormItem"
|
|
179
|
-
},
|
|
180
|
-
footer: {
|
|
181
|
-
type: "void",
|
|
182
|
-
"x-component": "Action.Drawer.Footer",
|
|
183
|
-
properties: {
|
|
184
|
-
cancel: {
|
|
185
|
-
title: '{{t("Cancel")}}',
|
|
186
|
-
"x-component": "Action",
|
|
187
|
-
"x-component-props": {
|
|
188
|
-
useAction: "{{ cm.useCancelAction }}"
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
submit: {
|
|
192
|
-
title: '{{t("Submit")}}',
|
|
193
|
-
"x-component": "Action",
|
|
194
|
-
"x-component-props": {
|
|
195
|
-
type: "primary",
|
|
196
|
-
useAction: "{{ cm.useCreateAction }}"
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
table: {
|
|
208
|
-
type: "void",
|
|
209
|
-
"x-uid": "input",
|
|
210
|
-
"x-component": "Table.Void",
|
|
211
|
-
"x-component-props": {
|
|
212
|
-
rowKey: "id",
|
|
213
|
-
rowSelection: {
|
|
214
|
-
type: "checkbox"
|
|
215
|
-
},
|
|
216
|
-
useDataSource: "{{ cm.useDataSourceFromRAC }}"
|
|
217
|
-
},
|
|
218
|
-
properties: {
|
|
219
|
-
id: {
|
|
220
|
-
type: "void",
|
|
221
|
-
"x-decorator": "Table.Column.Decorator",
|
|
222
|
-
"x-component": "Table.Column",
|
|
223
|
-
properties: {
|
|
224
|
-
id: {
|
|
225
|
-
type: "string",
|
|
226
|
-
"x-component": "CollectionField",
|
|
227
|
-
"x-read-pretty": true
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
title: {
|
|
232
|
-
type: "void",
|
|
233
|
-
"x-decorator": "Table.Column.Decorator",
|
|
234
|
-
"x-component": "Table.Column",
|
|
235
|
-
properties: {
|
|
236
|
-
title: {
|
|
237
|
-
type: "string",
|
|
238
|
-
"x-component": "CollectionField",
|
|
239
|
-
"x-read-pretty": true
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
type: {
|
|
244
|
-
type: "void",
|
|
245
|
-
"x-decorator": "Table.Column.Decorator",
|
|
246
|
-
"x-component": "Table.Column",
|
|
247
|
-
properties: {
|
|
248
|
-
type: {
|
|
249
|
-
type: "string",
|
|
250
|
-
"x-component": "CollectionField",
|
|
251
|
-
"x-read-pretty": true
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
default: {
|
|
256
|
-
type: "void",
|
|
257
|
-
"x-decorator": "Table.Column.Decorator",
|
|
258
|
-
"x-component": "Table.Column",
|
|
259
|
-
properties: {
|
|
260
|
-
default: {
|
|
261
|
-
type: "boolean",
|
|
262
|
-
"x-component": "CollectionField",
|
|
263
|
-
"x-read-pretty": true
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
actions: {
|
|
268
|
-
type: "void",
|
|
269
|
-
title: '{{t("Actions")}}',
|
|
270
|
-
"x-component": "Table.Column",
|
|
271
|
-
properties: {
|
|
272
|
-
actions: {
|
|
273
|
-
type: "void",
|
|
274
|
-
"x-component": "Space",
|
|
275
|
-
"x-component-props": {
|
|
276
|
-
split: "|"
|
|
277
|
-
},
|
|
278
|
-
properties: {
|
|
279
|
-
update: {
|
|
280
|
-
type: "void",
|
|
281
|
-
title: '{{t("Edit")}}',
|
|
282
|
-
"x-component": "Action.Link",
|
|
283
|
-
"x-component-props": {
|
|
284
|
-
type: "primary"
|
|
285
|
-
},
|
|
286
|
-
properties: {
|
|
287
|
-
drawer: {
|
|
288
|
-
type: "void",
|
|
289
|
-
"x-component": "Action.Drawer",
|
|
290
|
-
"x-decorator": "Form",
|
|
291
|
-
"x-decorator-props": {
|
|
292
|
-
useValues: "{{ cm.useValuesFromRecord }}"
|
|
293
|
-
},
|
|
294
|
-
title: '{{t("Edit")}}',
|
|
295
|
-
properties: {
|
|
296
|
-
id: {
|
|
297
|
-
"x-component": "CollectionField",
|
|
298
|
-
"x-decorator": "FormItem"
|
|
299
|
-
},
|
|
300
|
-
title: {
|
|
301
|
-
"x-component": "CollectionField",
|
|
302
|
-
"x-decorator": "FormItem"
|
|
303
|
-
},
|
|
304
|
-
type: {
|
|
305
|
-
"x-component": "CollectionField",
|
|
306
|
-
"x-decorator": "FormItem",
|
|
307
|
-
"x-disabled": true
|
|
308
|
-
},
|
|
309
|
-
options: {
|
|
310
|
-
type: "object",
|
|
311
|
-
"x-component": "ProviderOptions"
|
|
312
|
-
},
|
|
313
|
-
default: {
|
|
314
|
-
"x-component": "CollectionField",
|
|
315
|
-
"x-decorator": "FormItem"
|
|
316
|
-
},
|
|
317
|
-
footer: {
|
|
318
|
-
type: "void",
|
|
319
|
-
"x-component": "Action.Drawer.Footer",
|
|
320
|
-
properties: {
|
|
321
|
-
cancel: {
|
|
322
|
-
title: '{{t("Cancel")}}',
|
|
323
|
-
"x-component": "Action",
|
|
324
|
-
"x-component-props": {
|
|
325
|
-
useAction: "{{ cm.useCancelAction }}"
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
submit: {
|
|
329
|
-
title: '{{t("Submit")}}',
|
|
330
|
-
"x-component": "Action",
|
|
331
|
-
"x-component-props": {
|
|
332
|
-
type: "primary",
|
|
333
|
-
useAction: "{{ cm.useUpdateAction }}"
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
},
|
|
342
|
-
delete: {
|
|
343
|
-
type: "void",
|
|
344
|
-
title: '{{ t("Delete") }}',
|
|
345
|
-
"x-component": "Action.Link",
|
|
346
|
-
"x-component-props": {
|
|
347
|
-
confirm: {
|
|
348
|
-
title: "{{t('Delete record')}}",
|
|
349
|
-
content: "{{t('Are you sure you want to delete it?')}}"
|
|
350
|
-
},
|
|
351
|
-
useAction: "{{cm.useDestroyAction}}"
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
};
|
|
362
|
-
const SMSAliyun = {
|
|
363
|
-
type: "object",
|
|
364
|
-
properties: {
|
|
365
|
-
accessKeyId: {
|
|
366
|
-
title: `{{t("Access Key ID", { ns: "${NAMESPACE}" })}}`,
|
|
367
|
-
type: "string",
|
|
368
|
-
"x-decorator": "FormItem",
|
|
369
|
-
"x-component": "Input"
|
|
370
|
-
},
|
|
371
|
-
accessKeySecret: {
|
|
372
|
-
title: `{{t("Access Key Secret", { ns: "${NAMESPACE}" })}}`,
|
|
373
|
-
type: "string",
|
|
374
|
-
"x-decorator": "FormItem",
|
|
375
|
-
"x-component": "Password"
|
|
376
|
-
},
|
|
377
|
-
endpoint: {
|
|
378
|
-
title: `{{t("Endpoint", { ns: "${NAMESPACE}" })}}`,
|
|
379
|
-
type: "string",
|
|
380
|
-
"x-decorator": "FormItem",
|
|
381
|
-
"x-component": "Input"
|
|
382
|
-
},
|
|
383
|
-
sign: {
|
|
384
|
-
title: `{{t("Sign", { ns: "${NAMESPACE}" })}}`,
|
|
385
|
-
type: "string",
|
|
386
|
-
"x-decorator": "FormItem",
|
|
387
|
-
"x-component": "Input"
|
|
388
|
-
},
|
|
389
|
-
template: {
|
|
390
|
-
title: `{{t("Template code", { ns: "${NAMESPACE}" })}}`,
|
|
391
|
-
type: "string",
|
|
392
|
-
"x-decorator": "FormItem",
|
|
393
|
-
"x-component": "Input"
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
const SMSTencent = {
|
|
398
|
-
type: "object",
|
|
399
|
-
properties: {
|
|
400
|
-
secretId: {
|
|
401
|
-
title: `{{t("Secret Id", { ns: "${NAMESPACE}" })}}`,
|
|
402
|
-
type: "string",
|
|
403
|
-
"x-decorator": "FormItem",
|
|
404
|
-
"x-component": "Input"
|
|
405
|
-
},
|
|
406
|
-
secretKey: {
|
|
407
|
-
title: `{{t("Secret Key", { ns: "${NAMESPACE}" })}}`,
|
|
408
|
-
type: "string",
|
|
409
|
-
"x-decorator": "FormItem",
|
|
410
|
-
"x-component": "Password"
|
|
411
|
-
},
|
|
412
|
-
region: {
|
|
413
|
-
title: `{{t("Region", { ns: "${NAMESPACE}" })}}`,
|
|
414
|
-
type: "string",
|
|
415
|
-
"x-decorator": "FormItem",
|
|
416
|
-
"x-component": "Input"
|
|
417
|
-
},
|
|
418
|
-
endpoint: {
|
|
419
|
-
title: `{{t("Endpoint", { ns: "${NAMESPACE}" })}}`,
|
|
420
|
-
type: "string",
|
|
421
|
-
"x-decorator": "FormItem",
|
|
422
|
-
"x-component": "Input",
|
|
423
|
-
default: "sms.tencentcloudapi.com"
|
|
424
|
-
},
|
|
425
|
-
SignName: {
|
|
426
|
-
title: `{{t("Sign name", { ns: "${NAMESPACE}" })}}`,
|
|
427
|
-
type: "string",
|
|
428
|
-
"x-decorator": "FormItem",
|
|
429
|
-
"x-component": "Input"
|
|
430
|
-
},
|
|
431
|
-
SmsSdkAppId: {
|
|
432
|
-
title: `{{t("Sms sdk app id", { ns: "${NAMESPACE}" })}}`,
|
|
433
|
-
type: "string",
|
|
434
|
-
"x-decorator": "FormItem",
|
|
435
|
-
"x-component": "Input"
|
|
436
|
-
},
|
|
437
|
-
TemplateId: {
|
|
438
|
-
title: `{{t("Template Id", { ns: "${NAMESPACE}" })}}`,
|
|
439
|
-
type: "string",
|
|
440
|
-
"x-decorator": "FormItem",
|
|
441
|
-
"x-component": "Input"
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
};
|
|
445
|
-
const providerTypes = new client$1.Registry();
|
|
446
|
-
providerTypes.register("sms-aliyun", SMSAliyun);
|
|
447
|
-
providerTypes.register("sms-tencent", SMSTencent);
|
|
448
|
-
const Verification = react.observer(
|
|
449
|
-
(props) => {
|
|
450
|
-
const form = react.useForm();
|
|
451
|
-
const field = react.useField();
|
|
452
|
-
const [s, setSchema] = require$$0.useState(new react.Schema({}));
|
|
453
|
-
require$$0.useEffect(() => {
|
|
454
|
-
form.clearFormGraph("options.*");
|
|
455
|
-
setSchema(new react.Schema(providerTypes.get(form.values.type) || {}));
|
|
456
|
-
}, [form.values.type]);
|
|
457
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(antdV5.FormLayout, { layout: "vertical", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
458
|
-
react.RecursionField,
|
|
459
|
-
{
|
|
460
|
-
basePath: field.address,
|
|
461
|
-
onlyRenderProperties: true,
|
|
462
|
-
schema: s
|
|
463
|
-
},
|
|
464
|
-
form.values.type || "sms-aliyun"
|
|
465
|
-
) });
|
|
466
|
-
},
|
|
467
|
-
{ displayName: "Verification" }
|
|
468
|
-
);
|
|
469
|
-
function VerificationProviders() {
|
|
470
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Card, { bordered: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
471
|
-
client.SchemaComponent,
|
|
472
|
-
{
|
|
473
|
-
schema: providers,
|
|
474
|
-
components: {
|
|
475
|
-
ProviderOptions: Verification
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
) });
|
|
479
|
-
}
|
|
480
|
-
const VerificationProvider = (props) => {
|
|
481
|
-
const ctx = require$$0.useContext(client.PluginManagerContext);
|
|
482
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
483
|
-
client.SettingsCenterProvider,
|
|
484
|
-
{
|
|
485
|
-
settings: {
|
|
486
|
-
verification: {
|
|
487
|
-
icon: "CheckCircleOutlined",
|
|
488
|
-
title: `{{t("Verification", { ns: "${NAMESPACE}" })}}`,
|
|
489
|
-
tabs: {
|
|
490
|
-
providers: {
|
|
491
|
-
title: `{{t("Verification providers", { ns: "${NAMESPACE}" })}}`,
|
|
492
|
-
component: VerificationProviders
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
},
|
|
497
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
498
|
-
client.PluginManagerContext.Provider,
|
|
499
|
-
{
|
|
500
|
-
value: {
|
|
501
|
-
components: {
|
|
502
|
-
...ctx == null ? void 0 : ctx.components
|
|
503
|
-
}
|
|
504
|
-
},
|
|
505
|
-
children: props.children
|
|
506
|
-
}
|
|
507
|
-
)
|
|
508
|
-
}
|
|
509
|
-
);
|
|
510
|
-
};
|
|
511
|
-
class VerificationPlugin extends client.Plugin {
|
|
512
|
-
async load() {
|
|
513
|
-
this.app.use(VerificationProvider);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
exports2.VerificationPlugin = VerificationPlugin;
|
|
517
|
-
exports2.default = VerificationPlugin;
|
|
518
|
-
Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
519
|
-
});
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("react"),require("react-i18next"),require("antd"),require("@formily/shared"),require("@formily/antd-v5"),require("@formily/react"),require("@nocobase/utils/client")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","react","react-i18next","antd","@formily/shared","@formily/antd-v5","@formily/react","@nocobase/utils/client"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e["@nocobase/plugin-verification"]={},e["@nocobase/client"],e.jsxRuntime,e.react,e["react-i18next"],e.antd,e["@formily/shared"],e["@formily/antd-v5"],e["@formily/react"],e["@nocobase/utils"]))})(this,function(e,t,o,c,m,d,l,p,r,s){"use strict";var $=Object.defineProperty,q=Object.defineProperties;var V=Object.getOwnPropertyDescriptors;var v=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var F=(e,t,o)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,x=(e,t)=>{for(var o in t||(t={}))j.call(t,o)&&F(e,o,t[o]);if(v)for(var o of v(t))k.call(t,o)&&F(e,o,t[o]);return e},I=(e,t)=>q(e,V(t));var A=(e,t,o)=>new Promise((c,m)=>{var d=r=>{try{p(o.next(r))}catch(s){m(s)}},l=r=>{try{p(o.throw(r))}catch(s){m(s)}},p=r=>r.done?c(r.value):Promise.resolve(r.value).then(d,l);p((o=o.apply(e,t)).next())});const n="verification",y={name:"verifications_providers",fields:[{type:"string",name:"id",interface:"input",uiSchema:{title:'{{t("ID")}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"title",interface:"input",uiSchema:{title:'{{t("Title")}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"type",interface:"select",uiSchema:{title:`{{t("Provider type", { ns: "${n}" })}}`,type:"string","x-component":"Select",required:!0,enum:[{label:`{{t("Aliyun SMS", { ns: "${n}" })}}`,value:"sms-aliyun"},{label:`{{t("Tencent SMS", { ns: "${n}" })}}`,value:"sms-tencent"}]}},{type:"radio",name:"default",interface:"checkbox",uiSchema:{title:'{{t("Default")}}',type:"boolean","x-component":"Checkbox"}}]},S={type:"void",name:"providers","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:y,resourceName:"verifications_providers",request:{resource:"verifications_providers",action:"list",params:{pageSize:50,sort:["-default","id"],appends:[]}}},"x-component":"CollectionProvider","x-component-props":{collection:y},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{delete:{type:"void",title:'{{t("Delete")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-component":"Action","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(a){const i=t.useActionContext();return t.useRequest(()=>Promise.resolve({data:{name:`s_${l.uid()}`}}),I(x({},a),{refreshDeps:[i.visible]}))}},title:'{{t("Add new")}}',properties:{id:{"x-component":"CollectionField","x-decorator":"FormItem",description:'{{t("Identifier for program usage. Support letters, numbers and underscores, must start with an letter.")}}'},title:{"x-component":"CollectionField","x-decorator":"FormItem"},type:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"ProviderOptions"},default:{"x-component":"CollectionField","x-decorator":"FormItem"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}}}}}}},table:{type:"void","x-uid":"input","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{id:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{id:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},title:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},type:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{type:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},default:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{default:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{update:{type:"void",title:'{{t("Edit")}}',"x-component":"Action.Link","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{t("Edit")}}',properties:{id:{"x-component":"CollectionField","x-decorator":"FormItem"},title:{"x-component":"CollectionField","x-decorator":"FormItem"},type:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":!0},options:{type:"object","x-component":"ProviderOptions"},default:{"x-component":"CollectionField","x-decorator":"FormItem"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"},useAction:"{{cm.useDestroyAction}}"}}}}}}}}}},C={type:"object",properties:{accessKeyId:{title:`{{t("Access Key ID", { ns: "${n}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},accessKeySecret:{title:`{{t("Access Key Secret", { ns: "${n}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Password"},endpoint:{title:`{{t("Endpoint", { ns: "${n}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},sign:{title:`{{t("Sign", { ns: "${n}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},template:{title:`{{t("Template code", { ns: "${n}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"}}},g={type:"object",properties:{secretId:{title:`{{t("Secret Id", { ns: "${n}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},secretKey:{title:`{{t("Secret Key", { ns: "${n}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Password"},region:{title:`{{t("Region", { ns: "${n}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},endpoint:{title:`{{t("Endpoint", { ns: "${n}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",default:"sms.tencentcloudapi.com"},SignName:{title:`{{t("Sign name", { ns: "${n}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},SmsSdkAppId:{title:`{{t("Sms sdk app id", { ns: "${n}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},TemplateId:{title:`{{t("Template Id", { ns: "${n}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"}}},u=new s.Registry;u.register("sms-aliyun",C),u.register("sms-tencent",g);const b=r.observer(a=>{const i=r.useForm(),D=r.useField(),[T,w]=c.useState(new r.Schema({}));return c.useEffect(()=>{i.clearFormGraph("options.*"),w(new r.Schema(u.get(i.values.type)||{}))},[i.values.type]),o.jsx(p.FormLayout,{layout:"vertical",children:o.jsx(r.RecursionField,{basePath:D.address,onlyRenderProperties:!0,schema:T},i.values.type||"sms-aliyun")})},{displayName:"Verification"});function h(){return o.jsx(d.Card,{bordered:!1,children:o.jsx(t.SchemaComponent,{schema:S,components:{ProviderOptions:b}})})}const P=a=>{const i=c.useContext(t.PluginManagerContext);return o.jsx(t.SettingsCenterProvider,{settings:{verification:{icon:"CheckCircleOutlined",title:`{{t("Verification", { ns: "${n}" })}}`,tabs:{providers:{title:`{{t("Verification providers", { ns: "${n}" })}}`,component:h}}}},children:o.jsx(t.PluginManagerContext.Provider,{value:{components:x({},i==null?void 0:i.components)},children:a.children})})};class f extends t.Plugin{load(){return A(this,null,function*(){this.app.use(P)})}}e.VerificationPlugin=f,e.default=f,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
default: () => import_server.default
|
|
12
32
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
33
|
+
module.exports = __toCommonJS(src_exports);
|
|
34
|
+
__reExport(src_exports, require("./server"), module.exports);
|
|
35
|
+
var import_server = __toESM(require("./server"));
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
...require("./server")
|
|
18
39
|
});
|
package/dist/locale/pt-BR.js
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 pt_BR_exports = {};
|
|
19
|
+
__export(pt_BR_exports, {
|
|
20
|
+
default: () => pt_BR_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(pt_BR_exports);
|
|
3
23
|
var pt_BR_default = {
|
|
4
24
|
Verification: "Verifica\xE7\xE3o",
|
|
5
25
|
"Verification providers": "Provedores de verifica\xE7\xE3o",
|
|
@@ -18,5 +38,3 @@ var pt_BR_default = {
|
|
|
18
38
|
"Sms sdk app id": "ID do aplicativo de SMS",
|
|
19
39
|
"Template Id": "ID do modelo de SMS"
|
|
20
40
|
};
|
|
21
|
-
|
|
22
|
-
module.exports = pt_BR_default;
|
package/dist/locale/zh-CN.js
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 zh_CN_exports = {};
|
|
19
|
+
__export(zh_CN_exports, {
|
|
20
|
+
default: () => zh_CN_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(zh_CN_exports);
|
|
3
23
|
var zh_CN_default = {
|
|
4
24
|
Verification: "\u9A8C\u8BC1\u7801",
|
|
5
25
|
"Verification providers": "\u9A8C\u8BC1\u7801\u63D0\u4F9B\u5546",
|
|
@@ -23,5 +43,3 @@ var zh_CN_default = {
|
|
|
23
43
|
"You are trying so frequently, please slow down": "\u60A8\u7684\u64CD\u4F5C\u592A\u9891\u7E41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",
|
|
24
44
|
"Verification code is invalid": "\u65E0\u6548\u7684\u9A8C\u8BC1\u7801"
|
|
25
45
|
};
|
|
26
|
-
|
|
27
|
-
module.exports = zh_CN_default;
|