rcs-js 2.0.0-rc.6 → 2.0.0-rc.8

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 (164) hide show
  1. package/dist/cjs/Client.d.ts +0 -3
  2. package/dist/cjs/Client.js +6 -11
  3. package/dist/cjs/api/resources/brands/client/requests/UpsertBrandParams.d.ts +1 -1
  4. package/dist/cjs/api/resources/index.d.ts +0 -1
  5. package/dist/cjs/api/resources/index.js +1 -2
  6. package/dist/cjs/api/resources/messages/client/Client.d.ts +3 -3
  7. package/dist/cjs/api/resources/messages/client/Client.js +3 -3
  8. package/dist/cjs/api/resources/messages/resources/index.d.ts +6 -3
  9. package/dist/cjs/api/resources/messages/resources/index.js +7 -4
  10. package/dist/cjs/api/resources/messages/resources/mms/client/Client.d.ts +26 -0
  11. package/dist/cjs/api/resources/messages/resources/mms/client/Client.js +83 -0
  12. package/dist/cjs/api/resources/messages/resources/mms/client/index.d.ts +1 -0
  13. package/dist/cjs/api/resources/messages/resources/mms/client/index.js +15 -0
  14. package/dist/cjs/api/resources/messages/resources/{send → mms}/client/requests/index.d.ts +0 -1
  15. package/dist/cjs/api/resources/messages/resources/mms/index.d.ts +1 -0
  16. package/dist/cjs/api/resources/messages/resources/mms/index.js +1 -0
  17. package/dist/cjs/api/resources/messages/resources/{send/types/SendRcsResponse.d.ts → mms/types/MmsSendResponse.d.ts} +1 -1
  18. package/dist/cjs/api/resources/messages/resources/mms/types/index.d.ts +1 -0
  19. package/dist/cjs/api/resources/{message/resources/sms → messages/resources/mms/types}/index.js +1 -1
  20. package/dist/cjs/api/resources/messages/resources/rcs/client/Client.d.ts +28 -0
  21. package/dist/cjs/api/resources/messages/resources/rcs/client/Client.js +85 -0
  22. package/dist/cjs/api/resources/messages/resources/rcs/index.d.ts +1 -0
  23. package/dist/cjs/api/resources/messages/resources/rcs/index.js +1 -0
  24. package/dist/cjs/api/resources/messages/resources/{send/types/SendSmsResponse.d.ts → rcs/types/RcsSendResponse.d.ts} +1 -1
  25. package/dist/cjs/api/resources/messages/resources/rcs/types/index.d.ts +1 -0
  26. package/dist/cjs/api/resources/{message → messages/resources/rcs/types}/index.js +1 -2
  27. package/dist/cjs/api/resources/{message → messages}/resources/sms/client/Client.d.ts +22 -1
  28. package/dist/cjs/api/resources/messages/resources/{send → sms}/client/Client.js +19 -117
  29. package/dist/cjs/api/resources/messages/resources/{send → sms}/client/requests/Sms.d.ts +2 -2
  30. package/dist/cjs/api/resources/messages/resources/sms/client/requests/index.d.ts +1 -0
  31. package/dist/cjs/api/resources/messages/resources/{send/types/SendMmsResponse.d.ts → sms/types/SmsSendResponse.d.ts} +1 -1
  32. package/dist/cjs/api/resources/messages/resources/sms/types/index.d.ts +1 -0
  33. package/dist/cjs/api/resources/messages/resources/sms/types/index.js +17 -0
  34. package/dist/cjs/api/resources/phoneNumbers/client/requests/SearchPhoneNumberParams.d.ts +2 -2
  35. package/dist/cjs/api/types/Rcs.d.ts +3 -3
  36. package/dist/cjs/api/types/RcsCards.d.ts +2 -2
  37. package/dist/cjs/api/types/RcsCardsContent.d.ts +2 -2
  38. package/dist/cjs/api/types/RcsMediaContent.d.ts +1 -1
  39. package/dist/cjs/api/types/RcsTextContent.d.ts +1 -1
  40. package/dist/cjs/api/types/{RcsButtonContent.d.ts → RichButton.d.ts} +2 -2
  41. package/dist/cjs/api/types/{RcsCard.d.ts → RichCardsMessage.d.ts} +1 -1
  42. package/dist/cjs/api/types/{RcsMedia.d.ts → RichMediaMessage.d.ts} +2 -2
  43. package/dist/cjs/api/types/{RcsText.d.ts → RichTextMessage.d.ts} +1 -1
  44. package/dist/{esm/api/types/NullableContact.d.mts → cjs/api/types/UpsertContact.d.ts} +1 -1
  45. package/dist/cjs/api/types/index.d.ts +5 -5
  46. package/dist/cjs/api/types/index.js +5 -5
  47. package/dist/cjs/index.d.ts +4 -4
  48. package/dist/cjs/index.js +8 -8
  49. package/dist/cjs/version.d.ts +1 -1
  50. package/dist/cjs/version.js +1 -1
  51. package/dist/esm/Client.d.mts +0 -3
  52. package/dist/esm/Client.mjs +2 -7
  53. package/dist/esm/api/resources/brands/client/requests/UpsertBrandParams.d.mts +1 -1
  54. package/dist/esm/api/resources/index.d.mts +0 -1
  55. package/dist/esm/api/resources/index.mjs +0 -1
  56. package/dist/esm/api/resources/messages/client/Client.d.mts +3 -3
  57. package/dist/esm/api/resources/messages/client/Client.mjs +3 -3
  58. package/dist/esm/api/resources/messages/resources/index.d.mts +6 -3
  59. package/dist/esm/api/resources/messages/resources/index.mjs +6 -3
  60. package/dist/esm/api/resources/messages/resources/mms/client/Client.d.mts +26 -0
  61. package/dist/esm/api/resources/messages/resources/mms/client/Client.mjs +83 -0
  62. package/dist/esm/api/resources/messages/resources/mms/client/index.d.mts +1 -0
  63. package/dist/esm/api/resources/messages/resources/mms/client/index.mjs +1 -1
  64. package/dist/esm/api/resources/messages/resources/{send → mms}/client/requests/index.d.mts +0 -1
  65. package/dist/esm/api/resources/messages/resources/mms/index.d.mts +1 -0
  66. package/dist/esm/api/resources/messages/resources/mms/index.mjs +1 -0
  67. package/dist/esm/api/resources/messages/resources/{send/types/SendRcsResponse.d.mts → mms/types/MmsSendResponse.d.mts} +1 -1
  68. package/dist/esm/api/resources/messages/resources/mms/types/index.d.mts +1 -0
  69. package/dist/esm/api/resources/messages/resources/mms/types/index.mjs +1 -0
  70. package/dist/esm/api/resources/messages/resources/rcs/client/Client.d.mts +28 -0
  71. package/dist/esm/api/resources/messages/resources/rcs/client/Client.mjs +85 -0
  72. package/dist/esm/api/resources/messages/resources/rcs/index.d.mts +1 -0
  73. package/dist/esm/api/resources/messages/resources/rcs/index.mjs +1 -0
  74. package/dist/esm/api/resources/messages/resources/{send/types/SendSmsResponse.d.mts → rcs/types/RcsSendResponse.d.mts} +1 -1
  75. package/dist/esm/api/resources/messages/resources/rcs/types/index.d.mts +1 -0
  76. package/dist/esm/api/resources/messages/resources/rcs/types/index.mjs +1 -0
  77. package/dist/esm/api/resources/{message → messages}/resources/sms/client/Client.d.mts +22 -1
  78. package/dist/esm/api/resources/messages/resources/{send → sms}/client/Client.mjs +17 -115
  79. package/dist/esm/api/resources/messages/resources/{send → sms}/client/requests/Sms.d.mts +2 -2
  80. package/dist/esm/api/resources/messages/resources/sms/client/requests/index.d.mts +1 -0
  81. package/dist/esm/api/resources/messages/resources/{send/types/SendMmsResponse.d.mts → sms/types/SmsSendResponse.d.mts} +1 -1
  82. package/dist/esm/api/resources/messages/resources/sms/types/index.d.mts +1 -0
  83. package/dist/esm/api/resources/messages/resources/sms/types/index.mjs +1 -0
  84. package/dist/esm/api/resources/phoneNumbers/client/requests/SearchPhoneNumberParams.d.mts +2 -2
  85. package/dist/esm/api/types/Rcs.d.mts +3 -3
  86. package/dist/esm/api/types/RcsCards.d.mts +2 -2
  87. package/dist/esm/api/types/RcsCardsContent.d.mts +2 -2
  88. package/dist/esm/api/types/RcsMediaContent.d.mts +1 -1
  89. package/dist/esm/api/types/RcsTextContent.d.mts +1 -1
  90. package/dist/esm/api/types/{RcsButtonContent.d.mts → RichButton.d.mts} +2 -2
  91. package/dist/esm/api/types/{RcsCard.d.mts → RichCardsMessage.d.mts} +1 -1
  92. package/dist/esm/api/types/{RcsMedia.d.mts → RichMediaMessage.d.mts} +2 -2
  93. package/dist/esm/api/types/{RcsText.d.mts → RichTextMessage.d.mts} +1 -1
  94. package/dist/{cjs/api/types/NullableContact.d.ts → esm/api/types/UpsertContact.d.mts} +1 -1
  95. package/dist/esm/api/types/index.d.mts +5 -5
  96. package/dist/esm/api/types/index.mjs +5 -5
  97. package/dist/esm/index.d.mts +4 -4
  98. package/dist/esm/index.mjs +4 -4
  99. package/dist/esm/version.d.mts +1 -1
  100. package/dist/esm/version.mjs +1 -1
  101. package/package.json +1 -1
  102. package/reference.md +46 -48
  103. package/dist/cjs/api/resources/message/client/Client.d.ts +0 -22
  104. package/dist/cjs/api/resources/message/client/Client.js +0 -17
  105. package/dist/cjs/api/resources/message/client/index.d.ts +0 -1
  106. package/dist/cjs/api/resources/message/index.d.ts +0 -2
  107. package/dist/cjs/api/resources/message/resources/index.d.ts +0 -1
  108. package/dist/cjs/api/resources/message/resources/index.js +0 -37
  109. package/dist/cjs/api/resources/message/resources/sms/client/Client.js +0 -135
  110. package/dist/cjs/api/resources/message/resources/sms/client/index.d.ts +0 -1
  111. package/dist/cjs/api/resources/message/resources/sms/index.d.ts +0 -1
  112. package/dist/cjs/api/resources/messages/resources/send/client/Client.d.ts +0 -110
  113. package/dist/cjs/api/resources/messages/resources/send/client/requests/index.js +0 -2
  114. package/dist/cjs/api/resources/messages/resources/send/types/index.d.ts +0 -3
  115. package/dist/cjs/api/resources/messages/resources/send/types/index.js +0 -19
  116. package/dist/esm/api/resources/message/client/Client.d.mts +0 -22
  117. package/dist/esm/api/resources/message/client/Client.mjs +0 -13
  118. package/dist/esm/api/resources/message/client/index.d.mts +0 -1
  119. package/dist/esm/api/resources/message/index.d.mts +0 -2
  120. package/dist/esm/api/resources/message/index.mjs +0 -2
  121. package/dist/esm/api/resources/message/resources/index.d.mts +0 -1
  122. package/dist/esm/api/resources/message/resources/index.mjs +0 -1
  123. package/dist/esm/api/resources/message/resources/sms/client/Client.mjs +0 -98
  124. package/dist/esm/api/resources/message/resources/sms/client/index.d.mts +0 -1
  125. package/dist/esm/api/resources/message/resources/sms/index.d.mts +0 -1
  126. package/dist/esm/api/resources/message/resources/sms/index.mjs +0 -1
  127. package/dist/esm/api/resources/messages/resources/send/client/Client.d.mts +0 -110
  128. package/dist/esm/api/resources/messages/resources/send/client/requests/index.mjs +0 -1
  129. package/dist/esm/api/resources/messages/resources/send/types/index.d.mts +0 -3
  130. package/dist/esm/api/resources/messages/resources/send/types/index.mjs +0 -3
  131. /package/dist/cjs/api/resources/messages/resources/{send → mms}/client/requests/Mms.d.ts +0 -0
  132. /package/dist/cjs/api/resources/messages/resources/{send → mms}/client/requests/Mms.js +0 -0
  133. /package/dist/cjs/api/resources/{message/client → messages/resources/mms/client/requests}/index.js +0 -0
  134. /package/dist/cjs/api/resources/messages/resources/{send/client/requests/Sms.js → mms/types/MmsSendResponse.js} +0 -0
  135. /package/dist/cjs/api/resources/messages/resources/{send/types/SendMmsResponse.js → rcs/types/RcsSendResponse.js} +0 -0
  136. /package/dist/cjs/api/resources/messages/resources/{send → sms}/client/index.d.ts +0 -0
  137. /package/dist/cjs/api/resources/messages/resources/{send → sms}/client/index.js +0 -0
  138. /package/dist/cjs/api/resources/messages/resources/{send/types/SendRcsResponse.js → sms/client/requests/Sms.js} +0 -0
  139. /package/dist/cjs/api/resources/{message/resources/sms/client → messages/resources/sms/client/requests}/index.js +0 -0
  140. /package/dist/cjs/api/resources/messages/resources/{send → sms}/index.d.ts +0 -0
  141. /package/dist/cjs/api/resources/messages/resources/{send → sms}/index.js +0 -0
  142. /package/dist/cjs/api/resources/messages/resources/{send/types/SendSmsResponse.js → sms/types/SmsSendResponse.js} +0 -0
  143. /package/dist/cjs/api/types/{NullableContact.js → RichButton.js} +0 -0
  144. /package/dist/cjs/api/types/{RcsButtonContent.js → RichCardsMessage.js} +0 -0
  145. /package/dist/cjs/api/types/{RcsCard.js → RichMediaMessage.js} +0 -0
  146. /package/dist/cjs/api/types/{RcsMedia.js → RichTextMessage.js} +0 -0
  147. /package/dist/cjs/api/types/{RcsText.js → UpsertContact.js} +0 -0
  148. /package/dist/esm/api/resources/messages/resources/{send → mms}/client/requests/Mms.d.mts +0 -0
  149. /package/dist/esm/api/resources/messages/resources/{send → mms}/client/requests/Mms.mjs +0 -0
  150. /package/dist/esm/api/resources/{message/client → messages/resources/mms/client/requests}/index.mjs +0 -0
  151. /package/dist/esm/api/resources/messages/resources/{send/client/requests/Sms.mjs → mms/types/MmsSendResponse.mjs} +0 -0
  152. /package/dist/esm/api/resources/messages/resources/{send/types/SendMmsResponse.mjs → rcs/types/RcsSendResponse.mjs} +0 -0
  153. /package/dist/esm/api/resources/messages/resources/{send → sms}/client/index.d.mts +0 -0
  154. /package/dist/esm/api/resources/messages/resources/{send → sms}/client/index.mjs +0 -0
  155. /package/dist/esm/api/resources/messages/resources/{send/types/SendRcsResponse.mjs → sms/client/requests/Sms.mjs} +0 -0
  156. /package/dist/esm/api/resources/{message/resources/sms/client → messages/resources/sms/client/requests}/index.mjs +0 -0
  157. /package/dist/esm/api/resources/messages/resources/{send → sms}/index.d.mts +0 -0
  158. /package/dist/esm/api/resources/messages/resources/{send → sms}/index.mjs +0 -0
  159. /package/dist/esm/api/resources/messages/resources/{send/types/SendSmsResponse.mjs → sms/types/SmsSendResponse.mjs} +0 -0
  160. /package/dist/esm/api/types/{NullableContact.mjs → RichButton.mjs} +0 -0
  161. /package/dist/esm/api/types/{RcsButtonContent.mjs → RichCardsMessage.mjs} +0 -0
  162. /package/dist/esm/api/types/{RcsCard.mjs → RichMediaMessage.mjs} +0 -0
  163. /package/dist/esm/api/types/{RcsMedia.mjs → RichTextMessage.mjs} +0 -0
  164. /package/dist/esm/api/types/{RcsText.mjs → UpsertContact.mjs} +0 -0
