@extrahorizon/exh-cli 1.13.0-feat-168-eab0ce8 → 1.13.0

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/CHANGELOG.md +12 -0
  2. package/build/commands/data/schemas/sync.d.ts +4 -4
  3. package/build/commands/data/schemas/sync.js +4 -4
  4. package/build/commands/data/schemas/verify.d.ts +2 -2
  5. package/build/commands/data/schemas/verify.js +2 -2
  6. package/build/commands/dispatchers/init.d.ts +4 -4
  7. package/build/commands/dispatchers/init.js +5 -5
  8. package/build/commands/dispatchers/sync.d.ts +4 -3
  9. package/build/commands/dispatchers/sync.js +4 -3
  10. package/build/commands/localizations/sync.d.ts +1 -1
  11. package/build/commands/localizations/sync.js +1 -1
  12. package/build/commands/login.d.ts +5 -5
  13. package/build/commands/login.js +5 -5
  14. package/build/commands/settings/sync.d.ts +11 -2
  15. package/build/commands/settings/sync.js +10 -5
  16. package/build/commands/sync.d.ts +9 -9
  17. package/build/commands/sync.js +9 -9
  18. package/build/commands/tasks/{createrepo.d.ts → create-repo.d.ts} +10 -3
  19. package/build/commands/tasks/{createrepo.js → create-repo.js} +10 -4
  20. package/build/commands/tasks/init.d.ts +22 -0
  21. package/build/commands/tasks/init.js +30 -0
  22. package/build/commands/tasks/sync.d.ts +9 -9
  23. package/build/commands/tasks/sync.js +9 -9
  24. package/build/commands/templates/delete.d.ts +2 -2
  25. package/build/commands/templates/delete.js +2 -2
  26. package/build/commands/templates/get.d.ts +2 -2
  27. package/build/commands/templates/get.js +2 -2
  28. package/build/commands/templates/sync.d.ts +2 -2
  29. package/build/commands/templates/sync.js +2 -2
  30. package/build/config-json-schemas/Dispatchers.json +14 -2
  31. package/build/config-json-schemas/Template.json +26 -198
  32. package/build/exh.d.ts +2 -1
  33. package/build/exh.js +58 -17
  34. package/build/helpers/repoConfig.d.ts +1 -1
  35. package/build/helpers/repoConfig.js +41 -35
  36. package/build/helpers/util.d.ts +0 -1
  37. package/build/helpers/util.js +1 -31
  38. package/build/index.js +1 -0
  39. package/build/repositories/auth.d.ts +1 -1
  40. package/build/repositories/auth.js +1 -2
  41. package/build/repositories/functions.js +1 -1
  42. package/build/repositories/schemas.d.ts +1 -1
  43. package/build/repositories/schemas.js +1 -1
  44. package/build/repositories/user.d.ts +1 -1
  45. package/build/services/auth.js +7 -17
  46. package/build/services/dispatchers/init.d.ts +1 -1
  47. package/build/services/dispatchers/init.js +4 -4
  48. package/build/services/dispatchers/sync.js +32 -7
  49. package/build/services/settings/sync.js +1 -1
  50. package/build/services/settings/util/readServiceSettingsFile.js +1 -1
  51. package/build/services/sync.js +1 -1
  52. package/build/services/tasks/index.d.ts +1 -1
  53. package/build/services/tasks/index.js +3 -3
  54. package/build/services/tasks/init.d.ts +8 -0
  55. package/build/services/tasks/init.js +55 -0
  56. package/build/services/tasks/util.d.ts +2 -2
  57. package/build/services/tasks/util.js +2 -1
  58. package/build/services/templates/util/readTemplateFiles.js +3 -1
  59. package/build/services/templates/util/utils.js +1 -2
  60. package/package.json +2 -2
  61. package/build/services/tasks/createRepo.d.ts +0 -5
  62. package/build/services/tasks/createRepo.js +0 -52
  63. /package/build/config-json-schemas/{SettingsConfig.json → ServiceSettings.json} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # Extra Horizon CLI changelog
2
2
 
