@kivel.io/sdk 0.0.0-stage → 0.6.1
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 +59 -0
- package/LICENSE +201 -0
- package/README.md +86 -2
- package/dist/index.d.ts +358 -0
- package/dist/index.js +458 -0
- package/dist/types.d.ts +276 -0
- package/dist/types.js +1 -0
- package/package.json +42 -3
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
export interface WaitOptions {
|
|
2
|
+
token?: string;
|
|
3
|
+
after?: string;
|
|
4
|
+
timeoutSeconds?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface AgentLogin {
|
|
7
|
+
userCode: string;
|
|
8
|
+
verificationUrl: string;
|
|
9
|
+
deviceCode: string;
|
|
10
|
+
expiresAt: string;
|
|
11
|
+
interval: number;
|
|
12
|
+
instructions: string;
|
|
13
|
+
}
|
|
14
|
+
export type AgentToken = {
|
|
15
|
+
status: 'pending';
|
|
16
|
+
interval: number;
|
|
17
|
+
} | {
|
|
18
|
+
status: 'approved';
|
|
19
|
+
apiKey: string;
|
|
20
|
+
mcp: {
|
|
21
|
+
url: string;
|
|
22
|
+
header: string;
|
|
23
|
+
};
|
|
24
|
+
next: string;
|
|
25
|
+
};
|
|
26
|
+
export interface AgentTrial {
|
|
27
|
+
trialKey: string;
|
|
28
|
+
expiresAt: string;
|
|
29
|
+
limits: string;
|
|
30
|
+
claim: {
|
|
31
|
+
userCode: string;
|
|
32
|
+
claimUrl: string;
|
|
33
|
+
deviceCode: string;
|
|
34
|
+
humanNotified: boolean;
|
|
35
|
+
};
|
|
36
|
+
instructions: string;
|
|
37
|
+
}
|
|
38
|
+
export interface EmailInbox {
|
|
39
|
+
id: string;
|
|
40
|
+
address: string;
|
|
41
|
+
expiresAt: string | null;
|
|
42
|
+
persistent: boolean;
|
|
43
|
+
status?: 'active' | 'paused';
|
|
44
|
+
forwardingUrl?: string | null;
|
|
45
|
+
managementToken?: string;
|
|
46
|
+
messageCount?: number;
|
|
47
|
+
messageLimit?: number;
|
|
48
|
+
}
|
|
49
|
+
export interface EmailInboxSettings {
|
|
50
|
+
activeDays?: number | undefined;
|
|
51
|
+
localPart?: string | undefined;
|
|
52
|
+
}
|
|
53
|
+
export interface SocketEventSource {
|
|
54
|
+
kind: 'webhook' | 'email' | 'approval' | 'job' | 'sms';
|
|
55
|
+
id: string;
|
|
56
|
+
token?: string;
|
|
57
|
+
after?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface SocketEvent {
|
|
60
|
+
kind: SocketEventSource['kind'];
|
|
61
|
+
id: string;
|
|
62
|
+
cursor: string;
|
|
63
|
+
requests?: import('./index.js').CapturedRequest[];
|
|
64
|
+
messages?: EmailMessage[];
|
|
65
|
+
approval?: Approval;
|
|
66
|
+
deliveries?: {
|
|
67
|
+
id: string;
|
|
68
|
+
at: string;
|
|
69
|
+
deliveryId: string;
|
|
70
|
+
attempt: number;
|
|
71
|
+
status: number | null;
|
|
72
|
+
error?: string;
|
|
73
|
+
}[];
|
|
74
|
+
}
|
|
75
|
+
export interface EmailMessage {
|
|
76
|
+
id: string;
|
|
77
|
+
receivedAt: string;
|
|
78
|
+
from: string;
|
|
79
|
+
mailFrom?: string;
|
|
80
|
+
to: string;
|
|
81
|
+
cc?: string[];
|
|
82
|
+
subject: string;
|
|
83
|
+
text: string;
|
|
84
|
+
html?: string;
|
|
85
|
+
codes: string[];
|
|
86
|
+
links: {
|
|
87
|
+
url: string;
|
|
88
|
+
kind: 'verification' | 'other';
|
|
89
|
+
}[];
|
|
90
|
+
attachments: {
|
|
91
|
+
id?: string;
|
|
92
|
+
filename: string;
|
|
93
|
+
mimeType: string;
|
|
94
|
+
size: number;
|
|
95
|
+
}[];
|
|
96
|
+
direction?: 'inbound' | 'outbound';
|
|
97
|
+
deliveryStatus?: 'pending' | 'sent';
|
|
98
|
+
messageId?: string;
|
|
99
|
+
inReplyTo?: string;
|
|
100
|
+
references?: string[];
|
|
101
|
+
}
|
|
102
|
+
export interface EmailContent {
|
|
103
|
+
to: string[];
|
|
104
|
+
cc?: string[];
|
|
105
|
+
subject: string;
|
|
106
|
+
text?: string | undefined;
|
|
107
|
+
html?: string | undefined;
|
|
108
|
+
replyTo?: string | undefined;
|
|
109
|
+
}
|
|
110
|
+
export interface SendEmailInput extends EmailContent {
|
|
111
|
+
idempotencyKey: string;
|
|
112
|
+
}
|
|
113
|
+
export interface EmailThreadSummary {
|
|
114
|
+
id: string;
|
|
115
|
+
inboxId: string;
|
|
116
|
+
subject: string;
|
|
117
|
+
lastAt: string;
|
|
118
|
+
from: string;
|
|
119
|
+
messageCount: number;
|
|
120
|
+
}
|
|
121
|
+
export interface EmailThread extends EmailThreadSummary {
|
|
122
|
+
messages: EmailMessage[];
|
|
123
|
+
}
|
|
124
|
+
export interface EmailThreadsPage {
|
|
125
|
+
threads: EmailThreadSummary[];
|
|
126
|
+
nextCursor: string | null;
|
|
127
|
+
}
|
|
128
|
+
export interface EmailDraft {
|
|
129
|
+
id: string;
|
|
130
|
+
inboxId: string;
|
|
131
|
+
subject: string;
|
|
132
|
+
status: 'draft' | 'awaitingApproval' | 'scheduled' | 'completed' | 'failed' | 'rejected' | 'expired';
|
|
133
|
+
sendAt: string | null;
|
|
134
|
+
expiresAt: string;
|
|
135
|
+
approvalId?: string;
|
|
136
|
+
approvalExpiresAt?: string;
|
|
137
|
+
answerUrl?: string;
|
|
138
|
+
events: {
|
|
139
|
+
id: string;
|
|
140
|
+
at: string;
|
|
141
|
+
attempt: number;
|
|
142
|
+
status: number | null;
|
|
143
|
+
error?: string;
|
|
144
|
+
}[];
|
|
145
|
+
}
|
|
146
|
+
export interface EmailRules {
|
|
147
|
+
requireApproval: boolean;
|
|
148
|
+
inboundAllow: string[];
|
|
149
|
+
inboundBlock: string[];
|
|
150
|
+
outboundAllow: string[];
|
|
151
|
+
outboundBlock: string[];
|
|
152
|
+
}
|
|
153
|
+
export interface MemoryEntry<T = unknown> {
|
|
154
|
+
namespace: string;
|
|
155
|
+
key: string;
|
|
156
|
+
value: T;
|
|
157
|
+
bytes: number;
|
|
158
|
+
expiresAt?: string;
|
|
159
|
+
}
|
|
160
|
+
export interface MonitorInput {
|
|
161
|
+
kind: 'http' | 'ssl' | 'heartbeat' | 'dns';
|
|
162
|
+
name: string;
|
|
163
|
+
target?: string;
|
|
164
|
+
intervalSeconds?: number;
|
|
165
|
+
graceSeconds?: number;
|
|
166
|
+
expectStatus?: number;
|
|
167
|
+
expectText?: string;
|
|
168
|
+
sslDays?: number;
|
|
169
|
+
dnsRecordType?: 'A' | 'AAAA' | 'CNAME' | 'MX' | 'TXT' | 'NS' | 'CAA';
|
|
170
|
+
alertWebhook?: string;
|
|
171
|
+
}
|
|
172
|
+
export interface Monitor extends MonitorInput {
|
|
173
|
+
id: string;
|
|
174
|
+
status: 'pending' | 'up' | 'down';
|
|
175
|
+
paused: boolean;
|
|
176
|
+
failures: number;
|
|
177
|
+
createdAt: string;
|
|
178
|
+
nextRunAt: string;
|
|
179
|
+
lastCheckAt?: string;
|
|
180
|
+
lastPingAt?: string;
|
|
181
|
+
lastMessage?: string;
|
|
182
|
+
lastDurationMs?: number;
|
|
183
|
+
recentChecks?: {
|
|
184
|
+
at: string;
|
|
185
|
+
status: string;
|
|
186
|
+
durationMs: number;
|
|
187
|
+
}[];
|
|
188
|
+
dnsBaseline?: string[];
|
|
189
|
+
lastDnsAnswers?: string[];
|
|
190
|
+
pingUrl?: string;
|
|
191
|
+
events?: {
|
|
192
|
+
at: string;
|
|
193
|
+
status: string;
|
|
194
|
+
message: string;
|
|
195
|
+
}[];
|
|
196
|
+
}
|
|
197
|
+
export interface ApprovalInput {
|
|
198
|
+
question: string;
|
|
199
|
+
details?: string;
|
|
200
|
+
options?: string[];
|
|
201
|
+
timeoutMinutes?: number;
|
|
202
|
+
}
|
|
203
|
+
export interface Approval {
|
|
204
|
+
id: string;
|
|
205
|
+
agentName: string;
|
|
206
|
+
question: string;
|
|
207
|
+
details?: string;
|
|
208
|
+
options: string[];
|
|
209
|
+
status: 'pending' | 'answered' | 'expired';
|
|
210
|
+
answer?: string;
|
|
211
|
+
note?: string;
|
|
212
|
+
createdAt: string;
|
|
213
|
+
expiresAt: string;
|
|
214
|
+
answeredAt?: string;
|
|
215
|
+
answerUrl: string;
|
|
216
|
+
emailed?: boolean;
|
|
217
|
+
next?: string;
|
|
218
|
+
}
|
|
219
|
+
export interface Authenticator {
|
|
220
|
+
id: string;
|
|
221
|
+
name: string;
|
|
222
|
+
issuer: string;
|
|
223
|
+
accountName: string;
|
|
224
|
+
algorithm: 'SHA1' | 'SHA256' | 'SHA512';
|
|
225
|
+
digits: 6 | 7 | 8;
|
|
226
|
+
period: 30 | 60;
|
|
227
|
+
createdAt: string;
|
|
228
|
+
}
|
|
229
|
+
export interface AuthenticatorInput {
|
|
230
|
+
name: string;
|
|
231
|
+
uri?: string;
|
|
232
|
+
secret?: string;
|
|
233
|
+
imageBase64?: string;
|
|
234
|
+
algorithm?: 'SHA1' | 'SHA256' | 'SHA512';
|
|
235
|
+
digits?: 6 | 7 | 8;
|
|
236
|
+
period?: 30 | 60;
|
|
237
|
+
}
|
|
238
|
+
export interface TotpCode {
|
|
239
|
+
id: string;
|
|
240
|
+
code: string;
|
|
241
|
+
secondsRemaining: number;
|
|
242
|
+
expiresAt: string;
|
|
243
|
+
nextCode?: string;
|
|
244
|
+
}
|
|
245
|
+
export interface EmailAttachmentLink {
|
|
246
|
+
filename: string;
|
|
247
|
+
size: number;
|
|
248
|
+
expiresAt: string;
|
|
249
|
+
downloadUrl: string;
|
|
250
|
+
}
|
|
251
|
+
export type OAuthScenario = 'none' | 'access_denied' | 'invalid_grant' | 'expired_code' | 'wrong_redirect_uri' | 'invalid_pkce_verifier' | 'expired_tokens' | 'slow_token_endpoint' | 'rotated_signing_key';
|
|
252
|
+
export interface OAuthProviderInput {
|
|
253
|
+
name: string;
|
|
254
|
+
redirectUris: string[];
|
|
255
|
+
users: {
|
|
256
|
+
sub: string;
|
|
257
|
+
email: string;
|
|
258
|
+
name: string;
|
|
259
|
+
claims?: Record<string, unknown>;
|
|
260
|
+
}[];
|
|
261
|
+
claims?: Record<string, unknown>;
|
|
262
|
+
headless?: boolean;
|
|
263
|
+
scenario?: OAuthScenario;
|
|
264
|
+
}
|
|
265
|
+
export interface OAuthProvider {
|
|
266
|
+
id: string;
|
|
267
|
+
issuer: string;
|
|
268
|
+
endpointUrl: string;
|
|
269
|
+
discoveryUrl: string;
|
|
270
|
+
client_id: string;
|
|
271
|
+
expiresAt: string;
|
|
272
|
+
oauth: OAuthProviderInput;
|
|
273
|
+
}
|
|
274
|
+
export interface CreatedOAuthProvider extends OAuthProvider {
|
|
275
|
+
client_secret: string;
|
|
276
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kivel.io/sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.6.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"import": "./dist/index.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist/**/*.js",
|
|
13
|
+
"dist/**/*.d.ts",
|
|
14
|
+
"CHANGELOG.md"
|
|
15
|
+
],
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"typescript": "^7.0.2",
|
|
18
|
+
"@types/node": "^26.6.5"
|
|
19
|
+
},
|
|
20
|
+
"description": "TypeScript client for Kivel: agent login, webhooks, email, memory, monitors and approvals.",
|
|
21
|
+
"license": "Apache-2.0",
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=22.13.0"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://kivel.io/docs/sdk/",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/TangoBeee/kivel.git",
|
|
29
|
+
"directory": "packages/sdk"
|
|
30
|
+
},
|
|
31
|
+
"bugs": {
|
|
32
|
+
"email": "support@kivel.io"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public",
|
|
36
|
+
"registry": "https://registry.npmjs.org/",
|
|
37
|
+
"tag": "beta"
|
|
38
|
+
},
|
|
39
|
+
"main": "./dist/index.js",
|
|
40
|
+
"types": "./dist/index.d.ts",
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "node -e \"require('node:fs').rmSync('dist', {recursive:true,force:true})\" && tsc -p tsconfig.json",
|
|
43
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
44
|
+
}
|
|
6
45
|
}
|