@naturalpay/sdk 0.4.0 → 0.7.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.
Files changed (118) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/client.d.mts +7 -16
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -16
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -12
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -12
  9. package/client.mjs.map +1 -1
  10. package/internal/tslib.js +17 -17
  11. package/internal/utils/query.d.mts +3 -0
  12. package/internal/utils/query.d.mts.map +1 -1
  13. package/internal/utils/query.d.ts +3 -0
  14. package/internal/utils/query.d.ts.map +1 -1
  15. package/internal/utils/query.js +16 -3
  16. package/internal/utils/query.js.map +1 -1
  17. package/internal/utils/query.mjs +16 -2
  18. package/internal/utils/query.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/resources/agents.d.mts +435 -260
  21. package/resources/agents.d.mts.map +1 -1
  22. package/resources/agents.d.ts +435 -260
  23. package/resources/agents.d.ts.map +1 -1
  24. package/resources/agents.js +72 -20
  25. package/resources/agents.js.map +1 -1
  26. package/resources/agents.mjs +72 -20
  27. package/resources/agents.mjs.map +1 -1
  28. package/resources/customers.d.mts +243 -114
  29. package/resources/customers.d.mts.map +1 -1
  30. package/resources/customers.d.ts +243 -114
  31. package/resources/customers.d.ts.map +1 -1
  32. package/resources/customers.js +6 -7
  33. package/resources/customers.js.map +1 -1
  34. package/resources/customers.mjs +6 -7
  35. package/resources/customers.mjs.map +1 -1
  36. package/resources/index.d.mts +2 -4
  37. package/resources/index.d.mts.map +1 -1
  38. package/resources/index.d.ts +2 -4
  39. package/resources/index.d.ts.map +1 -1
  40. package/resources/index.js +1 -5
  41. package/resources/index.js.map +1 -1
  42. package/resources/index.mjs +0 -2
  43. package/resources/index.mjs.map +1 -1
  44. package/src/client.ts +23 -60
  45. package/src/internal/utils/query.ts +18 -2
  46. package/src/resources/agents.ts +541 -294
  47. package/src/resources/customers.ts +273 -132
  48. package/src/resources/index.ts +10 -24
  49. package/src/version.ts +1 -1
  50. package/version.d.mts +1 -1
  51. package/version.d.ts +1 -1
  52. package/version.js +1 -1
  53. package/version.mjs +1 -1
  54. package/internal/qs/formats.d.mts +0 -7
  55. package/internal/qs/formats.d.mts.map +0 -1
  56. package/internal/qs/formats.d.ts +0 -7
  57. package/internal/qs/formats.d.ts.map +0 -1
  58. package/internal/qs/formats.js +0 -13
  59. package/internal/qs/formats.js.map +0 -1
  60. package/internal/qs/formats.mjs +0 -9
  61. package/internal/qs/formats.mjs.map +0 -1
  62. package/internal/qs/index.d.mts +0 -10
  63. package/internal/qs/index.d.mts.map +0 -1
  64. package/internal/qs/index.d.ts +0 -10
  65. package/internal/qs/index.d.ts.map +0 -1
  66. package/internal/qs/index.js +0 -14
  67. package/internal/qs/index.js.map +0 -1
  68. package/internal/qs/index.mjs +0 -10
  69. package/internal/qs/index.mjs.map +0 -1
  70. package/internal/qs/stringify.d.mts +0 -3
  71. package/internal/qs/stringify.d.mts.map +0 -1
  72. package/internal/qs/stringify.d.ts +0 -3
  73. package/internal/qs/stringify.d.ts.map +0 -1
  74. package/internal/qs/stringify.js +0 -277
  75. package/internal/qs/stringify.js.map +0 -1
  76. package/internal/qs/stringify.mjs +0 -274
  77. package/internal/qs/stringify.mjs.map +0 -1
  78. package/internal/qs/types.d.mts +0 -57
  79. package/internal/qs/types.d.mts.map +0 -1
  80. package/internal/qs/types.d.ts +0 -57
  81. package/internal/qs/types.d.ts.map +0 -1
  82. package/internal/qs/types.js +0 -3
  83. package/internal/qs/types.js.map +0 -1
  84. package/internal/qs/types.mjs +0 -2
  85. package/internal/qs/types.mjs.map +0 -1
  86. package/internal/qs/utils.d.mts +0 -15
  87. package/internal/qs/utils.d.mts.map +0 -1
  88. package/internal/qs/utils.d.ts +0 -15
  89. package/internal/qs/utils.d.ts.map +0 -1
  90. package/internal/qs/utils.js +0 -230
  91. package/internal/qs/utils.js.map +0 -1
  92. package/internal/qs/utils.mjs +0 -217
  93. package/internal/qs/utils.mjs.map +0 -1
  94. package/resources/delegations.d.mts +0 -458
  95. package/resources/delegations.d.mts.map +0 -1
  96. package/resources/delegations.d.ts +0 -458
  97. package/resources/delegations.d.ts.map +0 -1
  98. package/resources/delegations.js +0 -47
  99. package/resources/delegations.js.map +0 -1
  100. package/resources/delegations.mjs +0 -43
  101. package/resources/delegations.mjs.map +0 -1
  102. package/resources/escalations.d.mts +0 -1124
  103. package/resources/escalations.d.mts.map +0 -1
  104. package/resources/escalations.d.ts +0 -1124
  105. package/resources/escalations.d.ts.map +0 -1
  106. package/resources/escalations.js +0 -110
  107. package/resources/escalations.js.map +0 -1
  108. package/resources/escalations.mjs +0 -106
  109. package/resources/escalations.mjs.map +0 -1
  110. package/src/internal/qs/LICENSE.md +0 -13
  111. package/src/internal/qs/README.md +0 -3
  112. package/src/internal/qs/formats.ts +0 -10
  113. package/src/internal/qs/index.ts +0 -13
  114. package/src/internal/qs/stringify.ts +0 -385
  115. package/src/internal/qs/types.ts +0 -71
  116. package/src/internal/qs/utils.ts +0 -265
  117. package/src/resources/delegations.ts +0 -580
  118. package/src/resources/escalations.ts +0 -1422