3
3
  ### v1.13.0
4
+ * Introduced `exh settings sync`, by default enabling synchronization of service settings from a `service-settings.json` file.
5
+ * Added `exh dispatchers init`, which creates a dispatcher in a new `dispatchers.json` file or appends a new dispatcher to an existing configuration.
6
+ * Added `exh templates init`, generating a basic email template in the `./templates` directory.
7
+ * Introduced `exh tasks init`, replacing `exh tasks create-repo` for task creation.
8
+ * Aligned behavior with other `init` commands by initializing new tasks in the `./tasks` directory by default.
9
+ * Added support for a `templateName` field in mail actions within dispatchers.
10
+ * The CLI automatically resolves the template id based on the provided template name.
11
+ * Removed validation for v1 templates, focusing on improved support for v2 templates in JetBrains IDEs using the provided JSON schemas via `$schema`.
12
+ * Updated `exh tasks sync` to create users with `activationMode: 'manual'`, preventing unnecessary activation emails.
13
+ * Made file argument optional for `exh dispatchers sync`, defaults to `./dispatchers.json` when no file argument is provided.
14
+ * Deprecated `exh tasks create-repo` in favor of the new `exh tasks init` command.
15
+ * Deprecated the use of `templateId` in mail actions, recommending `templateName` instead.
4
16
 
5
17
  ### v1.12.0
6
18
  * Now adding `$schema` as the last property when creating a new schema via `exh data schemas init`
