/opt/canhelp/node_modules/gel/dist
NameSizeModeActions
codecs/-0755rm
datatypes/-0755rm
errors/-0755rm
primitives/-0755rm
reflection/-0755rm
baseClient.d.ts58870644editdlrm
baseClient.js198870644editdlrm
baseConn.d.ts48900644editdlrm
baseConn.js315880644editdlrm
browserClient.d.ts2000644editdlrm
browserClient.js12120644editdlrm
browserCrypto.d.ts910644editdlrm
browserCrypto.js7240644editdlrm
cli.mjs74390755editdlrm
codecTypeRegistry.d.ts1950644editdlrm
codecTypeRegistry.js770644editdlrm
conUtils.d.ts55400644editdlrm
conUtils.js362590644editdlrm
conUtils.server.d.ts5550644editdlrm
conUtils.server.js32660644editdlrm
credentials.d.ts5610644editdlrm
credentials.js41580644editdlrm
cryptoUtils.d.ts1060644editdlrm
cryptoUtils.js8110644editdlrm
fetchConn.d.ts28000644editdlrm
fetchConn.js75450644editdlrm
httpScram.d.ts2290644editdlrm
httpScram.js39700644editdlrm
ifaces.d.ts25300644editdlrm
ifaces.js28470644editdlrm
index.browser.d.ts8670644editdlrm
index.browser.js19730644editdlrm
index.node.d.ts12750644editdlrm
index.node.js32660644editdlrm
index.shared.d.ts18960644editdlrm
index.shared.js54860644editdlrm
nodeClient.d.ts2400644editdlrm
nodeClient.js15290644editdlrm
nodeCrypto.d.ts910644editdlrm
nodeCrypto.js9170644editdlrm
options.d.ts42540644editdlrm
options.js112490644editdlrm
platform.d.ts1240644editdlrm
platform.js17310644editdlrm
rawConn.d.ts12180644editdlrm
rawConn.js173140644editdlrm
retry.d.ts11530644editdlrm
retry.js39250644editdlrm
scram.d.ts17230644editdlrm
scram.js60040644editdlrm
systemUtils.d.ts4830644editdlrm
systemUtils.js38400644editdlrm
transaction.d.ts17380644editdlrm
transaction.js81130644editdlrm
typeutil.d.ts2430644editdlrm
typeutil.js770644editdlrm
utils.d.ts19250644editdlrm
utils.js37270644editdlrm
Edit: /opt/canhelp/node_modules/gel/dist/options.js (11249B)
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Options = exports.TransactionOptions = exports.RetryOptions = exports.logWarnings = exports.throwWarnings = exports.RetryCondition = exports.IsolationLevel = void 0; exports.defaultBackoff = defaultBackoff; const errors = __importStar(require("./errors/index")); const buffer_1 = require("./primitives/buffer"); const record_1 = require("./codecs/record"); const context_1 = require("./codecs/context"); function defaultBackoff(attempt) { return 2 ** attempt * 100 + Math.random() * 100; } var IsolationLevel; (function (IsolationLevel) { IsolationLevel["Serializable"] = "Serializable"; IsolationLevel["RepeatableRead"] = "RepeatableRead"; IsolationLevel["PreferRepeatableRead"] = "PreferRepeatableRead"; })(IsolationLevel || (exports.IsolationLevel = IsolationLevel = {})); var RetryCondition; (function (RetryCondition) { RetryCondition[RetryCondition["TransactionConflict"] = 0] = "TransactionConflict"; RetryCondition[RetryCondition["NetworkError"] = 1] = "NetworkError"; })(RetryCondition || (exports.RetryCondition = RetryCondition = {})); class RetryRule { attempts; backoff; constructor(attempts, backoff) { this.attempts = attempts; this.backoff = backoff; } } const throwWarnings = (warnings) => { throw new AggregateError(warnings, formatWarnings(warnings)); }; exports.throwWarnings = throwWarnings; const logWarnings = (warnings) => { const merged = new Error(formatWarnings(warnings)); console.warn(Object.assign(merged, { name: "" })); }; exports.logWarnings = logWarnings; const formatWarnings = (warnings) => `warnings occurred while running query:\n${warnings.map((warn) => warn.message).join("\n")}`; class RetryOptions { default; overrides; constructor(attempts = 3, backoff = defaultBackoff) { this.default = new RetryRule(attempts, backoff); this.overrides = new Map(); } withRule(condition, attempts, backoff) { const def = this.default; const overrides = new Map(this.overrides); overrides.set(condition, new RetryRule(attempts ?? def.attempts, backoff ?? def.backoff)); const result = Object.create(RetryOptions.prototype); result.default = def; result.overrides = overrides; return result; } getRuleForException(err) { let result; if (err instanceof errors.TransactionConflictError) { result = this.overrides.get(RetryCondition.TransactionConflict); } else if (err instanceof errors.ClientError) { result = this.overrides.get(RetryCondition.NetworkError); } return result ?? this.default; } static defaults() { return _retryOptionsDefault; } } exports.RetryOptions = RetryOptions; const _retryOptionsDefault = new RetryOptions(); class TransactionOptions { isolation; readonly; deferrable; constructor({ isolation, readonly, deferrable, } = {}) { this.isolation = isolation; this.readonly = readonly; this.deferrable = deferrable; } isDefault() { return (this.isolation === undefined && this.readonly === undefined && this.deferrable === undefined); } static defaults() { return _defaultTransactionOptions; } } exports.TransactionOptions = TransactionOptions; const _defaultTransactionOptions = new TransactionOptions(); const TAG_ANNOTATION_KEY = "tag"; class Options { static schemaVersion = 0; module; moduleAliases; config; globals; retryOptions; transactionOptions; codecs; warningHandler; annotations = new Map(); cachedCodecContext = null; cachedCodecContextVer = -1; get tag() { return this.annotations.get(TAG_ANNOTATION_KEY) ?? null; } static signalSchemaChange() { this.schemaVersion += 1; } constructor({ retryOptions = RetryOptions.defaults(), transactionOptions = TransactionOptions.defaults(), warningHandler = exports.logWarnings, module = "default", moduleAliases = {}, config = {}, globals = {}, codecs = {}, } = {}) { this.retryOptions = retryOptions; this.transactionOptions = transactionOptions; this.warningHandler = warningHandler; this.module = module; this.moduleAliases = new Map(Object.entries(moduleAliases)); this.config = new Map(Object.entries(config)); this.globals = new Map(Object.entries(globals)); this.codecs = new Map(Object.entries(codecs)); } makeCodecContext() { if (this.codecs.size === 0) { return context_1.NOOP_CODEC_CONTEXT; } if (this.cachedCodecContextVer === Options.schemaVersion) { return this.cachedCodecContext; } const ctx = new context_1.CodecContext(this.codecs); this.cachedCodecContext = ctx; this.cachedCodecContextVer = Options.schemaVersion; return ctx; } _cloneWith(mergeOptions) { const clone = Object.create(Options.prototype); clone.annotations = this.annotations; clone.retryOptions = mergeOptions.retryOptions ?? this.retryOptions; clone.transactionOptions = mergeOptions.transactionOptions ?? this.transactionOptions; clone.warningHandler = mergeOptions.warningHandler ?? this.warningHandler; if (mergeOptions.config != null) { clone.config = new Map([ ...this.config, ...Object.entries(mergeOptions.config), ]); } else { clone.config = this.config; } if (mergeOptions.globals != null) { clone.globals = new Map([ ...this.globals, ...Object.entries(mergeOptions.globals), ]); } else { clone.globals = this.globals; } if (mergeOptions.moduleAliases != null) { clone.moduleAliases = new Map([ ...this.moduleAliases, ...Object.entries(mergeOptions.moduleAliases), ]); } else { clone.moduleAliases = this.moduleAliases; } if (mergeOptions.codecs != null) { clone.codecs = new Map([ ...this.codecs, ...Object.entries(mergeOptions.codecs), ]); } else { clone.codecs = this.codecs; clone.cachedCodecContext = this.cachedCodecContext; clone.cachedCodecContextVer = this.cachedCodecContextVer; } if (mergeOptions._dropSQLRowCodec && clone.codecs.has("_private_sql_row")) { if (clone.codecs === this.codecs) { clone.codecs = new Map(clone.codecs); clone.cachedCodecContext = null; clone.cachedCodecContextVer = -1; } clone.codecs.delete("_private_sql_row"); } clone.module = mergeOptions.module ?? this.module; return clone; } _serialise() { const state = {}; if (this.module !== "default") { state.module = this.module; } if (this.moduleAliases.size) { state.aliases = Array.from(this.moduleAliases.entries()); } if (this.config.size) { state.config = Object.fromEntries(this.config.entries()); } if (this.globals.size) { const globs = {}; for (const [key, val] of this.globals.entries()) { globs[key.includes("::") ? key : `${this.module}::${key}`] = val; } state.globals = globs; } return state; } withModuleAliases({ module, ...aliases }) { return this._cloneWith({ module: module ?? this.module, moduleAliases: aliases, }); } withConfig(config) { return this._cloneWith({ config }); } withCodecs(codecs) { return this._cloneWith({ codecs }); } withSQLRowMode(mode) { if (mode === "object") { return this._cloneWith({ _dropSQLRowCodec: true }); } else if (mode === "array") { return this._cloneWith({ codecs: record_1.SQLRowModeArray }); } else { throw new errors.InterfaceError(`invalid mode=${mode}`); } } withGlobals(globals) { return this._cloneWith({ globals: { ...this.globals, ...globals }, }); } withQueryTag(tag) { const annos = new Map(this.annotations); if (tag != null) { if (tag.startsWith("edgedb/")) { throw new errors.InterfaceError("reserved tag: edgedb/*"); } if (tag.startsWith("gel/")) { throw new errors.InterfaceError("reserved tag: gel/*"); } if (buffer_1.utf8Encoder.encode(tag).length > 128) { throw new errors.InterfaceError("tag too long (> 128 bytes)"); } annos.set(TAG_ANNOTATION_KEY, tag); } else { annos.delete(TAG_ANNOTATION_KEY); } const clone = this._cloneWith({}); clone.annotations = annos; return clone; } withTransactionOptions(opt) { return this._cloneWith({ transactionOptions: opt instanceof TransactionOptions ? opt : new TransactionOptions(opt), }); } withRetryOptions(opt) { return this._cloneWith({ retryOptions: opt instanceof RetryOptions ? opt : new RetryOptions(opt.attempts, opt.backoff), }); } withWarningHandler(handler) { return this._cloneWith({ warningHandler: handler }); } isDefaultSession() { return (this.config.size === 0 && this.globals.size === 0 && this.moduleAliases.size === 0 && this.module === "default" && this.transactionOptions.isDefault()); } static defaults() { return _defaultOptions; } } exports.Options = Options; const _defaultOptions = new Options();