jd_platform_sdk 0.0.3 → 0.0.4

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 (39) hide show
  1. package/dist/index.d.ts +5 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +8 -0
  4. package/dist/sdk/jdConnector.d.ts +2 -2
  5. package/dist/sdk/jdConnector.d.ts.map +1 -1
  6. package/dist/sdk/models/jdApplication.d.ts +3 -3
  7. package/dist/sdk/models/jdApplication.d.ts.map +1 -1
  8. package/dist/sdk/models/jdApplication.js +3 -5
  9. package/dist/sdk/models/jdResource.d.ts +7 -6
  10. package/dist/sdk/models/jdResource.d.ts.map +1 -1
  11. package/dist/sdk/models/jdResource.js +20 -0
  12. package/dist/sdk/models/modules/geolocation/jdCity.d.ts +15 -0
  13. package/dist/sdk/models/modules/geolocation/jdCity.d.ts.map +1 -0
  14. package/dist/sdk/models/modules/geolocation/jdCity.js +50 -0
  15. package/dist/sdk/models/modules/geolocation/jdCountry.d.ts +10 -0
  16. package/dist/sdk/models/modules/geolocation/jdCountry.d.ts.map +1 -0
  17. package/dist/sdk/models/modules/geolocation/jdCountry.js +42 -0
  18. package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts +14 -0
  19. package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts.map +1 -0
  20. package/dist/sdk/models/modules/geolocation/jdDistrict.js +44 -0
  21. package/dist/sdk/models/modules/geolocation/jdState.d.ts +15 -0
  22. package/dist/sdk/models/modules/geolocation/jdState.d.ts.map +1 -0
  23. package/dist/sdk/models/modules/geolocation/jdState.js +50 -0
  24. package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts +2 -2
  25. package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts.map +1 -1
  26. package/dist/sdk/models/modules/karaoke/jdKtvShop.js +2 -5
  27. package/dist/sdk/models/modules/user/jdSessionUser.d.ts +17 -0
  28. package/dist/sdk/models/modules/user/jdSessionUser.d.ts.map +1 -0
  29. package/dist/sdk/models/modules/user/jdSessionUser.js +62 -0
  30. package/dist/sdk/models/modules/user/jdUser.d.ts +17 -0
  31. package/dist/sdk/models/modules/user/jdUser.d.ts.map +1 -0
  32. package/dist/sdk/models/modules/user/jdUser.js +72 -0
  33. package/dist/sdk/utilities/browserUtils.d.ts +6 -4
  34. package/dist/sdk/utilities/browserUtils.d.ts.map +1 -1
  35. package/dist/sdk/utilities/browserUtils.js +23 -21
  36. package/dist/sdk/utilities/utils.d.ts +2 -0
  37. package/dist/sdk/utilities/utils.d.ts.map +1 -1
  38. package/dist/sdk/utilities/utils.js +16 -0
  39. package/package.json +4 -1
package/dist/index.d.ts CHANGED
@@ -9,5 +9,10 @@ export * from "./sdk/utilities/stringUtils";
9
9
  export * from "./sdk/utilities/utils";
10
10
  export * from "./sdk/models/jdResource";
11
11
  export * from "./sdk/models/jdApplication";
12
+ export * from "./sdk/models/modules/user/jdUser";
12
13
  export * from "./sdk/models/modules/karaoke/jdKtvShop";
14
+ export * from "./sdk/models/modules/geolocation/jdCountry";
15
+ export * from "./sdk/models/modules/geolocation/jdState";
16
+ export * from "./sdk/models/modules/geolocation/jdCity";
17
+ export * from "./sdk/models/modules/geolocation/jdDistrict";
13
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AAGvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AAGtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,wCAAwC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AAGvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AAGtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAG3C,cAAc,kCAAkC,CAAC;AAGjD,cAAc,wCAAwC,CAAC;AAGvD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,0CAA0C,CAAC;AACzD,cAAc,yCAAyC,CAAC;AACxD,cAAc,6CAA6C,CAAC"}
package/dist/index.js CHANGED
@@ -11,4 +11,12 @@ export * from "./sdk/utilities/utils";
11
11
  // Generic Models for different possible modules for all platforms
12
12
  export * from "./sdk/models/jdResource";
13
13
  export * from "./sdk/models/jdApplication";
14
+ //User
15
+ export * from "./sdk/models/modules/user/jdUser";
16
+ //Karaoke
14
17
  export * from "./sdk/models/modules/karaoke/jdKtvShop";
