@wenex/sdk 1.1.16 → 1.1.18

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const env_util_1 = require("./env.util");
4
+ describe('src/common/core/env.util.ts', () => {
5
+ it('ENV', () => {
6
+ expect((0, env_util_1.ENV)('KEY')).toBeUndefined();
7
+ expect((0, env_util_1.ENV)('KEY', 1)).toBe(1);
8
+ expect((0, env_util_1.ENV)('KEY', '1')).toBe(1);
9
+ expect((0, env_util_1.ENV)('KEY', true)).toBe(true);
10
+ expect((0, env_util_1.ENV)('KEY', 'true')).toBe(true);
11
+ expect((0, env_util_1.ENV)('KEY', 'value')).toBe('value');
12
+ expect((0, env_util_1.ENV)('KEY', { key: 'value' })).toStrictEqual({ key: 'value' });
13
+ expect((0, env_util_1.ENV)('KEY', '{"key":"value"}')).toStrictEqual({ key: 'value' });
14
+ });
15
+ it('ENV_A', () => {
16
+ expect((0, env_util_1.ENV_A)('FOR_TEST')).toStrictEqual([]);
17
+ process.env['FOR_TEST'] = 'foo,bar';
18
+ expect((0, env_util_1.ENV_A)('FOR_TEST')).toStrictEqual(['foo', 'bar']);
19
+ });
20
+ });
21
+ //# sourceMappingURL=env.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.spec.js","sourceRoot":"","sources":["../../src/common/core/env.spec.ts"],"names":[],"mappings":";;AAAA,yCAAwC;AAExC,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;QACb,MAAM,CAAC,IAAA,cAAG,EAAC,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QAEnC,MAAM,CAAC,IAAA,cAAG,EAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,CAAC,IAAA,cAAG,EAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAEhC,MAAM,CAAC,IAAA,cAAG,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,MAAM,CAAC,IAAA,cAAG,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEtC,MAAM,CAAC,IAAA,cAAG,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE1C,MAAM,CAAC,IAAA,cAAG,EAAC,KAAK,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;QACrE,MAAM,CAAC,IAAA,cAAG,EAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;QACf,MAAM,CAAC,IAAA,gBAAK,EAAC,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QAE5C,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;QACpC,MAAM,CAAC,IAAA,gBAAK,EAAC,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function ENV<T = any>(key: Uppercase<string>, value?: T): T;
2
+ export declare function ENV_A<T = any>(key: Uppercase<string>, value?: T[]): T[];
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ENV = ENV;
4
+ exports.ENV_A = ENV_A;
5
+ function ENV(key, value) {
6
+ const val = !process.env[key] ? value : process.env[key];
7
+ try {
8
+ return (typeof val === 'string' ? JSON.parse(val) : val);
9
+ }
10
+ catch {
11
+ return val;
12
+ }
13
+ }
14
+ function ENV_A(key, value = []) {
15
+ const val = !process.env[key] ? value : process.env[key];
16
+ try {
17
+ return (typeof val === 'string' ? val.split(',') : val);
18
+ }
19
+ catch {
20
+ return val;
21
+ }
22
+ }
23
+ //# sourceMappingURL=env.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.util.js","sourceRoot":"","sources":["../../src/common/core/env.util.ts"],"names":[],"mappings":";;AAAA,kBAOC;AAED,sBAOC;AAhBD,SAAgB,GAAG,CAAU,GAAsB,EAAE,KAAS;IAC5D,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzD,IAAI,CAAC;QACH,OAAO,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAM,CAAC;IAChE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAgB,KAAK,CAAU,GAAsB,EAAE,QAAa,EAAE;IACpE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzD,IAAI,CAAC;QACH,OAAO,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAQ,CAAC;IACjE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAU,CAAC;IACpB,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare enum PusHistoryContentDir {
2
+ ltr = "ltr",
3
+ rtl = "rtl",
4
+ auto = "auto"
5
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PusHistoryContentDir = void 0;
4
+ var PusHistoryContentDir;
5
+ (function (PusHistoryContentDir) {
6
+ PusHistoryContentDir["ltr"] = "ltr";
7
+ PusHistoryContentDir["rtl"] = "rtl";
8
+ PusHistoryContentDir["auto"] = "auto";
9
+ })(PusHistoryContentDir || (exports.PusHistoryContentDir = PusHistoryContentDir = {}));
10
+ //# sourceMappingURL=content-dir.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-dir.enum.js","sourceRoot":"","sources":["../../../../../src/common/enums/touch/pushes/histories/content-dir.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,mCAAW,CAAA;IACX,mCAAW,CAAA;IACX,qCAAa,CAAA;AACf,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B"}
@@ -0,0 +1 @@
1
+ export * from './content-dir.enum';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./content-dir.enum"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/common/enums/touch/pushes/histories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC"}
@@ -1 +1,2 @@
1
+ export * from './histories';
1
2
  export * from './urgency.enum';
@@ -14,5 +14,6 @@ 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("./histories"), exports);
17
18
  __exportStar(require("./urgency.enum"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/enums/touch/pushes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/enums/touch/pushes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,iDAA+B"}
@@ -0,0 +1,14 @@
1
+ import { PusHistoryContentDir } from '../../../../enums/touch';
2
+ export interface PusHistoryContent<T = any> {
3
+ title: string;
4
+ badge?: string;
5
+ body?: string;
6
+ data?: T;
7
+ dir?: PusHistoryContentDir;
8
+ icon?: string;
9
+ lang?: string;
10
+ require_interaction?: boolean;
11
+ silent?: boolean;
12
+ tag?: string;
13
+ }
14
+ export type PusHistoryContentDto<T = any> = PusHistoryContent<T>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=content.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.interface.js","sourceRoot":"","sources":["../../../../../src/common/interfaces/touch/pushes/histories/content.interface.ts"],"names":[],"mappings":""}
@@ -1,16 +1,21 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { PushUrgency } from '../../../../enums/touch';
3
- import { Core, Dto, Payload } from '../../../../core/interfaces';
4
- export interface PusHistory<Key extends string = string, Properties extends object = object> extends Core<Properties> {
3
+ import { Core, Dto, NesteDto } from '../../../../core/interfaces';
4
+ import { PusHistoryContent, PusHistoryContentDto } from './content.interface';
5
+ export interface PusHistory<T = any, Properties extends object = object> extends Core<Properties> {
5
6
  to: string;
6
7
  from?: string;
7
8
  topic?: string;
8
9
  urgency?: PushUrgency;
9
10
  ttl?: number;
10
11
  timeout?: number;
11
- payload: Payload<Key>;
12
+ content: PusHistoryContent<T>;
12
13
  status: number;
13
14
  }
14
- export type PusHistoryDoc<Key extends string = string, Properties extends object = object> = PusHistory<Key, Properties> & Document;
15
- export type PusHistoryDto<Key extends string = string, Properties extends object = object> = Dto<PusHistory<Key, Properties>>;
16
- export type PusHistorySendDto<Key extends string = string, Properties extends object = object> = Dto<PusHistory<Key, Properties>, 'status'>;
15
+ export type PusHistoryDoc<T = any, Properties extends object = object> = PusHistory<T, Properties> & Document;
16
+ export type PusHistoryDto<T = any, Properties extends object = object> = NesteDto<Dto<PusHistory<T, Properties>>, {
17
+ content: PusHistoryContentDto<T>;
18
+ }>;
19
+ export type PusHistorySendDto<T = any, Properties extends object = object> = NesteDto<Dto<PusHistory<T, Properties>, 'status'>, {
20
+ content: PusHistoryContentDto;
21
+ }>;
@@ -1 +1,2 @@
1
+ export * from './content.interface';
1
2
  export * from './history.interface';
@@ -14,5 +14,6 @@ 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("./content.interface"), exports);
17
18
  __exportStar(require("./history.interface"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/common/interfaces/touch/pushes/histories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/common/interfaces/touch/pushes/histories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,sDAAoC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenex/sdk",
3
- "version": "1.1.16",
3
+ "version": "1.1.18",
4
4
  "description": "Wenex SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",