rcs-js 2.0.17 → 2.0.19

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 (92) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/messages/client/Client.d.ts +3 -0
  3. package/dist/cjs/api/resources/messages/client/Client.js +7 -2
  4. package/dist/cjs/api/resources/messages/resources/index.d.ts +1 -0
  5. package/dist/cjs/api/resources/messages/resources/index.js +2 -1
  6. package/dist/cjs/api/resources/messages/resources/simulate/client/Client.d.ts +125 -0
  7. package/dist/cjs/api/resources/messages/resources/simulate/client/Client.js +231 -0
  8. package/dist/cjs/api/resources/messages/resources/simulate/client/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/messages/resources/simulate/client/index.js +2 -0
  10. package/dist/cjs/api/resources/messages/resources/simulate/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/messages/resources/simulate/index.js +17 -0
  12. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +3 -1
  13. package/dist/cjs/api/resources/webhooks/client/Client.js +3 -1
  14. package/dist/cjs/api/resources/webhooks/client/requests/AttachWebhookParams.d.ts +15 -1
  15. package/dist/cjs/api/types/AttachWebhookResult.d.ts +2 -0
  16. package/dist/cjs/api/types/SimulateMessageInput.d.ts +10 -0
  17. package/dist/cjs/api/types/SimulateMessageInput.js +3 -0
  18. package/dist/cjs/api/types/SimulateUserButton.d.ts +11 -0
  19. package/dist/cjs/api/types/SimulateUserButton.js +3 -0
  20. package/dist/cjs/api/types/SimulateUserMessage.d.ts +11 -0
  21. package/dist/cjs/api/types/SimulateUserMessage.js +3 -0
  22. package/dist/cjs/api/types/SimulateUserParams.d.ts +11 -0
  23. package/dist/cjs/api/types/SimulateUserParams.js +3 -0
  24. package/dist/cjs/api/types/SimulateUserResponse.d.ts +6 -0
  25. package/dist/cjs/api/types/SimulateUserResponse.js +3 -0
  26. package/dist/cjs/api/types/UserButtonPress.d.ts +25 -0
  27. package/dist/cjs/api/types/UserButtonPress.js +3 -0
  28. package/dist/cjs/api/types/UserButtonPressCall.d.ts +11 -0
  29. package/dist/cjs/api/types/UserButtonPressCall.js +3 -0
  30. package/dist/cjs/api/types/UserButtonPressOpenUrl.d.ts +11 -0
  31. package/dist/cjs/api/types/UserButtonPressOpenUrl.js +3 -0
  32. package/dist/cjs/api/types/UserButtonPressRequestUserLocation.d.ts +22 -0
  33. package/dist/cjs/api/types/UserButtonPressRequestUserLocation.js +3 -0
  34. package/dist/cjs/api/types/UserButtonPressScheduleEvent.d.ts +15 -0
  35. package/dist/cjs/api/types/UserButtonPressScheduleEvent.js +3 -0
  36. package/dist/cjs/api/types/UserButtonPressSendLocation.d.ts +24 -0
  37. package/dist/cjs/api/types/UserButtonPressSendLocation.js +3 -0
  38. package/dist/cjs/api/types/UserButtonPressTrigger.d.ts +11 -0
  39. package/dist/cjs/api/types/UserButtonPressTrigger.js +3 -0
  40. package/dist/cjs/api/types/WebhookSummary.d.ts +2 -0
  41. package/dist/cjs/api/types/Webhooks.d.ts +2 -0
  42. package/dist/cjs/api/types/index.d.ts +12 -0
  43. package/dist/cjs/api/types/index.js +12 -0
  44. package/dist/cjs/version.d.ts +1 -1
  45. package/dist/cjs/version.js +1 -1
  46. package/dist/esm/Client.mjs +2 -2
  47. package/dist/esm/api/resources/messages/client/Client.d.mts +3 -0
  48. package/dist/esm/api/resources/messages/client/Client.mjs +5 -0
  49. package/dist/esm/api/resources/messages/resources/index.d.mts +1 -0
  50. package/dist/esm/api/resources/messages/resources/index.mjs +1 -0
  51. package/dist/esm/api/resources/messages/resources/simulate/client/Client.d.mts +125 -0
  52. package/dist/esm/api/resources/messages/resources/simulate/client/Client.mjs +194 -0
  53. package/dist/esm/api/resources/messages/resources/simulate/client/index.d.mts +1 -0
  54. package/dist/esm/api/resources/messages/resources/simulate/client/index.mjs +1 -0
  55. package/dist/esm/api/resources/messages/resources/simulate/index.d.mts +1 -0
  56. package/dist/esm/api/resources/messages/resources/simulate/index.mjs +1 -0
  57. package/dist/esm/api/resources/webhooks/client/Client.d.mts +3 -1
  58. package/dist/esm/api/resources/webhooks/client/Client.mjs +3 -1
  59. package/dist/esm/api/resources/webhooks/client/requests/AttachWebhookParams.d.mts +15 -1
  60. package/dist/esm/api/types/AttachWebhookResult.d.mts +2 -0
  61. package/dist/esm/api/types/SimulateMessageInput.d.mts +10 -0
  62. package/dist/esm/api/types/SimulateMessageInput.mjs +2 -0
  63. package/dist/esm/api/types/SimulateUserButton.d.mts +11 -0
  64. package/dist/esm/api/types/SimulateUserButton.mjs +2 -0
  65. package/dist/esm/api/types/SimulateUserMessage.d.mts +11 -0
  66. package/dist/esm/api/types/SimulateUserMessage.mjs +2 -0
  67. package/dist/esm/api/types/SimulateUserParams.d.mts +11 -0
  68. package/dist/esm/api/types/SimulateUserParams.mjs +2 -0
  69. package/dist/esm/api/types/SimulateUserResponse.d.mts +6 -0
  70. package/dist/esm/api/types/SimulateUserResponse.mjs +2 -0
  71. package/dist/esm/api/types/UserButtonPress.d.mts +25 -0
  72. package/dist/esm/api/types/UserButtonPress.mjs +2 -0
  73. package/dist/esm/api/types/UserButtonPressCall.d.mts +11 -0
  74. package/dist/esm/api/types/UserButtonPressCall.mjs +2 -0
  75. package/dist/esm/api/types/UserButtonPressOpenUrl.d.mts +11 -0
  76. package/dist/esm/api/types/UserButtonPressOpenUrl.mjs +2 -0
  77. package/dist/esm/api/types/UserButtonPressRequestUserLocation.d.mts +22 -0
  78. package/dist/esm/api/types/UserButtonPressRequestUserLocation.mjs +2 -0
  79. package/dist/esm/api/types/UserButtonPressScheduleEvent.d.mts +15 -0
  80. package/dist/esm/api/types/UserButtonPressScheduleEvent.mjs +2 -0
  81. package/dist/esm/api/types/UserButtonPressSendLocation.d.mts +24 -0
  82. package/dist/esm/api/types/UserButtonPressSendLocation.mjs +2 -0
  83. package/dist/esm/api/types/UserButtonPressTrigger.d.mts +11 -0
  84. package/dist/esm/api/types/UserButtonPressTrigger.mjs +2 -0
  85. package/dist/esm/api/types/WebhookSummary.d.mts +2 -0
  86. package/dist/esm/api/types/Webhooks.d.mts +2 -0
  87. package/dist/esm/api/types/index.d.mts +12 -0
  88. package/dist/esm/api/types/index.mjs +12 -0
  89. package/dist/esm/version.d.mts +1 -1
  90. package/dist/esm/version.mjs +1 -1
  91. package/package.json +1 -1
  92. package/reference.md +73 -1
