@omnara/sdk 0.1.8 → 0.1.10

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/zod.js CHANGED
@@ -187,6 +187,7 @@ import {
187
187
  zCronMessageTemplate,
188
188
  zCronTimezone,
189
189
  zCronTrigger,
190
+ zCronTriggerDeliveryMode,
190
191
  zCronTriggerFailureReport,
191
192
  zCronTriggerId,
192
193
  zCronTriggerTarget,
@@ -749,7 +750,7 @@ import {
749
750
  zVisibleMachine,
750
751
  zVisibleProject,
751
752
  zWarning
752
- } from "./chunk-P33FH4PQ.js";
753
+ } from "./chunk-Q6U3G6AQ.js";
753
754
  export {
754
755
  zAcceptInvitationPath,
755
756
  zAcceptInvitationResponse,
@@ -939,6 +940,7 @@ export {
939
940
  zCronMessageTemplate,
940
941
  zCronTimezone,
941
942
  zCronTrigger,
943
+ zCronTriggerDeliveryMode,
942
944
  zCronTriggerFailureReport,
943
945
  zCronTriggerId,
944
946
  zCronTriggerTarget,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnara/sdk",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "TypeScript SDK for the Omnara API, with browser, TanStack Query, and Zod entry points",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://omnara.com",
@@ -1,51 +0,0 @@
1
- import {
2
- zAgentConfigErrorIssue
3
- } from "./chunk-P33FH4PQ.js";
4
-
5
- // src/errors.ts
6
- import * as z from "zod";
7
- var errorIssuesSchema = z.object({ issues: z.array(zAgentConfigErrorIssue).optional() });
8
- function issuesFromBody(body) {
9
- const parsed = errorIssuesSchema.safeParse(body);
10
- return parsed.success ? parsed.data.issues ?? [] : [];
11
- }
12
- var ApiError = class _ApiError extends Error {
13
- status;
14
- code;
15
- body;
16
- issues;
17
- constructor(status, message, code, body) {
18
- super(message);
19
- this.name = "ApiError";
20
- this.status = status;
21
- this.code = code;
22
- this.body = body;
23
- this.issues = issuesFromBody(body);
24
- }
25
- static async fromResponse(response) {
26
- let message = `request failed with status ${response.status}`;
27
- let code;
28
- let data;
29
- try {
30
- data = await response.clone().json();
31
- } catch {
32
- data = void 0;
33
- }
34
- if (data && typeof data === "object") {
35
- if ("error_description" in data && typeof data.error_description === "string") {
36
- message = data.error_description;
37
- } else if ("error" in data && typeof data.error === "string") {
38
- message = data.error;
39
- }
40
- if ("code" in data && typeof data.code === "string") {
41
- code = data.code;
42
- }
43
- }
44
- return new _ApiError(response.status, message, code, data);
45
- }
46
- };
47
-
48
- export {
49
- ApiError
50
- };
51
- //# sourceMappingURL=chunk-5CVUE3YZ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/errors.ts"],"sourcesContent":["import * as z from 'zod'\n\nimport type { AgentConfigErrorIssue, Error as ApiErrorBody } from './generated/types.gen'\nimport { zAgentConfigErrorIssue } from './generated/zod.gen'\n\nexport type ApiErrorCode = ApiErrorBody['code']\n\nconst errorIssuesSchema = z.object({ issues: z.array(zAgentConfigErrorIssue).optional() })\n\nfunction issuesFromBody(body: unknown): AgentConfigErrorIssue[] {\n const parsed = errorIssuesSchema.safeParse(body)\n return parsed.success ? (parsed.data.issues ?? []) : []\n}\n\nexport class ApiError extends Error {\n readonly status: number\n readonly code: ApiErrorCode | undefined\n readonly body: unknown\n readonly issues: AgentConfigErrorIssue[]\n\n constructor(status: number, message: string, code?: ApiErrorCode, body?: unknown) {\n super(message)\n this.name = 'ApiError'\n this.status = status\n this.code = code\n this.body = body\n this.issues = issuesFromBody(body)\n }\n\n static async fromResponse(response: Response): Promise<ApiError> {\n let message = `request failed with status ${response.status}`\n let code: ApiErrorCode | undefined\n let data: unknown\n try {\n data = await response.clone().json()\n } catch {\n data = undefined\n }\n if (data && typeof data === 'object') {\n if ('error_description' in data && typeof data.error_description === 'string') {\n message = data.error_description\n } else if ('error' in data && typeof data.error === 'string') {\n message = data.error\n }\n if ('code' in data && typeof data.code === 'string') {\n code = data.code as ApiErrorCode\n }\n }\n return new ApiError(response.status, message, code, data)\n }\n}\n"],"mappings":";;;;;AAAA,YAAY,OAAO;AAOnB,IAAM,oBAAsB,SAAO,EAAE,QAAU,QAAM,sBAAsB,EAAE,SAAS,EAAE,CAAC;AAEzF,SAAS,eAAe,MAAwC;AAC9D,QAAM,SAAS,kBAAkB,UAAU,IAAI;AAC/C,SAAO,OAAO,UAAW,OAAO,KAAK,UAAU,CAAC,IAAK,CAAC;AACxD;AAEO,IAAM,WAAN,MAAM,kBAAiB,MAAM;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAgB,SAAiB,MAAqB,MAAgB;AAChF,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,SAAS,eAAe,IAAI;AAAA,EACnC;AAAA,EAEA,aAAa,aAAa,UAAuC;AAC/D,QAAI,UAAU,8BAA8B,SAAS,MAAM;AAC3D,QAAI;AACJ,QAAI;AACJ,QAAI;AACF,aAAO,MAAM,SAAS,MAAM,EAAE,KAAK;AAAA,IACrC,QAAQ;AACN,aAAO;AAAA,IACT;AACA,QAAI,QAAQ,OAAO,SAAS,UAAU;AACpC,UAAI,uBAAuB,QAAQ,OAAO,KAAK,sBAAsB,UAAU;AAC7E,kBAAU,KAAK;AAAA,MACjB,WAAW,WAAW,QAAQ,OAAO,KAAK,UAAU,UAAU;AAC5D,kBAAU,KAAK;AAAA,MACjB;AACA,UAAI,UAAU,QAAQ,OAAO,KAAK,SAAS,UAAU;AACnD,eAAO,KAAK;AAAA,MACd;AAAA,IACF;AACA,WAAO,IAAI,UAAS,SAAS,QAAQ,SAAS,MAAM,IAAI;AAAA,EAC1D;AACF;","names":[]}