Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

test-celitech-liblab

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

test-celitech-liblab

Celitech - Welcome to the CELITECH API documentation! Useful links: [Homepage](https://www.celitech.com) | [Support email](mailto:support@celitech.com) | [Blog](https://www.celitech.com/blog/) # Introduction This guide is your go-to resource for the CE

  • 1.0.8
  • unpublished
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Celitech Typescript SDK 1.0.8

The Typescript SDK for Celitech.

  • API version: 1.0.8
  • SDK version: 1.0.8

Table of Contents

  • About the API
  • Installation
  • Environment Variables
  • API Endpoint Services
  • API Models
  • Sample Usage
  • Environments
  • Celitech Services
  • License

About the API

Welcome to the CELITECH API documentation! Useful links: Homepage | Support email | Blog # Introduction This guide is your go-to resource for the CELITECH API, with full documentation and schemas. Need help? Email us at support@celitech.com. Partners refers to online service providers that use our eSIM API. Access levels include Gold, Platinum, and Diamond. ## API The CELITECH API is designed for use by partner platforms, including both web and mobile applications. It's assumed all endpoint calls are initiated from the backend of an integrated platform. API URL: https://api.celitech.net/v1 ## Authentication & Authorization CELITECH API uses the OAuth 2.0 protocol for authentication and authorization. The endpoints are protected using client credentials flow which is based on a token exchange. The token has a defined life span (typically 1 hour), after which a new token must be obtained. To begin, obtain OAuth 2.0 client credentials ( CLIENT_ID & CLIENT_SECRET ) from the CELITECH Dashboard. Then your client application requests an access token from the CELITECH Authorization Server, extracts a token from the response, and sends the token to the CELITECH API that you want to access. Security Scheme Type: OAuth2 Flow type: clientCredentials Token URL: https://auth.celitech.net/oauth2/token

Installation

npm install test-celitech-liblab  

Environment Variables

You will need the following environment variables in order to access all the features of this SDK:

NameDescription
CLIENT_IDClient ID parameter
CLIENT_SECRETClient Secret parameter

You can set these environment variables on the command line or you can use whatever tooling your project has in place to manage environment variables. If you are using a .env file, we have provided a template with the variable names in the .env.example file in the same directory as this readme.

Sample Usage

Here is a simple program demonstrating usage of this SDK. It can also be found in the examples/src/index.ts file in this directory.

When running the sample make sure to use npm install to install all the dependencies.

import { Celitech } from 'test-celitech-liblab';


const sdk = new Celitech();

(async () => {
  const result = await sdk.destinations
    .listDestinations();
  console.log(result);
})();
 

Environments

Here is the list of all available environments:

DEFAULT = 'https://tshnuiufz7.execute-api.us-east-1.amazonaws.com/test',
TOKEN_SERVER = 'https://test-core-partners.auth.us-east-1.amazoncognito.com/oauth2/token',
PRODUCTION = 'https://tshnuiufz7.execute-api.us-east-1.amazonaws.com/test'

How to set the environment:

const sdk = new Celitech();
sdk.setEnvironment(Environment.DEFAULT);

Celitech Services

A list of all services and services methods.

Destinations

MethodDescription
listDestinationsList Destinations

Packages

MethodDescription
listPackagesList Packages

Purchases

MethodDescription
createPurchaseCreate Purchase
listPurchasesList Purchases
topUpEsimTop-up eSIM
editPurchaseEdit Purchase
getPurchaseConsumptionGet Purchase Consumption

ESim

MethodDescription
getEsimGet eSIM Status
getEsimDeviceGet eSIM Device
getEsimHistoryGet eSIM History
getEsimMacGet eSIM MAC

All Methods

listDestinations

List Destinations

  • HTTP Method: GET
  • Endpoint: /destinations

Return Type

ListDestinationsResponse

Example Usage Code Snippet

import { Celitech } from './src';

const sdk = new Celitech();

(async () => {
  const result = await sdk.destinations.listDestinations();
  console.log(result);
})();

listPackages

List Packages

  • HTTP Method: GET
  • Endpoint: /packages

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

NameTypeDescription
destinationstring
startDatestringStart date of the package's validity in the format 'yyyy-MM-dd'. This date can be set to the current day or any day within the next 12 months.
endDatestringEnd date of the package's validity in the format 'yyyy-MM-dd'. End date can be maximum 60 days after Start date.
afterCursorstring
limitnumber
startTimenumber
endTimenumber
durationnumber

Return Type

ListPackagesResponse

Example Usage Code Snippet

import { Celitech } from './src';

const sdk = new Celitech();

(async () => {
  const result = await sdk.packages.listPackages({
    destination: 'FRA',
    startDate: '2023-11-01',
    endDate: '2023-11-20',
    afterCursor:
      'Y3JlYXRlZEF0OjE1OTk0OTMwOTgsZGVzdGluYXRpb246QVVTLG1pbkRheXM6MCxkYXRhTGltaXRJbkJ5dGVzOjUzNjg3MDkxMjA',
    limit: 20,
    startTime: 1672052449,
    endTime: 1672396681,
    duration: 344232,
  });
  console.log(result);
})();

createPurchase

Create Purchase

  • HTTP Method: POST
  • Endpoint: /purchases

Required Parameters

| input | object | Request body. |

Return Type

CreatePurchaseResponse

Example Usage Code Snippet

import { Celitech } from './src';

const sdk = new Celitech();

(async () => {
  const input = {
    dataLimitInGB: 1,
    destination: 'FRA',
    email: 'example@domain.com',
    endDate: '2023-11-20',
    endTime: 1672396681,
    networkBrand: 'CELITECH',
    startDate: '2023-11-01',
    startTime: 1672051891,
  };
  const result = await sdk.purchases.createPurchase(input);
  console.log(result);
})();

listPurchases

List Purchases

  • HTTP Method: GET
  • Endpoint: /purchases

Optional Parameters

Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}