18
+ //Geolocation
19
+ export * from "./sdk/models/modules/geolocation/jdCountry";
20
+ export * from "./sdk/models/modules/geolocation/jdState";
21
+ export * from "./sdk/models/modules/geolocation/jdCity";
22
+ export * from "./sdk/models/modules/geolocation/jdDistrict";
@@ -15,10 +15,10 @@ export declare class JDConnector {
15
15
  httpPostDirectAsync(url: string, headers: any, body: any, bShowErrorMessage: boolean, bAutoHideBusyIndicator?: boolean, overrideVersion?: string): Promise<SimpleResponse>;
16
16
  httpGetRelativeAsync(url: string, headers: any, params: any, bShowErrorMessage: boolean, bForceRefresh?: boolean, bAutoHideBusyIndicator?: boolean, overrideVersion?: string): Promise<SimpleResponse>;
17
17
  httpPostRelativeAsync(url: string, headers: any, body: any, bShowErrorMessage: boolean, bAutoHideBusyIndicator?: boolean, overrideVersion?: string): Promise<SimpleResponse>;
18
- httpASyncCallDirect(httpType: any, url: string, params: any, headers: any, body: any, bShowErrorMessage: boolean, bBuildParams: boolean, bRelativeURL?: boolean, bForceRefresh?: boolean, bAutoHideBusyIndicator?: boolean, overrideVersion?: string): Promise<SimpleResponse>;
18
+ httpASyncCallDirect(httpType: JDHttpType, url: string, params: any, headers: any, body: any, bShowErrorMessage: boolean, bBuildParams: boolean, bRelativeURL?: boolean, bForceRefresh?: boolean, bAutoHideBusyIndicator?: boolean, overrideVersion?: string): Promise<SimpleResponse>;
19
19
  getDirectURL(baseURL: string, params: any, bRelativeURL?: boolean): string;
20
20
  buildParams(params: Record<string, any>): string;
21
21
  private buildURL;
22
- buildDirectURL(httpType: any, url: string, data: Record<string, any>): string;
22
+ buildDirectURL(httpType: JDHttpType, url: string, data: Record<string, any>): string;
23
23
  }
24
24
  //# sourceMappingURL=jdConnector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jdConnector.d.ts","sourceRoot":"","sources":["../../src/sdk/jdConnector.ts"],"names":[],"mappings":"AAIA,0BAAkB,UAAU;IAC3B,GAAG,IAAA;IACH,IAAI,IAAA;IACJ,GAAG,IAAA;IACH,MAAM,IAAA;CACN;AAED,qBAAa,cAAc;IACxB,IAAI,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;gBACP,IAAI,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM;IAKzC,OAAO;CAGR;AAED,qBAAa,WAAW;IACjB,kBAAkB,CAAC,GAAG,EAAC,MAAM,EAAE,OAAO,EAAC,GAAG,EAAE,MAAM,EAAC,GAAG,EAAE,iBAAiB,EAAE,OAAO,EAAE,aAAa,UAAO,EAAE,sBAAsB,UAAO,EAAE,eAAe,SAAK;IAI7J,mBAAmB,CAAC,GAAG,EAAC,MAAM,EAAE,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,GAAG,EAAE,iBAAiB,EAAC,OAAO,EAAE,sBAAsB,UAAO,EAAE,eAAe,SA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exE"}
@@ -1,5 +1,5 @@
1
1
  import JDResource from "./jdResource";
2
- export default class JDApplication extends JDResource {
2
+ export declare class JDApplication extends JDResource {
3
3
  appId: string;
4
4
  appKey: string;
5
5
  appSecret: string;
@@ -10,8 +10,8 @@ export default class JDApplication extends JDResource {
10
10
  versionCode: number;
11
11
  bundleCodeAndroid: number;
12
12
  bundleCodeIos: number;
13
- constructor(data: object);
14
- setData(data: object): void;
13
+ constructor(data: Record<string, any>);
14
+ setData(data: Record<string, any>): void;
15
15
  static getApplications(orderBy: string | undefined, order: string | undefined, pageIndex: number | undefined, countPerPage: number | undefined, fields: string | undefined, { isSandbox, isFeatured, }: {
16
16
  isSandbox?: boolean | undefined;
17
17
  isFeatured?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"jdApplication.d.ts","sourceRoot":"","sources":["../../../src/sdk/models/jdApplication.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU;IACpD,KAAK,SAAM;IACX,MAAM,SAAM;IACZ,SAAS,SAAM;IACf,UAAU,EAAE,MAAM,CAAM;IACxB,IAAI,EAAE,MAAM,CAAM;IAClB,WAAW,SAAM;IACjB,OAAO,SAAM;IACb,WAAW,SAAK;IAChB,iBAAiB,SAAK;IACtB,aAAa,SAAK;gBAEN,IAAI,EAAC,MAAM;IAKvB,OAAO,CAAC,IAAI,EAAC,MAAM;WAeN,eAAe,CAAC,OAAO,oBAAe,EAAE,KAAK,oBAAS,EAAE,SAAS,oBAAI,EAAE,YAAY,oBAAK,EAAE,MAAM,oBAAK,EAAE,EAAC,SAAiB,EAAE,UAAkB,GAAE;;;KAAA;WAe/I,OAAO,CAAC,EAAE,EAAC,MAAM;CAI9B"}
1
+ {"version":3,"file":"jdApplication.d.ts","sourceRoot":"","sources":["../../../src/sdk/models/jdApplication.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,qBAAa,aAAc,SAAQ,UAAU;IAC5C,KAAK,SAAM;IACX,MAAM,SAAM;IACZ,SAAS,SAAM;IACf,UAAU,EAAE,MAAM,CAAM;IACxB,IAAI,EAAE,MAAM,CAAM;IAClB,WAAW,SAAM;IACjB,OAAO,SAAM;IACb,WAAW,SAAK;IAChB,iBAAiB,SAAK;IACtB,aAAa,SAAK;gBAEN,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAKpC,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WAenB,eAAe,CAAC,OAAO,oBAAe,EAAE,KAAK,oBAAS,EAAE,SAAS,oBAAI,EAAE,YAAY,oBAAK,EAAE,MAAM,oBAAK,EAAE,EAAC,SAAiB,EAAE,UAAkB,GAAE;;;KAAA;WAc/I,OAAO,CAAC,EAAE,EAAC,MAAM;CAG9B"}
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { Utils } from "../utilities/utils";
11
11
  import JDResource from "./jdResource";
12
- export default class JDApplication extends JDResource {
12
+ export class JDApplication extends JDResource {
13
13
  constructor(data) {
14
14
  super(data);
15
15
  this.appId = '';
@@ -47,14 +47,12 @@ export default class JDApplication extends JDResource {
47
47
  params['featured'] = isFeatured ? 'true' : 'false';
48
48
  }
49
49
  // console.log(params);
50
- const response = yield JDResource.getRelative('/applications', params);
51
- return response;
50
+ return yield JDResource.getRelative('/applications', params);
52
51
  });
53
52
  }
54
53
  static getInfo(id) {
55
54
  return __awaiter(this, void 0, void 0, function* () {
56
- const response = yield JDResource.getRelative(`/applications/${id}`, {});
57
- return response;
55
+ return yield JDResource.getRelative(`/applications/${id}`, {});
58
56
  });
59
57
  }
60
58
  }
@@ -29,15 +29,16 @@ export default class JDResource {
29
29
  get cdnBannerURL800(): string;
30
30
  getFacebookIconURL(fbId: string): string;
31
31
  constructor(data: Record<string, any>);
32
- setData(data: object): void;
32
+ setData(data: Record<string, any>): void;
33
33
  static getHashBody(remark?: string): Record<string, any>;
34
34
  static getDefaultHeaders(headers?: {}): Record<string, any>;
35
- static addDefaultParams(params: any): void;
35
+ static addDefaultParams(params: Record<string, any>): void;
36
36
  static getSortParameters(orderBy: string, order: string, pageIndex: number, countPerPage: number, fields: string): Record<string, any>;
37
37
  static getFieldParameters(fields: string): Record<string, any>;
38
- static getRelative(relativeUrl: string, params: object, bShowErrorToast?: boolean, bForceRefresh?: boolean, overrideVersion?: string, headers?: {}): Promise<SimpleResponse>;
39
- static postRelative(relativeUrl: string, body: object, bShowErrorToast?: boolean, overrideVersion?: string): Promise<SimpleResponse>;
40
- static getDirect(directUrl: string, params: object, bShowErrorToast?: boolean, bForceRefresh?: boolean, overrideVersion?: string): Promise<SimpleResponse>;
41
- static postDirect(directUrl: string, body: object, bShowErrorToast?: boolean, overrideVersion?: string): Promise<SimpleResponse>;
38
+ static getRelative(relativeUrl: string, params: Record<string, any>, bShowErrorToast?: boolean, bForceRefresh?: boolean, overrideVersion?: string, headers?: {}): Promise<SimpleResponse>;
39
+ static postRelative(relativeUrl: string, body: Record<string, any>, bShowErrorToast?: boolean, overrideVersion?: string): Promise<SimpleResponse>;
40
+ static getDirect(directUrl: string, params: Record<string, any>, bShowErrorToast?: boolean, bForceRefresh?: boolean, overrideVersion?: string): Promise<SimpleResponse>;
41
+ static postDirect(directUrl: string, body: Record<string, any>, bShowErrorToast?: boolean, overrideVersion?: string): Promise<SimpleResponse>;
42
+ static checkUser(response: SimpleResponse): Promise<void>;
42
43
  }
43
44
  //# sourceMappingURL=jdResource.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jdResource.d.ts","sourceRoot":"","sources":["../../../src/sdk/models/jdResource.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAO,UAAU;IAC9B,IAAI,SAAM;IACP,IAAI,SAAM;IACV,KA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YAAY,CAAC,WAAW,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAG,eAAe,UAAO,EAAE,eAAe,SAAK;WAQxG,SAAS,CAAC,SAAS,EAAC,MAAM,EAAE,MAAM,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAG,eAAe,UAAO,EAAE,aAAa,UAAQ,EAAE,eAAe,SAAK;WAK5H,UAAU,CAAC,SAAS,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,eAAe,UAAO,EAAG,eAAe,SAAK;WAMpG,SAAS,CAAC,QAAQ,EAAC,cAAc;CAkB9C"}
@@ -11,6 +11,8 @@ import { Utils } from "../utilities/utils";
11
11
  import { DateUtils } from "../utilities/dateUtils";
12
12
  import { CryptoUtils } from "../utilities/cryptoUtils";
13
13
  import { JDConnector, SimpleResponse } from "../jdConnector";
14
+ import { JDUser } from "./modules/user/jdUser";
15
+ import { BrowserUtils } from "../utilities/browserUtils";
14
16
  export default class JDResource {
15
17
  // Properties
16
18
  // localisedTitle:string = DPUtility.getStringFromField(this.title, 'en');
@@ -138,4 +140,22 @@ export default class JDResource {
138
140
  return new SimpleResponse(response.body, response.statusCode);
139
141
  });
140
142
  }
143
+ // Save the token and user information to globals if successful
144
+ static checkUser(response) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ if (response.statusCode == 200) {
147
+ const dataRaw = Utils.stringToObject(response.body);
148
+ const token = Utils.getString(dataRaw, "token");
149
+ const dataUser = Utils.getObject(dataRaw, "user");
150
+ // Save to global variables and also in the session so that the user can keep the log in status
151
+ const user = new JDUser(dataUser);
152
+ globalThis.xAuthToken = token;
153
+ globalThis.userId = user.myId;
154
+ globalThis.user = user;
155
+ //Also save in the session
156
+ BrowserUtils.setSessionItem("token", token);
157
+ BrowserUtils.setSessionItem("user", Utils.objectToString(dataUser));
158
+ }
159
+ });
160
+ }
141
161
  }
