@operla-ai/sdk 0.0.7 → 0.0.8

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 (61) hide show
  1. package/package.json +1 -1
  2. package/dist/client.d.ts +0 -33
  3. package/dist/client.d.ts.map +0 -1
  4. package/dist/client.js +0 -48
  5. package/dist/client.js.map +0 -1
  6. package/dist/generated/api-types.d.ts +0 -881
  7. package/dist/generated/api-types.d.ts.map +0 -1
  8. package/dist/generated/api-types.js +0 -7
  9. package/dist/generated/api-types.js.map +0 -1
  10. package/dist/resources/agents.d.ts +0 -26
  11. package/dist/resources/agents.d.ts.map +0 -1
  12. package/dist/resources/agents.js +0 -49
  13. package/dist/resources/agents.js.map +0 -1
  14. package/dist/resources/auth.d.ts +0 -13
  15. package/dist/resources/auth.d.ts.map +0 -1
  16. package/dist/resources/auth.js +0 -16
  17. package/dist/resources/auth.js.map +0 -1
  18. package/dist/resources/chat.d.ts +0 -24
  19. package/dist/resources/chat.d.ts.map +0 -1
  20. package/dist/resources/chat.js +0 -28
  21. package/dist/resources/chat.js.map +0 -1
  22. package/dist/resources/config.d.ts +0 -23
  23. package/dist/resources/config.d.ts.map +0 -1
  24. package/dist/resources/config.js +0 -37
  25. package/dist/resources/config.js.map +0 -1
  26. package/dist/resources/conversations.d.ts +0 -46
  27. package/dist/resources/conversations.d.ts.map +0 -1
  28. package/dist/resources/conversations.js +0 -22
  29. package/dist/resources/conversations.js.map +0 -1
  30. package/dist/resources/entities.d.ts +0 -31
  31. package/dist/resources/entities.d.ts.map +0 -1
  32. package/dist/resources/entities.js +0 -26
  33. package/dist/resources/entities.js.map +0 -1
  34. package/dist/resources/feedback.d.ts +0 -33
  35. package/dist/resources/feedback.d.ts.map +0 -1
  36. package/dist/resources/feedback.js +0 -49
  37. package/dist/resources/feedback.js.map +0 -1
  38. package/dist/resources/kb.d.ts +0 -33
  39. package/dist/resources/kb.d.ts.map +0 -1
  40. package/dist/resources/kb.js +0 -40
  41. package/dist/resources/kb.js.map +0 -1
  42. package/dist/resources/organizations.d.ts +0 -40
  43. package/dist/resources/organizations.d.ts.map +0 -1
  44. package/dist/resources/organizations.js +0 -26
  45. package/dist/resources/organizations.js.map +0 -1
  46. package/dist/resources/scenarios.d.ts +0 -20
  47. package/dist/resources/scenarios.d.ts.map +0 -1
  48. package/dist/resources/scenarios.js +0 -37
  49. package/dist/resources/scenarios.js.map +0 -1
  50. package/dist/resources/stats.d.ts +0 -8
  51. package/dist/resources/stats.d.ts.map +0 -1
  52. package/dist/resources/stats.js +0 -16
  53. package/dist/resources/stats.js.map +0 -1
  54. package/dist/resources/tickets.d.ts +0 -33
  55. package/dist/resources/tickets.d.ts.map +0 -1
  56. package/dist/resources/tickets.js +0 -34
  57. package/dist/resources/tickets.js.map +0 -1
  58. package/dist/resources/users.d.ts +0 -32
  59. package/dist/resources/users.d.ts.map +0 -1
  60. package/dist/resources/users.js +0 -22
  61. package/dist/resources/users.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@operla-ai/sdk",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Operla — TypeScript SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/dist/client.d.ts DELETED
