@sudoplatform/sudo-user 10.0.0 → 10.1.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.
- package/docs/assets/highlight.css +1 -1
- package/docs/assets/main.js +2 -2
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +28 -2
- package/docs/classes/AlreadyRegisteredError.html +3 -3
- package/docs/classes/DefaultSudoUserClient.html +30 -28
- package/docs/classes/IdentityServiceConfigNotFoundError.html +3 -3
- package/docs/classes/LocalAuthenticationProvider.html +3 -3
- package/docs/classes/TESTAuthenticationProvider.html +3 -3
- package/docs/index.html +1 -1
- package/docs/interfaces/AuthenticationProvider.html +2 -2
- package/docs/interfaces/AuthenticationTokens.html +2 -2
- package/docs/interfaces/SudoUserClient.html +27 -25
- package/docs/modules.html +1 -1
- package/lib/gen/graphql-types.d.ts +5 -4
- package/lib/user/auth.js +1 -1
- package/lib/user/identity-provider.d.ts +7 -0
- package/lib/user/identity-provider.js +21 -0
- package/lib/user/user-client-interface.d.ts +4 -0
- package/lib/user/user-client.d.ts +1 -0
- package/lib/user/user-client.js +20 -0
- package/package.json +50 -41
|
@@ -42,6 +42,7 @@ export declare class DefaultSudoUserClient implements SudoUserClient {
|
|
|
42
42
|
isSignedIn(): Promise<boolean>;
|
|
43
43
|
refreshTokens(refreshToken: string): Promise<AuthenticationTokens>;
|
|
44
44
|
getLatestAuthToken(): Promise<string>;
|
|
45
|
+
signOut(): Promise<void>;
|
|
45
46
|
globalSignOut(): Promise<void>;
|
|
46
47
|
registerWithAuthenticationProvider(authenticationProvider: AuthenticationProvider, registrationId?: string): Promise<string>;
|
|
47
48
|
signInWithAuthenticationProvider(authenticationProvider: AuthenticationProvider): Promise<AuthenticationTokens>;
|
package/lib/user/user-client.js
CHANGED
|
@@ -241,6 +241,26 @@ class DefaultSudoUserClient {
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
+
async signOut() {
|
|
245
|
+
let refreshToken;
|
|
246
|
+
|
|
247
|
+
try {
|
|
248
|
+
refreshToken = await this.getRefreshToken();
|
|
249
|
+
} catch (err) {
|
|
250
|
+
if (err instanceof _sudoCommon.KeyNotFoundError) {
|
|
251
|
+
throw new _sudoCommon.NotSignedInError();
|
|
252
|
+
} else {
|
|
253
|
+
throw err;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (refreshToken) {
|
|
258
|
+
await this.identityProvider.signOut(refreshToken);
|
|
259
|
+
} else {
|
|
260
|
+
throw new _sudoCommon.NotSignedInError();
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
244
264
|
async globalSignOut() {
|
|
245
265
|
if (!(await this.isSignedIn())) {
|
|
246
266
|
throw new _sudoCommon.NotSignedInError();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudoplatform/sudo-user",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.1.1",
|
|
4
4
|
"author": "Anonyome Labs, Inc.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"scripts": {
|
|
11
|
+
"prepare": "husky install",
|
|
11
12
|
"lint": "yarn lint:eslint && yarn lint:prettier",
|
|
12
13
|
"lint:eslint": "eslint \"{bin,test,src}/**/*.{ts,tsx}\"",
|
|
13
14
|
"lint:prettier": "prettier -l \"{bin,test,src}/**/*.{js,json,jsx,ts,tsx}\"",
|
|
@@ -32,65 +33,73 @@
|
|
|
32
33
|
"./lib/runtimes/node/node-crypto.js": "./lib/runtimes/browser/browser-crypto.js"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@aws-sdk/client-cognito-identity-provider": "^3.
|
|
36
|
-
"@graphql-typed-document-node/core": "^3.1.
|
|
37
|
-
"@sudoplatform/sudo-web-crypto-provider": "^3.
|
|
36
|
+
"@aws-sdk/client-cognito-identity-provider": "^3.102.0",
|
|
37
|
+
"@graphql-typed-document-node/core": "^3.1.1",
|
|
38
|
+
"@sudoplatform/sudo-web-crypto-provider": "^3.1.0",
|
|
38
39
|
"amazon-cognito-auth-js": "^1.3.3",
|
|
39
40
|
"apollo-cache-inmemory": "^1.6.6",
|
|
40
|
-
"asn1js": "^2.
|
|
41
|
-
"aws-appsync": "4.
|
|
42
|
-
"fp-ts": "^2.
|
|
43
|
-
"graphql": "^15.
|
|
41
|
+
"asn1js": "^2.4.0",
|
|
42
|
+
"aws-appsync": "^4.1.6",
|
|
43
|
+
"fp-ts": "^2.12.1",
|
|
44
|
+
"graphql": "^15.8.0",
|
|
44
45
|
"io-ts": "^2.2.16",
|
|
45
46
|
"jsonwebtoken": "^8.5.1",
|
|
46
47
|
"lodash": "^4.17.21",
|
|
47
|
-
"monocle-ts": "^2.3.
|
|
48
|
-
"newtype-ts": "^0.3.
|
|
49
|
-
"tslib": "^2.
|
|
48
|
+
"monocle-ts": "^2.3.13",
|
|
49
|
+
"newtype-ts": "^0.3.5",
|
|
50
|
+
"tslib": "^2.4.0",
|
|
50
51
|
"uuid": "^8.3.2"
|
|
51
52
|
},
|
|
52
53
|
"resolutions": {
|
|
53
54
|
"apollo-cache-inmemory": "^1.6.6",
|
|
54
|
-
"
|
|
55
|
+
"apollo-client": "^2.6.10",
|
|
56
|
+
"apollo-link": "^1.2.14",
|
|
57
|
+
"apollo-link-http": "^1.5.17",
|
|
58
|
+
"@graphql-codegen/**/ansi-regex": "^5.0.1",
|
|
59
|
+
"cross-fetch": "^3.1.5",
|
|
60
|
+
"node-fetch": "^2.6.7",
|
|
61
|
+
"minimist": "^1.2.6"
|
|
55
62
|
},
|
|
56
63
|
"devDependencies": {
|
|
57
|
-
"@babel/cli": "^7.
|
|
58
|
-
"@babel/core": "^7.
|
|
59
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
60
|
-
"@babel/plugin-proposal-private-methods": "^7.
|
|
61
|
-
"@babel/preset-env": "^7.
|
|
62
|
-
"@babel/preset-typescript": "^7.
|
|
63
|
-
"@graphql-codegen/add": "^3.1.
|
|
64
|
-
"@graphql-codegen/cli": "^2.2
|
|
65
|
-
"@graphql-codegen/plugin-helpers": "^2.2
|
|
66
|
-
"@graphql-codegen/typed-document-node": "^2.
|
|
67
|
-
"@graphql-codegen/typescript": "^2.
|
|
68
|
-
"@graphql-codegen/typescript-operations": "^2.
|
|
64
|
+
"@babel/cli": "^7.17.10",
|
|
65
|
+
"@babel/core": "^7.18.2",
|
|
66
|
+
"@babel/plugin-proposal-class-properties": "^7.17.12",
|
|
67
|
+
"@babel/plugin-proposal-private-methods": "^7.17.12",
|
|
68
|
+
"@babel/preset-env": "^7.18.2",
|
|
69
|
+
"@babel/preset-typescript": "^7.17.12",
|
|
70
|
+
"@graphql-codegen/add": "^3.1.1",
|
|
71
|
+
"@graphql-codegen/cli": "^2.6.2",
|
|
72
|
+
"@graphql-codegen/plugin-helpers": "^2.4.2",
|
|
73
|
+
"@graphql-codegen/typed-document-node": "^2.2.11",
|
|
74
|
+
"@graphql-codegen/typescript": "^2.4.11",
|
|
75
|
+
"@graphql-codegen/typescript-operations": "^2.4.0",
|
|
69
76
|
"@graphql-typed-document-node/apollo-client-2": "^1.0.0",
|
|
70
|
-
"@sudoplatform/sudo-common": "^6.
|
|
77
|
+
"@sudoplatform/sudo-common": "^6.2.1",
|
|
71
78
|
"@types/amazon-cognito-auth-js": "^1.3.0",
|
|
72
|
-
"@types/firefox-webext-browser": "^
|
|
73
|
-
"@types/jest": "^
|
|
74
|
-
"@types/jsonwebtoken": "^8.5.
|
|
75
|
-
"@types/lodash": "^4.14.
|
|
76
|
-
"@types/node": "^
|
|
77
|
-
"@types/uuid": "^8.3.
|
|
78
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
79
|
-
"@typescript-eslint/parser": "^5.
|
|
79
|
+
"@types/firefox-webext-browser": "^94.0.1",
|
|
80
|
+
"@types/jest": "^28.1.0",
|
|
81
|
+
"@types/jsonwebtoken": "^8.5.8",
|
|
82
|
+
"@types/lodash": "^4.14.182",
|
|
83
|
+
"@types/node": "^16.11.38",
|
|
84
|
+
"@types/uuid": "^8.3.4",
|
|
85
|
+
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
|
86
|
+
"@typescript-eslint/parser": "^5.27.0",
|
|
80
87
|
"apollo-client": "^2.6.10",
|
|
81
|
-
"eslint": "^8.0
|
|
82
|
-
"eslint-config-prettier": "^8.
|
|
83
|
-
"eslint-plugin-import": "^2.
|
|
88
|
+
"eslint": "^8.16.0",
|
|
89
|
+
"eslint-config-prettier": "^8.5.0",
|
|
90
|
+
"eslint-plugin-import": "^2.26.0",
|
|
84
91
|
"eslint-plugin-prettier": "^4.0.0",
|
|
92
|
+
"husky": "^8.0.1",
|
|
85
93
|
"isomorphic-fetch": "^3.0.0",
|
|
86
94
|
"isomorphic-webcrypto": "^2.3.8",
|
|
87
|
-
"jest": "
|
|
88
|
-
"
|
|
95
|
+
"jest": "28.1.0",
|
|
96
|
+
"jest-environment-node": "^28.1.0",
|
|
97
|
+
"prettier": "^2.6.2",
|
|
89
98
|
"react": "16.13.1",
|
|
90
|
-
"subscriptions-transport-ws": "^0.
|
|
99
|
+
"subscriptions-transport-ws": "^0.11.0",
|
|
91
100
|
"ts-mockito": "^2.6.1",
|
|
92
|
-
"typedoc": "^0.22.
|
|
93
|
-
"typescript": "^4.
|
|
101
|
+
"typedoc": "^0.22.17",
|
|
102
|
+
"typescript": "^4.7.2",
|
|
94
103
|
"websocket": "^1.0.34"
|
|
95
104
|
},
|
|
96
105
|
"peerDependencies": {
|