NameTypeDescription
iccidstring
afterDatestringStart date of the interval for filtering purchases in the format 'yyyy-MM-dd'
beforeDatestringEnd date of the interval for filtering purchases in the format 'yyyy-MM-dd'
afterCursorstring
limitnumber
afternumber
beforenumber

Return Type

ListPurchasesResponse

Example Usage Code Snippet

import { Celitech } from './src';

const sdk = new Celitech();

(async () => {
  const result = await sdk.purchases.listPurchases({
    iccid: '1111222233334444555',
    afterDate: '2023-11-01',
    beforeDate: '2023-11-20',
    afterCursor:
      'Y3JlYXRlZEF0OjE1OTk0OTMwOTgsZGVzdGluYXRpb246QVVTLG1pbkRheXM6MCxkYXRhTGltaXRJbkJ5dGVzOjUzNjg3MDkxMjA',
    limit: 20,
    after: 1672052365,
    before: 1672396681,
  });
  console.log(result);
})();

topUpEsim

Top-up eSIM

  • HTTP Method: POST
  • Endpoint: /purchases/topup

Required Parameters

| input | object | Request body. |

Return Type

TopUpEsimResponse

Example Usage Code Snippet

import { Celitech } from './src';

const sdk = new Celitech();

(async () => {
  const input = {
    dataLimitInGB: 1,
    email: 'example@domain.com',
    endDate: '2023-11-20',
    endTime: 1672396681,
    iccid: '1111222233334444555',
    startDate: '2023-11-01',
    startTime: 1672051891,
  };
  const result = await sdk.purchases.topUpEsim(input);
  console.log(result);
})();

editPurchase

Edit Purchase

  • HTTP Method: POST
  • Endpoint: /purchases/edit

Required Parameters

| input | object | Request body. |

Return Type

EditPurchaseResponse

Example Usage Code Snippet

import { Celitech } from './src';

const sdk = new Celitech();

(async () => {
  const input = {
    endDate: '2023-11-20',
    endTime: 1672396681,
    purchaseId: 'ae471106-c8b4-42cf-b83a-b061291f2922',
    startDate: '2023-11-01',
    startTime: 1672051891,
  };
  const result = await sdk.purchases.editPurchase(input);
  console.log(result);
})();

getPurchaseConsumption

Get Purchase Consumption

  • HTTP Method: GET
  • Endpoint: /purchases/{purchaseId}/consumption

Required Parameters

NameTypeDescription
purchaseIdstring

Return Type

GetPurchaseConsumptionResponse

Example Usage Code Snippet

import { Celitech } from './src';

const sdk = new Celitech();

(async () => {
  const result = await sdk.purchases.getPurchaseConsumption('4973fa15-6979-4daa-9cf3-672620df819c');
  console.log(result);
})();

getEsim

Get eSIM Status

  • HTTP Method: GET
  • Endpoint: /esim

Required Parameters

NameTypeDescription
iccidstring

Return Type

GetEsimResponse

Example Usage Code Snippet

import { Celitech } from './src';

const sdk = new Celitech();

(async () => {
  const result = await sdk.eSim.getEsim('1111222233334444555');
  console.log(result);
})();

getEsimDevice

Get eSIM Device

  • HTTP Method: GET
  • Endpoint: /esim/{iccid}/device

Required Parameters

NameTypeDescription
iccidstring

Return Type

GetEsimDeviceResponse

Example Usage Code Snippet

import { Celitech } from './src';

const sdk = new Celitech();

(async () => {
  const result = await sdk.eSim.getEsimDevice('1111222233334444555');
  console.log(result);
})();

getEsimHistory

Get eSIM History

  • HTTP Method: GET
  • Endpoint: /esim/{iccid}/history

Required Parameters

NameTypeDescription
iccidstring

Return Type

GetEsimHistoryResponse

Example Usage Code Snippet

import { Celitech } from './src';

const sdk = new Celitech();

(async () => {
  const result = await sdk.eSim.getEsimHistory('1111222233334444555');
  console.log(result);
})();

getEsimMac

Get eSIM MAC

  • HTTP Method: GET
  • Endpoint: /esim/{iccid}/mac

Required Parameters

NameTypeDescription
iccidstring

Return Type

GetEsimMacResponse

Example Usage Code Snippet

import { Celitech } from './src';

const sdk = new Celitech();

(async () => {
  const result = await sdk.eSim.getEsimMac('1111222233334444555');
  console.log(result);
})();

License

License: MIT. See license in LICENSE.

FAQs

Package last updated on 15 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc