@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.cjs CHANGED
@@ -2039,6 +2039,108 @@ var Traces = class {
2039
2039
  });
2040
2040
  }
2041
2041
  };
2042
+ var Triggers = class {
2043
+ /**
2044
+ * List triggers
2045
+ *
2046
+ * The project's schedule triggers.
2047
+ */
2048
+ static listTriggers(options) {
2049
+ return (options.client ?? client).get({
2050
+ url: "/v1/projects/{project_id}/triggers",
2051
+ ...options
2052
+ });
2053
+ }
2054
+ /**
2055
+ * Create a trigger
2056
+ *
2057
+ * Schedules `target_id` (an agent in this project) to run on `cron`, a 5-field cron expression evaluated in UTC.
2058
+ *
2059
+ */
2060
+ static createTrigger(options) {
2061
+ return (options.client ?? client).post({
2062
+ url: "/v1/projects/{project_id}/triggers",
2063
+ ...options,
2064
+ headers: {
2065
+ "Content-Type": "application/json",
2066
+ ...options.headers
2067
+ }
2068
+ });
2069
+ }
2070
+ /**
2071
+ * Delete a trigger
2072
+ *
2073
+ * Removes the trigger. Its firing history is kept.
2074
+ */
2075
+ static deleteTrigger(options) {
2076
+ return (options.client ?? client).delete({
2077
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}",
2078
+ ...options
2079
+ });
2080
+ }
2081
+ /**
2082
+ * Get a trigger
2083
+ */
2084
+ static getTrigger(options) {
2085
+ return (options.client ?? client).get({
2086
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}",
2087
+ ...options
2088
+ });
2089
+ }
2090
+ /**
2091
+ * Update a trigger
2092
+ *
2093
+ * Retune the schedule, its target, or whether it fires at all. At least one field is required. `type` and `target_type` are immutable.
2094
+ *
2095
+ */
2096
+ static updateTrigger(options) {
2097
+ return (options.client ?? client).patch({
2098
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}",
2099
+ ...options,
2100
+ headers: {
2101
+ "Content-Type": "application/json",
2102
+ ...options.headers
2103
+ }
2104
+ });
2105
+ }
2106
+ /**
2107
+ * Fire a trigger manually
2108
+ *
2109
+ * 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`.
2110
+ * `input` is shallow-merged over the trigger's own stored `input` for this run only — the trigger's configuration is unchanged.
2111
+ *
2112
+ */
2113
+ static fireTrigger(options) {
2114
+ return (options.client ?? client).post({
2115
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}:fire",
2116
+ ...options,
2117
+ headers: {
2118
+ "Content-Type": "application/json",
2119
+ ...options.headers
2120
+ }
2121
+ });
2122
+ }
2123
+ /**
2124
+ * List a trigger's firings
2125
+ *
2126
+ * Every time this trigger ran, newest first — scheduled and manual alike.
2127
+ */
2128
+ static listTriggerFirings(options) {
2129
+ return (options.client ?? client).get({
2130
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}/firings",
2131
+ ...options
2132
+ });
2133
+ }
2134
+ /**
2135
+ * Get a trigger firing
2136
+ */
2137
+ static getTriggerFiring(options) {
2138
+ return (options.client ?? client).get({
2139
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}/firings/{firing_id}",
2140
+ ...options
2141
+ });
2142
+ }
2143
+ };
2042
2144
  var Webhooks = class {
2043
2145
  /**
2044
2146
  * List webhooks
@@ -2270,6 +2372,7 @@ exports.Sessions = Sessions;
2270
2372
  exports.Tasks = Tasks;
2271
2373
  exports.Tools = Tools;
2272
2374
  exports.Traces = Traces;
2375
+ exports.Triggers = Triggers;
2273
2376
  exports.Webhooks = Webhooks;
2274
2377
  exports.createClient = createClient;
2275
2378
  exports.createConfig = createConfig;