@flowcore/cli 4.13.5 → 4.14.1
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/CHANGELOG.md +19 -0
- package/README.md +33 -11
- package/dist/commands/update.d.ts +6 -0
- package/dist/commands/update.js +41 -0
- package/dist/hooks/init/check-updates.d.ts +3 -0
- package/dist/hooks/init/check-updates.js +57 -0
- package/oclif.manifest.json +24 -1
- package/package.json +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,25 @@
|
|
|
10
10
|
|
|
11
11
|
* added description to start that includes week ([58687a7](https://github.com/flowcore-io/flowcore-cli/commit/58687a7bbb66aaa5d6da26af88e555cbb1e72467))
|
|
12
12
|
|
|
13
|
+
## [4.14.1](https://github.com/flowcore-io/flowcore-cli/compare/v4.14.0...v4.14.1) (2025-06-06)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* **package:** :arrow_up: update @flowcore/cli-plugin-core to version 5.7.0 ([c724dce](https://github.com/flowcore-io/flowcore-cli/commit/c724dcea1c9b7c625d199b1f5b443e1292442470))
|
|
19
|
+
|
|
20
|
+
## [4.14.0](https://github.com/flowcore-io/flowcore-cli/compare/v4.13.5...v4.14.0) (2025-05-22)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* **update:** :sparkles: add update command and check for updates hook ([0ef3af6](https://github.com/flowcore-io/flowcore-cli/commit/0ef3af694909aec6dad5081f57ddd70cb876be30))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **update:** :art: simplify error handling in update command and check-updates hook ([abaf50d](https://github.com/flowcore-io/flowcore-cli/commit/abaf50d392ff83e467328c81f271a1e4b968a94a))
|
|
31
|
+
|
|
13
32
|
## [4.13.5](https://github.com/flowcore-io/flowcore-cli/compare/v4.13.4...v4.13.5) (2025-05-22)
|
|
14
33
|
|
|
15
34
|
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ $ npm install -g @flowcore/cli
|
|
|
18
18
|
$ flowcore COMMAND
|
|
19
19
|
running command...
|
|
20
20
|
$ flowcore (--version)
|
|
21
|
-
@flowcore/cli/4.
|
|
21
|
+
@flowcore/cli/4.14.1 linux-x64 node-v20.16.0
|
|
22
22
|
$ flowcore --help [COMMAND]
|
|
23
23
|
USAGE
|
|
24
24
|
$ flowcore COMMAND
|
|
@@ -84,6 +84,7 @@ USAGE
|
|
|
84
84
|
* [`flowcore scenario local`](#flowcore-scenario-local)
|
|
85
85
|
* [`flowcore stream STREAM`](#flowcore-stream-stream)
|
|
86
86
|
* [`flowcore stream http STREAM`](#flowcore-stream-http-stream)
|
|
87
|
+
* [`flowcore update`](#flowcore-update)
|
|
87
88
|
* [`flowcore version`](#flowcore-version)
|
|
88
89
|
* [`flowcore whoami`](#flowcore-whoami)
|
|
89
90
|
|
|
@@ -108,7 +109,7 @@ EXAMPLES
|
|
|
108
109
|
$ flowcore apply -f ./path/to/manifest.yml
|
|
109
110
|
```
|
|
110
111
|
|
|
111
|
-
_See code: [src/commands/apply.ts](https://github.com/flowcore-io/flowcore-cli/blob/v4.
|
|
112
|
+
_See code: [src/commands/apply.ts](https://github.com/flowcore-io/flowcore-cli/blob/v4.14.1/src/commands/apply.ts)_
|
|
112
113
|
|
|
113
114
|
## `flowcore auth delete key API_KEY_NAME`
|
|
114
115
|
|
|
@@ -561,7 +562,7 @@ EXAMPLES
|
|
|
561
562
|
cat ./path/to/manifest.yml | flowcore delete -f -
|
|
562
563
|
```
|
|
563
564
|
|
|
564
|
-
_See code: [src/commands/delete.ts](https://github.com/flowcore-io/flowcore-cli/blob/v4.
|
|
565
|
+
_See code: [src/commands/delete.ts](https://github.com/flowcore-io/flowcore-cli/blob/v4.14.1/src/commands/delete.ts)_
|
|
565
566
|
|
|
566
567
|
## `flowcore delete policy NAME`
|
|
567
568
|
|
|
@@ -628,7 +629,7 @@ EXAMPLES
|
|
|
628
629
|
$ flowcore diff -f ./path/to/manifest.yml
|
|
629
630
|
```
|
|
630
631
|
|
|
631
|
-
_See code: [src/commands/diff.ts](https://github.com/flowcore-io/flowcore-cli/blob/v4.
|
|
632
|
+
_See code: [src/commands/diff.ts](https://github.com/flowcore-io/flowcore-cli/blob/v4.14.1/src/commands/diff.ts)_
|
|
632
633
|
|
|
633
634
|
## `flowcore edit policy NAME`
|
|
634
635
|
|
|
@@ -872,7 +873,7 @@ EXAMPLES
|
|
|
872
873
|
$ flowcore info
|
|
873
874
|
```
|
|
874
875
|
|
|
875
|
-
_See code: [src/commands/info.ts](https://github.com/flowcore-io/flowcore-cli/blob/v4.
|
|
876
|
+
_See code: [src/commands/info.ts](https://github.com/flowcore-io/flowcore-cli/blob/v4.14.1/src/commands/info.ts)_
|
|
876
877
|
|
|
877
878
|
## `flowcore login`
|
|
878
879
|
|
|
@@ -1514,13 +1515,14 @@ Stream events from a datacore running on the Flowcore Platform and output them t
|
|
|
1514
1515
|
|
|
1515
1516
|
```
|
|
1516
1517
|
USAGE
|
|
1517
|
-
$ flowcore stream STREAM [-e <value>] [-j] [-l] [-m <value>] [-p] [-c] [-s <value>] [-z <value>] [-i]
|
|
1518
|
-
[--profile <value>]
|
|
1518
|
+
$ flowcore stream STREAM [-e <value>] [-j] [-l] [-m <value>] [-p] [-c] [-s <value>] [-z <value>] [-i] [-x
|
|
1519
|
+
<value>] [-b <value>] [--profile <value>]
|
|
1519
1520
|
|
|
1520
1521
|
ARGUMENTS
|
|
1521
1522
|
STREAM stream url to connect to
|
|
1522
1523
|
|
|
1523
1524
|
FLAGS
|
|
1525
|
+
-b, --bufferSize=<value> Buffer size for event processing
|
|
1524
1526
|
-c, --scan Scan the full time range
|
|
1525
1527
|
-e, --end=<value> End time to stream to, example: 2024-07-08T12:20:44Z, 1y, 1m, 1w, 1d, 1h, now
|
|
1526
1528
|
-i, --includeSensitiveData Include sensitive data in the output
|
|
@@ -1529,6 +1531,7 @@ FLAGS
|
|
|
1529
1531
|
-m, --max=<value> Maximum number of events to send to the destination
|
|
1530
1532
|
-p, --payload Only send the event payload to the destination
|
|
1531
1533
|
-s, --start=<value> Start time bucket to stream from, example: (2024-07-08T12:20:44Z, 1y, 1m, 1w, 1d, 1h, now)
|
|
1534
|
+
-x, --concurrency=<value> [default: 1] Number of events to process concurrently
|
|
1532
1535
|
-z, --pageSize=<value> [default: 10000] Number of events to fetch per page
|
|
1533
1536
|
--profile=<value> Specify the configuration profile to use
|
|
1534
1537
|
|
|
@@ -1555,7 +1558,7 @@ EXAMPLES
|
|
|
1555
1558
|
$ flowcore stream "https://flowcore.io/<org>/<data core>/<flow type>/[<event type1>,<event type2>,<event type3>].stream" -s 3m
|
|
1556
1559
|
```
|
|
1557
1560
|
|
|
1558
|
-
_See code: [@flowcore/cli-plugin-core](https://github.com/flowcore/flowcore-cli-plugin-core/blob/v5.
|
|
1561
|
+
_See code: [@flowcore/cli-plugin-core](https://github.com/flowcore/flowcore-cli-plugin-core/blob/v5.7.0/src/commands/stream.ts)_
|
|
1559
1562
|
|
|
1560
1563
|
## `flowcore stream http STREAM`
|
|
1561
1564
|
|
|
@@ -1563,14 +1566,15 @@ Stream events from a datacore running on the Flowcore Platform and stream to a h
|
|
|
1563
1566
|
|
|
1564
1567
|
```
|
|
1565
1568
|
USAGE
|
|
1566
|
-
$ flowcore stream http STREAM [-e <value>] [-j] [-l] [-m <value>] [-p] [-c] [-s <value>] [-z <value>] [-i]
|
|
1567
|
-
[--profile <value>] [-d <value>] [-H <value>] [-t <value>]
|
|
1569
|
+
$ flowcore stream http STREAM [-e <value>] [-j] [-l] [-m <value>] [-p] [-c] [-s <value>] [-z <value>] [-i] [-x
|
|
1570
|
+
<value>] [-b <value>] [--profile <value>] [-d <value>] [-H <value>] [-t <value>]
|
|
1568
1571
|
|
|
1569
1572
|
ARGUMENTS
|
|
1570
1573
|
STREAM stream url to connect to
|
|
1571
1574
|
|
|
1572
1575
|
FLAGS
|
|
1573
1576
|
-H, --header=<value>... [default: ] header to send with the request, example: (-H 'Authorization: Bearer TOKEN')
|
|
1577
|
+
-b, --bufferSize=<value> Buffer size for event processing
|
|
1574
1578
|
-c, --scan Scan the full time range
|
|
1575
1579
|
-d, --destination=<value> [default: http://localhost:3000/transform] Destination to send events to
|
|
1576
1580
|
-e, --end=<value> End time to stream to, example: 2024-07-08T12:20:44Z, 1y, 1m, 1w, 1d, 1h, now
|
|
@@ -1581,6 +1585,7 @@ FLAGS
|
|
|
1581
1585
|
-p, --payload Only send the event payload to the destination
|
|
1582
1586
|
-s, --start=<value> Start time bucket to stream from, example: (2024-07-08T12:20:44Z, 1y, 1m, 1w, 1d, 1h, now)
|
|
1583
1587
|
-t, --timeout=<value> [default: 5000] Timeout in milliseconds to wait for a response from the destination
|
|
1588
|
+
-x, --concurrency=<value> [default: 1] Number of events to process concurrently
|
|
1584
1589
|
-z, --pageSize=<value> [default: 10000] Number of events to fetch per page
|
|
1585
1590
|
--profile=<value> Specify the configuration profile to use
|
|
1586
1591
|
|
|
@@ -1599,7 +1604,24 @@ EXAMPLES
|
|
|
1599
1604
|
$ flowcore stream http "https://flowcore.io/<org>/<data core>/<flow type>/[<event type1>,<event type2>,<event type3>].stream" -s 3m -d http://localhost:3000/transform
|
|
1600
1605
|
```
|
|
1601
1606
|
|
|
1602
|
-
_See code: [@flowcore/cli-plugin-core](https://github.com/flowcore/flowcore-cli-plugin-core/blob/v5.
|
|
1607
|
+
_See code: [@flowcore/cli-plugin-core](https://github.com/flowcore/flowcore-cli-plugin-core/blob/v5.7.0/src/commands/stream/http.ts)_
|
|
1608
|
+
|
|
1609
|
+
## `flowcore update`
|
|
1610
|
+
|
|
1611
|
+
Update the Flowcore CLI to the latest version
|
|
1612
|
+
|
|
1613
|
+
```
|
|
1614
|
+
USAGE
|
|
1615
|
+
$ flowcore update
|
|
1616
|
+
|
|
1617
|
+
DESCRIPTION
|
|
1618
|
+
Update the Flowcore CLI to the latest version
|
|
1619
|
+
|
|
1620
|
+
EXAMPLES
|
|
1621
|
+
$ flowcore update
|
|
1622
|
+
```
|
|
1623
|
+
|
|
1624
|
+
_See code: [src/commands/update.ts](https://github.com/flowcore-io/flowcore-cli/blob/v4.14.1/src/commands/update.ts)_
|
|
1603
1625
|
|
|
1604
1626
|
## `flowcore version`
|
|
1605
1627
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import { exec } from 'node:child_process';
|
|
3
|
+
import { promisify } from 'node:util';
|
|
4
|
+
const execAsync = promisify(exec);
|
|
5
|
+
export default class Update extends Command {
|
|
6
|
+
static description = 'Update the Flowcore CLI to the latest version';
|
|
7
|
+
static examples = [
|
|
8
|
+
'$ flowcore update',
|
|
9
|
+
];
|
|
10
|
+
async run() {
|
|
11
|
+
const { config } = this;
|
|
12
|
+
const packageName = config.pjson.name;
|
|
13
|
+
this.log('Checking for updates...');
|
|
14
|
+
try {
|
|
15
|
+
// Get current and latest version
|
|
16
|
+
const currentVersion = config.version;
|
|
17
|
+
const { stdout: latestVersionStdout } = await execAsync(`npm view ${packageName} version`);
|
|
18
|
+
const latestVersion = latestVersionStdout.trim();
|
|
19
|
+
if (latestVersion === currentVersion) {
|
|
20
|
+
this.log(`You're already using the latest version (${currentVersion}).`);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
this.log(`Updating from ${currentVersion} to ${latestVersion}...`);
|
|
24
|
+
// Check if global or local installation and update accordingly
|
|
25
|
+
try {
|
|
26
|
+
await execAsync(`npm list -g ${packageName}`);
|
|
27
|
+
// If we reached here, it's a global installation
|
|
28
|
+
await execAsync(`npm install -g ${packageName}@latest`);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
// It's a local installation or error occurred
|
|
32
|
+
await execAsync(`npm install ${packageName}@latest`);
|
|
33
|
+
}
|
|
34
|
+
this.log(`✅ Successfully updated to version ${latestVersion}!`);
|
|
35
|
+
this.log('Please restart any running CLI processes to use the new version.');
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
this.error(`Failed to update: ${error instanceof Error ? error.message : String(error)}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { exec } from 'node:child_process';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { promisify } from 'node:util';
|
|
5
|
+
const execAsync = promisify(exec);
|
|
6
|
+
// The update check is done by the @oclif/plugin-warn-if-update-available plugin
|
|
7
|
+
// This hook just ensures it runs each time and can add custom behavior
|
|
8
|
+
const hook = async function ({ config }) {
|
|
9
|
+
// Only run this hook if not in a test environment
|
|
10
|
+
if (process.env.NODE_ENV === 'test')
|
|
11
|
+
return;
|
|
12
|
+
try {
|
|
13
|
+
// Get current package info
|
|
14
|
+
const pkg = config.pjson;
|
|
15
|
+
const currentVersion = pkg.version;
|
|
16
|
+
// Check if we've recently looked for updates (to avoid checking on every command)
|
|
17
|
+
const cacheDir = path.join(config.cacheDir, 'update-check');
|
|
18
|
+
const cacheFile = path.join(cacheDir, 'last-check');
|
|
19
|
+
let lastCheck = 0;
|
|
20
|
+
try {
|
|
21
|
+
if (fs.existsSync(cacheFile)) {
|
|
22
|
+
lastCheck = Number.parseInt(fs.readFileSync(cacheFile, 'utf8'), 10);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
// If we can't read the cache file, continue with check
|
|
27
|
+
}
|
|
28
|
+
const now = Date.now();
|
|
29
|
+
const checkInterval = 1000 * 60 * 60 * 24; // 1 day in milliseconds
|
|
30
|
+
// Only check once per day
|
|
31
|
+
if (now - lastCheck < checkInterval) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
// Write the current time to the cache file
|
|
35
|
+
try {
|
|
36
|
+
if (!fs.existsSync(cacheDir)) {
|
|
37
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
38
|
+
}
|
|
39
|
+
fs.writeFileSync(cacheFile, now.toString());
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// If we can't write to the cache file, continue anyway
|
|
43
|
+
}
|
|
44
|
+
// Make a request to npm to get the latest version
|
|
45
|
+
const { stdout } = await execAsync(`npm view ${pkg.name} version`);
|
|
46
|
+
const latestVersion = stdout.trim();
|
|
47
|
+
// Compare versions
|
|
48
|
+
if (latestVersion !== currentVersion) {
|
|
49
|
+
// The @oclif/plugin-warn-if-update-available plugin will handle the notification
|
|
50
|
+
// This hook just makes sure the check happens regularly
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// Silently fail on error - we don't want to break the CLI if update check fails
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
export default hook;
|
package/oclif.manifest.json
CHANGED
|
@@ -171,7 +171,30 @@
|
|
|
171
171
|
"commands",
|
|
172
172
|
"info.js"
|
|
173
173
|
]
|
|
174
|
+
},
|
|
175
|
+
"update": {
|
|
176
|
+
"aliases": [],
|
|
177
|
+
"args": {},
|
|
178
|
+
"description": "Update the Flowcore CLI to the latest version",
|
|
179
|
+
"examples": [
|
|
180
|
+
"$ flowcore update"
|
|
181
|
+
],
|
|
182
|
+
"flags": {},
|
|
183
|
+
"hasDynamicHelp": false,
|
|
184
|
+
"hiddenAliases": [],
|
|
185
|
+
"id": "update",
|
|
186
|
+
"pluginAlias": "@flowcore/cli",
|
|
187
|
+
"pluginName": "@flowcore/cli",
|
|
188
|
+
"pluginType": "core",
|
|
189
|
+
"strict": true,
|
|
190
|
+
"enableJsonFlag": false,
|
|
191
|
+
"isESM": true,
|
|
192
|
+
"relativePath": [
|
|
193
|
+
"dist",
|
|
194
|
+
"commands",
|
|
195
|
+
"update.js"
|
|
196
|
+
]
|
|
174
197
|
}
|
|
175
198
|
},
|
|
176
|
-
"version": "4.
|
|
199
|
+
"version": "4.14.1"
|
|
177
200
|
}
|
package/package.json
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@datastructures-js/queue": "^4.2.3",
|
|
8
|
+
"@flowcore/cli": "^4.13.5",
|
|
8
9
|
"@flowcore/cli-plugin-ai": "^1.1.2",
|
|
9
10
|
"@flowcore/cli-plugin-auth-management": "^1.4.0",
|
|
10
11
|
"@flowcore/cli-plugin-config": "^2.5.0",
|
|
11
|
-
"@flowcore/cli-plugin-core": "^5.
|
|
12
|
+
"@flowcore/cli-plugin-core": "^5.7.0",
|
|
12
13
|
"@flowcore/cli-plugin-data-core": "^3.3.0",
|
|
13
14
|
"@flowcore/cli-plugin-generator": "^1.6.0",
|
|
14
15
|
"@flowcore/cli-plugin-iam": "^1.7.0",
|
|
@@ -98,7 +99,10 @@
|
|
|
98
99
|
},
|
|
99
100
|
"topicSeparator": " ",
|
|
100
101
|
"hooks": {
|
|
101
|
-
"init":
|
|
102
|
+
"init": [
|
|
103
|
+
"./dist/hooks/init/add-jsr",
|
|
104
|
+
"./dist/hooks/init/check-updates"
|
|
105
|
+
]
|
|
102
106
|
}
|
|
103
107
|
},
|
|
104
108
|
"repository": "flowcore-io/flowcore-cli",
|
|
@@ -115,7 +119,7 @@
|
|
|
115
119
|
"prestart": "npm run build",
|
|
116
120
|
"update-schema": "rover graph introspect https://graph.api.staging.flowcore.io/graphql -o schema.gql"
|
|
117
121
|
},
|
|
118
|
-
"version": "4.
|
|
122
|
+
"version": "4.14.1",
|
|
119
123
|
"bugs": "https://github.com/flowcore-io/flowcore-cli/issues",
|
|
120
124
|
"keywords": [
|
|
121
125
|
"flowcore",
|