Options
All
  • Public
  • Public/Protected
  • All
Menu

SDK Library

Library which allows you to fully manage signageOS applets, devices, management & monitoring using JS.

Installation and prerequisites

npm install @signageos/sdk

Environment variables

Mandatory ENV variables (when using SDK api/rest singleton - deprecated. Use factories createApiV1 or createApiV2 instead):

in .env file:

# Organization API SECURITY TOKENS
SOS_AUTH_CLIENT_ID="...OAuthClientID..."
SOS_AUTH_SECRET="...OAuthSecret..."

# Account API SECURITY TOKENS
SOS_API_IDENTIFICATION="...apiSecurityTokenID..."
SOS_API_SECURITY_TOKEN="...apiSecurityToken..."

Optional ENV variable adjustment (with default values):

# REST API URL (default to the production server)
SOS_API_URL="https://api.signageos.io"
# How many times to retry request until it fails
SOS_REQUEST_MAX_ATTEMPTS="3"

How to obtain Organization API SECURITY TOKENS

  1. Go to Box in the side menu select Organize and sub menu Organizations
  2. In organizations select your organization (or create new one)
  3. In top tabs select API tokens
  4. Click on button Add new token and generate new values
  5. Generated values can be used in .env file SOS_AUTH_CLIENT_ID is Token ID and SOS_AUTH_SECRET is Token Secret

How to obtain Account API SECURITY TOKENS

  1. Go to Box in the top navigation menu click on account icon
  2. In drop down menu select My profile
  3. Scroll to the bottom of the page, click on button Add new token and generate new values
  4. Generate values can be used in .env file SOS_API_IDENTIFICATION is Token ID and SOS_API_SECURITY_TOKEN is Token Secret

You may read articles about setting up SDK & Rest API:

Please see the .env.dist file where all mandatory ENV variables, required for SDK usage, are listed too.

REST API

Credentials in code

Just by setting ENV variables properly, you are ready to go and may use the api. If not ENV variables provided to node.js app, it tries to get values from user's ~/.sosrc which is configured by @signageos/cli dependency.

import { createApiV1 } from "@signageos/sdk";

const api = createApiV1(
    {
        url: 'https://api.signageos.io', // Optional
        organizationAuth: {
            clientId: '...OAuthClientID...',
            secret: '...OAuthSecret...',
        },
        accountAuth: {
            tokenId: '...apiSecurityTokenID...',
            token: '...apiSecurityToken...',
        },
    },
);

// retrieves the list of all devices
const devices = await api.device.list();

// ...
import { createApiV2 } from "@signageos/sdk";

const api = createApiV2(
    {
        url: 'https://api.signageos.io', // Optional
        organizationAuth: {
            clientId: '...OAuthClientID...',
            secret: '...OAuthSecret...',
        },
        accountAuth: {
            tokenId: '...apiSecurityTokenID...',
            token: '...apiSecurityToken...',
        },
    },
);

// retrieves the list of all devices
const devices = await api.device.list();

// ...

Credentials from ENV Variables

import { createApiV1 } from "@signageos/sdk";

// takes parameters from env vars
const api = createApiV1();

// retrieves the list of all devices
const devices = await api.device.list();

// ...
import { createApiV2 } from "@signageos/sdk";

// takes parameters from env vars
const api = createApiV2();

// retrieves the list of all devices
const devices = await api.device.list();

// ...

Documentation

The complete SDK documentation may be generated by typedoc by running the command:

$ npm i && npm run docs

Once generated, the docs directory will contain the generated documentation.

The most useful documentation pages:

Development

Running the tests

Setup env variables:

SOS_ORGANIZATION_UID=[ORGANIZATION_UID] // Add `organizationUid` on which will be the tests running

This SDK library contains several unit and integration tests, You may locate inside the sdk root directory and run npm run test or npm run test-integration command.

If you properly configured all the mandatory environment variables either in .env file inside the sdk root or on your machine, and you set
the integration tests will be launched too. Otherwise only unit test would be run and integrations tests would be skipped.

Tip: you may use existing .env.dist file for creating the .env.

Index

Namespaces

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

Address

Address: string

AlertType

AlertType: "DEVICE" | "POLICY" | "APPLET"

ApplicationType

ApplicationType: typeof ApplicationTypes[number]

BillingPlan

BillingPlan: "open" | "medium" | "enterprise"

Coordinates

Coordinates: { lat: number; long: number }

Type declaration

  • lat: number
  • long: number

IAppletVersionFile

IAppletVersionFile: Partial<IAppletVersionFileCreatable> & Pick<IAppletVersionFileCreatable, "name" | "path">

IAuthLikeOptions

IAuthLikeOptions: IAuthOptions | (() => Promise<IAuthOptions>)

IBulkOperationAlias

IBulkOperationAlias: IBulkOperation<DeviceActionType>

ILogOperations

ILogOperations: { getAll: any }

Type declaration

  • getAll: function
    • getAll(since?: Date): Promise<string[]>
    • Parameters

      • Optional since: Date

      Returns Promise<string[]>

