@tailor-platform/sdk 1.46.0 → 1.47.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 +36 -0
- package/dist/{actor-BmxQeMFP.d.mts → actor-DhXSqWTW.d.mts} +2 -2
- package/dist/application-CN9Htzup.mjs +4 -0
- package/dist/{application-B4zVVNRS.mjs → application-TasSqBTD.mjs} +22 -41
- package/dist/application-TasSqBTD.mjs.map +1 -0
- package/dist/cli/index.mjs +33 -15
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +6 -6
- package/dist/cli/lib.mjs +3 -3
- package/dist/{client-BwXkoiMq.mjs → client-COfsXV69.mjs} +31 -120
- package/dist/client-COfsXV69.mjs.map +1 -0
- package/dist/{client-DTaArWQr.mjs → client-DYSkSLRr.mjs} +1 -1
- package/dist/configure/index.d.mts +4 -4
- package/dist/configure/index.mjs +4 -43
- package/dist/configure/index.mjs.map +1 -1
- package/dist/{crashreport-6mcMyWu4.mjs → crashreport-B8lVOx0U.mjs} +1 -1
- package/dist/{crashreport-DGeGj9BF.mjs → crashreport-CKJwnWsX.mjs} +2 -2
- package/dist/{crashreport-DGeGj9BF.mjs.map → crashreport-CKJwnWsX.mjs.map} +1 -1
- package/dist/{index-DV-5OIEv.d.mts → index-BRvNi5q9.d.mts} +2 -2
- package/dist/{index-BBvPd9Uv.d.mts → index-BXyS7xKC.d.mts} +2 -2
- package/dist/{index-Dxe6alSZ.d.mts → index-BbOTbZFf.d.mts} +2 -2
- package/dist/{index-PB0otrDj.d.mts → index-BoU_52Du.d.mts} +4 -4
- package/dist/{index-B5_4Tzm2.d.mts → index-iy-hNfGp.d.mts} +2 -2
- package/dist/{interceptor-CrcDfLPq.mjs → interceptor-CBsqEWDK.mjs} +1 -1
- package/dist/{interceptor-CrcDfLPq.mjs.map → interceptor-CBsqEWDK.mjs.map} +1 -1
- package/dist/mock-BP-9O5On.mjs +796 -0
- package/dist/mock-BP-9O5On.mjs.map +1 -0
- package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
- package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
- package/dist/plugin/builtin/seed/index.d.mts +1 -1
- package/dist/plugin/index.d.mts +2 -2
- package/dist/{repl-editor-BlT2dFtm.mjs → repl-editor-CZpLlOBj.mjs} +1 -1
- package/dist/{repl-editor-BlT2dFtm.mjs.map → repl-editor-CZpLlOBj.mjs.map} +1 -1
- package/dist/{runtime-B67skpW-.mjs → runtime-DDYL2Zf1.mjs} +86 -8
- package/dist/runtime-DDYL2Zf1.mjs.map +1 -0
- package/dist/{service-CCgw66c6.mjs → service-obEU5gSM.mjs} +1 -1
- package/dist/{service-CCgw66c6.mjs.map → service-obEU5gSM.mjs.map} +1 -1
- package/dist/{tailor-db-field-Hx9OqPWY.d.mts → tailor-db-field-Bn8ZC5lK.d.mts} +1 -1
- package/dist/{schema-DBq6hr6h.mjs → tailordb-Bg9-TZj1.mjs} +42 -2
- package/dist/tailordb-Bg9-TZj1.mjs.map +1 -0
- package/dist/utils/test/index.d.mts +13 -4
- package/dist/utils/test/index.mjs +12 -3
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/environment.d.mts +12 -0
- package/dist/vitest/environment.mjs +44 -0
- package/dist/vitest/environment.mjs.map +1 -0
- package/dist/vitest/index.d.mts +345 -0
- package/dist/vitest/index.mjs +350 -0
- package/dist/vitest/index.mjs.map +1 -0
- package/dist/vitest/setup.d.mts +64 -0
- package/dist/vitest/setup.mjs +141 -0
- package/dist/vitest/setup.mjs.map +1 -0
- package/dist/{workflow.generated-DFljpJh7.d.mts → workflow.generated-i7PK4fg-.d.mts} +2 -2
- package/docs/cli/setup.md +1 -0
- package/docs/services/tailordb.md +43 -12
- package/docs/services/workflow.md +1 -1
- package/docs/testing.md +530 -243
- package/package.json +32 -6
- package/dist/application-B4zVVNRS.mjs.map +0 -1
- package/dist/application-Boa_11Nv.mjs +0 -4
- package/dist/client-BwXkoiMq.mjs.map +0 -1
- package/dist/runtime-B67skpW-.mjs.map +0 -1
- package/dist/schema-DBq6hr6h.mjs.map +0 -1
package/dist/cli/lib.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="@tailor-platform/function-types" />
|
|
2
|
-
import { N as TailorDBType, P as TypeSourceInfoEntry, Q as Resolver, _t as IdProvider, ct as IncomingWebhookTrigger, o as Plugin, rt as Executor, s as PluginAttachment, ut as ScheduleTriggerInput, vt as OAuth2ClientInput } from "../tailor-db-field-
|
|
3
|
-
import { r as AppConfig } from "../workflow.generated-
|
|
4
|
-
import { n as kyselyTypePlugin } from "../index-
|
|
5
|
-
import { n as enumConstantsPlugin } from "../index-
|
|
6
|
-
import { n as fileUtilsPlugin } from "../index-
|
|
7
|
-
import { n as seedPlugin } from "../index-
|
|
2
|
+
import { N as TailorDBType, P as TypeSourceInfoEntry, Q as Resolver, _t as IdProvider, ct as IncomingWebhookTrigger, o as Plugin, rt as Executor, s as PluginAttachment, ut as ScheduleTriggerInput, vt as OAuth2ClientInput } from "../tailor-db-field-Bn8ZC5lK.mjs";
|
|
3
|
+
import { r as AppConfig } from "../workflow.generated-i7PK4fg-.mjs";
|
|
4
|
+
import { n as kyselyTypePlugin } from "../index-BRvNi5q9.mjs";
|
|
5
|
+
import { n as enumConstantsPlugin } from "../index-BbOTbZFf.mjs";
|
|
6
|
+
import { n as fileUtilsPlugin } from "../index-iy-hNfGp.mjs";
|
|
7
|
+
import { n as seedPlugin } from "../index-BXyS7xKC.mjs";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import * as _$_bufbuild_protobuf_codegenv20 from "@bufbuild/protobuf/codegenv2";
|
|
10
10
|
import { GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
package/dist/cli/lib.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import { d as initOperatorClient } from "../client-
|
|
3
|
-
import { $t as getMigrationDirPath, A as truncate, B as updateOrganization, Bt as MIGRATION_LABEL_KEY, D as resumeWorkflow, Dt as startWorkflow, Gt as INITIAL_SCHEMA_NUMBER, Ht as bundleMigrationScript, It as getExecutor, J as updateFolder, Jt as compareLocalTypesWithSnapshot, K as getOrganization, Kt as MIGRATE_FILE_NAME, L as remove, Lt as deploy, M as generate$1, Mt as listWorkflowExecutions, P as show, Q as getFolder, Qt as getLatestMigrationNumber, Rt as executeScript, S as listApps, St as getExecutorJob, Tt as watchExecutorJob, Ut as DB_TYPES_FILE_NAME, V as organizationTree, W as listOrganizations, Wt as DIFF_FILE_NAME, X as listFolders, Xt as createSnapshotFromLocalTypes, Yt as compareSnapshots, _ as getWorkspace, a as updateUser, an as reconstructSnapshotFromMigrations, cn as hasChanges, d as inviteUser, dt as generate, en as getMigrationFilePath, et as deleteFolder, fn as generateUserTypes, gt as listWebhookExecutors, h as listWorkspaces, hn as apiCall, ht as getFunctionRegistry, it as listOAuth2Clients, jt as getWorkflowExecution, k as listWorkflows, kt as getWorkflow, l as listUsers, ln as getNamespacesWithMigrations, n as query, nn as getNextMigrationNumber, nt as createFolder, on as formatDiffSummary, ot as getOAuth2Client, p as restoreWorkspace, pt as listFunctionRegistries, qt as SCHEMA_FILE_NAME, s as removeUser, sn as formatMigrationDiff, st as getMachineUserToken, t as isNativeTypeScriptRuntime, tn as getMigrationFiles, ut as listMachineUsers, w as getAppHealth, wt as listExecutorJobs, x as createWorkspace, xt as listExecutors, y as deleteWorkspace, yt as triggerExecutor, zt as waitForExecution } from "../runtime-
|
|
4
|
-
import { C as loadWorkspaceId, S as loadAccessToken, _ as getDistDir, y as loadConfig } from "../application-
|
|
2
|
+
import { d as initOperatorClient } from "../client-COfsXV69.mjs";
|
|
3
|
+
import { $t as getMigrationDirPath, A as truncate, B as updateOrganization, Bt as MIGRATION_LABEL_KEY, D as resumeWorkflow, Dt as startWorkflow, Gt as INITIAL_SCHEMA_NUMBER, Ht as bundleMigrationScript, It as getExecutor, J as updateFolder, Jt as compareLocalTypesWithSnapshot, K as getOrganization, Kt as MIGRATE_FILE_NAME, L as remove, Lt as deploy, M as generate$1, Mt as listWorkflowExecutions, P as show, Q as getFolder, Qt as getLatestMigrationNumber, Rt as executeScript, S as listApps, St as getExecutorJob, Tt as watchExecutorJob, Ut as DB_TYPES_FILE_NAME, V as organizationTree, W as listOrganizations, Wt as DIFF_FILE_NAME, X as listFolders, Xt as createSnapshotFromLocalTypes, Yt as compareSnapshots, _ as getWorkspace, a as updateUser, an as reconstructSnapshotFromMigrations, cn as hasChanges, d as inviteUser, dt as generate, en as getMigrationFilePath, et as deleteFolder, fn as generateUserTypes, gt as listWebhookExecutors, h as listWorkspaces, hn as apiCall, ht as getFunctionRegistry, it as listOAuth2Clients, jt as getWorkflowExecution, k as listWorkflows, kt as getWorkflow, l as listUsers, ln as getNamespacesWithMigrations, n as query, nn as getNextMigrationNumber, nt as createFolder, on as formatDiffSummary, ot as getOAuth2Client, p as restoreWorkspace, pt as listFunctionRegistries, qt as SCHEMA_FILE_NAME, s as removeUser, sn as formatMigrationDiff, st as getMachineUserToken, t as isNativeTypeScriptRuntime, tn as getMigrationFiles, ut as listMachineUsers, w as getAppHealth, wt as listExecutorJobs, x as createWorkspace, xt as listExecutors, y as deleteWorkspace, yt as triggerExecutor, zt as waitForExecution } from "../runtime-DDYL2Zf1.mjs";
|
|
4
|
+
import { C as loadWorkspaceId, S as loadAccessToken, _ as getDistDir, y as loadConfig } from "../application-TasSqBTD.mjs";
|
|
5
5
|
import { n as enumConstantsPlugin } from "../enum-constants-C3KSpsYj.mjs";
|
|
6
6
|
import { t as multiline } from "../multiline-e3IpANmS.mjs";
|
|
7
7
|
import { n as fileUtilsPlugin } from "../file-utils-DjNi_3U_.mjs";
|
|
@@ -1119,21 +1119,6 @@ var require_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1119
1119
|
}
|
|
1120
1120
|
[kSecureProxyConnectionError] = true;
|
|
1121
1121
|
};
|
|
1122
|
-
const kMessageSizeExceededError = Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED");
|
|
1123
|
-
var MessageSizeExceededError = class extends UndiciError {
|
|
1124
|
-
constructor(message) {
|
|
1125
|
-
super(message);
|
|
1126
|
-
this.name = "MessageSizeExceededError";
|
|
1127
|
-
this.message = message || "Max decompressed message size exceeded";
|
|
1128
|
-
this.code = "UND_ERR_WS_MESSAGE_SIZE_EXCEEDED";
|
|
1129
|
-
}
|
|
1130
|
-
static [Symbol.hasInstance](instance) {
|
|
1131
|
-
return instance && instance[kMessageSizeExceededError] === true;
|
|
1132
|
-
}
|
|
1133
|
-
get [kMessageSizeExceededError]() {
|
|
1134
|
-
return true;
|
|
1135
|
-
}
|
|
1136
|
-
};
|
|
1137
1122
|
module.exports = {
|
|
1138
1123
|
AbortError,
|
|
1139
1124
|
HTTPParserError,
|
|
@@ -1157,8 +1142,7 @@ var require_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1157
1142
|
ResponseExceededMaxSizeError,
|
|
1158
1143
|
RequestRetryError,
|
|
1159
1144
|
ResponseError,
|
|
1160
|
-
SecureProxyConnectionError
|
|
1161
|
-
MessageSizeExceededError
|
|
1145
|
+
SecureProxyConnectionError
|
|
1162
1146
|
};
|
|
1163
1147
|
}));
|
|
1164
1148
|
|
|
@@ -1958,7 +1942,6 @@ var require_request$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1958
1942
|
if (typeof method !== "string") throw new InvalidArgumentError("method must be a string");
|
|
1959
1943
|
else if (normalizedMethodRecords[method] === void 0 && !isValidHTTPToken(method)) throw new InvalidArgumentError("invalid request method");
|
|
1960
1944
|
if (upgrade && typeof upgrade !== "string") throw new InvalidArgumentError("upgrade must be a string");
|
|
1961
|
-
if (upgrade && !isValidHeaderValue(upgrade)) throw new InvalidArgumentError("invalid upgrade header");
|
|
1962
1945
|
if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) throw new InvalidArgumentError("invalid headersTimeout");
|
|
1963
1946
|
if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) throw new InvalidArgumentError("invalid bodyTimeout");
|
|
1964
1947
|
if (reset != null && typeof reset !== "boolean") throw new InvalidArgumentError("invalid reset");
|
|
@@ -2138,12 +2121,10 @@ var require_request$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2138
2121
|
if (!isValidHeaderValue(val)) throw new InvalidArgumentError(`invalid ${key} header`);
|
|
2139
2122
|
} else if (val === null) val = "";
|
|
2140
2123
|
else val = `${val}`;
|
|
2141
|
-
if (headerName === "host") {
|
|
2142
|
-
if (request.host !== null) throw new InvalidArgumentError("duplicate host header");
|
|
2124
|
+
if (request.host === null && headerName === "host") {
|
|
2143
2125
|
if (typeof val !== "string") throw new InvalidArgumentError("invalid host header");
|
|
2144
2126
|
request.host = val;
|
|
2145
|
-
} else if (headerName === "content-length") {
|
|
2146
|
-
if (request.contentLength !== null) throw new InvalidArgumentError("duplicate content-length header");
|
|
2127
|
+
} else if (request.contentLength === null && headerName === "content-length") {
|
|
2147
2128
|
request.contentLength = parseInt(val, 10);
|
|
2148
2129
|
if (!Number.isFinite(request.contentLength)) throw new InvalidArgumentError("invalid content-length header");
|
|
2149
2130
|
} else if (request.contentType === null && headerName === "content-type") {
|
|
@@ -2216,18 +2197,13 @@ var require_dispatcher_base = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
2216
2197
|
const kOnDestroyed = Symbol("onDestroyed");
|
|
2217
2198
|
const kOnClosed = Symbol("onClosed");
|
|
2218
2199
|
const kInterceptedDispatch = Symbol("Intercepted Dispatch");
|
|
2219
|
-
const kWebSocketOptions = Symbol("webSocketOptions");
|
|
2220
2200
|
var DispatcherBase = class extends Dispatcher {
|
|
2221
|
-
constructor(
|
|
2201
|
+
constructor() {
|
|
2222
2202
|
super();
|
|
2223
2203
|
this[kDestroyed] = false;
|
|
2224
2204
|
this[kOnDestroyed] = null;
|
|
2225
2205
|
this[kClosed] = false;
|
|
2226
2206
|
this[kOnClosed] = [];
|
|
2227
|
-
this[kWebSocketOptions] = opts?.webSocket ?? {};
|
|
2228
|
-
}
|
|
2229
|
-
get webSocketOptions() {
|
|
2230
|
-
return { maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024 };
|
|
2231
2207
|
}
|
|
2232
2208
|
get destroyed() {
|
|
2233
2209
|
return this[kDestroyed];
|
|
@@ -6932,8 +6908,8 @@ var require_client = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6932
6908
|
* @param {string|URL} url
|
|
6933
6909
|
* @param {import('../../types/client.js').Client.Options} options
|
|
6934
6910
|
*/
|
|
6935
|
-
constructor(url, { interceptors, maxHeaderSize, headersTimeout, socketTimeout, requestTimeout, connectTimeout, bodyTimeout, idleTimeout, keepAlive, keepAliveTimeout, maxKeepAliveTimeout, keepAliveMaxTimeout, keepAliveTimeoutThreshold, socketPath, pipelining, tls, strictContentLength, maxCachedSessions, maxRedirections, connect, maxRequestsPerClient, localAddress, maxResponseSize, autoSelectFamily, autoSelectFamilyAttemptTimeout, maxConcurrentStreams, allowH2
|
|
6936
|
-
super(
|
|
6911
|
+
constructor(url, { interceptors, maxHeaderSize, headersTimeout, socketTimeout, requestTimeout, connectTimeout, bodyTimeout, idleTimeout, keepAlive, keepAliveTimeout, maxKeepAliveTimeout, keepAliveMaxTimeout, keepAliveTimeoutThreshold, socketPath, pipelining, tls, strictContentLength, maxCachedSessions, maxRedirections, connect, maxRequestsPerClient, localAddress, maxResponseSize, autoSelectFamily, autoSelectFamilyAttemptTimeout, maxConcurrentStreams, allowH2 } = {}) {
|
|
6912
|
+
super();
|
|
6937
6913
|
if (keepAlive !== void 0) throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead");
|
|
6938
6914
|
if (socketTimeout !== void 0) throw new InvalidArgumentError("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");
|
|
6939
6915
|
if (requestTimeout !== void 0) throw new InvalidArgumentError("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");
|
|
@@ -7339,8 +7315,8 @@ var require_pool_base = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
7339
7315
|
const kRemoveClient = Symbol("remove client");
|
|
7340
7316
|
const kStats = Symbol("stats");
|
|
7341
7317
|
var PoolBase = class extends DispatcherBase {
|
|
7342
|
-
constructor(
|
|
7343
|
-
super(
|
|
7318
|
+
constructor() {
|
|
7319
|
+
super();
|
|
7344
7320
|
this[kQueue] = new FixedQueue();
|
|
7345
7321
|
this[kClients] = [];
|
|
7346
7322
|
this[kQueued] = 0;
|
|
@@ -7471,6 +7447,7 @@ var require_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
7471
7447
|
}
|
|
7472
7448
|
var Pool = class extends PoolBase {
|
|
7473
7449
|
constructor(origin, { connections, factory = defaultFactory, connect, connectTimeout, tls, maxCachedSessions, socketPath, autoSelectFamily, autoSelectFamilyAttemptTimeout, allowH2, ...options } = {}) {
|
|
7450
|
+
super();
|
|
7474
7451
|
if (connections != null && (!Number.isFinite(connections) || connections < 0)) throw new InvalidArgumentError("invalid connections");
|
|
7475
7452
|
if (typeof factory !== "function") throw new InvalidArgumentError("factory must be a function.");
|
|
7476
7453
|
if (connect != null && typeof connect !== "function" && typeof connect !== "object") throw new InvalidArgumentError("connect must be a function or an object");
|
|
@@ -7486,7 +7463,6 @@ var require_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
7486
7463
|
} : void 0,
|
|
7487
7464
|
...connect
|
|
7488
7465
|
});
|
|
7489
|
-
super(options);
|
|
7490
7466
|
this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool) ? options.interceptors.Pool : [];
|
|
7491
7467
|
this[kConnections] = connections || null;
|
|
7492
7468
|
this[kUrl] = util.parseOrigin(origin);
|
|
@@ -7650,10 +7626,10 @@ var require_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
7650
7626
|
}
|
|
7651
7627
|
var Agent = class extends DispatcherBase {
|
|
7652
7628
|
constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
|
|
7629
|
+
super();
|
|
7653
7630
|
if (typeof factory !== "function") throw new InvalidArgumentError("factory must be a function.");
|
|
7654
7631
|
if (connect != null && typeof connect !== "function" && typeof connect !== "object") throw new InvalidArgumentError("connect must be a function or an object");
|
|
7655
7632
|
if (!Number.isInteger(maxRedirections) || maxRedirections < 0) throw new InvalidArgumentError("maxRedirections must be a positive number");
|
|
7656
|
-
super(options);
|
|
7657
7633
|
if (connect && typeof connect !== "function") connect = { ...connect };
|
|
7658
7634
|
this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent) ? options.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })];
|
|
7659
7635
|
this[kOptions] = {
|
|
@@ -14464,13 +14440,11 @@ var require_util$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
14464
14440
|
* @param {string} value
|
|
14465
14441
|
*/
|
|
14466
14442
|
function isValidClientWindowBits(value) {
|
|
14467
|
-
if (value.length === 0) return false;
|
|
14468
14443
|
for (let i = 0; i < value.length; i++) {
|
|
14469
14444
|
const byte = value.charCodeAt(i);
|
|
14470
14445
|
if (byte < 48 || byte > 57) return false;
|
|
14471
14446
|
}
|
|
14472
|
-
|
|
14473
|
-
return num >= 8 && num <= 15;
|
|
14447
|
+
return true;
|
|
14474
14448
|
}
|
|
14475
14449
|
const hasIntl = typeof process.versions.icu === "string";
|
|
14476
14450
|
const fatalDecoder = hasIntl ? new TextDecoder("utf-8", { fatal: true }) : void 0;
|
|
@@ -14746,7 +14720,6 @@ var require_connection = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
14746
14720
|
var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
14747
14721
|
const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = __require("node:zlib");
|
|
14748
14722
|
const { isValidClientWindowBits } = require_util$1();
|
|
14749
|
-
const { MessageSizeExceededError } = require_errors();
|
|
14750
14723
|
const tail = Buffer.from([
|
|
14751
14724
|
0,
|
|
14752
14725
|
0,
|
|
@@ -14759,21 +14732,10 @@ var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
14759
14732
|
/** @type {import('node:zlib').InflateRaw} */
|
|
14760
14733
|
#inflate;
|
|
14761
14734
|
#options = {};
|
|
14762
|
-
|
|
14763
|
-
/**
|
|
14764
|
-
* @param {Map<string, string>} extensions
|
|
14765
|
-
*/
|
|
14766
|
-
constructor(extensions, options) {
|
|
14735
|
+
constructor(extensions) {
|
|
14767
14736
|
this.#options.serverNoContextTakeover = extensions.has("server_no_context_takeover");
|
|
14768
14737
|
this.#options.serverMaxWindowBits = extensions.get("server_max_window_bits");
|
|
14769
|
-
this.#maxPayloadSize = options.maxPayloadSize;
|
|
14770
14738
|
}
|
|
14771
|
-
/**
|
|
14772
|
-
* Decompress a compressed payload.
|
|
14773
|
-
* @param {Buffer} chunk Compressed data
|
|
14774
|
-
* @param {boolean} fin Final fragment flag
|
|
14775
|
-
* @param {Function} callback Callback function
|
|
14776
|
-
*/
|
|
14777
14739
|
decompress(chunk, fin, callback) {
|
|
14778
14740
|
if (!this.#inflate) {
|
|
14779
14741
|
let windowBits = Z_DEFAULT_WINDOWBITS;
|
|
@@ -14784,23 +14746,12 @@ var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
14784
14746
|
}
|
|
14785
14747
|
windowBits = Number.parseInt(this.#options.serverMaxWindowBits);
|
|
14786
14748
|
}
|
|
14787
|
-
|
|
14788
|
-
this.#inflate = createInflateRaw({ windowBits });
|
|
14789
|
-
} catch (err) {
|
|
14790
|
-
callback(err);
|
|
14791
|
-
return;
|
|
14792
|
-
}
|
|
14749
|
+
this.#inflate = createInflateRaw({ windowBits });
|
|
14793
14750
|
this.#inflate[kBuffer] = [];
|
|
14794
14751
|
this.#inflate[kLength] = 0;
|
|
14795
14752
|
this.#inflate.on("data", (data) => {
|
|
14796
|
-
this.#inflate[kLength] += data.length;
|
|
14797
|
-
if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {
|
|
14798
|
-
callback(new MessageSizeExceededError());
|
|
14799
|
-
this.#inflate.removeAllListeners();
|
|
14800
|
-
this.#inflate = null;
|
|
14801
|
-
return;
|
|
14802
|
-
}
|
|
14803
14753
|
this.#inflate[kBuffer].push(data);
|
|
14754
|
+
this.#inflate[kLength] += data.length;
|
|
14804
14755
|
});
|
|
14805
14756
|
this.#inflate.on("error", (err) => {
|
|
14806
14757
|
this.#inflate = null;
|
|
@@ -14810,7 +14761,6 @@ var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
14810
14761
|
this.#inflate.write(chunk);
|
|
14811
14762
|
if (fin) this.#inflate.write(tail);
|
|
14812
14763
|
this.#inflate.flush(() => {
|
|
14813
|
-
if (!this.#inflate) return;
|
|
14814
14764
|
const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength]);
|
|
14815
14765
|
this.#inflate[kBuffer].length = 0;
|
|
14816
14766
|
this.#inflate[kLength] = 0;
|
|
@@ -14833,10 +14783,8 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
14833
14783
|
const { WebsocketFrameSend } = require_frame();
|
|
14834
14784
|
const { closeWebSocketConnection } = require_connection();
|
|
14835
14785
|
const { PerMessageDeflate } = require_permessage_deflate();
|
|
14836
|
-
const { MessageSizeExceededError } = require_errors();
|
|
14837
14786
|
var ByteParser = class extends Writable {
|
|
14838
14787
|
#buffers = [];
|
|
14839
|
-
#fragmentsBytes = 0;
|
|
14840
14788
|
#byteOffset = 0;
|
|
14841
14789
|
#loop = false;
|
|
14842
14790
|
#state = parserStates.INFO;
|
|
@@ -14844,19 +14792,11 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
14844
14792
|
#fragments = [];
|
|
14845
14793
|
/** @type {Map<string, PerMessageDeflate>} */
|
|
14846
14794
|
#extensions;
|
|
14847
|
-
|
|
14848
|
-
#maxPayloadSize;
|
|
14849
|
-
/**
|
|
14850
|
-
* @param {import('./websocket').WebSocket} ws
|
|
14851
|
-
* @param {Map<string, string>|null} extensions
|
|
14852
|
-
* @param {{ maxPayloadSize?: number }} [options]
|
|
14853
|
-
*/
|
|
14854
|
-
constructor(ws, extensions, options = {}) {
|
|
14795
|
+
constructor(ws, extensions) {
|
|
14855
14796
|
super();
|
|
14856
14797
|
this.ws = ws;
|
|
14857
14798
|
this.#extensions = extensions == null ? /* @__PURE__ */ new Map() : extensions;
|
|
14858
|
-
this.#
|
|
14859
|
-
if (this.#extensions.has("permessage-deflate")) this.#extensions.set("permessage-deflate", new PerMessageDeflate(extensions, options));
|
|
14799
|
+
if (this.#extensions.has("permessage-deflate")) this.#extensions.set("permessage-deflate", new PerMessageDeflate(extensions));
|
|
14860
14800
|
}
|
|
14861
14801
|
/**
|
|
14862
14802
|
* @param {Buffer} chunk
|
|
@@ -14868,13 +14808,6 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
14868
14808
|
this.#loop = true;
|
|
14869
14809
|
this.run(callback);
|
|
14870
14810
|
}
|
|
14871
|
-
#validatePayloadLength() {
|
|
14872
|
-
if (this.#maxPayloadSize > 0 && !isControlFrame(this.#info.opcode) && this.#info.payloadLength > this.#maxPayloadSize) {
|
|
14873
|
-
failWebsocketConnection(this.ws, "Payload size exceeds maximum allowed size");
|
|
14874
|
-
return false;
|
|
14875
|
-
}
|
|
14876
|
-
return true;
|
|
14877
|
-
}
|
|
14878
14811
|
/**
|
|
14879
14812
|
* Runs whenever a new chunk is received.
|
|
14880
14813
|
* Callback is called whenever there are no more chunks buffering,
|
|
@@ -14931,7 +14864,6 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
14931
14864
|
if (payloadLength <= 125) {
|
|
14932
14865
|
this.#info.payloadLength = payloadLength;
|
|
14933
14866
|
this.#state = parserStates.READ_DATA;
|
|
14934
|
-
if (!this.#validatePayloadLength()) return;
|
|
14935
14867
|
} else if (payloadLength === 126) this.#state = parserStates.PAYLOADLENGTH_16;
|
|
14936
14868
|
else if (payloadLength === 127) this.#state = parserStates.PAYLOADLENGTH_64;
|
|
14937
14869
|
if (isTextBinaryFrame(opcode)) {
|
|
@@ -14947,19 +14879,17 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
14947
14879
|
const buffer = this.consume(2);
|
|
14948
14880
|
this.#info.payloadLength = buffer.readUInt16BE(0);
|
|
14949
14881
|
this.#state = parserStates.READ_DATA;
|
|
14950
|
-
if (!this.#validatePayloadLength()) return;
|
|
14951
14882
|
} else if (this.#state === parserStates.PAYLOADLENGTH_64) {
|
|
14952
14883
|
if (this.#byteOffset < 8) return callback();
|
|
14953
14884
|
const buffer = this.consume(8);
|
|
14954
14885
|
const upper = buffer.readUInt32BE(0);
|
|
14955
|
-
|
|
14956
|
-
if (upper !== 0 || lower > 2 ** 31 - 1) {
|
|
14886
|
+
if (upper > 2 ** 31 - 1) {
|
|
14957
14887
|
failWebsocketConnection(this.ws, "Received payload length > 2^31 bytes.");
|
|
14958
14888
|
return;
|
|
14959
14889
|
}
|
|
14960
|
-
|
|
14890
|
+
const lower = buffer.readUInt32BE(4);
|
|
14891
|
+
this.#info.payloadLength = (upper << 8) + lower;
|
|
14961
14892
|
this.#state = parserStates.READ_DATA;
|
|
14962
|
-
if (!this.#validatePayloadLength()) return;
|
|
14963
14893
|
} else if (this.#state === parserStates.READ_DATA) {
|
|
14964
14894
|
if (this.#byteOffset < this.#info.payloadLength) return callback();
|
|
14965
14895
|
const body = this.consume(this.#info.payloadLength);
|
|
@@ -14967,33 +14897,30 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
14967
14897
|
this.#loop = this.parseControlFrame(body);
|
|
14968
14898
|
this.#state = parserStates.INFO;
|
|
14969
14899
|
} else if (!this.#info.compressed) {
|
|
14970
|
-
this.
|
|
14971
|
-
if (this.#
|
|
14972
|
-
|
|
14973
|
-
|
|
14900
|
+
this.#fragments.push(body);
|
|
14901
|
+
if (!this.#info.fragmented && this.#info.fin) {
|
|
14902
|
+
const fullMessage = Buffer.concat(this.#fragments);
|
|
14903
|
+
websocketMessageReceived(this.ws, this.#info.binaryType, fullMessage);
|
|
14904
|
+
this.#fragments.length = 0;
|
|
14974
14905
|
}
|
|
14975
|
-
if (!this.#info.fragmented && this.#info.fin) websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments());
|
|
14976
14906
|
this.#state = parserStates.INFO;
|
|
14977
14907
|
} else {
|
|
14978
14908
|
this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error, data) => {
|
|
14979
14909
|
if (error) {
|
|
14980
|
-
|
|
14981
|
-
return;
|
|
14982
|
-
}
|
|
14983
|
-
this.writeFragments(data);
|
|
14984
|
-
if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {
|
|
14985
|
-
failWebsocketConnection(this.ws, new MessageSizeExceededError().message);
|
|
14910
|
+
closeWebSocketConnection(this.ws, 1007, error.message, error.message.length);
|
|
14986
14911
|
return;
|
|
14987
14912
|
}
|
|
14913
|
+
this.#fragments.push(data);
|
|
14988
14914
|
if (!this.#info.fin) {
|
|
14989
14915
|
this.#state = parserStates.INFO;
|
|
14990
14916
|
this.#loop = true;
|
|
14991
14917
|
this.run(callback);
|
|
14992
14918
|
return;
|
|
14993
14919
|
}
|
|
14994
|
-
websocketMessageReceived(this.ws, this.#info.binaryType,
|
|
14920
|
+
websocketMessageReceived(this.ws, this.#info.binaryType, Buffer.concat(this.#fragments));
|
|
14995
14921
|
this.#loop = true;
|
|
14996
14922
|
this.#state = parserStates.INFO;
|
|
14923
|
+
this.#fragments.length = 0;
|
|
14997
14924
|
this.run(callback);
|
|
14998
14925
|
});
|
|
14999
14926
|
this.#loop = false;
|
|
@@ -15033,21 +14960,6 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
15033
14960
|
this.#byteOffset -= n;
|
|
15034
14961
|
return buffer;
|
|
15035
14962
|
}
|
|
15036
|
-
writeFragments(fragment) {
|
|
15037
|
-
this.#fragmentsBytes += fragment.length;
|
|
15038
|
-
this.#fragments.push(fragment);
|
|
15039
|
-
}
|
|
15040
|
-
consumeFragments() {
|
|
15041
|
-
const fragments = this.#fragments;
|
|
15042
|
-
if (fragments.length === 1) {
|
|
15043
|
-
this.#fragmentsBytes = 0;
|
|
15044
|
-
return fragments.shift();
|
|
15045
|
-
}
|
|
15046
|
-
const output = Buffer.concat(fragments, this.#fragmentsBytes);
|
|
15047
|
-
this.#fragments = [];
|
|
15048
|
-
this.#fragmentsBytes = 0;
|
|
15049
|
-
return output;
|
|
15050
|
-
}
|
|
15051
14963
|
parseCloseBody(data) {
|
|
15052
14964
|
assert(data.length !== 1);
|
|
15053
14965
|
/** @type {number|undefined} */
|
|
@@ -15404,8 +15316,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
15404
15316
|
*/
|
|
15405
15317
|
#onConnectionEstablished(response, parsedExtensions) {
|
|
15406
15318
|
this[kResponse] = response;
|
|
15407
|
-
const
|
|
15408
|
-
const parser = new ByteParser(this, parsedExtensions, { maxPayloadSize });
|
|
15319
|
+
const parser = new ByteParser(this, parsedExtensions);
|
|
15409
15320
|
parser.on("drain", onParserDrain);
|
|
15410
15321
|
parser.on("error", onParserError.bind(this));
|
|
15411
15322
|
response.socket.ws = this;
|
|
@@ -16223,7 +16134,7 @@ function initOAuth2Client() {
|
|
|
16223
16134
|
* @returns Configured Operator client
|
|
16224
16135
|
*/
|
|
16225
16136
|
async function initOperatorClient(accessToken) {
|
|
16226
|
-
const { createTracingInterceptor } = await import("./interceptor-
|
|
16137
|
+
const { createTracingInterceptor } = await import("./interceptor-CBsqEWDK.mjs");
|
|
16227
16138
|
return createClient(OperatorService, await createTransport(platformBaseUrl, [
|
|
16228
16139
|
await userAgentInterceptor(),
|
|
16229
16140
|
await bearerTokenInterceptor(accessToken),
|
|
@@ -16533,4 +16444,4 @@ async function closeConnectionPool() {
|
|
|
16533
16444
|
|
|
16534
16445
|
//#endregion
|
|
16535
16446
|
export { FilterSchema as $, FunctionExecution_Status as A, AuthOAuth2Client_GrantType as B, TailorDBType_Permission_Operator as C, IdPLang as D, PipelineResolver_OperationType as E, AuthConnection_Type as F, PATScope as G, AuthSCIMAttribute_Type as H, AuthHookPoint as I, GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus as J, TenantProviderConfig_TenantProviderType as K, AuthIDPConfig_AuthType as L, ExecutorJobStatus as M, ExecutorTargetType as N, IdPPermissionOperator as O, ExecutorTriggerType as P, Condition_Operator as Q, AuthInvokerSchema as R, TailorDBGQLPermission_Permit as S, TailorDBType_PermitAction as T, AuthSCIMAttribute_Uniqueness as U, AuthSCIMAttribute_Mutability as V, AuthSCIMConfig_AuthorizationType as W, Subgraph_ServiceType as X, ApplicationSchemaUpdateAttemptStatus as Y, ConditionSchema as Z, WorkspacePlatformUserRole as _, fetchMachineUserToken as a, TailorDBGQLPermission_Action as b, fetchUserInfo as c, initOperatorClient as d, PageDirection as et, parseMethodName as f, OperatorService as g, userAgent as h, fetchAll as i, FunctionExecution_Type as j, IdPPermissionPermit as k, formatRequestParams as l, resolveStaticWebsiteUrls as m, closeConnectionPool as n, fetchPaged as o, platformBaseUrl as p, UserProfileProviderConfig_UserProfileProviderType as q, createTransport as r, fetchPlatformMachineUserToken as s, MAX_PAGE_SIZE as t, initOAuth2Client as u, WorkflowExecution_Status as v, TailorDBType_Permission_Permit as w, TailorDBGQLPermission_Operator as x, WorkflowJobExecution_Status as y, AuthOAuth2Client_ClientType as z };
|
|
16536
|
-
//# sourceMappingURL=client-
|
|
16447
|
+
//# sourceMappingURL=client-COfsXV69.mjs.map
|