@@ -53,8 +53,8 @@ class PinnacleClient {
53
53
  this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: (0, headers_js_1.mergeHeaders)({
54
54
  "X-Fern-Language": "JavaScript",
55
55
  "X-Fern-SDK-Name": "rcs-js",
56
- "X-Fern-SDK-Version": "2.0.17",
57
- "User-Agent": "rcs-js/2.0.17",
56
+ "X-Fern-SDK-Version": "2.0.19",
57
+ "User-Agent": "rcs-js/2.0.19",
58
58
  "X-Fern-Runtime": core.RUNTIME.type,
59
59
  "X-Fern-Runtime-Version": core.RUNTIME.version,
60
60
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -7,6 +7,7 @@ import { Mms } from "../resources/mms/client/Client.js";
7
7
  import { Rcs } from "../resources/rcs/client/Client.js";
8
8
  import { Schedule } from "../resources/schedule/client/Client.js";
9
9
  import { Schedules } from "../resources/schedules/client/Client.js";
10
+ import { Simulate } from "../resources/simulate/client/Client.js";
10
11
  import { Sms } from "../resources/sms/client/Client.js";
11
12
  export declare namespace Messages {
12
13
  interface Options extends BaseClientOptions {
@@ -23,6 +24,7 @@ export declare class Messages {
23
24
  protected _schedule: Schedule | undefined;
24
25
  protected _schedules: Schedules | undefined;
25
26
  protected _blasts: Blasts | undefined;
27
+ protected _simulate: Simulate | undefined;
26
28
  constructor(_options: Messages.Options);
27
29
  get sms(): Sms;
28
30
  get mms(): Mms;
@@ -31,6 +33,7 @@ export declare class Messages {
31
33
  get schedule(): Schedule;
32
34
  get schedules(): Schedules;
33
35
  get blasts(): Blasts;
36
+ get simulate(): Simulate;
34
37
  /**
35
38
  * Retrieve a previously sent message.
36
39
  *
@@ -55,14 +55,15 @@ const Client_js_3 = require("../resources/mms/client/Client.js");
55
55
  const Client_js_4 = require("../resources/rcs/client/Client.js");
56
56
  const Client_js_5 = require("../resources/schedule/client/Client.js");
57
57
  const Client_js_6 = require("../resources/schedules/client/Client.js");
58
- const Client_js_7 = require("../resources/sms/client/Client.js");
58
+ const Client_js_7 = require("../resources/simulate/client/Client.js");
59
+ const Client_js_8 = require("../resources/sms/client/Client.js");
59
60
  class Messages {
60
61
  constructor(_options) {
61
62
  this._options = _options;
62
63
  }
63
64
  get sms() {
64
65
  var _a;
65
- return ((_a = this._sms) !== null && _a !== void 0 ? _a : (this._sms = new Client_js_7.Sms(this._options)));
66
+ return ((_a = this._sms) !== null && _a !== void 0 ? _a : (this._sms = new Client_js_8.Sms(this._options)));
66
67
  }
67
68
  get mms() {
68
69
  var _a;
@@ -88,6 +89,10 @@ class Messages {
88
89
  var _a;
89
90
  return ((_a = this._blasts) !== null && _a !== void 0 ? _a : (this._blasts = new Client_js_2.Blasts(this._options)));
90
91
  }
92
+ get simulate() {
93
+ var _a;
94
+ return ((_a = this._simulate) !== null && _a !== void 0 ? _a : (this._simulate = new Client_js_7.Simulate(this._options)));
95
+ }
91
96
  /**
92
97
  * Retrieve a previously sent message.
93
98
  *
@@ -12,6 +12,7 @@ export * from "./rcs/types/index.js";
12
12
  export * as schedule from "./schedule/index.js";
13
13
  export * from "./schedules/client/requests/index.js";
14
14
  export * as schedules from "./schedules/index.js";
15
+ export * as simulate from "./simulate/index.js";
15
16
  export * from "./sms/client/requests/index.js";
16
17
  export * as sms from "./sms/index.js";
17
18
  export * from "./sms/types/index.js";
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.sms = exports.schedules = exports.schedule = exports.rcs = exports.mms = exports.blasts = exports.blast = void 0;
39
+ exports.sms = exports.simulate = exports.schedules = exports.schedule = exports.rcs = exports.mms = exports.blasts = exports.blast = void 0;
40
40
  __exportStar(require("./blast/client/requests/index.js"), exports);
41
41
  exports.blast = __importStar(require("./blast/index.js"));
42
42
  __exportStar(require("./blast/types/index.js"), exports);
@@ -51,6 +51,7 @@ __exportStar(require("./rcs/types/index.js"), exports);
51
51
  exports.schedule = __importStar(require("./schedule/index.js"));
52
52
  __exportStar(require("./schedules/client/requests/index.js"), exports);
53
53
  exports.schedules = __importStar(require("./schedules/index.js"));
54
+ exports.simulate = __importStar(require("./simulate/index.js"));
54
55
  __exportStar(require("./sms/client/requests/index.js"), exports);
55
56
  exports.sms = __importStar(require("./sms/index.js"));
56
57
  __exportStar(require("./sms/types/index.js"), exports);
@@ -0,0 +1,125 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
2
+ import * as core from "../../../../../../core/index.js";
3
+ import * as Pinnacle from "../../../../../index.js";
4
+ export declare namespace Simulate {
5
+ interface Options extends BaseClientOptions {
6
+ }
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class Simulate {
11
+ protected readonly _options: Simulate.Options;
12
+ constructor(_options: Simulate.Options);
13
+ /**
14
+ * Simulate inbound messages and button presses from a user.
15
+ *
16
+ * @param {Pinnacle.SimulateUserParams} request
17
+ * @param {Simulate.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link Pinnacle.BadRequestError}
20
+ * @throws {@link Pinnacle.UnauthorizedError}
21
+ * @throws {@link Pinnacle.ForbiddenError}
22
+ * @throws {@link Pinnacle.InternalServerError}
23
+ *
24
+ * @example
25
+ * await client.messages.simulate.user({
26
+ * from: "+14155551234",
27
+ * to: "+14155555678",
28
+ * message: {
29
+ * text: "Hello from the test user!"
30
+ * }
31
+ * })
32
+ *
33
+ * @example
34
+ * await client.messages.simulate.user({
35
+ * from: "+14155551234",
36
+ * to: "+14155555678",
37
+ * message: {
38
+ * mediaUrls: ["https://example.com/image.jpg"]
39
+ * }
40
+ * })
41
+ *
42
+ * @example
43
+ * await client.messages.simulate.user({
44
+ * from: "+14155551234",
45
+ * to: "+14155555678",
46
+ * message: {
47
+ * text: "Check this out",
48
+ * mediaUrls: ["https://example.com/image.jpg"]
49
+ * }
50
+ * })
51
+ *
52
+ * @example
53
+ * await client.messages.simulate.user({
54
+ * from: "+14155551234",
55
+ * to: "agent_abc123",
56
+ * button: {
57
+ * type: "trigger",
58
+ * title: "Sign Up",
59
+ * payload: "user_clicked_signup"
60
+ * }
61
+ * })
62
+ *
63
+ * @example
64
+ * await client.messages.simulate.user({
65
+ * from: "+14155551234",
66
+ * to: "agent_abc123",
67
+ * button: {
68
+ * type: "openUrl",
69
+ * title: "Visit Website"
70
+ * }
71
+ * })
72
+ *
73
+ * @example
74
+ * await client.messages.simulate.user({
75
+ * from: "+14155551234",
76
+ * to: "agent_abc123",
77
+ * button: {
78
+ * type: "call",
79
+ * title: "Call Us",
80
+ * payload: "+15555555555"
81
+ * }
82
+ * })
83
+ *
84
+ * @example
85
+ * await client.messages.simulate.user({
86
+ * from: "+14155551234",
87
+ * to: "agent_abc123",
88
+ * button: {
89
+ * type: "scheduleEvent",
90
+ * title: "Add to Calendar",
91
+ * eventTitle: "Pinnacle Workshop",
92
+ * eventStartTime: "2025-12-12T10:00:00Z",
93
+ * eventEndTime: "2025-12-12T11:00:00Z"
94
+ * }
95
+ * })
96
+ *
97
+ * @example
98
+ * await client.messages.simulate.user({
99
+ * from: "+14155551234",
100
+ * to: "agent_abc123",
101
+ * button: {
102
+ * type: "sendLocation",
103
+ * title: "View Location",
104
+ * name: "Pinnacle HQ",
105
+ * latLong: {
106
+ * lat: 37.7899,
107
+ * lng: -122.3969
108
+ * }
109
+ * }
110
+ * })
111
+ *
112
+ * @example
113
+ * await client.messages.simulate.user({
114
+ * from: "+14155551234",
115
+ * to: "agent_abc123",
116
+ * button: {
117
+ * type: "requestUserLocation",
118
+ * title: "Share Location"
119
+ * }
120
+ * })
121
+ */
122
+ user(request: Pinnacle.SimulateUserParams, requestOptions?: Simulate.RequestOptions): core.HttpResponsePromise<Pinnacle.SimulateUserResponse>;
123
+ private __user;
124
+ protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
125
+ }
@@ -0,0 +1,231 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.Simulate = void 0;
47
+ const headers_js_1 = require("../../../../../../core/headers.js");
48
+ const core = __importStar(require("../../../../../../core/index.js"));
49
+ const environments = __importStar(require("../../../../../../environments.js"));
50
+ const errors = __importStar(require("../../../../../../errors/index.js"));
51
+ const Pinnacle = __importStar(require("../../../../../index.js"));
52
+ class Simulate {
53
+ constructor(_options) {
54
+ this._options = _options;
55
+ }
56
+ /**
57
+ * Simulate inbound messages and button presses from a user.
58
+ *
59
+ * @param {Pinnacle.SimulateUserParams} request
60
+ * @param {Simulate.RequestOptions} requestOptions - Request-specific configuration.
61
+ *
62
+ * @throws {@link Pinnacle.BadRequestError}
63
+ * @throws {@link Pinnacle.UnauthorizedError}
64
+ * @throws {@link Pinnacle.ForbiddenError}
65
+ * @throws {@link Pinnacle.InternalServerError}
66
+ *
67
+ * @example
68
+ * await client.messages.simulate.user({
69
+ * from: "+14155551234",
70
+ * to: "+14155555678",
71
+ * message: {
72
+ * text: "Hello from the test user!"
73
+ * }
74
+ * })
75
+ *
76
+ * @example
77
+ * await client.messages.simulate.user({
78
+ * from: "+14155551234",
79
+ * to: "+14155555678",
80
+ * message: {
81
+ * mediaUrls: ["https://example.com/image.jpg"]
82
+ * }
83
+ * })
84
+ *
85
+ * @example
86
+ * await client.messages.simulate.user({
87
+ * from: "+14155551234",
88
+ * to: "+14155555678",
89
+ * message: {
90
+ * text: "Check this out",
91
+ * mediaUrls: ["https://example.com/image.jpg"]
92
+ * }
93
+ * })
94
+ *
95
+ * @example
96
+ * await client.messages.simulate.user({
97
+ * from: "+14155551234",
98
+ * to: "agent_abc123",
99
+ * button: {
100
+ * type: "trigger",
101
+ * title: "Sign Up",
102
+ * payload: "user_clicked_signup"
103
+ * }
104
+ * })
105
+ *
106
+ * @example
107
+ * await client.messages.simulate.user({
108
+ * from: "+14155551234",
109
+ * to: "agent_abc123",
110
+ * button: {
111
+ * type: "openUrl",
112
+ * title: "Visit Website"
113
+ * }
114
+ * })
115
+ *
116
+ * @example
117
+ * await client.messages.simulate.user({
118
+ * from: "+14155551234",
119
+ * to: "agent_abc123",
120
+ * button: {
121
+ * type: "call",
122
+ * title: "Call Us",
123
+ * payload: "+15555555555"
124
+ * }
125
+ * })
126
+ *
127
+ * @example
128
+ * await client.messages.simulate.user({
129
+ * from: "+14155551234",
130
+ * to: "agent_abc123",
131
+ * button: {
132
+ * type: "scheduleEvent",
133
+ * title: "Add to Calendar",
134
+ * eventTitle: "Pinnacle Workshop",
135
+ * eventStartTime: "2025-12-12T10:00:00Z",
136
+ * eventEndTime: "2025-12-12T11:00:00Z"
137
+ * }
138
+ * })
139
+ *
140
+ * @example
141
+ * await client.messages.simulate.user({
142
+ * from: "+14155551234",
143
+ * to: "agent_abc123",
144
+ * button: {
145
+ * type: "sendLocation",
146
+ * title: "View Location",
147
+ * name: "Pinnacle HQ",
148
+ * latLong: {
149
+ * lat: 37.7899,
150
+ * lng: -122.3969
151
+ * }
152
+ * }
153
+ * })
154
+ *
155
+ * @example
156
+ * await client.messages.simulate.user({
157
+ * from: "+14155551234",
158
+ * to: "agent_abc123",
159
+ * button: {
160
+ * type: "requestUserLocation",
161
+ * title: "Share Location"
162
+ * }
163
+ * })
164
+ */
165
+ user(request, requestOptions) {
166
+ return core.HttpResponsePromise.fromPromise(this.__user(request, requestOptions));
167
+ }
168
+ __user(request, requestOptions) {
169
+ return __awaiter(this, void 0, void 0, function* () {
170
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
171
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
172
+ const _response = yield core.fetcher({
173
+ 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/simulate/user"),
174
+ method: "POST",
175
+ headers: _headers,
176
+ contentType: "application/json",
177
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
178
+ requestType: "json",
179
+ body: request,
180
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
181
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
182
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
183
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
184
+ logging: this._options.logging,
185
+ });
186
+ if (_response.ok) {
187
+ return { data: _response.body, rawResponse: _response.rawResponse };
188
+ }
189
+ if (_response.error.reason === "status-code") {
190
+ switch (_response.error.statusCode) {
191
+ case 400:
192
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
193
+ case 401:
194
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
195
+ case 403:
196
+ throw new Pinnacle.ForbiddenError(_response.error.body, _response.rawResponse);
197
+ case 500:
198
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
199
+ default:
200
+ throw new errors.PinnacleError({
201
+ statusCode: _response.error.statusCode,
202
+ body: _response.error.body,
203
+ rawResponse: _response.rawResponse,
204
+ });
205
+ }
206
+ }
207
+ switch (_response.error.reason) {
208
+ case "non-json":
209
+ throw new errors.PinnacleError({
210
+ statusCode: _response.error.statusCode,
211
+ body: _response.error.rawBody,
212
+ rawResponse: _response.rawResponse,
213
+ });
214
+ case "timeout":
215
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /messages/simulate/user.");
216
+ case "unknown":
217
+ throw new errors.PinnacleError({
218
+ message: _response.error.errorMessage,
219
+ rawResponse: _response.rawResponse,
220
+ });
221
+ }
222
+ });
223
+ }
224
+ _getCustomAuthorizationHeaders() {
225
+ return __awaiter(this, void 0, void 0, function* () {
226
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
227
+ return { "PINNACLE-API-KEY": apiKeyValue };
228
+ });
229
+ }
230
+ }
231
+ exports.Simulate = Simulate;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -48,7 +48,9 @@ export declare class Webhooks {
48
48
  *
49
49
  * You can attach an existing webhook by providing its ID, or create a new webhook by specifying a name and URL. Supports bulk operations with up to 50 senders per request. <br>
50
50
  *
51
- * Subscriptions are additive — attaching new senders does not remove existing ones. Re-attaching the same sender updates the event type filter without creating duplicates.
51
+ * Subscriptions are additive — attaching new senders does not remove existing ones. Re-attaching the same sender updates the event type filter without creating duplicates. <br>
52
+ *
53
+ * **Custom headers** may be provided in either case via the optional `headers` field. When attaching a new webhook, the headers are stored on the webhook and sent on every delivery. When attaching an existing `webhookId`, supplying `headers` **overwrites** the stored headers on that webhook — omit the field to leave them unchanged, or pass an empty object `{}` to clear them. The reserved `PINNACLE-SIGNING-SECRET` header is always set by Pinnacle and cannot be overridden.
52
54
  *
53
55
  * @param {Pinnacle.AttachWebhookParams} request
54
56
  * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
@@ -203,7 +203,9 @@ class Webhooks {
203
203
  *
204
204
  * You can attach an existing webhook by providing its ID, or create a new webhook by specifying a name and URL. Supports bulk operations with up to 50 senders per request. <br>
205
205
  *
206
- * Subscriptions are additive — attaching new senders does not remove existing ones. Re-attaching the same sender updates the event type filter without creating duplicates.
206
+ * Subscriptions are additive — attaching new senders does not remove existing ones. Re-attaching the same sender updates the event type filter without creating duplicates. <br>
207
+ *
208
+ * **Custom headers** may be provided in either case via the optional `headers` field. When attaching a new webhook, the headers are stored on the webhook and sent on every delivery. When attaching an existing `webhookId`, supplying `headers` **overwrites** the stored headers on that webhook — omit the field to leave them unchanged, or pass an empty object `{}` to clear them. The reserved `PINNACLE-SIGNING-SECRET` header is always set by Pinnacle and cannot be overridden.
207
209
  *
208
210
  * @param {Pinnacle.AttachWebhookParams} request
209
211
  * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
@@ -8,7 +8,11 @@ import type * as Pinnacle from "../../../../index.js";
8
8
  export interface AttachWebhookParams {
9
9
  /** Array of senders to attach the webhook to. Can be phone numbers in E.164 format or RCS agent IDs. */
10
10
  senders: string[];
11
- /** Existing webhook ID (starts with `wh_`). Provide this OR `name` + `url` to create a new webhook. The webhook must be in ENABLED status. Disabled webhooks can be re-enabled from the [dashboard](https://app.pinnacle.sh/dashboard/development/webhooks). */
11
+ /**
12
+ * Existing webhook ID (starts with `wh_`). Provide this OR `name` + `url` to create a new webhook. The webhook must be in ENABLED status. Disabled webhooks can be re-enabled from the [dashboard](https://app.pinnacle.sh/dashboard/development/webhooks).
13
+ *
14
+ * Supplying `headers` alongside `webhookId` **overwrites** the stored headers on the webhook. Omit `headers` to leave them unchanged.
15
+ */
12
16
  webhookId?: string;
13
17
  /** Name for a new webhook (required if no `webhookId`). */
14
18
  name?: string;
@@ -20,4 +24,14 @@ export interface AttachWebhookParams {
20
24
  * `USER.TYPING` is only supported for RCS agent senders, not phone numbers.
21
25
  */
22
26
  event?: Pinnacle.WebhookEventEnum | null;
27
+ /**
28
+ * Optional custom HTTP headers (key-value map) to include when dispatching webhook events to the endpoint.
29
+ *
30
+ * Header names must start with a letter or digit and contain only letters, digits, `-`, or `_` (matching the pattern `^[A-Za-z0-9][A-Za-z0-9_-]*$`). Names are case-insensitive per [RFC 9110](https://datatracker.ietf.org/doc/html/rfc9110#name-field-names) and are normalized to uppercase before storage and sending.
31
+ *
32
+ * When provided with an existing `webhookId`, these headers **overwrite** any headers currently stored on that webhook. Omit to leave existing headers unchanged.
33
+ *
34
+ * The reserved `PINNACLE-SIGNING-SECRET` header is silently ignored and cannot be overridden.
35
+ */
36
+ headers?: Record<string, string | null> | null;
23
37
  }
@@ -18,5 +18,7 @@ export declare namespace AttachWebhookResult {
18
18
  url: string;
19
19
  /** Signing secret sent in the `PINNACLE-SIGNING-SECRET` header for request verification. */
20
20
  secret: string;
21
+ /** Optional custom HTTP headers sent on every webhook delivery. Header names must match the regex `^[A-Za-z0-9][A-Za-z0-9_-]*$` — start with a letter or digit and contain only letters, digits, `-`, or `_`. Keys are case-insensitive and stored in uppercase. Values must be strings. The reserved `PINNACLE-SIGNING-SECRET` header is never returned here and cannot be overridden. */
22
+ headers?: Record<string, string | null> | null;
21
23
  }
22
24
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * User message payload. At least one of `text` or `mediaUrls` must be non-empty.
3
+ * Send only `text` to simulate an inbound SMS; include `mediaUrls` to simulate an inbound MMS.
4
+ */
5
+ export interface SimulateMessageInput {
6
+ /** Text message sent by the user. */
7
+ text?: string;
8
+ /** URLs of media files sent by the user. */
9
+ mediaUrls?: string[];
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import type * as Pinnacle from "../index.js";
2
+ /**
3
+ * Simulate a button press from a user.
4
+ */
5
+ export interface SimulateUserButton {
6
+ /** User phone number in E.164 format. */
7
+ from: string;
8
+ /** RCS agent ID (prefixed with `agent_`). */
9
+ to: string;
10
+ button: Pinnacle.UserButtonPress;
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import type * as Pinnacle from "../index.js";
2
+ /**
3
+ * Simulate an inbound message from a user.
4
+ */
5
+ export interface SimulateUserMessage {
6
+ /** User phone number in E.164 format. */
7
+ from: string;
8
+ /** Receiver phone number in E.164 format or RCS agent ID (prefixed with `agent_`). */
9
+ to: string;
10
+ message: Pinnacle.SimulateMessageInput;
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import type * as Pinnacle from "../index.js";
2
+ /**
3
+ * Request body for simulating an inbound event from a user.
4
+ */
5
+ export type SimulateUserParams =
6
+ /**
7
+ * Simulate an inbound message from a user. */
8
+ Pinnacle.SimulateUserMessage
9
+ /**
10
+ * Simulate a button press from a user. Only for RCS agents. */
11
+ | Pinnacle.SimulateUserButton;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Result of the simulation.
3
+ */
4
+ export interface SimulateUserResponse {
5
+ success: boolean;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,25 @@
1
+ import type * as Pinnacle from "../index.js";
2
+ /**
3
+ * Discriminated union of button presses that can be simulated for a user.
4
+ */
5
+ export type UserButtonPress = Pinnacle.UserButtonPress.Trigger | Pinnacle.UserButtonPress.OpenUrl | Pinnacle.UserButtonPress.Call | Pinnacle.UserButtonPress.ScheduleEvent | Pinnacle.UserButtonPress.SendLocation | Pinnacle.UserButtonPress.RequestUserLocation;
6
+ export declare namespace UserButtonPress {
7
+ interface Trigger extends Pinnacle.UserButtonPressTrigger {
8
+ type: "trigger";
9
+ }
10
+ interface OpenUrl extends Pinnacle.UserButtonPressOpenUrl {
11
+ type: "openUrl";
12
+ }
13
+ interface Call extends Pinnacle.UserButtonPressCall {
14
+ type: "call";
15
+ }
16
+ interface ScheduleEvent extends Pinnacle.UserButtonPressScheduleEvent {
17
+ type: "scheduleEvent";
18
+ }
19
+ interface SendLocation extends Pinnacle.UserButtonPressSendLocation {
20
+ type: "sendLocation";
21
+ }
22
+ interface RequestUserLocation extends Pinnacle.UserButtonPressRequestUserLocation {
23
+ type: "requestUserLocation";
24
+ }
25
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });