@taqueria/plugin-octez-client 0.56.8 → 0.56.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/common.ts CHANGED
@@ -31,7 +31,9 @@ export type IntersectionOpts = ClientOpts & TypeCheckOpts & TypeCheckAllOpts & S
31
31
 
32
32
  type UnionOpts = ClientOpts | TypeCheckOpts | TypeCheckAllOpts | SimulateOpts;
33
33
 
34
- const ENDPOINT = process.env['TAQ_TEZOS_CLIENT_RPC'] ?? 'https://ghostnet.ecadinfra.com';
34
+ // Temporary change till a discussion is had with ECAD Labs
35
+ // about https://github.com/TezosTaqueria/taqueria/actions/runs/10102868947/job/27961869044
36
+ const ENDPOINT = process.env['TAQ_TEZOS_CLIENT_RPC'] ?? 'https://ghostnet.smartpy.io';
35
37
  export const GLOBAL_OPTIONS = `--endpoint ${ENDPOINT}`;
36
38
 
37
39
  export const trimTezosClientMenuIfPresent = (msg: string): string => {
package/index.js CHANGED
@@ -37,7 +37,7 @@ var import_path = require("path");
37
37
  var getFlextesaImage = (_arch) => "tezos/tezos:octez-v20.2";
38
38
  var OCTEZ_CLIENT_IMAGE_ENV_VAR = "TAQ_OCTEZ_CLIENT_IMAGE";
39
39
  var getClientDockerImage = () => (0, import_node_sdk.getDockerImage)(getFlextesaImage((0, import_node_sdk.getArchSync)()), OCTEZ_CLIENT_IMAGE_ENV_VAR);
40
- var ENDPOINT = process.env["TAQ_TEZOS_CLIENT_RPC"] ?? "https://ghostnet.ecadinfra.com";
40
+ var ENDPOINT = process.env["TAQ_TEZOS_CLIENT_RPC"] ?? "https://ghostnet.smartpy.io";
41
41
  var GLOBAL_OPTIONS = `--endpoint ${ENDPOINT}`;
42
42
  var trimTezosClientMenuIfPresent = (msg) => {
43
43
  return msg.replace(/Usage:(.|\n)+/, "");
@@ -188,7 +188,6 @@ var getTypecheckCmd = async (parsedArgs, sourceFile) => {
188
188
  const baseCmd = `docker run --rm -v "${projectDir}":/project -w /project --platform ${arch} ${flextesaImage}`;
189
189
  const inputFile = getInputFilename(parsedArgs, sourceFile);
190
190
  const cmd = `${baseCmd} octez-client ${GLOBAL_OPTIONS} typecheck script ${inputFile}`;
191
- console.error(cmd);
192
191
  return cmd;
193
192
  };
194
193
  var typecheckContract = (parsedArgs, sourceFile) => getCheckFileExistenceCommand(parsedArgs, sourceFile).then(import_node_sdk4.execCmd).then(
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts","main.ts","client.ts","common.ts","simulate.ts","typecheck.ts","typecheckAll.ts"],"sourcesContent":["import { Option, Plugin, PositionalArg, Task } from '@taqueria/node-sdk';\nimport main from './main';\n\nPlugin.create(i18n => ({\n\talias: 'tezos-client',\n\tschema: '1.0',\n\tversion: '0.1',\n\ttasks: [\n\t\tTask.create({\n\t\t\ttask: 'client',\n\t\t\tcommand: 'client',\n\t\t\tdescription:\n\t\t\t\t'This task allows you to run arbitrary octez-client native commands. Note that they might not benefit from the abstractions provided by Taqueria',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tshortFlag: 'c',\n\t\t\t\t\tflag: 'command',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdescription: 'The command to be passed to the underlying octez-client binary, wrapped in quotes',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'none',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck',\n\t\t\tcommand: 'typecheck <sourceFile>',\n\t\t\taliases: ['tc'],\n\t\t\tdescription: 'Typecheck a Michelson contract',\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to typecheck',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck-all',\n\t\t\tcommand: 'typecheck-all',\n\t\t\tdescription: 'Typecheck all Michelson contracts in the artifacts directory',\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'simulate',\n\t\t\tcommand: 'simulate <sourceFile>',\n\t\t\taliases: ['sim'],\n\t\t\tdescription: 'Run a Michelson contract as a simulation',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'storage',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the storage file that contains the storage value as a Michelson expression, in the artifacts directory, used for originating a contract',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'param',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the parameter file that contains the parameter value as a Michelson expression, in the artifacts directory, used for invoking a deployed contract',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'entrypoint',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'You may explicitly specify an entrypoint to make the parameter value shorter, without having to specify a chain of (Left (Right ... 14 ...))',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to simulate',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'get-image',\n\t\t\tcommand: 'get-image',\n\t\t\tdescription: 'Gets the name of the image to be used',\n\t\t\thandler: 'proxy',\n\t\t\thidden: true,\n\t\t}),\n\t],\n\tproxy: main,\n}), process.argv);\n","import { RequestArgs, sendAsyncErr, sendAsyncRes } from '@taqueria/node-sdk';\nimport client from './client';\nimport { getClientDockerImage, IntersectionOpts as Opts } from './common';\nimport simulate from './simulate';\nimport typecheck from './typecheck';\nimport typecheckAll from './typecheckAll';\n\nconst main = (parsedArgs: RequestArgs.t): Promise<void> => {\n\tconst unsafeOpts = parsedArgs as unknown as Opts;\n\tswitch (unsafeOpts.task) {\n\t\tcase 'client':\n\t\t\treturn client(unsafeOpts);\n\t\tcase 'typecheck':\n\t\t\treturn typecheck(unsafeOpts);\n\t\tcase 'typecheck-all':\n\t\t\treturn typecheckAll(unsafeOpts);\n\t\tcase 'simulate':\n\t\t\treturn simulate(unsafeOpts);\n\t\tcase 'get-image':\n\t\t\treturn sendAsyncRes(getClientDockerImage());\n\t\tdefault:\n\t\t\treturn sendAsyncErr(`${unsafeOpts.task} is not an understood task by the Tezos-client plugin`);\n\t}\n};\n\nexport default main;\n","import { getArch, sendAsyncErr, sendRes, spawnCmd } from '@taqueria/node-sdk';\nimport { ClientOpts as Opts, getClientDockerImage } from './common';\n\nconst getArbitraryClientCmd = async (\n\tparsedArgs: Opts,\n\tuserArgs: string,\n): Promise<[string, Record<string, string>]> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst binary = 'docker';\n\tconst baseArgs = [\n\t\t'run',\n\t\t'--rm',\n\t\t'-v',\n\t\t`${projectDir}:/project`,\n\t\t'-w',\n\t\t'/project',\n\t\t'--platform',\n\t\tarch,\n\t\tflextesaImage,\n\t\t'octez-client',\n\t];\n\tconst processedUserArgs = userArgs.split(' ').map(arg => arg.startsWith('\\\\-') ? arg.substring(1) : arg).filter(arg =>\n\t\targ\n\t);\n\tconst args = baseArgs.concat(processedUserArgs);\n\tconst envVars = {};\n\treturn [\n\t\t[binary, ...args].join(' '),\n\t\tenvVars,\n\t];\n};\n\nconst runArbitraryClientCmd = (parsedArgs: Opts, cmd: string): Promise<string> =>\n\tgetArbitraryClientCmd(parsedArgs, cmd)\n\t\t.then(([cmd, envVars]) => spawnCmd(cmd, envVars))\n\t\t.then(code =>\n\t\t\tcode !== null && code === 0\n\t\t\t\t? `Command \"${cmd}\" ran successfully by octez-client`\n\t\t\t\t: `Command \"${cmd}\" failed. Please check your command`\n\t\t)\n\t\t.catch(err => sendAsyncErr(`An internal error has occurred: ${err.message}`));\n\nconst client = (parsedArgs: Opts): Promise<void> => {\n\tconst args = parsedArgs.command;\n\treturn runArbitraryClientCmd(parsedArgs, args).then(sendRes).catch(err => sendAsyncErr(err, false));\n};\n\nexport default client;\n","import { getArchSync, getDockerImage, ProxyTaskArgs, RequestArgs } from '@taqueria/node-sdk';\nimport { join } from 'path';\n\n// Should point to the latest stable version, so it needs to be updated as part of our release process.\nconst getFlextesaImage = (_arch: 'linux/arm64/v8' | 'linux/amd64'): string => 'tezos/tezos:octez-v20.2';\n\nconst OCTEZ_CLIENT_IMAGE_ENV_VAR = 'TAQ_OCTEZ_CLIENT_IMAGE';\n\nexport const getClientDockerImage = (): string =>\n\tgetDockerImage(getFlextesaImage(getArchSync()), OCTEZ_CLIENT_IMAGE_ENV_VAR);\n\nexport interface ClientOpts extends ProxyTaskArgs.t {\n\tcommand: string;\n}\n\nexport interface TypeCheckOpts extends ProxyTaskArgs.t {\n\tsourceFile: string;\n}\n\nexport interface TypeCheckAllOpts extends ProxyTaskArgs.t {\n}\n\nexport interface SimulateOpts extends ProxyTaskArgs.t {\n\tsourceFile?: string;\n\tstorage?: string;\n\tparam?: string;\n\tentrypoint?: string;\n}\n\nexport type IntersectionOpts = ClientOpts & TypeCheckOpts & TypeCheckAllOpts & SimulateOpts;\n\ntype UnionOpts = ClientOpts | TypeCheckOpts | TypeCheckAllOpts | SimulateOpts;\n\nconst ENDPOINT = process.env['TAQ_TEZOS_CLIENT_RPC'] ?? 'https://ghostnet.ecadinfra.com';\nexport const GLOBAL_OPTIONS = `--endpoint ${ENDPOINT}`;\n\nexport const trimTezosClientMenuIfPresent = (msg: string): string => {\n\treturn msg.replace(/Usage:(.|\\n)+/, '');\n};\n\nexport const getInputFilename = (opts: UnionOpts, sourceFile: string) =>\n\tjoin('/project', opts.config.artifactsDir ?? 'artifacts', sourceFile);\n\nexport const getCheckFileExistenceCommand = async (parsedArgs: UnionOpts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = getArchSync();\n\tconst baseCmd =\n\t\t`docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${getClientDockerImage()} ls`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} ${inputFile}`;\n\treturn cmd;\n};\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tgetContractContent,\n\tgetParameter,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport { basename, extname } from 'path';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\tSimulateOpts as Opts,\n\ttrimTezosClientMenuIfPresent,\n} from './common';\n\ntype TableRow = { contract: string; result: string };\n\n// This is needed mostly due to the fact that execCmd() wraps the command in double quotes\nconst preprocessString = (value: string): string => {\n\t// 1. if the string contains escaped double quotes, escape them further\n\tvalue = value.replace(/\\\\\"/g, '\\\\\\\\\\\\\"');\n\t// 2. if the string contains unescaped double quotes, escape them\n\tvalue = value.replace(/(?<!\\\\)\"/g, '\\\\\"');\n\treturn value;\n};\n\nconst getDefaultStorageFilename = (contractName: string): string => {\n\tconst baseFilename = basename(contractName, extname(contractName));\n\tconst extFilename = extname(contractName);\n\tconst defaultStorage = `${baseFilename}.default_storage${extFilename}`;\n\treturn defaultStorage;\n};\n\nconst getSimulateCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\n\tconst storageFilename = parsedArgs.storage ?? getDefaultStorageFilename(sourceFile);\n\tconst storage = (await getContractContent(parsedArgs, storageFilename))?.trim();\n\n\tif (storage === undefined) {\n\t\treturn Promise.reject(\n\t\t\tnew Error(\n\t\t\t\t`❌ No initial storage file was found for ${sourceFile}\\nStorage must be specified in a file as a Michelson expression and will automatically be linked to this contract if specified with the name \"${\n\t\t\t\t\tgetDefaultStorageFilename(sourceFile)\n\t\t\t\t}\" in the artifacts directory\\nYou can also manually pass a storage file to the simulate task using the --storage STORAGE_FILE_NAME option\\n`,\n\t\t\t),\n\t\t);\n\t}\n\n\tconst paramFilename = parsedArgs.param!;\n\tconst param = (await getParameter(parsedArgs, paramFilename)).trim();\n\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst entrypoint = parsedArgs.entrypoint ? `--entrypoint ${parsedArgs.entrypoint}` : '';\n\n\tconst cmd =\n\t\t`${baseCmd} octez-client ${GLOBAL_OPTIONS} run script ${inputFile} on storage \\'${storage}\\' and input \\'${param}\\' ${entrypoint}`;\n\treturn cmd;\n};\n\nconst simulateContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tretrySimulateCmd(parsedArgs, sourceFile, 0)\n\t\t\t\t.then(({ stdout, stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(`\\n${stderr}`);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: stdout,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst retrySimulateCmd = (\n\tparsedArgs: Opts,\n\tsourceFile: string,\n\tretryCount: number,\n): Promise<{ stdout: string; stderr: string }> => {\n\tconst max_retries = 3;\n\tconst relay_delay_ms = 1000;\n\treturn getSimulateCmd(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.catch(err => {\n\t\t\tif (retryCount < max_retries && err.stderr.includes('503 Service Temporarily')) {\n\t\t\t\tconst delay = relay_delay_ms * Math.pow(2, retryCount);\n\t\t\t\treturn new Promise(resolve => setTimeout(resolve, delay))\n\t\t\t\t\t.then(() => retrySimulateCmd(parsedArgs, sourceFile, retryCount + 1));\n\t\t\t} else {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t});\n};\n\nconst simulate = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile!);\n\treturn simulateContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default simulate;\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\ttrimTezosClientMenuIfPresent,\n\tTypeCheckOpts as Opts,\n} from './common';\n\nexport type TableRow = { contract: string; result: string };\n\nconst getTypecheckCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} octez-client ${GLOBAL_OPTIONS} typecheck script ${inputFile}`;\n\tconsole.error(cmd);\n\treturn cmd;\n};\n\nexport const typecheckContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tgetTypecheckCmd(parsedArgs, sourceFile)\n\t\t\t\t.then(execCmd)\n\t\t\t\t.then(({ stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(stderr);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Valid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst typecheck = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile);\n\treturn typecheckContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default typecheck;\n","import { getArtifactsDir, isContractFile, sendAsyncErr, sendJsonRes } from '@taqueria/node-sdk';\nimport glob from 'fast-glob';\nimport { join } from 'path';\nimport { TypeCheckAllOpts as Opts, TypeCheckOpts } from './common';\nimport { TableRow, typecheckContract } from './typecheck';\n\nconst compileAll = async (parsedArgs: Opts): Promise<void> => {\n\tlet p: Promise<TableRow>[] = [];\n\n\tconst contractFilenames = await glob(\n\t\t['**/*.tz'],\n\t\t{ cwd: join(parsedArgs.config.projectDir, getArtifactsDir(parsedArgs)), absolute: false },\n\t);\n\n\tfor (const filename of contractFilenames) {\n\t\tif (isContractFile(filename)) p.push(typecheckContract(parsedArgs as TypeCheckOpts, filename));\n\t}\n\n\treturn Promise.all(p).then(sendJsonRes).catch(err => sendAsyncErr(err, false));\n};\n\nexport default compileAll;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,mBAAoD;;;ACApD,IAAAC,mBAAwD;;;ACAxD,IAAAC,mBAAyD;;;ACAzD,sBAAwE;AACxE,kBAAqB;AAGrB,IAAM,mBAAmB,CAAC,UAAoD;AAE9E,IAAM,6BAA6B;AAE5B,IAAM,uBAAuB,UACnC,gCAAe,qBAAiB,6BAAY,CAAC,GAAG,0BAA0B;AAwB3E,IAAM,WAAW,QAAQ,IAAI,sBAAsB,KAAK;AACjD,IAAM,iBAAiB,cAAc,QAAQ;AAE7C,IAAM,+BAA+B,CAAC,QAAwB;AACpE,SAAO,IAAI,QAAQ,iBAAiB,EAAE;AACvC;AAEO,IAAM,mBAAmB,CAAC,MAAiB,mBACjD,kBAAK,YAAY,KAAK,OAAO,gBAAgB,aAAa,UAAU;AAE9D,IAAM,+BAA+B,OAAO,YAAuB,eAAwC;AAC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MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,MACT,QAAQ;AAAA,IACT,CAAC;AAAA,EACF;AAAA,EACA,OAAO;AACR,IAAI,QAAQ,IAAI;","names":["import_node_sdk","import_node_sdk","import_node_sdk","cmd","import_node_sdk","import_path","import_node_sdk","import_node_sdk","import_path","glob"]}
1
+ {"version":3,"sources":["index.ts","main.ts","client.ts","common.ts","simulate.ts","typecheck.ts","typecheckAll.ts"],"sourcesContent":["import { Option, Plugin, PositionalArg, Task } from '@taqueria/node-sdk';\nimport main from './main';\n\nPlugin.create(i18n => ({\n\talias: 'tezos-client',\n\tschema: '1.0',\n\tversion: '0.1',\n\ttasks: [\n\t\tTask.create({\n\t\t\ttask: 'client',\n\t\t\tcommand: 'client',\n\t\t\tdescription:\n\t\t\t\t'This task allows you to run arbitrary octez-client native commands. Note that they might not benefit from the abstractions provided by Taqueria',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tshortFlag: 'c',\n\t\t\t\t\tflag: 'command',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdescription: 'The command to be passed to the underlying octez-client binary, wrapped in quotes',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'none',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck',\n\t\t\tcommand: 'typecheck <sourceFile>',\n\t\t\taliases: ['tc'],\n\t\t\tdescription: 'Typecheck a Michelson contract',\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to typecheck',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck-all',\n\t\t\tcommand: 'typecheck-all',\n\t\t\tdescription: 'Typecheck all Michelson contracts in the artifacts directory',\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'simulate',\n\t\t\tcommand: 'simulate <sourceFile>',\n\t\t\taliases: ['sim'],\n\t\t\tdescription: 'Run a Michelson contract as a simulation',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'storage',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the storage file that contains the storage value as a Michelson expression, in the artifacts directory, used for originating a contract',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'param',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the parameter file that contains the parameter value as a Michelson expression, in the artifacts directory, used for invoking a deployed contract',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'entrypoint',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'You may explicitly specify an entrypoint to make the parameter value shorter, without having to specify a chain of (Left (Right ... 14 ...))',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to simulate',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'get-image',\n\t\t\tcommand: 'get-image',\n\t\t\tdescription: 'Gets the name of the image to be used',\n\t\t\thandler: 'proxy',\n\t\t\thidden: true,\n\t\t}),\n\t],\n\tproxy: main,\n}), process.argv);\n","import { RequestArgs, sendAsyncErr, sendAsyncRes } from '@taqueria/node-sdk';\nimport client from './client';\nimport { getClientDockerImage, IntersectionOpts as Opts } from './common';\nimport simulate from './simulate';\nimport typecheck from './typecheck';\nimport typecheckAll from './typecheckAll';\n\nconst main = (parsedArgs: RequestArgs.t): Promise<void> => {\n\tconst unsafeOpts = parsedArgs as unknown as Opts;\n\tswitch (unsafeOpts.task) {\n\t\tcase 'client':\n\t\t\treturn client(unsafeOpts);\n\t\tcase 'typecheck':\n\t\t\treturn typecheck(unsafeOpts);\n\t\tcase 'typecheck-all':\n\t\t\treturn typecheckAll(unsafeOpts);\n\t\tcase 'simulate':\n\t\t\treturn simulate(unsafeOpts);\n\t\tcase 'get-image':\n\t\t\treturn sendAsyncRes(getClientDockerImage());\n\t\tdefault:\n\t\t\treturn sendAsyncErr(`${unsafeOpts.task} is not an understood task by the Tezos-client plugin`);\n\t}\n};\n\nexport default main;\n","import { getArch, sendAsyncErr, sendRes, spawnCmd } from '@taqueria/node-sdk';\nimport { ClientOpts as Opts, getClientDockerImage } from './common';\n\nconst getArbitraryClientCmd = async (\n\tparsedArgs: Opts,\n\tuserArgs: string,\n): Promise<[string, Record<string, string>]> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst binary = 'docker';\n\tconst baseArgs = [\n\t\t'run',\n\t\t'--rm',\n\t\t'-v',\n\t\t`${projectDir}:/project`,\n\t\t'-w',\n\t\t'/project',\n\t\t'--platform',\n\t\tarch,\n\t\tflextesaImage,\n\t\t'octez-client',\n\t];\n\tconst processedUserArgs = userArgs.split(' ').map(arg => arg.startsWith('\\\\-') ? arg.substring(1) : arg).filter(arg =>\n\t\targ\n\t);\n\tconst args = baseArgs.concat(processedUserArgs);\n\tconst envVars = {};\n\treturn [\n\t\t[binary, ...args].join(' '),\n\t\tenvVars,\n\t];\n};\n\nconst runArbitraryClientCmd = (parsedArgs: Opts, cmd: string): Promise<string> =>\n\tgetArbitraryClientCmd(parsedArgs, cmd)\n\t\t.then(([cmd, envVars]) => spawnCmd(cmd, envVars))\n\t\t.then(code =>\n\t\t\tcode !== null && code === 0\n\t\t\t\t? `Command \"${cmd}\" ran successfully by octez-client`\n\t\t\t\t: `Command \"${cmd}\" failed. Please check your command`\n\t\t)\n\t\t.catch(err => sendAsyncErr(`An internal error has occurred: ${err.message}`));\n\nconst client = (parsedArgs: Opts): Promise<void> => {\n\tconst args = parsedArgs.command;\n\treturn runArbitraryClientCmd(parsedArgs, args).then(sendRes).catch(err => sendAsyncErr(err, false));\n};\n\nexport default client;\n","import { getArchSync, getDockerImage, ProxyTaskArgs, RequestArgs } from '@taqueria/node-sdk';\nimport { join } from 'path';\n\n// Should point to the latest stable version, so it needs to be updated as part of our release process.\nconst getFlextesaImage = (_arch: 'linux/arm64/v8' | 'linux/amd64'): string => 'tezos/tezos:octez-v20.2';\n\nconst OCTEZ_CLIENT_IMAGE_ENV_VAR = 'TAQ_OCTEZ_CLIENT_IMAGE';\n\nexport const getClientDockerImage = (): string =>\n\tgetDockerImage(getFlextesaImage(getArchSync()), OCTEZ_CLIENT_IMAGE_ENV_VAR);\n\nexport interface ClientOpts extends ProxyTaskArgs.t {\n\tcommand: string;\n}\n\nexport interface TypeCheckOpts extends ProxyTaskArgs.t {\n\tsourceFile: string;\n}\n\nexport interface TypeCheckAllOpts extends ProxyTaskArgs.t {\n}\n\nexport interface SimulateOpts extends ProxyTaskArgs.t {\n\tsourceFile?: string;\n\tstorage?: string;\n\tparam?: string;\n\tentrypoint?: string;\n}\n\nexport type IntersectionOpts = ClientOpts & TypeCheckOpts & TypeCheckAllOpts & SimulateOpts;\n\ntype UnionOpts = ClientOpts | TypeCheckOpts | TypeCheckAllOpts | SimulateOpts;\n\n// Temporary change till a discussion is had with ECAD Labs\n// about https://github.com/TezosTaqueria/taqueria/actions/runs/10102868947/job/27961869044\nconst ENDPOINT = process.env['TAQ_TEZOS_CLIENT_RPC'] ?? 'https://ghostnet.smartpy.io';\nexport const GLOBAL_OPTIONS = `--endpoint ${ENDPOINT}`;\n\nexport const trimTezosClientMenuIfPresent = (msg: string): string => {\n\treturn msg.replace(/Usage:(.|\\n)+/, '');\n};\n\nexport const getInputFilename = (opts: UnionOpts, sourceFile: string) =>\n\tjoin('/project', opts.config.artifactsDir ?? 'artifacts', sourceFile);\n\nexport const getCheckFileExistenceCommand = async (parsedArgs: UnionOpts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = getArchSync();\n\tconst baseCmd =\n\t\t`docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${getClientDockerImage()} ls`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} ${inputFile}`;\n\treturn cmd;\n};\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tgetContractContent,\n\tgetParameter,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport { basename, extname } from 'path';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\tSimulateOpts as Opts,\n\ttrimTezosClientMenuIfPresent,\n} from './common';\n\ntype TableRow = { contract: string; result: string };\n\n// This is needed mostly due to the fact that execCmd() wraps the command in double quotes\nconst preprocessString = (value: string): string => {\n\t// 1. if the string contains escaped double quotes, escape them further\n\tvalue = value.replace(/\\\\\"/g, '\\\\\\\\\\\\\"');\n\t// 2. if the string contains unescaped double quotes, escape them\n\tvalue = value.replace(/(?<!\\\\)\"/g, '\\\\\"');\n\treturn value;\n};\n\nconst getDefaultStorageFilename = (contractName: string): string => {\n\tconst baseFilename = basename(contractName, extname(contractName));\n\tconst extFilename = extname(contractName);\n\tconst defaultStorage = `${baseFilename}.default_storage${extFilename}`;\n\treturn defaultStorage;\n};\n\nconst getSimulateCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\n\tconst storageFilename = parsedArgs.storage ?? getDefaultStorageFilename(sourceFile);\n\tconst storage = (await getContractContent(parsedArgs, storageFilename))?.trim();\n\n\tif (storage === undefined) {\n\t\treturn Promise.reject(\n\t\t\tnew Error(\n\t\t\t\t`❌ No initial storage file was found for ${sourceFile}\\nStorage must be specified in a file as a Michelson expression and will automatically be linked to this contract if specified with the name \"${\n\t\t\t\t\tgetDefaultStorageFilename(sourceFile)\n\t\t\t\t}\" in the artifacts directory\\nYou can also manually pass a storage file to the simulate task using the --storage STORAGE_FILE_NAME option\\n`,\n\t\t\t),\n\t\t);\n\t}\n\n\tconst paramFilename = parsedArgs.param!;\n\tconst param = (await getParameter(parsedArgs, paramFilename)).trim();\n\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst entrypoint = parsedArgs.entrypoint ? `--entrypoint ${parsedArgs.entrypoint}` : '';\n\n\tconst cmd =\n\t\t`${baseCmd} octez-client ${GLOBAL_OPTIONS} run script ${inputFile} on storage \\'${storage}\\' and input \\'${param}\\' ${entrypoint}`;\n\treturn cmd;\n};\n\nconst simulateContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tretrySimulateCmd(parsedArgs, sourceFile, 0)\n\t\t\t\t.then(({ stdout, stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(`\\n${stderr}`);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: stdout,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst retrySimulateCmd = (\n\tparsedArgs: Opts,\n\tsourceFile: string,\n\tretryCount: number,\n): Promise<{ stdout: string; stderr: string }> => {\n\tconst max_retries = 3;\n\tconst relay_delay_ms = 1000;\n\treturn getSimulateCmd(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.catch(err => {\n\t\t\tif (retryCount < max_retries && err.stderr.includes('503 Service Temporarily')) {\n\t\t\t\tconst delay = relay_delay_ms * Math.pow(2, retryCount);\n\t\t\t\treturn new Promise(resolve => setTimeout(resolve, delay))\n\t\t\t\t\t.then(() => retrySimulateCmd(parsedArgs, sourceFile, retryCount + 1));\n\t\t\t} else {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t});\n};\n\nconst simulate = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile!);\n\treturn simulateContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default simulate;\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\ttrimTezosClientMenuIfPresent,\n\tTypeCheckOpts as Opts,\n} from './common';\n\nexport type TableRow = { contract: string; result: string };\n\nconst getTypecheckCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} octez-client ${GLOBAL_OPTIONS} typecheck script ${inputFile}`;\n\treturn cmd;\n};\n\nexport const typecheckContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tgetTypecheckCmd(parsedArgs, sourceFile)\n\t\t\t\t.then(execCmd)\n\t\t\t\t.then(({ stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(stderr);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Valid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst typecheck = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile);\n\treturn typecheckContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default typecheck;\n","import { getArtifactsDir, isContractFile, sendAsyncErr, sendJsonRes } from '@taqueria/node-sdk';\nimport glob from 'fast-glob';\nimport { join } from 'path';\nimport { TypeCheckAllOpts as Opts, TypeCheckOpts } from './common';\nimport { TableRow, typecheckContract } from './typecheck';\n\nconst compileAll = async (parsedArgs: Opts): Promise<void> => {\n\tlet p: Promise<TableRow>[] = [];\n\n\tconst contractFilenames = await glob(\n\t\t['**/*.tz'],\n\t\t{ cwd: join(parsedArgs.config.projectDir, getArtifactsDir(parsedArgs)), absolute: false },\n\t);\n\n\tfor (const filename of contractFilenames) {\n\t\tif (isContractFile(filename)) p.push(typecheckContract(parsedArgs as TypeCheckOpts, filename));\n\t}\n\n\treturn Promise.all(p).then(sendJsonRes).catch(err => sendAsyncErr(err, false));\n};\n\nexport default compileAll;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,mBAAoD;;;ACApD,IAAAC,mBAAwD;;;ACAxD,IAAAC,mBAAyD;;;ACAzD,sBAAwE;AACxE,kBAAqB;AAGrB,IAAM,mBAAmB,CAAC,UAAoD;AAE9E,IAAM,6BAA6B;AAE5B,IAAM,uBAAuB,UACnC,gCAAe,qBAAiB,6BAAY,CAAC,GAAG,0BAA0B;AA0B3E,IAAM,WAAW,QAAQ,IAAI,sBAAsB,KAAK;AACjD,IAAM,iBAAiB,cAAc,QAAQ;AAE7C,IAAM,+BAA+B,CAAC,QAAwB;AACpE,SAAO,IAAI,QAAQ,iBAAiB,EAAE;AACvC;AAEO,IAAM,mBAAmB,CAAC,MAAiB,mBACjD,kBAAK,YAAY,KAAK,OAAO,gBAAgB,aAAa,UAAU;AAE9D,IAAM,+BAA+B,OAAO,YAAuB,eAA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AS;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,MACT,QAAQ;AAAA,IACT,CAAC;AAAA,EACF;AAAA,EACA,OAAO;AACR,IAAI,QAAQ,IAAI;","names":["import_node_sdk","import_node_sdk","import_node_sdk","cmd","import_node_sdk","import_path","import_node_sdk","import_node_sdk","import_path","glob"]}
package/index.mjs CHANGED
@@ -13,7 +13,7 @@ import { join } from "path";
13
13
  var getFlextesaImage = (_arch) => "tezos/tezos:octez-v20.2";
14
14
  var OCTEZ_CLIENT_IMAGE_ENV_VAR = "TAQ_OCTEZ_CLIENT_IMAGE";
15
15
  var getClientDockerImage = () => getDockerImage(getFlextesaImage(getArchSync()), OCTEZ_CLIENT_IMAGE_ENV_VAR);
16
- var ENDPOINT = process.env["TAQ_TEZOS_CLIENT_RPC"] ?? "https://ghostnet.ecadinfra.com";
16
+ var ENDPOINT = process.env["TAQ_TEZOS_CLIENT_RPC"] ?? "https://ghostnet.smartpy.io";
17
17
  var GLOBAL_OPTIONS = `--endpoint ${ENDPOINT}`;
18
18
  var trimTezosClientMenuIfPresent = (msg) => {
19
19
  return msg.replace(/Usage:(.|\n)+/, "");
@@ -182,7 +182,6 @@ var getTypecheckCmd = async (parsedArgs, sourceFile) => {
182
182
  const baseCmd = `docker run --rm -v "${projectDir}":/project -w /project --platform ${arch} ${flextesaImage}`;
183
183
  const inputFile = getInputFilename(parsedArgs, sourceFile);
184
184
  const cmd = `${baseCmd} octez-client ${GLOBAL_OPTIONS} typecheck script ${inputFile}`;
185
- console.error(cmd);
186
185
  return cmd;
187
186
  };
188
187
  var typecheckContract = (parsedArgs, sourceFile) => getCheckFileExistenceCommand(parsedArgs, sourceFile).then(execCmd2).then(
package/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts","main.ts","client.ts","common.ts","simulate.ts","typecheck.ts","typecheckAll.ts"],"sourcesContent":["import { Option, Plugin, PositionalArg, Task } from '@taqueria/node-sdk';\nimport main from './main';\n\nPlugin.create(i18n => ({\n\talias: 'tezos-client',\n\tschema: '1.0',\n\tversion: '0.1',\n\ttasks: [\n\t\tTask.create({\n\t\t\ttask: 'client',\n\t\t\tcommand: 'client',\n\t\t\tdescription:\n\t\t\t\t'This task allows you to run arbitrary octez-client native commands. Note that they might not benefit from the abstractions provided by Taqueria',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tshortFlag: 'c',\n\t\t\t\t\tflag: 'command',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdescription: 'The command to be passed to the underlying octez-client binary, wrapped in quotes',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'none',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck',\n\t\t\tcommand: 'typecheck <sourceFile>',\n\t\t\taliases: ['tc'],\n\t\t\tdescription: 'Typecheck a Michelson contract',\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to typecheck',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck-all',\n\t\t\tcommand: 'typecheck-all',\n\t\t\tdescription: 'Typecheck all Michelson contracts in the artifacts directory',\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'simulate',\n\t\t\tcommand: 'simulate <sourceFile>',\n\t\t\taliases: ['sim'],\n\t\t\tdescription: 'Run a Michelson contract as a simulation',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'storage',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the storage file that contains the storage value as a Michelson expression, in the artifacts directory, used for originating a contract',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'param',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the parameter file that contains the parameter value as a Michelson expression, in the artifacts directory, used for invoking a deployed contract',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'entrypoint',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'You may explicitly specify an entrypoint to make the parameter value shorter, without having to specify a chain of (Left (Right ... 14 ...))',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to simulate',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'get-image',\n\t\t\tcommand: 'get-image',\n\t\t\tdescription: 'Gets the name of the image to be used',\n\t\t\thandler: 'proxy',\n\t\t\thidden: true,\n\t\t}),\n\t],\n\tproxy: main,\n}), process.argv);\n","import { RequestArgs, sendAsyncErr, sendAsyncRes } from '@taqueria/node-sdk';\nimport client from './client';\nimport { getClientDockerImage, IntersectionOpts as Opts } from './common';\nimport simulate from './simulate';\nimport typecheck from './typecheck';\nimport typecheckAll from './typecheckAll';\n\nconst main = (parsedArgs: RequestArgs.t): Promise<void> => {\n\tconst unsafeOpts = parsedArgs as unknown as Opts;\n\tswitch (unsafeOpts.task) {\n\t\tcase 'client':\n\t\t\treturn client(unsafeOpts);\n\t\tcase 'typecheck':\n\t\t\treturn typecheck(unsafeOpts);\n\t\tcase 'typecheck-all':\n\t\t\treturn typecheckAll(unsafeOpts);\n\t\tcase 'simulate':\n\t\t\treturn simulate(unsafeOpts);\n\t\tcase 'get-image':\n\t\t\treturn sendAsyncRes(getClientDockerImage());\n\t\tdefault:\n\t\t\treturn sendAsyncErr(`${unsafeOpts.task} is not an understood task by the Tezos-client plugin`);\n\t}\n};\n\nexport default main;\n","import { getArch, sendAsyncErr, sendRes, spawnCmd } from '@taqueria/node-sdk';\nimport { ClientOpts as Opts, getClientDockerImage } from './common';\n\nconst getArbitraryClientCmd = async (\n\tparsedArgs: Opts,\n\tuserArgs: string,\n): Promise<[string, Record<string, string>]> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst binary = 'docker';\n\tconst baseArgs = [\n\t\t'run',\n\t\t'--rm',\n\t\t'-v',\n\t\t`${projectDir}:/project`,\n\t\t'-w',\n\t\t'/project',\n\t\t'--platform',\n\t\tarch,\n\t\tflextesaImage,\n\t\t'octez-client',\n\t];\n\tconst processedUserArgs = userArgs.split(' ').map(arg => arg.startsWith('\\\\-') ? arg.substring(1) : arg).filter(arg =>\n\t\targ\n\t);\n\tconst args = baseArgs.concat(processedUserArgs);\n\tconst envVars = {};\n\treturn [\n\t\t[binary, ...args].join(' '),\n\t\tenvVars,\n\t];\n};\n\nconst runArbitraryClientCmd = (parsedArgs: Opts, cmd: string): Promise<string> =>\n\tgetArbitraryClientCmd(parsedArgs, cmd)\n\t\t.then(([cmd, envVars]) => spawnCmd(cmd, envVars))\n\t\t.then(code =>\n\t\t\tcode !== null && code === 0\n\t\t\t\t? `Command \"${cmd}\" ran successfully by octez-client`\n\t\t\t\t: `Command \"${cmd}\" failed. Please check your command`\n\t\t)\n\t\t.catch(err => sendAsyncErr(`An internal error has occurred: ${err.message}`));\n\nconst client = (parsedArgs: Opts): Promise<void> => {\n\tconst args = parsedArgs.command;\n\treturn runArbitraryClientCmd(parsedArgs, args).then(sendRes).catch(err => sendAsyncErr(err, false));\n};\n\nexport default client;\n","import { getArchSync, getDockerImage, ProxyTaskArgs, RequestArgs } from '@taqueria/node-sdk';\nimport { join } from 'path';\n\n// Should point to the latest stable version, so it needs to be updated as part of our release process.\nconst getFlextesaImage = (_arch: 'linux/arm64/v8' | 'linux/amd64'): string => 'tezos/tezos:octez-v20.2';\n\nconst OCTEZ_CLIENT_IMAGE_ENV_VAR = 'TAQ_OCTEZ_CLIENT_IMAGE';\n\nexport const getClientDockerImage = (): string =>\n\tgetDockerImage(getFlextesaImage(getArchSync()), OCTEZ_CLIENT_IMAGE_ENV_VAR);\n\nexport interface ClientOpts extends ProxyTaskArgs.t {\n\tcommand: string;\n}\n\nexport interface TypeCheckOpts extends ProxyTaskArgs.t {\n\tsourceFile: string;\n}\n\nexport interface TypeCheckAllOpts extends ProxyTaskArgs.t {\n}\n\nexport interface SimulateOpts extends ProxyTaskArgs.t {\n\tsourceFile?: string;\n\tstorage?: string;\n\tparam?: string;\n\tentrypoint?: string;\n}\n\nexport type IntersectionOpts = ClientOpts & TypeCheckOpts & TypeCheckAllOpts & SimulateOpts;\n\ntype UnionOpts = ClientOpts | TypeCheckOpts | TypeCheckAllOpts | SimulateOpts;\n\nconst ENDPOINT = process.env['TAQ_TEZOS_CLIENT_RPC'] ?? 'https://ghostnet.ecadinfra.com';\nexport const GLOBAL_OPTIONS = `--endpoint ${ENDPOINT}`;\n\nexport const trimTezosClientMenuIfPresent = (msg: string): string => {\n\treturn msg.replace(/Usage:(.|\\n)+/, '');\n};\n\nexport const getInputFilename = (opts: UnionOpts, sourceFile: string) =>\n\tjoin('/project', opts.config.artifactsDir ?? 'artifacts', sourceFile);\n\nexport const getCheckFileExistenceCommand = async (parsedArgs: UnionOpts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = getArchSync();\n\tconst baseCmd =\n\t\t`docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${getClientDockerImage()} ls`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} ${inputFile}`;\n\treturn cmd;\n};\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tgetContractContent,\n\tgetParameter,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport { basename, extname } from 'path';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\tSimulateOpts as Opts,\n\ttrimTezosClientMenuIfPresent,\n} from './common';\n\ntype TableRow = { contract: string; result: string };\n\n// This is needed mostly due to the fact that execCmd() wraps the command in double quotes\nconst preprocessString = (value: string): string => {\n\t// 1. if the string contains escaped double quotes, escape them further\n\tvalue = value.replace(/\\\\\"/g, '\\\\\\\\\\\\\"');\n\t// 2. if the string contains unescaped double quotes, escape them\n\tvalue = value.replace(/(?<!\\\\)\"/g, '\\\\\"');\n\treturn value;\n};\n\nconst getDefaultStorageFilename = (contractName: string): string => {\n\tconst baseFilename = basename(contractName, extname(contractName));\n\tconst extFilename = extname(contractName);\n\tconst defaultStorage = `${baseFilename}.default_storage${extFilename}`;\n\treturn defaultStorage;\n};\n\nconst getSimulateCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\n\tconst storageFilename = parsedArgs.storage ?? getDefaultStorageFilename(sourceFile);\n\tconst storage = (await getContractContent(parsedArgs, storageFilename))?.trim();\n\n\tif (storage === undefined) {\n\t\treturn Promise.reject(\n\t\t\tnew Error(\n\t\t\t\t`❌ No initial storage file was found for ${sourceFile}\\nStorage must be specified in a file as a Michelson expression and will automatically be linked to this contract if specified with the name \"${\n\t\t\t\t\tgetDefaultStorageFilename(sourceFile)\n\t\t\t\t}\" in the artifacts directory\\nYou can also manually pass a storage file to the simulate task using the --storage STORAGE_FILE_NAME option\\n`,\n\t\t\t),\n\t\t);\n\t}\n\n\tconst paramFilename = parsedArgs.param!;\n\tconst param = (await getParameter(parsedArgs, paramFilename)).trim();\n\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst entrypoint = parsedArgs.entrypoint ? `--entrypoint ${parsedArgs.entrypoint}` : '';\n\n\tconst cmd =\n\t\t`${baseCmd} octez-client ${GLOBAL_OPTIONS} run script ${inputFile} on storage \\'${storage}\\' and input \\'${param}\\' ${entrypoint}`;\n\treturn cmd;\n};\n\nconst simulateContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tretrySimulateCmd(parsedArgs, sourceFile, 0)\n\t\t\t\t.then(({ stdout, stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(`\\n${stderr}`);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: stdout,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst retrySimulateCmd = (\n\tparsedArgs: Opts,\n\tsourceFile: string,\n\tretryCount: number,\n): Promise<{ stdout: string; stderr: string }> => {\n\tconst max_retries = 3;\n\tconst relay_delay_ms = 1000;\n\treturn getSimulateCmd(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.catch(err => {\n\t\t\tif (retryCount < max_retries && err.stderr.includes('503 Service Temporarily')) {\n\t\t\t\tconst delay = relay_delay_ms * Math.pow(2, retryCount);\n\t\t\t\treturn new Promise(resolve => setTimeout(resolve, delay))\n\t\t\t\t\t.then(() => retrySimulateCmd(parsedArgs, sourceFile, retryCount + 1));\n\t\t\t} else {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t});\n};\n\nconst simulate = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile!);\n\treturn simulateContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default simulate;\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\ttrimTezosClientMenuIfPresent,\n\tTypeCheckOpts as Opts,\n} from './common';\n\nexport type TableRow = { contract: string; result: string };\n\nconst getTypecheckCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} octez-client ${GLOBAL_OPTIONS} typecheck script ${inputFile}`;\n\tconsole.error(cmd);\n\treturn cmd;\n};\n\nexport const typecheckContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tgetTypecheckCmd(parsedArgs, sourceFile)\n\t\t\t\t.then(execCmd)\n\t\t\t\t.then(({ stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(stderr);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Valid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst typecheck = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile);\n\treturn typecheckContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default typecheck;\n","import { getArtifactsDir, isContractFile, sendAsyncErr, sendJsonRes } from '@taqueria/node-sdk';\nimport glob from 'fast-glob';\nimport { join } from 'path';\nimport { TypeCheckAllOpts as Opts, TypeCheckOpts } from './common';\nimport { TableRow, typecheckContract } from './typecheck';\n\nconst compileAll = async (parsedArgs: Opts): Promise<void> => {\n\tlet p: Promise<TableRow>[] = [];\n\n\tconst contractFilenames = await glob(\n\t\t['**/*.tz'],\n\t\t{ cwd: join(parsedArgs.config.projectDir, getArtifactsDir(parsedArgs)), absolute: false },\n\t);\n\n\tfor (const filename of contractFilenames) {\n\t\tif (isContractFile(filename)) p.push(typecheckContract(parsedArgs as TypeCheckOpts, filename));\n\t}\n\n\treturn Promise.all(p).then(sendJsonRes).catch(err => sendAsyncErr(err, false));\n};\n\nexport default compileAll;\n"],"mappings":";AAAA,SAAS,QAAQ,QAAQ,eAAe,YAAY;;;ACApD,SAAsB,gBAAAA,eAAc,oBAAoB;;;ACAxD,SAAS,SAAS,cAAc,SAAS,gBAAgB;;;ACAzD,SAAS,aAAa,sBAAkD;AACxE,SAAS,YAAY;AAGrB,IAAM,mBAAmB,CAAC,UAAoD;AAE9E,IAAM,6BAA6B;AAE5B,IAAM,uBAAuB,MACnC,eAAe,iBAAiB,YAAY,CAAC,GAAG,0BAA0B;AAwB3E,IAAM,WAAW,QAAQ,IAAI,sBAAsB,KAAK;AACjD,IAAM,iBAAiB,cAAc,QAAQ;AAE7C,IAAM,+BAA+B,CAAC,QAAwB;AACpE,SAAO,IAAI,QAAQ,iBAAiB,EAAE;AACvC;AAEO,IAAM,mBAAmB,CAAC,MAAiB,eACjD,KAAK,YAAY,KAAK,OAAO,gBAAgB,aAAa,UAAU;AAE9D,IAAM,+BAA+B,OAAO,YAAuB,eAAwC;AACjH,QAAM,aAAa,QAAQ,IAAI,eAAe,WAAW;AACzD,MAAI,CAAC;AAAY,UAAM;AACvB,QAAM,OAAO,YAAY;AACzB,QAAM,UACL,uBAAwB,UAAU,qCAAsC,IAAI,IAAI,qBAAqB,CAAC;AACvG,QAAM,YAAY,iBAAiB,YAAY,UAAU;AACzD,QAAM,MAAM,GAAG,OAAO,IAAI,SAAS;AACnC,SAAO;AACR;;;ADjDA,IAAM,wBAAwB,OAC7B,YACA,aAC+C;AAC/C,QAAM,aAAa,QAAQ,IAAI,eAAe,WAAW;AACzD,MAAI,CAAC;AAAY,UAAM;AACvB,QAAM,OAAO,MAA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AI;","names":["sendAsyncErr","cmd","getArch","sendAsyncErr","getArch","sendAsyncErr","addTzExtensionIfMissing","execCmd","getArch","sendAsyncErr","sendErr","sendJsonRes","sendWarn","getArch","execCmd","sendWarn","sendErr","addTzExtensionIfMissing","sendJsonRes","sendAsyncErr","sendAsyncErr","sendJsonRes","join","join","sendJsonRes","sendAsyncErr","sendAsyncErr"]}
1
+ {"version":3,"sources":["index.ts","main.ts","client.ts","common.ts","simulate.ts","typecheck.ts","typecheckAll.ts"],"sourcesContent":["import { Option, Plugin, PositionalArg, Task } from '@taqueria/node-sdk';\nimport main from './main';\n\nPlugin.create(i18n => ({\n\talias: 'tezos-client',\n\tschema: '1.0',\n\tversion: '0.1',\n\ttasks: [\n\t\tTask.create({\n\t\t\ttask: 'client',\n\t\t\tcommand: 'client',\n\t\t\tdescription:\n\t\t\t\t'This task allows you to run arbitrary octez-client native commands. Note that they might not benefit from the abstractions provided by Taqueria',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tshortFlag: 'c',\n\t\t\t\t\tflag: 'command',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdescription: 'The command to be passed to the underlying octez-client binary, wrapped in quotes',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'none',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck',\n\t\t\tcommand: 'typecheck <sourceFile>',\n\t\t\taliases: ['tc'],\n\t\t\tdescription: 'Typecheck a Michelson contract',\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to typecheck',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck-all',\n\t\t\tcommand: 'typecheck-all',\n\t\t\tdescription: 'Typecheck all Michelson contracts in the artifacts directory',\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'simulate',\n\t\t\tcommand: 'simulate <sourceFile>',\n\t\t\taliases: ['sim'],\n\t\t\tdescription: 'Run a Michelson contract as a simulation',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'storage',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the storage file that contains the storage value as a Michelson expression, in the artifacts directory, used for originating a contract',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'param',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the parameter file that contains the parameter value as a Michelson expression, in the artifacts directory, used for invoking a deployed contract',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'entrypoint',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'You may explicitly specify an entrypoint to make the parameter value shorter, without having to specify a chain of (Left (Right ... 14 ...))',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to simulate',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'get-image',\n\t\t\tcommand: 'get-image',\n\t\t\tdescription: 'Gets the name of the image to be used',\n\t\t\thandler: 'proxy',\n\t\t\thidden: true,\n\t\t}),\n\t],\n\tproxy: main,\n}), process.argv);\n","import { RequestArgs, sendAsyncErr, sendAsyncRes } from '@taqueria/node-sdk';\nimport client from './client';\nimport { getClientDockerImage, IntersectionOpts as Opts } from './common';\nimport simulate from './simulate';\nimport typecheck from './typecheck';\nimport typecheckAll from './typecheckAll';\n\nconst main = (parsedArgs: RequestArgs.t): Promise<void> => {\n\tconst unsafeOpts = parsedArgs as unknown as Opts;\n\tswitch (unsafeOpts.task) {\n\t\tcase 'client':\n\t\t\treturn client(unsafeOpts);\n\t\tcase 'typecheck':\n\t\t\treturn typecheck(unsafeOpts);\n\t\tcase 'typecheck-all':\n\t\t\treturn typecheckAll(unsafeOpts);\n\t\tcase 'simulate':\n\t\t\treturn simulate(unsafeOpts);\n\t\tcase 'get-image':\n\t\t\treturn sendAsyncRes(getClientDockerImage());\n\t\tdefault:\n\t\t\treturn sendAsyncErr(`${unsafeOpts.task} is not an understood task by the Tezos-client plugin`);\n\t}\n};\n\nexport default main;\n","import { getArch, sendAsyncErr, sendRes, spawnCmd } from '@taqueria/node-sdk';\nimport { ClientOpts as Opts, getClientDockerImage } from './common';\n\nconst getArbitraryClientCmd = async (\n\tparsedArgs: Opts,\n\tuserArgs: string,\n): Promise<[string, Record<string, string>]> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst binary = 'docker';\n\tconst baseArgs = [\n\t\t'run',\n\t\t'--rm',\n\t\t'-v',\n\t\t`${projectDir}:/project`,\n\t\t'-w',\n\t\t'/project',\n\t\t'--platform',\n\t\tarch,\n\t\tflextesaImage,\n\t\t'octez-client',\n\t];\n\tconst processedUserArgs = userArgs.split(' ').map(arg => arg.startsWith('\\\\-') ? arg.substring(1) : arg).filter(arg =>\n\t\targ\n\t);\n\tconst args = baseArgs.concat(processedUserArgs);\n\tconst envVars = {};\n\treturn [\n\t\t[binary, ...args].join(' '),\n\t\tenvVars,\n\t];\n};\n\nconst runArbitraryClientCmd = (parsedArgs: Opts, cmd: string): Promise<string> =>\n\tgetArbitraryClientCmd(parsedArgs, cmd)\n\t\t.then(([cmd, envVars]) => spawnCmd(cmd, envVars))\n\t\t.then(code =>\n\t\t\tcode !== null && code === 0\n\t\t\t\t? `Command \"${cmd}\" ran successfully by octez-client`\n\t\t\t\t: `Command \"${cmd}\" failed. Please check your command`\n\t\t)\n\t\t.catch(err => sendAsyncErr(`An internal error has occurred: ${err.message}`));\n\nconst client = (parsedArgs: Opts): Promise<void> => {\n\tconst args = parsedArgs.command;\n\treturn runArbitraryClientCmd(parsedArgs, args).then(sendRes).catch(err => sendAsyncErr(err, false));\n};\n\nexport default client;\n","import { getArchSync, getDockerImage, ProxyTaskArgs, RequestArgs } from '@taqueria/node-sdk';\nimport { join } from 'path';\n\n// Should point to the latest stable version, so it needs to be updated as part of our release process.\nconst getFlextesaImage = (_arch: 'linux/arm64/v8' | 'linux/amd64'): string => 'tezos/tezos:octez-v20.2';\n\nconst OCTEZ_CLIENT_IMAGE_ENV_VAR = 'TAQ_OCTEZ_CLIENT_IMAGE';\n\nexport const getClientDockerImage = (): string =>\n\tgetDockerImage(getFlextesaImage(getArchSync()), OCTEZ_CLIENT_IMAGE_ENV_VAR);\n\nexport interface ClientOpts extends ProxyTaskArgs.t {\n\tcommand: string;\n}\n\nexport interface TypeCheckOpts extends ProxyTaskArgs.t {\n\tsourceFile: string;\n}\n\nexport interface TypeCheckAllOpts extends ProxyTaskArgs.t {\n}\n\nexport interface SimulateOpts extends ProxyTaskArgs.t {\n\tsourceFile?: string;\n\tstorage?: string;\n\tparam?: string;\n\tentrypoint?: string;\n}\n\nexport type IntersectionOpts = ClientOpts & TypeCheckOpts & TypeCheckAllOpts & SimulateOpts;\n\ntype UnionOpts = ClientOpts | TypeCheckOpts | TypeCheckAllOpts | SimulateOpts;\n\n// Temporary change till a discussion is had with ECAD Labs\n// about https://github.com/TezosTaqueria/taqueria/actions/runs/10102868947/job/27961869044\nconst ENDPOINT = process.env['TAQ_TEZOS_CLIENT_RPC'] ?? 'https://ghostnet.smartpy.io';\nexport const GLOBAL_OPTIONS = `--endpoint ${ENDPOINT}`;\n\nexport const trimTezosClientMenuIfPresent = (msg: string): string => {\n\treturn msg.replace(/Usage:(.|\\n)+/, '');\n};\n\nexport const getInputFilename = (opts: UnionOpts, sourceFile: string) =>\n\tjoin('/project', opts.config.artifactsDir ?? 'artifacts', sourceFile);\n\nexport const getCheckFileExistenceCommand = async (parsedArgs: UnionOpts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = getArchSync();\n\tconst baseCmd =\n\t\t`docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${getClientDockerImage()} ls`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} ${inputFile}`;\n\treturn cmd;\n};\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tgetContractContent,\n\tgetParameter,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport { basename, extname } from 'path';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\tSimulateOpts as Opts,\n\ttrimTezosClientMenuIfPresent,\n} from './common';\n\ntype TableRow = { contract: string; result: string };\n\n// This is needed mostly due to the fact that execCmd() wraps the command in double quotes\nconst preprocessString = (value: string): string => {\n\t// 1. if the string contains escaped double quotes, escape them further\n\tvalue = value.replace(/\\\\\"/g, '\\\\\\\\\\\\\"');\n\t// 2. if the string contains unescaped double quotes, escape them\n\tvalue = value.replace(/(?<!\\\\)\"/g, '\\\\\"');\n\treturn value;\n};\n\nconst getDefaultStorageFilename = (contractName: string): string => {\n\tconst baseFilename = basename(contractName, extname(contractName));\n\tconst extFilename = extname(contractName);\n\tconst defaultStorage = `${baseFilename}.default_storage${extFilename}`;\n\treturn defaultStorage;\n};\n\nconst getSimulateCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\n\tconst storageFilename = parsedArgs.storage ?? getDefaultStorageFilename(sourceFile);\n\tconst storage = (await getContractContent(parsedArgs, storageFilename))?.trim();\n\n\tif (storage === undefined) {\n\t\treturn Promise.reject(\n\t\t\tnew Error(\n\t\t\t\t`❌ No initial storage file was found for ${sourceFile}\\nStorage must be specified in a file as a Michelson expression and will automatically be linked to this contract if specified with the name \"${\n\t\t\t\t\tgetDefaultStorageFilename(sourceFile)\n\t\t\t\t}\" in the artifacts directory\\nYou can also manually pass a storage file to the simulate task using the --storage STORAGE_FILE_NAME option\\n`,\n\t\t\t),\n\t\t);\n\t}\n\n\tconst paramFilename = parsedArgs.param!;\n\tconst param = (await getParameter(parsedArgs, paramFilename)).trim();\n\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst entrypoint = parsedArgs.entrypoint ? `--entrypoint ${parsedArgs.entrypoint}` : '';\n\n\tconst cmd =\n\t\t`${baseCmd} octez-client ${GLOBAL_OPTIONS} run script ${inputFile} on storage \\'${storage}\\' and input \\'${param}\\' ${entrypoint}`;\n\treturn cmd;\n};\n\nconst simulateContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tretrySimulateCmd(parsedArgs, sourceFile, 0)\n\t\t\t\t.then(({ stdout, stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(`\\n${stderr}`);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: stdout,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst retrySimulateCmd = (\n\tparsedArgs: Opts,\n\tsourceFile: string,\n\tretryCount: number,\n): Promise<{ stdout: string; stderr: string }> => {\n\tconst max_retries = 3;\n\tconst relay_delay_ms = 1000;\n\treturn getSimulateCmd(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.catch(err => {\n\t\t\tif (retryCount < max_retries && err.stderr.includes('503 Service Temporarily')) {\n\t\t\t\tconst delay = relay_delay_ms * Math.pow(2, retryCount);\n\t\t\t\treturn new Promise(resolve => setTimeout(resolve, delay))\n\t\t\t\t\t.then(() => retrySimulateCmd(parsedArgs, sourceFile, retryCount + 1));\n\t\t\t} else {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t});\n};\n\nconst simulate = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile!);\n\treturn simulateContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default simulate;\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\ttrimTezosClientMenuIfPresent,\n\tTypeCheckOpts as Opts,\n} from './common';\n\nexport type TableRow = { contract: string; result: string };\n\nconst getTypecheckCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} octez-client ${GLOBAL_OPTIONS} typecheck script ${inputFile}`;\n\treturn cmd;\n};\n\nexport const typecheckContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tgetTypecheckCmd(parsedArgs, sourceFile)\n\t\t\t\t.then(execCmd)\n\t\t\t\t.then(({ stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(stderr);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Valid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst typecheck = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile);\n\treturn typecheckContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default typecheck;\n","import { getArtifactsDir, isContractFile, sendAsyncErr, sendJsonRes } from '@taqueria/node-sdk';\nimport glob from 'fast-glob';\nimport { join } from 'path';\nimport { TypeCheckAllOpts as Opts, TypeCheckOpts } from './common';\nimport { TableRow, typecheckContract } from './typecheck';\n\nconst compileAll = async (parsedArgs: Opts): Promise<void> => {\n\tlet p: Promise<TableRow>[] = [];\n\n\tconst contractFilenames = await glob(\n\t\t['**/*.tz'],\n\t\t{ cwd: join(parsedArgs.config.projectDir, getArtifactsDir(parsedArgs)), absolute: false },\n\t);\n\n\tfor (const filename of contractFilenames) {\n\t\tif (isContractFile(filename)) p.push(typecheckContract(parsedArgs as TypeCheckOpts, filename));\n\t}\n\n\treturn Promise.all(p).then(sendJsonRes).catch(err => sendAsyncErr(err, false));\n};\n\nexport default compileAll;\n"],"mappings":";AAAA,SAAS,QAAQ,QAAQ,eAAe,YAAY;;;ACApD,SAAsB,gBAAAA,eAAc,oBAAoB;;;ACAxD,SAAS,SAAS,cAAc,SAAS,gBAAgB;;;ACAzD,SAAS,aAAa,sBAAkD;AACxE,SAAS,YAAY;AAGrB,IAAM,mBAAmB,CAAC,UAAoD;AAE9E,IAAM,6BAA6B;AAE5B,IAAM,uBAAuB,MACnC,eAAe,iBAAiB,YAAY,CAAC,GAAG,0BAA0B;AA0B3E,IAAM,WAAW,QAAQ,IAAI,sBAAsB,KAAK;AACjD,IAAM,iBAAiB,cAAc,QAAQ;AAE7C,IAAM,+BAA+B,CAAC,QAAwB;AACpE,SAAO,IAAI,QAAQ,iBAAiB,EAAE;AACvC;AAEO,IAAM,mBAAmB,CAAC,MAAiB,eACjD,KAAK,YAAY,KAAK,OAAO,gBAAgB,aAAa,UAAU;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,OAAO,OAAO;AAAA,UACb,MAAM;AAAA,UACN,aACC;AAAA,UACD,UAAU;AAAA,QACX,CAAC;AAAA,MACF;AAAA,MACA,SAAS;AAAA,MACT,aAAa;AAAA,QACZ,cAAc,OAAO;AAAA,UACpB,aAAa;AAAA,UACb,aAAa;AAAA,QACd,CAAC;AAAA,MACF;AAAA,MACA,UAAU;AAAA,IACX,CAAC;AAAA,IACD,KAAK,OAAO;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,MACT,QAAQ;AAAA,IACT,CAAC;AAAA,EACF;AAAA,EACA,OAAO;AACR,IAAI,QAAQ,IAAI;","names":["sendAsyncErr","cmd","getArch","sendAsyncErr","getArch","sendAsyncErr","addTzExtensionIfMissing","execCmd","getArch","sendAsyncErr","sendErr","sendJsonRes","sendWarn","getArch","execCmd","sendWarn","sendErr","addTzExtensionIfMissing","sendJsonRes","sendAsyncErr","sendAsyncErr","sendJsonRes","join","join","sendJsonRes","sendAsyncErr","sendAsyncErr"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taqueria/plugin-octez-client",
3
- "version": "0.56.8",
3
+ "version": "0.56.10",
4
4
  "description": "A taqueria plugin for utilizing octez-client",
5
5
  "targets": {
6
6
  "default": {
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "homepage": "https://github.com/tezostaqueria/taqueria#readme",
43
43
  "dependencies": {
44
- "@taqueria/node-sdk": "^0.56.8",
44
+ "@taqueria/node-sdk": "^0.56.10",
45
45
  "fast-glob": "^3.3.2"
46
46
  },
47
47
  "devDependencies": {
package/typecheck.ts CHANGED
@@ -26,7 +26,6 @@ const getTypecheckCmd = async (parsedArgs: Opts, sourceFile: string): Promise<st
26
26
  const baseCmd = `docker run --rm -v \"${projectDir}\":/project -w /project --platform ${arch} ${flextesaImage}`;
27
27
  const inputFile = getInputFilename(parsedArgs, sourceFile);
28
28
  const cmd = `${baseCmd} octez-client ${GLOBAL_OPTIONS} typecheck script ${inputFile}`;
29
- console.error(cmd);
30
29
  return cmd;
31
30
  };
32
31