@platforma-sdk/bootstrap 5.2.31 → 5.2.33

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.
Files changed (63) hide show
  1. package/dist/block.cjs +1 -1
  2. package/dist/block.cjs.map +1 -1
  3. package/dist/block.d.ts.map +1 -1
  4. package/dist/block.js +1 -1
  5. package/dist/block.js.map +1 -1
  6. package/dist/cmd-opts.d.ts +36 -36
  7. package/dist/commands/create-block.cjs +2 -2
  8. package/dist/commands/create-block.cjs.map +1 -1
  9. package/dist/commands/create-block.d.ts +1 -1
  10. package/dist/commands/create-block.d.ts.map +1 -1
  11. package/dist/commands/create-block.js +2 -2
  12. package/dist/commands/create-block.js.map +1 -1
  13. package/dist/commands/reset.cjs +1 -1
  14. package/dist/commands/reset.cjs.map +1 -1
  15. package/dist/commands/reset.d.ts +1 -1
  16. package/dist/commands/reset.d.ts.map +1 -1
  17. package/dist/commands/reset.js +1 -1
  18. package/dist/commands/reset.js.map +1 -1
  19. package/dist/commands/start/docker/s3.d.ts +21 -21
  20. package/dist/commands/start/docker.d.ts +21 -21
  21. package/dist/commands/start/local/s3.d.ts +25 -25
  22. package/dist/commands/start/local.d.ts +23 -23
  23. package/dist/commands/start.d.ts +1 -1
  24. package/dist/commands/stop.cjs +1 -1
  25. package/dist/commands/stop.cjs.map +1 -1
  26. package/dist/commands/stop.d.ts +1 -1
  27. package/dist/commands/stop.js +1 -1
  28. package/dist/commands/stop.js.map +1 -1
  29. package/dist/commands/svc/create/arg-parser.cjs +2 -2
  30. package/dist/commands/svc/create/arg-parser.cjs.map +1 -1
  31. package/dist/commands/svc/create/arg-parser.js +2 -2
  32. package/dist/commands/svc/create/arg-parser.js.map +1 -1
  33. package/dist/commands/svc/create/docker/s3.cjs.map +1 -1
  34. package/dist/commands/svc/create/docker/s3.d.ts +22 -22
  35. package/dist/commands/svc/create/docker/s3.js.map +1 -1
  36. package/dist/commands/svc/create/docker.cjs.map +1 -1
  37. package/dist/commands/svc/create/docker.d.ts +22 -22
  38. package/dist/commands/svc/create/docker.js.map +1 -1
  39. package/dist/commands/svc/create/local/s3.cjs.map +1 -1
  40. package/dist/commands/svc/create/local/s3.d.ts +26 -26
  41. package/dist/commands/svc/create/local/s3.js.map +1 -1
  42. package/dist/commands/svc/create/local.cjs.map +1 -1
  43. package/dist/commands/svc/create/local.d.ts +24 -24
  44. package/dist/commands/svc/create/local.js.map +1 -1
  45. package/dist/commands/svc/delete.d.ts +3 -3
  46. package/dist/commands/svc/down.d.ts +2 -2
  47. package/dist/commands/svc/up.d.ts +2 -2
  48. package/dist/index.cjs +0 -1
  49. package/dist/index.cjs.map +1 -1
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +0 -1
  52. package/dist/index.js.map +1 -1
  53. package/dist/package.cjs.map +1 -1
  54. package/dist/package.js.map +1 -1
  55. package/dist/templates/pl-config.cjs.map +1 -1
  56. package/dist/templates/pl-config.js.map +1 -1
  57. package/dist/util.cjs +2 -2
  58. package/dist/util.cjs.map +1 -1
  59. package/dist/util.d.ts +1 -1
  60. package/dist/util.d.ts.map +1 -1
  61. package/dist/util.js +2 -2
  62. package/dist/util.js.map +1 -1
  63. package/package.json +8 -7
package/dist/block.cjs CHANGED
@@ -91,7 +91,7 @@ function askForOptions() {
91
91
  softwarePlatforms = Array.from(new Set(softwarePlatforms)).sort();
92
92
  const result = CreateBlockOptions.safeParse({ npmOrgName, orgName, blockName, softwarePlatforms });
93
93
  if (!result.success && result.error.issues.length) {
94
- throw new Error(result.error.issues.map(i => i.message).join('; '));
94
+ throw new Error(result.error.issues.map((i) => i.message).join('; '));
95
95
  }
96
96
  return result.data;
97
97
  }
