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

celitech-sdk

Package Overview
Dependencies
Maintainers
0
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

celitech-sdk

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/)

  • 1.1.60
  • npm
  • Socket score

Version published
Weekly downloads
54
increased by20%
Maintainers
0
Weekly downloads
 
Created
Source

Celitech Typescript SDK 1.1.60

The Typescript SDK for Celitech.

  • API version: 1.1.60
  • SDK version: 1.1.60

Table of Contents

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

About the API

Welcome to the CELITECH API documentation! Useful links: Homepage | Support email | Blog

Installation

npm install celitech-sdk

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 'celitech-sdk';


const sdk = new Celitech();

(async () => {
  try {
    const result = await sdk.destinations
      .listDestinations();
    console.log(result);
  } catch (err) {
    const error = err as Error;
    console.error(error.message);
  }
})();


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 'celitech-sdk';

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
destinationstringISO representation of the package's destination.
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 90 days after Start date.
afterCursorstringTo get the next batch of results, use this parameter. It tells the API where to start fetching data after the last item you received. It helps you avoid repeats and efficiently browse through large sets of data.
limitnumberMaximum number of packages to be returned in the response. The value must be greater than 0 and less than or equal to 160. If not provided, the default value is 20
startTimenumberEpoch value representing the start time of the package's validity. This timestamp can be set to the current time or any time within the next 12 months
endTimenumberEpoch value representing the end time of the package's validity. End time can be maximum 90 days after Start time
durationnumberDuration in seconds for the package's validity. If this parameter is present, it will override the startTime and endTime parameters. The maximum duration for a package's validity period is 90 days

Return Type

ListPackagesResponse

Example Usage Code Snippet

import { Celitech } from 'celitech-sdk';

const sdk = new Celitech();

(async () => {
  const result = await sdk.packages.listPackages();
  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 'celitech-sdk';

const sdk = new Celitech();

(async () => {
  const input = {
    dataLimitInGB: 1,
    destination: 'FRA',
    endDate: '2023-11-20',
    startDate: '2023-11-01',
  };
  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
iccidstringID of the eSIM
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'
afterCursorstringTo get the next batch of results, use this parameter. It tells the API where to start fetching data after the last item you received. It helps you avoid repeats and efficiently browse through large sets of data.
limitnumberMaximum number of purchases to be returned in the response. The value must be greater than 0 and less than or equal to 100. If not provided, the default value is 20
afternumberEpoch value representing the start of the time interval for filtering purchases
beforenumberEpoch value representing the end of the time interval for filtering purchases

Return Type

ListPurchasesResponse

Example Usage Code Snippet

import { Celitech } from 'celitech-sdk';

const sdk = new Celitech();

(async () => {
  const result = await sdk.purchases.listPurchases();
  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 'celitech-sdk';

const sdk = new Celitech();

(async () => {
  const input = {
    dataLimitInGB: 1,
    endDate: '2023-11-20',
    iccid: '1111222233334444555',
    startDate: '2023-11-01',
  };
  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 'celitech-sdk';

const sdk = new Celitech();

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

getPurchaseConsumption

Get Purchase Consumption

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

Required Parameters

NameTypeDescription
purchaseIdstringID of the purchase

Return Type

GetPurchaseConsumptionResponse

Example Usage Code Snippet

import { Celitech } from 'celitech-sdk';

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
iccidstringID of the eSIM

Return Type

GetEsimResponse

Example Usage Code Snippet

import { Celitech } from 'celitech-sdk';

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
iccidstringID of the eSIM

Return Type

GetEsimDeviceResponse

Example Usage Code Snippet

import { Celitech } from 'celitech-sdk';

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
iccidstringID of the eSIM

Return Type

GetEsimHistoryResponse

Example Usage Code Snippet

import { Celitech } from 'celitech-sdk';

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
iccidstringID of the eSIM

Return Type

GetEsimMacResponse

Example Usage Code Snippet

import { Celitech } from 'celitech-sdk';

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 03 Jul 2024

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