botshield-sdk 1.5.0 → 1.6.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 +22 -0
- package/client.d.mts +6 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -0
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/internal/types.d.mts +6 -6
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +6 -6
- package/internal/types.d.ts.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -0
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +2 -0
- package/internal/utils/log.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/actions.d.mts +131 -0
- package/resources/actions.d.mts.map +1 -0
- package/resources/actions.d.ts +131 -0
- package/resources/actions.d.ts.map +1 -0
- package/resources/actions.js +36 -0
- package/resources/actions.js.map +1 -0
- package/resources/actions.mjs +32 -0
- package/resources/actions.mjs.map +1 -0
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +24 -0
- package/src/internal/types.ts +6 -8
- package/src/internal/utils/log.ts +2 -0
- package/src/resources/actions.ts +184 -0
- package/src/resources/index.ts +9 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Queued pattern: agent proposes an action async, user attests in BotShield app, BotShield signs a Resolution JWT and POSTs it to the agent's callback URL.
|
|
9
|
+
*/
|
|
10
|
+
export class Actions extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Stand down a queued action before the user responds. No-op if the proposal is
|
|
13
|
+
* already in a terminal state (TTL is cancel — silent expiry produces no
|
|
14
|
+
* Resolution).
|
|
15
|
+
*/
|
|
16
|
+
cancelAction(
|
|
17
|
+
body: ActionCancelActionParams,
|
|
18
|
+
options?: RequestOptions,
|
|
19
|
+
): APIPromise<ActionCancelActionResponse> {
|
|
20
|
+
return this._client.post('/authlink/cancel', { body, ...options });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Poll the current state of a previously-proposed action. For terminal states
|
|
25
|
+
* (approved/denied), the response carries the signed Resolution JWT.
|
|
26
|
+
*/
|
|
27
|
+
checkActionStatus(
|
|
28
|
+
query: ActionCheckActionStatusParams,
|
|
29
|
+
options?: RequestOptions,
|
|
30
|
+
): APIPromise<ActionCheckActionStatusResponse> {
|
|
31
|
+
return this._client.get('/authlink/check-status', { query, ...options });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Queue a human-presence-gated action for a BotShield user. The user receives a
|
|
36
|
+
* card on their iOS app, attests via biometric ceremony, and BotShield delivers a
|
|
37
|
+
* signed Resolution JWT to your registered callback URL. Authentication: agent key
|
|
38
|
+
* (bs*agent*<name>\_\_<secret>) in Authorization header.
|
|
39
|
+
*/
|
|
40
|
+
proposeAction(
|
|
41
|
+
body: ActionProposeActionParams,
|
|
42
|
+
options?: RequestOptions,
|
|
43
|
+
): APIPromise<ActionProposeActionResponse> {
|
|
44
|
+
return this._client.post('/authlink/inquire', { body, ...options });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface ActionCancelActionResponse {
|
|
49
|
+
data: ActionCancelActionResponse.Data;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export namespace ActionCancelActionResponse {
|
|
53
|
+
export interface Data {
|
|
54
|
+
already_terminal?: boolean;
|
|
55
|
+
|
|
56
|
+
cancelled?: boolean;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ActionCheckActionStatusResponse {
|
|
61
|
+
data: ActionCheckActionStatusResponse.Data;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export namespace ActionCheckActionStatusResponse {
|
|
65
|
+
export interface Data {
|
|
66
|
+
status: 'queued' | 'approved' | 'denied' | 'expired' | 'cancelled';
|
|
67
|
+
|
|
68
|
+
ceremony_id?: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Whether the callback webhook has been confirmed delivered.
|
|
72
|
+
*/
|
|
73
|
+
delivered?: boolean;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* BotShield-signed Resolution JWT. Present only when status is approved or denied.
|
|
77
|
+
* Verify with BotShield's public key.
|
|
78
|
+
*/
|
|
79
|
+
resolution_jwt?: string;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Present only when status is approved or denied.
|
|
83
|
+
*/
|
|
84
|
+
verdict?: 'approve' | 'denied';
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface ActionProposeActionResponse {
|
|
89
|
+
data: ActionProposeActionResponse.Data;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export namespace ActionProposeActionResponse {
|
|
93
|
+
export interface Data {
|
|
94
|
+
card_id: string;
|
|
95
|
+
|
|
96
|
+
status: 'queued';
|
|
97
|
+
|
|
98
|
+
ttl_at: string;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface ActionCancelActionParams {
|
|
103
|
+
request_id: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface ActionCheckActionStatusParams {
|
|
107
|
+
request_id: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface ActionProposeActionParams {
|
|
111
|
+
action: ActionProposeActionParams.Action;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Agent-supplied UUID for idempotency. Re-proposing with the same request_id
|
|
115
|
+
* returns the existing card_id.
|
|
116
|
+
*/
|
|
117
|
+
request_id: string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Email of the BotShield user to receive this proposal.
|
|
121
|
+
*/
|
|
122
|
+
user_email: string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Optional Adaptive Card v1.5 JSON shown when the user expands the card.
|
|
126
|
+
* Allowlist: TextBlock, FactSet, ColumnSet, Container, Table, Image (bundled-asset
|
|
127
|
+
* only).
|
|
128
|
+
*/
|
|
129
|
+
adaptive_card_payload?: unknown;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* How long the user has to respond before the proposal expires. Bounds locked by
|
|
133
|
+
* V3 spec §3.4.
|
|
134
|
+
*/
|
|
135
|
+
ttl_seconds?: number;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export namespace ActionProposeActionParams {
|
|
139
|
+
export interface Action {
|
|
140
|
+
/**
|
|
141
|
+
* Must be in agent.allowed_action_categories AND in the partner's approved scopes
|
|
142
|
+
* for this environment.
|
|
143
|
+
*/
|
|
144
|
+
category: string;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Plain-English action description shown on the card (e.g. 'Has an Uber ride ready
|
|
148
|
+
* to book').
|
|
149
|
+
*/
|
|
150
|
+
summary_title: string;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Primary KPI shown on the card chrome.
|
|
154
|
+
*/
|
|
155
|
+
summary_detail?: Action.SummaryDetail;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Optional link to the user's MultiPass-linked account.
|
|
159
|
+
*/
|
|
160
|
+
trusted_account_id?: string;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export namespace Action {
|
|
164
|
+
/**
|
|
165
|
+
* Primary KPI shown on the card chrome.
|
|
166
|
+
*/
|
|
167
|
+
export interface SummaryDetail {
|
|
168
|
+
label?: string;
|
|
169
|
+
|
|
170
|
+
value?: string;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export declare namespace Actions {
|
|
176
|
+
export {
|
|
177
|
+
type ActionCancelActionResponse as ActionCancelActionResponse,
|
|
178
|
+
type ActionCheckActionStatusResponse as ActionCheckActionStatusResponse,
|
|
179
|
+
type ActionProposeActionResponse as ActionProposeActionResponse,
|
|
180
|
+
type ActionCancelActionParams as ActionCancelActionParams,
|
|
181
|
+
type ActionCheckActionStatusParams as ActionCheckActionStatusParams,
|
|
182
|
+
type ActionProposeActionParams as ActionProposeActionParams,
|
|
183
|
+
};
|
|
184
|
+
}
|
package/src/resources/index.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
export {
|
|
4
|
+
Actions,
|
|
5
|
+
type ActionCancelActionResponse,
|
|
6
|
+
type ActionCheckActionStatusResponse,
|
|
7
|
+
type ActionProposeActionResponse,
|
|
8
|
+
type ActionCancelActionParams,
|
|
9
|
+
type ActionCheckActionStatusParams,
|
|
10
|
+
type ActionProposeActionParams,
|
|
11
|
+
} from './actions';
|
|
3
12
|
export {
|
|
4
13
|
SDK,
|
|
5
14
|
type SDKCreateSessionResponse,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.6.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.6.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.6.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.6.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|