@orq-ai/node 4.8.0-rc.31 → 4.8.0-rc.32

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.
Files changed (203) hide show
  1. package/README.md +58 -35
  2. package/funcs/policiesList.js +1 -2
  3. package/funcs/policiesList.js.map +1 -1
  4. package/funcs/schedulesCreate.d.ts +18 -0
  5. package/funcs/schedulesCreate.d.ts.map +1 -0
  6. package/funcs/schedulesCreate.js +125 -0
  7. package/funcs/schedulesCreate.js.map +1 -0
  8. package/funcs/schedulesDelete.d.ts +18 -0
  9. package/funcs/schedulesDelete.d.ts.map +1 -0
  10. package/funcs/schedulesDelete.js +129 -0
  11. package/funcs/schedulesDelete.js.map +1 -0
  12. package/funcs/schedulesList.d.ts +17 -0
  13. package/funcs/schedulesList.d.ts.map +1 -0
  14. package/funcs/schedulesList.js +120 -0
  15. package/funcs/schedulesList.js.map +1 -0
  16. package/funcs/schedulesRetrieve.d.ts +18 -0
  17. package/funcs/schedulesRetrieve.d.ts.map +1 -0
  18. package/funcs/schedulesRetrieve.js +128 -0
  19. package/funcs/schedulesRetrieve.js.map +1 -0
  20. package/funcs/schedulesTrigger.d.ts +18 -0
  21. package/funcs/schedulesTrigger.d.ts.map +1 -0
  22. package/funcs/schedulesTrigger.js +128 -0
  23. package/funcs/schedulesTrigger.js.map +1 -0
  24. package/funcs/schedulesUpdate.d.ts +18 -0
  25. package/funcs/schedulesUpdate.d.ts.map +1 -0
  26. package/funcs/schedulesUpdate.js +129 -0
  27. package/funcs/schedulesUpdate.js.map +1 -0
  28. package/jsr.json +1 -1
  29. package/lib/config.d.ts +2 -2
  30. package/lib/config.js +2 -2
  31. package/models/components/index.d.ts +3 -0
  32. package/models/components/index.d.ts.map +1 -1
  33. package/models/components/index.js +3 -0
  34. package/models/components/index.js.map +1 -1
  35. package/models/components/publicschedule.d.ts +66 -0
  36. package/models/components/publicschedule.d.ts.map +1 -0
  37. package/models/components/publicschedule.js +86 -0
  38. package/models/components/publicschedule.js.map +1 -0
  39. package/models/components/publicscheduleerrordetail.d.ts +17 -0
  40. package/models/components/publicscheduleerrordetail.d.ts.map +1 -0
  41. package/models/components/publicscheduleerrordetail.js +51 -0
  42. package/models/components/publicscheduleerrordetail.js.map +1 -0
  43. package/models/components/publicschedulepayload.d.ts +43 -0
  44. package/models/components/publicschedulepayload.d.ts.map +1 -0
  45. package/models/components/publicschedulepayload.js +73 -0
  46. package/models/components/publicschedulepayload.js.map +1 -0
  47. package/models/components/reasoningpart.js +1 -1
  48. package/models/errors/createagentschedule.d.ts +46 -0
  49. package/models/errors/createagentschedule.d.ts.map +1 -0
  50. package/models/errors/createagentschedule.js +99 -0
  51. package/models/errors/createagentschedule.js.map +1 -0
  52. package/models/errors/deleteagentschedule.d.ts +25 -0
  53. package/models/errors/deleteagentschedule.d.ts.map +1 -0
  54. package/models/errors/deleteagentschedule.js +71 -0
  55. package/models/errors/deleteagentschedule.js.map +1 -0
  56. package/models/errors/index.d.ts +5 -0
  57. package/models/errors/index.d.ts.map +1 -1
  58. package/models/errors/index.js +5 -0
  59. package/models/errors/index.js.map +1 -1
  60. package/models/errors/retrieveagentschedule.d.ts +25 -0
  61. package/models/errors/retrieveagentschedule.d.ts.map +1 -0
  62. package/models/errors/retrieveagentschedule.js +71 -0
  63. package/models/errors/retrieveagentschedule.js.map +1 -0
  64. package/models/errors/triggeragentschedule.d.ts +46 -0
  65. package/models/errors/triggeragentschedule.d.ts.map +1 -0
  66. package/models/errors/triggeragentschedule.js +99 -0
  67. package/models/errors/triggeragentschedule.js.map +1 -0
  68. package/models/errors/updateagentschedule.d.ts +46 -0
  69. package/models/errors/updateagentschedule.d.ts.map +1 -0
  70. package/models/errors/updateagentschedule.js +99 -0
  71. package/models/errors/updateagentschedule.js.map +1 -0
  72. package/models/operations/createagentschedule.d.ts +123 -0
  73. package/models/operations/createagentschedule.d.ts.map +1 -0
  74. package/models/operations/createagentschedule.js +125 -0
  75. package/models/operations/createagentschedule.js.map +1 -0
  76. package/models/operations/createcontact.js +1 -1
  77. package/models/operations/createdataset.js +1 -1
  78. package/models/operations/createdatasetitem.js +4 -4
  79. package/models/operations/createdatasource.js +1 -1
  80. package/models/operations/createeval.js +16 -16
  81. package/models/operations/createidentity.js +1 -1
  82. package/models/operations/createtool.js +6 -6
  83. package/models/operations/deleteagentschedule.d.ts +20 -0
  84. package/models/operations/deleteagentschedule.d.ts.map +1 -0
  85. package/models/operations/deleteagentschedule.js +56 -0
  86. package/models/operations/deleteagentschedule.js.map +1 -0
  87. package/models/operations/getalltools.js +6 -6
  88. package/models/operations/getevals.js +16 -16
  89. package/models/operations/getv2humanevalsets.js +2 -2
  90. package/models/operations/getv2humanevalsetsid.js +2 -2
  91. package/models/operations/index.d.ts +6 -0
  92. package/models/operations/index.d.ts.map +1 -1
  93. package/models/operations/index.js +6 -0
  94. package/models/operations/index.js.map +1 -1
  95. package/models/operations/listagentschedules.d.ts +27 -0
  96. package/models/operations/listagentschedules.d.ts.map +1 -0
  97. package/models/operations/listagentschedules.js +64 -0
  98. package/models/operations/listagentschedules.js.map +1 -0
  99. package/models/operations/listdatasetdatapoints.js +4 -4
  100. package/models/operations/listdatasets.js +1 -1
  101. package/models/operations/listdatasources.js +1 -1
  102. package/models/operations/listidentities.js +1 -1
  103. package/models/operations/patchv2humanevalsetsid.js +2 -2
  104. package/models/operations/policylist.d.ts +3 -8
  105. package/models/operations/policylist.d.ts.map +1 -1
  106. package/models/operations/policylist.js +2 -2
  107. package/models/operations/policylist.js.map +1 -1
  108. package/models/operations/postv2feedbackevaluation.js +3 -3
  109. package/models/operations/postv2humanevalsets.js +2 -2
  110. package/models/operations/retrieveagentschedule.d.ts +87 -0
  111. package/models/operations/retrieveagentschedule.d.ts.map +1 -0
  112. package/models/operations/retrieveagentschedule.js +100 -0
  113. package/models/operations/retrieveagentschedule.js.map +1 -0
  114. package/models/operations/retrievedatapoint.js +4 -4
  115. package/models/operations/retrievedataset.js +1 -1
  116. package/models/operations/retrievedatasource.js +1 -1
  117. package/models/operations/retrieveidentity.js +1 -1
  118. package/models/operations/retrievetool.js +6 -6
  119. package/models/operations/runagent.js +1 -1
  120. package/models/operations/streamrunagent.js +1 -1
  121. package/models/operations/triggeragentschedule.d.ts +35 -0
  122. package/models/operations/triggeragentschedule.d.ts.map +1 -0
  123. package/models/operations/triggeragentschedule.js +70 -0
  124. package/models/operations/triggeragentschedule.js.map +1 -0
  125. package/models/operations/updateagentschedule.d.ts +133 -0
  126. package/models/operations/updateagentschedule.d.ts.map +1 -0
  127. package/models/operations/updateagentschedule.js +129 -0
  128. package/models/operations/updateagentschedule.js.map +1 -0
  129. package/models/operations/updatedatapoint.js +4 -4
  130. package/models/operations/updatedataset.js +1 -1
  131. package/models/operations/updatedatasource.js +1 -1
  132. package/models/operations/updateeval.js +16 -16
  133. package/models/operations/updateidentity.js +1 -1
  134. package/models/operations/updatetool.js +7 -7
  135. package/package.json +9 -9
  136. package/sdk/schedules.d.ts +47 -0
  137. package/sdk/schedules.d.ts.map +1 -0
  138. package/sdk/schedules.js +72 -0
  139. package/sdk/schedules.js.map +1 -0
  140. package/sdk/sdk.d.ts +3 -0
  141. package/sdk/sdk.d.ts.map +1 -1
  142. package/sdk/sdk.js +4 -0
  143. package/sdk/sdk.js.map +1 -1
  144. package/src/funcs/policiesList.ts +1 -2
  145. package/src/funcs/schedulesCreate.ts +185 -0
  146. package/src/funcs/schedulesDelete.ts +184 -0
  147. package/src/funcs/schedulesList.ts +167 -0
  148. package/src/funcs/schedulesRetrieve.ts +183 -0
  149. package/src/funcs/schedulesTrigger.ts +190 -0
  150. package/src/funcs/schedulesUpdate.ts +191 -0
  151. package/src/lib/config.ts +2 -2
  152. package/src/models/components/index.ts +3 -0
  153. package/src/models/components/publicschedule.ts +121 -0
  154. package/src/models/components/publicscheduleerrordetail.ts +39 -0
  155. package/src/models/components/publicschedulepayload.ts +84 -0
  156. package/src/models/components/reasoningpart.ts +1 -1
  157. package/src/models/errors/createagentschedule.ts +105 -0
  158. package/src/models/errors/deleteagentschedule.ts +56 -0
  159. package/src/models/errors/index.ts +5 -0
  160. package/src/models/errors/retrieveagentschedule.ts +56 -0
  161. package/src/models/errors/triggeragentschedule.ts +105 -0
  162. package/src/models/errors/updateagentschedule.ts +105 -0
  163. package/src/models/operations/createagentschedule.ts +230 -0
  164. package/src/models/operations/createcontact.ts +1 -1
  165. package/src/models/operations/createdataset.ts +1 -1
  166. package/src/models/operations/createdatasetitem.ts +4 -4
  167. package/src/models/operations/createdatasource.ts +1 -1
  168. package/src/models/operations/createeval.ts +16 -16
  169. package/src/models/operations/createidentity.ts +1 -1
  170. package/src/models/operations/createtool.ts +6 -6
  171. package/src/models/operations/deleteagentschedule.ts +46 -0
  172. package/src/models/operations/getalltools.ts +6 -6
  173. package/src/models/operations/getevals.ts +16 -16
  174. package/src/models/operations/getv2humanevalsets.ts +2 -2
  175. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  176. package/src/models/operations/index.ts +6 -0
  177. package/src/models/operations/listagentschedules.ts +69 -0
  178. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  179. package/src/models/operations/listdatasets.ts +1 -1
  180. package/src/models/operations/listdatasources.ts +1 -1
  181. package/src/models/operations/listidentities.ts +1 -1
  182. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  183. package/src/models/operations/policylist.ts +5 -10
  184. package/src/models/operations/postv2feedbackevaluation.ts +3 -3
  185. package/src/models/operations/postv2humanevalsets.ts +2 -2
  186. package/src/models/operations/retrieveagentschedule.ts +165 -0
  187. package/src/models/operations/retrievedatapoint.ts +4 -4
  188. package/src/models/operations/retrievedataset.ts +1 -1
  189. package/src/models/operations/retrievedatasource.ts +1 -1
  190. package/src/models/operations/retrieveidentity.ts +1 -1
  191. package/src/models/operations/retrievetool.ts +6 -6
  192. package/src/models/operations/runagent.ts +1 -1
  193. package/src/models/operations/streamrunagent.ts +1 -1
  194. package/src/models/operations/triggeragentschedule.ts +86 -0
  195. package/src/models/operations/updateagentschedule.ts +244 -0
  196. package/src/models/operations/updatedatapoint.ts +4 -4
  197. package/src/models/operations/updatedataset.ts +1 -1
  198. package/src/models/operations/updatedatasource.ts +1 -1
  199. package/src/models/operations/updateeval.ts +16 -16
  200. package/src/models/operations/updateidentity.ts +1 -1
  201. package/src/models/operations/updatetool.ts +7 -7
  202. package/src/sdk/schedules.ts +117 -0
  203. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,190 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeSimple } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