@@ -39,24 +39,23 @@ export declare class Agents extends APIResource {
39
39
  */
40
40
  list(params?: AgentListParams | null | undefined, options?: RequestOptions): APIPromise<AgentListResponse>;
41
41
  /**
42
- * Developer-only. Creates one invitation per agent and sends a single Resend email
43
- * to the customer.
42
+ * Add or invite customer relationships for this agent.
44
43
  *
45
44
  * @example
46
45
  * ```ts
47
- * const response = await client.agents.createInvitations({
48
- * agents: [
49
- * {
50
- * agentId: 'agt_ecc2efdd09bd231a9ad9bd2aada37aa7',
51
- * permissions: ['string'],
52
- * },
53
- * ],
54
- * customerEmail: 'dev@stainless.com',
55
- * 'Idempotency-Key': 'Idempotency-Key',
56
- * });
46
+ * const response = await client.agents.createCustomer(
47
+ * 'agt_ecc2efdd09bd231a9ad9bd2aada37aa7',
48
+ * {
49
+ * permissions: ['string'],
50
+ * recipients: [
51
+ * { type: 'type', value: 'dev@stainless.com' },
52
+ * ],
53
+ * 'Idempotency-Key': 'Idempotency-Key',
54
+ * },
55
+ * );
57
56
  * ```
58
57
  */
59
- createInvitations(params: AgentCreateInvitationsParams, options?: RequestOptions): APIPromise<AgentCreateInvitationsResponse>;
58
+ createCustomer(agentID: string, params: AgentCreateCustomerParams, options?: RequestOptions): APIPromise<AgentCreateCustomerResponse>;
60
59
  /**
61
60
  * Get agent details by its unique ID.
62
61
  *
@@ -69,17 +68,30 @@ export declare class Agents extends APIResource {
69
68
  */
70
69
  get(agentID: string, params?: AgentGetParams | null | undefined, options?: RequestOptions): APIPromise<AgentGetResponse>;
71
70
  /**
72
- * List agent delegation invitations
71
+ * Get a specific customer invitation for this agent.
73
72
  *
74
73
  * @example
75
74
  * ```ts
76
- * const response =
77
- * await client.agents.listInvitationsForDeveloper();
75
+ * const response = await client.agents.getCustomer(
76
+ * 'pty_ecc2efdd09bd231a9ad9bd2aada37aa7',
77
+ * { agentId: 'agt_ecc2efdd09bd231a9ad9bd2aada37aa7' },
78
+ * );
78
79
  * ```
79
80
  */
80
- listInvitationsForDeveloper(params?: AgentListInvitationsForDeveloperParams | null | undefined, options?: RequestOptions): APIPromise<AgentListInvitationsForDeveloperResponse>;
81
+ getCustomer(customerID: string, params: AgentGetCustomerParams, options?: RequestOptions): APIPromise<AgentGetCustomerResponse>;
81
82
  /**
82
- * Revoke an agent.
83
+ * List customer invitations for this agent.
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * const response = await client.agents.listCustomers(
88
+ * 'agt_ecc2efdd09bd231a9ad9bd2aada37aa7',
89
+ * );
90
+ * ```
91
+ */
92
+ listCustomers(agentID: string, params?: AgentListCustomersParams | null | undefined, options?: RequestOptions): APIPromise<AgentListCustomersResponse>;
93
+ /**
94
+ * Delete an agent. Deleting an agent revokes it and cleans up active access.
83
95
  *
84
96
  * @example
85
97
  * ```ts
@@ -90,6 +102,21 @@ export declare class Agents extends APIResource {
90
102
  * ```
91
103
  */
92
104
  remove(agentID: string, params: AgentRemoveParams, options?: RequestOptions): APIPromise<AgentRemoveResponse>;
105
+ /**
106
+ * Revoke this customer invitation so the agent can no longer act for the customer.
107
+ *
108
+ * @example
109
+ * ```ts
110
+ * const response = await client.agents.removeCustomer(
111
+ * 'pty_ecc2efdd09bd231a9ad9bd2aada37aa7',
112
+ * {
113
+ * agentId: 'agt_ecc2efdd09bd231a9ad9bd2aada37aa7',
114
+ * 'Idempotency-Key': 'Idempotency-Key',
115
+ * },
116
+ * );
117
+ * ```
118
+ */
119
+ removeCustomer(customerID: string, params: AgentRemoveCustomerParams, options?: RequestOptions): APIPromise<AgentRemoveCustomerResponse>;
93
120
  }
