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.
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/sdk/configs/jdConfig.js +2 -2
- package/dist/sdk/jdConnector.d.ts +2 -2
- package/dist/sdk/jdConnector.d.ts.map +1 -1
- package/dist/sdk/jdConnector.js +10 -8
- package/dist/sdk/jdSdk.d.ts +1 -1
- package/dist/sdk/jdSdk.d.ts.map +1 -1
- package/dist/sdk/jdSdk.js +2 -1
- package/dist/sdk/models/jdApplication.d.ts +3 -3
- package/dist/sdk/models/jdApplication.d.ts.map +1 -1
- package/dist/sdk/models/jdApplication.js +3 -5
- package/dist/sdk/models/jdResource.d.ts +13 -12
- package/dist/sdk/models/jdResource.d.ts.map +1 -1
- package/dist/sdk/models/jdResource.js +46 -34
- package/dist/sdk/models/modules/geolocation/jdCity.d.ts +15 -0
- package/dist/sdk/models/modules/geolocation/jdCity.d.ts.map +1 -0
- package/dist/sdk/models/modules/geolocation/jdCity.js +50 -0
- package/dist/sdk/models/modules/geolocation/jdCountry.d.ts +10 -0
- package/dist/sdk/models/modules/geolocation/jdCountry.d.ts.map +1 -0
- package/dist/sdk/models/modules/geolocation/jdCountry.js +42 -0
- package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts +14 -0
- package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts.map +1 -0
- package/dist/sdk/models/modules/geolocation/jdDistrict.js +44 -0
- package/dist/sdk/models/modules/geolocation/jdState.d.ts +15 -0
- package/dist/sdk/models/modules/geolocation/jdState.d.ts.map +1 -0
- package/dist/sdk/models/modules/geolocation/jdState.js +50 -0
- package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts +24 -2
- package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts.map +1 -1
- package/dist/sdk/models/modules/karaoke/jdKtvShop.js +40 -5
- package/dist/sdk/models/modules/user/jdSessionUser.d.ts +17 -0
- package/dist/sdk/models/modules/user/jdSessionUser.d.ts.map +1 -0
- package/dist/sdk/models/modules/user/jdSessionUser.js +62 -0
- package/dist/sdk/models/modules/user/jdUser.d.ts +17 -0
- package/dist/sdk/models/modules/user/jdUser.d.ts.map +1 -0
- package/dist/sdk/models/modules/user/jdUser.js +72 -0
- package/dist/sdk/utilities/browserUtils.d.ts +6 -4
- package/dist/sdk/utilities/browserUtils.d.ts.map +1 -1
- package/dist/sdk/utilities/browserUtils.js +23 -21
- package/dist/sdk/utilities/utils.d.ts +2 -0
- package/dist/sdk/utilities/utils.d.ts.map +1 -1
- package/dist/sdk/utilities/utils.js +18 -0
- package/package.json +11 -2
- package/readme.md +5 -0
- package/dist/globals.d.ts +0 -7
- package/dist/globals.d.ts.map +0 -1
- package/dist/globals.js +0 -1
- package/dist/sdk/configs/dpConfig.d.ts +0 -15
- package/dist/sdk/configs/dpConfig.d.ts.map +0 -1
- package/dist/sdk/configs/dpConfig.js +0 -49
- package/dist/sdk/extensions/extensions.d.ts +0 -2
- package/dist/sdk/extensions/extensions.d.ts.map +0 -1
- package/dist/sdk/extensions/extensions.js +0 -23
- package/dist/sdk/utilities/crypto_utils.d.ts +0 -5
- package/dist/sdk/utilities/crypto_utils.d.ts.map +0 -1
- package/dist/sdk/utilities/crypto_utils.js +0 -26
- package/dist/stringUtils.d.ts +0 -3
- package/dist/stringUtils.d.ts.map +0 -1
- package/dist/stringUtils.js +0 -6
- package/dist/unit_tests.d.ts +0 -2
- package/dist/unit_tests.d.ts.map +0 -1
- package/dist/unit_tests.js +0 -7
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crypto_utils.d.ts","sourceRoot":"","sources":["../../../src/sdk/utilities/crypto_utils.ts"],"names":[],"mappings":"AAIA,qBAAa,aAAa;IAEtB,MAAM,CAAC,wBAAwB,CAAC,WAAW,EAAC,GAAG;IAqB/C,MAAM,CAAC,YAAY,CAAC,UAAU,EAAC,MAAM,EAAE,MAAM,EAAC,MAAM;CAGvD"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
-
// @ts-ignore
|
|
3
|
-
import hmacSha256 from 'crypto-js/hmac-sha256';
|
|
4
|
-
export class CryptoUtility {
|
|
5
|
-
// Generate hash string to sign to communicate with the server to allow from this client only
|
|
6
|
-
static generateBeforeHashString(paramsArray) {
|
|
7
|
-
const curUserId = globalThis.curUserId;
|
|
8
|
-
const curApplicationId = globalThis.curApplicationId;
|
|
9
|
-
const curAppSecret = globalThis.curAppSecret;
|
|
10
|
-
const userId = curUserId.get();
|
|
11
|
-
let strBeforeHash = curApplicationId.get() + userId;
|
|
12
|
-
const appSecret = curAppSecret.get();
|
|
13
|
-
// console.log(`Player ID: ${playerId}`);
|
|
14
|
-
for (const param of paramsArray) {
|
|
15
|
-
strBeforeHash += param;
|
|
16
|
-
}
|
|
17
|
-
// console.log(`Cur Application Id: ${curApplicationId.get()}`);
|
|
18
|
-
// console.log(`Cur User Id: ${userId}`);
|
|
19
|
-
// console.log(`Before Hash: ${strBeforeHash}`);
|
|
20
|
-
// console.log(`App Secret: ${appSecret}`);
|
|
21
|
-
return hmacSha256(strBeforeHash, appSecret).toString();
|
|
22
|
-
}
|
|
23
|
-
static generateHash(strMessage, secret) {
|
|
24
|
-
return hmacSha256(strMessage, secret).toString();
|
|
25
|
-
}
|
|
26
|
-
}
|
package/dist/stringUtils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stringUtils.d.ts","sourceRoot":"","sources":["../src/stringUtils.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C"}
|
package/dist/stringUtils.js
DELETED
package/dist/unit_tests.d.ts
DELETED
package/dist/unit_tests.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unit_tests.d.ts","sourceRoot":"","sources":["../src/unit_tests.ts"],"names":[],"mappings":""}
|
package/dist/unit_tests.js
DELETED