IVideoOperations

IVideoOperations: { getAll: any }

Type declaration

  • getAll: function
    • getAll(since?: Date): Promise<IVideoProperties[]>
    • Parameters

      • Optional since: Date

      Returns Promise<IVideoProperties[]>

LogData

LogData: { [DeviceTelemetryType.APPLICATION_VERSION]: { version: string; versionNumber?: undefined | number }; [DeviceTelemetryType.AUTO_RECOVERY]: { enabled: true; healthcheckIntervalMs: number }; [DeviceTelemetryType.BRIGHTNESS]: { brightness: number }; [DeviceTelemetryType.BUNDLED_APPLET]: { appletUid: string; appletVersion: string; config: {} }; [DeviceTelemetryType.DATETIME]: { ntpServer: string | null; timezone: string | null }; [DeviceTelemetryType.DEBUG]: { appletEnabled: boolean; nativeEnabled: boolean }; [DeviceTelemetryType.DISPLAY_SETTING]: { backlight: number; contrast: number; maxTemperature: number; sharpness: number }; [DeviceTelemetryType.FIRMWARE_VERSION]: { version: string }; [DeviceTelemetryType.FRONT_CAPABILITIES]: { capable: FrontCapabilities[] }; [DeviceTelemetryType.INPUT_SOURCE]: { inputSource: InputSource | string }; [DeviceTelemetryType.MANAGEMENT_CAPABILITIES]: { capable: ManagementCapabilities[] }; [DeviceTelemetryType.OFFLINE_RANGE]: { since: Date; until: Date }; [DeviceTelemetryType.ONLINE_STATUS]: { online: boolean }; [DeviceTelemetryType.ORIENTATION]: { orientation: DeviceOrientation; videoOrientation?: DeviceVideoOrientation }; [DeviceTelemetryType.PEER_RECOVERY]: { enabled: false } | { enabled: true; healthcheckIntervalMs: number }; [DeviceTelemetryType.POWER_ACTIONS_SCHEDULE]: IPowerActionsScheduleSettings[]; [DeviceTelemetryType.PROPRIETARY_TIMERS]: ITimerSettings[]; [DeviceTelemetryType.REMOTE_CONTROL]: { enabled: boolean }; [DeviceTelemetryType.RESOLUTION]: TResolutionItem; [DeviceTelemetryType.TEMPERATURE]: { temperature: number }; [DeviceTelemetryType.TIMERS]: ITimerSettings[]; [DeviceTelemetryType.VOLUME]: { volume: number } }

Type declaration

  • [DeviceTelemetryType.APPLICATION_VERSION]: { version: string; versionNumber?: undefined | number }
    • version: string
    • Optional versionNumber?: undefined | number
      deprecated

      It's only available in mongodb database for filtering purposes

  • [DeviceTelemetryType.AUTO_RECOVERY]: { enabled: true; healthcheckIntervalMs: number }
    • enabled: true
    • healthcheckIntervalMs: number
  • [DeviceTelemetryType.BRIGHTNESS]: { brightness: number }
    • brightness: number
  • [DeviceTelemetryType.BUNDLED_APPLET]: { appletUid: string; appletVersion: string; config: {} }
    • appletUid: string
    • appletVersion: string
    • config: {}
      • [key: string]: string
  • [DeviceTelemetryType.DATETIME]: { ntpServer: string | null; timezone: string | null }
    • ntpServer: string | null
    • timezone: string | null
  • [DeviceTelemetryType.DEBUG]: { appletEnabled: boolean; nativeEnabled: boolean }
    • appletEnabled: boolean
    • nativeEnabled: boolean
  • [DeviceTelemetryType.DISPLAY_SETTING]: { backlight: number; contrast: number; maxTemperature: number; sharpness: number }
    • backlight: number
    • contrast: number
    • maxTemperature: number
    • sharpness: number
  • [DeviceTelemetryType.FIRMWARE_VERSION]: { version: string }
    • version: string
  • [DeviceTelemetryType.FRONT_CAPABILITIES]: { capable: FrontCapabilities[] }
  • [DeviceTelemetryType.INPUT_SOURCE]: { inputSource: InputSource | string }
    • inputSource: InputSource | string

      It may be arbitrary platform-dependent string but common values are listed in enumeration.

  • [DeviceTelemetryType.MANAGEMENT_CAPABILITIES]: { capable: ManagementCapabilities[] }
  • [DeviceTelemetryType.OFFLINE_RANGE]: { since: Date; until: Date }
    • since: Date
    • until: Date
  • [DeviceTelemetryType.ONLINE_STATUS]: { online: boolean }
    • online: boolean
  • [DeviceTelemetryType.ORIENTATION]: { orientation: DeviceOrientation; videoOrientation?: DeviceVideoOrientation }
  • [DeviceTelemetryType.PEER_RECOVERY]: { enabled: false } | { enabled: true; healthcheckIntervalMs: number }
  • [DeviceTelemetryType.POWER_ACTIONS_SCHEDULE]: IPowerActionsScheduleSettings[]
  • [DeviceTelemetryType.PROPRIETARY_TIMERS]: ITimerSettings[]
  • [DeviceTelemetryType.REMOTE_CONTROL]: { enabled: boolean }
    • enabled: boolean
  • [DeviceTelemetryType.RESOLUTION]: TResolutionItem
  • [DeviceTelemetryType.TEMPERATURE]: { temperature: number }
    • temperature: number
  • [DeviceTelemetryType.TIMERS]: ITimerSettings[]
  • [DeviceTelemetryType.VOLUME]: { volume: number }
    • volume: number

NumericOperator

NumericOperator: ">" | "<" | "<=" | ">=" | "=" | "!="

ParseObject

ParseObject: typeof IAppletVersionFile

ResolutionItem

ResolutionItem: { framerate?: undefined | number; height: number; width: number }

Type declaration

  • Optional framerate?: undefined | number
  • height: number
  • width: number

SemverOperator

SemverOperator: NumericOperator

SnoozeRule

StorageType

StorageType: "s3"

SubscriptionType

SubscriptionType: "open" | "basic" | "medium" | "all"

TPagination

TPagination: ILinkPagination

TResolutionItem

TResolutionItem: { framerate?: undefined | number; height: number; width: number }

Type declaration

  • Optional framerate?: undefined | number
  • height: number
  • width: number

TTelemetries

TTelemetries: {}

Type declaration

TTelemetriesByDevice

TTelemetriesByDevice: { createdAt: IDevice["createdAt"]; deviceUid: IDevice["uid"]; telemetries: TTelemetries }

Type declaration

  • createdAt: IDevice["createdAt"]
  • deviceUid: IDevice["uid"]
  • telemetries: TTelemetries

Variables

Const ApplicationTypes

ApplicationTypes: ["sssp", "tizen", "webos", "android", "chrome", "brightsign", "linux", "windows", "default"] = ['sssp','tizen','webos','android','chrome','brightsign','linux','windows','default',] as const

Const IAppletVersionFile

IAppletVersionFile: "applet.version.file" = "applet.version.file"

Const RESOURCE

RESOURCE: string = `device/verification`

Const apiUrl

apiUrl: undefined | string = process.env.SOS_API_URL

Const debug

debug: Debugger = Debug('@signageos/sdk:RestApi:requester')

Const distPath

distPath: string = rootPath + '/dist'

Const environment

environment: string = process.env.NODE_ENV || 'dev'

Const packageConfig

packageConfig: any = require('../package.json')

Const path

path: any = require('path')

Const requestMaxAttempts

requestMaxAttempts: number = process.env.SOS_REQUEST_MAX_ATTEMPTS ? parseInt(process.env.SOS_REQUEST_MAX_ATTEMPTS) : 3

Const rootPath

rootPath: any = path.normalize(path.join(__dirname, '..'))

Const testsPath

testsPath: string = rootPath + '/tests'

Const videoStates

videoStates: VideoStateChanged["state"][] = ['play', 'stop', 'pause', 'ended', 'error']

Functions

Const checkAppletVersionCreatable

  • Parameters

    Returns void

Const checkAppletVersionUpdatable

  • Parameters

    Returns void

createDefaultParser

  • createDefaultParser(): (Anonymous function)
  • Returns (Anonymous function)

createOptions

  • createOptions(method: "POST" | "GET" | "PUT" | "DELETE", options: IOptions, data?: BodyInit | Buffer): Promise<RequestInit>
  • Parameters

    • method: "POST" | "GET" | "PUT" | "DELETE"
    • options: IOptions
    • Optional data: BodyInit | Buffer

    Returns Promise<RequestInit>

createS3ResponseParser

  • createS3ResponseParser(parse: ParseObject): (Anonymous function) | (Anonymous function)
  • Parameters

    Returns (Anonymous function) | (Anonymous function)

createStorageResponseParser

  • createStorageResponseParser(storage: StorageType, parse: ParseObject): (Anonymous function) | (Anonymous function)
  • Parameters

    Returns (Anonymous function) | (Anonymous function)

createUri

  • createUri(options: IOptions, resource: string, queryParams?: any): string
  • Parameters

    • options: IOptions
    • resource: string
    • Optional queryParams: any

    Returns string

createUserAgent

  • createUserAgent(options: IOptions): string
  • Parameters

    Returns string

deleteResource

  • deleteResource(options: IOptions, path: string, query?: any): Promise<Response>
  • Parameters

    • options: IOptions
    • path: string
    • Optional query: any

    Returns Promise<Response>

deserializeJSON

  • deserializeJSON(_key: string, value: any): any
  • Parameters

    • _key: string
    • value: any

    Returns any

doFetch

  • doFetch(url: string | Request, init?: RequestInit): Promise<Response>
  • Parameters

    • url: string | Request
    • Optional init: RequestInit

    Returns Promise<Response>

doRequest

  • doRequest(url: string | Request, init?: RequestInit, fetchFn?: (url: string | Request, init?: RequestInit) => Promise<Response>, waitFn?: (timeout: number) => Promise<void>): Promise<Response>
  • Parameters

    • url: string | Request
    • Optional init: RequestInit
    • Default value fetchFn: (url: string | Request, init?: RequestInit) => Promise<Response> = doFetch
        • (url: string | Request, init?: RequestInit): Promise<Response>
        • Parameters

          • url: string | Request
          • Optional init: RequestInit

          Returns Promise<Response>

    • Default value waitFn: (timeout: number) => Promise<void> = wait
        • (timeout: number): Promise<void>
        • Parameters

          • timeout: number

          Returns Promise<void>

    Returns Promise<Response>

fillDataToEntity

  • fillDataToEntity<T>(entity: T & { constructor: Function }, data: T): void
  • Type parameters

    • T

    Parameters

    • entity: T & { constructor: Function }
    • data: T

    Returns void

Const getAttachmentExtension

  • getAttachmentExtension(file: Buffer): Promise<undefined | "it" | "png" | "apng" | "gif" | "webp" | "flif" | "xcf" | "cr2" | "cr3" | "orf" | "arw" | "dng" | "nef" | "rw2" | "raf" | "tif" | "bmp" | "icns" | "jxr" | "psd" | "indd" | "zip" | "tar" | "rar" | "gz" | "bz2" | "7z" | "dmg" | "mp4" | "mid" | "mkv" | "webm" | "mov" | "avi" | "mpg" | "mp2" | "mp3" | "m4a" | "ogg" | "opus" | "flac" | "wav" | "qcp" | "amr" | "pdf" | "epub" | "mobi" | "exe" | "swf" | "rtf" | "woff" | "woff2" | "eot" | "ttf" | "otf" | "ico" | "flv" | "ps" | "xz" | "sqlite" | "nes" | "crx" | "xpi" | "cab" | "deb" | "ar" | "rpm" | "Z" | "lz" | "cfb" | "mxf" | "mts" | "wasm" | "blend" | "bpg" | "docx" | "pptx" | "xlsx" | "3gp" | "3g2" | "jp2" | "jpm" | "jpx" | "mj2" | "aif" | "odt" | "ods" | "odp" | "xml" | "heic" | "cur" | "ktx" | "ape" | "wv" | "asf" | "dcm" | "mpc" | "ics" | "glb" | "pcap" | "dsf" | "lnk" | "alias" | "voc" | "ac3" | "m4b" | "m4p" | "m4v" | "f4a" | "f4b" | "f4p" | "f4v" | "mie" | "ogv" | "ogm" | "oga" | "spx" | "ogx" | "arrow" | "shp" | "aac" | "mp1" | "s3m" | "xm" | "ai" | "skp" | "avif" | "eps" | "lzh" | "pgp" | "asar" | "stl" | "chm" | "3mf" | "zst" | "jxl" | "vcf" | "image/jpeg" | "image/png" | "image/gif" | "image/webp" | "image/flif" | "image/x-xcf" | "image/x-canon-cr2" | "image/x-canon-cr3" | "image/tiff" | "image/bmp" | "image/icns" | "image/vnd.ms-photo" | "image/vnd.adobe.photoshop" | "application/x-indesign" | "application/epub+zip" | "application/x-xpinstall" | "application/vnd.oasis.opendocument.text" | "application/vnd.oasis.opendocument.spreadsheet" | "application/vnd.oasis.opendocument.presentation" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/zip" | "application/x-tar" | "application/x-rar-compressed" | "application/gzip" | "application/x-bzip2" | "application/x-7z-compressed" | "application/x-apple-diskimage" | "video/mp4" | "audio/midi" | "video/x-matroska" | "video/webm" | "video/quicktime" | "video/vnd.avi" | "audio/vnd.wave" | "audio/qcelp" | "audio/x-ms-asf" | "video/x-ms-asf" | "application/vnd.ms-asf" | "video/mpeg" | "video/3gpp" | "audio/mpeg" | "audio/mp4" | "audio/opus" | "video/ogg" | "audio/ogg" | "application/ogg" | "audio/x-flac" | "audio/ape" | "audio/wavpack" | "audio/amr" | "application/pdf" | "application/x-msdownload" | "application/x-shockwave-flash" | "application/rtf" | "application/wasm" | "font/woff" | "font/woff2" | "application/vnd.ms-fontobject" | "font/ttf" | "font/otf" | "image/x-icon" | "video/x-flv" | "application/postscript" | "application/eps" | "application/x-xz" | "application/x-sqlite3" | "application/x-nintendo-nes-rom" | "application/x-google-chrome-extension" | "application/vnd.ms-cab-compressed" | "application/x-deb" | "application/x-unix-archive" | "application/x-rpm" | "application/x-compress" | "application/x-lzip" | "application/x-cfb" | "application/x-mie" | "application/x-apache-arrow" | "application/mxf" | "video/mp2t" | "application/x-blender" | "image/bpg" | "image/jp2" | "image/jpx" | "image/jpm" | "image/mj2" | "audio/aiff" | "application/xml" | "application/x-mobipocket-ebook" | "image/heif" | "image/heif-sequence" | "image/heic" | "image/heic-sequence" | "image/ktx" | "application/dicom" | "audio/x-musepack" | "text/calendar" | "text/vcard" | "model/gltf-binary" | "application/vnd.tcpdump.pcap" | "audio/x-dsf" | "application/x.ms.shortcut" | "application/x.apple.alias" | "audio/x-voc" | "audio/vnd.dolby.dd-raw" | "audio/x-m4a" | "image/apng" | "image/x-olympus-orf" | "image/x-sony-arw" | "image/x-adobe-dng" | "image/x-nikon-nef" | "image/x-panasonic-rw2" | "image/x-fujifilm-raf" | "video/x-m4v" | "video/3gpp2" | "application/x-esri-shape" | "audio/aac" | "audio/x-it" | "audio/x-s3m" | "audio/x-xm" | "video/MP1S" | "video/MP2P" | "application/vnd.sketchup.skp" | "image/avif" | "application/x-lzh-compressed" | "application/pgp-encrypted" | "application/x-asar" | "model/stl" | "application/vnd.ms-htmlhelp" | "model/3mf" | "image/jxl" | "application/zstd" | "jpeg">
  • Parameters

    • file: Buffer

    Returns Promise<undefined | "it" | "png" | "apng" | "gif" | "webp" | "flif" | "xcf" | "cr2" | "cr3" | "orf" | "arw" | "dng" | "nef" | "rw2" | "raf" | "tif" | "bmp" | "icns" | "jxr" | "psd" | "indd" | "zip" | "tar" | "rar" | "gz" | "bz2" | "7z" | "dmg" | "mp4" | "mid" | "mkv" | "webm" | "mov" | "avi" | "mpg" | "mp2" | "mp3" | "m4a" | "ogg" | "opus" | "flac" | "wav" | "qcp" | "amr" | "pdf" | "epub" | "mobi" | "exe" | "swf" | "rtf" | "woff" | "woff2" | "eot" | "ttf" | "otf" | "ico" | "flv" | "ps" | "xz" | "sqlite" | "nes" | "crx" | "xpi" | "cab" | "deb" | "ar" | "rpm" | "Z" | "lz" | "cfb" | "mxf" | "mts" | "wasm" | "blend" | "bpg" | "docx" | "pptx" | "xlsx" | "3gp" | "3g2" | "jp2" | "jpm" | "jpx" | "mj2" | "aif" | "odt" | "ods" | "odp" | "xml" | "heic" | "cur" | "ktx" | "ape" | "wv" | "asf" | "dcm" | "mpc" | "ics" | "glb" | "pcap" | "dsf" | "lnk" | "alias" | "voc" | "ac3" | "m4b" | "m4p" | "m4v" | "f4a" | "f4b" | "f4p" | "f4v" | "mie" | "ogv" | "ogm" | "oga" | "spx" | "ogx" | "arrow" | "shp" | "aac" | "mp1" | "s3m" | "xm" | "ai" | "skp" | "avif" | "eps" | "lzh" | "pgp" | "asar" | "stl" | "chm" | "3mf" | "zst" | "jxl" | "vcf" | "image/jpeg" | "image/png" | "image/gif" | "image/webp" | "image/flif" | "image/x-xcf" | "image/x-canon-cr2" | "image/x-canon-cr3" | "image/tiff" | "image/bmp" | "image/icns" | "image/vnd.ms-photo" | "image/vnd.adobe.photoshop" | "application/x-indesign" | "application/epub+zip" | "application/x-xpinstall" | "application/vnd.oasis.opendocument.text" | "application/vnd.oasis.opendocument.spreadsheet" | "application/vnd.oasis.opendocument.presentation" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/zip" | "application/x-tar" | "application/x-rar-compressed" | "application/gzip" | "application/x-bzip2" | "application/x-7z-compressed" | "application/x-apple-diskimage" | "video/mp4" | "audio/midi" | "video/x-matroska" | "video/webm" | "video/quicktime" | "video/vnd.avi" | "audio/vnd.wave" | "audio/qcelp" | "audio/x-ms-asf" | "video/x-ms-asf" | "application/vnd.ms-asf" | "video/mpeg" | "video/3gpp" | "audio/mpeg" | "audio/mp4" | "audio/opus" | "video/ogg" | "audio/ogg" | "application/ogg" | "audio/x-flac" | "audio/ape" | "audio/wavpack" | "audio/amr" | "application/pdf" | "application/x-msdownload" | "application/x-shockwave-flash" | "application/rtf" | "application/wasm" | "font/woff" | "font/woff2" | "application/vnd.ms-fontobject" | "font/ttf" | "font/otf" | "image/x-icon" | "video/x-flv" | "application/postscript" | "application/eps" | "application/x-xz" | "application/x-sqlite3" | "application/x-nintendo-nes-rom" | "application/x-google-chrome-extension" | "application/vnd.ms-cab-compressed" | "application/x-deb" | "application/x-unix-archive" | "application/x-rpm" | "application/x-compress" | "application/x-lzip" | "application/x-cfb" | "application/x-mie" | "application/x-apache-arrow" | "application/mxf" | "video/mp2t" | "application/x-blender" | "image/bpg" | "image/jp2" | "image/jpx" | "image/jpm" | "image/mj2" | "audio/aiff" | "application/xml" | "application/x-mobipocket-ebook" | "image/heif" | "image/heif-sequence" | "image/heic" | "image/heic-sequence" | "image/ktx" | "application/dicom" | "audio/x-musepack" | "text/calendar" | "text/vcard" | "model/gltf-binary" | "application/vnd.tcpdump.pcap" | "audio/x-dsf" | "application/x.ms.shortcut" | "application/x.apple.alias" | "audio/x-voc" | "audio/vnd.dolby.dd-raw" | "audio/x-m4a" | "image/apng" | "image/x-olympus-orf" | "image/x-sony-arw" | "image/x-adobe-dng" | "image/x-nikon-nef" | "image/x-panasonic-rw2" | "image/x-fujifilm-raf" | "video/x-m4v" | "video/3gpp2" | "application/x-esri-shape" | "audio/aac" | "audio/x-it" | "audio/x-s3m" | "audio/x-xm" | "video/MP1S" | "video/MP2P" | "application/vnd.sketchup.skp" | "image/avif" | "application/x-lzh-compressed" | "application/pgp-encrypted" | "application/x-asar" | "model/stl" | "application/vnd.ms-htmlhelp" | "model/3mf" | "image/jxl" | "application/zstd" | "jpeg">

