rcs-js 1.0.15 → 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.d.ts +3 -0
- package/Client.js +6 -1
- package/api/resources/company/client/Client.js +3 -3
- package/api/resources/index.d.ts +3 -0
- package/api/resources/index.js +4 -1
- package/api/resources/send/client/Client.js +3 -3
- package/api/resources/tools/client/Client.d.ts +61 -0
- package/api/resources/tools/client/Client.js +195 -0
- package/api/resources/tools/client/index.d.ts +1 -0
- package/api/resources/tools/client/index.js +17 -0
- package/api/resources/tools/client/requests/ToolsShortenUrlRequest.d.ts +15 -0
- package/api/resources/tools/client/requests/ToolsShortenUrlRequest.js +5 -0
- package/api/resources/tools/client/requests/ToolsUploadUrlRequest.d.ts +24 -0
- package/api/resources/tools/client/requests/ToolsUploadUrlRequest.js +5 -0
- package/api/resources/tools/client/requests/index.d.ts +2 -0
- package/api/resources/tools/client/requests/index.js +2 -0
- package/api/resources/tools/index.d.ts +2 -0
- package/api/resources/tools/index.js +18 -0
- package/api/resources/tools/types/ToolsShortenUrlResponse.d.ts +9 -0
- package/api/resources/tools/types/ToolsShortenUrlResponse.js +5 -0
- package/api/resources/tools/types/ToolsUploadUrlResponse.d.ts +9 -0
- package/api/resources/tools/types/ToolsUploadUrlResponse.js +5 -0
- package/api/resources/tools/types/index.d.ts +2 -0
- package/api/resources/tools/types/index.js +18 -0
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +6 -1
- package/dist/api/resources/company/client/Client.js +3 -3
- package/dist/api/resources/index.d.ts +3 -0
- package/dist/api/resources/index.js +4 -1
- package/dist/api/resources/send/client/Client.js +3 -3
- package/dist/api/resources/tools/client/Client.d.ts +61 -0
- package/dist/api/resources/tools/client/Client.js +195 -0
- package/dist/api/resources/tools/client/index.d.ts +1 -0
- package/dist/api/resources/tools/client/index.js +17 -0
- package/dist/api/resources/tools/client/requests/ToolsShortenUrlRequest.d.ts +15 -0
- package/dist/api/resources/tools/client/requests/ToolsShortenUrlRequest.js +5 -0
- package/dist/api/resources/tools/client/requests/ToolsUploadUrlRequest.d.ts +24 -0
- package/dist/api/resources/tools/client/requests/ToolsUploadUrlRequest.js +5 -0
- package/dist/api/resources/tools/client/requests/index.d.ts +2 -0
- package/dist/api/resources/tools/client/requests/index.js +2 -0
- package/dist/api/resources/tools/index.d.ts +2 -0
- package/dist/api/resources/tools/index.js +18 -0
- package/dist/api/resources/tools/types/ToolsShortenUrlResponse.d.ts +9 -0
- package/dist/api/resources/tools/types/ToolsShortenUrlResponse.js +5 -0
- package/dist/api/resources/tools/types/ToolsUploadUrlResponse.d.ts +9 -0
- package/dist/api/resources/tools/types/ToolsUploadUrlResponse.js +5 -0
- package/dist/api/resources/tools/types/index.d.ts +2 -0
- package/dist/api/resources/tools/types/index.js +18 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/serialization/resources/index.d.ts +3 -0
- package/dist/serialization/resources/index.js +4 -1
- package/dist/serialization/resources/tools/client/index.d.ts +1 -0
- package/dist/serialization/resources/tools/client/index.js +17 -0
- package/dist/serialization/resources/tools/client/requests/ToolsShortenUrlRequest.d.ts +13 -0
- package/dist/serialization/resources/tools/client/requests/ToolsShortenUrlRequest.js +34 -0
- package/dist/serialization/resources/tools/client/requests/ToolsUploadUrlRequest.d.ts +14 -0
- package/dist/serialization/resources/tools/client/requests/ToolsUploadUrlRequest.js +35 -0
- package/dist/serialization/resources/tools/client/requests/index.d.ts +2 -0
- package/dist/serialization/resources/tools/client/requests/index.js +7 -0
- package/dist/serialization/resources/tools/index.d.ts +2 -0
- package/dist/serialization/resources/tools/index.js +18 -0
- package/dist/serialization/resources/tools/types/ToolsShortenUrlResponse.d.ts +13 -0
- package/dist/serialization/resources/tools/types/ToolsShortenUrlResponse.js +34 -0
- package/dist/serialization/resources/tools/types/ToolsUploadUrlResponse.d.ts +13 -0
- package/dist/serialization/resources/tools/types/ToolsUploadUrlResponse.js +34 -0
- package/dist/serialization/resources/tools/types/index.d.ts +2 -0
- package/dist/serialization/resources/tools/types/index.js +18 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrapper/PinnacleClient.d.ts +17 -0
- package/dist/wrapper/PinnacleClient.js +68 -0
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
- package/reference.md +134 -0
- package/serialization/resources/index.d.ts +3 -0
- package/serialization/resources/index.js +4 -1
- package/serialization/resources/tools/client/index.d.ts +1 -0
- package/serialization/resources/tools/client/index.js +17 -0
- package/serialization/resources/tools/client/requests/ToolsShortenUrlRequest.d.ts +13 -0
- package/serialization/resources/tools/client/requests/ToolsShortenUrlRequest.js +34 -0
- package/serialization/resources/tools/client/requests/ToolsUploadUrlRequest.d.ts +14 -0
- package/serialization/resources/tools/client/requests/ToolsUploadUrlRequest.js +35 -0
- package/serialization/resources/tools/client/requests/index.d.ts +2 -0
- package/serialization/resources/tools/client/requests/index.js +7 -0
- package/serialization/resources/tools/index.d.ts +2 -0
- package/serialization/resources/tools/index.js +18 -0
- package/serialization/resources/tools/types/ToolsShortenUrlResponse.d.ts +13 -0
- package/serialization/resources/tools/types/ToolsShortenUrlResponse.js +34 -0
- package/serialization/resources/tools/types/ToolsUploadUrlResponse.d.ts +13 -0
- package/serialization/resources/tools/types/ToolsUploadUrlResponse.js +34 -0
- package/serialization/resources/tools/types/index.d.ts +2 -0
- package/serialization/resources/tools/types/index.js +18 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/wrapper/PinnacleClient.d.ts +17 -0
- package/wrapper/PinnacleClient.js +68 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ToolsUploadUrlRequest = void 0;
|
|
30
|
+
const core = __importStar(require("../../../../../core"));
|
|
31
|
+
exports.ToolsUploadUrlRequest = core.serialization.object({
|
|
32
|
+
contentType: core.serialization.string(),
|
|
33
|
+
size: core.serialization.number(),
|
|
34
|
+
name: core.serialization.string(),
|
|
35
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToolsUploadUrlRequest = exports.ToolsShortenUrlRequest = void 0;
|
|
4
|
+
var ToolsShortenUrlRequest_1 = require("./ToolsShortenUrlRequest");
|
|
5
|
+
Object.defineProperty(exports, "ToolsShortenUrlRequest", { enumerable: true, get: function () { return ToolsShortenUrlRequest_1.ToolsShortenUrlRequest; } });
|
|
6
|
+
var ToolsUploadUrlRequest_1 = require("./ToolsUploadUrlRequest");
|
|
7
|
+
Object.defineProperty(exports, "ToolsUploadUrlRequest", { enumerable: true, get: function () { return ToolsUploadUrlRequest_1.ToolsUploadUrlRequest; } });
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./types"), exports);
|
|
18
|
+
__exportStar(require("./client"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../../../index";
|
|
5
|
+
import * as Pinnacle from "../../../../api/index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
export declare const ToolsShortenUrlResponse: core.serialization.ObjectSchema<serializers.ToolsShortenUrlResponse.Raw, Pinnacle.ToolsShortenUrlResponse>;
|
|
8
|
+
export declare namespace ToolsShortenUrlResponse {
|
|
9
|
+
interface Raw {
|
|
10
|
+
shortenedUrl?: string | null;
|
|
11
|
+
expiresAt?: string | null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ToolsShortenUrlResponse = void 0;
|
|
30
|
+
const core = __importStar(require("../../../../core"));
|
|
31
|
+
exports.ToolsShortenUrlResponse = core.serialization.object({
|
|
32
|
+
shortenedUrl: core.serialization.string().optional(),
|
|
33
|
+
expiresAt: core.serialization.date().optional(),
|
|
34
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../../../index";
|
|
5
|
+
import * as Pinnacle from "../../../../api/index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
export declare const ToolsUploadUrlResponse: core.serialization.ObjectSchema<serializers.ToolsUploadUrlResponse.Raw, Pinnacle.ToolsUploadUrlResponse>;
|
|
8
|
+
export declare namespace ToolsUploadUrlResponse {
|
|
9
|
+
interface Raw {
|
|
10
|
+
upload?: string | null;
|
|
11
|
+
download?: string | null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ToolsUploadUrlResponse = void 0;
|
|
30
|
+
const core = __importStar(require("../../../../core"));
|
|
31
|
+
exports.ToolsUploadUrlResponse = core.serialization.object({
|
|
32
|
+
upload: core.serialization.string().optional(),
|
|
33
|
+
download: core.serialization.string().optional(),
|
|
34
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./ToolsShortenUrlResponse"), exports);
|
|
18
|
+
__exportStar(require("./ToolsUploadUrlResponse"), exports);
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.18";
|
package/dist/version.js
CHANGED
|
@@ -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
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
|
|
29
|
-
Object.defineProperty(exports, "PinnacleClient", { enumerable: true, get: function () { return
|
|
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
package/reference.md
CHANGED
|
@@ -496,3 +496,137 @@ await client.send.mms({
|
|
|
496
496
|
</dd>
|
|
497
497
|
</dl>
|
|
498
498
|
</details>
|
|
499
|
+
|
|
500
|
+
## Tools
|
|
501
|
+
|
|
502
|
+
<details><summary><code>client.tools.<a href="/src/api/resources/tools/client/Client.ts">shortenUrl</a>({ ...params }) -> Pinnacle.ToolsShortenUrlResponse</code></summary>
|
|
503
|
+
<dl>
|
|
504
|
+
<dd>
|
|
505
|
+
|
|
506
|
+
#### 📝 Description
|
|
507
|
+
|
|
508
|
+
<dl>
|
|
509
|
+
<dd>
|
|
510
|
+
|
|
511
|
+
<dl>
|
|
512
|
+
<dd>
|
|
513
|
+
|
|
514
|
+
Create a shortened URL with an optional expiration date (default and max expiration is 90 days). The shortened URL will redirect to the original URL and will have the following format https://urls.p1n.io/ABCD5678.
|
|
515
|
+
|
|
516
|
+
</dd>
|
|
517
|
+
</dl>
|
|
518
|
+
</dd>
|
|
519
|
+
</dl>
|
|
520
|
+
|
|
521
|
+
#### 🔌 Usage
|
|
522
|
+
|
|
523
|
+
<dl>
|
|
524
|
+
<dd>
|
|
525
|
+
|
|
526
|
+
<dl>
|
|
527
|
+
<dd>
|
|
528
|
+
|
|
529
|
+
```typescript
|
|
530
|
+
await client.tools.shortenUrl({
|
|
531
|
+
url: "https://example.com",
|
|
532
|
+
});
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
</dd>
|
|
536
|
+
</dl>
|
|
537
|
+
</dd>
|
|
538
|
+
</dl>
|
|
539
|
+
|
|
540
|
+
#### ⚙️ Parameters
|
|
541
|
+
|
|
542
|
+
<dl>
|
|
543
|
+
<dd>
|
|
544
|
+
|
|
545
|
+
<dl>
|
|
546
|
+
<dd>
|
|
547
|
+
|
|
548
|
+
**request:** `Pinnacle.ToolsShortenUrlRequest`
|
|
549
|
+
|
|
550
|
+
</dd>
|
|
551
|
+
</dl>
|
|
552
|
+
|
|
553
|
+
<dl>
|
|
554
|
+
<dd>
|
|
555
|
+
|
|
556
|
+
**requestOptions:** `Tools.RequestOptions`
|
|
557
|
+
|
|
558
|
+
</dd>
|
|
559
|
+
</dl>
|
|
560
|
+
</dd>
|
|
561
|
+
</dl>
|
|
562
|
+
|
|
563
|
+
</dd>
|
|
564
|
+
</dl>
|
|
565
|
+
</details>
|
|
566
|
+
|
|
567
|
+
<details><summary><code>client.tools.<a href="/src/api/resources/tools/client/Client.ts">uploadUrl</a>({ ...params }) -> Pinnacle.ToolsUploadUrlResponse</code></summary>
|
|
568
|
+
<dl>
|
|
569
|
+
<dd>
|
|
570
|
+
|
|
571
|
+
#### 📝 Description
|
|
572
|
+
|
|
573
|
+
<dl>
|
|
574
|
+
<dd>
|
|
575
|
+
|
|
576
|
+
<dl>
|
|
577
|
+
<dd>
|
|
578
|
+
|
|
579
|
+
Generate signed upload (expires in 2 hours) and download URLs for a file (expires in 1 hour).
|
|
580
|
+
|
|
581
|
+
</dd>
|
|
582
|
+
</dl>
|
|
583
|
+
</dd>
|
|
584
|
+
</dl>
|
|
585
|
+
|
|
586
|
+
#### 🔌 Usage
|
|
587
|
+
|
|
588
|
+
<dl>
|
|
589
|
+
<dd>
|
|
590
|
+
|
|
591
|
+
<dl>
|
|
592
|
+
<dd>
|
|
593
|
+
|
|
594
|
+
```typescript
|
|
595
|
+
await client.tools.uploadUrl({
|
|
596
|
+
contentType: "image/png",
|
|
597
|
+
size: 1024,
|
|
598
|
+
name: "example.png",
|
|
599
|
+
});
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
</dd>
|
|
603
|
+
</dl>
|
|
604
|
+
</dd>
|
|
605
|
+
</dl>
|
|
606
|
+
|
|
607
|
+
#### ⚙️ Parameters
|
|
608
|
+
|
|
609
|
+
<dl>
|
|
610
|
+
<dd>
|
|
611
|
+
|
|
612
|
+
<dl>
|
|
613
|
+
<dd>
|
|
614
|
+
|
|
615
|
+
**request:** `Pinnacle.ToolsUploadUrlRequest`
|
|
616
|
+
|
|
617
|
+
</dd>
|
|
618
|
+
</dl>
|
|
619
|
+
|
|
620
|
+
<dl>
|
|
621
|
+
<dd>
|
|
622
|
+
|
|
623
|
+
**requestOptions:** `Tools.RequestOptions`
|
|
624
|
+
|
|
625
|
+
</dd>
|
|
626
|
+
</dl>
|
|
627
|
+
</dd>
|
|
628
|
+
</dl>
|
|
629
|
+
|
|
630
|
+
</dd>
|
|
631
|
+
</dl>
|
|
632
|
+
</details>
|
|
@@ -2,5 +2,8 @@ export * as company from "./company";
|
|
|
2
2
|
export * from "./company/types";
|
|
3
3
|
export * as send from "./send";
|
|
4
4
|
export * from "./send/types";
|
|
5
|
+
export * as tools from "./tools";
|
|
6
|
+
export * from "./tools/types";
|
|
5
7
|
export * from "./company/client/requests";
|
|
6
8
|
export * from "./send/client/requests";
|
|
9
|
+
export * from "./tools/client/requests";
|
|
@@ -26,10 +26,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.send = exports.company = void 0;
|
|
29
|
+
exports.tools = exports.send = exports.company = void 0;
|
|
30
30
|
exports.company = __importStar(require("./company"));
|
|
31
31
|
__exportStar(require("./company/types"), exports);
|
|
32
32
|
exports.send = __importStar(require("./send"));
|
|
33
33
|
__exportStar(require("./send/types"), exports);
|
|
34
|
+
exports.tools = __importStar(require("./tools"));
|
|
35
|
+
__exportStar(require("./tools/types"), exports);
|
|
34
36
|
__exportStar(require("./company/client/requests"), exports);
|
|
35
37
|
__exportStar(require("./send/client/requests"), exports);
|
|
38
|
+
__exportStar(require("./tools/client/requests"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests";
|
|
@@ -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("./requests"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../../../../index";
|
|
5
|
+
import * as Pinnacle from "../../../../../api/index";
|
|
6
|
+
import * as core from "../../../../../core";
|
|
7
|
+
export declare const ToolsShortenUrlRequest: core.serialization.Schema<serializers.ToolsShortenUrlRequest.Raw, Pinnacle.ToolsShortenUrlRequest>;
|
|
8
|
+
export declare namespace ToolsShortenUrlRequest {
|
|
9
|
+
interface Raw {
|
|
10
|
+
url: string;
|
|
11
|
+
expiresAt?: string | null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ToolsShortenUrlRequest = void 0;
|
|
30
|
+
const core = __importStar(require("../../../../../core"));
|
|
31
|
+
exports.ToolsShortenUrlRequest = core.serialization.object({
|
|
32
|
+
url: core.serialization.string(),
|
|
33
|
+
expiresAt: core.serialization.date().optional(),
|
|
34
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../../../../index";
|
|
5
|
+
import * as Pinnacle from "../../../../../api/index";
|
|
6
|
+
import * as core from "../../../../../core";
|
|
7
|
+
export declare const ToolsUploadUrlRequest: core.serialization.Schema<serializers.ToolsUploadUrlRequest.Raw, Pinnacle.ToolsUploadUrlRequest>;
|
|
8
|
+
export declare namespace ToolsUploadUrlRequest {
|
|
9
|
+
interface Raw {
|
|
10
|
+
contentType: string;
|
|
11
|
+
size: number;
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ToolsUploadUrlRequest = void 0;
|
|
30
|
+
const core = __importStar(require("../../../../../core"));
|
|
31
|
+
exports.ToolsUploadUrlRequest = core.serialization.object({
|
|
32
|
+
contentType: core.serialization.string(),
|
|
33
|
+
size: core.serialization.number(),
|
|
34
|
+
name: core.serialization.string(),
|
|
35
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToolsUploadUrlRequest = exports.ToolsShortenUrlRequest = void 0;
|
|
4
|
+
var ToolsShortenUrlRequest_1 = require("./ToolsShortenUrlRequest");
|
|
5
|
+
Object.defineProperty(exports, "ToolsShortenUrlRequest", { enumerable: true, get: function () { return ToolsShortenUrlRequest_1.ToolsShortenUrlRequest; } });
|
|
6
|
+
var ToolsUploadUrlRequest_1 = require("./ToolsUploadUrlRequest");
|
|
7
|
+
Object.defineProperty(exports, "ToolsUploadUrlRequest", { enumerable: true, get: function () { return ToolsUploadUrlRequest_1.ToolsUploadUrlRequest; } });
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./types"), exports);
|
|
18
|
+
__exportStar(require("./client"), exports);
|