phonic 0.30.11 → 0.30.12

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 (28) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/tools/client/Client.d.ts +4 -2
  3. package/dist/cjs/api/resources/tools/client/Client.js +4 -2
  4. package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.d.ts +20 -5
  5. package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.js +4 -0
  6. package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.d.ts +16 -2
  7. package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.js +4 -0
  8. package/dist/cjs/api/types/Tool.d.ts +9 -1
  9. package/dist/cjs/api/types/Tool.js +4 -0
  10. package/dist/cjs/api/types/ToolParameter.d.ts +20 -0
  11. package/dist/cjs/api/types/ToolParameter.js +4 -0
  12. package/dist/cjs/version.d.ts +1 -1
  13. package/dist/cjs/version.js +1 -1
  14. package/dist/esm/Client.mjs +2 -2
  15. package/dist/esm/api/resources/tools/client/Client.d.mts +4 -2
  16. package/dist/esm/api/resources/tools/client/Client.mjs +4 -2
  17. package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.d.mts +20 -5
  18. package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.mjs +4 -0
  19. package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.d.mts +16 -2
  20. package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.mjs +4 -0
  21. package/dist/esm/api/types/Tool.d.mts +9 -1
  22. package/dist/esm/api/types/Tool.mjs +4 -0
  23. package/dist/esm/api/types/ToolParameter.d.mts +20 -0
  24. package/dist/esm/api/types/ToolParameter.mjs +4 -0
  25. package/dist/esm/version.d.mts +1 -1
  26. package/dist/esm/version.mjs +1 -1
  27. package/package.json +1 -1
  28. package/reference.md +2 -0
@@ -50,8 +50,8 @@ class PhonicClient {
50
50
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
51
51
  "X-Fern-Language": "JavaScript",
52
52
  "X-Fern-SDK-Name": "phonic",
53
- "X-Fern-SDK-Version": "0.30.11",
54
- "User-Agent": "phonic/0.30.11",
53
+ "X-Fern-SDK-Version": "0.30.12",
54
+ "User-Agent": "phonic/0.30.12",
55
55
  "X-Fern-Runtime": core.RUNTIME.type,
56
56
  "X-Fern-Runtime-Version": core.RUNTIME.version,
57
57
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -66,12 +66,14 @@ export declare class Tools {
66
66
  * type: "string",
67
67
  * name: "date",
68
68
  * description: "The date for the appointment in YYYY-MM-DD format",
69
- * is_required: true
69
+ * is_required: true,
70
+ * location: "request_body"
70
71
  * }, {
71
72
  * type: "string",
72
73
  * name: "time",
73
74
  * description: "The time for the appointment in HH:MM format",
74
- * is_required: true
75
+ * is_required: true,
76
+ * location: "request_body"
75
77
  * }],
76
78
  * endpoint_method: "POST",
77
79
  * endpoint_url: "https://api.example.com/book-appointment",
@@ -154,12 +154,14 @@ class Tools {
154
154
  * type: "string",
155
155
  * name: "date",
156
156
  * description: "The date for the appointment in YYYY-MM-DD format",
157
- * is_required: true
157
+ * is_required: true,
158
+ * location: "request_body"
158
159
  * }, {
159
160
  * type: "string",
160
161
  * name: "time",
161
162
  * description: "The time for the appointment in HH:MM format",
162
- * is_required: true
163
+ * is_required: true,
164
+ * location: "request_body"
163
165
  * }],
164
166
  * endpoint_method: "POST",
165
167
  * endpoint_url: "https://api.example.com/book-appointment",
@@ -14,12 +14,14 @@ import * as Phonic from "../../../../index.js";
14
14
  * type: "string",
15
15
  * name: "date",
16
16
  * description: "The date for the appointment in YYYY-MM-DD format",
17
- * is_required: true
17
+ * is_required: true,
18
+ * location: "request_body"
18
19
  * }, {
19
20
  * type: "string",
20
21
  * name: "time",
21
22
  * description: "The time for the appointment in HH:MM format",
22
- * is_required: true
23
+ * is_required: true,
24
+ * location: "request_body"
23
25
  * }],
24
26
  * endpoint_method: "POST",
25
27
  * endpoint_url: "https://api.example.com/book-appointment",
