@flowcore/cli 1.2.0 → 1.3.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@
7
7
 
8
8
 
9
9
 
10
+ ## [1.3.0](https://github.com/flowcore-io/flowcore-cli/compare/v1.2.0...v1.3.0) (2024-01-09)
11
+
12
+
13
+ ### Features
14
+
15
+ * added timeout for destination as flag ([f731aac](https://github.com/flowcore-io/flowcore-cli/commit/f731aac025262179af1fd56e2ab2477a674635f9))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * added description to start that includes week ([58687a7](https://github.com/flowcore-io/flowcore-cli/commit/58687a7bbb66aaa5d6da26af88e555cbb1e72467))
21
+
10
22
  ## [1.2.0](https://github.com/flowcore-io/flowcore-cli/compare/v1.1.2...v1.2.0) (2024-01-09)
11
23
 
12
24
 
package/README.md CHANGED
@@ -17,7 +17,7 @@ $ npm install -g @flowcore/cli
17
17
  $ flowcore COMMAND
18
18
  running command...
19
19
  $ flowcore (--version)
20
- @flowcore/cli/1.2.0 linux-x64 node-v20.10.0
20
+ @flowcore/cli/1.3.0 linux-x64 node-v20.10.0
21
21
  $ flowcore --help [COMMAND]
22
22
  USAGE
23
23
  $ flowcore COMMAND
@@ -103,7 +103,7 @@ EXAMPLES
103
103
  $ flowcore config set -l https://auth.flowcore.io/realms/flowcore/.well-known/openid-configuration -c my-client-id -p
104
104
  ```
105
105
 
106
- _See code: [src/commands/config/set.ts](https://github.com/flowcore-io/flowcore-cli/blob/v1.2.0/src/commands/config/set.ts)_
106
+ _See code: [src/commands/config/set.ts](https://github.com/flowcore-io/flowcore-cli/blob/v1.3.0/src/commands/config/set.ts)_
107
107
 
108
108
  ## `flowcore config show`
109
109
 
@@ -123,7 +123,7 @@ EXAMPLES
123
123
  $ flowcore config show
124
124
  ```
125
125
 
126
- _See code: [src/commands/config/show.ts](https://github.com/flowcore-io/flowcore-cli/blob/v1.2.0/src/commands/config/show.ts)_
126
+ _See code: [src/commands/config/show.ts](https://github.com/flowcore-io/flowcore-cli/blob/v1.3.0/src/commands/config/show.ts)_
127
127
 
128
128
  ## `flowcore help [COMMANDS]`
129
129
 
@@ -166,7 +166,7 @@ EXAMPLES
166
166
  $ flowcore login --port 8080
167
167
  ```
168
168
 
169
- _See code: [src/commands/login.ts](https://github.com/flowcore-io/flowcore-cli/blob/v1.2.0/src/commands/login.ts)_
169
+ _See code: [src/commands/login.ts](https://github.com/flowcore-io/flowcore-cli/blob/v1.3.0/src/commands/login.ts)_
170
170
 
171
171
  ## `flowcore plugins`
172
172
 
@@ -449,7 +449,7 @@ Stream events from a datacore running on the Flowcore Platform
449
449
 
450
450
  ```
451
451
  USAGE
452
- $ flowcore stream STREAM [--profile <value>] [-d <value>] [-j] [-l] [-o http|log] [-s <value>]
452
+ $ flowcore stream STREAM [--profile <value>] [-d <value>] [-j] [-l] [-o http|log] [-s <value>] [-t <value>]
453
453
 
454
454
  ARGUMENTS
455
455
  STREAM stream url to connect to
@@ -460,7 +460,8 @@ FLAGS
460
460
  -l, --[no-]live Change to live mode when reaching last time bucket
461
461
  -o, --output=<option> [default: http] Output format
462
462
  <options: http|log>
463
- -s, --start=<value> Start time bucket to stream from, example: (1y, 1m, 1d, 1h)
463
+ -s, --start=<value> Start time bucket to stream from, example: (1y, 1m, 1w, 1d, 1h)
464
+ -t, --timeout=<value> [default: 5000] Timeout in milliseconds to wait for a response from the destination
464
465
  --profile=<value> Specify the configuration profile to use
465
466
 
466
467
  DESCRIPTION
@@ -476,7 +477,7 @@ EXAMPLES
476
477
  $ flowcore stream https://flowcore.io/<org>/<data core>/<flow type>/[<event type1>,<event type2>,<event type3>].stream -o log -s 3m
477
478
  ```
478
479
 
479
- _See code: [src/commands/stream.ts](https://github.com/flowcore-io/flowcore-cli/blob/v1.2.0/src/commands/stream.ts)_
480
+ _See code: [src/commands/stream.ts](https://github.com/flowcore-io/flowcore-cli/blob/v1.3.0/src/commands/stream.ts)_
480
481
 
481
482
  ## `flowcore version`
482
483
 
@@ -513,5 +514,5 @@ DESCRIPTION
513
514
  Check what user you are logged in as
514
515
  ```
515
516
 
516
- _See code: [src/commands/whoami.ts](https://github.com/flowcore-io/flowcore-cli/blob/v1.2.0/src/commands/whoami.ts)_
517
+ _See code: [src/commands/whoami.ts](https://github.com/flowcore-io/flowcore-cli/blob/v1.3.0/src/commands/whoami.ts)_
517
518
  <!-- commandsstop -->
@@ -11,6 +11,7 @@ export default class Stream extends BaseCommand<typeof Stream> {
11
11
  live: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
12
12
  output: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
13
13
  start: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
14
+ timeout: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
14
15
  };
15
16
  run(): Promise<void>;
16
17
  private processEvents;
@@ -29,7 +29,8 @@ export default class Stream extends BaseCommand {
29
29
  json: Flags.boolean({ char: 'j', description: 'Output json only' }),
30
30
  live: Flags.boolean({ allowNo: true, char: 'l', default: true, description: 'Change to live mode when reaching last time bucket' }),
31
31
  output: Flags.string({ char: 'o', default: 'http', description: 'Output format', options: ['http', 'log'] }),
32
- start: Flags.string({ char: 's', description: 'Start time bucket to stream from, example: (1y, 1m, 1d, 1h)' }),
32
+ start: Flags.string({ char: 's', description: 'Start time bucket to stream from, example: (1y, 1m, 1w, 1d, 1h)' }),
33
+ timeout: Flags.integer({ char: 't', default: 5000, description: 'Timeout in milliseconds to wait for a response from the destination' }),
33
34
  };
34
35
  async run() {
35
36
  const config = this.cliConfiguration.getConfig();
@@ -130,7 +131,7 @@ export default class Stream extends BaseCommand {
130
131
  },
131
132
  method: "POST",
132
133
  }),
133
- new Promise((resolve, reject) => { setTimeout(() => reject(new Error("Timeout waiting for response")), 5000); }),]);
134
+ new Promise((resolve, reject) => { setTimeout(() => reject(new Error("Timeout waiting for response")), this.flags.timeout); }),]);
134
135
  if (!result.ok) {
135
136
  !this.flags.json && this.warn(`Error sending event to ${destination}: ${result.statusText}`);
136
137
  }
@@ -154,7 +155,7 @@ export default class Stream extends BaseCommand {
154
155
  }
155
156
  }
