@trycourier/courier 7.7.1 → 7.9.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 (135) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/client.d.mts +19 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +19 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +15 -5
  7. package/client.js.map +1 -1
  8. package/client.mjs +15 -5
  9. package/client.mjs.map +1 -1
  10. package/package.json +12 -1
  11. package/resources/index.d.mts +4 -1
  12. package/resources/index.d.mts.map +1 -1
  13. package/resources/index.d.ts +4 -1
  14. package/resources/index.d.ts.map +1 -1
  15. package/resources/index.js +7 -1
  16. package/resources/index.js.map +1 -1
  17. package/resources/index.mjs +3 -0
  18. package/resources/index.mjs.map +1 -1
  19. package/resources/journeys.d.mts +143 -0
  20. package/resources/journeys.d.mts.map +1 -0
  21. package/resources/journeys.d.ts +143 -0
  22. package/resources/journeys.d.ts.map +1 -0
  23. package/resources/journeys.js +38 -0
  24. package/resources/journeys.js.map +1 -0
  25. package/resources/journeys.mjs +34 -0
  26. package/resources/journeys.mjs.map +1 -0
  27. package/resources/messages.d.mts +20 -20
  28. package/resources/messages.d.mts.map +1 -1
  29. package/resources/messages.d.ts +20 -20
  30. package/resources/messages.d.ts.map +1 -1
  31. package/resources/notifications/checks.d.mts +35 -0
  32. package/resources/notifications/checks.d.mts.map +1 -1
  33. package/resources/notifications/checks.d.ts +35 -0
  34. package/resources/notifications/checks.d.ts.map +1 -1
  35. package/resources/notifications/checks.js +35 -0
  36. package/resources/notifications/checks.js.map +1 -1
  37. package/resources/notifications/checks.mjs +35 -0
  38. package/resources/notifications/checks.mjs.map +1 -1
  39. package/resources/notifications/draft.d.mts +7 -0
  40. package/resources/notifications/draft.d.mts.map +1 -1
  41. package/resources/notifications/draft.d.ts +7 -0
  42. package/resources/notifications/draft.d.ts.map +1 -1
  43. package/resources/notifications/draft.js +7 -0
  44. package/resources/notifications/draft.js.map +1 -1
  45. package/resources/notifications/draft.mjs +7 -0
  46. package/resources/notifications/draft.mjs.map +1 -1
  47. package/resources/notifications/index.d.mts +1 -1
  48. package/resources/notifications/index.d.mts.map +1 -1
  49. package/resources/notifications/index.d.ts +1 -1
  50. package/resources/notifications/index.d.ts.map +1 -1
  51. package/resources/notifications/index.js.map +1 -1
  52. package/resources/notifications/index.mjs.map +1 -1
  53. package/resources/notifications/notifications.d.mts +369 -6
  54. package/resources/notifications/notifications.d.mts.map +1 -1
  55. package/resources/notifications/notifications.d.ts +369 -6
  56. package/resources/notifications/notifications.d.ts.map +1 -1
  57. package/resources/notifications/notifications.js +122 -0
  58. package/resources/notifications/notifications.js.map +1 -1
  59. package/resources/notifications/notifications.mjs +122 -0
  60. package/resources/notifications/notifications.mjs.map +1 -1
  61. package/resources/providers/catalog.d.mts +40 -0
  62. package/resources/providers/catalog.d.mts.map +1 -0
  63. package/resources/providers/catalog.d.ts +40 -0
  64. package/resources/providers/catalog.d.ts.map +1 -0
  65. package/resources/providers/catalog.js +18 -0
  66. package/resources/providers/catalog.js.map +1 -0
  67. package/resources/providers/catalog.mjs +14 -0
  68. package/resources/providers/catalog.mjs.map +1 -0
  69. package/resources/providers/index.d.mts +3 -0
  70. package/resources/providers/index.d.mts.map +1 -0
  71. package/resources/providers/index.d.ts +3 -0
  72. package/resources/providers/index.d.ts.map +1 -0
  73. package/resources/providers/index.js +9 -0
  74. package/resources/providers/index.js.map +1 -0
  75. package/resources/providers/index.mjs +4 -0
  76. package/resources/providers/index.mjs.map +1 -0
  77. package/resources/providers/providers.d.mts +182 -0
  78. package/resources/providers/providers.d.mts.map +1 -0
  79. package/resources/providers/providers.d.ts +182 -0
  80. package/resources/providers/providers.d.ts.map +1 -0
  81. package/resources/providers/providers.js +57 -0
  82. package/resources/providers/providers.js.map +1 -0
  83. package/resources/providers/providers.mjs +52 -0
  84. package/resources/providers/providers.mjs.map +1 -0
  85. package/resources/providers.d.mts +2 -0
  86. package/resources/providers.d.mts.map +1 -0
  87. package/resources/providers.d.ts +2 -0
  88. package/resources/providers.d.ts.map +1 -0
  89. package/resources/providers.js +6 -0
  90. package/resources/providers.js.map +1 -0
  91. package/resources/providers.mjs +3 -0
  92. package/resources/providers.mjs.map +1 -0
  93. package/resources/routing-strategies.d.mts +304 -0
  94. package/resources/routing-strategies.d.mts.map +1 -0
  95. package/resources/routing-strategies.d.ts +304 -0
  96. package/resources/routing-strategies.d.ts.map +1 -0
  97. package/resources/routing-strategies.js +94 -0
  98. package/resources/routing-strategies.js.map +1 -0
  99. package/resources/routing-strategies.mjs +90 -0
  100. package/resources/routing-strategies.mjs.map +1 -0
  101. package/resources/send.d.mts +2 -60
  102. package/resources/send.d.mts.map +1 -1
  103. package/resources/send.d.ts +2 -60
  104. package/resources/send.d.ts.map +1 -1
  105. package/resources/shared.d.mts +60 -1
  106. package/resources/shared.d.mts.map +1 -1
  107. package/resources/shared.d.ts +60 -1
  108. package/resources/shared.d.ts.map +1 -1
  109. package/resources/tenants/tenants.d.mts +2 -62
  110. package/resources/tenants/tenants.d.mts.map +1 -1
  111. package/resources/tenants/tenants.d.ts +2 -62
  112. package/resources/tenants/tenants.d.ts.map +1 -1
  113. package/resources/tenants/tenants.js.map +1 -1
  114. package/resources/tenants/tenants.mjs.map +1 -1
  115. package/src/client.ts +111 -5
  116. package/src/resources/index.ts +44 -0
  117. package/src/resources/journeys.ts +174 -0
  118. package/src/resources/messages.ts +24 -24
  119. package/src/resources/notifications/checks.ts +35 -0
  120. package/src/resources/notifications/draft.ts +7 -0
  121. package/src/resources/notifications/index.ts +14 -0
  122. package/src/resources/notifications/notifications.ts +474 -5
  123. package/src/resources/providers/catalog.ts +53 -0
  124. package/src/resources/providers/index.ts +12 -0
  125. package/src/resources/providers/providers.ts +240 -0
  126. package/src/resources/providers.ts +3 -0
  127. package/src/resources/routing-strategies.ts +394 -0
  128. package/src/resources/send.ts +2 -67
  129. package/src/resources/shared.ts +71 -1
  130. package/src/resources/tenants/tenants.ts +2 -69
  131. package/src/version.ts +1 -1
  132. package/version.d.mts +1 -1
  133. package/version.d.ts +1 -1
  134. package/version.js +1 -1
  135. package/version.mjs +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tenants.mjs","sourceRoot":"","sources":["../../src/resources/tenants/tenants.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,KAAK,cAAc;OACnB,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EAML,SAAS,GACV;OAEM,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA2E/E,CAAC;IAzEC;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAwB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,YAAY,QAAQ,EAAE,EAAE;YACrD,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,SAAS,CACP,QAAgB,EAChB,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,QAAQ,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;CACF;AAqZD,OAAO,CAAC,WAAW,GAAG,WAAW,CAAC;AAClC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"tenants.mjs","sourceRoot":"","sources":["../../src/resources/tenants/tenants.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,KAAK,cAAc;OACnB,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EAML,SAAS,GACV;OAEM,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA2E/E,CAAC;IAzEC;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAwB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,YAAY,QAAQ,EAAE,EAAE;YACrD,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,SAAS,CACP,QAAgB,EAChB,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,QAAQ,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;CACF;AAkVD,OAAO,CAAC,WAAW,GAAG,WAAW,CAAC;AAClC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC"}
