@clicktap/state 0.16.3 → 0.16.5
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/__mocks__/nanoid.d.ts +1 -1
- package/auth/AuthProvider.d.ts +102 -224
- package/auth/actors/authenticate.d.ts +1 -1
- package/auth/actors/refreshAccessToken.d.ts +1 -1
- package/auth/actors/unauthenticate.d.ts +1 -1
- package/auth/auth.d.ts +51 -112
- package/index.js +41 -34
- package/index.mjs +1980 -1637
- package/package.json +5 -2
- package/quote/CheckoutProvider.d.ts +103 -220
- package/quote/QuoteProvider.d.ts +175 -424
- package/quote/checkout/actions/resetCheckout.d.ts +23 -23
- package/quote/checkout/actions/updateQuote.d.ts +37 -37
- package/quote/checkout/actors/placeOrder.d.ts +1 -1
- package/quote/checkout/actors/submitStepData.d.ts +1 -1
- package/quote/checkout.d.ts +39 -78
- package/quote/quote/actions/addItems.d.ts +37 -37
- package/quote/quote/actions/refresh.d.ts +37 -37
- package/quote/quote/actions/removeItems.d.ts +37 -37
- package/quote/quote/actions/syncAccessToken.d.ts +12 -12
- package/quote/quote/actions/updateItems.d.ts +37 -37
- package/quote/quote/actors/addItems.d.ts +1 -1
- package/quote/quote/actors/refresh.d.ts +1 -1
- package/quote/quote/actors/removeItems.d.ts +1 -1
- package/quote/quote/actors/updateItems.d.ts +1 -1
- package/quote/quote.d.ts +68 -151
- package/toast/ToastProvider.d.ts +45 -58
- package/toast/timer.d.ts +12 -11
- package/toast/toast.d.ts +45 -58
package/__mocks__/nanoid.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export declare const nanoid: (_size?: number) => string;
|
|
|
2
2
|
export declare const customAlphabet: (_alphabet: string, _defaultSize?: number) => (_size?: number) => string;
|
|
3
3
|
declare const _default: {
|
|
4
4
|
nanoid: (_size?: number) => string;
|
|
5
|
-
customAlphabet: (_alphabet: string, _defaultSize?: number
|
|
5
|
+
customAlphabet: (_alphabet: string, _defaultSize?: number) => (_size?: number) => string;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
package/auth/AuthProvider.d.ts
CHANGED
|
@@ -5,119 +5,58 @@ export interface AuthContextType {
|
|
|
5
5
|
authActor: Actor<typeof authMachine>;
|
|
6
6
|
isLoggedIn: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare const AuthContext: import('react').Context<Actor<import('xstate').StateMachine<import('./types').AuthMachineContext, import('./types').RefreshTokenEvent | import('./types').LoginEvent | import('./types').LogoutEvent | import('./types').ClearErrorsEvent | import('./types').RestoreEvent | import('xstate').DoneActorEvent<import('./types').AuthenticateSuccessEvent> | import('xstate').DoneActorEvent<import('./types').RefreshTokenSuccessEvent>, {
|
|
9
|
-
[x: string]: import('xstate').
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
setAccessToken: {
|
|
49
|
-
type: "setAccessToken";
|
|
50
|
-
params: import('xstate').NonReducibleUnknown;
|
|
51
|
-
};
|
|
52
|
-
setIgnoreRefreshToken: {
|
|
53
|
-
type: "setIgnoreRefreshToken";
|
|
54
|
-
params: import('xstate').NonReducibleUnknown;
|
|
55
|
-
};
|
|
56
|
-
setUserContext: {
|
|
57
|
-
type: "setUserContext";
|
|
58
|
-
params: import('xstate').NonReducibleUnknown;
|
|
59
|
-
};
|
|
60
|
-
unsetRefreshToken: {
|
|
61
|
-
type: "unsetRefreshToken";
|
|
62
|
-
params: import('xstate').NonReducibleUnknown;
|
|
63
|
-
};
|
|
64
|
-
unsetUserContext: {
|
|
65
|
-
type: "unsetUserContext";
|
|
66
|
-
params: import('xstate').NonReducibleUnknown;
|
|
67
|
-
};
|
|
68
|
-
}>, never, "refresh", "refreshing" | "authenticating" | "loggedIn" | "loggedOut" | "unauthenticating" | "loggedInReady", string, {
|
|
8
|
+
export declare const AuthContext: import('react').Context<Actor<import('xstate').StateMachine<import('./types').AuthMachineContext, import('./types').RefreshTokenEvent | import('./types').LoginEvent | import('./types').LogoutEvent | import('./types').ClearErrorsEvent | import('./types').RestoreEvent | import('xstate').DoneActorEvent<import('./types').AuthenticateSuccessEvent, string> | import('xstate').DoneActorEvent<import('./types').RefreshTokenSuccessEvent, string>, {
|
|
9
|
+
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<import('./types').AuthenticateSuccessEvent, import('./actors').AuthenticateInput, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<import('./types').RefreshTokenSuccessEvent, import('./actors').RefreshTokenInput, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<import('./types').UnauthenticateSuccessEvent, import('./actors').UnauthenticateInput, import('xstate').EventObject>> | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
src: "authenticate";
|
|
12
|
+
logic: import('xstate').PromiseActorLogic<import('./types').AuthenticateSuccessEvent, import('./actors').AuthenticateInput, import('xstate').EventObject>;
|
|
13
|
+
id: string | undefined;
|
|
14
|
+
} | {
|
|
15
|
+
src: "refreshAccessToken";
|
|
16
|
+
logic: import('xstate').PromiseActorLogic<import('./types').RefreshTokenSuccessEvent, import('./actors').RefreshTokenInput, import('xstate').EventObject>;
|
|
17
|
+
id: string | undefined;
|
|
18
|
+
} | {
|
|
19
|
+
src: "unauthenticate";
|
|
20
|
+
logic: import('xstate').PromiseActorLogic<import('./types').UnauthenticateSuccessEvent, import('./actors').UnauthenticateInput, import('xstate').EventObject>;
|
|
21
|
+
id: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
type: "addError";
|
|
24
|
+
params: import('xstate').NonReducibleUnknown;
|
|
25
|
+
} | {
|
|
26
|
+
type: "clearErrors";
|
|
27
|
+
params: import('xstate').NonReducibleUnknown;
|
|
28
|
+
} | {
|
|
29
|
+
type: "notifyAuthenticated";
|
|
30
|
+
params: import('xstate').NonReducibleUnknown;
|
|
31
|
+
} | {
|
|
32
|
+
type: "setAccessToken";
|
|
33
|
+
params: import('xstate').NonReducibleUnknown;
|
|
34
|
+
} | {
|
|
35
|
+
type: "setIgnoreRefreshToken";
|
|
36
|
+
params: import('xstate').NonReducibleUnknown;
|
|
37
|
+
} | {
|
|
38
|
+
type: "setUserContext";
|
|
39
|
+
params: import('xstate').NonReducibleUnknown;
|
|
40
|
+
} | {
|
|
41
|
+
type: "unsetRefreshToken";
|
|
42
|
+
params: import('xstate').NonReducibleUnknown;
|
|
43
|
+
} | {
|
|
44
|
+
type: "unsetUserContext";
|
|
45
|
+
params: import('xstate').NonReducibleUnknown;
|
|
46
|
+
}, never, "refresh", "refreshing" | "authenticating" | "loggedIn" | "loggedOut" | "unauthenticating" | "loggedInReady", string, {
|
|
69
47
|
initialContext: Partial<import('./types').AuthMachineContext>;
|
|
70
|
-
initialState?: string
|
|
71
|
-
}, import('xstate').NonReducibleUnknown, import('./types').AuthenticatedEmittedEvent, import('xstate').MetaObject,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
unauthenticate: {
|
|
83
|
-
src: "unauthenticate";
|
|
84
|
-
logic: import('xstate').PromiseActorLogic<import('./types').UnauthenticateSuccessEvent, import('./actors').UnauthenticateInput>;
|
|
85
|
-
id: string | undefined;
|
|
86
|
-
};
|
|
87
|
-
}>, import('xstate').Values<{
|
|
88
|
-
addError: {
|
|
89
|
-
type: "addError";
|
|
90
|
-
params: import('xstate').NonReducibleUnknown;
|
|
91
|
-
};
|
|
92
|
-
clearErrors: {
|
|
93
|
-
type: "clearErrors";
|
|
94
|
-
params: import('xstate').NonReducibleUnknown;
|
|
95
|
-
};
|
|
96
|
-
notifyAuthenticated: {
|
|
97
|
-
type: "notifyAuthenticated";
|
|
98
|
-
params: import('xstate').NonReducibleUnknown;
|
|
99
|
-
};
|
|
100
|
-
setAccessToken: {
|
|
101
|
-
type: "setAccessToken";
|
|
102
|
-
params: import('xstate').NonReducibleUnknown;
|
|
103
|
-
};
|
|
104
|
-
setIgnoreRefreshToken: {
|
|
105
|
-
type: "setIgnoreRefreshToken";
|
|
106
|
-
params: import('xstate').NonReducibleUnknown;
|
|
107
|
-
};
|
|
108
|
-
setUserContext: {
|
|
109
|
-
type: "setUserContext";
|
|
110
|
-
params: import('xstate').NonReducibleUnknown;
|
|
111
|
-
};
|
|
112
|
-
unsetRefreshToken: {
|
|
113
|
-
type: "unsetRefreshToken";
|
|
114
|
-
params: import('xstate').NonReducibleUnknown;
|
|
115
|
-
};
|
|
116
|
-
unsetUserContext: {
|
|
117
|
-
type: "unsetUserContext";
|
|
118
|
-
params: import('xstate').NonReducibleUnknown;
|
|
119
|
-
};
|
|
120
|
-
}>, never, "refresh", string, import('./types').AuthenticatedEmittedEvent>>>>;
|
|
48
|
+
initialState?: string;
|
|
49
|
+
}, import('xstate').NonReducibleUnknown, import('./types').AuthenticatedEmittedEvent, import('xstate').MetaObject, {
|
|
50
|
+
id: "auth";
|
|
51
|
+
states: {
|
|
52
|
+
readonly authenticating: {};
|
|
53
|
+
readonly unauthenticating: {};
|
|
54
|
+
readonly refreshing: {};
|
|
55
|
+
readonly loggedOut: {};
|
|
56
|
+
readonly loggedInReady: {};
|
|
57
|
+
readonly loggedIn: {};
|
|
58
|
+
};
|
|
59
|
+
}>>>;
|
|
121
60
|
export declare const useAuth: () => AuthContextType;
|
|
122
61
|
type AuthOptions = {
|
|
123
62
|
inspect: Observer<InspectionEvent> | undefined;
|
|
@@ -134,119 +73,58 @@ type AuthOptions = {
|
|
|
134
73
|
* @todo should probably update signature to pass Partial<AuthContext> and
|
|
135
74
|
* Options, endpoints should probably be moved into context
|
|
136
75
|
*/
|
|
137
|
-
export declare const getAuth: (refreshToken?: string, options?: AuthOptions) => Promise<Actor<import('xstate').StateMachine<import('./types').AuthMachineContext, import('./types').RefreshTokenEvent | import('./types').LoginEvent | import('./types').LogoutEvent | import('./types').ClearErrorsEvent | import('./types').RestoreEvent | import('xstate').DoneActorEvent<import('./types').AuthenticateSuccessEvent> | import('xstate').DoneActorEvent<import('./types').RefreshTokenSuccessEvent>, {
|
|
138
|
-
[x: string]: import('xstate').
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
};
|
|
177
|
-
setAccessToken: {
|
|
178
|
-
type: "setAccessToken";
|
|
179
|
-
params: import('xstate').NonReducibleUnknown;
|
|
180
|
-
};
|
|
181
|
-
setIgnoreRefreshToken: {
|
|
182
|
-
type: "setIgnoreRefreshToken";
|
|
183
|
-
params: import('xstate').NonReducibleUnknown;
|
|
184
|
-
};
|
|
185
|
-
setUserContext: {
|
|
186
|
-
type: "setUserContext";
|
|
187
|
-
params: import('xstate').NonReducibleUnknown;
|
|
188
|
-
};
|
|
189
|
-
unsetRefreshToken: {
|
|
190
|
-
type: "unsetRefreshToken";
|
|
191
|
-
params: import('xstate').NonReducibleUnknown;
|
|
192
|
-
};
|
|
193
|
-
unsetUserContext: {
|
|
194
|
-
type: "unsetUserContext";
|
|
195
|
-
params: import('xstate').NonReducibleUnknown;
|
|
196
|
-
};
|
|
197
|
-
}>, never, "refresh", "refreshing" | "authenticating" | "loggedIn" | "loggedOut" | "unauthenticating" | "loggedInReady", string, {
|
|
76
|
+
export declare const getAuth: (refreshToken?: string, options?: AuthOptions) => Promise<Actor<import('xstate').StateMachine<import('./types').AuthMachineContext, import('./types').RefreshTokenEvent | import('./types').LoginEvent | import('./types').LogoutEvent | import('./types').ClearErrorsEvent | import('./types').RestoreEvent | import('xstate').DoneActorEvent<import('./types').AuthenticateSuccessEvent, string> | import('xstate').DoneActorEvent<import('./types').RefreshTokenSuccessEvent, string>, {
|
|
77
|
+
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<import('./types').AuthenticateSuccessEvent, import('./actors').AuthenticateInput, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<import('./types').RefreshTokenSuccessEvent, import('./actors').RefreshTokenInput, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<import('./types').UnauthenticateSuccessEvent, import('./actors').UnauthenticateInput, import('xstate').EventObject>> | undefined;
|
|
78
|
+
}, {
|
|
79
|
+
src: "authenticate";
|
|
80
|
+
logic: import('xstate').PromiseActorLogic<import('./types').AuthenticateSuccessEvent, import('./actors').AuthenticateInput, import('xstate').EventObject>;
|
|
81
|
+
id: string | undefined;
|
|
82
|
+
} | {
|
|
83
|
+
src: "refreshAccessToken";
|
|
84
|
+
logic: import('xstate').PromiseActorLogic<import('./types').RefreshTokenSuccessEvent, import('./actors').RefreshTokenInput, import('xstate').EventObject>;
|
|
85
|
+
id: string | undefined;
|
|
86
|
+
} | {
|
|
87
|
+
src: "unauthenticate";
|
|
88
|
+
logic: import('xstate').PromiseActorLogic<import('./types').UnauthenticateSuccessEvent, import('./actors').UnauthenticateInput, import('xstate').EventObject>;
|
|
89
|
+
id: string | undefined;
|
|
90
|
+
}, {
|
|
91
|
+
type: "addError";
|
|
92
|
+
params: import('xstate').NonReducibleUnknown;
|
|
93
|
+
} | {
|
|
94
|
+
type: "clearErrors";
|
|
95
|
+
params: import('xstate').NonReducibleUnknown;
|
|
96
|
+
} | {
|
|
97
|
+
type: "notifyAuthenticated";
|
|
98
|
+
params: import('xstate').NonReducibleUnknown;
|
|
99
|
+
} | {
|
|
100
|
+
type: "setAccessToken";
|
|
101
|
+
params: import('xstate').NonReducibleUnknown;
|
|
102
|
+
} | {
|
|
103
|
+
type: "setIgnoreRefreshToken";
|
|
104
|
+
params: import('xstate').NonReducibleUnknown;
|
|
105
|
+
} | {
|
|
106
|
+
type: "setUserContext";
|
|
107
|
+
params: import('xstate').NonReducibleUnknown;
|
|
108
|
+
} | {
|
|
109
|
+
type: "unsetRefreshToken";
|
|
110
|
+
params: import('xstate').NonReducibleUnknown;
|
|
111
|
+
} | {
|
|
112
|
+
type: "unsetUserContext";
|
|
113
|
+
params: import('xstate').NonReducibleUnknown;
|
|
114
|
+
}, never, "refresh", "refreshing" | "authenticating" | "loggedIn" | "loggedOut" | "unauthenticating" | "loggedInReady", string, {
|
|
198
115
|
initialContext: Partial<import('./types').AuthMachineContext>;
|
|
199
|
-
initialState?: string
|
|
200
|
-
}, import('xstate').NonReducibleUnknown, import('./types').AuthenticatedEmittedEvent, import('xstate').MetaObject,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
unauthenticate: {
|
|
212
|
-
src: "unauthenticate";
|
|
213
|
-
logic: import('xstate').PromiseActorLogic<import('./types').UnauthenticateSuccessEvent, import('./actors').UnauthenticateInput>;
|
|
214
|
-
id: string | undefined;
|
|
215
|
-
};
|
|
216
|
-
}>, import('xstate').Values<{
|
|
217
|
-
addError: {
|
|
218
|
-
type: "addError";
|
|
219
|
-
params: import('xstate').NonReducibleUnknown;
|
|
220
|
-
};
|
|
221
|
-
clearErrors: {
|
|
222
|
-
type: "clearErrors";
|
|
223
|
-
params: import('xstate').NonReducibleUnknown;
|
|
224
|
-
};
|
|
225
|
-
notifyAuthenticated: {
|
|
226
|
-
type: "notifyAuthenticated";
|
|
227
|
-
params: import('xstate').NonReducibleUnknown;
|
|
228
|
-
};
|
|
229
|
-
setAccessToken: {
|
|
230
|
-
type: "setAccessToken";
|
|
231
|
-
params: import('xstate').NonReducibleUnknown;
|
|
232
|
-
};
|
|
233
|
-
setIgnoreRefreshToken: {
|
|
234
|
-
type: "setIgnoreRefreshToken";
|
|
235
|
-
params: import('xstate').NonReducibleUnknown;
|
|
236
|
-
};
|
|
237
|
-
setUserContext: {
|
|
238
|
-
type: "setUserContext";
|
|
239
|
-
params: import('xstate').NonReducibleUnknown;
|
|
240
|
-
};
|
|
241
|
-
unsetRefreshToken: {
|
|
242
|
-
type: "unsetRefreshToken";
|
|
243
|
-
params: import('xstate').NonReducibleUnknown;
|
|
244
|
-
};
|
|
245
|
-
unsetUserContext: {
|
|
246
|
-
type: "unsetUserContext";
|
|
247
|
-
params: import('xstate').NonReducibleUnknown;
|
|
248
|
-
};
|
|
249
|
-
}>, never, "refresh", string, import('./types').AuthenticatedEmittedEvent>>>>;
|
|
116
|
+
initialState?: string;
|
|
117
|
+
}, import('xstate').NonReducibleUnknown, import('./types').AuthenticatedEmittedEvent, import('xstate').MetaObject, {
|
|
118
|
+
id: "auth";
|
|
119
|
+
states: {
|
|
120
|
+
readonly authenticating: {};
|
|
121
|
+
readonly unauthenticating: {};
|
|
122
|
+
readonly refreshing: {};
|
|
123
|
+
readonly loggedOut: {};
|
|
124
|
+
readonly loggedInReady: {};
|
|
125
|
+
readonly loggedIn: {};
|
|
126
|
+
};
|
|
127
|
+
}>>>;
|
|
250
128
|
type Props = {
|
|
251
129
|
children: ReactNode;
|
|
252
130
|
actor: Actor<typeof authMachine>;
|
|
@@ -12,5 +12,5 @@ export type AuthenticateResponse = {
|
|
|
12
12
|
accessToken?: string;
|
|
13
13
|
};
|
|
14
14
|
/** @todo pass locale for auth server? */
|
|
15
|
-
export declare const authenticate: import('xstate').PromiseActorLogic<AuthenticateSuccessEvent, AuthenticateInput>;
|
|
15
|
+
export declare const authenticate: import('xstate').PromiseActorLogic<AuthenticateSuccessEvent, AuthenticateInput, import('xstate').EventObject>;
|
|
16
16
|
export default authenticate;
|
|
@@ -14,5 +14,5 @@ export type RefreshTokenOutput = {
|
|
|
14
14
|
accessToken: string;
|
|
15
15
|
};
|
|
16
16
|
/** @todo pass locale for auth server? */
|
|
17
|
-
export declare const refreshAccessToken: import('xstate').PromiseActorLogic<RefreshTokenSuccessEvent, RefreshTokenInput>;
|
|
17
|
+
export declare const refreshAccessToken: import('xstate').PromiseActorLogic<RefreshTokenSuccessEvent, RefreshTokenInput, import('xstate').EventObject>;
|
|
18
18
|
export default refreshAccessToken;
|
|
@@ -10,5 +10,5 @@ export type UnauthenticateResponse = {
|
|
|
10
10
|
accessToken?: string;
|
|
11
11
|
};
|
|
12
12
|
/** @todo pass locale for auth server? */
|
|
13
|
-
export declare const unauthenticate: import('xstate').PromiseActorLogic<UnauthenticateSuccessEvent, UnauthenticateInput>;
|
|
13
|
+
export declare const unauthenticate: import('xstate').PromiseActorLogic<UnauthenticateSuccessEvent, UnauthenticateInput, import('xstate').EventObject>;
|
|
14
14
|
export default unauthenticate;
|
package/auth/auth.d.ts
CHANGED
|
@@ -1,115 +1,54 @@
|
|
|
1
1
|
import { AuthMachineContext } from './types';
|
|
2
|
-
export declare const authMachine: import('xstate').StateMachine<AuthMachineContext, import('./types').RefreshTokenEvent | import('./types').LoginEvent | import('./types').LogoutEvent | import('./types').ClearErrorsEvent | import('./types').RestoreEvent | import('xstate').DoneActorEvent<import('./types').AuthenticateSuccessEvent> | import('xstate').DoneActorEvent<import('./types').RefreshTokenSuccessEvent>, {
|
|
3
|
-
[x: string]: import('xstate').
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
42
|
-
setAccessToken: {
|
|
43
|
-
type: "setAccessToken";
|
|
44
|
-
params: import('xstate').NonReducibleUnknown;
|
|
45
|
-
};
|
|
46
|
-
setIgnoreRefreshToken: {
|
|
47
|
-
type: "setIgnoreRefreshToken";
|
|
48
|
-
params: import('xstate').NonReducibleUnknown;
|
|
49
|
-
};
|
|
50
|
-
setUserContext: {
|
|
51
|
-
type: "setUserContext";
|
|
52
|
-
params: import('xstate').NonReducibleUnknown;
|
|
53
|
-
};
|
|
54
|
-
unsetRefreshToken: {
|
|
55
|
-
type: "unsetRefreshToken";
|
|
56
|
-
params: import('xstate').NonReducibleUnknown;
|
|
57
|
-
};
|
|
58
|
-
unsetUserContext: {
|
|
59
|
-
type: "unsetUserContext";
|
|
60
|
-
params: import('xstate').NonReducibleUnknown;
|
|
61
|
-
};
|
|
62
|
-
}>, never, "refresh", "refreshing" | "authenticating" | "loggedIn" | "loggedOut" | "unauthenticating" | "loggedInReady", string, {
|
|
2
|
+
export declare const authMachine: import('xstate').StateMachine<AuthMachineContext, import('./types').RefreshTokenEvent | import('./types').LoginEvent | import('./types').LogoutEvent | import('./types').ClearErrorsEvent | import('./types').RestoreEvent | import('xstate').DoneActorEvent<import('./types').AuthenticateSuccessEvent, string> | import('xstate').DoneActorEvent<import('./types').RefreshTokenSuccessEvent, string>, {
|
|
3
|
+
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<import('./types').AuthenticateSuccessEvent, import('./actors').AuthenticateInput, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<import('./types').RefreshTokenSuccessEvent, import('./actors').RefreshTokenInput, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<import('./types').UnauthenticateSuccessEvent, import('./actors').UnauthenticateInput, import('xstate').EventObject>> | undefined;
|
|
4
|
+
}, {
|
|
5
|
+
src: "authenticate";
|
|
6
|
+
logic: import('xstate').PromiseActorLogic<import('./types').AuthenticateSuccessEvent, import('./actors').AuthenticateInput, import('xstate').EventObject>;
|
|
7
|
+
id: string | undefined;
|
|
8
|
+
} | {
|
|
9
|
+
src: "refreshAccessToken";
|
|
10
|
+
logic: import('xstate').PromiseActorLogic<import('./types').RefreshTokenSuccessEvent, import('./actors').RefreshTokenInput, import('xstate').EventObject>;
|
|
11
|
+
id: string | undefined;
|
|
12
|
+
} | {
|
|
13
|
+
src: "unauthenticate";
|
|
14
|
+
logic: import('xstate').PromiseActorLogic<import('./types').UnauthenticateSuccessEvent, import('./actors').UnauthenticateInput, import('xstate').EventObject>;
|
|
15
|
+
id: string | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
type: "addError";
|
|
18
|
+
params: import('xstate').NonReducibleUnknown;
|
|
19
|
+
} | {
|
|
20
|
+
type: "clearErrors";
|
|
21
|
+
params: import('xstate').NonReducibleUnknown;
|
|
22
|
+
} | {
|
|
23
|
+
type: "notifyAuthenticated";
|
|
24
|
+
params: import('xstate').NonReducibleUnknown;
|
|
25
|
+
} | {
|
|
26
|
+
type: "setAccessToken";
|
|
27
|
+
params: import('xstate').NonReducibleUnknown;
|
|
28
|
+
} | {
|
|
29
|
+
type: "setIgnoreRefreshToken";
|
|
30
|
+
params: import('xstate').NonReducibleUnknown;
|
|
31
|
+
} | {
|
|
32
|
+
type: "setUserContext";
|
|
33
|
+
params: import('xstate').NonReducibleUnknown;
|
|
34
|
+
} | {
|
|
35
|
+
type: "unsetRefreshToken";
|
|
36
|
+
params: import('xstate').NonReducibleUnknown;
|
|
37
|
+
} | {
|
|
38
|
+
type: "unsetUserContext";
|
|
39
|
+
params: import('xstate').NonReducibleUnknown;
|
|
40
|
+
}, never, "refresh", "refreshing" | "authenticating" | "loggedIn" | "loggedOut" | "unauthenticating" | "loggedInReady", string, {
|
|
63
41
|
initialContext: Partial<AuthMachineContext>;
|
|
64
|
-
initialState?: string
|
|
65
|
-
}, import('xstate').NonReducibleUnknown, import('./types').AuthenticatedEmittedEvent, import('xstate').MetaObject,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
unauthenticate: {
|
|
77
|
-
src: "unauthenticate";
|
|
78
|
-
logic: import('xstate').PromiseActorLogic<import('./types').UnauthenticateSuccessEvent, import('./actors').UnauthenticateInput>;
|
|
79
|
-
id: string | undefined;
|
|
80
|
-
};
|
|
81
|
-
}>, import('xstate').Values<{
|
|
82
|
-
addError: {
|
|
83
|
-
type: "addError";
|
|
84
|
-
params: import('xstate').NonReducibleUnknown;
|
|
85
|
-
};
|
|
86
|
-
clearErrors: {
|
|
87
|
-
type: "clearErrors";
|
|
88
|
-
params: import('xstate').NonReducibleUnknown;
|
|
89
|
-
};
|
|
90
|
-
notifyAuthenticated: {
|
|
91
|
-
type: "notifyAuthenticated";
|
|
92
|
-
params: import('xstate').NonReducibleUnknown;
|
|
93
|
-
};
|
|
94
|
-
setAccessToken: {
|
|
95
|
-
type: "setAccessToken";
|
|
96
|
-
params: import('xstate').NonReducibleUnknown;
|
|
97
|
-
};
|
|
98
|
-
setIgnoreRefreshToken: {
|
|
99
|
-
type: "setIgnoreRefreshToken";
|
|
100
|
-
params: import('xstate').NonReducibleUnknown;
|
|
101
|
-
};
|
|
102
|
-
setUserContext: {
|
|
103
|
-
type: "setUserContext";
|
|
104
|
-
params: import('xstate').NonReducibleUnknown;
|
|
105
|
-
};
|
|
106
|
-
unsetRefreshToken: {
|
|
107
|
-
type: "unsetRefreshToken";
|
|
108
|
-
params: import('xstate').NonReducibleUnknown;
|
|
109
|
-
};
|
|
110
|
-
unsetUserContext: {
|
|
111
|
-
type: "unsetUserContext";
|
|
112
|
-
params: import('xstate').NonReducibleUnknown;
|
|
113
|
-
};
|
|
114
|
-
}>, never, "refresh", string, import('./types').AuthenticatedEmittedEvent>>;
|
|
42
|
+
initialState?: string;
|
|
43
|
+
}, import('xstate').NonReducibleUnknown, import('./types').AuthenticatedEmittedEvent, import('xstate').MetaObject, {
|
|
44
|
+
id: "auth";
|
|
45
|
+
states: {
|
|
46
|
+
readonly authenticating: {};
|
|
47
|
+
readonly unauthenticating: {};
|
|
48
|
+
readonly refreshing: {};
|
|
49
|
+
readonly loggedOut: {};
|
|
50
|
+
readonly loggedInReady: {};
|
|
51
|
+
readonly loggedIn: {};
|
|
52
|
+
};
|
|
53
|
+
}>;
|
|
115
54
|
export default authMachine;
|