Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "inkbox"
version = "0.1.0"
version = "0.1.1"
description = "Python SDK for the Inkbox API"
readme = "README.md"
requires-python = ">=3.11"
Expand Down
2 changes: 1 addition & 1 deletion typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@inkbox/sdk",
"version": "0.1.0",
"version": "0.1.1",
"description": "TypeScript SDK for the Inkbox API",
"license": "MIT",
"type": "module",
Expand Down
19 changes: 13 additions & 6 deletions typescript/src/agent_identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,20 @@ export class AgentIdentity {
* @returns The newly created and linked {@link IdentityMailbox}.
*/
async createMailbox(options: { displayName?: string } = {}): Promise<IdentityMailbox> {
const mailbox = await this._inkbox._mailboxes.create(options);
const data = await this._inkbox._idsResource.assignMailbox(this.agentHandle, {
mailboxId: mailbox.id,
const mailbox = await this._inkbox._mailboxes.create({
agentHandle: this.agentHandle,
...options,
});
this._mailbox = data.mailbox;
this._data = data;
return this._mailbox!;
const linked: IdentityMailbox = {
id: mailbox.id,
emailAddress: mailbox.emailAddress,
displayName: mailbox.displayName,
status: mailbox.status,
createdAt: mailbox.createdAt,
updatedAt: mailbox.updatedAt,
};
this._mailbox = linked;
return linked;
}

/**
Expand Down
7 changes: 4 additions & 3 deletions typescript/src/mail/resources/mailboxes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ export class MailboxesResource {
constructor(private readonly http: HttpTransport) {}

/**
* Create a new mailbox.
* Create a new mailbox and link it to an agent identity.
*
* The email address is automatically generated by the server.
*
* @param options.agentHandle - Handle of the agent identity to assign this mailbox to.
* @param options.displayName - Optional human-readable name shown as the sender.
*/
async create(options: { displayName?: string } = {}): Promise<Mailbox> {
const body: Record<string, unknown> = {};
async create(options: { agentHandle: string; displayName?: string }): Promise<Mailbox> {
const body: Record<string, unknown> = { agent_handle: options.agentHandle };
if (options.displayName !== undefined) {
body["display_name"] = options.displayName;
}
Expand Down
Loading