@@ -0,0 +1,15 @@
1
+ import JDResource from "../../jdResource";
2
+ export declare class JDCity extends JDResource {
3
+ stateId: string;
4
+ state: Record<string, any>;
5
+ get localisedStateTitle(): string;
6
+ get stateTitleEN(): string;
7
+ get stateTitleMM(): string;
8
+ constructor(data: Record<string, any>);
9
+ setData(data: Record<string, any>): void;
10
+ static getCities(orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
11
+ static findCities(title: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
12
+ static getDistricts(stateId: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
13
+ static getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
14
+ }
15
+ //# sourceMappingURL=jdCity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jdCity.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/geolocation/jdCity.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C,qBAAa,MAAO,SAAQ,UAAU;IACrC,OAAO,EAAC,MAAM,CAAM;IACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAEhC,IAAI,mBAAmB,IAAG,MAAM,CAAgF;IAChH,IAAI,YAAY,IAAG,MAAM,CAAuE;IAChG,IAAI,YAAY,IAAG,MAAM,CAAuE;gBAEpF,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAKpC,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WAMnB,SAAS,CAAC,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;WAK/F,UAAU,CAAC,KAAK,EAAC,MAAM,EAAE,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;WAK9G,YAAY,CAAC,OAAO,EAAC,MAAM,EAAE,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;WAKlH,OAAO,CAAC,EAAE,EAAC,MAAM;CAG9B"}
@@ -0,0 +1,50 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import JDResource from "../../jdResource";
11
+ import { Utils } from "../../../utilities/utils";
12
+ export class JDCity extends JDResource {
13
+ get localisedStateTitle() { return globalThis.language == 'en' ? this.stateTitleEN : this.stateTitleMM; }
14
+ get stateTitleEN() { return Utils.getString(Utils.getObject(this.state, 'title'), 'en'); }
15
+ get stateTitleMM() { return Utils.getString(Utils.getObject(this.state, 'title'), 'mm'); }
16
+ constructor(data) {
17
+ super(data);
18
+ this.stateId = "";
19
+ this.state = {};
20
+ this.setData(data);
21
+ }
22
+ setData(data) {
23
+ super.setData(data);
24
+ this.stateId = Utils.getString(data, "state_id");
25
+ this.state = Utils.getObject(data, "state");
26
+ }
27
+ static getCities() {
28
+ return __awaiter(this, arguments, void 0, function* (orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
29
+ const params = JDResource.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
30
+ return yield JDResource.getRelative('/modules/geolocation/cities', params);
31
+ });
32
+ }
33
+ static findCities(title_1) {
34
+ return __awaiter(this, arguments, void 0, function* (title, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
35
+ const params = JDResource.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
36
+ return yield JDResource.getRelative('/modules/geolocation/cities/find', params);
37
+ });
38
+ }
39
+ static getDistricts(stateId_1) {
40
+ return __awaiter(this, arguments, void 0, function* (stateId, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
41
+ const params = JDResource.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
42
+ return yield JDResource.getRelative(`/modules/geolocation/cities/${stateId}/districts`, params);
43
+ });
44
+ }
45
+ static getInfo(id) {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ return yield JDResource.getRelative(`/modules/geolocation/states/${id}`, {});
48
+ });
49
+ }
50
+ }
@@ -0,0 +1,10 @@
1
+ import JDResource from "../../jdResource";
2
+ export declare class JDCountry extends JDResource {
3
+ constructor(data: Record<string, any>);
4
+ setData(data: Record<string, any>): void;
5
+ static getCountries(orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
6
+ static findCountries(title: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
7
+ static getStates(countryId: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
8
+ static getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
9
+ }
10
+ //# sourceMappingURL=jdCountry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jdCountry.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/geolocation/jdCountry.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C,qBAAa,SAAU,SAAQ,UAAU;gBAC5B,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAKpC,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WAInB,YAAY,CAAC,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;WAKlG,aAAa,CAAC,KAAK,EAAC,MAAM,EAAE,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;WAKjH,SAAS,CAAC,SAAS,EAAC,MAAM,EAAE,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;WAKjH,OAAO,CAAC,EAAE,EAAC,MAAM;CAG9B"}
@@ -0,0 +1,42 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import JDResource from "../../jdResource";
11
+ export class JDCountry extends JDResource {
12
+ constructor(data) {
13
+ super(data);
14
+ this.setData(data);
15
+ }
16
+ setData(data) {
17
+ super.setData(data);
18
+ }
19
+ static getCountries() {
20
+ return __awaiter(this, arguments, void 0, function* (orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
21
+ const params = JDResource.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
22
+ return yield JDResource.getRelative('/modules/geolocation/countries', params);
23
+ });
24
+ }
25
+ static findCountries(title_1) {
26
+ return __awaiter(this, arguments, void 0, function* (title, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
27
+ const params = JDResource.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
28
+ return yield JDResource.getRelative('/modules/geolocation/countries/find', params);
29
+ });
30
+ }
31
+ static getStates(countryId_1) {
32
+ return __awaiter(this, arguments, void 0, function* (countryId, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
33
+ const params = JDResource.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
34
+ return yield JDResource.getRelative(`/modules/geolocation/countries/${countryId}/states`, params);
35
+ });
36
+ }
37
+ static getInfo(id) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ return yield JDResource.getRelative(`/modules/geolocation/countries/${id}`, {});
40
+ });
41
+ }
42
+ }
@@ -0,0 +1,14 @@
1
+ import JDResource from "../../jdResource";
2
+ export declare class JDDistrict extends JDResource {
3
+ cityId: string;
4
+ city: Record<string, any>;
5
+ get localisedCityTitle(): string;
6
+ get cityTitleEN(): string;
7
+ get cityTitleMM(): string;
8
+ constructor(data: Record<string, any>);
9
+ setData(data: Record<string, any>): void;
10
+ static getSDistricts(orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
11
+ static findDistricts(title: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
12
+ static getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
13
+ }
14
+ //# sourceMappingURL=jdDistrict.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jdDistrict.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/geolocation/jdDistrict.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C,qBAAa,UAAW,SAAQ,UAAU;IACzC,MAAM,EAAC,MAAM,CAAM;IACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAE/B,IAAI,kBAAkB,IAAG,MAAM,CAA8E;IAC7G,IAAI,WAAW,IAAG,MAAM,CAAsE;IAC9F,IAAI,WAAW,IAAG,MAAM,CAAsE;gBAElF,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAInC,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WAMpB,aAAa,CAAC,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;WAKnG,aAAa,CAAC,KAAK,EAAC,MAAM,EAAE,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;WAKjH,OAAO,CAAC,EAAE,EAAC,MAAM;CAG9B"}
@@ -0,0 +1,44 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import JDResource from "../../jdResource";
11
+ import { Utils } from "../../../utilities/utils";
12
+ export class JDDistrict extends JDResource {
13
+ get localisedCityTitle() { return globalThis.language == 'en' ? this.cityTitleEN : this.cityTitleMM; }
14
+ get cityTitleEN() { return Utils.getString(Utils.getObject(this.city, 'title'), 'en'); }
15
+ get cityTitleMM() { return Utils.getString(Utils.getObject(this.city, 'title'), 'mm'); }
16
+ constructor(data) {
17
+ super(data);
18
+ this.cityId = "";
19
+ this.city = {};
20
+ this.setData(data);
21
+ }
22
+ setData(data) {
23
+ super.setData(data);
24
+ this.cityId = Utils.getString(data, "city_id");
25
+ this.city = Utils.getObject(data, "city");
26
+ }
27
+ static getSDistricts() {
28
+ return __awaiter(this, arguments, void 0, function* (orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
29
+ const params = JDResource.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
30
+ return yield JDResource.getRelative('/modules/geolocation/districts', params);
31
+ });
32
+ }
33
+ static findDistricts(title_1) {
34
+ return __awaiter(this, arguments, void 0, function* (title, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
35
+ const params = JDResource.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
36
+ return yield JDResource.getRelative('/modules/geolocation/districts/find', params);
37
+ });
38
+ }
39
+ static getInfo(id) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ return yield JDResource.getRelative(`/modules/geolocation/districts/${id}`, {});
42
+ });
43
+ }
44
+ }
@@ -0,0 +1,15 @@
1
+ import JDResource from "../../jdResource";
2
+ export declare class JDState extends JDResource {
3
+ countryId: string;
4
+ country: Record<string, any>;
5
+ get localisedCountryTitle(): string;
6
+ get countryTitleEN(): string;
7
+ get countryTitleMM(): string;
8
+ constructor(data: Record<string, any>);
9
+ setData(data: Record<string, any>): void;
10
+ static getStates(orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
11
+ static findStates(title: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
12
+ static getCities(stateId: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
13
+ static getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
14
+ }
15
+ //# sourceMappingURL=jdState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jdState.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/geolocation/jdState.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C,qBAAa,OAAQ,SAAQ,UAAU;IACtC,SAAS,EAAC,MAAM,CAAM;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAElC,IAAI,qBAAqB,IAAG,MAAM,CAAoF;IACtH,IAAI,cAAc,IAAG,MAAM,CAAyE;IACpG,IAAI,cAAc,IAAG,MAAM,CAAyE;gBAExF,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAKpC,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WAMnB,SAAS,CAAC,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;WAK/F,UAAU,CAAC,KAAK,EAAC,MAAM,EAAE,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;WAK9G,SAAS,CAAC,OAAO,EAAC,MAAM,EAAE,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;WAK/G,OAAO,CAAC,EAAE,EAAC,MAAM;CAG9B"}
@@ -0,0 +1,50 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import JDResource from "../../jdResource";
11
+ import { Utils } from "../../../utilities/utils";
12
+ export class JDState extends JDResource {
13
+ get localisedCountryTitle() { return globalThis.language == 'en' ? this.countryTitleEN : this.countryTitleMM; }
14
+ get countryTitleEN() { return Utils.getString(Utils.getObject(this.country, 'title'), 'en'); }
15
+ get countryTitleMM() { return Utils.getString(Utils.getObject(this.country, 'title'), 'mm'); }
16
+ constructor(data) {
17
+ super(data);
18
+ this.countryId = "";
19
+ this.country = {};
20
+ this.setData(data);
21
+ }
22
+ setData(data) {
23
+ super.setData(data);
24
+ this.countryId = Utils.getString(data, "country_id");
25
+ this.country = Utils.getObject(data, "country");
26
+ }
27
+ static getStates() {
28
+ return __awaiter(this, arguments, void 0, function* (orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
29
+ const params = JDResource.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
30
+ return yield JDResource.getRelative('/modules/geolocation/states', params);
31
+ });
32
+ }
33
+ static findStates(title_1) {
34
+ return __awaiter(this, arguments, void 0, function* (title, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
35
+ const params = JDResource.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
36
+ return yield JDResource.getRelative('/modules/geolocation/states/find', params);
37
+ });
38
+ }
39
+ static getCities(stateId_1) {
40
+ return __awaiter(this, arguments, void 0, function* (stateId, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
41
+ const params = JDResource.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
42
+ return yield JDResource.getRelative(`/modules/geolocation/states/${stateId}/cities`, params);
43
+ });
44
+ }
45
+ static getInfo(id) {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ return yield JDResource.getRelative(`/modules/geolocation/states/${id}`, {});
48
+ });
49
+ }
50
+ }
@@ -22,8 +22,8 @@ export declare class JDKtvShop extends JDResource {
22
22
  get districtTitleEN(): string;
23
23
  get districtTitleMM(): string;
24
24
  expiryDate: Date;
25
- constructor(data: object);
26
- setData(data: object): void;
25
+ constructor(data: Record<string, any>);
26
+ setData(data: Record<string, any>): void;
27
27
  static getKtvShops(isRecommended?: boolean, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
28
28
  static getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
29
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"jdKtvShop.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/karaoke/jdKtvShop.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C,qBAAa,SAAU,SAAQ,UAAU;IACxC,UAAU,EAAC,MAAM,CAAM;IACvB,gBAAgB,EAAC,MAAM,CAAK;IAC5B,mBAAmB,EAAC,MAAM,CAAK;IAE/B,SAAS,EAAC,MAAM,CAAM;IACtB,OAAO,EAAC,MAAM,CAAM;IACpB,MAAM,EAAC,MAAM,CAAM;IACnB,UAAU,EAAC,MAAM,CAAM;IAEvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAClC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAClC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAChC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAEnC,IAAI,gBAAgB,IAAG,MAAM,CAG5B;IAED,IAAI,cAAc,IAAG,MAAM,CAAyE;IACpG,IAAI,cAAc,IAAG,MAAM,CAAyE;IAEpG,IAAI,YAAY,IAAG,MAAM,CAAuE;IAChG,IAAI,YAAY,IAAG,MAAM,CAAuE;IAEhG,IAAI,WAAW,IAAG,MAAM,CAAsE;IAC9F,IAAI,WAAW,IAAG,MAAM,CAAsE;IAE9F,IAAI,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IAAG,MAAM,CAAsE;IAC9F,IAAI,WAAW,IAAG,MAAM,CAAsE;IAE9F,IAAI,eAAe,IAAG,MAAM,CAA0E;IACtG,IAAI,eAAe,IAAG,MAAM,CAA0E;IAEtG,UAAU,EAAC,IAAI,CAAc;gBAEjB,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAKpC,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WAoBnB,WAAW,CAAC,aAAa,UAAQ,EAAE,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;WASxH,OAAO,CAAC,EAAE,EAAC,MAAM;CAG9B"}
@@ -61,15 +61,12 @@ export class JDKtvShop extends JDResource {
61
61
  if (Utils.isset(isRecommended)) {
62
62
  params['recommended'] = isRecommended ? 'true' : 'false';
63
63
  }
64
- // console.log(params);
65
- const response = yield JDResource.getRelative('/modules/karaoke/ktv_shops', params);
66
- return response;
64
+ return yield JDResource.getRelative('/modules/karaoke/ktv_shops', params);
67
65
  });
68
66
  }
