@ziggy-ai/client-sdk 0.1.0 → 0.1.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.d.ts +2 -2
- package/dist/index.js +15 -15
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @ziggy/client-sdk Types
|
|
2
|
+
* @ziggy-ai/client-sdk Types
|
|
3
3
|
*
|
|
4
4
|
* All TypeScript types for the client SDK.
|
|
5
5
|
*/
|
|
@@ -755,7 +755,7 @@ declare class AppClient {
|
|
|
755
755
|
*
|
|
756
756
|
* @example
|
|
757
757
|
* ```typescript
|
|
758
|
-
* import { CallbackHandler } from '@ziggy/client-sdk';
|
|
758
|
+
* import { CallbackHandler } from '@ziggy-ai/client-sdk';
|
|
759
759
|
*
|
|
760
760
|
* const handler = new CallbackHandler();
|
|
761
761
|
*
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
// src/types.
|
|
1
|
+
// src/types.js
|
|
2
2
|
var ZiggyError = class extends Error {
|
|
3
|
+
status;
|
|
4
|
+
code;
|
|
5
|
+
details;
|
|
3
6
|
constructor(message, status, code, details) {
|
|
4
7
|
super(message);
|
|
5
8
|
this.status = status;
|
|
@@ -9,6 +12,7 @@ var ZiggyError = class extends Error {
|
|
|
9
12
|
}
|
|
10
13
|
};
|
|
11
14
|
var ZiggyConnectionError = class extends ZiggyError {
|
|
15
|
+
retryable;
|
|
12
16
|
constructor(message, retryable = true) {
|
|
13
17
|
super(message, 0, "CONNECTION_ERROR");
|
|
14
18
|
this.retryable = retryable;
|
|
@@ -16,7 +20,7 @@ var ZiggyConnectionError = class extends ZiggyError {
|
|
|
16
20
|
}
|
|
17
21
|
};
|
|
18
22
|
|
|
19
|
-
// src/auth.
|
|
23
|
+
// src/auth.js
|
|
20
24
|
function buildHeaders(config, extra) {
|
|
21
25
|
return {
|
|
22
26
|
"Content-Type": "application/json",
|
|
@@ -25,7 +29,7 @@ function buildHeaders(config, extra) {
|
|
|
25
29
|
};
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
// src/connection.
|
|
32
|
+
// src/connection.js
|
|
29
33
|
var Connection = class {
|
|
30
34
|
config;
|
|
31
35
|
constructor(config) {
|
|
@@ -59,14 +63,12 @@ var Connection = class {
|
|
|
59
63
|
}
|
|
60
64
|
return await response.json();
|
|
61
65
|
} catch (error) {
|
|
62
|
-
if (error instanceof ZiggyError)
|
|
66
|
+
if (error instanceof ZiggyError)
|
|
67
|
+
throw error;
|
|
63
68
|
if (error instanceof DOMException && error.name === "AbortError") {
|
|
64
69
|
throw new ZiggyConnectionError("Request timed out", true);
|
|
65
70
|
}
|
|
66
|
-
throw new ZiggyConnectionError(
|
|
67
|
-
error instanceof Error ? error.message : "Connection failed",
|
|
68
|
-
true
|
|
69
|
-
);
|
|
71
|
+
throw new ZiggyConnectionError(error instanceof Error ? error.message : "Connection failed", true);
|
|
70
72
|
} finally {
|
|
71
73
|
clearTimeout(timer);
|
|
72
74
|
}
|
|
@@ -95,11 +97,9 @@ var Connection = class {
|
|
|
95
97
|
}
|
|
96
98
|
return response;
|
|
97
99
|
} catch (error) {
|
|
98
|
-
if (error instanceof ZiggyError)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
true
|
|
102
|
-
);
|
|
100
|
+
if (error instanceof ZiggyError)
|
|
101
|
+
throw error;
|
|
102
|
+
throw new ZiggyConnectionError(error instanceof Error ? error.message : "Connection failed", true);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
};
|
|
@@ -545,7 +545,7 @@ var AnalyticsClient = class {
|
|
|
545
545
|
}
|
|
546
546
|
};
|
|
547
547
|
|
|
548
|
-
// src/app.
|
|
548
|
+
// src/app.js
|
|
549
549
|
var AppClient = class {
|
|
550
550
|
connection;
|
|
551
551
|
constructor(connection) {
|
|
@@ -624,7 +624,7 @@ var AppClient = class {
|
|
|
624
624
|
}
|
|
625
625
|
};
|
|
626
626
|
|
|
627
|
-
// src/callback-handler.
|
|
627
|
+
// src/callback-handler.js
|
|
628
628
|
var CallbackHandler = class {
|
|
629
629
|
handlers = /* @__PURE__ */ new Map();
|
|
630
630
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ziggy-ai/client-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Client SDK for integrating with Ziggy's v1 API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"repository": {
|
|
42
42
|
"type": "git",
|
|
43
|
-
"url": "https://github.com/
|
|
43
|
+
"url": "https://github.com/alchemyagentic/Ziggy.git",
|
|
44
44
|
"directory": "packages/client-sdk"
|
|
45
45
|
}
|
|
46
46
|
}
|