Skip to main content

Secure Share | Node.js SDK

Delete (Beta)

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. How to install a Beta release.

required parameters

DeleteRequest

Response Object

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

Create a folder (Beta)

folderCreate(request: FolderCreateRequest): Promise<PangeaResponse<FolderCreateResult>>

Create a folder, either by name or path and parent_id. How to install a Beta release.

required parameters

FolderCreateRequest

Response Object

Promise<PangeaResponse<FolderCreateResult>>
const request = {
  metadata: {
    created_by: "jim",
    priority: "medium",
  },
  parent_id: "pos_3djfmzg2db4c6donarecbyv5begtj2bm",
  path: "/",
  tags: ["irs_2023", "personal"],
};

const response = await client.folderCreate(request);

Get archive (Beta)

getArchive(request: GetArchiveRequest): Promise<PangeaResponse<GetArchiveResult>>

Get an archive file of multiple objects. How to install a Beta release.

required parameters

GetArchiveRequest

Response Object

Promise<PangeaResponse<GetArchiveResult>>
const request = { ids: ["pos_3djfmzg2db4c6donarecbyv5begtj2bm"] };
const response = await client.getArchive(request);

Get an object (Beta)

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. How to install a Beta release.

required parameters

GetRequest

Response Object

Promise<PangeaResponse<GetResult>>
const request = {
  id: "pos_3djfmzg2db4c6donarecbyv5begtj2bm",
  path: "/",
};

const response = await client.getItem(request);

List (Beta)

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

List or filter/search records. How to install a Beta release.

required parameters

ListRequest

Response Object

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

post(endpoint: string, data: object, options: PostOptions): Promise<PangeaResponse<R>>

POST request.

required parameters

string

Endpoint path.

object

Request body.

Additional options.

Response Object

Promise<PangeaResponse<R>>

Upload a file (Beta)

put(request: PutRequest, fileData: FileData): Promise<PangeaResponse<PutResult>>

Upload a file. How to install a Beta release.

required parameters

PutRequest
FileData

Response Object

Promise<PangeaResponse<PutResult>>
const request = {
  transfer_method: TransferMethod.MULTIPART,
  Metadata: {
    created_by: "jim",
    priority: "medium",
  },
  parent_id: "pos_3djfmzg2db4c6donarecbyv5begtj2bm",
  path: "/",
  tags: ["irs_2023", "personal"],
};
const file = fs.readFileSync("./path/to/file.pdf");
const fileData = {
  file,
  name: "file",
};

const response = await client.put(request, fileData);

Request upload URL (Beta)

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

Request a presigned URL. How to install a Beta release.

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",
  path: "/",
  tags: ["irs_2023", "personal"],
};

const response = await client.requestUploadURL(request);
shareLinkCreate(request: ShareLinkCreateRequest): Promise<PangeaResponse<ShareLinkCreateResult>>

Create a share link. How to install a Beta release.

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. How to install a Beta release.

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. How to install a Beta release.

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. How to install a Beta release.

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

Send share links. How to install a Beta release.

required parameters

ShareLinkSendRequest

Response Object

Promise<PangeaResponse<ShareLinkSendResult>>
 const resp = await client.shareLinkSend({
   links: [{
     id: linkID,
     email: "user@email.com",
   }],
   sender_email: "sender@email.com",
   sender_name: "Sender Name"

Update a file (Beta)

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

Update a file. How to install a Beta release.

required parameters

UpdateRequest

Response Object

Promise<PangeaResponse<UpdateResult>>
const request = {
  id: "pos_3djfmzg2db4c6donarecbyv5begtj2bm",
  path: "/",
  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 DeleteRequest

DeleteRequest

optional parameters

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

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.

string

A case-sensitive path to an object. Contains a sequence of path segments delimited by the the

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

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.

Interface GetRequest

GetRequest

optional parameters

string

The ID of the object to retrieve.

string

The path of the object to retrieve.

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 ID of a stored object.

string
string
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.

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.

Interface ListFilter

ListFilter

optional parameters

string

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

Interface ListRequest

ListRequest

optional parameters

ListFilter
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 hexadecimal-encoded CRC32C hash of the file data, which will be verified by the server if provided.

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 path where the file should be placed. It will auto-create directories if necessary.

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.

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>
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 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.

string

The ID of a bucket resource.

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 storage_pool_id equals this value.

Array<string>

Only records where storage_pool_id includes each substring.

Array<string>

Only records where storage_pool_id equals one of the provided substrings.

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

ShareLinkListFilter
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>
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.

Tags

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

Metadata

Set the object's metadata.

string

Set the parent (folder) of the object.

string

An alternative to ID for identifying the target file.

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.

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