@sudoplatform/sudo-user 17.1.1 → 17.2.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.
- package/cjs/user/error.js +10 -1
- package/cjs/user/user-client.js +48 -32
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/highlight.css +1 -1
- package/docs/assets/icons.js +1 -1
- package/docs/assets/icons.svg +1 -1
- package/docs/assets/main.js +4 -4
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +18 -3
- package/docs/classes/AlreadyRegisteredError.html +148 -8
- package/docs/classes/AlreadySignedInError.html +173 -0
- package/docs/classes/DefaultSudoUserClient.html +543 -57
- package/docs/classes/IdentityServiceConfigNotFoundError.html +148 -8
- package/docs/classes/LocalAuthenticationProvider.html +123 -12
- package/docs/classes/SignInGuard.html +107 -8
- package/docs/classes/TESTAuthenticationProvider.html +138 -12
- package/docs/classes/internal.AmplifyClient.html +148 -13
- package/docs/enums/GraphQLClientAuthMode.html +64 -2
- package/docs/functions/internal.getIdentityServiceConfig.html +39 -1
- package/docs/hierarchy.html +42 -1
- package/docs/index.html +37 -2
- package/docs/interfaces/AuthenticationProvider.html +78 -5
- package/docs/interfaces/AuthenticationTokens.html +86 -7
- package/docs/interfaces/GraphQLClient.html +123 -12
- package/docs/interfaces/GraphQLClientOptions.html +92 -8
- package/docs/interfaces/SudoPlatformSignInCallback.html +68 -5
- package/docs/interfaces/SudoUserClient.html +431 -52
- package/docs/interfaces/internal.SudoUserOptions.html +91 -2
- package/docs/modules/internal.html +53 -1
- package/docs/modules.html +52 -1
- package/docs/types/IAMCredentials.html +65 -2
- package/docs/types/TokenProvider.html +33 -1
- package/docs/types/internal.Config.html +35 -1
- package/docs/types/internal.FederatedSignInConfig.html +34 -1
- package/docs/types/internal.IdentityServiceConfig.html +34 -1
- package/docs/variables/internal.Config.html +35 -1
- package/docs/variables/internal.FederatedSignInConfigCodec.html +34 -1
- package/docs/variables/internal.IdentityServiceConfigCodec.html +34 -1
- package/lib/user/error.js +8 -0
- package/lib/user/user-client.js +49 -33
- package/package.json +36 -60
- package/types/user/error.d.ts +6 -0
- package/types/user/user-client-interface.d.ts +12 -0
- package/types/user/user-client.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudoplatform/sudo-user",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.2.0",
|
|
4
4
|
"author": "Anonyome Labs, Inc.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -52,58 +52,64 @@
|
|
|
52
52
|
"@aws-sdk/client-cognito-identity-provider": "3.632.0",
|
|
53
53
|
"@aws-sdk/credential-providers": "^3.929.0",
|
|
54
54
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
55
|
-
"@sudoplatform/sudo-web-crypto-provider": "^12.0.
|
|
55
|
+
"@sudoplatform/sudo-web-crypto-provider": "^12.0.2",
|
|
56
56
|
"@types/zen-observable": "^0.8.7",
|
|
57
57
|
"amazon-cognito-auth-js": "^1.3.3",
|
|
58
|
-
"aws-amplify": "^6.
|
|
58
|
+
"aws-amplify": "^6.20.0",
|
|
59
59
|
"fp-ts": "^2.16.11",
|
|
60
|
-
"graphql": "^16.
|
|
60
|
+
"graphql": "^16.14.2",
|
|
61
61
|
"io-ts": "^2.2.22",
|
|
62
|
-
"jose": "^6.
|
|
63
|
-
"lodash": "^4.
|
|
62
|
+
"jose": "^6.2.10",
|
|
63
|
+
"lodash": "^4.18.1",
|
|
64
64
|
"monocle-ts": "^2.3.13",
|
|
65
65
|
"newtype-ts": "^0.3.5",
|
|
66
66
|
"tslib": "^2.8.1",
|
|
67
|
-
"uuid": "^11.1.
|
|
67
|
+
"uuid": "^11.1.1",
|
|
68
68
|
"zen-observable": "^0.10.0"
|
|
69
69
|
},
|
|
70
70
|
"resolutions": {
|
|
71
71
|
"tmp": "^0.2.3",
|
|
72
72
|
"graphql": "^16.12.0",
|
|
73
73
|
"@smithy/config-resolver": "^4.4.6",
|
|
74
|
-
"fast-xml-parser": "^5.
|
|
74
|
+
"fast-xml-parser": "^5.10.1",
|
|
75
|
+
"uuid": "^11.1.1",
|
|
76
|
+
"lodash": "^4.18.1",
|
|
77
|
+
"shell-quote": "^1.10.0",
|
|
78
|
+
"ip-address": "^10.4.0",
|
|
79
|
+
"tar": "^7.5.22",
|
|
80
|
+
"js-yaml": "^5.2.3"
|
|
75
81
|
},
|
|
76
82
|
"devDependencies": {
|
|
77
|
-
"@graphql-codegen/add": "^6.0.
|
|
78
|
-
"@graphql-codegen/cli": "^6.
|
|
79
|
-
"@graphql-codegen/plugin-helpers": "^6.
|
|
80
|
-
"@graphql-codegen/typed-document-node": "^6.1.
|
|
81
|
-
"@graphql-codegen/typescript": "^5.0.
|
|
82
|
-
"@graphql-codegen/typescript-operations": "^5.0
|
|
83
|
-
"@sudoplatform/sudo-common": "^12.2.
|
|
83
|
+
"@graphql-codegen/add": "^6.0.1",
|
|
84
|
+
"@graphql-codegen/cli": "^6.3.1",
|
|
85
|
+
"@graphql-codegen/plugin-helpers": "^6.3.0",
|
|
86
|
+
"@graphql-codegen/typed-document-node": "^6.1.8",
|
|
87
|
+
"@graphql-codegen/typescript": "^5.0.10",
|
|
88
|
+
"@graphql-codegen/typescript-operations": "^5.1.0",
|
|
89
|
+
"@sudoplatform/sudo-common": "^12.2.9",
|
|
84
90
|
"@types/amazon-cognito-auth-js": "^1.3.4",
|
|
85
91
|
"@types/firefox-webext-browser": "^143.0.0",
|
|
86
92
|
"@types/jest": "^29.5.14",
|
|
87
|
-
"@types/lodash": "^4.17.
|
|
88
|
-
"@types/node": "^22.
|
|
89
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
90
|
-
"@typescript-eslint/parser": "^8.
|
|
91
|
-
"concurrently": "^9.2.
|
|
93
|
+
"@types/lodash": "^4.17.25",
|
|
94
|
+
"@types/node": "^22.20.1",
|
|
95
|
+
"@typescript-eslint/eslint-plugin": "^8.68.0",
|
|
96
|
+
"@typescript-eslint/parser": "^8.68.0",
|
|
97
|
+
"concurrently": "^9.2.4",
|
|
92
98
|
"eslint": "^8.57.1",
|
|
93
99
|
"eslint-config-prettier": "^9.1.2",
|
|
94
100
|
"eslint-plugin-import": "^2.32.0",
|
|
95
|
-
"eslint-plugin-prettier": "^5.5.
|
|
101
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
96
102
|
"eslint-plugin-tree-shaking": "^1.12.2",
|
|
97
103
|
"husky": "^9.1.7",
|
|
98
104
|
"isomorphic-fetch": "^3.0.0",
|
|
99
105
|
"jest": "^29.7.0",
|
|
100
|
-
"jest-environment-jsdom": "^30.
|
|
106
|
+
"jest-environment-jsdom": "^30.4.1",
|
|
101
107
|
"jest-environment-node": "^29.7.0",
|
|
102
|
-
"prettier": "^3.6
|
|
108
|
+
"prettier": "^3.9.6",
|
|
103
109
|
"subscriptions-transport-ws": "^0.11.0",
|
|
104
|
-
"ts-jest": "^29.4.
|
|
110
|
+
"ts-jest": "^29.4.12",
|
|
105
111
|
"ts-mockito": "^2.6.1",
|
|
106
|
-
"typedoc": "^0.28.
|
|
112
|
+
"typedoc": "^0.28.20",
|
|
107
113
|
"typescript": "^5.9.3",
|
|
108
114
|
"websocket": "^1.0.35"
|
|
109
115
|
},
|
|
@@ -114,42 +120,12 @@
|
|
|
114
120
|
"engines": {
|
|
115
121
|
"node": ">=22"
|
|
116
122
|
},
|
|
117
|
-
"packageManager": "yarn@4.
|
|
123
|
+
"packageManager": "yarn@4.18.0+sha512.fcb8716fe7cd0eece141ffc18b92193a9df9204c1ba83189c288835223fc0bbe64af473bab0d5e9927a7daeb5caf2bb07eb2787cc9338ca040ea125f2a1f2f7e",
|
|
118
124
|
"auditSuppressions": {
|
|
119
|
-
"
|
|
120
|
-
"until":
|
|
121
|
-
"untilISO": "2026-
|
|
122
|
-
"reason": "
|
|
123
|
-
},
|
|
124
|
-
"1113371": {
|
|
125
|
-
"until": 1772584573,
|
|
126
|
-
"untilISO": "2026-03-04T00:36:13Z",
|
|
127
|
-
"reason": "minimatch - transitive dependency, we dont use the vulnerable functionality and waiting for patch"
|
|
128
|
-
},
|
|
129
|
-
"1115538": {
|
|
130
|
-
"until": 1780015846,
|
|
131
|
-
"untilISO": "2026-05-29T00:50:46Z",
|
|
132
|
-
"reason": "handlebars transitive via ts-jest, no fix available"
|
|
133
|
-
},
|
|
134
|
-
"1115539": {
|
|
135
|
-
"until": 1780015846,
|
|
136
|
-
"untilISO": "2026-05-29T00:50:46Z",
|
|
137
|
-
"reason": "handlebars transitive via ts-jest, no fix available"
|
|
138
|
-
},
|
|
139
|
-
"1115544": {
|
|
140
|
-
"until": 1780015846,
|
|
141
|
-
"untilISO": "2026-05-29T00:50:46Z",
|
|
142
|
-
"reason": "handlebars transitive via ts-jest, no fix available"
|
|
143
|
-
},
|
|
144
|
-
"1115588": {
|
|
145
|
-
"until": 1780015846,
|
|
146
|
-
"untilISO": "2026-05-29T00:50:46Z",
|
|
147
|
-
"reason": "handlebars transitive via ts-jest, no fix available"
|
|
148
|
-
},
|
|
149
|
-
"1117066": {
|
|
150
|
-
"until": 1780015846,
|
|
151
|
-
"untilISO": "2026-05-29T00:50:46Z",
|
|
152
|
-
"reason": "immutable transitive via @ardatan/relay-compiler, pinned at 3.7.6"
|
|
125
|
+
"1120607": {
|
|
126
|
+
"until": 1791070134,
|
|
127
|
+
"untilISO": "2026-10-03T23:28:54Z",
|
|
128
|
+
"reason": "js-cookie transitive via amazon-cognito-auth-js (pinned ^2.1.4, no 2.x fix released) and @aws-amplify/core (pinned ^3.0.5); forcing 3.x globally risks breaking amazon-cognito-auth-js cookie API usage"
|
|
153
129
|
}
|
|
154
130
|
}
|
|
155
131
|
}
|
package/types/user/error.d.ts
CHANGED
|
@@ -7,6 +7,12 @@ declare class UserError extends Error {
|
|
|
7
7
|
export declare class AlreadyRegisteredError extends UserError {
|
|
8
8
|
constructor();
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Indicates the user associated with the client is already signed in.
|
|
12
|
+
*/
|
|
13
|
+
export declare class AlreadySignedInError extends UserError {
|
|
14
|
+
constructor();
|
|
15
|
+
}
|
|
10
16
|
/**
|
|
11
17
|
* Indicates the configuration related to Identity Service is not found. This may indicate that Identity Service
|
|
12
18
|
* is not deployed into your runtime instance or the config file that
|
|
@@ -94,6 +94,18 @@ export interface SudoUserClient {
|
|
|
94
94
|
* @param name user name.
|
|
95
95
|
*/
|
|
96
96
|
setUserName(name: string): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Signs in as the specified user by assuming an ID token obtained
|
|
99
|
+
* externally, e.g. from another Sudo Platform client acting on this
|
|
100
|
+
* user's behalf. Unlike the other sign in methods, no access or refresh
|
|
101
|
+
* token is cached, so the assumed ID token cannot be refreshed once it
|
|
102
|
+
* expires and *isSignedIn* will return *false*.
|
|
103
|
+
*
|
|
104
|
+
* @param username user name of the user being signed in as.
|
|
105
|
+
* @param idToken ID token to assume.
|
|
106
|
+
* @throws {@link AlreadySignedInError} if the client is already signed in.
|
|
107
|
+
*/
|
|
108
|
+
signInViaAssumption(username: string, idToken: string): Promise<void>;
|
|
97
109
|
/**
|
|
98
110
|
* Returns the subject of the user associated with this client.
|
|
99
111
|
* Note: This is an internal method used by other Sudo platform SDKs.
|
|
@@ -37,6 +37,7 @@ export declare class DefaultSudoUserClient implements SudoUserClient {
|
|
|
37
37
|
getRefreshTokenExpiry(): Promise<Date | undefined>;
|
|
38
38
|
getUserName(): Promise<string | undefined>;
|
|
39
39
|
setUserName(name: string): Promise<void>;
|
|
40
|
+
signInViaAssumption(username: string, idToken: string): Promise<void>;
|
|
40
41
|
getUserClaim(name: string): Promise<any | undefined>;
|
|
41
42
|
getSubject(): Promise<string | undefined>;
|
|
42
43
|
isSignedIn(): Promise<boolean>;
|