carlyemail 0.6.4 → 0.6.5

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/carlyemail.js CHANGED
@@ -18,7 +18,7 @@ import { basename, extname, join } from "node:path";
18
18
  import { fileURLToPath } from "node:url";
19
19
  import { randomBytes } from "node:crypto";
20
20
 
21
- export const VERSION = "0.6.4";
21
+ export const VERSION = "0.6.5";
22
22
 
23
23
  const DEFAULT_API = "https://api.carlyemail.com";
24
24
  const CONFIG_DIR = join(homedir(), ".carlyemail");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carlyemail",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Real email inboxes your agent can send, receive and reply from. SDK and CLI.",
5
5
  "keywords": [
6
6
  "email",
package/sdk.d.ts CHANGED
@@ -11,6 +11,7 @@ export interface AgentSigninResponse {
11
11
  export interface AgentSigninVerifyRequest {
12
12
  human_email: string;
13
13
  otp_code: string;
14
+ organization_id?: string | null;
14
15
  }
15
16
 
16
17
  export interface AgentSigninVerifyResponse {
@@ -18,6 +19,8 @@ export interface AgentSigninVerifyResponse {
18
19
  api_key: string;
19
20
  inbox_domain?: string | null;
20
21
  inboxes_on_signup_domain?: Array<string>;
22
+ member?: MemberOut | null;
23
+ organizations?: Array<OrganizationChoice>;
21
24
  }
22
25
 
23
26
  export interface AgentSignupRequest {
@@ -255,6 +258,8 @@ export interface Identity {
255
258
  pod_id?: string | null;
256
259
  inbox_id?: string | null;
257
260
  api_key_id?: string | null;
261
+ member?: MemberOut | null;
262
+ organizations?: Array<OrganizationChoice>;
258
263
  }
259
264
 
260
265
  export interface InboxEventOut {
@@ -280,6 +285,13 @@ export interface InboxOut {
280
285
  created_at: string;
281
286
  }
282
287
 
288
+ export interface InviteMemberRequest {
289
+ email: string;
290
+ role?: string | null;
291
+ inbox_ids?: Array<string> | null;
292
+ name?: string | null;
293
+ }
294
+
283
295
  export interface ListApiKeysResponse {
284
296
  count: number;
285
297
  next_page_token?: string | null;
@@ -341,6 +353,11 @@ export interface ListListEntriesResponse {
341
353
  entries: Array<ListEntryOut>;
342
354
  }
343
355
 
356
+ export interface ListMembersResponse {
357
+ count: number;
358
+ members: Array<MemberOut>;
359
+ }
360
+
344
361
  export interface ListMessagesResponse {
345
362
  count: number;
346
363
  limit?: number | null;
@@ -374,6 +391,18 @@ export interface ListWebhooksResponse {
374
391
  webhooks: Array<WebhookOut>;
375
392
  }
376
393
 
394
+ export interface MemberOut {
395
+ member_id: string;
396
+ email: string;
397
+ name?: string | null;
398
+ role: string;
399
+ inbox_ids?: Array<string>;
400
+ status: string;
401
+ joined_at?: string | null;
402
+ last_signed_in_at?: string | null;
403
+ created_at?: string | null;
404
+ }
405
+
377
406
  export interface MessageItem {
378
407
  inbox_id: string;
379
408
  thread_id: string;
@@ -420,17 +449,28 @@ export interface MessageOut {
420
449
  authentication?: Record<string, string>;
421
450
  }
422
451
 
452
+ export interface OrganizationChoice {
453
+ organization_id: string;
454
+ name?: string | null;
455
+ role: string;
456
+ status: string;
457
+ }
458
+
423
459
  export interface OrganizationOut {
424
460
  organization_id: string;
461
+ human_email?: string | null;
462
+ name?: string | null;
425
463
  inbox_count: number;
426
464
  domain_count: number;
427
465
  pod_count?: number;
428
466
  webhook_count?: number;
467
+ member_count?: number;
429
468
  storage_bytes?: number;
430
469
  inbox_limit?: number | null;
431
470
  domain_limit?: number | null;
432
471
  pod_limit?: number | null;
433
472
  webhook_limit?: number | null;
473
+ member_limit?: number | null;
434
474
  storage_limit_bytes?: number | null;
435
475
  plan?: string | null;
436
476
  billing_id?: string | null;
@@ -510,6 +550,16 @@ export interface SendMessageResponse {
510
550
  thread_id: string;
511
551
  }
512
552
 
553
+ export interface SwitchRequest {
554
+ organization_id: string;
555
+ }
556
+
557
+ export interface SwitchResponse {
558
+ organization_id: string;
559
+ api_key: string;
560
+ member: MemberOut;
561
+ }
562
+
513
563
  export interface ThreadItem {
514
564
  inbox_id: string;
515
565
  thread_id: string;
@@ -579,6 +629,12 @@ export interface UpdateInboxWebhookRequest {
579
629
  enabled?: boolean | null;
580
630
  }
581
631
 
632
+ export interface UpdateMemberRequest {
633
+ role?: string | null;
634
+ inbox_ids?: Array<string> | null;
635
+ name?: string | null;
636
+ }
637
+
582
638
  export interface UpdateMessageRequest {
583
639
  add_labels?: Array<string> | null;
584
640
  remove_labels?: Array<string> | null;
@@ -685,6 +741,7 @@ export declare class Agent {
685
741
 
686
742
  export declare class Auth {
687
743
  whoami(): Promise<Identity>;
744
+ switchOrganization(body: SwitchRequest): Promise<SwitchResponse>;
688
745
  }
689
746
 
690
747
  export declare class Billing {
@@ -779,6 +836,14 @@ export declare class ApiKeys {
779
836
  deleteInbox(inboxId: string, apiKeyId: string): Promise<void>;
780
837
  }
781
838
 
839
+ export declare class Members {
840
+ list(): Promise<ListMembersResponse>;
841
+ invite(body: InviteMemberRequest): Promise<MemberOut>;
842
+ get(memberId: string): Promise<MemberOut>;
843
+ update(memberId: string, body: UpdateMemberRequest): Promise<MemberOut>;
844
+ remove(memberId: string): Promise<void>;
845
+ }
846
+
782
847
  export declare class Events {
783
848
  list(query?: { eventTypes?: Array<string> | null; inboxId?: string | null; start?: string | null; end?: string | null; limit?: number | null; pageToken?: string | null }): Promise<ListEventsResponse>;
784
849
  }
@@ -874,6 +939,7 @@ export declare class CarlyEmail {
874
939
  lists: Lists;
875
940
  domains: Domains;
876
941
  apiKeys: ApiKeys;
942
+ members: Members;
877
943
  events: Events;
878
944
  metrics: Metrics;
879
945
  pods: Pods;
package/sdk.js CHANGED
@@ -103,6 +103,11 @@ class Auth {
103
103
  whoami() {
104
104
  return this.$.request("GET", `/v0/auth/me`);
105
105
  }
106
+
107
+ /** Switch Organization */
108
+ switchOrganization(body) {
109
+ return this.$.request("POST", `/v0/auth/switch`, { body });
110
+ }
106
111
  }
107
112
 
108
113
  class Billing {
@@ -484,6 +489,37 @@ class ApiKeys {
484
489
  }
485
490
  }
486
491
 
492
+ class Members {
493
+ constructor(transport) {
494
+ this.$ = transport;
495
+ }
496
+
497
+ /** List Members */
498
+ list() {
499
+ return this.$.request("GET", `/v0/members`);
500
+ }
501
+
502
+ /** Invite Member */
503
+ invite(body) {
504
+ return this.$.request("POST", `/v0/members`, { body });
505
+ }
506
+
507
+ /** Get Member */
508
+ get(memberId) {
509
+ return this.$.request("GET", `/v0/members/${encode(memberId)}`);
510
+ }
511
+
512
+ /** Update Member */
513
+ update(memberId, body) {
514
+ return this.$.request("PATCH", `/v0/members/${encode(memberId)}`, { body });
515
+ }
516
+
517
+ /** Remove Member */
518
+ remove(memberId) {
519
+ return this.$.request("DELETE", `/v0/members/${encode(memberId)}`);
520
+ }
521
+ }
522
+
487
523
  class Events {
488
524
  constructor(transport) {
489
525
  this.$ = transport;
@@ -854,6 +890,7 @@ export class CarlyEmail {
854
890
  this.lists = new Lists(transport);
855
891
  this.domains = new Domains(transport);
856
892
  this.apiKeys = new ApiKeys(transport);
893
+ this.members = new Members(transport);
857
894
  this.events = new Events(transport);
858
895
  this.metrics = new Metrics(transport);
859
896
  this.pods = new Pods(transport);