@naturali/cli 0.50.0 → 0.50.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/dist/index.mjs +414 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region package.json
|
|
17
|
-
var version = "0.50.
|
|
17
|
+
var version = "0.50.1";
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region ../sdk/src/generated/core/bodySerializer.gen.ts
|
|
20
20
|
const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
|
|
@@ -2056,6 +2056,108 @@ var Traces = class {
|
|
|
2056
2056
|
});
|
|
2057
2057
|
}
|
|
2058
2058
|
};
|
|
2059
|
+
var Triggers = class {
|
|
2060
|
+
/**
|
|
2061
|
+
* List triggers
|
|
2062
|
+
*
|
|
2063
|
+
* The project's schedule triggers.
|
|
2064
|
+
*/
|
|
2065
|
+
static listTriggers(options) {
|
|
2066
|
+
return (options.client ?? client).get({
|
|
2067
|
+
url: "/v1/projects/{project_id}/triggers",
|
|
2068
|
+
...options
|
|
2069
|
+
});
|
|
2070
|
+
}
|
|
2071
|
+
/**
|
|
2072
|
+
* Create a trigger
|
|
2073
|
+
*
|
|
2074
|
+
* Schedules `target_id` (an agent in this project) to run on `cron`, a 5-field cron expression evaluated in UTC.
|
|
2075
|
+
*
|
|
2076
|
+
*/
|
|
2077
|
+
static createTrigger(options) {
|
|
2078
|
+
return (options.client ?? client).post({
|
|
2079
|
+
url: "/v1/projects/{project_id}/triggers",
|
|
2080
|
+
...options,
|
|
2081
|
+
headers: {
|
|
2082
|
+
"Content-Type": "application/json",
|
|
2083
|
+
...options.headers
|
|
2084
|
+
}
|
|
2085
|
+
});
|
|
2086
|
+
}
|
|
2087
|
+
/**
|
|
2088
|
+
* Delete a trigger
|
|
2089
|
+
*
|
|
2090
|
+
* Removes the trigger. Its firing history is kept.
|
|
2091
|
+
*/
|
|
2092
|
+
static deleteTrigger(options) {
|
|
2093
|
+
return (options.client ?? client).delete({
|
|
2094
|
+
url: "/v1/projects/{project_id}/triggers/{trigger_id}",
|
|
2095
|
+
...options
|
|
2096
|
+
});
|
|
2097
|
+
}
|
|
2098
|
+
/**
|
|
2099
|
+
* Get a trigger
|
|
2100
|
+
*/
|
|
2101
|
+
static getTrigger(options) {
|
|
2102
|
+
return (options.client ?? client).get({
|
|
2103
|
+
url: "/v1/projects/{project_id}/triggers/{trigger_id}",
|
|
2104
|
+
...options
|
|
2105
|
+
});
|
|
2106
|
+
}
|
|
2107
|
+
/**
|
|
2108
|
+
* Update a trigger
|
|
2109
|
+
*
|
|
2110
|
+
* Retune the schedule, its target, or whether it fires at all. At least one field is required. `type` and `target_type` are immutable.
|
|
2111
|
+
*
|
|
2112
|
+
*/
|
|
2113
|
+
static updateTrigger(options) {
|
|
2114
|
+
return (options.client ?? client).patch({
|
|
2115
|
+
url: "/v1/projects/{project_id}/triggers/{trigger_id}",
|
|
2116
|
+
...options,
|
|
2117
|
+
headers: {
|
|
2118
|
+
"Content-Type": "application/json",
|
|
2119
|
+
...options.headers
|
|
2120
|
+
}
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
/**
|
|
2124
|
+
* Fire a trigger manually
|
|
2125
|
+
*
|
|
2126
|
+
* Runs the trigger's target right now, outside its schedule, and waits for the run to finish. This is the `…:fire` action; the path segment is `{trigger_id}:fire`.
|
|
2127
|
+
* `input` is shallow-merged over the trigger's own stored `input` for this run only — the trigger's configuration is unchanged.
|
|
2128
|
+
*
|
|
2129
|
+
*/
|
|
2130
|
+
static fireTrigger(options) {
|
|
2131
|
+
return (options.client ?? client).post({
|
|
2132
|
+
url: "/v1/projects/{project_id}/triggers/{trigger_id}:fire",
|
|
2133
|
+
...options,
|
|
2134
|
+
headers: {
|
|
2135
|
+
"Content-Type": "application/json",
|
|
2136
|
+
...options.headers
|
|
2137
|
+
}
|
|
2138
|
+
});
|
|
2139
|
+
}
|
|
2140
|
+
/**
|
|
2141
|
+
* List a trigger's firings
|
|
2142
|
+
*
|
|
2143
|
+
* Every time this trigger ran, newest first — scheduled and manual alike.
|
|
2144
|
+
*/
|
|
2145
|
+
static listTriggerFirings(options) {
|
|
2146
|
+
return (options.client ?? client).get({
|
|
2147
|
+
url: "/v1/projects/{project_id}/triggers/{trigger_id}/firings",
|
|
2148
|
+
...options
|
|
2149
|
+
});
|
|
2150
|
+
}
|
|
2151
|
+
/**
|
|
2152
|
+
* Get a trigger firing
|
|
2153
|
+
*/
|
|
2154
|
+
static getTriggerFiring(options) {
|
|
2155
|
+
return (options.client ?? client).get({
|
|
2156
|
+
url: "/v1/projects/{project_id}/triggers/{trigger_id}/firings/{firing_id}",
|
|
2157
|
+
...options
|
|
2158
|
+
});
|
|
2159
|
+
}
|
|
2160
|
+
};
|
|
2059
2161
|
var Webhooks = class {
|
|
2060
2162
|
/**
|
|
2061
2163
|
* List webhooks
|
|
@@ -2289,6 +2391,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
2289
2391
|
Tasks: () => Tasks,
|
|
2290
2392
|
Tools: () => Tools,
|
|
2291
2393
|
Traces: () => Traces,
|
|
2394
|
+
Triggers: () => Triggers,
|
|
2292
2395
|
Webhooks: () => Webhooks,
|
|
2293
2396
|
createClient: () => createClient,
|
|
2294
2397
|
createConfig: () => createConfig
|
|
@@ -6738,6 +6841,316 @@ const routes = {
|
|
|
6738
6841
|
"in": "path"
|
|
6739
6842
|
}]
|
|
6740
6843
|
},
|
|
6844
|
+
"list-triggers": {
|
|
6845
|
+
serviceClass: "Triggers",
|
|
6846
|
+
operationId: "listTriggers",
|
|
6847
|
+
description: "The project's schedule triggers.",
|
|
6848
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/triggers",
|
|
6849
|
+
httpMethod: "get",
|
|
6850
|
+
pathParams: ["project_id"],
|
|
6851
|
+
queryParams: ["limit", "offset"],
|
|
6852
|
+
flags: [
|
|
6853
|
+
{
|
|
6854
|
+
"name": "project_id",
|
|
6855
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6856
|
+
"required": true,
|
|
6857
|
+
"type": "string",
|
|
6858
|
+
"in": "path"
|
|
6859
|
+
},
|
|
6860
|
+
{
|
|
6861
|
+
"name": "limit",
|
|
6862
|
+
"description": "Maximum items to return (1–100).",
|
|
6863
|
+
"required": false,
|
|
6864
|
+
"type": "integer",
|
|
6865
|
+
"in": "query"
|
|
6866
|
+
},
|
|
6867
|
+
{
|
|
6868
|
+
"name": "offset",
|
|
6869
|
+
"description": "Items to skip. These lists page by offset rather than by naturali's usual opaque cursor because the upstream ordering is offset-based; a cursor here would only imitate a keyset.\n",
|
|
6870
|
+
"required": false,
|
|
6871
|
+
"type": "integer",
|
|
6872
|
+
"in": "query"
|
|
6873
|
+
}
|
|
6874
|
+
]
|
|
6875
|
+
},
|
|
6876
|
+
"create-trigger": {
|
|
6877
|
+
serviceClass: "Triggers",
|
|
6878
|
+
operationId: "createTrigger",
|
|
6879
|
+
description: "Schedules `target_id` (an agent in this project) to run on `cron`, a 5-field cron expression evaluated in UTC.",
|
|
6880
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/triggers",
|
|
6881
|
+
httpMethod: "post",
|
|
6882
|
+
pathParams: ["project_id"],
|
|
6883
|
+
queryParams: [],
|
|
6884
|
+
flags: [
|
|
6885
|
+
{
|
|
6886
|
+
"name": "project_id",
|
|
6887
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6888
|
+
"required": true,
|
|
6889
|
+
"type": "string",
|
|
6890
|
+
"in": "path"
|
|
6891
|
+
},
|
|
6892
|
+
{
|
|
6893
|
+
"name": "name",
|
|
6894
|
+
"description": "",
|
|
6895
|
+
"required": true,
|
|
6896
|
+
"type": "string",
|
|
6897
|
+
"in": "body"
|
|
6898
|
+
},
|
|
6899
|
+
{
|
|
6900
|
+
"name": "description",
|
|
6901
|
+
"description": "",
|
|
6902
|
+
"required": false,
|
|
6903
|
+
"type": "string",
|
|
6904
|
+
"in": "body"
|
|
6905
|
+
},
|
|
6906
|
+
{
|
|
6907
|
+
"name": "target_id",
|
|
6908
|
+
"description": "The agent this trigger runs. Must belong to this project.",
|
|
6909
|
+
"required": true,
|
|
6910
|
+
"type": "string",
|
|
6911
|
+
"in": "body"
|
|
6912
|
+
},
|
|
6913
|
+
{
|
|
6914
|
+
"name": "input",
|
|
6915
|
+
"description": "",
|
|
6916
|
+
"required": false,
|
|
6917
|
+
"type": "object",
|
|
6918
|
+
"in": "body"
|
|
6919
|
+
},
|
|
6920
|
+
{
|
|
6921
|
+
"name": "cron",
|
|
6922
|
+
"description": "5-field cron expression, evaluated in UTC.",
|
|
6923
|
+
"required": true,
|
|
6924
|
+
"type": "string",
|
|
6925
|
+
"in": "body"
|
|
6926
|
+
},
|
|
6927
|
+
{
|
|
6928
|
+
"name": "active",
|
|
6929
|
+
"description": "",
|
|
6930
|
+
"required": false,
|
|
6931
|
+
"type": "boolean",
|
|
6932
|
+
"in": "body"
|
|
6933
|
+
}
|
|
6934
|
+
]
|
|
6935
|
+
},
|
|
6936
|
+
"get-trigger": {
|
|
6937
|
+
serviceClass: "Triggers",
|
|
6938
|
+
operationId: "getTrigger",
|
|
6939
|
+
description: "Get a trigger",
|
|
6940
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/triggers",
|
|
6941
|
+
httpMethod: "get",
|
|
6942
|
+
pathParams: ["project_id", "trigger_id"],
|
|
6943
|
+
queryParams: [],
|
|
6944
|
+
flags: [{
|
|
6945
|
+
"name": "project_id",
|
|
6946
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6947
|
+
"required": true,
|
|
6948
|
+
"type": "string",
|
|
6949
|
+
"in": "path"
|
|
6950
|
+
}, {
|
|
6951
|
+
"name": "trigger_id",
|
|
6952
|
+
"description": "Trigger public ID (trg_ prefix) — the runtime trigger id.",
|
|
6953
|
+
"required": true,
|
|
6954
|
+
"type": "string",
|
|
6955
|
+
"in": "path"
|
|
6956
|
+
}]
|
|
6957
|
+
},
|
|
6958
|
+
"update-trigger": {
|
|
6959
|
+
serviceClass: "Triggers",
|
|
6960
|
+
operationId: "updateTrigger",
|
|
6961
|
+
description: "Retune the schedule, its target, or whether it fires at all. At least one field is required. `type` and `target_type` are immutable.",
|
|
6962
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/triggers",
|
|
6963
|
+
httpMethod: "patch",
|
|
6964
|
+
pathParams: ["project_id", "trigger_id"],
|
|
6965
|
+
queryParams: [],
|
|
6966
|
+
flags: [
|
|
6967
|
+
{
|
|
6968
|
+
"name": "project_id",
|
|
6969
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6970
|
+
"required": true,
|
|
6971
|
+
"type": "string",
|
|
6972
|
+
"in": "path"
|
|
6973
|
+
},
|
|
6974
|
+
{
|
|
6975
|
+
"name": "trigger_id",
|
|
6976
|
+
"description": "Trigger public ID (trg_ prefix) — the runtime trigger id.",
|
|
6977
|
+
"required": true,
|
|
6978
|
+
"type": "string",
|
|
6979
|
+
"in": "path"
|
|
6980
|
+
},
|
|
6981
|
+
{
|
|
6982
|
+
"name": "name",
|
|
6983
|
+
"description": "",
|
|
6984
|
+
"required": false,
|
|
6985
|
+
"type": "string",
|
|
6986
|
+
"in": "body"
|
|
6987
|
+
},
|
|
6988
|
+
{
|
|
6989
|
+
"name": "description",
|
|
6990
|
+
"description": "",
|
|
6991
|
+
"required": false,
|
|
6992
|
+
"type": "string",
|
|
6993
|
+
"in": "body"
|
|
6994
|
+
},
|
|
6995
|
+
{
|
|
6996
|
+
"name": "target_id",
|
|
6997
|
+
"description": "",
|
|
6998
|
+
"required": false,
|
|
6999
|
+
"type": "string",
|
|
7000
|
+
"in": "body"
|
|
7001
|
+
},
|
|
7002
|
+
{
|
|
7003
|
+
"name": "input",
|
|
7004
|
+
"description": "",
|
|
7005
|
+
"required": false,
|
|
7006
|
+
"type": "object",
|
|
7007
|
+
"in": "body"
|
|
7008
|
+
},
|
|
7009
|
+
{
|
|
7010
|
+
"name": "cron",
|
|
7011
|
+
"description": "",
|
|
7012
|
+
"required": false,
|
|
7013
|
+
"type": "string",
|
|
7014
|
+
"in": "body"
|
|
7015
|
+
},
|
|
7016
|
+
{
|
|
7017
|
+
"name": "active",
|
|
7018
|
+
"description": "",
|
|
7019
|
+
"required": false,
|
|
7020
|
+
"type": "boolean",
|
|
7021
|
+
"in": "body"
|
|
7022
|
+
}
|
|
7023
|
+
]
|
|
7024
|
+
},
|
|
7025
|
+
"delete-trigger": {
|
|
7026
|
+
serviceClass: "Triggers",
|
|
7027
|
+
operationId: "deleteTrigger",
|
|
7028
|
+
description: "Removes the trigger. Its firing history is kept.",
|
|
7029
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/triggers",
|
|
7030
|
+
httpMethod: "delete",
|
|
7031
|
+
pathParams: ["project_id", "trigger_id"],
|
|
7032
|
+
queryParams: [],
|
|
7033
|
+
flags: [{
|
|
7034
|
+
"name": "project_id",
|
|
7035
|
+
"description": "Project public ID (proj_ prefix).",
|
|
7036
|
+
"required": true,
|
|
7037
|
+
"type": "string",
|
|
7038
|
+
"in": "path"
|
|
7039
|
+
}, {
|
|
7040
|
+
"name": "trigger_id",
|
|
7041
|
+
"description": "Trigger public ID (trg_ prefix) — the runtime trigger id.",
|
|
7042
|
+
"required": true,
|
|
7043
|
+
"type": "string",
|
|
7044
|
+
"in": "path"
|
|
7045
|
+
}]
|
|
7046
|
+
},
|
|
7047
|
+
"fire-trigger": {
|
|
7048
|
+
serviceClass: "Triggers",
|
|
7049
|
+
operationId: "fireTrigger",
|
|
7050
|
+
description: "Runs the trigger's target right now, outside its schedule, and waits for the run to finish. This is the `…:fire` action; the path segment is `{trigger_id}:fire`. `input` is shallow-merged over the trigger's own stored `input` for this run only — the trigger's configuration is unchanged.",
|
|
7051
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/triggers",
|
|
7052
|
+
httpMethod: "post",
|
|
7053
|
+
pathParams: ["project_id", "trigger_id"],
|
|
7054
|
+
queryParams: [],
|
|
7055
|
+
flags: [
|
|
7056
|
+
{
|
|
7057
|
+
"name": "project_id",
|
|
7058
|
+
"description": "Project public ID (proj_ prefix).",
|
|
7059
|
+
"required": true,
|
|
7060
|
+
"type": "string",
|
|
7061
|
+
"in": "path"
|
|
7062
|
+
},
|
|
7063
|
+
{
|
|
7064
|
+
"name": "trigger_id",
|
|
7065
|
+
"description": "Trigger public ID (trg_ prefix) — the runtime trigger id.",
|
|
7066
|
+
"required": true,
|
|
7067
|
+
"type": "string",
|
|
7068
|
+
"in": "path"
|
|
7069
|
+
},
|
|
7070
|
+
{
|
|
7071
|
+
"name": "input",
|
|
7072
|
+
"description": "Fire-time input, shallow-merged over the trigger's stored `input`.",
|
|
7073
|
+
"required": false,
|
|
7074
|
+
"type": "object",
|
|
7075
|
+
"in": "body"
|
|
7076
|
+
}
|
|
7077
|
+
]
|
|
7078
|
+
},
|
|
7079
|
+
"list-trigger-firings": {
|
|
7080
|
+
serviceClass: "Triggers",
|
|
7081
|
+
operationId: "listTriggerFirings",
|
|
7082
|
+
description: "Every time this trigger ran, newest first — scheduled and manual alike.",
|
|
7083
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/triggers",
|
|
7084
|
+
httpMethod: "get",
|
|
7085
|
+
pathParams: ["project_id", "trigger_id"],
|
|
7086
|
+
queryParams: ["limit", "offset"],
|
|
7087
|
+
flags: [
|
|
7088
|
+
{
|
|
7089
|
+
"name": "project_id",
|
|
7090
|
+
"description": "Project public ID (proj_ prefix).",
|
|
7091
|
+
"required": true,
|
|
7092
|
+
"type": "string",
|
|
7093
|
+
"in": "path"
|
|
7094
|
+
},
|
|
7095
|
+
{
|
|
7096
|
+
"name": "trigger_id",
|
|
7097
|
+
"description": "Trigger public ID (trg_ prefix) — the runtime trigger id.",
|
|
7098
|
+
"required": true,
|
|
7099
|
+
"type": "string",
|
|
7100
|
+
"in": "path"
|
|
7101
|
+
},
|
|
7102
|
+
{
|
|
7103
|
+
"name": "limit",
|
|
7104
|
+
"description": "Maximum items to return (1–100).",
|
|
7105
|
+
"required": false,
|
|
7106
|
+
"type": "integer",
|
|
7107
|
+
"in": "query"
|
|
7108
|
+
},
|
|
7109
|
+
{
|
|
7110
|
+
"name": "offset",
|
|
7111
|
+
"description": "Items to skip. These lists page by offset rather than by naturali's usual opaque cursor because the upstream ordering is offset-based; a cursor here would only imitate a keyset.\n",
|
|
7112
|
+
"required": false,
|
|
7113
|
+
"type": "integer",
|
|
7114
|
+
"in": "query"
|
|
7115
|
+
}
|
|
7116
|
+
]
|
|
7117
|
+
},
|
|
7118
|
+
"get-trigger-firing": {
|
|
7119
|
+
serviceClass: "Triggers",
|
|
7120
|
+
operationId: "getTriggerFiring",
|
|
7121
|
+
description: "Get a trigger firing",
|
|
7122
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/triggers",
|
|
7123
|
+
httpMethod: "get",
|
|
7124
|
+
pathParams: [
|
|
7125
|
+
"project_id",
|
|
7126
|
+
"trigger_id",
|
|
7127
|
+
"firing_id"
|
|
7128
|
+
],
|
|
7129
|
+
queryParams: [],
|
|
7130
|
+
flags: [
|
|
7131
|
+
{
|
|
7132
|
+
"name": "project_id",
|
|
7133
|
+
"description": "Project public ID (proj_ prefix).",
|
|
7134
|
+
"required": true,
|
|
7135
|
+
"type": "string",
|
|
7136
|
+
"in": "path"
|
|
7137
|
+
},
|
|
7138
|
+
{
|
|
7139
|
+
"name": "trigger_id",
|
|
7140
|
+
"description": "Trigger public ID (trg_ prefix) — the runtime trigger id.",
|
|
7141
|
+
"required": true,
|
|
7142
|
+
"type": "string",
|
|
7143
|
+
"in": "path"
|
|
7144
|
+
},
|
|
7145
|
+
{
|
|
7146
|
+
"name": "firing_id",
|
|
7147
|
+
"description": "Firing public ID — the runtime firing id.",
|
|
7148
|
+
"required": true,
|
|
7149
|
+
"type": "string",
|
|
7150
|
+
"in": "path"
|
|
7151
|
+
}
|
|
7152
|
+
]
|
|
7153
|
+
},
|
|
6741
7154
|
"list-webhooks": {
|
|
6742
7155
|
serviceClass: "Webhooks",
|
|
6743
7156
|
operationId: "listWebhooks",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/cli",
|
|
3
|
-
"version": "0.50.
|
|
3
|
+
"version": "0.50.1",
|
|
4
4
|
"description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tsx": "^4.23.1",
|
|
31
31
|
"typescript": "~6.0.3",
|
|
32
32
|
"vitest": "^4.1.10",
|
|
33
|
-
"@naturali/sdk": "0.50.
|
|
33
|
+
"@naturali/sdk": "0.50.1"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"generate": "tsx scripts/generate.ts",
|