package/src/client.ts CHANGED
@@ -67,6 +67,15 @@ import {
67
67
  InboundBulkMessageUser,
68
68
  } from './resources/bulk';
69
69
  import { Inbound, InboundTrackEventParams, InboundTrackEventResponse } from './resources/inbound';
70
+ import {
71
+ Journey,
72
+ JourneyInvokeParams,
73
+ JourneyListParams,
74
+ Journeys,
75
+ JourneysInvokeRequest,
76
+ JourneysInvokeResponse,
77
+ JourneysListResponse,
78
+ } from './resources/journeys';
70
79
  import {
71
80
  MessageContentResponse,
72
81
  MessageDetails,
@@ -78,6 +87,18 @@ import {
78
87
  Messages,
79
88
  } from './resources/messages';
80
89
  import { Requests } from './resources/requests';
90
+ import {
91
+ RoutingStrategies,
92
+ RoutingStrategyCreateParams,
93
+ RoutingStrategyCreateRequest,
94
+ RoutingStrategyGetResponse,
95
+ RoutingStrategyListParams,
96
+ RoutingStrategyListResponse,
97
+ RoutingStrategyMutationResponse,
98
+ RoutingStrategyReplaceParams,
99
+ RoutingStrategyReplaceRequest,
100
+ RoutingStrategySummary,
101
+ } from './resources/routing-strategies';
81
102
  import { Send, SendMessageParams, SendMessageResponse } from './resources/send';
82
103
  import {
83
104
  TranslationRetrieveParams,
@@ -104,10 +125,24 @@ import {
104
125
  import {
105
126
  BaseCheck,
106
127
  Check,
128
+ NotificationCreateParams,
107
129
  NotificationGetContent,
108
130
  NotificationListParams,
109
131
  NotificationListResponse,
132
+ NotificationListVersionsParams,
133
+ NotificationPublishParams,
134
+ NotificationReplaceParams,
135
+ NotificationRetrieveParams,
136
+ NotificationTemplateCreateRequest,
137
+ NotificationTemplateGetResponse,
138
+ NotificationTemplateMutationResponse,
139
+ NotificationTemplatePayload,
140
+ NotificationTemplatePublishRequest,
141
+ NotificationTemplateSummary,
142
+ NotificationTemplateUpdateRequest,
143
+ NotificationTemplateVersionListResponse,
110
144
  Notifications,
145
+ VersionNode,
111
146
  } from './resources/notifications/notifications';
112
147
  import {
113
148
  ProfileCreateParams,
@@ -119,6 +154,15 @@ import {
119
154
  Profiles,
120
155
  SubscribeToListsRequestItem,
121
156
  } from './resources/profiles/profiles';
157
+ import {
158
+ Provider,
159
+ ProviderCreateParams,
160
+ ProviderListParams,
161
+ ProviderListResponse,
162
+ ProviderUpdateParams,
163
+ Providers,
164
+ ProvidersCatalogEntry,
165
+ } from './resources/providers/providers';
122
166
  import {
123
167
  BaseTemplateTenantAssociation,
124
168
  DefaultPreferences,
@@ -364,8 +408,9 @@ export class Courier {
364
408
  : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
365
409
 
366
410
  const defaultQuery = this.defaultQuery();
367
- if (!isEmptyObj(defaultQuery)) {
368
- query = { ...defaultQuery, ...query };
411
+ const pathQuery = Object.fromEntries(url.searchParams);
412
+ if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
413
+ query = { ...pathQuery, ...defaultQuery, ...query };
369
414
  }
370
415
 
371
416
  if (typeof query === 'object' && query && !Array.isArray(query)) {
@@ -674,9 +719,9 @@ export class Courier {
674
719
  }
675
720
  }
676
721
 
677
- // If the API asks us to wait a certain amount of time (and it's a reasonable amount),
678
- // just do what it says, but otherwise calculate a default
679
- if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
722
+ // If the API asks us to wait a certain amount of time, just do what it
723
+ // says, but otherwise calculate a default
724
+ if (timeoutMillis === undefined) {
680
725
  const maxRetries = options.maxRetries ?? this.maxRetries;
681
726
  timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
682
727
  }
@@ -836,9 +881,11 @@ export class Courier {
836
881
 
837
882
  send: API.Send = new API.Send(this);
838
883
  audiences: API.Audiences = new API.Audiences(this);
884
+ providers: API.Providers = new API.Providers(this);
839
885
  auditEvents: API.AuditEvents = new API.AuditEvents(this);
840
886
  auth: API.Auth = new API.Auth(this);
841
887
  automations: API.Automations = new API.Automations(this);
888
+ journeys: API.Journeys = new API.Journeys(this);
842
889
  brands: API.Brands = new API.Brands(this);
843
890
  bulk: API.Bulk = new API.Bulk(this);
844
891
  inbound: API.Inbound = new API.Inbound(this);
@@ -846,6 +893,7 @@ export class Courier {
846
893
  messages: API.Messages = new API.Messages(this);
847
894
  requests: API.Requests = new API.Requests(this);
848
895
  notifications: API.Notifications = new API.Notifications(this);
896
+ routingStrategies: API.RoutingStrategies = new API.RoutingStrategies(this);
849
897
  profiles: API.Profiles = new API.Profiles(this);
850
898
  tenants: API.Tenants = new API.Tenants(this);
851
899
  translations: API.Translations = new API.Translations(this);
@@ -854,9 +902,11 @@ export class Courier {
854
902
 
855
903
  Courier.Send = Send;
856
904
  Courier.Audiences = Audiences;
905
+ Courier.Providers = Providers;
857
906
  Courier.AuditEvents = AuditEvents;
858
907
  Courier.Auth = Auth;
859
908
  Courier.Automations = Automations;
909
+ Courier.Journeys = Journeys;
860
910
  Courier.Brands = Brands;
861
911
  Courier.Bulk = Bulk;
862
912
  Courier.Inbound = Inbound;
@@ -864,6 +914,7 @@ Courier.Lists = Lists;
864
914
  Courier.Messages = Messages;
865
915
  Courier.Requests = Requests;
866
916
  Courier.Notifications = Notifications;
917
+ Courier.RoutingStrategies = RoutingStrategies;
867
918
  Courier.Profiles = Profiles;
868
919
  Courier.Tenants = Tenants;
869
920
  Courier.Translations = Translations;
@@ -889,6 +940,16 @@ export declare namespace Courier {
889
940
  type AudienceListMembersParams as AudienceListMembersParams,
890
941
  };
891
942
 
943
+ export {
944
+ Providers as Providers,
945
+ type Provider as Provider,
946
+ type ProvidersCatalogEntry as ProvidersCatalogEntry,
947
+ type ProviderListResponse as ProviderListResponse,
948
+ type ProviderCreateParams as ProviderCreateParams,
949
+ type ProviderUpdateParams as ProviderUpdateParams,
950
+ type ProviderListParams as ProviderListParams,
951
+ };
952
+
892
953
  export {
893
954
  AuditEvents as AuditEvents,
894
955
  type AuditEvent as AuditEvent,
@@ -910,6 +971,16 @@ export declare namespace Courier {
910
971
  type AutomationListParams as AutomationListParams,
911
972
  };
912
973
 
974
+ export {
975
+ Journeys as Journeys,
976
+ type Journey as Journey,
977
+ type JourneysInvokeRequest as JourneysInvokeRequest,
978
+ type JourneysInvokeResponse as JourneysInvokeResponse,
979
+ type JourneysListResponse as JourneysListResponse,
980
+ type JourneyListParams as JourneyListParams,
981
+ type JourneyInvokeParams as JourneyInvokeParams,
982
+ };
983
+
913
984
  export {
914
985
  Brands as Brands,
915
986
  type Brand as Brand,
@@ -978,8 +1049,35 @@ export declare namespace Courier {
978
1049
  type BaseCheck as BaseCheck,
979
1050
  type Check as Check,
980
1051
  type NotificationGetContent as NotificationGetContent,
1052
+ type NotificationTemplateCreateRequest as NotificationTemplateCreateRequest,
1053
+ type NotificationTemplateGetResponse as NotificationTemplateGetResponse,
1054
+ type NotificationTemplateMutationResponse as NotificationTemplateMutationResponse,
1055
+ type NotificationTemplatePayload as NotificationTemplatePayload,
1056
+ type NotificationTemplatePublishRequest as NotificationTemplatePublishRequest,
1057
+ type NotificationTemplateSummary as NotificationTemplateSummary,
1058
+ type NotificationTemplateUpdateRequest as NotificationTemplateUpdateRequest,
1059
+ type NotificationTemplateVersionListResponse as NotificationTemplateVersionListResponse,
1060
+ type VersionNode as VersionNode,
981
1061
  type NotificationListResponse as NotificationListResponse,
1062
+ type NotificationCreateParams as NotificationCreateParams,
1063
+ type NotificationRetrieveParams as NotificationRetrieveParams,
982
1064
  type NotificationListParams as NotificationListParams,
1065
+ type NotificationListVersionsParams as NotificationListVersionsParams,
1066
+ type NotificationPublishParams as NotificationPublishParams,
1067
+ type NotificationReplaceParams as NotificationReplaceParams,
1068
+ };
1069
+
1070
+ export {
1071
+ RoutingStrategies as RoutingStrategies,
1072
+ type RoutingStrategyCreateRequest as RoutingStrategyCreateRequest,
1073
+ type RoutingStrategyGetResponse as RoutingStrategyGetResponse,
1074
+ type RoutingStrategyListResponse as RoutingStrategyListResponse,
1075
+ type RoutingStrategyMutationResponse as RoutingStrategyMutationResponse,
1076
+ type RoutingStrategyReplaceRequest as RoutingStrategyReplaceRequest,
1077
+ type RoutingStrategySummary as RoutingStrategySummary,
1078
+ type RoutingStrategyCreateParams as RoutingStrategyCreateParams,
1079
+ type RoutingStrategyListParams as RoutingStrategyListParams,
1080
+ type RoutingStrategyReplaceParams as RoutingStrategyReplaceParams,
983
1081
  };
984
1082
 
985
1083
  export {
@@ -1027,7 +1125,9 @@ export declare namespace Courier {
1027
1125
  export type AudienceFilter = API.AudienceFilter;
1028
1126
  export type AudienceFilterConfig = API.AudienceFilterConfig;
1029
1127
  export type AudienceRecipient = API.AudienceRecipient;
1128
+ export type Channel = API.Channel;
1030
1129
  export type ChannelClassification = API.ChannelClassification;
1130
+ export type ChannelMetadata = API.ChannelMetadata;
1031
1131
  export type ChannelPreference = API.ChannelPreference;
1032
1132
  export type DeviceType = API.DeviceType;
1033
1133
  export type Discord = API.Discord;
@@ -1038,6 +1138,7 @@ export declare namespace Courier {
1038
1138
  export type ElementalContent = API.ElementalContent;
1039
1139
  export type ElementalContentSugar = API.ElementalContentSugar;
1040
1140
  export type ElementalDividerNodeWithType = API.ElementalDividerNodeWithType;
1141
+ export type ElementalHTMLNodeWithType = API.ElementalHTMLNodeWithType;
1041
1142
  export type ElementalImageNodeWithType = API.ElementalImageNodeWithType;
1042
1143
  export type ElementalMetaNodeWithType = API.ElementalMetaNodeWithType;
1043
1144
  export type ElementalNode = API.ElementalNode;
@@ -1050,9 +1151,13 @@ export declare namespace Courier {
1050
1151
  export type ListFilter = API.ListFilter;
1051
1152
  export type ListPatternRecipient = API.ListPatternRecipient;
1052
1153
  export type ListRecipient = API.ListRecipient;
1154
+ export type MessageChannels = API.MessageChannels;
1053
1155
  export type MessageContext = API.MessageContext;
1156
+ export type MessageProviders = API.MessageProviders;
1157
+ export type MessageProvidersType = API.MessageProvidersType;
1054
1158
  export type MessageRouting = API.MessageRouting;
1055
1159
  export type MessageRoutingChannel = API.MessageRoutingChannel;
1160
+ export type Metadata = API.Metadata;
1056
1161
  export type MsTeams = API.MsTeams;
1057
1162
  export type MsTeamsBaseProperties = API.MsTeamsBaseProperties;
1058
1163
  export type MsTeamsRecipient = API.MsTeamsRecipient;
@@ -1079,6 +1184,7 @@ export declare namespace Courier {
1079
1184
  export type SlackBaseProperties = API.SlackBaseProperties;
1080
1185
  export type SlackRecipient = API.SlackRecipient;
1081
1186
  export type TextStyle = API.TextStyle;
1187
+ export type Timeouts = API.Timeouts;
1082
1188
  export type Token = API.Token;
1083
1189
  export type UserProfile = API.UserProfile;
1084
1190
  export type UserProfileFirebaseToken = API.UserProfileFirebaseToken;
@@ -58,6 +58,15 @@ export {
58
58
  type BulkListUsersParams,
59
59
  } from './bulk';
60
60
  export { Inbound, type InboundTrackEventResponse, type InboundTrackEventParams } from './inbound';
61
+ export {
62
+ Journeys,
63
+ type Journey,
64
+ type JourneysInvokeRequest,
65
+ type JourneysInvokeResponse,
66
+ type JourneysListResponse,
67
+ type JourneyListParams,
68
+ type JourneyInvokeParams,
69
+ } from './journeys';
61
70
  export {
62
71
  Lists,
63
72
  type PutSubscriptionsRecipient,
@@ -82,8 +91,22 @@ export {
82
91
  type BaseCheck,
83
92
  type Check,
84
93
  type NotificationGetContent,
94
+ type NotificationTemplateCreateRequest,
95
+ type NotificationTemplateGetResponse,
96
+ type NotificationTemplateMutationResponse,
97
+ type NotificationTemplatePayload,
98
+ type NotificationTemplatePublishRequest,
99
+ type NotificationTemplateSummary,
100
+ type NotificationTemplateUpdateRequest,
101
+ type NotificationTemplateVersionListResponse,
102
+ type VersionNode,
85
103
  type NotificationListResponse,
104
+ type NotificationCreateParams,
105
+ type NotificationRetrieveParams,
86
106
  type NotificationListParams,
107
+ type NotificationListVersionsParams,
108
+ type NotificationPublishParams,
109
+ type NotificationReplaceParams,
87
110
  } from './notifications/notifications';
88
111
  export {
89
112
  Profiles,
@@ -95,7 +118,28 @@ export {
95
118
  type ProfileUpdateParams,
96
119
  type ProfileReplaceParams,
97
120
  } from './profiles/profiles';
121
+ export {
122
+ Providers,
123
+ type Provider,
124
+ type ProvidersCatalogEntry,
125
+ type ProviderListResponse,
126
+ type ProviderCreateParams,
127
+ type ProviderUpdateParams,
128
+ type ProviderListParams,
129
+ } from './providers/providers';
98
130
  export { Requests } from './requests';
131
+ export {
132
+ RoutingStrategies,
133
+ type RoutingStrategyCreateRequest,
134
+ type RoutingStrategyGetResponse,
135
+ type RoutingStrategyListResponse,
136
+ type RoutingStrategyMutationResponse,
137
+ type RoutingStrategyReplaceRequest,
138
+ type RoutingStrategySummary,
139
+ type RoutingStrategyCreateParams,
140
+ type RoutingStrategyListParams,
141
+ type RoutingStrategyReplaceParams,
142
+ } from './routing-strategies';
99
143
  export { Send, type SendMessageResponse, type SendMessageParams } from './send';
100
144
  export {
101
145
  Tenants,
@@ -0,0 +1,174 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
7
+
8
+ export class Journeys extends APIResource {
9
+ /**
10
+ * Get the list of journeys.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const journeysListResponse = await client.journeys.list();
15
+ * ```
16
+ */
17
+ list(
18
+ query: JourneyListParams | null | undefined = {},
19
+ options?: RequestOptions,
20
+ ): APIPromise<JourneysListResponse> {
21
+ return this._client.get('/journeys', { query, ...options });
22
+ }
23
+
24
+ /**
25
+ * Invoke a journey run from a journey template.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const journeysInvokeResponse = await client.journeys.invoke(
30
+ * 'templateId',
31
+ * {
32
+ * data: { order_id: 'order-456', amount: 99.99 },
33
+ * user_id: 'user-123',
34
+ * },
35
+ * );
36
+ * ```
37
+ */
38
+ invoke(
39
+ templateID: string,
40
+ body: JourneyInvokeParams,
41
+ options?: RequestOptions,
42
+ ): APIPromise<JourneysInvokeResponse> {
43
+ return this._client.post(path`/journeys/${templateID}/invoke`, { body, ...options });
44
+ }
45
+ }
46
+
47
+ /**
48
+ * A journey template representing an automation workflow.
49
+ */
50
+ export interface Journey {
51
+ /**
52
+ * The unique identifier of the journey.
53
+ */
54
+ id: string;
55
+
56
+ /**
57
+ * The name of the journey.
58
+ */
59
+ name: string;
60
+
61
+ /**
62
+ * The version of the journey (published or draft).
63
+ */
64
+ version: 'published' | 'draft';
65
+
66
+ /**
67
+ * ISO 8601 timestamp when the journey was created.
68
+ */
69
+ createdAt?: string;
70
+
71
+ /**
72
+ * ISO 8601 timestamp when the journey was last updated.
73
+ */
74
+ updatedAt?: string;
75
+ }
76
+
77
+ /**
78
+ * Request body for invoking a journey. Requires either a user identifier or a
79
+ * profile with contact information. User identifiers can be provided via user_id
80
+ * field, or resolved from profile/data objects (user_id, userId, or anonymousId
81
+ * fields).
82
+ */
83
+ export interface JourneysInvokeRequest {
84
+ /**
85
+ * Data payload passed to the journey. The expected shape can be predefined using
86
+ * the schema builder in the journey editor. This data is available in journey
87
+ * steps for condition evaluation and template variable interpolation. Can also
88
+ * contain user identifiers (user_id, userId, anonymousId) if not provided
89
+ * elsewhere.
90
+ */
91
+ data?: { [key: string]: unknown };
92
+
93
+ /**
94
+ * Profile data for the user. Can contain contact information (email,
95
+ * phone_number), user identifiers (user_id, userId, anonymousId), or any custom
96
+ * profile fields. Profile fields are merged with any existing stored profile for
97
+ * the user. Include context.tenant_id to load a tenant-scoped profile for
98
+ * multi-tenant scenarios.
99
+ */
100
+ profile?: { [key: string]: unknown };
101
+
102
+ /**
103
+ * A unique identifier for the user. If not provided, the system will attempt to
104
+ * resolve the user identifier from profile or data objects.
105
+ */
106
+ user_id?: string;
107
+ }
108
+
109
+ export interface JourneysInvokeResponse {
110
+ /**
111
+ * A unique identifier for the journey run that was created.
112
+ */
113
+ runId: string;
114
+ }
115
+
116
+ export interface JourneysListResponse {
117
+ /**
118
+ * A cursor token for pagination. Present when there are more results available.
119
+ */
120
+ cursor?: string;
121
+
122
+ templates?: Array<Journey>;
123
+ }
124
+
125
+ export interface JourneyListParams {
126
+ /**
127
+ * A cursor token for pagination. Use the cursor from the previous response to
128
+ * fetch the next page of results.
129
+ */
130
+ cursor?: string;
131
+
132
+ /**
133
+ * The version of journeys to retrieve. Accepted values are published (for
134
+ * published journeys) or draft (for draft journeys). Defaults to published.
135
+ */
136
+ version?: 'published' | 'draft';
137
+ }
138
+
139
+ export interface JourneyInvokeParams {
140
+ /**
141
+ * Data payload passed to the journey. The expected shape can be predefined using
142
+ * the schema builder in the journey editor. This data is available in journey
143
+ * steps for condition evaluation and template variable interpolation. Can also
144
+ * contain user identifiers (user_id, userId, anonymousId) if not provided
145
+ * elsewhere.
146
+ */
147
+ data?: { [key: string]: unknown };
148
+
149
+ /**
150
+ * Profile data for the user. Can contain contact information (email,
151
+ * phone_number), user identifiers (user_id, userId, anonymousId), or any custom
152
+ * profile fields. Profile fields are merged with any existing stored profile for
153
+ * the user. Include context.tenant_id to load a tenant-scoped profile for
154
+ * multi-tenant scenarios.
155
+ */
156
+ profile?: { [key: string]: unknown };
157
+
158
+ /**
159
+ * A unique identifier for the user. If not provided, the system will attempt to
160
+ * resolve the user identifier from profile or data objects.
161
+ */
162
+ user_id?: string;
163
+ }
164
+
165
+ export declare namespace Journeys {
166
+ export {
167
+ type Journey as Journey,
168
+ type JourneysInvokeRequest as JourneysInvokeRequest,
169
+ type JourneysInvokeResponse as JourneysInvokeResponse,
170
+ type JourneysListResponse as JourneysListResponse,
171
+ type JourneyListParams as JourneyListParams,
172
+ type JourneyInvokeParams as JourneyInvokeParams,
173
+ };
174
+ }
@@ -61,18 +61,6 @@ export interface MessageDetails {
61
61
  */
62
62
  id: string;
63
63
 
64
- /**
65
- * A UTC timestamp at which the recipient clicked on a tracked link for the first
66
- * time. Stored as a millisecond representation of the Unix epoch.
67
- */
68
- clicked: number;
69
-
70
- /**
71
- * A UTC timestamp at which the Integration provider delivered the message. Stored
72
- * as a millisecond representation of the Unix epoch.
73
- */
74
- delivered: number;
75
-
76
64
  /**
77
65
  * A UTC timestamp at which Courier received the message request. Stored as a
78
66
  * millisecond representation of the Unix epoch.
@@ -89,23 +77,11 @@ export interface MessageDetails {
89
77
  */
90
78
  notification: string;
91
79
 
92
- /**
93
- * A UTC timestamp at which the recipient opened a message for the first time.
94
- * Stored as a millisecond representation of the Unix epoch.
95
- */
96
- opened: number;
97
-
98
80
  /**
99
81
  * A unique identifier associated with the recipient of the delivered message.
100
82
  */
101
83
  recipient: string;
102
84
 
103
- /**
104
- * A UTC timestamp at which Courier passed the message to the Integration provider.
105
- * Stored as a millisecond representation of the Unix epoch.
106
- */
107
- sent: number;
108
-
109
85
  /**
110
86
  * The current status of the message.
111
87
  */
@@ -126,11 +102,29 @@ export interface MessageDetails {
126
102
  | 'UNMAPPED'
127
103
  | 'UNROUTABLE';
128
104
 
105
+ /**
106
+ * A UTC timestamp at which the recipient clicked on a tracked link for the first
107
+ * time. Stored as a millisecond representation of the Unix epoch.
108
+ */
109
+ clicked?: number;
110
+
111
+ /**
112
+ * A UTC timestamp at which the Integration provider delivered the message. Stored
113
+ * as a millisecond representation of the Unix epoch.
114
+ */
115
+ delivered?: number;
116
+
129
117
  /**
130
118
  * A message describing the error that occurred.
131
119
  */
132
120
  error?: string | null;
133
121
 
122
+ /**
123
+ * A UTC timestamp at which the recipient opened a message for the first time.
124
+ * Stored as a millisecond representation of the Unix epoch.
125
+ */
126
+ opened?: number;
127
+
134
128
  /**
135
129
  * The reason for the current status of the message.
136
130
  */
@@ -145,6 +139,12 @@ export interface MessageDetails {
145
139
  | 'UNPUBLISHED'
146
140
  | 'UNSUBSCRIBED'
147
141
  | null;
142
+
143
+ /**
144
+ * A UTC timestamp at which Courier passed the message to the Integration provider.
145
+ * Stored as a millisecond representation of the Unix epoch.
146
+ */
147
+ sent?: number;
148
148
  }
149
149
 
150
150
  export interface MessageRetrieveResponse extends MessageDetails {
@@ -8,6 +8,24 @@ import { RequestOptions } from '../../internal/request-options';
8
8
  import { path } from '../../internal/utils/path';
9
9
 
10
10
  export class Checks extends APIResource {
11
+ /**
12
+ * @example
13
+ * ```ts
14
+ * const check = await client.notifications.checks.update(
15
+ * 'submissionId',
16
+ * {
17
+ * id: 'id',
18
+ * checks: [
19
+ * {
20
+ * id: 'id',
21
+ * status: 'RESOLVED',
22
+ * type: 'custom',
23
+ * },
24
+ * ],
25
+ * },
26
+ * );
27
+ * ```
28
+ */
11
29
  update(
12
30
  submissionID: string,
13
31
  params: CheckUpdateParams,
@@ -17,6 +35,15 @@ export class Checks extends APIResource {
17
35
  return this._client.put(path`/notifications/${id}/${submissionID}/checks`, { body, ...options });
18
36
  }
19
37
 
38
+ /**
39
+ * @example
40
+ * ```ts
41
+ * const checks = await client.notifications.checks.list(
42
+ * 'submissionId',
43
+ * { id: 'id' },
44
+ * );
45
+ * ```
46
+ */
20
47
  list(
21
48
  submissionID: string,
22
49
  params: CheckListParams,
@@ -26,6 +53,14 @@ export class Checks extends APIResource {
26
53
  return this._client.get(path`/notifications/${id}/${submissionID}/checks`, options);
27
54
  }
28
55
 
56
+ /**
57
+ * @example
58
+ * ```ts
59
+ * await client.notifications.checks.delete('submissionId', {
60
+ * id: 'id',
61
+ * });
62
+ * ```
63
+ */
29
64
  delete(submissionID: string, params: CheckDeleteParams, options?: RequestOptions): APIPromise<void> {
30
65
  const { id } = params;
31
66
  return this._client.delete(path`/notifications/${id}/${submissionID}/checks`, {
@@ -7,6 +7,13 @@ import { RequestOptions } from '../../internal/request-options';
7
7
  import { path } from '../../internal/utils/path';
8
8
 
9
9
  export class Draft extends APIResource {
10
+ /**
11
+ * @example
12
+ * ```ts
13
+ * const notificationGetContent =
14
+ * await client.notifications.draft.retrieveContent('id');
15
+ * ```
16
+ */
10
17
  retrieveContent(id: string, options?: RequestOptions): APIPromise<NotificationsAPI.NotificationGetContent> {
11
18
  return this._client.get(path`/notifications/${id}/draft/content`, options);
12
19
  }
@@ -14,6 +14,20 @@ export {
14
14
  type BaseCheck,
15
15
  type Check,
16
16
  type NotificationGetContent,
17
+ type NotificationTemplateCreateRequest,
18
+ type NotificationTemplateGetResponse,
19
+ type NotificationTemplateMutationResponse,
20
+ type NotificationTemplatePayload,
21
+ type NotificationTemplatePublishRequest,
22
+ type NotificationTemplateSummary,
23
+ type NotificationTemplateUpdateRequest,
24
+ type NotificationTemplateVersionListResponse,
25
+ type VersionNode,
17
26
  type NotificationListResponse,
27
+ type NotificationCreateParams,
28
+ type NotificationRetrieveParams,
18
29
  type NotificationListParams,
30
+ type NotificationListVersionsParams,
31
+ type NotificationPublishParams,
32
+ type NotificationReplaceParams,
19
33
  } from './notifications';