@naturalpay/sdk 0.4.0 → 0.5.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 +9 -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 +554 -268
  21. package/resources/agents.d.mts.map +1 -1
  22. package/resources/agents.d.ts +554 -268
  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 +676 -300
  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.
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * const response = await client.agents.getCustomer(
76
+ * 'pty_ecc2efdd09bd231a9ad9bd2aada37aa7',
77
+ * { agentId: 'agt_ecc2efdd09bd231a9ad9bd2aada37aa7' },
78
+ * );
79
+ * ```
80
+ */
81
+ getCustomer(customerID: string, params: AgentGetCustomerParams, options?: RequestOptions): APIPromise<AgentGetCustomerResponse>;
82
+ /**
83
+ * List customer invitations for this agent.
73
84
  *
74
85
  * @example
75
86
  * ```ts
76
- * const response =
77
- * await client.agents.listInvitationsForDeveloper();
87
+ * const response = await client.agents.listCustomers(
88
+ * 'agt_ecc2efdd09bd231a9ad9bd2aada37aa7',
89
+ * );
78
90
  * ```
79
91
  */
80
- listInvitationsForDeveloper(params?: AgentListInvitationsForDeveloperParams | null | undefined, options?: RequestOptions): APIPromise<AgentListInvitationsForDeveloperResponse>;
92
+ listCustomers(agentID: string, params?: AgentListCustomersParams | null | undefined, options?: RequestOptions): APIPromise<AgentListCustomersResponse>;
81
93
  /**
82
- * Revoke an agent.
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
481
480
  */
482
- status: 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED';
481
+ recipient: Attributes.UnionMember0 | Attributes.UnionMember1 | Attributes.UnionMember2;
482
+ /**
483
+ * Current invitation status
484
+ */
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 attributes
731
724
  */
732
725
  attributes: Data.Attributes;
733
726
  /**
734
- * Related resource identifiers
727
+ * Related agent and access details
735
728
  */
736
729
  relationships: Data.Relationships;
737
730
  /**
@@ -741,180 +734,279 @@ export declare namespace AgentListInvitationsForDeveloperResponse {
741
734
  }
742
735
  namespace Data {
743
736
  /**
744
- * Resource attributes
737
+ * Customer party attributes
745
738
  */
746
739
  interface Attributes {
747
740
  /**
748
- * When this invitation was accepted
741
+ * Customer email, when known
749
742
  */
750
- acceptedAt: string | null;
743
+ email: string | null;
751
744
  /**
752
- * Display name of the agent being delegated
745
+ * Customer party display name, when known
753
746
  */
754
- agentName: string;
747
+ name: string | null;
755
748
  /**
756
- * Why the invitation was cancelled
749
+ * The customer is represented by a party
757
750
  */
758
- cancelReason: 'AGENT_RETIRED' | 'DEVELOPER_RETIRED' | null;
759
- /**
760
- * When this invitation was created
761
- */
762
- createdAt: string;
763
- /**
764
- * When this invitation was declined
765
- */
766
- declinedAt: string | null;
767
- /**
768
- * Display name of the developer party
769
- */
770
- developerName: string;
771
- /**
772
- * Status after applying expiry and cancel-reason overlays
773
- */
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;
783
- /**
784
- * Per-agent transaction limits
785
- */
786
- limits: Attributes.Limits | null;
787
- /**
788
- * Permissions the agent will hold on accept
789
- */
790
- permissions: Array<string>;
791
- /**
792
- * Raw persisted status
793
- */
794
- status: 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED';
795
- /**
796
- * When this invitation was last updated
797
- */
798
- updatedAt: string;
799
- }
800
- namespace Attributes {
801
- /**
802
- * Per-agent transaction limits
803
- */
804
- interface Limits {
805
- /**
806
- * Per-transaction cap, integer cents (USD).
807
- */
808
- perTransaction?: number | null;
809
- }
751
+ type: string;
810
752
  }
811
753
  /**
812
- * Related resource identifiers
754
+ * Related agent and access details
813
755
  */
814
756
  interface Relationships {
815
757
  /**
816
- * Agent being delegated
817
- */
818
- agent: Relationships.Agent;
819
- /**
820
- * Resulting agent delegation once accepted; currently null on public create/list
821
- * responses
758
+ * This agent's access state for the customer
822
759
  */
823
- agentDelegation: Relationships.AgentDelegation;
760
+ access: Relationships.Access;
824
761
  /**
825
- * Customer party the invitation was accepted on (null until accept)
762
+ * Agent attached to this customer
826
763
  */
827
- customerParty: Relationships.CustomerParty;
828
- /**
829
- * Developer party that issued the invitation
830
- */
831
- developerParty: Relationships.DeveloperParty;
764
+ agent: Relationships.Agent;
832
765
  }
833
766
  namespace Relationships {
834
767
  /**
835
- * Agent being delegated
768
+ * This agent's access state for the customer
836
769
  */
837
- interface Agent {
838
- /**
839
- * Related resource identifier
840
- */
841
- data: Agent.Data;
770
+ interface Access {
771
+ data: Access.Data;
842
772
  }
843
- namespace Agent {
844
- /**
845
- * Related resource identifier
846
- */
773
+ namespace Access {
847
774
  interface Data {
775
+ /**
776
+ * Underlying access record ID
777
+ */
848
778
  id: string;
779
+ /**
780
+ * Access attributes
781
+ */
782
+ attributes: Data.Attributes;
849
783
  /**
850
784
  * Resource type
851
785
  */
852
786
  type: string;
853
787
  }
788
+ namespace Data {
789
+ /**
790
+ * Access attributes
791
+ */
792
+ interface Attributes {
793
+ /**
794
+ * When this agent-customer relationship was created
795
+ */
796
+ createdAt: string;
797
+ /**
798
+ * Per-agent customer transaction limits
799
+ */
800
+ limits: Attributes.Limits | null;
801
+ /**
802
+ * Permissions granted or requested for this agent
803
+ */
804
+ permissions: Array<string>;
805
+ /**
806
+ * Current agent-customer relationship status
807
+ */
808
+ status: 'ACTIVE' | 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED' | 'REVOKED';
809
+ /**
810
+ * When this agent-customer relationship was last updated
811
+ */
812
+ updatedAt: string | null;
813
+ }
814
+ namespace Attributes {
815
+ /**
816
+ * Per-agent customer transaction limits
817
+ */
818
+ interface Limits {
819
+ /**
820
+ * Per-transaction cap, integer cents (USD).
821
+ */
822
+ perTransaction?: number | null;
823
+ }
824
+ }
825
+ }
854
826
  }
855
827
  /**
856
- * Resulting agent delegation once accepted; currently null on public create/list
857
- * responses
828
+ * Agent attached to this customer
858
829
  */
859
- interface AgentDelegation {
860
- /**
861
- * Related resource identifier
862
- */
863
- data: AgentDelegation.Data | null;
830
+ interface Agent {
831
+ data: Agent.Data;
864
832
  }
865
- namespace AgentDelegation {
866
- /**
867
- * Related resource identifier
868
- */
833
+ namespace Agent {
869
834
  interface Data {
835
+ /**
836
+ * Agent ID (agt\_\*)
837
+ */
870
838
  id: string;
839
+ /**
840
+ * Agent attributes
841
+ */
842
+ attributes: Data.Attributes;
871
843
  /**
872
844
  * Resource type
873
845
  */
874
846
  type: string;
875
847
  }
848
+ namespace Data {
849
+ /**
850
+ * Agent attributes
851
+ */
852
+ interface Attributes {
853
+ /**
854
+ * Agent display name
855
+ */
856
+ name: string | null;
857
+ }
858
+ }
876
859
  }
860
+ }
861
+ }
862
+ }
863
+ export interface AgentListCustomersResponse {
864
+ data: Array<AgentListCustomersResponse.Data>;
865
+ meta: AgentListCustomersResponse.Meta;
866
+ }
867
+ export declare namespace AgentListCustomersResponse {
868
+ interface Data {
869
+ /**
870
+ * Customer party ID when known; otherwise the lowercased customer email
871
+ */
872
+ id: string;
873
+ /**
874
+ * Customer party attributes
875
+ */
876
+ attributes: Data.Attributes;
877
+ /**
878
+ * Related agent and access details
879
+ */
880
+ relationships: Data.Relationships;
881
+ /**
882
+ * Resource type
883
+ */
884
+ type: string;
885
+ }
886
+ namespace Data {
887
+ /**
888
+ * Customer party attributes
889
+ */
890
+ interface Attributes {
877
891
  /**
878
- * Customer party the invitation was accepted on (null until accept)
892
+ * Customer email, when known
879
893
  */
880
- interface CustomerParty {
881
- /**
882
- * Related resource identifier
883
- */
884
- data: CustomerParty.Data | null;
894
+ email: string | null;
895
+ /**
896
+ * Customer party display name, when known
897
+ */
898
+ name: string | null;
899
+ /**
900
+ * The customer is represented by a party
901
+ */
902
+ type: string;
903
+ }
904
+ /**
905
+ * Related agent and access details
906
+ */
907
+ interface Relationships {
908
+ /**
909
+ * This agent's access state for the customer
910
+ */
911
+ access: Relationships.Access;
912
+ /**
913
+ * Agent attached to this customer
914
+ */
915
+ agent: Relationships.Agent;
916
+ }
917
+ namespace Relationships {
918
+ /**
919
+ * This agent's access state for the customer
920
+ */
921
+ interface Access {
922
+ data: Access.Data;
885
923
  }
886
- namespace CustomerParty {
887
- /**
888
- * Related resource identifier
889
- */
924
+ namespace Access {
890
925
  interface Data {
926
+ /**
927
+ * Underlying access record ID
928
+ */
891
929
  id: string;
930
+ /**
931
+ * Access attributes
932
+ */
933
+ attributes: Data.Attributes;
892
934
  /**
893
935
  * Resource type
894
936
  */
895
937
  type: string;
896
938
  }
939
+ namespace Data {
940
+ /**
941
+ * Access attributes
942
+ */
943
+ interface Attributes {
944
+ /**
945
+ * When this agent-customer relationship was created
946
+ */
947
+ createdAt: string;
948
+ /**
949
+ * Per-agent customer transaction limits
950
+ */
951
+ limits: Attributes.Limits | null;
952
+ /**
953
+ * Permissions granted or requested for this agent
954
+ */
955
+ permissions: Array<string>;
956
+ /**
957
+ * Current agent-customer relationship status
958
+ */
959
+ status: 'ACTIVE' | 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED' | 'REVOKED';
960
+ /**
961
+ * When this agent-customer relationship was last updated
962
+ */
963
+ updatedAt: string | null;
964
+ }
965
+ namespace Attributes {
966
+ /**
967
+ * Per-agent customer transaction limits
968
+ */
969
+ interface Limits {
970
+ /**
971
+ * Per-transaction cap, integer cents (USD).
972
+ */
973
+ perTransaction?: number | null;
974
+ }
975
+ }
976
+ }
897
977
  }
898
978
  /**
899
- * Developer party that issued the invitation
979
+ * Agent attached to this customer
900
980
  */
901
- interface DeveloperParty {
902
- /**
903
- * Related resource identifier
904
- */
905
- data: DeveloperParty.Data;
981
+ interface Agent {
982
+ data: Agent.Data;
906
983
  }
907
- namespace DeveloperParty {
908
- /**
909
- * Related resource identifier
910
- */
984
+ namespace Agent {
911
985
  interface Data {
986
+ /**
987
+ * Agent ID (agt\_\*)
988
+ */
912
989
  id: string;
990
+ /**
991
+ * Agent attributes
992
+ */
993
+ attributes: Data.Attributes;
913
994
  /**
914
995
  * Resource type
915
996
  */
916
997
  type: string;
917
998
  }
999
+ namespace Data {
1000
+ /**
1001
+ * Agent attributes
1002
+ */
1003
+ interface Attributes {
1004
+ /**
1005
+ * Agent display name
1006
+ */
1007
+ name: string | null;
1008
+ }
1009
+ }
918
1010
  }
919
1011
  }
920
1012
  }
@@ -1034,6 +1126,163 @@ export declare namespace AgentRemoveResponse {
1034
1126
  deleted: true;
1035
1127
  }
1036
1128
  }
1129
+ export interface AgentRemoveCustomerResponse {
1130
+ data: AgentRemoveCustomerResponse.Data;
1131
+ meta: AgentRemoveCustomerResponse.Meta;
1132
+ }
1133
+ export declare namespace AgentRemoveCustomerResponse {
1134
+ interface Data {
1135
+ /**
1136
+ * Customer party ID when known; otherwise the lowercased customer email
1137
+ */
1138
+ id: string;
1139
+ /**
1140
+ * Customer party attributes
1141
+ */
1142
+ attributes: Data.Attributes;
1143
+ /**
1144
+ * Related agent and access details
1145
+ */
1146
+ relationships: Data.Relationships;
1147
+ /**
1148
+ * Resource type
1149
+ */
1150
+ type: string;
1151
+ }
1152
+ namespace Data {
1153
+ /**
1154
+ * Customer party attributes
1155
+ */
1156
+ interface Attributes {
1157
+ /**
1158
+ * Customer email, when known
1159
+ */
1160
+ email: string | null;
1161
+ /**
1162
+ * Customer party display name, when known
1163
+ */
1164
+ name: string | null;
1165
+ /**
1166
+ * The customer is represented by a party
1167
+ */
1168
+ type: string;
1169
+ }
1170
+ /**
1171
+ * Related agent and access details
1172
+ */
1173
+ interface Relationships {
1174
+ /**
1175
+ * This agent's access state for the customer
1176
+ */
1177
+ access: Relationships.Access;
1178
+ /**
1179
+ * Agent attached to this customer
1180
+ */
1181
+ agent: Relationships.Agent;
1182
+ }
1183
+ namespace Relationships {
1184
+ /**
1185
+ * This agent's access state for the customer
1186
+ */
1187
+ interface Access {
1188
+ data: Access.Data;
1189
+ }
1190
+ namespace Access {
1191
+ interface Data {
1192
+ /**
1193
+ * Underlying access record ID
1194
+ */
1195
+ id: string;
1196
+ /**
1197
+ * Access attributes
1198
+ */
1199
+ attributes: Data.Attributes;
1200
+ /**
1201
+ * Resource type
1202
+ */
1203
+ type: string;
1204
+ }
1205
+ namespace Data {
1206
+ /**
1207
+ * Access attributes
1208
+ */
1209
+ interface Attributes {
1210
+ /**
1211
+ * When this agent-customer relationship was created
1212
+ */
1213
+ createdAt: string;
1214
+ /**
1215
+ * Per-agent customer transaction limits
1216
+ */
1217
+ limits: Attributes.Limits | null;
1218
+ /**
1219
+ * Permissions granted or requested for this agent
1220
+ */
1221
+ permissions: Array<string>;
1222
+ /**
1223
+ * Current agent-customer relationship status
1224
+ */
1225
+ status: 'ACTIVE' | 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED' | 'REVOKED';
1226
+ /**
1227
+ * When this agent-customer relationship was last updated
1228
+ */
1229
+ updatedAt: string | null;
1230
+ }
1231
+ namespace Attributes {
1232
+ /**
1233
+ * Per-agent customer transaction limits
1234
+ */
1235
+ interface Limits {
1236
+ /**
1237
+ * Per-transaction cap, integer cents (USD).
1238
+ */
1239
+ perTransaction?: number | null;
1240
+ }
1241
+ }
1242
+ }
1243
+ }
1244
+ /**
1245
+ * Agent attached to this customer
1246
+ */
1247
+ interface Agent {
1248
+ data: Agent.Data;
1249
+ }
1250
+ namespace Agent {
1251
+ interface Data {
1252
+ /**
1253
+ * Agent ID (agt\_\*)
1254
+ */
1255
+ id: string;
1256
+ /**
1257
+ * Agent attributes
1258
+ */
1259
+ attributes: Data.Attributes;
1260
+ /**
1261
+ * Resource type
1262
+ */
1263
+ type: string;
1264
+ }
1265
+ namespace Data {
1266
+ /**
1267
+ * Agent attributes
1268
+ */
1269
+ interface Attributes {
1270
+ /**
1271
+ * Agent display name
1272
+ */
1273
+ name: string | null;
1274
+ }
1275
+ }
1276
+ }
1277
+ }
1278
+ }
1279
+ interface Meta {
1280
+ /**
1281
+ * Indicates the resource was deleted
1282
+ */
1283
+ deleted: true;
1284
+ }
1285
+ }
1037
1286
  export interface AgentCreateParams {
1038
1287
  /**
1039
1288
  * Body param: Agent display name
@@ -1136,15 +1385,15 @@ export interface AgentListParams {
1136
1385
  */
1137
1386
  'X-Instance-ID'?: string;
1138
1387
  }
1139
- export interface AgentCreateInvitationsParams {
1388
+ export interface AgentCreateCustomerParams {
1140
1389
  /**
1141
- * Body param: Per-agent delegation requests (1-50)
1390
+ * Body param: Permissions to request
1142
1391
  */
1143
- agents: Array<AgentCreateInvitationsParams.Agent>;
1392
+ permissions: Array<string>;
1144
1393
  /**
1145
- * Body param: Email address of the customer to invite
1394
+ * Body param: Customer recipients to invite (1-50)
1146
1395
  */
1147
- customerEmail: string;
1396
+ recipients: Array<AgentCreateCustomerParams.UnionMember0 | AgentCreateCustomerParams.UnionMember1>;
1148
1397
  /**
1149
1398
  * Header param: Unique key for idempotent request handling. If a request with the
1150
1399
  * same key was already processed, the original response is returned.
@@ -1154,6 +1403,10 @@ export interface AgentCreateInvitationsParams {
1154
1403
  * Body param: Optional explicit expiry timestamp; server defaults to 7 days
1155
1404
  */
1156
1405
  expiresAt?: string;
1406
+ /**
1407
+ * Body param: Optional per-transaction limit
1408
+ */
1409
+ limits?: AgentCreateCustomerParams.Limits;
1157
1410
  /**
1158
1411
  * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1159
1412
  */
@@ -1164,19 +1417,29 @@ export interface AgentCreateInvitationsParams {
1164
1417
  */
1165
1418
  'X-Instance-ID'?: string;
1166
1419
  }
1167
- export declare namespace AgentCreateInvitationsParams {
1168
- interface Agent {
1169
- agentId: string;
1170
- permissions: Array<string>;
1171
- limits?: Agent.Limits;
1420
+ export declare namespace AgentCreateCustomerParams {
1421
+ interface UnionMember0 {
1422
+ type: string;
1423
+ /**
1424
+ * Email address
1425
+ */
1426
+ value: string;
1172
1427
  }
1173
- namespace Agent {
1174
- interface Limits {
1175
- /**
1176
- * Per-transaction cap, integer cents (USD).
1177
- */
1178
- perTransaction?: number | null;
1179
- }
1428
+ interface UnionMember1 {
1429
+ type: string;
1430
+ /**
1431
+ * Phone number in E.164 format
1432
+ */
1433
+ value: string;
1434
+ }
1435
+ /**
1436
+ * Optional per-transaction limit
1437
+ */
1438
+ interface Limits {
1439
+ /**
1440
+ * Per-transaction cap, integer cents (USD).
1441
+ */
1442
+ perTransaction?: number | null;
1180
1443
  }
1181
1444
  }
1182
1445
  export interface AgentGetParams {
@@ -1190,27 +1453,30 @@ export interface AgentGetParams {
1190
1453
  */
1191
1454
  'X-Instance-ID'?: string;
1192
1455
  }
1193
- export interface AgentListInvitationsForDeveloperParams {
1456
+ export interface AgentGetCustomerParams {
1194
1457
  /**
1195
- * Query param
1458
+ * Path param: Agent ID
1196
1459
  */
1197
- agentId?: string;
1460
+ agentId: string;
1198
1461
  /**
1199
- * Query param
1462
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1200
1463
  */
1201
- cursor?: string;
1464
+ 'X-Agent-ID'?: string;
1202
1465
  /**
1203
- * Query param
1466
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
1467
+ * for agent observability.
1204
1468
  */
1205
- customerEmail?: string;
1469
+ 'X-Instance-ID'?: string;
1470
+ }
1471
+ export interface AgentListCustomersParams {
1206
1472
  /**
1207
1473
  * Query param
1208
1474
  */
1209
- limit?: number;
1475
+ cursor?: string;
1210
1476
  /**
1211
1477
  * Query param
1212
1478
  */
1213
- status?: Array<'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED'>;
1479
+ limit?: number;
1214
1480
  /**
1215
1481
  * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1216
1482
  */
@@ -1237,7 +1503,27 @@ export interface AgentRemoveParams {
1237
1503
  */
1238
1504
  'X-Instance-ID'?: string;
1239
1505
  }
1506
+ export interface AgentRemoveCustomerParams {
1507
+ /**
1508
+ * Path param: Agent ID
1509
+ */
1510
+ agentId: string;
1511
+ /**
1512
+ * Header param: Unique key for idempotent request handling. If a request with the
1513
+ * same key was already processed, the original response is returned.
1514
+ */
1515
+ 'Idempotency-Key': string;
1516
+ /**
1517
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1518
+ */
1519
+ 'X-Agent-ID'?: string;
1520
+ /**
1521
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
1522
+ * for agent observability.
1523
+ */
1524
+ 'X-Instance-ID'?: string;
1525
+ }
1240
1526
  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, };
1527
+ 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
1528
  }
1243
1529
  //# sourceMappingURL=agents.d.mts.map