Skip to main content

Secure Share | Node.js SDK

Buckets

buckets(): Promise<PangeaResponse<BucketsResult>>

Get information on the accessible buckets.

Response Object

Promise<PangeaResponse<BucketsResult>>
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.

required parameters

DeleteRequest

Response Object

Promise<PangeaResponse<DeleteResult>>
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.

required parameters

FolderCreateRequest

Response Object

Promise<PangeaResponse<FolderCreateResult>>
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.

required parameters

GetArchiveRequest

Response Object

Promise<PangeaResponse<GetArchiveResult>>
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.

required parameters

GetRequest

Response Object

Promise<PangeaResponse<GetResult>>
const request = { id: "pos_3djfmzg2db4c6donarecbyv5begtj2bm" };
const response = await client.getItem(request);

List

list(request: ListRequest): Promise<PangeaResponse<ListResult>>

List or filter/search records.

required parameters

ListRequest

Response Object

Promise<PangeaResponse<ListResult>>
const request = {};
const response = await client.list(request);

Request upload URL

requestUploadURL(request: PutRequest): Promise<PangeaResponse<PutResult>>

Request a presigned URL.

required parameters

PutRequest

Response Object

Promise<PangeaResponse<PutResult>>
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);
shareLinkCreate(request: ShareLinkCreateRequest): Promise<PangeaResponse<ShareLinkCreateResult>>

Create a share link.

required parameters

ShareLinkCreateRequest

Response Object

Promise<PangeaResponse<ShareLinkCreateResult>>
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);
shareLinkDelete(request: ShareLinkDeleteRequest): Promise<PangeaResponse<ShareLinkDeleteResult>>

Delete share links.

required parameters

ShareLinkDeleteRequest

Response Object

Promise<PangeaResponse<ShareLinkDeleteResult>>
const request = { ids: ["psl_3djfmzg2db4c6donarecbyv5begtj2bm"] };
const response = await client.shareLinkDelete(request);
shareLinkGet(request: ShareLinkGetRequest): Promise<PangeaResponse<ShareLinkGetResult>>

Get a share link.

required parameters

ShareLinkGetRequest

Response Object

Promise<PangeaResponse<ShareLinkGetResult>>
const request = { id: "psl_3djfmzg2db4c6donarecbyv5begtj2bm" };
const response = await client.shareLinkGet(request);
shareLinkList(request: ShareLinkListRequest): Promise<PangeaResponse<ShareLinkListResult>>

Look up share links by filter options.

const request = {};
const response = await client.shareLinkList(request);
shareLinkSend(request: ShareLinkSendRequest): Promise<PangeaResponse<ShareLinkSendResult>>

Send share links.

required parameters

ShareLinkSendRequest

Response Object

Promise<PangeaResponse<ShareLinkSendResult>>

Update a file

update(request: UpdateRequest): Promise<PangeaResponse<UpdateResult>>

Update a file.

required parameters

UpdateRequest

Response Object

Promise<PangeaResponse<UpdateResult>>
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

ArchiveFormat

TAR = "tar"

ZIP = "zip"

Enum AuthenticatorType

AuthenticatorType

EMAIL_OTP = "email_otp"

PASSWORD = "password"

SMS_OTP = "sms_otp"

SOCIAL = "social"

Enum FileFormat

FileFormat

A = "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

ItemOrder

ASC = "asc"

DESC = "desc"

Enum ItemOrderBy

ItemOrderBy

CREATED_AT = "created_at"

ID = "id"

NAME = "name"

PARENT_ID = "parent_id"

TYPE = "type"

UPDATED_AT = "updated_at"

LinkType

DOWNLOAD = "download"

EDITOR = "editor"

UPLOAD = "upload"

Interface Authenticator

Authenticator

required parameters

string

An email address.

An authentication mechanism.

Interface Bucket

Bucket

required parameters

boolean

If true, is the default bucket.

string

The ID of a share bucket resource.

string

The bucket's friendly name.

Array<TransferMethod>

Interface BucketsResult

BucketsResult

required parameters

Array<Bucket>

A list of available buckets.

Interface DeleteRequest

DeleteRequest

optional parameters

string

The bucket to use, if not the default.

boolean

If true, delete a folder even if it's not empty. Deletes the contents of folder as well.

string

The ID of the object to delete.

string

The path of the object to delete.

Interface DeleteResult

DeleteResult

required parameters

number

Number of objects deleted.

Interface FolderCreateRequest

FolderCreateRequest

optional parameters

string

The bucket to use, if not the default.

string

The folder to place the folder in. Must match

Metadata

A set of string-based key/value pairs used to provide additional data about an object.

string

The name of an object.

string

The ID of a stored object.

Tags

A list of user-defined tags.

Interface FolderCreateResult

FolderCreateResult

required parameters

ItemData

Interface GetArchiveRequest

GetArchiveRequest

required parameters

Array<string>

The IDs of the objects to include in the archive. Folders include all children.

