@sudoplatform/sudo-user 13.0.1 → 13.1.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.
Files changed (43) hide show
  1. package/cjs/client/apiClient.js +39 -18
  2. package/cjs/client/apiClient.js.map +1 -1
  3. package/cjs/client/transformer/ErrorTransformer.js +23 -0
  4. package/cjs/client/transformer/ErrorTransformer.js.map +1 -0
  5. package/cjs/gen/graphql-types.js +26 -1
  6. package/cjs/gen/graphql-types.js.map +1 -1
  7. package/cjs/user/user-client.js +8 -0
  8. package/cjs/user/user-client.js.map +1 -1
  9. package/docs/assets/main.js +3 -3
  10. package/docs/assets/search.js +1 -1
  11. package/docs/assets/style.css +450 -363
  12. package/docs/classes/AlreadyRegisteredError.html +78 -70
  13. package/docs/classes/DefaultSudoUserClient.html +329 -287
  14. package/docs/classes/IdentityServiceConfigNotFoundError.html +78 -70
  15. package/docs/classes/LocalAuthenticationProvider.html +59 -52
  16. package/docs/classes/TESTAuthenticationProvider.html +67 -60
  17. package/docs/functions/internal.getIdentityServiceConfig.html +32 -26
  18. package/docs/index.html +33 -45
  19. package/docs/interfaces/AuthenticationProvider.html +41 -35
  20. package/docs/interfaces/AuthenticationTokens.html +48 -42
  21. package/docs/interfaces/SudoUserClient.html +276 -239
  22. package/docs/modules/internal.html +37 -31
  23. package/docs/modules.html +29 -34
  24. package/docs/types/internal.Config.html +30 -24
  25. package/docs/types/internal.FederatedSignInConfig.html +30 -24
  26. package/docs/types/internal.IdentityServiceConfig.html +30 -24
  27. package/docs/variables/internal.Config-1.html +30 -24
  28. package/docs/variables/internal.FederatedSignInConfigCodec.html +30 -24
  29. package/docs/variables/internal.IdentityServiceConfigCodec.html +30 -24
  30. package/lib/client/apiClient.js +41 -20
  31. package/lib/client/apiClient.js.map +1 -1
  32. package/lib/client/transformer/ErrorTransformer.js +19 -0
  33. package/lib/client/transformer/ErrorTransformer.js.map +1 -0
  34. package/lib/gen/graphql-types.js +25 -0
  35. package/lib/gen/graphql-types.js.map +1 -1
  36. package/lib/user/user-client.js +8 -0
  37. package/lib/user/user-client.js.map +1 -1
  38. package/package.json +16 -25
  39. package/types/client/apiClient.d.ts +3 -1
  40. package/types/client/transformer/ErrorTransformer.d.ts +2 -0
  41. package/types/gen/graphql-types.d.ts +88 -20
  42. package/types/user/user-client-interface.d.ts +5 -0
  43. package/types/user/user-client.d.ts +1 -0
@@ -12,53 +12,108 @@ export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
12
12
  export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
13
13
  [SubKey in K]: Maybe<T[SubKey]>;
14
14
  };
