@forgehive/forge-cli 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/runner.js CHANGED
@@ -19,6 +19,7 @@ const replay_1 = require("./tasks/task/replay");
19
19
  const list_1 = require("./tasks/task/list");
20
20
  const describe_1 = require("./tasks/task/describe");
21
21
  const fingerprint_1 = require("./tasks/task/fingerprint");
22
+ const invoke_1 = require("./tasks/task/invoke");
22
23
  const create_1 = require("./tasks/runner/create");
23
24
  const remove_2 = require("./tasks/runner/remove");
24
25
  const bundle_1 = require("./tasks/runner/bundle");
@@ -48,6 +49,7 @@ runner.load('task:replay', replay_1.replay);
48
49
  runner.load('task:list', list_1.list);
49
50
  runner.load('task:describe', describe_1.describe);
50
51
  runner.load('task:fingerprint', fingerprint_1.fingerprint);
52
+ runner.load('task:invoke', invoke_1.invoke);
51
53
  // Runner commands
52
54
  runner.load('runner:create', create_1.create);
53
55
  runner.load('runner:remove', remove_2.remove);
@@ -97,6 +99,13 @@ runner.setHandler(async (data) => {
97
99
  uuid
98
100
  });
99
101
  }
102
+ else if (taskName === 'task:invoke') {
103
+ const { json } = args;
104
+ result = await task.run({
105
+ descriptorName: action,
106
+ json
107
+ });
108
+ }
100
109
  else if (taskName === 'task:replay') {
101
110
  const { path, cache } = args;
102
111
  result = await task.run({
@@ -1,3 +1,4 @@
1
+ import { type ExecutionRecord } from '@forgehive/hive-sdk';
1
2
  import { type ForgeConf, type Profile } from '../types';
2
3
  export declare const run: import("@forgehive/task").TaskInstanceType<(argv: {
3
4
  descriptorName: string;
@@ -16,10 +17,7 @@ export declare const run: import("@forgehive/task").TaskInstanceType<(argv: {
16
17
  }) => Promise<Promise<any>>;
17
18
  verifyLogFolder: (logsPath: string) => Promise<boolean>;
18
19
  ensureBuildsFolder: () => Promise<string>;
19
- sendLogToAPI: (profile: Profile, projectName: string, taskName: string, logItem: {
20
- input: unknown;
21
- metadata?: Record<string, string>;
22
- }) => Promise<boolean>;
20
+ sendLogToAPI: (profile: Profile, projectName: string, record: ExecutionRecord) => Promise<boolean>;
23
21
  }>) => Promise<any>, {
24
22
  loadConf: (args: {}) => Promise<Promise<ForgeConf>>;
25
23
  loadCurrentProfile: (args: {}) => Promise<Promise<Profile>>;
@@ -34,8 +32,5 @@ export declare const run: import("@forgehive/task").TaskInstanceType<(argv: {
34
32
  }) => Promise<Promise<any>>;
35
33
  verifyLogFolder: (logsPath: string) => Promise<boolean>;
36
34
  ensureBuildsFolder: () => Promise<string>;
37
- sendLogToAPI: (profile: Profile, projectName: string, taskName: string, logItem: {
38
- input: unknown;
39
- metadata?: Record<string, string>;
40
- }) => Promise<boolean>;
35
+ sendLogToAPI: (profile: Profile, projectName: string, record: ExecutionRecord) => Promise<boolean>;
41
36
  }>;
@@ -51,7 +51,7 @@ const boundaries = {
51
51
  }
52
52
  return buildsPath;
53
53
  },
54
- sendLogToAPI: async (profile, projectName, taskName, logItem) => {
54
+ sendLogToAPI: async (profile, projectName, record) => {
55
55
  try {
56
56
  const config = {
57
57
  projectName,
@@ -63,7 +63,7 @@ const boundaries = {
63
63
  }
64
64
  };
65
65
  const client = new hive_sdk_1.HiveLogClient(config);
66
- const result = await client.sendLog(taskName, logItem);
66
+ const result = await client.sendLog(record);
67
67
  if (result === 'success') {
68
68
  console.log('===============================================');
69
69
  console.log('Log sent to API... ', profile.name, profile.url);
@@ -152,7 +152,7 @@ exports.run = (0, task_1.createTask)({
152
152
  await tape.save();
153
153
  if (profile) {
154
154
  try {
155
- await sendLogToAPI(profile, projectName, descriptorName, logItem);
155
+ await sendLogToAPI(profile, projectName, logItem);
156
156
  }
157
157
  catch (e) {
158
158
  console.error('Failed to send log to API:', e);
@@ -17,6 +17,7 @@ export interface Infra {
17
17
  export interface ForgeConf {
18
18
  project: {
19
19
  name: string;
20
+ uuid?: string;
20
21
  };
21
22
  paths: {
22
23
  logs: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgehive/forge-cli",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "TypeScript CLI application",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -10,11 +10,11 @@
10
10
  "publishConfig": {
11
11
  "access": "public",
12
12
  "dependencies": {
13
- "@forgehive/hive-sdk": "^0.0.3",
14
- "@forgehive/record-tape": "^0.2.2",
15
- "@forgehive/runner": "^0.2.2",
13
+ "@forgehive/hive-sdk": "^0.1.0",
14
+ "@forgehive/record-tape": "^0.2.3",
15
+ "@forgehive/runner": "^0.2.3",
16
16
  "@forgehive/schema": "^0.1.4",
17
- "@forgehive/task": "^0.2.2",
17
+ "@forgehive/task": "^0.2.3",
18
18
  "esbuild": "^0.25.0",
19
19
  "handlebars": "^4.7.8",
20
20
  "minimist": "^1.2.8"
@@ -27,11 +27,11 @@
27
27
  "esbuild": "^0.25.0",
28
28
  "handlebars": "^4.7.8",
29
29
  "minimist": "^1.2.8",
30
- "@forgehive/hive-sdk": "0.0.3",
31
- "@forgehive/runner": "0.2.2",
32
- "@forgehive/record-tape": "0.2.2",
30
+ "@forgehive/hive-sdk": "0.1.0",
31
+ "@forgehive/record-tape": "0.2.3",
32
+ "@forgehive/runner": "0.2.3",
33
33
  "@forgehive/schema": "0.1.4",
34
- "@forgehive/task": "0.2.2"
34
+ "@forgehive/task": "0.2.3"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/archiver": "^6.0.3",
@@ -10,7 +10,7 @@ import os from 'os'
10
10
  import { createTask } from '@forgehive/task'
11
11
  import { Schema } from '@forgehive/schema'
12
12
  import { RecordTape } from '@forgehive/record-tape'
13
- import { HiveLogClient } from '@forgehive/hive-sdk'
13
+ import { HiveLogClient, type ExecutionRecord } from '@forgehive/hive-sdk'
14
14
 
15
15
  import { create as bundleCreate } from '../bundle/create'
16
16
  import { load as bundleLoad } from '../bundle/load'
@@ -51,7 +51,7 @@ const boundaries = {
51
51
 
52
52
  return buildsPath
53
53
  },
54
- sendLogToAPI: async (profile: Profile, projectName: string, taskName: string, logItem: { input: unknown; metadata?: Record<string, string> }): Promise<boolean> => {
54
+ sendLogToAPI: async (profile: Profile, projectName: string, record: ExecutionRecord): Promise<boolean> => {
55
55
  try {
56
56
  const config = {
57
57
  projectName,
@@ -64,7 +64,7 @@ const boundaries = {
64
64
  }
65
65
 
66
66
  const client = new HiveLogClient(config)
67
- const result = await client.sendLog(taskName, logItem)
67
+ const result = await client.sendLog(record)
68
68
 
69
69
  if (result === 'success') {
70
70
  console.log('===============================================')
@@ -173,7 +173,7 @@ export const run = createTask({
173
173
 
174
174
  if (profile) {
175
175
  try {
176
- await sendLogToAPI(profile, projectName, descriptorName, logItem)
176
+ await sendLogToAPI(profile, projectName, logItem)
177
177
  } catch (e) {
178
178
  console.error('Failed to send log to API:', e)
179
179
  }