@nocobase/plugin-verification 0.13.0-alpha.4 → 0.13.0-alpha.6

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.
@@ -1,24 +1,47 @@
1
- 'use strict';
2
-
3
- var path = require('path');
4
- var database = require('@nocobase/database');
5
- var server = require('@nocobase/server');
6
- var utils = require('@nocobase/utils');
7
- var _ = require('.');
8
- var initActions = require('./actions');
9
- var constants = require('./constants');
10
- var locale = require('./locale');
11
- var initProviders = require('./providers');
12
-
13
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
14
-
15
- var path__default = /*#__PURE__*/_interopDefault(path);
16
- var initActions__default = /*#__PURE__*/_interopDefault(initActions);
17
- var initProviders__default = /*#__PURE__*/_interopDefault(initProviders);
18
-
19
- class VerificationPlugin extends server.Plugin {
20
- providers = new utils.Registry();
21
- interceptors = new utils.Registry();
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var Plugin_exports = {};
29
+ __export(Plugin_exports, {
30
+ default: () => VerificationPlugin
31
+ });
32
+ module.exports = __toCommonJS(Plugin_exports);
33
+ var import_path = __toESM(require("path"));
34
+ var import_database = require("@nocobase/database");
35
+ var import_server = require("@nocobase/server");
36
+ var import_utils = require("@nocobase/utils");
37
+ var import__ = require(".");
38
+ var import_actions2 = __toESM(require("./actions"));
39
+ var import_constants = require("./constants");
40
+ var import_locale = require("./locale");
41
+ var import_providers = __toESM(require("./providers"));
42
+ class VerificationPlugin extends import_server.Plugin {
43
+ providers = new import_utils.Registry();
44
+ interceptors = new import_utils.Registry();
22
45
  intercept = async (context, next) => {
23
46
  const { resourceName, actionName, values } = context.action.params;
24
47
  const key = `${resourceName}:${actionName}`;
@@ -38,22 +61,22 @@ class VerificationPlugin extends server.Plugin {
38
61
  type: key,
39
62
  content,
40
63
  expiresAt: {
41
- [database.Op.gt]: /* @__PURE__ */ new Date()
64
+ [import_database.Op.gt]: /* @__PURE__ */ new Date()
42
65
  },
43
- status: constants.CODE_STATUS_UNUSED
66
+ status: import_constants.CODE_STATUS_UNUSED
44
67
  }
45
68
  });
46
69
  if (!item) {
47
70
  return context.throw(400, {
48
71
  code: "InvalidVerificationCode",
49
- message: context.t("Verification code is invalid", { ns: _.namespace })
72
+ message: context.t("Verification code is invalid", { ns: import__.namespace })
50
73
  });
51
74
  }
52
75
  try {
53
76
  await next();
54
77
  } finally {
55
78
  await item.update({
56
- status: constants.CODE_STATUS_USED
79
+ status: import_constants.CODE_STATUS_USED
57
80
  });
58
81
  }
59
82
  };
