@pushwoosh/session-store 2.2.20 → 2.3.0

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.
@@ -1,7 +1,9 @@
1
- import { Subscription } from 'rxjs';
2
- import { GrpcClient } from '@pushwoosh/http-client';
3
- import { Account as AccountData, User as UserData } from '@pushwoosh/rpc-service-client/pushwoosh/accounts/get_auth_info_pb';
1
+ import { type Subscription } from 'rxjs';
2
+ import { type GrpcClient } from '@pushwoosh/http-client';
3
+ import { type RpcServiceClientInstances } from '@pushwoosh/grpc-bridge';
4
4
  import type { Session } from './session-store.types';
5
+ type AuthInfoAccountAsObject = ReturnType<RpcServiceClientInstances['accounts']['AuthInfoAccount']['toObject']>;
6
+ type AuthInfoUserAsObject = ReturnType<RpcServiceClientInstances['accounts']['AuthInfoUser']['toObject']>;
5
7
  export declare class SessionStore {
6
8
  /**
7
9
  * Клиент для работы c grpc
@@ -24,7 +26,7 @@ export declare class SessionStore {
24
26
  /**
25
27
  * Загрузить данные об аккаунте и пользователе
26
28
  */
27
- load: () => Promise<[AccountData.AsObject, UserData.AsObject]>;
29
+ load: () => Promise<[AuthInfoAccountAsObject, AuthInfoUserAsObject]>;
28
30
  /**
29
31
  * Обновить сеанс
30
32
  */
@@ -36,4 +38,5 @@ export declare class SessionStore {
36
38
  */
37
39
  subscribe: (callback: (session: Session) => any) => Subscription;
38
40
  }
41
+ export {};
39
42
  //# sourceMappingURL=session-store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../src/session-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,YAAY,EAAE,MAAM,MAAM,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,IAAI,IAAI,QAAQ,EAEjB,MAAM,mEAAmE,CAAC;AAS3E,OAAO,KAAK,EAAE,OAAO,EAAoB,M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IAAI,QAAa,QAAQ,CAAC,uBAAuB,EAAE,oBAAoB,CAAC,CAAC,CAO9E;IAEF;;OAEG;IACI,MAAM,QAAa,QAAQ,IAAI,CAAC,CAGrC;IAEF;;;;OAIG;IACI,SAAS,uBAAwB,OAAO,KAAK,GAAG,KAAG,YAAY,CAEpE;CACH"}
@@ -1,4 +1,4 @@
1
1
  import type { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
2
2
  export declare function timestampToUtcDate(timestamp?: Timestamp.AsObject): string;
3
- export declare const formatEmailsList: (emails?: string[] | undefined) => string;
3
+ export declare const formatEmailsList: (emails?: string[]) => string;
4
4
  //# sourceMappingURL=session-store.helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session-store.helpers.d.ts","sourceRoot":"","sources":["../src/session-store.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAE9E,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,QAAQ,GAAG,MAAM,CAOzE;AAED,eAAO,MAAM,gBAAgB,qCAAwB,MAEpD,CAAC"}
1
+ {"version":3,"file":"session-store.helpers.d.ts","sourceRoot":"","sources":["../src/session-store.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAE9E,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,QAAQ,GAAG,MAAM,CAOzE;AAED,eAAO,MAAM,gBAAgB,YAAa,MAAM,EAAE,KAAG,MAEpD,CAAC"}
@@ -5,7 +5,7 @@ import type { Platforms } from './entities/platforms';
5
5
  import type { Restrictions } from './entities/restrictions';
6
6
  import type { Counters } from './entities/counters';
7
7
  import type { User } from './entities/user';
8
- export declare type Session = {
8
+ export type Session = {
9
9
  readonly account: Account;
10
10
  readonly permissions: Permissions;
11
11
  readonly platforms: Platforms;
@@ -13,7 +13,7 @@ export declare type Session = {
13
13
  readonly counters: Counters;
14
14
  readonly user: User;
15
15
  };
16
- export declare type RestrictionsData = {
16
+ export type RestrictionsData = {
17
17
  restrictions: RestrictionValue.AsObject;
18
18
  };
19
19
  //# sourceMappingURL=session-store.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session-store.types.d.ts","sourceRoot":"","sources":["../src/session-store.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+EAA+E,CAAC;AAEtH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,oBAAY,OAAO,GAAG;IACpB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;CACrB,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,YAAY,EAAE,gBAAgB,CAAC,QAAQ,CAAC;CACzC,CAAC"}
1
+ {"version":3,"file":"session-store.types.d.ts","sourceRoot":"","sources":["../src/session-store.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+EAA+E,CAAC;AAEtH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,YAAY,EAAE,gBAAgB,CAAC,QAAQ,CAAC;CACzC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export type NonNullableReturnType<T> = T extends (...args: any[]) => infer R ? NonNullable<R> : never;
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC"}
package/package.json CHANGED
@@ -18,24 +18,25 @@
18
18
  "pre-commit": "check",
19
19
  "dependencies": {
20
20
  "@babel/runtime-corejs3": "^7.17.2",
21
+ "@pushwoosh/grpc-bridge": "^0.4.38",
21
22
  "core-js": "^3.21.0"
22
23
  },
23
24
  "devDependencies": {
24
- "@babel/core": "^7.17.2",
25
+ "@babel/core": "^7.18.6",
25
26
  "@babel/plugin-transform-runtime": "^7.17.0",
26
27
  "@babel/preset-env": "^7.16.11",
27
28
  "@types/google-protobuf": "^3.15.12",
28
29
  "@types/jest": "^27.4.0",
29
30
  "@types/webpack-env": "^1.16.3",
30
- "@typescript-eslint/eslint-plugin": "^5.11.0",
31
- "@typescript-eslint/parser": "^5.11.0",
32
- "babel-loader": "^8.2.3",
31
+ "@typescript-eslint/eslint-plugin": "^7.11.0",
32
+ "@typescript-eslint/parser": "^7.11.0",
33
+ "babel-loader": "^9.1.3",
33
34
  "clean-webpack-plugin": "^4.0.0",
34
35
  "cross-env": "^7.0.3",
35
36
  "dotenv": "^16.0.0",
36
37
  "eslint": "^8.8.0",
37
38
  "eslint-config-airbnb": "^19.0.4",
38
- "eslint-config-airbnb-typescript": "^16.1.0",
39
+ "eslint-config-airbnb-typescript": "^18.0.0",
39
40
  "eslint-plugin-compat": "^4.0.2",
40
41
  "eslint-plugin-import": "^2.25.4",
41
42
  "eslint-plugin-jsx-a11y": "^6.5.1",
@@ -47,14 +48,14 @@
47
48
  "ts-jest": "^27.1.3",
48
49
  "ts-loader": "^9.2.6",
49
50
  "typescript": "^4.5.5",
50
- "webpack": "^5.68.0",
51
+ "webpack": "^5.91.0",
51
52
  "webpack-cli": "^4.9.2",
52
53
  "webpack-dev-server": "^4.7.4",
53
54
  "webpack-merge": "^5.8.0"
54
55
  },
55
56
  "peerDependencies": {
57
+ "@pushwoosh/grpc-bridge": "^0.4.38",
56
58
  "@pushwoosh/http-client": "^2.4.8",
57
- "@pushwoosh/rpc-service-client": "^0.1.124",
58
59
  "rxjs": "^7.5.2",
59
60
  "tslib": "^2.3.1"
60
61
  },
@@ -62,5 +63,5 @@
62
63
  "node": ">=16.0.0",
63
64
  "npm": ">=7.0.0"
64
65
  },
65
- "version": "2.2.20"
66
+ "version": "2.3.0"
66
67
  }