@digicatapult/sqnc-process-management 3.0.57 → 3.0.61

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/build/index.js CHANGED
@@ -22,8 +22,7 @@ const mapOptions = (options)=>({
22
22
  });
23
23
  // TODO nice to have, a local config file for substrate host details e.g. name, port, address
24
24
  // so no need to parse every time calling a command, or ability to set
25
- program.name('process management').description('a command line interface for managing chain processes').version(cliVersion, '-v, --version', 'output current version').helpOption('--help', 'display help for command') //override -h
26
- ;
25
+ program.name('process management').description('a command line interface for managing chain processes').version(cliVersion, '-v, --version', 'output current version').helpOption('--help', 'display help for command'); //override -h
27
26
  program.command('list').description('A command for listing all active process flows').option('-v, --verbose', 'Returns all information about the transation, default - false').option('-h, --host <host>', 'substrate blockchain host address or FQDM, default - "localhost"', 'localhost').option('-p, --port <port>', 'specify host port number if it is not a default, default - 9944', '9944').option('--raw', 'print processes with hex values and extra keys such as "createdAtHash"').option('--active', 'returns only active process flows').option('--disabled', 'returns only disabled process flows').action(async (options)=>{
28
27
  if (options.print) log(`
29
28
  retrieving all process flows from a chain...
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env -S node --no-warnings\n\nimport fs from 'fs/promises'\n\nimport chalk from 'chalk'\nimport { Command } from 'commander'\n\nimport { loadProcesses, disableProcess, listTransforming } from './lib/process/index.js'\nimport { getAll } from './lib/process/api.js'\nimport cliVersion from './version.js'\n\nconst unwrap = <T, E>(res: Process.Result<T, E>): T => {\n if (res.type === 'ok') return res.result\n else throw res.error\n}\n\nconst { log, dir } = console\nconst program = new Command()\nconst { red: r, blue: b } = {\n red: (txt: string) => chalk.redBright(txt),\n blue: (txt: string) => chalk.blueBright(txt),\n}\n\nconst mapOptions = (options: Process.CLIOptions): Polkadot.Options => ({\n API_HOST: options.host,\n API_PORT: parseInt(options.port),\n USER_URI: options.user,\n})\n\n// TODO nice to have, a local config file for substrate host details e.g. name, port, address\n// so no need to parse every time calling a command, or ability to set\nprogram\n .name('process management')\n .description('a command line interface for managing chain processes')\n .version(cliVersion, '-v, --version', 'output current version')\n .helpOption('--help', 'display help for command') //override -h\n\nprogram\n .command('list')\n .description('A command for listing all active process flows')\n .option('-v, --verbose', 'Returns all information about the transation, default - false')\n .option('-h, --host <host>', 'substrate blockchain host address or FQDM, default - \"localhost\"', 'localhost')\n .option('-p, --port <port>', 'specify host port number if it is not a default, default - 9944', '9944')\n .option('--raw', 'print processes with hex values and extra keys such as \"createdAtHash\"')\n .option('--active', 'returns only active process flows')\n .option('--disabled', 'returns only disabled process flows')\n .action(async (options: Process.CLIOptions) => {\n if (options.print)\n log(`\n retrieving all process flows from a chain...\n options: ${b(JSON.stringify(options))}\n `)\n try {\n const res: Process.RawPayload[] = await getAll(mapOptions(options))\n\n const transformed = listTransforming(res, options)\n dir(transformed, { depth: null })\n\n process.exit(0)\n } catch (err) {\n log(err)\n process.exit(1)\n }\n })\n\nprogram\n .command('create')\n .description('A command for persisting process flows onto the chain')\n .option('--dryRun', 'to validate process and response locally before persisting on the chain, default - false')\n .option('--verbose', 'Returns all information about the transation, default - false')\n .option('-h, --host <host>', 'substrate blockchain host address or FQDM, default - \"localhost\"', 'localhost')\n .option('-p, --port <port>', 'specify host port number if it is not a default, default - 9944', '9944')\n .requiredOption('-f, --file <file>', 'path to file containing process flows to loads')\n .requiredOption('-u, --user <user>', 'specify substrate blockchain user URI')\n .action(async (options: Process.CLIOptions) => {\n if (options.print)\n log(`\n attempting to create a process...\n options: ${b(JSON.stringify(options))}\n `)\n const { dryRun, verbose } = options\n try {\n const data = (await fs.readFile(options.file)).toString('utf8')\n const loadResult = await loadProcesses({ data, dryRun, options: mapOptions(options), verbose })\n dir(loadResult.message, { depth: null })\n dir(unwrap(loadResult), { depth: null })\n process.exit(0)\n } catch (err) {\n log(err)\n process.exit(1)\n }\n })\n\nprogram\n .command('disable')\n .description('A command for disabling an existing process flows. Required process ID and version')\n .option('--dryRun', 'to validate process and response locally before persisting on the chain, default - false')\n .option('-h, --host <host>', 'substrate blockchain host address or FQDM, default - \"localhost\"', 'localhost')\n .option('-p, --port <port>', 'specify host port number if it is not a default, default - 9944', '9944')\n .requiredOption('-u, --user <user>', 'specify substrate blockchain user URI')\n .argument('<id>', 'a valid process id that you would like to disable')\n .argument('<version>', 'a version number of a process')\n .action(async (id: string, version: string, options: Process.CLIOptions) => {\n if (options.print) log(`attempting to disable:\\nID:${b(id)}\\nVersion:${b(version)}`)\n try {\n const { dryRun } = options\n const res = unwrap(await disableProcess(id, parseInt(version), dryRun, mapOptions(options)))\n dir(res, { depth: null })\n\n process.exit(0)\n } catch (err) {\n log(err)\n process.exit(1)\n }\n })\n\nprogram.parse()\nif (!program.option) {\n program.help()\n}\n\nprogram.on('command:*', function () {\n log(`\n ${r('Invalid command: %s\\nSee --help for a list of available commands.')}\n ${program.args.join(' ')}`)\n process.exit(127)\n})\n"],"names":["fs","chalk","Command","loadProcesses","disableProcess","listTransforming","getAll","cliVersion","unwrap","res","type","result","error","log","dir","console","program","red","r","blue","b","txt","redBright","blueBright","mapOptions","options","API_HOST","host","API_PORT","parseInt","port","USER_URI","user","name","description","version","helpOption","command","option","action","print","JSON","stringify","transformed","depth","process","exit","err","requiredOption","dryRun","verbose","data","readFile","file","toString","loadResult","message","argument","id","parse","help","on","args","join"],"mappings":";AAEA,OAAOA,QAAQ,cAAa;AAE5B,OAAOC,WAAW,QAAO;AACzB,SAASC,OAAO,QAAQ,YAAW;AAEnC,SAASC,aAAa,EAAEC,cAAc,EAAEC,gBAAgB,QAAQ,yBAAwB;AACxF,SAASC,MAAM,QAAQ,uBAAsB;AAC7C,OAAOC,gBAAgB,eAAc;AAErC,MAAMC,SAAS,CAAOC;IACpB,IAAIA,IAAIC,IAAI,KAAK,MAAM,OAAOD,IAAIE,MAAM;SACnC,MAAMF,IAAIG,KAAK;AACtB;AAEA,MAAM,EAAEC,GAAG,EAAEC,GAAG,EAAE,GAAGC;AACrB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AO;QAAK;QAEvBC,QAAQC,IAAI,CAAC;IACf,EAAE,OAAOC,KAAK;QACZlC,IAAIkC;QACJF,QAAQC,IAAI,CAAC;IACf;AACF;AAEF9B,QAAQ2C,KAAK;AACb,IAAI,CAAC3C,QAAQsB,MAAM,EAAE;IACnBtB,QAAQ4C,IAAI;AACd;AAEA5C,QAAQ6C,EAAE,CAAC,aAAa;IACtBhD,IAAI,CAAC;IACH,EAAEK,EAAE,qEAAqE;IACzE,EAAEF,QAAQ8C,IAAI,CAACC,IAAI,CAAC,MAAM;IAC5BlB,QAAQC,IAAI,CAAC;AACf"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env -S node --no-warnings\n\nimport fs from 'fs/promises'\n\nimport chalk from 'chalk'\nimport { Command } from 'commander'\n\nimport { loadProcesses, disableProcess, listTransforming } from './lib/process/index.js'\nimport { getAll } from './lib/process/api.js'\nimport cliVersion from './version.js'\n\nconst unwrap = <T, E>(res: Process.Result<T, E>): T => {\n if (res.type === 'ok') return res.result\n else throw res.error\n}\n\nconst { log, dir } = console\nconst program = new Command()\nconst { red: r, blue: b } = {\n red: (txt: string) => chalk.redBright(txt),\n blue: (txt: string) => chalk.blueBright(txt),\n}\n\nconst mapOptions = (options: Process.CLIOptions): Polkadot.Options => ({\n API_HOST: options.host,\n API_PORT: parseInt(options.port),\n USER_URI: options.user,\n})\n\n// TODO nice to have, a local config file for substrate host details e.g. name, port, address\n// so no need to parse every time calling a command, or ability to set\nprogram\n .name('process management')\n .description('a command line interface for managing chain processes')\n .version(cliVersion, '-v, --version', 'output current version')\n .helpOption('--help', 'display help for command') //override -h\n\nprogram\n .command('list')\n .description('A command for listing all active process flows')\n .option('-v, --verbose', 'Returns all information about the transation, default - false')\n .option('-h, --host <host>', 'substrate blockchain host address or FQDM, default - \"localhost\"', 'localhost')\n .option('-p, --port <port>', 'specify host port number if it is not a default, default - 9944', '9944')\n .option('--raw', 'print processes with hex values and extra keys such as \"createdAtHash\"')\n .option('--active', 'returns only active process flows')\n .option('--disabled', 'returns only disabled process flows')\n .action(async (options: Process.CLIOptions) => {\n if (options.print)\n log(`\n retrieving all process flows from a chain...\n options: ${b(JSON.stringify(options))}\n `)\n try {\n const res: Process.RawPayload[] = await getAll(mapOptions(options))\n\n const transformed = listTransforming(res, options)\n dir(transformed, { depth: null })\n\n process.exit(0)\n } catch (err) {\n log(err)\n process.exit(1)\n }\n })\n\nprogram\n .command('create')\n .description('A command for persisting process flows onto the chain')\n .option('--dryRun', 'to validate process and response locally before persisting on the chain, default - false')\n .option('--verbose', 'Returns all information about the transation, default - false')\n .option('-h, --host <host>', 'substrate blockchain host address or FQDM, default - \"localhost\"', 'localhost')\n .option('-p, --port <port>', 'specify host port number if it is not a default, default - 9944', '9944')\n .requiredOption('-f, --file <file>', 'path to file containing process flows to loads')\n .requiredOption('-u, --user <user>', 'specify substrate blockchain user URI')\n .action(async (options: Process.CLIOptions) => {\n if (options.print)\n log(`\n attempting to create a process...\n options: ${b(JSON.stringify(options))}\n `)\n const { dryRun, verbose } = options\n try {\n const data = (await fs.readFile(options.file)).toString('utf8')\n const loadResult = await loadProcesses({ data, dryRun, options: mapOptions(options), verbose })\n dir(loadResult.message, { depth: null })\n dir(unwrap(loadResult), { depth: null })\n process.exit(0)\n } catch (err) {\n log(err)\n process.exit(1)\n }\n })\n\nprogram\n .command('disable')\n .description('A command for disabling an existing process flows. Required process ID and version')\n .option('--dryRun', 'to validate process and response locally before persisting on the chain, default - false')\n .option('-h, --host <host>', 'substrate blockchain host address or FQDM, default - \"localhost\"', 'localhost')\n .option('-p, --port <port>', 'specify host port number if it is not a default, default - 9944', '9944')\n .requiredOption('-u, --user <user>', 'specify substrate blockchain user URI')\n .argument('<id>', 'a valid process id that you would like to disable')\n .argument('<version>', 'a version number of a process')\n .action(async (id: string, version: string, options: Process.CLIOptions) => {\n if (options.print) log(`attempting to disable:\\nID:${b(id)}\\nVersion:${b(version)}`)\n try {\n const { dryRun } = options\n const res = unwrap(await disableProcess(id, parseInt(version), dryRun, mapOptions(options)))\n dir(res, { depth: null })\n\n process.exit(0)\n } catch (err) {\n log(err)\n process.exit(1)\n }\n })\n\nprogram.parse()\nif (!program.option) {\n program.help()\n}\n\nprogram.on('command:*', function () {\n log(`\n ${r('Invalid command: %s\\nSee --help for a list of available commands.')}\n ${program.args.join(' ')}`)\n process.exit(127)\n})\n"],"names":["fs","chalk","Command","loadProcesses","disableProcess","listTransforming","getAll","cliVersion","unwrap","res","type","result","error","log","dir","console","program","red","r","blue","b","txt","redBright","blueBright","mapOptions","options","API_HOST","host","API_PORT","parseInt","port","USER_URI","user","name","description","version","helpOption","command","option","action","print","JSON","stringify","transformed","depth","process","exit","err","requiredOption","dryRun","verbose","data","readFile","file","toString","loadResult","message","argument","id","parse","help","on","args","join"],"mappings":";AAEA,OAAOA,QAAQ,cAAa;AAE5B,OAAOC,WAAW,QAAO;AACzB,SAASC,OAAO,QAAQ,YAAW;AAEnC,SAASC,aAAa,EAAEC,cAAc,EAAEC,gBAAgB,QAAQ,yBAAwB;AACxF,SAASC,MAAM,QAAQ,uBAAsB;AAC7C,OAAOC,gBAAgB,eAAc;AAErC,MAAMC,SAAS,CAAOC;IACpB,IAAIA,IAAIC,IAAI,KAAK,MAAM,OAAOD,IAAIE,MAAM;SACnC,MAAMF,IAAIG,KAAK;AACtB;AAEA,MAAM,EAAEC,GAAG,EAAEC,GAAG,EAAE,GAAGC;AACrB,MAAMC,UAAU,IAAId;AACpB,MAAM,EAAEe,KAAKC,CAAC,EAAEC,MAAMC,CAAC,EAAE,GAAG;IAC1BH,KAAK,CAACI,MAAgBpB,MAAMqB,SAAS,CAACD;IACtCF,MAAM,CAACE,MAAgBpB,MAAMsB,UAAU,CAACF;AAC1C;AAEA,MAAMG,aAAa,CAACC,UAAmD,CAAA;QACrEC,UAAUD,QAAQE,IAAI;QACtBC,UAAUC,SAASJ,QAAQK,IAAI;QAC/BC,UAAUN,QAAQO,IAAI;IACxB,CAAA;AAEA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IAC5BlB,QAAQC,IAAI,CAAC;AACf"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/types/error.ts"],"sourcesContent":["export class DisableError extends Error {\n constructor(m: string) {\n super(m)\n Object.setPrototypeOf(this, DisableError.prototype)\n }\n}\n\nexport class VersionError extends Error {\n constructor(version: number, expected: number, name: string) {\n super(\n `Process version ${version} is invalid. If you are trying to create a new version of process ${name} version should be ${expected}`\n )\n Object.setPrototypeOf(this, VersionError.prototype)\n }\n}\n\nexport class CliInputParseError extends Error {\n constructor(public baseError: Error) {\n super(`Error parsing input: ${baseError.message}`)\n Object.setPrototypeOf(this, CliInputParseError.prototype)\n }\n}\n\nexport class ProgramError extends Error {\n process?: Process.Payload\n constructor(m: string, process?: Process.Payload) {\n super(m)\n this.process = process\n Object.setPrototypeOf(this, ProgramError.prototype)\n }\n}\n"],"names":["DisableError","Error","constructor","m","Object","setPrototypeOf","prototype","VersionError","version","expected","name","CliInputParseError","baseError","message","ProgramError","process"],"mappings":"AAAA,OAAO,MAAMA,qBAAqBC;IAChCC,YAAYC,CAAS,CAAE;QACrB,KAAK,CAACA;QACNC,OAAOC,cAAc,CAAC,IAAI,EAAEL,aAAaM,SAAS;IACpD;AACF;AAEA,OAAO,MAAMC,qBAAqBN;IAChCC,YAAYM,OAAe,EAAEC,QAAgB,EAAEC,IAAY,CAAE;QAC3D,KAAK,CACH,CAAC,gBAAgB,EAAEF,QAAQ,kEAAkE,EAAEE,KAAK,mBAAmB,EAAED,UAAU;QAErIL,OAAOC,cAAc,CAAC,IAAI,EAAEE,aAAaD,SAAS;IACpD;AACF;AAEA,OAAO,MAAMK,2BAA2BV;;IACtCC,YAAY,AAAOU,SAAgB,CAAE;QACnC,KAAK,CAAC,CAAC,qBAAqB,EAAEA,UAAUC,OAAO,EAAE,QADhCD,YAAAA;QAEjBR,OAAOC,cAAc,CAAC,IAAI,EAAEM,mBAAmBL,SAAS;IAC1D;AACF;AAEA,OAAO,MAAMQ,qBAAqBb;IAChCc,QAAyB;IACzBb,YAAYC,CAAS,EAAEY,OAAyB,CAAE;QAChD,KAAK,CAACZ;QACN,IAAI,CAACY,OAAO,GAAGA;QACfX,OAAOC,cAAc,CAAC,IAAI,EAAES,aAAaR,SAAS;IACpD;AACF"}
1
+ {"version":3,"sources":["../../../src/lib/types/error.ts"],"sourcesContent":["export class DisableError extends Error {\n constructor(m: string) {\n super(m)\n Object.setPrototypeOf(this, DisableError.prototype)\n }\n}\n\nexport class VersionError extends Error {\n constructor(version: number, expected: number, name: string) {\n super(\n `Process version ${version} is invalid. If you are trying to create a new version of process ${name} version should be ${expected}`\n )\n Object.setPrototypeOf(this, VersionError.prototype)\n }\n}\n\nexport class CliInputParseError extends Error {\n constructor(public baseError: Error) {\n super(`Error parsing input: ${baseError.message}`)\n Object.setPrototypeOf(this, CliInputParseError.prototype)\n }\n}\n\nexport class ProgramError extends Error {\n process?: Process.Payload\n constructor(m: string, process?: Process.Payload) {\n super(m)\n this.process = process\n Object.setPrototypeOf(this, ProgramError.prototype)\n }\n}\n"],"names":["DisableError","Error","m","Object","setPrototypeOf","prototype","VersionError","version","expected","name","CliInputParseError","baseError","message","ProgramError","process"],"mappings":"AAAA,OAAO,MAAMA,qBAAqBC;IAChC,YAAYC,CAAS,CAAE;QACrB,KAAK,CAACA;QACNC,OAAOC,cAAc,CAAC,IAAI,EAAEJ,aAAaK,SAAS;IACpD;AACF;AAEA,OAAO,MAAMC,qBAAqBL;IAChC,YAAYM,OAAe,EAAEC,QAAgB,EAAEC,IAAY,CAAE;QAC3D,KAAK,CACH,CAAC,gBAAgB,EAAEF,QAAQ,kEAAkE,EAAEE,KAAK,mBAAmB,EAAED,UAAU;QAErIL,OAAOC,cAAc,CAAC,IAAI,EAAEE,aAAaD,SAAS;IACpD;AACF;AAEA,OAAO,MAAMK,2BAA2BT;;IACtC,YAAY,AAAOU,SAAgB,CAAE;QACnC,KAAK,CAAC,CAAC,qBAAqB,EAAEA,UAAUC,OAAO,EAAE,QADhCD,YAAAA;QAEjBR,OAAOC,cAAc,CAAC,IAAI,EAAEM,mBAAmBL,SAAS;IAC1D;AACF;AAEA,OAAO,MAAMQ,qBAAqBZ;IAChCa,QAAyB;IACzB,YAAYZ,CAAS,EAAEY,OAAyB,CAAE;QAChD,KAAK,CAACZ;QACN,IAAI,CAACY,OAAO,GAAGA;QACfX,OAAOC,cAAc,CAAC,IAAI,EAAES,aAAaR,SAAS;IACpD;AACF"}
@@ -4,8 +4,7 @@ export const createNodeApi = async (options)=>{
4
4
  const api = new ApiPromise({
5
5
  provider
6
6
  });
7
- api.isReadyOrError.catch(()=>{}) // prevent unhandled promise rejection errors
8
- ;
7
+ api.isReadyOrError.catch(()=>{}); // prevent unhandled promise rejection errors
9
8
  await api.isReady;
10
9
  api.on('error', (err)=>{
11
10
  const msg = err.message || JSON.stringify(err);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/utils/polkadot.ts"],"sourcesContent":["import { ApiPromise, WsProvider, Keyring } from '@polkadot/api'\n\nexport const createNodeApi = async (options: Polkadot.Options) => {\n const provider = new WsProvider(`ws://${options.API_HOST}:${options.API_PORT}`)\n const api = new ApiPromise({ provider })\n\n api.isReadyOrError.catch(() => {}) // prevent unhandled promise rejection errors\n\n await api.isReady\n\n api.on('error', (err: { message?: string }): string => {\n const msg = err.message || JSON.stringify(err)\n console.log(`Error from substrate node connection. Error was ${msg}`)\n\n return msg\n })\n\n return {\n api,\n keyring: new Keyring({ type: 'sr25519' }),\n [Symbol.asyncDispose]: async () => {\n await api.disconnect()\n },\n }\n}\n"],"names":["ApiPromise","WsProvider","Keyring","createNodeApi","options","provider","API_HOST","API_PORT","api","isReadyOrError","catch","isReady","on","err","msg","message","JSON","stringify","console","log","keyring","type","Symbol","asyncDispose","disconnect"],"mappings":"AAAA,SAASA,UAAU,EAAEC,UAAU,EAAEC,OAAO,QAAQ,gBAAe;AAE/D,OAAO,MAAMC,gBAAgB,OAAOC;IAClC,MAAMC,WAAW,IAAIJ,WAAW,CAAC,KAAK,EAAEG,QAAQE,QAAQ,CAAC,CAAC,EAAEF,QAAQG,QAAQ,EAAE;IAC9E,MAAMC,MAAM,IAAIR,WAAW;QAAEK;IAAS;IAEtCG,IAAIC,cAAc,CAACC,KAAK,CAAC,KAAO,GAAG,6CAA6C;;IAEhF,MAAMF,IAAIG,OAAO;IAEjBH,IAAII,EAAE,CAAC,SAAS,CAACC;QACf,MAAMC,MAAMD,IAAIE,OAAO,IAAIC,KAAKC,SAAS,CAACJ;QAC1CK,QAAQC,GAAG,CAAC,CAAC,gDAAgD,EAAEL,KAAK;QAEpE,OAAOA;IACT;IAEA,OAAO;QACLN;QACAY,SAAS,IAAIlB,QAAQ;YAAEmB,MAAM;QAAU;QACvC,CAACC,OAAOC,YAAY,CAAC,EAAE;YACrB,MAAMf,IAAIgB,UAAU;QACtB;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/lib/utils/polkadot.ts"],"sourcesContent":["import { ApiPromise, WsProvider, Keyring } from '@polkadot/api'\n\nexport const createNodeApi = async (options: Polkadot.Options) => {\n const provider = new WsProvider(`ws://${options.API_HOST}:${options.API_PORT}`)\n const api = new ApiPromise({ provider })\n\n api.isReadyOrError.catch(() => {}) // prevent unhandled promise rejection errors\n\n await api.isReady\n\n api.on('error', (err: { message?: string }): string => {\n const msg = err.message || JSON.stringify(err)\n console.log(`Error from substrate node connection. Error was ${msg}`)\n\n return msg\n })\n\n return {\n api,\n keyring: new Keyring({ type: 'sr25519' }),\n [Symbol.asyncDispose]: async () => {\n await api.disconnect()\n },\n }\n}\n"],"names":["ApiPromise","WsProvider","Keyring","createNodeApi","options","provider","API_HOST","API_PORT","api","isReadyOrError","catch","isReady","on","err","msg","message","JSON","stringify","console","log","keyring","type","Symbol","asyncDispose","disconnect"],"mappings":"AAAA,SAASA,UAAU,EAAEC,UAAU,EAAEC,OAAO,QAAQ,gBAAe;AAE/D,OAAO,MAAMC,gBAAgB,OAAOC;IAClC,MAAMC,WAAW,IAAIJ,WAAW,CAAC,KAAK,EAAEG,QAAQE,QAAQ,CAAC,CAAC,EAAEF,QAAQG,QAAQ,EAAE;IAC9E,MAAMC,MAAM,IAAIR,WAAW;QAAEK;IAAS;IAEtCG,IAAIC,cAAc,CAACC,KAAK,CAAC,KAAO,IAAG,6CAA6C;IAEhF,MAAMF,IAAIG,OAAO;IAEjBH,IAAII,EAAE,CAAC,SAAS,CAACC;QACf,MAAMC,MAAMD,IAAIE,OAAO,IAAIC,KAAKC,SAAS,CAACJ;QAC1CK,QAAQC,GAAG,CAAC,CAAC,gDAAgD,EAAEL,KAAK;QAEpE,OAAOA;IACT;IAEA,OAAO;QACLN;QACAY,SAAS,IAAIlB,QAAQ;YAAEmB,MAAM;QAAU;QACvC,CAACC,OAAOC,YAAY,CAAC,EAAE;YACrB,MAAMf,IAAIgB,UAAU;QACtB;IACF;AACF,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digicatapult/sqnc-process-management",
3
- "version": "3.0.57",
3
+ "version": "3.0.61",
4
4
  "description": "SQNC Process Management Flow",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -37,32 +37,32 @@
37
37
  },
38
38
  "homepage": "https://github.com/digicatapult/sqnc-process-management#readme",
39
39
  "devDependencies": {
40
- "@eslint/eslintrc": "^3.3.1",
41
- "@eslint/js": "^9.27.0",
42
- "@swc-node/register": "^1.10.10",
43
- "@swc/cli": "^0.7.7",
44
- "@swc/core": "^1.11.22",
40
+ "@eslint/eslintrc": "^3.3.3",
41
+ "@eslint/js": "^9.39.2",
42
+ "@swc-node/register": "^1.11.1",
43
+ "@swc/cli": "^0.7.9",
44
+ "@swc/core": "^1.15.5",
45
45
  "@swc/helpers": "^0.5.17",
46
- "@types/chai": "^5.2.2",
46
+ "@types/chai": "^5.2.3",
47
47
  "@types/mocha": "^10.0.10",
48
- "@types/node": "^18.19.100",
49
- "@typescript-eslint/eslint-plugin": "^8.32.1",
50
- "@typescript-eslint/parser": "^8.32.1",
51
- "chai": "^5.2.0",
48
+ "@types/node": "^18.19.130",
49
+ "@typescript-eslint/eslint-plugin": "^8.50.0",
50
+ "@typescript-eslint/parser": "^8.50.0",
51
+ "chai": "^5.3.3",
52
52
  "depcheck": "^1.4.7",
53
- "eslint": "^9.27.0",
54
- "eslint-config-prettier": "^10.1.5",
55
- "eslint-plugin-prettier": "^5.4.0",
56
- "mocha": "^11.3.0",
57
- "nodemon": "^3.1.10",
58
- "prettier": "^3.5.3",
53
+ "eslint": "^9.39.2",
54
+ "eslint-config-prettier": "^10.1.8",
55
+ "eslint-plugin-prettier": "^5.5.4",
56
+ "mocha": "^11.7.5",
57
+ "nodemon": "^3.1.11",
58
+ "prettier": "^3.7.4",
59
59
  "reflect-metadata": "^0.2.2",
60
- "testcontainers": "^10.26.0"
60
+ "testcontainers": "^11.10.0"
61
61
  },
62
62
  "dependencies": {
63
- "@polkadot/api": "^15.10.2",
64
- "chalk": "^5.4.1",
65
- "commander": "^14.0.0",
66
- "zod": "^3.24.4"
63
+ "@polkadot/api": "^16.5.4",
64
+ "chalk": "^5.6.2",
65
+ "commander": "^14.0.2",
66
+ "zod": "^4.2.1"
67
67
  }
68
68
  }