Const getFileExtension

  • getFileExtension(file: Buffer): Promise<undefined | "it" | "jpg" | "png" | "apng" | "gif" | "webp" | "flif" | "xcf" | "cr2" | "cr3" | "orf" | "arw" | "dng" | "nef" | "rw2" | "raf" | "tif" | "bmp" | "icns" | "jxr" | "psd" | "indd" | "zip" | "tar" | "rar" | "gz" | "bz2" | "7z" | "dmg" | "mp4" | "mid" | "mkv" | "webm" | "mov" | "avi" | "mpg" | "mp2" | "mp3" | "m4a" | "ogg" | "opus" | "flac" | "wav" | "qcp" | "amr" | "pdf" | "epub" | "mobi" | "exe" | "swf" | "rtf" | "woff" | "woff2" | "eot" | "ttf" | "otf" | "ico" | "flv" | "ps" | "xz" | "sqlite" | "nes" | "crx" | "xpi" | "cab" | "deb" | "ar" | "rpm" | "Z" | "lz" | "cfb" | "mxf" | "mts" | "wasm" | "blend" | "bpg" | "docx" | "pptx" | "xlsx" | "3gp" | "3g2" | "jp2" | "jpm" | "jpx" | "mj2" | "aif" | "odt" | "ods" | "odp" | "xml" | "heic" | "cur" | "ktx" | "ape" | "wv" | "asf" | "dcm" | "mpc" | "ics" | "glb" | "pcap" | "dsf" | "lnk" | "alias" | "voc" | "ac3" | "m4b" | "m4p" | "m4v" | "f4a" | "f4b" | "f4p" | "f4v" | "mie" | "ogv" | "ogm" | "oga" | "spx" | "ogx" | "arrow" | "shp" | "aac" | "mp1" | "s3m" | "xm" | "ai" | "skp" | "avif" | "eps" | "lzh" | "pgp" | "asar" | "stl" | "chm" | "3mf" | "zst" | "jxl" | "vcf" | "image/jpeg" | "image/png" | "image/gif" | "image/webp" | "image/flif" | "image/x-xcf" | "image/x-canon-cr2" | "image/x-canon-cr3" | "image/tiff" | "image/bmp" | "image/icns" | "image/vnd.ms-photo" | "image/vnd.adobe.photoshop" | "application/x-indesign" | "application/epub+zip" | "application/x-xpinstall" | "application/vnd.oasis.opendocument.text" | "application/vnd.oasis.opendocument.spreadsheet" | "application/vnd.oasis.opendocument.presentation" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/zip" | "application/x-tar" | "application/x-rar-compressed" | "application/gzip" | "application/x-bzip2" | "application/x-7z-compressed" | "application/x-apple-diskimage" | "video/mp4" | "audio/midi" | "video/x-matroska" | "video/webm" | "video/quicktime" | "video/vnd.avi" | "audio/vnd.wave" | "audio/qcelp" | "audio/x-ms-asf" | "video/x-ms-asf" | "application/vnd.ms-asf" | "video/mpeg" | "video/3gpp" | "audio/mpeg" | "audio/mp4" | "audio/opus" | "video/ogg" | "audio/ogg" | "application/ogg" | "audio/x-flac" | "audio/ape" | "audio/wavpack" | "audio/amr" | "application/pdf" | "application/x-msdownload" | "application/x-shockwave-flash" | "application/rtf" | "application/wasm" | "font/woff" | "font/woff2" | "application/vnd.ms-fontobject" | "font/ttf" | "font/otf" | "image/x-icon" | "video/x-flv" | "application/postscript" | "application/eps" | "application/x-xz" | "application/x-sqlite3" | "application/x-nintendo-nes-rom" | "application/x-google-chrome-extension" | "application/vnd.ms-cab-compressed" | "application/x-deb" | "application/x-unix-archive" | "application/x-rpm" | "application/x-compress" | "application/x-lzip" | "application/x-cfb" | "application/x-mie" | "application/x-apache-arrow" | "application/mxf" | "video/mp2t" | "application/x-blender" | "image/bpg" | "image/jp2" | "image/jpx" | "image/jpm" | "image/mj2" | "audio/aiff" | "application/xml" | "application/x-mobipocket-ebook" | "image/heif" | "image/heif-sequence" | "image/heic" | "image/heic-sequence" | "image/ktx" | "application/dicom" | "audio/x-musepack" | "text/calendar" | "text/vcard" | "model/gltf-binary" | "application/vnd.tcpdump.pcap" | "audio/x-dsf" | "application/x.ms.shortcut" | "application/x.apple.alias" | "audio/x-voc" | "audio/vnd.dolby.dd-raw" | "audio/x-m4a" | "image/apng" | "image/x-olympus-orf" | "image/x-sony-arw" | "image/x-adobe-dng" | "image/x-nikon-nef" | "image/x-panasonic-rw2" | "image/x-fujifilm-raf" | "video/x-m4v" | "video/3gpp2" | "application/x-esri-shape" | "audio/aac" | "audio/x-it" | "audio/x-s3m" | "audio/x-xm" | "video/MP1S" | "video/MP2P" | "application/vnd.sketchup.skp" | "image/avif" | "application/x-lzh-compressed" | "application/pgp-encrypted" | "application/x-asar" | "model/stl" | "application/vnd.ms-htmlhelp" | "model/3mf" | "image/jxl" | "application/zstd">
  • Parameters

    • file: Buffer

    Returns Promise<undefined | "it" | "jpg" | "png" | "apng" | "gif" | "webp" | "flif" | "xcf" | "cr2" | "cr3" | "orf" | "arw" | "dng" | "nef" | "rw2" | "raf" | "tif" | "bmp" | "icns" | "jxr" | "psd" | "indd" | "zip" | "tar" | "rar" | "gz" | "bz2" | "7z" | "dmg" | "mp4" | "mid" | "mkv" | "webm" | "mov" | "avi" | "mpg" | "mp2" | "mp3" | "m4a" | "ogg" | "opus" | "flac" | "wav" | "qcp" | "amr" | "pdf" | "epub" | "mobi" | "exe" | "swf" | "rtf" | "woff" | "woff2" | "eot" | "ttf" | "otf" | "ico" | "flv" | "ps" | "xz" | "sqlite" | "nes" | "crx" | "xpi" | "cab" | "deb" | "ar" | "rpm" | "Z" | "lz" | "cfb" | "mxf" | "mts" | "wasm" | "blend" | "bpg" | "docx" | "pptx" | "xlsx" | "3gp" | "3g2" | "jp2" | "jpm" | "jpx" | "mj2" | "aif" | "odt" | "ods" | "odp" | "xml" | "heic" | "cur" | "ktx" | "ape" | "wv" | "asf" | "dcm" | "mpc" | "ics" | "glb" | "pcap" | "dsf" | "lnk" | "alias" | "voc" | "ac3" | "m4b" | "m4p" | "m4v" | "f4a" | "f4b" | "f4p" | "f4v" | "mie" | "ogv" | "ogm" | "oga" | "spx" | "ogx" | "arrow" | "shp" | "aac" | "mp1" | "s3m" | "xm" | "ai" | "skp" | "avif" | "eps" | "lzh" | "pgp" | "asar" | "stl" | "chm" | "3mf" | "zst" | "jxl" | "vcf" | "image/jpeg" | "image/png" | "image/gif" | "image/webp" | "image/flif" | "image/x-xcf" | "image/x-canon-cr2" | "image/x-canon-cr3" | "image/tiff" | "image/bmp" | "image/icns" | "image/vnd.ms-photo" | "image/vnd.adobe.photoshop" | "application/x-indesign" | "application/epub+zip" | "application/x-xpinstall" | "application/vnd.oasis.opendocument.text" | "application/vnd.oasis.opendocument.spreadsheet" | "application/vnd.oasis.opendocument.presentation" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/zip" | "application/x-tar" | "application/x-rar-compressed" | "application/gzip" | "application/x-bzip2" | "application/x-7z-compressed" | "application/x-apple-diskimage" | "video/mp4" | "audio/midi" | "video/x-matroska" | "video/webm" | "video/quicktime" | "video/vnd.avi" | "audio/vnd.wave" | "audio/qcelp" | "audio/x-ms-asf" | "video/x-ms-asf" | "application/vnd.ms-asf" | "video/mpeg" | "video/3gpp" | "audio/mpeg" | "audio/mp4" | "audio/opus" | "video/ogg" | "audio/ogg" | "application/ogg" | "audio/x-flac" | "audio/ape" | "audio/wavpack" | "audio/amr" | "application/pdf" | "application/x-msdownload" | "application/x-shockwave-flash" | "application/rtf" | "application/wasm" | "font/woff" | "font/woff2" | "application/vnd.ms-fontobject" | "font/ttf" | "font/otf" | "image/x-icon" | "video/x-flv" | "application/postscript" | "application/eps" | "application/x-xz" | "application/x-sqlite3" | "application/x-nintendo-nes-rom" | "application/x-google-chrome-extension" | "application/vnd.ms-cab-compressed" | "application/x-deb" | "application/x-unix-archive" | "application/x-rpm" | "application/x-compress" | "application/x-lzip" | "application/x-cfb" | "application/x-mie" | "application/x-apache-arrow" | "application/mxf" | "video/mp2t" | "application/x-blender" | "image/bpg" | "image/jp2" | "image/jpx" | "image/jpm" | "image/mj2" | "audio/aiff" | "application/xml" | "application/x-mobipocket-ebook" | "image/heif" | "image/heif-sequence" | "image/heic" | "image/heic-sequence" | "image/ktx" | "application/dicom" | "audio/x-musepack" | "text/calendar" | "text/vcard" | "model/gltf-binary" | "application/vnd.tcpdump.pcap" | "audio/x-dsf" | "application/x.ms.shortcut" | "application/x.apple.alias" | "audio/x-voc" | "audio/vnd.dolby.dd-raw" | "audio/x-m4a" | "image/apng" | "image/x-olympus-orf" | "image/x-sony-arw" | "image/x-adobe-dng" | "image/x-nikon-nef" | "image/x-panasonic-rw2" | "image/x-fujifilm-raf" | "video/x-m4v" | "video/3gpp2" | "application/x-esri-shape" | "audio/aac" | "audio/x-it" | "audio/x-s3m" | "audio/x-xm" | "video/MP1S" | "video/MP2P" | "application/vnd.sketchup.skp" | "image/avif" | "application/x-lzh-compressed" | "application/pgp-encrypted" | "application/x-asar" | "model/stl" | "application/vnd.ms-htmlhelp" | "model/3mf" | "image/jxl" | "application/zstd">