22
+ import { OrqError } from "../models/errors/orqerror.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Trigger schedule execution
31
+ *
32
+ * @remarks
33
+ * Runs the schedule's payload immediately (≈10 seconds after the request, to stay above the NATS scheduler's minimum deliver-at margin). The schedule's regular cadence is unaffected. Inactive schedules return 400.
34
+ */
35
+ export function schedulesTrigger(
36
+ client: OrqCore,
37
+ request: operations.TriggerAgentScheduleRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ operations.TriggerAgentScheduleResponseBody,
42
+ | errors.TriggerAgentScheduleResponseBody
43
+ | errors.TriggerAgentScheduleSchedulesResponseBody
44
+ | OrqError
45
+ | ResponseValidationError
46
+ | ConnectionError
47
+ | RequestAbortedError
48
+ | RequestTimeoutError
49
+ | InvalidRequestError
50
+ | UnexpectedClientError
51
+ | SDKValidationError
52
+ >
53
+ > {
54
+ return new APIPromise($do(
55
+ client,
56
+ request,
57
+ options,
58
+ ));
59
+ }
60
+
61
+ async function $do(
62
+ client: OrqCore,
63
+ request: operations.TriggerAgentScheduleRequest,
64
+ options?: RequestOptions,
65
+ ): Promise<
66
+ [
67
+ Result<
68
+ operations.TriggerAgentScheduleResponseBody,
69
+ | errors.TriggerAgentScheduleResponseBody
70
+ | errors.TriggerAgentScheduleSchedulesResponseBody
71
+ | OrqError
72
+ | ResponseValidationError
73
+ | ConnectionError
74
+ | RequestAbortedError
75
+ | RequestTimeoutError
76
+ | InvalidRequestError
77
+ | UnexpectedClientError
78
+ | SDKValidationError
79
+ >,
80
+ APICall,
81
+ ]
82
+ > {
83
+ const parsed = safeParse(
84
+ request,
85
+ (value) =>
86
+ operations.TriggerAgentScheduleRequest$outboundSchema.parse(value),
87
+ "Input validation failed",
88
+ );
89
+ if (!parsed.ok) {
90
+ return [parsed, { status: "invalid" }];
91
+ }
92
+ const payload = parsed.value;
93
+ const body = null;
94
+
95
+ const pathParams = {
96
+ agent_key: encodeSimple("agent_key", payload.agent_key, {
97
+ explode: false,
98
+ charEncoding: "percent",
99
+ }),
100
+ schedule_id: encodeSimple("schedule_id", payload.schedule_id, {
101
+ explode: false,
102
+ charEncoding: "percent",
103
+ }),
104
+ };
105
+ const path = pathToFunc(
106
+ "/v3/agents/{agent_key}/schedules/{schedule_id}/execution",
107
+ )(pathParams);
108
+
109
+ const headers = new Headers(compactMap({
110
+ Accept: "application/json",
111
+ }));
112
+
113
+ const secConfig = await extractSecurity(client._options.apiKey);
114
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
115
+ const requestSecurity = resolveGlobalSecurity(securityInput);
116
+
117
+ const context = {
118
+ options: client._options,
119
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
120
+ operationID: "trigger-agent-schedule",
121
+ oAuth2Scopes: null,
122
+
123
+ resolvedSecurity: requestSecurity,
124
+
125
+ securitySource: client._options.apiKey,
126
+ retryConfig: options?.retries
127
+ || client._options.retryConfig
128
+ || { strategy: "none" },
129
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
130
+ };
131
+
132
+ const requestRes = client._createRequest(context, {
133
+ security: requestSecurity,
134
+ method: "POST",
135
+ baseURL: options?.serverURL,
136
+ path: path,
137
+ headers: headers,
138
+ body: body,
139
+ userAgent: client._options.userAgent,
140
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
141
+ }, options);
142
+ if (!requestRes.ok) {
143
+ return [requestRes, { status: "invalid" }];
144
+ }
145
+ const req = requestRes.value;
146
+
147
+ const doResult = await client._do(req, {
148
+ context,
149
+ isErrorStatusCode: (statusCode: number) =>
150
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
151
+ retryConfig: context.retryConfig,
152
+ retryCodes: context.retryCodes,
153
+ });
154
+ if (!doResult.ok) {
155
+ return [doResult, { status: "request-error", request: req }];
156
+ }
157
+ const response = doResult.value;
158
+
159
+ const responseFields = {
160
+ HttpMeta: { Response: response, Request: req },
161
+ };
162
+
163
+ const [result] = await M.match<
164
+ operations.TriggerAgentScheduleResponseBody,
165
+ | errors.TriggerAgentScheduleResponseBody
166
+ | errors.TriggerAgentScheduleSchedulesResponseBody
167
+ | OrqError
168
+ | ResponseValidationError
169
+ | ConnectionError
170
+ | RequestAbortedError
171
+ | RequestTimeoutError
172
+ | InvalidRequestError
173
+ | UnexpectedClientError
174
+ | SDKValidationError
175
+ >(
176
+ M.json(202, operations.TriggerAgentScheduleResponseBody$inboundSchema),
177
+ M.jsonErr(400, errors.TriggerAgentScheduleResponseBody$inboundSchema),
178
+ M.jsonErr(
179
+ 404,
180
+ errors.TriggerAgentScheduleSchedulesResponseBody$inboundSchema,
181
+ ),
182
+ M.fail("4XX"),
183
+ M.fail("5XX"),
184
+ )(response, req, { extraFields: responseFields });
185
+ if (!result.ok) {
186
+ return [result, { status: "complete", request: req, response }];
187
+ }
188
+
189
+ return [result, { status: "complete", request: req, response }];
190
+ }
@@ -0,0 +1,191 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
22
+ import { OrqError } from "../models/errors/orqerror.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Update schedule
31
+ *
32
+ * @remarks
33
+ * Partially updates a schedule. Any omitted field is left unchanged. Changing `expression` or `type` (or reactivating from inactive) re-publishes the NATS schedule and bumps `generation`; payload-only and `agent_tag`-only changes leave the firing cadence in place.
34
+ */
35
+ export function schedulesUpdate(
36
+ client: OrqCore,
37
+ request: operations.UpdateAgentScheduleRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ operations.UpdateAgentScheduleResponseBody,
42
+ | errors.UpdateAgentScheduleResponseBody
43
+ | errors.UpdateAgentScheduleSchedulesResponseBody
44
+ | OrqError
45
+ | ResponseValidationError
46
+ | ConnectionError
47
+ | RequestAbortedError
48
+ | RequestTimeoutError
49
+ | InvalidRequestError
50
+ | UnexpectedClientError
51
+ | SDKValidationError
52
+ >
53
+ > {
54
+ return new APIPromise($do(
55
+ client,
56
+ request,
57
+ options,
58
+ ));
59
+ }
60
+
61
+ async function $do(
62
+ client: OrqCore,
63
+ request: operations.UpdateAgentScheduleRequest,
64
+ options?: RequestOptions,
65
+ ): Promise<
66
+ [
67
+ Result<
68
+ operations.UpdateAgentScheduleResponseBody,
69
+ | errors.UpdateAgentScheduleResponseBody
70
+ | errors.UpdateAgentScheduleSchedulesResponseBody
71
+ | OrqError
72
+ | ResponseValidationError
73
+ | ConnectionError
74
+ | RequestAbortedError
75
+ | RequestTimeoutError
76
+ | InvalidRequestError
77
+ | UnexpectedClientError
78
+ | SDKValidationError
79
+ >,
80
+ APICall,
81
+ ]
82
+ > {
83
+ const parsed = safeParse(
84
+ request,
85
+ (value) =>
86
+ operations.UpdateAgentScheduleRequest$outboundSchema.parse(value),
87
+ "Input validation failed",
88
+ );
89
+ if (!parsed.ok) {
90
+ return [parsed, { status: "invalid" }];
91
+ }
92
+ const payload = parsed.value;
93
+ const body = encodeJSON("body", payload.RequestBody, { explode: true });
94
+
95
+ const pathParams = {
96
+ agent_key: encodeSimple("agent_key", payload.agent_key, {
97
+ explode: false,
98
+ charEncoding: "percent",
99
+ }),
100
+ schedule_id: encodeSimple("schedule_id", payload.schedule_id, {
101
+ explode: false,
102
+ charEncoding: "percent",
103
+ }),
104
+ };
105
+ const path = pathToFunc("/v3/agents/{agent_key}/schedules/{schedule_id}")(
106
+ pathParams,
107
+ );
108
+
109
+ const headers = new Headers(compactMap({
110
+ "Content-Type": "application/json",
111
+ Accept: "application/json",
112
+ }));
113
+
114
+ const secConfig = await extractSecurity(client._options.apiKey);
115
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
116
+ const requestSecurity = resolveGlobalSecurity(securityInput);
117
+
118
+ const context = {
119
+ options: client._options,
120
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
121
+ operationID: "update-agent-schedule",
122
+ oAuth2Scopes: null,
123
+
124
+ resolvedSecurity: requestSecurity,
125
+
126
+ securitySource: client._options.apiKey,
127
+ retryConfig: options?.retries
128
+ || client._options.retryConfig
129
+ || { strategy: "none" },
130
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
131
+ };
132
+
133
+ const requestRes = client._createRequest(context, {
134
+ security: requestSecurity,
135
+ method: "PATCH",
136
+ baseURL: options?.serverURL,
137
+ path: path,
138
+ headers: headers,
139
+ body: body,
140
+ userAgent: client._options.userAgent,
141
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
142
+ }, options);
143
+ if (!requestRes.ok) {
144
+ return [requestRes, { status: "invalid" }];
145
+ }
146
+ const req = requestRes.value;
147
+
148
+ const doResult = await client._do(req, {
149
+ context,
150
+ isErrorStatusCode: (statusCode: number) =>
151
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
152
+ retryConfig: context.retryConfig,
153
+ retryCodes: context.retryCodes,
154
+ });
155
+ if (!doResult.ok) {
156
+ return [doResult, { status: "request-error", request: req }];
157
+ }
158
+ const response = doResult.value;
159
+
160
+ const responseFields = {
161
+ HttpMeta: { Response: response, Request: req },
162
+ };
163
+
164
+ const [result] = await M.match<
165
+ operations.UpdateAgentScheduleResponseBody,
166
+ | errors.UpdateAgentScheduleResponseBody
167
+ | errors.UpdateAgentScheduleSchedulesResponseBody
168
+ | OrqError
169
+ | ResponseValidationError
170
+ | ConnectionError
171
+ | RequestAbortedError
172
+ | RequestTimeoutError
173
+ | InvalidRequestError
174
+ | UnexpectedClientError
175
+ | SDKValidationError
176
+ >(
177
+ M.json(200, operations.UpdateAgentScheduleResponseBody$inboundSchema),
178
+ M.jsonErr(400, errors.UpdateAgentScheduleResponseBody$inboundSchema),
179
+ M.jsonErr(
180
+ 404,
181
+ errors.UpdateAgentScheduleSchedulesResponseBody$inboundSchema,
182
+ ),
183
+ M.fail("4XX"),
184
+ M.fail("5XX"),
185
+ )(response, req, { extraFields: responseFields });
186
+ if (!result.ok) {
187
+ return [result, { status: "complete", request: req, response }];
188
+ }
189
+
190
+ return [result, { status: "complete", request: req, response }];
191
+ }
package/src/lib/config.ts CHANGED
@@ -68,7 +68,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
68
68
  export const SDK_METADATA = {
69
69
  language: "typescript",
70
70
  openapiDocVersion: "2.0",
71
- sdkVersion: "4.8.0-rc.31",
71
+ sdkVersion: "4.8.0-rc.32",
72
72
  genVersion: "2.881.2",
73
- userAgent: "speakeasy-sdk/typescript 4.8.0-rc.31 2.881.2 2.0 @orq-ai/node",
73
+ userAgent: "speakeasy-sdk/typescript 4.8.0-rc.32 2.881.2 2.0 @orq-ai/node",
74
74
  } as const;
@@ -49,6 +49,9 @@ export * from "./policy.js";
49
49
  export * from "./policyretryconfig.js";
50
50
  export * from "./publiccontact.js";
51
51
  export * from "./publicidentity.js";
52
+ export * from "./publicschedule.js";
53
+ export * from "./publicscheduleerrordetail.js";
54
+ export * from "./publicschedulepayload.js";
52
55
  export * from "./publicusage.js";
53
56
  export * from "./reasoning.js";
54
57
  export * from "./reasoningparam.js";
@@ -0,0 +1,121 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+ import {
12
+ PublicSchedulePayload,
13
+ PublicSchedulePayload$inboundSchema,
14
+ } from "./publicschedulepayload.js";
15
+
16
+ /**
17
+ * Schedule type.
18
+ */
19
+ export const PublicScheduleType = {
20
+ Cron: "cron",
21
+ Once: "once",
22
+ Interval: "interval",
23
+ } as const;
24
+ /**
25
+ * Schedule type.
26
+ */
27
+ export type PublicScheduleType = ClosedEnum<typeof PublicScheduleType>;
28
+
29
+ export type PublicSchedule = {
30
+ /**
31
+ * ULID identifying this schedule.
32
+ */
33
+ id: string;
34
+ agentKey: string;
35
+ /**
36
+ * Pinned agent version. Omit to always run the agent's current active version.
37
+ */
38
+ agentTag?: string | undefined;
39
+ created: Date;
40
+ /**
41
+ * ID of the API key that created the schedule.
42
+ */
43
+ createdById: string;
44
+ /**
45
+ * Cron expression (6-field, seconds required), @every duration, @at RFC3339 timestamp, or a predefined descriptor like @hourly/@daily.
46
+ */
47
+ expression: string;
48
+ /**
49
+ * Monotonic counter bumped when the schedule's firing cadence changes. Used by the consumer to skip stale in-flight triggers.
50
+ */
51
+ generation: number;
52
+ /**
53
+ * Whether the schedule is currently firing. once schedules flip to false automatically after firing.
54
+ */
55
+ isActive: boolean;
56
+ /**
57
+ * Timestamp of the most recent firing, if any.
58
+ */
59
+ lastTriggeredAt?: Date | undefined;
60
+ payload: PublicSchedulePayload;
61
+ /**
62
+ * Total firings since creation or last expression/type change.
63
+ */
64
+ triggerCount: number;
65
+ /**
66
+ * Schedule type.
67
+ */
68
+ type: PublicScheduleType;
69
+ updated: Date;
70
+ workspaceId: string;
71
+ };
72
+
73
+ /** @internal */
74
+ export const PublicScheduleType$inboundSchema: z.ZodNativeEnum<
75
+ typeof PublicScheduleType
76
+ > = z.nativeEnum(PublicScheduleType);
77
+
78
+ /** @internal */
79
+ export const PublicSchedule$inboundSchema: z.ZodType<
80
+ PublicSchedule,
81
+ z.ZodTypeDef,
82
+ unknown
83
+ > = z.object({
84
+ _id: z.string(),
85
+ agent_key: z.string(),
86
+ agent_tag: z.string().optional(),
87
+ created: z.string().datetime({ offset: true }).transform(v => new Date(v)),
88
+ created_by_id: z.string(),
89
+ expression: z.string(),
90
+ generation: z.number().int(),
91
+ is_active: z.boolean(),
92
+ last_triggered_at: z.string().datetime({ offset: true }).transform(v =>
93
+ new Date(v)
94
+ ).optional(),
95
+ payload: PublicSchedulePayload$inboundSchema,
96
+ trigger_count: z.number().int(),
97
+ type: PublicScheduleType$inboundSchema,
98
+ updated: z.string().datetime({ offset: true }).transform(v => new Date(v)),
99
+ workspace_id: z.string(),
100
+ }).transform((v) => {
101
+ return remap$(v, {
102
+ "_id": "id",
103
+ "agent_key": "agentKey",
104
+ "agent_tag": "agentTag",
105
+ "created_by_id": "createdById",
106
+ "is_active": "isActive",
107
+ "last_triggered_at": "lastTriggeredAt",
108
+ "trigger_count": "triggerCount",
109
+ "workspace_id": "workspaceId",
110
+ });
111
+ });
112
+
113
+ export function publicScheduleFromJSON(
114
+ jsonString: string,
115
+ ): SafeParseResult<PublicSchedule, SDKValidationError> {
116
+ return safeParse(
117
+ jsonString,
118
+ (x) => PublicSchedule$inboundSchema.parse(JSON.parse(x)),
119
+ `Failed to parse 'PublicSchedule' from JSON`,
120
+ );
121
+ }
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type PublicScheduleErrorDetail = {
11
+ /**
12
+ * Stable error code, e.g. invalid_expression, schedule_not_found, agent_not_found.
13
+ */
14
+ code: string;
15
+ /**
16
+ * Human-readable error description.
17
+ */
18
+ message: string;
19
+ };
20
+
21
+ /** @internal */
22
+ export const PublicScheduleErrorDetail$inboundSchema: z.ZodType<
23
+ PublicScheduleErrorDetail,
24
+ z.ZodTypeDef,
25
+ unknown
26
+ > = z.object({
27
+ code: z.string(),
28
+ message: z.string(),
29
+ });
30
+
31
+ export function publicScheduleErrorDetailFromJSON(
32
+ jsonString: string,
33
+ ): SafeParseResult<PublicScheduleErrorDetail, SDKValidationError> {
34
+ return safeParse(
35
+ jsonString,
36
+ (x) => PublicScheduleErrorDetail$inboundSchema.parse(JSON.parse(x)),
37
+ `Failed to parse 'PublicScheduleErrorDetail' from JSON`,
38
+ );
39
+ }
@@ -0,0 +1,84 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type PublicSchedulePayload = {
12
+ /**
13
+ * Input to pass to the agent on each firing. Same shape as the Responses API input — a string or an array of input items.
14
+ */
15
+ input?: any | undefined;
16
+ /**
17
+ * Optional memory store entity ID to attach to each run.
18
+ */
19
+ memoryEntityId?: string | undefined;
20
+ /**
21
+ * Opaque key/value pairs attached to every response generated by this schedule.
22
+ */
23
+ metadata?: { [k: string]: any } | undefined;
24
+ /**
25
+ * Template variables substituted into instructions. Supports secret values: {"secret": true, "value": "..."}.
26
+ */
27
+ variables?: { [k: string]: any } | undefined;
28
+ };
29
+
30
+ /** @internal */
31
+ export const PublicSchedulePayload$inboundSchema: z.ZodType<
32
+ PublicSchedulePayload,
33
+ z.ZodTypeDef,
34
+ unknown
35
+ > = z.object({
36
+ input: z.any().optional(),
37
+ memory_entity_id: z.string().optional(),
38
+ metadata: z.record(z.any()).optional(),
39
+ variables: z.record(z.any()).optional(),
40
+ }).transform((v) => {
41
+ return remap$(v, {
42
+ "memory_entity_id": "memoryEntityId",
43
+ });
44
+ });
45
+ /** @internal */
46
+ export type PublicSchedulePayload$Outbound = {
47
+ input?: any | undefined;
48
+ memory_entity_id?: string | undefined;
49
+ metadata?: { [k: string]: any } | undefined;
50
+ variables?: { [k: string]: any } | undefined;
51
+ };
52
+
53
+ /** @internal */
54
+ export const PublicSchedulePayload$outboundSchema: z.ZodType<
55
+ PublicSchedulePayload$Outbound,
56
+ z.ZodTypeDef,
57
+ PublicSchedulePayload
58
+ > = z.object({
59
+ input: z.any().optional(),
60
+ memoryEntityId: z.string().optional(),
61
+ metadata: z.record(z.any()).optional(),
62
+ variables: z.record(z.any()).optional(),
63
+ }).transform((v) => {
64
+ return remap$(v, {
65
+ memoryEntityId: "memory_entity_id",
66
+ });
67
+ });
68
+
69
+ export function publicSchedulePayloadToJSON(
70
+ publicSchedulePayload: PublicSchedulePayload,
71
+ ): string {
72
+ return JSON.stringify(
73
+ PublicSchedulePayload$outboundSchema.parse(publicSchedulePayload),
74
+ );
75
+ }
76
+ export function publicSchedulePayloadFromJSON(
77
+ jsonString: string,
78
+ ): SafeParseResult<PublicSchedulePayload, SDKValidationError> {
79
+ return safeParse(
80
+ jsonString,
81
+ (x) => PublicSchedulePayload$inboundSchema.parse(JSON.parse(x)),
82
+ `Failed to parse 'PublicSchedulePayload' from JSON`,
83
+ );
84
+ }
@@ -40,7 +40,7 @@ export const ReasoningPart$inboundSchema: z.ZodType<
40
40
  z.ZodTypeDef,
41
41
  unknown
42
42
  > = z.object({
43
- _id: z.string().default("reasoning_01kpnfmkm2k9mby5nav2xpabcj"),
43
+ _id: z.string().default("reasoning_01kpnjfdem451s78ftj1863y6k"),
44
44
  metadata: z.record(z.any()).optional(),
45
45
  kind: z.literal("reasoning"),
46
46
  reasoning: z.string(),