156
157
  setTimeBucket(date, start) {
157
- const parts = start.match(/(\d+)([dhmy])/i);
158
+ const parts = start.match(/(\d+)([dhmwy])/i);
158
159
  if (!parts) {
159
160
  ux.error(`Invalid start time bucket, generated from ${start}`);
160
161
  }
@@ -103,11 +103,20 @@
103
103
  },
104
104
  "start": {
105
105
  "char": "s",
106
- "description": "Start time bucket to stream from, example: (1y, 1m, 1d, 1h)",
106
+ "description": "Start time bucket to stream from, example: (1y, 1m, 1w, 1d, 1h)",
107
107
  "name": "start",
108
108
  "hasDynamicHelp": false,
109
109
  "multiple": false,
110
110
  "type": "option"
111
+ },
112
+ "timeout": {
113
+ "char": "t",
114
+ "description": "Timeout in milliseconds to wait for a response from the destination",
115
+ "name": "timeout",
116
+ "default": 5000,
117
+ "hasDynamicHelp": false,
118
+ "multiple": false,
119
+ "type": "option"
111
120
  }
112
121
  },
113
122
  "hasDynamicHelp": false,
@@ -259,5 +268,5 @@
259
268
  ]
260
269
  }
261
270
  },
262
- "version": "1.2.0"
271
+ "version": "1.3.0"
263
272
  }
package/package.json CHANGED
@@ -86,7 +86,7 @@
86
86
  "prestart": "npm run build",
87
87
  "update-schema": "rover graph introspect https://graph.api.staging.flowcore.io/graphql -o schema.gql"
88
88
  },
89
- "version": "1.2.0",
89
+ "version": "1.3.0",
90
90
  "bugs": "https://github.com/flowcore-io/flowcore-cli/issues",
91
91
  "keywords": [
92
92
  "flowcore",