94
121
  export interface AgentCreateResponse {
95
122
  data: AgentCreateResponse.Data;
@@ -398,28 +425,28 @@ export declare namespace AgentListResponse {
398
425
  }
399
426
  }
400
427
  }
401
- export interface AgentCreateInvitationsResponse {
428
+ export interface AgentCreateCustomerResponse {
402
429
  /**
403
- * Successfully created invitation resources
430
+ * Created customer invitation resources
404
431
  */
405
- data: Array<AgentCreateInvitationsResponse.Data>;
432
+ data: Array<AgentCreateCustomerResponse.Data>;
406
433
  /**
407
434
  * Batch invitation metadata
408
435
  */
409
- meta: AgentCreateInvitationsResponse.Meta;
436
+ meta: AgentCreateCustomerResponse.Meta;
410
437
  }
411
- export declare namespace AgentCreateInvitationsResponse {
438
+ export declare namespace AgentCreateCustomerResponse {
412
439
  interface Data {
413
440
  /**
414
- * Invitation ID (adi\_\*)
441
+ * Customer invitation ID (adi\_\*)
415
442
  */
416
443
  id: string;
417
444
  /**
418
- * Resource attributes
445
+ * Invitation attributes
419
446
  */
420
447
  attributes: Data.Attributes;
421
448
  /**
422
- * Related resource identifiers
449
+ * Related agent and customer party
423
450
  */
424
451
  relationships: Data.Relationships;
425
452
  /**
@@ -429,65 +456,41 @@ export declare namespace AgentCreateInvitationsResponse {
429
456
  }
430
457
  namespace Data {
431
458
  /**
432
- * Resource attributes
459
+ * Invitation attributes
433
460
  */
434
461
  interface Attributes {
435
- /**
436
- * When this invitation was accepted
437
- */
438
- acceptedAt: string | null;
439
- /**
440
- * Display name of the agent being delegated
441
- */
442
- agentName: string;
443
- /**
444
- * Why the invitation was cancelled
445
- */
446
- cancelReason: 'AGENT_RETIRED' | 'DEVELOPER_RETIRED' | null;
447
462
  /**
448
463
  * When this invitation was created
449
464
  */
450
465
  createdAt: string;
451
- /**
452
- * When this invitation was declined
453
- */
454
- declinedAt: string | null;
455
- /**
456
- * Display name of the developer party
457
- */
458
- developerName: string;
459
- /**
460
- * Status after applying expiry and cancel-reason overlays
461
- */
462
- effectiveStatus: 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED';
463
- /**
464
- * Customer email the invitation was sent to
465
- */
466
- email: string;
467
466
  /**
468
467
  * When this invitation expires
469
468
  */
470
469
  expiresAt: string;
471
470
  /**
472
- * Per-agent transaction limits
471
+ * Requested per-agent customer limits
473
472
  */
474
473
  limits: Attributes.Limits | null;
475
474
  /**
476
- * Permissions the agent will hold on accept
475
+ * Permissions requested for this agent invitation
477
476
  */
478
477
  permissions: Array<string>;
479
478
  /**
480
- * Raw persisted status
479
+ * Recipient identifier used to create the invitation
480
+ */
481
+ recipient: Attributes.UnionMember0 | Attributes.UnionMember1 | Attributes.UnionMember2;
482
+ /**
483
+ * Current invitation status
481
484
  */
482
- status: 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED';
485
+ status: 'ACTIVE' | 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED' | 'REVOKED';
483
486
  /**
484
487
  * When this invitation was last updated
485
488
  */
486
- updatedAt: string;
489
+ updatedAt: string | null;
487
490
  }
488
491
  namespace Attributes {
489
492
  /**
490
- * Per-agent transaction limits
493
+ * Requested per-agent customer limits
491
494
  */
492
495
  interface Limits {
493
496
  /**
@@ -495,75 +498,87 @@ export declare namespace AgentCreateInvitationsResponse {
495
498
  */
496
499
  perTransaction?: number | null;
497
500
  }
501
+ interface UnionMember0 {
502
+ type: string;
503
+ /**
504
+ * Email address
505
+ */
506
+ value: string;
507
+ }
508
+ interface UnionMember1 {
509
+ type: string;
510
+ /**
511
+ * Phone number in E.164 format
512
+ */
513
+ value: string;
514
+ }
515
+ interface UnionMember2 {
516
+ type: string;
517
+ /**
518
+ * Natural party ID (pty\_\*)
519
+ */
520
+ value: string;
521
+ }
498
522
  }
499
523
  /**
500
- * Related resource identifiers
524
+ * Related agent and customer party
501
525
  */
502
526
  interface Relationships {
503
527
  /**
504
- * Agent being delegated
528
+ * Agent attached to this invitation
505
529
  */
506
530
  agent: Relationships.Agent;
507
531
  /**
508
- * Resulting agent delegation once accepted; currently null on public create/list
509
- * responses
510
- */
511
- agentDelegation: Relationships.AgentDelegation;
512
- /**
513
- * Customer party the invitation was accepted on (null until accept)
532
+ * Customer party when the recipient is an existing party or once the invitation is
533
+ * accepted
514
534
  */
515
535
  customerParty: Relationships.CustomerParty;
516
- /**
517
- * Developer party that issued the invitation
518
- */
519
- developerParty: Relationships.DeveloperParty;
520
536
  }
521
537
  namespace Relationships {
522
538
  /**
523
- * Agent being delegated
539
+ * Agent attached to this invitation
524
540
  */
525
541
  interface Agent {
526
- /**
527
- * Related resource identifier
528
- */
529
542
  data: Agent.Data;
530
543
  }
531
544
  namespace Agent {
532
- /**
533
- * Related resource identifier
534
- */
535
545
  interface Data {
546
+ /**
547
+ * Agent ID (agt\_\*)
548
+ */
536
549
  id: string;
550
+ /**
551
+ * Agent attributes
552
+ */
553
+ attributes: Data.Attributes;
537
554
  /**
538
555
  * Resource type
539
556
  */
540
557
  type: string;
541
558
  }
542
- }
543
- /**
544
- * Resulting agent delegation once accepted; currently null on public create/list
545
- * responses
546
- */
547
- interface AgentDelegation {
548
- /**
549
- * Related resource identifier
550
- */
551
- data: AgentDelegation.Data | null;
552
- }
553
- namespace AgentDelegation {
554
- /**
555
- * Related resource identifier
556
- */
557
- interface Data {
558
- id: string;
559
+ namespace Data {
559
560
  /**
560
- * Resource type
561
+ * Agent attributes
561
562
  */
562
- type: string;
563
+ interface Attributes {
564
+ /**
565
+ * Agent description
566
+ */
567
+ description: string | null;
568
+ /**
569
+ * Agent display name
570
+ */
571
+ name: string | null;
572
+ /**
573
+ * Agent status
574
+ */
575
+ status: 'ACTIVE' | 'REVOKED';
576
+ }
563
577
  }
564
578
  }
565
579
  /**
566
- * Customer party the invitation was accepted on (null until accept)
580
+ * Customer party when the recipient is an existing party or once the invitation is
581
+ * accepted
567
582
  */
568
583
  interface CustomerParty {
569
584
  /**
@@ -583,27 +598,6 @@ export declare namespace AgentCreateInvitationsResponse {
583
598
  type: string;
584
599
  }
585
600
  }
586
- /**
587
- * Developer party that issued the invitation
588
- */
589
- interface DeveloperParty {
590
- /**
591
- * Related resource identifier
592
- */
593
- data: DeveloperParty.Data;
594
- }
595
- namespace DeveloperParty {
596
- /**
597
- * Related resource identifier
598
- */
599
- interface Data {
600
- id: string;
601
- /**
602
- * Resource type
603
- */
604
- type: string;
605
- }
606
- }
607
601
  }
608
602
  }
609
603
  /**
@@ -716,22 +710,21 @@ export declare namespace AgentGetResponse {
716
710
  }
717
711
  }
718
712
  }
719
- export interface AgentListInvitationsForDeveloperResponse {
720
- data: Array<AgentListInvitationsForDeveloperResponse.Data>;
721
- meta: AgentListInvitationsForDeveloperResponse.Meta;
713
+ export interface AgentGetCustomerResponse {
714
+ data: AgentGetCustomerResponse.Data;
722
715
  }
723
- export declare namespace AgentListInvitationsForDeveloperResponse {
716
+ export declare namespace AgentGetCustomerResponse {
724
717
  interface Data {
725
718
  /**
726
- * Invitation ID (adi\_\*)
719
+ * Customer party ID when known; otherwise the lowercased customer email
727
720
  */
728
721
  id: string;
729
722
  /**
730
- * Resource attributes
723
+ * Customer party and invitation attributes
731
724
  */
732
725
  attributes: Data.Attributes;
733
726
  /**
734
- * Related resource identifiers
727
+ * Related agent details
735
728
  */
736
729
  relationships: Data.Relationships;
737
730
  /**
@@ -741,65 +734,41 @@ export declare namespace AgentListInvitationsForDeveloperResponse {
741
734
  }
742
735
  namespace Data {
743
736
  /**
744
- * Resource attributes
737
+ * Customer party and invitation attributes
745
738
  */
746
739
  interface Attributes {
747
740
  /**
748
- * When this invitation was accepted
749
- */
750
- acceptedAt: string | null;
751
- /**
752
- * Display name of the agent being delegated
753
- */
754
- agentName: string;
755
- /**
756
- * Why the invitation was cancelled
757
- */
758
- cancelReason: 'AGENT_RETIRED' | 'DEVELOPER_RETIRED' | null;
759
- /**
760
- * When this invitation was created
741
+ * When this agent-customer relationship was created
761
742
  */
762
743
  createdAt: string;
763
744
  /**
764
- * When this invitation was declined
765
- */
766
- declinedAt: string | null;
767
- /**
768
- * Display name of the developer party
745
+ * Customer email, when known
769
746
  */
770
- developerName: string;
747
+ email: string | null;
771
748
  /**
772
- * Status after applying expiry and cancel-reason overlays
749
+ * Per-agent customer transaction limits
773
750
  */
774
- effectiveStatus: 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED';
775
- /**
776
- * Customer email the invitation was sent to
777
- */
778
- email: string;
779
- /**
780
- * When this invitation expires
781
- */
782
- expiresAt: string;
751
+ limits: Attributes.Limits | null;
783
752
  /**
784
- * Per-agent transaction limits
753
+ * Customer party display name, when known
785
754
  */
786
- limits: Attributes.Limits | null;
755
+ name: string | null;
787
756
  /**
788
- * Permissions the agent will hold on accept
757
+ * Permissions granted or requested for this agent
789
758
  */
790
759
  permissions: Array<string>;
791
760
  /**
792
- * Raw persisted status
761
+ * Current agent-customer relationship status
793
762
  */
794
- status: 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED';
763
+ status: 'ACTIVE' | 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED' | 'REVOKED';
795
764
  /**
796
- * When this invitation was last updated
765
+ * When this agent-customer relationship was last updated
797
766
  */
798
- updatedAt: string;
767
+ updatedAt: string | null;
799
768
  }
800
769
  namespace Attributes {
801
770
  /**
802
- * Per-agent transaction limits
771
+ * Per-agent customer transaction limits
803
772
  */
804
773
  interface Limits {
805
774
  /**
@@ -809,112 +778,161 @@ export declare namespace AgentListInvitationsForDeveloperResponse {
809
778
  }
810
779
  }
811
780
  /**
812
- * Related resource identifiers
781
+ * Related agent details
813
782
  */
814
783
  interface Relationships {
815
784
  /**
816
- * Agent being delegated
785
+ * Agent attached to this customer
817
786
  */
818
787
  agent: Relationships.Agent;
819
- /**
820
- * Resulting agent delegation once accepted; currently null on public create/list
821
- * responses
822
- */
823
- agentDelegation: Relationships.AgentDelegation;
824
- /**
825
- * Customer party the invitation was accepted on (null until accept)
826
- */
827
- customerParty: Relationships.CustomerParty;
828
- /**
829
- * Developer party that issued the invitation
830
- */
831
- developerParty: Relationships.DeveloperParty;
832
788
  }
833
789
  namespace Relationships {
834
790
  /**
835
- * Agent being delegated
791
+ * Agent attached to this customer
836
792
  */
837
793
  interface Agent {
838
- /**
839
- * Related resource identifier
840
- */
841
794
  data: Agent.Data;
842
795
  }
843
796
  namespace Agent {
844
- /**
845
- * Related resource identifier
846
- */
847
797
  interface Data {
798
+ /**
799
+ * Agent ID (agt\_\*)
800
+ */
848
801
  id: string;
802
+ /**
803
+ * Agent attributes
804
+ */
805
+ attributes: Data.Attributes;
849
806
  /**
850
807
  * Resource type
851
808
  */
852
809
  type: string;
853
810
  }
854
- }
855
- /**
856
- * Resulting agent delegation once accepted; currently null on public create/list
857
- * responses
858
- */
859
- interface AgentDelegation {
860
- /**
861
- * Related resource identifier
862
- */
863
- data: AgentDelegation.Data | null;
864
- }
865
- namespace AgentDelegation {
866
- /**
867
- * Related resource identifier
868
- */
869
- interface Data {
870
- id: string;
811
+ namespace Data {
871
812
  /**
872
- * Resource type
813
+ * Agent attributes
873
814
  */
874
- type: string;
815
+ interface Attributes {
816
+ /**
817
+ * Agent display name
818
+ */
819
+ name: string | null;
820
+ }
875
821
  }
876
822
  }
823
+ }
824
+ }
825
+ }
826
+ export interface AgentListCustomersResponse {
827
+ data: Array<AgentListCustomersResponse.Data>;
828
+ meta: AgentListCustomersResponse.Meta;
829
+ }
830
+ export declare namespace AgentListCustomersResponse {
831
+ interface Data {
832
+ /**
833
+ * Customer party ID when known; otherwise the lowercased customer email
834
+ */
835
+ id: string;
836
+ /**
837
+ * Customer party and invitation attributes
838
+ */
839
+ attributes: Data.Attributes;
840
+ /**
841
+ * Related agent details
842
+ */
843
+ relationships: Data.Relationships;
844
+ /**
845
+ * Resource type
846
+ */
847
+ type: string;
848
+ }
849
+ namespace Data {
850
+ /**
851
+ * Customer party and invitation attributes
852
+ */
853
+ interface Attributes {
877
854
  /**
878
- * Customer party the invitation was accepted on (null until accept)
855
+ * When this agent-customer relationship was created
879
856
  */
880
- interface CustomerParty {
881
- /**
882
- * Related resource identifier
883
- */
884
- data: CustomerParty.Data | null;
885
- }
886
- namespace CustomerParty {
857
+ createdAt: string;
858
+ /**
859
+ * Customer email, when known
860
+ */
861
+ email: string | null;
862
+ /**
863
+ * Per-agent customer transaction limits
864
+ */
865
+ limits: Attributes.Limits | null;
866
+ /**
867
+ * Customer party display name, when known
868
+ */
869
+ name: string | null;
870
+ /**
871
+ * Permissions granted or requested for this agent
872
+ */
873
+ permissions: Array<string>;
874
+ /**
875
+ * Current agent-customer relationship status
876
+ */
877
+ status: 'ACTIVE' | 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED' | 'REVOKED';
878
+ /**
879
+ * When this agent-customer relationship was last updated
880
+ */
881
+ updatedAt: string | null;
882
+ }
883
+ namespace Attributes {
884
+ /**
885
+ * Per-agent customer transaction limits
886
+ */
887
+ interface Limits {
887
888
  /**
888
- * Related resource identifier
889
+ * Per-transaction cap, integer cents (USD).
889
890
  */
890
- interface Data {
891
- id: string;
892
- /**
893
- * Resource type
894
- */
895
- type: string;
896
- }
891
+ perTransaction?: number | null;
897
892
  }
893
+ }
894
+ /**
895
+ * Related agent details
896
+ */
897
+ interface Relationships {
898
898
  /**
899
- * Developer party that issued the invitation
899
+ * Agent attached to this customer
900
900
  */
901
- interface DeveloperParty {
902
- /**
903
- * Related resource identifier
904
- */
905
- data: DeveloperParty.Data;
901
+ agent: Relationships.Agent;
902
+ }
903
+ namespace Relationships {
904
+ /**
905
+ * Agent attached to this customer
906
+ */
907
+ interface Agent {
908
+ data: Agent.Data;
906
909
  }
907
- namespace DeveloperParty {
908
- /**
909
- * Related resource identifier
910
- */
910
+ namespace Agent {
911
911
  interface Data {
912
+ /**
913
+ * Agent ID (agt\_\*)
914
+ */
912
915
  id: string;
916
+ /**
917
+ * Agent attributes
918
+ */
919
+ attributes: Data.Attributes;
913
920
  /**
914
921
  * Resource type
915
922
  */
916
923
  type: string;
917
924
  }
925
+ namespace Data {
926
+ /**
927
+ * Agent attributes
928
+ */
929
+ interface Attributes {
930
+ /**
931
+ * Agent display name
932
+ */
933
+ name: string | null;
934
+ }
935
+ }
918
936
  }
919
937
  }
920
938
  }
@@ -1034,6 +1052,126 @@ export declare namespace AgentRemoveResponse {
1034
1052
  deleted: true;
1035
1053
  }
1036
1054
  }
1055
+ export interface AgentRemoveCustomerResponse {
1056
+ data: AgentRemoveCustomerResponse.Data;
1057
+ meta: AgentRemoveCustomerResponse.Meta;
1058
+ }
1059
+ export declare namespace AgentRemoveCustomerResponse {
1060
+ interface Data {
1061
+ /**
1062
+ * Customer party ID when known; otherwise the lowercased customer email
1063
+ */
1064
+ id: string;
1065
+ /**
1066
+ * Customer party and invitation attributes
1067
+ */
1068
+ attributes: Data.Attributes;
1069
+ /**
1070
+ * Related agent details
1071
+ */
1072
+ relationships: Data.Relationships;
1073
+ /**
1074
+ * Resource type
1075
+ */
1076
+ type: string;
1077
+ }
1078
+ namespace Data {
1079
+ /**
1080
+ * Customer party and invitation attributes
1081
+ */
1082
+ interface Attributes {
1083
+ /**
1084
+ * When this agent-customer relationship was created
1085
+ */
1086
+ createdAt: string;
1087
+ /**
1088
+ * Customer email, when known
1089
+ */
1090
+ email: string | null;
1091
+ /**
1092
+ * Per-agent customer transaction limits
1093
+ */
1094
+ limits: Attributes.Limits | null;
1095
+ /**
1096
+ * Customer party display name, when known
1097
+ */
1098
+ name: string | null;
1099
+ /**
1100
+ * Permissions granted or requested for this agent
1101
+ */
1102
+ permissions: Array<string>;
1103
+ /**
1104
+ * Current agent-customer relationship status
1105
+ */
1106
+ status: 'ACTIVE' | 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED' | 'REVOKED';
1107
+ /**
1108
+ * When this agent-customer relationship was last updated
1109
+ */
1110
+ updatedAt: string | null;
1111
+ }
1112
+ namespace Attributes {
1113
+ /**
1114
+ * Per-agent customer transaction limits
1115
+ */
1116
+ interface Limits {
1117
+ /**
1118
+ * Per-transaction cap, integer cents (USD).
1119
+ */
1120
+ perTransaction?: number | null;
1121
+ }
1122
+ }
1123
+ /**
1124
+ * Related agent details
1125
+ */
1126
+ interface Relationships {
1127
+ /**
1128
+ * Agent attached to this customer
1129
+ */
1130
+ agent: Relationships.Agent;
1131
+ }
1132
+ namespace Relationships {
1133
+ /**
1134
+ * Agent attached to this customer
1135
+ */
1136
+ interface Agent {
1137
+ data: Agent.Data;
1138
+ }
1139
+ namespace Agent {
1140
+ interface Data {
1141
+ /**
1142
+ * Agent ID (agt\_\*)
1143
+ */
1144
+ id: string;
1145
+ /**
1146
+ * Agent attributes
1147
+ */
1148
+ attributes: Data.Attributes;
1149
+ /**
1150
+ * Resource type
1151
+ */
1152
+ type: string;
1153
+ }
1154
+ namespace Data {
1155
+ /**
1156
+ * Agent attributes
1157
+ */
1158
+ interface Attributes {
1159
+ /**
1160
+ * Agent display name
1161
+ */
1162
+ name: string | null;
1163
+ }
1164
+ }
1165
+ }
1166
+ }
1167
+ }
1168
+ interface Meta {
1169
+ /**
1170
+ * Indicates the resource was deleted
1171
+ */
1172
+ deleted: true;
1173
+ }
1174
+ }
1037
1175
  export interface AgentCreateParams {
1038
1176
  /**
1039
1177
  * Body param: Agent display name
@@ -1136,15 +1274,15 @@ export interface AgentListParams {
1136
1274
  */
1137
1275
  'X-Instance-ID'?: string;
1138
1276
  }
1139
- export interface AgentCreateInvitationsParams {
1277
+ export interface AgentCreateCustomerParams {
1140
1278
  /**
1141
- * Body param: Per-agent delegation requests (1-50)
1279
+ * Body param: Permissions to request
1142
1280
  */
1143
- agents: Array<AgentCreateInvitationsParams.Agent>;
1281
+ permissions: Array<string>;
1144
1282
  /**
1145
- * Body param: Email address of the customer to invite
1283
+ * Body param: Customer recipients to invite (1-50)
1146
1284
  */
1147
- customerEmail: string;
1285
+ recipients: Array<AgentCreateCustomerParams.UnionMember0 | AgentCreateCustomerParams.UnionMember1>;
1148
1286
  /**
1149
1287
  * Header param: Unique key for idempotent request handling. If a request with the
1150
1288
  * same key was already processed, the original response is returned.
@@ -1154,6 +1292,10 @@ export interface AgentCreateInvitationsParams {
1154
1292
  * Body param: Optional explicit expiry timestamp; server defaults to 7 days
1155
1293
  */
1156
1294
  expiresAt?: string;
1295
+ /**
1296
+ * Body param: Optional per-transaction limit
1297
+ */
1298
+ limits?: AgentCreateCustomerParams.Limits;
1157
1299
  /**
1158
1300
  * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1159
1301
  */
@@ -1164,19 +1306,29 @@ export interface AgentCreateInvitationsParams {
1164
1306
  */
1165
1307
  'X-Instance-ID'?: string;
1166
1308
  }
1167
- export declare namespace AgentCreateInvitationsParams {
1168
- interface Agent {
1169
- agentId: string;
1170
- permissions: Array<string>;
1171
- limits?: Agent.Limits;
1309
+ export declare namespace AgentCreateCustomerParams {
1310
+ interface UnionMember0 {
1311
+ type: string;
1312
+ /**
1313
+ * Email address
1314
+ */
1315
+ value: string;
1172
1316
  }
1173
- namespace Agent {
1174
- interface Limits {
1175
- /**
1176
- * Per-transaction cap, integer cents (USD).
1177
- */
1178
- perTransaction?: number | null;
1179
- }
1317
+ interface UnionMember1 {
1318
+ type: string;
1319
+ /**
1320
+ * Phone number in E.164 format
1321
+ */
1322
+ value: string;
1323
+ }
1324
+ /**
1325
+ * Optional per-transaction limit
1326
+ */
1327
+ interface Limits {
1328
+ /**
1329
+ * Per-transaction cap, integer cents (USD).
1330
+ */
1331
+ perTransaction?: number | null;
1180
1332
  }
1181
1333
  }
1182
1334
  export interface AgentGetParams {
@@ -1190,27 +1342,30 @@ export interface AgentGetParams {
1190
1342
  */
1191
1343
  'X-Instance-ID'?: string;
1192
1344
  }
1193
- export interface AgentListInvitationsForDeveloperParams {
1345
+ export interface AgentGetCustomerParams {
1194
1346
  /**
1195
- * Query param
1347
+ * Path param: Agent ID
1196
1348
  */
1197
- agentId?: string;
1349
+ agentId: string;
1198
1350
  /**
1199
- * Query param
1351
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1200
1352
  */
1201
- cursor?: string;
1353
+ 'X-Agent-ID'?: string;
1202
1354
  /**
1203
- * Query param
1355
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
1356
+ * for agent observability.
1204
1357
  */
1205
- customerEmail?: string;
1358
+ 'X-Instance-ID'?: string;
1359
+ }
1360
+ export interface AgentListCustomersParams {
1206
1361
  /**
1207
1362
  * Query param
1208
1363
  */
1209
- limit?: number;
1364
+ cursor?: string;
1210
1365
  /**
1211
1366
  * Query param
1212
1367
  */
1213
- status?: Array<'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED'>;
1368
+ limit?: number;
1214
1369
  /**
1215
1370
  * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1216
1371
  */
@@ -1237,7 +1392,27 @@ export interface AgentRemoveParams {
1237
1392
  */
1238
1393
  'X-Instance-ID'?: string;
1239
1394
  }
1395
+ export interface AgentRemoveCustomerParams {
1396
+ /**
1397
+ * Path param: Agent ID
1398
+ */
1399
+ agentId: string;
1400
+ /**
1401
+ * Header param: Unique key for idempotent request handling. If a request with the
1402
+ * same key was already processed, the original response is returned.
1403
+ */
1404
+ 'Idempotency-Key': string;
1405
+ /**
1406
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1407
+ */
1408
+ 'X-Agent-ID'?: string;
1409
+ /**
1410
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
1411
+ * for agent observability.
1412
+ */
1413
+ 'X-Instance-ID'?: string;
1414
+ }
1240
1415
  export declare namespace Agents {
1241
- export { type AgentCreateResponse as AgentCreateResponse, type AgentUpdateResponse as AgentUpdateResponse, type AgentListResponse as AgentListResponse, type AgentCreateInvitationsResponse as AgentCreateInvitationsResponse, type AgentGetResponse as AgentGetResponse, type AgentListInvitationsForDeveloperResponse as AgentListInvitationsForDeveloperResponse, type AgentRemoveResponse as AgentRemoveResponse, type AgentCreateParams as AgentCreateParams, type AgentUpdateParams as AgentUpdateParams, type AgentListParams as AgentListParams, type AgentCreateInvitationsParams as AgentCreateInvitationsParams, type AgentGetParams as AgentGetParams, type AgentListInvitationsForDeveloperParams as AgentListInvitationsForDeveloperParams, type AgentRemoveParams as AgentRemoveParams, };
1416
+ export { type AgentCreateResponse as AgentCreateResponse, type AgentUpdateResponse as AgentUpdateResponse, type AgentListResponse as AgentListResponse, type AgentCreateCustomerResponse as AgentCreateCustomerResponse, type AgentGetResponse as AgentGetResponse, type AgentGetCustomerResponse as AgentGetCustomerResponse, type AgentListCustomersResponse as AgentListCustomersResponse, type AgentRemoveResponse as AgentRemoveResponse, type AgentRemoveCustomerResponse as AgentRemoveCustomerResponse, type AgentCreateParams as AgentCreateParams, type AgentUpdateParams as AgentUpdateParams, type AgentListParams as AgentListParams, type AgentCreateCustomerParams as AgentCreateCustomerParams, type AgentGetParams as AgentGetParams, type AgentGetCustomerParams as AgentGetCustomerParams, type AgentListCustomersParams as AgentListCustomersParams, type AgentRemoveParams as AgentRemoveParams, type AgentRemoveCustomerParams as AgentRemoveCustomerParams, };
1242
1417
  }
1243
1418
  //# sourceMappingURL=agents.d.ts.map