@01.software/sdk 0.33.0 → 0.35.0

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 (76) hide show
  1. package/README.md +214 -22
  2. package/dist/analytics/react.cjs.map +1 -1
  3. package/dist/analytics/react.js.map +1 -1
  4. package/dist/analytics.cjs.map +1 -1
  5. package/dist/analytics.js.map +1 -1
  6. package/dist/client.cjs +342 -27
  7. package/dist/client.cjs.map +1 -1
  8. package/dist/client.d.cts +7 -6
  9. package/dist/client.d.ts +7 -6
  10. package/dist/client.js +342 -27
  11. package/dist/client.js.map +1 -1
  12. package/dist/{collection-client-De6eKW1J.d.cts → collection-client-CR2B8c1v.d.cts} +7 -3
  13. package/dist/{collection-client-B6SlhzIP.d.ts → collection-client-DkREjhQ9.d.ts} +7 -3
  14. package/dist/{const-sPR2IkCe.d.cts → const-BTvdrXtY.d.cts} +4 -4
  15. package/dist/{const-DwmSDeWq.d.ts → const-CdqCauHQ.d.ts} +4 -4
  16. package/dist/errors.cjs +300 -0
  17. package/dist/errors.cjs.map +1 -0
  18. package/dist/{index-BGEhoDUs.d.cts → errors.d.cts} +13 -1
  19. package/dist/{index-BGEhoDUs.d.ts → errors.d.ts} +13 -1
  20. package/dist/errors.js +277 -0
  21. package/dist/errors.js.map +1 -0
  22. package/dist/index-CjA3U6X3.d.cts +186 -0
  23. package/dist/index-DK8_NXkh.d.ts +186 -0
  24. package/dist/index.cjs +1402 -177
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +75 -10
  27. package/dist/index.d.ts +75 -10
  28. package/dist/index.js +1402 -177
  29. package/dist/index.js.map +1 -1
  30. package/dist/{payload-types-dkeQyrDC.d.cts → payload-types-C7tb7Xbs.d.cts} +208 -52
  31. package/dist/{payload-types-dkeQyrDC.d.ts → payload-types-C7tb7Xbs.d.ts} +208 -52
  32. package/dist/query.cjs +195 -36
  33. package/dist/query.cjs.map +1 -1
  34. package/dist/query.d.cts +45 -18
  35. package/dist/query.d.ts +45 -18
  36. package/dist/query.js +195 -36
  37. package/dist/query.js.map +1 -1
  38. package/dist/realtime.cjs.map +1 -1
  39. package/dist/realtime.d.cts +2 -2
  40. package/dist/realtime.d.ts +2 -2
  41. package/dist/realtime.js.map +1 -1
  42. package/dist/{server-CrsPyqEc.d.cts → server-nXOezi4b.d.cts} +22 -6
  43. package/dist/{server-CrsPyqEc.d.ts → server-nXOezi4b.d.ts} +22 -6
  44. package/dist/server.cjs +440 -33
  45. package/dist/server.cjs.map +1 -1
  46. package/dist/server.d.cts +11 -179
  47. package/dist/server.d.ts +11 -179
  48. package/dist/server.js +440 -33
  49. package/dist/server.js.map +1 -1
  50. package/dist/{types-Cel_4L9t.d.ts → types-1ylMrCuW.d.ts} +1 -1
  51. package/dist/{types-B3YT092I.d.cts → types-Bx558PU6.d.cts} +1 -1
  52. package/dist/{types-BHh0YLmq.d.ts → types-Byo_Rty4.d.ts} +705 -69
  53. package/dist/{types-BZKxss8Y.d.cts → types-DDhtZI6E.d.cts} +705 -69
  54. package/dist/ui/canvas/server.cjs +231 -38
  55. package/dist/ui/canvas/server.cjs.map +1 -1
  56. package/dist/ui/canvas/server.d.cts +1 -1
  57. package/dist/ui/canvas/server.d.ts +1 -1
  58. package/dist/ui/canvas/server.js +221 -38
  59. package/dist/ui/canvas/server.js.map +1 -1
  60. package/dist/ui/canvas.cjs +320 -257
  61. package/dist/ui/canvas.cjs.map +1 -1
  62. package/dist/ui/canvas.d.cts +5 -19
  63. package/dist/ui/canvas.d.ts +5 -19
  64. package/dist/ui/canvas.js +323 -260
  65. package/dist/ui/canvas.js.map +1 -1
  66. package/dist/ui/form.d.cts +1 -1
  67. package/dist/ui/form.d.ts +1 -1
  68. package/dist/ui/video.d.cts +1 -1
  69. package/dist/ui/video.d.ts +1 -1
  70. package/dist/webhook.cjs +2 -1
  71. package/dist/webhook.cjs.map +1 -1
  72. package/dist/webhook.d.cts +20 -179
  73. package/dist/webhook.d.ts +20 -179
  74. package/dist/webhook.js +2 -1
  75. package/dist/webhook.js.map +1 -1
  76. package/package.json +12 -3