optional parameters

string

The bucket to use, if not the default.

The format to use to build the archive.

TransferMethod

The requested transfer method for the file data.

Interface GetArchiveResult

GetArchiveResult

required parameters

number

Number of objects included in the archive.

optional parameters

string

A location where the archive can be downloaded from.

A list of all objects included in the archive.

Interface GetRequest

GetRequest

optional parameters

string

The bucket to use, if not the default.

string

The ID of the object to retrieve.

string

If the file was protected with a password, the password to decrypt with.

TransferMethod

The requested transfer method for the file data.

Interface GetResult

GetResult

required parameters

ItemData

optional parameters

string

A URL where the file can be downloaded from.

Interface ItemData

ItemData

required parameters

string

The date and time the object was created.

string

The key in the external bucket that contains this file.

string

The ID of a stored object.

string

The name of the object.

string

The parent ID (a folder). Blanks means the root folder.

string

The type of the item (file or dir).

string

The date and time the object was last updated.

optional parameters

number

The number of billable bytes (includes Metadata, Tags, etc.) for the object.

string

The MD5 hash of the file contents.

Metadata

A set of string-based key/value pairs used to provide additional data about an object.

Metadata

Protected (read-only) metadata.

string

The SHA256 hash of the file contents.

string

The SHA512 hash of the file contents.

number

The size of the object in bytes.

Tags

A list of user-defined tags.

Tags

Protected (read-only) flags.

Interface ListFilter

ListFilter

optional parameters

string

Only records where created_at equals this value.

string

Only records where created_at is greater than this value.

string

Only records where created_at is greater than or equal to this value.

string

Only records where created_at is less than this value.

string

Only records where created_at is less than or equal to this value.

string

Only records where the object exists in the supplied parent folder path name.

string

Only records where id equals this value.

Array<string>

Only records where id equals one of the provided substrings.

string

Only records where name equals this value.

Array<string>

Only records where name includes each substring.

Array<string>

Only records where name equals one of the provided substrings.

string

Only records where parent_id equals this value.

Array<string>

Only records where parent_id equals one of the provided substrings.

number

Only records where size equals this value.

number

Only records where size is greater than this value.

number

Only records where size is greater than or equal to this value.

number

Only records where size is less than to this value.

number

Only records where size is less than or equal to this value.

Array<string>

A list of tags that all must be present.

string

Only records where type equals this value.

Array<string>

Only records where type includes each substring.

Array<string>

Only records where type equals one of the provided substrings.

string

Only records where updated_at equals this value.

string

Only records where updated_at is greater than this value.

string

Only records where updated_at is greater than or equal to this value.

string

Only records where updated_at is less than this value.

string

Only records where updated_at is less than or equal to this value.

Interface ListRequest

ListRequest

optional parameters

string

The bucket to use, if not the default.

boolean

If true, include the

string

Reflected value from a previous response to obtain the next page of results.

Order results asc(ending) or desc(ending).

ItemOrderBy

Which field to order results by.

number

Maximum results to include in the response.

Interface ListResult

ListResult

required parameters

number

The total number of objects matched by the list request.

optional parameters

string

Used to fetch the next page of the current listing when provided in a repeated request's last parameter.

Interface Metadata

Metadata

Interface PutRequest

PutRequest

optional parameters

string

The bucket to use, if not the default.

string

The hexadecimal-encoded CRC32C hash of the file data, which will be verified by the server if provided.

string

The path to the parent folder. Leave blank for the root folder. Path must resolve to parent_id if also set.

The format of the file, which will be verified by the server if provided. Uploads not matching the supplied format will be rejected.

string

The hexadecimal-encoded MD5 hash of the file data, which will be verified by the server if provided.

Metadata

A set of string-based key/value pairs used to provide additional data about an object.

string

The MIME type of the file, which will be verified by the server if provided. Uploads not matching the supplied MIME type will be rejected.

string

The name of the object to store.

string

The parent ID of the object (a folder). Leave blank to keep in the root folder.

string

An optional password to protect the file with. Downloading the file will require this password.

string

An optional password algorithm to protect the file with. See symmetric vault password_algorithm.

string

The hexadecimal-encoded SHA1 hash of the file data, which will be verified by the server if provided.

string

The SHA256 hash of the file data, which will be verified by the server if provided.

string

The hexadecimal-encoded SHA512 hash of the file data, which will be verified by the server if provided.

number

The size (in bytes) of the file. If the upload doesn't match, the call will fail.

string

The URL to fetch the file payload from (for transfer_method source-url).

Tags

A list of user-defined tags

TransferMethod

The transfer method used to upload the file data.

Interface PutResult

PutResult

required parameters

ItemData
ShareLinkCreateItem

required parameters

Array<Authenticator>

A list of authenticators.

Array<string>

List of storage IDs.

optional parameters

string

The date and time the share link expires.

LinkType

Type of link.

number

