samva 0.9.0 → 0.11.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 +60 -10
  2. package/dist/client/sdk.gen.d.ts +1106 -215
  3. package/dist/client/types.gen.d.ts +11554 -6343
  4. package/dist/{client-DB7zbTti.js → client-8YXjfsVc.js} +6492 -3068
  5. package/dist/{client-attribution-vK1yjEdG.js → client-attribution-Ct2FKITg.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 +100 -44
  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 +6 -6
  13. package/dist/effect/brands.js +2 -2
  14. package/dist/effect/campaigns.d.ts +33 -63
  15. package/dist/effect/campaigns.js +1 -1
  16. package/dist/effect/client.js +1 -1
  17. package/dist/effect/contact-groups.d.ts +33 -50
  18. package/dist/effect/contact-groups.js +1 -1
  19. package/dist/effect/contacts.d.ts +327 -729
  20. package/dist/effect/contacts.js +10 -2
  21. package/dist/effect/conversations.d.ts +579 -1134
  22. package/dist/effect/conversations.js +14 -2
  23. package/dist/effect/custom-fields.d.ts +5 -55
  24. package/dist/effect/custom-fields.js +1 -1
  25. package/dist/effect/email.d.ts +283 -317
  26. package/dist/effect/email.js +5 -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 +31383 -14386
  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 +5 -2
  37. package/dist/effect/internal/mailbox-events.d.ts +11 -0
  38. package/dist/effect/internal/operation.d.ts +23 -377
  39. package/dist/effect/mailboxes.d.ts +1676 -0
  40. package/dist/effect/mailboxes.js +3 -0
  41. package/dist/effect/media.d.ts +9 -9
  42. package/dist/effect/media.js +1 -1
  43. package/dist/effect/messages.d.ts +173 -940
  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 +8 -7
  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 +15 -25
  53. package/dist/effect/scheduled-messages.js +1 -1
  54. package/dist/effect/templates.d.ts +213 -290
  55. package/dist/effect/templates.js +2 -2
  56. package/dist/effect/unsubscribe-groups.d.ts +22 -76
  57. package/dist/effect/unsubscribe-groups.js +1 -1
  58. package/dist/effect/webhooks.d.ts +119 -41
  59. package/dist/effect/webhooks.js +2 -2
  60. package/dist/index.js +3 -2
  61. package/dist/mailbox-events-CcWm8lO4.js +617 -0
  62. package/dist/mailbox-events.d.ts +175 -0
  63. package/dist/mailboxes-4gJMAJh4.js +147 -0
  64. package/dist/{operation-Cdp1EI_1.js → operation-BuyvAsZ1.js} +403 -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-DoEUUjNM.js → promises-CqAmI39P.js} +3242 -556
  70. package/dist/service-map.d.ts +458 -36
  71. package/package.json +28 -8
@@ -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-DB7zbTti.js";
2
+ import { t as Service, w as SamvaApi } from "./client-8YXjfsVc.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: {
@@ -264,12 +272,19 @@ const SDK_OPERATION_CALLS = {
264
272
  paths: ["id"]
265
273
  },
266
274
  emailGetStats: { kind: "params" },
267
- emailEnableCatchAll: { kind: "payload" },
268
- emailDisableCatchAll: { kind: "payload" },
275
+ emailEnableCatchAll: {
276
+ kind: "pathPayload",
277
+ paths: ["id"]
278
+ },
279
+ emailDisableCatchAll: {
280
+ kind: "path",
281
+ paths: ["id"]
282
+ },
269
283
  emailGetCatchAllConfig: { kind: "params" },
270
284
  emailUpdateCatchAllConfig: { kind: "payload" },
271
285
  emailGetCatchAllStats: { kind: "params" },
272
286
  emailListSuppressions: { kind: "params" },
