rcs-js 2.0.0-rc.11 → 2.0.0-rc.13
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/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/campaigns/resources/rcs/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/campaigns/resources/rcs/client/Client.js +3 -0
- package/dist/cjs/api/resources/messages/resources/rcs/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/messages/resources/rcs/client/Client.js +1 -1
- package/dist/cjs/api/resources/tools/resources/file/client/Client.d.ts +21 -0
- package/dist/cjs/api/resources/tools/resources/file/client/Client.js +74 -0
- package/dist/cjs/api/resources/tools/resources/file/client/requests/RefreshFileParams.d.ts +21 -0
- package/dist/cjs/api/resources/tools/resources/file/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/tools/resources/url/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/tools/resources/url/client/Client.js +1 -1
- package/dist/cjs/api/types/AutofillDlcCampaignResponse.d.ts +11 -11
- package/dist/cjs/api/types/ButtonClicked.d.ts +11 -0
- package/dist/cjs/api/types/ButtonClickedData.d.ts +56 -0
- package/dist/cjs/api/types/ButtonClickedData.js +16 -0
- package/dist/cjs/api/types/CreateUrlOptions.d.ts +1 -1
- package/dist/cjs/api/types/DlcCampaignWithExtendedBrandAndStatus.d.ts +13 -10
- package/dist/cjs/api/types/ExtendedBrand.d.ts +7 -4
- package/dist/cjs/api/types/ExtendedRcsCampaign.d.ts +9 -8
- package/dist/cjs/api/types/MessageContent.d.ts +2 -2
- package/dist/cjs/api/types/MessageEvent.d.ts +56 -0
- package/dist/cjs/api/types/MessageEvent.js +13 -0
- package/dist/cjs/api/types/ProfileStatusEnum.d.ts +7 -4
- package/dist/cjs/api/types/RcsBase.d.ts +2 -0
- package/dist/cjs/api/types/RcsButtonCall.d.ts +2 -0
- package/dist/cjs/api/types/RcsButtonOpenUrl.d.ts +2 -0
- package/dist/cjs/api/types/RcsButtonRequestUserLocation.d.ts +2 -0
- package/dist/cjs/api/types/RcsButtonScheduleEvent.d.ts +2 -0
- package/dist/cjs/api/types/RcsButtonSendLocation.d.ts +2 -0
- package/dist/cjs/api/types/RcsButtonTrigger.d.ts +2 -2
- package/dist/cjs/api/types/RefreshedFile.d.ts +9 -0
- package/dist/cjs/api/types/{Rcs.d.ts → RichMessage.d.ts} +1 -1
- package/dist/cjs/api/types/RichMessage.js +5 -0
- package/dist/cjs/api/types/index.d.ts +5 -3
- package/dist/cjs/api/types/index.js +5 -3
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wrapper/PinnacleClient.d.ts +9 -0
- package/dist/cjs/wrapper/PinnacleClient.js +17 -0
- package/dist/cjs/wrapper/messages/Client.d.ts +13 -0
- package/dist/cjs/wrapper/messages/Client.js +49 -0
- package/dist/cjs/wrapper/tools/Client.d.ts +6 -0
- package/dist/cjs/wrapper/tools/Client.js +12 -0
- package/dist/cjs/wrapper/tools/FileUploader.d.ts +15 -0
- package/dist/cjs/wrapper/tools/FileUploader.js +162 -0
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/campaigns/resources/rcs/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/campaigns/resources/rcs/client/Client.mjs +3 -0
- package/dist/esm/api/resources/messages/resources/rcs/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/messages/resources/rcs/client/Client.mjs +1 -1
- package/dist/esm/api/resources/tools/resources/file/client/Client.d.mts +21 -0
- package/dist/esm/api/resources/tools/resources/file/client/Client.mjs +74 -0
- package/dist/esm/api/resources/tools/resources/file/client/requests/RefreshFileParams.d.mts +21 -0
- package/dist/esm/api/resources/tools/resources/file/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/tools/resources/url/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/tools/resources/url/client/Client.mjs +1 -1
- package/dist/esm/api/types/AutofillDlcCampaignResponse.d.mts +11 -11
- package/dist/esm/api/types/ButtonClicked.d.mts +11 -0
- package/dist/esm/api/types/ButtonClickedData.d.mts +56 -0
- package/dist/esm/api/types/ButtonClickedData.mjs +13 -0
- package/dist/esm/api/types/CreateUrlOptions.d.mts +1 -1
- package/dist/esm/api/types/DlcCampaignWithExtendedBrandAndStatus.d.mts +13 -10
- package/dist/esm/api/types/ExtendedBrand.d.mts +7 -4
- package/dist/esm/api/types/ExtendedRcsCampaign.d.mts +9 -8
- package/dist/esm/api/types/MessageContent.d.mts +2 -2
- package/dist/esm/api/types/MessageEvent.d.mts +56 -0
- package/dist/esm/api/types/MessageEvent.mjs +10 -0
- package/dist/esm/api/types/ProfileStatusEnum.d.mts +7 -4
- package/dist/esm/api/types/RcsBase.d.mts +2 -0
- package/dist/esm/api/types/RcsButtonCall.d.mts +2 -0
- package/dist/esm/api/types/RcsButtonOpenUrl.d.mts +2 -0
- package/dist/esm/api/types/RcsButtonRequestUserLocation.d.mts +2 -0
- package/dist/esm/api/types/RcsButtonScheduleEvent.d.mts +2 -0
- package/dist/esm/api/types/RcsButtonSendLocation.d.mts +2 -0
- package/dist/esm/api/types/RcsButtonTrigger.d.mts +2 -2
- package/dist/esm/api/types/RefreshedFile.d.mts +9 -0
- package/dist/esm/api/types/{Rcs.d.mts → RichMessage.d.mts} +1 -1
- package/dist/esm/api/types/RichMessage.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +5 -3
- package/dist/esm/api/types/index.mjs +5 -3
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/esm/wrapper/PinnacleClient.d.mts +9 -0
- package/dist/esm/wrapper/PinnacleClient.mjs +13 -0
- package/dist/esm/wrapper/messages/Client.d.mts +13 -0
- package/dist/esm/wrapper/messages/Client.mjs +45 -0
- package/dist/esm/wrapper/tools/Client.d.mts +6 -0
- package/dist/esm/wrapper/tools/Client.mjs +8 -0
- package/dist/esm/wrapper/tools/FileUploader.d.mts +15 -0
- package/dist/esm/wrapper/tools/FileUploader.mjs +125 -0
- package/package.json +7 -3
- package/reference.md +76 -2
- package/dist/cjs/api/types/ClickAction.d.ts +0 -28
- package/dist/cjs/api/types/InboundButton.d.ts +0 -11
- package/dist/esm/api/types/ClickAction.d.mts +0 -28
- package/dist/esm/api/types/InboundButton.d.mts +0 -11
- /package/dist/cjs/api/{types/ClickAction.js → resources/tools/resources/file/client/requests/RefreshFileParams.js} +0 -0
- /package/dist/cjs/api/types/{InboundButton.js → ButtonClicked.js} +0 -0
- /package/dist/cjs/api/types/{Rcs.js → RefreshedFile.js} +0 -0
- /package/dist/esm/api/{types/ClickAction.mjs → resources/tools/resources/file/client/requests/RefreshFileParams.mjs} +0 -0
- /package/dist/esm/api/types/{InboundButton.mjs → ButtonClicked.mjs} +0 -0
- /package/dist/esm/api/types/{Rcs.mjs → RefreshedFile.mjs} +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Messages } from "../../api/resources/messages/client/Client.mjs";
|
|
2
|
+
import * as Pinnacle from "../../api/index.mjs";
|
|
3
|
+
interface ExpressLikeRequest {
|
|
4
|
+
headers: Record<string, string | string[] | undefined>;
|
|
5
|
+
body?: any;
|
|
6
|
+
get?: (name: string) => string | undefined;
|
|
7
|
+
protocol?: string;
|
|
8
|
+
originalUrl?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class EnhancedMessages extends Messages {
|
|
11
|
+
process(req: Request | ExpressLikeRequest, secret?: string): Promise<Pinnacle.MessageEvent>;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Messages } from "../../api/resources/messages/client/Client.mjs";
|
|
11
|
+
import { UnauthorizedError } from "../../api/errors/index.mjs";
|
|
12
|
+
export class EnhancedMessages extends Messages {
|
|
13
|
+
process(req, secret) {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const signingSecret = secret || process.env.PINNACLE_SIGNING_SECRET;
|
|
17
|
+
let headerSecret;
|
|
18
|
+
let body;
|
|
19
|
+
if (req instanceof Request) {
|
|
20
|
+
headerSecret =
|
|
21
|
+
((_a = req.headers) === null || _a === void 0 ? void 0 : _a.get("PINNACLE-SIGNING-SECRET")) || ((_b = req.headers) === null || _b === void 0 ? void 0 : _b.get("pinnacle-signing-secret")) || undefined;
|
|
22
|
+
body = yield req.json();
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
const headers = req.headers;
|
|
26
|
+
headerSecret = headers["pinnacle-signing-secret"];
|
|
27
|
+
body = req.body;
|
|
28
|
+
}
|
|
29
|
+
if (!signingSecret) {
|
|
30
|
+
throw new UnauthorizedError({
|
|
31
|
+
error: "Make sure to set the PINNACLE-SIGNING-SECRET environment variable or pass the secret as an argument to the process method",
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (!headerSecret) {
|
|
35
|
+
throw new UnauthorizedError({
|
|
36
|
+
error: "Failed to get the PINNACLE-SIGNING-SECRET header from request",
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (headerSecret !== signingSecret) {
|
|
40
|
+
throw new UnauthorizedError({ error: "Invalid webhook signature" });
|
|
41
|
+
}
|
|
42
|
+
return body;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Tools } from '../../api/resources/tools/client/Client.mjs';
|
|
2
|
+
import { FileUploader } from './FileUploader.mjs';
|
|
3
|
+
export class EnhancedTools extends Tools {
|
|
4
|
+
get file() {
|
|
5
|
+
var _a;
|
|
6
|
+
return ((_a = this._fileUploader) !== null && _a !== void 0 ? _a : (this._fileUploader = new FileUploader(this._options)));
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { File_ } from "../../api/resources/tools/resources/file/client/Client.mjs";
|
|
2
|
+
import { UploadFileParams } from "../../api/resources/tools/resources/file/client/requests/index.mjs";
|
|
3
|
+
export declare class FileUploader extends File_ {
|
|
4
|
+
/**
|
|
5
|
+
* Upload a file from a file path (Node.js) or File object (browser)
|
|
6
|
+
* @param fileInput - File path string (Node.js) or File object (browser)
|
|
7
|
+
* @param options - Upload options
|
|
8
|
+
* @returns The download URL of the uploaded file
|
|
9
|
+
*/
|
|
10
|
+
uploadFromPath(fileInput: string | File, options?: {
|
|
11
|
+
name?: string;
|
|
12
|
+
options?: UploadFileParams.Options;
|
|
13
|
+
}): Promise<string>;
|
|
14
|
+
private getMimeType;
|
|
15
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import * as mime from "mime-types";
|
|
11
|
+
import { File_ } from "../../api/resources/tools/resources/file/client/Client.mjs";
|
|
12
|
+
import { BadRequestError, NotFoundError, InternalServerError } from "../../api/errors/index.mjs";
|
|
13
|
+
export class FileUploader extends File_ {
|
|
14
|
+
/**
|
|
15
|
+
* Upload a file from a file path (Node.js) or File object (browser)
|
|
16
|
+
* @param fileInput - File path string (Node.js) or File object (browser)
|
|
17
|
+
* @param options - Upload options
|
|
18
|
+
* @returns The download URL of the uploaded file
|
|
19
|
+
*/
|
|
20
|
+
uploadFromPath(fileInput, options) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
let size;
|
|
23
|
+
let fileName;
|
|
24
|
+
let contentType;
|
|
25
|
+
let blob;
|
|
26
|
+
if (typeof window === "undefined") {
|
|
27
|
+
if (typeof fileInput !== "string") {
|
|
28
|
+
throw new BadRequestError({ message: "In Node.js, fileInput must be a file path string" });
|
|
29
|
+
}
|
|
30
|
+
const fs = yield import("fs");
|
|
31
|
+
const path = yield import("path");
|
|
32
|
+
const filePath = fileInput;
|
|
33
|
+
let stats;
|
|
34
|
+
try {
|
|
35
|
+
stats = yield fs.promises.stat(filePath);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
if (error.code === "ENOENT") {
|
|
39
|
+
throw new NotFoundError({ error: `File not found: ${filePath}` });
|
|
40
|
+
}
|
|
41
|
+
throw new InternalServerError({ error: `Failed to access file: ${error.message}` });
|
|
42
|
+
}
|
|
43
|
+
if (stats.isDirectory()) {
|
|
44
|
+
throw new BadRequestError({ message: `Path is a directory, not a file: ${filePath}` });
|
|
45
|
+
}
|
|
46
|
+
size = stats.size;
|
|
47
|
+
fileName = (options === null || options === void 0 ? void 0 : options.name) || path.default.basename(filePath);
|
|
48
|
+
contentType = this.getMimeType(filePath);
|
|
49
|
+
const fileBuffer = yield fs.promises.readFile(filePath);
|
|
50
|
+
const arrayBuffer = new Uint8Array(fileBuffer).buffer;
|
|
51
|
+
blob = new Blob([arrayBuffer], { type: contentType });
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
if (!(fileInput instanceof File)) {
|
|
55
|
+
throw new BadRequestError({ message: "In browser, fileInput must be a File object" });
|
|
56
|
+
}
|
|
57
|
+
const file = fileInput;
|
|
58
|
+
size = file.size;
|
|
59
|
+
fileName = (options === null || options === void 0 ? void 0 : options.name) || file.name;
|
|
60
|
+
contentType = file.type || this.getMimeType(file.name);
|
|
61
|
+
blob = file;
|
|
62
|
+
}
|
|
63
|
+
const uploadParams = {
|
|
64
|
+
contentType,
|
|
65
|
+
size,
|
|
66
|
+
name: fileName,
|
|
67
|
+
options: options === null || options === void 0 ? void 0 : options.options,
|
|
68
|
+
};
|
|
69
|
+
const uploadResult = yield this.upload(uploadParams);
|
|
70
|
+
if (uploadResult.uploadUrl) {
|
|
71
|
+
yield fetch(uploadResult.uploadUrl, {
|
|
72
|
+
method: "PUT",
|
|
73
|
+
body: blob,
|
|
74
|
+
headers: {
|
|
75
|
+
"Content-Type": contentType,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return uploadResult.downloadUrl;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
getMimeType(filePath) {
|
|
83
|
+
const mimeType = mime.lookup(filePath);
|
|
84
|
+
if (!mimeType) {
|
|
85
|
+
return "application/octet-stream";
|
|
86
|
+
}
|
|
87
|
+
const supportedTypes = new Set([
|
|
88
|
+
"audio/mpeg",
|
|
89
|
+
"audio/mp4",
|
|
90
|
+
"audio/ogg",
|
|
91
|
+
"audio/aac",
|
|
92
|
+
"audio/webm",
|
|
93
|
+
"audio/wav",
|
|
94
|
+
"audio/3gpp",
|
|
95
|
+
"audio/amr",
|
|
96
|
+
"video/mp4",
|
|
97
|
+
"video/mpeg",
|
|
98
|
+
"video/quicktime",
|
|
99
|
+
"video/webm",
|
|
100
|
+
"video/3gpp",
|
|
101
|
+
"video/H264",
|
|
102
|
+
"video/x-m4v",
|
|
103
|
+
"image/jpeg",
|
|
104
|
+
"image/png",
|
|
105
|
+
"image/gif",
|
|
106
|
+
"image/bmp",
|
|
107
|
+
"image/tiff",
|
|
108
|
+
"image/webp",
|
|
109
|
+
"application/pdf",
|
|
110
|
+
"text/csv",
|
|
111
|
+
"application/rtf",
|
|
112
|
+
"text/vcard",
|
|
113
|
+
"text/calendar",
|
|
114
|
+
]);
|
|
115
|
+
if (supportedTypes.has(mimeType)) {
|
|
116
|
+
return mimeType;
|
|
117
|
+
}
|
|
118
|
+
const baseType = mimeType.split("/")[0];
|
|
119
|
+
if (["audio", "video", "image"].includes(baseType)) {
|
|
120
|
+
console.warn(`MIME type ${mimeType} may not be fully supported. Proceeding anyway.`);
|
|
121
|
+
return mimeType;
|
|
122
|
+
}
|
|
123
|
+
return "application/octet-stream";
|
|
124
|
+
}
|
|
125
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rcs-js",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": "github:pinnacle-dev/rcs-js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -38,6 +38,9 @@
|
|
|
38
38
|
"test:browser": "jest --selectProjects browser",
|
|
39
39
|
"test:wire": "jest --selectProjects wire"
|
|
40
40
|
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"mime-types": "^3.0.1"
|
|
43
|
+
},
|
|
41
44
|
"devDependencies": {
|
|
42
45
|
"webpack": "^5.97.1",
|
|
43
46
|
"ts-loader": "^9.5.1",
|
|
@@ -49,7 +52,8 @@
|
|
|
49
52
|
"msw": "^2.8.4",
|
|
50
53
|
"@types/node": "^18.19.70",
|
|
51
54
|
"prettier": "^3.4.2",
|
|
52
|
-
"typescript": "~5.7.2"
|
|
55
|
+
"typescript": "~5.7.2",
|
|
56
|
+
"@types/mime-types": "^3.0.1"
|
|
53
57
|
},
|
|
54
58
|
"browser": {
|
|
55
59
|
"fs": false,
|
|
@@ -62,4 +66,4 @@
|
|
|
62
66
|
"node": ">=18.0.0"
|
|
63
67
|
},
|
|
64
68
|
"sideEffects": false
|
|
65
|
-
}
|
|
69
|
+
}
|
package/reference.md
CHANGED
|
@@ -2915,7 +2915,7 @@ await client.messages.rcs.send({
|
|
|
2915
2915
|
<dl>
|
|
2916
2916
|
<dd>
|
|
2917
2917
|
|
|
2918
|
-
**request:** `Pinnacle.
|
|
2918
|
+
**request:** `Pinnacle.RichMessage`
|
|
2919
2919
|
|
|
2920
2920
|
</dd>
|
|
2921
2921
|
</dl>
|
|
@@ -3768,7 +3768,7 @@ See the response of [Create Shortened URL](./create-url) for more information.
|
|
|
3768
3768
|
<dl>
|
|
3769
3769
|
<dd>
|
|
3770
3770
|
|
|
3771
|
-
Update the destination or
|
|
3771
|
+
Update the destination or expiration date of an existing shortened URL. Expiring links cannot be updated into a permalink.
|
|
3772
3772
|
|
|
3773
3773
|
</dd>
|
|
3774
3774
|
</dl>
|
|
@@ -3907,6 +3907,80 @@ await client.tools.file.upload({
|
|
|
3907
3907
|
</dl>
|
|
3908
3908
|
</details>
|
|
3909
3909
|
|
|
3910
|
+
<details><summary><code>client.tools.file.<a href="/src/api/resources/tools/resources/file/client/Client.ts">refresh</a>({ ...params }) -> Pinnacle.RefreshedFile[]</code></summary>
|
|
3911
|
+
<dl>
|
|
3912
|
+
<dd>
|
|
3913
|
+
|
|
3914
|
+
#### 📝 Description
|
|
3915
|
+
|
|
3916
|
+
<dl>
|
|
3917
|
+
<dd>
|
|
3918
|
+
|
|
3919
|
+
<dl>
|
|
3920
|
+
<dd>
|
|
3921
|
+
|
|
3922
|
+
Refresh expiring presigned URLs for Pinnacle-hosted files to extend their access time.
|
|
3923
|
+
|
|
3924
|
+
<Callout type="info">
|
|
3925
|
+
This only works for presigned download URLs. At this moment, you cannot refresh a presigned upload URL, generate a new one instead.
|
|
3926
|
+
</Callout>
|
|
3927
|
+
</dd>
|
|
3928
|
+
</dl>
|
|
3929
|
+
</dd>
|
|
3930
|
+
</dl>
|
|
3931
|
+
|
|
3932
|
+
#### 🔌 Usage
|
|
3933
|
+
|
|
3934
|
+
<dl>
|
|
3935
|
+
<dd>
|
|
3936
|
+
|
|
3937
|
+
<dl>
|
|
3938
|
+
<dd>
|
|
3939
|
+
|
|
3940
|
+
```typescript
|
|
3941
|
+
await client.tools.file.refresh({
|
|
3942
|
+
uris: [
|
|
3943
|
+
"https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=oldtoken",
|
|
3944
|
+
"https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=oldtoken2",
|
|
3945
|
+
"icons/3/test.jpg",
|
|
3946
|
+
"invalid/url",
|
|
3947
|
+
"https://google.com",
|
|
3948
|
+
],
|
|
3949
|
+
});
|
|
3950
|
+
```
|
|
3951
|
+
|
|
3952
|
+
</dd>
|
|
3953
|
+
</dl>
|
|
3954
|
+
</dd>
|
|
3955
|
+
</dl>
|
|
3956
|
+
|
|
3957
|
+
#### ⚙️ Parameters
|
|
3958
|
+
|
|
3959
|
+
<dl>
|
|
3960
|
+
<dd>
|
|
3961
|
+
|
|
3962
|
+
<dl>
|
|
3963
|
+
<dd>
|
|
3964
|
+
|
|
3965
|
+
**request:** `Pinnacle.tools.RefreshFileParams`
|
|
3966
|
+
|
|
3967
|
+
</dd>
|
|
3968
|
+
</dl>
|
|
3969
|
+
|
|
3970
|
+
<dl>
|
|
3971
|
+
<dd>
|
|
3972
|
+
|
|
3973
|
+
**requestOptions:** `File_.RequestOptions`
|
|
3974
|
+
|
|
3975
|
+
</dd>
|
|
3976
|
+
</dl>
|
|
3977
|
+
</dd>
|
|
3978
|
+
</dl>
|
|
3979
|
+
|
|
3980
|
+
</dd>
|
|
3981
|
+
</dl>
|
|
3982
|
+
</details>
|
|
3983
|
+
|
|
3910
3984
|
## Tools ContactCard
|
|
3911
3985
|
|
|
3912
3986
|
<details><summary><code>client.tools.contactCard.<a href="/src/api/resources/tools/resources/contactCard/client/Client.ts">get</a>({ ...params }) -> Pinnacle.VCardData</code></summary>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
export interface ClickAction {
|
|
5
|
-
/** Title of the button or quick reply that was clicked on. */
|
|
6
|
-
button: string;
|
|
7
|
-
/** Payload received from the button interaction. */
|
|
8
|
-
data: ClickAction.Data;
|
|
9
|
-
}
|
|
10
|
-
export declare namespace ClickAction {
|
|
11
|
-
/**
|
|
12
|
-
* Payload received from the button interaction.
|
|
13
|
-
*/
|
|
14
|
-
type Data =
|
|
15
|
-
/**
|
|
16
|
-
* Data that is attached to the button. <br>
|
|
17
|
-
*
|
|
18
|
-
* This is only returned when `trigger` buttons are pressed. */
|
|
19
|
-
{
|
|
20
|
-
metadata: string;
|
|
21
|
-
payload: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Indicates that the button was clicked. <br>
|
|
25
|
-
*
|
|
26
|
-
* This is returned when `openUrl`, `call`, and `scheduleEvent` buttons are clicked. */
|
|
27
|
-
| "clicked";
|
|
28
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as Pinnacle from "../index.js";
|
|
5
|
-
export type InboundButton =
|
|
6
|
-
/**
|
|
7
|
-
* Data associated with a button that is pressed. Excludes `requestUserLocation` and `sendLocation`. */
|
|
8
|
-
Pinnacle.ClickAction
|
|
9
|
-
/**
|
|
10
|
-
* User provided location. Occurs when recipient responds to a `requestUserLocation` or `sendLocation` button. */
|
|
11
|
-
| Pinnacle.LocationShareAction;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
export interface ClickAction {
|
|
5
|
-
/** Title of the button or quick reply that was clicked on. */
|
|
6
|
-
button: string;
|
|
7
|
-
/** Payload received from the button interaction. */
|
|
8
|
-
data: ClickAction.Data;
|
|
9
|
-
}
|
|
10
|
-
export declare namespace ClickAction {
|
|
11
|
-
/**
|
|
12
|
-
* Payload received from the button interaction.
|
|
13
|
-
*/
|
|
14
|
-
type Data =
|
|
15
|
-
/**
|
|
16
|
-
* Data that is attached to the button. <br>
|
|
17
|
-
*
|
|
18
|
-
* This is only returned when `trigger` buttons are pressed. */
|
|
19
|
-
{
|
|
20
|
-
metadata: string;
|
|
21
|
-
payload: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Indicates that the button was clicked. <br>
|
|
25
|
-
*
|
|
26
|
-
* This is returned when `openUrl`, `call`, and `scheduleEvent` buttons are clicked. */
|
|
27
|
-
| "clicked";
|
|
28
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as Pinnacle from "../index.mjs";
|
|
5
|
-
export type InboundButton =
|
|
6
|
-
/**
|
|
7
|
-
* Data associated with a button that is pressed. Excludes `requestUserLocation` and `sendLocation`. */
|
|
8
|
-
Pinnacle.ClickAction
|
|
9
|
-
/**
|
|
10
|
-
* User provided location. Occurs when recipient responds to a `requestUserLocation` or `sendLocation` button. */
|
|
11
|
-
| Pinnacle.LocationShareAction;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|