@bearei/server-common 0.0.198 → 0.0.199

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.
Files changed (36) hide show
  1. package/dist/access/access.guard.js +3 -3
  2. package/dist/access/access.guard.js.map +1 -1
  3. package/dist/access/access.interceptor.js +4 -4
  4. package/dist/access/access.interceptor.js.map +1 -1
  5. package/dist/authentication/authentication.service.d.ts +1 -1
  6. package/dist/base-service/base-service.service.js +19 -18
  7. package/dist/base-service/base-service.service.js.map +1 -1
  8. package/dist/decorators/is-captcha.decorator.js +16 -14
  9. package/dist/decorators/is-captcha.decorator.js.map +1 -1
  10. package/dist/decorators/is-nanoid.decorator.js +16 -14
  11. package/dist/decorators/is-nanoid.decorator.js.map +1 -1
  12. package/dist/decorators/is-password.decorator.js +16 -14
  13. package/dist/decorators/is-password.decorator.js.map +1 -1
  14. package/dist/decorators/is-version.decorator.js +16 -14
  15. package/dist/decorators/is-version.decorator.js.map +1 -1
  16. package/dist/external/external.interface.d.ts +1 -1
  17. package/dist/external/external.service.d.ts +2 -2
  18. package/dist/external/external.service.js +2 -2
  19. package/dist/external/external.service.js.map +1 -1
  20. package/dist/tsconfig.build.tsbuildinfo +1 -1
  21. package/dist/utils/build-mobile-number.utils.d.ts +1 -0
  22. package/dist/utils/build-mobile-number.utils.js +6 -0
  23. package/dist/utils/build-mobile-number.utils.js.map +1 -0
  24. package/dist/utils/create-sanitize-response-entity.utils.d.ts +1 -1
  25. package/dist/utils/create-sanitize-response-entity.utils.js +3 -3
  26. package/dist/utils/create-sanitize-response-entity.utils.js.map +1 -1
  27. package/dist/utils/extract-bearer-token.utils.d.ts +2 -0
  28. package/dist/utils/extract-bearer-token.utils.js +9 -0
  29. package/dist/utils/extract-bearer-token.utils.js.map +1 -0
  30. package/dist/utils/index.d.ts +2 -1
  31. package/dist/utils/index.js +2 -1
  32. package/dist/utils/index.js.map +1 -1
  33. package/package.json +1 -1
  34. package/dist/utils/format.utils.d.ts +0 -3
  35. package/dist/utils/format.utils.js +0 -11
  36. package/dist/utils/format.utils.js.map +0 -1