@@ -77,7 +100,7 @@ class VerificationPlugin extends server.Plugin {
77
100
  await ProviderRepo.create({
78
101
  values: {
79
102
  id: DEFAULT_SMS_VERIFY_CODE_PROVIDER,
80
- type: constants.PROVIDER_TYPE_SMS_ALIYUN,
103
+ type: import_constants.PROVIDER_TYPE_SMS_ALIYUN,
81
104
  title: "Default SMS sender",
82
105
  options: {
83
106
  accessKeyId: INIT_ALI_SMS_ACCESS_KEY,
@@ -93,10 +116,10 @@ class VerificationPlugin extends server.Plugin {
93
116
  }
94
117
  async load() {
95
118
  const { app, db, options } = this;
96
- app.i18n.addResources("zh-CN", _.namespace, locale.zhCN);
97
- await this.importCollections(path__default.default.resolve(__dirname, "collections"));
98
- initProviders__default.default(this);
99
- initActions__default.default(this);
119
+ app.i18n.addResources("zh-CN", import__.namespace, import_locale.zhCN);
120
+ await this.importCollections(import_path.default.resolve(__dirname, "collections"));
121
+ (0, import_providers.default)(this);
122
+ (0, import_actions2.default)(this);
100
123
  app.resourcer.use(async (context, next) => {
101
124
  const { resourceName, actionName, values } = context.action.params;
102
125
  const key = `${resourceName}:${actionName}`;
@@ -121,5 +144,3 @@ class VerificationPlugin extends server.Plugin {
121
144
  });
122
145
  }
123
146
  }
124
-
125
- module.exports = VerificationPlugin;
@@ -1,27 +1,36 @@
1
- 'use strict';
2
-
3
- var verifications = require('./verifications');
4
-
5
- function _interopNamespace(e) {
6
- if (e && e.__esModule) return e;
7
- var n = Object.create(null);
8
- if (e) {
9
- Object.keys(e).forEach(function (k) {
10
- if (k !== 'default') {
11
- var d = Object.getOwnPropertyDescriptor(e, k);
12
- Object.defineProperty(n, k, d.get ? d : {
13
- enumerable: true,
14
- get: function () { return e[k]; }
15
- });
16
- }
17
- });
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 });
18
16
  }
19
- n.default = e;
20
- return Object.freeze(n);
21
- }
22
-
23
- var verifications__namespace = /*#__PURE__*/_interopNamespace(verifications);
24
-
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var actions_exports = {};
29
+ __export(actions_exports, {
30
+ default: () => actions_default
31
+ });
32
+ module.exports = __toCommonJS(actions_exports);
33
+ var verifications = __toESM(require("./verifications"));
25
34
  function make(name, mod) {
26
35
  return Object.keys(mod).reduce(
27
36
  (result, key) => ({
@@ -33,8 +42,6 @@ function make(name, mod) {
33
42
  }
34
43
  function actions_default({ app }) {
35
44
  app.actions({
36
- ...make("verifications", verifications__namespace)
45
+ ...make("verifications", verifications)
37
46
  });
38
47
  }
39
-
40
- module.exports = actions_default;
@@ -1,19 +1,43 @@
1
- 'use strict';
2
-
3
- var actions = require('@nocobase/actions');
4
- var database = require('@nocobase/database');
5
- var dayjs = require('dayjs');
6
- var crypto = require('crypto');
7
- var util = require('util');
8
- var __ = require('..');
9
- var constants = require('../constants');
10
-
11
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
-
13
- var actions__default = /*#__PURE__*/_interopDefault(actions);
14
- var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
15
-
16
- const asyncRandomInt = util.promisify(crypto.randomInt);
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var verifications_exports = {};
29
+ __export(verifications_exports, {
30
+ create: () => create
31
+ });
32
+ module.exports = __toCommonJS(verifications_exports);
33
+ var import_actions = __toESM(require("@nocobase/actions"));
34
+ var import_database = require("@nocobase/database");
35
+ var import_dayjs = __toESM(require("dayjs"));
36
+ var import_crypto = require("crypto");
37
+ var import_util = require("util");
38
+ var import__ = require("..");
39
+ var import_constants = require("../constants");
40
+ const asyncRandomInt = (0, import_util.promisify)(import_crypto.randomInt);
17
41
  async function create(context, next) {
18
42
  const plugin = context.app.getPlugin("verification");
19
43
  const { values } = context.action.params;
@@ -30,7 +54,7 @@ async function create(context, next) {
30
54
  if (!receiver) {
31
55
  return context.throw(400, {
32
56
  code: "InvalidReceiver",
33
- message: context.t("Not a valid cellphone number, please re-enter", { ns: __.namespace })
57
+ message: context.t("Not a valid cellphone number, please re-enter", { ns: import__.namespace })
34
58
  });
35
59
  }
36
60
  const VerificationModel = context.db.getModel("verifications");
@@ -38,17 +62,17 @@ async function create(context, next) {
38
62
  where: {
39
63
  type: values.type,
40
64
  receiver,
41
- status: constants.CODE_STATUS_UNUSED,
65
+ status: import_constants.CODE_STATUS_UNUSED,
42
66
  expiresAt: {
43
- [database.Op.gt]: /* @__PURE__ */ new Date()
67
+ [import_database.Op.gt]: /* @__PURE__ */ new Date()
44
68
  }
45
69
  }
46
70
  });
47
71
  if (record) {
48
- const seconds = dayjs__default.default(record.get("expiresAt")).diff(dayjs__default.default(), "seconds");
72
+ const seconds = (0, import_dayjs.default)(record.get("expiresAt")).diff((0, import_dayjs.default)(), "seconds");
49
73
  return context.throw(429, {
50
74
  code: "RateLimit",
51
- message: context.t("Please don't retry in {{time}} seconds", { time: seconds, ns: __.namespace })
75
+ message: context.t("Please don't retry in {{time}} seconds", { time: seconds, ns: import__.namespace })
52
76
  });
53
77
  }
54
78
  const code = (await asyncRandomInt(999999)).toString(10).padStart(6, "0");
@@ -69,25 +93,25 @@ async function create(context, next) {
69
93
  case "InvalidReceiver":
70
94
  return context.throw(400, {
71
95
  code: "InvalidReceiver",
72
- message: context.t("Not a valid cellphone number, please re-enter", { ns: __.namespace })
96
+ message: context.t("Not a valid cellphone number, please re-enter", { ns: import__.namespace })
73
97
  });
74
98
  case "RateLimit":
75
- return context.throw(429, context.t("You are trying so frequently, please slow down", { ns: __.namespace }));
99
+ return context.throw(429, context.t("You are trying so frequently, please slow down", { ns: import__.namespace }));
76
100
  default:
77
101
  console.error(error);
78
102
  return context.throw(
79
103
  500,
80
- context.t("Verification send failed, please try later or contact to administrator", { ns: __.namespace })
104
+ context.t("Verification send failed, please try later or contact to administrator", { ns: import__.namespace })
81
105
  );
82
106
  }
83
107
  }
84
108
  const data = {
85
- id: crypto.randomUUID(),
109
+ id: (0, import_crypto.randomUUID)(),
86
110
  type: values.type,
87
111
  receiver,
88
112
  content: code,
89
113
  expiresAt: Date.now() + (interceptor.expiresIn ?? 60) * 1e3,
90
- status: constants.CODE_STATUS_UNUSED,
114
+ status: import_constants.CODE_STATUS_UNUSED,
91
115
  providerId: providerItem.get("id")
92
116
  };
93
117
  context.action.mergeParams(
@@ -98,7 +122,7 @@ async function create(context, next) {
98
122
  values: "overwrite"
99
123
  }
100
124
  );
101
- await actions__default.default.create(context, async () => {
125
+ await import_actions.default.create(context, async () => {
102
126
  const { body: result } = context;
103
127
  context.body = {
104
128
  id: result.id,
@@ -107,5 +131,7 @@ async function create(context, next) {
107
131
  return next();
108
132
  });
109
133
  }
110
-
111
- exports.create = create;
134
+ // Annotate the CommonJS export names for ESM import in node:
135
+ 0 && (module.exports = {
136
+ create
137
+ });
@@ -1,5 +1,25 @@
1
- 'use strict';
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 verifications_exports = {};
19
+ __export(verifications_exports, {
20
+ default: () => verifications_default
21
+ });
22
+ module.exports = __toCommonJS(verifications_exports);
3
23
  var verifications_default = {
4
24
  namespace: "verification.verificationData",
5
25
  duplicator: "optional",
@@ -38,5 +58,3 @@ var verifications_default = {
38
58
  }
39
59
  ]
40
60
  };
41
-
42
- module.exports = verifications_default;
@@ -1,5 +1,25 @@
1
- 'use strict';
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 verifications_providers_exports = {};
19
+ __export(verifications_providers_exports, {
20
+ default: () => verifications_providers_default
21
+ });
22
+ module.exports = __toCommonJS(verifications_providers_exports);
3
23
  var verifications_providers_default = {
4
24
  namespace: "verification.verificationProviders",
5
25
  duplicator: "optional",
@@ -28,5 +48,3 @@ var verifications_providers_default = {
28
48
  }
29
49
  ]
30
50
  };
31
-
32
- module.exports = verifications_providers_default;
@@ -1,11 +1,36 @@
1
- 'use strict';
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 constants_exports = {};
19
+ __export(constants_exports, {
20
+ CODE_STATUS_UNUSED: () => CODE_STATUS_UNUSED,
21
+ CODE_STATUS_USED: () => CODE_STATUS_USED,
22
+ PROVIDER_TYPE_SMS_ALIYUN: () => PROVIDER_TYPE_SMS_ALIYUN,
23
+ PROVIDER_TYPE_SMS_TENCENT: () => PROVIDER_TYPE_SMS_TENCENT
24
+ });
25
+ module.exports = __toCommonJS(constants_exports);
3
26
  const PROVIDER_TYPE_SMS_ALIYUN = "sms-aliyun";
4
27
  const PROVIDER_TYPE_SMS_TENCENT = "sms-tencent";
5
28
  const CODE_STATUS_UNUSED = 0;
6
29
  const CODE_STATUS_USED = 1;
7
-
8
- exports.CODE_STATUS_UNUSED = CODE_STATUS_UNUSED;
9
- exports.CODE_STATUS_USED = CODE_STATUS_USED;
10
- exports.PROVIDER_TYPE_SMS_ALIYUN = PROVIDER_TYPE_SMS_ALIYUN;
11
- exports.PROVIDER_TYPE_SMS_TENCENT = PROVIDER_TYPE_SMS_TENCENT;
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ CODE_STATUS_UNUSED,
33
+ CODE_STATUS_USED,
34
+ PROVIDER_TYPE_SMS_ALIYUN,
35
+ PROVIDER_TYPE_SMS_TENCENT
36
+ });
@@ -1,34 +1,48 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var package_json = require('../../package.json');
6
- var constants = require('./constants');
7
- var providers = require('./providers');
8
- var Plugin = require('./Plugin');
9
-
10
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
-
12
- var Plugin__default = /*#__PURE__*/_interopDefault(Plugin);
13
-
14
- const namespace = package_json.name;
15
-
16
- Object.defineProperty(exports, 'Provider', {
17
- enumerable: true,
18
- get: function () { return providers.Provider; }
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 name2 in all)
9
+ __defProp(target, name2, { get: all[name2], 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 server_exports = {};
30
+ __export(server_exports, {
31
+ Interceptor: () => import_Plugin.Interceptor,
32
+ Provider: () => import_providers.Provider,
33
+ default: () => import_Plugin.default,
34
+ namespace: () => namespace
19
35
  });
20
- Object.defineProperty(exports, 'Interceptor', {
21
- enumerable: true,
22
- get: function () { return Plugin.Interceptor; }
23
- });
24
- Object.defineProperty(exports, 'default', {
25
- enumerable: true,
26
- get: function () { return Plugin__default.default; }
27
- });
28
- exports.namespace = namespace;
29
- Object.keys(constants).forEach(function (k) {
30
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
31
- enumerable: true,
32
- get: function () { return constants[k]; }
33
- });
36
+ module.exports = __toCommonJS(server_exports);
37
+ var import_package = require("../../package.json");
38
+ __reExport(server_exports, require("./constants"), module.exports);
39
+ var import_providers = require("./providers");
40
+ var import_Plugin = __toESM(require("./Plugin"));
41
+ const namespace = import_package.name;
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ Interceptor,
45
+ Provider,
46
+ namespace,
47
+ ...require("./constants")
34
48
  });
@@ -1,14 +1,37 @@
1
- 'use strict';
2
-
3
- var zhCN = require('./zh-CN');
4
-
5
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
-
7
- var zhCN__default = /*#__PURE__*/_interopDefault(zhCN);
8
-
9
-
10
-
11
- Object.defineProperty(exports, 'zhCN', {
12
- enumerable: true,
13
- get: function () { return zhCN__default.default; }
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var locale_exports = {};
29
+ __export(locale_exports, {
30
+ zhCN: () => import_zh_CN.default
31
+ });
32
+ module.exports = __toCommonJS(locale_exports);
33
+ var import_zh_CN = __toESM(require("./zh-CN"));
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ zhCN
14
37
  });
@@ -1,5 +1,25 @@
1
- 'use strict';
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 send failed, please try later or contact to administrator": "\u9A8C\u8BC1\u7801\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u6216\u8054\u7CFB\u7BA1\u7406\u5458",
5
25
  "Not a valid cellphone number, please re-enter": "\u4E0D\u662F\u6709\u6548\u7684\u624B\u673A\u53F7\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165",
@@ -7,5 +27,3 @@ var zh_CN_default = {
7
27
  "You are trying so frequently, please slow down": "\u60A8\u7684\u64CD\u4F5C\u592A\u9891\u7E41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",
8
28
  "Verification code is invalid": "\u65E0\u6548\u7684\u9A8C\u8BC1\u7801"
9
29
  };
10
-
11
- module.exports = zh_CN_default;