@contello/client 3.2.0 → 3.2.1
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/dist/cli.js +1 -1
- package/dist/generate-Db8wmmzJ.js +3 -0
- package/dist/index.cjs +22 -27
- package/dist/index.d.cts +8 -8
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -27
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
- package/dist/generate-CqlYWWhF.js +0 -1338
- package/dist/generate-CqlYWWhF.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const command = process.argv[2];
|
|
4
4
|
switch (command) {
|
|
5
5
|
case "generate":
|
|
6
|
-
await import("./generate-
|
|
6
|
+
await import("./generate-Db8wmmzJ.js");
|
|
7
7
|
break;
|
|
8
8
|
default:
|
|
9
9
|
console.error(command ? `unknown command: ${command}` : "usage: contello-client <command>");
|
package/dist/index.cjs
CHANGED
|
@@ -637,12 +637,11 @@ function upload(url, project, token, data, meta, options) {
|
|
|
637
637
|
else sendStream(data);
|
|
638
638
|
return;
|
|
639
639
|
}
|
|
640
|
-
if (message.type
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
}
|
|
640
|
+
if (message.type !== "done") return;
|
|
641
|
+
done = true;
|
|
642
|
+
cleanup();
|
|
643
|
+
ws.close();
|
|
644
|
+
resolve(message.id);
|
|
646
645
|
});
|
|
647
646
|
ws.addEventListener("error", () => {
|
|
648
647
|
cleanup();
|
|
@@ -675,17 +674,15 @@ var ContelloClient = class {
|
|
|
675
674
|
let connectedCount = 0;
|
|
676
675
|
const onConnectionUp = () => {
|
|
677
676
|
connectedCount++;
|
|
678
|
-
if (connectedCount
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
}
|
|
677
|
+
if (connectedCount !== connections || state === "connected") return;
|
|
678
|
+
state = "connected";
|
|
679
|
+
options.onConnected?.();
|
|
682
680
|
};
|
|
683
681
|
const onConnectionDown = () => {
|
|
684
682
|
if (connectedCount > 0) connectedCount--;
|
|
685
|
-
if (state
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
}
|
|
683
|
+
if (state !== "connected") return;
|
|
684
|
+
state = "reconnecting";
|
|
685
|
+
options.onReconnecting?.();
|
|
689
686
|
};
|
|
690
687
|
this._pool = new ConnectionPool((id) => {
|
|
691
688
|
const context = Object.freeze({
|
|
@@ -777,22 +774,20 @@ var ContelloClient = class {
|
|
|
777
774
|
error(err) {
|
|
778
775
|
done = true;
|
|
779
776
|
error = err;
|
|
780
|
-
if (pending)
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
}
|
|
777
|
+
if (!pending) return;
|
|
778
|
+
const p = pending;
|
|
779
|
+
pending = void 0;
|
|
780
|
+
p.reject(err);
|
|
785
781
|
},
|
|
786
782
|
complete() {
|
|
787
783
|
done = true;
|
|
788
|
-
if (pending)
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
}
|
|
784
|
+
if (!pending) return;
|
|
785
|
+
const p = pending;
|
|
786
|
+
pending = void 0;
|
|
787
|
+
p.resolve({
|
|
788
|
+
value: void 0,
|
|
789
|
+
done: true
|
|
790
|
+
});
|
|
796
791
|
}
|
|
797
792
|
});
|
|
798
793
|
return {
|
package/dist/index.d.cts
CHANGED
|
@@ -211,7 +211,7 @@ type ContelloClientOptions<TSchema extends Schema | undefined = undefined> = {
|
|
|
211
211
|
onError?: ((error: unknown) => void) | undefined;
|
|
212
212
|
connectionEvents?: ConnectionEvents | undefined;
|
|
213
213
|
};
|
|
214
|
-
declare class ContelloClient<TSchema extends Schema | undefined = undefined> {
|
|
214
|
+
export declare class ContelloClient<TSchema extends Schema | undefined = undefined> {
|
|
215
215
|
private _pool;
|
|
216
216
|
private _rpc;
|
|
217
217
|
private _sources;
|
|
@@ -237,7 +237,7 @@ declare class ContelloClient<TSchema extends Schema | undefined = undefined> {
|
|
|
237
237
|
upload(data: UploadData, meta: UploadMetadata, options?: UploadOptions | undefined): Promise<string>;
|
|
238
238
|
execute<TData>(query: string, variables?: Record<string, unknown> | undefined): Promise<TData>;
|
|
239
239
|
}
|
|
240
|
-
declare function createContelloClient<TSchema extends Schema | undefined = undefined>(options: ContelloClientOptions<TSchema>): ContelloClient<TSchema>;
|
|
240
|
+
export declare function createContelloClient<TSchema extends Schema | undefined = undefined>(options: ContelloClientOptions<TSchema>): ContelloClient<TSchema>;
|
|
241
241
|
//#endregion
|
|
242
242
|
//#region src/scalars.d.ts
|
|
243
243
|
type LocalDateTime = {
|
|
@@ -255,7 +255,7 @@ type LocalDate = {
|
|
|
255
255
|
};
|
|
256
256
|
//#endregion
|
|
257
257
|
//#region src/source-subscription.d.ts
|
|
258
|
-
declare function createSourceSubscription(source: SourceDef): string;
|
|
258
|
+
export declare function createSourceSubscription(source: SourceDef): string;
|
|
259
259
|
//#endregion
|
|
260
260
|
//#region src/source-mutation.d.ts
|
|
261
261
|
type SourceMutationKind = keyof SourceMutations;
|
|
@@ -265,16 +265,16 @@ type SourceMutationValues = {
|
|
|
265
265
|
id?: string | undefined;
|
|
266
266
|
};
|
|
267
267
|
/** The mutation document for one write operation of a source. Cached per source + kind. */
|
|
268
|
-
declare function createSourceMutation(source: SourceDef, kind: SourceMutationKind): string;
|
|
268
|
+
export declare function createSourceMutation(source: SourceDef, kind: SourceMutationKind): string;
|
|
269
269
|
/**
|
|
270
270
|
* Variables for a write: one per bound argument, the input nested under the envelope field when
|
|
271
271
|
* the argument is a one-field wrapper, and everything encoded on the way out (LocalDate /
|
|
272
272
|
* LocalDateTime structs become wire strings) — every caller goes through here, so no write path
|
|
273
273
|
* can skip the encoding.
|
|
274
274
|
*/
|
|
275
|
-
declare function createSourceMutationVariables(binding: SourceMutationBinding, values: SourceMutationValues): Record<string, unknown>;
|
|
275
|
+
export declare function createSourceMutationVariables(binding: SourceMutationBinding, values: SourceMutationValues): Record<string, unknown>;
|
|
276
276
|
/** Pulls the id out of whatever shape the mutation answered with. */
|
|
277
|
-
declare function readSourceMutationId(binding: SourceMutationBinding, result: unknown): string;
|
|
277
|
+
export declare function readSourceMutationId(binding: SourceMutationBinding, result: unknown): string;
|
|
278
278
|
//#endregion
|
|
279
279
|
//#region src/built-in-mutations.d.ts
|
|
280
280
|
/**
|
|
@@ -289,7 +289,7 @@ declare function readSourceMutationId(binding: SourceMutationBinding, result: un
|
|
|
289
289
|
*
|
|
290
290
|
* Assets have no `create` — an asset comes into being through `client.upload()`, not a mutation.
|
|
291
291
|
*/
|
|
292
|
-
declare const BUILT_IN_MUTATIONS: Partial<Record<SourceCardinality, SourceMutations>>;
|
|
292
|
+
export declare const BUILT_IN_MUTATIONS: Partial<Record<SourceCardinality, SourceMutations>>;
|
|
293
293
|
//#endregion
|
|
294
|
-
export {
|
|
294
|
+
export type { ConnectionContext, ConnectionEvents, ContelloClientOptions, DownloadResult, HttpAgentOptions, LocalDate, LocalDateTime, OperationDef, OperationKind, OperationMap, ProxyResult, Rpc, Schema, SitemapProxyOptions, SourceAccessors, SourceCardinality, SourceDef, SourceMap, SourceMutationArgument, SourceMutationBinding, SourceMutationKind, SourceMutationResult, SourceMutationValues, SourceMutations, SourceWrites, UploadData, UploadMetadata, UploadOptions };
|
|
295
295
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/http.ts","../src/types.ts","../src/upload.ts","../src/client.ts","../src/scalars.ts","../src/source-subscription.ts","../src/source-mutation.ts","../src/built-in-mutations.ts"],"mappings":";;;KAkCY;EACV;EACA;EACA;EACA;;KAcU;EACV;EACA;EACA,SAAS,QAAQ;EACjB,UAAU,eAAe;;KAiCf;EACV;EACA,SAAS;EACT,UAAU,eAAe;;KAqBf;;EAEV;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U;;;;;;;KAQ7E,iBAAiB,MAAM,SAAS;EAAa,cAAc;;EAC1D,SAAS,OAAO,YAAY,QAAQ,SAAS;IAC/C,yBACD,SAAS;EAAa,cAAc;;EACjC,SAAS,OAAO,YAAY,QAAQ,SAAS;IAC/C,yBACD,SAAS;EAAa,cAAc;;EACjC,SAAS,OAAO,YAAY;IAC9B;;KAGQ,gBAAgB,iBAAiB,gBAC1C,WAAW;EAAa,OAAO,iBAAiB,SAAS;IAAQ,iBAAiB,SAAS;;;KC7KlF;EACV;EACA;EACA;EACA;IAAgB;IAAa;;EAC7B;;KAGU,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":["NodeReadableStream"],"sources":["../src/http.ts","../src/types.ts","../src/upload.ts","../src/client.ts","../src/scalars.ts","../src/source-subscription.ts","../src/source-mutation.ts","../src/built-in-mutations.ts"],"mappings":";;;KAkCY;EACV;EACA;EACA;EACA;;KAcU;EACV;EACA;EACA,SAAS,QAAQ;EACjB,UAAU,eAAe;;KAiCf;EACV;EACA,SAAS;EACT,UAAU,eAAe;;KAqBf;;EAEV;;EAEA;;EAEA;;EAEA;;;;KCzHU;KAEA,aACV,mBACA,aAAa,yBACb,cAAc,gBAAgB;EAE9B;EACA,MAAM;;EAEN,WAAW;;EAEX,cAAc;;KAGJ,eAAe,eAAe;KAE9B,YAAY,UAAU,gBAAgB,YAAY;KAClD,eAAe,UAAU,gBAAgB,YAAY;KAErD,UAAU,UAAU,gBAAgB,mCAC5C,eAAe,WAAW,8BAClB,cAAc,YAAY,OAC/B,WAAW,eAAe,OAAO,cAAc,YAAY,MAC9D,eAAe,WAAW,8BAClB,QAAQ,YAAY,OACzB,WAAW,eAAe,OAAO,QAAQ,YAAY;KAEhD,IAAI,UAAU,mBACvB,WAAW,IAAI,UAAU,EAAE;;;;;;;;;KAWlB;;;;;;KAOA;;EAEV;;EAEA;;EAEA;;;;;EAKA;;;;;;;;KASU;;;;;KAMA;;EAEV;EACA,WAAW;EACX,QAAQ;;;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,gBAAgB;EAChD;EACA;EACA;EACA,SAAS;EACT;EACA,OAAO;EACP;EACA;EACA,YAAY;EACZ,mBAAmB;;qBAKR,eAAe,gBAAgB;UAClC;UACA;UACA;UACA;UACA;UACA;UACA;EAEI,YAAA,SAAS,sBAAsB;MAuFvC,OAAO,gBAAgB,aAAa,kBAAkB,IAAI;MAQ1D,WAAW,gBAAgB,kBAAkB,iBAAiB,gBAAgB;EAQ5E,QAAQ;EAIR,WAAW;EAKX,QAAQ;;;;;;EAUd,UAAU,OAAO,eAAe,YAAY,sCAAsC,cAAc;EA2FhG,SAAS,iBAAiB,QAAQ;EAIlC,SAAS,cAAc,SAAS,0BAA0B,QAAQ;EAIlE,aACE,mBACA,SAAS,qBACT,SAAS,0BACR,QAAQ;EAOX,OAAO,MAAM,YAAY,MAAM,gBAAgB,UAAU,4BAA4B;EAOrF,QAAQ,OAAO,eAAe,YAAY,sCAAsC,QAAQ;;wBAS1E,qBAAqB,gBAAgB,gCACnD,SAAS,sBAAsB,WAC9B,eAAe;;;KCtTN;EACV;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;EACA;;;;wBCcc,yBAAyB,QAAQ;;;KCvBrC,2BAA2B;;KAG3B;EACV;EACA;;;wBAwBc,qBAAqB,QAAQ,WAAW,MAAM;;;;;;;wBA+B9C,8BACd,SAAS,uBACT,QAAQ,uBACP;;wBAYa,qBAAqB,SAAS,uBAAuB;;;;;;;;;;;;;;;qBChExD,oBAAoB,QAAQ,OAAO,mBAAmB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -211,7 +211,7 @@ type ContelloClientOptions<TSchema extends Schema | undefined = undefined> = {
|
|
|
211
211
|
onError?: ((error: unknown) => void) | undefined;
|
|
212
212
|
connectionEvents?: ConnectionEvents | undefined;
|
|
213
213
|
};
|
|
214
|
-
declare class ContelloClient<TSchema extends Schema | undefined = undefined> {
|
|
214
|
+
export declare class ContelloClient<TSchema extends Schema | undefined = undefined> {
|
|
215
215
|
private _pool;
|
|
216
216
|
private _rpc;
|
|
217
217
|
private _sources;
|
|
@@ -237,7 +237,7 @@ declare class ContelloClient<TSchema extends Schema | undefined = undefined> {
|
|
|
237
237
|
upload(data: UploadData, meta: UploadMetadata, options?: UploadOptions | undefined): Promise<string>;
|
|
238
238
|
execute<TData>(query: string, variables?: Record<string, unknown> | undefined): Promise<TData>;
|
|
239
239
|
}
|
|
240
|
-
declare function createContelloClient<TSchema extends Schema | undefined = undefined>(options: ContelloClientOptions<TSchema>): ContelloClient<TSchema>;
|
|
240
|
+
export declare function createContelloClient<TSchema extends Schema | undefined = undefined>(options: ContelloClientOptions<TSchema>): ContelloClient<TSchema>;
|
|
241
241
|
//#endregion
|
|
242
242
|
//#region src/scalars.d.ts
|
|
243
243
|
type LocalDateTime = {
|
|
@@ -255,7 +255,7 @@ type LocalDate = {
|
|
|
255
255
|
};
|
|
256
256
|
//#endregion
|
|
257
257
|
//#region src/source-subscription.d.ts
|
|
258
|
-
declare function createSourceSubscription(source: SourceDef): string;
|
|
258
|
+
export declare function createSourceSubscription(source: SourceDef): string;
|
|
259
259
|
//#endregion
|
|
260
260
|
//#region src/source-mutation.d.ts
|
|
261
261
|
type SourceMutationKind = keyof SourceMutations;
|
|
@@ -265,16 +265,16 @@ type SourceMutationValues = {
|
|
|
265
265
|
id?: string | undefined;
|
|
266
266
|
};
|
|
267
267
|
/** The mutation document for one write operation of a source. Cached per source + kind. */
|
|
268
|
-
declare function createSourceMutation(source: SourceDef, kind: SourceMutationKind): string;
|
|
268
|
+
export declare function createSourceMutation(source: SourceDef, kind: SourceMutationKind): string;
|
|
269
269
|
/**
|
|
270
270
|
* Variables for a write: one per bound argument, the input nested under the envelope field when
|
|
271
271
|
* the argument is a one-field wrapper, and everything encoded on the way out (LocalDate /
|
|
272
272
|
* LocalDateTime structs become wire strings) — every caller goes through here, so no write path
|
|
273
273
|
* can skip the encoding.
|
|
274
274
|
*/
|
|
275
|
-
declare function createSourceMutationVariables(binding: SourceMutationBinding, values: SourceMutationValues): Record<string, unknown>;
|
|
275
|
+
export declare function createSourceMutationVariables(binding: SourceMutationBinding, values: SourceMutationValues): Record<string, unknown>;
|
|
276
276
|
/** Pulls the id out of whatever shape the mutation answered with. */
|
|
277
|
-
declare function readSourceMutationId(binding: SourceMutationBinding, result: unknown): string;
|
|
277
|
+
export declare function readSourceMutationId(binding: SourceMutationBinding, result: unknown): string;
|
|
278
278
|
//#endregion
|
|
279
279
|
//#region src/built-in-mutations.d.ts
|
|
280
280
|
/**
|
|
@@ -289,7 +289,7 @@ declare function readSourceMutationId(binding: SourceMutationBinding, result: un
|
|
|
289
289
|
*
|
|
290
290
|
* Assets have no `create` — an asset comes into being through `client.upload()`, not a mutation.
|
|
291
291
|
*/
|
|
292
|
-
declare const BUILT_IN_MUTATIONS: Partial<Record<SourceCardinality, SourceMutations>>;
|
|
292
|
+
export declare const BUILT_IN_MUTATIONS: Partial<Record<SourceCardinality, SourceMutations>>;
|
|
293
293
|
//#endregion
|
|
294
|
-
export {
|
|
294
|
+
export type { ConnectionContext, ConnectionEvents, ContelloClientOptions, DownloadResult, HttpAgentOptions, LocalDate, LocalDateTime, OperationDef, OperationKind, OperationMap, ProxyResult, Rpc, Schema, SitemapProxyOptions, SourceAccessors, SourceCardinality, SourceDef, SourceMap, SourceMutationArgument, SourceMutationBinding, SourceMutationKind, SourceMutationResult, SourceMutationValues, SourceMutations, SourceWrites, UploadData, UploadMetadata, UploadOptions };
|
|
295
295
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/http.ts","../src/types.ts","../src/upload.ts","../src/client.ts","../src/scalars.ts","../src/source-subscription.ts","../src/source-mutation.ts","../src/built-in-mutations.ts"],"mappings":";;;KAkCY;EACV;EACA;EACA;EACA;;KAcU;EACV;EACA;EACA,SAAS,QAAQ;EACjB,UAAU,eAAe;;KAiCf;EACV;EACA,SAAS;EACT,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,UAAU,kBAAkB,yBAAyB,UAAU;;;;;;;KAQ7E,iBAAiB,MAAM,SAAS;EAAa,cAAc;;EAC1D,SAAS,OAAO,YAAY,QAAQ,SAAS;IAC/C,yBACD,SAAS;EAAa,cAAc;;EACjC,SAAS,OAAO,YAAY,QAAQ,SAAS;IAC/C,yBACD,SAAS;EAAa,cAAc;;EACjC,SAAS,OAAO,YAAY;IAC9B;;KAGQ,gBAAgB,iBAAiB,gBAC1C,WAAW;EAAa,OAAO,iBAAiB,SAAS;IAAQ,iBAAiB,SAAS;;;KC7KlF;EACV;EACA;EACA;EACA;IAAgB;IAAa;;EAC7B;;KAGU,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["NodeReadableStream"],"sources":["../src/http.ts","../src/types.ts","../src/upload.ts","../src/client.ts","../src/scalars.ts","../src/source-subscription.ts","../src/source-mutation.ts","../src/built-in-mutations.ts"],"mappings":";;;KAkCY;EACV;EACA;EACA;EACA;;KAcU;EACV;EACA;EACA,SAAS,QAAQ;EACjB,UAAU,eAAe;;KAiCf;EACV;EACA,SAAS;EACT,UAAU,eAAe;;KAqBf;;EAEV;;EAEA;;EAEA;;EAEA;;;;KCzHU;KAEA,aACV,mBACA,aAAa,yBACb,cAAc,gBAAgB;EAE9B;EACA,MAAM;;EAEN,WAAW;;EAEX,cAAc;;KAGJ,eAAe,eAAe;KAE9B,YAAY,UAAU,gBAAgB,YAAY;KAClD,eAAe,UAAU,gBAAgB,YAAY;KAErD,UAAU,UAAU,gBAAgB,mCAC5C,eAAe,WAAW,8BAClB,cAAc,YAAY,OAC/B,WAAW,eAAe,OAAO,cAAc,YAAY,MAC9D,eAAe,WAAW,8BAClB,QAAQ,YAAY,OACzB,WAAW,eAAe,OAAO,QAAQ,YAAY;KAEhD,IAAI,UAAU,mBACvB,WAAW,IAAI,UAAU,EAAE;;;;;;;;;KAWlB;;;;;;KAOA;;EAEV;;EAEA;;EAEA;;;;;EAKA;;;;;;;;KASU;;;;;KAMA;;EAE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AS,mBAAmB;;KAG9B,sBAAsB,gBAAgB;EAChD;EACA;EACA;EACA,SAAS;EACT;EACA,OAAO;EACP;EACA;EACA,YAAY;EACZ,mBAAmB;;qBAKR,eAAe,gBAAgB;UAClC;UACA;UACA;UACA;UACA;UACA;UACA;EAEI,YAAA,SAAS,sBAAsB;MAuFvC,OAAO,gBAAgB,aAAa,kBAAkB,IAAI;MAQ1D,WAAW,gBAAgB,kBAAkB,iBAAiB,gBAAgB;EAQ5E,QAAQ;EAIR,WAAW;EAKX,QAAQ;;;;;;EAUd,UAAU,OAAO,eAAe,YAAY,sCAAsC,cAAc;EA2FhG,SAAS,iBAAiB,QAAQ;EAIlC,SAAS,cAAc,SAAS,0BAA0B,QAAQ;EAIlE,aACE,mBACA,SAAS,qBACT,SAAS,0BACR,QAAQ;EAOX,OAAO,MAAM,YAAY,MAAM,gBAAgB,UAAU,4BAA4B;EAOrF,QAAQ,OAAO,eAAe,YAAY,sCAAsC,QAAQ;;wBAS1E,qBAAqB,gBAAgB,gCACnD,SAAS,sBAAsB,WAC9B,eAAe;;;KCtTN;EACV;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;EACA;;;;wBCcc,yBAAyB,QAAQ;;;KCvBrC,2BAA2B;;KAG3B;EACV;EACA;;;wBAwBc,qBAAqB,QAAQ,WAAW,MAAM;;;;;;;wBA+B9C,8BACd,SAAS,uBACT,QAAQ,uBACP;;wBAYa,qBAAqB,SAAS,uBAAuB;;;;;;;;;;;;;;;qBChExD,oBAAoB,QAAQ,OAAO,mBAAmB"}
|
package/dist/index.js
CHANGED
|
@@ -636,12 +636,11 @@ function upload(url, project, token, data, meta, options) {
|
|
|
636
636
|
else sendStream(data);
|
|
637
637
|
return;
|
|
638
638
|
}
|
|
639
|
-
if (message.type
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
}
|
|
639
|
+
if (message.type !== "done") return;
|
|
640
|
+
done = true;
|
|
641
|
+
cleanup();
|
|
642
|
+
ws.close();
|
|
643
|
+
resolve(message.id);
|
|
645
644
|
});
|
|
646
645
|
ws.addEventListener("error", () => {
|
|
647
646
|
cleanup();
|
|
@@ -674,17 +673,15 @@ var ContelloClient = class {
|
|
|
674
673
|
let connectedCount = 0;
|
|
675
674
|
const onConnectionUp = () => {
|
|
676
675
|
connectedCount++;
|
|
677
|
-
if (connectedCount
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
}
|
|
676
|
+
if (connectedCount !== connections || state === "connected") return;
|
|
677
|
+
state = "connected";
|
|
678
|
+
options.onConnected?.();
|
|
681
679
|
};
|
|
682
680
|
const onConnectionDown = () => {
|
|
683
681
|
if (connectedCount > 0) connectedCount--;
|
|
684
|
-
if (state
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
}
|
|
682
|
+
if (state !== "connected") return;
|
|
683
|
+
state = "reconnecting";
|
|
684
|
+
options.onReconnecting?.();
|
|
688
685
|
};
|
|
689
686
|
this._pool = new ConnectionPool((id) => {
|
|
690
687
|
const context = Object.freeze({
|
|
@@ -776,22 +773,20 @@ var ContelloClient = class {
|
|
|
776
773
|
error(err) {
|
|
777
774
|
done = true;
|
|
778
775
|
error = err;
|
|
779
|
-
if (pending)
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
}
|
|
776
|
+
if (!pending) return;
|
|
777
|
+
const p = pending;
|
|
778
|
+
pending = void 0;
|
|
779
|
+
p.reject(err);
|
|
784
780
|
},
|
|
785
781
|
complete() {
|
|
786
782
|
done = true;
|
|
787
|
-
if (pending)
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
}
|
|
783
|
+
if (!pending) return;
|
|
784
|
+
const p = pending;
|
|
785
|
+
pending = void 0;
|
|
786
|
+
p.resolve({
|
|
787
|
+
value: void 0,
|
|
788
|
+
done: true
|
|
789
|
+
});
|
|
795
790
|
}
|
|
796
791
|
});
|
|
797
792
|
return {
|