@roarkanalytics/cli 0.1.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/LICENSE +201 -0
- package/README.md +225 -0
- package/bin.d.ts +2 -0
- package/bin.js +14 -0
- package/commands.d.ts +5 -0
- package/commands.js +3553 -0
- package/completions.d.ts +1 -0
- package/completions.js +13 -0
- package/index.d.ts +6 -0
- package/index.js +26 -0
- package/man/roark-agent-create.1 +99 -0
- package/man/roark-agent-endpoint-create.1 +108 -0
- package/man/roark-agent-endpoint-get.1 +93 -0
- package/man/roark-agent-endpoint-list.1 +102 -0
- package/man/roark-agent-endpoint-update.1 +103 -0
- package/man/roark-agent-get.1 +93 -0
- package/man/roark-agent-list.1 +99 -0
- package/man/roark-agent-update.1 +100 -0
- package/man/roark-call-create.1 +150 -0
- package/man/roark-call-get.1 +93 -0
- package/man/roark-call-list.1 +111 -0
- package/man/roark-call-metric-list.1 +100 -0
- package/man/roark-call-sentiment-run-list.1 +93 -0
- package/man/roark-call-transcript-get.1 +97 -0
- package/man/roark-config-apply.1 +96 -0
- package/man/roark-config-diff.1 +96 -0
- package/man/roark-customer-flow-create.1 +97 -0
- package/man/roark-customer-flow-delete.1 +93 -0
- package/man/roark-customer-flow-edge-case-create.1 +112 -0
- package/man/roark-customer-flow-edge-case-delete.1 +96 -0
- package/man/roark-customer-flow-edge-case-promote.1 +96 -0
- package/man/roark-customer-flow-edge-case-update.1 +118 -0
- package/man/roark-customer-flow-get.1 +93 -0
- package/man/roark-customer-flow-graph-replace.1 +100 -0
- package/man/roark-customer-flow-happy-path-update.1 +115 -0
- package/man/roark-customer-flow-list.1 +105 -0
- package/man/roark-customer-flow-update.1 +109 -0
- package/man/roark-health.1 +89 -0
- package/man/roark-http-request-definition-create.1 +108 -0
- package/man/roark-http-request-definition-get.1 +93 -0
- package/man/roark-http-request-definition-list.1 +96 -0
- package/man/roark-http-request-definition-update.1 +109 -0
- package/man/roark-metric-collection-job-create.1 +99 -0
- package/man/roark-metric-collection-job-get.1 +93 -0
- package/man/roark-metric-collection-job-list.1 +99 -0
- package/man/roark-metric-definition-create.1 +100 -0
- package/man/roark-metric-definition-list.1 +89 -0
- package/man/roark-metric-policy-create.1 +105 -0
- package/man/roark-metric-policy-delete.1 +93 -0
- package/man/roark-metric-policy-get.1 +93 -0
- package/man/roark-metric-policy-list.1 +99 -0
- package/man/roark-metric-policy-update.1 +106 -0
- package/man/roark-simulation-environment-get.1 +93 -0
- package/man/roark-simulation-environment-list.1 +96 -0
- package/man/roark-simulation-job-get.1 +93 -0
- package/man/roark-simulation-job-lookup.1 +96 -0
- package/man/roark-simulation-persona-create.1 +156 -0
- package/man/roark-simulation-persona-get.1 +93 -0
- package/man/roark-simulation-persona-list.1 +99 -0
- package/man/roark-simulation-persona-update.1 +160 -0
- package/man/roark-simulation-plan-create.1 +138 -0
- package/man/roark-simulation-plan-delete.1 +93 -0
- package/man/roark-simulation-plan-get.1 +93 -0
- package/man/roark-simulation-plan-job-get.1 +93 -0
- package/man/roark-simulation-plan-job-list.1 +108 -0
- package/man/roark-simulation-plan-job-start.1 +97 -0
- package/man/roark-simulation-plan-list.1 +102 -0
- package/man/roark-simulation-plan-update.1 +142 -0
- package/man/roark-simulation-run.1 +97 -0
- package/man/roark-webhook-create.1 +102 -0
- package/man/roark-webhook-delete.1 +93 -0
- package/man/roark-webhook-get.1 +93 -0
- package/man/roark-webhook-list.1 +96 -0
- package/man/roark.1 +287 -0
- package/package.json +102 -0
- package/runtime/commands/api.d.ts +26 -0
- package/runtime/commands/api.js +85 -0
- package/runtime/commands/auth.d.ts +9 -0
- package/runtime/commands/auth.js +111 -0
- package/runtime/commands/completion.d.ts +9 -0
- package/runtime/commands/completion.js +42 -0
- package/runtime/commands/config.d.ts +15 -0
- package/runtime/commands/config.js +125 -0
- package/runtime/config.d.ts +65 -0
- package/runtime/config.js +163 -0
- package/runtime/confirm.d.ts +16 -0
- package/runtime/confirm.js +34 -0
- package/runtime/errors.d.ts +45 -0
- package/runtime/errors.js +91 -0
- package/runtime/input.d.ts +52 -0
- package/runtime/input.js +211 -0
- package/runtime/output.d.ts +41 -0
- package/runtime/output.js +90 -0
- package/runtime/program.d.ts +45 -0
- package/runtime/program.js +305 -0
- package/runtime/types.d.ts +53 -0
- package/runtime/types.js +10 -0
- package/version.d.ts +1 -0
- package/version.js +8 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
.\" File generated from our OpenAPI spec by app-agent-codegen. Do not edit.
|
|
2
|
+
.TH "ROARK\-WEBHOOK\-GET" "1" "" "roark-webhook-get" "Roark Analytics API Manual"
|
|
3
|
+
.SH "NAME"
|
|
4
|
+
roark\-webhook\-get \- Get webhook by ID
|
|
5
|
+
.SH "SYNOPSIS"
|
|
6
|
+
.B roark webhook get
|
|
7
|
+
\fIwebhook\-id\fR [\fIoptions\fR]
|
|
8
|
+
.SH "DESCRIPTION"
|
|
9
|
+
Returns a specific webhook with its event subscriptions.
|
|
10
|
+
.SH "API"
|
|
11
|
+
GET /v1/webhook/{webhookId}
|
|
12
|
+
.SH "ARGUMENTS"
|
|
13
|
+
.TP
|
|
14
|
+
\fIwebhook\-id\fR
|
|
15
|
+
The ID of the webhook to retrieve
|
|
16
|
+
.SH "GLOBAL OPTIONS"
|
|
17
|
+
.TP
|
|
18
|
+
\fB\-\-data\fR \fI<json>\fR
|
|
19
|
+
Request body as JSON, or @file to read one (@\- for stdin).
|
|
20
|
+
.TP
|
|
21
|
+
\fB\-y\fR, \fB\-\-yes\fR
|
|
22
|
+
Skip confirmation prompts.
|
|
23
|
+
.TP
|
|
24
|
+
\fB\-\-no\-input\fR
|
|
25
|
+
Never prompt; fail instead.
|
|
26
|
+
.TP
|
|
27
|
+
\fB\-\-base\-url\fR \fI<url>\fR
|
|
28
|
+
API base URL.
|
|
29
|
+
.TP
|
|
30
|
+
\fB\-\-token\fR \fI<token>\fR
|
|
31
|
+
Bearer token. Prefer ROARK_API_BEARER_TOKEN or the stored credential.
|
|
32
|
+
.TP
|
|
33
|
+
\fB\-\-timeout\fR \fI<ms>\fR
|
|
34
|
+
Request timeout in milliseconds.
|
|
35
|
+
.TP
|
|
36
|
+
\fB\-\-max\-retries\fR \fI<count>\fR
|
|
37
|
+
Retries for retryable failures.
|
|
38
|
+
.TP
|
|
39
|
+
\fB\-\-format\fR \fI<format>\fR
|
|
40
|
+
Output format: auto, json, jsonl, plain.
|
|
41
|
+
.TP
|
|
42
|
+
\fB\-\-json\fR
|
|
43
|
+
Shorthand for \-\-format json.
|
|
44
|
+
.TP
|
|
45
|
+
\fB\-\-no\-color\fR
|
|
46
|
+
Disable colour.
|
|
47
|
+
.TP
|
|
48
|
+
\fB\-q\fR, \fB\-\-quiet\fR
|
|
49
|
+
Suppress non\-essential output.
|
|
50
|
+
.TP
|
|
51
|
+
\fB\-\-allow\-project\-base\-url\fR
|
|
52
|
+
Send the stored credential to a base URL set by a project .roark.json. Refused by default.
|
|
53
|
+
.SH "EXAMPLES"
|
|
54
|
+
.PP
|
|
55
|
+
.RS 4
|
|
56
|
+
.nf
|
|
57
|
+
roark webhook get <webhook\-id>
|
|
58
|
+
.fi
|
|
59
|
+
.RE
|
|
60
|
+
.SH "ENVIRONMENT"
|
|
61
|
+
.TP
|
|
62
|
+
\fBROARK_API_BEARER_TOKEN\fR
|
|
63
|
+
Bearer token used when \-\-token is not given.
|
|
64
|
+
.TP
|
|
65
|
+
\fBROARK_BASE_URL\fR
|
|
66
|
+
API base URL.
|
|
67
|
+
.TP
|
|
68
|
+
\fBROARK_ALLOW_PROJECT_BASE_URL\fR
|
|
69
|
+
Trusts a base URL set by a project .roark.json, like \-\-allow\-project\-base\-url.
|
|
70
|
+
.TP
|
|
71
|
+
\fBNO_COLOR\fR
|
|
72
|
+
Disables colour when set to any value.
|
|
73
|
+
.SH "EXIT STATUS"
|
|
74
|
+
.TP
|
|
75
|
+
\fB0\fR
|
|
76
|
+
The command succeeded.
|
|
77
|
+
.TP
|
|
78
|
+
\fB1\fR
|
|
79
|
+
The API rejected the request.
|
|
80
|
+
.TP
|
|
81
|
+
\fB2\fR
|
|
82
|
+
The command line was wrong.
|
|
83
|
+
.TP
|
|
84
|
+
\fB3\fR
|
|
85
|
+
No credential, or the credential was refused.
|
|
86
|
+
.TP
|
|
87
|
+
\fB4\fR
|
|
88
|
+
The addressed resource does not exist.
|
|
89
|
+
.TP
|
|
90
|
+
\fB5\fR
|
|
91
|
+
The request never completed: connection, timeout, or abort.
|
|
92
|
+
.SH "SEE ALSO"
|
|
93
|
+
.BR roark (1)
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
.\" File generated from our OpenAPI spec by app-agent-codegen. Do not edit.
|
|
2
|
+
.TH "ROARK\-WEBHOOK\-LIST" "1" "" "roark-webhook-list" "Roark Analytics API Manual"
|
|
3
|
+
.SH "NAME"
|
|
4
|
+
roark\-webhook\-list \- List webhooks
|
|
5
|
+
.SH "SYNOPSIS"
|
|
6
|
+
.B roark webhook list
|
|
7
|
+
[\fIoptions\fR]
|
|
8
|
+
.SH "DESCRIPTION"
|
|
9
|
+
Returns a paginated list of webhooks with their event subscriptions.
|
|
10
|
+
.SH "API"
|
|
11
|
+
GET /v1/webhook
|
|
12
|
+
.SH "OPTIONS"
|
|
13
|
+
.TP
|
|
14
|
+
\fB\-\-limit\fR \fI<value>\fR
|
|
15
|
+
Maximum number of webhooks to return (default: 20, max: 50) Optional.
|
|
16
|
+
.TP
|
|
17
|
+
\fB\-\-after\fR \fI<value>\fR
|
|
18
|
+
Cursor for pagination \- webhook ID to start after Optional.
|
|
19
|
+
.SH "GLOBAL OPTIONS"
|
|
20
|
+
.TP
|
|
21
|
+
\fB\-\-data\fR \fI<json>\fR
|
|
22
|
+
Request body as JSON, or @file to read one (@\- for stdin).
|
|
23
|
+
.TP
|
|
24
|
+
\fB\-y\fR, \fB\-\-yes\fR
|
|
25
|
+
Skip confirmation prompts.
|
|
26
|
+
.TP
|
|
27
|
+
\fB\-\-no\-input\fR
|
|
28
|
+
Never prompt; fail instead.
|
|
29
|
+
.TP
|
|
30
|
+
\fB\-\-base\-url\fR \fI<url>\fR
|
|
31
|
+
API base URL.
|
|
32
|
+
.TP
|
|
33
|
+
\fB\-\-token\fR \fI<token>\fR
|
|
34
|
+
Bearer token. Prefer ROARK_API_BEARER_TOKEN or the stored credential.
|
|
35
|
+
.TP
|
|
36
|
+
\fB\-\-timeout\fR \fI<ms>\fR
|
|
37
|
+
Request timeout in milliseconds.
|
|
38
|
+
.TP
|
|
39
|
+
\fB\-\-max\-retries\fR \fI<count>\fR
|
|
40
|
+
Retries for retryable failures.
|
|
41
|
+
.TP
|
|
42
|
+
\fB\-\-format\fR \fI<format>\fR
|
|
43
|
+
Output format: auto, json, jsonl, plain.
|
|
44
|
+
.TP
|
|
45
|
+
\fB\-\-json\fR
|
|
46
|
+
Shorthand for \-\-format json.
|
|
47
|
+
.TP
|
|
48
|
+
\fB\-\-no\-color\fR
|
|
49
|
+
Disable colour.
|
|
50
|
+
.TP
|
|
51
|
+
\fB\-q\fR, \fB\-\-quiet\fR
|
|
52
|
+
Suppress non\-essential output.
|
|
53
|
+
.TP
|
|
54
|
+
\fB\-\-allow\-project\-base\-url\fR
|
|
55
|
+
Send the stored credential to a base URL set by a project .roark.json. Refused by default.
|
|
56
|
+
.SH "EXAMPLES"
|
|
57
|
+
.PP
|
|
58
|
+
.RS 4
|
|
59
|
+
.nf
|
|
60
|
+
roark webhook list
|
|
61
|
+
.fi
|
|
62
|
+
.RE
|
|
63
|
+
.SH "ENVIRONMENT"
|
|
64
|
+
.TP
|
|
65
|
+
\fBROARK_API_BEARER_TOKEN\fR
|
|
66
|
+
Bearer token used when \-\-token is not given.
|
|
67
|
+
.TP
|
|
68
|
+
\fBROARK_BASE_URL\fR
|
|
69
|
+
API base URL.
|
|
70
|
+
.TP
|
|
71
|
+
\fBROARK_ALLOW_PROJECT_BASE_URL\fR
|
|
72
|
+
Trusts a base URL set by a project .roark.json, like \-\-allow\-project\-base\-url.
|
|
73
|
+
.TP
|
|
74
|
+
\fBNO_COLOR\fR
|
|
75
|
+
Disables colour when set to any value.
|
|
76
|
+
.SH "EXIT STATUS"
|
|
77
|
+
.TP
|
|
78
|
+
\fB0\fR
|
|
79
|
+
The command succeeded.
|
|
80
|
+
.TP
|
|
81
|
+
\fB1\fR
|
|
82
|
+
The API rejected the request.
|
|
83
|
+
.TP
|
|
84
|
+
\fB2\fR
|
|
85
|
+
The command line was wrong.
|
|
86
|
+
.TP
|
|
87
|
+
\fB3\fR
|
|
88
|
+
No credential, or the credential was refused.
|
|
89
|
+
.TP
|
|
90
|
+
\fB4\fR
|
|
91
|
+
The addressed resource does not exist.
|
|
92
|
+
.TP
|
|
93
|
+
\fB5\fR
|
|
94
|
+
The request never completed: connection, timeout, or abort.
|
|
95
|
+
.SH "SEE ALSO"
|
|
96
|
+
.BR roark (1)
|
package/man/roark.1
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
.\" File generated from our OpenAPI spec by app-agent-codegen. Do not edit.
|
|
2
|
+
.TH "ROARK" "1" "" "roark" "Roark Analytics API Manual"
|
|
3
|
+
.SH "NAME"
|
|
4
|
+
roark \- command line interface for the Roark Analytics API
|
|
5
|
+
.SH "SYNOPSIS"
|
|
6
|
+
.B roark
|
|
7
|
+
\fIresource\fR [\fIsub\-resource\fR...] \fIverb\fR [\fIarguments\fR] [\fIoptions\fR]
|
|
8
|
+
.SH "DESCRIPTION"
|
|
9
|
+
roark calls the Roark Analytics API from the command line. Commands are grouped by resource and read noun before verb, so the resource is what you type first and the verb is always one of list, get, create, update or delete unless the operation is genuinely something else.
|
|
10
|
+
.PP
|
|
11
|
+
Output is JSON on standard output: indented and coloured when it is going to a terminal, compact when it is being piped. Errors go to standard error, so redirecting standard output captures only real output.
|
|
12
|
+
.SH "GLOBAL OPTIONS"
|
|
13
|
+
.TP
|
|
14
|
+
\fB\-\-base\-url\fR \fI<url>\fR
|
|
15
|
+
API base URL.
|
|
16
|
+
.TP
|
|
17
|
+
\fB\-\-token\fR \fI<token>\fR
|
|
18
|
+
Bearer token. Prefer ROARK_API_BEARER_TOKEN or the stored credential.
|
|
19
|
+
.TP
|
|
20
|
+
\fB\-\-timeout\fR \fI<ms>\fR
|
|
21
|
+
Request timeout in milliseconds.
|
|
22
|
+
.TP
|
|
23
|
+
\fB\-\-max\-retries\fR \fI<count>\fR
|
|
24
|
+
Retries for retryable failures.
|
|
25
|
+
.TP
|
|
26
|
+
\fB\-\-format\fR \fI<format>\fR
|
|
27
|
+
Output format: auto, json, jsonl, plain.
|
|
28
|
+
.TP
|
|
29
|
+
\fB\-\-json\fR
|
|
30
|
+
Shorthand for \-\-format json.
|
|
31
|
+
.TP
|
|
32
|
+
\fB\-\-no\-color\fR
|
|
33
|
+
Disable colour.
|
|
34
|
+
.TP
|
|
35
|
+
\fB\-q\fR, \fB\-\-quiet\fR
|
|
36
|
+
Suppress non\-essential output.
|
|
37
|
+
.TP
|
|
38
|
+
\fB\-\-allow\-project\-base\-url\fR
|
|
39
|
+
Send the stored credential to a base URL set by a project .roark.json. Refused by default.
|
|
40
|
+
.TP
|
|
41
|
+
\fB\-\-data\fR \fI<json>\fR
|
|
42
|
+
Request body as JSON, or @file to read one (@\- for stdin).
|
|
43
|
+
.TP
|
|
44
|
+
\fB\-y\fR, \fB\-\-yes\fR
|
|
45
|
+
Skip confirmation prompts.
|
|
46
|
+
.TP
|
|
47
|
+
\fB\-\-no\-input\fR
|
|
48
|
+
Never prompt; fail instead.
|
|
49
|
+
.SH "COMMANDS"
|
|
50
|
+
.TP
|
|
51
|
+
\fBroark auth\fR
|
|
52
|
+
Store, remove and inspect the credential.
|
|
53
|
+
.TP
|
|
54
|
+
\fBroark config\fR
|
|
55
|
+
Read and write CLI settings.
|
|
56
|
+
.TP
|
|
57
|
+
\fBroark api\fR
|
|
58
|
+
Call any endpoint directly, including ones without a generated command.
|
|
59
|
+
.TP
|
|
60
|
+
\fBroark completion\fR
|
|
61
|
+
Print a shell completion script.
|
|
62
|
+
.TP
|
|
63
|
+
\fBroark agent create\fR
|
|
64
|
+
Create a new agent See roark\-agent\-create(1).
|
|
65
|
+
.TP
|
|
66
|
+
\fBroark agent endpoint create\fR
|
|
67
|
+
Create a new agent endpoint See roark\-agent\-endpoint\-create(1).
|
|
68
|
+
.TP
|
|
69
|
+
\fBroark agent endpoint get\fR
|
|
70
|
+
Get agent endpoint by ID See roark\-agent\-endpoint\-get(1).
|
|
71
|
+
.TP
|
|
72
|
+
\fBroark agent endpoint list\fR
|
|
73
|
+
List agent endpoints See roark\-agent\-endpoint\-list(1).
|
|
74
|
+
.TP
|
|
75
|
+
\fBroark agent endpoint update\fR
|
|
76
|
+
Update an agent endpoint See roark\-agent\-endpoint\-update(1).
|
|
77
|
+
.TP
|
|
78
|
+
\fBroark agent get\fR
|
|
79
|
+
Get agent by ID See roark\-agent\-get(1).
|
|
80
|
+
.TP
|
|
81
|
+
\fBroark agent list\fR
|
|
82
|
+
List agents See roark\-agent\-list(1).
|
|
83
|
+
.TP
|
|
84
|
+
\fBroark agent update\fR
|
|
85
|
+
Update an agent See roark\-agent\-update(1).
|
|
86
|
+
.TP
|
|
87
|
+
\fBroark call create\fR
|
|
88
|
+
Create a call See roark\-call\-create(1).
|
|
89
|
+
.TP
|
|
90
|
+
\fBroark call get\fR
|
|
91
|
+
Get a call by ID See roark\-call\-get(1).
|
|
92
|
+
.TP
|
|
93
|
+
\fBroark call list\fR
|
|
94
|
+
List calls See roark\-call\-list(1).
|
|
95
|
+
.TP
|
|
96
|
+
\fBroark call metric list\fR
|
|
97
|
+
List call metrics See roark\-call\-metric\-list(1).
|
|
98
|
+
.TP
|
|
99
|
+
\fBroark call sentiment\-run list\fR
|
|
100
|
+
List call sentiment runs See roark\-call\-sentiment\-run\-list(1).
|
|
101
|
+
.TP
|
|
102
|
+
\fBroark call transcript get\fR
|
|
103
|
+
Get call transcript See roark\-call\-transcript\-get(1).
|
|
104
|
+
.TP
|
|
105
|
+
\fBroark config apply\fR
|
|
106
|
+
Apply a config bundle See roark\-config\-apply(1).
|
|
107
|
+
.TP
|
|
108
|
+
\fBroark config diff\fR
|
|
109
|
+
Diff a config bundle See roark\-config\-diff(1).
|
|
110
|
+
.TP
|
|
111
|
+
\fBroark customer\-flow create\fR
|
|
112
|
+
Create a customer flow See roark\-customer\-flow\-create(1).
|
|
113
|
+
.TP
|
|
114
|
+
\fBroark customer\-flow delete\fR
|
|
115
|
+
Delete a customer flow See roark\-customer\-flow\-delete(1).
|
|
116
|
+
.TP
|
|
117
|
+
\fBroark customer\-flow edge\-case create\fR
|
|
118
|
+
Add an edge case See roark\-customer\-flow\-edge\-case\-create(1).
|
|
119
|
+
.TP
|
|
120
|
+
\fBroark customer\-flow edge\-case delete\fR
|
|
121
|
+
Remove an edge case See roark\-customer\-flow\-edge\-case\-delete(1).
|
|
122
|
+
.TP
|
|
123
|
+
\fBroark customer\-flow edge\-case promote\fR
|
|
124
|
+
Promote an edge case to the happy path See roark\-customer\-flow\-edge\-case\-promote(1).
|
|
125
|
+
.TP
|
|
126
|
+
\fBroark customer\-flow edge\-case update\fR
|
|
127
|
+
Update an edge case See roark\-customer\-flow\-edge\-case\-update(1).
|
|
128
|
+
.TP
|
|
129
|
+
\fBroark customer\-flow get\fR
|
|
130
|
+
Get customer flow by ID See roark\-customer\-flow\-get(1).
|
|
131
|
+
.TP
|
|
132
|
+
\fBroark customer\-flow graph replace\fR
|
|
133
|
+
Replace a scripted flow's steps See roark\-customer\-flow\-graph\-replace(1).
|
|
134
|
+
.TP
|
|
135
|
+
\fBroark customer\-flow happy\-path update\fR
|
|
136
|
+
Update a flow's happy path See roark\-customer\-flow\-happy\-path\-update(1).
|
|
137
|
+
.TP
|
|
138
|
+
\fBroark customer\-flow list\fR
|
|
139
|
+
List customer flows See roark\-customer\-flow\-list(1).
|
|
140
|
+
.TP
|
|
141
|
+
\fBroark customer\-flow update\fR
|
|
142
|
+
Update a customer flow See roark\-customer\-flow\-update(1).
|
|
143
|
+
.TP
|
|
144
|
+
\fBroark health\fR
|
|
145
|
+
Get API health status See roark\-health(1).
|
|
146
|
+
.TP
|
|
147
|
+
\fBroark http\-request\-definition create\fR
|
|
148
|
+
Create HTTP request definition See roark\-http\-request\-definition\-create(1).
|
|
149
|
+
.TP
|
|
150
|
+
\fBroark http\-request\-definition get\fR
|
|
151
|
+
Get HTTP request definition by ID See roark\-http\-request\-definition\-get(1).
|
|
152
|
+
.TP
|
|
153
|
+
\fBroark http\-request\-definition list\fR
|
|
154
|
+
List HTTP request definitions See roark\-http\-request\-definition\-list(1).
|
|
155
|
+
.TP
|
|
156
|
+
\fBroark http\-request\-definition update\fR
|
|
157
|
+
Update HTTP request definition See roark\-http\-request\-definition\-update(1).
|
|
158
|
+
.TP
|
|
159
|
+
\fBroark metric collection\-job create\fR
|
|
160
|
+
Create and run a metric collection job See roark\-metric\-collection\-job\-create(1).
|
|
161
|
+
.TP
|
|
162
|
+
\fBroark metric collection\-job get\fR
|
|
163
|
+
Get metric collection job by ID See roark\-metric\-collection\-job\-get(1).
|
|
164
|
+
.TP
|
|
165
|
+
\fBroark metric collection\-job list\fR
|
|
166
|
+
List metric collection jobs See roark\-metric\-collection\-job\-list(1).
|
|
167
|
+
.TP
|
|
168
|
+
\fBroark metric definition create\fR
|
|
169
|
+
Create custom metric definition See roark\-metric\-definition\-create(1).
|
|
170
|
+
.TP
|
|
171
|
+
\fBroark metric definition list\fR
|
|
172
|
+
List metric definitions See roark\-metric\-definition\-list(1).
|
|
173
|
+
.TP
|
|
174
|
+
\fBroark metric policy create\fR
|
|
175
|
+
Create a metric policy See roark\-metric\-policy\-create(1).
|
|
176
|
+
.TP
|
|
177
|
+
\fBroark metric policy delete\fR
|
|
178
|
+
Delete a metric policy See roark\-metric\-policy\-delete(1).
|
|
179
|
+
.TP
|
|
180
|
+
\fBroark metric policy get\fR
|
|
181
|
+
Get metric policy by ID See roark\-metric\-policy\-get(1).
|
|
182
|
+
.TP
|
|
183
|
+
\fBroark metric policy list\fR
|
|
184
|
+
List metric policies See roark\-metric\-policy\-list(1).
|
|
185
|
+
.TP
|
|
186
|
+
\fBroark metric policy update\fR
|
|
187
|
+
Update a metric policy See roark\-metric\-policy\-update(1).
|
|
188
|
+
.TP
|
|
189
|
+
\fBroark simulation environment get\fR
|
|
190
|
+
Get environment by ID See roark\-simulation\-environment\-get(1).
|
|
191
|
+
.TP
|
|
192
|
+
\fBroark simulation environment list\fR
|
|
193
|
+
List environments See roark\-simulation\-environment\-list(1).
|
|
194
|
+
.TP
|
|
195
|
+
\fBroark simulation job get\fR
|
|
196
|
+
Get simulation by ID See roark\-simulation\-job\-get(1).
|
|
197
|
+
.TP
|
|
198
|
+
\fBroark simulation job lookup\fR
|
|
199
|
+
Lookup by phone number See roark\-simulation\-job\-lookup(1).
|
|
200
|
+
.TP
|
|
201
|
+
\fBroark simulation persona create\fR
|
|
202
|
+
Create a new persona See roark\-simulation\-persona\-create(1).
|
|
203
|
+
.TP
|
|
204
|
+
\fBroark simulation persona get\fR
|
|
205
|
+
Get persona by ID See roark\-simulation\-persona\-get(1).
|
|
206
|
+
.TP
|
|
207
|
+
\fBroark simulation persona list\fR
|
|
208
|
+
List personas See roark\-simulation\-persona\-list(1).
|
|
209
|
+
.TP
|
|
210
|
+
\fBroark simulation persona update\fR
|
|
211
|
+
Update a persona See roark\-simulation\-persona\-update(1).
|
|
212
|
+
.TP
|
|
213
|
+
\fBroark simulation plan create\fR
|
|
214
|
+
Create a run plan See roark\-simulation\-plan\-create(1).
|
|
215
|
+
.TP
|
|
216
|
+
\fBroark simulation plan delete\fR
|
|
217
|
+
Delete a run plan See roark\-simulation\-plan\-delete(1).
|
|
218
|
+
.TP
|
|
219
|
+
\fBroark simulation plan get\fR
|
|
220
|
+
Get run plan by ID See roark\-simulation\-plan\-get(1).
|
|
221
|
+
.TP
|
|
222
|
+
\fBroark simulation plan job get\fR
|
|
223
|
+
Get simulation plan job See roark\-simulation\-plan\-job\-get(1).
|
|
224
|
+
.TP
|
|
225
|
+
\fBroark simulation plan job list\fR
|
|
226
|
+
List simulation plan jobs See roark\-simulation\-plan\-job\-list(1).
|
|
227
|
+
.TP
|
|
228
|
+
\fBroark simulation plan job start\fR
|
|
229
|
+
Run a simulation plan See roark\-simulation\-plan\-job\-start(1).
|
|
230
|
+
.TP
|
|
231
|
+
\fBroark simulation plan list\fR
|
|
232
|
+
List run plans See roark\-simulation\-plan\-list(1).
|
|
233
|
+
.TP
|
|
234
|
+
\fBroark simulation plan update\fR
|
|
235
|
+
Update a run plan See roark\-simulation\-plan\-update(1).
|
|
236
|
+
.TP
|
|
237
|
+
\fBroark simulation run\fR
|
|
238
|
+
Run a simulation See roark\-simulation\-run(1).
|
|
239
|
+
.TP
|
|
240
|
+
\fBroark webhook create\fR
|
|
241
|
+
Create webhook See roark\-webhook\-create(1).
|
|
242
|
+
.TP
|
|
243
|
+
\fBroark webhook delete\fR
|
|
244
|
+
Delete webhook See roark\-webhook\-delete(1).
|
|
245
|
+
.TP
|
|
246
|
+
\fBroark webhook get\fR
|
|
247
|
+
Get webhook by ID See roark\-webhook\-get(1).
|
|
248
|
+
.TP
|
|
249
|
+
\fBroark webhook list\fR
|
|
250
|
+
List webhooks See roark\-webhook\-list(1).
|
|
251
|
+
.SH "CONFIGURATION"
|
|
252
|
+
Settings are resolved highest precedence first: command line flag, environment variable, project .roark.json found by walking up from the working directory, then the user config file. The stored credential is written with mode 0600.
|
|
253
|
+
.SH "ENVIRONMENT"
|
|
254
|
+
.TP
|
|
255
|
+
\fBROARK_API_BEARER_TOKEN\fR
|
|
256
|
+
Bearer token used when \-\-token is not given.
|
|
257
|
+
.TP
|
|
258
|
+
\fBROARK_BASE_URL\fR
|
|
259
|
+
API base URL.
|
|
260
|
+
.TP
|
|
261
|
+
\fBXDG_CONFIG_HOME\fR
|
|
262
|
+
Overrides the location of the user config file.
|
|
263
|
+
.TP
|
|
264
|
+
\fBROARK_ALLOW_PROJECT_BASE_URL\fR
|
|
265
|
+
Trusts a base URL set by a project .roark.json, like \-\-allow\-project\-base\-url.
|
|
266
|
+
.TP
|
|
267
|
+
\fBNO_COLOR\fR
|
|
268
|
+
Disables colour when set to any value.
|
|
269
|
+
.SH "EXIT STATUS"
|
|
270
|
+
.TP
|
|
271
|
+
\fB0\fR
|
|
272
|
+
The command succeeded.
|
|
273
|
+
.TP
|
|
274
|
+
\fB1\fR
|
|
275
|
+
The API rejected the request.
|
|
276
|
+
.TP
|
|
277
|
+
\fB2\fR
|
|
278
|
+
The command line was wrong.
|
|
279
|
+
.TP
|
|
280
|
+
\fB3\fR
|
|
281
|
+
No credential, or the credential was refused.
|
|
282
|
+
.TP
|
|
283
|
+
\fB4\fR
|
|
284
|
+
The addressed resource does not exist.
|
|
285
|
+
.TP
|
|
286
|
+
\fB5\fR
|
|
287
|
+
The request never completed: connection, timeout, or abort.
|
package/package.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@roarkanalytics/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The official command line interface for the Roark API",
|
|
5
|
+
"author": "Roark <james@roark.ai>",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/roarkhq/sdk-roark-analytics-node.git",
|
|
10
|
+
"directory": "packages/cli"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/roarkhq/sdk-roark-analytics-node/tree/main/packages/cli#readme",
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
|
+
"packageManager": "pnpm@10.30.1",
|
|
15
|
+
"private": false,
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"bin": {
|
|
20
|
+
"roark": "./bin.js"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "./build",
|
|
27
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
28
|
+
"test": "jest",
|
|
29
|
+
"lint": "eslint .",
|
|
30
|
+
"fix": "eslint --fix ."
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@roarkanalytics/sdk": "^2.33.0",
|
|
34
|
+
"commander": "^14.0.3"
|
|
35
|
+
},
|
|
36
|
+
"man": [
|
|
37
|
+
"./man/roark.1",
|
|
38
|
+
"./man/roark-agent-create.1",
|
|
39
|
+
"./man/roark-agent-endpoint-create.1",
|
|
40
|
+
"./man/roark-agent-endpoint-get.1",
|
|
41
|
+
"./man/roark-agent-endpoint-list.1",
|
|
42
|
+
"./man/roark-agent-endpoint-update.1",
|
|
43
|
+
"./man/roark-agent-get.1",
|
|
44
|
+
"./man/roark-agent-list.1",
|
|
45
|
+
"./man/roark-agent-update.1",
|
|
46
|
+
"./man/roark-call-create.1",
|
|
47
|
+
"./man/roark-call-get.1",
|
|
48
|
+
"./man/roark-call-list.1",
|
|
49
|
+
"./man/roark-call-metric-list.1",
|
|
50
|
+
"./man/roark-call-sentiment-run-list.1",
|
|
51
|
+
"./man/roark-call-transcript-get.1",
|
|
52
|
+
"./man/roark-config-apply.1",
|
|
53
|
+
"./man/roark-config-diff.1",
|
|
54
|
+
"./man/roark-customer-flow-create.1",
|
|
55
|
+
"./man/roark-customer-flow-delete.1",
|
|
56
|
+
"./man/roark-customer-flow-edge-case-create.1",
|
|
57
|
+
"./man/roark-customer-flow-edge-case-delete.1",
|
|
58
|
+
"./man/roark-customer-flow-edge-case-promote.1",
|
|
59
|
+
"./man/roark-customer-flow-edge-case-update.1",
|
|
60
|
+
"./man/roark-customer-flow-get.1",
|
|
61
|
+
"./man/roark-customer-flow-graph-replace.1",
|
|
62
|
+
"./man/roark-customer-flow-happy-path-update.1",
|
|
63
|
+
"./man/roark-customer-flow-list.1",
|
|
64
|
+
"./man/roark-customer-flow-update.1",
|
|
65
|
+
"./man/roark-health.1",
|
|
66
|
+
"./man/roark-http-request-definition-create.1",
|
|
67
|
+
"./man/roark-http-request-definition-get.1",
|
|
68
|
+
"./man/roark-http-request-definition-list.1",
|
|
69
|
+
"./man/roark-http-request-definition-update.1",
|
|
70
|
+
"./man/roark-metric-collection-job-create.1",
|
|
71
|
+
"./man/roark-metric-collection-job-get.1",
|
|
72
|
+
"./man/roark-metric-collection-job-list.1",
|
|
73
|
+
"./man/roark-metric-definition-create.1",
|
|
74
|
+
"./man/roark-metric-definition-list.1",
|
|
75
|
+
"./man/roark-metric-policy-create.1",
|
|
76
|
+
"./man/roark-metric-policy-delete.1",
|
|
77
|
+
"./man/roark-metric-policy-get.1",
|
|
78
|
+
"./man/roark-metric-policy-list.1",
|
|
79
|
+
"./man/roark-metric-policy-update.1",
|
|
80
|
+
"./man/roark-simulation-environment-get.1",
|
|
81
|
+
"./man/roark-simulation-environment-list.1",
|
|
82
|
+
"./man/roark-simulation-job-get.1",
|
|
83
|
+
"./man/roark-simulation-job-lookup.1",
|
|
84
|
+
"./man/roark-simulation-persona-create.1",
|
|
85
|
+
"./man/roark-simulation-persona-get.1",
|
|
86
|
+
"./man/roark-simulation-persona-list.1",
|
|
87
|
+
"./man/roark-simulation-persona-update.1",
|
|
88
|
+
"./man/roark-simulation-plan-create.1",
|
|
89
|
+
"./man/roark-simulation-plan-delete.1",
|
|
90
|
+
"./man/roark-simulation-plan-get.1",
|
|
91
|
+
"./man/roark-simulation-plan-job-get.1",
|
|
92
|
+
"./man/roark-simulation-plan-job-list.1",
|
|
93
|
+
"./man/roark-simulation-plan-job-start.1",
|
|
94
|
+
"./man/roark-simulation-plan-list.1",
|
|
95
|
+
"./man/roark-simulation-plan-update.1",
|
|
96
|
+
"./man/roark-simulation-run.1",
|
|
97
|
+
"./man/roark-webhook-create.1",
|
|
98
|
+
"./man/roark-webhook-delete.1",
|
|
99
|
+
"./man/roark-webhook-get.1",
|
|
100
|
+
"./man/roark-webhook-list.1"
|
|
101
|
+
]
|
|
102
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `roark api <method> <path>` - the escape hatch.
|
|
3
|
+
*
|
|
4
|
+
* The generated commands cover the endpoints `sdk.yml` exposes, which is
|
|
5
|
+
* deliberately a curated subset. Without this, an endpoint that exists but is
|
|
6
|
+
* not yet configured is unreachable from the CLI and the answer is "wait for a
|
|
7
|
+
* release". Modelled on `gh api`.
|
|
8
|
+
*/
|
|
9
|
+
import { Command } from 'commander';
|
|
10
|
+
import type Roark from '@roarkanalytics/sdk';
|
|
11
|
+
import { type OutputFormat } from '../output';
|
|
12
|
+
export declare const METHODS: readonly ["get", "post", "put", "patch", "delete"];
|
|
13
|
+
type Method = (typeof METHODS)[number];
|
|
14
|
+
export declare const isMethod: (value: string) => value is Method;
|
|
15
|
+
/**
|
|
16
|
+
* `--query k=v` repeated, so no shell quoting of a whole query string.
|
|
17
|
+
*
|
|
18
|
+
* Splits on the first `=` only: a value can legitimately contain one, as in
|
|
19
|
+
* `--query filter=status=open`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const parseQuery: (entries: string[] | undefined) => Record<string, string> | undefined;
|
|
22
|
+
export declare const registerApiCommand: (root: Command, binaryName: string, clientFor: (options: never) => Roark, resolveOutput: (options: never) => {
|
|
23
|
+
format: OutputFormat;
|
|
24
|
+
color: boolean;
|
|
25
|
+
}) => void;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `roark api <method> <path>` - the escape hatch.
|
|
4
|
+
*
|
|
5
|
+
* The generated commands cover the endpoints `sdk.yml` exposes, which is
|
|
6
|
+
* deliberately a curated subset. Without this, an endpoint that exists but is
|
|
7
|
+
* not yet configured is unreachable from the CLI and the answer is "wait for a
|
|
8
|
+
* release". Modelled on `gh api`.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.registerApiCommand = exports.parseQuery = exports.isMethod = exports.METHODS = void 0;
|
|
12
|
+
const commander_1 = require("commander");
|
|
13
|
+
const errors_1 = require("../errors");
|
|
14
|
+
const input_1 = require("../input");
|
|
15
|
+
const output_1 = require("../output");
|
|
16
|
+
exports.METHODS = ['get', 'post', 'put', 'patch', 'delete'];
|
|
17
|
+
const isMethod = (value) => exports.METHODS.includes(value);
|
|
18
|
+
exports.isMethod = isMethod;
|
|
19
|
+
/**
|
|
20
|
+
* `--query k=v` repeated, so no shell quoting of a whole query string.
|
|
21
|
+
*
|
|
22
|
+
* Splits on the first `=` only: a value can legitimately contain one, as in
|
|
23
|
+
* `--query filter=status=open`.
|
|
24
|
+
*/
|
|
25
|
+
const parseQuery = (entries) => {
|
|
26
|
+
if (!entries || entries.length === 0)
|
|
27
|
+
return undefined;
|
|
28
|
+
const query = {};
|
|
29
|
+
for (const entry of entries) {
|
|
30
|
+
const index = entry.indexOf('=');
|
|
31
|
+
if (index === -1)
|
|
32
|
+
throw new errors_1.UsageError(`--query expects key=value, got '${entry}'`);
|
|
33
|
+
query[entry.slice(0, index)] = entry.slice(index + 1);
|
|
34
|
+
}
|
|
35
|
+
return query;
|
|
36
|
+
};
|
|
37
|
+
exports.parseQuery = parseQuery;
|
|
38
|
+
const registerApiCommand = (root, binaryName, clientFor, resolveOutput) => {
|
|
39
|
+
const command = new commander_1.Command('api')
|
|
40
|
+
.description('Call any API endpoint directly, including ones without a generated command')
|
|
41
|
+
.argument('<method>', `HTTP method: ${exports.METHODS.join(', ')}`)
|
|
42
|
+
.argument('<path>', 'request path, e.g. /v1/call')
|
|
43
|
+
.option('--data <json>', 'request body as JSON, or @file to read one (@- for stdin)')
|
|
44
|
+
.option('--query <key=value>', 'query parameter; repeat for more than one', (value, previous) => [...(previous ?? []), value])
|
|
45
|
+
.option('--base-url <url>', 'API base URL')
|
|
46
|
+
.option('--token <token>', 'bearer token')
|
|
47
|
+
.option('--timeout <ms>', 'request timeout in milliseconds')
|
|
48
|
+
.option('--max-retries <count>', 'retries for retryable failures')
|
|
49
|
+
.option('--format <format>', 'output format')
|
|
50
|
+
.option('--json', 'shorthand for --format json')
|
|
51
|
+
.option('--no-color', 'disable colour')
|
|
52
|
+
.addHelpText('after', [
|
|
53
|
+
'',
|
|
54
|
+
'Examples:',
|
|
55
|
+
` ${binaryName} api get /v1/call --query limit=5`,
|
|
56
|
+
` ${binaryName} api post /v1/webhook --data '{"url":"https://example.com"}'`,
|
|
57
|
+
` cat body.json | ${binaryName} api post /v1/webhook`,
|
|
58
|
+
].join('\n'))
|
|
59
|
+
.showHelpAfterError();
|
|
60
|
+
command.action(async (method, path, options) => {
|
|
61
|
+
const verb = method.toLowerCase();
|
|
62
|
+
if (!(0, exports.isMethod)(verb)) {
|
|
63
|
+
throw new errors_1.UsageError(`Unknown HTTP method '${method}'. Expected one of ${exports.METHODS.join(', ')}.`);
|
|
64
|
+
}
|
|
65
|
+
if (!path.startsWith('/'))
|
|
66
|
+
throw new errors_1.UsageError(`Path must start with '/', got '${path}'`);
|
|
67
|
+
const explicit = options['data'] === undefined ? undefined : (0, input_1.readData)(options['data']);
|
|
68
|
+
const piped = explicit === undefined && (0, input_1.stdinIsPiped)() ?
|
|
69
|
+
(() => {
|
|
70
|
+
const raw = (0, input_1.readStdin)().trim();
|
|
71
|
+
return raw.length === 0 ? undefined : JSON.parse(raw);
|
|
72
|
+
})()
|
|
73
|
+
: undefined;
|
|
74
|
+
const body = explicit ?? piped;
|
|
75
|
+
const query = (0, exports.parseQuery)(options['query']);
|
|
76
|
+
const client = clientFor(options);
|
|
77
|
+
const result = await client[verb](path, {
|
|
78
|
+
...(body === undefined ? {} : { body }),
|
|
79
|
+
...(query === undefined ? {} : { query }),
|
|
80
|
+
});
|
|
81
|
+
(0, output_1.write)((0, output_1.render)(result, resolveOutput(options)));
|
|
82
|
+
});
|
|
83
|
+
root.addCommand(command);
|
|
84
|
+
};
|
|
85
|
+
exports.registerApiCommand = registerApiCommand;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `roark auth login | logout | status`
|
|
3
|
+
*
|
|
4
|
+
* The token is never accepted as a flag value: flags land in shell history and
|
|
5
|
+
* in the process table, where a bearer token has no business being. It is read
|
|
6
|
+
* from a prompt with echo off, or from stdin so CI can pipe it in.
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'commander';
|
|
9
|
+
export declare const registerAuthCommands: (root: Command, binaryName: string) => void;
|