Secure Share | Node.js SDK
Buckets
buckets(): Promise<PangeaResponse<BucketsResult>>Get information on the accessible buckets.
await client.buckets();
Delete
delete(request: DeleteRequest): Promise<PangeaResponse<DeleteResult>>Delete object by ID or path. If both are supplied, the path must match that of the object represented by the ID.
const request = { id: "pos_3djfmzg2db4c6donarecbyv5begtj2bm" };
const response = await client.delete(request);
Create a folder
folderCreate(request: FolderCreateRequest): Promise<PangeaResponse<FolderCreateResult>>Create a folder, either by name or path and parent_id.
const request = {
metadata: {
created_by: "jim",
priority: "medium",
},
parent_id: "pos_3djfmzg2db4c6donarecbyv5begtj2bm",
folder: "/",
tags: ["irs_2023", "personal"],
};
const response = await client.folderCreate(request);
Get archive
getArchive(request: GetArchiveRequest): Promise<PangeaResponse<GetArchiveResult>>Get an archive file of multiple objects.
const request = { ids: ["pos_3djfmzg2db4c6donarecbyv5begtj2bm"] };
const response = await client.getArchive(request);
Get an object
getItem(request: GetRequest): Promise<PangeaResponse<GetResult>>Get object. If both ID and path are supplied, the call will fail if the target object doesn't match both properties.
const request = { id: "pos_3djfmzg2db4c6donarecbyv5begtj2bm" };
const response = await client.getItem(request);
List
list(request: ListRequest): Promise<PangeaResponse<ListResult>>List or filter/search records.
const request = {};
const response = await client.list(request);
Request upload URL
requestUploadURL(request: PutRequest): Promise<PangeaResponse<PutResult>>Request a presigned URL.
const { crc32c, sha256, size } = getFileUploadParams("./path/to/file.pdf");
const request = {
transfer_method: TransferMethod.POST_URL,
crc32c,
sha256,
size,
Metadata: {
created_by: "jim",
priority: "medium",
},
parent_id: "pos_3djfmzg2db4c6donarecbyv5begtj2bm",
folder: "/",
tags: ["irs_2023", "personal"],
};
const response = await client.requestUploadURL(request);
Create share links
shareLinkCreate(request: ShareLinkCreateRequest): Promise<PangeaResponse<ShareLinkCreateResult>>Create a share link.
const authenticator = {
auth_type: Share.AuthenticatorType.PASSWORD,
auth_context: "my_fav_Pa55word",
};
const link = {
targets: ["pos_3djfmzg2db4c6donarecbyv5begtj2bm"],
link_type: Share.LinkType.DOWNLOAD,
authenticators: [authenticator],
};
const request = { links: [link] };
const response = await client.shareLinkCreate(request);
Delete share links
shareLinkDelete(request: ShareLinkDeleteRequest): Promise<PangeaResponse<ShareLinkDeleteResult>>Delete share links.
const request = { ids: ["psl_3djfmzg2db4c6donarecbyv5begtj2bm"] };
const response = await client.shareLinkDelete(request);
Get share link
shareLinkGet(request: ShareLinkGetRequest): Promise<PangeaResponse<ShareLinkGetResult>>Get a share link.
const request = { id: "psl_3djfmzg2db4c6donarecbyv5begtj2bm" };
const response = await client.shareLinkGet(request);
List share links
shareLinkList(request: ShareLinkListRequest): Promise<PangeaResponse<ShareLinkListResult>>Look up share links by filter options.
const request = {};
const response = await client.shareLinkList(request);
Send share links
shareLinkSend(request: ShareLinkSendRequest): Promise<PangeaResponse<ShareLinkSendResult>>Send share links.
Update a file
update(request: UpdateRequest): Promise<PangeaResponse<UpdateResult>>Update a file.
const request = {
id: "pos_3djfmzg2db4c6donarecbyv5begtj2bm",
folder: "/",
remove_metadata: {
created_by: "jim",
priority: "medium",
}
remove_tags: ["irs_2023", "personal"],
};
const response = await client.update(request);
Enum ArchiveFormat
ArchiveFormatTAR
= "tar"
ZIP
= "zip"
Enum AuthenticatorType
AuthenticatorTypeEMAIL_OTP
= "email_otp"
PASSWORD
= "password"
SMS_OTP
= "sms_otp"
SOCIAL
= "social"
Enum FileFormat
FileFormatA
= "A"
AAC
= "AAC"
ACCDB
= "ACCDB"
AIFF
= "AIFF"
AMF
= "AMF"
AMR
= "AMR"
APE
= "APE"
ASF
= "ASF"
ATOM
= "ATOM"
AU
= "AU"
AVI
= "AVI"
AVIF
= "AVIF"
BIN
= "BIN"
BMP
= "BMP"
BPG
= "BPG"
BZ2
= "BZ2"
CAB
= "CAB"
CLASS
= "CLASS"
CPIO
= "CPIO"
CRX
= "CRX"
CSV
= "CSV"
DAE
= "DAE"
DBF
= "DBF"
DCM
= "DCM"
DEB
= "DEB"
DJVU
= "DJVU"
DLL
= "DLL"
DOC
= "DOC"
DOCX
= "DOCX"
DWG
= "DWG"
EOT
= "EOT"
EPUB
= "EPUB"
EXE
= "EXE"
F3G2
= "3G2"
F3GP
= "3GP"
F3MF
= "3MF"
F7Z
= "7Z"
FDF
= "FDF"
FITS
= "FITS"
FLAC
= "FLAC"
FLV
= "FLV"
GBR
= "GBR"
GEOJSON
= "GEOJSON"
GIF
= "GIF"
GLB
= "GLB"
GML
= "GML"
GPX
= "GPX"
GZ
= "GZ"
HAR
= "HAR"
HDR
= "HDR"
HEIC
= "HEIC"
HEIF
= "HEIF"
HTML
= "HTML"
ICNS
= "ICNS"
ICO
= "ICO"
ICS
= "ICS"
ISO
= "ISO"
JAR
= "JAR"
JP2
= "JP2"
JPF
= "JPF"
JPG
= "JPG"
JPM
= "JPM"
JS
= "JS"
JSON
= "JSON"
JXL
= "JXL"
JXR
= "JXR"
KML
= "KML"
LIT
= "LIT"
LNK
= "LNK"
LUA
= "LUA"
LZ
= "LZ"
M3U
= "M3U"
M4A
= "M4A"
MACHO
= "MACHO"
MDB
= "MDB"
MIDI
= "MIDI"
MKV
= "MKV"
MOBI
= "MOBI"
MOV
= "MOV"
MP3
= "MP3"
MP4
= "MP4"
MPC
= "MPC"
MPEG
= "MPEG"
MQV
= "MQV"
MRC
= "MRC"
MSG
= "MSG"
MSI
= "MSI"
NDJSON
= "NDJSON"
NES
= "NES"
ODC
= "ODC"
ODF
= "ODF"
ODG
= "ODG"
ODP
= "ODP"
ODS
= "ODS"
ODT
= "ODT"
OGA
= "OGA"
OGV
= "OGV"
OTF
= "OTF"
OTG
= "OTG"
OTP
= "OTP"
OTS
= "OTS"
OTT
= "OTT"
OWL
= "OWL"
P7S
= "P7S"
PAT
= "PAT"
PDF
= "PDF"
PHP
= "PHP"
PL
= "PL"
PNG
= "PNG"
PPT
= "PPT"
PPTX
= "PPTX"
PS
= "PS"
PSD
= "PSD"
PUB
= "PUB"
PY
= "PY"
QCP
= "QCP"
RAR
= "RAR"
RMVB
= "RMVB"
RPM
= "RPM"
RSS
= "RSS"
RTF
= "RTF"
SHP
= "SHP"
SHX
= "SHX"
SO
= "SO"
SQLITE
= "SQLITE"
SRT
= "SRT"
SVG
= "SVG"
SWF
= "SWF"
SXC
= "SXC"
TAR
= "TAR"
TCL
= "TCL"
TCX
= "TCX"
TIFF
= "TIFF"
TORRENT
= "TORRENT"
TSV
= "TSV"
TTC
= "TTC"
TTF
= "TTF"
TXT
= "TXT"
VCF
= "VCF"
VOC
= "VOC"
VTT
= "VTT"
WARC
= "WARC"
WASM
= "WASM"
WAV
= "WAV"
WEBM
= "WEBM"
WEBP
= "WEBP"
WOFF
= "WOFF"
WOFF2
= "WOFF2"
X3D
= "X3D"
XAR
= "XAR"
XCF
= "XCF"
XFDF
= "XFDF"
XLF
= "XLF"
XLS
= "XLS"
XLSX
= "XLSX"
XML
= "XML"
XPM
= "XPM"
XZ
= "XZ"
ZIP
= "ZIP"
ZST
= "ZST"
Enum ItemOrder
ItemOrderASC
= "asc"
DESC
= "desc"
Enum ItemOrderBy
ItemOrderByCREATED_AT
= "created_at"
ID
= "id"
NAME
= "name"
PARENT_ID
= "parent_id"
TYPE
= "type"
UPDATED_AT
= "updated_at"
Enum LinkType
LinkTypeDOWNLOAD
= "download"
EDITOR
= "editor"
UPLOAD
= "upload"