@@ -0,0 +1 @@
1
+ export declare const buildMobileNumber: (regionCode?: string) => (mobile: string) => string;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildMobileNumber = void 0;
4
+ const buildMobileNumber = (regionCode = '') => (mobile) => `+${regionCode} ${mobile}`;
5
+ exports.buildMobileNumber = buildMobileNumber;
6
+ //# sourceMappingURL=build-mobile-number.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-mobile-number.utils.js","sourceRoot":"","sources":["../../src/utils/build-mobile-number.utils.ts"],"names":[],"mappings":";;;AAAO,MAAM,iBAAiB,GAC7B,CAAC,UAAU,GAAG,EAAE,EAAE,EAAE,CACpB,CAAC,MAAc,EAAE,EAAE,CAClB,IAAI,UAAU,IAAI,MAAM,EAAE,CAAA;AAHf,QAAA,iBAAiB,qBAGF"}
@@ -1 +1 @@
1
- export declare const createSanitizeResponseEntity: <T>(omitKeys?: (keyof T)[]) => (object: T) => T;
1
+ export declare const createSanitizeResponseData: <T>(omitKeys?: (keyof T)[]) => (object: T) => T;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSanitizeResponseEntity = void 0;
4
- const createSanitizeResponseEntity = (omitKeys = []) => {
3
+ exports.createSanitizeResponseData = void 0;
4
+ const createSanitizeResponseData = (omitKeys = []) => {
5
5
  const omitKeysSet = new Set(omitKeys);
6
6
  return (object) => Object.entries(object).reduce((accumulator, [key, value]) => omitKeysSet.has(key) ? accumulator : ({
7
7
  ...accumulator,
8
8
  [key]: typeof value === 'number' ? `${value}` : value
9
9
  }), {});
10
10
  };
11
- exports.createSanitizeResponseEntity = createSanitizeResponseEntity;
11
+ exports.createSanitizeResponseData = createSanitizeResponseData;
12
12
  //# sourceMappingURL=create-sanitize-response-entity.utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-sanitize-response-entity.utils.js","sourceRoot":"","sources":["../../src/utils/create-sanitize-response-entity.utils.ts"],"names":[],"mappings":";;;AAAO,MAAM,4BAA4B,GAAG,CAAI,WAAW,EAAiB,EAAE,EAAE;IAC/E,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAA;IAErC,OAAO,CAAC,MAAS,EAAE,EAAE,CACpB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAC5B,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAC7B,WAAW,CAAC,GAAG,CAAC,GAAc,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAC/C;QACC,GAAG,WAAW;QACd,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK;KACrD,CACD,EACF,EAAE,CACG,CAAA;AACR,CAAC,CAAA;AAdY,QAAA,4BAA4B,gCAcxC"}
1
+ {"version":3,"file":"create-sanitize-response-entity.utils.js","sourceRoot":"","sources":["../../src/utils/create-sanitize-response-entity.utils.ts"],"names":[],"mappings":";;;AAAO,MAAM,0BAA0B,GAAG,CAAI,WAAW,EAAiB,EAAE,EAAE;IAC7E,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAA;IAErC,OAAO,CAAC,MAAS,EAAE,EAAE,CACpB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAC5B,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAC7B,WAAW,CAAC,GAAG,CAAC,GAAc,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAC/C;QACC,GAAG,WAAW;QACd,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK;KACrD,CACD,EACF,EAAE,CACG,CAAA;AACR,CAAC,CAAA;AAdY,QAAA,0BAA0B,8BActC"}
@@ -0,0 +1,2 @@
1
+ import type { RequestHeaders } from '../app.interface';
2
+ export declare const extractBearerToken: (headers: RequestHeaders) => (key?: string) => string | undefined;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractBearerToken = void 0;
4
+ const extractBearerToken = (headers) => (key = 'authorization') => {
5
+ const [type, token] = headers[key]?.split(' ') ?? [];
6
+ return type === 'Bearer' ? token : undefined;
7
+ };
8
+ exports.extractBearerToken = extractBearerToken;
9
+ //# sourceMappingURL=extract-bearer-token.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-bearer-token.utils.js","sourceRoot":"","sources":["../../src/utils/extract-bearer-token.utils.ts"],"names":[],"mappings":";;;AAEO,MAAM,kBAAkB,GAC9B,CAAC,OAAuB,EAAE,EAAE,CAC5B,CAAC,GAAG,GAAG,eAAe,EAAsB,EAAE;IAC7C,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;IAEpD,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;AAC7C,CAAC,CAAA;AANW,QAAA,kBAAkB,sBAM7B"}
@@ -1,4 +1,5 @@
1
+ export * from './build-mobile-number.utils';
1
2
  export * from './create-sanitize-response-entity.utils';
2
- export * from './format.utils';
3
+ export * from './extract-bearer-token.utils';
3
4
  export * from './generate-random-number.utils';
4
5
  export * from './sign.utils';
@@ -14,8 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./build-mobile-number.utils"), exports);
17
18
  __exportStar(require("./create-sanitize-response-entity.utils"), exports);
18
- __exportStar(require("./format.utils"), exports);
19
+ __exportStar(require("./extract-bearer-token.utils"), exports);
19
20
  __exportStar(require("./generate-random-number.utils"), exports);
20
21
  __exportStar(require("./sign.utils"), exports);
21
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0EAAuD;AACvD,iDAA8B;AAC9B,iEAA8C;AAC9C,+CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA2C;AAC3C,0EAAuD;AACvD,+DAA4C;AAC5C,iEAA8C;AAC9C,+CAA4B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bearei/server-common",
3
- "version": "0.0.198",
3
+ "version": "0.0.199",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "bearei <bear_ei@outlook.com>",
@@ -1,3 +0,0 @@
1
- import type { RequestHeaders } from '../app.interface';
2
- export declare const formatMobile: (regionCode?: string) => (mobile: string) => string;
3
- export declare const formatToken: (headers: RequestHeaders) => (key?: string) => string | undefined;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatToken = exports.formatMobile = void 0;
4
- const formatMobile = (regionCode = '') => (mobile) => `+${regionCode} ${mobile}`;
5
- exports.formatMobile = formatMobile;
6
- const formatToken = (headers) => (key = 'authorization') => {
7
- const [type, token] = headers[key]?.split(' ') ?? [];
8
- return type === 'Bearer' ? token : undefined;
9
- };
10
- exports.formatToken = formatToken;
11
- //# sourceMappingURL=format.utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format.utils.js","sourceRoot":"","sources":["../../src/utils/format.utils.ts"],"names":[],"mappings":";;;AAEO,MAAM,YAAY,GACxB,CAAC,UAAU,GAAG,EAAE,EAAE,EAAE,CACpB,CAAC,MAAc,EAAE,EAAE,CAClB,IAAI,UAAU,IAAI,MAAM,EAAE,CAAA;AAHf,QAAA,YAAY,gBAGG;AAErB,MAAM,WAAW,GACvB,CAAC,OAAuB,EAAE,EAAE,CAC5B,CAAC,GAAG,GAAG,eAAe,EAAsB,EAAE;IAC7C,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;IAEpD,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;AAC7C,CAAC,CAAA;AANW,QAAA,WAAW,eAMtB"}