@quiltt/core 3.5.4 → 3.5.6
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/CHANGELOG.md +30 -10
- package/README.md +1 -1
- package/dist/SubscriptionLink-client-VkkcO2Yz.js +300 -0
- package/dist/index-client-D55-rzVl.js +561 -0
- package/dist/index.d.ts +402 -15
- package/dist/index.js +284 -11
- package/package.json +18 -19
- package/src/api/graphql/links/BatchHttpLink.ts +4 -2
- package/src/api/graphql/links/HttpLink.ts +4 -2
- package/src/api/graphql/links/actioncable/logger.ts +3 -1
- package/src/api/graphql/links/actioncable/subscription_guarantor.ts +1 -1
- package/src/api/rest/{AuthAPI.ts → auth.ts} +39 -26
- package/src/api/rest/fetchWithRetry.ts +73 -0
- package/src/api/rest/index.ts +1 -1
- package/dist/Storage/index.cjs +0 -10
- package/dist/Storage/index.cjs.map +0 -1
- package/dist/Storage/index.d.ts +0 -2
- package/dist/Storage/index.js +0 -5
- package/dist/Storage/index.js.map +0 -1
- package/dist/api/graphql/index.cjs +0 -49
- package/dist/api/graphql/index.cjs.map +0 -1
- package/dist/api/graphql/index.d.ts +0 -16
- package/dist/api/graphql/index.js +0 -15
- package/dist/api/graphql/index.js.map +0 -1
- package/dist/api/graphql/links/actioncable/index.cjs +0 -18
- package/dist/api/graphql/links/actioncable/index.cjs.map +0 -1
- package/dist/api/graphql/links/actioncable/index.d.ts +0 -62
- package/dist/api/graphql/links/actioncable/index.js +0 -5
- package/dist/api/graphql/links/actioncable/index.js.map +0 -1
- package/dist/api/graphql/links/index.cjs +0 -28
- package/dist/api/graphql/links/index.cjs.map +0 -1
- package/dist/api/graphql/links/index.d.ts +0 -56
- package/dist/api/graphql/links/index.js +0 -14
- package/dist/api/graphql/links/index.js.map +0 -1
- package/dist/api/index.cjs +0 -54
- package/dist/api/index.cjs.map +0 -1
- package/dist/api/index.d.ts +0 -78
- package/dist/api/index.js +0 -16
- package/dist/api/index.js.map +0 -1
- package/dist/api/rest/index.cjs +0 -14
- package/dist/api/rest/index.cjs.map +0 -1
- package/dist/api/rest/index.d.ts +0 -70
- package/dist/api/rest/index.js +0 -7
- package/dist/api/rest/index.js.map +0 -1
- package/dist/consumer-c13efb94.d.ts +0 -78
- package/dist/index-f53b61b3.d.ts +0 -129
- package/dist/index.cjs +0 -67
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/src/api/rest/axios.ts +0 -52
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export { ConnectorSDK, ConnectorSDKCallbackMetadata, ConnectorSDKCallbacks, ConnectorSDKConnectOptions, ConnectorSDKConnector, ConnectorSDKConnectorOptions, ConnectorSDKEventType, ConnectorSDKOnEventCallback, ConnectorSDKOnEventExitCallback, ConnectorSDKOnExitAbortCallback, ConnectorSDKOnExitErrorCallback, ConnectorSDKOnExitSuccessCallback, ConnectorSDKOnLoadCallback, ConnectorSDKReconnectOptions } from './api/index.js';
|
|
4
|
-
export { AuthLink, BatchHttpLink, ErrorLink, ForwardableLink, HttpLink, RetryLink, SubscriptionLink, TerminatingLink, VersionLink } from './api/graphql/links/index.js';
|
|
5
|
-
export { QuilttClient, QuilttClientOptions } from './api/graphql/index.js';
|
|
6
|
-
export { AuthAPI, AuthStrategies, PasscodePayload, SessionResponse, UnprocessableData, UnprocessableResponse, UsernamePayload } from './api/rest/index.js';
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { ApolloLink, Operation, NextLink, Observable as Observable$1, FetchResult, ApolloClientOptions, ApolloClient } from '@apollo/client/index.js';
|
|
7
3
|
export { ApolloError, InMemoryCache, NormalizedCacheObject, OperationVariables, gql, useMutation, useQuery, useSubscription } from '@apollo/client/index.js';
|
|
8
|
-
import '
|
|
9
|
-
import '@apollo/client
|
|
10
|
-
import '@apollo/client';
|
|
11
|
-
import '@apollo/client/link/
|
|
12
|
-
import '@apollo/client/
|
|
13
|
-
import '@apollo/client/core/index.js';
|
|
14
|
-
import './consumer-c13efb94.js';
|
|
15
|
-
import 'axios';
|
|
4
|
+
import { BatchHttpLink as BatchHttpLink$1 } from '@apollo/client/link/batch-http/index.js';
|
|
5
|
+
import * as _apollo_client from '@apollo/client';
|
|
6
|
+
import { HttpLink as HttpLink$1 } from '@apollo/client/link/http/index.js';
|
|
7
|
+
import { RetryLink as RetryLink$1 } from '@apollo/client/link/retry/index.js';
|
|
8
|
+
import { ApolloLink as ApolloLink$1, Operation as Operation$1, NextLink as NextLink$1, Observable as Observable$2, FetchResult as FetchResult$1 } from '@apollo/client/core/index.js';
|
|
16
9
|
|
|
17
10
|
declare const debugging: boolean;
|
|
18
11
|
declare const version: string;
|
|
@@ -21,6 +14,38 @@ declare const endpointAuth: string;
|
|
|
21
14
|
declare const endpointGraphQL: string;
|
|
22
15
|
declare const endpointWebsockets: string;
|
|
23
16
|
|
|
17
|
+
/** Utility types to extend default TS utilities */
|
|
18
|
+
type Maybe<T> = T | null;
|
|
19
|
+
type InputMaybe<T> = Maybe<T>;
|
|
20
|
+
type Exact<T extends {
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}> = {
|
|
23
|
+
[K in keyof T]: T[K];
|
|
24
|
+
};
|
|
25
|
+
type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
|
|
26
|
+
[SubKey in K]?: Maybe<T[SubKey]>;
|
|
27
|
+
};
|
|
28
|
+
type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
|
|
29
|
+
[SubKey in K]: Maybe<T[SubKey]>;
|
|
30
|
+
};
|
|
31
|
+
type Nullable<T> = {
|
|
32
|
+
[K in keyof T]: T[K] | null;
|
|
33
|
+
};
|
|
34
|
+
type Mutable<Type> = {
|
|
35
|
+
-readonly [Key in keyof Type]: Type[Key];
|
|
36
|
+
};
|
|
37
|
+
type DeepPartial<T> = T extends object ? {
|
|
38
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
39
|
+
} : T;
|
|
40
|
+
type DeepReadonly<T> = T extends object ? {
|
|
41
|
+
[P in keyof T]: DeepReadonly<T[P]>;
|
|
42
|
+
} : T;
|
|
43
|
+
declare global {
|
|
44
|
+
interface Window {
|
|
45
|
+
expo: any;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
24
49
|
type JsonWebToken<T> = {
|
|
25
50
|
token: string;
|
|
26
51
|
claims: Claims<T>;
|
|
@@ -45,6 +70,100 @@ type PrivateClaims = {
|
|
|
45
70
|
type QuilttJWT = JsonWebToken<PrivateClaims>;
|
|
46
71
|
declare const JsonWebTokenParse: <T>(token: Maybe<string> | undefined) => Maybe<JsonWebToken<T>> | undefined;
|
|
47
72
|
|
|
73
|
+
type Observer<T> = Dispatch<SetStateAction<Maybe<T> | undefined>>;
|
|
74
|
+
/**
|
|
75
|
+
* This is designed to support singletons to share the memory states across all
|
|
76
|
+
* instance of hooks to ensure that updates only process once, by storing a value
|
|
77
|
+
* then notifying all subscribers when it's updated.
|
|
78
|
+
*/
|
|
79
|
+
declare class Observable<T> {
|
|
80
|
+
private state?;
|
|
81
|
+
private observers;
|
|
82
|
+
constructor(initalState?: Maybe<T>);
|
|
83
|
+
get: () => Maybe<T> | undefined;
|
|
84
|
+
set: (nextState: Maybe<T> | undefined) => void;
|
|
85
|
+
subscribe: (observer: Observer<T>) => void;
|
|
86
|
+
unsubscribe: (observer: Observer<T>) => void;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* An error and type safe wrapper for localStorage.
|
|
91
|
+
* It allows you to subscribe to changes;
|
|
92
|
+
* but localStorage changes only fire with another
|
|
93
|
+
* window updates the record.
|
|
94
|
+
*/
|
|
95
|
+
declare class LocalStorage<T> {
|
|
96
|
+
private observers;
|
|
97
|
+
constructor();
|
|
98
|
+
isEnabled: () => boolean;
|
|
99
|
+
isDisabled: () => boolean;
|
|
100
|
+
get: (key: string) => Maybe<T> | undefined;
|
|
101
|
+
set: (key: string, state: Maybe<T> | undefined) => void;
|
|
102
|
+
remove: (key: string) => void;
|
|
103
|
+
subscribe: (key: string, observer: Observer<T>) => void;
|
|
104
|
+
unsubscribe: (key: string, observer: Observer<T>) => void;
|
|
105
|
+
private handleStorageEvent;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* This is designed to support effectively an in memory key value store singleton,
|
|
110
|
+
* similar to localstorage, but allows you to subscribe to changes within the current
|
|
111
|
+
* window.
|
|
112
|
+
*/
|
|
113
|
+
declare class MemoryStorage<T> {
|
|
114
|
+
private observables;
|
|
115
|
+
get: (key: string) => Maybe<T> | undefined;
|
|
116
|
+
set: (key: string, state: Maybe<T> | undefined) => void;
|
|
117
|
+
subscribe: (key: string, observer: Observer<T>) => void;
|
|
118
|
+
unsubscribe: (key: string, observer: Observer<T>) => void;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* This is wraps both local and memory storage to create a unified interface, that
|
|
123
|
+
* allows you to subscribe to all either changes made within this window, or changes
|
|
124
|
+
* made by other windows.
|
|
125
|
+
*/
|
|
126
|
+
declare class Storage<T> {
|
|
127
|
+
private memoryStore;
|
|
128
|
+
private localStore;
|
|
129
|
+
private observers;
|
|
130
|
+
private monitors;
|
|
131
|
+
/**
|
|
132
|
+
* Checks memoryStorage before falling back to localStorage.
|
|
133
|
+
*/
|
|
134
|
+
get: (key: string) => Maybe<T> | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* We don't trust localStorage to always be present, so we can't rely on it to
|
|
137
|
+
* update memoryStorage based on emitted changes. So we manage our own
|
|
138
|
+
* emitting while using the underlying events to keep memoryStore in sync with
|
|
139
|
+
* localStore.
|
|
140
|
+
*/
|
|
141
|
+
set: (key: string, newState: Maybe<T> | undefined) => void;
|
|
142
|
+
/**
|
|
143
|
+
* Allows you to subscribe to all changes in memory or local storage as a
|
|
144
|
+
* single event.
|
|
145
|
+
*/
|
|
146
|
+
subscribe: (key: string, observer: Observer<T>) => void;
|
|
147
|
+
unsubscribe: (key: string, observer: Observer<T>) => void;
|
|
148
|
+
/**
|
|
149
|
+
* Sets bubble the changes down the stack starting with memoryStore and then
|
|
150
|
+
* localStore. memoryStore will emit changes to everything within the current
|
|
151
|
+
* window context, while localStore will emit changes to every other window
|
|
152
|
+
* context.
|
|
153
|
+
*
|
|
154
|
+
* To ensure that the other windows are updated correctly, changes to localStore
|
|
155
|
+
* need to be subscribed and updated to in memory store, which then may be subscribed
|
|
156
|
+
* to outside of storage.
|
|
157
|
+
*/
|
|
158
|
+
private monitorLocalStorageChanges;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* This is an singleton to share the memory states across all instances; This
|
|
163
|
+
* basically acts like shared memory when there is no localStorage.
|
|
164
|
+
*/
|
|
165
|
+
declare const GlobalStorage: Storage<any>;
|
|
166
|
+
|
|
48
167
|
/**
|
|
49
168
|
* This is designed to support singletons to timeouts that can broadcast
|
|
50
169
|
* to any observers, preventing race conditions with multiple timeouts.
|
|
@@ -57,4 +176,272 @@ declare class Timeoutable {
|
|
|
57
176
|
private broadcast;
|
|
58
177
|
}
|
|
59
178
|
|
|
60
|
-
|
|
179
|
+
interface CallbackManager {
|
|
180
|
+
onEvent(callback: ConnectorSDKOnEventCallback): void;
|
|
181
|
+
onLoad(callback: ConnectorSDKOnLoadCallback): void;
|
|
182
|
+
onExit(callback: ConnectorSDKOnEventExitCallback): void;
|
|
183
|
+
onExitSuccess(callback: ConnectorSDKOnExitSuccessCallback): void;
|
|
184
|
+
onExitAbort(callback: ConnectorSDKOnExitAbortCallback): void;
|
|
185
|
+
onExitError(callback: ConnectorSDKOnExitErrorCallback): void;
|
|
186
|
+
offEvent(callback: ConnectorSDKOnEventCallback): void;
|
|
187
|
+
offLoad(callback: ConnectorSDKOnLoadCallback): void;
|
|
188
|
+
offExit(callback: ConnectorSDKOnEventExitCallback): void;
|
|
189
|
+
offExitSuccess(callback: ConnectorSDKOnExitSuccessCallback): void;
|
|
190
|
+
offExitAbort(callback: ConnectorSDKOnExitAbortCallback): void;
|
|
191
|
+
offExitError(callback: ConnectorSDKOnExitErrorCallback): void;
|
|
192
|
+
}
|
|
193
|
+
interface ConnectorSDK extends CallbackManager {
|
|
194
|
+
authenticate(token: string | null | undefined): void;
|
|
195
|
+
connect(connectorId: string, options?: ConnectorSDKConnectOptions): ConnectorSDKConnector;
|
|
196
|
+
reconnect(connectorId: string, options: ConnectorSDKReconnectOptions): ConnectorSDKConnector;
|
|
197
|
+
reset(): void;
|
|
198
|
+
}
|
|
199
|
+
interface ConnectorSDKConnector extends CallbackManager {
|
|
200
|
+
open(): void;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Types for optional callbacks in the ConnectorSDK.
|
|
204
|
+
*
|
|
205
|
+
* Leaf event nodes return only metadata.
|
|
206
|
+
* Internal nodes return both event type and metadata.
|
|
207
|
+
*/
|
|
208
|
+
type ConnectorSDKCallbacks = {
|
|
209
|
+
onEvent?: ConnectorSDKOnEventCallback;
|
|
210
|
+
onLoad?: ConnectorSDKOnLoadCallback;
|
|
211
|
+
onExit?: ConnectorSDKOnEventExitCallback;
|
|
212
|
+
onExitSuccess?: ConnectorSDKOnExitSuccessCallback;
|
|
213
|
+
onExitAbort?: ConnectorSDKOnExitAbortCallback;
|
|
214
|
+
onExitError?: ConnectorSDKOnExitErrorCallback;
|
|
215
|
+
};
|
|
216
|
+
type ConnectorSDKOnEventCallback = (type: ConnectorSDKEventType, metadata: ConnectorSDKCallbackMetadata) => void;
|
|
217
|
+
type ConnectorSDKOnLoadCallback = (metadata: ConnectorSDKCallbackMetadata) => void;
|
|
218
|
+
type ConnectorSDKOnEventExitCallback = (type: ConnectorSDKEventType, metadata: ConnectorSDKCallbackMetadata) => void;
|
|
219
|
+
type ConnectorSDKOnExitSuccessCallback = (metadata: ConnectorSDKCallbackMetadata) => void;
|
|
220
|
+
type ConnectorSDKOnExitAbortCallback = (metadata: ConnectorSDKCallbackMetadata) => void;
|
|
221
|
+
type ConnectorSDKOnExitErrorCallback = (metadata: ConnectorSDKCallbackMetadata) => void;
|
|
222
|
+
declare enum ConnectorSDKEventType {
|
|
223
|
+
Load = "loaded",
|
|
224
|
+
ExitSuccess = "exited.successful",
|
|
225
|
+
ExitAbort = "exited.aborted",
|
|
226
|
+
ExitError = "exited.errored"
|
|
227
|
+
}
|
|
228
|
+
type ConnectorSDKCallbackMetadata = {
|
|
229
|
+
connectorId: string;
|
|
230
|
+
profileId?: string;
|
|
231
|
+
connectionId?: string;
|
|
232
|
+
};
|
|
233
|
+
type ConnectorSDKConnectOptions = ConnectorSDKCallbacks & {
|
|
234
|
+
institution?: string;
|
|
235
|
+
};
|
|
236
|
+
type ConnectorSDKReconnectOptions = ConnectorSDKCallbacks & {
|
|
237
|
+
connectionId: string;
|
|
238
|
+
};
|
|
239
|
+
type ConnectorSDKConnectorOptions = ConnectorSDKCallbacks & {
|
|
240
|
+
institution?: string;
|
|
241
|
+
connectionId?: string;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* unauthorizedCallback only triggers in the event the token is present, and
|
|
246
|
+
* returns the token; This allows sessions to be forgotten without race conditions
|
|
247
|
+
* causing null sessions to kill valid sessions, or invalid sessions for killing
|
|
248
|
+
* valid sessions during rotation and networking weirdness.
|
|
249
|
+
*/
|
|
250
|
+
declare class AuthLink extends ApolloLink {
|
|
251
|
+
request(operation: Operation, forward: NextLink): Observable$1<FetchResult> | null;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
declare const BatchHttpLink: BatchHttpLink$1;
|
|
255
|
+
|
|
256
|
+
declare const ErrorLink: _apollo_client.ApolloLink;
|
|
257
|
+
|
|
258
|
+
declare const ForwardableLink: ApolloLink;
|
|
259
|
+
|
|
260
|
+
declare const HttpLink: HttpLink$1;
|
|
261
|
+
|
|
262
|
+
declare const RetryLink: RetryLink$1;
|
|
263
|
+
|
|
264
|
+
declare class Connection {
|
|
265
|
+
constructor(consumer: any);
|
|
266
|
+
send(data: any): boolean;
|
|
267
|
+
open(): boolean;
|
|
268
|
+
close({ allowReconnect }?: {
|
|
269
|
+
allowReconnect: boolean;
|
|
270
|
+
}): any;
|
|
271
|
+
reopen(): any;
|
|
272
|
+
getProtocol(): any;
|
|
273
|
+
isOpen(): boolean;
|
|
274
|
+
isActive(): boolean;
|
|
275
|
+
triedToReconnect(): boolean;
|
|
276
|
+
isProtocolSupported(): boolean;
|
|
277
|
+
isState(...states: any[]): boolean;
|
|
278
|
+
getState(): string | null;
|
|
279
|
+
installEventHandlers(): void;
|
|
280
|
+
uninstallEventHandlers(): void;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
type Data = {
|
|
284
|
+
[id: string]: string | object | null | undefined;
|
|
285
|
+
};
|
|
286
|
+
declare class Subscription {
|
|
287
|
+
consumer: Consumer;
|
|
288
|
+
identifier: string;
|
|
289
|
+
constructor(consumer: Consumer, params: Data | undefined, mixin: Data);
|
|
290
|
+
perform(action: string, data?: Data): boolean;
|
|
291
|
+
send(data: object): boolean;
|
|
292
|
+
unsubscribe(): Subscription;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
declare class SubscriptionGuarantor {
|
|
296
|
+
subscriptions: Subscriptions;
|
|
297
|
+
pendingSubscriptions: Array<Subscription>;
|
|
298
|
+
retryTimeout: ReturnType<typeof setTimeout> | undefined;
|
|
299
|
+
constructor(subscriptions: Subscriptions);
|
|
300
|
+
guarantee(subscription: Subscription): void;
|
|
301
|
+
forget(subscription: Subscription): void;
|
|
302
|
+
startGuaranteeing(): void;
|
|
303
|
+
stopGuaranteeing(): void;
|
|
304
|
+
retrySubscribing(): void;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
declare class Subscriptions {
|
|
308
|
+
consumer: Consumer;
|
|
309
|
+
guarantor: SubscriptionGuarantor;
|
|
310
|
+
subscriptions: Array<Subscription>;
|
|
311
|
+
constructor(consumer: Consumer);
|
|
312
|
+
create(channelName: string, mixin: Data): Subscription;
|
|
313
|
+
add(subscription: Subscription): Subscription;
|
|
314
|
+
remove(subscription: Subscription): Subscription;
|
|
315
|
+
reject(identifier: string): Subscription[];
|
|
316
|
+
forget(subscription: Subscription): Subscription;
|
|
317
|
+
findAll(identifier: string): Subscription[];
|
|
318
|
+
reload(): void[];
|
|
319
|
+
notifyAll(callbackName: string, ...args: any[]): any[][];
|
|
320
|
+
notify(subscription: Subscription, callbackName: string, ...args: any[]): any[];
|
|
321
|
+
subscribe(subscription: Subscription): void;
|
|
322
|
+
confirmSubscription(identifier: string): void;
|
|
323
|
+
sendCommand(subscription: Subscription, command: string): boolean;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
declare class Consumer {
|
|
327
|
+
_url: string;
|
|
328
|
+
subscriptions: Subscriptions;
|
|
329
|
+
connection: Connection;
|
|
330
|
+
subprotocols: Array<string>;
|
|
331
|
+
constructor(url: string);
|
|
332
|
+
get url(): string;
|
|
333
|
+
send(data: object): boolean;
|
|
334
|
+
connect(): boolean;
|
|
335
|
+
disconnect(): any;
|
|
336
|
+
ensureActiveConnection(): boolean | undefined;
|
|
337
|
+
addSubProtocol(subprotocol: string): void;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
type RequestResult = FetchResult$1<{
|
|
341
|
+
[key: string]: unknown;
|
|
342
|
+
}, Record<string, unknown>, Record<string, unknown>>;
|
|
343
|
+
type ConnectionParams = object | ((operation: Operation$1) => object);
|
|
344
|
+
declare class ActionCableLink extends ApolloLink$1 {
|
|
345
|
+
cables: {
|
|
346
|
+
[id: string]: Consumer;
|
|
347
|
+
};
|
|
348
|
+
channelName: string;
|
|
349
|
+
actionName: string;
|
|
350
|
+
connectionParams: ConnectionParams;
|
|
351
|
+
constructor(options: {
|
|
352
|
+
channelName?: string;
|
|
353
|
+
actionName?: string;
|
|
354
|
+
connectionParams?: ConnectionParams;
|
|
355
|
+
});
|
|
356
|
+
request(operation: Operation$1, _next: NextLink$1): Observable$2<RequestResult> | null;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
declare class SubscriptionLink extends ActionCableLink {
|
|
360
|
+
constructor();
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
declare const TerminatingLink: ApolloLink;
|
|
364
|
+
|
|
365
|
+
declare const VersionLink: ApolloLink;
|
|
366
|
+
|
|
367
|
+
type QuilttClientOptions<T> = Omit<ApolloClientOptions<T>, 'link'>;
|
|
368
|
+
declare class QuilttClient<T> extends ApolloClient<T> {
|
|
369
|
+
constructor(options: QuilttClientOptions<T>);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
type FetchResponse<T> = {
|
|
373
|
+
data: T;
|
|
374
|
+
status: number;
|
|
375
|
+
statusText: string;
|
|
376
|
+
headers: Headers;
|
|
377
|
+
ok: boolean;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
declare enum AuthStrategies {
|
|
381
|
+
Email = "email",
|
|
382
|
+
Phone = "phone"
|
|
383
|
+
}
|
|
384
|
+
interface EmailInput {
|
|
385
|
+
email: string;
|
|
386
|
+
phone?: never;
|
|
387
|
+
}
|
|
388
|
+
interface PhoneInput {
|
|
389
|
+
phone: string;
|
|
390
|
+
email?: never;
|
|
391
|
+
}
|
|
392
|
+
type UsernamePayload = EmailInput | PhoneInput;
|
|
393
|
+
type PasscodePayload = UsernamePayload & {
|
|
394
|
+
passcode: string;
|
|
395
|
+
};
|
|
396
|
+
type SessionData = {
|
|
397
|
+
token: string;
|
|
398
|
+
};
|
|
399
|
+
type NoContentData = null;
|
|
400
|
+
type UnauthorizedData = {
|
|
401
|
+
message: string;
|
|
402
|
+
instruction: string;
|
|
403
|
+
};
|
|
404
|
+
type UnprocessableData = {
|
|
405
|
+
[attribute: string]: Array<string>;
|
|
406
|
+
};
|
|
407
|
+
type Ping = SessionData | UnauthorizedData;
|
|
408
|
+
type Identify = SessionData | NoContentData | UnprocessableData;
|
|
409
|
+
type Authenticate = SessionData | UnauthorizedData | UnprocessableData;
|
|
410
|
+
type Revoke = NoContentData | UnauthorizedData;
|
|
411
|
+
type SessionResponse = FetchResponse<SessionData>;
|
|
412
|
+
type UnprocessableResponse = FetchResponse<UnprocessableData>;
|
|
413
|
+
declare class AuthAPI {
|
|
414
|
+
clientId: string | undefined;
|
|
415
|
+
constructor(clientId?: string | undefined);
|
|
416
|
+
/**
|
|
417
|
+
* Response Statuses:
|
|
418
|
+
* - 200: OK -> Session is Valid
|
|
419
|
+
* - 401: Unauthorized -> Session is Invalid
|
|
420
|
+
*/
|
|
421
|
+
ping: (token: string) => Promise<FetchResponse<Ping>>;
|
|
422
|
+
/**
|
|
423
|
+
* Response Statuses:
|
|
424
|
+
* - 201: Created -> Profile Created, New Session Returned
|
|
425
|
+
* - 202: Accepted -> Profile Found, MFA Code Sent for `authenticate`
|
|
426
|
+
* - 422: Unprocessable Entity -> Invalid Payload
|
|
427
|
+
*/
|
|
428
|
+
identify: (payload: UsernamePayload) => Promise<FetchResponse<Identify>>;
|
|
429
|
+
/**
|
|
430
|
+
* Response Statuses:
|
|
431
|
+
* - 201: Created -> MFA Validated, New Session Returned
|
|
432
|
+
* - 401: Unauthorized -> MFA Invalid
|
|
433
|
+
* - 422: Unprocessable Entity -> Invalid Payload
|
|
434
|
+
*/
|
|
435
|
+
authenticate: (payload: PasscodePayload) => Promise<FetchResponse<Authenticate>>;
|
|
436
|
+
/**
|
|
437
|
+
* Response Statuses:
|
|
438
|
+
* - 204: No Content -> Session Revoked
|
|
439
|
+
* - 401: Unauthorized -> Session Not Found
|
|
440
|
+
*/
|
|
441
|
+
revoke: (token: string) => Promise<FetchResponse<Revoke>>;
|
|
442
|
+
private config;
|
|
443
|
+
private validateStatus;
|
|
444
|
+
private body;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export { AuthAPI, AuthLink, AuthStrategies, BatchHttpLink, type Claims, type ConnectorSDK, type ConnectorSDKCallbackMetadata, type ConnectorSDKCallbacks, type ConnectorSDKConnectOptions, type ConnectorSDKConnector, type ConnectorSDKConnectorOptions, ConnectorSDKEventType, type ConnectorSDKOnEventCallback, type ConnectorSDKOnEventExitCallback, type ConnectorSDKOnExitAbortCallback, type ConnectorSDKOnExitErrorCallback, type ConnectorSDKOnExitSuccessCallback, type ConnectorSDKOnLoadCallback, type ConnectorSDKReconnectOptions, type DeepPartial, type DeepReadonly, ErrorLink, type Exact, ForwardableLink, GlobalStorage, HttpLink, type InputMaybe, type JsonWebToken, JsonWebTokenParse, LocalStorage, type MakeMaybe, type MakeOptional, type Maybe, MemoryStorage, type Mutable, type Nullable, Observable, type Observer, type PasscodePayload, type PrivateClaims, QuilttClient, type QuilttClientOptions, type QuilttJWT, type RegisteredClaims, RetryLink, type SessionResponse, Storage, SubscriptionLink, TerminatingLink, Timeoutable, type UnprocessableData, type UnprocessableResponse, type UsernamePayload, VersionLink, cdnBase, debugging, endpointAuth, endpointGraphQL, endpointWebsockets, version };
|