@quiltt/core 3.5.5 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -10
- package/README.md +1 -1
- package/dist/{SubscriptionLink-client-B5Tmyqw7.js → SubscriptionLink-client-Bf6n9gzT.js} +70 -61
- package/dist/{index-client-BY-d8Msy.js → index-client-C87sSU05.js} +1 -1
- package/dist/index.d.ts +190 -179
- package/dist/index.js +122 -86
- package/package.json +13 -14
- package/src/api/graphql/links/ActionCableLink.ts +1 -1
- package/src/api/graphql/links/AuthLink.ts +1 -1
- package/src/api/graphql/links/BatchHttpLink.ts +4 -2
- package/src/api/graphql/links/ErrorLink.ts +1 -1
- package/src/api/graphql/links/HttpLink.ts +4 -2
- 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/src/configuration.ts +33 -19
- package/src/index.ts +2 -2
- package/src/{Storage → storage}/Local.ts +0 -2
- package/src/{Storage → storage}/Memory.ts +0 -2
- package/src/{Storage/index.ts → storage/Storage.ts} +0 -3
- package/src/storage/index.ts +3 -0
- package/src/api/rest/axios.ts +0 -52
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @quiltt/core
|
|
2
2
|
|
|
3
|
+
## 3.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#229](https://github.com/quiltt/quiltt-js/pull/229) [`f688563`](https://github.com/quiltt/quiltt-js/commit/f6885635d989fb75918cb13e449ca0eec60850fc) Thanks [@zubairaziz](https://github.com/zubairaziz)! - Fix Websockets protocol variable
|
|
8
|
+
|
|
9
|
+
- [#229](https://github.com/quiltt/quiltt-js/pull/229) [`f688563`](https://github.com/quiltt/quiltt-js/commit/f6885635d989fb75918cb13e449ca0eec60850fc) Thanks [@zubairaziz](https://github.com/zubairaziz)! - Fix Websockets protocol variable
|
|
10
|
+
|
|
11
|
+
## 3.5.6
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#223](https://github.com/quiltt/quiltt-js/pull/223) [`8c5041c`](https://github.com/quiltt/quiltt-js/commit/8c5041c1670fd7dbfed06355c06888256ce84b08) Thanks [@zubairaziz](https://github.com/zubairaziz)! - Remove axios and replace with native fetch
|
|
16
|
+
|
|
3
17
|
## 3.5.5
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -24,57 +38,57 @@
|
|
|
24
38
|
|
|
25
39
|
### Patch Changes
|
|
26
40
|
|
|
27
|
-
- [#204](https://github.com/quiltt/quiltt-
|
|
41
|
+
- [#204](https://github.com/quiltt/quiltt-js/pull/204) [`ee42bf1`](https://github.com/quiltt/quiltt-js/commit/ee42bf137db1029807df49f66ff7e57117e8ace9) Thanks [@sirwolfgang](https://github.com/sirwolfgang)! - Add missing type to QuilttButton
|
|
28
42
|
|
|
29
|
-
- [#197](https://github.com/quiltt/quiltt-
|
|
43
|
+
- [#197](https://github.com/quiltt/quiltt-js/pull/197) [`8d9f24c`](https://github.com/quiltt/quiltt-js/commit/8d9f24c59102db5dc665195a6145cfac2c80e2c0) Thanks [@rubendinho](https://github.com/rubendinho)! - Update docs, and fix typo in types
|
|
30
44
|
|
|
31
45
|
## 3.5.2
|
|
32
46
|
|
|
33
47
|
### Patch Changes
|
|
34
48
|
|
|
35
|
-
- [#202](https://github.com/quiltt/quiltt-
|
|
49
|
+
- [#202](https://github.com/quiltt/quiltt-js/pull/202) [`42705f0`](https://github.com/quiltt/quiltt-js/commit/42705f0e01b0adb35ab627697169433e1065a8f0) Thanks [@sirwolfgang](https://github.com/sirwolfgang)! - Expose Institutions to React API
|
|
36
50
|
|
|
37
51
|
## 3.5.1
|
|
38
52
|
|
|
39
53
|
### Patch Changes
|
|
40
54
|
|
|
41
|
-
- [#200](https://github.com/quiltt/quiltt-
|
|
55
|
+
- [#200](https://github.com/quiltt/quiltt-js/pull/200) [`0a07431`](https://github.com/quiltt/quiltt-js/commit/0a07431ff936e6cd4fd3aeee66bba1fec21f6624) Thanks [@sirwolfgang](https://github.com/sirwolfgang)! - Fix release
|
|
42
56
|
|
|
43
57
|
## 3.5.0
|
|
44
58
|
|
|
45
59
|
### Minor Changes
|
|
46
60
|
|
|
47
|
-
- [#198](https://github.com/quiltt/quiltt-
|
|
61
|
+
- [#198](https://github.com/quiltt/quiltt-js/pull/198) [`c65d87a`](https://github.com/quiltt/quiltt-js/commit/c65d87a8316dbec82635a0c4108714de7bbd082b) Thanks [@sirwolfgang](https://github.com/sirwolfgang)! - Add Institutions to the Connect API
|
|
48
62
|
|
|
49
63
|
## 3.4.1
|
|
50
64
|
|
|
51
65
|
### Patch Changes
|
|
52
66
|
|
|
53
|
-
- [#195](https://github.com/quiltt/quiltt-
|
|
67
|
+
- [#195](https://github.com/quiltt/quiltt-js/pull/195) [`6c36908`](https://github.com/quiltt/quiltt-js/commit/6c36908678cb46d5f6a0c7438e0ed48889cabf79) Thanks [@tom-quiltt](https://github.com/tom-quiltt)! - Report preflight error before sending connectorUrl to webview
|
|
54
68
|
|
|
55
69
|
## 3.4.0
|
|
56
70
|
|
|
57
71
|
### Minor Changes
|
|
58
72
|
|
|
59
|
-
- [#191](https://github.com/quiltt/quiltt-
|
|
73
|
+
- [#191](https://github.com/quiltt/quiltt-js/pull/191) [`58c8f0c`](https://github.com/quiltt/quiltt-js/commit/58c8f0c5265dfa379263225baafb4552067514c6) Thanks [@tom-quiltt](https://github.com/tom-quiltt)! - Add agent QSP for analytic
|
|
60
74
|
|
|
61
75
|
## 3.3.10
|
|
62
76
|
|
|
63
77
|
### Patch Changes
|
|
64
78
|
|
|
65
|
-
- [#190](https://github.com/quiltt/quiltt-
|
|
79
|
+
- [#190](https://github.com/quiltt/quiltt-js/pull/190) [`21ead66`](https://github.com/quiltt/quiltt-js/commit/21ead662e7626f906562f952c9d1c0bc2c859985) Thanks [@tom-quiltt](https://github.com/tom-quiltt)! - Fix Android App with Chase app installed not able to launch Chase app
|
|
66
80
|
|
|
67
81
|
## 3.3.9
|
|
68
82
|
|
|
69
83
|
### Patch Changes
|
|
70
84
|
|
|
71
|
-
- [#187](https://github.com/quiltt/quiltt-
|
|
85
|
+
- [#187](https://github.com/quiltt/quiltt-js/pull/187) [`02f37cd`](https://github.com/quiltt/quiltt-js/commit/02f37cda97f501f2d77601d0fd6b7fbbd1c71431) Thanks [@rubendinho](https://github.com/rubendinho)! - Export Quiltt config
|
|
72
86
|
|
|
73
87
|
## 3.3.8
|
|
74
88
|
|
|
75
89
|
### Patch Changes
|
|
76
90
|
|
|
77
|
-
- [#185](https://github.com/quiltt/quiltt-
|
|
91
|
+
- [#185](https://github.com/quiltt/quiltt-js/pull/185) [`a3452da`](https://github.com/quiltt/quiltt-js/commit/a3452da3c7604902b5917e1f838e2dced42b708c) Thanks [@rubendinho](https://github.com/rubendinho)! - Fix Vite build error
|
|
78
92
|
|
|
79
93
|
## 3.3.7
|
|
80
94
|
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @quiltt/core
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/@quiltt%2Fcore)
|
|
4
|
-
[](https://github.com/quiltt/quiltt-js/actions/workflows/ci.yml)
|
|
5
5
|
|
|
6
6
|
`@quiltt/core` provides essential functionality for building Javascript-based applications with Quiltt. It provides an Auth API client and modules for handling JSON Web Tokens (JWT), observables, storage management, timeouts, API handling, and Typescript types.
|
|
7
7
|
|
|
@@ -1,66 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { ApolloLink, Observable as Observable$1 } from '@apollo/client/core/index.js';
|
|
3
3
|
import { print } from 'graphql';
|
|
4
|
-
import { c as createConsumer } from './index-client-
|
|
5
|
-
|
|
6
|
-
var name = "@quiltt/core";
|
|
7
|
-
var version$1 = "3.5.5";
|
|
8
|
-
|
|
9
|
-
const QUILTT_API_INSECURE = (()=>{
|
|
10
|
-
try {
|
|
11
|
-
return process.env.QUILTT_API_INSECURE;
|
|
12
|
-
} catch {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
})();
|
|
16
|
-
const QUILTT_API_DOMAIN = (()=>{
|
|
17
|
-
try {
|
|
18
|
-
return process.env.QUILTT_API_DOMAIN;
|
|
19
|
-
} catch {
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
})();
|
|
23
|
-
const QUILTT_DEBUG = (()=>{
|
|
24
|
-
try {
|
|
25
|
-
return !!process.env.QUILTT_DEBUG || process.env.NODE_ENV !== 'production';
|
|
26
|
-
} catch {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
})();
|
|
30
|
-
const domain = QUILTT_API_DOMAIN || 'quiltt.io';
|
|
31
|
-
const protocolHttp = `http${QUILTT_API_INSECURE ? '' : 's'}`;
|
|
32
|
-
const protocolWebsockets = `ws${QUILTT_API_DOMAIN ? '' : 's'}`;
|
|
33
|
-
const debugging = QUILTT_DEBUG;
|
|
34
|
-
const version = `${name}: v${version$1}`;
|
|
35
|
-
const cdnBase = `${protocolHttp}://cdn.${domain}`;
|
|
36
|
-
const endpointAuth = `${protocolHttp}://auth.${domain}/v1/users/session`;
|
|
37
|
-
const endpointGraphQL = `${protocolHttp}://api.${domain}/v1/graphql`;
|
|
38
|
-
const endpointWebsockets = `${protocolWebsockets}://api.${domain}/websockets`;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* This is designed to support singletons to share the memory states across all
|
|
42
|
-
* instance of hooks to ensure that updates only process once, by storing a value
|
|
43
|
-
* then notifying all subscribers when it's updated.
|
|
44
|
-
*/ class Observable {
|
|
45
|
-
constructor(initalState){
|
|
46
|
-
this.observers = [];
|
|
47
|
-
this.get = ()=>{
|
|
48
|
-
return this.state;
|
|
49
|
-
};
|
|
50
|
-
this.set = (nextState)=>{
|
|
51
|
-
if (this.state === nextState) return;
|
|
52
|
-
this.state = nextState;
|
|
53
|
-
this.observers.forEach((update)=>update(nextState));
|
|
54
|
-
};
|
|
55
|
-
this.subscribe = (observer)=>{
|
|
56
|
-
this.observers.push(observer);
|
|
57
|
-
};
|
|
58
|
-
this.unsubscribe = (observer)=>{
|
|
59
|
-
this.observers = this.observers.filter((update)=>update !== observer);
|
|
60
|
-
};
|
|
61
|
-
this.state = initalState;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
4
|
+
import { c as createConsumer } from './index-client-C87sSU05.js';
|
|
64
5
|
|
|
65
6
|
/**
|
|
66
7
|
* An error and type safe wrapper for localStorage.
|
|
@@ -136,6 +77,31 @@ const endpointWebsockets = `${protocolWebsockets}://api.${domain}/websockets`;
|
|
|
136
77
|
}
|
|
137
78
|
}
|
|
138
79
|
|
|
80
|
+
/**
|
|
81
|
+
* This is designed to support singletons to share the memory states across all
|
|
82
|
+
* instance of hooks to ensure that updates only process once, by storing a value
|
|
83
|
+
* then notifying all subscribers when it's updated.
|
|
84
|
+
*/ class Observable {
|
|
85
|
+
constructor(initalState){
|
|
86
|
+
this.observers = [];
|
|
87
|
+
this.get = ()=>{
|
|
88
|
+
return this.state;
|
|
89
|
+
};
|
|
90
|
+
this.set = (nextState)=>{
|
|
91
|
+
if (this.state === nextState) return;
|
|
92
|
+
this.state = nextState;
|
|
93
|
+
this.observers.forEach((update)=>update(nextState));
|
|
94
|
+
};
|
|
95
|
+
this.subscribe = (observer)=>{
|
|
96
|
+
this.observers.push(observer);
|
|
97
|
+
};
|
|
98
|
+
this.unsubscribe = (observer)=>{
|
|
99
|
+
this.observers = this.observers.filter((update)=>update !== observer);
|
|
100
|
+
};
|
|
101
|
+
this.state = initalState;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
139
105
|
/**
|
|
140
106
|
* This is designed to support effectively an in memory key value store singleton,
|
|
141
107
|
* similar to localstorage, but allows you to subscribe to changes within the current
|
|
@@ -236,6 +202,49 @@ const endpointWebsockets = `${protocolWebsockets}://api.${domain}/websockets`;
|
|
|
236
202
|
* basically acts like shared memory when there is no localStorage.
|
|
237
203
|
*/ const GlobalStorage = new Storage();
|
|
238
204
|
|
|
205
|
+
var name = "@quiltt/core";
|
|
206
|
+
var version$1 = "3.6.0";
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Retrieves the environment variable by key, with fallback and type conversion,
|
|
210
|
+
* supporting Node.js, Vite, and potentially other runtime environments.
|
|
211
|
+
*/ const getEnv = (key, fallback = undefined)=>{
|
|
212
|
+
try {
|
|
213
|
+
let value;
|
|
214
|
+
// Check if running under Node.js and use process.env
|
|
215
|
+
if (typeof process !== 'undefined' && process.env) {
|
|
216
|
+
value = process.env[key];
|
|
217
|
+
}
|
|
218
|
+
// Return the value after type conversion if necessary or use fallback
|
|
219
|
+
if (value === undefined || value === null) {
|
|
220
|
+
return fallback;
|
|
221
|
+
}
|
|
222
|
+
// Convert to boolean if the value is 'true' or 'false'
|
|
223
|
+
if (value === 'true' || value === 'false') {
|
|
224
|
+
return value === 'true';
|
|
225
|
+
}
|
|
226
|
+
// Convert to number if it's numeric
|
|
227
|
+
if (!isNaN(Number(value))) {
|
|
228
|
+
return Number(value);
|
|
229
|
+
}
|
|
230
|
+
return value;
|
|
231
|
+
} catch (error) {
|
|
232
|
+
return undefined;
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
const QUILTT_API_INSECURE = getEnv('QUILTT_API_INSECURE', false);
|
|
236
|
+
const QUILTT_API_DOMAIN = getEnv('QUILTT_API_DOMAIN', 'quiltt.io');
|
|
237
|
+
const QUILTT_DEBUG = getEnv('QUILTT_DEBUG', process?.env?.NODE_ENV !== 'production');
|
|
238
|
+
const domain = QUILTT_API_DOMAIN || 'quiltt.io';
|
|
239
|
+
const protocolHttp = `http${QUILTT_API_INSECURE ? '' : 's'}`;
|
|
240
|
+
const protocolWebsockets = `ws${QUILTT_API_INSECURE ? '' : 's'}`;
|
|
241
|
+
const debugging = QUILTT_DEBUG;
|
|
242
|
+
const version = `${name}: v${version$1}`;
|
|
243
|
+
const cdnBase = `${protocolHttp}://cdn.${domain}`;
|
|
244
|
+
const endpointAuth = `${protocolHttp}://auth.${domain}/v1/users/session`;
|
|
245
|
+
const endpointGraphQL = `${protocolHttp}://api.${domain}/v1/graphql`;
|
|
246
|
+
const endpointWebsockets = `${protocolWebsockets}://api.${domain}/websockets`;
|
|
247
|
+
|
|
239
248
|
class ActionCableLink extends ApolloLink {
|
|
240
249
|
constructor(options){
|
|
241
250
|
super();
|
|
@@ -297,4 +306,4 @@ class SubscriptionLink extends ActionCableLink {
|
|
|
297
306
|
}
|
|
298
307
|
}
|
|
299
308
|
|
|
300
|
-
export { GlobalStorage as G, LocalStorage as L, MemoryStorage as M, Observable as O, SubscriptionLink as S, endpointAuth as a,
|
|
309
|
+
export { GlobalStorage as G, LocalStorage as L, MemoryStorage as M, Observable as O, SubscriptionLink as S, endpointAuth as a, Storage as b, cdnBase as c, debugging as d, endpointGraphQL as e, endpointWebsockets as f, getEnv as g, version as v };
|