@@ -1,5 +1,8 @@
1
- export * as send from "./send/index.mjs";
2
- export * from "./send/types/index.mjs";
1
+ export * as sms from "./sms/index.mjs";
2
+ export * from "./sms/types/index.mjs";
3
3
  export * as mms from "./mms/index.mjs";
4
+ export * from "./mms/types/index.mjs";
4
5
  export * as rcs from "./rcs/index.mjs";
5
- export * from "./send/client/requests/index.mjs";
6
+ export * from "./rcs/types/index.mjs";
7
+ export * from "./sms/client/requests/index.mjs";
8
+ export * from "./mms/client/requests/index.mjs";
@@ -1,5 +1,8 @@
1
- export * as send from "./send/index.mjs";
2
- export * from "./send/types/index.mjs";
1
+ export * as sms from "./sms/index.mjs";
2
+ export * from "./sms/types/index.mjs";
3
3
  export * as mms from "./mms/index.mjs";
4
+ export * from "./mms/types/index.mjs";
4
5
  export * as rcs from "./rcs/index.mjs";
5
- export * from "./send/client/requests/index.mjs";
6
+ export * from "./rcs/types/index.mjs";
7
+ export * from "./sms/client/requests/index.mjs";
8
+ export * from "./mms/client/requests/index.mjs";
@@ -29,6 +29,32 @@ export declare namespace Mms {
29
29
  export declare class Mms {
30
30
  protected readonly _options: Mms.Options;
31
31
  constructor(_options: Mms.Options);
32
+ /**
33
+ * Send a MMS immediately or schedule it for future delivery.
34
+ *
35
+ * @param {Pinnacle.messages.Mms} request
36
+ * @param {Mms.RequestOptions} requestOptions - Request-specific configuration.
37
+ *
38
+ * @throws {@link Pinnacle.BadRequestError}
39
+ * @throws {@link Pinnacle.UnauthorizedError}
40
+ * @throws {@link Pinnacle.PaymentRequiredError}
41
+ * @throws {@link Pinnacle.NotFoundError}
42
+ * @throws {@link Pinnacle.InternalServerError}
43
+ *
44
+ * @example
45
+ * await client.messages.mms.send({
46
+ * from: "+14155164736",
47
+ * mediaUrls: ["https://fastly.picsum.photos/id/941/300/300.jpg?hmac=mDxM9PWSqRDjecwSCEpzU4bj35gqnG7yA25OL29uNv0"],
48
+ * options: {
49
+ * multiple_messages: true,
50
+ * validate: true
51
+ * },
52
+ * text: "Check out this image!",
53
+ * to: "+14154746461"
54
+ * })
55
+ */
56
+ send(request: Pinnacle.messages.Mms, requestOptions?: Mms.RequestOptions): core.HttpResponsePromise<Pinnacle.messages.MmsSendResponse>;
57
+ private __send;
32
58
  /**
33
59
  * Validate MMS message content without sending it.
34
60
  *
@@ -19,6 +19,89 @@ export class Mms {
19
19
  constructor(_options) {
20
20
  this._options = _options;
21
21
  }
22
+ /**
23
+ * Send a MMS immediately or schedule it for future delivery.
24
+ *
25
+ * @param {Pinnacle.messages.Mms} request
26
+ * @param {Mms.RequestOptions} requestOptions - Request-specific configuration.
27
+ *
28
+ * @throws {@link Pinnacle.BadRequestError}
29
+ * @throws {@link Pinnacle.UnauthorizedError}
30
+ * @throws {@link Pinnacle.PaymentRequiredError}
31
+ * @throws {@link Pinnacle.NotFoundError}
32
+ * @throws {@link Pinnacle.InternalServerError}
33
+ *
34
+ * @example
35
+ * await client.messages.mms.send({
36
+ * from: "+14155164736",
37
+ * mediaUrls: ["https://fastly.picsum.photos/id/941/300/300.jpg?hmac=mDxM9PWSqRDjecwSCEpzU4bj35gqnG7yA25OL29uNv0"],
38
+ * options: {
39
+ * multiple_messages: true,
40
+ * validate: true
41
+ * },
42
+ * text: "Check out this image!",
43
+ * to: "+14154746461"
44
+ * })
45
+ */
46
+ send(request, requestOptions) {
47
+ return core.HttpResponsePromise.fromPromise(this.__send(request, requestOptions));
48
+ }
49
+ __send(request, requestOptions) {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ var _a, _b, _c;
52
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
53
+ const _response = yield core.fetcher({
54
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PinnacleEnvironment.Default, "messages/send/mms"),
55
+ method: "POST",
56
+ headers: _headers,
57
+ contentType: "application/json",
58
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
59
+ requestType: "json",
60
+ body: request,
61
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
62
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
63
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
64
+ });
65
+ if (_response.ok) {
66
+ return { data: _response.body, rawResponse: _response.rawResponse };
67
+ }
68
+ if (_response.error.reason === "status-code") {
69
+ switch (_response.error.statusCode) {
70
+ case 400:
71
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
72
+ case 401:
73
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
74
+ case 402:
75
+ throw new Pinnacle.PaymentRequiredError(_response.error.body, _response.rawResponse);
76
+ case 404:
77
+ throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
78
+ case 500:
79
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
80
+ default:
81
+ throw new errors.PinnacleError({
82
+ statusCode: _response.error.statusCode,
83
+ body: _response.error.body,
84
+ rawResponse: _response.rawResponse,
85
+ });
86
+ }
87
+ }
88
+ switch (_response.error.reason) {
89
+ case "non-json":
90
+ throw new errors.PinnacleError({
91
+ statusCode: _response.error.statusCode,
92
+ body: _response.error.rawBody,
93
+ rawResponse: _response.rawResponse,
94
+ });
95
+ case "timeout":
96
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /messages/send/mms.");
97
+ case "unknown":
98
+ throw new errors.PinnacleError({
99
+ message: _response.error.errorMessage,
100
+ rawResponse: _response.rawResponse,
101
+ });
102
+ }
103
+ });
104
+ }
22
105
  /**
23
106
  * Validate MMS message content without sending it.
24
107
  *
@@ -1 +1,2 @@
1
1
  export {};
2
+ export * from "./requests/index.mjs";
@@ -1 +1 @@
1
- export {};
1
+ export * from "./requests/index.mjs";
@@ -1,2 +1 @@
1
- export { type Sms } from "./Sms.mjs";
2
1
  export { type Mms } from "./Mms.mjs";
@@ -1 +1,2 @@
1
+ export * from "./types/index.mjs";
1
2
  export * from "./client/index.mjs";
@@ -1 +1,2 @@
1
+ export * from "./types/index.mjs";
1
2
  export * from "./client/index.mjs";
@@ -2,4 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Pinnacle from "../../../../../index.mjs";
5
- export type SendRcsResponse = Pinnacle.SentRcsDetails | Pinnacle.ScheduledMessaage;
5
+ export type MmsSendResponse = Pinnacle.SentMmsDetails | Pinnacle.ScheduledMessaage;
@@ -0,0 +1 @@
1
+ export * from "./MmsSendResponse.mjs";
@@ -0,0 +1 @@
1
+ export * from "./MmsSendResponse.mjs";
@@ -29,6 +29,34 @@ export declare namespace Rcs {
29
29
  export declare class Rcs {
30
30
  protected readonly _options: Rcs.Options;
31
31
  constructor(_options: Rcs.Options);
32
+ /**
33
+ * Send a RCS message immediately or schedule it for future delivery. <br>
34
+ *
35
+ * Requires an active RCS agent and recipient devices that support RCS Business Messaging.
36
+ *
37
+ * @param {Pinnacle.Rcs} request
38
+ * @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
39
+ *
40
+ * @throws {@link Pinnacle.BadRequestError}
41
+ * @throws {@link Pinnacle.UnauthorizedError}
42
+ * @throws {@link Pinnacle.PaymentRequiredError}
43
+ * @throws {@link Pinnacle.NotFoundError}
44
+ * @throws {@link Pinnacle.InternalServerError}
45
+ *
46
+ * @example
47
+ * await client.messages.rcs.send({
48
+ * quickReplies: [{
49
+ * type: "openUrl",
50
+ * payload: "payload",
51
+ * title: "title"
52
+ * }],
53
+ * text: "text",
54
+ * from: "from",
55
+ * to: "to"
56
+ * })
57
+ */
58
+ send(request: Pinnacle.Rcs, requestOptions?: Rcs.RequestOptions): core.HttpResponsePromise<Pinnacle.messages.RcsSendResponse>;
59
+ private __send;
32
60
  /**
33
61
  * Validate RCS message content without sending it.
34
62
  *
@@ -19,6 +19,91 @@ export class Rcs {
19
19
  constructor(_options) {
20
20
  this._options = _options;
21
21
  }
22
+ /**
23
+ * Send a RCS message immediately or schedule it for future delivery. <br>
24
+ *
25
+ * Requires an active RCS agent and recipient devices that support RCS Business Messaging.
26
+ *
27
+ * @param {Pinnacle.Rcs} request
28
+ * @param {Rcs.RequestOptions} requestOptions - Request-specific configuration.
29
+ *
30
+ * @throws {@link Pinnacle.BadRequestError}
31
+ * @throws {@link Pinnacle.UnauthorizedError}
32
+ * @throws {@link Pinnacle.PaymentRequiredError}
33
+ * @throws {@link Pinnacle.NotFoundError}
34
+ * @throws {@link Pinnacle.InternalServerError}
35
+ *
36
+ * @example
37
+ * await client.messages.rcs.send({
38
+ * quickReplies: [{
39
+ * type: "openUrl",
40
+ * payload: "payload",
41
+ * title: "title"
42
+ * }],
43
+ * text: "text",
44
+ * from: "from",
45
+ * to: "to"
46
+ * })
47
+ */
48
+ send(request, requestOptions) {
49
+ return core.HttpResponsePromise.fromPromise(this.__send(request, requestOptions));
50
+ }
51
+ __send(request, requestOptions) {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ var _a, _b, _c;
54
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
55
+ const _response = yield core.fetcher({
56
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PinnacleEnvironment.Default, "messages/send/rcs"),
57
+ method: "POST",
58
+ headers: _headers,
59
+ contentType: "application/json",
60
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
61
+ requestType: "json",
62
+ body: request,
63
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
64
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
65
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
66
+ });
67
+ if (_response.ok) {
68
+ return { data: _response.body, rawResponse: _response.rawResponse };
69
+ }
70
+ if (_response.error.reason === "status-code") {
71
+ switch (_response.error.statusCode) {
72
+ case 400:
73
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
74
+ case 401:
75
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
76
+ case 402:
77
+ throw new Pinnacle.PaymentRequiredError(_response.error.body, _response.rawResponse);
78
+ case 404:
79
+ throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
80
+ case 500:
81
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
82
+ default:
83
+ throw new errors.PinnacleError({
84
+ statusCode: _response.error.statusCode,
85
+ body: _response.error.body,
86
+ rawResponse: _response.rawResponse,
87
+ });
88
+ }
89
+ }
90
+ switch (_response.error.reason) {
91
+ case "non-json":
92
+ throw new errors.PinnacleError({
93
+ statusCode: _response.error.statusCode,
94
+ body: _response.error.rawBody,
95
+ rawResponse: _response.rawResponse,
96
+ });
97
+ case "timeout":
98
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /messages/send/rcs.");
99
+ case "unknown":
100
+ throw new errors.PinnacleError({
101
+ message: _response.error.errorMessage,
102
+ rawResponse: _response.rawResponse,
103
+ });
104
+ }
105
+ });
106
+ }
22
107
  /**
23
108
  * Validate RCS message content without sending it.
24
109
  *
@@ -1 +1,2 @@
1
+ export * from "./types/index.mjs";
1
2
  export * from "./client/index.mjs";
@@ -1 +1,2 @@
1
+ export * from "./types/index.mjs";
1
2
  export * from "./client/index.mjs";
@@ -2,4 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Pinnacle from "../../../../../index.mjs";
5
- export type SendSmsResponse = Pinnacle.SentSmsDetails | Pinnacle.ScheduledMessaage;
5
+ export type RcsSendResponse = Pinnacle.SentRcsDetails | Pinnacle.ScheduledMessaage;
@@ -0,0 +1 @@
1
+ export * from "./RcsSendResponse.mjs";
@@ -0,0 +1 @@
1
+ export * from "./RcsSendResponse.mjs";
@@ -29,6 +29,27 @@ export declare namespace Sms {
29
29
  export declare class Sms {
30
30
  protected readonly _options: Sms.Options;
31
31
  constructor(_options: Sms.Options);
32
+ /**
33
+ * Send a SMS message immediately or schedule it for future delivery.
34
+ *
35
+ * @param {Pinnacle.messages.Sms} request
36
+ * @param {Sms.RequestOptions} requestOptions - Request-specific configuration.
37
+ *
38
+ * @throws {@link Pinnacle.BadRequestError}
39
+ * @throws {@link Pinnacle.UnauthorizedError}
40
+ * @throws {@link Pinnacle.PaymentRequiredError}
41
+ * @throws {@link Pinnacle.NotFoundError}
42
+ * @throws {@link Pinnacle.InternalServerError}
43
+ *
44
+ * @example
45
+ * await client.messages.sms.send({
46
+ * from: "+14155164736",
47
+ * text: "Hey!",
48
+ * to: "+14154746461"
49
+ * })
50
+ */
51
+ send(request: Pinnacle.messages.Sms, requestOptions?: Sms.RequestOptions): core.HttpResponsePromise<Pinnacle.messages.SmsSendResponse>;
52
+ private __send;
32
53
  /**
33
54
  * Validate SMS message content without sending it.
34
55
  *
@@ -40,7 +61,7 @@ export declare class Sms {
40
61
  * @throws {@link Pinnacle.InternalServerError}
41
62
  *
42
63
  * @example
43
- * await client.message.sms.validate({
64
+ * await client.messages.sms.validate({
44
65
  * text: "Hello from Pinnacle"
45
66
  * })
46
67
  */
