diff --git a/dist/api.d.ts b/dist/api.d.ts index 2a1ec1e160..0a4e40a05e 100644 --- a/dist/api.d.ts +++ b/dist/api.d.ts @@ -1459,18 +1459,18 @@ export declare function makeTranslateObjectFormula; result: PackFormulaResult; - }[] | undefined; - isAction?: boolean | undefined; - connectionRequirement?: ConnectionRequirement | undefined; - network?: import("./api_types").Network | undefined; - cacheTtlSecs?: number | undefined; - isExperimental?: boolean | undefined; - isSystem?: boolean | undefined; - extraOAuthScopes?: string[] | undefined; + }>; + isAction?: boolean; + connectionRequirement?: ConnectionRequirement; + network?: import("./api_types").Network; + cacheTtlSecs?: number; + isExperimental?: boolean; + isSystem?: boolean; + extraOAuthScopes?: string[]; } & { execute: (params: ParamValues, context: ExecutionContext) => Promise>; resultType: Type.object; @@ -1500,18 +1500,18 @@ export declare function makeEmptyFormula(definitio name: string; description: string; parameters: ParamDefsT; - varargParameters?: ParamDefs | undefined; - examples?: { - params: (import("./api_types").PackFormulaValue | undefined)[]; + varargParameters?: ParamDefs; + examples?: Array<{ + params: Array; result: PackFormulaResult; - }[] | undefined; - isAction?: boolean | undefined; - connectionRequirement?: ConnectionRequirement | undefined; - network?: import("./api_types").Network | undefined; - cacheTtlSecs?: number | undefined; - isExperimental?: boolean | undefined; - isSystem?: boolean | undefined; - extraOAuthScopes?: string[] | undefined; + }>; + isAction?: boolean; + connectionRequirement?: ConnectionRequirement; + network?: import("./api_types").Network; + cacheTtlSecs?: number; + isExperimental?: boolean; + isSystem?: boolean; + extraOAuthScopes?: string[]; } & { execute: (params: ParamValues, context: ExecutionContext) => Promise; resultType: Type.string; diff --git a/dist/api.js b/dist/api.js index 22ae3be49a..bb6b55f53b 100644 --- a/dist/api.js +++ b/dist/api.js @@ -1,6 +1,47 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.maybeRewriteConnectionForFormula = exports.maybeRewriteConnectionForNamedPropertyOptions = exports.makeEmptyFormula = exports.makeTranslateObjectFormula = exports.makeDynamicSyncTable = exports.makeSyncTableLegacy = exports.makeSyncTable = exports.makeObjectFormula = exports.makeSimpleAutocompleteMetadataFormula = exports.autocompleteSearchObjects = exports.simpleAutocomplete = exports.makePropertyOptionsFormula = exports.makeMetadataFormula = exports.normalizePropertyOptionsResults = exports.makeFormula = exports.makeStringFormula = exports.makeNumericFormula = exports.UpdateOutcome = exports.isSyncPackFormula = exports.isStringPackFormula = exports.isObjectPackFormula = exports.check = exports.makeUserVisibleError = exports.makeFileArrayParameter = exports.makeFileParameter = exports.makeImageArrayParameter = exports.makeImageParameter = exports.makeHtmlArrayParameter = exports.makeHtmlParameter = exports.makeDateArrayParameter = exports.makeDateParameter = exports.makeBooleanArrayParameter = exports.makeBooleanParameter = exports.makeNumericArrayParameter = exports.makeNumericParameter = exports.makeStringArrayParameter = exports.makeStringParameter = exports.makeParameter = exports.wrapGetSchema = exports.wrapMetadataFunction = exports.isDynamicSyncTable = exports.isUserVisibleError = exports.ResponseSizeTooLargeError = exports.MissingScopesError = exports.StatusCodeError = exports.UserVisibleError = void 0; +exports.UpdateOutcome = exports.ResponseSizeTooLargeError = exports.MissingScopesError = exports.StatusCodeError = exports.UserVisibleError = void 0; +exports.isUserVisibleError = isUserVisibleError; +exports.isDynamicSyncTable = isDynamicSyncTable; +exports.wrapMetadataFunction = wrapMetadataFunction; +exports.wrapGetSchema = wrapGetSchema; +exports.makeParameter = makeParameter; +exports.makeStringParameter = makeStringParameter; +exports.makeStringArrayParameter = makeStringArrayParameter; +exports.makeNumericParameter = makeNumericParameter; +exports.makeNumericArrayParameter = makeNumericArrayParameter; +exports.makeBooleanParameter = makeBooleanParameter; +exports.makeBooleanArrayParameter = makeBooleanArrayParameter; +exports.makeDateParameter = makeDateParameter; +exports.makeDateArrayParameter = makeDateArrayParameter; +exports.makeHtmlParameter = makeHtmlParameter; +exports.makeHtmlArrayParameter = makeHtmlArrayParameter; +exports.makeImageParameter = makeImageParameter; +exports.makeImageArrayParameter = makeImageArrayParameter; +exports.makeFileParameter = makeFileParameter; +exports.makeFileArrayParameter = makeFileArrayParameter; +exports.makeUserVisibleError = makeUserVisibleError; +exports.check = check; +exports.isObjectPackFormula = isObjectPackFormula; +exports.isStringPackFormula = isStringPackFormula; +exports.isSyncPackFormula = isSyncPackFormula; +exports.makeNumericFormula = makeNumericFormula; +exports.makeStringFormula = makeStringFormula; +exports.makeFormula = makeFormula; +exports.normalizePropertyOptionsResults = normalizePropertyOptionsResults; +exports.makeMetadataFormula = makeMetadataFormula; +exports.makePropertyOptionsFormula = makePropertyOptionsFormula; +exports.simpleAutocomplete = simpleAutocomplete; +exports.autocompleteSearchObjects = autocompleteSearchObjects; +exports.makeSimpleAutocompleteMetadataFormula = makeSimpleAutocompleteMetadataFormula; +exports.makeObjectFormula = makeObjectFormula; +exports.makeSyncTable = makeSyncTable; +exports.makeSyncTableLegacy = makeSyncTableLegacy; +exports.makeDynamicSyncTable = makeDynamicSyncTable; +exports.makeTranslateObjectFormula = makeTranslateObjectFormula; +exports.makeEmptyFormula = makeEmptyFormula; +exports.maybeRewriteConnectionForNamedPropertyOptions = maybeRewriteConnectionForNamedPropertyOptions; +exports.maybeRewriteConnectionForFormula = maybeRewriteConnectionForFormula; const api_types_1 = require("./api_types"); const api_types_2 = require("./api_types"); const api_types_3 = require("./api_types"); @@ -200,15 +241,12 @@ exports.ResponseSizeTooLargeError = ResponseSizeTooLargeError; function isUserVisibleError(error) { return 'isUserVisible' in error && error.isUserVisible; } -exports.isUserVisibleError = isUserVisibleError; function isDynamicSyncTable(syncTable) { return 'isDynamic' in syncTable; } -exports.isDynamicSyncTable = isDynamicSyncTable; function wrapMetadataFunction(fnOrFormula) { return typeof fnOrFormula === 'function' ? makeMetadataFormula(fnOrFormula) : fnOrFormula; } -exports.wrapMetadataFunction = wrapMetadataFunction; function transformToArraySchema(schema) { if ((schema === null || schema === void 0 ? void 0 : schema.type) === schema_2.ValueType.Array) { return schema; @@ -237,7 +275,6 @@ function wrapGetSchema(getSchema) { }, }; } -exports.wrapGetSchema = wrapGetSchema; /** * Create a definition for a parameter for a formula or sync. * @@ -280,101 +317,81 @@ function makeParameter(paramDefinition) { } return Object.freeze({ ...rest, autocomplete, type: actualType, crawlStrategy }); } -exports.makeParameter = makeParameter; /** @deprecated */ function makeStringParameter(name, description, args = {}) { return Object.freeze({ ...args, name, description, type: api_types_6.Type.string }); } -exports.makeStringParameter = makeStringParameter; /** @deprecated */ function makeStringArrayParameter(name, description, args = {}) { return Object.freeze({ ...args, name, description, type: api_types_13.stringArray }); } -exports.makeStringArrayParameter = makeStringArrayParameter; /** @deprecated */ function makeNumericParameter(name, description, args = {}) { return Object.freeze({ ...args, name, description, type: api_types_6.Type.number }); } -exports.makeNumericParameter = makeNumericParameter; /** @deprecated */ function makeNumericArrayParameter(name, description, args = {}) { return Object.freeze({ ...args, name, description, type: api_types_12.numberArray }); } -exports.makeNumericArrayParameter = makeNumericArrayParameter; /** @deprecated */ function makeBooleanParameter(name, description, args = {}) { return Object.freeze({ ...args, name, description, type: api_types_6.Type.boolean }); } -exports.makeBooleanParameter = makeBooleanParameter; /** @deprecated */ function makeBooleanArrayParameter(name, description, args = {}) { return Object.freeze({ ...args, name, description, type: api_types_7.booleanArray }); } -exports.makeBooleanArrayParameter = makeBooleanArrayParameter; /** @deprecated */ function makeDateParameter(name, description, args = {}) { return Object.freeze({ ...args, name, description, type: api_types_6.Type.date }); } -exports.makeDateParameter = makeDateParameter; /** @deprecated */ function makeDateArrayParameter(name, description, args = {}) { return Object.freeze({ ...args, name, description, type: api_types_8.dateArray }); } -exports.makeDateArrayParameter = makeDateArrayParameter; /** @deprecated */ function makeHtmlParameter(name, description, args = {}) { return Object.freeze({ ...args, name, description, type: api_types_6.Type.html }); } -exports.makeHtmlParameter = makeHtmlParameter; /** @deprecated */ function makeHtmlArrayParameter(name, description, args = {}) { return Object.freeze({ ...args, name, description, type: api_types_10.htmlArray }); } -exports.makeHtmlArrayParameter = makeHtmlArrayParameter; /** @deprecated */ function makeImageParameter(name, description, args = {}) { return Object.freeze({ ...args, name, description, type: api_types_6.Type.image }); } -exports.makeImageParameter = makeImageParameter; /** @deprecated */ function makeImageArrayParameter(name, description, args = {}) { return Object.freeze({ ...args, name, description, type: api_types_11.imageArray }); } -exports.makeImageArrayParameter = makeImageArrayParameter; /** @deprecated */ function makeFileParameter(name, description, args = {}) { return Object.freeze({ ...args, name, description, type: api_types_6.Type.file }); } -exports.makeFileParameter = makeFileParameter; /** @deprecated */ function makeFileArrayParameter(name, description, args = {}) { return Object.freeze({ ...args, name, description, type: api_types_9.fileArray }); } -exports.makeFileArrayParameter = makeFileArrayParameter; /** @deprecated */ function makeUserVisibleError(msg) { return new UserVisibleError(msg); } -exports.makeUserVisibleError = makeUserVisibleError; /** @deprecated */ function check(condition, msg) { if (!condition) { throw makeUserVisibleError(msg); } } -exports.check = check; function isObjectPackFormula(fn) { return fn.resultType === api_types_6.Type.object; } -exports.isObjectPackFormula = isObjectPackFormula; function isStringPackFormula(fn) { return fn.resultType === api_types_6.Type.string; } -exports.isStringPackFormula = isStringPackFormula; function isSyncPackFormula(fn) { return Boolean(fn.isSyncFormula); } -exports.isSyncPackFormula = isSyncPackFormula; /** * Possible outcomes for a single sync update. * @hidden @@ -403,7 +420,6 @@ const MaxPermissionsPerRow = 1000; function makeNumericFormula(definition) { return Object.assign({}, definition, { resultType: api_types_6.Type.number }); } -exports.makeNumericFormula = makeNumericFormula; /** * @deprecated * @@ -419,7 +435,6 @@ function makeStringFormula(definition) { ...(response && { schema: response.schema }), }); } -exports.makeStringFormula = makeStringFormula; /** * Creates a formula definition. * @@ -560,7 +575,6 @@ function makeFormula(fullDefinition) { } return maybeRewriteConnectionForFormula(formula, fullDefinition.connectionRequirement); } -exports.makeFormula = makeFormula; function normalizePropertyOptionsResultsArray(results) { return results.map(r => { if (typeof r === 'object' && Object.keys(r).length === 2 && 'display' in r && 'value' in r) { @@ -581,7 +595,6 @@ function normalizePropertyOptionsResults(results) { ...otherProps, }; } -exports.normalizePropertyOptionsResults = normalizePropertyOptionsResults; /** * A wrapper that generates a formula definition from the function that implements a metadata formula. * It is uncommon to ever need to call this directly, normally you would just define the JavaScript @@ -629,7 +642,6 @@ function makeMetadataFormula(execute, options) { connectionRequirement: (options === null || options === void 0 ? void 0 : options.connectionRequirement) || api_types_1.ConnectionRequirement.Optional, }); } -exports.makeMetadataFormula = makeMetadataFormula; /** * Builds a formula to store in {@link SyncTablePropertyOptions}. * @hidden @@ -657,7 +669,6 @@ function makePropertyOptionsFormula({ execute, schema, name, }) { const formula = makeFormula(formulaDefn); return formula; } -exports.makePropertyOptionsFormula = makePropertyOptionsFormula; /** * Utility to search over an array of autocomplete results and return only those that * match the given search string. @@ -704,7 +715,6 @@ function simpleAutocomplete(search, options) { } return Promise.resolve(metadataResults); } -exports.simpleAutocomplete = simpleAutocomplete; /** * A helper to search over a list of objects representing candidate search results, * filtering to only those that match a search string, and converting the matching @@ -752,7 +762,6 @@ async function autocompleteSearchObjects(search, objs, displayKey, valueKey) { } return metadataResults; } -exports.autocompleteSearchObjects = autocompleteSearchObjects; /** * @deprecated If you have a hardcoded array of autocomplete options, simply include that array * as the value of the `autocomplete` property in your parameter definition. There is no longer @@ -765,7 +774,6 @@ function makeSimpleAutocompleteMetadataFormula(options) { connectionRequirement: api_types_1.ConnectionRequirement.Optional, }); } -exports.makeSimpleAutocompleteMetadataFormula = makeSimpleAutocompleteMetadataFormula; function isResponseHandlerTemplate(obj) { return obj && obj.schema; } @@ -814,7 +822,6 @@ function makeObjectFormula({ response, ...definition }) { schema, }); } -exports.makeObjectFormula = makeObjectFormula; /** * Wrapper to produce a sync table definition. All (non-dynamic) sync tables should be created * using this wrapper rather than declaring a sync table definition object directly. @@ -962,7 +969,6 @@ function makeSyncTable({ name, description, identityName, schema: inputSchema, f role, }; } -exports.makeSyncTable = makeSyncTable; /** @deprecated */ function makeSyncTableLegacy(name, schema, formula, connectionRequirement, dynamicOptions = {}) { var _a; @@ -981,7 +987,6 @@ function makeSyncTableLegacy(name, schema, formula, connectionRequirement, dynam dynamicOptions, }); } -exports.makeSyncTableLegacy = makeSyncTableLegacy; /** * Creates a dynamic sync table definition. * @@ -1036,7 +1041,6 @@ function makeDynamicSyncTable({ name, description, getName: getNameDef, getSchem getName: maybeRewriteConnectionForFormula(getName, connectionRequirement), }; } -exports.makeDynamicSyncTable = makeDynamicSyncTable; /** * Helper to generate a formula that fetches a list of entities from a given URL and returns them. * @@ -1090,7 +1094,6 @@ function makeTranslateObjectFormula({ response, ...definition }) { schema: response.schema, }); } -exports.makeTranslateObjectFormula = makeTranslateObjectFormula; // TODO(jonathan/ekoleda): Flesh out a guide for empty formulas if this is something we care to support. // We probably also need the builder's addFormula() method to support empty formula defs if it doesn't already. /** @@ -1125,7 +1128,6 @@ function makeEmptyFormula(definition) { resultType: api_types_6.Type.string, }); } -exports.makeEmptyFormula = makeEmptyFormula; function maybeRewriteConnectionForNamedPropertyOptions(namedPropertyOptions, connectionRequirement) { if (!namedPropertyOptions) { return namedPropertyOptions; @@ -1136,7 +1138,6 @@ function maybeRewriteConnectionForNamedPropertyOptions(namedPropertyOptions, con } return result; } -exports.maybeRewriteConnectionForNamedPropertyOptions = maybeRewriteConnectionForNamedPropertyOptions; function maybeRewriteConnectionForFormula(formula, connectionRequirement) { var _a; if (formula && connectionRequirement) { @@ -1163,7 +1164,6 @@ function maybeRewriteConnectionForFormula(formula, connectionRequirement) { } return formula; } -exports.maybeRewriteConnectionForFormula = maybeRewriteConnectionForFormula; // This helper method finds any inline options functions in a static sync table schema. // These functions will need to be extracted into the "namedPropertyOptions" property on the sync // table and replaced with strings. diff --git a/dist/api_types.d.ts b/dist/api_types.d.ts index d59f300c9c..9881666d23 100644 --- a/dist/api_types.d.ts +++ b/dist/api_types.d.ts @@ -1,4 +1,3 @@ -/// import type { $Values } from './type_utils'; import type { ArraySchema } from './schema'; import type { AuthenticationDef } from './types'; diff --git a/dist/api_types.js b/dist/api_types.js index bc117022d9..4db614b10c 100644 --- a/dist/api_types.js +++ b/dist/api_types.js @@ -1,6 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.TableRole = exports.OptionsType = exports.PrecannedDateRange = exports.ValidFetchMethods = exports.NetworkConnection = exports.ConnectionRequirement = exports.ParameterTypeInputMap = exports.ParameterType = exports.fileArray = exports.imageArray = exports.htmlArray = exports.dateArray = exports.booleanArray = exports.numberArray = exports.stringArray = exports.isArrayType = exports.Type = void 0; +exports.TableRole = exports.OptionsType = exports.PrecannedDateRange = exports.ValidFetchMethods = exports.NetworkConnection = exports.ConnectionRequirement = exports.ParameterTypeInputMap = exports.ParameterType = exports.fileArray = exports.imageArray = exports.htmlArray = exports.dateArray = exports.booleanArray = exports.numberArray = exports.stringArray = exports.Type = void 0; +exports.isArrayType = isArrayType; /** * Markers used internally to represent data types for parameters and return values. * It should not be necessary to ever use these values directly. @@ -24,7 +25,6 @@ var Type; function isArrayType(obj) { return obj && obj.type === 'array' && typeof obj.items === 'number'; } -exports.isArrayType = isArrayType; /** @deprecated */ exports.stringArray = { type: 'array', diff --git a/dist/builder.js b/dist/builder.js index 63286e847f..5fcdb44a02 100644 --- a/dist/builder.js +++ b/dist/builder.js @@ -1,6 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.PackDefinitionBuilder = exports.newPack = void 0; +exports.PackDefinitionBuilder = void 0; +exports.newPack = newPack; const types_1 = require("./types"); const api_types_1 = require("./api_types"); const api_1 = require("./api"); @@ -25,7 +26,6 @@ const api_7 = require("./api"); function newPack(definition) { return new PackDefinitionBuilder(definition); } -exports.newPack = newPack; /** * A class that assists in constructing a pack definition. Use {@link newPack} to create one. */ diff --git a/dist/bundle.d.ts b/dist/bundle.d.ts index 47eaf13608..1802c2d9d7 100644 --- a/dist/bundle.d.ts +++ b/dist/bundle.d.ts @@ -3723,19 +3723,19 @@ export declare function makeDynamicSyncTable({ response, ...definition }: ObjectArrayFormulaDef): { description: string; name: string; - cacheTtlSecs?: number | undefined; + cacheTtlSecs?: number; parameters: ParamDefsT; - varargParameters?: ParamDefs | undefined; - examples?: { - params: (PackFormulaValue | undefined)[]; + varargParameters?: ParamDefs; + examples?: Array<{ + params: Array; result: PackFormulaResult; - }[] | undefined; - isAction?: boolean | undefined; - connectionRequirement?: ConnectionRequirement | undefined; - network?: Network | undefined; - isExperimental?: boolean | undefined; - isSystem?: boolean | undefined; - extraOAuthScopes?: string[] | undefined; + }>; + isAction?: boolean; + connectionRequirement?: ConnectionRequirement; + network?: Network; + isExperimental?: boolean; + isSystem?: boolean; + extraOAuthScopes?: string[]; } & { execute: (params: ParamValues, context: ExecutionContext) => Promise>; resultType: Type.object; @@ -3764,19 +3764,19 @@ export declare function makeTranslateObjectFormula(definition: EmptyFormulaDef): { description: string; name: string; - cacheTtlSecs?: number | undefined; + cacheTtlSecs?: number; parameters: ParamDefsT; - varargParameters?: ParamDefs | undefined; - examples?: { - params: (PackFormulaValue | undefined)[]; + varargParameters?: ParamDefs; + examples?: Array<{ + params: Array; result: PackFormulaResult; - }[] | undefined; - isAction?: boolean | undefined; - connectionRequirement?: ConnectionRequirement | undefined; - network?: Network | undefined; - isExperimental?: boolean | undefined; - isSystem?: boolean | undefined; - extraOAuthScopes?: string[] | undefined; + }>; + isAction?: boolean; + connectionRequirement?: ConnectionRequirement; + network?: Network; + isExperimental?: boolean; + isSystem?: boolean; + extraOAuthScopes?: string[]; } & { execute: (params: ParamValues, context: ExecutionContext) => Promise; resultType: Type.string; diff --git a/dist/cli/auth.js b/dist/cli/auth.js index de9536f06d..4aedb4c033 100644 --- a/dist/cli/auth.js +++ b/dist/cli/auth.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.handleAuth = void 0; +exports.handleAuth = handleAuth; const build_1 = require("./build"); const helpers_1 = require("./helpers"); const helpers_2 = require("./helpers"); @@ -11,4 +11,3 @@ async function handleAuth({ manifestPath, oauthServerPort, extraOAuthScopes }) { const manifest = await (0, helpers_1.importManifest)(bundleFilename); await (0, auth_1.setupAuthFromModule)(fullManifestPath, manifest, { oauthServerPort, extraOAuthScopes }); } -exports.handleAuth = handleAuth; diff --git a/dist/cli/build.js b/dist/cli/build.js index e5850e4ecd..3651b60dd5 100644 --- a/dist/cli/build.js +++ b/dist/cli/build.js @@ -1,6 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.build = exports.handleBuild = void 0; +exports.handleBuild = handleBuild; +exports.build = build; const compile_1 = require("../testing/compile"); const helpers_1 = require("../testing/helpers"); async function handleBuild({ outputDir, manifestFile, minify, timerStrategy, intermediateOutputDirectory, }) { @@ -18,7 +19,6 @@ async function handleBuild({ outputDir, manifestFile, minify, timerStrategy, int (0, helpers_1.print)(`Pack built successfully. Compiled output is in ${bundlePath}.`); } } -exports.handleBuild = handleBuild; async function build(manifestFile, { timerStrategy } = {}) { const { bundlePath } = await (0, compile_1.compilePackBundle)({ manifestPath: manifestFile, @@ -26,4 +26,3 @@ async function build(manifestFile, { timerStrategy } = {}) { }); return bundlePath; } -exports.build = build; diff --git a/dist/cli/clone.js b/dist/cli/clone.js index c0faaf5d51..320097a563 100644 --- a/dist/cli/clone.js +++ b/dist/cli/clone.js @@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.handleClone = void 0; +exports.handleClone = handleClone; const helpers_1 = require("./helpers"); const helpers_2 = require("./helpers"); const helpers_3 = require("./helpers"); @@ -66,7 +66,6 @@ async function handleClone({ packIdOrUrl, codaApiEndpoint, apiToken }) { fs_extra_1.default.writeFileSync(path_1.default.join(manifestDir, 'pack.ts'), sourceCode); (0, helpers_6.printAndExit)("Successfully updated pack.ts with the Pack's code!", 0); } -exports.handleClone = handleClone; function maybeHandleClientError(err) { if ((0, coda_1.isResponseError)(err)) { switch (err.response.status) { diff --git a/dist/cli/config_storage.js b/dist/cli/config_storage.js index 6661b19b6e..e57198f7db 100644 --- a/dist/cli/config_storage.js +++ b/dist/cli/config_storage.js @@ -26,7 +26,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getPackOptions = exports.storePackOptions = exports.getPackId = exports.storePackId = exports.storeCodaApiKey = exports.getApiKey = exports.PackOptionKey = exports.PACK_ID_FILE_NAME = exports.DEFAULT_API_ENDPOINT = void 0; +exports.PackOptionKey = exports.PACK_ID_FILE_NAME = exports.DEFAULT_API_ENDPOINT = void 0; +exports.getApiKey = getApiKey; +exports.storeCodaApiKey = storeCodaApiKey; +exports.storePackId = storePackId; +exports.getPackId = getPackId; +exports.storePackOptions = storePackOptions; +exports.getPackOptions = getPackOptions; const path = __importStar(require("path")); const helpers_1 = require("../testing/helpers"); const url_parse_1 = __importDefault(require("url-parse")); @@ -61,7 +67,6 @@ function getApiKey(codaApiEndpoint) { } return process.env.CODA_PACKS_API_KEY; } -exports.getApiKey = getApiKey; function storeCodaApiKey(apiKey, projectDir = '.', codaApiEndpoint) { const filename = path.join(projectDir, API_KEY_FILE_NAME); const apiKeyFile = readApiKeyFile(filename) || { apiKey: '' }; @@ -75,7 +80,6 @@ function storeCodaApiKey(apiKey, projectDir = '.', codaApiEndpoint) { } writeApiKeyFile(filename, apiKeyFile); } -exports.storeCodaApiKey = storeCodaApiKey; function readApiKeyFile(filename) { return (0, helpers_1.readJSONFile)(filename); } @@ -94,7 +98,6 @@ function storePackId(manifestDir, packId, codaApiEndpoint) { } writePacksFile(manifestDir, fileContents); } -exports.storePackId = storePackId; function getPackId(manifestDir, codaApiEndpoint) { var _a; const fileContents = readPackIdFile(manifestDir); @@ -109,19 +112,16 @@ function getPackId(manifestDir, codaApiEndpoint) { return (_a = fileContents.environmentPackIds) === null || _a === void 0 ? void 0 : _a[host]; } } -exports.getPackId = getPackId; // Merges new options with existing ones, if any. function storePackOptions(manifestDir, options) { const fileContents = readPackIdFile(manifestDir) || { packId: -1 }; fileContents.options = { ...fileContents.options, ...options }; writePacksFile(manifestDir, fileContents); } -exports.storePackOptions = storePackOptions; function getPackOptions(manifestDir) { const fileContents = readPackIdFile(manifestDir); return fileContents === null || fileContents === void 0 ? void 0 : fileContents.options; } -exports.getPackOptions = getPackOptions; function readPackIdFile(manifestDir) { const filename = path.join(manifestDir, exports.PACK_ID_FILE_NAME); return (0, helpers_1.readJSONFile)(filename); diff --git a/dist/cli/create.js b/dist/cli/create.js index df9fa6d2d3..ba6eae0fac 100644 --- a/dist/cli/create.js +++ b/dist/cli/create.js @@ -26,7 +26,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.createPack = exports.handleCreate = void 0; +exports.handleCreate = handleCreate; +exports.createPack = createPack; const config_storage_1 = require("./config_storage"); const helpers_1 = require("./helpers"); const helpers_2 = require("./helpers"); @@ -43,7 +44,6 @@ const errors_3 = require("./errors"); async function handleCreate({ manifestFile, codaApiEndpoint, name, description, workspace, apiToken, }) { await createPack(manifestFile, codaApiEndpoint, { name, description, workspace }, apiToken); } -exports.handleCreate = handleCreate; async function createPack(manifestFile, codaApiEndpoint, { name, description, workspace }, apiToken) { const manifestDir = path.dirname(manifestFile); const formattedEndpoint = (0, helpers_3.formatEndpoint)(codaApiEndpoint); @@ -72,7 +72,6 @@ async function createPack(manifestFile, codaApiEndpoint, { name, description, wo return (0, helpers_4.printAndExit)(errors.join('\n')); } } -exports.createPack = createPack; function parseWorkspace(workspace) { if (workspace) { const match = /.*\/workspaces\/(ws-[A-Za-z0-9=_-]{10})/.exec(workspace); diff --git a/dist/cli/errors.js b/dist/cli/errors.js index 1c52b58fb4..7e9b976b75 100644 --- a/dist/cli/errors.js +++ b/dist/cli/errors.js @@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.formatError = exports.formatResponseError = exports.tryParseSystemError = void 0; +exports.tryParseSystemError = tryParseSystemError; +exports.formatResponseError = formatResponseError; +exports.formatError = formatError; const util_1 = __importDefault(require("util")); function tryParseSystemError(error) { // NB(alan): this should only be hit for Coda developers trying to use the CLI with their development server. @@ -12,13 +14,10 @@ function tryParseSystemError(error) { } return ''; } -exports.tryParseSystemError = tryParseSystemError; async function formatResponseError(err) { const json = await err.response.json(); return formatError(json); } -exports.formatResponseError = formatResponseError; function formatError(obj) { return util_1.default.inspect(obj, false, null, true); } -exports.formatError = formatError; diff --git a/dist/cli/execute.js b/dist/cli/execute.js index 427a0eb980..c8d3c517bd 100644 --- a/dist/cli/execute.js +++ b/dist/cli/execute.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.handleExecute = void 0; +exports.handleExecute = handleExecute; const compile_1 = require("../testing/compile"); const execution_1 = require("../testing/execution"); const helpers_1 = require("./helpers"); @@ -35,4 +35,3 @@ async function handleExecute({ manifestPath, formulaName, params, fetch, vm, dyn contextOptions: { useRealFetcher: fetch }, }); } -exports.handleExecute = handleExecute; diff --git a/dist/cli/extensions.js b/dist/cli/extensions.js index 7442ebb096..627e736d87 100644 --- a/dist/cli/extensions.js +++ b/dist/cli/extensions.js @@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.handleExtensions = exports.Tools = void 0; +exports.Tools = void 0; +exports.handleExtensions = handleExtensions; const fs_extra_1 = __importDefault(require("fs-extra")); const helpers_1 = require("./helpers"); const path_1 = __importDefault(require("path")); @@ -26,7 +27,6 @@ async function handleExtensions(args) { } } } -exports.handleExtensions = handleExtensions; function installVSCodeExtensions() { const vsCodeDir = path_1.default.join(process.cwd(), '.vscode'); if (!fs_extra_1.default.existsSync(vsCodeDir)) { diff --git a/dist/cli/helpers.d.ts b/dist/cli/helpers.d.ts index 9c49f13f6e..36ef14d617 100644 --- a/dist/cli/helpers.d.ts +++ b/dist/cli/helpers.d.ts @@ -1,5 +1,3 @@ -/// -/// import type { Authentication } from '../types'; import type { BasicPackDefinition } from '../types'; import { Client } from '../helpers/external-api/coda'; diff --git a/dist/cli/helpers.js b/dist/cli/helpers.js index d56822a6b1..9e90647f57 100644 --- a/dist/cli/helpers.js +++ b/dist/cli/helpers.js @@ -26,7 +26,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.assertPackIdOrUrl = exports.assertPackId = exports.assertApiToken = exports.importManifest = exports.getPackAuth = exports.makeManifestFullPath = exports.isTestCommand = exports.formatEndpoint = exports.createCodaClient = exports.spawnProcess = void 0; +exports.spawnProcess = spawnProcess; +exports.createCodaClient = createCodaClient; +exports.formatEndpoint = formatEndpoint; +exports.isTestCommand = isTestCommand; +exports.makeManifestFullPath = makeManifestFullPath; +exports.getPackAuth = getPackAuth; +exports.importManifest = importManifest; +exports.assertApiToken = assertApiToken; +exports.assertPackId = assertPackId; +exports.assertPackIdOrUrl = assertPackIdOrUrl; const coda_1 = require("../helpers/external-api/coda"); const config_storage_1 = require("./config_storage"); const config_storage_2 = require("./config_storage"); @@ -41,24 +50,19 @@ function spawnProcess(command, { stdio = 'inherit' } = {}) { stdio, }); } -exports.spawnProcess = spawnProcess; function createCodaClient(apiToken, protocolAndHost) { return new coda_1.Client({ protocolAndHost, apiToken }); } -exports.createCodaClient = createCodaClient; function formatEndpoint(endpoint) { return endpoint.startsWith('https://') ? endpoint : `https://${endpoint}`; } -exports.formatEndpoint = formatEndpoint; function isTestCommand() { var _a; return (_a = process.argv[1]) === null || _a === void 0 ? void 0 : _a.endsWith('coda.ts'); } -exports.isTestCommand = isTestCommand; function makeManifestFullPath(manifestPath) { return path_1.default.isAbsolute(manifestPath) ? manifestPath : path_1.default.join(process.cwd(), manifestPath); } -exports.makeManifestFullPath = makeManifestFullPath; // Packs today do not have both defaultAuth and systemAuth specs, so this helper gets // whichever is available, defaulting to defaultAuth. A smarter version could be supported // in the future, for a use case like a Google Maps pack which allowed a default credential @@ -74,12 +78,10 @@ function getPackAuth(packDef) { // Since SystemAuthentication is a strict subset of Authentication, we can cast them together. return defaultAuthentication || systemConnectionAuthentication; } -exports.getPackAuth = getPackAuth; async function importManifest(bundleFilename) { const module = await Promise.resolve(`${path_1.default.resolve(bundleFilename)}`).then(s => __importStar(require(s))); return module.pack || module.manifest; } -exports.importManifest = importManifest; function assertApiToken(codaApiEndpoint, cliApiToken) { if (cliApiToken) { return cliApiToken; @@ -90,7 +92,6 @@ function assertApiToken(codaApiEndpoint, cliApiToken) { } return apiKey; } -exports.assertApiToken = assertApiToken; function assertPackId(manifestDir, codaApiEndpoint) { const packId = (0, config_storage_2.getPackId)(manifestDir, codaApiEndpoint); if (!packId) { @@ -98,7 +99,6 @@ function assertPackId(manifestDir, codaApiEndpoint) { } return packId; } -exports.assertPackId = assertPackId; function assertPackIdOrUrl(packIdOrUrl) { const packId = (0, link_1.parsePackIdOrUrl)(packIdOrUrl); if (!packId) { @@ -106,4 +106,3 @@ function assertPackIdOrUrl(packIdOrUrl) { } return packId; } -exports.assertPackIdOrUrl = assertPackIdOrUrl; diff --git a/dist/cli/init.js b/dist/cli/init.js index 084e50b62a..9a471660bb 100644 --- a/dist/cli/init.js +++ b/dist/cli/init.js @@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.handleInit = void 0; +exports.handleInit = handleInit; const fs_extra_1 = __importDefault(require("fs-extra")); const path_1 = __importDefault(require("path")); const helpers_1 = require("../testing/helpers"); @@ -75,4 +75,3 @@ async function handleInit() { (0, helpers_2.spawnProcess)(uninstallCommand); } } -exports.handleInit = handleInit; diff --git a/dist/cli/link.js b/dist/cli/link.js index e3421aa8a2..3b2062cb4d 100644 --- a/dist/cli/link.js +++ b/dist/cli/link.js @@ -1,6 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.parsePackIdOrUrl = exports.handleLink = void 0; +exports.handleLink = handleLink; +exports.parsePackIdOrUrl = parsePackIdOrUrl; const helpers_1 = require("./helpers"); const helpers_2 = require("./helpers"); const helpers_3 = require("./helpers"); @@ -51,7 +52,6 @@ async function handleLink({ manifestDir, codaApiEndpoint, packIdOrUrl, apiToken (0, config_storage_2.storePackId)(manifestDir, packId, codaApiEndpoint); return (0, helpers_5.printAndExit)(`Linked successfully!`, 0); } -exports.handleLink = handleLink; function parsePackIdOrUrl(packIdOrUrl) { for (const regex of PackRegexes) { const match = packIdOrUrl.match(regex); @@ -62,4 +62,3 @@ function parsePackIdOrUrl(packIdOrUrl) { } return null; } -exports.parsePackIdOrUrl = parsePackIdOrUrl; diff --git a/dist/cli/register.js b/dist/cli/register.js index a986964cd0..665e3fa642 100644 --- a/dist/cli/register.js +++ b/dist/cli/register.js @@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.handleRegister = void 0; +exports.handleRegister = handleRegister; const helpers_1 = require("./helpers"); const helpers_2 = require("./helpers"); const coda_1 = require("../helpers/external-api/coda"); @@ -37,4 +37,3 @@ async function handleRegister({ apiToken, codaApiEndpoint }) { (0, config_storage_1.storeCodaApiKey)(apiToken, process.env.PWD, codaApiEndpoint); (0, helpers_3.printAndExit)(`API key validated and stored successfully!`, 0); } -exports.handleRegister = handleRegister; diff --git a/dist/cli/release.js b/dist/cli/release.js index 467ba73be1..6200a3f20c 100644 --- a/dist/cli/release.js +++ b/dist/cli/release.js @@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.handleRelease = void 0; +exports.handleRelease = handleRelease; const helpers_1 = require("./helpers"); const helpers_2 = require("./helpers"); const build_1 = require("./build"); @@ -72,7 +72,6 @@ async function handleRelease({ manifestFile, packVersion: explicitPackVersion, c await handleResponse(codaClient.createPackRelease(packId, {}, { packVersion, releaseNotes: notes })); return (0, helpers_6.printAndExit)('Success!', 0); } -exports.handleRelease = handleRelease; async function handleResponse(p) { try { return await p; diff --git a/dist/cli/set_option.js b/dist/cli/set_option.js index 5e741b79c3..73e644f6a7 100644 --- a/dist/cli/set_option.js +++ b/dist/cli/set_option.js @@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.handleSetOption = void 0; +exports.handleSetOption = handleSetOption; const config_storage_1 = require("./config_storage"); const compile_1 = require("../testing/compile"); const __1 = require(".."); @@ -37,7 +37,6 @@ async function handleSetOption({ manifestFile, option, value }) { (0, config_storage_2.storePackOptions)(manifestDir, options); (0, helpers_1.print)('Option stored successfully.'); } -exports.handleSetOption = handleSetOption; function validateOption(option, value) { const validOptions = Object.values(config_storage_1.PackOptionKey); if (!validOptions.includes(option)) { diff --git a/dist/cli/upload.js b/dist/cli/upload.js index 90077af111..8b591d9fa0 100644 --- a/dist/cli/upload.js +++ b/dist/cli/upload.js @@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.handleUpload = void 0; +exports.handleUpload = handleUpload; const v1_1 = require("../helpers/external-api/v1"); const helpers_1 = require("./helpers"); const helpers_2 = require("./helpers"); @@ -167,7 +167,6 @@ async function handleUpload({ intermediateOutputDirectory, manifestFile, codaApi cleanup(intermediateOutputDirectory, logger); logger.info('Done!'); } -exports.handleUpload = handleUpload; async function uploadPack(uploadUrl, uploadPayload, headers) { try { await fetch(uploadUrl, { diff --git a/dist/cli/validate.js b/dist/cli/validate.js index d19e455fce..499cbe06d9 100644 --- a/dist/cli/validate.js +++ b/dist/cli/validate.js @@ -23,7 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateMetadata = exports.handleValidate = void 0; +exports.handleValidate = handleValidate; +exports.validateMetadata = validateMetadata; const compile_1 = require("../testing/compile"); const metadata_1 = require("../helpers/metadata"); const helpers_1 = require("./helpers"); @@ -42,7 +43,6 @@ async function handleValidate({ manifestFile, checkDeprecationWarnings }) { const metadata = (0, metadata_1.compilePackMetadata)(manifest); return validateMetadata(metadata, { checkDeprecationWarnings }); } -exports.handleValidate = handleValidate; async function validateMetadata(metadata, { checkDeprecationWarnings = true } = {}) { var _a, _b; // Since package.json isn't in dist, we grab it from the root directory instead. @@ -68,7 +68,6 @@ async function validateMetadata(metadata, { checkDeprecationWarnings = true } = (0, helpers_4.printAndExit)(`Your Pack is using deprecated properties or features: \n${deprecationWarnings}`, 0); } } -exports.validateMetadata = validateMetadata; function makeErrorMessage({ path, message }) { if (path) { return `Error in field at path "${path}": ${message}`; diff --git a/dist/cli/whoami.js b/dist/cli/whoami.js index bbe3c36ff1..a0a033948c 100644 --- a/dist/cli/whoami.js +++ b/dist/cli/whoami.js @@ -1,6 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.formatWhoami = exports.handleWhoami = void 0; +exports.handleWhoami = handleWhoami; +exports.formatWhoami = formatWhoami; const helpers_1 = require("./helpers"); const helpers_2 = require("./helpers"); const config_storage_1 = require("./config_storage"); @@ -28,9 +29,7 @@ async function handleWhoami({ apiToken, codaApiEndpoint }) { return (0, helpers_3.printAndExit)(errors.join('\n')); } } -exports.handleWhoami = handleWhoami; function formatWhoami(user) { const { name, loginId, tokenName, scoped } = user; return `You are ${name} (${loginId}) using ${scoped ? 'scoped' : 'non-scoped'} token "${tokenName}"`; } -exports.formatWhoami = formatWhoami; diff --git a/dist/handler_templates.js b/dist/handler_templates.js index a99ddffe30..2bc6773628 100644 --- a/dist/handler_templates.js +++ b/dist/handler_templates.js @@ -3,7 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.generateObjectResponseHandler = exports.untransformKeys = exports.untransformBody = exports.transformBody = exports.generateRequestHandler = void 0; +exports.generateRequestHandler = generateRequestHandler; +exports.transformBody = transformBody; +exports.untransformBody = untransformBody; +exports.untransformKeys = untransformKeys; +exports.generateObjectResponseHandler = generateObjectResponseHandler; const clone_1 = __importDefault(require("clone")); const object_utils_1 = require("./helpers/object_utils"); const ensure_1 = require("./helpers/ensure"); @@ -115,7 +119,6 @@ function generateRequestHandler(request, parameters) { }; }; } -exports.generateRequestHandler = generateRequestHandler; function mapKeys(obj, schema) { if (!(schema && (0, schema_2.isObject)(schema))) { return obj; @@ -163,7 +166,6 @@ function transformBody(body, schema) { } return body; } -exports.transformBody = transformBody; function getUnmapKeyLookup(schema) { const remappedKeys = new Map(); if (!(schema && (0, schema_2.isObject)(schema))) { @@ -216,7 +218,6 @@ function untransformBody(body, schema) { } return body; } -exports.untransformBody = untransformBody; /** * Reverses the transformation of schema object keys to the values expected by the pack. * Useful when passing in a list of keys from Coda -> Pack, such as when sending the aggregated @@ -227,7 +228,6 @@ function untransformKeys(keys, schema) { const remappedKeys = getUnmapKeyLookup(schemaObject); return keys.map(key => remappedKeys.get(key) || key); } -exports.untransformKeys = untransformKeys; function generateObjectResponseHandler(response) { const { projectKey } = response; return function objectResponseHandler(resp) { @@ -240,4 +240,3 @@ function generateObjectResponseHandler(response) { return projectedBody; }; } -exports.generateObjectResponseHandler = generateObjectResponseHandler; diff --git a/dist/helpers/crypto.d.ts b/dist/helpers/crypto.d.ts index ab85b219ab..b45de2cb80 100644 --- a/dist/helpers/crypto.d.ts +++ b/dist/helpers/crypto.d.ts @@ -1,2 +1 @@ -/// export declare function computeSha256(dataToChecksum: string | Buffer, encodeAsUtf8?: boolean): string; diff --git a/dist/helpers/crypto.js b/dist/helpers/crypto.js index 72b390d688..8cd3d8ad7b 100644 --- a/dist/helpers/crypto.js +++ b/dist/helpers/crypto.js @@ -3,12 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.computeSha256 = void 0; +exports.computeSha256 = computeSha256; const sha_js_1 = __importDefault(require("sha.js")); function computeSha256(dataToChecksum, encodeAsUtf8 = true) { return _computeSha256Impl(dataToChecksum, encodeAsUtf8, true); } -exports.computeSha256 = computeSha256; function _computeSha256Impl(dataToChecksum, encodeAsUtf8 = true, outputHex) { const hash = (0, sha_js_1.default)('sha256'); if (typeof dataToChecksum === 'string' && encodeAsUtf8) { diff --git a/dist/helpers/ensure.js b/dist/helpers/ensure.js index 856ad9e8b5..76f10d0548 100644 --- a/dist/helpers/ensure.js +++ b/dist/helpers/ensure.js @@ -1,6 +1,10 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.ensureNever = exports.assertCondition = exports.ensureExists = exports.ensureNonEmptyString = exports.ensureUnreachable = void 0; +exports.ensureUnreachable = ensureUnreachable; +exports.ensureNonEmptyString = ensureNonEmptyString; +exports.ensureExists = ensureExists; +exports.assertCondition = assertCondition; +exports.ensureNever = ensureNever; const api_1 = require("../api"); /** * Helper for TypeScript to make sure that handling of code forks is exhaustive, @@ -31,7 +35,6 @@ const api_1 = require("../api"); function ensureUnreachable(value, message) { throw new Error(message || `Unreachable code hit with value ${String(value)}`); } -exports.ensureUnreachable = ensureUnreachable; /** * Helper to check that a given value is a string, and is not the empty string. * If the value is not a string or is empty, an error will be raised at runtime. @@ -42,7 +45,6 @@ function ensureNonEmptyString(value, message) { } return value; } -exports.ensureNonEmptyString = ensureNonEmptyString; /** * Helper to check that a given value is defined, that is, is neither `undefined` nor `null`. * If the value is `undefined` or `null`, an error will be raised at runtime. @@ -56,7 +58,6 @@ function ensureExists(value, message) { } return value; } -exports.ensureExists = ensureExists; function getErrorConstructor(message) { return message ? api_1.UserVisibleError : Error; } @@ -82,10 +83,8 @@ function assertCondition(condition, message) { throw new (getErrorConstructor(message))(message || 'Assertion failed'); } } -exports.assertCondition = assertCondition; /** * Helper to check that a given type is empty/never at compile time. * In particular, useful to check whether a given a object is empty via `ensureNever()`. */ function ensureNever(_) { } -exports.ensureNever = ensureNever; diff --git a/dist/helpers/external-api/coda.d.ts b/dist/helpers/external-api/coda.d.ts index c540ce90cb..5acb8da86d 100644 --- a/dist/helpers/external-api/coda.d.ts +++ b/dist/helpers/external-api/coda.d.ts @@ -81,7 +81,7 @@ export declare class Client { pageToken?: string; }): Promise; upsertRows(docId: string, tableIdOrName: string, params: { - disableParsing?: boolean | undefined; + disableParsing?: boolean; } | undefined, payload: types.PublicApiRowsUpsert): Promise; deleteRows(docId: string, tableIdOrName: string, params: {} | undefined, payload: types.PublicApiRowsDelete): Promise; getRow(docId: string, tableIdOrName: string, rowIdOrName: string, params?: { @@ -89,7 +89,7 @@ export declare class Client { valueFormat?: types.PublicApiValueFormat; }): Promise; updateRow(docId: string, tableIdOrName: string, rowIdOrName: string, params: { - disableParsing?: boolean | undefined; + disableParsing?: boolean; } | undefined, payload: types.PublicApiRowUpdate): Promise; deleteRow(docId: string, tableIdOrName: string, rowIdOrName: string, params?: {}): Promise; pushButton(docId: string, tableIdOrName: string, rowIdOrName: string, columnIdOrName: string, params?: {}): Promise; diff --git a/dist/helpers/external-api/coda.js b/dist/helpers/external-api/coda.js index ed2d474c28..6f7706178b 100644 --- a/dist/helpers/external-api/coda.js +++ b/dist/helpers/external-api/coda.js @@ -8,7 +8,8 @@ * Hash: 3cb65a92b168c432b6eb8cad28cd0cc16911c3536d86f2d256c7ddb6007de8ad */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.Client = exports.isResponseError = exports.ResponseError = void 0; +exports.Client = exports.ResponseError = void 0; +exports.isResponseError = isResponseError; require("es6-promise/auto"); require("cross-fetch/polyfill"); const url_1 = require("../url"); @@ -22,7 +23,6 @@ exports.ResponseError = ResponseError; function isResponseError(err) { return err instanceof ResponseError; } -exports.isResponseError = isResponseError; class Client { constructor({ apiToken, protocolAndHost = 'https://coda.io', userAgent = 'Coda-Typescript-API-Client', }) { this.protocolAndHost = protocolAndHost; diff --git a/dist/helpers/legacy_marshal/index.js b/dist/helpers/legacy_marshal/index.js index 3d8430f395..926125bafc 100644 --- a/dist/helpers/legacy_marshal/index.js +++ b/dist/helpers/legacy_marshal/index.js @@ -1,6 +1,9 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.legacyUnwrapError = exports.legacyWrapError = exports.internalUnmarshalValueForAnyNodeVersion = exports.marshalValueForAnyNodeVersion = void 0; +exports.marshalValueForAnyNodeVersion = marshalValueForAnyNodeVersion; +exports.internalUnmarshalValueForAnyNodeVersion = internalUnmarshalValueForAnyNodeVersion; +exports.legacyWrapError = legacyWrapError; +exports.legacyUnwrapError = legacyUnwrapError; const marshal_errors_1 = require("./marshal_errors"); const marshal_errors_2 = require("./marshal_errors"); const marshal_buffer_1 = require("./marshal_buffer"); @@ -91,7 +94,6 @@ function marshalValueForAnyNodeVersion(val) { } return result; } -exports.marshalValueForAnyNodeVersion = marshalValueForAnyNodeVersion; /** * Use unmarshalValueFromString() instead. It can determine what type of marshaling was used and * call the correct unmarshal function, which gives us more flexibility to swap between marshaling @@ -105,11 +107,9 @@ function internalUnmarshalValueForAnyNodeVersion(marshaledValue) { // JSON parsing can't populate `undefined` in deserialize b/c it's not a valid JSON value, so we make a 2nd pass. return reviveUndefinedValues(parsed); } -exports.internalUnmarshalValueForAnyNodeVersion = internalUnmarshalValueForAnyNodeVersion; function legacyWrapError(err) { return new Error(marshalValueForAnyNodeVersion(err)); } -exports.legacyWrapError = legacyWrapError; function legacyUnwrapError(err) { try { const unmarshaledValue = internalUnmarshalValueForAnyNodeVersion(err.message); @@ -122,7 +122,6 @@ function legacyUnwrapError(err) { return err; } } -exports.legacyUnwrapError = legacyUnwrapError; // Recursively traverses objects/arrays function reviveUndefinedValues(val) { // Check null first b/c typeof null === 'object' diff --git a/dist/helpers/legacy_marshal/marshal_buffer.d.ts b/dist/helpers/legacy_marshal/marshal_buffer.d.ts index 092ec1af68..c425b90ea5 100644 --- a/dist/helpers/legacy_marshal/marshal_buffer.d.ts +++ b/dist/helpers/legacy_marshal/marshal_buffer.d.ts @@ -1,4 +1,3 @@ -/// export declare function marshalBuffer(val: any): object | undefined; export declare function unmarshalBuffer(val: { [key: string]: any; diff --git a/dist/helpers/legacy_marshal/marshal_buffer.js b/dist/helpers/legacy_marshal/marshal_buffer.js index d45bd09755..f321ba9ee8 100644 --- a/dist/helpers/legacy_marshal/marshal_buffer.js +++ b/dist/helpers/legacy_marshal/marshal_buffer.js @@ -1,6 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.unmarshalBuffer = exports.marshalBuffer = void 0; +exports.marshalBuffer = marshalBuffer; +exports.unmarshalBuffer = unmarshalBuffer; const constants_1 = require("./constants"); const constants_2 = require("./constants"); function marshalBuffer(val) { @@ -16,11 +17,9 @@ function marshalBuffer(val) { }; } } -exports.marshalBuffer = marshalBuffer; function unmarshalBuffer(val) { if (typeof val !== 'object' || val[constants_2.LegacyMarshalingInjectedKeys.CodaMarshaler] !== constants_1.LegacyCodaMarshalerType.Buffer) { return; } return Buffer.from(val.data); } -exports.unmarshalBuffer = unmarshalBuffer; diff --git a/dist/helpers/legacy_marshal/marshal_dates.js b/dist/helpers/legacy_marshal/marshal_dates.js index 0f04e498fc..518a1f23fc 100644 --- a/dist/helpers/legacy_marshal/marshal_dates.js +++ b/dist/helpers/legacy_marshal/marshal_dates.js @@ -1,6 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.unmarshalDate = exports.marshalDate = void 0; +exports.marshalDate = marshalDate; +exports.unmarshalDate = unmarshalDate; const constants_1 = require("./constants"); const constants_2 = require("./constants"); function marshalDate(val) { @@ -11,11 +12,9 @@ function marshalDate(val) { }; } } -exports.marshalDate = marshalDate; function unmarshalDate(val) { if (typeof val !== 'object' || val[constants_2.LegacyMarshalingInjectedKeys.CodaMarshaler] !== constants_1.LegacyCodaMarshalerType.Date) { return; } return new Date(Date.parse(val.date)); } -exports.unmarshalDate = unmarshalDate; diff --git a/dist/helpers/legacy_marshal/marshal_errors.js b/dist/helpers/legacy_marshal/marshal_errors.js index 6a735bc0bd..bf355a36b8 100644 --- a/dist/helpers/legacy_marshal/marshal_errors.js +++ b/dist/helpers/legacy_marshal/marshal_errors.js @@ -1,6 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.legacyUnmarshalError = exports.legacyMarshalError = void 0; +exports.legacyMarshalError = legacyMarshalError; +exports.legacyUnmarshalError = legacyUnmarshalError; const constants_1 = require("./constants"); const constants_2 = require("./constants"); const api_1 = require("../../api"); @@ -55,7 +56,6 @@ function legacyMarshalError(err) { ...args, }; } -exports.legacyMarshalError = legacyMarshalError; function getErrorClass(errorClassType, name) { let errorClasses; switch (errorClassType) { @@ -87,4 +87,3 @@ function legacyUnmarshalError(val) { } return error; } -exports.legacyUnmarshalError = legacyUnmarshalError; diff --git a/dist/helpers/legacy_marshal/marshal_numbers.js b/dist/helpers/legacy_marshal/marshal_numbers.js index 1b4eb7b01d..057128d569 100644 --- a/dist/helpers/legacy_marshal/marshal_numbers.js +++ b/dist/helpers/legacy_marshal/marshal_numbers.js @@ -1,6 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.unmarshalNumber = exports.marshalNumber = void 0; +exports.marshalNumber = marshalNumber; +exports.unmarshalNumber = unmarshalNumber; const constants_1 = require("./constants"); const constants_2 = require("./constants"); function marshalNumber(val) { @@ -12,11 +13,9 @@ function marshalNumber(val) { }; } } -exports.marshalNumber = marshalNumber; function unmarshalNumber(val) { if (typeof val !== 'object' || val[constants_2.LegacyMarshalingInjectedKeys.CodaMarshaler] !== constants_1.LegacyCodaMarshalerType.Number) { return; } return Number(val.data); } -exports.unmarshalNumber = unmarshalNumber; diff --git a/dist/helpers/metadata.js b/dist/helpers/metadata.js index 59af7b6ced..8fffbfe860 100644 --- a/dist/helpers/metadata.js +++ b/dist/helpers/metadata.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.compilePackMetadata = void 0; +exports.compilePackMetadata = compilePackMetadata; const types_1 = require("../types"); const api_1 = require("../api"); function compilePackMetadata(manifest) { @@ -20,7 +20,6 @@ function compilePackMetadata(manifest) { }; return metadata; } -exports.compilePackMetadata = compilePackMetadata; function compileFormatsMetadata(formats) { return formats.map(format => { return { diff --git a/dist/helpers/migration.js b/dist/helpers/migration.js index ac64195c18..1ddf6d88bc 100644 --- a/dist/helpers/migration.js +++ b/dist/helpers/migration.js @@ -1,12 +1,15 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.postSetupMetadataHelper = exports.setEndpointDefHelper = exports.setEndpointHelper = exports.paramDefHelper = exports.objectSchemaHelper = void 0; +exports.objectSchemaHelper = objectSchemaHelper; +exports.paramDefHelper = paramDefHelper; +exports.setEndpointHelper = setEndpointHelper; +exports.setEndpointDefHelper = setEndpointDefHelper; +exports.postSetupMetadataHelper = postSetupMetadataHelper; const ensure_1 = require("../helpers/ensure"); const ensure_2 = require("../helpers/ensure"); function objectSchemaHelper(schema) { return new ObjectSchemaHelper(schema); } -exports.objectSchemaHelper = objectSchemaHelper; class ObjectSchemaHelper { constructor(schema) { this._schema = schema; @@ -63,7 +66,6 @@ class ObjectSchemaHelper { function paramDefHelper(def) { return new ParamDefHelper(def); } -exports.paramDefHelper = paramDefHelper; class ParamDefHelper { constructor(def) { this._def = def; @@ -76,7 +78,6 @@ class ParamDefHelper { function setEndpointHelper(step) { return new SetEndpointHelper(step); } -exports.setEndpointHelper = setEndpointHelper; class SetEndpointHelper { constructor(step) { this._step = step; @@ -89,7 +90,6 @@ class SetEndpointHelper { function setEndpointDefHelper(step) { return new SetEndpointDefHelper(step); } -exports.setEndpointDefHelper = setEndpointDefHelper; class SetEndpointDefHelper { constructor(step) { this._step = step; @@ -102,7 +102,6 @@ class SetEndpointDefHelper { function postSetupMetadataHelper(metadata) { return new PostSetupMetadataHelper(metadata); } -exports.postSetupMetadataHelper = postSetupMetadataHelper; class PostSetupMetadataHelper { constructor(metadata) { this._metadata = metadata; diff --git a/dist/helpers/object_utils.js b/dist/helpers/object_utils.js index e135e0622d..1c9902c08e 100644 --- a/dist/helpers/object_utils.js +++ b/dist/helpers/object_utils.js @@ -1,6 +1,10 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.isPromise = exports.deepCopy = exports.isNil = exports.isDefined = exports.deepFreeze = void 0; +exports.deepFreeze = deepFreeze; +exports.isDefined = isDefined; +exports.isNil = isNil; +exports.deepCopy = deepCopy; +exports.isPromise = isPromise; function deepFreeze(obj) { Object.freeze(obj); for (const k of Object.keys(obj)) { @@ -12,29 +16,24 @@ function deepFreeze(obj) { } return obj; } -exports.deepFreeze = deepFreeze; /** * Returns whether the value is actually defined, i.e. is anything other than null or undefined. */ function isDefined(obj) { return !isNil(obj); } -exports.isDefined = isDefined; /** * Returns whether the value has not been defined, i.e. is null or undefined. */ function isNil(obj) { return typeof obj === 'undefined' || obj === null; } -exports.isNil = isNil; function deepCopy(obj) { return JSON.parse(JSON.stringify(obj)); } -exports.deepCopy = deepCopy; /** * Returns whether the value is a Promise. */ function isPromise(obj) { return obj && typeof obj === 'object' && 'then' in obj; } -exports.isPromise = isPromise; diff --git a/dist/helpers/sample_utils.js b/dist/helpers/sample_utils.js index ac01f0a75e..f217bab83c 100644 --- a/dist/helpers/sample_utils.js +++ b/dist/helpers/sample_utils.js @@ -1,10 +1,10 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.fakeDefinitionToMetadata = exports.fakeDefinitionToDefinition = void 0; +exports.fakeDefinitionToDefinition = fakeDefinitionToDefinition; +exports.fakeDefinitionToMetadata = fakeDefinitionToMetadata; function fakeDefinitionToDefinition(def) { return def; } -exports.fakeDefinitionToDefinition = fakeDefinitionToDefinition; function fakeDefinitionToMetadata(def) { const { formulas: originalFormulas, defaultAuthentication: originalDefaultAuthentication, formats: originalFormats, syncTables: originalSyncTables, ...packMetadata } = def; const formulas = originalFormulas.map(formula => { @@ -38,4 +38,3 @@ function fakeDefinitionToMetadata(def) { ...packMetadata, }; } -exports.fakeDefinitionToMetadata = fakeDefinitionToMetadata; diff --git a/dist/helpers/schema.js b/dist/helpers/schema.js index 7383c7b4f2..dc680051d0 100644 --- a/dist/helpers/schema.js +++ b/dist/helpers/schema.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getEffectivePropertyKeysFromSchema = void 0; +exports.getEffectivePropertyKeysFromSchema = getEffectivePropertyKeysFromSchema; const schema_1 = require("../schema"); /** * A helper to extract properties fromKeys from a schema object. This is mostly useful @@ -17,4 +17,3 @@ function getEffectivePropertyKeysFromSchema(schema) { } return [...new Set(Object.entries(schema.properties).map(([key, property]) => property.fromKey || key))]; } -exports.getEffectivePropertyKeysFromSchema = getEffectivePropertyKeysFromSchema; diff --git a/dist/helpers/string.js b/dist/helpers/string.js index a2529034ee..6e1f66dcbd 100644 --- a/dist/helpers/string.js +++ b/dist/helpers/string.js @@ -1,8 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.isEmail = void 0; +exports.isEmail = isEmail; const EMAIL_REGEX = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; function isEmail(text) { return EMAIL_REGEX.test(text); } -exports.isEmail = isEmail; diff --git a/dist/helpers/url.js b/dist/helpers/url.js index a166973e9f..8ed20ce023 100644 --- a/dist/helpers/url.js +++ b/dist/helpers/url.js @@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.join = exports.getQueryParams = exports.withQueryParams = void 0; +exports.withQueryParams = withQueryParams; +exports.getQueryParams = getQueryParams; +exports.join = join; const ensure_1 = require("./ensure"); const qs_1 = __importDefault(require("qs")); const url_parse_1 = __importDefault(require("url-parse")); @@ -28,7 +30,6 @@ function withQueryParams(url, params) { parsedUrl.set('query', qs_1.default.stringify(JSON.parse(JSON.stringify(updatedParams)), { addQueryPrefix: true })); return parsedUrl.toString(); } -exports.withQueryParams = withQueryParams; /** * Helper to take a URL string and return the parameters (if any) as a JavaScript object. * @@ -43,7 +44,6 @@ function getQueryParams(url) { // Merge the params together return qs_1.default.parse(parsedUrl.query, { ignoreQueryPrefix: true }); } -exports.getQueryParams = getQueryParams; /** * Joins all the tokens into a single URL string separated by '/'. Zero length tokens cause errors. * @param tokens Zero or more tokens to be combined. If token doesn't end with '/', one will be added as the separator @@ -73,4 +73,3 @@ function join(...tokens) { } return combined; } -exports.join = join; diff --git a/dist/runtime/bootstrap/index.js b/dist/runtime/bootstrap/index.js index 05d4ec0164..f02877faf9 100644 --- a/dist/runtime/bootstrap/index.js +++ b/dist/runtime/bootstrap/index.js @@ -3,7 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getThunkPath = exports.registerBundles = exports.registerBundle = exports.injectExecutionContext = exports.injectSerializer = exports.executeThunk = exports.injectFetcherFunction = exports.injectLogFunction = exports.injectAsyncFunction = exports.createIsolateContext = exports.createIsolate = void 0; +exports.createIsolate = createIsolate; +exports.createIsolateContext = createIsolateContext; +exports.injectAsyncFunction = injectAsyncFunction; +exports.injectLogFunction = injectLogFunction; +exports.injectFetcherFunction = injectFetcherFunction; +exports.executeThunk = executeThunk; +exports.injectSerializer = injectSerializer; +exports.injectExecutionContext = injectExecutionContext; +exports.registerBundle = registerBundle; +exports.registerBundles = registerBundles; +exports.getThunkPath = getThunkPath; const fs_1 = __importDefault(require("fs")); const ivm_wrapper_1 = require("../../testing/ivm_wrapper"); const marshaling_1 = require("../common/marshaling"); @@ -18,7 +28,6 @@ function createIsolate(options) { const ivm = (0, ivm_wrapper_1.getIvm)(); return new ivm.Isolate(options); } -exports.createIsolate = createIsolate; /** * Setup an isolate context with sufficient globals needed to execute a pack. * @@ -43,7 +52,6 @@ async function createIsolateContext(isolate) { await jail.set('pack', {}, { copy: true }); return context; } -exports.createIsolateContext = createIsolateContext; /** * Helper utilities which enables injection of a function stub into the isolate that will execute outside the sandbox. * Care must be taken in handling inputs in the func you pass in here. @@ -68,7 +76,6 @@ async function injectAsyncFunction(context, stubName, func) { }); };`, [stub], { arguments: { reference: true } }); } -exports.injectAsyncFunction = injectAsyncFunction; // Log functions have no return value and do a more relaxed version of marshaling that doesn't // raise an exception on unsupported types like normal marshaling would. async function injectLogFunction(context, stubName, func) { @@ -81,7 +88,6 @@ async function injectLogFunction(context, stubName, func) { }); };`, [stub], { arguments: { reference: true } }); } -exports.injectLogFunction = injectLogFunction; async function injectFetcherFunction(context, stubName, func) { const stub = async (marshaledValue) => { const result = await func((0, marshaling_2.unmarshalValue)(marshaledValue)); @@ -103,7 +109,6 @@ async function injectFetcherFunction(context, stubName, func) { }); };`, [stub], { arguments: { reference: true } }); } -exports.injectFetcherFunction = injectFetcherFunction; /** * Actually execute the pack function inside the isolate by loading and passing control to the thunk. */ @@ -131,7 +136,6 @@ async function executeThunk(context, { params, formulaSpec, updates, permissionR throw err; } } -exports.executeThunk = executeThunk; // Lambdas can't import the v8 serialize/deserialize functions which are helpful for safely // data into or out of isolated-vm embedded into an error message string, so we explicitly // make a serialization function available within the lambda. @@ -145,7 +149,6 @@ async function injectSerializer(context, stubName) { arguments: { reference: true }, }); } -exports.injectSerializer = injectSerializer; /** * Injects the ExecutionContext object, including stubs for network calls, into the isolate. */ @@ -176,7 +179,6 @@ async function injectExecutionContext({ context, fetcher, temporaryBlobStorage, await injectAsyncFunction(context, 'executionContext.temporaryBlobStorage.storeBlob', temporaryBlobStorage.storeBlob.bind(temporaryBlobStorage)); await injectAsyncFunction(context, 'executionContext.temporaryBlobStorage.storeUrl', temporaryBlobStorage.storeUrl.bind(temporaryBlobStorage)); } -exports.injectExecutionContext = injectExecutionContext; async function registerBundle(isolate, context, path, stubName, requiresManualClosure = true) { // reset global.exports and module.exports to be used by this bundle. // see buildWithES for why we need both global.exports and module.exports. @@ -200,13 +202,10 @@ async function registerBundle(isolate, context, path, stubName, requiresManualCl await context.eval(`global.${stubName} = {...global.exports, ...module.exports};`); } } -exports.registerBundle = registerBundle; async function registerBundles(isolate, context, packBundlePath, thunkBundlePath, requiresManualClosure = true) { await registerBundle(isolate, context, thunkBundlePath, 'coda', requiresManualClosure); await registerBundle(isolate, context, packBundlePath, 'pack', requiresManualClosure); } -exports.registerBundles = registerBundles; function getThunkPath() { return path_1.default.join(__dirname, '../../bundles/thunk_bundle.js'); } -exports.getThunkPath = getThunkPath; diff --git a/dist/runtime/common/helpers.js b/dist/runtime/common/helpers.js index e8be5f3609..cf88f7266c 100644 --- a/dist/runtime/common/helpers.js +++ b/dist/runtime/common/helpers.js @@ -1,6 +1,9 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.tryFindSyncFormula = exports.tryFindFormula = exports.findSyncFormula = exports.findFormula = void 0; +exports.findFormula = findFormula; +exports.findSyncFormula = findSyncFormula; +exports.tryFindFormula = tryFindFormula; +exports.tryFindSyncFormula = tryFindSyncFormula; function findFormula(packDef, formulaNameWithNamespace) { const packFormulas = packDef.formulas; if (!packFormulas) { @@ -24,7 +27,6 @@ function findFormula(packDef, formulaNameWithNamespace) { } throw new Error(`Pack definition has no formula "${name}"${namespace !== null && namespace !== void 0 ? namespace : ` in namespace "${namespace}"`}.`); } -exports.findFormula = findFormula; function findSyncFormula(packDef, syncFormulaName) { if (!packDef.syncTables) { throw new Error(`Pack definition has no sync tables.`); @@ -37,18 +39,15 @@ function findSyncFormula(packDef, syncFormulaName) { } throw new Error(`Pack definition has no sync formula "${syncFormulaName}" in its sync tables.`); } -exports.findSyncFormula = findSyncFormula; function tryFindFormula(packDef, formulaNameWithNamespace) { try { return findFormula(packDef, formulaNameWithNamespace); } catch (_err) { } } -exports.tryFindFormula = tryFindFormula; function tryFindSyncFormula(packDef, syncFormulaName) { try { return findSyncFormula(packDef, syncFormulaName); } catch (_err) { } } -exports.tryFindSyncFormula = tryFindSyncFormula; diff --git a/dist/runtime/common/marshaling/index.js b/dist/runtime/common/marshaling/index.js index 3e2db627f9..dcba484196 100644 --- a/dist/runtime/common/marshaling/index.js +++ b/dist/runtime/common/marshaling/index.js @@ -1,6 +1,16 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.unmarshalError = exports.marshalError = exports.unwrapError = exports.wrapErrorForSameOrHigherNodeVersion = exports.unmarshalValue = exports.unmarshalValueFromString = exports.marshalValueToStringForSameOrHigherNodeVersion = exports.marshalValue = exports.marshalValuesForLogging = exports.isMarshaledValue = exports.TransformType = void 0; +exports.TransformType = void 0; +exports.isMarshaledValue = isMarshaledValue; +exports.marshalValuesForLogging = marshalValuesForLogging; +exports.marshalValue = marshalValue; +exports.marshalValueToStringForSameOrHigherNodeVersion = marshalValueToStringForSameOrHigherNodeVersion; +exports.unmarshalValueFromString = unmarshalValueFromString; +exports.unmarshalValue = unmarshalValue; +exports.wrapErrorForSameOrHigherNodeVersion = wrapErrorForSameOrHigherNodeVersion; +exports.unwrapError = unwrapError; +exports.marshalError = marshalError; +exports.unmarshalError = unmarshalError; const constants_1 = require("./constants"); const constants_2 = require("./constants"); const api_1 = require("../../../api"); @@ -144,11 +154,9 @@ function fixUncopyableTypes(val, pathPrefix, postTransforms, depth = 0) { function isMarshaledValue(val) { return typeof val === 'object' && constants_2.MarshalingInjectedKeys.CodaMarshaler in val; } -exports.isMarshaledValue = isMarshaledValue; function marshalValuesForLogging(val) { return [marshalValue((0, util_1.format)(...val))]; } -exports.marshalValuesForLogging = marshalValuesForLogging; function marshalValue(val) { const postTransforms = []; const { val: encodedVal } = fixUncopyableTypes(val, [], postTransforms, 0); @@ -158,12 +166,10 @@ function marshalValue(val) { [constants_2.MarshalingInjectedKeys.CodaMarshaler]: constants_1.CodaMarshalerType.Object, }; } -exports.marshalValue = marshalValue; function marshalValueToStringForSameOrHigherNodeVersion(val) { const serialized = (0, serializer_2.serialize)(marshalValue(val)); return serialized; } -exports.marshalValueToStringForSameOrHigherNodeVersion = marshalValueToStringForSameOrHigherNodeVersion; function unmarshalValueFromString(marshaledValue) { if (marshaledValue === undefined) { // Historically marshalValueForAnyNodeVersion could sometimes return "undefined" even @@ -178,7 +184,6 @@ function unmarshalValueFromString(marshaledValue) { // Probably a legacy JSON value return (0, legacy_marshal_1.internalUnmarshalValueForAnyNodeVersion)(marshaledValue); } -exports.unmarshalValueFromString = unmarshalValueFromString; function applyTransform(input, path, fn) { if (path.length === 0) { return fn(input); @@ -206,7 +211,6 @@ function unmarshalValue(marshaledValue) { } return result; } -exports.unmarshalValue = unmarshalValue; // The only way to pass information out of isolated-vm through an uncaught exception is // in the "message" field, which must be a string. Because of that, we use marshalValueToString() // instead of just putting a structuredClone()-compatible object into a custom field on a custom @@ -214,7 +218,6 @@ exports.unmarshalValue = unmarshalValue; function wrapErrorForSameOrHigherNodeVersion(err) { return new Error(marshalValueToStringForSameOrHigherNodeVersion(err)); } -exports.wrapErrorForSameOrHigherNodeVersion = wrapErrorForSameOrHigherNodeVersion; function unwrapError(err) { try { const unmarshaledValue = unmarshalValueFromString(err.message); @@ -227,7 +230,6 @@ function unwrapError(err) { return err; } } -exports.unwrapError = unwrapError; function getErrorClassType(err) { if (recognizableSystemErrorClasses.some(cls => cls === err.constructor)) { return ErrorClassType.System; @@ -263,7 +265,6 @@ function marshalError(err) { }; return result; } -exports.marshalError = marshalError; function getErrorClass(errorClassType, name) { let errorClasses; switch (errorClassType) { @@ -295,4 +296,3 @@ function unmarshalError(val) { } return error; } -exports.unmarshalError = unmarshalError; diff --git a/dist/runtime/common/source_map.js b/dist/runtime/common/source_map.js index 40489af46a..686412b1e5 100644 --- a/dist/runtime/common/source_map.js +++ b/dist/runtime/common/source_map.js @@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.translateErrorStackFromVM = void 0; +exports.translateErrorStackFromVM = translateErrorStackFromVM; const source_map_1 = require("source-map"); const fs_1 = __importDefault(require("fs")); const stackTraceParser = __importStar(require("stacktrace-parser")); @@ -63,4 +63,3 @@ async function translateErrorStackFromVM({ stacktrace, bundleSourceMapPath, vmFi return stacktrace; } } -exports.translateErrorStackFromVM = translateErrorStackFromVM; diff --git a/dist/runtime/thunk/thunk.js b/dist/runtime/thunk/thunk.js index b16bd351c8..4e17af78f7 100644 --- a/dist/runtime/thunk/thunk.js +++ b/dist/runtime/thunk/thunk.js @@ -1,6 +1,12 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.setUpBufferForTest = exports.handleFetcherStatusError = exports.handleError = exports.handleErrorAsync = exports.ensureSwitchUnreachable = exports.findAndExecutePackFunction = exports.marshalValuesForLogging = exports.unmarshalValueFromString = exports.marshalValueToStringForSameOrHigherNodeVersion = exports.unmarshalValue = exports.marshalValue = void 0; +exports.marshalValuesForLogging = exports.unmarshalValueFromString = exports.marshalValueToStringForSameOrHigherNodeVersion = exports.unmarshalValue = exports.marshalValue = void 0; +exports.findAndExecutePackFunction = findAndExecutePackFunction; +exports.ensureSwitchUnreachable = ensureSwitchUnreachable; +exports.handleErrorAsync = handleErrorAsync; +exports.handleError = handleError; +exports.handleFetcherStatusError = handleFetcherStatusError; +exports.setUpBufferForTest = setUpBufferForTest; const types_1 = require("../../types"); const buffer_1 = require("buffer"); const types_2 = require("../types"); @@ -39,7 +45,6 @@ async function findAndExecutePackFunction({ shouldWrapError = true, ...args }) { throw shouldWrapError ? (0, marshaling_2.wrapErrorForSameOrHigherNodeVersion)(err) : err; } } -exports.findAndExecutePackFunction = findAndExecutePackFunction; async function doFindAndExecutePackFunction({ params, formulaSpec, manifest, executionContext, updates, getPermissionsRequest, }) { var _a, _b; const { syncTables, defaultAuthentication } = manifest; @@ -245,7 +250,6 @@ function findParentFormula(manifest, formulaSpec) { function ensureSwitchUnreachable(value) { throw new Error(`Unreachable code hit with value ${String(value)}`); } -exports.ensureSwitchUnreachable = ensureSwitchUnreachable; async function handleErrorAsync(func) { try { return await func(); @@ -254,7 +258,6 @@ async function handleErrorAsync(func) { throw (0, marshaling_1.unwrapError)(err); } } -exports.handleErrorAsync = handleErrorAsync; function handleError(func) { try { return func(); @@ -263,7 +266,6 @@ function handleError(func) { throw (0, marshaling_1.unwrapError)(err); } } -exports.handleError = handleError; function handleFetcherStatusError(fetchResult, fetchRequest) { // using constant here to avoid another dependency. if (fetchResult.status >= 400) { @@ -277,13 +279,11 @@ function handleFetcherStatusError(fetchResult, fetchRequest) { }); } } -exports.handleFetcherStatusError = handleFetcherStatusError; function setUpBufferForTest() { if (!global.Buffer) { global.Buffer = buffer_1.Buffer; } } -exports.setUpBufferForTest = setUpBufferForTest; function parseSyncUpdateResult(response) { return { result: response.result.map(r => { diff --git a/dist/schema.js b/dist/schema.js index 0e9f2596ac..4cfc8181ae 100644 --- a/dist/schema.js +++ b/dist/schema.js @@ -3,7 +3,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.throwOnDynamicSchemaWithJsOptionsFunction = exports.withIdentity = exports.makeReferenceSchemaFromObjectSchema = exports.normalizeObjectSchema = exports.normalizeSchema = exports.normalizePropertyValuePathIntoSchemaPath = exports.normalizeSchemaKeyPath = exports.normalizeSchemaKey = exports.makeObjectSchema = exports.makeSchema = exports.generateSchema = exports.maybeUnwrapArraySchema = exports.maybeSchemaOptionsValue = exports.unwrappedSchemaSupportsOptions = exports.isArray = exports.isObject = exports.makeAttributionNode = exports.AttributionNodeType = exports.PermissionType = exports.PrincipalType = exports.IndexingStrategy = exports.PropertyLabelValueTemplate = exports.SimpleStringHintValueTypes = exports.DurationUnit = exports.ImageShapeStyle = exports.ImageCornerStyle = exports.ImageOutline = exports.LinkDisplayType = exports.EmailDisplayType = exports.ScaleIconSet = exports.CurrencyFormat = exports.AutocompleteHintValueTypes = exports.ObjectHintValueTypes = exports.BooleanHintValueTypes = exports.NumberHintValueTypes = exports.StringHintValueTypes = exports.ValueHintType = exports.ValueType = void 0; +exports.AttributionNodeType = exports.PermissionType = exports.PrincipalType = exports.IndexingStrategy = exports.PropertyLabelValueTemplate = exports.SimpleStringHintValueTypes = exports.DurationUnit = exports.ImageShapeStyle = exports.ImageCornerStyle = exports.ImageOutline = exports.LinkDisplayType = exports.EmailDisplayType = exports.ScaleIconSet = exports.CurrencyFormat = exports.AutocompleteHintValueTypes = exports.ObjectHintValueTypes = exports.BooleanHintValueTypes = exports.NumberHintValueTypes = exports.StringHintValueTypes = exports.ValueHintType = exports.ValueType = void 0; +exports.makeAttributionNode = makeAttributionNode; +exports.isObject = isObject; +exports.isArray = isArray; +exports.unwrappedSchemaSupportsOptions = unwrappedSchemaSupportsOptions; +exports.maybeSchemaOptionsValue = maybeSchemaOptionsValue; +exports.maybeUnwrapArraySchema = maybeUnwrapArraySchema; +exports.generateSchema = generateSchema; +exports.makeSchema = makeSchema; +exports.makeObjectSchema = makeObjectSchema; +exports.normalizeSchemaKey = normalizeSchemaKey; +exports.normalizeSchemaKeyPath = normalizeSchemaKeyPath; +exports.normalizePropertyValuePathIntoSchemaPath = normalizePropertyValuePathIntoSchemaPath; +exports.normalizeSchema = normalizeSchema; +exports.normalizeObjectSchema = normalizeObjectSchema; +exports.makeReferenceSchemaFromObjectSchema = makeReferenceSchemaFromObjectSchema; +exports.withIdentity = withIdentity; +exports.throwOnDynamicSchemaWithJsOptionsFunction = throwOnDynamicSchemaWithJsOptionsFunction; const ensure_1 = require("./helpers/ensure"); const object_utils_1 = require("./helpers/object_utils"); const ensure_2 = require("./helpers/ensure"); @@ -447,26 +464,21 @@ var AttributionNodeType; function makeAttributionNode(node) { return node; } -exports.makeAttributionNode = makeAttributionNode; function isObject(val) { return Boolean(val && val.type === ValueType.Object); } -exports.isObject = isObject; function isArray(val) { return Boolean(val && val.type === ValueType.Array); } -exports.isArray = isArray; function unwrappedSchemaSupportsOptions(schema) { return Boolean(schema === null || schema === void 0 ? void 0 : schema.codaType) && [ValueHintType.SelectList, ValueHintType.Reference].includes(schema.codaType); } -exports.unwrappedSchemaSupportsOptions = unwrappedSchemaSupportsOptions; function maybeSchemaOptionsValue(schema) { const unwrappedSchema = maybeUnwrapArraySchema(schema); if (unwrappedSchemaSupportsOptions(unwrappedSchema)) { return unwrappedSchema.options; } } -exports.maybeSchemaOptionsValue = maybeSchemaOptionsValue; /** * Pulls out the item type of an Array schema, returning undefined if the Array contains another Array. */ @@ -478,7 +490,6 @@ function maybeUnwrapArraySchema(val) { return val.items; } } -exports.maybeUnwrapArraySchema = maybeUnwrapArraySchema; /** * Utility that examines a JavaScript value and attempts to infer a schema definition * that describes it. @@ -524,7 +535,6 @@ function generateSchema(obj) { } return (0, ensure_5.ensureUnreachable)(obj); } -exports.generateSchema = generateSchema; /** * A wrapper for creating any schema definition. * @@ -550,7 +560,6 @@ exports.generateSchema = generateSchema; function makeSchema(schema) { return schema; } -exports.makeSchema = makeSchema; /** * A wrapper for creating a schema definition for an object value. * @@ -595,7 +604,6 @@ function makeObjectSchema(schemaDef) { validateObjectSchema(schema); return schema; } -exports.makeObjectSchema = makeObjectSchema; function validateObjectSchema(schema) { // TODO(jonathan): These should all move to upload_validation checks, since these aren't getting // enforced on upload and a hacked CLI could just bypass these. @@ -635,7 +643,6 @@ function normalizeSchemaKey(key) { // Colons cause problems in our formula handling. return (0, pascalcase_1.default)(key).replace(/:/g, '_'); } -exports.normalizeSchemaKey = normalizeSchemaKey; /** * Normalizes a schema property key path. This interprets "."s as accessing object properties * and "[]" as accessing array items. Uses normalizeSchemaKey to normalize each part in-between. @@ -662,7 +669,6 @@ function normalizeSchemaKeyPath(key, normalizedProperties) { }) .join('.'); } -exports.normalizeSchemaKeyPath = normalizeSchemaKeyPath; /** * Normalizes a schema PropertyIdentifier by converting it to PascalCase. */ @@ -717,7 +723,6 @@ function normalizePropertyValuePathIntoSchemaPath(propertyValue) { .join('.properties.'); return normalizedValue; } -exports.normalizePropertyValuePathIntoSchemaPath = normalizePropertyValuePathIntoSchemaPath; function normalizeSchema(schema) { if (isArray(schema)) { return { @@ -734,7 +739,6 @@ function normalizeSchema(schema) { // We always make a copy of the input schema so we never accidentally mutate it. return { ...schema }; } -exports.normalizeSchema = normalizeSchema; function normalizeObjectSchema(schema) { const normalizedProperties = {}; const { attribution, options, requireForUpdates, codaType, description, displayProperty, featured, featuredProperties, id, identity, idProperty, parentIdProperty, imageProperty, includeUnknownProperties, linkProperty, primary, properties, snippetProperty, subtitleProperties, titleProperty, type, @@ -815,7 +819,6 @@ function normalizeObjectSchema(schema) { type: ValueType.Object, }; } -exports.normalizeObjectSchema = normalizeObjectSchema; /** * Convenience for creating a reference object schema from an existing schema for the * object. Copies over the identity, idProperty, and displayProperty from the schema, @@ -846,7 +849,6 @@ function makeReferenceSchemaFromObjectSchema(schema, identityName) { }; return makeObjectSchema(referenceSchema); } -exports.makeReferenceSchemaFromObjectSchema = makeReferenceSchemaFromObjectSchema; /** * Convenience for defining the result schema for an action. The identity enables Coda to * update the corresponding sync table row, if it exists. @@ -858,7 +860,6 @@ function withIdentity(schema, identityName) { identity: { name: (0, ensure_4.ensureNonEmptyString)(identityName) }, }); } -exports.withIdentity = withIdentity; /** * If someone tries to put a js function into a getSchema result in a dynamic schema, it's not going to work. * This method is to detect this proactively and give a clear, user-visible error message. Otherwise the error @@ -882,4 +883,3 @@ function throwOnDynamicSchemaWithJsOptionsFunction(dynamicSchema, parentKey) { throw new Error('Sync tables with dynamic schemas must use "options: OptionsType.Dynamic" instead of "options: () => {...}'); } } -exports.throwOnDynamicSchemaWithJsOptionsFunction = throwOnDynamicSchemaWithJsOptionsFunction; diff --git a/dist/testing/auth.js b/dist/testing/auth.js index 5c2d0752e9..65d07db0d1 100644 --- a/dist/testing/auth.js +++ b/dist/testing/auth.js @@ -23,7 +23,11 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.readCredentialsFile = exports.storeCredential = exports.setupAuth = exports.setupAuthFromModule = exports.DEFAULT_OAUTH_SERVER_PORT = void 0; +exports.DEFAULT_OAUTH_SERVER_PORT = void 0; +exports.setupAuthFromModule = setupAuthFromModule; +exports.setupAuth = setupAuth; +exports.storeCredential = storeCredential; +exports.readCredentialsFile = readCredentialsFile; const types_1 = require("../types"); const types_2 = require("../types"); const ensure_1 = require("../helpers/ensure"); @@ -46,7 +50,6 @@ async function setupAuthFromModule(manifestPath, manifest, opts = {}) { const manifestDir = path.dirname(manifestPath); return setupAuth(manifestDir, manifest, opts); } -exports.setupAuthFromModule = setupAuthFromModule; async function setupAuth(manifestDir, packDef, opts = {}) { const auth = (0, helpers_1.getPackAuth)(packDef); if (!auth) { @@ -90,7 +93,6 @@ async function setupAuth(manifestDir, packDef, opts = {}) { return (0, ensure_4.ensureUnreachable)(auth); } } -exports.setupAuth = setupAuth; class CredentialHandler { constructor(manifestDir, authDef, { oauthServerPort, extraOAuthScopes } = {}) { this._authDef = authDef; @@ -322,13 +324,11 @@ function storeCredential(manifestDir, credentials) { const filename = path.join(manifestDir, CREDENTIALS_FILE_NAME); writeCredentialsFile(filename, credentials); } -exports.storeCredential = storeCredential; function readCredentialsFile(manifestDir) { const filename = path.join(manifestDir, CREDENTIALS_FILE_NAME); const fileContents = (0, helpers_5.readJSONFile)(filename); return fileContents === null || fileContents === void 0 ? void 0 : fileContents.credentials; } -exports.readCredentialsFile = readCredentialsFile; function writeCredentialsFile(credentialsFile, credentials) { const fileContents = { credentials }; (0, helpers_6.writeJSONFile)(credentialsFile, fileContents, 0o600); diff --git a/dist/testing/coercion.js b/dist/testing/coercion.js index 150e24f312..c9b3a240ef 100644 --- a/dist/testing/coercion.js +++ b/dist/testing/coercion.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.coerceParams = void 0; +exports.coerceParams = coerceParams; const api_types_1 = require("../api_types"); const ensure_1 = require("../helpers/ensure"); const api_types_2 = require("../api_types"); @@ -28,7 +28,6 @@ function coerceParams(formula, args) { } return coerced; } -exports.coerceParams = coerceParams; function coerceParamValue(paramDef, paramValue) { if (!(0, object_utils_1.isDefined)(paramValue)) { return paramValue; diff --git a/dist/testing/compile.js b/dist/testing/compile.js index 453fff86d8..62589646d7 100644 --- a/dist/testing/compile.js +++ b/dist/testing/compile.js @@ -26,7 +26,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.compilePackBundle = exports.TimerShimStrategy = void 0; +exports.TimerShimStrategy = void 0; +exports.compilePackBundle = compilePackBundle; const browserify_1 = __importDefault(require("browserify")); const metadata_1 = require("../helpers/metadata"); const ensure_1 = require("../helpers/ensure"); @@ -136,9 +137,9 @@ async function buildWithES({ lastBundleFilename, outputBundleFilename, options: // logical assignment target: 'ES2020', inject: getInjections(buildOptions), - minify: false, + minify: false, // don't minify here since browserify doesn't minify anyway. sourcemap: 'both', - keepNames: true, + keepNames: true, // this is required to interpret code like `StatusCodeError.name`. // The pack bundle is always targeting the isolated-vm environment. define: { 'process.env.IN_ISOLATED_VM_OR_BROWSER': 'true' }, external: ['codaInternal'], // for serializer @@ -245,4 +246,3 @@ outputDirectory, manifestPath, minify = true, intermediateOutputDirectory, timer bundleSourceMapPath, }; } -exports.compilePackBundle = compilePackBundle; diff --git a/dist/testing/execution.d.ts b/dist/testing/execution.d.ts index 86e6e5b8ad..accf7b558a 100644 --- a/dist/testing/execution.d.ts +++ b/dist/testing/execution.d.ts @@ -1,4 +1,3 @@ -/// import type { BasicPackDefinition } from '../types'; import type { ExecutionContext } from '../api_types'; import type { FormulaSpecification } from '../runtime/types'; diff --git a/dist/testing/execution.js b/dist/testing/execution.js index 258f454de8..4a2bfed5c5 100644 --- a/dist/testing/execution.js +++ b/dist/testing/execution.js @@ -26,7 +26,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.newRealFetcherSyncExecutionContext = exports.newRealFetcherExecutionContext = exports.executeMetadataFormula = exports.executeSyncFormulaFromPackDefSingleIteration = exports.executeSyncFormulaFromPackDef = exports.executeFormulaOrSyncWithRawParams = exports.VMError = exports.executeFormulaOrSyncWithVM = exports.makeFormulaSpec = exports.executeFormulaOrSyncFromCLI = exports.executeFormulaFromPackDef = exports.DEFAULT_MAX_ROWS = void 0; +exports.VMError = exports.DEFAULT_MAX_ROWS = void 0; +exports.executeFormulaFromPackDef = executeFormulaFromPackDef; +exports.executeFormulaOrSyncFromCLI = executeFormulaOrSyncFromCLI; +exports.makeFormulaSpec = makeFormulaSpec; +exports.executeFormulaOrSyncWithVM = executeFormulaOrSyncWithVM; +exports.executeFormulaOrSyncWithRawParams = executeFormulaOrSyncWithRawParams; +exports.executeSyncFormulaFromPackDef = executeSyncFormulaFromPackDef; +exports.executeSyncFormulaFromPackDefSingleIteration = executeSyncFormulaFromPackDefSingleIteration; +exports.executeMetadataFormula = executeMetadataFormula; +exports.newRealFetcherExecutionContext = newRealFetcherExecutionContext; +exports.newRealFetcherSyncExecutionContext = newRealFetcherSyncExecutionContext; const types_1 = require("../runtime/types"); const types_2 = require("../runtime/types"); const buffer_1 = require("buffer/"); @@ -130,7 +140,6 @@ async function executeFormulaFromPackDef(packDef, formulaNameWithNamespace, para } return findAndExecutePackFunction(params, { type: types_1.FormulaType.Standard, formulaName: resolveFormulaNameWithNamespace(formulaNameWithNamespace) }, packDef, executionContext || (0, mocks_1.newMockExecutionContext)(), undefined, undefined, options); } -exports.executeFormulaFromPackDef = executeFormulaFromPackDef; async function executeFormulaOrSyncFromCLI({ formulaName, params, manifest, manifestPath, vm, dynamicUrl, maxRows = exports.DEFAULT_MAX_ROWS, bundleSourceMapPath, bundlePath, contextOptions = {}, }) { try { if (maxRows <= 0) { @@ -188,7 +197,6 @@ async function executeFormulaOrSyncFromCLI({ formulaName, params, manifest, mani process.exit(1); } } -exports.executeFormulaOrSyncFromCLI = executeFormulaOrSyncFromCLI; const SyncMetadataFormulaTokens = Object.freeze({ [types_2.MetadataFormulaType.SyncListDynamicUrls]: 'listDynamicUrls', [types_2.MetadataFormulaType.SyncSearchDynamicUrls]: 'searchDynamicUrls', @@ -307,7 +315,6 @@ function makeFormulaSpec(manifest, formulaNameInput) { } throw new Error(`Unrecognized execution command: "${formulaNameInput}".`); } -exports.makeFormulaSpec = makeFormulaSpec; // This method is used to execute a (sync) formula in testing with VM. Don't use it in lambda or calc service. async function executeFormulaOrSyncWithVM({ formulaName, params, bundlePath, executionContext = (0, mocks_2.newMockSyncExecutionContext)(), }) { const manifest = await (0, helpers_4.importManifest)(bundlePath); @@ -319,7 +326,6 @@ async function executeFormulaOrSyncWithVM({ formulaName, params, bundlePath, exe const ivmContext = await ivmHelper.setupIvmContext(bundlePath, executionContext); return (0, bootstrap_1.executeThunk)(ivmContext, { params, formulaSpec: formulaSpecification }, bundlePath, bundlePath + '.map'); } -exports.executeFormulaOrSyncWithVM = executeFormulaOrSyncWithVM; class VMError { constructor(name, message, stack) { this.name = name; @@ -413,7 +419,6 @@ async function executeFormulaOrSyncWithRawParams({ formulaSpecification, params: } return findAndExecutePackFunction(params, formulaSpecification, manifest, executionContext, syncUpdates, permissionRequest); } -exports.executeFormulaOrSyncWithRawParams = executeFormulaOrSyncWithRawParams; /** * Executes multiple iterations of a sync formula in a loop until there is no longer * a `continuation` returned, aggregating each page of results and returning an array @@ -457,7 +462,6 @@ async function executeSyncFormulaFromPackDef(packDef, syncFormulaName, params, c } return result; } -exports.executeSyncFormulaFromPackDef = executeSyncFormulaFromPackDef; /** * Executes a single sync iteration, and returns the return value from the sync formula * including the continuation, for inspection. @@ -470,12 +474,10 @@ async function executeSyncFormulaFromPackDefSingleIteration(packDef, syncFormula } return findAndExecutePackFunction(params, { formulaName: syncFormulaName, type: types_1.FormulaType.Sync }, packDef, executionContext || (0, mocks_2.newMockSyncExecutionContext)(), undefined, undefined, options); } -exports.executeSyncFormulaFromPackDefSingleIteration = executeSyncFormulaFromPackDefSingleIteration; async function executeMetadataFormula(formula, metadataParams = {}, context = (0, mocks_1.newMockExecutionContext)()) { const { search, formulaContext } = metadataParams; return formula.execute([search || '', formulaContext ? JSON.stringify(formulaContext) : ''], context); } -exports.executeMetadataFormula = executeMetadataFormula; function getCredentials(manifestPath) { if (manifestPath) { const manifestDir = path.dirname(manifestPath); @@ -492,12 +494,10 @@ function buildUpdateCredentialsCallback(manifestPath) { function newRealFetcherExecutionContext(packDef, manifestPath) { return (0, fetcher_1.newFetcherExecutionContext)(buildUpdateCredentialsCallback(manifestPath), (0, helpers_3.getPackAuth)(packDef), packDef.networkDomains, getCredentials(manifestPath)); } -exports.newRealFetcherExecutionContext = newRealFetcherExecutionContext; function newRealFetcherSyncExecutionContext(packDef, manifestPath) { const context = newRealFetcherExecutionContext(packDef, manifestPath); return { ...context, sync: {} }; } -exports.newRealFetcherSyncExecutionContext = newRealFetcherSyncExecutionContext; const SyncUpdateSchema = z.object({ previousValue: z.object({}).passthrough(), newValue: z.object({}).passthrough(), diff --git a/dist/testing/fetcher.js b/dist/testing/fetcher.js index ba4a05cd1e..2877e62dfa 100644 --- a/dist/testing/fetcher.js +++ b/dist/testing/fetcher.js @@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.newFetcherSyncExecutionContext = exports.newFetcherExecutionContext = exports.requestHelper = exports.AuthenticatingFetcher = void 0; +exports.requestHelper = exports.AuthenticatingFetcher = void 0; +exports.newFetcherExecutionContext = newFetcherExecutionContext; +exports.newFetcherSyncExecutionContext = newFetcherSyncExecutionContext; const client_sts_1 = require("@aws-sdk/client-sts"); const types_1 = require("../types"); const constants_1 = require("./constants"); @@ -522,7 +524,7 @@ exports.requestHelper = { return (0, node_fetcher_1.nodeFetcher)({ ...request, resolveWithFullResponse: true, - timeout: 60000, + timeout: 60000, // msec forever: true, // keep alive connections as long as possible. }); }, @@ -553,12 +555,10 @@ function newFetcherExecutionContext(updateCredentialsCallback, authDef, networkD temporaryBlobStorage: new AuthenticatingBlobStorage(fetcher), }; } -exports.newFetcherExecutionContext = newFetcherExecutionContext; function newFetcherSyncExecutionContext(updateCredentialsCallback, authDef, networkDomains, credentials) { const context = newFetcherExecutionContext(updateCredentialsCallback, authDef, networkDomains, credentials); return { ...context, sync: {} }; } -exports.newFetcherSyncExecutionContext = newFetcherSyncExecutionContext; function addQueryParam(url, param, value) { const parsedUrl = new url_1.URL(url); // Put the key at the beginning, as some APIs expect it at the beginning. diff --git a/dist/testing/helpers.d.ts b/dist/testing/helpers.d.ts index b1203f65e6..51baba20bd 100644 --- a/dist/testing/helpers.d.ts +++ b/dist/testing/helpers.d.ts @@ -1,5 +1,3 @@ -/// -/// import type { PackVersionDefinition } from '../types'; import fs from 'fs'; export declare function getManifestFromModule(module: any): PackVersionDefinition; diff --git a/dist/testing/helpers.js b/dist/testing/helpers.js index b6b250b4f4..2f63da3590 100644 --- a/dist/testing/helpers.js +++ b/dist/testing/helpers.js @@ -26,7 +26,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.processVmError = exports.getExpirationDate = exports.writeJSONFile = exports.readJSONFile = exports.readFile = exports.promptForInput = exports.printAndExit = exports.printFull = exports.printError = exports.printWarn = exports.print = exports.getManifestFromModule = void 0; +exports.printError = exports.printWarn = exports.print = void 0; +exports.getManifestFromModule = getManifestFromModule; +exports.printFull = printFull; +exports.printAndExit = printAndExit; +exports.promptForInput = promptForInput; +exports.readFile = readFile; +exports.readJSONFile = readJSONFile; +exports.writeJSONFile = writeJSONFile; +exports.getExpirationDate = getExpirationDate; +exports.processVmError = processVmError; const ensure_1 = require("../helpers/ensure"); const fs_1 = __importDefault(require("fs")); const util_1 = require("util"); @@ -42,7 +51,6 @@ function getManifestFromModule(module) { } return module.pack || module.manifest; } -exports.getManifestFromModule = getManifestFromModule; // eslint-disable-next-line no-console exports.print = console.log; // eslint-disable-next-line no-console @@ -65,12 +73,10 @@ function printFull(value) { console.log(value); } } -exports.printFull = printFull; function printAndExit(msg, exitCode = 1) { (0, exports.print)(msg); return process.exit(exitCode); } -exports.printAndExit = printAndExit; function promptForInput(prompt, { mask, options, yesOrNo } = {}) { while (true) { const answer = readlineSync.question(prompt, { mask: mask ? '*' : undefined, hideEchoBack: mask }); @@ -89,7 +95,6 @@ function promptForInput(prompt, { mask, options, yesOrNo } = {}) { } } } -exports.promptForInput = promptForInput; function readFile(fileName) { (0, ensure_1.ensureNonEmptyString)(fileName); let file; @@ -104,12 +109,10 @@ function readFile(fileName) { } return file; } -exports.readFile = readFile; function readJSONFile(fileName) { const file = readFile(fileName); return file ? JSON.parse(file.toString()) : undefined; } -exports.readJSONFile = readJSONFile; function writeJSONFile(fileName, payload, mode) { (0, ensure_1.ensureNonEmptyString)(fileName); const dirname = path_1.default.dirname(fileName); @@ -123,12 +126,10 @@ function writeJSONFile(fileName, payload, mode) { } fs_1.default.writeFileSync(fileName, JSON.stringify(payload, undefined, 2), { mode }); } -exports.writeJSONFile = writeJSONFile; function getExpirationDate(expiresInSeconds) { // OAuth standard says expiresIn units should be seconds. return new Date(Date.now() + expiresInSeconds * 1000); } -exports.getExpirationDate = getExpirationDate; async function processVmError(vmError, bundlePath) { // this is weird. the error thrown by ivm seems a standard error but somehow its stack can't be overwritten. // unwrapError(wrapError(err)) will recreate the same type of error in a standard way, where the stack can @@ -143,4 +144,3 @@ async function processVmError(vmError, bundlePath) { err.stack = `${err.constructor.name}${messageSuffix}\n${translatedStacktrace}`; return err; } -exports.processVmError = processVmError; diff --git a/dist/testing/ivm_helper.js b/dist/testing/ivm_helper.js index d6d179bffa..f4ba2f4f34 100644 --- a/dist/testing/ivm_helper.js +++ b/dist/testing/ivm_helper.js @@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.setupIvmContext = void 0; +exports.setupIvmContext = setupIvmContext; const build_1 = require("../cli/build"); const bootstrap_1 = require("../runtime/bootstrap"); const fs_1 = __importDefault(require("fs")); @@ -56,4 +56,3 @@ async function setupIvmContext(bundlePath, executionContext) { }); return ivmContext; } -exports.setupIvmContext = setupIvmContext; diff --git a/dist/testing/ivm_wrapper.js b/dist/testing/ivm_wrapper.js index 13755f1c3f..de96947b60 100644 --- a/dist/testing/ivm_wrapper.js +++ b/dist/testing/ivm_wrapper.js @@ -1,6 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.tryGetIvm = exports.getIvm = void 0; +exports.getIvm = getIvm; +exports.tryGetIvm = tryGetIvm; const ensure_1 = require("../helpers/ensure"); // eslint-disable-next-line @typescript-eslint/consistent-type-imports let ivm; @@ -13,8 +14,6 @@ catch (e) { function getIvm() { return (0, ensure_1.ensureExists)(ivm); } -exports.getIvm = getIvm; function tryGetIvm() { return ivm; } -exports.tryGetIvm = tryGetIvm; diff --git a/dist/testing/mocks.js b/dist/testing/mocks.js index 7cee65cf6c..e413bb571b 100644 --- a/dist/testing/mocks.js +++ b/dist/testing/mocks.js @@ -3,13 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.newJsonFetchResponse = exports.newMockExecutionContext = exports.newMockSyncExecutionContext = void 0; +exports.newMockSyncExecutionContext = newMockSyncExecutionContext; +exports.newMockExecutionContext = newMockExecutionContext; +exports.newJsonFetchResponse = newJsonFetchResponse; const sinon_1 = __importDefault(require("sinon")); const uuid_1 = require("uuid"); function newMockSyncExecutionContext(overrides) { return { ...newMockExecutionContext(), sync: {}, ...overrides }; } -exports.newMockSyncExecutionContext = newMockSyncExecutionContext; function newMockExecutionContext(overrides) { return { invocationLocation: { @@ -27,9 +28,7 @@ function newMockExecutionContext(overrides) { ...overrides, }; } -exports.newMockExecutionContext = newMockExecutionContext; function newJsonFetchResponse(body, status = 200, headers) { const allHeaders = { 'Content-Type': 'application/json', ...headers }; return { status, body, headers: allHeaders }; } -exports.newJsonFetchResponse = newJsonFetchResponse; diff --git a/dist/testing/node_fetcher.js b/dist/testing/node_fetcher.js index bb72e05680..e2f984a080 100644 --- a/dist/testing/node_fetcher.js +++ b/dist/testing/node_fetcher.js @@ -23,7 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.nodeFetcher = exports.isStatusCodeError = exports.StatusCodeError = exports.fetch = void 0; +exports.StatusCodeError = void 0; +exports.fetch = fetch; +exports.isStatusCodeError = isStatusCodeError; +exports.nodeFetcher = nodeFetcher; const nodeFetch = __importStar(require("node-fetch")); /** * A wrapper for fetch() that allows us to @@ -33,7 +36,6 @@ const nodeFetch = __importStar(require("node-fetch")); async function fetch(url, init) { return nodeFetch.default(url, init); } -exports.fetch = fetch; class StatusCodeError extends Error { constructor(statusCode, body, options, response) { super(`${statusCode} - ${JSON.stringify(body)}`); @@ -47,7 +49,6 @@ exports.StatusCodeError = StatusCodeError; function isStatusCodeError(err) { return typeof err === 'object' && err.name === StatusCodeError.name; } -exports.isStatusCodeError = isStatusCodeError; async function nodeFetcher(options) { const { method = 'GET', uri, qs, followRedirect = true, throwOnRedirect = true, gzip = true, json, headers: rawHeaders = {}, form, body, timeout, resolveWithFullResponse, resolveWithRawBody, simple = true, encoding, maxResponseSizeBytes, legacyBlankAcceptHeader, } = options; // https://github.com/node-fetch/node-fetch#options @@ -125,7 +126,6 @@ async function nodeFetcher(options) { } return resultBody; } -exports.nodeFetcher = nodeFetcher; async function getResultBody(response, { encoding, resolveWithRawBody, forceJsonResponseBody, }) { var _a; if (resolveWithRawBody) { diff --git a/dist/testing/oauth_helpers.js b/dist/testing/oauth_helpers.js index 8d641d597c..fce340bd79 100644 --- a/dist/testing/oauth_helpers.js +++ b/dist/testing/oauth_helpers.js @@ -1,6 +1,8 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getTokenExpiry = exports.performOAuthClientCredentialsServerFlow = exports.requestOAuthAccessToken = void 0; +exports.requestOAuthAccessToken = requestOAuthAccessToken; +exports.performOAuthClientCredentialsServerFlow = performOAuthClientCredentialsServerFlow; +exports.getTokenExpiry = getTokenExpiry; const constants_1 = require("./constants"); const helpers_1 = require("./helpers"); async function requestOAuthAccessToken(params, { tokenUrl, nestedResponseKey, scopeParamName }) { @@ -50,7 +52,6 @@ async function requestOAuthAccessToken(params, { tokenUrl, nestedResponseKey, sc const { access_token: accessToken, refresh_token: refreshToken, ...data } = tokenContainer; return { accessToken, refreshToken, data }; } -exports.requestOAuthAccessToken = requestOAuthAccessToken; async function performOAuthClientCredentialsServerFlow({ clientId, clientSecret, authDef, scopes, }) { const { tokenUrl, nestedResponseKey, scopeParamName, scopeDelimiter } = authDef; // Use the manifest's scopes as a default. @@ -69,8 +70,6 @@ async function performOAuthClientCredentialsServerFlow({ clientId, clientSecret, }); return { accessToken, expires: getTokenExpiry(data) }; } -exports.performOAuthClientCredentialsServerFlow = performOAuthClientCredentialsServerFlow; function getTokenExpiry(data) { return data.expires_in && (0, helpers_1.getExpirationDate)(Number(data.expires_in)).toString(); } -exports.getTokenExpiry = getTokenExpiry; diff --git a/dist/testing/oauth_server.js b/dist/testing/oauth_server.js index 53fb53a37e..c1cdd59557 100644 --- a/dist/testing/oauth_server.js +++ b/dist/testing/oauth_server.js @@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.makeRedirectUrl = exports.launchOAuthServerFlow = void 0; +exports.launchOAuthServerFlow = launchOAuthServerFlow; +exports.makeRedirectUrl = makeRedirectUrl; require("cross-fetch/polyfill"); const child_process_1 = require("child_process"); const express_1 = __importDefault(require("express")); @@ -48,11 +49,9 @@ function launchOAuthServerFlow({ clientId, clientSecret, authDef, port, afterTok }; serverContainer.start(launchCallback); } -exports.launchOAuthServerFlow = launchOAuthServerFlow; function makeRedirectUrl(port) { return `http://localhost:${port}/oauth`; } -exports.makeRedirectUrl = makeRedirectUrl; class OAuthServerContainer { constructor(tokenCallback, afterTokenExchange, port) { this._tokenCallback = tokenCallback; diff --git a/dist/testing/upload_validation.js b/dist/testing/upload_validation.js index 983f381b8c..d43ceb9615 100644 --- a/dist/testing/upload_validation.js +++ b/dist/testing/upload_validation.js @@ -26,7 +26,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.zodErrorDetailToValidationError = exports._hasCycle = exports.validateCrawlHierarchy = exports.validateSyncTableSchema = exports.validateVariousAuthenticationMetadata = exports.validatePackVersionMetadata = exports.PackMetadataValidationError = exports.Limits = exports.PACKS_VALID_COLUMN_FORMAT_MATCHER_REGEX = void 0; +exports.PackMetadataValidationError = exports.Limits = exports.PACKS_VALID_COLUMN_FORMAT_MATCHER_REGEX = void 0; +exports.validatePackVersionMetadata = validatePackVersionMetadata; +exports.validateVariousAuthenticationMetadata = validateVariousAuthenticationMetadata; +exports.validateSyncTableSchema = validateSyncTableSchema; +exports.validateCrawlHierarchy = validateCrawlHierarchy; +exports._hasCycle = _hasCycle; +exports.zodErrorDetailToValidationError = zodErrorDetailToValidationError; const schema_1 = require("../schema"); const types_1 = require("../types"); const schema_2 = require("../schema"); @@ -129,7 +135,6 @@ async function validatePackVersionMetadata(metadata, sdkVersion, { warningMode } } return validated.data; } -exports.validatePackVersionMetadata = validatePackVersionMetadata; // Note: This is called within Coda for validating user-provided authentication metadata // as part of Various connections. function validateVariousAuthenticationMetadata(auth, options) { @@ -140,7 +145,6 @@ function validateVariousAuthenticationMetadata(auth, options) { } throw new PackMetadataValidationError('Various authentication failed validation', validated.error, validated.error.errors.flatMap(zodErrorDetailToValidationError)); } -exports.validateVariousAuthenticationMetadata = validateVariousAuthenticationMetadata; // Note: This is called within Coda for validating the result of getSchema calls for dynamic sync tables. function validateSyncTableSchema(schema, options) { const { arrayPropertySchema } = buildMetadataSchema(options); @@ -159,7 +163,6 @@ function validateSyncTableSchema(schema, options) { } throw new PackMetadataValidationError('Schema failed validation', validated.error, validated.error.errors.flatMap(zodErrorDetailToValidationError)); } -exports.validateSyncTableSchema = validateSyncTableSchema; /** * Returns a map of sync table names to their child sync table names, or undefined if the hierarchy is invalid. * Example valid return: { Parent: 'Child' } @@ -237,7 +240,6 @@ function validateCrawlHierarchy(syncTables, context) { } return parentToChildrenMap; } -exports.validateCrawlHierarchy = validateCrawlHierarchy; // Exported for tests /** @hidden */ function _hasCycle(tree) { @@ -260,7 +262,6 @@ function _hasCycle(tree) { } return subtreeHasCycle('__CODA_INTERNAL_ROOT__', Object.keys(tree), new Set()); } -exports._hasCycle = _hasCycle; function getNonUniqueElements(items) { const set = new Set(); const nonUnique = []; @@ -337,7 +338,6 @@ function zodErrorDetailToValidationError(subError) { }, ]; } -exports.zodErrorDetailToValidationError = zodErrorDetailToValidationError; function zodPathToPathString(zodPath) { const parts = []; zodPath.forEach((zodPathPart, i) => { @@ -1299,7 +1299,7 @@ function buildMetadataSchema({ sdkVersion }) { }); const formatMetadataSchema = zodCompleteObject({ name: z.string().max(exports.Limits.BuildingBlockName), - formulaNamespace: z.string().optional(), + formulaNamespace: z.string().optional(), // Will be removed once we deprecate namespace objects. formulaName: z.string(), hasNoConnection: z.boolean().optional(), instructions: z.string().optional(), diff --git a/dist/testing/validation.js b/dist/testing/validation.js index 26bac0bb5e..846966bb4c 100644 --- a/dist/testing/validation.js +++ b/dist/testing/validation.js @@ -26,7 +26,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateResult = exports.validateParams = void 0; +exports.validateParams = validateParams; +exports.validateResult = validateResult; const types_1 = require("./types"); const types_2 = require("./types"); const types_3 = require("./types"); @@ -67,7 +68,6 @@ function validateParams(formula, args) { throw new types_1.ParameterException(`The following parameter errors were found:\n${errorMsgs.join('\n')}`); } } -exports.validateParams = validateParams; function validateResult(formula, result) { const maybeError = validateResultType(formula.resultType, result); if (maybeError) { @@ -78,7 +78,6 @@ function validateResult(formula, result) { validateObjectResult(formula, result); } } -exports.validateResult = validateResult; function validateResultType(resultType, result) { if (!(0, object_utils_1.isDefined)(result)) { return { message: `Expected a ${resultType} result but got ${result}.` }; diff --git a/package.json b/package.json index 59aa196766..74af25bed7 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "sinon": "18.0.0", "source-map": "0.8.0-beta.0", "stacktrace-parser": "0.1.10", - "typescript": "5.1.6", + "typescript": "5.5.4", "uglify-js": "3.19.1", "url-parse": "1.5.10", "uuid": "9.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index acd39ce006..1fc20e9824 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -96,8 +96,8 @@ importers: specifier: 0.1.10 version: 0.1.10 typescript: - specifier: 5.1.6 - version: 5.1.6 + specifier: 5.5.4 + version: 5.5.4 uglify-js: specifier: 3.19.1 version: 3.19.1 @@ -216,13 +216,13 @@ importers: version: 17.0.26 '@typescript-eslint/eslint-plugin': specifier: 6.21.0 - version: 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.57.0)(typescript@5.1.6) + version: 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/experimental-utils': specifier: 5.62.0 - version: 5.62.0(eslint@8.57.0)(typescript@5.1.6) + version: 5.62.0(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': specifier: 6.21.0 - version: 6.21.0(eslint@8.57.0)(typescript@5.1.6) + version: 6.21.0(eslint@8.57.0)(typescript@5.5.4) aws-sdk: specifier: 2.1665.0 version: 2.1665.0 @@ -282,13 +282,13 @@ importers: version: 4.1.1 ts-loader: specifier: 9.5.1 - version: 9.5.1(typescript@5.1.6)(webpack@5.81.0) + version: 9.5.1(typescript@5.5.4)(webpack@5.81.0) ts-node: specifier: 10.9.2 - version: 10.9.2(@types/node@18.19.18)(typescript@5.1.6) + version: 10.9.2(@types/node@18.19.18)(typescript@5.5.4) typedoc: specifier: 0.24.8 - version: 0.24.8(typescript@5.1.6) + version: 0.24.8(typescript@5.5.4) typedoc-plugin-markdown: specifier: 3.15.3 version: 3.15.3(typedoc@0.24.8) @@ -2412,7 +2412,7 @@ packages: '@types/yargs-parser': 21.0.0 dev: true - /@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.57.0)(typescript@5.1.6): + /@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.57.0)(typescript@5.5.4): resolution: {integrity: sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2424,10 +2424,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.6.2 - '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.1.6) + '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/type-utils': 6.21.0(eslint@8.57.0)(typescript@5.1.6) - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.1.6) + '@typescript-eslint/type-utils': 6.21.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/visitor-keys': 6.21.0 debug: 4.3.5(supports-color@8.1.1) eslint: 8.57.0 @@ -2435,26 +2435,26 @@ packages: ignore: 5.2.4 natural-compare: 1.4.0 semver: 7.6.3 - ts-api-utils: 1.0.3(typescript@5.1.6) - typescript: 5.1.6 + ts-api-utils: 1.0.3(typescript@5.5.4) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/experimental-utils@5.62.0(eslint@8.57.0)(typescript@5.1.6): + /@typescript-eslint/experimental-utils@5.62.0(eslint@8.57.0)(typescript@5.5.4): resolution: {integrity: sha512-RTXpeB3eMkpoclG3ZHft6vG/Z30azNHuqY6wKPBHlVMZFuEvrtlEDe8gMqDb+SO+9hjC/pLekeSCryf9vMZlCw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.1.6) + '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.5.4) eslint: 8.57.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.1.6): + /@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.5.4): resolution: {integrity: sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2466,11 +2466,11 @@ packages: dependencies: '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.1.6) + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.5.4) '@typescript-eslint/visitor-keys': 6.21.0 debug: 4.3.5(supports-color@8.1.1) eslint: 8.57.0 - typescript: 5.1.6 + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true @@ -2491,7 +2491,7 @@ packages: '@typescript-eslint/visitor-keys': 6.21.0 dev: true - /@typescript-eslint/type-utils@6.21.0(eslint@8.57.0)(typescript@5.1.6): + /@typescript-eslint/type-utils@6.21.0(eslint@8.57.0)(typescript@5.5.4): resolution: {integrity: sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2501,12 +2501,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.1.6) - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.1.6) + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.5.4) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.5.4) debug: 4.3.5(supports-color@8.1.1) eslint: 8.57.0 - ts-api-utils: 1.0.3(typescript@5.1.6) - typescript: 5.1.6 + ts-api-utils: 1.0.3(typescript@5.5.4) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true @@ -2521,7 +2521,7 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@5.62.0(typescript@5.1.6): + /@typescript-eslint/typescript-estree@5.62.0(typescript@5.5.4): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2536,13 +2536,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.3 - tsutils: 3.21.0(typescript@5.1.6) - typescript: 5.1.6 + tsutils: 3.21.0(typescript@5.5.4) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/typescript-estree@6.21.0(typescript@5.1.6): + /@typescript-eslint/typescript-estree@6.21.0(typescript@5.5.4): resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2558,13 +2558,13 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.3 - ts-api-utils: 1.0.3(typescript@5.1.6) - typescript: 5.1.6 + ts-api-utils: 1.0.3(typescript@5.5.4) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@5.62.0(eslint@8.57.0)(typescript@5.1.6): + /@typescript-eslint/utils@5.62.0(eslint@8.57.0)(typescript@5.5.4): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2575,7 +2575,7 @@ packages: '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.1.6) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.5.4) eslint: 8.57.0 eslint-scope: 5.1.1 semver: 7.6.3 @@ -2584,7 +2584,7 @@ packages: - typescript dev: true - /@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.1.6): + /@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.5.4): resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2595,7 +2595,7 @@ packages: '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.1.6) + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.5.4) eslint: 8.57.0 semver: 7.6.3 transitivePeerDependencies: @@ -4127,7 +4127,6 @@ packages: /diff@5.2.0: resolution: {integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==} engines: {node: '>=0.3.1'} - dev: false /diffie-hellman@5.0.3: resolution: {integrity: sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==} @@ -4175,7 +4174,7 @@ packages: engines: {node: '>=14.0.0'} hasBin: true dependencies: - typescript: 5.1.6 + typescript: 5.5.4 yargs: 17.7.2 dev: true @@ -8022,16 +8021,16 @@ packages: resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==} dev: true - /ts-api-utils@1.0.3(typescript@5.1.6): + /ts-api-utils@1.0.3(typescript@5.5.4): resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} engines: {node: '>=16.13.0'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.1.6 + typescript: 5.5.4 dev: true - /ts-loader@9.5.1(typescript@5.1.6)(webpack@5.81.0): + /ts-loader@9.5.1(typescript@5.5.4)(webpack@5.81.0): resolution: {integrity: sha512-rNH3sK9kGZcH9dYzC7CewQm4NtxJTjSEVRJ2DyBZR7f8/wcta+iV44UPCXc5+nzDzivKtlzV6c9P4e+oFhDLYg==} engines: {node: '>=12.0.0'} peerDependencies: @@ -8043,11 +8042,11 @@ packages: micromatch: 4.0.5 semver: 7.6.3 source-map: 0.7.4 - typescript: 5.1.6 + typescript: 5.5.4 webpack: 5.81.0(esbuild@0.20.1)(uglify-js@3.19.1) dev: true - /ts-node@10.9.2(@types/node@18.19.18)(typescript@5.1.6): + /ts-node@10.9.2(@types/node@18.19.18)(typescript@5.5.4): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true peerDependencies: @@ -8073,7 +8072,7 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.1.6 + typescript: 5.5.4 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true @@ -8087,14 +8086,14 @@ packages: /tslib@2.6.3: resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - /tsutils@3.21.0(typescript@5.1.6): + /tsutils@3.21.0(typescript@5.5.4): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 5.1.6 + typescript: 5.5.4 dev: true /tty-browserify@0.0.1: @@ -8172,10 +8171,10 @@ packages: typedoc: '>=0.24.0' dependencies: handlebars: 4.7.8 - typedoc: 0.24.8(typescript@5.1.6) + typedoc: 0.24.8(typescript@5.5.4) dev: true - /typedoc@0.24.8(typescript@5.1.6): + /typedoc@0.24.8(typescript@5.5.4): resolution: {integrity: sha512-ahJ6Cpcvxwaxfu4KtjA8qZNqS43wYt6JL27wYiIgl1vd38WW/KWX11YuAeZhuz9v+ttrutSsgK+XO1CjL1kA3w==} engines: {node: '>= 14.14'} hasBin: true @@ -8186,11 +8185,11 @@ packages: marked: 4.3.0 minimatch: 9.0.3 shiki: 0.14.2 - typescript: 5.1.6 + typescript: 5.5.4 dev: true - /typescript@5.1.6: - resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} + /typescript@5.5.4: + resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} engines: {node: '>=14.17'} hasBin: true