@orth/sdk 0.6.0 → 0.7.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Added
6
+
7
+ - `searchId` on `run()`: the `searchId` of the search that led to the call,
8
+ so Orthogonal can link the two. Optional; the server ignores a bad one.
9
+
3
10
  ## 0.6.0
4
11
 
5
12
  The SDK is now built and published from Orthogonal's monorepo.
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /** Kept equal to package.json by tests/requests.test.ts. */
2
- export const VERSION = "0.6.0";
2
+ export const VERSION = "0.7.0";
3
3
  const DEFAULT_BASE_URL = "https://www.orthogonal.com";
4
4
  /** The host to call: the option, else ORTH_API_URL where a process exists. */
5
5
  function resolveBaseUrl(baseUrl) {
@@ -100,7 +100,7 @@ export class Orthogonal {
100
100
  * Call any API on the Orthogonal platform
101
101
  */
102
102
  async run(options) {
103
- const { api, path, method, query, body, idempotencyKey } = options;
103
+ const { api, path, method, query, body, idempotencyKey, searchId } = options;
104
104
  const response = await fetch(`${this.baseUrl}/v1/run`, {
105
105
  method: "POST",
106
106
  headers: {
@@ -111,7 +111,7 @@ export class Orthogonal {
111
111
  ...(idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {}),
112
112
  ...this.customHeaders,
113
113
  },
114
- body: JSON.stringify({ api, path, method, query, body }),
114
+ body: JSON.stringify({ api, path, method, query, body, searchId }),
115
115
  });
116
116
  // A proxy or gateway error can answer with HTML: keep its text.
117
117
  const text = await response.text();
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { OrthogonalConfig, RunOptions, RunResponse } from "./types";
2
2
  /** Kept equal to package.json by tests/requests.test.ts. */
3
- export declare const VERSION = "0.6.0";
3
+ export declare const VERSION = "0.7.0";
4
4
  /**
5
5
  * Error thrown by {@link Orthogonal.run} on a non-2xx response.
6
6
  *
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Orthogonal = exports.OrthogonalRunError = exports.VERSION = void 0;
4
4
  /** Kept equal to package.json by tests/requests.test.ts. */
5
- exports.VERSION = "0.6.0";
5
+ exports.VERSION = "0.7.0";
6
6
  const DEFAULT_BASE_URL = "https://www.orthogonal.com";
7
7
  /** The host to call: the option, else ORTH_API_URL where a process exists. */
8
8
  function resolveBaseUrl(baseUrl) {
@@ -104,7 +104,7 @@ class Orthogonal {
104
104
  * Call any API on the Orthogonal platform
105
105
  */
106
106
  async run(options) {
107
- const { api, path, method, query, body, idempotencyKey } = options;
107
+ const { api, path, method, query, body, idempotencyKey, searchId } = options;
108
108
  const response = await fetch(`${this.baseUrl}/v1/run`, {
109
109
  method: "POST",
110
110
  headers: {
@@ -115,7 +115,7 @@ class Orthogonal {
115
115
  ...(idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {}),
116
116
  ...this.customHeaders,
117
117
  },
118
- body: JSON.stringify({ api, path, method, query, body }),
118
+ body: JSON.stringify({ api, path, method, query, body, searchId }),
119
119
  });
120
120
  // A proxy or gateway error can answer with HTML: keep its text.
121
121
  const text = await response.text();
package/dist/types.d.ts CHANGED
@@ -31,6 +31,12 @@ export interface RunOptions {
31
31
  * (sent as the Idempotency-Key header).
32
32
  */
33
33
  idempotencyKey?: string;
34
+ /**
35
+ * The `searchId` of the search (/v1/search, MCP search) that led to this
36
+ * call. Optional: it links the call to that search, and the server ignores
37
+ * a missing or malformed one.
38
+ */
39
+ searchId?: string;
34
40
  }
35
41
  /**
36
42
  * Response from the run() method
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orth/sdk",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "TypeScript SDK to call any API on the Orthogonal platform",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",