15
+ export type MakeEmpty<T extends {
16
+ [key: string]: unknown;
17
+ }, K extends keyof T> = {
18
+ [_ in K]?: never;
19
+ };
20
+ export type Incremental<T> = T | {
21
+ [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never;
22
+ };
15
23
  /** All built-in and custom scalars, mapped to their actual values */
16
24
  export type Scalars = {
17
- ID: string;
18
- String: string;
19
- Boolean: boolean;
20
- Int: number;
21
- Float: number;
22
- AWSDate: any;
23
- AWSDateTime: any;
24
- AWSEmail: any;
25
- AWSIPAddress: any;
26
- AWSJSON: unknown;
27
- AWSPhone: any;
28
- AWSTime: any;
29
- AWSTimestamp: any;
30
- AWSURL: any;
25
+ ID: {
26
+ input: string | number;
27
+ output: string;
28
+ };
29
+ String: {
30
+ input: string;
31
+ output: string;
32
+ };
33
+ Boolean: {
34
+ input: boolean;
35
+ output: boolean;
36
+ };
37
+ Int: {
38
+ input: number;
39
+ output: number;
40
+ };
41
+ Float: {
42
+ input: number;
43
+ output: number;
44
+ };
45
+ AWSDate: {
46
+ input: any;
47
+ output: any;
48
+ };
49
+ AWSDateTime: {
50
+ input: any;
51
+ output: any;
52
+ };
53
+ AWSEmail: {
54
+ input: any;
55
+ output: any;
56
+ };
57
+ AWSIPAddress: {
58
+ input: any;
59
+ output: any;
60
+ };
61
+ AWSJSON: {
62
+ input: unknown;
63
+ output: unknown;
64
+ };
65
+ AWSPhone: {
66
+ input: any;
67
+ output: any;
68
+ };
69
+ AWSTime: {
70
+ input: any;
71
+ output: any;
72
+ };
73
+ AWSTimestamp: {
74
+ input: any;
75
+ output: any;
76
+ };
77
+ AWSURL: {
78
+ input: any;
79
+ output: any;
80
+ };
81
+ };
82
+ export type ApiResult = {
83
+ __typename?: 'ApiResult';
84
+ success: Scalars['Boolean']['output'];
31
85
  };
32
86
  export type Deregister = {
33
87
  __typename?: 'Deregister';
34
- success: Scalars['Boolean'];
88
+ success: Scalars['Boolean']['output'];
35
89
  };
36
90
  export type FederatedId = {
37
91
  __typename?: 'FederatedId';
38
- identityId: Scalars['String'];
92
+ identityId: Scalars['String']['output'];
39
93
  };
40
94
  export type GlobalSignOut = {
41
95
  __typename?: 'GlobalSignOut';
42
- success: Scalars['Boolean'];
96
+ success: Scalars['Boolean']['output'];
43
97
  };
44
98
  export type Mutation = {
45
99
  __typename?: 'Mutation';
46
100
  deregister?: Maybe<Deregister>;
47
101
  globalSignOut?: Maybe<GlobalSignOut>;
48
102
  registerFederatedId?: Maybe<FederatedId>;
103
+ reset?: Maybe<ApiResult>;
49
104
  };
50
105
  export type MutationRegisterFederatedIdArgs = {
51
106
  input?: InputMaybe<RegisterFederatedIdInput>;
52
107
  };
53
108
  export type Query = {
54
109
  __typename?: 'Query';
55
- notImplemented?: Maybe<Scalars['Boolean']>;
110
+ notImplemented?: Maybe<Scalars['Boolean']['output']>;
56
111
  };
57
112
  export type QueryNotImplementedArgs = {
58
- dummy: Scalars['String'];
113
+ dummy: Scalars['String']['input'];
59
114
  };
60
115
  export type RegisterFederatedIdInput = {
61
- idToken: Scalars['String'];
116
+ idToken: Scalars['String']['input'];
62
117
  };
63
118
  export type DeregisterMutationVariables = Exact<{
64
119
  [key: string]: never;
@@ -90,6 +145,16 @@ export type RegisterFederatedIdMutation = {
90
145
  identityId: string;
91
146
  } | undefined;
92
147
  };
148
+ export type ResetMutationVariables = Exact<{
149
+ [key: string]: never;
150
+ }>;
151
+ export type ResetMutation = {
152
+ __typename?: 'Mutation';
153
+ reset?: {
154
+ __typename?: 'ApiResult';
155
+ success: boolean;
156
+ } | undefined;
157
+ };
93
158
  export declare const DeregisterDocument: DocumentNode<DeregisterMutation, Exact<{
94
159
  [key: string]: never;
95
160
  }>>;
@@ -99,3 +164,6 @@ export declare const GlobalSignOutDocument: DocumentNode<GlobalSignOutMutation,
99
164
  export declare const RegisterFederatedIdDocument: DocumentNode<RegisterFederatedIdMutation, Exact<{
100
165
  input: RegisterFederatedIdInput;
101
166
  }>>;
167
+ export declare const ResetDocument: DocumentNode<ResetMutation, Exact<{
168
+ [key: string]: never;
169
+ }>>;
@@ -161,6 +161,11 @@ export interface SudoUserClient {
161
161
  * Resets internal state and clears any cached data.
162
162
  */
163
163
  reset(): void;
164
+ /**
165
+ * Removes all data owned by the signed-in user in Sudo Platform Services
166
+ * without deregistering the user
167
+ */
168
+ resetUserData(): Promise<void>;
164
169
  /**
165
170
  * De-registers the user associated with this client. The user must
166
171
  * be signed in.
@@ -52,6 +52,7 @@ export declare class DefaultSudoUserClient implements SudoUserClient {
52
52
  clearAuthenticationTokens(): Promise<void>;
53
53
  presentSignOutUI(): void;
54
54
  reset(): void;
55
+ resetUserData(): Promise<void>;
55
56
  private getTokenClaim;
56
57
  /**
57
58
  * Store the authentication tokens and user id of the signed in user. This function