zmp-sdk 2.21.1 → 2.22.1

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.
@@ -13,6 +13,7 @@ import { Routing } from './routing';
13
13
  import ZJSBridge from '../zaloJsBridge';
14
14
  import { SDKServiceInterface } from '../types/interface';
15
15
  import { ZMPEEmitter } from '../event-emitter';
16
+ import { contextInfo } from '../types/entity';
16
17
  export default class ZaloMiniProgramSDKService implements SDKServiceInterface {
17
18
  #private;
18
19
  events: ZMPEEmitter;
@@ -27,6 +28,7 @@ export default class ZaloMiniProgramSDKService implements SDKServiceInterface {
27
28
  getAppId(): string;
28
29
  getZAppId(): string;
29
30
  getDeviceId(): string;
31
+ getContext(): contextInfo | null;
30
32
  getJSBridge(): ZJSBridge;
31
33
  login(object?: InputDataType.CallbackType): Promise<string>;
32
34
  loginZaloV3(): Promise<string | null>;
@@ -42,3 +42,10 @@ export declare type systemInfo = {
42
42
  /** Theme set in Zalo */
43
43
  zaloTheme: string;
44
44
  };
45
+ /**
46
+ * Context info
47
+ */
48
+ export declare type contextInfo = {
49
+ type: "USER_CHAT" | "GROUP_CHAT";
50
+ id: string;
51
+ };
@@ -1,11 +1,12 @@
1
1
  import * as InputDataType from './inputData';
2
2
  import * as CallbackDataType from './callbackData';
3
- import { systemInfo } from './entity';
3
+ import { systemInfo, contextInfo } from './entity';
4
4
  import { MediaPickerType } from './enum';
5
5
  import { SDKCreator } from '..';
6
6
  export interface SDKServiceInterface {
7
7
  getAppId: () => string;
8
8
  getDeviceId: () => string;
9
+ getContext: () => contextInfo | null;
9
10
  login: (object?: InputDataType.CallbackType) => Promise<string>;
10
11
  getLoginStatus: () => boolean;
11
12
  getAccessToken: (object?: InputDataType.CallbackType) => Promise<string | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmp-sdk",
3
- "version": "2.21.1",
3
+ "version": "2.22.1",
4
4
  "description": "Zalo Mini App SDK",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -12,12 +12,11 @@
12
12
  "dist"
13
13
  ],
14
14
  "scripts": {
15
- "docs": "rimraf ./dist/docs && auto-changelog -p && jsdoc -c ./jsdoc.js",
16
- "tsdocs": "rimraf ./tsdocs && typedoc ./src/index.ts --options ./typedoc.json ./src",
15
+ "changelog": "auto-changelog -p && node ./scripts/build-changelog.js",
17
16
  "watch": "rollup -c -w",
18
17
  "build": "rimraf dist && NODE_ENV=production rollup -c",
19
18
  "version": "NODE_ENV=production yarn run build",
20
- "release": "np --no-2fa"
19
+ "release": "np --no-2fa && yarn run changelog"
21
20
  },
22
21
  "author": {
23
22
  "name": "Zalo"
@@ -27,15 +26,10 @@
27
26
  "runPublish": true
28
27
  },
29
28
  "auto-changelog": {
30
- "output": "./docs-template/changelog/changelog.md",
29
+ "output": "./CHANGELOG.json",
31
30
  "unreleased": true,
32
31
  "commitLimit": false,
33
- "template": "./docs-template/changelog-template.hbs",
34
- "handlebarsSetup": "./docs-template/changelog-setup.js"
35
- },
36
- "apidoc": {
37
- "title": "Custom apiDoc browser title",
38
- "url": ""
32
+ "template": "json"
39
33
  },
40
34
  "devDependencies": {
41
35
  "@babel/core": "^7.0.0-0",
@@ -45,6 +39,8 @@
45
39
  "@babel/preset-env": "^7.16.11",
46
40
  "@babel/preset-typescript": "^7.12.7",
47
41
  "@babel/runtime": "^7.0.0-beta.46",
42
+ "@commitlint/cli": "^17.0.3",
43
+ "@commitlint/config-conventional": "^17.0.3",
48
44
  "@open-wc/rollup-plugin-html": "^1.2.5",
49
45
  "@rollup/plugin-alias": "^3.1.9",
50
46
  "@rollup/plugin-html": "^0.2.2",
@@ -55,6 +51,7 @@
55
51
  "@types/qrcode": "^1.4.1",
56
52
  "babel-plugin-lodash": "^3.3.4",
57
53
  "jest": "^25.1.0",
54
+ "json2md": "^1.12.0",
58
55
  "kida-docs": "^2.5.3",
59
56
  "np": "^7.2.0",
60
57
  "npm": "^6.14.11",