@naturali/sdk 0.49.3 → 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 CHANGED
@@ -2038,6 +2038,108 @@ var Traces = class {
2038
2038
  });
2039
2039
  }
2040
2040
  };
2041
+ var Triggers = class {
2042
+ /**
2043
+ * List triggers
2044
+ *
2045
+ * The project's schedule triggers.
2046
+ */
2047
+ static listTriggers(options) {
2048
+ return (options.client ?? client).get({
2049
+ url: "/v1/projects/{project_id}/triggers",
2050
+ ...options
2051
+ });
2052
+ }
2053
+ /**
2054
+ * Create a trigger
2055
+ *
2056
+ * Schedules `target_id` (an agent in this project) to run on `cron`, a 5-field cron expression evaluated in UTC.
2057
+ *
2058
+ */
2059
+ static createTrigger(options) {
2060
+ return (options.client ?? client).post({
2061
+ url: "/v1/projects/{project_id}/triggers",
2062
+ ...options,
2063
+ headers: {
2064
+ "Content-Type": "application/json",
2065
+ ...options.headers
2066
+ }
2067
+ });
2068
+ }
2069
+ /**
2070
+ * Delete a trigger
2071
+ *
2072
+ * Removes the trigger. Its firing history is kept.
2073
+ */
2074
+ static deleteTrigger(options) {
2075
+ return (options.client ?? client).delete({
2076
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}",
2077
+ ...options
2078
+ });
2079
+ }
2080
+ /**
2081
+ * Get a trigger
2082
+ */
2083
+ static getTrigger(options) {
2084
+ return (options.client ?? client).get({
2085
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}",
2086
+ ...options
2087
+ });
2088
+ }
2089
+ /**
2090
+ * Update a trigger
2091
+ *
2092
+ * Retune the schedule, its target, or whether it fires at all. At least one field is required. `type` and `target_type` are immutable.
2093
+ *
2094
+ */
2095
+ static updateTrigger(options) {
2096
+ return (options.client ?? client).patch({
2097
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}",
2098
+ ...options,
2099
+ headers: {
2100
+ "Content-Type": "application/json",
2101
+ ...options.headers
2102
+ }
2103
+ });
2104
+ }
2105
+ /**
2106
+ * Fire a trigger manually
2107
+ *
2108
+ * 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`.
2109
+ * `input` is shallow-merged over the trigger's own stored `input` for this run only — the trigger's configuration is unchanged.
2110
+ *
2111
+ */
2112
+ static fireTrigger(options) {
2113
+ return (options.client ?? client).post({
2114
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}:fire",
2115
+ ...options,
2116
+ headers: {
2117
+ "Content-Type": "application/json",
2118
+ ...options.headers
2119
+ }
2120
+ });
2121
+ }
2122
+ /**
2123
+ * List a trigger's firings
2124
+ *
2125
+ * Every time this trigger ran, newest first — scheduled and manual alike.
2126
+ */
2127
+ static listTriggerFirings(options) {
2128
+ return (options.client ?? client).get({
2129
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}/firings",
2130
+ ...options
2131
+ });
2132
+ }
2133
+ /**
2134
+ * Get a trigger firing
2135
+ */
2136
+ static getTriggerFiring(options) {
2137
+ return (options.client ?? client).get({
2138
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}/firings/{firing_id}",
2139
+ ...options
2140
+ });
2141
+ }
2142
+ };
2041
2143
  var Webhooks = class {
2042
2144
  /**
2043
2145
  * List webhooks
@@ -2252,4 +2354,4 @@ var NaturaliClient = class {
2252
2354
  }
2253
2355
  };
2254
2356
  //#endregion
2255
- export { Actors, Agents, ApiKeys, Assistant, Auth, Boards, Channels, Generations, Knowledge, Models, NaturaliClient, Projects, Providers, Sessions, Tasks, Tools, Traces, Webhooks, createClient, createConfig };
2357
+ export { Actors, Agents, ApiKeys, Assistant, Auth, Boards, Channels, Generations, Knowledge, Models, NaturaliClient, Projects, Providers, Sessions, Tasks, Tools, Traces, Triggers, Webhooks, createClient, createConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/sdk",
3
- "version": "0.49.3",
3
+ "version": "0.50.1",
4
4
  "description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -37,7 +37,7 @@
37
37
  "tsx": "^4.23.1",
38
38
  "typescript": "~6.0.3",
39
39
  "vitest": "^4.1.10",
40
- "@naturali/api": "0.49.3"
40
+ "@naturali/api": "0.50.1"
41
41
  },
42
42
  "scripts": {
43
43
  "generate": "tsx scripts/generate.ts",