@@ -15,7 +15,7 @@ import * as core from "../../../../../../core/index.mjs";
15
15
  import * as Pinnacle from "../../../../../index.mjs";
16
16
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
17
17
  import * as errors from "../../../../../../errors/index.mjs";
18
- export class Send {
18
+ export class Sms {
19
19
  constructor(_options) {
20
20
  this._options = _options;
21
21
  }
@@ -23,7 +23,7 @@ export class Send {
23
23
  * Send a SMS message immediately or schedule it for future delivery.
24
24
  *
25
25
  * @param {Pinnacle.messages.Sms} request
26
- * @param {Send.RequestOptions} requestOptions - Request-specific configuration.
26
+ * @param {Sms.RequestOptions} requestOptions - Request-specific configuration.
27
27
  *
28
28
  * @throws {@link Pinnacle.BadRequestError}
29
29
  * @throws {@link Pinnacle.UnauthorizedError}
@@ -32,16 +32,16 @@ export class Send {
32
32
  * @throws {@link Pinnacle.InternalServerError}
33
33
  *
34
34
  * @example
35
- * await client.messages.send.sms({
35
+ * await client.messages.sms.send({
36
36
  * from: "+14155164736",
37
- * text: "Hey! \uD83D\uDE02",
37
+ * text: "Hey!",
38
38
  * to: "+14154746461"
39
39
  * })
40
40
  */
41
- sms(request, requestOptions) {
42
- return core.HttpResponsePromise.fromPromise(this.__sms(request, requestOptions));
41
+ send(request, requestOptions) {
42
+ return core.HttpResponsePromise.fromPromise(this.__send(request, requestOptions));
43
43
  }
44
- __sms(request, requestOptions) {
44
+ __send(request, requestOptions) {
45
45
  return __awaiter(this, void 0, void 0, function* () {
46
46
  var _a, _b, _c;
47
47
  let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
@@ -98,38 +98,29 @@ export class Send {
98
98
  });
99
99
  }
100
100
  /**
101
- * Send a MMS immediately or schedule it for future delivery.
101
+ * Validate SMS message content without sending it.
102
102
  *
103
- * @param {Pinnacle.messages.Mms} request
104
- * @param {Send.RequestOptions} requestOptions - Request-specific configuration.
103
+ * @param {Pinnacle.SmsContent} request
104
+ * @param {Sms.RequestOptions} requestOptions - Request-specific configuration.
105
105
  *
106
106
  * @throws {@link Pinnacle.BadRequestError}
107
107
  * @throws {@link Pinnacle.UnauthorizedError}
108
- * @throws {@link Pinnacle.PaymentRequiredError}
109
- * @throws {@link Pinnacle.NotFoundError}
110
108
  * @throws {@link Pinnacle.InternalServerError}
111
109
  *
112
110
  * @example
113
- * await client.messages.send.mms({
114
- * from: "+14155164736",
115
- * mediaUrls: ["https://fastly.picsum.photos/id/941/300/300.jpg?hmac=mDxM9PWSqRDjecwSCEpzU4bj35gqnG7yA25OL29uNv0"],
116
- * options: {
117
- * multiple_messages: true,
118
- * validate: true
119
- * },
120
- * text: "Check out this image!",
121
- * to: "+14154746461"
111
+ * await client.messages.sms.validate({
112
+ * text: "Hello from Pinnacle"
122
113
  * })
123
114
  */
124
- mms(request, requestOptions) {
125
- return core.HttpResponsePromise.fromPromise(this.__mms(request, requestOptions));
115
+ validate(request, requestOptions) {
116
+ return core.HttpResponsePromise.fromPromise(this.__validate(request, requestOptions));
126
117
  }
127
- __mms(request, requestOptions) {
118
+ __validate(request, requestOptions) {
128
119
  return __awaiter(this, void 0, void 0, function* () {
129
120
  var _a, _b, _c;
130
121
  let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
131
122
  const _response = yield core.fetcher({
132
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PinnacleEnvironment.Default, "messages/send/mms"),
123
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PinnacleEnvironment.Default, "messages/validate/sms"),
133
124
  method: "POST",
134
125
  headers: _headers,
135
126
  contentType: "application/json",
@@ -149,95 +140,6 @@ export class Send {
149
140
  throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
150
141
  case 401:
151
142
  throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
152
- case 402:
153
- throw new Pinnacle.PaymentRequiredError(_response.error.body, _response.rawResponse);
154
- case 404:
155
- throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
156
- case 500:
157
- throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
158
- default:
159
- throw new errors.PinnacleError({
160
- statusCode: _response.error.statusCode,
161
- body: _response.error.body,
162
- rawResponse: _response.rawResponse,
163
- });
164
- }
165
- }
166
- switch (_response.error.reason) {
167
- case "non-json":
168
- throw new errors.PinnacleError({
169
- statusCode: _response.error.statusCode,
170
- body: _response.error.rawBody,
171
- rawResponse: _response.rawResponse,
172
- });
173
- case "timeout":
174
- throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /messages/send/mms.");
175
- case "unknown":
176
- throw new errors.PinnacleError({
177
- message: _response.error.errorMessage,
178
- rawResponse: _response.rawResponse,
179
- });
180
- }
181
- });
182
- }
183
- /**
184
- * Send a RCS message immediately or schedule it for future delivery. <br>
185
- *
186
- * Requires an active RCS agent and recipient devices that support RCS Business Messaging.
187
- *
188
- * @param {Pinnacle.Rcs} request
189
- * @param {Send.RequestOptions} requestOptions - Request-specific configuration.
190
- *
191
- * @throws {@link Pinnacle.BadRequestError}
192
- * @throws {@link Pinnacle.UnauthorizedError}
193
- * @throws {@link Pinnacle.PaymentRequiredError}
194
- * @throws {@link Pinnacle.NotFoundError}
195
- * @throws {@link Pinnacle.InternalServerError}
196
- *
197
- * @example
198
- * await client.messages.send.rcs({
199
- * quickReplies: [{
200
- * type: "openUrl",
201
- * payload: "payload",
202
- * title: "title"
203
- * }],
204
- * text: "text",
205
- * from: "from",
206
- * to: "to"
207
- * })
208
- */
209
- rcs(request, requestOptions) {
210
- return core.HttpResponsePromise.fromPromise(this.__rcs(request, requestOptions));
211
- }
212
- __rcs(request, requestOptions) {
213
- return __awaiter(this, void 0, void 0, function* () {
214
- var _a, _b, _c;
215
- let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
216
- const _response = yield core.fetcher({
217
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PinnacleEnvironment.Default, "messages/send/rcs"),
218
- method: "POST",
219
- headers: _headers,
220
- contentType: "application/json",
221
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
222
- requestType: "json",
223
- body: request,
224
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
225
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
226
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
227
- });
228
- if (_response.ok) {
229
- return { data: _response.body, rawResponse: _response.rawResponse };
230
- }
231
- if (_response.error.reason === "status-code") {
232
- switch (_response.error.statusCode) {
233
- case 400:
234
- throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
235
- case 401:
236
- throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
237
- case 402:
238
- throw new Pinnacle.PaymentRequiredError(_response.error.body, _response.rawResponse);
239
- case 404:
240
- throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
241
143
  case 500:
242
144
  throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
243
145
  default:
@@ -256,7 +158,7 @@ export class Send {
256
158
  rawResponse: _response.rawResponse,
257
159
  });
258
160
  case "timeout":
259
- throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /messages/send/rcs.");
161
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /messages/validate/sms.");
260
162
  case "unknown":
261
163
  throw new errors.PinnacleError({
262
164
  message: _response.error.errorMessage,
@@ -6,14 +6,14 @@ import * as Pinnacle from "../../../../../../index.mjs";
6
6
  * @example
7
7
  * {
8
8
  * from: "+14155164736",
9
- * text: "Hey! \uD83D\uDE02",
9
+ * text: "Hey!",
10
10
  * to: "+14154746461"
11
11
  * }
12
12
  *
13
13
  * @example
14
14
  * {
15
15
  * from: "+14155164736",
16
- * text: "Hey! \uD83D\uDE02",
16
+ * text: "Hey!",
17
17
  * to: "+14154746461"
18
18
  * }
19
19
  */
@@ -0,0 +1 @@
1
+ export { type Sms } from "./Sms.mjs";
@@ -2,4 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Pinnacle from "../../../../../index.mjs";
5
- export type SendMmsResponse = Pinnacle.SentMmsDetails | Pinnacle.ScheduledMessaage;
5
+ export type SmsSendResponse = Pinnacle.SentSmsDetails | Pinnacle.ScheduledMessaage;
@@ -0,0 +1 @@
1
+ export * from "./SmsSendResponse.mjs";
@@ -0,0 +1 @@
1
+ export * from "./SmsSendResponse.mjs";
@@ -29,7 +29,7 @@ export interface SearchPhoneNumberParams {
29
29
  */
30
30
  location?: SearchPhoneNumberParams.Location;
31
31
  /** Filter your search by digit pattern. */
32
- number?: SearchPhoneNumberParams.PhoneNumberDigitFilters;
32
+ number?: SearchPhoneNumberParams.Number;
33
33
  /** Extra search settings to control how many results you get. */
34
34
  options?: SearchPhoneNumberParams.Options;
35
35
  /** Types of phone numbers to return in your search. */
@@ -58,7 +58,7 @@ export declare namespace SearchPhoneNumberParams {
58
58
  /**
59
59
  * Filter your search by digit pattern.
60
60
  */
61
- interface PhoneNumberDigitFilters {
61
+ interface Number {
62
62
  /** Your search will return only numbers that contain this digit sequence anywhere within them. */
63
63
  contains?: string;
64
64
  /** Your search will return only numbers that end with these digits. */
@@ -5,10 +5,10 @@ import * as Pinnacle from "../index.mjs";
5
5
  export type Rcs =
6
6
  /**
7
7
  * Send a text RCS message with optional quick reply buttons. */
8
- Pinnacle.RcsText
8
+ Pinnacle.RichTextMessage
9
9
  /**
10
10
  * Send a media RCS message with optional quick reply buttons. */
11
- | Pinnacle.RcsMedia
11
+ | Pinnacle.RichMediaMessage
12
12
  /**
13
13
  * Send a cards RCS message with optional quick reply buttons. */
14
- | Pinnacle.RcsCard;
14
+ | Pinnacle.RichCardsMessage;