@@ -4,22 +4,22 @@ export declare const desc = "Sync all schemas in a directory with the ExH cloud"
4
4
  export declare const builder: (yargs: any) => import("yargs").Argv<import("yargs").Omit<{}, "file" | "dir" | "dry" | "ignoreVerificationErrors"> & import("yargs").InferredOptionTypes<{
5
5
  dir: {
6
6
  demandOption: false;
7
- describe: string;
7
+ description: string;
8
8
  type: "string";
9
9
  };
10
10
  file: {
11
11
  demandOption: false;
12
- describe: string;
12
+ description: string;
13
13
  type: "string";
14
14
  };
15
15
  dry: {
16
16
  demandOption: false;
17
- describe: string;
17
+ description: string;
18
18
  type: "boolean";
19
19
  };
20
20
  ignoreVerificationErrors: {
21
21
  demandOption: false;
22
- describe: string;
22
+ description: string;
23
23
  type: "boolean";
24
24
  default: boolean;
25
25
  };
@@ -8,22 +8,22 @@ exports.desc = 'Sync all schemas in a directory with the ExH cloud';
8
8
  const builder = (yargs) => (0, util_1.epilogue)(yargs).options({
9
9
  dir: {
10
10
  demandOption: false,
11
- describe: 'Directory containing the schemas which need to be synced',
11
+ description: 'Directory containing the schemas which need to be synced',
12
12
  type: 'string',
13
13
  },
14
14
  file: {
15
15
  demandOption: false,
16
- describe: 'File containing a schema which needs to be synced',
16
+ description: 'File containing a schema which needs to be synced',
17
17
  type: 'string',
18
18
  },
19
19
  dry: {
20
20
  demandOption: false,
21
- describe: 'When set, a dry-run will be performed. Only output will be printed, but no changes will be pushed to the back-end.',
21
+ description: 'When set, a dry-run will be performed. Only output will be printed, but no changes will be pushed to the back-end.',
22
22
  type: 'boolean',
23
23
  },
24
24
  ignoreVerificationErrors: {
25
25
  demandOption: false,
26
- describe: 'Allow synchronization to proceed with validation errors.',
26
+ description: 'Allow synchronization to proceed with validation errors.',
27
27
  type: 'boolean',
28
28
  default: false,
29
29
  },
@@ -3,11 +3,11 @@ export declare const command = "verify";
3
3
  export declare const desc = "Syntactically verify a local schema";
4
4
  export declare const builder: (yargs: any) => import("yargs").Argv<import("yargs").Omit<{}, "file" | "dir"> & import("yargs").InferredOptionTypes<{
5
5
  file: {
6
- describe: string;
6
+ description: string;
7
7
  type: "string";
8
8
  };
9
9
  dir: {
10
- describe: string;
10
+ description: string;
11
11
  type: "string";
12
12
  };
13
13
  }>>;
@@ -10,11 +10,11 @@ exports.desc = 'Syntactically verify a local schema';
10
10
  const builder = (yargs) => (0, util_1.epilogue)(yargs)
11
11
  .options({
12
12
  file: {
13
- describe: 'schema json file which needs to be verified',
13
+ description: 'schema json file which needs to be verified',
14
14
  type: 'string',
15
15
  },
16
16
  dir: {
17
- describe: 'directory containing schemas to be verified',
17
+ description: 'directory containing schemas to be verified',
18
18
  type: 'string',
19
19
  },
20
20
  })
@@ -3,14 +3,14 @@ export declare const command = "init <name>";
3
3
  export declare const desc = "Create a basic Dispatcher";
4
4
  export declare const builder: (yargs: any) => import("yargs").Argv<import("yargs").Omit<{
5
5
  name: string;
6
- }, "path"> & import("yargs").InferredOptionTypes<{
7
- path: {
6
+ }, "file"> & import("yargs").InferredOptionTypes<{
7
+ file: {
8
8
  description: string;
9
9
  type: "string";
10
10
  default: string;
11
11
  };
12
12
  }>>;
13
- export declare const handler: ({ name, path }: {
13
+ export declare const handler: ({ name, file }: {
14
14
  name: string;
15
- path: string;
15
+ file: string;
16
16
  }) => Promise<void>;
@@ -12,14 +12,14 @@ const builder = (yargs) => (0, util_1.epilogue)(yargs)
12
12
  type: 'string',
13
13
  })
14
14
  .options({
15
- path: {
16
- description: 'The path to the folder where the Dispatchers file should be created',
15
+ file: {
16
+ description: 'Path to the file where the new Dispatcher should be added',
17
17
  type: 'string',
18
- default: './',
18
+ default: './dispatchers.json',
19
19
  },
20
20
  });
21
21
  exports.builder = builder;
22
- const handler = async function init({ name, path }) {
23
- await dispatcherService.init(name, path);
22
+ const handler = async function init({ name, file }) {
23
+ await dispatcherService.init(name, file);
24
24
  };
25
25
  exports.handler = handler;
@@ -3,13 +3,14 @@ export declare const command = "sync";
3
3
  export declare const desc = "Synchronize Dispatchers, if a declared Dispatcher does not exist, it will be created";
4
4
  export declare const builder: (yargs: Argv) => Argv<import("yargs").Omit<{}, "file" | "clean"> & import("yargs").InferredOptionTypes<{
5
5
  file: {
6
- demandOption: true;
7
- describe: string;
6
+ demandOption: false;
7
+ description: string;
8
8
  type: "string";
9
+ default: string;
9
10
  };
10
11
  clean: {
11
12
  demandOption: false;
12
- describe: string;
13
+ description: string;
13
14
  type: "boolean";
14
15
  };
15
16
  }>>;
@@ -7,13 +7,14 @@ exports.command = 'sync';
7
7
  exports.desc = 'Synchronize Dispatchers, if a declared Dispatcher does not exist, it will be created';
8
8
  const builder = (yargs) => (0, util_1.epilogue)(yargs).options({
9
9
  file: {
10
- demandOption: true,
11
- describe: 'Path to the file containing the Dispatcher(s) configuration',
10
+ demandOption: false,
11
+ description: 'Path to the file containing the Dispatcher(s) configuration',
12
12
  type: 'string',
13
+ default: './dispatchers.json',
13
14
  },
14
15
  clean: {
15
16
  demandOption: false,
16
- describe: 'Delete Dispatchers created using the CLI, that are no longer present in the local Dispatcher file',
17
+ description: 'Delete Dispatchers created using the CLI, that are no longer present in the local Dispatcher file',
17
18
  type: 'boolean',
18
19
  },
19
20
  });
@@ -4,7 +4,7 @@ export declare const desc = "Sync all localizations in a directory with the ExH
4
4
  export declare const builder: (yargs: any) => import("yargs").Argv<import("yargs").Omit<{}, "path"> & import("yargs").InferredOptionTypes<{
5
5
  path: {
6
6
  demandOption: false;
7
- describe: string;
7
+ description: string;
8
8
  type: "string";
9
9
  default: string;
10
10
  };
@@ -8,7 +8,7 @@ exports.desc = 'Sync all localizations in a directory with the ExH cloud';
8
8
  const builder = (yargs) => (0, util_1.epilogue)(yargs).options({
9
9
  path: {
10
10
  demandOption: false,
11
- describe: 'Directory containing the localizations which need to be synced in a JSON format. By Default: ./localizations',
11
+ description: 'Directory containing the localizations which need to be synced in a JSON format. By Default: ./localizations',
12
12
  type: 'string',
13
13
  default: './localizations',
14
14
  },
@@ -5,27 +5,27 @@ export declare const builder: (yargs: any) => import("yargs").Argv<import("yargs
5
5
  host: {
6
6
  demandOption: true;
7
7
  type: "string";
8
- describe: string;
8
+ description: string;
9
9
  };
10
10
  email: {
11
11
  demandOption: true;
12
12
  type: "string";
13
- describe: string;
13
+ description: string;
14
14
  };
15
15
  password: {
16
16
  demandOption: true;
17
17
  type: "string";
18
- describe: string;
18
+ description: string;
19
19
  };
20
20
  consumerKey: {
21
21
  demandOption: true;
22
22
  type: "string";
23
- describe: string;
23
+ description: string;
24
24
  };
25
25
  consumerSecret: {
26
26
  demandOption: true;
27
27
  type: "string";
28
- describe: string;
28
+ description: string;
29
29
  };
30
30
  }>>;
31
31
  export declare const handler: ({ host, email, password, consumerKey, consumerSecret }: {
@@ -9,27 +9,27 @@ const builder = (yargs) => (0, util_1.epilogue)(yargs).options({
9
9
  host: {
10
10
  demandOption: true,
11
11
  type: 'string',
12
- describe: 'the address of your ExH cloud instance (eg. https://api.dev.my-instance.extrahorizon.io)',
12
+ description: 'the address of your ExH cloud instance (eg. https://api.dev.my-instance.extrahorizon.io)',
13
13
  },
14
14
  email: {
15
15
  demandOption: true,
16
16
  type: 'string',
17
- describe: 'email address of your ExH account',
17
+ description: 'email address of your ExH account',
18
18
  },
19
19
  password: {
20
20
  demandOption: true,
21
21
  type: 'string',
22
- describe: 'password of your ExH account',
22
+ description: 'password of your ExH account',
23
23
  },
24
24
  consumerKey: {
25
25
  demandOption: true,
26
26
  type: 'string',
27
- describe: 'Consumer key',
27
+ description: 'Consumer key',
28
28
  },
29
29
  consumerSecret: {
30
30
  demandOption: true,
31
31
  type: 'string',
32
- describe: 'Consumer secret',
32
+ description: 'Consumer secret',
33
33
  },
34
34
  });
35
35
  exports.builder = builder;
@@ -1,5 +1,14 @@
1
1
  import { Argv } from 'yargs';
2
2
  export declare const command = "sync";
3
3
  export declare const desc = "Synchronize Service Settings";
4
- export declare const builder: (yargs: Argv) => Argv<import("yargs").Omit<{}, never> & import("yargs").InferredOptionTypes<{}>>;
5
- export declare const handler: () => Promise<void>;
4
+ export declare const builder: (yargs: Argv) => Argv<import("yargs").Omit<{}, "file"> & import("yargs").InferredOptionTypes<{
5
+ file: {
6
+ demandOption: false;
7
+ description: string;
8
+ type: "string";
9
+ default: string;
10
+ };
11
+ }>>;
12
+ export declare const handler: ({ file }: {
13
+ file: string;
14
+ }) => Promise<void>;
@@ -1,15 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handler = exports.builder = exports.desc = exports.command = void 0;
4
- const path = require("node:path");
5
4
  const util_1 = require("../../helpers/util");
6
5
  const serviceSettingService = require("../../services/settings");
7
6
  exports.command = 'sync';
8
7
  exports.desc = 'Synchronize Service Settings';
9
- const builder = (yargs) => (0, util_1.epilogue)(yargs).options({});
8
+ const builder = (yargs) => (0, util_1.epilogue)(yargs).options({
9
+ file: {
10
+ demandOption: false,
11
+ description: 'Path to the file containing the Service Settings configuration',
12
+ type: 'string',
13
+ default: './service-settings.json',
14
+ },
15
+ });
10
16
  exports.builder = builder;
11
- const handler = async () => {
12
- const filePath = path.join(process.cwd(), 'service-settings.json');
13
- await serviceSettingService.sync(filePath);
17
+ const handler = async ({ file }) => {
18
+ await serviceSettingService.sync(file);
14
19
  };
15
20
  exports.handler = handler;
@@ -4,53 +4,53 @@ export declare const desc = "Sync your ExH configuration to the cloud environmen
4
4
  export declare const builder: (yargs: any) => import("yargs").Argv<import("yargs").Omit<{}, "path" | "settings" | "schemas" | "dispatchers" | "tasks" | "templates" | "localizations" | "cleanDispatchers" | "ignoreSchemaVerificationErrors"> & import("yargs").InferredOptionTypes<{
5
5
  path: {
6
6
  demandOption: false;
7
- describe: string;
7
+ description: string;
8
8
  type: "string";
9
9
  };
10
10
  schemas: {
11
11
  demandOption: false;
12
- describe: string;
12
+ description: string;
13
13
  type: "boolean";
14
14
  default: boolean;
15
15
  };
16
16
  tasks: {
17
17
  demandOption: false;
18
- describe: string;
18
+ description: string;
19
19
  type: "boolean";
20
20
  default: boolean;
21
21
  };
22
22
  templates: {
23
23
  demandOption: false;
24
- describe: string;
24
+ description: string;
25
25
  type: "boolean";
26
26
  default: boolean;
27
27
  };
28
28
  dispatchers: {
29
29
  demandOption: false;
30
- describe: string;
30
+ description: string;
31
31
  type: "boolean";
32
32
  default: boolean;
33
33
  };
34
34
  cleanDispatchers: {
35
35
  demandOption: false;
36
- describe: string;
36
+ description: string;
37
37
  type: "boolean";
38
38
  };
39
39
  localizations: {
40
40
  demandOption: false;
41
- describe: string;
41
+ description: string;
42
42
  type: "boolean";
43
43
  default: boolean;
44
44
  };
45
45
  settings: {
46
46
  demandOption: false;
47
- describe: string;
47
+ description: string;
48
48
  type: "boolean";
49
49
  default: boolean;
50
50
  };
51
51
  ignoreSchemaVerificationErrors: {
52
52
  demandOption: false;
53
- describe: string;
53
+ description: string;
54
54
  type: "boolean";
55
55
  default: boolean;
56
56
  };
@@ -12,54 +12,54 @@ const builder = (yargs) => (0, util_1.epilogue)(yargs)
12
12
  .options({
13
13
  path: {
14
14
  demandOption: false,
15
- describe: `Path to folder which needs to be synchronized. The target folder should contain a ${repoConfig_1.REPO_CONFIG_FILE} file.
15
+ description: `Path to folder which needs to be synchronized. The target folder should contain a ${repoConfig_1.REPO_CONFIG_FILE} file.
16
16
  If not, the local directory is assumed with a default configuration which assumes tasks are in a 'tasks' folder, schemas in a 'schemas' folder, etc...`,
17
17
  type: 'string',
18
18
  },
19
19
  schemas: {
20
20
  demandOption: false,
21
- describe: 'Sync schemas only',
21
+ description: 'Sync schemas only',
22
22
  type: 'boolean',
23
23
  default: false,
24
24
  },
25
25
  tasks: {
26
26
  demandOption: false,
27
- describe: 'Sync tasks only',
27
+ description: 'Sync tasks only',
28
28
  type: 'boolean',
29
29
  default: false,
30
30
  },
31
31
  templates: {
32
32
  demandOption: false,
33
- describe: 'Sync templates only',
33
+ description: 'Sync templates only',
34
34
  type: 'boolean',
35
35
  default: false,
36
36
  },
37
37
  dispatchers: {
38
38
  demandOption: false,
39
- describe: 'Sync Dispatchers only',
39
+ description: 'Sync Dispatchers only',
40
40
  type: 'boolean',
41
41
  default: false,
42
42
  },
43
43
  cleanDispatchers: {
44
44
  demandOption: false,
45
- describe: 'Delete Dispatchers created using the CLI, that are no longer present in the local Dispatcher file',
45
+ description: 'Delete Dispatchers created using the CLI, that are no longer present in the local Dispatcher file',
46
46
  type: 'boolean',
47
47
  },
48
48
  localizations: {
49
49
  demandOption: false,
50
- describe: 'Sync localizations only',
50
+ description: 'Sync localizations only',
51
51
  type: 'boolean',
52
52
  default: false,
53
53
  },
54
54
  settings: {
55
55
  demandOption: false,
56
- describe: 'Sync service settings only',
56
+ description: 'Sync service settings only',
57
57
  type: 'boolean',
58
58
  default: false,
59
59
  },
60
60
  ignoreSchemaVerificationErrors: {
61
61
  demandOption: false,
62
- describe: 'Allow schema synchronization to proceed with validation errors.',
62
+ description: 'Allow schema synchronization to proceed with validation errors.',
63
63
  type: 'boolean',
64
64
  default: false,
65
65
  },
@@ -1,9 +1,10 @@
1
1
  /// <reference types="yargs" />
2
2
  export declare const command = "create-repo <name>";
3
- export declare const desc = "Create a new task repository";
3
+ export declare const desc = false;
4
+ export declare const deprecated = "Use \"exh tasks init\" instead, which has more consistent behavior with other \"init\" commands.";
4
5
  export declare const builder: (yargs: any) => import("yargs").Argv<import("yargs").Omit<{
5
6
  name: string;
6
- }, "repo" | "git"> & import("yargs").InferredOptionTypes<{
7
+ }, "path" | "repo" | "git"> & import("yargs").InferredOptionTypes<{
7
8
  repo: {
8
9
  description: string;
9
10
  type: "string";
@@ -14,9 +15,15 @@ export declare const builder: (yargs: any) => import("yargs").Argv<import("yargs
14
15
  type: "boolean";
15
16
  default: boolean;
16
17
  };
18
+ path: {
19
+ description: string;
20
+ type: "string";
21
+ default: string;
22
+ };
17
23
  }>>;
18
- export declare const handler: ({ name, repo, git }: {
24
+ export declare const handler: ({ name, repo, git, path }: {
19
25
  name: any;
20
26
  repo: any;
21
27
  git: any;
28
+ path: any;
22
29
  }) => Promise<void>;
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handler = exports.builder = exports.desc = exports.command = void 0;
3
+ exports.handler = exports.builder = exports.deprecated = exports.desc = exports.command = void 0;
4
4
  const util_1 = require("../../helpers/util");
5
5
  const tasksService = require("../../services/tasks");
6
6
  exports.command = 'create-repo <name>';
7
- exports.desc = 'Create a new task repository';
7
+ exports.desc = false;
8
+ exports.deprecated = 'Use "exh tasks init" instead, which has more consistent behavior with other "init" commands.';
8
9
  const builder = (yargs) => (0, util_1.epilogue)(yargs)
9
10
  .positional('name', {
10
11
  demandOption: true,
@@ -22,9 +23,14 @@ const builder = (yargs) => (0, util_1.epilogue)(yargs)
22
23
  type: 'boolean',
23
24
  default: false,
24
25
  },
26
+ path: {
27
+ description: 'the path where the new repo/task should be created',
28
+ type: 'string',
29
+ default: './',
30
+ },
25
31
  });
26
32
  exports.builder = builder;
27
- const handler = async ({ name, repo, git }) => {
28
- await tasksService.createRepo({ name, repo, git });
33
+ const handler = async ({ name, repo, git, path }) => {
34
+ await tasksService.init({ name, repo, git, path });
29
35
  };
30
36
  exports.handler = handler;
@@ -0,0 +1,22 @@
1
+ /// <reference types="yargs" />
2
+ export declare const command = "init <name>";
3
+ export declare const desc = "Create a new task";
4
+ export declare const builder: (yargs: any) => import("yargs").Argv<import("yargs").Omit<{
5
+ name: string;
6
+ }, "path" | "repo"> & import("yargs").InferredOptionTypes<{
7
+ repo: {
8
+ description: string;
9
+ type: "string";
10
+ default: string;
11
+ };
12
+ path: {
13
+ description: string;
14
+ type: "string";
15
+ default: string;
16
+ };
17
+ }>>;
18
+ export declare const handler: ({ name, repo, path }: {
19
+ name: any;
20
+ repo: any;
21
+ path: any;
22
+ }) => Promise<void>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handler = exports.builder = exports.desc = exports.command = void 0;
4
+ const util_1 = require("../../helpers/util");
5
+ const tasksService = require("../../services/tasks");
6
+ exports.command = 'init <name>';
7
+ exports.desc = 'Create a new task';
8
+ const builder = (yargs) => (0, util_1.epilogue)(yargs)
9
+ .positional('name', {
10
+ demandOption: true,
11
+ description: 'The name of the new task',
12
+ type: 'string',
13
+ })
14
+ .options({
15
+ repo: {
16
+ description: 'Git repository template to clone',
17
+ type: 'string',
18
+ default: 'https://github.com/ExtraHorizon/template-task',
19
+ },
20
+ path: {
21
+ description: 'the path where the new task should be created',
22
+ type: 'string',
23
+ default: './tasks',
24
+ },
25
+ });
26
+ exports.builder = builder;
27
+ const handler = async ({ name, repo, path }) => {
28
+ await tasksService.init({ name, repo, path });
29
+ };
30
+ exports.handler = handler;
@@ -4,45 +4,45 @@ export declare const desc = "Sync a task. Will create the task first if it doesn
4
4
  export declare const builder: (yargs: any) => import("yargs").Argv<import("yargs").Omit<{}, "description" | "code" | "name" | "path" | "entryPoint" | "runtime" | "env" | "timeLimit" | "memoryLimit" | "executionPermission" | "defaultPriority"> & import("yargs").InferredOptionTypes<{
5
5
  path: {
6
6
  demandOption: false;
7
- describe: string;
7
+ description: string;
8
8
  type: "string";
9
9
  };
10
10
  name: {
11
11
  demandOption: false;
12
- describe: string;
12
+ description: string;
13
13
  type: "string";
14
14
  };
15
15
  code: {
16
16
  demandOption: false;
17
- describe: string;
17
+ description: string;
18
18
  type: "string";
19
19
  };
20
20
  entryPoint: {
21
21
  demandOption: false;
22
- describe: string;
22
+ description: string;
23
23
  type: "string";
24
24
  };
25
25
  runtime: {
26
26
  demandOption: false;
27
- describe: string;
27
+ description: string;
28
28
  choices: string[];
29
29
  type: "string";
30
30
  };
31
31
  description: {
32
- describe: string;
32
+ description: string;
33
33
  type: "string";
34
34
  default: string;
35
35
  };
36
36
  timeLimit: {
37
- describe: string;
37
+ description: string;
38
38
  type: "number";
39
39
  };
40
40
  memoryLimit: {
41
- describe: string;
41
+ description: string;
42
42
  type: "number";
43
43
  };
44
44
  env: {
45
- describe: string;
45
+ description: string;
46
46
  type: "string";
47
47
  default: any[];
48
48
  };