getResource

  • getResource(options: IOptions, path: string, query?: any): Promise<Response>
  • Parameters

    • options: IOptions
    • path: string
    • Optional query: any

    Returns Promise<Response>

parseJSON

  • parseJSON(text: string): Promise<any>
  • Parameters

    • text: string

    Returns Promise<any>

parseJSONResponse

  • parseJSONResponse(resp: Response): Promise<any>
  • Parameters

    • resp: Response

    Returns Promise<any>

parseStorageResponse

postResource

  • postResource(options: IOptions, path: string, data: any, query?: any): Promise<Response>
  • Parameters

    • options: IOptions
    • path: string
    • data: any
    • Optional query: any

    Returns Promise<Response>

postStorage

  • postStorage(url: string | Request, fields: any, data: ReadableStream, size: number): Promise<Response>
  • Parameters

    • url: string | Request
    • fields: any
    • data: ReadableStream
    • size: number

    Returns Promise<Response>

prepareQueryParams

  • prepareQueryParams(qp: any): string
  • Parameters

    • qp: any

    Returns string

putResource

  • putResource(options: IOptions, path: string, data: any, query?: any): Promise<Response>
  • Parameters

    • options: IOptions
    • path: string
    • data: any
    • Optional query: any

    Returns Promise<Response>

wait

  • wait(timeout: number): Promise<void>
  • Parameters

    • timeout: number

    Returns Promise<void>

Object literals

Const parameters

parameters: object

accountAuth

accountAuth: undefined | { token: string; tokenId: string } = process.env.SOS_API_IDENTIFICATION && process.env.SOS_API_SECURITY_TOKEN ? {tokenId: process.env.SOS_API_IDENTIFICATION,token: process.env.SOS_API_SECURITY_TOKEN,} : undefined

apiUrl

apiUrl: string

configPath

configPath: string = __dirname

environment

environment: string

organizationAuth

organizationAuth: undefined | { clientId: string; secret: string } = process.env.SOS_AUTH_CLIENT_ID && process.env.SOS_AUTH_SECRET ? {clientId: process.env.SOS_AUTH_CLIENT_ID,secret: process.env.SOS_AUTH_SECRET,} : undefined

organizationUid

organizationUid: undefined | string = process.env.SOS_ORGANIZATION_UID

requestMaxAttempts

requestMaxAttempts: number

version

version: any = packageConfig.version

paths

paths: object

distPath

distPath: string

rootPath

rootPath: any

testsPath

testsPath: string

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Private property
  • Private method
  • Protected property
  • Static property

Generated using TypeDoc