@inkbox/sdk 0.2.0 → 0.2.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/README.md +3 -47
- package/dist/agent_identity.d.ts +54 -68
- package/dist/agent_identity.d.ts.map +1 -1
- package/dist/agent_identity.js +77 -109
- package/dist/agent_identity.js.map +1 -1
- package/dist/credentials.d.ts +11 -0
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +17 -0
- package/dist/credentials.js.map +1 -1
- package/dist/identities/resources/identities.d.ts +0 -15
- package/dist/identities/resources/identities.d.ts.map +1 -1
- package/dist/identities/resources/identities.js +0 -18
- package/dist/identities/resources/identities.js.map +1 -1
- package/dist/identities/types.d.ts +0 -21
- package/dist/identities/types.d.ts.map +1 -1
- package/dist/identities/types.js +0 -11
- package/dist/identities/types.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/inkbox.d.ts +17 -6
- package/dist/inkbox.d.ts.map +1 -1
- package/dist/inkbox.js +25 -9
- package/dist/inkbox.js.map +1 -1
- package/dist/vault/crypto.d.ts +6 -4
- package/dist/vault/crypto.d.ts.map +1 -1
- package/dist/vault/crypto.js +22 -14
- package/dist/vault/crypto.js.map +1 -1
- package/dist/vault/resources/vault.d.ts +35 -1
- package/dist/vault/resources/vault.d.ts.map +1 -1
- package/dist/vault/resources/vault.js +113 -8
- package/dist/vault/resources/vault.js.map +1 -1
- package/dist/vault/totp.d.ts +73 -0
- package/dist/vault/totp.d.ts.map +1 -0
- package/dist/vault/totp.js +230 -0
- package/dist/vault/totp.js.map +1 -0
- package/dist/vault/types.d.ts +3 -0
- package/dist/vault/types.d.ts.map +1 -1
- package/dist/vault/types.js +4 -0
- package/dist/vault/types.js.map +1 -1
- package/package.json +2 -1
- package/dist/authenticator/resources/accounts.d.ts +0 -70
- package/dist/authenticator/resources/accounts.d.ts.map +0 -1
- package/dist/authenticator/resources/accounts.js +0 -91
- package/dist/authenticator/resources/accounts.js.map +0 -1
- package/dist/authenticator/resources/apps.d.ts +0 -38
- package/dist/authenticator/resources/apps.d.ts.map +0 -1
- package/dist/authenticator/resources/apps.js +0 -52
- package/dist/authenticator/resources/apps.js.map +0 -1
- package/dist/authenticator/types.d.ts +0 -83
- package/dist/authenticator/types.d.ts.map +0 -1
- package/dist/authenticator/types.js +0 -43
- package/dist/authenticator/types.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @inkbox/sdk
|
|
2
2
|
|
|
3
|
-
TypeScript SDK for the [Inkbox API](https://inkbox.ai/docs) — API-first communication infrastructure for AI agents (email, phone,
|
|
3
|
+
TypeScript SDK for the [Inkbox API](https://inkbox.ai/docs) — API-first communication infrastructure for AI agents (email, phone, identities, encrypted vault — login credentials, API keys, key pairs, SSH keys, OTP, etc.).
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -19,10 +19,10 @@ You'll need an API key to use this SDK. Get one at [console.inkbox.ai](https://c
|
|
|
19
19
|
```ts
|
|
20
20
|
import { Inkbox } from "@inkbox/sdk";
|
|
21
21
|
|
|
22
|
-
const inkbox = new Inkbox({
|
|
22
|
+
const inkbox = await new Inkbox({
|
|
23
23
|
apiKey: process.env.INKBOX_API_KEY!,
|
|
24
24
|
vaultKey: process.env.INKBOX_VAULT_KEY,
|
|
25
|
-
});
|
|
25
|
+
}).ready();
|
|
26
26
|
|
|
27
27
|
// Create an agent identity
|
|
28
28
|
const identity = await inkbox.createIdentity("support-bot");
|
|
@@ -215,46 +215,6 @@ for (const t of hits) {
|
|
|
215
215
|
|
|
216
216
|
---
|
|
217
217
|
|
|
218
|
-
## Authenticator
|
|
219
|
-
|
|
220
|
-
```ts
|
|
221
|
-
// Create an authenticator app and link it to an identity
|
|
222
|
-
const app = await identity.createAuthenticatorApp();
|
|
223
|
-
|
|
224
|
-
// Add an OTP account from an otpauth:// URI
|
|
225
|
-
const account = await identity.createAuthenticatorAccount({
|
|
226
|
-
otpauthUri: "otpauth://totp/Example:user@example.com?secret=EXAMPLESECRET&issuer=Example",
|
|
227
|
-
displayName: "My OTP Account", // optional (max 255 chars)
|
|
228
|
-
description: "Login MFA for Example", // optional
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
// List all accounts in this identity's authenticator app
|
|
232
|
-
const accounts = await identity.listAuthenticatorAccounts();
|
|
233
|
-
|
|
234
|
-
// Get a single account
|
|
235
|
-
const acct = await identity.getAuthenticatorAccount("account-uuid");
|
|
236
|
-
|
|
237
|
-
// Update account metadata (pass null to clear a field)
|
|
238
|
-
await identity.updateAuthenticatorAccount("account-uuid", { displayName: "New Label" });
|
|
239
|
-
|
|
240
|
-
// Generate an OTP code
|
|
241
|
-
const otp = await identity.generateOtp("account-uuid");
|
|
242
|
-
console.log(otp.otpCode); // e.g. "482901"
|
|
243
|
-
console.log(otp.validForSeconds); // seconds until expiry (null for HOTP)
|
|
244
|
-
console.log(otp.otpType); // "totp" or "hotp"
|
|
245
|
-
|
|
246
|
-
// Delete an account
|
|
247
|
-
await identity.deleteAuthenticatorAccount("account-uuid");
|
|
248
|
-
|
|
249
|
-
// Unlink authenticator app from identity
|
|
250
|
-
await identity.unlinkAuthenticatorApp();
|
|
251
|
-
|
|
252
|
-
// Delete the authenticator app (org-level)
|
|
253
|
-
await inkbox.authenticatorApps.delete("app-uuid");
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
---
|
|
257
|
-
|
|
258
218
|
## Credentials
|
|
259
219
|
|
|
260
220
|
Access credentials stored in the vault through the agent-facing `credentials` surface. The vault must be unlocked first.
|
|
@@ -431,10 +391,6 @@ Runnable example scripts are available in the [examples/typescript](https://gith
|
|
|
431
391
|
| `read-agent-calls.ts` | List calls and print transcripts |
|
|
432
392
|
| `receive-agent-email-webhook.ts` | Register and delete a mailbox webhook |
|
|
433
393
|
| `receive-agent-call-webhook.ts` | Register, update, and delete a phone webhook |
|
|
434
|
-
| `agent-authenticator-app-e2e.ts` | Full authenticator app lifecycle (create, OTP, cleanup) |
|
|
435
|
-
| `create-authenticator.ts` | Create an authenticator app and add an OTP account |
|
|
436
|
-
| `generate-otp.ts` | Generate an OTP code for an account |
|
|
437
|
-
| `list-authenticator-accounts.ts` | List authenticator accounts for an identity |
|
|
438
394
|
|
|
439
395
|
## License
|
|
440
396
|
|
package/dist/agent_identity.d.ts
CHANGED
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
* identity's assigned channels so callers never need to pass an email
|
|
9
9
|
* address or phone number ID explicitly.
|
|
10
10
|
*/
|
|
11
|
-
import type { AuthenticatorAccount, AuthenticatorApp, OTPCode } from "./authenticator/types.js";
|
|
12
11
|
import { Credentials } from "./credentials.js";
|
|
12
|
+
import type { TOTPCode, TOTPConfig } from "./vault/totp.js";
|
|
13
|
+
import type { DecryptedVaultSecret, SecretPayload, VaultSecret } from "./vault/types.js";
|
|
13
14
|
import { MessageDirection } from "./mail/types.js";
|
|
14
15
|
import type { Message, MessageDetail, ThreadDetail } from "./mail/types.js";
|
|
15
16
|
import type { PhoneCall, PhoneCallWithRateLimit, PhoneTranscript } from "./phone/types.js";
|
|
16
|
-
import type { _AgentIdentityData,
|
|
17
|
+
import type { _AgentIdentityData, IdentityMailbox, IdentityPhoneNumber } from "./identities/types.js";
|
|
17
18
|
import type { Inkbox } from "./inkbox.js";
|
|
18
19
|
export declare class AgentIdentity {
|
|
19
20
|
private _data;
|
|
20
21
|
private readonly _inkbox;
|
|
21
22
|
private _mailbox;
|
|
22
23
|
private _phoneNumber;
|
|
23
|
-
private _authenticatorApp;
|
|
24
24
|
private _credentials;
|
|
25
25
|
private _credentialsVaultRef;
|
|
26
26
|
constructor(data: _AgentIdentityData, inkbox: Inkbox);
|
|
@@ -31,8 +31,6 @@ export declare class AgentIdentity {
|
|
|
31
31
|
get mailbox(): IdentityMailbox | null;
|
|
32
32
|
/** The phone number currently assigned to this identity, or `null` if none. */
|
|
33
33
|
get phoneNumber(): IdentityPhoneNumber | null;
|
|
34
|
-
/** The authenticator app currently assigned to this identity, or `null` if none. */
|
|
35
|
-
get authenticatorApp(): IdentityAuthenticatorApp | null;
|
|
36
34
|
/**
|
|
37
35
|
* Identity-scoped credential access.
|
|
38
36
|
*
|
|
@@ -56,6 +54,57 @@ export declare class AgentIdentity {
|
|
|
56
54
|
* @param secretId - UUID of the secret to revoke access from.
|
|
57
55
|
*/
|
|
58
56
|
revokeCredentialAccess(secretId: string): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Create a vault secret and grant this identity access to it.
|
|
59
|
+
*
|
|
60
|
+
* The vault must be unlocked first.
|
|
61
|
+
*
|
|
62
|
+
* @param options.name - Display name (max 255 characters).
|
|
63
|
+
* @param options.payload - The secret payload.
|
|
64
|
+
* @param options.description - Optional description.
|
|
65
|
+
* @returns {@link VaultSecret} metadata.
|
|
66
|
+
*/
|
|
67
|
+
createSecret(options: {
|
|
68
|
+
name: string;
|
|
69
|
+
payload: SecretPayload;
|
|
70
|
+
description?: string;
|
|
71
|
+
}): Promise<VaultSecret>;
|
|
72
|
+
/**
|
|
73
|
+
* Fetch and decrypt a vault secret this identity has access to.
|
|
74
|
+
*
|
|
75
|
+
* @param secretId - UUID of the secret.
|
|
76
|
+
*/
|
|
77
|
+
getSecret(secretId: string): Promise<DecryptedVaultSecret>;
|
|
78
|
+
/**
|
|
79
|
+
* Add or replace TOTP on a login secret this identity has access to.
|
|
80
|
+
*
|
|
81
|
+
* @param secretId - UUID of the login secret.
|
|
82
|
+
* @param totp - A {@link TOTPConfig} or an `otpauth://totp/...` URI string.
|
|
83
|
+
* @returns Updated {@link VaultSecret} metadata.
|
|
84
|
+
*/
|
|
85
|
+
setTotp(secretId: string, totp: TOTPConfig | string): Promise<VaultSecret>;
|
|
86
|
+
/**
|
|
87
|
+
* Remove TOTP from a login secret this identity has access to.
|
|
88
|
+
*
|
|
89
|
+
* @param secretId - UUID of the login secret.
|
|
90
|
+
* @returns Updated {@link VaultSecret} metadata.
|
|
91
|
+
*/
|
|
92
|
+
removeTotp(secretId: string): Promise<VaultSecret>;
|
|
93
|
+
/**
|
|
94
|
+
* Generate the current TOTP code for a login secret.
|
|
95
|
+
*
|
|
96
|
+
* Uses cached credentials if available, otherwise fetches fresh.
|
|
97
|
+
*
|
|
98
|
+
* @param secretId - UUID of the login secret.
|
|
99
|
+
* @returns A {@link TOTPCode}.
|
|
100
|
+
*/
|
|
101
|
+
getTotpCode(secretId: string): Promise<TOTPCode>;
|
|
102
|
+
/**
|
|
103
|
+
* Delete a vault secret.
|
|
104
|
+
*
|
|
105
|
+
* @param secretId - UUID of the secret to delete.
|
|
106
|
+
*/
|
|
107
|
+
deleteSecret(secretId: string): Promise<void>;
|
|
59
108
|
/**
|
|
60
109
|
* Create a new mailbox and link it to this identity.
|
|
61
110
|
*
|
|
@@ -100,24 +149,6 @@ export declare class AgentIdentity {
|
|
|
100
149
|
* Unlink this identity's phone number (does not release the number).
|
|
101
150
|
*/
|
|
102
151
|
unlinkPhoneNumber(): Promise<void>;
|
|
103
|
-
/**
|
|
104
|
-
* Create a new authenticator app and link it to this identity.
|
|
105
|
-
*
|
|
106
|
-
* @returns The newly created {@link AuthenticatorApp}.
|
|
107
|
-
*/
|
|
108
|
-
createAuthenticatorApp(): Promise<AuthenticatorApp>;
|
|
109
|
-
/**
|
|
110
|
-
* Link an existing authenticator app to this identity.
|
|
111
|
-
*
|
|
112
|
-
* @param authenticatorAppId - UUID of the authenticator app to link. Obtain via
|
|
113
|
-
* `inkbox.authenticatorApps.list()` or `inkbox.authenticatorApps.get()`.
|
|
114
|
-
* @returns The linked {@link IdentityAuthenticatorApp}.
|
|
115
|
-
*/
|
|
116
|
-
assignAuthenticatorApp(authenticatorAppId: string): Promise<IdentityAuthenticatorApp>;
|
|
117
|
-
/**
|
|
118
|
-
* Unlink this identity's authenticator app (does not delete the app).
|
|
119
|
-
*/
|
|
120
|
-
unlinkAuthenticatorApp(): Promise<void>;
|
|
121
152
|
/**
|
|
122
153
|
* Send an email from this identity's mailbox.
|
|
123
154
|
*
|
|
@@ -214,50 +245,6 @@ export declare class AgentIdentity {
|
|
|
214
245
|
* @param callId - ID of the call to fetch transcripts for.
|
|
215
246
|
*/
|
|
216
247
|
listTranscripts(callId: string): Promise<PhoneTranscript[]>;
|
|
217
|
-
/**
|
|
218
|
-
* Create a new authenticator account from an `otpauth://` URI.
|
|
219
|
-
*
|
|
220
|
-
* @param options.otpauthUri - `otpauth://totp/...` or `otpauth://hotp/...` URI.
|
|
221
|
-
* @param options.displayName - Optional user-managed label (max 255 characters).
|
|
222
|
-
* @param options.description - Optional free-form notes.
|
|
223
|
-
*/
|
|
224
|
-
createAuthenticatorAccount(options: {
|
|
225
|
-
otpauthUri: string;
|
|
226
|
-
displayName?: string;
|
|
227
|
-
description?: string;
|
|
228
|
-
}): Promise<AuthenticatorAccount>;
|
|
229
|
-
/** List all authenticator accounts in this identity's app. */
|
|
230
|
-
listAuthenticatorAccounts(): Promise<AuthenticatorAccount[]>;
|
|
231
|
-
/**
|
|
232
|
-
* Get a single authenticator account by ID.
|
|
233
|
-
*
|
|
234
|
-
* @param accountId - UUID of the authenticator account.
|
|
235
|
-
*/
|
|
236
|
-
getAuthenticatorAccount(accountId: string): Promise<AuthenticatorAccount>;
|
|
237
|
-
/**
|
|
238
|
-
* Update user-managed metadata on an authenticator account.
|
|
239
|
-
*
|
|
240
|
-
* @param accountId - UUID of the authenticator account to update.
|
|
241
|
-
* @param options.displayName - New label (max 255 characters).
|
|
242
|
-
* @param options.description - New notes.
|
|
243
|
-
*/
|
|
244
|
-
updateAuthenticatorAccount(accountId: string, options: {
|
|
245
|
-
displayName?: string | null;
|
|
246
|
-
description?: string | null;
|
|
247
|
-
}): Promise<AuthenticatorAccount>;
|
|
248
|
-
/**
|
|
249
|
-
* Delete an authenticator account.
|
|
250
|
-
*
|
|
251
|
-
* @param accountId - UUID of the authenticator account to delete.
|
|
252
|
-
*/
|
|
253
|
-
deleteAuthenticatorAccount(accountId: string): Promise<void>;
|
|
254
|
-
/**
|
|
255
|
-
* Generate the current OTP code for an authenticator account.
|
|
256
|
-
*
|
|
257
|
-
* @param accountId - UUID of the authenticator account.
|
|
258
|
-
* @returns The generated OTP code with metadata.
|
|
259
|
-
*/
|
|
260
|
-
generateOtp(accountId: string): Promise<OTPCode>;
|
|
261
248
|
/**
|
|
262
249
|
* Update this identity's handle or status.
|
|
263
250
|
*
|
|
@@ -283,6 +270,5 @@ export declare class AgentIdentity {
|
|
|
283
270
|
private _requireVaultUnlocked;
|
|
284
271
|
private _requireMailbox;
|
|
285
272
|
private _requirePhone;
|
|
286
|
-
private _requireAuthenticatorApp;
|
|
287
273
|
}
|
|
288
274
|
//# sourceMappingURL=agent_identity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent_identity.d.ts","sourceRoot":"","sources":["../src/agent_identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"agent_identity.d.ts","sourceRoot":"","sources":["../src/agent_identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,KAAK,EAEV,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACpB,MAAM,uBAAuB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AC,IAAI,CAAC;IAQ7B,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,aAAa;CAQtB"}
|
package/dist/agent_identity.js
CHANGED
|
@@ -15,7 +15,6 @@ export class AgentIdentity {
|
|
|
15
15
|
_inkbox;
|
|
16
16
|
_mailbox;
|
|
17
17
|
_phoneNumber;
|
|
18
|
-
_authenticatorApp;
|
|
19
18
|
_credentials = null;
|
|
20
19
|
_credentialsVaultRef = null; // tracks which _unlocked built the cache
|
|
21
20
|
constructor(data, inkbox) {
|
|
@@ -23,7 +22,6 @@ export class AgentIdentity {
|
|
|
23
22
|
this._inkbox = inkbox;
|
|
24
23
|
this._mailbox = data.mailbox;
|
|
25
24
|
this._phoneNumber = data.phoneNumber;
|
|
26
|
-
this._authenticatorApp = data.authenticatorApp;
|
|
27
25
|
}
|
|
28
26
|
// ------------------------------------------------------------------
|
|
29
27
|
// Identity properties
|
|
@@ -35,8 +33,6 @@ export class AgentIdentity {
|
|
|
35
33
|
get mailbox() { return this._mailbox; }
|
|
36
34
|
/** The phone number currently assigned to this identity, or `null` if none. */
|
|
37
35
|
get phoneNumber() { return this._phoneNumber; }
|
|
38
|
-
/** The authenticator app currently assigned to this identity, or `null` if none. */
|
|
39
|
-
get authenticatorApp() { return this._authenticatorApp; }
|
|
40
36
|
/**
|
|
41
37
|
* Identity-scoped credential access.
|
|
42
38
|
*
|
|
@@ -89,6 +85,83 @@ export class AgentIdentity {
|
|
|
89
85
|
this._credentials = null;
|
|
90
86
|
}
|
|
91
87
|
// ------------------------------------------------------------------
|
|
88
|
+
// Vault secret management
|
|
89
|
+
// ------------------------------------------------------------------
|
|
90
|
+
/**
|
|
91
|
+
* Create a vault secret and grant this identity access to it.
|
|
92
|
+
*
|
|
93
|
+
* The vault must be unlocked first.
|
|
94
|
+
*
|
|
95
|
+
* @param options.name - Display name (max 255 characters).
|
|
96
|
+
* @param options.payload - The secret payload.
|
|
97
|
+
* @param options.description - Optional description.
|
|
98
|
+
* @returns {@link VaultSecret} metadata.
|
|
99
|
+
*/
|
|
100
|
+
async createSecret(options) {
|
|
101
|
+
this._requireVaultUnlocked();
|
|
102
|
+
const unlocked = this._inkbox._vaultResource._unlocked;
|
|
103
|
+
const secret = await unlocked.createSecret(options);
|
|
104
|
+
await this._inkbox._vaultResource.grantAccess(secret.id, this.id);
|
|
105
|
+
this._credentials = null;
|
|
106
|
+
return secret;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Fetch and decrypt a vault secret this identity has access to.
|
|
110
|
+
*
|
|
111
|
+
* @param secretId - UUID of the secret.
|
|
112
|
+
*/
|
|
113
|
+
async getSecret(secretId) {
|
|
114
|
+
this._requireVaultUnlocked();
|
|
115
|
+
return this._inkbox._vaultResource._unlocked.getSecret(secretId);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Add or replace TOTP on a login secret this identity has access to.
|
|
119
|
+
*
|
|
120
|
+
* @param secretId - UUID of the login secret.
|
|
121
|
+
* @param totp - A {@link TOTPConfig} or an `otpauth://totp/...` URI string.
|
|
122
|
+
* @returns Updated {@link VaultSecret} metadata.
|
|
123
|
+
*/
|
|
124
|
+
async setTotp(secretId, totp) {
|
|
125
|
+
this._requireVaultUnlocked();
|
|
126
|
+
const result = await this._inkbox._vaultResource._unlocked.setTotp(secretId, totp);
|
|
127
|
+
this._credentials = null;
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Remove TOTP from a login secret this identity has access to.
|
|
132
|
+
*
|
|
133
|
+
* @param secretId - UUID of the login secret.
|
|
134
|
+
* @returns Updated {@link VaultSecret} metadata.
|
|
135
|
+
*/
|
|
136
|
+
async removeTotp(secretId) {
|
|
137
|
+
this._requireVaultUnlocked();
|
|
138
|
+
const result = await this._inkbox._vaultResource._unlocked.removeTotp(secretId);
|
|
139
|
+
this._credentials = null;
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Generate the current TOTP code for a login secret.
|
|
144
|
+
*
|
|
145
|
+
* Uses cached credentials if available, otherwise fetches fresh.
|
|
146
|
+
*
|
|
147
|
+
* @param secretId - UUID of the login secret.
|
|
148
|
+
* @returns A {@link TOTPCode}.
|
|
149
|
+
*/
|
|
150
|
+
async getTotpCode(secretId) {
|
|
151
|
+
this._requireVaultUnlocked();
|
|
152
|
+
return this._inkbox._vaultResource._unlocked.getTotpCode(secretId);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Delete a vault secret.
|
|
156
|
+
*
|
|
157
|
+
* @param secretId - UUID of the secret to delete.
|
|
158
|
+
*/
|
|
159
|
+
async deleteSecret(secretId) {
|
|
160
|
+
this._requireVaultUnlocked();
|
|
161
|
+
await this._inkbox._vaultResource._unlocked.deleteSecret(secretId);
|
|
162
|
+
this._credentials = null;
|
|
163
|
+
}
|
|
164
|
+
// ------------------------------------------------------------------
|
|
92
165
|
// Channel management
|
|
93
166
|
// ------------------------------------------------------------------
|
|
94
167
|
/**
|
|
@@ -173,46 +246,6 @@ export class AgentIdentity {
|
|
|
173
246
|
await this._inkbox._idsResource.unlinkPhoneNumber(this.agentHandle);
|
|
174
247
|
this._phoneNumber = null;
|
|
175
248
|
}
|
|
176
|
-
/**
|
|
177
|
-
* Create a new authenticator app and link it to this identity.
|
|
178
|
-
*
|
|
179
|
-
* @returns The newly created {@link AuthenticatorApp}.
|
|
180
|
-
*/
|
|
181
|
-
async createAuthenticatorApp() {
|
|
182
|
-
const app = await this._inkbox._authApps.create({ agentHandle: this.agentHandle });
|
|
183
|
-
this._authenticatorApp = {
|
|
184
|
-
id: app.id,
|
|
185
|
-
organizationId: app.organizationId,
|
|
186
|
-
identityId: app.identityId,
|
|
187
|
-
status: app.status,
|
|
188
|
-
createdAt: app.createdAt,
|
|
189
|
-
updatedAt: app.updatedAt,
|
|
190
|
-
};
|
|
191
|
-
return app;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Link an existing authenticator app to this identity.
|
|
195
|
-
*
|
|
196
|
-
* @param authenticatorAppId - UUID of the authenticator app to link. Obtain via
|
|
197
|
-
* `inkbox.authenticatorApps.list()` or `inkbox.authenticatorApps.get()`.
|
|
198
|
-
* @returns The linked {@link IdentityAuthenticatorApp}.
|
|
199
|
-
*/
|
|
200
|
-
async assignAuthenticatorApp(authenticatorAppId) {
|
|
201
|
-
const data = await this._inkbox._idsResource.assignAuthenticatorApp(this.agentHandle, {
|
|
202
|
-
authenticatorAppId,
|
|
203
|
-
});
|
|
204
|
-
this._authenticatorApp = data.authenticatorApp;
|
|
205
|
-
this._data = data;
|
|
206
|
-
return this._authenticatorApp;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Unlink this identity's authenticator app (does not delete the app).
|
|
210
|
-
*/
|
|
211
|
-
async unlinkAuthenticatorApp() {
|
|
212
|
-
this._requireAuthenticatorApp();
|
|
213
|
-
await this._inkbox._idsResource.unlinkAuthenticatorApp(this.agentHandle);
|
|
214
|
-
this._authenticatorApp = null;
|
|
215
|
-
}
|
|
216
249
|
// ------------------------------------------------------------------
|
|
217
250
|
// Mail helpers
|
|
218
251
|
// ------------------------------------------------------------------
|
|
@@ -326,64 +359,6 @@ export class AgentIdentity {
|
|
|
326
359
|
return this._inkbox._transcripts.list(this._phoneNumber.id, callId);
|
|
327
360
|
}
|
|
328
361
|
// ------------------------------------------------------------------
|
|
329
|
-
// Authenticator helpers
|
|
330
|
-
// ------------------------------------------------------------------
|
|
331
|
-
/**
|
|
332
|
-
* Create a new authenticator account from an `otpauth://` URI.
|
|
333
|
-
*
|
|
334
|
-
* @param options.otpauthUri - `otpauth://totp/...` or `otpauth://hotp/...` URI.
|
|
335
|
-
* @param options.displayName - Optional user-managed label (max 255 characters).
|
|
336
|
-
* @param options.description - Optional free-form notes.
|
|
337
|
-
*/
|
|
338
|
-
async createAuthenticatorAccount(options) {
|
|
339
|
-
this._requireAuthenticatorApp();
|
|
340
|
-
return this._inkbox._authAccounts.create(this._authenticatorApp.id, options);
|
|
341
|
-
}
|
|
342
|
-
/** List all authenticator accounts in this identity's app. */
|
|
343
|
-
async listAuthenticatorAccounts() {
|
|
344
|
-
this._requireAuthenticatorApp();
|
|
345
|
-
return this._inkbox._authAccounts.list(this._authenticatorApp.id);
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* Get a single authenticator account by ID.
|
|
349
|
-
*
|
|
350
|
-
* @param accountId - UUID of the authenticator account.
|
|
351
|
-
*/
|
|
352
|
-
async getAuthenticatorAccount(accountId) {
|
|
353
|
-
this._requireAuthenticatorApp();
|
|
354
|
-
return this._inkbox._authAccounts.get(this._authenticatorApp.id, accountId);
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* Update user-managed metadata on an authenticator account.
|
|
358
|
-
*
|
|
359
|
-
* @param accountId - UUID of the authenticator account to update.
|
|
360
|
-
* @param options.displayName - New label (max 255 characters).
|
|
361
|
-
* @param options.description - New notes.
|
|
362
|
-
*/
|
|
363
|
-
async updateAuthenticatorAccount(accountId, options) {
|
|
364
|
-
this._requireAuthenticatorApp();
|
|
365
|
-
return this._inkbox._authAccounts.update(this._authenticatorApp.id, accountId, options);
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* Delete an authenticator account.
|
|
369
|
-
*
|
|
370
|
-
* @param accountId - UUID of the authenticator account to delete.
|
|
371
|
-
*/
|
|
372
|
-
async deleteAuthenticatorAccount(accountId) {
|
|
373
|
-
this._requireAuthenticatorApp();
|
|
374
|
-
await this._inkbox._authAccounts.delete(this._authenticatorApp.id, accountId);
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Generate the current OTP code for an authenticator account.
|
|
378
|
-
*
|
|
379
|
-
* @param accountId - UUID of the authenticator account.
|
|
380
|
-
* @returns The generated OTP code with metadata.
|
|
381
|
-
*/
|
|
382
|
-
async generateOtp(accountId) {
|
|
383
|
-
this._requireAuthenticatorApp();
|
|
384
|
-
return this._inkbox._authAccounts.generateOtp(this._authenticatorApp.id, accountId);
|
|
385
|
-
}
|
|
386
|
-
// ------------------------------------------------------------------
|
|
387
362
|
// Identity management
|
|
388
363
|
// ------------------------------------------------------------------
|
|
389
364
|
/**
|
|
@@ -398,7 +373,6 @@ export class AgentIdentity {
|
|
|
398
373
|
...result,
|
|
399
374
|
mailbox: this._mailbox,
|
|
400
375
|
phoneNumber: this._phoneNumber,
|
|
401
|
-
authenticatorApp: this._authenticatorApp,
|
|
402
376
|
};
|
|
403
377
|
}
|
|
404
378
|
/**
|
|
@@ -415,7 +389,6 @@ export class AgentIdentity {
|
|
|
415
389
|
this._data = data;
|
|
416
390
|
this._mailbox = data.mailbox;
|
|
417
391
|
this._phoneNumber = data.phoneNumber;
|
|
418
|
-
this._authenticatorApp = data.authenticatorApp;
|
|
419
392
|
this._credentials = null;
|
|
420
393
|
return this;
|
|
421
394
|
}
|
|
@@ -441,10 +414,5 @@ export class AgentIdentity {
|
|
|
441
414
|
throw new InkboxError(`Identity '${this.agentHandle}' has no phone number assigned. Call identity.provisionPhoneNumber() or identity.assignPhoneNumber() first.`);
|
|
442
415
|
}
|
|
443
416
|
}
|
|
444
|
-
_requireAuthenticatorApp() {
|
|
445
|
-
if (!this._authenticatorApp) {
|
|
446
|
-
throw new InkboxError(`Identity '${this.agentHandle}' has no authenticator app assigned. Call identity.createAuthenticatorApp() or identity.assignAuthenticatorApp() first.`);
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
417
|
}
|
|
450
418
|
//# sourceMappingURL=agent_identity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent_identity.js","sourceRoot":"","sources":["../src/agent_identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAkB,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"agent_identity.js","sourceRoot":"","sources":["../src/agent_identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;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
|
* The vault remains the *admin* surface for creating secrets, managing
|
|
8
8
|
* keys, and configuring access rules.
|
|
9
9
|
*/
|
|
10
|
+
import type { TOTPCode } from "./vault/totp.js";
|
|
10
11
|
import type { APIKeyPayload, DecryptedVaultSecret, KeyPairPayload, LoginPayload, SSHKeyPayload } from "./vault/types.js";
|
|
11
12
|
/**
|
|
12
13
|
* Agent-facing credential access — typed, identity-scoped.
|
|
@@ -80,6 +81,16 @@ export declare class Credentials {
|
|
|
80
81
|
*/
|
|
81
82
|
getSshKey(secretId: string): SSHKeyPayload;
|
|
82
83
|
private _getTyped;
|
|
84
|
+
/**
|
|
85
|
+
* Generate the current TOTP code for a login credential.
|
|
86
|
+
*
|
|
87
|
+
* @param secretId - UUID of the login secret.
|
|
88
|
+
* @returns A {@link TOTPCode}.
|
|
89
|
+
* @throws Error if not found.
|
|
90
|
+
* @throws TypeError if the credential is not a login type.
|
|
91
|
+
* @throws Error if the login has no TOTP configured.
|
|
92
|
+
*/
|
|
93
|
+
getTotpCode(secretId: string): TOTPCode;
|
|
83
94
|
/** Number of credentials accessible to this identity. */
|
|
84
95
|
get length(): number;
|
|
85
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,aAAa,EACd,MAAM,kBAAkB,CAAC;AAG1B;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyB;IAClD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoC;gBAE9C,OAAO,EAAE,oBAAoB,EAAE;IAS3C,wDAAwD;IACxD,IAAI,IAAI,oBAAoB,EAAE;IAI9B,kDAAkD;IAClD,UAAU,IAAI,oBAAoB,EAAE;IAIpC,gCAAgC;IAChC,WA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;;OAKG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB;IAU3C;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY;IAIxC;;;;;;OAMG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa;IAI1C;;;;;;OAMG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc;IAI5C;;;;;;OAMG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa;IAQ1C,OAAO,CAAC,SAAS;IAUjB;;;;;;;;OAQG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ;IAQvC,yDAAyD;IACzD,IAAI,MAAM,IAAI,MAAM,CAEnB;CACF"}
|
package/dist/credentials.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* The vault remains the *admin* surface for creating secrets, managing
|
|
8
8
|
* keys, and configuring access rules.
|
|
9
9
|
*/
|
|
10
|
+
import { generateTotp } from "./vault/totp.js";
|
|
10
11
|
import { VaultSecretType } from "./vault/types.js";
|
|
11
12
|
/**
|
|
12
13
|
* Agent-facing credential access — typed, identity-scoped.
|
|
@@ -122,6 +123,22 @@ export class Credentials {
|
|
|
122
123
|
}
|
|
123
124
|
return secret.payload;
|
|
124
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Generate the current TOTP code for a login credential.
|
|
128
|
+
*
|
|
129
|
+
* @param secretId - UUID of the login secret.
|
|
130
|
+
* @returns A {@link TOTPCode}.
|
|
131
|
+
* @throws Error if not found.
|
|
132
|
+
* @throws TypeError if the credential is not a login type.
|
|
133
|
+
* @throws Error if the login has no TOTP configured.
|
|
134
|
+
*/
|
|
135
|
+
getTotpCode(secretId) {
|
|
136
|
+
const payload = this.getLogin(secretId);
|
|
137
|
+
if (!payload.totp) {
|
|
138
|
+
throw new Error(`Login '${secretId}' has no TOTP configured`);
|
|
139
|
+
}
|
|
140
|
+
return generateTotp(payload.totp);
|
|
141
|
+
}
|
|
125
142
|
/** Number of credentials accessible to this identity. */
|
|
126
143
|
get length() {
|
|
127
144
|
return this._secrets.length;
|
package/dist/credentials.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAQ/C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,WAAW;IACL,QAAQ,CAAyB;IACjC,KAAK,CAAoC;IAE1D,YAAY,OAA+B;QACzC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,qEAAqE;IACrE,iEAAiE;IACjE,qEAAqE;IAErE,wDAAwD;IACxD,IAAI;QACF,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAED,kDAAkD;IAClD,UAAU;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,eAAe,CAAC,KAAK,CAAC,CAAC;IAC7E,CAAC;IAED,gCAAgC;IAChC,WAAW;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,eAAe,CAAC,OAAO,CAAC,CA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