69
67
  static getInfo(id) {
70
68
  return __awaiter(this, void 0, void 0, function* () {
71
- const response = yield JDResource.getRelative(`/modules/karaoke/ktv_shops/${id}`, {});
72
- return response;
69
+ return yield JDResource.getRelative(`/modules/karaoke/ktv_shops/${id}`, {});
73
70
  });
74
71
  }
75
72
  }
@@ -0,0 +1,17 @@
1
+ import JDResource from "../../jdResource";
2
+ export declare class JDSessionUser extends JDResource {
3
+ cloudSessionId: string;
4
+ name: string;
5
+ username: string;
6
+ phone: string;
7
+ searchTokens: any[];
8
+ get isLoggedIn(): boolean;
9
+ constructor(data: Record<string, any>);
10
+ setData(data: Record<string, any>): void;
11
+ static findSessionUsers(name: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
12
+ static authenticate(username: string, password: string): Promise<import("../../../jdConnector").SimpleResponse>;
13
+ static register(name: string, username: string, email: string, phone: string, password: string): Promise<import("../../../jdConnector").SimpleResponse>;
14
+ static logout(name: string, username: string, email: string, phone: string, password: string): Promise<import("../../../jdConnector").SimpleResponse>;
15
+ static getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
16
+ }
17
+ //# sourceMappingURL=jdSessionUser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jdSessionUser.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/user/jdSessionUser.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C,qBAAa,aAAc,SAAQ,UAAU;IAC5C,cAAc,EAAC,MAAM,CAAM;IAC3B,IAAI,EAAC,MAAM,CAAM;IACjB,QAAQ,EAAC,MAAM,CAAM;IACrB,KAAK,EAAC,MAAM,CAAM;IAClB,YAAY,EAAE,GAAG,EAAE,CAAM;IAEzB,IAAI,UAAU,IAAG,OAAO,CAA+C;gBAE3D,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAKpC,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WASnB,gBAAgB,CAAC,IAAI,EAAC,MAAM,EAAE,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;WAMnH,YAAY,CAAC,QAAQ,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM;WAK7C,QAAQ,CAAC,IAAI,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM;WAKlF,MAAM,CAAC,IAAI,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM;WAMhF,OAAO,CAAC,EAAE,EAAC,MAAM;CAG9B"}
@@ -0,0 +1,62 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import JDResource from "../../jdResource";
11
+ import { Utils } from "../../../utilities/utils";
12
+ export class JDSessionUser extends JDResource {
13
+ get isLoggedIn() { return Utils.isset(globalThis.xAuthToken); }
14
+ constructor(data) {
15
+ super(data);
16
+ this.cloudSessionId = "";
17
+ this.name = "";
18
+ this.username = "";
19
+ this.phone = "";
20
+ this.searchTokens = [];
21
+ this.setData(data);
22
+ }
23
+ setData(data) {
24
+ super.setData(data);
25
+ this.cloudSessionId = Utils.getString(data, "cloud_session_id");
26
+ this.name = Utils.getString(data, "name");
27
+ this.username = Utils.getString(data, "username");
28
+ this.phone = Utils.getString(data, "phone");
29
+ this.searchTokens = Utils.getArray(data, "search_tokens");
30
+ }
31
+ static findSessionUsers(name_1) {
32
+ return __awaiter(this, arguments, void 0, function* (name, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
33
+ const params = JDResource.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
34
+ return yield JDResource.getRelative('/modules/user/session_users/find', params);
35
+ });
36
+ }
37
+ // TODO: Sign the API calls to only be able to call from this client only
38
+ static authenticate(username, password) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ const body = { username, password };
41
+ return yield JDResource.postRelative('/modules/user/session_users/authenticate', body);
42
+ });
43
+ }
44
+ static register(name, username, email, phone, password) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ const body = { name, username, email, phone, password };
47
+ return yield JDResource.postRelative('/modules/user/session_users/register', body);
48
+ });
49
+ }
50
+ static logout(name, username, email, phone, password) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ const body = { name, username, email, phone, password };
53
+ return yield JDResource.postRelative('/modules/user/session_users/register', body);
54
+ });
55
+ }
56
+ // Get the user information
57
+ static getInfo(id) {
58
+ return __awaiter(this, void 0, void 0, function* () {
59
+ return yield JDResource.getRelative(`/modules/user/session_users/${id}`, {});
60
+ });
61
+ }
62
+ }
@@ -0,0 +1,17 @@
1
+ import JDResource from "../../jdResource";
2
+ export declare class JDUser extends JDResource {
3
+ name: string;
4
+ username: string;
5
+ phone: string;
6
+ email: string;
7
+ searchTokens: any[];
8
+ get isLoggedIn(): boolean;
9
+ constructor(data: Record<string, any>);
10
+ setData(data: Record<string, any>): void;
11
+ static findUsers(name: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
12
+ static authenticate(username: string, password: string): Promise<import("../../../jdConnector").SimpleResponse>;
13
+ static register(name: string, username: string, email: string, phone: string, password: string): Promise<import("../../../jdConnector").SimpleResponse>;
14
+ static logout(name: string, username: string, email: string, phone: string, password: string): Promise<import("../../../jdConnector").SimpleResponse>;
15
+ static getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
16
+ }
17
+ //# sourceMappingURL=jdUser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jdUser.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/user/jdUser.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C,qBAAa,MAAO,SAAQ,UAAU;IACrC,IAAI,EAAC,MAAM,CAAM;IACjB,QAAQ,EAAC,MAAM,CAAM;IACrB,KAAK,EAAC,MAAM,CAAM;IAClB,KAAK,EAAC,MAAM,CAAM;IAClB,YAAY,EAAE,GAAG,EAAE,CAAM;IAEzB,IAAI,UAAU,IAAG,OAAO,CAA+C;gBAE3D,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAKpC,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WASnB,SAAS,CAAC,IAAI,EAAC,MAAM,EAAE,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;WAM5G,YAAY,CAAC,QAAQ,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM;WAO7C,QAAQ,CAAC,IAAI,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM;WAOlF,MAAM,CAAC,IAAI,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM;WAahF,OAAO,CAAC,EAAE,EAAC,MAAM;CAG9B"}
@@ -0,0 +1,72 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import JDResource from "../../jdResource";
11
+ import { Utils } from "../../../utilities/utils";
12
+ export class JDUser extends JDResource {
13
+ get isLoggedIn() { return Utils.isset(globalThis.xAuthToken); }
14
+ constructor(data) {
15
+ super(data);
16
+ this.name = "";
17
+ this.username = "";
18
+ this.phone = "";
19
+ this.email = "";
20
+ this.searchTokens = [];
21
+ this.setData(data);
22
+ }
23
+ setData(data) {
24
+ super.setData(data);
25
+ this.name = Utils.getString(data, "name");
26
+ this.username = Utils.getString(data, "username");
27
+ this.phone = Utils.getString(data, "phone");
28
+ this.email = Utils.getString(data, "email");
29
+ this.searchTokens = Utils.getArray(data, "search_tokens");
30
+ }
31
+ static findUsers(name_1) {
32
+ return __awaiter(this, arguments, void 0, function* (name, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
33
+ const params = JDResource.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
34
+ return yield JDResource.getRelative('/modules/user/users/find', params);
35
+ });
36
+ }
37
+ // TODO: Sign the API calls to only be able to call from this client only
38
+ static authenticate(username, password) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ const body = { username, password };
41
+ const response = yield JDResource.postRelative('/modules/user/users/authenticate', body);
42
+ yield JDResource.checkUser(response);
43
+ return response;
44
+ });
45
+ }
46
+ static register(name, username, email, phone, password) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ const body = { name, username, email, phone, password };
49
+ const response = yield JDResource.postRelative('/modules/user/users/register', body);
50
+ yield JDResource.checkUser(response);
51
+ return response;
52
+ });
53
+ }
54
+ static logout(name, username, email, phone, password) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ const body = { name, username, email, phone, password };
57
+ const response = yield JDResource.postRelative('/modules/user/users/register', body);
58
+ // Reset the auth token information
59
+ if (response.statusCode == 200) {
60
+ globalThis.xAuthToken = "";
61
+ globalThis.user = new JDUser({});
62
+ }
63
+ return response;
64
+ });
65
+ }
66
+ // Get the user information
67
+ static getInfo(id) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ return yield JDResource.getRelative(`/modules/user/users/${id}`, {});
70
+ });
71
+ }
72
+ }
@@ -1,5 +1,7 @@
1
- export declare function setSessionItem(key: string, val: string): void;
2
- export declare function getSessionItem(key: string): string | null;
3
- export declare function setStorageItem(key: string, val: string): void;
4
- export declare function getStorageItem(key: string): string | null;
1
+ export declare class BrowserUtils {
2
+ static setSessionItem(key: string, val: string): void;
3
+ static getSessionItem(key: string): string | null;
4
+ static setStorageItem(key: string, val: string): void;
5
+ static getStorageItem(key: string): string | null;
6
+ }
5
7
  //# sourceMappingURL=browserUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browserUtils.d.ts","sourceRoot":"","sources":["../../../src/sdk/utilities/browserUtils.ts"],"names":[],"mappings":"AACA,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAI7D;AAGD,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKzD;AAGD,wBAAiB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAI9D;AAGD,wBAAiB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK1D"}
1
+ {"version":3,"file":"browserUtils.d.ts","sourceRoot":"","sources":["../../../src/sdk/utilities/browserUtils.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAY;IAErB,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAOrD,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAQjD,MAAM,CAAE,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAOtD,MAAM,CAAE,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAMrD"}
@@ -1,26 +1,28 @@
1
- // Set a session storage item
2
- export function setSessionItem(key, val) {
3
- if (typeof window !== "undefined") {
4
- window.sessionStorage.setItem(key, val);
1
+ export class BrowserUtils {
2
+ // Set a session storage item
3
+ static setSessionItem(key, val) {
4
+ if (typeof window !== "undefined") {
5
+ window.sessionStorage.setItem(key, val);
6
+ }
5
7
  }
6
- }
7
- // Get a session storage item
8
- export function getSessionItem(key) {
9
- if (typeof window !== "undefined") {
10
- return window.sessionStorage.getItem(key);
8
+ // Get a session storage item
9
+ static getSessionItem(key) {
10
+ if (typeof window !== "undefined") {
11
+ return window.sessionStorage.getItem(key);
12
+ }
13
+ return null;
11
14
  }
12
- return null;
13
- }
14
- // Set a local storage item
15
- export function setStorageItem(key, val) {
16
- if (typeof window !== "undefined") {
17
- window.localStorage.setItem(key, val);
15
+ // Set a local storage item
16
+ static setStorageItem(key, val) {
17
+ if (typeof window !== "undefined") {
18
+ window.localStorage.setItem(key, val);
19
+ }
18
20
  }
19
- }
20
- // Get a local storage item
21
- export function getStorageItem(key) {
22
- if (typeof window !== "undefined") {
23
- return window.localStorage.getItem(key);
21
+ // Get a local storage item
22
+ static getStorageItem(key) {
23
+ if (typeof window !== "undefined") {
24
+ return window.localStorage.getItem(key);
25
+ }
26
+ return null;
24
27
  }
25
- return null;
26
28
  }
@@ -15,6 +15,8 @@ export declare class Utils {
15
15
  static addFloatToField(data: any, field: string, amount: number): number;
16
16
  static stringToObject(strData: string): any;
17
17
  static stringToArray(strData: string): any[];
18
+ static objectToString(data: object): string;
19
+ static arrayToString(dataArray: object): string;
18
20
  static copyToClipboard(val: string, message?: string): void;
19
21
  static isset(obj: Record<string, any> | null | undefined | string | boolean): boolean;
20
22
  static issetNum(val: any): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/sdk/utilities/utils.ts"],"names":[],"mappings":"AAEA,qBAAa,KAAK;IACd,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAIlD,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,SAAK,GAAG,MAAM;IAInE,MAAM,CAAC,SAAS,CAAC,IAAI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AAoB,CAAC,MAAM,GAAE,MAAW,GAAG,MAAM;IAUxD,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG1C"}
@@ -66,6 +66,22 @@ export class Utils {
66
66
  return [];
67
67
  }
68
68
  }
69
+ static objectToString(data) {
70
+ try {
71
+ return JSON.stringify(data);
72
+ }
73
+ catch (ex) {
74
+ return "{}";
75
+ }
76
+ }
77
+ static arrayToString(dataArray) {
78
+ try {
79
+ return JSON.stringify(dataArray);
80
+ }
81
+ catch (ex) {
82
+ return "[]";
83
+ }
84
+ }
69
85
  static copyToClipboard(val, message = 'Text copied') {
70
86
  navigator.clipboard.writeText(val)
71
87
  .then(() => {
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "jd_platform_sdk",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": "./dist/index.js"
9
+ },
7
10
  "scripts": {
8
11
  "build": "tsc",
9
12
  "test": "jest"