@quiltt/core 3.6.12 → 3.6.14
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 +12 -0
- package/dist/{SubscriptionLink-client-CGUaoxuA.js → SubscriptionLink-client-9B6w8jF6.js} +5 -8
- package/dist/index.d.ts +1 -76
- package/dist/index.js +3 -3
- package/package.json +3 -1
- package/src/api/graphql/links/ActionCableLink.ts +5 -4
- package/src/api/graphql/links/BatchHttpLink.ts +2 -2
- package/src/api/graphql/links/HttpLink.ts +1 -1
- package/src/api/graphql/links/VersionLink.ts +1 -1
- package/src/api/rest/auth.ts +1 -1
- package/src/configuration.ts +3 -6
- package/dist/index-client-AzYaJaCS.js +0 -560
- package/src/api/graphql/links/actioncable/README.md +0 -1
- package/src/api/graphql/links/actioncable/adapters.ts +0 -4
- package/src/api/graphql/links/actioncable/connection.ts +0 -188
- package/src/api/graphql/links/actioncable/connection_monitor.ts +0 -141
- package/src/api/graphql/links/actioncable/consumer.ts +0 -86
- package/src/api/graphql/links/actioncable/index.ts +0 -35
- package/src/api/graphql/links/actioncable/internal.ts +0 -19
- package/src/api/graphql/links/actioncable/logger.ts +0 -18
- package/src/api/graphql/links/actioncable/subscription.ts +0 -45
- package/src/api/graphql/links/actioncable/subscription_guarantor.ts +0 -54
- package/src/api/graphql/links/actioncable/subscriptions.ts +0 -113
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @quiltt/core
|
|
2
2
|
|
|
3
|
+
## 3.6.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#278](https://github.com/quiltt/quiltt-js/pull/278) [`0d9e43d`](https://github.com/quiltt/quiltt-js/commit/0d9e43d580d73279d7c078219749b000ebb59b02) Thanks [@rubendinho](https://github.com/rubendinho)! - Fix debug config during CI
|
|
8
|
+
|
|
9
|
+
## 3.6.13
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#276](https://github.com/quiltt/quiltt-js/pull/276) [`be1f9be`](https://github.com/quiltt/quiltt-js/commit/be1f9be957ef1a7686e6a25807275186c8dd51b4) Thanks [@rubendinho](https://github.com/rubendinho)! - Replace manually imported ActionCable code with official npm package
|
|
14
|
+
|
|
3
15
|
## 3.6.12
|
|
4
16
|
|
|
5
17
|
### 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
|
+
import { createConsumer } from '@rails/actioncable';
|
|
3
4
|
import { print } from 'graphql';
|
|
4
|
-
import { c as createConsumer } from './index-client-AzYaJaCS.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* An error and type safe wrapper for localStorage.
|
|
@@ -203,16 +203,13 @@ import { c as createConsumer } from './index-client-AzYaJaCS.js';
|
|
|
203
203
|
*/ const GlobalStorage = new Storage();
|
|
204
204
|
|
|
205
205
|
var name = "@quiltt/core";
|
|
206
|
-
var version$1 = "3.6.
|
|
206
|
+
var version$1 = "3.6.14";
|
|
207
207
|
|
|
208
208
|
const QUILTT_API_INSECURE = (()=>{
|
|
209
209
|
try {
|
|
210
|
-
|
|
211
|
-
return process.env.QUILTT_API_INSECURE === 'true';
|
|
212
|
-
}
|
|
213
|
-
return process.env.QUILTT_API_INSECURE;
|
|
210
|
+
return process.env.QUILTT_API_INSECURE === 'true';
|
|
214
211
|
} catch {
|
|
215
|
-
return
|
|
212
|
+
return false;
|
|
216
213
|
}
|
|
217
214
|
})();
|
|
218
215
|
const QUILTT_API_DOMAIN = (()=>{
|
|
@@ -224,7 +221,7 @@ const QUILTT_API_DOMAIN = (()=>{
|
|
|
224
221
|
})();
|
|
225
222
|
const QUILTT_DEBUG = (()=>{
|
|
226
223
|
try {
|
|
227
|
-
return
|
|
224
|
+
return process.env.NODE_ENV !== 'production' && process.env.QUILTT_DEBUG === 'true';
|
|
228
225
|
} catch {
|
|
229
226
|
return false;
|
|
230
227
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import * as _apollo_client from '@apollo/client';
|
|
|
5
5
|
import { HttpLink as HttpLink$1 } from '@apollo/client/link/http/index.js';
|
|
6
6
|
import { RetryLink as RetryLink$1 } from '@apollo/client/link/retry/index.js';
|
|
7
7
|
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';
|
|
8
|
+
import { Consumer } from '@rails/actioncable';
|
|
8
9
|
import { Dispatch, SetStateAction } from 'react';
|
|
9
10
|
|
|
10
11
|
interface CallbackManager {
|
|
@@ -92,82 +93,6 @@ declare const HttpLink: HttpLink$1;
|
|
|
92
93
|
|
|
93
94
|
declare const RetryLink: RetryLink$1;
|
|
94
95
|
|
|
95
|
-
declare class Connection {
|
|
96
|
-
constructor(consumer: any);
|
|
97
|
-
send(data: any): boolean;
|
|
98
|
-
open(): boolean;
|
|
99
|
-
close({ allowReconnect }?: {
|
|
100
|
-
allowReconnect: boolean;
|
|
101
|
-
}): any;
|
|
102
|
-
reopen(): any;
|
|
103
|
-
getProtocol(): any;
|
|
104
|
-
isOpen(): boolean;
|
|
105
|
-
isActive(): boolean;
|
|
106
|
-
triedToReconnect(): boolean;
|
|
107
|
-
isProtocolSupported(): boolean;
|
|
108
|
-
isState(...states: any[]): boolean;
|
|
109
|
-
getState(): string | null;
|
|
110
|
-
installEventHandlers(): void;
|
|
111
|
-
uninstallEventHandlers(): void;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
type Data = {
|
|
115
|
-
[id: string]: string | object | null | undefined;
|
|
116
|
-
};
|
|
117
|
-
declare class Subscription {
|
|
118
|
-
consumer: Consumer;
|
|
119
|
-
identifier: string;
|
|
120
|
-
constructor(consumer: Consumer, params: Data | undefined, mixin: Data);
|
|
121
|
-
perform(action: string, data?: Data): boolean;
|
|
122
|
-
send(data: object): boolean;
|
|
123
|
-
unsubscribe(): Subscription;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
declare class SubscriptionGuarantor {
|
|
127
|
-
subscriptions: Subscriptions;
|
|
128
|
-
pendingSubscriptions: Array<Subscription>;
|
|
129
|
-
retryTimeout: ReturnType<typeof setTimeout> | undefined;
|
|
130
|
-
constructor(subscriptions: Subscriptions);
|
|
131
|
-
guarantee(subscription: Subscription): void;
|
|
132
|
-
forget(subscription: Subscription): void;
|
|
133
|
-
startGuaranteeing(): void;
|
|
134
|
-
stopGuaranteeing(): void;
|
|
135
|
-
retrySubscribing(): void;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
declare class Subscriptions {
|
|
139
|
-
consumer: Consumer;
|
|
140
|
-
guarantor: SubscriptionGuarantor;
|
|
141
|
-
subscriptions: Array<Subscription>;
|
|
142
|
-
constructor(consumer: Consumer);
|
|
143
|
-
create(channelName: string, mixin: Data): Subscription;
|
|
144
|
-
add(subscription: Subscription): Subscription;
|
|
145
|
-
remove(subscription: Subscription): Subscription;
|
|
146
|
-
reject(identifier: string): Subscription[];
|
|
147
|
-
forget(subscription: Subscription): Subscription;
|
|
148
|
-
findAll(identifier: string): Subscription[];
|
|
149
|
-
reload(): void[];
|
|
150
|
-
notifyAll(callbackName: string, ...args: any[]): any[][];
|
|
151
|
-
notify(subscription: Subscription, callbackName: string, ...args: any[]): any[];
|
|
152
|
-
subscribe(subscription: Subscription): void;
|
|
153
|
-
confirmSubscription(identifier: string): void;
|
|
154
|
-
sendCommand(subscription: Subscription, command: string): boolean;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
declare class Consumer {
|
|
158
|
-
_url: string;
|
|
159
|
-
subscriptions: Subscriptions;
|
|
160
|
-
connection: Connection;
|
|
161
|
-
subprotocols: Array<string>;
|
|
162
|
-
constructor(url: string);
|
|
163
|
-
get url(): string;
|
|
164
|
-
send(data: object): boolean;
|
|
165
|
-
connect(): boolean;
|
|
166
|
-
disconnect(): any;
|
|
167
|
-
ensureActiveConnection(): boolean | undefined;
|
|
168
|
-
addSubProtocol(subprotocol: string): void;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
96
|
type RequestResult = FetchResult$1<{
|
|
172
97
|
[key: string]: unknown;
|
|
173
98
|
}, Record<string, unknown>, Record<string, unknown>>;
|
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 } from './SubscriptionLink-client-
|
|
3
|
+
import { G as GlobalStorage, e as endpointGraphQL, v as version, d as debugging, S as SubscriptionLink, a as endpointAuth } from './SubscriptionLink-client-9B6w8jF6.js';
|
|
4
|
+
export { L as LocalStorage, M as MemoryStorage, O as Observable, b as Storage, c as cdnBase, f as endpointWebsockets } from './SubscriptionLink-client-9B6w8jF6.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';
|
|
@@ -164,7 +164,7 @@ var AuthStrategies;
|
|
|
164
164
|
AuthStrategies["Email"] = "email";
|
|
165
165
|
AuthStrategies["Phone"] = "phone";
|
|
166
166
|
})(AuthStrategies || (AuthStrategies = {}));
|
|
167
|
-
// https://www.quiltt.dev/api-reference/
|
|
167
|
+
// https://www.quiltt.dev/api-reference/auth
|
|
168
168
|
class AuthAPI {
|
|
169
169
|
constructor(clientId){
|
|
170
170
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quiltt/core",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.14",
|
|
4
4
|
"description": "Javascript API client and utilities for Quiltt",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"quiltt",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@apollo/client": "^3.9.9",
|
|
37
|
+
"@rails/actioncable": "^7.1.3-4",
|
|
37
38
|
"cross-fetch": "^4.0.0",
|
|
38
39
|
"graphql": "^16.9.0",
|
|
39
40
|
"graphql-ruby-client": "^1.14.0"
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@biomejs/biome": "1.8.3",
|
|
43
44
|
"@types/node": "20.14.10",
|
|
45
|
+
"@types/rails__actioncable": "6.1.11",
|
|
44
46
|
"@types/react": "18.3.3",
|
|
45
47
|
"bunchee": "5.2.2",
|
|
46
48
|
"rimraf": "6.0.0",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { GlobalStorage } from '@/storage'
|
|
2
1
|
import type { FetchResult, NextLink, Operation } from '@apollo/client/core/index.js'
|
|
3
2
|
import { ApolloLink, Observable } from '@apollo/client/core/index.js'
|
|
3
|
+
import { createConsumer } from '@rails/actioncable'
|
|
4
|
+
import type { Consumer } from '@rails/actioncable'
|
|
4
5
|
import { print } from 'graphql'
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
6
|
+
|
|
7
|
+
import { endpointWebsockets } from '@/configuration'
|
|
8
|
+
import { GlobalStorage } from '@/storage'
|
|
8
9
|
|
|
9
10
|
type RequestResult = FetchResult<
|
|
10
11
|
{ [key: string]: unknown },
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BatchHttpLink as ApolloHttpLink } from '@apollo/client/link/batch-http/index.js'
|
|
2
2
|
import crossfetch from 'cross-fetch'
|
|
3
3
|
|
|
4
|
+
import { endpointGraphQL } from '@/configuration'
|
|
5
|
+
|
|
4
6
|
// Use `cross-fetch` only if `fetch` is not available on the `globalThis` object
|
|
5
7
|
const effectiveFetch = typeof fetch === 'undefined' ? crossfetch : fetch
|
|
6
8
|
|
|
7
|
-
import { endpointGraphQL } from '../../../configuration'
|
|
8
|
-
|
|
9
9
|
export const BatchHttpLink = new ApolloHttpLink({
|
|
10
10
|
uri: endpointGraphQL,
|
|
11
11
|
fetch: effectiveFetch,
|
|
@@ -4,7 +4,7 @@ import crossfetch from 'cross-fetch'
|
|
|
4
4
|
// Use `cross-fetch` only if `fetch` is not available on the `globalThis` object
|
|
5
5
|
const effectiveFetch = typeof fetch === 'undefined' ? crossfetch : fetch
|
|
6
6
|
|
|
7
|
-
import { endpointGraphQL } from '
|
|
7
|
+
import { endpointGraphQL } from '@/configuration'
|
|
8
8
|
|
|
9
9
|
export const HttpLink = new ApolloHttpLink({
|
|
10
10
|
uri: endpointGraphQL,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApolloLink } from '@apollo/client/index.js'
|
|
2
2
|
|
|
3
|
-
import { version } from '
|
|
3
|
+
import { version } from '@/configuration'
|
|
4
4
|
|
|
5
5
|
export const VersionLink = new ApolloLink((operation, forward) => {
|
|
6
6
|
operation.setContext(({ headers = {} }) => ({
|
package/src/api/rest/auth.ts
CHANGED
|
@@ -33,7 +33,7 @@ type Revoke = NoContentData | UnauthorizedData
|
|
|
33
33
|
export type SessionResponse = FetchResponse<SessionData>
|
|
34
34
|
export type UnprocessableResponse = FetchResponse<UnprocessableData>
|
|
35
35
|
|
|
36
|
-
// https://www.quiltt.dev/api-reference/
|
|
36
|
+
// https://www.quiltt.dev/api-reference/auth
|
|
37
37
|
export class AuthAPI {
|
|
38
38
|
clientId: string | undefined
|
|
39
39
|
|
package/src/configuration.ts
CHANGED
|
@@ -2,12 +2,9 @@ import { name as packageName, version as packageVersion } from '../package.json'
|
|
|
2
2
|
|
|
3
3
|
const QUILTT_API_INSECURE = (() => {
|
|
4
4
|
try {
|
|
5
|
-
|
|
6
|
-
return process.env.QUILTT_API_INSECURE === 'true'
|
|
7
|
-
}
|
|
8
|
-
return process.env.QUILTT_API_INSECURE
|
|
5
|
+
return process.env.QUILTT_API_INSECURE === 'true'
|
|
9
6
|
} catch {
|
|
10
|
-
return
|
|
7
|
+
return false
|
|
11
8
|
}
|
|
12
9
|
})()
|
|
13
10
|
|
|
@@ -21,7 +18,7 @@ const QUILTT_API_DOMAIN = (() => {
|
|
|
21
18
|
|
|
22
19
|
const QUILTT_DEBUG = (() => {
|
|
23
20
|
try {
|
|
24
|
-
return
|
|
21
|
+
return process.env.NODE_ENV !== 'production' && process.env.QUILTT_DEBUG === 'true'
|
|
25
22
|
} catch {
|
|
26
23
|
return false
|
|
27
24
|
}
|