The maximum number of times a user can be authenticated to access the share link.

string

An optional message to use in accessing shares.

string

An email address.

Tags

A list of user-defined tags.

string

An optional title to use in accessing shares.

ShareLinkCreateRequest

required parameters

Array<ShareLinkCreateItem>
ShareLinkCreateResult

required parameters

Array<ShareLinkItem>
ShareLinkDeleteRequest

required parameters

Array<string>

optional parameters

string

The bucket to use, if not the default.

ShareLinkDeleteResult

required parameters

Array<ShareLinkItem>
ShareLinkGetRequest

required parameters

string

The ID of a share link.

ShareLinkGetResult

required parameters

ShareLinkItem
ShareLinkItem

required parameters

number

The number of times a user has authenticated to access the share link.

Array<Authenticator>

A list of authenticators

string

The ID of a share bucket resource.

string

The date and time the share link was created.

string

The date and time the share link expires.

string

The ID of a share link.

string

A URL to access the file/folders shared with a link.

string

Type of link.

number

The maximum number of times a user can be authenticated to access the share link.

Array<string>

List of storage IDs.

optional parameters

string

The date and time the share link was last accessed.

string

An optional message to use in accessing shares.

string

An email address.

Tags

A list of user-defined tags.

string

An optional title to use in accessing shares.

ShareLinkListFilter

optional parameters

number

Only records where access_count equals this value.

number

Only records where access_count is greater than this value.

number

Only records where access_count is greater than or equal to this value.

number

Only records where access_count is less than this value.

number

Only records where access_count is less than or equal to this value.

string

Only records where created_at equals this value.

string

Only records where created_at is greater than this value.

string

Only records where created_at is greater than or equal to this value.

string

Only records where created_at is less than this value.

string

Only records where created_at is less than or equal to this value.

string

Only records where expires_at equals this value.

string

Only records where expires_at is greater than this value.

string

Only records where expires_at is greater than or equal to this value.

string

Only records where expires_at is less than this value.

string

Only records where expires_at is less than or equal to this value.

string

Only records where id equals this value.

Array<string>

Only records where id includes each substring.

Array<string>

Only records where id equals one of the provided substrings.

string

Only records where last_accessed_at equals this value.

string

Only records where last_accessed_at is greater than this value.

string

Only records where last_accessed_at is greater than or equal to this value.

string

Only records where last_accessed_at is less than this value.

string

Only records where last_accessed_at is less than or equal to this value.

string

Only records where link equals this value.

Array<string>

Only records where link includes each substring.

Array<string>

Only records where link equals one of the provided substrings.

string

Only records where link_type equals this value.

Array<string>

Only records where link_type includes each substring.

Array<string>

Only records where link_type equals one of the provided substrings.

number

Only records where max_access_count equals this value.

number

Only records where max_access_count is greater than this value.

number

Only records where max_access_count is greater than or equal to this value.

number

Only records where max_access_count is less than this value.

number

Only records where max_access_count is less than or equal to this value.

string

Only records where target_id equals this value.

Array<string>

Only records where target_id includes each substring.

Array<string>

Only records where target_id equals one of the provided substrings.

ShareLinkListRequest

optional parameters

string

The bucket to use, if not the default.

string

Reflected value from a previous response to obtain the next page of results.

Order results asc(ending) or desc(ending).

ItemOrderBy

Which field to order results by.

number

Maximum results to include in the response.

ShareLinkListResult

required parameters

number

The total number of share links matched by the list request.

Array<ShareLinkItem>

optional parameters

string

Used to fetch the next page of the current listing when provided in a repeated request's last parameter.

ShareLinkSendItem

required parameters

string

An email address.

string

The ID of a share link.

ShareLinkSendRequest

required parameters

Array<ShareLinkSendItem>
string

An email address.

optional parameters

string
ShareLinkSendResult

required parameters

Array<ShareLinkItem>

Interface UpdateRequest

UpdateRequest

required parameters

string

An identifier for the file to update.

optional parameters

Metadata

A list of metadata key/values to set in the object. If a provided key exists, the value will be replaced.

string

Protect the file with the supplied password.

string

The algorithm to use to password protect the file.

Tags

A list of tags to add. It is not an error to provide a tag which already exists.

string

The bucket to use, if not the default.

string

Set the parent (folder). Leave blank for the root folder. Path must resolve to parent_id if also set.

Metadata

Set the object's metadata.

string

Set the parent (folder) of the object.

Metadata

A list of metadata key/values to remove in the object. It is not an error for a provided key to not exist. If a provided key exists but doesn't match the provided value, it will not be removed.

string

Remove the supplied password from the file.

Tags

A list of tags to remove. It is not an error to provide a tag which is not present.

Tags

Set the object's tags.

string

The date and time the object was last updated. If included, the update will fail if this doesn't match the date and time of the last update for the object.

Interface UpdateResult

UpdateResult

required parameters

ItemData

Type alias Tags

Tags