@sudoplatform/sudo-user 15.1.4 → 16.0.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.
Files changed (69) hide show
  1. package/cjs/client/amplifyClient.js +226 -0
  2. package/cjs/client/amplifyClient.js.map +1 -0
  3. package/cjs/client/apiClient.js +50 -59
  4. package/cjs/client/apiClient.js.map +1 -1
  5. package/cjs/client/graphqlClient.js +10 -0
  6. package/cjs/client/graphqlClient.js.map +1 -0
  7. package/cjs/client/transformer/ErrorTransformer.js +1 -2
  8. package/cjs/client/transformer/ErrorTransformer.js.map +1 -1
  9. package/cjs/core/sdk-config.js +2 -2
  10. package/cjs/core/sdk-config.js.map +1 -1
  11. package/cjs/index.js +3 -1
  12. package/cjs/index.js.map +1 -1
  13. package/cjs/sdk.js +3 -0
  14. package/cjs/sdk.js.map +1 -1
  15. package/cjs/utils/parse-token.js +1 -2
  16. package/cjs/utils/parse-token.js.map +1 -1
  17. package/cjs/utils/resolvable-promise.js +1 -2
  18. package/cjs/utils/resolvable-promise.js.map +1 -1
  19. package/cjs/utils/sign-options-builder.js +1 -2
  20. package/cjs/utils/sign-options-builder.js.map +1 -1
  21. package/docs/assets/hierarchy.js +1 -1
  22. package/docs/assets/highlight.css +56 -0
  23. package/docs/assets/main.js +5 -5
  24. package/docs/assets/navigation.js +1 -1
  25. package/docs/assets/search.js +1 -1
  26. package/docs/assets/style.css +251 -228
  27. package/docs/classes/AlreadyRegisteredError.html +33 -12
  28. package/docs/classes/DefaultSudoUserClient.html +75 -75
  29. package/docs/classes/IdentityServiceConfigNotFoundError.html +33 -12
  30. package/docs/classes/LocalAuthenticationProvider.html +12 -12
  31. package/docs/classes/TESTAuthenticationProvider.html +13 -13
  32. package/docs/classes/internal.AmplifyClient.html +21 -0
  33. package/docs/enums/GraphQLClientAuthMode.html +4 -0
  34. package/docs/functions/internal.getIdentityServiceConfig.html +1 -1
  35. package/docs/hierarchy.html +1 -1
  36. package/docs/index.html +5 -5
  37. package/docs/interfaces/AuthenticationProvider.html +5 -5
  38. package/docs/interfaces/AuthenticationTokens.html +10 -10
  39. package/docs/interfaces/GraphQLClient.html +20 -0
  40. package/docs/interfaces/GraphQLClientOptions.html +13 -0
  41. package/docs/interfaces/SudoUserClient.html +66 -66
  42. package/docs/interfaces/internal.SudoUserOptions.html +9 -9
  43. package/docs/modules/internal.html +1 -1
  44. package/docs/modules.html +1 -1
  45. package/docs/types/IAMCredentials.html +4 -0
  46. package/docs/types/TokenProvider.html +1 -0
  47. package/docs/types/internal.Config.html +1 -1
  48. package/docs/types/internal.FederatedSignInConfig.html +1 -1
  49. package/docs/types/internal.IdentityServiceConfig.html +1 -1
  50. package/docs/variables/internal.Config.html +1 -0
  51. package/docs/variables/internal.FederatedSignInConfigCodec.html +1 -1
  52. package/docs/variables/internal.IdentityServiceConfigCodec.html +1 -1
  53. package/lib/client/amplifyClient.js +222 -0
  54. package/lib/client/amplifyClient.js.map +1 -0
  55. package/lib/client/apiClient.js +50 -59
  56. package/lib/client/apiClient.js.map +1 -1
  57. package/lib/client/graphqlClient.js +7 -0
  58. package/lib/client/graphqlClient.js.map +1 -0
  59. package/lib/index.js +1 -0
  60. package/lib/index.js.map +1 -1
  61. package/lib/sdk.js +1 -0
  62. package/lib/sdk.js.map +1 -1
  63. package/package.json +54 -37
  64. package/types/client/amplifyClient.d.ts +60 -0
  65. package/types/client/graphqlClient.d.ts +84 -0
  66. package/types/gen/graphql-types.d.ts +4 -12
  67. package/types/index.d.ts +1 -0
  68. package/types/sdk.d.ts +1 -0
  69. package/docs/variables/internal.Config-1.html +0 -1
@@ -3,10 +3,10 @@
3
3
  *
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { AWSAppSyncClient, AUTH_TYPE } from 'aws-appsync';
7
6
  import { DeregisterDocument, RegisterFederatedIdDocument, GlobalSignOutDocument, ResetDocument, } from '../gen/graphql-types';
8
7
  import { NotSignedInError, FatalError, UnknownGraphQLError, } from '@sudoplatform/sudo-common';
9
8
  import { graphQLErrorsToClientError } from './transformer/ErrorTransformer';
9
+ import { AmplifyClient } from './amplifyClient';
10
10
  /**
11
11
  * AppSync wrapper to use to invoke Identity Service APIs.
12
12
  */
@@ -16,14 +16,10 @@ export class ApiClient {
16
16
  this.graphqlUrl = graphqlUrl;
17
17
  this.sudoUserClient = sudoUserClient;
18
18
  this.logger = logger;
19
- this.client = new AWSAppSyncClient({
20
- url: graphqlUrl,
19
+ this.client = new AmplifyClient({
20
+ graphqlUrl,
21
21
  region: region,
22
- auth: {
23
- type: AUTH_TYPE.AMAZON_COGNITO_USER_POOLS,
24
- jwtToken: async () => await sudoUserClient.getLatestAuthToken(),
25
- },
26
- disableOffline: true,
22
+ tokenProvider: async () => await sudoUserClient.getLatestAuthToken(),
27
23
  });
28
24
  }
29
25
  async resetUserData() {
@@ -34,25 +30,25 @@ export class ApiClient {
34
30
  try {
35
31
  result = await this.client.mutate({
36
32
  mutation: ResetDocument,
37
- fetchPolicy: 'no-cache',
38
33
  });
39
34
  }
40
35
  catch (err) {
41
- const apolloError = err;
42
- const error = apolloError.graphQLErrors?.[0];
43
- if (error) {
44
- throw graphQLErrorsToClientError(error, this.logger);
45
- }
46
- else {
47
- throw new UnknownGraphQLError(err);
36
+ if ('graphQLErrors' in err) {
37
+ const error = err.graphQLErrors?.[0];
38
+ if (error) {
39
+ throw graphQLErrorsToClientError(error, this.logger);
40
+ }
41
+ else {
42
+ throw new UnknownGraphQLError(err);
43
+ }
48
44
  }
49
45
  }
50
- const error = result.errors?.[0];
46
+ const error = result?.errors?.[0];
51
47
  if (error) {
52
48
  throw graphQLErrorsToClientError(error, this.logger);
53
49
  }
54
- if (result.data) {
55
- return { success: result.data.reset?.success ? true : false };
50
+ if (result?.data) {
51
+ return { success: !!result.data.reset?.success };
56
52
  }
57
53
  else {
58
54
  throw new FatalError('reset did not return any result.');
@@ -66,25 +62,25 @@ export class ApiClient {
66
62
  try {
67
63
  result = await this.client.mutate({
68
64
  mutation: DeregisterDocument,
69
- fetchPolicy: 'no-cache',
70
65
  });
71
66
  }
72
67
  catch (err) {
73
- const apolloError = err;
74
- const error = apolloError.graphQLErrors?.[0];
75
- if (error) {
76
- throw graphQLErrorsToClientError(error, this.logger);
77
- }
78
- else {
79
- throw new UnknownGraphQLError(err);
68
+ if ('graphQLErrors' in err) {
69
+ const error = err.graphQLErrors?.[0];
70
+ if (error) {
71
+ throw graphQLErrorsToClientError(error, this.logger);
72
+ }
73
+ else {
74
+ throw new UnknownGraphQLError(err);
75
+ }
80
76
  }
81
77
  }
82
- const error = result.errors?.[0];
78
+ const error = result?.errors?.[0];
83
79
  if (error) {
84
80
  throw graphQLErrorsToClientError(error, this.logger);
85
81
  }
86
- if (result.data) {
87
- return { success: result.data.deregister?.success ? true : false };
82
+ if (result?.data) {
83
+ return { success: !!result?.data.deregister?.success };
88
84
  }
89
85
  else {
90
86
  throw new FatalError('deregister did not return any result.');
@@ -98,25 +94,25 @@ export class ApiClient {
98
94
  try {
99
95
  result = await this.client.mutate({
100
96
  mutation: GlobalSignOutDocument,
101
- fetchPolicy: 'no-cache',
102
97
  });
103
98
  }
104
99
  catch (err) {
105
- const apolloError = err;
106
- const error = apolloError.graphQLErrors?.[0];
107
- if (error) {
108
- throw graphQLErrorsToClientError(error, this.logger);
109
- }
110
- else {
111
- throw new UnknownGraphQLError(err);
100
+ if ('graphQLErrors' in err) {
101
+ const error = err.graphQLErrors?.[0];
102
+ if (error) {
103
+ throw graphQLErrorsToClientError(error, this.logger);
104
+ }
105
+ else {
106
+ throw new UnknownGraphQLError(err);
107
+ }
112
108
  }
113
109
  }
114
- const error = result.errors?.[0];
110
+ const error = result?.errors?.[0];
115
111
  if (error) {
116
112
  throw graphQLErrorsToClientError(error, this.logger);
117
113
  }
118
- if (result.data) {
119
- return { success: result.data.globalSignOut?.success ? true : false };
114
+ if (result?.data) {
115
+ return { success: result?.data.globalSignOut?.success ?? false };
120
116
  }
121
117
  else {
122
118
  throw new FatalError('globalSignOut did not return any result.');
@@ -128,24 +124,24 @@ export class ApiClient {
128
124
  result = await this.client.mutate({
129
125
  mutation: RegisterFederatedIdDocument,
130
126
  variables: { input },
131
- fetchPolicy: 'no-cache',
132
127
  });
133
128
  }
134
129
  catch (err) {
135
- const apolloError = err;
136
- const error = apolloError.graphQLErrors?.[0];
137
- if (error) {
138
- throw graphQLErrorsToClientError(error, this.logger);
139
- }
140
- else {
141
- throw new UnknownGraphQLError(err);
130
+ if ('graphQLErrors' in err) {
131
+ const error = err.graphQLErrors?.[0];
132
+ if (error) {
133
+ throw graphQLErrorsToClientError(error, this.logger);
134
+ }
135
+ else {
136
+ throw new UnknownGraphQLError(err);
137
+ }
142
138
  }
143
139
  }
144
- const error = result.errors?.[0];
140
+ const error = result?.errors?.[0];
145
141
  if (error) {
146
142
  throw graphQLErrorsToClientError(error, this.logger);
147
143
  }
148
- const identityId = result.data?.registerFederatedId?.identityId;
144
+ const identityId = result?.data?.registerFederatedId?.identityId;
149
145
  if (identityId) {
150
146
  return {
151
147
  identityId,
@@ -156,15 +152,10 @@ export class ApiClient {
156
152
  }
157
153
  }
158
154
  async reset() {
159
- await this.client.clearStore();
160
- this.client = new AWSAppSyncClient({
161
- url: this.graphqlUrl,
155
+ this.client = new AmplifyClient({
156
+ graphqlUrl: this.graphqlUrl,
162
157
  region: this.region,
163
- auth: {
164
- type: AUTH_TYPE.AMAZON_COGNITO_USER_POOLS,
165
- jwtToken: async () => await this.sudoUserClient.getLatestAuthToken(),
166
- },
167
- disableOffline: true,
158
+ tokenProvider: async () => await this.sudoUserClient.getLatestAuthToken(),
168
159
  });
169
160
  }
170
161
  }
@@ -1 +1 @@
1
- {"version":3,"file":"apiClient.js","sourceRoot":"","sources":["../../src/client/apiClient.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EAEL,kBAAkB,EAElB,2BAA2B,EAG3B,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] = "AWS_IAM";
5
+ GraphQLClientAuthMode["ApiKey"] = "API_KEY";
6
+ })(GraphQLClientAuthMode || (GraphQLClientAuthMode = {}));
7
+ //# sourceMappingURL=graphqlClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphqlClient.js","sourceRoot":"","sources":["../../src/client/graphqlClient.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,yDAAgC,CAAA;IAChC,wCAAe,CAAA;IACf,2CAAkB,CAAA;AACpB,CAAC,EAJW,qBAAqB,KAArB,qBAAqB,QAIhC"}
package/lib/index.js CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
  /* Everything exported here is considered public API and is documented by typedoc. */
7
7
  export { DefaultSudoUserClient } from './user/user-client';
8
+ export { GraphQLClientAuthMode, } from './client/graphqlClient';
8
9
  export * from './user/user-client-interface';
9
10
  export { TESTAuthenticationProvider, LocalAuthenticationProvider, } from './user/auth-provider';
10
11
  export * from './user/error';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qFAAqF;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,cAAc,8BAA8B,CAAA;AAC5C,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,GAE5B,MAAM,sBAAsB,CAAA;AAE7B,cAAc,cAAc,CAAA;AAE5B;;;GAGG;AACH,OAAO,KAAK,QAAQ,MAAM,OAAO,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qFAAqF;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAEL,qBAAqB,GAItB,MAAM,wBAAwB,CAAA;AAE/B,cAAc,8BAA8B,CAAA;AAC5C,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,GAE5B,MAAM,sBAAsB,CAAA;AAE7B,cAAc,cAAc,CAAA;AAE5B;;;GAGG;AACH,OAAO,KAAK,QAAQ,MAAM,OAAO,CAAA"}
package/lib/sdk.js CHANGED
@@ -8,4 +8,5 @@
8
8
  * SDKs.
9
9
  */
10
10
  export * from './core/sdk-config';
11
+ export { AmplifyClient } from './client/amplifyClient';
11
12
  //# sourceMappingURL=sdk.js.map
package/lib/sdk.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,cAAc,mBAAmB,CAAA"}
1
+ {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,cAAc,mBAAmB,CAAA;AAGjC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudoplatform/sudo-user",
3
- "version": "15.1.4",
3
+ "version": "16.0.1",
4
4
  "author": "Anonyome Labs, Inc.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -47,68 +47,85 @@
47
47
  "./lib/runtimes/node/node-crypto.js": "./lib/runtimes/browser/browser-crypto.js"
48
48
  },
49
49
  "dependencies": {
50
- "@aws-sdk/client-cognito-identity-provider": "<3.633.0",
50
+ "@aws-sdk/client-cognito-identity-provider": "3.632.0",
51
+ "@aws-sdk/credential-providers": "^3.929.0",
51
52
  "@graphql-typed-document-node/core": "^3.2.0",
52
- "@sudoplatform/sudo-web-crypto-provider": "^11.0.1",
53
+ "@sudoplatform/sudo-web-crypto-provider": "^12.0.0",
54
+ "@types/zen-observable": "^0.8.7",
53
55
  "amazon-cognito-auth-js": "^1.3.3",
54
- "apollo-cache-inmemory": "^1.6.6",
55
- "aws-appsync": "^4.1.10",
56
- "fp-ts": "^2.16.9",
57
- "graphql": "^15.9.0",
56
+ "aws-amplify": "^6.15.8",
57
+ "fp-ts": "^2.16.11",
58
+ "graphql": "^16.12.0",
58
59
  "io-ts": "^2.2.22",
59
- "jws": "^4.0.0",
60
+ "jws": "^4.0.1",
60
61
  "lodash": "^4.17.21",
61
62
  "monocle-ts": "^2.3.13",
62
63
  "newtype-ts": "^0.3.5",
63
64
  "tslib": "^2.8.1",
64
- "uuid": "^11.0.3"
65
+ "uuid": "^11.1.0",
66
+ "zen-observable": "^0.10.0"
65
67
  },
66
68
  "resolutions": {
67
- "apollo-cache-inmemory": "^1.6.6"
69
+ "tmp": "^0.2.3",
70
+ "graphql": "^16.12.0"
68
71
  },
69
72
  "devDependencies": {
70
- "@graphql-codegen/add": "^5.0.3",
71
- "@graphql-codegen/cli": "^5.0.3",
72
- "@graphql-codegen/plugin-helpers": "^5.1.0",
73
- "@graphql-codegen/typed-document-node": "^5.0.12",
74
- "@graphql-codegen/typescript": "^4.1.2",
75
- "@graphql-codegen/typescript-operations": "^4.4.0",
76
- "@graphql-typed-document-node/apollo-client-2": "^1.0.0",
77
- "@sudoplatform/sudo-common": "^10.0.0",
73
+ "@graphql-codegen/add": "^6.0.0",
74
+ "@graphql-codegen/cli": "^6.0.1",
75
+ "@graphql-codegen/plugin-helpers": "^6.0.0",
76
+ "@graphql-codegen/typed-document-node": "^6.1.4",
77
+ "@graphql-codegen/typescript": "^5.0.6",
78
+ "@graphql-codegen/typescript-operations": "^5.0.6",
79
+ "@sudoplatform/sudo-common": "^12.2.0",
78
80
  "@types/amazon-cognito-auth-js": "^1.3.4",
79
- "@types/firefox-webext-browser": "^120.0.4",
81
+ "@types/firefox-webext-browser": "^143.0.0",
80
82
  "@types/jest": "^29.5.14",
81
- "@types/jws": "^3.2.10",
82
- "@types/lodash": "^4.17.13",
83
- "@types/node": "^20.17.9",
84
- "@types/uuid": "^10.0.0",
85
- "@typescript-eslint/eslint-plugin": "^8.18.0",
86
- "@typescript-eslint/parser": "^8.18.0",
87
- "apollo-client": "^2.6.10",
88
- "concurrently": "^9.1.0",
83
+ "@types/jws": "^3.2.11",
84
+ "@types/lodash": "^4.17.21",
85
+ "@types/node": "^22.19.1",
86
+ "@typescript-eslint/eslint-plugin": "^8.46.3",
87
+ "@typescript-eslint/parser": "^8.46.3",
88
+ "concurrently": "^9.2.1",
89
89
  "eslint": "^8.57.1",
90
- "eslint-config-prettier": "^9.1.0",
91
- "eslint-plugin-import": "^2.31.0",
92
- "eslint-plugin-prettier": "^5.2.1",
90
+ "eslint-config-prettier": "^9.1.2",
91
+ "eslint-plugin-import": "^2.32.0",
92
+ "eslint-plugin-prettier": "^5.5.4",
93
93
  "eslint-plugin-tree-shaking": "^1.12.2",
94
94
  "husky": "^9.1.7",
95
95
  "isomorphic-fetch": "^3.0.0",
96
96
  "jest": "^29.7.0",
97
97
  "jest-environment-node": "^29.7.0",
98
- "prettier": "^3.4.2",
98
+ "prettier": "^3.6.2",
99
99
  "subscriptions-transport-ws": "^0.11.0",
100
- "ts-jest": "^29.2.5",
100
+ "ts-jest": "^29.4.6",
101
101
  "ts-mockito": "^2.6.1",
102
- "typedoc": "^0.27.4",
103
- "typescript": "~5.4.x",
102
+ "typedoc": "^0.28.15",
103
+ "typescript": "^5.9.3",
104
104
  "websocket": "^1.0.35"
105
105
  },
106
106
  "peerDependencies": {
107
- "@sudoplatform/sudo-common": "^10.0.0",
107
+ "@sudoplatform/sudo-common": "^12.2.0",
108
108
  "io-ts": "^2.2.22"
109
109
  },
110
110
  "engines": {
111
- "node": ">=20"
111
+ "node": ">=22"
112
112
  },
113
- "packageManager": "yarn@4.9.2+sha512.1fc009bc09d13cfd0e19efa44cbfc2b9cf6ca61482725eb35bbc5e257e093ebf4130db6dfe15d604ff4b79efd8e1e8e99b25fa7d0a6197c9f9826358d4d65c3c"
113
+ "auditSuppressions": {
114
+ "1109754": {
115
+ "until": 1765917031,
116
+ "untilISO": "2025-12-16T20:30:31Z",
117
+ "reason": "waiting for fix - js-xaml"
118
+ },
119
+ "1109801": {
120
+ "until": 1765917031,
121
+ "untilISO": "2025-12-16T20:30:31Z",
122
+ "reason": "waiting for fix - js-xaml"
123
+ },
124
+ "1109802": {
125
+ "until": 1765917031,
126
+ "untilISO": "2025-12-16T20:30:31Z",
127
+ "reason": "waiting for fix - js-xaml"
128
+ }
129
+ },
130
+ "packageManager": "yarn@4.11.0+sha512.4e54aeace9141df2f0177c266b05ec50dc044638157dae128c471ba65994ac802122d7ab35bcd9e81641228b7dcf24867d28e750e0bcae8a05277d600008ad54"
114
131
  }
@@ -0,0 +1,60 @@
1
+ import { GraphQLResult } from '@aws-amplify/api-graphql';
2
+ import { DocumentNode } from 'graphql';
3
+ import Observable from 'zen-observable';
4
+ import { GraphQLClient, GraphQLClientOptions } from './graphqlClient';
5
+ /**
6
+ * Convenience wrapper for GraphQL API using Amplify SDK.
7
+ */
8
+ export declare class AmplifyClient implements GraphQLClient {
9
+ private readonly options;
10
+ private client;
11
+ private readonly amplify;
12
+ constructor(options: GraphQLClientOptions);
13
+ private configure;
14
+ /**
15
+ * Performs GraphQL query operation.
16
+ *
17
+ * @param options query document, query variables and authentication
18
+ * token (optional). If authentication token is provided then the
19
+ * token provided via the constructor will be ignored.
20
+ * @returns query result.
21
+ */
22
+ query<T>(options: {
23
+ query: string | DocumentNode;
24
+ variables?: any;
25
+ authToken?: string;
26
+ }): Promise<GraphQLResult<T>>;
27
+ /**
28
+ * Performs GraphQL mutation operation.
29
+ *
30
+ * @param options mutation document, mutation variables and authentication
31
+ * token (optional). If authentication token is provided then the
32
+ * token provided via the constructor will be ignored.
33
+ * @returns mutation result.
34
+ */
35
+ mutate<T>(options: {
36
+ mutation: string | DocumentNode;
37
+ variables?: any;
38
+ authToken?: string;
39
+ }): Promise<GraphQLResult<T>>;
40
+ /**
41
+ * Performs GraphQL subscription operation.
42
+ *
43
+ * @param options subscription document, subscription variables and
44
+ * authentication token (optional). If authentication token is provided
45
+ * then the token provided via the constructor will be ignored.
46
+ * @returns observable for receiving subscription notifications.
47
+ */
48
+ subscribe<T>(options: {
49
+ subscription: string | DocumentNode;
50
+ variables?: any;
51
+ authToken?: string;
52
+ }): Promise<Observable<GraphQLResult<T>>>;
53
+ /**
54
+ * Resolves a TokenProvider into its actual token value.
55
+ * Handles both string tokens and async/sync function providers.
56
+ */
57
+ private resolveToken;
58
+ private transformAuthMode;
59
+ private resolveAuthOptions;
60
+ }
@@ -0,0 +1,84 @@
1
+ import { GraphQLResult } from '@aws-amplify/api-graphql';
2
+ import { DocumentNode } from 'graphql';
3
+ import Observable from 'zen-observable';
4
+ export declare enum GraphQLClientAuthMode {
5
+ OpenIDConnect = "OPENID_CONNECT",
6
+ IAM = "AWS_IAM",
7
+ ApiKey = "API_KEY"
8
+ }
9
+ export type TokenProvider = (() => string | Promise<string>) | string;
10
+ export type IAMCredentials = {
11
+ accessKeyId: string;
12
+ secretAccessKey: string;
13
+ sessionToken?: string;
14
+ };
15
+ export interface GraphQLClientOptions {
16
+ /**
17
+ * GraphQL URL i.e. AppSync URL in most cases.
18
+ */
19
+ graphqlUrl: string;
20
+ /**
21
+ * AWS Region to connect to.
22
+ */
23
+ region: string;
24
+ /**
25
+ * Authentication mode. If not provided, defaults to OPENID_CONNECT - the usual client mode
26
+ */
27
+ authMode?: GraphQLClientAuthMode;
28
+ /**
29
+ * A provider which resolves to the ID token for authentication.
30
+ */
31
+ tokenProvider?: TokenProvider;
32
+ /**
33
+ * If authMode is API_KEY, this is the API key to use for authentication.
34
+ */
35
+ apiKey?: string;
36
+ /**
37
+ * if authMode is IAM, override default credential values with these.
38
+ */
39
+ credentials?: IAMCredentials;
40
+ }
41
+ /**
42
+ * Interface for GraphQL client operations.
43
+ */
44
+ export interface GraphQLClient {
45
+ /**
46
+ * Performs GraphQL query operation.
47
+ *
48
+ * @param options query document, query variables and authentication
49
+ * token (optional). If authentication token is provided then the
50
+ * token provided via the constructor will be ignored.
51
+ * @returns query result.
52
+ */
53
+ query<T>(options: {
54
+ query: string | DocumentNode;
55
+ variables?: any;
56
+ idToken?: string;
57
+ }): Promise<GraphQLResult<T>>;
58
+ /**
59
+ * Performs GraphQL mutation operation.
60
+ *
61
+ * @param options mutation document, mutation variables and authentication
62
+ * token (optional). If authentication token is provided then the
63
+ * token provided via the constructor will be ignored.
64
+ * @returns mutation result.
65
+ */
66
+ mutate<T>(options: {
67
+ mutation: string | DocumentNode;
68
+ variables?: any;
69
+ idToken?: string;
70
+ }): Promise<GraphQLResult<T>>;
71
+ /**
72
+ * Performs GraphQL subscription operation.
73
+ *
74
+ * @param options subscription document, subscription variables and
75
+ * authentication token (optional). If authentication token is provided
76
+ * then the token provided via the constructor will be ignored.
77
+ * @returns observable for receiving subscription notifications.
78
+ */
79
+ subscribe<T>(options: {
80
+ subscription: string | DocumentNode;
81
+ variables?: any;
82
+ idToken?: string;
83
+ }): Promise<Observable<GraphQLResult<T>>>;
84
+ }
@@ -155,15 +155,7 @@ export type ResetMutation = {
155
155
  success: boolean;
156
156
  } | undefined;
157
157
  };
158
- export declare const DeregisterDocument: DocumentNode<DeregisterMutation, Exact<{
159
- [key: string]: never;
160
- }>>;
161
- export declare const GlobalSignOutDocument: DocumentNode<GlobalSignOutMutation, Exact<{
162
- [key: string]: never;
163
- }>>;
164
- export declare const RegisterFederatedIdDocument: DocumentNode<RegisterFederatedIdMutation, Exact<{
165
- input: RegisterFederatedIdInput;
166
- }>>;
167
- export declare const ResetDocument: DocumentNode<ResetMutation, Exact<{
168
- [key: string]: never;
169
- }>>;
158
+ export declare const DeregisterDocument: DocumentNode<DeregisterMutation, DeregisterMutationVariables>;
159
+ export declare const GlobalSignOutDocument: DocumentNode<GlobalSignOutMutation, GlobalSignOutMutationVariables>;
160
+ export declare const RegisterFederatedIdDocument: DocumentNode<RegisterFederatedIdMutation, RegisterFederatedIdMutationVariables>;
161
+ export declare const ResetDocument: DocumentNode<ResetMutation, ResetMutationVariables>;
package/types/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { DefaultSudoUserClient } from './user/user-client';
2
+ export { GraphQLClient, GraphQLClientAuthMode, GraphQLClientOptions, TokenProvider, IAMCredentials, } from './client/graphqlClient';
2
3
  export * from './user/user-client-interface';
3
4
  export { TESTAuthenticationProvider, LocalAuthenticationProvider, AuthenticationProvider, } from './user/auth-provider';
4
5
  export * from './user/error';
package/types/sdk.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './core/sdk-config';
2
2
  export { SudoUserOptions } from './user/user-client';
3
+ export { AmplifyClient } from './client/amplifyClient';
@@ -1 +0,0 @@
1
- <!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Config | @sudoplatform/sudo-user</title><meta name="description" content="Documentation for @sudoplatform/sudo-user"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@sudoplatform/sudo-user</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@sudoplatform/sudo-user</a></li><li><a href="../modules/internal.html">internal</a></li><li><a href="internal.Config-1.html">Config</a></li></ul><h1>Variable Config<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">Config</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">IntersectionC</span><span class="tsd-signature-symbol">&lt;</span><br/>    <span class="tsd-signature-symbol">[</span><br/>        <span class="tsd-signature-type">TypeC</span><span class="tsd-signature-symbol">&lt;</span><br/>            <span class="tsd-signature-symbol">{</span><br/>                <span class="tsd-kind-property">identityService</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">IntersectionC</span><span class="tsd-signature-symbol">&lt;</span><br/>                    <span class="tsd-signature-symbol">[</span><br/>                        <span class="tsd-signature-type">TypeC</span><span class="tsd-signature-symbol">&lt;</span><br/>                            <span class="tsd-signature-symbol">{</span><br/>                                <span class="tsd-kind-property">apiUrl</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">StringC</span><span class="tsd-signature-symbol">;</span><br/>                                <span class="tsd-kind-property">bucket</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">StringC</span><span class="tsd-signature-symbol">;</span><br/>                                <span class="tsd-kind-property">clientId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">StringC</span><span class="tsd-signature-symbol">;</span><br/>                                <span class="tsd-kind-property">identityPoolId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">StringC</span><span class="tsd-signature-symbol">;</span><br/>                                <span class="tsd-kind-property">poolId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">StringC</span><span class="tsd-signature-symbol">;</span><br/>                                <span class="tsd-kind-property">region</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">StringC</span><span class="tsd-signature-symbol">;</span><br/>                                <span class="tsd-kind-property">registrationMethods</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">ArrayC</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">StringC</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">;</span><br/>                                <span class="tsd-kind-property">transientBucket</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">StringC</span><span class="tsd-signature-symbol">;</span><br/>                            <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/>                        <span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>                        <span class="tsd-signature-type">PartialC</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">refreshTokenLifetime</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">NumberC</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>                    <span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/>                <span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">;</span><br/>            <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/>        <span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>        <span class="tsd-signature-type">PartialC</span><span class="tsd-signature-symbol">&lt;</span><br/>            <span class="tsd-signature-symbol">{</span><br/>                <span class="tsd-kind-property">federatedSignIn</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">IntersectionC</span><span class="tsd-signature-symbol">&lt;</span><br/>                    <span class="tsd-signature-symbol">[</span><br/>                        <span class="tsd-signature-type">TypeC</span><span class="tsd-signature-symbol">&lt;</span><br/>                            <span class="tsd-signature-symbol">{</span><br/>                                <span class="tsd-kind-property">appClientId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">StringC</span><span class="tsd-signature-symbol">;</span><br/>                                <span class="tsd-kind-property">signInRedirectUri</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">StringC</span><span class="tsd-signature-symbol">;</span><br/>                                <span class="tsd-kind-property">signOutRedirectUri</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">StringC</span><span class="tsd-signature-symbol">;</span><br/>                                <span class="tsd-kind-property">webDomain</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">StringC</span><span class="tsd-signature-symbol">;</span><br/>                            <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/>                        <span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>                        <span class="tsd-signature-type">PartialC</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">identityProvider</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">StringC</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">refreshTokenLifetime</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">NumberC</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>                    <span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/>                <span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">;</span><br/>            <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/>        <span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/sudoplatform/sudo-user-js/blob/ba5f3ba00d14300161442314ed900735a425df63/src/core/sdk-config.ts#L54">src/core/sdk-config.ts:54</a></li><li>Defined in <a href="https://github.com/sudoplatform/sudo-user-js/blob/ba5f3ba00d14300161442314ed900735a425df63/src/core/sdk-config.ts#L65">src/core/sdk-config.ts:65</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@sudoplatform/sudo-user</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>