@@ -1,7 +1,7 @@
1
- import { D as DebugConfig, R as RetryConfig, A as ApiQueryOptions, P as PayloadFindResponse, g as PayloadMutationResponse } from './types-BZKxss8Y.cjs';
1
+ import { D as DebugConfig, R as RetryConfig, A as ApiQueryOptions, P as PayloadFindResponse, h as PayloadMutationResponse } from './types-DDhtZI6E.cjs';
2
2
  import { GenerateMetadataOptions, Metadata } from './metadata.cjs';
3
- import { c as ServerCollection, P as PublicCollection } from './const-sPR2IkCe.cjs';
4
- import { C as CollectionType } from './types-B3YT092I.cjs';
3
+ import { S as ServerCollection, P as PublicCollection } from './const-BTvdrXtY.cjs';
4
+ import { C as CollectionType } from './types-Bx558PU6.cjs';
5
5
 
6
6
  interface FetchOptions extends RequestInit {
7
7
  apiUrl?: string;
@@ -150,6 +150,10 @@ declare class CollectionClient<TCollection extends string = PublicCollection> ex
150
150
  * POST /api/...custom-endpoint
151
151
  */
152
152
  requestFindEndpoint<T = unknown>(endpoint: string, data?: unknown): Promise<PayloadFindResponse<T>>;
153
+ /**
154
+ * Find-like response from a cacheable GET custom endpoint.
155
+ */
156
+ requestFindEndpointGet<T = unknown>(endpoint: string): Promise<PayloadFindResponse<T>>;
153
157
  /**
154
158
  * Find document by ID
155
159
  * GET /api/{collection}/{id}
@@ -1,7 +1,7 @@
1
- import { D as DebugConfig, R as RetryConfig, A as ApiQueryOptions, P as PayloadFindResponse, g as PayloadMutationResponse } from './types-BHh0YLmq.js';
1
+ import { D as DebugConfig, R as RetryConfig, A as ApiQueryOptions, P as PayloadFindResponse, h as PayloadMutationResponse } from './types-Byo_Rty4.js';
2
2
  import { GenerateMetadataOptions, Metadata } from './metadata.js';
3
- import { c as ServerCollection, P as PublicCollection } from './const-DwmSDeWq.js';
4
- import { C as CollectionType } from './types-Cel_4L9t.js';
3
+ import { S as ServerCollection, P as PublicCollection } from './const-CdqCauHQ.js';
4
+ import { C as CollectionType } from './types-1ylMrCuW.js';
5
5
 
6
6
  interface FetchOptions extends RequestInit {
7
7
  apiUrl?: string;
@@ -150,6 +150,10 @@ declare class CollectionClient<TCollection extends string = PublicCollection> ex
150
150
  * POST /api/...custom-endpoint
151
151
  */
152
152
  requestFindEndpoint<T = unknown>(endpoint: string, data?: unknown): Promise<PayloadFindResponse<T>>;
153
+ /**
154
+ * Find-like response from a cacheable GET custom endpoint.
155
+ */
156
+ requestFindEndpointGet<T = unknown>(endpoint: string): Promise<PayloadFindResponse<T>>;
153
157
  /**
154
158
  * Find document by ID
155
159
  * GET /api/{collection}/{id}
@@ -1,4 +1,4 @@
1
- import { e as Config } from './payload-types-dkeQyrDC.cjs';
1
+ import { e as Config } from './payload-types-C7tb7Xbs.cjs';
2
2
 
3
3
  /**
4
4
  * Collection type derived from Payload Config.
@@ -14,7 +14,7 @@ declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-lo
14
14
  * Array of all public collection names for runtime use (e.g., Zod enum validation).
15
15
  * This is the single source of truth for which collections are publicly accessible via SDK.
16
16
  */
17
- declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags"];
17
+ declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "post-tags", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags"];
18
18
  /**
19
19
  * Server-auth collection names for runtime use. These collections are safe for
20
20
  * secret-key/PAT SDK and MCP server tools, but must not appear in browser or
@@ -26,7 +26,7 @@ declare const SERVER_ONLY_COLLECTIONS: readonly ["customer-groups", "reports", "
26
26
  * Derived from the COLLECTIONS array (single source of truth).
27
27
  */
28
28
  type PublicCollection = (typeof COLLECTIONS)[number];
29
- declare const SERVER_COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags", "customer-groups", "reports", "community-bans"];
29
+ declare const SERVER_COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "post-tags", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags", "customer-groups", "reports", "community-bans"];
30
30
  type ServerCollection = (typeof SERVER_COLLECTIONS)[number];
31
31
 
32
- export { type Collection as C, INTERNAL_COLLECTIONS as I, type PublicCollection as P, SERVER_COLLECTIONS as S, COLLECTIONS as a, SERVER_ONLY_COLLECTIONS as b, type ServerCollection as c };
32
+ export { type Collection as C, INTERNAL_COLLECTIONS as I, type PublicCollection as P, type ServerCollection as S, COLLECTIONS as a, SERVER_COLLECTIONS as b, SERVER_ONLY_COLLECTIONS as c };
@@ -1,4 +1,4 @@
1
- import { e as Config } from './payload-types-dkeQyrDC.js';
1
+ import { e as Config } from './payload-types-C7tb7Xbs.js';
2
2
 
3
3
  /**
4
4
  * Collection type derived from Payload Config.
@@ -14,7 +14,7 @@ declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-lo
14
14
  * Array of all public collection names for runtime use (e.g., Zod enum validation).
15
15
  * This is the single source of truth for which collections are publicly accessible via SDK.
16
16
  */
17
- declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags"];
17
+ declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "post-tags", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags"];
18
18
  /**
19
19
  * Server-auth collection names for runtime use. These collections are safe for
20
20
  * secret-key/PAT SDK and MCP server tools, but must not appear in browser or
@@ -26,7 +26,7 @@ declare const SERVER_ONLY_COLLECTIONS: readonly ["customer-groups", "reports", "
26
26
  * Derived from the COLLECTIONS array (single source of truth).
27
27
  */
28
28
  type PublicCollection = (typeof COLLECTIONS)[number];
29
- declare const SERVER_COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags", "customer-groups", "reports", "community-bans"];
29
+ declare const SERVER_COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "post-tags", "customer-profile-lists", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags", "customer-groups", "reports", "community-bans"];
30
30
  type ServerCollection = (typeof SERVER_COLLECTIONS)[number];
31
31
 
32
- export { type Collection as C, INTERNAL_COLLECTIONS as I, type PublicCollection as P, SERVER_COLLECTIONS as S, COLLECTIONS as a, SERVER_ONLY_COLLECTIONS as b, type ServerCollection as c };
32
+ export { type Collection as C, INTERNAL_COLLECTIONS as I, type PublicCollection as P, type ServerCollection as S, COLLECTIONS as a, SERVER_COLLECTIONS as b, SERVER_ONLY_COLLECTIONS as c };
@@ -0,0 +1,300 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/errors.ts
21
+ var errors_exports = {};
22
+ __export(errors_exports, {
23
+ ApiError: () => ApiError,
24
+ AuthError: () => AuthError,
25
+ ConfigError: () => ConfigError,
26
+ ConflictError: () => ConflictError,
27
+ GoneError: () => GoneError,
28
+ NetworkError: () => NetworkError,
29
+ NotFoundError: () => NotFoundError,
30
+ PermissionError: () => PermissionError,
31
+ RateLimitError: () => RateLimitError,
32
+ SDKError: () => SDKError,
33
+ ServiceUnavailableError: () => ServiceUnavailableError,
34
+ TimeoutError: () => TimeoutError,
35
+ UsageLimitError: () => UsageLimitError,
36
+ ValidationError: () => ValidationError,
37
+ createApiError: () => createApiError,
38
+ createAuthError: () => createAuthError,
39
+ createConfigError: () => createConfigError,
40
+ createConflictError: () => createConflictError,
41
+ createGoneError: () => createGoneError,
42
+ createNetworkError: () => createNetworkError,
43
+ createNotFoundError: () => createNotFoundError,
44
+ createPermissionError: () => createPermissionError,
45
+ createRateLimitError: () => createRateLimitError,
46
+ createServiceUnavailableError: () => createServiceUnavailableError,
47
+ createTimeoutError: () => createTimeoutError,
48
+ createUsageLimitError: () => createUsageLimitError,
49
+ createValidationError: () => createValidationError,
50
+ isApiError: () => isApiError,
51
+ isAuthError: () => isAuthError,
52
+ isConfigError: () => isConfigError,
53
+ isConflictError: () => isConflictError,
54
+ isGoneError: () => isGoneError,
55
+ isNetworkError: () => isNetworkError,
56
+ isNotFoundError: () => isNotFoundError,
57
+ isPermissionError: () => isPermissionError,
58
+ isRateLimitError: () => isRateLimitError,
59
+ isSDKError: () => isSDKError,
60
+ isServiceUnavailableError: () => isServiceUnavailableError,
61
+ isTimeoutError: () => isTimeoutError,
62
+ isUsageLimitError: () => isUsageLimitError,
63
+ isValidationError: () => isValidationError
64
+ });
65
+ module.exports = __toCommonJS(errors_exports);
66
+
67
+ // src/core/errors.ts
68
+ var SDKError = class extends Error {
69
+ constructor(code, message, status, details, userMessage, suggestion, requestId) {
70
+ super(message);
71
+ this.name = "SDKError";
72
+ this.code = code;
73
+ this.status = status;
74
+ this.details = details;
75
+ this.userMessage = userMessage;
76
+ this.suggestion = suggestion;
77
+ this.requestId = requestId;
78
+ if (Error.captureStackTrace) {
79
+ Error.captureStackTrace(this, new.target);
80
+ }
81
+ }
82
+ getUserMessage() {
83
+ return this.userMessage || this.message;
84
+ }
85
+ toJSON() {
86
+ return {
87
+ name: this.name,
88
+ code: this.code,
89
+ message: this.message,
90
+ status: this.status,
91
+ details: this.details,
92
+ userMessage: this.userMessage,
93
+ suggestion: this.suggestion,
94
+ ...this.requestId !== void 0 && { requestId: this.requestId }
95
+ };
96
+ }
97
+ };
98
+ var NetworkError = class extends SDKError {
99
+ constructor(message, status, details, userMessage, suggestion) {
100
+ super("NETWORK_ERROR", message, status, details, userMessage, suggestion);
101
+ this.name = "NetworkError";
102
+ }
103
+ };
104
+ var ValidationError = class extends SDKError {
105
+ constructor(message, details, userMessage, suggestion, status = 400) {
106
+ super("VALIDATION_ERROR", message, status, details, userMessage, suggestion);
107
+ this.name = "ValidationError";
108
+ }
109
+ };
110
+ var ApiError = class extends SDKError {
111
+ constructor(message, status, details, userMessage, suggestion, requestId) {
112
+ super(
113
+ "API_ERROR",
114
+ message,
115
+ status,
116
+ details,
117
+ userMessage,
118
+ suggestion,
119
+ requestId
120
+ );
121
+ this.name = "ApiError";
122
+ }
123
+ };
124
+ var ConfigError = class extends SDKError {
125
+ constructor(message, details, userMessage, suggestion) {
126
+ super("CONFIG_ERROR", message, void 0, details, userMessage, suggestion);
127
+ this.name = "ConfigError";
128
+ }
129
+ };
130
+ var TimeoutError = class extends SDKError {
131
+ constructor(message = "Request timed out.", details, userMessage, suggestion) {
132
+ super("TIMEOUT_ERROR", message, 408, details, userMessage, suggestion);
133
+ this.name = "TimeoutError";
134
+ }
135
+ };
136
+ var GoneError = class extends SDKError {
137
+ constructor(message = "The requested resource is no longer available.", details, userMessage, suggestion) {
138
+ super("GONE_ERROR", message, 410, details, userMessage, suggestion);
139
+ this.name = "GoneError";
140
+ }
141
+ };
142
+ var ServiceUnavailableError = class extends SDKError {
143
+ constructor(message = "Service temporarily unavailable.", retryAfter, details, userMessage, suggestion) {
144
+ super(
145
+ "SERVICE_UNAVAILABLE_ERROR",
146
+ message,
147
+ 503,
148
+ details,
149
+ userMessage,
150
+ suggestion
151
+ );
152
+ this.name = "ServiceUnavailableError";
153
+ this.retryAfter = retryAfter;
154
+ }
155
+ };
156
+ var UsageLimitError = class extends SDKError {
157
+ constructor(message, usage, details, userMessage, suggestion) {
158
+ super("USAGE_LIMIT_ERROR", message, 429, details, userMessage, suggestion);
159
+ this.name = "UsageLimitError";
160
+ this.usage = usage;
161
+ }
162
+ toJSON() {
163
+ return {
164
+ ...super.toJSON(),
165
+ usage: this.usage
166
+ };
167
+ }
168
+ };
169
+ var AuthError = class extends SDKError {
170
+ constructor(message, details, userMessage, suggestion, requestId) {
171
+ super(
172
+ "auth_error",
173
+ message,
174
+ 401,
175
+ details,
176
+ userMessage,
177
+ suggestion,
178
+ requestId
179
+ );
180
+ this.name = "AuthError";
181
+ }
182
+ };
183
+ var PermissionError = class extends SDKError {
184
+ constructor(message, details, userMessage, suggestion, requestId) {
185
+ super(
186
+ "permission_error",
187
+ message,
188
+ 403,
189
+ details,
190
+ userMessage,
191
+ suggestion,
192
+ requestId
193
+ );
194
+ this.name = "PermissionError";
195
+ }
196
+ };
197
+ var NotFoundError = class extends SDKError {
198
+ constructor(message, details, userMessage, suggestion, requestId) {
199
+ super(
200
+ "not_found",
201
+ message,
202
+ 404,
203
+ details,
204
+ userMessage,
205
+ suggestion,
206
+ requestId
207
+ );
208
+ this.name = "NotFoundError";
209
+ }
210
+ };
211
+ var ConflictError = class extends SDKError {
212
+ constructor(message, details, userMessage, suggestion, requestId) {
213
+ super("conflict", message, 409, details, userMessage, suggestion, requestId);
214
+ this.name = "ConflictError";
215
+ }
216
+ };
217
+ var RateLimitError = class extends SDKError {
218
+ constructor(message, retryAfter, details, userMessage, suggestion, requestId) {
219
+ super(
220
+ "rate_limit_exceeded",
221
+ message,
222
+ 429,
223
+ details,
224
+ userMessage,
225
+ suggestion,
226
+ requestId
227
+ );
228
+ this.name = "RateLimitError";
229
+ this.retryAfter = retryAfter;
230
+ }
231
+ };
232
+ function isSDKError(error) {
233
+ return error instanceof SDKError;
234
+ }
235
+ function isNetworkError(error) {
236
+ return error instanceof NetworkError;
237
+ }
238
+ function isValidationError(error) {
239
+ return error instanceof ValidationError;
240
+ }
241
+ function isApiError(error) {
242
+ return error instanceof ApiError;
243
+ }
244
+ function isConfigError(error) {
245
+ return error instanceof ConfigError;
246
+ }
247
+ function isTimeoutError(error) {
248
+ return error instanceof TimeoutError;
249
+ }
250
+ function isGoneError(error) {
251
+ return error instanceof GoneError;
252
+ }
253
+ function isServiceUnavailableError(error) {
254
+ return error instanceof ServiceUnavailableError;
255
+ }
256
+ function isUsageLimitError(error) {
257
+ return error instanceof UsageLimitError;
258
+ }
259
+ function isAuthError(error) {
260
+ return error instanceof AuthError;
261
+ }
262
+ function isPermissionError(error) {
263
+ return error instanceof PermissionError;
264
+ }
265
+ function isNotFoundError(error) {
266
+ return error instanceof NotFoundError;
267
+ }
268
+ function isConflictError(error) {
269
+ return error instanceof ConflictError;
270
+ }
271
+ function isRateLimitError(error) {
272
+ return error instanceof RateLimitError;
273
+ }
274
+ var createNetworkError = (message, status, details, userMessage, suggestion) => new NetworkError(message, status, details, userMessage, suggestion);
275
+ var createValidationError = (message, details, userMessage, suggestion, status) => new ValidationError(message, details, userMessage, suggestion, status);
276
+ var createApiError = (message, status, details, userMessage, suggestion, requestId) => new ApiError(message, status, details, userMessage, suggestion, requestId);
277
+ var createConfigError = (message, details, userMessage, suggestion) => new ConfigError(message, details, userMessage, suggestion);
278
+ var createTimeoutError = (message, details, userMessage, suggestion) => new TimeoutError(message, details, userMessage, suggestion);
279
+ var createGoneError = (message, details, userMessage, suggestion) => new GoneError(message, details, userMessage, suggestion);
280
+ var createServiceUnavailableError = (message, retryAfter, details, userMessage, suggestion) => new ServiceUnavailableError(
281
+ message,
282
+ retryAfter,
283
+ details,
284
+ userMessage,
285
+ suggestion
286
+ );
287
+ var createUsageLimitError = (message, usage, details, userMessage, suggestion) => new UsageLimitError(message, usage, details, userMessage, suggestion);
288
+ var createAuthError = (message, details, userMessage, suggestion, requestId) => new AuthError(message, details, userMessage, suggestion, requestId);
289
+ var createPermissionError = (message, details, userMessage, suggestion, requestId) => new PermissionError(message, details, userMessage, suggestion, requestId);
290
+ var createNotFoundError = (message, details, userMessage, suggestion, requestId) => new NotFoundError(message, details, userMessage, suggestion, requestId);
291
+ var createConflictError = (message, details, userMessage, suggestion, requestId) => new ConflictError(message, details, userMessage, suggestion, requestId);
292
+ var createRateLimitError = (message, retryAfter, details, userMessage, suggestion, requestId) => new RateLimitError(
293
+ message,
294
+ retryAfter,
295
+ details,
296
+ userMessage,
297
+ suggestion,
298
+ requestId
299
+ );
300
+ //# sourceMappingURL=errors.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/errors.ts","../src/core/errors.ts"],"sourcesContent":["export {\n SDKError,\n NetworkError,\n ValidationError,\n ApiError,\n ConfigError,\n TimeoutError,\n GoneError,\n ServiceUnavailableError,\n UsageLimitError,\n AuthError,\n PermissionError,\n NotFoundError,\n ConflictError,\n RateLimitError,\n isSDKError,\n isNetworkError,\n isValidationError,\n isApiError,\n isConfigError,\n isTimeoutError,\n isGoneError,\n isServiceUnavailableError,\n isUsageLimitError,\n isAuthError,\n isPermissionError,\n isNotFoundError,\n isConflictError,\n isRateLimitError,\n createNetworkError,\n createValidationError,\n createApiError,\n createConfigError,\n createTimeoutError,\n createGoneError,\n createServiceUnavailableError,\n createUsageLimitError,\n createAuthError,\n createPermissionError,\n createNotFoundError,\n createConflictError,\n createRateLimitError,\n} from './core/errors'\n","export class SDKError extends Error {\n readonly code: string\n readonly status?: number\n readonly details?: unknown\n readonly userMessage?: string\n readonly suggestion?: string\n readonly requestId?: string\n\n constructor(\n code: string,\n message: string,\n status?: number,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n requestId?: string,\n ) {\n super(message)\n this.name = 'SDKError'\n this.code = code\n this.status = status\n this.details = details\n this.userMessage = userMessage\n this.suggestion = suggestion\n this.requestId = requestId\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, new.target)\n }\n }\n\n getUserMessage(): string {\n return this.userMessage || this.message\n }\n\n toJSON() {\n return {\n name: this.name,\n code: this.code,\n message: this.message,\n status: this.status,\n details: this.details,\n userMessage: this.userMessage,\n suggestion: this.suggestion,\n ...(this.requestId !== undefined && { requestId: this.requestId }),\n }\n }\n}\n\nexport class NetworkError extends SDKError {\n constructor(\n message: string,\n status?: number,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n ) {\n super('NETWORK_ERROR', message, status, details, userMessage, suggestion)\n this.name = 'NetworkError'\n }\n}\n\nexport class ValidationError extends SDKError {\n constructor(\n message: string,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n status = 400,\n ) {\n super('VALIDATION_ERROR', message, status, details, userMessage, suggestion)\n this.name = 'ValidationError'\n }\n}\n\nexport class ApiError extends SDKError {\n constructor(\n message: string,\n status: number,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n requestId?: string,\n ) {\n super(\n 'API_ERROR',\n message,\n status,\n details,\n userMessage,\n suggestion,\n requestId,\n )\n this.name = 'ApiError'\n }\n}\n\nexport class ConfigError extends SDKError {\n constructor(\n message: string,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n ) {\n super('CONFIG_ERROR', message, undefined, details, userMessage, suggestion)\n this.name = 'ConfigError'\n }\n}\n\nexport class TimeoutError extends SDKError {\n constructor(\n message = 'Request timed out.',\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n ) {\n super('TIMEOUT_ERROR', message, 408, details, userMessage, suggestion)\n this.name = 'TimeoutError'\n }\n}\n\nexport class GoneError extends SDKError {\n constructor(\n message = 'The requested resource is no longer available.',\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n ) {\n super('GONE_ERROR', message, 410, details, userMessage, suggestion)\n this.name = 'GoneError'\n }\n}\n\nexport class ServiceUnavailableError extends SDKError {\n readonly retryAfter?: number\n\n constructor(\n message = 'Service temporarily unavailable.',\n retryAfter?: number,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n ) {\n super(\n 'SERVICE_UNAVAILABLE_ERROR',\n message,\n 503,\n details,\n userMessage,\n suggestion,\n )\n this.name = 'ServiceUnavailableError'\n this.retryAfter = retryAfter\n }\n}\n\nexport class UsageLimitError extends SDKError {\n readonly usage: { limit: number; current: number; remaining: number }\n\n constructor(\n message: string,\n usage: { limit: number; current: number; remaining: number },\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n ) {\n super('USAGE_LIMIT_ERROR', message, 429, details, userMessage, suggestion)\n this.name = 'UsageLimitError'\n this.usage = usage\n }\n\n toJSON() {\n return {\n ...super.toJSON(),\n usage: this.usage,\n }\n }\n}\n\nexport class AuthError extends SDKError {\n constructor(\n message: string,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n requestId?: string,\n ) {\n super(\n 'auth_error',\n message,\n 401,\n details,\n userMessage,\n suggestion,\n requestId,\n )\n this.name = 'AuthError'\n }\n}\n\nexport class PermissionError extends SDKError {\n constructor(\n message: string,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n requestId?: string,\n ) {\n super(\n 'permission_error',\n message,\n 403,\n details,\n userMessage,\n suggestion,\n requestId,\n )\n this.name = 'PermissionError'\n }\n}\n\nexport class NotFoundError extends SDKError {\n constructor(\n message: string,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n requestId?: string,\n ) {\n super(\n 'not_found',\n message,\n 404,\n details,\n userMessage,\n suggestion,\n requestId,\n )\n this.name = 'NotFoundError'\n }\n}\n\nexport class ConflictError extends SDKError {\n constructor(\n message: string,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n requestId?: string,\n ) {\n super('conflict', message, 409, details, userMessage, suggestion, requestId)\n this.name = 'ConflictError'\n }\n}\n\nexport class RateLimitError extends SDKError {\n readonly retryAfter?: number\n\n constructor(\n message: string,\n retryAfter?: number,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n requestId?: string,\n ) {\n super(\n 'rate_limit_exceeded',\n message,\n 429,\n details,\n userMessage,\n suggestion,\n requestId,\n )\n this.name = 'RateLimitError'\n this.retryAfter = retryAfter\n }\n}\n\nexport function isSDKError(error: unknown): error is SDKError {\n return error instanceof SDKError\n}\n\nexport function isNetworkError(error: unknown): error is NetworkError {\n return error instanceof NetworkError\n}\n\nexport function isValidationError(error: unknown): error is ValidationError {\n return error instanceof ValidationError\n}\n\nexport function isApiError(error: unknown): error is ApiError {\n return error instanceof ApiError\n}\n\nexport function isConfigError(error: unknown): error is ConfigError {\n return error instanceof ConfigError\n}\n\nexport function isTimeoutError(error: unknown): error is TimeoutError {\n return error instanceof TimeoutError\n}\n\nexport function isGoneError(error: unknown): error is GoneError {\n return error instanceof GoneError\n}\n\nexport function isServiceUnavailableError(\n error: unknown,\n): error is ServiceUnavailableError {\n return error instanceof ServiceUnavailableError\n}\n\nexport function isUsageLimitError(error: unknown): error is UsageLimitError {\n return error instanceof UsageLimitError\n}\n\nexport function isAuthError(error: unknown): error is AuthError {\n return error instanceof AuthError\n}\n\nexport function isPermissionError(error: unknown): error is PermissionError {\n return error instanceof PermissionError\n}\n\nexport function isNotFoundError(error: unknown): error is NotFoundError {\n return error instanceof NotFoundError\n}\n\nexport function isConflictError(error: unknown): error is ConflictError {\n return error instanceof ConflictError\n}\n\nexport function isRateLimitError(error: unknown): error is RateLimitError {\n return error instanceof RateLimitError\n}\n\nexport const createNetworkError = (\n message: string,\n status?: number,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n) => new NetworkError(message, status, details, userMessage, suggestion)\n\nexport const createValidationError = (\n message: string,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n status?: number,\n) => new ValidationError(message, details, userMessage, suggestion, status)\n\nexport const createApiError = (\n message: string,\n status: number,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n requestId?: string,\n) => new ApiError(message, status, details, userMessage, suggestion, requestId)\n\nexport const createConfigError = (\n message: string,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n) => new ConfigError(message, details, userMessage, suggestion)\n\nexport const createTimeoutError = (\n message?: string,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n) => new TimeoutError(message, details, userMessage, suggestion)\n\nexport const createGoneError = (\n message?: string,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n) => new GoneError(message, details, userMessage, suggestion)\n\nexport const createServiceUnavailableError = (\n message?: string,\n retryAfter?: number,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n) =>\n new ServiceUnavailableError(\n message,\n retryAfter,\n details,\n userMessage,\n suggestion,\n )\n\nexport const createUsageLimitError = (\n message: string,\n usage: { limit: number; current: number; remaining: number },\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n) => new UsageLimitError(message, usage, details, userMessage, suggestion)\n\nexport const createAuthError = (\n message: string,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n requestId?: string,\n) => new AuthError(message, details, userMessage, suggestion, requestId)\n\nexport const createPermissionError = (\n message: string,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n requestId?: string,\n) => new PermissionError(message, details, userMessage, suggestion, requestId)\n\nexport const createNotFoundError = (\n message: string,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n requestId?: string,\n) => new NotFoundError(message, details, userMessage, suggestion, requestId)\n\nexport const createConflictError = (\n message: string,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n requestId?: string,\n) => new ConflictError(message, details, userMessage, suggestion, requestId)\n\nexport const createRateLimitError = (\n message: string,\n retryAfter?: number,\n details?: unknown,\n userMessage?: string,\n suggestion?: string,\n requestId?: string,\n) =>\n new RateLimitError(\n message,\n retryAfter,\n details,\n userMessage,\n suggestion,\n requestId,\n )\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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YAAY,SAAS;AAEpE,IAAM,sBAAsB,CACjC,SACA,SACA,aACA,YACA,cACG,IAAI,cAAc,SAAS,SAAS,aAAa,YAAY,SAAS;AAEpE,IAAM,uBAAuB,CAClC,SACA,YACA,SACA,aACA,YACA,cAEA,IAAI;AAAA,EACF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
@@ -97,10 +97,22 @@ declare function isPermissionError(error: unknown): error is PermissionError;
97
97
  declare function isNotFoundError(error: unknown): error is NotFoundError;
98
98
  declare function isConflictError(error: unknown): error is ConflictError;
99
99
  declare function isRateLimitError(error: unknown): error is RateLimitError;
100
+ declare const createNetworkError: (message: string, status?: number, details?: unknown, userMessage?: string, suggestion?: string) => NetworkError;
101
+ declare const createValidationError: (message: string, details?: unknown, userMessage?: string, suggestion?: string, status?: number) => ValidationError;
102
+ declare const createApiError: (message: string, status: number, details?: unknown, userMessage?: string, suggestion?: string, requestId?: string) => ApiError;
103
+ declare const createConfigError: (message: string, details?: unknown, userMessage?: string, suggestion?: string) => ConfigError;
104
+ declare const createTimeoutError: (message?: string, details?: unknown, userMessage?: string, suggestion?: string) => TimeoutError;
105
+ declare const createGoneError: (message?: string, details?: unknown, userMessage?: string, suggestion?: string) => GoneError;
106
+ declare const createServiceUnavailableError: (message?: string, retryAfter?: number, details?: unknown, userMessage?: string, suggestion?: string) => ServiceUnavailableError;
107
+ declare const createUsageLimitError: (message: string, usage: {
108
+ limit: number;
109
+ current: number;
110
+ remaining: number;
111
+ }, details?: unknown, userMessage?: string, suggestion?: string) => UsageLimitError;
100
112
  declare const createAuthError: (message: string, details?: unknown, userMessage?: string, suggestion?: string, requestId?: string) => AuthError;
101
113
  declare const createPermissionError: (message: string, details?: unknown, userMessage?: string, suggestion?: string, requestId?: string) => PermissionError;
102
114
  declare const createNotFoundError: (message: string, details?: unknown, userMessage?: string, suggestion?: string, requestId?: string) => NotFoundError;
103
115
  declare const createConflictError: (message: string, details?: unknown, userMessage?: string, suggestion?: string, requestId?: string) => ConflictError;
104
116
  declare const createRateLimitError: (message: string, retryAfter?: number, details?: unknown, userMessage?: string, suggestion?: string, requestId?: string) => RateLimitError;
105
117
 
106
- export { ApiError as A, ConfigError as C, GoneError as G, NetworkError as N, PermissionError as P, RateLimitError as R, SDKError as S, TimeoutError as T, UsageLimitError as U, ValidationError as V, AuthError as a, ConflictError as b, NotFoundError as c, ServiceUnavailableError as d, createAuthError as e, createConflictError as f, createNotFoundError as g, createPermissionError as h, createRateLimitError as i, isApiError as j, isAuthError as k, isConfigError as l, isConflictError as m, isGoneError as n, isNetworkError as o, isNotFoundError as p, isPermissionError as q, isRateLimitError as r, isSDKError as s, isServiceUnavailableError as t, isTimeoutError as u, isUsageLimitError as v, isValidationError as w };
118
+ export { ApiError, AuthError, ConfigError, ConflictError, GoneError, NetworkError, NotFoundError, PermissionError, RateLimitError, SDKError, ServiceUnavailableError, TimeoutError, UsageLimitError, ValidationError, createApiError, createAuthError, createConfigError, createConflictError, createGoneError, createNetworkError, createNotFoundError, createPermissionError, createRateLimitError, createServiceUnavailableError, createTimeoutError, createUsageLimitError, createValidationError, isApiError, isAuthError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError };
@@ -97,10 +97,22 @@ declare function isPermissionError(error: unknown): error is PermissionError;
97
97
  declare function isNotFoundError(error: unknown): error is NotFoundError;
98
98
  declare function isConflictError(error: unknown): error is ConflictError;
99
99
  declare function isRateLimitError(error: unknown): error is RateLimitError;
100
+ declare const createNetworkError: (message: string, status?: number, details?: unknown, userMessage?: string, suggestion?: string) => NetworkError;
101
+ declare const createValidationError: (message: string, details?: unknown, userMessage?: string, suggestion?: string, status?: number) => ValidationError;
102
+ declare const createApiError: (message: string, status: number, details?: unknown, userMessage?: string, suggestion?: string, requestId?: string) => ApiError;
103
+ declare const createConfigError: (message: string, details?: unknown, userMessage?: string, suggestion?: string) => ConfigError;
104
+ declare const createTimeoutError: (message?: string, details?: unknown, userMessage?: string, suggestion?: string) => TimeoutError;
105
+ declare const createGoneError: (message?: string, details?: unknown, userMessage?: string, suggestion?: string) => GoneError;
106
+ declare const createServiceUnavailableError: (message?: string, retryAfter?: number, details?: unknown, userMessage?: string, suggestion?: string) => ServiceUnavailableError;
107
+ declare const createUsageLimitError: (message: string, usage: {
108
+ limit: number;
109
+ current: number;
110
+ remaining: number;
111
+ }, details?: unknown, userMessage?: string, suggestion?: string) => UsageLimitError;
100
112
  declare const createAuthError: (message: string, details?: unknown, userMessage?: string, suggestion?: string, requestId?: string) => AuthError;
101
113
  declare const createPermissionError: (message: string, details?: unknown, userMessage?: string, suggestion?: string, requestId?: string) => PermissionError;
102
114
  declare const createNotFoundError: (message: string, details?: unknown, userMessage?: string, suggestion?: string, requestId?: string) => NotFoundError;
103
115
  declare const createConflictError: (message: string, details?: unknown, userMessage?: string, suggestion?: string, requestId?: string) => ConflictError;
104
116
  declare const createRateLimitError: (message: string, retryAfter?: number, details?: unknown, userMessage?: string, suggestion?: string, requestId?: string) => RateLimitError;
105
117
 
106
- export { ApiError as A, ConfigError as C, GoneError as G, NetworkError as N, PermissionError as P, RateLimitError as R, SDKError as S, TimeoutError as T, UsageLimitError as U, ValidationError as V, AuthError as a, ConflictError as b, NotFoundError as c, ServiceUnavailableError as d, createAuthError as e, createConflictError as f, createNotFoundError as g, createPermissionError as h, createRateLimitError as i, isApiError as j, isAuthError as k, isConfigError as l, isConflictError as m, isGoneError as n, isNetworkError as o, isNotFoundError as p, isPermissionError as q, isRateLimitError as r, isSDKError as s, isServiceUnavailableError as t, isTimeoutError as u, isUsageLimitError as v, isValidationError as w };
118
+ export { ApiError, AuthError, ConfigError, ConflictError, GoneError, NetworkError, NotFoundError, PermissionError, RateLimitError, SDKError, ServiceUnavailableError, TimeoutError, UsageLimitError, ValidationError, createApiError, createAuthError, createConfigError, createConflictError, createGoneError, createNetworkError, createNotFoundError, createPermissionError, createRateLimitError, createServiceUnavailableError, createTimeoutError, createUsageLimitError, createValidationError, isApiError, isAuthError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError };