samva 0.10.0 → 0.12.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 (71) hide show
  1. package/README.md +59 -9
  2. package/dist/client/sdk.gen.d.ts +1126 -219
  3. package/dist/client/types.gen.d.ts +11655 -6311
  4. package/dist/{client-mI4S99Ts.js → client-Cj1bqIEe.js} +5169 -1639
  5. package/dist/{client-attribution-Bl4nTEsE.js → client-attribution-BTWYSXxo.js} +2 -2
  6. package/dist/effect/analytics.d.ts +18 -18
  7. package/dist/effect/analytics.js +1 -1
  8. package/dist/effect/api-keys.d.ts +99 -43
  9. package/dist/effect/api-keys.js +2 -4
  10. package/dist/effect/attachments.d.ts +5 -6
  11. package/dist/effect/attachments.js +1 -1
  12. package/dist/effect/brands.d.ts +4 -4
  13. package/dist/effect/brands.js +2 -2
  14. package/dist/effect/campaigns.d.ts +30 -60
  15. package/dist/effect/campaigns.js +1 -1
  16. package/dist/effect/client.js +1 -1
  17. package/dist/effect/contact-groups.d.ts +29 -46
  18. package/dist/effect/contact-groups.js +1 -1
  19. package/dist/effect/contacts.d.ts +324 -726
  20. package/dist/effect/contacts.js +10 -2
  21. package/dist/effect/conversations.d.ts +575 -1130
  22. package/dist/effect/conversations.js +14 -2
  23. package/dist/effect/custom-fields.d.ts +3 -53
  24. package/dist/effect/custom-fields.js +1 -1
  25. package/dist/effect/email.d.ts +349 -298
  26. package/dist/effect/email.js +9 -3
  27. package/dist/effect/extension-installations.d.ts +218 -0
  28. package/dist/effect/extension-installations.js +25 -0
  29. package/dist/effect/extensions.d.ts +192 -0
  30. package/dist/effect/extensions.js +19 -0
  31. package/dist/effect/feedback.d.ts +12 -0
  32. package/dist/effect/feedback.js +13 -0
  33. package/dist/effect/generated.d.ts +33011 -15519
  34. package/dist/effect/index.d.ts +6 -1
  35. package/dist/effect/index.js +7 -2
  36. package/dist/effect/internal/client.d.ts +3 -0
  37. package/dist/effect/internal/mailbox-events.d.ts +11 -0
  38. package/dist/effect/internal/operation.d.ts +20 -374
  39. package/dist/effect/mailboxes.d.ts +1676 -0
  40. package/dist/effect/mailboxes.js +3 -0
  41. package/dist/effect/media.d.ts +5 -5
  42. package/dist/effect/media.js +1 -1
  43. package/dist/effect/messages.d.ts +171 -938
  44. package/dist/effect/messages.js +6 -2
  45. package/dist/effect/namespaces.d.ts +82 -0
  46. package/dist/effect/namespaces.js +19 -0
  47. package/dist/effect/operations.d.ts +68 -12
  48. package/dist/effect/operations.js +1 -1
  49. package/dist/effect/organizations.d.ts +5 -4
  50. package/dist/effect/organizations.js +1 -1
  51. package/dist/effect/pagination.d.ts +16 -21
  52. package/dist/effect/scheduled-messages.d.ts +13 -23
  53. package/dist/effect/scheduled-messages.js +1 -1
  54. package/dist/effect/templates.d.ts +204 -281
  55. package/dist/effect/templates.js +2 -2
  56. package/dist/effect/unsubscribe-groups.d.ts +21 -75
  57. package/dist/effect/unsubscribe-groups.js +1 -1
  58. package/dist/effect/webhooks.d.ts +117 -39
  59. package/dist/effect/webhooks.js +2 -2
  60. package/dist/index.js +3 -2
  61. package/dist/mailbox-events-CsbF35vH.js +629 -0
  62. package/dist/mailbox-events.d.ts +178 -0
  63. package/dist/mailboxes-BtcktcNB.js +147 -0
  64. package/dist/{operation-DQWJO4jY.js → operation-BEghYyLu.js} +411 -67
  65. package/dist/promises/errors.gen.d.ts +5 -0
  66. package/dist/promises/index.d.ts +23 -1
  67. package/dist/promises/index.js +3 -2
  68. package/dist/promises/types.gen.d.ts +1 -1
  69. package/dist/{promises-C7D4oaHn.js → promises-BzrwhHEW.js} +3273 -547
  70. package/dist/service-map.d.ts +468 -36
  71. package/package.json +22 -2