287
+ emailCountSuppressions: { kind: "none" },
273
288
  emailRemoveSuppression: {
274
289
  kind: "path",
275
290
  paths: ["id"]
@@ -311,6 +326,30 @@ const SDK_OPERATION_CALLS = {
311
326
  kind: "pathPayload",
312
327
  paths: ["id"]
313
328
  },
329
+ conversationsAddTags: {
330
+ kind: "pathPayload",
331
+ paths: ["id"]
332
+ },
333
+ conversationsRemoveTags: {
334
+ kind: "pathPayload",
335
+ paths: ["id"]
336
+ },
337
+ conversationsAddCategories: {
338
+ kind: "pathPayload",
339
+ paths: ["id"]
340
+ },
341
+ conversationsRemoveCategories: {
342
+ kind: "pathPayload",
343
+ paths: ["id"]
344
+ },
345
+ conversationsAddChannels: {
346
+ kind: "pathPayload",
347
+ paths: ["id"]
348
+ },
349
+ conversationsRemoveChannels: {
350
+ kind: "pathPayload",
351
+ paths: ["id"]
352
+ },
314
353
  conversationsAddContacts: {
315
354
  kind: "pathPayload",
316
355
  paths: ["id"]
@@ -335,6 +374,22 @@ const SDK_OPERATION_CALLS = {
335
374
  kind: "pathPayload",
336
375
  paths: ["id"]
337
376
  },
377
+ contactsAddIdentity: {
378
+ kind: "pathPayload",
379
+ paths: ["id"]
380
+ },
381
+ contactsRemoveIdentity: {
382
+ kind: "path",
383
+ paths: ["id", "identityId"]
384
+ },
385
+ contactsAddTags: {
386
+ kind: "pathPayload",
387
+ paths: ["id"]
388
+ },
389
+ contactsRemoveTags: {
390
+ kind: "pathPayload",
391
+ paths: ["id"]
392
+ },
338
393
  contactsGetEngagement: {
339
394
  kind: "path",
340
395
  paths: ["id"]
@@ -349,28 +404,28 @@ const SDK_OPERATION_CALLS = {
349
404
  paths: ["id"]
350
405
  },
351
406
  contactsGetGroupMemberships: {
352
- kind: "path",
407
+ kind: "pathParams",
353
408
  paths: ["id"]
354
409
  },
355
410
  templatesList: { kind: "params" },
356
411
  templatesCreate: { kind: "payload" },
357
412
  templatesAddEntry: {
358
413
  kind: "pathPayload",
359
- paths: ["projectId"]
414
+ paths: ["id"]
360
415
  },
361
416
  templatesListFamilies: { kind: "params" },
362
417
  templatesCreateFamily: { kind: "payload" },
363
418
  templatesGetFamily: {
364
419
  kind: "path",
365
- paths: ["familyId"]
420
+ paths: ["id"]
366
421
  },
367
422
  templatesDeleteFamily: {
368
423
  kind: "path",
369
- paths: ["familyId"]
424
+ paths: ["id"]
370
425
  },
371
426
  templatesRenameFamily: {
372
427
  kind: "pathPayload",
373
- paths: ["familyId"]
428
+ paths: ["id"]
374
429
  },
375
430
  templatesCreateFamilyFromTemplate: {
376
431
  kind: "pathPayload",
@@ -378,11 +433,11 @@ const SDK_OPERATION_CALLS = {
378
433
  },
379
434
  templatesAttachFamilyMember: {
380
435
  kind: "path",
381
- paths: ["familyId", "templateId"]
436
+ paths: ["id", "templateId"]
382
437
  },
383
438
  templatesDetachFamilyMember: {
384
439
  kind: "path",
385
- paths: ["familyId", "templateId"]
440
+ paths: ["id", "templateId"]
386
441
  },
387
442
  templatesGetById: {
388
443
  kind: "path",
@@ -461,7 +516,7 @@ const SDK_OPERATION_CALLS = {
461
516
  paths: ["id", "publicationId"]
462
517
  },
463
518
  templatesListInputContracts: {
464
- kind: "path",
519
+ kind: "pathParams",
465
520
  paths: ["id"]
466
521
  },
467
522
  templatesGetInputContract: {
@@ -488,19 +543,19 @@ const SDK_OPERATION_CALLS = {
488
543
  },
489
544
  webhooksGetLogs: {
490
545
  kind: "pathParams",
491
- paths: ["webhookId"]
546
+ paths: ["id"]
492
547
  },
493
548
  webhooksGetStats: {
494
549
  kind: "pathParams",
495
- paths: ["webhookId"]
550
+ paths: ["id"]
496
551
  },
497
552
  webhooksRetryDelivery: {
498
- kind: "pathPayload",
499
- paths: ["webhookId"]
553
+ kind: "path",
554
+ paths: ["id", "deliveryId"]
500
555
  },
501
556
  webhooksRegenerateSecret: {
502
557
  kind: "path",
503
- paths: ["webhookId"]
558
+ paths: ["id"]
504
559
  },
505
560
  organizationsCreate: { kind: "payload" },
506
561
  organizationsGet: { kind: "none" },
@@ -526,10 +581,6 @@ const SDK_OPERATION_CALLS = {
526
581
  kind: "path",
527
582
  paths: ["id"]
528
583
  },
529
- apiKeysRemove: {
530
- kind: "path",
531
- paths: ["id"]
532
- },
533
584
  apiKeysGetStats: {
534
585
  kind: "pathParams",
535
586
  paths: ["id"]
@@ -538,6 +589,7 @@ const SDK_OPERATION_CALLS = {
538
589
  kind: "pathParams",
539
590
  paths: ["id"]
540
591
  },
592
+ feedbackSend: { kind: "payload" },
541
593
  attachmentsList: { kind: "params" },
542
594
  attachmentsGetById: {
543
595
  kind: "path",
@@ -568,21 +620,21 @@ const SDK_OPERATION_CALLS = {
568
620
  contactGroupsPreview: { kind: "payload" },
569
621
  contactGroupsEvaluateDynamic: {
570
622
  kind: "path",
571
- paths: ["groupId"]
623
+ paths: ["id"]
572
624
  },
573
625
  contactGroupsGetMembers: {
574
626
  kind: "pathParams",
575
- paths: ["groupId"]
627
+ paths: ["id"]
576
628
  },
577
629
  contactGroupsAddMembers: {
578
630
  kind: "pathPayload",
579
- paths: ["groupId"]
631
+ paths: ["id"]
580
632
  },
581
633
  contactGroupsRemoveMembers: {
582
634
  kind: "pathPayload",
583
- paths: ["groupId"]
635
+ paths: ["id"]
584
636
  },
585
- customFieldsList: { kind: "params" },
637
+ customFieldsList: { kind: "none" },
586
638
  customFieldsCreate: { kind: "payload" },
587
639
  customFieldsUpdate: {
588
640
  kind: "pathPayload",
@@ -592,7 +644,7 @@ const SDK_OPERATION_CALLS = {
592
644
  kind: "path",
593
645
  paths: ["id"]
594
646
  },
595
- unsubscribeList: { kind: "params" },
647
+ unsubscribeList: { kind: "none" },
596
648
  unsubscribeCreate: { kind: "payload" },
597
649
  unsubscribeUpdate: {
598
650
  kind: "pathPayload",
@@ -608,15 +660,15 @@ const SDK_OPERATION_CALLS = {
608
660
  },
609
661
  unsubscribeListMembers: {
610
662
  kind: "pathParams",
611
- paths: ["groupId"]
663
+ paths: ["id"]
612
664
  },
613
665
  unsubscribeAddEmails: {
614
666
  kind: "pathPayload",
615
- paths: ["groupId"]
667
+ paths: ["id"]
616
668
  },
617
669
  unsubscribeRemoveEmails: {
618
670
  kind: "pathPayload",
619
- paths: ["groupId"]
671
+ paths: ["id"]
620
672
  },
621
673
  unsubscribeCheckSubscription: { kind: "params" },
622
674
  analyticsGetStats: { kind: "params" },
@@ -624,62 +676,331 @@ const SDK_OPERATION_CALLS = {
624
676
  analyticsGetTopContacts: { kind: "params" },
625
677
  analyticsGetHourlyDistribution: { kind: "params" },
626
678
  analyticsGetDeliveryMetrics: { kind: "params" },
627
- analyticsExportData: { kind: "payload" }
679
+ analyticsExportData: { kind: "payload" },
680
+ mailboxesList: { kind: "params" },
681
+ mailboxesCreate: { kind: "payload" },
682
+ mailboxesGet: {
683
+ kind: "path",
684
+ paths: ["id"]
685
+ },
686
+ mailboxesUpdate: {
687
+ kind: "pathPayload",
688
+ paths: ["id"]
689
+ },
690
+ mailboxesRemove: {
691
+ kind: "path",
692
+ paths: ["id"]
693
+ },
694
+ mailboxesPause: {
695
+ kind: "path",
696
+ paths: ["id"]
697
+ },
698
+ mailboxesResume: {
699
+ kind: "path",
700
+ paths: ["id"]
701
+ },
702
+ mailboxesGetAgentActivity: {
703
+ kind: "pathParams",
704
+ paths: ["id"]
705
+ },
706
+ mailboxesListGrants: {
707
+ kind: "pathParams",
708
+ paths: ["id"]
709
+ },
710
+ mailboxesCreateGrant: {
711
+ kind: "pathPayload",
712
+ paths: ["id"]
713
+ },
714
+ mailboxesUpdateGrant: {
715
+ kind: "pathPayload",
716
+ paths: ["id", "grantId"]
717
+ },
718
+ mailboxesRevokeGrant: {
719
+ kind: "path",
720
+ paths: ["id", "grantId"]
721
+ },
722
+ mailboxesListPolicies: {
723
+ kind: "path",
724
+ paths: ["id"]
725
+ },
726
+ mailboxesCreatePolicy: {
727
+ kind: "pathPayload",
728
+ paths: ["id"]
729
+ },
730
+ mailboxesGetPolicy: {
731
+ kind: "path",
732
+ paths: ["id", "policyId"]
733
+ },
734
+ mailboxesUpdatePolicy: {
735
+ kind: "pathPayload",
736
+ paths: ["id", "policyId"]
737
+ },
738
+ mailboxesDeletePolicy: {
739
+ kind: "path",
740
+ paths: ["id", "policyId"]
741
+ },
742
+ mailboxesListFolders: {
743
+ kind: "path",
744
+ paths: ["id"]
745
+ },
746
+ mailboxesListLabels: {
747
+ kind: "path",
748
+ paths: ["id"]
749
+ },
750
+ mailboxesCreateLabel: {
751
+ kind: "pathPayload",
752
+ paths: ["id"]
753
+ },
754
+ mailboxesUpdateLabel: {
755
+ kind: "pathPayload",
756
+ paths: ["id", "labelId"]
757
+ },
758
+ mailboxesDeleteLabel: {
759
+ kind: "path",
760
+ paths: ["id", "labelId"]
761
+ },
762
+ mailboxesListThreads: {
763
+ kind: "pathParams",
764
+ paths: ["id"]
765
+ },
766
+ mailboxesGetThread: {
767
+ kind: "path",
768
+ paths: ["id", "threadId"]
769
+ },
770
+ mailboxesUpdateThread: {
771
+ kind: "pathPayload",
772
+ paths: ["id", "threadId"]
773
+ },
774
+ mailboxesAddThreadLabels: {
775
+ kind: "pathPayload",
776
+ paths: ["id", "threadId"]
777
+ },
778
+ mailboxesRemoveThreadLabels: {
779
+ kind: "pathPayload",
780
+ paths: ["id", "threadId"]
781
+ },
782
+ mailboxesListThreadMessages: {
783
+ kind: "pathParams",
784
+ paths: ["id", "threadId"]
785
+ },
786
+ mailboxesGetThreadContent: {
787
+ kind: "pathParams",
788
+ paths: ["id", "threadId"]
789
+ },
790
+ mailboxesListThreadNotes: {
791
+ kind: "pathParams",
792
+ paths: ["id", "threadId"]
793
+ },
794
+ mailboxesCreateNote: {
795
+ kind: "pathPayload",
796
+ paths: ["id", "threadId"]
797
+ },
798
+ mailboxesUpdateNote: {
799
+ kind: "pathPayload",
800
+ paths: [
801
+ "id",
802
+ "threadId",
803
+ "noteId"
804
+ ]
805
+ },
806
+ mailboxesDeleteNote: {
807
+ kind: "path",
808
+ paths: [
809
+ "id",
810
+ "threadId",
811
+ "noteId"
812
+ ]
813
+ },
814
+ mailboxesSendMessage: {
815
+ kind: "optionalIdempotentPathPayload",
816
+ paths: ["id"]
817
+ },
818
+ mailboxesGetMessage: {
819
+ kind: "path",
820
+ paths: ["id", "messageId"]
821
+ },
822
+ mailboxesGetMessageRaw: {
823
+ kind: "path",
824
+ paths: ["id", "messageId"]
825
+ },
826
+ mailboxesGetMessageAttachment: {
827
+ kind: "path",
828
+ paths: [
829
+ "id",
830
+ "messageId",
831
+ "attachmentId"
832
+ ]
833
+ },
834
+ mailboxesReply: {
835
+ kind: "optionalIdempotentPathPayload",
836
+ paths: ["id", "messageId"]
837
+ },
838
+ mailboxesReplyAll: {
839
+ kind: "optionalIdempotentPathPayload",
840
+ paths: ["id", "messageId"]
841
+ },
842
+ mailboxesForward: {
843
+ kind: "optionalIdempotentPathPayload",
844
+ paths: ["id", "messageId"]
845
+ },
846
+ mailboxesListQuarantine: {
847
+ kind: "pathParams",
848
+ paths: ["id"]
849
+ },
850
+ mailboxesReleaseMessage: {
851
+ kind: "path",
852
+ paths: ["id", "messageId"]
853
+ },
854
+ mailboxesDiscardMessage: {
855
+ kind: "path",
856
+ paths: ["id", "messageId"]
857
+ },
858
+ mailboxesListDrafts: {
859
+ kind: "pathParams",
860
+ paths: ["id"]
861
+ },
862
+ mailboxesCreateDraft: {
863
+ kind: "pathPayload",
864
+ paths: ["id"]
865
+ },
866
+ mailboxesGetDraft: {
867
+ kind: "path",
868
+ paths: ["id", "draftId"]
869
+ },
870
+ mailboxesUpdateDraft: {
871
+ kind: "pathPayload",
872
+ paths: ["id", "draftId"]
873
+ },
874
+ mailboxesDeleteDraft: {
875
+ kind: "path",
876
+ paths: ["id", "draftId"]
877
+ },
878
+ mailboxesSendDraft: {
879
+ kind: "optionalIdempotentPath",
880
+ paths: ["id", "draftId"]
881
+ },
882
+ mailboxesListActions: {
883
+ kind: "pathParams",
884
+ paths: ["id"]
885
+ },
886
+ mailboxesApproveAction: {
887
+ kind: "path",
888
+ paths: ["id", "actionId"]
889
+ },
890
+ mailboxesDenyAction: {
891
+ kind: "pathPayload",
892
+ paths: ["id", "actionId"]
893
+ },
894
+ mailboxesListEvents: {
895
+ kind: "pathParams",
896
+ paths: ["id"]
897
+ },
898
+ namespacesList: { kind: "params" },
899
+ namespacesCreate: { kind: "payload" },
900
+ namespacesGet: {
901
+ kind: "path",
902
+ paths: ["id"]
903
+ },
904
+ namespacesUpdate: {
905
+ kind: "pathPayload",
906
+ paths: ["id"]
907
+ },
908
+ namespacesRemove: {
909
+ kind: "path",
910
+ paths: ["id"]
911
+ },
912
+ extensionsList: { kind: "params" },
913
+ extensionsPublish: { kind: "payload" },
914
+ extensionsGet: {
915
+ kind: "path",
916
+ paths: ["id"]
917
+ },
918
+ extensionsListVersions: {
919
+ kind: "pathParams",
920
+ paths: ["id"]
921
+ },
922
+ extensionsGetVersion: {
923
+ kind: "path",
924
+ paths: ["id", "versionId"]
925
+ },
926
+ extensionInstallationsList: { kind: "params" },
927
+ extensionInstallationsInstall: { kind: "payload" },
928
+ extensionInstallationsGet: {
929
+ kind: "path",
930
+ paths: ["id"]
931
+ },
932
+ extensionInstallationsUninstall: {
933
+ kind: "path",
934
+ paths: ["id"]
935
+ },
936
+ extensionInstallationsDisable: {
937
+ kind: "path",
938
+ paths: ["id"]
939
+ },
940
+ extensionInstallationsEnable: {
941
+ kind: "path",
942
+ paths: ["id"]
943
+ },
944
+ extensionInstallationsListRuns: {
945
+ kind: "path",
946
+ paths: ["id"]
947
+ },
948
+ extensionInstallationsGetRun: {
949
+ kind: "path",
950
+ paths: ["id", "runId"]
951
+ }
628
952
  };
629
953
  //#endregion
630
954
  //#region src/effect/pagination.ts
631
955
  /**
632
956
  * Stream pagination for the Effect SDK.
633
957
  *
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.
958
+ * Every list operation whose success value is a page envelope gains `.pages()`
959
+ * and `.items()` companions on its domain operation. `.pages()` streams the raw
960
+ * envelopes; `.items()` flattens them into a stream of items. Every list pages
961
+ * by cursor, `{ items, nextCursor }`: each step passes the previous page's
962
+ * `nextCursor` as `cursor`, and the walk stops at a null `nextCursor`.
638
963
  *
639
964
  * The traversal is **lazy**: built on `Stream.paginate` (a pull-based source),
640
965
  * 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`.
966
+ * stops requesting further pages. Caller params (the start `cursor`,
967
+ * `limit`, filters) are respected; only the position is advanced per step.
644
968
  *
645
969
  * Retry is **not** re-applied here: the underlying domain operation is already
646
970
  * wrapped in the ambient {@link import("./retry").Service} policy (reads are
647
971
  * retry-safe), so each page fetch retries on its own and pagination composes
648
972
  * with retry instead of nesting retries.
649
973
  */
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;
974
+ /** Honor a caller-supplied start `cursor`; default to the first page otherwise. */
975
+ const startCursorOf = (input) => {
976
+ const cursor = input?.cursor;
977
+ return typeof cursor === "string" ? cursor : void 0;
657
978
  };
658
- /** Fetch one page at `page`, preserving all other caller params. */
659
- const fetchPage = (operation, input, page) => operation({
979
+ /** Fetch the page at `cursor`, preserving all other caller params. */
980
+ const fetchCursorPage = (operation, input, cursor) => operation({
660
981
  ...input,
661
- page: page.toString()
982
+ cursor
662
983
  });
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)])));
984
+ /** Stream the raw cursor page envelopes, one per request, from the caller's start cursor. */
985
+ const streamCursorPages = (operation, input) => Stream.paginate(startCursorOf(input), (cursor) => fetchCursorPage(operation, input, cursor).pipe(Effect.map((result) => [[result], Option.fromNullishOr(result.nextCursor)])));
986
+ /** Stream individual items across cursor pages, fetching the next page only when pulled. */
987
+ const streamCursorItems = (operation, input) => Stream.paginate(startCursorOf(input), (cursor) => fetchCursorPage(operation, input, cursor).pipe(Effect.map((result) => [result.items, Option.fromNullishOr(result.nextCursor)])));
667
988
  //#endregion
668
989
  //#region src/effect/internal/operation.ts
669
990
  const hasField = (node, name) => node?.propertySignatures?.some((property) => property.name === name) ?? false;
670
- const isPaginatedSuccess = (success) => {
991
+ const isCursorPaged = (success) => {
671
992
  if (!(success instanceof Set)) return false;
672
993
  for (const schema of success) for (const node of [
673
994
  schema.ast,
674
995
  schema.ast?.to,
675
996
  schema.ast?.from
676
- ]) if (hasField(node, "items") && hasField(node, "pagination")) return true;
997
+ ]) if (hasField(node, "items") && hasField(node, "nextCursor")) return true;
677
998
  return false;
678
999
  };
679
1000
  const paginatedOperations = () => {
680
1001
  const paginated = /* @__PURE__ */ new Set();
681
1002
  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);
1003
+ for (const group of Object.values(groups)) for (const [name, endpoint] of Object.entries(group.endpoints)) if (isCursorPaged(endpoint.success)) paginated.add(name);
683
1004
  return paginated;
684
1005
  };
685
1006
  const PAGINATED_OPERATIONS = paginatedOperations();
@@ -702,8 +1023,12 @@ const MODULE_NAMES = {
702
1023
  conversations: "Conversations",
703
1024
  customFields: "CustomFields",
704
1025
  email: "Email",
1026
+ extensions: "Extensions",
1027
+ feedback: "Feedback",
1028
+ mailboxes: "Mailboxes",
705
1029
  media: "Media",
706
1030
  messages: "Messages",
1031
+ namespaces: "Namespaces",
707
1032
  operations: "Operations",
708
1033
  organizations: "Organizations",
709
1034
  scheduledMessages: "ScheduledMessages",
@@ -751,21 +1076,32 @@ const adapt = (operationName, rawCall, input) => {
751
1076
  params,
752
1077
  headers: { "idempotency-key": inputRecord.idempotencyKey }
753
1078
  });
754
- const remainingInput = stripUndefined(Object.fromEntries(Object.entries(inputRecord).filter(([key]) => !pathDescriptor.paths.includes(key))));
1079
+ const optionalKeyHeaders = { headers: inputRecord.idempotencyKey === void 0 ? {} : { "idempotency-key": inputRecord.idempotencyKey } };
1080
+ if (pathDescriptor.kind === "optionalIdempotentPath") return call({
1081
+ params,
1082
+ ...optionalKeyHeaders
1083
+ });
1084
+ const headerKey = pathDescriptor.kind === "optionalIdempotentPathPayload";
1085
+ const remainingInput = stripUndefined(Object.fromEntries(Object.entries(inputRecord).filter(([key]) => !pathDescriptor.paths.includes(key) && !(headerKey && key === "idempotencyKey"))));
1086
+ if (pathDescriptor.kind === "optionalIdempotentPathPayload") return call({
1087
+ params,
1088
+ payload: remainingInput,
1089
+ ...optionalKeyHeaders
1090
+ });
755
1091
  return call({
756
1092
  params,
757
1093
  [pathDescriptor.kind === "pathParams" ? "query" : "payload"]: remainingInput
758
1094
  });
759
1095
  };
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";
1096
+ const isCursorPageEnvelope = (value) => Predicate.isObject(value) && Array.isArray(value.items) && (value.nextCursor === null || typeof value.nextCursor === "string");
761
1097
  const make = (operationName) => {
762
1098
  const call = Effect.fn(traceName(operationName))((input) => Effect.flatMap(Service, (client) => adapt(operationName, rawOperation(client, operationName), input)));
763
1099
  const operation = call;
764
1100
  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`)));
1101
+ const list = (input) => Effect.filterOrElse(call(input), isCursorPageEnvelope, () => Effect.die(/* @__PURE__ */ new Error(`${operationName} did not return a cursor page envelope`)));
766
1102
  Object.assign(operation, {
767
- pages: (input) => streamPages(list, input ?? {}),
768
- items: (input) => streamItems(list, input ?? {})
1103
+ pages: (input) => streamCursorPages(list, input ?? {}),
1104
+ items: (input) => streamCursorItems(list, input ?? {})
769
1105
  });
770
1106
  }
771
1107
  return operation;
@@ -799,4 +1135,4 @@ const addEmailSender = Effect.fn("Email.addSender")(function* (input, options) {
799
1135
  //#endregion
800
1136
  export { sendMessage as i, make as n, sendEmail as r, addEmailSender as t };
801
1137
 
802
- //# sourceMappingURL=operation-Cdp1EI_1.js.map
1138
+ //# sourceMappingURL=operation-BuyvAsZ1.js.map