@quiltt/core 3.6.1 → 3.6.2
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 +6 -0
- package/dist/{SubscriptionLink-client-DOcfhNgq.js → SubscriptionLink-client-KnrzzvDN.js} +23 -29
- package/dist/{index-client-BExxNScK.js → index-client-DrtC68Ap.js} +1 -1
- package/dist/index.d.ts +2 -7
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/configuration.ts +20 -31
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @quiltt/core
|
|
2
2
|
|
|
3
|
+
## 3.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#236](https://github.com/quiltt/quiltt-js/pull/236) [`85c0be1`](https://github.com/quiltt/quiltt-js/commit/85c0be16803381de5dbd89a7295e326228542080) Thanks [@zubairaziz](https://github.com/zubairaziz)! - Fix config loading
|
|
8
|
+
|
|
3
9
|
## 3.6.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -1,7 +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-
|
|
4
|
+
import { c as createConsumer } from './index-client-DrtC68Ap.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* An error and type safe wrapper for localStorage.
|
|
@@ -204,38 +204,32 @@ import { c as createConsumer } from './index-client-BExxNScK.js';
|
|
|
204
204
|
*/ const GlobalStorage = new Storage();
|
|
205
205
|
|
|
206
206
|
var name = "@quiltt/core";
|
|
207
|
-
var version$1 = "3.6.
|
|
207
|
+
var version$1 = "3.6.2";
|
|
208
208
|
|
|
209
|
-
|
|
210
|
-
* Retrieves the environment variable by key, with fallback and type conversion,
|
|
211
|
-
* supporting Node.js, Vite, and potentially other runtime environments.
|
|
212
|
-
*/ const getEnv = (key, fallback = undefined)=>{
|
|
209
|
+
const QUILTT_API_INSECURE = (()=>{
|
|
213
210
|
try {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
if (typeof process !== 'undefined' && process.env) {
|
|
217
|
-
value = process.env[key];
|
|
218
|
-
}
|
|
219
|
-
// Return the value after type conversion if necessary or use fallback
|
|
220
|
-
if (value === undefined || value === null) {
|
|
221
|
-
return fallback;
|
|
222
|
-
}
|
|
223
|
-
// Convert to boolean if the value is 'true' or 'false'
|
|
224
|
-
if (value === 'true' || value === 'false') {
|
|
225
|
-
return value === 'true';
|
|
211
|
+
if (process.env.QUILTT_API_INSECURE === 'true' || process.env.QUILTT_API_INSECURE === 'false') {
|
|
212
|
+
return process.env.QUILTT_API_INSECURE === 'true';
|
|
226
213
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
return Number(value);
|
|
230
|
-
}
|
|
231
|
-
return value;
|
|
232
|
-
} catch (error) {
|
|
214
|
+
return process.env.QUILTT_API_INSECURE;
|
|
215
|
+
} catch {
|
|
233
216
|
return undefined;
|
|
234
217
|
}
|
|
235
|
-
};
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
218
|
+
})();
|
|
219
|
+
const QUILTT_API_DOMAIN = (()=>{
|
|
220
|
+
try {
|
|
221
|
+
return process.env.QUILTT_API_DOMAIN;
|
|
222
|
+
} catch {
|
|
223
|
+
return undefined;
|
|
224
|
+
}
|
|
225
|
+
})();
|
|
226
|
+
const QUILTT_DEBUG = (()=>{
|
|
227
|
+
try {
|
|
228
|
+
return !!process.env.QUILTT_DEBUG || process.env.NODE_ENV !== 'production';
|
|
229
|
+
} catch {
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
})();
|
|
239
233
|
const domain = QUILTT_API_DOMAIN || 'quiltt.io';
|
|
240
234
|
const protocolHttp = `http${QUILTT_API_INSECURE ? '' : 's'}`;
|
|
241
235
|
const protocolWebsockets = `ws${QUILTT_API_INSECURE ? '' : 's'}`;
|
|
@@ -307,4 +301,4 @@ class SubscriptionLink extends ActionCableLink {
|
|
|
307
301
|
}
|
|
308
302
|
}
|
|
309
303
|
|
|
310
|
-
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,
|
|
304
|
+
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, version as v };
|
package/dist/index.d.ts
CHANGED
|
@@ -395,12 +395,7 @@ declare class Storage<T> {
|
|
|
395
395
|
*/
|
|
396
396
|
declare const GlobalStorage: Storage<any>;
|
|
397
397
|
|
|
398
|
-
|
|
399
|
-
* Retrieves the environment variable by key, with fallback and type conversion,
|
|
400
|
-
* supporting Node.js, Vite, and potentially other runtime environments.
|
|
401
|
-
*/
|
|
402
|
-
declare const getEnv: (key: string, fallback?: any) => any;
|
|
403
|
-
declare const debugging: any;
|
|
398
|
+
declare const debugging: boolean;
|
|
404
399
|
declare const version: string;
|
|
405
400
|
declare const cdnBase: string;
|
|
406
401
|
declare const endpointAuth: string;
|
|
@@ -443,4 +438,4 @@ declare class Timeoutable {
|
|
|
443
438
|
private broadcast;
|
|
444
439
|
}
|
|
445
440
|
|
|
446
|
-
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,
|
|
441
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApolloLink, ApolloClient } from '@apollo/client/index.js';
|
|
2
2
|
export { InMemoryCache, gql, useMutation, useQuery, useSubscription } from '@apollo/client/index.js';
|
|
3
|
-
import { G as GlobalStorage, e as endpointGraphQL, v as version, d as debugging, S as SubscriptionLink, a as endpointAuth } from './SubscriptionLink-client-
|
|
4
|
-
export { L as LocalStorage, M as MemoryStorage, O as Observable, b as Storage, c as cdnBase, f as endpointWebsockets
|
|
3
|
+
import { G as GlobalStorage, e as endpointGraphQL, v as version, d as debugging, S as SubscriptionLink, a as endpointAuth } from './SubscriptionLink-client-KnrzzvDN.js';
|
|
4
|
+
export { L as LocalStorage, M as MemoryStorage, O as Observable, b as Storage, c as cdnBase, f as endpointWebsockets } from './SubscriptionLink-client-KnrzzvDN.js';
|
|
5
5
|
import { BatchHttpLink as BatchHttpLink$1 } from '@apollo/client/link/batch-http/index.js';
|
|
6
6
|
import crossfetch from 'cross-fetch';
|
|
7
7
|
import { onError } from '@apollo/client/link/error/index.js';
|
package/package.json
CHANGED
package/src/configuration.ts
CHANGED
|
@@ -1,42 +1,31 @@
|
|
|
1
1
|
import { name as packageName, version as packageVersion } from '../package.json'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
* Retrieves the environment variable by key, with fallback and type conversion,
|
|
5
|
-
* supporting Node.js, Vite, and potentially other runtime environments.
|
|
6
|
-
*/
|
|
7
|
-
export const getEnv = (key: string, fallback: any = undefined): any => {
|
|
3
|
+
const QUILTT_API_INSECURE = (() => {
|
|
8
4
|
try {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
// Check if running under Node.js and use process.env
|
|
12
|
-
if (typeof process !== 'undefined' && process.env) {
|
|
13
|
-
value = process.env[key]
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Return the value after type conversion if necessary or use fallback
|
|
17
|
-
if (value === undefined || value === null) {
|
|
18
|
-
return fallback
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Convert to boolean if the value is 'true' or 'false'
|
|
22
|
-
if (value === 'true' || value === 'false') {
|
|
23
|
-
return value === 'true'
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Convert to number if it's numeric
|
|
27
|
-
if (!isNaN(Number(value))) {
|
|
28
|
-
return Number(value)
|
|
5
|
+
if (process.env.QUILTT_API_INSECURE === 'true' || process.env.QUILTT_API_INSECURE === 'false') {
|
|
6
|
+
return process.env.QUILTT_API_INSECURE === 'true'
|
|
29
7
|
}
|
|
8
|
+
return process.env.QUILTT_API_INSECURE
|
|
9
|
+
} catch {
|
|
10
|
+
return undefined
|
|
11
|
+
}
|
|
12
|
+
})()
|
|
30
13
|
|
|
31
|
-
|
|
32
|
-
|
|
14
|
+
const QUILTT_API_DOMAIN = (() => {
|
|
15
|
+
try {
|
|
16
|
+
return process.env.QUILTT_API_DOMAIN
|
|
17
|
+
} catch {
|
|
33
18
|
return undefined
|
|
34
19
|
}
|
|
35
|
-
}
|
|
20
|
+
})()
|
|
36
21
|
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
const QUILTT_DEBUG = (() => {
|
|
23
|
+
try {
|
|
24
|
+
return !!process.env.QUILTT_DEBUG || process.env.NODE_ENV !== 'production'
|
|
25
|
+
} catch {
|
|
26
|
+
return false
|
|
27
|
+
}
|
|
28
|
+
})()
|
|
40
29
|
|
|
41
30
|
const domain = QUILTT_API_DOMAIN || 'quiltt.io'
|
|
42
31
|
const protocolHttp = `http${QUILTT_API_INSECURE ? '' : 's'}`
|