@@ -1,5 +1,5 @@
1
1
  import { n as buildMessagesSendPayload, r as replyToEmailsPayload, t as buildEmailSendPayload } from "./normalize-B79uJIeb.js";
2
- import { t as Service, w as SamvaApi } from "./client-mI4S99Ts.js";
2
+ import { t as Service, w as SamvaApi } from "./client-Cj1bqIEe.js";
3
3
  import { generateIdempotencyKey, withRetry } from "./effect/retry.js";
4
4
  import { Effect, Option, Predicate, Stream } from "effect";
5
5
  //#region src/service-map.ts
@@ -26,11 +26,11 @@ const SDK_OPERATION_CALLS = {
26
26
  operationsList: { kind: "params" },
27
27
  operationsGet: {
28
28
  kind: "path",
29
- paths: ["operationId"]
29
+ paths: ["id"]
30
30
  },
31
31
  operationsRetry: {
32
32
  kind: "path",
33
- paths: ["operationId"]
33
+ paths: ["id"]
34
34
  },
35
35
  messagesList: { kind: "params" },
36
36
  messagesSend: { kind: "payload" },
@@ -52,25 +52,33 @@ const SDK_OPERATION_CALLS = {
52
52
  paths: ["id"]
53
53
  },
54
54
  messagesGetEvents: {
55
+ kind: "pathParams",
56
+ paths: ["id"]
57
+ },
58
+ messagesListDeliveries: {
59
+ kind: "path",
60
+ paths: ["id"]
61
+ },
62
+ messagesGetContent: {
55
63
  kind: "path",
56
64
  paths: ["id"]
57
65
  },
58
66
  mediaCreate: { kind: "payload" },
59
67
  mediaGetById: {
60
68
  kind: "path",
61
- paths: ["mediaId"]
69
+ paths: ["id"]
62
70
  },
63
71
  mediaRemove: {
64
72
  kind: "path",
65
- paths: ["mediaId"]
73
+ paths: ["id"]
66
74
  },
67
75
  mediaComplete: {
68
76
  kind: "path",
69
- paths: ["mediaId"]
77
+ paths: ["id"]
70
78
  },
71
79
  mediaDownloadUrl: {
72
80
  kind: "path",
73
- paths: ["mediaId"]
81
+ paths: ["id"]
74
82
  },
75
83
  scheduledMessagesList: { kind: "params" },
76
84
  scheduledMessagesCreate: { kind: "payload" },
@@ -178,7 +186,7 @@ const SDK_OPERATION_CALLS = {
178
186
  paths: ["id"]
179
187
  },
180
188
  emailGetDomainConnect: {
181
- kind: "path",
189
+ kind: "pathParams",
182
190
  paths: ["id"]
183
191
  },
184
192
  emailBuildDomainConnectApplyUrl: {
@@ -193,6 +201,10 @@ const SDK_OPERATION_CALLS = {
193
201
  kind: "pathPayload",
194
202
  paths: ["id"]
195
203
  },
204
+ emailGetReceivingStatus: {
205
+ kind: "path",
206
+ paths: ["id"]
207
+ },
196
208
  emailEnableCustomTracking: {
197
209
  kind: "pathPayload",
198
210
  paths: ["id"]
@@ -201,6 +213,10 @@ const SDK_OPERATION_CALLS = {
201
213
  kind: "path",
202
214
  paths: ["id"]
203
215
  },
216
+ emailRecheckCustomTracking: {
217
+ kind: "path",
218
+ paths: ["id"]
219
+ },
204
220
  emailGetCustomTrackingDomainConnect: {
205
221
  kind: "path",
206
222
  paths: ["id"]
@@ -264,12 +280,19 @@ const SDK_OPERATION_CALLS = {
264
280
  paths: ["id"]
265
281
  },
266
282
  emailGetStats: { kind: "params" },
267
- emailEnableCatchAll: { kind: "payload" },
268
- emailDisableCatchAll: { kind: "payload" },
283
+ emailEnableCatchAll: {
284
+ kind: "pathPayload",
285
+ paths: ["id"]
286
+ },
287
+ emailDisableCatchAll: {
288
+ kind: "path",
289
+ paths: ["id"]
290
+ },
269
291
  emailGetCatchAllConfig: { kind: "params" },
270
292
  emailUpdateCatchAllConfig: { kind: "payload" },
271
293
  emailGetCatchAllStats: { kind: "params" },
272
294
  emailListSuppressions: { kind: "params" },
295
+ emailCountSuppressions: { kind: "none" },
273
296
  emailRemoveSuppression: {
274
297
  kind: "path",
275
298
  paths: ["id"]
@@ -311,6 +334,30 @@ const SDK_OPERATION_CALLS = {
311
334
  kind: "pathPayload",
312
335
  paths: ["id"]
313
336
  },
337
+ conversationsAddTags: {
338
+ kind: "pathPayload",
339
+ paths: ["id"]
340
+ },
341
+ conversationsRemoveTags: {
342
+ kind: "pathPayload",
343
+ paths: ["id"]
344
+ },
345
+ conversationsAddCategories: {
346
+ kind: "pathPayload",
347
+ paths: ["id"]
348
+ },
349
+ conversationsRemoveCategories: {
350
+ kind: "pathPayload",
351
+ paths: ["id"]
352
+ },
353
+ conversationsAddChannels: {
354
+ kind: "pathPayload",
355
+ paths: ["id"]
356
+ },
357
+ conversationsRemoveChannels: {
358
+ kind: "pathPayload",
359
+ paths: ["id"]
360
+ },
314
361
  conversationsAddContacts: {
315
362
  kind: "pathPayload",
316
363
  paths: ["id"]
@@ -335,6 +382,22 @@ const SDK_OPERATION_CALLS = {
335
382
  kind: "pathPayload",
336
383
  paths: ["id"]
337
384
  },
385
+ contactsAddIdentity: {
386
+ kind: "pathPayload",
387
+ paths: ["id"]
388
+ },
389
+ contactsRemoveIdentity: {
390
+ kind: "path",
391
+ paths: ["id", "identityId"]
392
+ },
393
+ contactsAddTags: {
394
+ kind: "pathPayload",
395
+ paths: ["id"]
396
+ },
397
+ contactsRemoveTags: {
398
+ kind: "pathPayload",
399
+ paths: ["id"]
400
+ },
338
401
  contactsGetEngagement: {
339
402
  kind: "path",
340
403
  paths: ["id"]
@@ -349,28 +412,28 @@ const SDK_OPERATION_CALLS = {
349
412
  paths: ["id"]
350
413
  },
351
414
  contactsGetGroupMemberships: {
352
- kind: "path",
415
+ kind: "pathParams",
353
416
  paths: ["id"]
354
417
  },
355
418
  templatesList: { kind: "params" },
356
419
  templatesCreate: { kind: "payload" },
357
420
  templatesAddEntry: {
358
421
  kind: "pathPayload",
359
- paths: ["projectId"]
422
+ paths: ["id"]
360
423
  },
361
424
  templatesListFamilies: { kind: "params" },
362
425
  templatesCreateFamily: { kind: "payload" },
363
426
  templatesGetFamily: {
364
427
  kind: "path",
365
- paths: ["familyId"]
428
+ paths: ["id"]
366
429
  },
367
430
  templatesDeleteFamily: {
368
431
  kind: "path",
369
- paths: ["familyId"]
432
+ paths: ["id"]
370
433
  },
371
434
  templatesRenameFamily: {
372
435
  kind: "pathPayload",
373
- paths: ["familyId"]
436
+ paths: ["id"]
374
437
  },
375
438
  templatesCreateFamilyFromTemplate: {
376
439
  kind: "pathPayload",
@@ -378,11 +441,11 @@ const SDK_OPERATION_CALLS = {
378
441
  },
379
442
  templatesAttachFamilyMember: {
380
443
  kind: "path",
381
- paths: ["familyId", "templateId"]
444
+ paths: ["id", "templateId"]
382
445
  },
383
446
  templatesDetachFamilyMember: {
384
447
  kind: "path",
385
- paths: ["familyId", "templateId"]
448
+ paths: ["id", "templateId"]
386
449
  },
387
450
  templatesGetById: {
388
451
  kind: "path",
@@ -461,7 +524,7 @@ const SDK_OPERATION_CALLS = {
461
524
  paths: ["id", "publicationId"]
462
525
  },
463
526
  templatesListInputContracts: {
464
- kind: "path",
527
+ kind: "pathParams",
465
528
  paths: ["id"]
466
529
  },
467
530
  templatesGetInputContract: {
@@ -488,19 +551,19 @@ const SDK_OPERATION_CALLS = {
488
551
  },
489
552
  webhooksGetLogs: {
490
553
  kind: "pathParams",
491
- paths: ["webhookId"]
554
+ paths: ["id"]
492
555
  },
493
556
  webhooksGetStats: {
494
557
  kind: "pathParams",
495
- paths: ["webhookId"]
558
+ paths: ["id"]
496
559
  },
497
560
  webhooksRetryDelivery: {
498
- kind: "pathPayload",
499
- paths: ["webhookId"]
561
+ kind: "path",
562
+ paths: ["id", "deliveryId"]
500
563
  },
501
564
  webhooksRegenerateSecret: {
502
565
  kind: "path",
503
- paths: ["webhookId"]
566
+ paths: ["id"]
504
567
  },
505
568
  organizationsCreate: { kind: "payload" },
506
569
  organizationsGet: { kind: "none" },
@@ -526,10 +589,6 @@ const SDK_OPERATION_CALLS = {
526
589
  kind: "path",
527
590
  paths: ["id"]
528
591
  },
529
- apiKeysRemove: {
530
- kind: "path",
531
- paths: ["id"]
532
- },
533
592
  apiKeysGetStats: {
534
593
  kind: "pathParams",
535
594
  paths: ["id"]
@@ -538,6 +597,7 @@ const SDK_OPERATION_CALLS = {
538
597
  kind: "pathParams",
539
598
  paths: ["id"]
540
599
  },
600
+ feedbackSend: { kind: "payload" },
541
601
  attachmentsList: { kind: "params" },
542
602
  attachmentsGetById: {
543
603
  kind: "path",
@@ -568,21 +628,21 @@ const SDK_OPERATION_CALLS = {
568
628
  contactGroupsPreview: { kind: "payload" },
569
629
  contactGroupsEvaluateDynamic: {
570
630
  kind: "path",
571
- paths: ["groupId"]
631
+ paths: ["id"]
572
632
  },
573
633
  contactGroupsGetMembers: {
574
634
  kind: "pathParams",
575
- paths: ["groupId"]
635
+ paths: ["id"]
576
636
  },
577
637
  contactGroupsAddMembers: {
578
638
  kind: "pathPayload",
579
- paths: ["groupId"]
639
+ paths: ["id"]
580
640
  },
581
641
  contactGroupsRemoveMembers: {
582
642
  kind: "pathPayload",
583
- paths: ["groupId"]
643
+ paths: ["id"]
584
644
  },
585
- customFieldsList: { kind: "params" },
645
+ customFieldsList: { kind: "none" },
586
646
  customFieldsCreate: { kind: "payload" },
587
647
  customFieldsUpdate: {
588
648
  kind: "pathPayload",
@@ -592,7 +652,7 @@ const SDK_OPERATION_CALLS = {
592
652
  kind: "path",
593
653
  paths: ["id"]
594
654
  },
595
- unsubscribeList: { kind: "params" },
655
+ unsubscribeList: { kind: "none" },
596
656
  unsubscribeCreate: { kind: "payload" },
597
657
  unsubscribeUpdate: {
598
658
  kind: "pathPayload",
@@ -608,15 +668,15 @@ const SDK_OPERATION_CALLS = {
608
668
  },
609
669
  unsubscribeListMembers: {
610
670
  kind: "pathParams",
611
- paths: ["groupId"]
671
+ paths: ["id"]
612
672
  },
613
673
  unsubscribeAddEmails: {
614
674
  kind: "pathPayload",
615
- paths: ["groupId"]
675
+ paths: ["id"]
616
676
  },
617
677
  unsubscribeRemoveEmails: {
618
678
  kind: "pathPayload",
619
- paths: ["groupId"]
679
+ paths: ["id"]
620
680
  },
621
681
  unsubscribeCheckSubscription: { kind: "params" },
622
682
  analyticsGetStats: { kind: "params" },
@@ -624,62 +684,331 @@ const SDK_OPERATION_CALLS = {
624
684
  analyticsGetTopContacts: { kind: "params" },
625
685
  analyticsGetHourlyDistribution: { kind: "params" },
626
686
  analyticsGetDeliveryMetrics: { kind: "params" },
627
- analyticsExportData: { kind: "payload" }
687
+ analyticsExportData: { kind: "payload" },
688
+ mailboxesList: { kind: "params" },
689
+ mailboxesCreate: { kind: "payload" },
690
+ mailboxesGet: {
691
+ kind: "path",
692
+ paths: ["id"]
693
+ },
694
+ mailboxesUpdate: {
695
+ kind: "pathPayload",
696
+ paths: ["id"]
697
+ },
698
+ mailboxesRemove: {
699
+ kind: "path",
700
+ paths: ["id"]
701
+ },
702
+ mailboxesPause: {
703
+ kind: "path",
704
+ paths: ["id"]
705
+ },
706
+ mailboxesResume: {
707
+ kind: "path",
708
+ paths: ["id"]
709
+ },
710
+ mailboxesGetAgentActivity: {
711
+ kind: "pathParams",
712
+ paths: ["id"]
713
+ },
714
+ mailboxesListGrants: {
715
+ kind: "pathParams",
716
+ paths: ["id"]
717
+ },
718
+ mailboxesCreateGrant: {
719
+ kind: "pathPayload",
720
+ paths: ["id"]
721
+ },
722
+ mailboxesUpdateGrant: {
723
+ kind: "pathPayload",
724
+ paths: ["id", "grantId"]
725
+ },
726
+ mailboxesRevokeGrant: {
727
+ kind: "path",
728
+ paths: ["id", "grantId"]
729
+ },
730
+ mailboxesListPolicies: {
731
+ kind: "path",
732
+ paths: ["id"]
733
+ },
734
+ mailboxesCreatePolicy: {
735
+ kind: "pathPayload",
736
+ paths: ["id"]
737
+ },
738
+ mailboxesGetPolicy: {
739
+ kind: "path",
740
+ paths: ["id", "policyId"]
741
+ },
742
+ mailboxesUpdatePolicy: {
743
+ kind: "pathPayload",
744
+ paths: ["id", "policyId"]
745
+ },
746
+ mailboxesDeletePolicy: {
747
+ kind: "path",
748
+ paths: ["id", "policyId"]
749
+ },
750
+ mailboxesListFolders: {
751
+ kind: "path",
752
+ paths: ["id"]
753
+ },
754
+ mailboxesListLabels: {
755
+ kind: "path",
756
+ paths: ["id"]
757
+ },
758
+ mailboxesCreateLabel: {
759
+ kind: "pathPayload",
760
+ paths: ["id"]
761
+ },
762
+ mailboxesUpdateLabel: {
763
+ kind: "pathPayload",
764
+ paths: ["id", "labelId"]
765
+ },
766
+ mailboxesDeleteLabel: {
767
+ kind: "path",
768
+ paths: ["id", "labelId"]
769
+ },
770
+ mailboxesListThreads: {
771
+ kind: "pathParams",
772
+ paths: ["id"]
773
+ },
774
+ mailboxesGetThread: {
775
+ kind: "path",
776
+ paths: ["id", "threadId"]
777
+ },
778
+ mailboxesUpdateThread: {
779
+ kind: "pathPayload",
780
+ paths: ["id", "threadId"]
781
+ },
782
+ mailboxesAddThreadLabels: {
783
+ kind: "pathPayload",
784
+ paths: ["id", "threadId"]
785
+ },
786
+ mailboxesRemoveThreadLabels: {
787
+ kind: "pathPayload",
788
+ paths: ["id", "threadId"]
789
+ },
790
+ mailboxesListThreadMessages: {
791
+ kind: "pathParams",
792
+ paths: ["id", "threadId"]
793
+ },
794
+ mailboxesGetThreadContent: {
795
+ kind: "pathParams",
796
+ paths: ["id", "threadId"]
797
+ },
798
+ mailboxesListThreadNotes: {
799
+ kind: "pathParams",
800
+ paths: ["id", "threadId"]
801
+ },
802
+ mailboxesCreateNote: {
803
+ kind: "pathPayload",
804
+ paths: ["id", "threadId"]
805
+ },
806
+ mailboxesUpdateNote: {
807
+ kind: "pathPayload",
808
+ paths: [
809
+ "id",
810
+ "threadId",
811
+ "noteId"
812
+ ]
813
+ },
814
+ mailboxesDeleteNote: {
815
+ kind: "path",
816
+ paths: [
817
+ "id",
818
+ "threadId",
819
+ "noteId"
820
+ ]
821
+ },
822
+ mailboxesSendMessage: {
823
+ kind: "optionalIdempotentPathPayload",
824
+ paths: ["id"]
825
+ },
826
+ mailboxesGetMessage: {
827
+ kind: "path",
828
+ paths: ["id", "messageId"]
829
+ },
830
+ mailboxesGetMessageRaw: {
831
+ kind: "path",
832
+ paths: ["id", "messageId"]
833
+ },
834
+ mailboxesGetMessageAttachment: {
835
+ kind: "path",
836
+ paths: [
837
+ "id",
838
+ "messageId",
839
+ "attachmentId"
840
+ ]
841
+ },
842
+ mailboxesReply: {
843
+ kind: "optionalIdempotentPathPayload",
844
+ paths: ["id", "messageId"]
845
+ },
846
+ mailboxesReplyAll: {
847
+ kind: "optionalIdempotentPathPayload",
848
+ paths: ["id", "messageId"]
849
+ },
850
+ mailboxesForward: {
851
+ kind: "optionalIdempotentPathPayload",
852
+ paths: ["id", "messageId"]
853
+ },
854
+ mailboxesListQuarantine: {
855
+ kind: "pathParams",
856
+ paths: ["id"]
857
+ },
858
+ mailboxesReleaseMessage: {
859
+ kind: "path",
860
+ paths: ["id", "messageId"]
861
+ },
862
+ mailboxesDiscardMessage: {
863
+ kind: "path",
864
+ paths: ["id", "messageId"]
865
+ },
866
+ mailboxesListDrafts: {
867
+ kind: "pathParams",
868
+ paths: ["id"]
869
+ },
870
+ mailboxesCreateDraft: {
871
+ kind: "pathPayload",
872
+ paths: ["id"]
873
+ },
874
+ mailboxesGetDraft: {
875
+ kind: "path",
876
+ paths: ["id", "draftId"]
877
+ },
878
+ mailboxesUpdateDraft: {
879
+ kind: "pathPayload",
880
+ paths: ["id", "draftId"]
881
+ },
882
+ mailboxesDeleteDraft: {
883
+ kind: "path",
884
+ paths: ["id", "draftId"]
885
+ },
886
+ mailboxesSendDraft: {
887
+ kind: "optionalIdempotentPath",
888
+ paths: ["id", "draftId"]
889
+ },
890
+ mailboxesListActions: {
891
+ kind: "pathParams",
892
+ paths: ["id"]
893
+ },
894
+ mailboxesApproveAction: {
895
+ kind: "path",
896
+ paths: ["id", "actionId"]
897
+ },
898
+ mailboxesDenyAction: {
899
+ kind: "pathPayload",
900
+ paths: ["id", "actionId"]
901
+ },
902
+ mailboxesListEvents: {
903
+ kind: "pathParams",
904
+ paths: ["id"]
905
+ },
906
+ namespacesList: { kind: "params" },
907
+ namespacesCreate: { kind: "payload" },
908
+ namespacesGet: {
909
+ kind: "path",
910
+ paths: ["id"]
911
+ },
912
+ namespacesUpdate: {
913
+ kind: "pathPayload",
914
+ paths: ["id"]
915
+ },
916
+ namespacesRemove: {
917
+ kind: "path",
918
+ paths: ["id"]
919
+ },
920
+ extensionsList: { kind: "params" },
921
+ extensionsPublish: { kind: "payload" },
922
+ extensionsGet: {
923
+ kind: "path",
924
+ paths: ["id"]
925
+ },
926
+ extensionsListVersions: {
927
+ kind: "pathParams",
928
+ paths: ["id"]
929
+ },
930
+ extensionsGetVersion: {
931
+ kind: "path",
932
+ paths: ["id", "versionId"]
933
+ },
934
+ extensionInstallationsList: { kind: "params" },
935
+ extensionInstallationsInstall: { kind: "payload" },
936
+ extensionInstallationsGet: {
937
+ kind: "path",
938
+ paths: ["id"]
939
+ },
940
+ extensionInstallationsUninstall: {
941
+ kind: "path",
942
+ paths: ["id"]
943
+ },
944
+ extensionInstallationsDisable: {
945
+ kind: "path",
946
+ paths: ["id"]
947
+ },
948
+ extensionInstallationsEnable: {
949
+ kind: "path",
950
+ paths: ["id"]
951
+ },
952
+ extensionInstallationsListRuns: {
953
+ kind: "path",
954
+ paths: ["id"]
955
+ },
956
+ extensionInstallationsGetRun: {
957
+ kind: "path",
958
+ paths: ["id", "runId"]
959
+ }
628
960
  };
629
961
  //#endregion
630
962
  //#region src/effect/pagination.ts
631
963
  /**
632
964
  * Stream pagination for the Effect SDK.
633
965
  *
634
- * Every list operation whose success value is the uniform page envelope —
635
- * `{ items, pagination: { page, limit, total, totalPages } }` — gains `.pages()`
636
- * and `.items()` companions on its domain operation. `.pages()`
637
- * streams the raw envelopes; `.items()` flattens them into a stream of items.
966
+ * Every list operation whose success value is a page envelope gains `.pages()`
967
+ * and `.items()` companions on its domain operation. `.pages()` streams the raw
968
+ * envelopes; `.items()` flattens them into a stream of items. Every list pages
969
+ * by cursor, `{ items, nextCursor }`: each step passes the previous page's
970
+ * `nextCursor` as `cursor`, and the walk stops at a null `nextCursor`.
638
971
  *
639
972
  * The traversal is **lazy**: built on `Stream.paginate` (a pull-based source),
640
973
  * so each page is fetched only as the stream is consumed — `Stream.take(n)`
641
- * stops requesting further pages. Caller params (start `page`, `limit`, filters)
642
- * are respected; only `page` is advanced per step, and the walk stops once the
643
- * server-echoed `page` reaches `totalPages`.
974
+ * stops requesting further pages. Caller params (the start `cursor`,
975
+ * `limit`, filters) are respected; only the position is advanced per step.
644
976
  *
645
977
  * Retry is **not** re-applied here: the underlying domain operation is already
646
978
  * wrapped in the ambient {@link import("./retry").Service} policy (reads are
647
979
  * retry-safe), so each page fetch retries on its own and pagination composes
648
980
  * with retry instead of nesting retries.
649
981
  */
650
- /** The next page number, or `none` once the last page has been yielded. */
651
- const nextPage = (pagination) => pagination.page < pagination.totalPages ? Option.some(pagination.page + 1) : Option.none();
652
- /** Honor a caller-supplied start `page`; default to the first page otherwise. */
653
- const startPageOf = (input) => {
654
- const page = input?.page;
655
- const parsed = typeof page === "string" ? Number(page) : NaN;
656
- return Number.isFinite(parsed) && parsed >= 1 ? parsed : 1;
982
+ /** Honor a caller-supplied start `cursor`; default to the first page otherwise. */
983
+ const startCursorOf = (input) => {
984
+ const cursor = input?.cursor;
985
+ return typeof cursor === "string" ? cursor : void 0;
657
986
  };
658
- /** Fetch one page at `page`, preserving all other caller params. */
659
- const fetchPage = (operation, input, page) => operation({
987
+ /** Fetch the page at `cursor`, preserving all other caller params. */
988
+ const fetchCursorPage = (operation, input, cursor) => operation({
660
989
  ...input,
661
- page: page.toString()
990
+ cursor
662
991
  });
663
- /** Stream the raw page envelopes, one per request, from the caller's start page. */
664
- const streamPages = (operation, input) => Stream.paginate(startPageOf(input), (page) => fetchPage(operation, input, page).pipe(Effect.map((result) => [[result], nextPage(result.pagination)])));
665
- /** Stream individual items across pages, fetching the next page only when pulled. */
666
- const streamItems = (operation, input) => Stream.paginate(startPageOf(input), (page) => fetchPage(operation, input, page).pipe(Effect.map((result) => [result.items, nextPage(result.pagination)])));
992
+ /** Stream the raw cursor page envelopes, one per request, from the caller's start cursor. */
993
+ const streamCursorPages = (operation, input) => Stream.paginate(startCursorOf(input), (cursor) => fetchCursorPage(operation, input, cursor).pipe(Effect.map((result) => [[result], Option.fromNullishOr(result.nextCursor)])));
994
+ /** Stream individual items across cursor pages, fetching the next page only when pulled. */
995
+ const streamCursorItems = (operation, input) => Stream.paginate(startCursorOf(input), (cursor) => fetchCursorPage(operation, input, cursor).pipe(Effect.map((result) => [result.items, Option.fromNullishOr(result.nextCursor)])));
667
996
  //#endregion
668
997
  //#region src/effect/internal/operation.ts
669
998
  const hasField = (node, name) => node?.propertySignatures?.some((property) => property.name === name) ?? false;
670
- const isPaginatedSuccess = (success) => {
999
+ const isCursorPaged = (success) => {
671
1000
  if (!(success instanceof Set)) return false;
672
1001
  for (const schema of success) for (const node of [
673
1002
  schema.ast,
674
1003
  schema.ast?.to,
675
1004
  schema.ast?.from
676
- ]) if (hasField(node, "items") && hasField(node, "pagination")) return true;
1005
+ ]) if (hasField(node, "items") && hasField(node, "nextCursor")) return true;
677
1006
  return false;
678
1007
  };
679
1008
  const paginatedOperations = () => {
680
1009
  const paginated = /* @__PURE__ */ new Set();
681
1010
  const groups = SamvaApi.groups;
682
- for (const group of Object.values(groups)) for (const [name, endpoint] of Object.entries(group.endpoints)) if (isPaginatedSuccess(endpoint.success)) paginated.add(name);
1011
+ for (const group of Object.values(groups)) for (const [name, endpoint] of Object.entries(group.endpoints)) if (isCursorPaged(endpoint.success)) paginated.add(name);
683
1012
  return paginated;
684
1013
  };
685
1014
  const PAGINATED_OPERATIONS = paginatedOperations();
@@ -702,8 +1031,12 @@ const MODULE_NAMES = {
702
1031
  conversations: "Conversations",
703
1032
  customFields: "CustomFields",
704
1033
  email: "Email",
1034
+ extensions: "Extensions",
1035
+ feedback: "Feedback",
1036
+ mailboxes: "Mailboxes",
705
1037
  media: "Media",
706
1038
  messages: "Messages",
1039
+ namespaces: "Namespaces",
707
1040
  operations: "Operations",
708
1041
  organizations: "Organizations",
709
1042
  scheduledMessages: "ScheduledMessages",
@@ -751,21 +1084,32 @@ const adapt = (operationName, rawCall, input) => {
751
1084
  params,
752
1085
  headers: { "idempotency-key": inputRecord.idempotencyKey }
753
1086
  });
754
- const remainingInput = stripUndefined(Object.fromEntries(Object.entries(inputRecord).filter(([key]) => !pathDescriptor.paths.includes(key))));
1087
+ const optionalKeyHeaders = { headers: inputRecord.idempotencyKey === void 0 ? {} : { "idempotency-key": inputRecord.idempotencyKey } };
1088
+ if (pathDescriptor.kind === "optionalIdempotentPath") return call({
1089
+ params,
1090
+ ...optionalKeyHeaders
1091
+ });
1092
+ const headerKey = pathDescriptor.kind === "optionalIdempotentPathPayload";
1093
+ const remainingInput = stripUndefined(Object.fromEntries(Object.entries(inputRecord).filter(([key]) => !pathDescriptor.paths.includes(key) && !(headerKey && key === "idempotencyKey"))));
1094
+ if (pathDescriptor.kind === "optionalIdempotentPathPayload") return call({
1095
+ params,
1096
+ payload: remainingInput,
1097
+ ...optionalKeyHeaders
1098
+ });
755
1099
  return call({
756
1100
  params,
757
1101
  [pathDescriptor.kind === "pathParams" ? "query" : "payload"]: remainingInput
758
1102
  });
759
1103
  };
760
- const isPageEnvelope = (value) => Predicate.isObject(value) && Array.isArray(value.items) && Predicate.isObject(value.pagination) && typeof value.pagination.page === "number" && typeof value.pagination.limit === "number" && typeof value.pagination.total === "number" && typeof value.pagination.totalPages === "number";
1104
+ const isCursorPageEnvelope = (value) => Predicate.isObject(value) && Array.isArray(value.items) && (value.nextCursor === null || typeof value.nextCursor === "string");
761
1105
  const make = (operationName) => {
762
1106
  const call = Effect.fn(traceName(operationName))((input) => Effect.flatMap(Service, (client) => adapt(operationName, rawOperation(client, operationName), input)));
763
1107
  const operation = call;
764
1108
  if (PAGINATED_OPERATIONS.has(operationName)) {
765
- const list = (input) => Effect.filterOrElse(call(input), isPageEnvelope, () => Effect.die(/* @__PURE__ */ new Error(`${operationName} did not return a page envelope`)));
1109
+ const list = (input) => Effect.filterOrElse(call(input), isCursorPageEnvelope, () => Effect.die(/* @__PURE__ */ new Error(`${operationName} did not return a cursor page envelope`)));
766
1110
  Object.assign(operation, {
767
- pages: (input) => streamPages(list, input ?? {}),
768
- items: (input) => streamItems(list, input ?? {})
1111
+ pages: (input) => streamCursorPages(list, input ?? {}),
1112
+ items: (input) => streamCursorItems(list, input ?? {})
769
1113
  });
770
1114
  }
771
1115
  return operation;
@@ -799,4 +1143,4 @@ const addEmailSender = Effect.fn("Email.addSender")(function* (input, options) {
799
1143
  //#endregion
800
1144
  export { sendMessage as i, make as n, sendEmail as r, addEmailSender as t };
801
1145
 
802
- //# sourceMappingURL=operation-DQWJO4jY.js.map
1146
+ //# sourceMappingURL=operation-BEghYyLu.js.map