rcs-js 1.0.16 → 1.0.18

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.
package/Client.js CHANGED
@@ -76,7 +76,7 @@ class PinnacleClient {
76
76
  const _response = yield core.fetcher({
77
77
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "rcs_functionality"),
78
78
  method: "GET",
79
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
79
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
80
80
  contentType: "application/json",
81
81
  queryParameters: _queryParams,
82
82
  requestType: "json",
@@ -76,7 +76,7 @@ class Company {
76
76
  const _response = yield core.fetcher({
77
77
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "company"),
78
78
  method: "GET",
79
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
79
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
80
80
  contentType: "application/json",
81
81
  queryParameters: _queryParams,
82
82
  requestType: "json",
@@ -175,7 +175,7 @@ class Company {
175
175
  const _response = yield core.fetcher({
176
176
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "company/register"),
177
177
  method: "POST",
178
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
178
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
179
179
  contentType: "application/json",
180
180
  requestType: "json",
181
181
  body: serializers.CompanyRegisterRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -244,7 +244,7 @@ class Company {
244
244
  const _response = yield core.fetcher({
245
245
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "company/update"),
246
246
  method: "POST",
247
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
247
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
248
248
  contentType: "application/json",
249
249
  requestType: "json",
250
250
  body: serializers.CompanyUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -75,7 +75,7 @@ class Send {
75
75
  const _response = yield core.fetcher({
76
76
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "send/rcs"),
77
77
  method: "POST",
78
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
78
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
79
79
  contentType: "application/json",
80
80
  requestType: "json",
81
81
  body: serializers.Rcs.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -150,7 +150,7 @@ class Send {
150
150
  const _response = yield core.fetcher({
151
151
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "send/sms"),
152
152
  method: "POST",
153
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
153
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
154
154
  contentType: "application/json",
155
155
  requestType: "json",
156
156
  body: serializers.SendSmsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -225,7 +225,7 @@ class Send {
225
225
  const _response = yield core.fetcher({
226
226
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "send/mms"),
227
227
  method: "POST",
228
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
228
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
229
229
  contentType: "application/json",
230
230
  requestType: "json",
231
231
  body: serializers.SendMmsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -70,7 +70,7 @@ class Tools {
70
70
  const _response = yield core.fetcher({
71
71
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "tools/urls/shorten"),
72
72
  method: "POST",
73
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
73
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
74
74
  contentType: "application/json",
75
75
  requestType: "json",
76
76
  body: serializers.ToolsShortenUrlRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -139,7 +139,7 @@ class Tools {
139
139
  const _response = yield core.fetcher({
140
140
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "tools/uploadUrl"),
141
141
  method: "POST",
142
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
142
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
143
143
  contentType: "application/json",
144
144
  requestType: "json",
145
145
  body: serializers.ToolsUploadUrlRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
package/dist/Client.js CHANGED
@@ -76,7 +76,7 @@ class PinnacleClient {
76
76
  const _response = yield core.fetcher({
77
77
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "rcs_functionality"),
78
78
  method: "GET",
79
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
79
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
80
80
  contentType: "application/json",
81
81
  queryParameters: _queryParams,
82
82
  requestType: "json",
@@ -76,7 +76,7 @@ class Company {
76
76
  const _response = yield core.fetcher({
77
77
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "company"),
78
78
  method: "GET",
79
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
79
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
80
80
  contentType: "application/json",
81
81
  queryParameters: _queryParams,
82
82
  requestType: "json",
@@ -175,7 +175,7 @@ class Company {
175
175
  const _response = yield core.fetcher({
176
176
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "company/register"),
177
177
  method: "POST",
178
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
178
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
179
179
  contentType: "application/json",
180
180
  requestType: "json",
181
181
  body: serializers.CompanyRegisterRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -244,7 +244,7 @@ class Company {
244
244
  const _response = yield core.fetcher({
245
245
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "company/update"),
246
246
  method: "POST",
247
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
247
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
248
248
  contentType: "application/json",
249
249
  requestType: "json",
250
250
  body: serializers.CompanyUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -75,7 +75,7 @@ class Send {
75
75
  const _response = yield core.fetcher({
76
76
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "send/rcs"),
77
77
  method: "POST",
78
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
78
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
79
79
  contentType: "application/json",
80
80
  requestType: "json",
81
81
  body: serializers.Rcs.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -150,7 +150,7 @@ class Send {
150
150
  const _response = yield core.fetcher({
151
151
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "send/sms"),
152
152
  method: "POST",
153
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
153
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
154
154
  contentType: "application/json",
155
155
  requestType: "json",
156
156
  body: serializers.SendSmsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -225,7 +225,7 @@ class Send {
225
225
  const _response = yield core.fetcher({
226
226
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "send/mms"),
227
227
  method: "POST",
228
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
228
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
229
229
  contentType: "application/json",
230
230
  requestType: "json",
231
231
  body: serializers.SendMmsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -70,7 +70,7 @@ class Tools {
70
70
  const _response = yield core.fetcher({
71
71
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "tools/urls/shorten"),
72
72
  method: "POST",
73
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
73
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
74
74
  contentType: "application/json",
75
75
  requestType: "json",
76
76
  body: serializers.ToolsShortenUrlRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -139,7 +139,7 @@ class Tools {
139
139
  const _response = yield core.fetcher({
140
140
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PinnacleEnvironment.Default, "tools/uploadUrl"),
141
141
  method: "POST",
142
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.16", "User-Agent": "rcs-js/1.0.16", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
142
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "rcs-js", "X-Fern-SDK-Version": "1.0.18", "User-Agent": "rcs-js/1.0.18", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
143
143
  contentType: "application/json",
144
144
  requestType: "json",
145
145
  body: serializers.ToolsUploadUrlRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * as Pinnacle from "./api";
2
- export { PinnacleClient } from "./Client";
2
+ export { PinnacleClient } from "./wrapper/PinnacleClient";
3
3
  export { PinnacleEnvironment } from "./environments";
4
4
  export { PinnacleError, PinnacleTimeoutError } from "./errors";
package/dist/index.js CHANGED
@@ -25,8 +25,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.PinnacleTimeoutError = exports.PinnacleError = exports.PinnacleEnvironment = exports.PinnacleClient = exports.Pinnacle = void 0;
27
27
  exports.Pinnacle = __importStar(require("./api"));
28
- var Client_1 = require("./Client");
29
- Object.defineProperty(exports, "PinnacleClient", { enumerable: true, get: function () { return Client_1.PinnacleClient; } });
28
+ var PinnacleClient_1 = require("./wrapper/PinnacleClient");
29
+ Object.defineProperty(exports, "PinnacleClient", { enumerable: true, get: function () { return PinnacleClient_1.PinnacleClient; } });
30
30
  var environments_1 = require("./environments");
31
31
  Object.defineProperty(exports, "PinnacleEnvironment", { enumerable: true, get: function () { return environments_1.PinnacleEnvironment; } });
32
32
  var errors_1 = require("./errors");
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.16";
1
+ export declare const SDK_VERSION = "1.0.18";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.0.16";
4
+ exports.SDK_VERSION = "1.0.18";
@@ -0,0 +1,17 @@
1
+ import { PinnacleClient as FernClient } from "../Client";
2
+ export declare class PinnacleClient extends FernClient {
3
+ /**
4
+ * Upload a file to the server and return the download URL.
5
+ *
6
+ * @param {File} file - The file to be uploaded.
7
+ * @returns {Promise<string>} - The URL to download the uploaded file.
8
+ *
9
+ * @throws {Error} - If the file type cannot be determined or if the upload fails.
10
+ *
11
+ * @example
12
+ * const file = new File(["content"], "example.txt", { type: "text/plain" });
13
+ * const downloadUrl = await client.upload(file);
14
+ * console.log("File available at:", downloadUrl);
15
+ */
16
+ upload(file: File): Promise<string>;
17
+ }
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.PinnacleClient = void 0;
16
+ const Client_1 = require("../Client");
17
+ const node_fetch_1 = __importDefault(require("node-fetch"));
18
+ class PinnacleClient extends Client_1.PinnacleClient {
19
+ /**
20
+ * Upload a file to the server and return the download URL.
21
+ *
22
+ * @param {File} file - The file to be uploaded.
23
+ * @returns {Promise<string>} - The URL to download the uploaded file.
24
+ *
25
+ * @throws {Error} - If the file type cannot be determined or if the upload fails.
26
+ *
27
+ * @example
28
+ * const file = new File(["content"], "example.txt", { type: "text/plain" });
29
+ * const downloadUrl = await client.upload(file);
30
+ * console.log("File available at:", downloadUrl);
31
+ */
32
+ upload(file) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ const fileType = file.type;
35
+ if (!fileType) {
36
+ throw new Error("Could not determine the file type");
37
+ }
38
+ const { upload: uploadUrl, download: downloadUrl } = yield this.tools.uploadUrl({
39
+ name: file.name,
40
+ contentType: fileType,
41
+ size: file.size,
42
+ });
43
+ if (!uploadUrl) {
44
+ throw new Error("Failed to get upload url");
45
+ }
46
+ if (!downloadUrl) {
47
+ throw new Error("Failed to get download url");
48
+ }
49
+ const uploadFile = (file, uploadUrl) => __awaiter(this, void 0, void 0, function* () {
50
+ const fileBuffer = yield file.arrayBuffer();
51
+ const uploadResult = yield (0, node_fetch_1.default)(uploadUrl, {
52
+ method: "PUT",
53
+ headers: {
54
+ "Content-Type": file.type,
55
+ "Content-Length": file.size.toString(),
56
+ },
57
+ body: Buffer.from(fileBuffer),
58
+ });
59
+ if (!uploadResult.ok) {
60
+ throw new Error(`Failed to upload file: ${uploadResult.statusText}`);
61
+ }
62
+ });
63
+ yield uploadFile(file, uploadUrl);
64
+ return downloadUrl;
65
+ });
66
+ }
67
+ }
68
+ exports.PinnacleClient = PinnacleClient;
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * as Pinnacle from "./api";
2
- export { PinnacleClient } from "./Client";
2
+ export { PinnacleClient } from "./wrapper/PinnacleClient";
3
3
  export { PinnacleEnvironment } from "./environments";
4
4
  export { PinnacleError, PinnacleTimeoutError } from "./errors";
package/index.js CHANGED
@@ -25,8 +25,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.PinnacleTimeoutError = exports.PinnacleError = exports.PinnacleEnvironment = exports.PinnacleClient = exports.Pinnacle = void 0;
27
27
  exports.Pinnacle = __importStar(require("./api"));
28
- var Client_1 = require("./Client");
29
- Object.defineProperty(exports, "PinnacleClient", { enumerable: true, get: function () { return Client_1.PinnacleClient; } });
28
+ var PinnacleClient_1 = require("./wrapper/PinnacleClient");
29
+ Object.defineProperty(exports, "PinnacleClient", { enumerable: true, get: function () { return PinnacleClient_1.PinnacleClient; } });
30
30
  var environments_1 = require("./environments");
31
31
  Object.defineProperty(exports, "PinnacleEnvironment", { enumerable: true, get: function () { return environments_1.PinnacleEnvironment; } });
32
32
  var errors_1 = require("./errors");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rcs-js",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "private": false,
5
5
  "repository": "https://github.com/pinnacle-dev/rcs-js",
6
6
  "main": "./index.js",
@@ -17,8 +17,7 @@
17
17
  "formdata-node": "^6.0.3",
18
18
  "node-fetch": "2.7.0",
19
19
  "qs": "6.11.2",
20
- "readable-stream": "^4.5.2",
21
- "mime-types": "2.1.35"
20
+ "readable-stream": "^4.5.2"
22
21
  },
23
22
  "devDependencies": {
24
23
  "@types/url-join": "4.0.1",
@@ -34,8 +33,7 @@
34
33
  "jest-environment-jsdom": "29.7.0",
35
34
  "@types/node": "17.0.33",
36
35
  "prettier": "2.7.1",
37
- "typescript": "4.6.4",
38
- "@types/mime-types": "2.1.4"
36
+ "typescript": "4.6.4"
39
37
  },
40
38
  "browser": {
41
39
  "fs": false,
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.16";
1
+ export declare const SDK_VERSION = "1.0.18";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.0.16";
4
+ exports.SDK_VERSION = "1.0.18";
@@ -0,0 +1,17 @@
1
+ import { PinnacleClient as FernClient } from "../Client";
2
+ export declare class PinnacleClient extends FernClient {
3
+ /**
4
+ * Upload a file to the server and return the download URL.
5
+ *
6
+ * @param {File} file - The file to be uploaded.
7
+ * @returns {Promise<string>} - The URL to download the uploaded file.
8
+ *
9
+ * @throws {Error} - If the file type cannot be determined or if the upload fails.
10
+ *
11
+ * @example
12
+ * const file = new File(["content"], "example.txt", { type: "text/plain" });
13
+ * const downloadUrl = await client.upload(file);
14
+ * console.log("File available at:", downloadUrl);
15
+ */
16
+ upload(file: File): Promise<string>;
17
+ }
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.PinnacleClient = void 0;
16
+ const Client_1 = require("../Client");
17
+ const node_fetch_1 = __importDefault(require("node-fetch"));
18
+ class PinnacleClient extends Client_1.PinnacleClient {
19
+ /**
20
+ * Upload a file to the server and return the download URL.
21
+ *
22
+ * @param {File} file - The file to be uploaded.
23
+ * @returns {Promise<string>} - The URL to download the uploaded file.
24
+ *
25
+ * @throws {Error} - If the file type cannot be determined or if the upload fails.
26
+ *
27
+ * @example
28
+ * const file = new File(["content"], "example.txt", { type: "text/plain" });
29
+ * const downloadUrl = await client.upload(file);
30
+ * console.log("File available at:", downloadUrl);
31
+ */
32
+ upload(file) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ const fileType = file.type;
35
+ if (!fileType) {
36
+ throw new Error("Could not determine the file type");
37
+ }
38
+ const { upload: uploadUrl, download: downloadUrl } = yield this.tools.uploadUrl({
39
+ name: file.name,
40
+ contentType: fileType,
41
+ size: file.size,
42
+ });
43
+ if (!uploadUrl) {
44
+ throw new Error("Failed to get upload url");
45
+ }
46
+ if (!downloadUrl) {
47
+ throw new Error("Failed to get download url");
48
+ }
49
+ const uploadFile = (file, uploadUrl) => __awaiter(this, void 0, void 0, function* () {
50
+ const fileBuffer = yield file.arrayBuffer();
51
+ const uploadResult = yield (0, node_fetch_1.default)(uploadUrl, {
52
+ method: "PUT",
53
+ headers: {
54
+ "Content-Type": file.type,
55
+ "Content-Length": file.size.toString(),
56
+ },
57
+ body: Buffer.from(fileBuffer),
58
+ });
59
+ if (!uploadResult.ok) {
60
+ throw new Error(`Failed to upload file: ${uploadResult.statusText}`);
61
+ }
62
+ });
63
+ yield uploadFile(file, uploadUrl);
64
+ return downloadUrl;
65
+ });
66
+ }
67
+ }
68
+ exports.PinnacleClient = PinnacleClient;