jd_platform_sdk 0.0.2 → 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 (63) 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/configs/jdConfig.js +2 -2
  5. package/dist/sdk/jdConnector.d.ts +2 -2
  6. package/dist/sdk/jdConnector.d.ts.map +1 -1
  7. package/dist/sdk/jdConnector.js +10 -8
  8. package/dist/sdk/jdSdk.d.ts +1 -1
  9. package/dist/sdk/jdSdk.d.ts.map +1 -1
  10. package/dist/sdk/jdSdk.js +2 -1
  11. package/dist/sdk/models/jdApplication.d.ts +3 -3
  12. package/dist/sdk/models/jdApplication.d.ts.map +1 -1
  13. package/dist/sdk/models/jdApplication.js +3 -5
  14. package/dist/sdk/models/jdResource.d.ts +13 -12
  15. package/dist/sdk/models/jdResource.d.ts.map +1 -1
  16. package/dist/sdk/models/jdResource.js +46 -34
  17. package/dist/sdk/models/modules/geolocation/jdCity.d.ts +15 -0
  18. package/dist/sdk/models/modules/geolocation/jdCity.d.ts.map +1 -0
  19. package/dist/sdk/models/modules/geolocation/jdCity.js +50 -0
  20. package/dist/sdk/models/modules/geolocation/jdCountry.d.ts +10 -0
  21. package/dist/sdk/models/modules/geolocation/jdCountry.d.ts.map +1 -0
  22. package/dist/sdk/models/modules/geolocation/jdCountry.js +42 -0
  23. package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts +14 -0
  24. package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts.map +1 -0
  25. package/dist/sdk/models/modules/geolocation/jdDistrict.js +44 -0
  26. package/dist/sdk/models/modules/geolocation/jdState.d.ts +15 -0
  27. package/dist/sdk/models/modules/geolocation/jdState.d.ts.map +1 -0
  28. package/dist/sdk/models/modules/geolocation/jdState.js +50 -0
  29. package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts +24 -2
  30. package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts.map +1 -1
  31. package/dist/sdk/models/modules/karaoke/jdKtvShop.js +40 -5
  32. package/dist/sdk/models/modules/user/jdSessionUser.d.ts +17 -0
  33. package/dist/sdk/models/modules/user/jdSessionUser.d.ts.map +1 -0
  34. package/dist/sdk/models/modules/user/jdSessionUser.js +62 -0
  35. package/dist/sdk/models/modules/user/jdUser.d.ts +17 -0
  36. package/dist/sdk/models/modules/user/jdUser.d.ts.map +1 -0
  37. package/dist/sdk/models/modules/user/jdUser.js +72 -0
  38. package/dist/sdk/utilities/browserUtils.d.ts +6 -4
  39. package/dist/sdk/utilities/browserUtils.d.ts.map +1 -1
  40. package/dist/sdk/utilities/browserUtils.js +23 -21
  41. package/dist/sdk/utilities/utils.d.ts +2 -0
  42. package/dist/sdk/utilities/utils.d.ts.map +1 -1
  43. package/dist/sdk/utilities/utils.js +18 -0
  44. package/package.json +11 -2
  45. package/readme.md +5 -0
  46. package/dist/globals.d.ts +0 -7
  47. package/dist/globals.d.ts.map +0 -1
  48. package/dist/globals.js +0 -1
  49. package/dist/sdk/configs/dpConfig.d.ts +0 -15
  50. package/dist/sdk/configs/dpConfig.d.ts.map +0 -1
  51. package/dist/sdk/configs/dpConfig.js +0 -49
  52. package/dist/sdk/extensions/extensions.d.ts +0 -2
  53. package/dist/sdk/extensions/extensions.d.ts.map +0 -1
  54. package/dist/sdk/extensions/extensions.js +0 -23
  55. package/dist/sdk/utilities/crypto_utils.d.ts +0 -5
  56. package/dist/sdk/utilities/crypto_utils.d.ts.map +0 -1
  57. package/dist/sdk/utilities/crypto_utils.js +0 -26
  58. package/dist/stringUtils.d.ts +0 -3
  59. package/dist/stringUtils.d.ts.map +0 -1
  60. package/dist/stringUtils.js +0 -6
  61. package/dist/unit_tests.d.ts +0 -2
  62. package/dist/unit_tests.d.ts.map +0 -1
  63. package/dist/unit_tests.js +0 -7
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";
@@ -12,11 +12,11 @@ export default class JDConfig {
12
12
  static getAPIHost() {
13
13
  const prConfig = JDConfig.instance;
14
14
  if (globalThis.bLocalHost) {
15
- return globalThis.apiEndPointLocalhost + globalThis.apiVersion;
15
+ return globalThis.apiEndPointLocalhost + "/" + globalThis.apiVersion;
16
16
  }
17
17
  else {
18
18
  if (globalThis.bSandboxApi) {
19
- return globalThis.apiEndPointSandbox + globalThis.apiVersion;
19
+ return globalThis.apiEndPointSandbox + "/" + globalThis.apiVersion;
20
20
  }
21
21
  else {
22
22
  return globalThis.apiEndPoint + globalThis.apiVersion;
@@ -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,SAAK;IAIrI,oBAAoB,CAAC,GAAG,EAAC,MAAM,EAAE,OAAO,EAAC,GAAG,EAAE,MAAM,EAAC,GAAG,EAAE,iBA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ildParams_1) {
44
44
  return __awaiter(this, arguments, void 0, function* (httpType, url, params, headers, body, bShowErrorMessage, bBuildParams, bRelativeURL = true, bForceRefresh = true, bAutoHideBusyIndicator = true, overrideVersion = '') {
45
45
  const finalURL = this.buildURL(httpType, url, params, true, bRelativeURL);
46
- // console.log(bRelativeURL);
47
- // console.log(finalURL);
46
+ // console.log(bRelativeURL);
47
+ // console.log(finalURL);
48
48
  //Only for debugging purposes only
49
49
  if (globalThis.bForceRefreshGetRequests) {
50
50
  bForceRefresh = true;
@@ -91,7 +91,7 @@ export class JDConnector {
91
91
  // Build a query parameters from a Map type to URL encoded string like ?event=test&type=001
92
92
  buildParams(params) {
93
93
  let finalParams = "";
94
- if (Utils.isset(params)) {
94
+ if (Utils.isNotEmpty(params)) {
95
95
  let index = 0;
96
96
  for (const key in params) {
97
97
  const val = params[key];
@@ -104,6 +104,7 @@ export class JDConnector {
104
104
  index++;
105
105
  }
106
106
  }
107
+ // console.log(`Final params: ${finalParams}`)
107
108
  return finalParams;
108
109
  }
109
110
  //bBuildParams - Whether or not the parameters will be embedded in URL
@@ -116,20 +117,21 @@ export class JDConnector {
116
117
  }
117
118
  // //Add hashtable form values for GET request
118
119
  if (httpType == 0 /* JDHttpType.GET */) {
119
- if (!params.isEmpty() && bBuildParams) {
120
+ if (Utils.isNotEmpty(params) && bBuildParams) {
120
121
  url += this.buildParams(params);
121
122
  }
122
123
  }
123
124
  // Replace all instances of "\r\n" with "\n"
124
- url = url.replace(/\r\n/g, "\n");
125
- // Encode the URL and replace "#" with "%23"
126
- url = encodeURI(url).replace(/#/g, "%23");
125
+ // url = url.replace(/\r\n/g, "\n");
126
+ //
127
+ // // Encode the URL and replace "#" with "%23"
128
+ // url = encodeURI(url).replace(/#/g, "%23");
127
129
  return url;
128
130
  }
129
131
  buildDirectURL(httpType, url, data) {
130
132
  //Add hashtable form values for GET request
131
133
  if (httpType == 0 /* JDHttpType.GET */) {
132
- if (!data.isEmpty())
134
+ if (Utils.isNotEmpty(data))
133
135
  url += this.buildParams(data);
134
136
  }
135
137
  // Replace all instances of "\r\n" with "\n"
@@ -1,6 +1,6 @@
1
1
  export declare class JDSdk {
2
2
  static initialiseApp(applicationId: string, appId: string, appKey: string, appSecret: string): void;
3
- static updateConfigs(apiEndPoint: string, apiEndPointSandbox: string, apiEndPointLocalhost: string, bLocalHost: boolean, bSandboxApi: boolean): void;
3
+ static updateConfigs(apiVersion: string, apiEndPoint: string, apiEndPointSandbox: string, apiEndPointLocalhost: string, bLocalHost: boolean, bSandboxApi: boolean): void;
4
4
  static updateUserId(userId: string): void;
5
5
  }
6
6
  //# sourceMappingURL=jdSdk.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jdSdk.d.ts","sourceRoot":"","sources":["../../src/sdk/jdSdk.ts"],"names":[],"mappings":"AAAA,qBAAa,KAAK;IACjB,MAAM,CAAC,aAAa,CAAC,aAAa,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,MAAM,EAAC,MAAM,EAAE,SAAS,EAAC,MAAM;IAOxF,MAAM,CAAC,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO;IAQ7I,MAAM,CAAC,YAAY,CAAC,MAAM,EAAC,MAAM;CAGjC"}
1
+ {"version":3,"file":"jdSdk.d.ts","sourceRoot":"","sources":["../../src/sdk/jdSdk.ts"],"names":[],"mappings":"AAAA,qBAAa,KAAK;IACjB,MAAM,CAAC,aAAa,CAAC,aAAa,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,MAAM,EAAC,MAAM,EAAE,SAAS,EAAC,MAAM;IAOxF,MAAM,CAAC,aAAa,CAAC,UAAU,EAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO;IAShK,MAAM,CAAC,YAAY,CAAC,MAAM,EAAC,MAAM;CAGjC"}
package/dist/sdk/jdSdk.js CHANGED
@@ -5,7 +5,8 @@ export class JDSdk {
5
5
  globalThis.appKey = appKey;
6
6
  globalThis.appSecret = appSecret;
7
7
  }
8
- static updateConfigs(apiEndPoint, apiEndPointSandbox, apiEndPointLocalhost, bLocalHost, bSandboxApi) {
8
+ static updateConfigs(apiVersion, apiEndPoint, apiEndPointSandbox, apiEndPointLocalhost, bLocalHost, bSandboxApi) {
9
+ globalThis.apiVersion = apiVersion;
9
10
  globalThis.apiEndPoint = apiEndPoint;
10
11
  globalThis.apiEndPointSandbox = apiEndPointSandbox;
11
12
  globalThis.apiEndPointLocalhost = apiEndPointLocalhost;
@@ -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
  }
@@ -3,9 +3,9 @@ export default class JDResource {
3
3
  myId: string;
4
4
  slug: string;
5
5
  index: number;
6
- title: object;
7
- description: object;
8
- images: object;
6
+ title: Record<string, any>;
7
+ description: Record<string, any>;
8
+ images: Record<string, any>;
9
9
  createdAt: Date;
10
10
  updatedAt: Date;
11
11
  placeholderIconURL: string;
@@ -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;
33
- static getHashBody(remark?: string): Promise<Record<string, any>>;
32
+ setData(data: Record<string, any>): void;
33
+ static getHashBody(remark?: string): Record<string, any>;
34
34
  static getDefaultHeaders(headers?: {}): Record<string, any>;
35
- static addDefaultParams(params: any): Promise<void>;
36
- static getSortParameters(orderBy: string, order: string, pageIndex: number, countPerPage: number, fields: string): Promise<Record<string, any>>;
37
- static getFieldParameters(fields: string): Promise<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>;
35
+ static addDefaultParams(params: Record<string, any>): void;
36
+ static getSortParameters(orderBy: string, order: string, pageIndex: number, countPerPage: number, fields: string): Record<string, any>;
37
+ static getFieldParameters(fields: string): Record<string, any>;
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,KAAK,SAAK;IACb,KAAK,EAAE,MAAM,CAAM;IAChB,WAAW,EAAE,MAAM,CAAM;IACzB,MAAM,EAAE,MAAM,CAAM;IACpB,SAAS,EAAC,IAAI,CAAc;IAC5B,SAAS,EAAC,IAAI,CAAc;IAC5B,kBAAkB,SAA2E;IAQhG,IAAI,cAAc,IAAG,MAAM,CAAsE;IACjG,IAAI,oBAAoB,IAAG,MAAM,CAAkF;IACnH,IAAI,OAAO,IAAG,MAAM,CAA8C;IAClE,IAAI,OAAO,IAAG,MAAM,CAA6C;IACjE,IAAI,aAAa,IAAG,MAAM,CAAmD;IAC7E,IAAI,aAAa,IAAG,MAAM,CAAm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tils";
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');
@@ -62,15 +64,13 @@ export default class JDResource {
62
64
  // console.log(this.createdAt);
63
65
  }
64
66
  //Get default hash string with remark
65
- static getHashBody() {
66
- return __awaiter(this, arguments, void 0, function* (remark = '') {
67
- const body = {};
68
- //Calculate hashes
69
- const timestamp = DateUtils.getTimeStamp();
70
- body['timestamp'] = timestamp;
71
- body['hash_before'] = CryptoUtils.generateBeforeHashString([timestamp, remark]);
72
- return body;
73
- });
67
+ static getHashBody(remark = '') {
68
+ const body = {};
69
+ //Calculate hashes
70
+ const timestamp = DateUtils.getTimeStamp();
71
+ body['timestamp'] = timestamp;
72
+ body['hash_before'] = CryptoUtils.generateBeforeHashString([timestamp, remark]);
73
+ return body;
74
74
  }
75
75
  // Other Utilities
76
76
  static getDefaultHeaders(headers = {}) {
@@ -86,35 +86,29 @@ export default class JDResource {
86
86
  }
87
87
  //This is used to make a direct call supported on some APIs
88
88
  static addDefaultParams(params) {
89
- return __awaiter(this, void 0, void 0, function* () {
90
- params["app_id"] = globalThis.appId;
91
- params["token"] = globalThis.xAuthToken;
92
- params["random_seed"] = Date.now();
93
- });
89
+ params["app_id"] = globalThis.appId;
90
+ params["token"] = globalThis.xAuthToken;
91
+ params["random_seed"] = Date.now();
94
92
  }
95
93
  static getSortParameters(orderBy, order, pageIndex, countPerPage, fields) {
96
- return __awaiter(this, void 0, void 0, function* () {
97
- const params = { 'page_index': pageIndex, 'count_per_page': countPerPage, 'fields': fields };
98
- if (Utils.isset(orderBy) && Utils.isset(order)) {
99
- params['order_by'] = orderBy;
100
- params['order'] = order;
101
- }
102
- if (pageIndex >= 0 && countPerPage > 0) {
103
- params["page_index"] = pageIndex;
104
- params["count_per_page"] = countPerPage;
105
- }
106
- if (Utils.isset(fields)) {
107
- params["fields"] = fields;
108
- }
109
- return params;
110
- });
94
+ const params = { 'page_index': pageIndex, 'count_per_page': countPerPage, 'fields': fields };
95
+ if (Utils.isset(orderBy) && Utils.isset(order)) {
96
+ params['order_by'] = orderBy;
97
+ params['order'] = order;
98
+ }
99
+ if (pageIndex >= 0 && countPerPage > 0) {
100
+ params["page_index"] = pageIndex;
101
+ params["count_per_page"] = countPerPage;
102
+ }
103
+ if (Utils.isset(fields)) {
104
+ params["fields"] = fields;
105
+ }
106
+ return params;
111
107
  }
112
108
  static getFieldParameters(fields) {
113
- return __awaiter(this, void 0, void 0, function* () {
114
- const params = {};
115
- params["fields"] = fields;
116
- return params;
117
- });
109
+ const params = {};
110
+ params["fields"] = fields;
111
+ return params;
118
112
  }
119
113
  // HTTP Calls Utilities
120
114
  static getRelative(relativeUrl_1, params_1) {
@@ -146,4 +140,22 @@ export default class JDResource {
146
140
  return new SimpleResponse(response.body, response.statusCode);
147
141
  });
148
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
+ }
149
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"}