@@ -1 +1 @@
1
- {"version":3,"file":"block.cjs","sources":["../src/block.ts"],"sourcesContent":["import { createWriteStream } from 'node:fs';\nimport * as fs from 'node:fs/promises';\nimport path from 'node:path';\nimport type winston from 'winston';\nimport { Writable, Transform } from 'node:stream';\nimport os from 'node:os';\nimport readlineSync from 'readline-sync';\nimport { z } from 'zod';\nimport decompress from 'decompress';\nimport yaml from 'yaml';\n\nconst blockPlatformsToChoose = ['Python'];\nconst allPlatforms = ['Tengo', 'Python'] as const;\nconst CreateBlockPlatforms = z.union([z.literal('Tengo'), z.literal('Python')]);\nexport type CreateBlockPlatform = z.infer<typeof CreateBlockPlatforms>;\n\nconst CreateBlockOptions = z.object({\n npmOrgName: z.string().min(1),\n orgName: z.string().min(1, { message: `Organization name must be provided` }),\n blockName: z.string().min(1, { message: `Block name must be provided` }),\n softwarePlatforms: z.array(CreateBlockPlatforms).refine((p) => new Set(p).size === p.length, {\n message: 'Must be an array of unique software platforms',\n }),\n});\nexport type CreateBlockOptions = z.infer<typeof CreateBlockOptions>;\n\n/** Creates a block by cloning block-boilerplate repository. */\nexport async function createBlock(logger: winston.Logger) {\n const { npmOrgName, orgName, blockName, softwarePlatforms } = askForOptions();\n const targetPath = path.join(process.cwd(), blockName);\n\n logger.info(`Downloading boilerplate code...`);\n await downloadAndUnzip(\n // 'https://github.com/milaboratory/platforma-block-boilerplate/archive/refs/heads/software_platforms.zip',\n // 'platforma-block-boilerplate-software_platforms',\n 'https://github.com/milaboratory/platforma-block-boilerplate/archive/refs/heads/main.zip',\n 'platforma-block-boilerplate-main',\n targetPath,\n );\n\n const platformsToRemove = allPlatforms.filter((p) => softwarePlatforms.indexOf(p) < 0);\n const noPlatforms = blockPlatformsToChoose.length == platformsToRemove.length;\n logger.info(`Keep platforms '${softwarePlatforms}', remove: '${platformsToRemove}'. Will remove all platforms? ${noPlatforms}`);\n for (const p of platformsToRemove) {\n await removePlatform(targetPath, p);\n }\n if (noPlatforms) {\n await removePlatformsCompletely(targetPath);\n }\n\n logger.info(`Replace everything in the template with provided options...`);\n replaceRegexInAllFiles(targetPath, [\n // '@' literal ensures only npm org name will be renamed,\n // as public registry for software also is called platforma-open, but without '@'.\n // Also, don't rename an organization for runenv-python-3 package.\n { from: /@platforma-open(?!.*runenv-python-3)/g, to: `@${npmOrgName}` },\n\n { from: /my-org/g, to: orgName },\n\n { from: /block-boilerplate/g, to: blockName },\n ]);\n}\n\nfunction askForOptions(): CreateBlockOptions {\n let npmOrgName = readlineSync.question(\n 'Write an organization name for npm. Default is \"platforma-open\": ',\n );\n if (npmOrgName === '') {\n npmOrgName = 'platforma-open';\n }\n\n let orgName = '';\n while (orgName.length < 1)\n orgName = readlineSync.question('Write an organization name, e.g. \"my-org\": ');\n\n let blockName = '';\n while (blockName.length < 1)\n blockName = readlineSync.question('Write a name of the block, e.g. \"hello-world\": ');\n\n const needSoftware = readlineSync.keyInYN('Create package for block\\'s software?');\n let softwarePlatforms = ['Tengo'];\n if (needSoftware) {\n while (softwarePlatforms.length < allPlatforms.length) {\n const index = readlineSync.keyInSelect(blockPlatformsToChoose, 'Choose software platform:');\n if (index < 0) break;\n softwarePlatforms.push(blockPlatformsToChoose[index]);\n }\n }\n softwarePlatforms = Array.from(new Set(softwarePlatforms)).sort();\n\n const result = CreateBlockOptions.safeParse({ npmOrgName, orgName, blockName, softwarePlatforms });\n if (!result.success && result.error.issues.length) {\n throw new Error(result.error.issues.map(i => i.message).join('; '));\n }\n\n return result.data!;\n}\n\nasync function downloadAndUnzip(url: string, pathInArchive: string, outputPath: string) {\n const response = await fetch(url);\n const content = await response.blob();\n\n const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'create-repo'));\n\n const tmpFile = path.join(tmpDir, 'packed-repo.zip');\n const f = Writable.toWeb(createWriteStream(tmpFile));\n await content.stream().pipeTo(f);\n\n const tmpRepo = path.join(tmpDir, 'unpacked-repo');\n await fs.mkdir(tmpRepo);\n await decompress(tmpFile, tmpRepo);\n\n await fs.cp(path.join(tmpRepo, pathInArchive), outputPath, { recursive: true });\n}\n\n/** Removes a bunch of dependencies to the platform. */\nasync function removePlatform(dir: string, platform: CreateBlockPlatform) {\n const p = platform.toLowerCase();\n\n // Remove <PlAlert> line from MainPage.vue\n // https://regex101.com/r/oCTyHk/1\n await deleteRegexInFile(\n path.join(dir, 'ui', 'src', 'pages', 'MainPage.vue'),\n new RegExp(`.*${p}Message.*\\\\n`, 'g'),\n );\n\n // Remove an output from the model.\n await deleteRegexInFile(\n path.join(dir, 'model', 'src', 'index.ts'),\n new RegExp(`.*${p}Message.*\\\\n\\\\n`, 'g'),\n );\n\n // This regexp represents a block of code until the empty line.\n // https://regex101.com/r/Os8kX1/1\n await deleteRegexInFile(\n path.join(dir, 'workflow', 'src', 'main.tpl.tengo'),\n new RegExp(`.*${p}.*exec.builder.*[\\\\s\\\\S]*?\\\\n\\\\n`, 'g'),\n );\n\n // Remove a line from the workflow output.\n // https://regex101.com/r/PkHwQ8/1\n await deleteRegexInFile(\n path.join(dir, 'workflow', 'src', 'main.tpl.tengo'),\n new RegExp(`.*${p}Message.*\\\\n`, 'g'),\n );\n\n // Remove 2 lines: the one with the language message and the one with expect\n await deleteRegexInFile(\n path.join(dir, 'workflow', 'src', 'wf.test.ts'),\n new RegExp(`.*${p}Message.*\\\\n.*expect.*\\\\n\\\\n`, 'g'),\n );\n\n await fs.rm(path.join(dir, 'software', `src_${p}`), { recursive: true });\n\n await replaceInFile(\n path.join(dir, 'software', 'package.json'),\n (content) => {\n const json = JSON.parse(content);\n delete json['block-software']['artifacts'][`hello-${p}-artifact`];\n delete json['block-software']['entrypoints'][`hello-world-${p}`];\n return JSON.stringify(json, null, 2);\n },\n );\n}\n\n/** Removes software directory completely and all references to it from the workspace. */\nasync function removePlatformsCompletely(dir: string) {\n await fs.rm(path.join(dir, 'software'), { recursive: true });\n\n await replaceInFile(\n path.join(dir, 'workflow', 'package.json'),\n (content) => {\n const json = JSON.parse(content);\n delete json['dependencies']['@platforma-open/my-org.block-boilerplate.software'];\n return JSON.stringify(json, null, 2);\n },\n );\n\n await deleteRegexInFile(\n path.join(dir, 'pnpm-workspace.yaml'),\n /.*- software$\\n/gm,\n );\n}\n\nasync function replaceRegexInAllFiles(\n dir: string,\n patterns: { from: RegExp; to: string }[],\n) {\n const files = await getAllFiles(dir);\n for (const { from, to } of patterns) {\n for (const fPath of files) {\n await replaceRegexInFile(fPath, from, to);\n }\n }\n}\n\nasync function getAllFiles(dir: string): Promise<string[]> {\n const allDirents = await fs.readdir(dir, {\n withFileTypes: true,\n recursive: true,\n });\n\n return allDirents.filter((f: any) => f.isFile()).map((f: any) => path.join(f.parentPath, f.name));\n}\n\nasync function replaceInFile(fPath: string, replacer: (content: string) => any) {\n const content = await fs.readFile(fPath);\n const newContent = replacer(content.toString());\n await fs.writeFile(fPath, newContent);\n}\n\nasync function replaceRegexInFile(fPath: string, from: RegExp, to: string) {\n return await replaceInFile(fPath, (content) => content.replaceAll(from, to));\n}\n\nasync function deleteRegexInFile(fPath: string, what: RegExp) {\n return await replaceRegexInFile(fPath, what, '');\n}\n"],"names":["z","fs","Writable","createWriteStream"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAM,sBAAsB,GAAG,CAAC,QAAQ,CAAC;AACzC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU;AACjD,MAAM,oBAAoB,GAAGA,KAAC,CAAC,KAAK,CAAC,CAACA,KAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAEA,KAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AAG/E,MAAM,kBAAkB,GAAGA,KAAC,CAAC,MAAM,CAAC;IAClC,UAAU,EAAEA,KAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7B,IAAA,OAAO,EAAEA,KAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,CAAA,kCAAA,CAAoC,EAAE,CAAC;AAC7E,IAAA,SAAS,EAAEA,KAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,CAAA,2BAAA,CAA6B,EAAE,CAAC;IACxE,iBAAiB,EAAEA,KAAC,CAAC,KAAK,CAAC,o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fs from 'node:fs/promises';\nimport path from 'node:path';\nimport type winston from 'winston';\nimport { Writable } from 'node:stream';\nimport os from 'node:os';\nimport readlineSync from 'readline-sync';\nimport { z } from 'zod';\nimport decompress from 'decompress';\n\nconst blockPlatformsToChoose = ['Python'];\nconst allPlatforms = ['Tengo', 'Python'] as const;\nconst CreateBlockPlatforms = z.union([z.literal('Tengo'), z.literal('Python')]);\nexport type CreateBlockPlatform = z.infer<typeof CreateBlockPlatforms>;\n\nconst CreateBlockOptions = z.object({\n npmOrgName: z.string().min(1),\n orgName: z.string().min(1, { message: `Organization name must be provided` }),\n blockName: z.string().min(1, { message: `Block name must be provided` }),\n softwarePlatforms: z.array(CreateBlockPlatforms).refine((p) => new Set(p).size === p.length, {\n message: 'Must be an array of unique software platforms',\n }),\n});\nexport type CreateBlockOptions = z.infer<typeof CreateBlockOptions>;\n\n/** Creates a block by cloning block-boilerplate repository. */\nexport async function createBlock(logger: winston.Logger) {\n const { npmOrgName, orgName, blockName, softwarePlatforms } = askForOptions();\n const targetPath = path.join(process.cwd(), blockName);\n\n logger.info(`Downloading boilerplate code...`);\n await downloadAndUnzip(\n // 'https://github.com/milaboratory/platforma-block-boilerplate/archive/refs/heads/software_platforms.zip',\n // 'platforma-block-boilerplate-software_platforms',\n 'https://github.com/milaboratory/platforma-block-boilerplate/archive/refs/heads/main.zip',\n 'platforma-block-boilerplate-main',\n targetPath,\n );\n\n const platformsToRemove = allPlatforms.filter((p) => softwarePlatforms.indexOf(p) < 0);\n const noPlatforms = blockPlatformsToChoose.length == platformsToRemove.length;\n logger.info(`Keep platforms '${softwarePlatforms}', remove: '${platformsToRemove}'. Will remove all platforms? ${noPlatforms}`);\n for (const p of platformsToRemove) {\n await removePlatform(targetPath, p);\n }\n if (noPlatforms) {\n await removePlatformsCompletely(targetPath);\n }\n\n logger.info(`Replace everything in the template with provided options...`);\n replaceRegexInAllFiles(targetPath, [\n // '@' literal ensures only npm org name will be renamed,\n // as public registry for software also is called platforma-open, but without '@'.\n // Also, don't rename an organization for runenv-python-3 package.\n { from: /@platforma-open(?!.*runenv-python-3)/g, to: `@${npmOrgName}` },\n\n { from: /my-org/g, to: orgName },\n\n { from: /block-boilerplate/g, to: blockName },\n ]);\n}\n\nfunction askForOptions(): CreateBlockOptions {\n let npmOrgName = readlineSync.question(\n 'Write an organization name for npm. Default is \"platforma-open\": ',\n );\n if (npmOrgName === '') {\n npmOrgName = 'platforma-open';\n }\n\n let orgName = '';\n while (orgName.length < 1)\n orgName = readlineSync.question('Write an organization name, e.g. \"my-org\": ');\n\n let blockName = '';\n while (blockName.length < 1)\n blockName = readlineSync.question('Write a name of the block, e.g. \"hello-world\": ');\n\n const needSoftware = readlineSync.keyInYN('Create package for block\\'s software?');\n let softwarePlatforms = ['Tengo'];\n if (needSoftware) {\n while (softwarePlatforms.length < allPlatforms.length) {\n const index = readlineSync.keyInSelect(blockPlatformsToChoose, 'Choose software platform:');\n if (index < 0) break;\n softwarePlatforms.push(blockPlatformsToChoose[index]);\n }\n }\n softwarePlatforms = Array.from(new Set(softwarePlatforms)).sort();\n\n const result = CreateBlockOptions.safeParse({ npmOrgName, orgName, blockName, softwarePlatforms });\n if (!result.success && result.error.issues.length) {\n throw new Error(result.error.issues.map((i) => i.message).join('; '));\n }\n\n return result.data!;\n}\n\nasync function downloadAndUnzip(url: string, pathInArchive: string, outputPath: string) {\n const response = await fetch(url);\n const content = await response.blob();\n\n const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'create-repo'));\n\n const tmpFile = path.join(tmpDir, 'packed-repo.zip');\n const f = Writable.toWeb(createWriteStream(tmpFile));\n await content.stream().pipeTo(f);\n\n const tmpRepo = path.join(tmpDir, 'unpacked-repo');\n await fs.mkdir(tmpRepo);\n await decompress(tmpFile, tmpRepo);\n\n await fs.cp(path.join(tmpRepo, pathInArchive), outputPath, { recursive: true });\n}\n\n/** Removes a bunch of dependencies to the platform. */\nasync function removePlatform(dir: string, platform: CreateBlockPlatform) {\n const p = platform.toLowerCase();\n\n // Remove <PlAlert> line from MainPage.vue\n // https://regex101.com/r/oCTyHk/1\n await deleteRegexInFile(\n path.join(dir, 'ui', 'src', 'pages', 'MainPage.vue'),\n new RegExp(`.*${p}Message.*\\\\n`, 'g'),\n );\n\n // Remove an output from the model.\n await deleteRegexInFile(\n path.join(dir, 'model', 'src', 'index.ts'),\n new RegExp(`.*${p}Message.*\\\\n\\\\n`, 'g'),\n );\n\n // This regexp represents a block of code until the empty line.\n // https://regex101.com/r/Os8kX1/1\n await deleteRegexInFile(\n path.join(dir, 'workflow', 'src', 'main.tpl.tengo'),\n new RegExp(`.*${p}.*exec.builder.*[\\\\s\\\\S]*?\\\\n\\\\n`, 'g'),\n );\n\n // Remove a line from the workflow output.\n // https://regex101.com/r/PkHwQ8/1\n await deleteRegexInFile(\n path.join(dir, 'workflow', 'src', 'main.tpl.tengo'),\n new RegExp(`.*${p}Message.*\\\\n`, 'g'),\n );\n\n // Remove 2 lines: the one with the language message and the one with expect\n await deleteRegexInFile(\n path.join(dir, 'workflow', 'src', 'wf.test.ts'),\n new RegExp(`.*${p}Message.*\\\\n.*expect.*\\\\n\\\\n`, 'g'),\n );\n\n await fs.rm(path.join(dir, 'software', `src_${p}`), { recursive: true });\n\n await replaceInFile(\n path.join(dir, 'software', 'package.json'),\n (content) => {\n const json = JSON.parse(content);\n delete json['block-software']['artifacts'][`hello-${p}-artifact`];\n delete json['block-software']['entrypoints'][`hello-world-${p}`];\n return JSON.stringify(json, null, 2);\n },\n );\n}\n\n/** Removes software directory completely and all references to it from the workspace. */\nasync function removePlatformsCompletely(dir: string) {\n await fs.rm(path.join(dir, 'software'), { recursive: true });\n\n await replaceInFile(\n path.join(dir, 'workflow', 'package.json'),\n (content) => {\n const json = JSON.parse(content);\n delete json['dependencies']['@platforma-open/my-org.block-boilerplate.software'];\n return JSON.stringify(json, null, 2);\n },\n );\n\n await deleteRegexInFile(\n path.join(dir, 'pnpm-workspace.yaml'),\n /.*- software$\\n/gm,\n );\n}\n\nasync function replaceRegexInAllFiles(\n dir: string,\n patterns: { from: RegExp; to: string }[],\n) {\n const files = await getAllFiles(dir);\n for (const { from, to } of patterns) {\n for (const fPath of files) {\n await replaceRegexInFile(fPath, from, to);\n }\n }\n}\n\nasync function getAllFiles(dir: string): Promise<string[]> {\n const allDirents = await fs.readdir(dir, {\n withFileTypes: true,\n recursive: true,\n });\n\n return allDirents.filter((f: any) => f.isFile()).map((f: any) => path.join(f.parentPath, f.name));\n}\n\nasync function replaceInFile(fPath: string, replacer: (content: string) => any) {\n const content = await fs.readFile(fPath);\n const newContent = replacer(content.toString());\n await fs.writeFile(fPath, newContent);\n}\n\nasync function replaceRegexInFile(fPath: string, from: RegExp, to: string) {\n return await replaceInFile(fPath, (content) => content.replaceAll(from, to));\n}\n\nasync function deleteRegexInFile(fPath: string, what: RegExp) {\n return await replaceRegexInFile(fPath, what, '');\n}\n"],"names":["z","fs","Writable","createWriteStream"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,sBAAsB,GAAG,CAAC,QAAQ,CAAC;AACzC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU;AACjD,MAAM,oBAAoB,GAAGA,KAAC,CAAC,KAAK,CAAC,CAACA,KAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAEA,KAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AAG/E,MAAM,kBAAkB,GAAGA,KAAC,CAAC,MAAM,CAAC;IAClC,UAAU,EAAEA,KAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7B,IAAA,OAAO,EAAEA,KAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,CAAA,kCAAA,CAAoC,EAAE,CAAC;AAC7E,IAAA,SAAS,EAAEA,KAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,CA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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../src/block.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAInC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,QAAA,MAAM,oBAAoB,6DAAqD,CAAC;AAChF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEvE,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;EAOtB,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,+DAA+D;AAC/D,wBAAsB,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,iBAkCvD"}
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../src/block.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAInC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,QAAA,MAAM,oBAAoB,6DAAqD,CAAC;AAChF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEvE,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;EAOtB,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,+DAA+D;AAC/D,wBAAsB,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,iBAkCvD"}
package/dist/block.js CHANGED
@@ -70,7 +70,7 @@ function askForOptions() {
70
70
  softwarePlatforms = Array.from(new Set(softwarePlatforms)).sort();
71
71
  const result = CreateBlockOptions.safeParse({ npmOrgName, orgName, blockName, softwarePlatforms });
72
72
  if (!result.success && result.error.issues.length) {
73
- throw new Error(result.error.issues.map(i => i.message).join('; '));
73
+ throw new Error(result.error.issues.map((i) => i.message).join('; '));
74
74
  }
75
75
  return result.data;
76
76
  }
package/dist/block.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"block.js","sources":["../src/block.ts"],"sourcesContent":["import { createWriteStream } from 'node:fs';\nimport * as fs from 'node:fs/promises';\nimport path from 'node:path';\nimport type winston from 'winston';\nimport { Writable, Transform } from 'node:stream';\nimport os from 'node:os';\nimport readlineSync from 'readline-sync';\nimport { z } from 'zod';\nimport decompress from 'decompress';\nimport yaml from 'yaml';\n\nconst blockPlatformsToChoose = ['Python'];\nconst allPlatforms = ['Tengo', 'Python'] as const;\nconst CreateBlockPlatforms = z.union([z.literal('Tengo'), z.literal('Python')]);\nexport type CreateBlockPlatform = z.infer<typeof CreateBlockPlatforms>;\n\nconst CreateBlockOptions = z.object({\n npmOrgName: z.string().min(1),\n orgName: z.string().min(1, { message: `Organization name must be provided` }),\n blockName: z.string().min(1, { message: `Block name must be provided` }),\n softwarePlatforms: z.array(CreateBlockPlatforms).refine((p) => new Set(p).size === p.length, {\n message: 'Must be an array of unique software platforms',\n }),\n});\nexport type CreateBlockOptions = z.infer<typeof CreateBlockOptions>;\n\n/** Creates a block by cloning block-boilerplate repository. */\nexport async function createBlock(logger: winston.Logger) {\n const { npmOrgName, orgName, blockName, softwarePlatforms } = askForOptions();\n const targetPath = path.join(process.cwd(), blockName);\n\n logger.info(`Downloading boilerplate code...`);\n await downloadAndUnzip(\n // 'https://github.com/milaboratory/platforma-block-boilerplate/archive/refs/heads/software_platforms.zip',\n // 'platforma-block-boilerplate-software_platforms',\n 'https://github.com/milaboratory/platforma-block-boilerplate/archive/refs/heads/main.zip',\n 'platforma-block-boilerplate-main',\n targetPath,\n );\n\n const platformsToRemove = allPlatforms.filter((p) => softwarePlatforms.indexOf(p) < 0);\n const noPlatforms = blockPlatformsToChoose.length == platformsToRemove.length;\n logger.info(`Keep platforms '${softwarePlatforms}', remove: '${platformsToRemove}'. Will remove all platforms? ${noPlatforms}`);\n for (const p of platformsToRemove) {\n await removePlatform(targetPath, p);\n }\n if (noPlatforms) {\n await removePlatformsCompletely(targetPath);\n }\n\n logger.info(`Replace everything in the template with provided options...`);\n replaceRegexInAllFiles(targetPath, [\n // '@' literal ensures only npm org name will be renamed,\n // as public registry for software also is called platforma-open, but without '@'.\n // Also, don't rename an organization for runenv-python-3 package.\n { from: /@platforma-open(?!.*runenv-python-3)/g, to: `@${npmOrgName}` },\n\n { from: /my-org/g, to: orgName },\n\n { from: /block-boilerplate/g, to: blockName },\n ]);\n}\n\nfunction askForOptions(): CreateBlockOptions {\n let npmOrgName = readlineSync.question(\n 'Write an organization name for npm. Default is \"platforma-open\": ',\n );\n if (npmOrgName === '') {\n npmOrgName = 'platforma-open';\n }\n\n let orgName = '';\n while (orgName.length < 1)\n orgName = readlineSync.question('Write an organization name, e.g. \"my-org\": ');\n\n let blockName = '';\n while (blockName.length < 1)\n blockName = readlineSync.question('Write a name of the block, e.g. \"hello-world\": ');\n\n const needSoftware = readlineSync.keyInYN('Create package for block\\'s software?');\n let softwarePlatforms = ['Tengo'];\n if (needSoftware) {\n while (softwarePlatforms.length < allPlatforms.length) {\n const index = readlineSync.keyInSelect(blockPlatformsToChoose, 'Choose software platform:');\n if (index < 0) break;\n softwarePlatforms.push(blockPlatformsToChoose[index]);\n }\n }\n softwarePlatforms = Array.from(new Set(softwarePlatforms)).sort();\n\n const result = CreateBlockOptions.safeParse({ npmOrgName, orgName, blockName, softwarePlatforms });\n if (!result.success && result.error.issues.length) {\n throw new Error(result.error.issues.map(i => i.message).join('; '));\n }\n\n return result.data!;\n}\n\nasync function downloadAndUnzip(url: string, pathInArchive: string, outputPath: string) {\n const response = await fetch(url);\n const content = await response.blob();\n\n const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'create-repo'));\n\n const tmpFile = path.join(tmpDir, 'packed-repo.zip');\n const f = Writable.toWeb(createWriteStream(tmpFile));\n await content.stream().pipeTo(f);\n\n const tmpRepo = path.join(tmpDir, 'unpacked-repo');\n await fs.mkdir(tmpRepo);\n await decompress(tmpFile, tmpRepo);\n\n await fs.cp(path.join(tmpRepo, pathInArchive), outputPath, { recursive: true });\n}\n\n/** Removes a bunch of dependencies to the platform. */\nasync function removePlatform(dir: string, platform: CreateBlockPlatform) {\n const p = platform.toLowerCase();\n\n // Remove <PlAlert> line from MainPage.vue\n // https://regex101.com/r/oCTyHk/1\n await deleteRegexInFile(\n path.join(dir, 'ui', 'src', 'pages', 'MainPage.vue'),\n new RegExp(`.*${p}Message.*\\\\n`, 'g'),\n );\n\n // Remove an output from the model.\n await deleteRegexInFile(\n path.join(dir, 'model', 'src', 'index.ts'),\n new RegExp(`.*${p}Message.*\\\\n\\\\n`, 'g'),\n );\n\n // This regexp represents a block of code until the empty line.\n // https://regex101.com/r/Os8kX1/1\n await deleteRegexInFile(\n path.join(dir, 'workflow', 'src', 'main.tpl.tengo'),\n new RegExp(`.*${p}.*exec.builder.*[\\\\s\\\\S]*?\\\\n\\\\n`, 'g'),\n );\n\n // Remove a line from the workflow output.\n // https://regex101.com/r/PkHwQ8/1\n await deleteRegexInFile(\n path.join(dir, 'workflow', 'src', 'main.tpl.tengo'),\n new RegExp(`.*${p}Message.*\\\\n`, 'g'),\n );\n\n // Remove 2 lines: the one with the language message and the one with expect\n await deleteRegexInFile(\n path.join(dir, 'workflow', 'src', 'wf.test.ts'),\n new RegExp(`.*${p}Message.*\\\\n.*expect.*\\\\n\\\\n`, 'g'),\n );\n\n await fs.rm(path.join(dir, 'software', `src_${p}`), { recursive: true });\n\n await replaceInFile(\n path.join(dir, 'software', 'package.json'),\n (content) => {\n const json = JSON.parse(content);\n delete json['block-software']['artifacts'][`hello-${p}-artifact`];\n delete json['block-software']['entrypoints'][`hello-world-${p}`];\n return JSON.stringify(json, null, 2);\n },\n );\n}\n\n/** Removes software directory completely and all references to it from the workspace. */\nasync function removePlatformsCompletely(dir: string) {\n await fs.rm(path.join(dir, 'software'), { recursive: true });\n\n await replaceInFile(\n path.join(dir, 'workflow', 'package.json'),\n (content) => {\n const json = JSON.parse(content);\n delete json['dependencies']['@platforma-open/my-org.block-boilerplate.software'];\n return JSON.stringify(json, null, 2);\n },\n );\n\n await deleteRegexInFile(\n path.join(dir, 'pnpm-workspace.yaml'),\n /.*- software$\\n/gm,\n );\n}\n\nasync function replaceRegexInAllFiles(\n dir: string,\n patterns: { from: RegExp; to: string }[],\n) {\n const files = await getAllFiles(dir);\n for (const { from, to } of patterns) {\n for (const fPath of files) {\n await replaceRegexInFile(fPath, from, to);\n }\n }\n}\n\nasync function getAllFiles(dir: string): Promise<string[]> {\n const allDirents = await fs.readdir(dir, {\n withFileTypes: true,\n recursive: true,\n });\n\n return allDirents.filter((f: any) => f.isFile()).map((f: any) => path.join(f.parentPath, f.name));\n}\n\nasync function replaceInFile(fPath: string, replacer: (content: string) => any) {\n const content = await fs.readFile(fPath);\n const newContent = replacer(content.toString());\n await fs.writeFile(fPath, newContent);\n}\n\nasync function replaceRegexInFile(fPath: string, from: RegExp, to: string) {\n return await replaceInFile(fPath, (content) => content.replaceAll(from, to));\n}\n\nasync function deleteRegexInFile(fPath: string, what: RegExp) {\n return await replaceRegexInFile(fPath, what, '');\n}\n"],"names":["os"],"mappings":";;;;;;;;;AAWA,MAAM,sBAAsB,GAAG,CAAC,QAAQ,CAAC;AACzC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU;AACjD,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AAG/E,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7B,IAAA,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAA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AC;AAC9E;AAEA,eAAe,iBAAiB,CAAC,KAAa,EAAE,IAAY,EAAA;IAC1D,OAAO,MAAM,kBAAkB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC;AAClD;;;;"}
1
+ {"version":3,"file":"block.js","sources":["../src/block.ts"],"sourcesContent":["import { createWriteStream } from 'node:fs';\nimport * as fs from 'node:fs/promises';\nimport path from 'node:path';\nimport type winston from 'winston';\nimport { Writable } from 'node:stream';\nimport os from 'node:os';\nimport readlineSync from 'readline-sync';\nimport { z } from 'zod';\nimport decompress from 'decompress';\n\nconst blockPlatformsToChoose = ['Python'];\nconst allPlatforms = ['Tengo', 'Python'] as const;\nconst CreateBlockPlatforms = z.union([z.literal('Tengo'), z.literal('Python')]);\nexport type CreateBlockPlatform = z.infer<typeof CreateBlockPlatforms>;\n\nconst CreateBlockOptions = z.object({\n npmOrgName: z.string().min(1),\n orgName: z.string().min(1, { message: `Organization name must be provided` }),\n blockName: z.string().min(1, { message: `Block name must be provided` }),\n softwarePlatforms: z.array(CreateBlockPlatforms).refine((p) => new Set(p).size === p.length, {\n message: 'Must be an array of unique software platforms',\n }),\n});\nexport type CreateBlockOptions = z.infer<typeof CreateBlockOptions>;\n\n/** Creates a block by cloning block-boilerplate repository. */\nexport async function createBlock(logger: winston.Logger) {\n const { npmOrgName, orgName, blockName, softwarePlatforms } = askForOptions();\n const targetPath = path.join(process.cwd(), blockName);\n\n logger.info(`Downloading boilerplate code...`);\n await downloadAndUnzip(\n // 'https://github.com/milaboratory/platforma-block-boilerplate/archive/refs/heads/software_platforms.zip',\n // 'platforma-block-boilerplate-software_platforms',\n 'https://github.com/milaboratory/platforma-block-boilerplate/archive/refs/heads/main.zip',\n 'platforma-block-boilerplate-main',\n targetPath,\n );\n\n const platformsToRemove = allPlatforms.filter((p) => softwarePlatforms.indexOf(p) < 0);\n const noPlatforms = blockPlatformsToChoose.length == platformsToRemove.length;\n logger.info(`Keep platforms '${softwarePlatforms}', remove: '${platformsToRemove}'. Will remove all platforms? ${noPlatforms}`);\n for (const p of platformsToRemove) {\n await removePlatform(targetPath, p);\n }\n if (noPlatforms) {\n await removePlatformsCompletely(targetPath);\n }\n\n logger.info(`Replace everything in the template with provided options...`);\n replaceRegexInAllFiles(targetPath, [\n // '@' literal ensures only npm org name will be renamed,\n // as public registry for software also is called platforma-open, but without '@'.\n // Also, don't rename an organization for runenv-python-3 package.\n { from: /@platforma-open(?!.*runenv-python-3)/g, to: `@${npmOrgName}` },\n\n { from: /my-org/g, to: orgName },\n\n { from: /block-boilerplate/g, to: blockName },\n ]);\n}\n\nfunction askForOptions(): CreateBlockOptions {\n let npmOrgName = readlineSync.question(\n 'Write an organization name for npm. Default is \"platforma-open\": ',\n );\n if (npmOrgName === '') {\n npmOrgName = 'platforma-open';\n }\n\n let orgName = '';\n while (orgName.length < 1)\n orgName = readlineSync.question('Write an organization name, e.g. \"my-org\": ');\n\n let blockName = '';\n while (blockName.length < 1)\n blockName = readlineSync.question('Write a name of the block, e.g. \"hello-world\": ');\n\n const needSoftware = readlineSync.keyInYN('Create package for block\\'s software?');\n let softwarePlatforms = ['Tengo'];\n if (needSoftware) {\n while (softwarePlatforms.length < allPlatforms.length) {\n const index = readlineSync.keyInSelect(blockPlatformsToChoose, 'Choose software platform:');\n if (index < 0) break;\n softwarePlatforms.push(blockPlatformsToChoose[index]);\n }\n }\n softwarePlatforms = Array.from(new Set(softwarePlatforms)).sort();\n\n const result = CreateBlockOptions.safeParse({ npmOrgName, orgName, blockName, softwarePlatforms });\n if (!result.success && result.error.issues.length) {\n throw new Error(result.error.issues.map((i) => i.message).join('; '));\n }\n\n return result.data!;\n}\n\nasync function downloadAndUnzip(url: string, pathInArchive: string, outputPath: string) {\n const response = await fetch(url);\n const content = await response.blob();\n\n const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'create-repo'));\n\n const tmpFile = path.join(tmpDir, 'packed-repo.zip');\n const f = Writable.toWeb(createWriteStream(tmpFile));\n await content.stream().pipeTo(f);\n\n const tmpRepo = path.join(tmpDir, 'unpacked-repo');\n await fs.mkdir(tmpRepo);\n await decompress(tmpFile, tmpRepo);\n\n await fs.cp(path.join(tmpRepo, pathInArchive), outputPath, { recursive: true });\n}\n\n/** Removes a bunch of dependencies to the platform. */\nasync function removePlatform(dir: string, platform: CreateBlockPlatform) {\n const p = platform.toLowerCase();\n\n // Remove <PlAlert> line from MainPage.vue\n // https://regex101.com/r/oCTyHk/1\n await deleteRegexInFile(\n path.join(dir, 'ui', 'src', 'pages', 'MainPage.vue'),\n new RegExp(`.*${p}Message.*\\\\n`, 'g'),\n );\n\n // Remove an output from the model.\n await deleteRegexInFile(\n path.join(dir, 'model', 'src', 'index.ts'),\n new RegExp(`.*${p}Message.*\\\\n\\\\n`, 'g'),\n );\n\n // This regexp represents a block of code until the empty line.\n // https://regex101.com/r/Os8kX1/1\n await deleteRegexInFile(\n path.join(dir, 'workflow', 'src', 'main.tpl.tengo'),\n new RegExp(`.*${p}.*exec.builder.*[\\\\s\\\\S]*?\\\\n\\\\n`, 'g'),\n );\n\n // Remove a line from the workflow output.\n // https://regex101.com/r/PkHwQ8/1\n await deleteRegexInFile(\n path.join(dir, 'workflow', 'src', 'main.tpl.tengo'),\n new RegExp(`.*${p}Message.*\\\\n`, 'g'),\n );\n\n // Remove 2 lines: the one with the language message and the one with expect\n await deleteRegexInFile(\n path.join(dir, 'workflow', 'src', 'wf.test.ts'),\n new RegExp(`.*${p}Message.*\\\\n.*expect.*\\\\n\\\\n`, 'g'),\n );\n\n await fs.rm(path.join(dir, 'software', `src_${p}`), { recursive: true });\n\n await replaceInFile(\n path.join(dir, 'software', 'package.json'),\n (content) => {\n const json = JSON.parse(content);\n delete json['block-software']['artifacts'][`hello-${p}-artifact`];\n delete json['block-software']['entrypoints'][`hello-world-${p}`];\n return JSON.stringify(json, null, 2);\n },\n );\n}\n\n/** Removes software directory completely and all references to it from the workspace. */\nasync function removePlatformsCompletely(dir: string) {\n await fs.rm(path.join(dir, 'software'), { recursive: true });\n\n await replaceInFile(\n path.join(dir, 'workflow', 'package.json'),\n (content) => {\n const json = JSON.parse(content);\n delete json['dependencies']['@platforma-open/my-org.block-boilerplate.software'];\n return JSON.stringify(json, null, 2);\n },\n );\n\n await deleteRegexInFile(\n path.join(dir, 'pnpm-workspace.yaml'),\n /.*- software$\\n/gm,\n );\n}\n\nasync function replaceRegexInAllFiles(\n dir: string,\n patterns: { from: RegExp; to: string }[],\n) {\n const files = await getAllFiles(dir);\n for (const { from, to } of patterns) {\n for (const fPath of files) {\n await replaceRegexInFile(fPath, from, to);\n }\n }\n}\n\nasync function getAllFiles(dir: string): Promise<string[]> {\n const allDirents = await fs.readdir(dir, {\n withFileTypes: true,\n recursive: true,\n });\n\n return allDirents.filter((f: any) => f.isFile()).map((f: any) => path.join(f.parentPath, f.name));\n}\n\nasync function replaceInFile(fPath: string, replacer: (content: string) => any) {\n const content = await fs.readFile(fPath);\n const newContent = replacer(content.toString());\n await fs.writeFile(fPath, newContent);\n}\n\nasync function replaceRegexInFile(fPath: string, from: RegExp, to: string) {\n return await replaceInFile(fPath, (content) => content.replaceAll(from, to));\n}\n\nasync function deleteRegexInFile(fPath: string, what: RegExp) {\n return await replaceRegexInFile(fPath, what, '');\n}\n"],"names":["os"],"mappings":";;;;;;;;;AAUA,MAAM,sBAAsB,GAAG,CAAC,QAAQ,CAAC;AACzC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU;AACjD,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AAG/E,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7B,IAAA,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAA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AE,EAAE,CAAC,CAAC;AAC9E;AAEA,eAAe,iBAAiB,CAAC,KAAa,EAAE,IAAY,EAAA;IAC1D,OAAO,MAAM,kBAAkB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC;AAClD;;;;"}
@@ -1,89 +1,89 @@
1
1
  export declare const GlobalFlags: {
2
- 'log-level': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
2
+ 'log-level': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
3
3
  };
4
4
  export declare const InstanceName: {
5
- name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
5
+ name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
6
6
  };
7
7
  export declare const ImageFlag: {
8
- image: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ image: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
9
  };
10
10
  export declare const VersionFlag: {
11
- version: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
12
  };
13
13
  export declare const ArchFlag: {
14
- arch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ arch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
15
  };
16
16
  export declare const LicenseFlags: {
17
- license: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
- 'license-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ license: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ 'license-file': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
19
  };
20
20
  export declare const AddressesFlags: {
21
- 'grpc-port': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
- 'grpc-listen': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
- 'monitoring-port': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
- 'monitoring-listen': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
25
- 'debug-port': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
26
- 'debug-listen': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
+ 'grpc-port': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
22
+ 'grpc-listen': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
23
+ 'monitoring-port': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
24
+ 'monitoring-listen': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
25
+ 'debug-port': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
26
+ 'debug-listen': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
27
27
  };
28
28
  export declare const S3AddressesFlags: {
29
- 's3-port': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
30
- 's3-console-port': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
29
+ 's3-port': import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
30
+ 's3-console-port': import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
31
31
  };
32
32
  export declare const StorageFlag: {
33
- storage: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
33
+ storage: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
34
34
  };
35
35
  export declare const MinioPresignHostFlag: {
36
- "minio-presign-host": import("@oclif/core/interfaces").BooleanFlag<boolean>;
36
+ "minio-presign-host": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
37
37
  };
38
38
  export declare const MountFlag: {
39
- mount: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
39
+ mount: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
40
40
  };
41
41
  export declare const PlLogFileFlag: {
42
- "pl-log-file": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
42
+ "pl-log-file": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
43
43
  };
44
44
  export declare const PlWorkdirFlag: {
45
- "pl-workdir": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
45
+ "pl-workdir": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
46
46
  };
47
47
  export declare const PlBinaryFlag: {
48
- "pl-binary": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
48
+ "pl-binary": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
49
49
  };
50
50
  export declare const PlSourcesFlag: {
51
- "pl-sources": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
51
+ "pl-sources": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
52
52
  };
53
53
  export declare const ConfigFlag: {
54
- config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
54
+ config: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
55
55
  };
56
56
  export declare const StoragePrimaryPathFlag: {
57
- 'storage-primary': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
57
+ 'storage-primary': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
58
58
  };
59
59
  export declare const StorageWorkPathFlag: {
60
- 'storage-work': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
60
+ 'storage-work': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
61
61
  };
62
62
  export declare const StorageLibraryPathFlag: {
63
- 'storage-primary': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
63
+ 'storage-primary': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
64
64
  };
65
65
  export declare const StoragePrimaryURLFlag: {
66
- 'storage-primary': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
66
+ 'storage-primary': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
67
67
  };
68
68
  export declare const StorageLibraryURLFlag: {
69
- 'storage-library': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
69
+ 'storage-library': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
70
70
  };
71
71
  export declare const AuthEnabledFlag: {
72
- 'auth-enabled': import("@oclif/core/interfaces").BooleanFlag<boolean>;
72
+ 'auth-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
73
73
  };
74
74
  export declare const HTPasswdFileFlag: {
75
- 'auth-htpasswd-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
75
+ 'auth-htpasswd-file': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
76
76
  };
77
77
  export declare const LDAPAddressFlag: {
78
- 'auth-ldap-server': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
78
+ 'auth-ldap-server': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
79
79
  };
80
80
  export declare const LDAPDefaultDNFlag: {
81
- 'auth-ldap-default-dn': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
81
+ 'auth-ldap-default-dn': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
82
82
  };
83
83
  export declare const AuthFlags: {
84
- 'auth-ldap-default-dn': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
85
- 'auth-ldap-server': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
86
- 'auth-htpasswd-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
87
- 'auth-enabled': import("@oclif/core/interfaces").BooleanFlag<boolean>;
84
+ 'auth-ldap-default-dn': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
85
+ 'auth-ldap-server': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
86
+ 'auth-htpasswd-file': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
87
+ 'auth-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
88
88
  };
89
89
  //# sourceMappingURL=cmd-opts.d.ts.map
@@ -6,10 +6,10 @@ var util = require('../util.cjs');
6
6
  var block = require('../block.cjs');
7
7
 
8
8
  class CreateBlock extends core.Command {
9
- static description = "Helps to create a new block by downloading a block's template.";
9
+ static description = 'Helps to create a new block by downloading a block\'s template.';
10
10
  static examples = ['<%= name %>'];
11
11
  static flags = {
12
- ...cmdOpts.GlobalFlags
12
+ ...cmdOpts.GlobalFlags,
13
13
  };
14
14
  async run() {
15
15
  const { flags } = await this.parse(CreateBlock);
@@ -1 +1 @@
1
- {"version":3,"file":"create-block.cjs","sources":["../../src/commands/create-block.ts"],"sourcesContent":["import { Command, Flags } from '@oclif/core';\nimport * as cmdOpts from '../cmd-opts';\nimport * as util from '../util';\nimport * as block from '../block';\n\nexport default class CreateBlock extends Command {\n static override description = \"Helps to create a new block by downloading a block's template.\";\n\n static override examples = ['<%= name %>'];\n\n static override flags = {\n ...cmdOpts.GlobalFlags\n };\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(CreateBlock);\n const logger = util.createLogger(flags['log-level']);\n\n await block.createBlock(logger);\n }\n}\n"],"names":["Command","cmdOpts.GlobalFlags","util.createLogger","block.createBlock"],"mappings":";;;;;;;AAKc,MAAO,WAAY,SAAQA,YAAO,CAAA;AAC9C,IAAA,OAAgB,WAAW,GAAG,gEAAgE;AAE9F,IAAA,OAAgB,QAAQ,GAAG,CAAC,aAAa,CAAC;IAE1C,OAAgB,KAAK,GAAG;QACtB,GAAGC;KACJ;AAEM,IAAA,MAAM,GAAG,GAAA;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;QAC/C,MAAM,MAAM,GAAGC,iBAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAEpD,QAAA,MAAMC,iBAAiB,CAAC,MAAM,CAAC;IACjC;;;;;"}
1
+ {"version":3,"file":"create-block.cjs","sources":["../../src/commands/create-block.ts"],"sourcesContent":["import { Command } from '@oclif/core';\nimport * as cmdOpts from '../cmd-opts';\nimport * as util from '../util';\nimport * as block from '../block';\n\nexport default class CreateBlock extends Command {\n static override description = 'Helps to create a new block by downloading a block\\'s template.';\n\n static override examples = ['<%= name %>'];\n\n static override flags = {\n ...cmdOpts.GlobalFlags,\n };\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(CreateBlock);\n const logger = util.createLogger(flags['log-level']);\n\n await block.createBlock(logger);\n }\n}\n"],"names":["Command","cmdOpts.GlobalFlags","util.createLogger","block.createBlock"],"mappings":";;;;;;;AAKc,MAAO,WAAY,SAAQA,YAAO,CAAA;AAC9C,IAAA,OAAgB,WAAW,GAAG,iEAAiE;AAE/F,IAAA,OAAgB,QAAQ,GAAG,CAAC,aAAa,CAAC;IAE1C,OAAgB,KAAK,GAAG;QACtB,GAAGC,mBAAmB;KACvB;AAEM,IAAA,MAAM,GAAG,GAAA;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;QAC/C,MAAM,MAAM,GAAGC,iBAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAEpD,QAAA,MAAMC,iBAAiB,CAAC,MAAM,CAAC;IACjC;;;;;"}
@@ -3,7 +3,7 @@ export default class CreateBlock extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- 'log-level': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
6
+ 'log-level': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
7
  };
8
8
  run(): Promise<void>;
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"create-block.d.ts","sourceRoot":"","sources":["../../src/commands/create-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAK7C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAC9C,OAAgB,WAAW,SAAoE;IAE/F,OAAgB,QAAQ,WAAmB;IAE3C,OAAgB,KAAK;;MAEnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAMlC"}
1
+ {"version":3,"file":"create-block.d.ts","sourceRoot":"","sources":["../../src/commands/create-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAKtC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAC9C,OAAgB,WAAW,SAAqE;IAEhG,OAAgB,QAAQ,WAAmB;IAE3C,OAAgB,KAAK;;MAEnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAMlC"}
@@ -4,10 +4,10 @@ import { createLogger } from '../util.js';
4
4
  import { createBlock } from '../block.js';
5
5
 
6
6
  class CreateBlock extends Command {
7
- static description = "Helps to create a new block by downloading a block's template.";
7
+ static description = 'Helps to create a new block by downloading a block\'s template.';
8
8
  static examples = ['<%= name %>'];
9
9
  static flags = {
10
- ...GlobalFlags
10
+ ...GlobalFlags,
11
11
  };
12
12
  async run() {
13
13
  const { flags } = await this.parse(CreateBlock);
@@ -1 +1 @@
1
- {"version":3,"file":"create-block.js","sources":["../../src/commands/create-block.ts"],"sourcesContent":["import { Command, Flags } from '@oclif/core';\nimport * as cmdOpts from '../cmd-opts';\nimport * as util from '../util';\nimport * as block from '../block';\n\nexport default class CreateBlock extends Command {\n static override description = \"Helps to create a new block by downloading a block's template.\";\n\n static override examples = ['<%= name %>'];\n\n static override flags = {\n ...cmdOpts.GlobalFlags\n };\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(CreateBlock);\n const logger = util.createLogger(flags['log-level']);\n\n await block.createBlock(logger);\n }\n}\n"],"names":["cmdOpts.GlobalFlags","util.createLogger","block.createBlock"],"mappings":";;;;;AAKc,MAAO,WAAY,SAAQ,OAAO,CAAA;AAC9C,IAAA,OAAgB,WAAW,GAAG,gEAAgE;AAE9F,IAAA,OAAgB,QAAQ,GAAG,CAAC,aAAa,CAAC;IAE1C,OAAgB,KAAK,GAAG;QACtB,GAAGA;KACJ;AAEM,IAAA,MAAM,GAAG,GAAA;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;QAC/C,MAAM,MAAM,GAAGC,YAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAEpD,QAAA,MAAMC,WAAiB,CAAC,MAAM,CAAC;IACjC;;;;;"}
1
+ {"version":3,"file":"create-block.js","sources":["../../src/commands/create-block.ts"],"sourcesContent":["import { Command } from '@oclif/core';\nimport * as cmdOpts from '../cmd-opts';\nimport * as util from '../util';\nimport * as block from '../block';\n\nexport default class CreateBlock extends Command {\n static override description = 'Helps to create a new block by downloading a block\\'s template.';\n\n static override examples = ['<%= name %>'];\n\n static override flags = {\n ...cmdOpts.GlobalFlags,\n };\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(CreateBlock);\n const logger = util.createLogger(flags['log-level']);\n\n await block.createBlock(logger);\n }\n}\n"],"names":["cmdOpts.GlobalFlags","util.createLogger","block.createBlock"],"mappings":";;;;;AAKc,MAAO,WAAY,SAAQ,OAAO,CAAA;AAC9C,IAAA,OAAgB,WAAW,GAAG,iEAAiE;AAE/F,IAAA,OAAgB,QAAQ,GAAG,CAAC,aAAa,CAAC;IAE1C,OAAgB,KAAK,GAAG;QACtB,GAAGA,WAAmB;KACvB;AAEM,IAAA,MAAM,GAAG,GAAA;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;QAC/C,MAAM,MAAM,GAAGC,YAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAEpD,QAAA,MAAMC,WAAiB,CAAC,MAAM,CAAC;IACjC;;;;;"}
@@ -9,7 +9,7 @@ class Reset extends core.Command {
9
9
  static description = 'Clear service state (forget last run command, destroy docker services, volumes and so on)';
10
10
  static examples = ['<%= config.bin %> <%= command.id %>'];
11
11
  static flags = {
12
- ...cmdOpts.GlobalFlags
12
+ ...cmdOpts.GlobalFlags,
13
13
  };
14
14
  async run() {
15
15
  const { flags } = await this.parse(Reset);
@@ -1 +1 @@
1
- {"version":3,"file":"reset.cjs","sources":["../../src/commands/reset.ts"],"sourcesContent":["import { Command, Flags } from '@oclif/core';\nimport Core from '../core';\nimport * as cmdOpts from '../cmd-opts';\nimport * as util from '../util';\n\nexport default class Reset extends Command {\n static override description =\n 'Clear service state (forget last run command, destroy docker services, volumes and so on)';\n\n static override examples = ['<%= config.bin %> <%= command.id %>'];\n\n static override flags = {\n ...cmdOpts.GlobalFlags\n };\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(Reset);\n\n const logger = util.createLogger(flags['log-level']);\n const core = new Core(logger);\n core.cleanupInstance();\n }\n}\n"],"names":["Command","cmdOpts.GlobalFlags","util.createLogger","Core"],"mappings":";;;;;;;AAKc,MAAO,KAAM,SAAQA,YAAO,CAAA;AACxC,IAAA,OAAgB,WAAW,GACzB,2FAA2F;AAE7F,IAAA,OAAgB,QAAQ,GAAG,CAAC,qCAAqC,CAAC;IAElE,OAAgB,KAAK,GAAG;QACtB,GAAGC;KACJ;AAEM,IAAA,MAAM,GAAG,GAAA;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAEzC,MAAM,MAAM,GAAGC,iBAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AACpD,QAAA,MAAM,IAAI,GAAG,IAAIC,cAAI,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,eAAe,EAAE;IACxB;;;;;"}
1
+ {"version":3,"file":"reset.cjs","sources":["../../src/commands/reset.ts"],"sourcesContent":["import { Command } from '@oclif/core';\nimport Core from '../core';\nimport * as cmdOpts from '../cmd-opts';\nimport * as util from '../util';\n\nexport default class Reset extends Command {\n static override description\n = 'Clear service state (forget last run command, destroy docker services, volumes and so on)';\n\n static override examples = ['<%= config.bin %> <%= command.id %>'];\n\n static override flags = {\n ...cmdOpts.GlobalFlags,\n };\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(Reset);\n\n const logger = util.createLogger(flags['log-level']);\n const core = new Core(logger);\n core.cleanupInstance();\n }\n}\n"],"names":["Command","cmdOpts.GlobalFlags","util.createLogger","Core"],"mappings":";;;;;;;AAKc,MAAO,KAAM,SAAQA,YAAO,CAAA;AACxC,IAAA,OAAgB,WAAW,GACvB,2FAA2F;AAE/F,IAAA,OAAgB,QAAQ,GAAG,CAAC,qCAAqC,CAAC;IAElE,OAAgB,KAAK,GAAG;QACtB,GAAGC,mBAAmB;KACvB;AAEM,IAAA,MAAM,GAAG,GAAA;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAEzC,MAAM,MAAM,GAAGC,iBAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AACpD,QAAA,MAAM,IAAI,GAAG,IAAIC,cAAI,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,eAAe,EAAE;IACxB;;;;;"}
@@ -3,7 +3,7 @@ export default class Reset extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- 'log-level': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
6
+ 'log-level': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
7
  };
8
8
  run(): Promise<void>;
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../src/commands/reset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAK7C,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,OAAO;IACxC,OAAgB,WAAW,SACmE;IAE9F,OAAgB,QAAQ,WAA2C;IAEnE,OAAgB,KAAK;;MAEnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAOlC"}
1
+ {"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../src/commands/reset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAKtC,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,OAAO;IACxC,OAAgB,WAAW,SACqE;IAEhG,OAAgB,QAAQ,WAA2C;IAEnE,OAAgB,KAAK;;MAEnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAOlC"}
@@ -7,7 +7,7 @@ class Reset extends Command {
7
7
  static description = 'Clear service state (forget last run command, destroy docker services, volumes and so on)';
8
8
  static examples = ['<%= config.bin %> <%= command.id %>'];
9
9
  static flags = {
10
- ...GlobalFlags
10
+ ...GlobalFlags,
11
11
  };
12
12
  async run() {
13
13
  const { flags } = await this.parse(Reset);
@@ -1 +1 @@
1
- {"version":3,"file":"reset.js","sources":["../../src/commands/reset.ts"],"sourcesContent":["import { Command, Flags } from '@oclif/core';\nimport Core from '../core';\nimport * as cmdOpts from '../cmd-opts';\nimport * as util from '../util';\n\nexport default class Reset extends Command {\n static override description =\n 'Clear service state (forget last run command, destroy docker services, volumes and so on)';\n\n static override examples = ['<%= config.bin %> <%= command.id %>'];\n\n static override flags = {\n ...cmdOpts.GlobalFlags\n };\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(Reset);\n\n const logger = util.createLogger(flags['log-level']);\n const core = new Core(logger);\n core.cleanupInstance();\n }\n}\n"],"names":["cmdOpts.GlobalFlags","util.createLogger"],"mappings":";;;;;AAKc,MAAO,KAAM,SAAQ,OAAO,CAAA;AACxC,IAAA,OAAgB,WAAW,GACzB,2FAA2F;AAE7F,IAAA,OAAgB,QAAQ,GAAG,CAAC,qCAAqC,CAAC;IAElE,OAAgB,KAAK,GAAG;QACtB,GAAGA;KACJ;AAEM,IAAA,MAAM,GAAG,GAAA;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAEzC,MAAM,MAAM,GAAGC,YAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AACpD,QAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,eAAe,EAAE;IACxB;;;;;"}
1
+ {"version":3,"file":"reset.js","sources":["../../src/commands/reset.ts"],"sourcesContent":["import { Command } from '@oclif/core';\nimport Core from '../core';\nimport * as cmdOpts from '../cmd-opts';\nimport * as util from '../util';\n\nexport default class Reset extends Command {\n static override description\n = 'Clear service state (forget last run command, destroy docker services, volumes and so on)';\n\n static override examples = ['<%= config.bin %> <%= command.id %>'];\n\n static override flags = {\n ...cmdOpts.GlobalFlags,\n };\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(Reset);\n\n const logger = util.createLogger(flags['log-level']);\n const core = new Core(logger);\n core.cleanupInstance();\n }\n}\n"],"names":["cmdOpts.GlobalFlags","util.createLogger"],"mappings":";;;;;AAKc,MAAO,KAAM,SAAQ,OAAO,CAAA;AACxC,IAAA,OAAgB,WAAW,GACvB,2FAA2F;AAE/F,IAAA,OAAgB,QAAQ,GAAG,CAAC,qCAAqC,CAAC;IAElE,OAAgB,KAAK,GAAG;QACtB,GAAGA,WAAmB;KACvB;AAEM,IAAA,MAAM,GAAG,GAAA;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAEzC,MAAM,MAAM,GAAGC,YAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AACpD,QAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,eAAe,EAAE;IACxB;;;;;"}
@@ -3,27 +3,27 @@ export default class S3 extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- "minio-presign-host": import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
- storage: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
- mount: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
- license: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
- 'license-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
- 'auth-ldap-default-dn': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
- 'auth-ldap-server': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
- 'auth-htpasswd-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
- 'auth-enabled': import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
- arch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
- version: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
- image: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
- 's3-port': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
19
- 's3-console-port': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
20
- 'grpc-port': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
- 'grpc-listen': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
- 'monitoring-port': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
- 'monitoring-listen': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
- 'debug-port': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
25
- 'debug-listen': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
26
- 'log-level': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
6
+ "minio-presign-host": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ storage: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ mount: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ license: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ 'license-file': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ 'auth-ldap-default-dn': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ 'auth-ldap-server': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ 'auth-htpasswd-file': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ 'auth-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ arch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ image: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ 's3-port': import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ 's3-console-port': import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ 'grpc-port': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
21
+ 'grpc-listen': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
22
+ 'monitoring-port': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
23
+ 'monitoring-listen': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
24
+ 'debug-port': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
25
+ 'debug-listen': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
26
+ 'log-level': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
27
27
  };
28
28
  run(): Promise<void>;
29
29
  }
@@ -3,27 +3,27 @@ export default class Docker extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- 'storage-library': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
- 'storage-work': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
- 'storage-primary': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
- storage: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
- mount: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
- license: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
- 'license-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
- 'auth-ldap-default-dn': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
- 'auth-ldap-server': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
- 'auth-htpasswd-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
- 'auth-enabled': import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
- arch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
- version: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
- image: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
- 'grpc-port': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
- 'grpc-listen': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
- 'monitoring-port': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
- 'monitoring-listen': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
- 'debug-port': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
25
- 'debug-listen': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
26
- 'log-level': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
6
+ 'storage-library': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ 'storage-work': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ 'storage-primary': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ storage: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ mount: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ license: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ 'license-file': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ 'auth-ldap-default-dn': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ 'auth-ldap-server': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ 'auth-htpasswd-file': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ 'auth-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
+ arch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ image: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ 'grpc-port': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
21
+ 'grpc-listen': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
22
+ 'monitoring-port': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
23
+ 'monitoring-listen': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
24
+ 'debug-port': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
25
+ 'debug-listen': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
26
+ 'log-level': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
27
27
  };
28
28
  run(): Promise<void>;
29
29
  }