@blazingagents/sdk 0.56.1 → 0.57.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/dist/contracts/api-error-codes.d.ts +1 -1
- package/dist/contracts/api-error-codes.js +1 -5
- package/dist/contracts/api.d.ts +8 -5
- package/dist/contracts/api.js +7 -0
- package/dist/contracts/entities/artifacts.d.ts +2 -2
- package/dist/contracts/entities/artifacts.js +1 -1
- package/dist/contracts/entities/attribution.d.ts +1 -1
- package/dist/contracts/entities/attribution.js +1 -1
- package/dist/contracts/entities/chat-connections.d.ts +1 -1
- package/dist/contracts/entities/chat-connections.js +2 -3
- package/dist/contracts/entities/mcp-connections.d.ts +6 -2
- package/dist/contracts/entities/mcp-connections.js +5 -11
- package/dist/contracts/entities/memories.d.ts +0 -13
- package/dist/contracts/entities/memories.js +0 -5
- package/dist/contracts/entities/merchant.d.ts +7 -88
- package/dist/contracts/entities/merchant.js +7 -22
- package/dist/contracts/entities/providers.d.ts +8 -5
- package/dist/contracts/entities/providers.js +7 -18
- package/dist/contracts/entities/session-inputs.d.ts +1 -1
- package/dist/contracts/entities/session-inputs.js +1 -1
- package/dist/contracts/entities/sessions.d.ts +8 -3
- package/dist/contracts/entities/sessions.js +4 -3
- package/dist/contracts/entities/skills.d.ts +27 -25
- package/dist/contracts/entities/skills.js +2 -2
- package/dist/contracts/entities/tasks.d.ts +0 -5
- package/dist/contracts/entities/tasks.js +3 -20
- package/dist/contracts/index.d.ts +3 -3
- package/dist/contracts/index.js +3 -3
- package/dist/http.d.ts +6 -0
- package/dist/http.js +10 -0
- package/dist/index.d.ts +1 -1
- package/dist/relay.js +1 -1
- package/dist/resources/agents.d.ts +2 -2
- package/dist/resources/agents.js +3 -3
- package/dist/resources/artifacts.d.ts +1 -0
- package/dist/resources/artifacts.js +1 -0
- package/dist/resources/memories.d.ts +7 -7
- package/dist/resources/memories.js +4 -4
- package/dist/resources/merchant-bindings.d.ts +3 -3
- package/dist/resources/merchant-bindings.js +2 -2
- package/dist/resources/merchant-connection.d.ts +5 -5
- package/dist/resources/merchant-connection.js +3 -3
- package/dist/resources/merchant-usage-events.d.ts +9 -9
- package/dist/resources/merchant-usage-events.js +5 -5
- package/dist/resources/skills.js +1 -9
- package/dist/resources/tasks.d.ts +10 -7
- package/dist/resources/tasks.js +9 -4
- package/dist/resources/workspaces.js +1 -1
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@ export const sessionActivitySchema = z
|
|
|
36
36
|
})
|
|
37
37
|
.strip();
|
|
38
38
|
export const sessionInputResponseSchema = z
|
|
39
|
-
.object({
|
|
39
|
+
.object({ input: sessionInputSchema, activity: sessionActivitySchema })
|
|
40
40
|
.strip();
|
|
41
41
|
export const sessionInputsResponseSchema = z
|
|
42
42
|
.object({
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/**
|
|
3
|
-
* `GET /v1/agents/{agentId}/sessions` list item. `
|
|
4
|
-
*
|
|
3
|
+
* `GET /v1/agents/{agentId}/sessions` list item. `userId`/`metadata` come
|
|
4
|
+
* from the first successful Turn.
|
|
5
5
|
*/
|
|
6
6
|
export declare const sessionListItemSchema: z.ZodObject<{
|
|
7
7
|
id: z.ZodString;
|
|
8
|
+
tenantId: z.ZodString;
|
|
8
9
|
messageCount: z.ZodNumber;
|
|
9
10
|
lastMessagePreview: z.ZodNullable<z.ZodString>;
|
|
10
11
|
userId: z.ZodString;
|
|
@@ -15,6 +16,7 @@ export declare const sessionListItemSchema: z.ZodObject<{
|
|
|
15
16
|
export declare const sessionsListResponseSchema: z.ZodObject<{
|
|
16
17
|
data: z.ZodArray<z.ZodObject<{
|
|
17
18
|
id: z.ZodString;
|
|
19
|
+
tenantId: z.ZodString;
|
|
18
20
|
messageCount: z.ZodNumber;
|
|
19
21
|
lastMessagePreview: z.ZodNullable<z.ZodString>;
|
|
20
22
|
userId: z.ZodString;
|
|
@@ -30,6 +32,7 @@ export declare const sessionForkedFromSchema: z.ZodObject<{
|
|
|
30
32
|
}, z.core.$strip>;
|
|
31
33
|
export declare const sessionResponseSchema: z.ZodObject<{
|
|
32
34
|
id: z.ZodString;
|
|
35
|
+
tenantId: z.ZodString;
|
|
33
36
|
messageCount: z.ZodNumber;
|
|
34
37
|
lastMessagePreview: z.ZodNullable<z.ZodString>;
|
|
35
38
|
userId: z.ZodString;
|
|
@@ -160,6 +163,7 @@ export declare const sessionResponseSchema: z.ZodObject<{
|
|
|
160
163
|
*/
|
|
161
164
|
export declare const latestSessionListItemSchema: z.ZodObject<{
|
|
162
165
|
id: z.ZodString;
|
|
166
|
+
tenantId: z.ZodString;
|
|
163
167
|
messageCount: z.ZodNumber;
|
|
164
168
|
lastMessagePreview: z.ZodNullable<z.ZodString>;
|
|
165
169
|
userId: z.ZodString;
|
|
@@ -177,6 +181,7 @@ export declare const latestSessionListItemSchema: z.ZodObject<{
|
|
|
177
181
|
export declare const latestSessionsListResponseSchema: z.ZodObject<{
|
|
178
182
|
data: z.ZodArray<z.ZodObject<{
|
|
179
183
|
id: z.ZodString;
|
|
184
|
+
tenantId: z.ZodString;
|
|
180
185
|
messageCount: z.ZodNumber;
|
|
181
186
|
lastMessagePreview: z.ZodNullable<z.ZodString>;
|
|
182
187
|
userId: z.ZodString;
|
|
@@ -355,7 +360,7 @@ export declare const turnStreamErrorEventSchema: z.ZodObject<{
|
|
|
355
360
|
type: z.ZodLiteral<"data-ba-error">;
|
|
356
361
|
transient: z.ZodLiteral<true>;
|
|
357
362
|
data: z.ZodObject<{
|
|
358
|
-
code: z.ZodCustom<"admin_agent_managed" | "agent_busy" | "agent_deleting" | "agent_disabled" | "
|
|
363
|
+
code: z.ZodCustom<"admin_agent_managed" | "agent_busy" | "agent_deleting" | "agent_disabled" | "agent_mcp_connections_invalid" | "api_key_limit_reached" | "artifact_session_cap_reached" | "chat_webhook_conflict" | "chat_webhook_registration_failed" | "forbidden" | "function_call_conflict" | "idempotency_conflict" | "input_idempotency_conflict" | "insufficient_scope" | "internal" | "invalid_cursor" | "invalid_request" | "mcp_connection_authentication_failed" | "mcp_connection_discovery_failed" | "mcp_connection_in_use" | "mcp_connection_invalid" | "mcp_connection_limit_reached" | "mcp_connection_name_conflict" | "mcp_connection_needs_auth" | "mcp_connection_not_found" | "mcp_connection_stale_credential_version" | "mcp_connection_unreachable" | "merchant_account_mismatch" | "merchant_balance_required" | "merchant_connection_in_use" | "merchant_credential_invalid" | "merchant_customer_not_found" | "merchant_customer_unmapped" | "merchant_eligibility_unavailable" | "merchant_event_state_conflict" | "merchant_provider_unavailable" | "merchant_subscription_required" | "message_id_conflict" | "message_not_found" | "model_discovery_unsupported" | "model_not_found" | "model_spending_limit_exceeded" | "model_validation_unavailable" | "not_found" | "prompt_variable_missing" | "prompt_variable_unknown" | "provider_historical_use" | "provider_in_use" | "provider_limit_reached" | "provider_name_conflict" | "provider_not_found" | "provider_required" | "rate_limited" | "service_unavailable" | "session_busy" | "session_fork_deleted" | "session_fork_unavailable" | "session_turn_unresponsive" | "session_version_mismatch" | "skill_invalid_archive" | "skill_invalid_markdown" | "skill_limit_reached" | "skill_name_conflict" | "skill_too_many_files" | "skill_uncompressed_too_large" | "steer_not_available" | "subscription_already_paid" | "subscription_not_cancelled" | "subscription_required" | "task_active_run_exists" | "tenant_deleting" | "tenant_deletion_in_progress" | "tenant_deletion_not_ready" | "tenant_not_deleting" | "tool_approval_continuation_settled" | "tool_approval_decision_conflict" | "tool_approval_outdated" | "turn_interrupted" | "unauthorized" | "usage_credit_required" | "validation_failed" | "workspace_busy" | "workspace_in_use" | "workspace_not_found" | (string & {}), "admin_agent_managed" | "agent_busy" | "agent_deleting" | "agent_disabled" | "agent_mcp_connections_invalid" | "api_key_limit_reached" | "artifact_session_cap_reached" | "chat_webhook_conflict" | "chat_webhook_registration_failed" | "forbidden" | "function_call_conflict" | "idempotency_conflict" | "input_idempotency_conflict" | "insufficient_scope" | "internal" | "invalid_cursor" | "invalid_request" | "mcp_connection_authentication_failed" | "mcp_connection_discovery_failed" | "mcp_connection_in_use" | "mcp_connection_invalid" | "mcp_connection_limit_reached" | "mcp_connection_name_conflict" | "mcp_connection_needs_auth" | "mcp_connection_not_found" | "mcp_connection_stale_credential_version" | "mcp_connection_unreachable" | "merchant_account_mismatch" | "merchant_balance_required" | "merchant_connection_in_use" | "merchant_credential_invalid" | "merchant_customer_not_found" | "merchant_customer_unmapped" | "merchant_eligibility_unavailable" | "merchant_event_state_conflict" | "merchant_provider_unavailable" | "merchant_subscription_required" | "message_id_conflict" | "message_not_found" | "model_discovery_unsupported" | "model_not_found" | "model_spending_limit_exceeded" | "model_validation_unavailable" | "not_found" | "prompt_variable_missing" | "prompt_variable_unknown" | "provider_historical_use" | "provider_in_use" | "provider_limit_reached" | "provider_name_conflict" | "provider_not_found" | "provider_required" | "rate_limited" | "service_unavailable" | "session_busy" | "session_fork_deleted" | "session_fork_unavailable" | "session_turn_unresponsive" | "session_version_mismatch" | "skill_invalid_archive" | "skill_invalid_markdown" | "skill_limit_reached" | "skill_name_conflict" | "skill_too_many_files" | "skill_uncompressed_too_large" | "steer_not_available" | "subscription_already_paid" | "subscription_not_cancelled" | "subscription_required" | "task_active_run_exists" | "tenant_deleting" | "tenant_deletion_in_progress" | "tenant_deletion_not_ready" | "tenant_not_deleting" | "tool_approval_continuation_settled" | "tool_approval_decision_conflict" | "tool_approval_outdated" | "turn_interrupted" | "unauthorized" | "usage_credit_required" | "validation_failed" | "workspace_busy" | "workspace_in_use" | "workspace_not_found" | (string & {})>;
|
|
359
364
|
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
360
365
|
message: z.ZodString;
|
|
361
366
|
}, z.core.$strict>;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { paginatedResponseSchema } from "../api.js";
|
|
3
|
-
import { agentIdSchema, sessionIdSchema } from "../ids.js";
|
|
3
|
+
import { agentIdSchema, sessionIdSchema, tenantIdSchema } from "../ids.js";
|
|
4
4
|
import { toolExecutionReferenceSchema } from "./agent-approval.js";
|
|
5
5
|
import { agentConfigSchema, agentResponseSchema } from "./agents.js";
|
|
6
6
|
import { metadataSchema, userIdSchema } from "./attribution.js";
|
|
7
7
|
import { chatRequestBodySchema } from "./chat.js";
|
|
8
8
|
import { sessionMessageSchema } from "./session-messages.js";
|
|
9
9
|
/**
|
|
10
|
-
* `GET /v1/agents/{agentId}/sessions` list item. `
|
|
11
|
-
*
|
|
10
|
+
* `GET /v1/agents/{agentId}/sessions` list item. `userId`/`metadata` come
|
|
11
|
+
* from the first successful Turn.
|
|
12
12
|
*/
|
|
13
13
|
export const sessionListItemSchema = z
|
|
14
14
|
.object({
|
|
15
15
|
id: sessionIdSchema,
|
|
16
|
+
tenantId: tenantIdSchema,
|
|
16
17
|
messageCount: z.number().int().nonnegative(),
|
|
17
18
|
lastMessagePreview: z.string().nullable(),
|
|
18
19
|
userId: userIdSchema,
|
|
@@ -82,32 +82,34 @@ export declare const skillCopyResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
82
82
|
details: z.ZodOptional<z.ZodUnknown>;
|
|
83
83
|
}, z.core.$strip>;
|
|
84
84
|
}, z.core.$strip>], "status">;
|
|
85
|
-
export declare const skillCopyResultsSchema: z.
|
|
86
|
-
|
|
87
|
-
status: z.ZodLiteral<"created">;
|
|
88
|
-
skill: z.ZodObject<{
|
|
89
|
-
id: z.ZodString;
|
|
90
|
-
tenantId: z.ZodString;
|
|
85
|
+
export declare const skillCopyResultsSchema: z.ZodObject<{
|
|
86
|
+
data: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
91
87
|
agentId: z.ZodString;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
88
|
+
status: z.ZodLiteral<"created">;
|
|
89
|
+
skill: z.ZodObject<{
|
|
90
|
+
id: z.ZodString;
|
|
91
|
+
tenantId: z.ZodString;
|
|
92
|
+
agentId: z.ZodString;
|
|
93
|
+
name: z.ZodString;
|
|
94
|
+
description: z.ZodString;
|
|
95
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
96
|
+
createdAt: z.ZodISODateTime;
|
|
97
|
+
updatedAt: z.ZodISODateTime;
|
|
98
|
+
files: z.ZodArray<z.ZodObject<{
|
|
99
|
+
path: z.ZodString;
|
|
100
|
+
sizeBytes: z.ZodNumber;
|
|
101
|
+
}, z.core.$strip>>;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
104
|
+
agentId: z.ZodString;
|
|
105
|
+
status: z.ZodLiteral<"failed">;
|
|
106
|
+
error: z.ZodObject<{
|
|
107
|
+
code: z.ZodString;
|
|
108
|
+
message: z.ZodString;
|
|
109
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
}, z.core.$strip>], "status">>;
|
|
112
|
+
}, z.core.$strip>;
|
|
111
113
|
export type Skill = z.infer<typeof skillSchema>;
|
|
112
114
|
export type SkillDetail = z.infer<typeof skillDetailSchema>;
|
|
113
115
|
export type SkillFile = z.infer<typeof skillFileSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { paginatedResponseSchema } from "../api.js";
|
|
2
|
+
import { listResponseSchema, paginatedResponseSchema } from "../api.js";
|
|
3
3
|
import { agentIdSchema, skillIdSchema, tenantIdSchema } from "../ids.js";
|
|
4
4
|
import { MAX_SKILL_COPY_DESTINATIONS, MAX_SKILL_DESCRIPTION_LENGTH, MAX_SKILL_NAME_LENGTH, } from "../limitations.js";
|
|
5
5
|
import { hasUniqueValues } from "../utils.js";
|
|
@@ -98,4 +98,4 @@ export const skillCopyResultSchema = z.discriminatedUnion("status", [
|
|
|
98
98
|
skillCopyCreatedResultSchema,
|
|
99
99
|
skillCopyFailedResultSchema,
|
|
100
100
|
]);
|
|
101
|
-
export const skillCopyResultsSchema =
|
|
101
|
+
export const skillCopyResultsSchema = listResponseSchema(skillCopyResultSchema);
|
|
@@ -44,7 +44,6 @@ export declare const taskScheduleInputSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
44
44
|
}, z.core.$strict>;
|
|
45
45
|
}, z.core.$strict>], "kind">;
|
|
46
46
|
export declare const createTaskBodySchema: z.ZodObject<{
|
|
47
|
-
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
48
47
|
agentId: z.ZodString;
|
|
49
48
|
name: z.ZodString;
|
|
50
49
|
prompt: z.ZodString;
|
|
@@ -95,9 +94,6 @@ export declare const updateTaskBodySchema: z.ZodObject<{
|
|
|
95
94
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
96
95
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
97
96
|
}, z.core.$strict>;
|
|
98
|
-
export declare const createTaskRunBodySchema: z.ZodObject<{
|
|
99
|
-
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
100
|
-
}, z.core.$strict>;
|
|
101
97
|
/**
|
|
102
98
|
* Task run status. `blocked` is the soft-block terminal state for an expected
|
|
103
99
|
* admission denial, such as a missing subscription or insufficient Usage
|
|
@@ -614,7 +610,6 @@ export type TaskRunResponse = z.infer<typeof taskRunResponseSchema>;
|
|
|
614
610
|
export type TaskRunsListResponse = z.infer<typeof taskRunsListResponseSchema>;
|
|
615
611
|
export type CreateTaskBody = z.input<typeof createTaskBodySchema>;
|
|
616
612
|
export type UpdateTaskBody = z.infer<typeof updateTaskBodySchema>;
|
|
617
|
-
export type CreateTaskRunBody = z.infer<typeof createTaskRunBodySchema>;
|
|
618
613
|
export type CreateTaskResponse = z.infer<typeof createTaskResponseSchema>;
|
|
619
614
|
export type CreateTaskRunResponse = z.infer<typeof createTaskRunResponseSchema>;
|
|
620
615
|
export type TaskRunMessagesResponse = z.infer<typeof taskRunMessagesResponseSchema>;
|
|
@@ -89,9 +89,9 @@ const taskNameSchema = z.string().trim().min(1).max(MAX_TASK_NAME_LENGTH);
|
|
|
89
89
|
const taskPromptSchema = z.string().trim().min(1).max(MAX_TASK_PROMPT_LENGTH);
|
|
90
90
|
/**
|
|
91
91
|
* `POST /v1/tasks` — schedule present = scheduled task; absent = on-demand.
|
|
92
|
-
* `submit: true` enqueues a run immediately. An optional `
|
|
93
|
-
* makes retries return the original Task and initial run id. Without
|
|
94
|
-
* each call creates a new Task. Run creation has its own
|
|
92
|
+
* `submit: true` enqueues a run immediately. An optional `Idempotency-Key`
|
|
93
|
+
* header makes retries return the original Task and initial run id. Without
|
|
94
|
+
* a key, each call creates a new Task. Run creation has its own key.
|
|
95
95
|
*/
|
|
96
96
|
const taskFieldDescriptions = {
|
|
97
97
|
agentId: "ID of the agent that runs the task. It cannot change later.",
|
|
@@ -105,12 +105,6 @@ const taskFieldDescriptions = {
|
|
|
105
105
|
};
|
|
106
106
|
export const createTaskBodySchema = z
|
|
107
107
|
.object({
|
|
108
|
-
idempotencyKey: z
|
|
109
|
-
.string()
|
|
110
|
-
.trim()
|
|
111
|
-
.min(1)
|
|
112
|
-
.optional()
|
|
113
|
-
.describe("Retry the same creation with this key to return the current task and its original initial run. Changed requests or deleted tasks return a conflict."),
|
|
114
108
|
agentId: agentIdSchema.describe(taskFieldDescriptions.agentId),
|
|
115
109
|
name: taskNameSchema.describe(taskFieldDescriptions.name),
|
|
116
110
|
prompt: taskPromptSchema.describe(taskFieldDescriptions.prompt),
|
|
@@ -144,17 +138,6 @@ export const updateTaskBodySchema = z
|
|
|
144
138
|
.refine(hasObjectKeys, {
|
|
145
139
|
message: atLeastOneFieldMessage,
|
|
146
140
|
});
|
|
147
|
-
// `POST /v1/tasks/{taskId}/runs` — optional client idempotency key.
|
|
148
|
-
export const createTaskRunBodySchema = z
|
|
149
|
-
.object({
|
|
150
|
-
idempotencyKey: z
|
|
151
|
-
.string()
|
|
152
|
-
.trim()
|
|
153
|
-
.min(1)
|
|
154
|
-
.optional()
|
|
155
|
-
.describe("Your own key for this run. Retrying with the same key returns the same run instead of starting another."),
|
|
156
|
-
})
|
|
157
|
-
.strict();
|
|
158
141
|
/**
|
|
159
142
|
* Task run status. `blocked` is the soft-block terminal state for an expected
|
|
160
143
|
* admission denial, such as a missing subscription or insufficient Usage
|
|
@@ -14,8 +14,8 @@ export { chatConfigurationSchema, chatConnectionSchema, chatConnectionsResponseS
|
|
|
14
14
|
export type { McpConnectionLiveDetails, McpConnectionTestErrorCode, } from "./entities/mcp-connections.ts";
|
|
15
15
|
export { createMcpConnectionBodySchema, forwardedMetadataKeysSchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionLiveDetailsSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.ts";
|
|
16
16
|
export type { CreateMemoryBody, Memory, UpdateMemoryBody, } from "./entities/memories.ts";
|
|
17
|
-
export { createMemoryBodySchema, memoriesListResponseSchema,
|
|
18
|
-
export { createMerchantConnectionBodySchema,
|
|
17
|
+
export { createMemoryBodySchema, memoriesListResponseSchema, memorySchema, memoryTextSchema, updateMemoryBodySchema, } from "./entities/memories.ts";
|
|
18
|
+
export { createMerchantConnectionBodySchema, merchantBindingsResponseSchema, merchantConnectionResponseSchema, merchantConnectionSchema, merchantCustomerBindingSchema, merchantEnvironmentSchema, merchantGuardSchema, merchantProviderSchema, merchantUsageEventNextAction, merchantUsageEventNextActionSchema, merchantUsageEventSchema, merchantUsageEventStatusSchema, merchantUsageEventsResponseSchema, merchantUsageSummaryQuerySchema, merchantUsageSummarySchema, updateMerchantConnectionBodySchema, upsertMerchantBindingBodySchema, } from "./entities/merchant.ts";
|
|
19
19
|
export { createPromptBodySchema, parsePromptVariables, promptResponseSchema, promptsListQuerySchema, promptsResponseSchema, promptTemplateSchema, renderPromptTemplate, updatePromptBodySchema, } from "./entities/prompts.ts";
|
|
20
20
|
export { createProviderBodySchema, providerListItemSchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.ts";
|
|
21
21
|
export type { ChatSteerConsumedEvent, SessionActivity, SessionInput, SessionInputResponse, SessionInputState, SessionInputsQuery, SessionInputsResponse, StopSessionBody, StopSessionResponse, SubmitSessionInputBody, } from "./entities/session-inputs.ts";
|
|
@@ -27,7 +27,7 @@ export { copySkillBodySchema, createSkillBodySchema, skillArchiveTypeSchema, ski
|
|
|
27
27
|
export type { SpendingLimit, SpendingLimitResponse, SpendingLimitStopDetails, UpdateSpendingLimitBody, } from "./entities/spending-limits.ts";
|
|
28
28
|
export { nextSpendingLimitReset, spendingLimitPeriodSchema, spendingLimitResetIntervalSchema, spendingLimitResponseSchema, spendingLimitSchema, spendingLimitStopDetailsSchema, updateSpendingLimitBodySchema, } from "./entities/spending-limits.ts";
|
|
29
29
|
export type { CreateTaskBody, TaskListItem, TaskRunStatus, TaskScheduleInput, UpdateTaskBody, } from "./entities/tasks.ts";
|
|
30
|
-
export { createTaskBodySchema, createTaskResponseSchema,
|
|
30
|
+
export { createTaskBodySchema, createTaskResponseSchema, createTaskRunResponseSchema, taskCronConfigSchema, taskIntervalConfigSchema, taskLatestRunSchema, taskListItemSchema, taskOnceConfigSchema, taskResponseSchema, taskRunMessagesResponseSchema, taskRunResponseSchema, taskRunStatusSchema, taskRunsListResponseSchema, taskScheduleInputSchema, taskScheduleKindSchema, tasksListResponseSchema, updateTaskBodySchema, } from "./entities/tasks.ts";
|
|
31
31
|
export type { TenantDeletion, UpdateTenantSettingsBody, } from "./entities/tenants.ts";
|
|
32
32
|
export { tenantDeletionSchema, tenantSettingsResponseSchema, updateTenantSettingsBodySchema, } from "./entities/tenants.ts";
|
|
33
33
|
export type { SessionUsageQuery, SessionUsageResponse, UsageBucket, UsageOverviewQuery, UsageOverviewResponse, UsageResponse, UsageTotals, } from "./entities/usage.ts";
|
package/dist/contracts/index.js
CHANGED
|
@@ -9,8 +9,8 @@ export { attributionCreateInputSchema, metadataSchema, userIdSchema, } from "./e
|
|
|
9
9
|
export { blazingAgentsChatMessageMetadataSchema, chatFunctionCallEventSchema, chatFunctionDefinitionSchema, chatFunctionDefinitionsSchema, chatFunctionOutcomeSchema, chatModeSchema, chatRequestBodySchema, chatTriggerSchema, claimChatFunctionBodySchema, claimChatFunctionResponseSchema, generationRequestBodySchema, jsonSchemaShapeSchema, MAX_CHAT_FUNCTION_DEFINITIONS_BYTES, MAX_CHAT_FUNCTION_PAYLOAD_BYTES, MAX_CHAT_FUNCTIONS, promptVariablesSchema, resolveChatFunctionBodySchema, resolveChatFunctionResponseSchema, usageSummarySchema, } from "./entities/chat.js";
|
|
10
10
|
export { chatConfigurationSchema, chatConnectionSchema, chatConnectionsResponseSchema, chatCredentialsSchema, chatHealthCheckSchema, chatHealthSchema, chatIdentitySchema, createChatConnectionBodySchema, rotateChatConnectionBodySchema, updateChatConnectionBodySchema, } from "./entities/chat-connections.js";
|
|
11
11
|
export { createMcpConnectionBodySchema, forwardedMetadataKeysSchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionLiveDetailsSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.js";
|
|
12
|
-
export { createMemoryBodySchema, memoriesListResponseSchema,
|
|
13
|
-
export { createMerchantConnectionBodySchema,
|
|
12
|
+
export { createMemoryBodySchema, memoriesListResponseSchema, memorySchema, memoryTextSchema, updateMemoryBodySchema, } from "./entities/memories.js";
|
|
13
|
+
export { createMerchantConnectionBodySchema, merchantBindingsResponseSchema, merchantConnectionResponseSchema, merchantConnectionSchema, merchantCustomerBindingSchema, merchantEnvironmentSchema, merchantGuardSchema, merchantProviderSchema, merchantUsageEventNextAction, merchantUsageEventNextActionSchema, merchantUsageEventSchema, merchantUsageEventStatusSchema, merchantUsageEventsResponseSchema, merchantUsageSummaryQuerySchema, merchantUsageSummarySchema, updateMerchantConnectionBodySchema, upsertMerchantBindingBodySchema, } from "./entities/merchant.js";
|
|
14
14
|
export { createPromptBodySchema, parsePromptVariables, promptResponseSchema, promptsListQuerySchema, promptsResponseSchema, promptTemplateSchema, renderPromptTemplate, updatePromptBodySchema, } from "./entities/prompts.js";
|
|
15
15
|
export { createProviderBodySchema, providerListItemSchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.js";
|
|
16
16
|
export { chatSteerConsumedEventSchema, sessionActivitySchema, sessionInputRequestIdSchema, sessionInputResponseSchema, sessionInputSchema, sessionInputStateSchema, sessionInputsQuerySchema, sessionInputsResponseSchema, stopSessionBodySchema, stopSessionResponseSchema, submitSessionInputBodySchema, } from "./entities/session-inputs.js";
|
|
@@ -18,7 +18,7 @@ export { sessionMessageSchema, } from "./entities/session-messages.js";
|
|
|
18
18
|
export { continueToolApprovalsBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionForkedFromSchema, sessionListItemSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalContinuationSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, turnStreamErrorEventSchema, } from "./entities/sessions.js";
|
|
19
19
|
export { copySkillBodySchema, createSkillBodySchema, skillArchiveTypeSchema, skillCopyResultsSchema, skillDescriptionSchema, skillDetailSchema, skillFilePathSchema, skillMetadataSchema, skillNameSchema, skillSchema, skillsListResponseSchema, } from "./entities/skills.js";
|
|
20
20
|
export { nextSpendingLimitReset, spendingLimitPeriodSchema, spendingLimitResetIntervalSchema, spendingLimitResponseSchema, spendingLimitSchema, spendingLimitStopDetailsSchema, updateSpendingLimitBodySchema, } from "./entities/spending-limits.js";
|
|
21
|
-
export { createTaskBodySchema, createTaskResponseSchema,
|
|
21
|
+
export { createTaskBodySchema, createTaskResponseSchema, createTaskRunResponseSchema, taskCronConfigSchema, taskIntervalConfigSchema, taskLatestRunSchema, taskListItemSchema, taskOnceConfigSchema, taskResponseSchema, taskRunMessagesResponseSchema, taskRunResponseSchema, taskRunStatusSchema, taskRunsListResponseSchema, taskScheduleInputSchema, taskScheduleKindSchema, tasksListResponseSchema, updateTaskBodySchema, } from "./entities/tasks.js";
|
|
22
22
|
export { tenantDeletionSchema, tenantSettingsResponseSchema, updateTenantSettingsBodySchema, } from "./entities/tenants.js";
|
|
23
23
|
export { sessionUsageQuerySchema, sessionUsageResponseSchema, usageOverviewQuerySchema, usageOverviewResponseSchema, usageResponseSchema, } from "./entities/usage.js";
|
|
24
24
|
export { createWorkspaceBodySchema, updateWorkspaceBodySchema, workspaceNetworkPolicySchema, workspaceSchema, workspacesListResponseSchema, workspaceTierSchema, } from "./entities/workspaces.js";
|
package/dist/http.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { BlazingAgentsError } from "./errors.ts";
|
|
2
2
|
import type { BlazingAgentsFetch, BlazingAgentsRequestInit, HttpConfig, RequestOptions } from "./types.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Builds the `Idempotency-Key` header, or none when the caller set no key.
|
|
5
|
+
* @param idempotencyKey - The caller's retry identity, if any.
|
|
6
|
+
* @returns The header to send, or `undefined`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function idempotencyHeaders(idempotencyKey: string | undefined): Record<string, string> | undefined;
|
|
3
9
|
/**
|
|
4
10
|
* Builds an endpoint path, encoding each interpolated value so it stays inside
|
|
5
11
|
* one path segment. `encodeURIComponent` leaves `.` and `..` unchanged, and
|
package/dist/http.js
CHANGED
|
@@ -23,6 +23,16 @@ const CREDENTIAL_KEYS = new Set([
|
|
|
23
23
|
/** Submitted secrets at least this long match as a substring; shorter ones only as a whole string. */
|
|
24
24
|
const MIN_SUBSTRING_SECRET_LENGTH = 8;
|
|
25
25
|
const DOT_OR_EMPTY_SEGMENTS = new Set(["", ".", ".."]);
|
|
26
|
+
/**
|
|
27
|
+
* Builds the `Idempotency-Key` header, or none when the caller set no key.
|
|
28
|
+
* @param idempotencyKey - The caller's retry identity, if any.
|
|
29
|
+
* @returns The header to send, or `undefined`.
|
|
30
|
+
*/
|
|
31
|
+
export function idempotencyHeaders(idempotencyKey) {
|
|
32
|
+
return idempotencyKey === undefined
|
|
33
|
+
? undefined
|
|
34
|
+
: { "Idempotency-Key": idempotencyKey };
|
|
35
|
+
}
|
|
26
36
|
/**
|
|
27
37
|
* Builds an endpoint path, encoding each interpolated value so it stays inside
|
|
28
38
|
* one path segment. `encodeURIComponent` leaves `.` and `..` unchanged, and
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export { agentConfigSchema } from "./contracts/entities/agents.ts";
|
|
|
14
14
|
export type { ArtifactDownloadUrlResponse, ArtifactListItem, ArtifactsListResponse, } from "./contracts/entities/artifacts.ts";
|
|
15
15
|
export type { ChatConfiguration, ChatConnection, ChatConnectionsResponse, ChatCredentials, ChatHealth, ChatIdentity, CreateChatConnectionBody, RotateChatConnectionBody, UpdateChatConnectionBody, } from "./contracts/entities/chat-connections.ts";
|
|
16
16
|
export type { CreateMcpConnectionBody, McpAttachmentResponse, McpAttachmentsResponse, McpConnectionAuthType, McpConnectionReconnectResult, McpConnectionResponse, McpConnectionStatus, McpConnectionTestResponse, ReconnectMcpConnectionBody, UpdateMcpAttachmentBody, UpdateMcpConnectionBody, } from "./contracts/entities/mcp-connections.ts";
|
|
17
|
-
export type { CreateMerchantConnectionBody,
|
|
17
|
+
export type { CreateMerchantConnectionBody, MerchantBindingsResponse, MerchantConnection, MerchantConnectionResponse, MerchantCustomerBinding, MerchantGuard, MerchantProviderKind, MerchantUsageEvent, MerchantUsageEventStatus, MerchantUsageEventsResponse, MerchantUsageSummary, UpdateMerchantConnectionBody, UpsertMerchantBindingBody, } from "./contracts/entities/merchant.ts";
|
|
18
18
|
export type { CreatePromptBody, PromptResponse, PromptsListQuery, PromptsResponse, UpdatePromptBody, } from "./contracts/entities/prompts.ts";
|
|
19
19
|
export type { CreateProviderBody, ProviderListItem, ProviderModel, ProviderModelsResponse, ProviderResponse, ProvidersResponse, ProviderType, ThinkingLevelsResponse, UpdateProviderBody, } from "./contracts/entities/providers.ts";
|
|
20
20
|
export type { ChatSteerConsumedEvent, SessionActivity, SessionInput, SessionInputResponse, SessionInputState, SessionInputsQuery, SessionInputsResponse, StopSessionBody, StopSessionResponse, SubmitSessionInputBody, } from "./contracts/entities/session-inputs.ts";
|
package/dist/relay.js
CHANGED
|
@@ -119,7 +119,7 @@ async function relaySteer(client, agentId, body, signal) {
|
|
|
119
119
|
message: validated.data[0],
|
|
120
120
|
abortSignal: signal,
|
|
121
121
|
});
|
|
122
|
-
return Response.json({ state: receipt.
|
|
122
|
+
return Response.json({ state: receipt.input.state }, { status: 202 });
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
125
|
* Forwards the last assistant approval round to its Session.
|
|
@@ -14,13 +14,13 @@ export interface AgentsResource {
|
|
|
14
14
|
create(input: CreateAgentBody & ResourceRequestOptions): Promise<Agent>;
|
|
15
15
|
/**
|
|
16
16
|
* Deletes the Agent while preserving its attached Workspace.
|
|
17
|
-
* @param input - `agentId`; optional abortSignal;
|
|
17
|
+
* @param input - `agentId`; optional abortSignal; deleteArtifacts controls Artifact deletion.
|
|
18
18
|
* @returns Resolves when the operation completes.
|
|
19
19
|
* @throws BlazingAgentsError - If the request fails, is aborted, or returns an invalid response; `agent_busy` (409) while the Agent has a live Turn or a queued or running Task run.
|
|
20
20
|
*/
|
|
21
21
|
delete(input: {
|
|
22
22
|
agentId: string;
|
|
23
|
-
|
|
23
|
+
deleteArtifacts: boolean;
|
|
24
24
|
} & ResourceRequestOptions): Promise<void>;
|
|
25
25
|
/**
|
|
26
26
|
* Disables the Agent.
|
package/dist/resources/agents.js
CHANGED
|
@@ -30,7 +30,7 @@ export function createUserAgentsResource(config) {
|
|
|
30
30
|
const update = async ({ agentId, abortSignal, ...body }) => requestJson(config, apiPath `/v1/agents/${agentId}`, {
|
|
31
31
|
json: body,
|
|
32
32
|
signal: abortSignal,
|
|
33
|
-
method: "
|
|
33
|
+
method: "PATCH",
|
|
34
34
|
}, agentResponseSchema);
|
|
35
35
|
return {
|
|
36
36
|
async create({ abortSignal, ...body }) {
|
|
@@ -67,10 +67,10 @@ export function createUserAgentsResource(config) {
|
|
|
67
67
|
async updateMcpAttachment({ agentId, mcpConnectionId, abortSignal, ...body }) {
|
|
68
68
|
return await requestJson(config, apiPath `/v1/agents/${agentId}/mcp-attachments/${mcpConnectionId}`, { json: body, method: "PATCH", signal: abortSignal }, mcpAttachmentResponseSchema);
|
|
69
69
|
},
|
|
70
|
-
async delete({ agentId,
|
|
70
|
+
async delete({ agentId, deleteArtifacts, abortSignal }) {
|
|
71
71
|
await requestJson(config, apiPath `/v1/agents/${agentId}`, {
|
|
72
72
|
method: "DELETE",
|
|
73
|
-
query: {
|
|
73
|
+
query: { deleteArtifacts },
|
|
74
74
|
signal: abortSignal,
|
|
75
75
|
});
|
|
76
76
|
},
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { type CreateMemoryBody, type MemoriesListResponse, type
|
|
1
|
+
import { type CreateMemoryBody, type MemoriesListResponse, type Memory, type UpdateMemoryBody } from "../contracts/entities/memories.ts";
|
|
2
2
|
import type { HttpConfig, ResourceRequestOptions } from "../types.ts";
|
|
3
3
|
export interface MemoriesResource {
|
|
4
4
|
/**
|
|
5
5
|
* Creates the Memory.
|
|
6
6
|
* @param input - `agentId`; creation fields; optional abortSignal.
|
|
7
|
-
* @returns The memory
|
|
7
|
+
* @returns The memory.
|
|
8
8
|
* @throws BlazingAgentsError - If the request fails, is aborted, or returns an invalid response.
|
|
9
9
|
*/
|
|
10
10
|
create(input: CreateMemoryBody & {
|
|
11
11
|
agentId: string;
|
|
12
|
-
} & ResourceRequestOptions): Promise<
|
|
12
|
+
} & ResourceRequestOptions): Promise<Memory>;
|
|
13
13
|
/**
|
|
14
14
|
* Deletes the Memory.
|
|
15
15
|
* @param input - `agentId`, `memoryId`; optional abortSignal.
|
|
@@ -23,13 +23,13 @@ export interface MemoriesResource {
|
|
|
23
23
|
/**
|
|
24
24
|
* Retrieves the Memory.
|
|
25
25
|
* @param input - `agentId`, `memoryId`; optional abortSignal.
|
|
26
|
-
* @returns The memory
|
|
26
|
+
* @returns The memory.
|
|
27
27
|
* @throws BlazingAgentsError - If the request fails, is aborted, or returns an invalid response.
|
|
28
28
|
*/
|
|
29
29
|
get(input: {
|
|
30
30
|
agentId: string;
|
|
31
31
|
memoryId: string;
|
|
32
|
-
} & ResourceRequestOptions): Promise<
|
|
32
|
+
} & ResourceRequestOptions): Promise<Memory>;
|
|
33
33
|
/**
|
|
34
34
|
* Lists one page of Memory records.
|
|
35
35
|
* @param input - `agentId`; filters and pagination options.
|
|
@@ -42,13 +42,13 @@ export interface MemoriesResource {
|
|
|
42
42
|
/**
|
|
43
43
|
* Updates the Memory.
|
|
44
44
|
* @param input - `agentId`, `memoryId`; fields to change; optional abortSignal.
|
|
45
|
-
* @returns The memory
|
|
45
|
+
* @returns The memory.
|
|
46
46
|
* @throws BlazingAgentsError - If the request fails, is aborted, or returns an invalid response.
|
|
47
47
|
*/
|
|
48
48
|
update(input: UpdateMemoryBody & {
|
|
49
49
|
agentId: string;
|
|
50
50
|
memoryId: string;
|
|
51
|
-
} & ResourceRequestOptions): Promise<
|
|
51
|
+
} & ResourceRequestOptions): Promise<Memory>;
|
|
52
52
|
}
|
|
53
53
|
export interface MemoriesListOptions extends ResourceRequestOptions {
|
|
54
54
|
cursor?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { memoriesListResponseSchema,
|
|
1
|
+
import { memoriesListResponseSchema, memorySchema, } from "../contracts/entities/memories.js";
|
|
2
2
|
import { apiPath, requestJson } from "../http.js";
|
|
3
3
|
/**
|
|
4
4
|
* `client.memories` — CRUD and query over `/v1/agents/:agentId/memories`.
|
|
@@ -21,13 +21,13 @@ export function createMemoriesResource(config) {
|
|
|
21
21
|
}, memoriesListResponseSchema);
|
|
22
22
|
},
|
|
23
23
|
async create({ agentId, abortSignal, ...body }) {
|
|
24
|
-
return await requestJson(config, apiPath `/v1/agents/${agentId}/memories`, { json: body, signal: abortSignal, method: "POST" },
|
|
24
|
+
return await requestJson(config, apiPath `/v1/agents/${agentId}/memories`, { json: body, signal: abortSignal, method: "POST" }, memorySchema);
|
|
25
25
|
},
|
|
26
26
|
async get({ agentId, memoryId, abortSignal }) {
|
|
27
|
-
return await requestJson(config, apiPath `/v1/agents/${agentId}/memories/${memoryId}`, { signal: abortSignal },
|
|
27
|
+
return await requestJson(config, apiPath `/v1/agents/${agentId}/memories/${memoryId}`, { signal: abortSignal }, memorySchema);
|
|
28
28
|
},
|
|
29
29
|
async update({ agentId, memoryId, abortSignal, ...body }) {
|
|
30
|
-
return await requestJson(config, apiPath `/v1/agents/${agentId}/memories/${memoryId}`, { json: body, signal: abortSignal, method: "PATCH" },
|
|
30
|
+
return await requestJson(config, apiPath `/v1/agents/${agentId}/memories/${memoryId}`, { json: body, signal: abortSignal, method: "PATCH" }, memorySchema);
|
|
31
31
|
},
|
|
32
32
|
async delete({ agentId, memoryId, abortSignal }) {
|
|
33
33
|
await requestJson(config, apiPath `/v1/agents/${agentId}/memories/${memoryId}`, { method: "DELETE", signal: abortSignal });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type MerchantBindingsResponse, type MerchantCustomerBinding, type UpsertMerchantBindingBody } from "../contracts/entities/merchant.ts";
|
|
2
2
|
import type { HttpConfig, ResourceRequestOptions } from "../types.ts";
|
|
3
3
|
export interface MerchantBindingsListOptions extends ResourceRequestOptions {
|
|
4
4
|
cursor?: string;
|
|
@@ -30,12 +30,12 @@ export interface MerchantBindingsResource {
|
|
|
30
30
|
/**
|
|
31
31
|
* Validates and saves the end-user merchant binding.
|
|
32
32
|
* @param input - `userId`; fields to change; optional abortSignal.
|
|
33
|
-
* @returns The merchant binding
|
|
33
|
+
* @returns The merchant binding.
|
|
34
34
|
* @throws BlazingAgentsError - If the request fails, is aborted, or returns an invalid response.
|
|
35
35
|
*/
|
|
36
36
|
put(input: UpsertMerchantBindingBody & {
|
|
37
37
|
userId: string;
|
|
38
|
-
} & ResourceRequestOptions): Promise<
|
|
38
|
+
} & ResourceRequestOptions): Promise<MerchantCustomerBinding>;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* `client.merchantBindings` — list/put/delete over
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { merchantBindingsResponseSchema, merchantCustomerBindingSchema, } from "../contracts/entities/merchant.js";
|
|
2
2
|
import { apiPath, requestJson } from "../http.js";
|
|
3
3
|
/**
|
|
4
4
|
* `client.merchantBindings` — list/put/delete over
|
|
@@ -14,7 +14,7 @@ export function createMerchantBindingsResource(config) {
|
|
|
14
14
|
return await requestJson(config, "/v1/merchant-connection/bindings", { query, signal: abortSignal }, merchantBindingsResponseSchema);
|
|
15
15
|
},
|
|
16
16
|
async put({ userId, abortSignal, ...body }) {
|
|
17
|
-
return await requestJson(config, apiPath `/v1/merchant-connection/bindings/${userId}`, { json: body, method: "PUT", signal: abortSignal },
|
|
17
|
+
return await requestJson(config, apiPath `/v1/merchant-connection/bindings/${userId}`, { json: body, method: "PUT", signal: abortSignal }, merchantCustomerBindingSchema);
|
|
18
18
|
},
|
|
19
19
|
async delete({ userId, abortSignal }) {
|
|
20
20
|
await requestJson(config, apiPath `/v1/merchant-connection/bindings/${userId}`, { method: "DELETE", signal: abortSignal });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CreateMerchantConnectionBody, type MerchantConnectionResponse, type UpdateMerchantConnectionBody } from "../contracts/entities/merchant.ts";
|
|
1
|
+
import { type CreateMerchantConnectionBody, type MerchantConnection, type MerchantConnectionResponse, type UpdateMerchantConnectionBody } from "../contracts/entities/merchant.ts";
|
|
2
2
|
import type { HttpConfig, ResourceRequestOptions } from "../types.ts";
|
|
3
3
|
/**
|
|
4
4
|
* `client.merchantConnection` — the tenant's own Polar/Dodo merchant
|
|
@@ -9,10 +9,10 @@ export interface MerchantConnectionResource {
|
|
|
9
9
|
/**
|
|
10
10
|
* Creates the merchant connection.
|
|
11
11
|
* @param input - creation fields; optional abortSignal.
|
|
12
|
-
* @returns The merchant connection
|
|
12
|
+
* @returns The merchant connection.
|
|
13
13
|
* @throws BlazingAgentsError - If the request fails, is aborted, or returns an invalid response.
|
|
14
14
|
*/
|
|
15
|
-
create(input: CreateMerchantConnectionBody & ResourceRequestOptions): Promise<
|
|
15
|
+
create(input: CreateMerchantConnectionBody & ResourceRequestOptions): Promise<MerchantConnection>;
|
|
16
16
|
/**
|
|
17
17
|
* Retrieves the merchant connection.
|
|
18
18
|
* @param input - optional abortSignal.
|
|
@@ -30,10 +30,10 @@ export interface MerchantConnectionResource {
|
|
|
30
30
|
/**
|
|
31
31
|
* Updates the merchant connection.
|
|
32
32
|
* @param input - fields to change; optional abortSignal.
|
|
33
|
-
* @returns The merchant connection
|
|
33
|
+
* @returns The merchant connection.
|
|
34
34
|
* @throws BlazingAgentsError - If the request fails, is aborted, or returns an invalid response.
|
|
35
35
|
*/
|
|
36
|
-
update(input: UpdateMerchantConnectionBody & ResourceRequestOptions): Promise<
|
|
36
|
+
update(input: UpdateMerchantConnectionBody & ResourceRequestOptions): Promise<MerchantConnection>;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* `client.merchantConnection` — get/create/update/retire over
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { merchantConnectionResponseSchema, } from "../contracts/entities/merchant.js";
|
|
1
|
+
import { merchantConnectionResponseSchema, merchantConnectionSchema, } from "../contracts/entities/merchant.js";
|
|
2
2
|
import { requestJson } from "../http.js";
|
|
3
3
|
/**
|
|
4
4
|
* `client.merchantConnection` — get/create/update/retire over
|
|
@@ -18,7 +18,7 @@ export function createMerchantConnectionResource(config) {
|
|
|
18
18
|
method: "POST",
|
|
19
19
|
credentialBearing: true,
|
|
20
20
|
signal: abortSignal,
|
|
21
|
-
},
|
|
21
|
+
}, merchantConnectionSchema);
|
|
22
22
|
},
|
|
23
23
|
async update({ abortSignal, ...body }) {
|
|
24
24
|
return await requestJson(config, "/v1/merchant-connection", {
|
|
@@ -26,7 +26,7 @@ export function createMerchantConnectionResource(config) {
|
|
|
26
26
|
method: "PATCH",
|
|
27
27
|
credentialBearing: true,
|
|
28
28
|
signal: abortSignal,
|
|
29
|
-
},
|
|
29
|
+
}, merchantConnectionSchema);
|
|
30
30
|
},
|
|
31
31
|
async retire({ abortSignal } = {}) {
|
|
32
32
|
await requestJson(config, "/v1/merchant-connection", {
|