@@ -1,33 +0,0 @@
1
- /**
2
- * Typed HTTP client for the Operla API.
3
- *
4
- * Wraps `openapi-fetch` so every request is validated against the generated
5
- * types from `openapi.json` — same contract the docs describe, no drift.
6
- */
7
- import { type Client } from "openapi-fetch";
8
- import type { paths } from "./generated/api-types";
9
- export interface OperlaClientConfig {
10
- /** Base URL of the Operla API (e.g. https://api.example.com) — without the `/v1` prefix. */
11
- baseUrl: string;
12
- /** JWT token for authentication (alternative to apiKey). */
13
- token?: string;
14
- /** API key for authentication (alternative to JWT). */
15
- apiKey?: string;
16
- }
17
- export declare class OperlaApiError extends Error {
18
- statusCode?: number | undefined;
19
- responseData?: unknown | undefined;
20
- constructor(message: string, statusCode?: number | undefined, responseData?: unknown | undefined);
21
- }
22
- export type OperlaHttpClient = Client<paths>;
23
- export declare function createHttpClient(config: OperlaClientConfig): OperlaHttpClient;
24
- /**
25
- * Unwrap an `openapi-fetch` response: returns `data` on success, throws an
26
- * `OperlaApiError` on non-2xx. Centralizes error shape so resources stay thin.
27
- */
28
- export declare function unwrap<D>(response: {
29
- data?: D;
30
- error?: unknown;
31
- response: Response;
32
- }): D;
33
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAqB,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,WAAW,kBAAkB;IACjC,4FAA4F;IAC5F,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,cAAe,SAAQ,KAAK;IAG9B,UAAU,CAAC,EAAE,MAAM;IACnB,YAAY,CAAC,EAAE,OAAO;gBAF7B,OAAO,EAAE,MAAM,EACR,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,YAAY,CAAC,EAAE,OAAO,YAAA;CAKhC;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAE7C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,GAAG,gBAAgB,CAS7E;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE;IAClC,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;CACpB,GAAG,CAAC,CAUJ"}
package/dist/client.js DELETED
@@ -1,48 +0,0 @@
1
- "use strict";
2
- /**
3
- * Typed HTTP client for the Operla API.
4
- *
5
- * Wraps `openapi-fetch` so every request is validated against the generated
6
- * types from `openapi.json` — same contract the docs describe, no drift.
7
- */
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.OperlaApiError = void 0;
13
- exports.createHttpClient = createHttpClient;
14
- exports.unwrap = unwrap;
15
- const openapi_fetch_1 = __importDefault(require("openapi-fetch"));
16
- class OperlaApiError extends Error {
17
- constructor(message, statusCode, responseData) {
18
- super(message);
19
- this.statusCode = statusCode;
20
- this.responseData = responseData;
21
- this.name = "OperlaApiError";
22
- }
23
- }
24
- exports.OperlaApiError = OperlaApiError;
25
- function createHttpClient(config) {
26
- const headers = {};
27
- if (config.token)
28
- headers.Authorization = `Bearer ${config.token}`;
29
- if (config.apiKey)
30
- headers["X-Api-Key"] = config.apiKey;
31
- return (0, openapi_fetch_1.default)({
32
- baseUrl: `${config.baseUrl.replace(/\/$/, "")}/v1`,
33
- headers,
34
- });
35
- }
36
- /**
37
- * Unwrap an `openapi-fetch` response: returns `data` on success, throws an
38
- * `OperlaApiError` on non-2xx. Centralizes error shape so resources stay thin.
39
- */
40
- function unwrap(response) {
41
- if (response.error !== undefined) {
42
- const body = response.error;
43
- const message = body?.error?.message ?? `Request failed with status ${response.response.status}`;
44
- throw new OperlaApiError(message, response.response.status, body);
45
- }
46
- return response.data;
47
- }
48
- //# sourceMappingURL=client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AA2BH,4CASC;AAMD,wBAcC;AAtDD,kEAA0D;AAY1D,MAAa,cAAe,SAAQ,KAAK;IACvC,YACE,OAAe,EACR,UAAmB,EACnB,YAAsB;QAE7B,KAAK,CAAC,OAAO,CAAC,CA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