@@ -67,10 +69,15 @@ export interface CreateToolRequest {
67
69
  type: CreateToolRequest.Type;
68
70
  /** Mode of operation. */
69
71
  execution_mode: CreateToolRequest.ExecutionMode;
70
- /** Array of parameter definitions. */
72
+ /**
73
+ * Array of parameter definitions.
74
+ * For `custom_webhook` tools with POST method, each parameter must include a `location` field.
75
+ * For `custom_webhook` tools with GET method, `location` defaults to `"query_string"` if not specified.
76
+ * For `custom_websocket` and `built_in_transfer_to_phone_number` tools, `location` must not be specified.
77
+ */
71
78
  parameters?: Phonic.ToolParameter[];
72
- /** Required for webhook tools. */
73
- endpoint_method?: "POST";
79
+ /** Required for webhook tools. HTTP method for the webhook endpoint. */
80
+ endpoint_method?: CreateToolRequest.EndpointMethod;
74
81
  /** Required for webhook tools. */
75
82
  endpoint_url?: string;
76
83
  /** Optional headers for webhook tools. */
@@ -100,4 +107,12 @@ export declare namespace CreateToolRequest {
100
107
  readonly Sync: "sync";
101
108
  readonly Async: "async";
102
109
  };
110
+ /**
111
+ * Required for webhook tools. HTTP method for the webhook endpoint.
112
+ */
113
+ type EndpointMethod = "GET" | "POST";
114
+ const EndpointMethod: {
115
+ readonly Get: "GET";
116
+ readonly Post: "POST";
117
+ };
103
118
  }
@@ -15,4 +15,8 @@ var CreateToolRequest;
15
15
  Sync: "sync",
16
16
  Async: "async",
17
17
  };
18
+ CreateToolRequest.EndpointMethod = {
19
+ Get: "GET",
20
+ Post: "POST",
21
+ };
18
22
  })(CreateToolRequest || (exports.CreateToolRequest = CreateToolRequest = {}));
@@ -24,9 +24,15 @@ export interface UpdateToolRequest {
24
24
  type?: UpdateToolRequest.Type;
25
25
  /** Mode of operation. */
26
26
  execution_mode?: UpdateToolRequest.ExecutionMode;
27
- /** Array of parameter definitions. */
27
+ /**
28
+ * Array of parameter definitions.
29
+ * When updating `type` or `endpoint_method`, all parameters must include explicit `location` values.
30
+ * For `custom_webhook` tools: `location` is required for POST, defaults to `"query_string"` for GET.
31
+ * For `custom_websocket` and `built_in_transfer_to_phone_number` tools: `location` must not be specified.
32
+ */
28
33
  parameters?: Phonic.ToolParameter[];
29
- endpoint_method?: "POST";
34
+ /** HTTP method for webhook tools. When changing this value, all parameters must include explicit `location` values. */
35
+ endpoint_method?: UpdateToolRequest.EndpointMethod;
30
36
  endpoint_url?: string;
31
37
  endpoint_headers?: Record<string, string>;
32
38
  endpoint_timeout_ms?: number;
@@ -52,4 +58,12 @@ export declare namespace UpdateToolRequest {
52
58
  readonly Sync: "sync";
53
59
  readonly Async: "async";
54
60
  };
61
+ /**
62
+ * HTTP method for webhook tools. When changing this value, all parameters must include explicit `location` values.
63
+ */
64
+ type EndpointMethod = "GET" | "POST";
65
+ const EndpointMethod: {
66
+ readonly Get: "GET";
67
+ readonly Post: "POST";
68
+ };
55
69
  }
@@ -15,4 +15,8 @@ var UpdateToolRequest;
15
15
  Sync: "sync",
16
16
  Async: "async",
17
17
  };
18
+ UpdateToolRequest.EndpointMethod = {
19
+ Get: "GET",
20
+ Post: "POST",
21
+ };
18
22
  })(UpdateToolRequest || (exports.UpdateToolRequest = UpdateToolRequest = {}));
@@ -17,7 +17,7 @@ export interface Tool {
17
17
  /** Array of parameter definitions for the tool. */
18
18
  parameters: Phonic.ToolParameter[];
19
19
  /** HTTP method for webhook tools. */
20
- endpoint_method?: "POST";
20
+ endpoint_method?: Tool.EndpointMethod;
21
21
  /** URL for webhook tools. */
22
22
  endpoint_url?: string;
23
23
  /** Headers for webhook tools. */
@@ -51,4 +51,12 @@ export declare namespace Tool {
51
51
  readonly Sync: "sync";
52
52
  readonly Async: "async";
53
53
  };
54
+ /**
55
+ * HTTP method for webhook tools.
56
+ */
57
+ type EndpointMethod = "GET" | "POST";
58
+ const EndpointMethod: {
59
+ readonly Get: "GET";
60
+ readonly Post: "POST";
61
+ };
54
62
  }
@@ -15,4 +15,8 @@ var Tool;
15
15
  Sync: "sync",
16
16
  Async: "async",
17
17
  };
18
+ Tool.EndpointMethod = {
19
+ Get: "GET",
20
+ Post: "POST",
21
+ };
18
22
  })(Tool || (exports.Tool = Tool = {}));
@@ -12,6 +12,14 @@ export interface ToolParameter {
12
12
  description: string;
13
13
  /** Whether the parameter is required. */
14
14
  is_required: boolean;
15
+ /**
16
+ * Only applicable for `custom_webhook` tools. Specifies where the parameter should be sent in the webhook request.
17
+ * - For GET webhooks: defaults to `"query_string"` and `"request_body"` is not allowed.
18
+ * - For POST webhooks: required, can be either `"request_body"` or `"query_string"`.
19
+ * - Not allowed for `custom_websocket` or `built_in_transfer_to_phone_number` tools.
20
+ * When updating a tool's type or endpoint_method, all parameters must include explicit `location` values.
21
+ */
22
+ location?: ToolParameter.Location;
15
23
  }
16
24
  export declare namespace ToolParameter {
17
25
  /**
@@ -35,4 +43,16 @@ export declare namespace ToolParameter {
35
43
  readonly Number: "number";
36
44
  readonly Boolean: "boolean";
37
45
  };
46
+ /**
47
+ * Only applicable for `custom_webhook` tools. Specifies where the parameter should be sent in the webhook request.
48
+ * - For GET webhooks: defaults to `"query_string"` and `"request_body"` is not allowed.
49
+ * - For POST webhooks: required, can be either `"request_body"` or `"query_string"`.
50
+ * - Not allowed for `custom_websocket` or `built_in_transfer_to_phone_number` tools.
51
+ * When updating a tool's type or endpoint_method, all parameters must include explicit `location` values.
52
+ */
53
+ type Location = "request_body" | "query_string";
54
+ const Location: {
55
+ readonly RequestBody: "request_body";
56
+ readonly QueryString: "query_string";
57
+ };
38
58
  }
@@ -19,4 +19,8 @@ var ToolParameter;
19
19
  Number: "number",
20
20
  Boolean: "boolean",
21
21
  };
22
+ ToolParameter.Location = {
23
+ RequestBody: "request_body",
24
+ QueryString: "query_string",
25
+ };
22
26
  })(ToolParameter || (exports.ToolParameter = ToolParameter = {}));
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.30.11";
1
+ export declare const SDK_VERSION = "0.30.12";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.30.11";
4
+ exports.SDK_VERSION = "0.30.12";
@@ -14,8 +14,8 @@ export class PhonicClient {
14
14
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
15
15
  "X-Fern-Language": "JavaScript",
16
16
  "X-Fern-SDK-Name": "phonic",
17
- "X-Fern-SDK-Version": "0.30.11",
18
- "User-Agent": "phonic/0.30.11",
17
+ "X-Fern-SDK-Version": "0.30.12",
18
+ "User-Agent": "phonic/0.30.12",
19
19
  "X-Fern-Runtime": core.RUNTIME.type,
20
20
  "X-Fern-Runtime-Version": core.RUNTIME.version,
21
21
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -66,12 +66,14 @@ export declare class Tools {
66
66
  * type: "string",
67
67
  * name: "date",
68
68
  * description: "The date for the appointment in YYYY-MM-DD format",
69
- * is_required: true
69
+ * is_required: true,
70
+ * location: "request_body"
70
71
  * }, {
71
72
  * type: "string",
72
73
  * name: "time",
73
74
  * description: "The time for the appointment in HH:MM format",
74
- * is_required: true
75
+ * is_required: true,
76
+ * location: "request_body"
75
77
  * }],
76
78
  * endpoint_method: "POST",
77
79
  * endpoint_url: "https://api.example.com/book-appointment",
@@ -118,12 +118,14 @@ export class Tools {
118
118
  * type: "string",
119
119
  * name: "date",
120
120
  * description: "The date for the appointment in YYYY-MM-DD format",
121
- * is_required: true
121
+ * is_required: true,
122
+ * location: "request_body"
122
123
  * }, {
123
124
  * type: "string",
124
125
  * name: "time",
125
126
  * description: "The time for the appointment in HH:MM format",
126
- * is_required: true
127
+ * is_required: true,
128
+ * location: "request_body"
127
129
  * }],
128
130
  * endpoint_method: "POST",
129
131
  * endpoint_url: "https://api.example.com/book-appointment",
@@ -14,12 +14,14 @@ import * as Phonic from "../../../../index.mjs";
14
14
  * type: "string",
15
15
  * name: "date",
16
16
  * description: "The date for the appointment in YYYY-MM-DD format",
17
- * is_required: true
17
+ * is_required: true,
18
+ * location: "request_body"
18
19
  * }, {
19
20
  * type: "string",
20
21
  * name: "time",
21
22
  * description: "The time for the appointment in HH:MM format",
22
- * is_required: true
23
+ * is_required: true,
24
+ * location: "request_body"
23
25
  * }],
24
26
  * endpoint_method: "POST",
25
27
  * endpoint_url: "https://api.example.com/book-appointment",
@@ -67,10 +69,15 @@ export interface CreateToolRequest {
67
69
  type: CreateToolRequest.Type;
68
70
  /** Mode of operation. */
69
71
  execution_mode: CreateToolRequest.ExecutionMode;
70
- /** Array of parameter definitions. */
72
+ /**
73
+ * Array of parameter definitions.
74
+ * For `custom_webhook` tools with POST method, each parameter must include a `location` field.
75
+ * For `custom_webhook` tools with GET method, `location` defaults to `"query_string"` if not specified.
76
+ * For `custom_websocket` and `built_in_transfer_to_phone_number` tools, `location` must not be specified.
77
+ */
71
78
  parameters?: Phonic.ToolParameter[];
72
- /** Required for webhook tools. */
73
- endpoint_method?: "POST";
79
+ /** Required for webhook tools. HTTP method for the webhook endpoint. */
80
+ endpoint_method?: CreateToolRequest.EndpointMethod;
74
81
  /** Required for webhook tools. */
75
82
  endpoint_url?: string;
76
83
  /** Optional headers for webhook tools. */
@@ -100,4 +107,12 @@ export declare namespace CreateToolRequest {
100
107
  readonly Sync: "sync";
101
108
  readonly Async: "async";
102
109
  };
110
+ /**
111
+ * Required for webhook tools. HTTP method for the webhook endpoint.
112
+ */
113
+ type EndpointMethod = "GET" | "POST";
114
+ const EndpointMethod: {
115
+ readonly Get: "GET";
116
+ readonly Post: "POST";
117
+ };
103
118
  }
@@ -12,4 +12,8 @@ export var CreateToolRequest;
12
12
  Sync: "sync",
13
13
  Async: "async",
14
14
  };
15
+ CreateToolRequest.EndpointMethod = {
16
+ Get: "GET",
17
+ Post: "POST",
18
+ };
15
19
  })(CreateToolRequest || (CreateToolRequest = {}));
@@ -24,9 +24,15 @@ export interface UpdateToolRequest {
24
24
  type?: UpdateToolRequest.Type;
25
25
  /** Mode of operation. */
26
26
  execution_mode?: UpdateToolRequest.ExecutionMode;
27
- /** Array of parameter definitions. */
27
+ /**
28
+ * Array of parameter definitions.
29
+ * When updating `type` or `endpoint_method`, all parameters must include explicit `location` values.
30
+ * For `custom_webhook` tools: `location` is required for POST, defaults to `"query_string"` for GET.
31
+ * For `custom_websocket` and `built_in_transfer_to_phone_number` tools: `location` must not be specified.
32
+ */
28
33
  parameters?: Phonic.ToolParameter[];
29
- endpoint_method?: "POST";
34
+ /** HTTP method for webhook tools. When changing this value, all parameters must include explicit `location` values. */
35
+ endpoint_method?: UpdateToolRequest.EndpointMethod;
30
36
  endpoint_url?: string;
31
37
  endpoint_headers?: Record<string, string>;
32
38
  endpoint_timeout_ms?: number;
@@ -52,4 +58,12 @@ export declare namespace UpdateToolRequest {
52
58
  readonly Sync: "sync";
53
59
  readonly Async: "async";
54
60
  };
61
+ /**
62
+ * HTTP method for webhook tools. When changing this value, all parameters must include explicit `location` values.
63
+ */
64
+ type EndpointMethod = "GET" | "POST";
65
+ const EndpointMethod: {
66
+ readonly Get: "GET";
67
+ readonly Post: "POST";
68
+ };
55
69
  }
@@ -12,4 +12,8 @@ export var UpdateToolRequest;
12
12
  Sync: "sync",
13
13
  Async: "async",
14
14
  };
15
+ UpdateToolRequest.EndpointMethod = {
16
+ Get: "GET",
17
+ Post: "POST",
18
+ };
15
19
  })(UpdateToolRequest || (UpdateToolRequest = {}));
@@ -17,7 +17,7 @@ export interface Tool {
17
17
  /** Array of parameter definitions for the tool. */
18
18
  parameters: Phonic.ToolParameter[];
19
19
  /** HTTP method for webhook tools. */
20
- endpoint_method?: "POST";
20
+ endpoint_method?: Tool.EndpointMethod;
21
21
  /** URL for webhook tools. */
22
22
  endpoint_url?: string;
23
23
  /** Headers for webhook tools. */
@@ -51,4 +51,12 @@ export declare namespace Tool {
51
51
  readonly Sync: "sync";
52
52
  readonly Async: "async";
53
53
  };
54
+ /**
55
+ * HTTP method for webhook tools.
56
+ */
57
+ type EndpointMethod = "GET" | "POST";
58
+ const EndpointMethod: {
59
+ readonly Get: "GET";
60
+ readonly Post: "POST";
61
+ };
54
62
  }
@@ -12,4 +12,8 @@ export var Tool;
12
12
  Sync: "sync",
13
13
  Async: "async",
14
14
  };
15
+ Tool.EndpointMethod = {
16
+ Get: "GET",
17
+ Post: "POST",
18
+ };
15
19
  })(Tool || (Tool = {}));
@@ -12,6 +12,14 @@ export interface ToolParameter {
12
12
  description: string;
13
13
  /** Whether the parameter is required. */
14
14
  is_required: boolean;
15
+ /**
16
+ * Only applicable for `custom_webhook` tools. Specifies where the parameter should be sent in the webhook request.
17
+ * - For GET webhooks: defaults to `"query_string"` and `"request_body"` is not allowed.
18
+ * - For POST webhooks: required, can be either `"request_body"` or `"query_string"`.
19
+ * - Not allowed for `custom_websocket` or `built_in_transfer_to_phone_number` tools.
20
+ * When updating a tool's type or endpoint_method, all parameters must include explicit `location` values.
21
+ */
22
+ location?: ToolParameter.Location;
15
23
  }
16
24
  export declare namespace ToolParameter {
17
25
  /**
@@ -35,4 +43,16 @@ export declare namespace ToolParameter {
35
43
  readonly Number: "number";
36
44
  readonly Boolean: "boolean";
37
45
  };
46
+ /**
47
+ * Only applicable for `custom_webhook` tools. Specifies where the parameter should be sent in the webhook request.
48
+ * - For GET webhooks: defaults to `"query_string"` and `"request_body"` is not allowed.
49
+ * - For POST webhooks: required, can be either `"request_body"` or `"query_string"`.
50
+ * - Not allowed for `custom_websocket` or `built_in_transfer_to_phone_number` tools.
51
+ * When updating a tool's type or endpoint_method, all parameters must include explicit `location` values.
52
+ */
53
+ type Location = "request_body" | "query_string";
54
+ const Location: {
55
+ readonly RequestBody: "request_body";
56
+ readonly QueryString: "query_string";
57
+ };
38
58
  }
@@ -16,4 +16,8 @@ export var ToolParameter;
16
16
  Number: "number",
17
17
  Boolean: "boolean",
18
18
  };
19
+ ToolParameter.Location = {
20
+ RequestBody: "request_body",
21
+ QueryString: "query_string",
22
+ };
19
23
  })(ToolParameter || (ToolParameter = {}));
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.30.11";
1
+ export declare const SDK_VERSION = "0.30.12";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.30.11";
1
+ export const SDK_VERSION = "0.30.12";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phonic",
3
- "version": "0.30.11",
3
+ "version": "0.30.12",
4
4
  "private": false,
5
5
  "repository": "github:Phonic-Co/phonic-node",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -605,12 +605,14 @@ await client.tools.create({
605
605
  name: "date",
606
606
  description: "The date for the appointment in YYYY-MM-DD format",
607
607
  is_required: true,
608
+ location: "request_body",
608
609
  },
609
610
  {
610
611
  type: "string",
611
612
  name: "time",
612
613
  description: "The time for the appointment in HH:MM format",
613
614
  is_required: true,
615
+ location: "request_body",
614
616
  },
615
617
  ],
616
618
  endpoint_method: "POST",