@liblab/sdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.170 • Public • Published

Liblab Typescript SDK 0.1.170

The Typescript SDK for Liblab.

  • API version: 0.1.170
  • SDK version: 0.1.170

Table of Contents

Installation

npm install sdk

Authentication

To see whether an endpoint needs a specific type of authentication check the endpoint's documentation.

Access Token

The Liblab API uses access tokens as a form of authentication. You can set the access token when initializing the SDK through the constructor:

const sdk = new Liblab('YOUR_ACCESS_TOKEN')

Or through the setAccessToken method:

const sdk = new Liblab()
sdk.setAccessToken('YOUR_ACCESS_TOKEN')

You can also set it for each service individually:

const sdk = new Liblab()
sdk.build.setAccessToken('YOUR_ACCESS_TOKEN')

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 { Liblab } from '@liblab/sdk';


const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

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

Environments

Here is the list of all available environments:

DEFAULT = 'https://api-dev.liblab.com',
PRODUCTION = 'https://api.liblab.com',
STAGING = 'https://api-staging.liblab.com',
DEVELOPMENT = 'https://api-dev.liblab.com'

How to set the environment:

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

Liblab Services

A list of all services and services methods.

Build

Method Description
createBuild
getBuilds
getBuildStatuses
getById
removeById
tag
untag
approveBuild
unApproveBuild

Api

Method Description
getApiBuilds
getApiBuildTags
getApiSdks
getApiDocs
createApi
getApis
searchApis
getApiById
updateApi
getApiMembers
removeApi
getApiByOrgSlugAndApiSlug

Org

Method Description
createOrg
getOrgs
searchOrgs
getOrgById
updateOrg
removeOrg
getApisByOrg
getOrgJobs
getDocsByOrg
getBuildByOrg
getOrgApiBuilds
getOrgArtifacts

OrgMember

Method Description
createMember
getByOrgId
updateMember
removeMember
leaveOrg
enableAllMembers
disableAllMembers

Artifact

Method Description
createArtifact
getArtifacts
getArtifactStatuses
getArtifactById
removeArtifact

Sdk

Method Description
createSdk
findSdks
getSdkById
removeSdk

Doc

Method Description
getApprovedByOrgSlugAndApiSlug
getAllApprovedByOrgSlugAndApiSlug
createDoc
findDocs
approve
unapprove
getDocById
removeDoc
updateDoc
getDownloadUrl

HubSpot

Method Description
sendShadowForm

Subscription

Method Description
getActiveSubscription
cancelActiveSubscription
getActiveSubscriptionStatus
getSubscriptionPaymentMethodUpdateLink
getCheckoutLink
createOpenSourceSubscription

PaymentProvider

Method Description
stripeWebhook
syncStripeSubscriptions

User

Method Description
getCurrentUser
createUser
getUsers
getUserById
updateUser
removeUser
updateEmailSubscription
getUserOrgs
getUserApis

Snippets

Method Description
getSnippetsByBuildId

Token

Method Description
createToken
findTokensByUserId
getTokenById
removeToken

Invitation

Method Description
createOrgInvite
redeemInvite
declineInvite
getReceivedInvites
getSentInvites
searchInvites
getInviteByCode

Auth0

Method Description
resetPasswordAuth0

Plan

Method Description
getEnabledPlans

Invoice

Method Description
getOrgInvoices

Spec

Method Description
validateSpec

HealthCheck

Method Description
healthCheckControllerCheck

Tags

Method Description
create
search

Ai

Method Description
askAboutSpec

Feedback

Method Description
sendFeedback

UserEvent

Method Description
getUserEvents
exportUserEventsToCsv
trackUserPublishPrEvent

All Methods

createBuild

  • HTTP Method: POST
  • Endpoint: /builds

Required Parameters

| input | object | Request body. |

Return Type

BuildResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {};
  const result = await sdk.build.createBuild(input);
  console.log(result);
})();

getBuilds

  • HTTP Method: GET
  • Endpoint: /builds

Required Parameters

Name Type Description
offset number
limit number
orgId number
apiSlug string

Return Type

PaginatedBuildResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.getBuilds(
    82563456.02971327,
    -23420816.146370485,
    28270686.561582714,
    'apiSlug',
  );
  console.log(result);
})();

getBuildStatuses

  • HTTP Method: GET
  • Endpoint: /builds/statuses

Return Type

GetBuildStatusesResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.getBuildStatuses();
  console.log(result);
})();

getById

  • HTTP Method: GET
  • Endpoint: /builds/{id}

Required Parameters

Name Type Description
id number

Return Type

GetBuildByIdResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.getById(-40208359.37193215);
  console.log(result);
})();

removeById

  • HTTP Method: DELETE
  • Endpoint: /builds/{buildId}/{apiSlug}/{orgId}

Required Parameters

Name Type Description
buildId number
apiSlug string
orgId number

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.removeById(-44339449.740950964, 'apiSlug', 79497693.33630323);
  console.log(result);
})();

tag

  • HTTP Method: POST
  • Endpoint: /builds/{buildId}/tag/{tagId}

Required Parameters

Name Type Description
buildId number
tagId number

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.tag(23961025.134772345, -66307465.70512746);
  console.log(result);
})();

untag

  • HTTP Method: POST
  • Endpoint: /builds/{buildId}/untag/{tagId}

Required Parameters

Name Type Description
buildId number
tagId number

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.untag(-68884502.1328615, -6983340.16050382);
  console.log(result);
})();

approveBuild

  • HTTP Method: PATCH
  • Endpoint: /builds/{buildId}/approve

Required Parameters

Name Type Description
buildId number

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.approveBuild(26456593.070628643);
  console.log(result);
})();

unApproveBuild

  • HTTP Method: PATCH
  • Endpoint: /builds/{buildId}/unapprove

Required Parameters

Name Type Description
buildId number

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.build.unApproveBuild(-4146321.4541081637);
  console.log(result);
})();

getApiBuilds

  • HTTP Method: GET
  • Endpoint: /apis/{id}/builds

Required Parameters

Name Type Description
id number
offset number
limit number

Optional Parameters

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

Name Type Description
sortBy SortBy
direction Direction
statuses string[]
tags number[]
createdByIds number[]

Return Type

PaginatedBuildResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApiBuilds(
    83269958.38200083,
    -52566321.51288971,
    -14559802.81306243,
    {
      sortBy: 'status',
      direction: 'asc',
      statuses: ['FAILURE', 'FAILURE'],
      tags: [93089605.79510576, 79732348.29611093],
      createdByIds: [86484679.98975685, 74010523.85775629],
    },
  );
  console.log(result);
})();

getApiBuildTags

  • HTTP Method: GET
  • Endpoint: /apis/{id}/builds/tags

Required Parameters

Name Type Description
id number

Return Type

GetApiBuildTagsResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApiBuildTags(-4412715.665746972);
  console.log(result);
})();

getApiSdks

  • HTTP Method: GET
  • Endpoint: /apis/{id}/sdks

Required Parameters

Name Type Description
id number
offset number
limit number

Optional Parameters

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

Name Type Description
statuses string[]
tags number[]
createdByIds number[]
languages string[]
sortBy ApiSortBy
direction Direction

Return Type

PaginatedSdkResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApiSdks(
    86525470.96179265,
    51659568.261363864,
    -75803350.24735141,
    {
      statuses: ['FAIL', 'SUCCESS'],
      tags: [-68980784.60582004, 14251741.3202416],
      createdByIds: [-47812419.08967995, 44750115.30562875],
      languages: ['CSHARP', 'SWIFT'],
      sortBy: 'createdAt',
      direction: 'asc',
    },
  );
  console.log(result);
})();

getApiDocs

  • HTTP Method: GET
  • Endpoint: /apis/{id}/docs

Required Parameters

Name Type Description
id number
offset number
limit number

Optional Parameters

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

Name Type Description
sortBy ApiSortBy
direction Direction
statuses string[]
tags number[]
createdByIds number[]

Return Type

PaginatedDocResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApiDocs(
    98534067.17156804,
    -74187802.71980645,
    -85875413.82004617,
    {
      sortBy: 'createdAt',
      direction: 'asc',
      statuses: ['FAIL', 'IN_PROGRESS'],
      tags: [-16355043.855438784, -10739401.47154811],
      createdByIds: [-32471345.752135366, 13716886.201927185],
    },
  );
  console.log(result);
})();

createApi

  • HTTP Method: POST
  • Endpoint: /apis

Required Parameters

| input | object | Request body. |

Return Type

ApiResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {};
  const result = await sdk.api.createApi(input);
  console.log(result);
})();

getApis

  • HTTP Method: GET
  • Endpoint: /apis

Required Parameters

Name Type Description
orgId number

Optional Parameters

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

Name Type Description
apiSlug string

Return Type

GetApisResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApis(-15642531.578727022, { apiSlug: 'apiSlug' });
  console.log(result);
})();

searchApis

  • HTTP Method: GET
  • Endpoint: /apis/search

Required Parameters

Name Type Description
offset number
limit number

Optional Parameters

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

Name Type Description
name string
sortBy ApiSortBy
orgId number
direction ApiDirection
orgIds number[]

Return Type

ApisSearchPaginatedResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.searchApis(-60003547.99669734, -37461647.54906599, {
    name: 'name',
    sortBy: 'createdAt',
    orgId: 4448211.3489829,
    direction: 'desc',
    orgIds: [47316608.9558779, -59226253.855744295],
  });
  console.log(result);
})();

getApiById

  • HTTP Method: GET
  • Endpoint: /apis/{id}

Required Parameters

Name Type Description
id number

Return Type

ApiResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApiById(-99789010.64989975);
  console.log(result);
})();

updateApi

  • HTTP Method: PATCH
  • Endpoint: /apis/{id}

Required Parameters

Name Type Description
id number
input object Request body.

Return Type

ApiResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { name: 'My api name', version: '1.0.1' };
  const result = await sdk.api.updateApi(input, 68786798.93630096);
  console.log(result);
})();

getApiMembers

  • HTTP Method: GET
  • Endpoint: /apis/{id}/members

Required Parameters

Name Type Description
id number

Return Type

GetApiMembersResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApiMembers(-32401588.75527355);
  console.log(result);
})();

removeApi

  • HTTP Method: DELETE
  • Endpoint: /apis/delete/{apiSlug}/{orgId}

Required Parameters

Name Type Description
apiSlug string
orgId number

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.removeApi('apiSlug', -20687105.22150381);
  console.log(result);
})();

getApiByOrgSlugAndApiSlug

  • HTTP Method: GET
  • Endpoint: /apis/{orgSlug}/{apiSlug}

Required Parameters

Name Type Description
orgSlug string
apiSlug string

Return Type

GetApiByOrgSlugAndApiSlugResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.api.getApiByOrgSlugAndApiSlug('orgSlug', 'apiSlug');
  console.log(result);
})();

createOrg

  • HTTP Method: POST
  • Endpoint: /orgs

Required Parameters

| input | object | Request body. |

Return Type

OrgResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {
    description: 'Example Org Description',
    domain: 'business.com',
    logoUrl: 'https://liblab.com/images/logo.png',
    name: 'Example Org',
    website: 'https://example.com',
  };
  const result = await sdk.org.createOrg(input);
  console.log(result);
})();

getOrgs

  • HTTP Method: GET
  • Endpoint: /orgs

Required Parameters

Name Type Description
offset number
limit number

Optional Parameters

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

Name Type Description
direction Direction
sortBy OrgSortBy

Return Type

AdminPaginatedOrgResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getOrgs(-79082723.54191066, -22995505.479965717, {
    direction: 'asc',
    sortBy: 'createdAt',
  });
  console.log(result);
})();

searchOrgs

  • HTTP Method: GET
  • Endpoint: /orgs/search

Required Parameters

Name Type Description
offset number
limit number

Optional Parameters

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

Name Type Description
website string
domain string
name string

Return Type

AdminPaginatedOrgResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.searchOrgs(-63271442.61506201, -90974707.96279109, {
    website: 'website',
    domain: 'domain',
    name: 'name',
  });
  console.log(result);
})();

getOrgById

  • HTTP Method: GET
  • Endpoint: /orgs/{id}

Required Parameters

Name Type Description
id number

Return Type

GetOrgByIdResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getOrgById(88395757.34323269);
  console.log(result);
})();

updateOrg

  • HTTP Method: PATCH
  • Endpoint: /orgs/{id}

Required Parameters

Name Type Description
id number
input object Request body.

Return Type

OrgResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {
    description: 'Example Org Description',
    domain: 'example.com',
    isAllowedForBeta: true,
    logoUrl: 'https://liblab.com/images/logo.png',
    name: 'Example Org',
    remainingCredits: 19,
    website: 'https://example.com',
  };
  const result = await sdk.org.updateOrg(input, -68014770.74599504);
  console.log(result);
})();

removeOrg

  • HTTP Method: DELETE
  • Endpoint: /orgs/{id}

Required Parameters

Name Type Description
id number

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.removeOrg(-7609382.961816281);
  console.log(result);
})();

getApisByOrg

  • HTTP Method: GET
  • Endpoint: /orgs/{id}/apis

Required Parameters

Name Type Description
id number

Return Type

GetApisByOrgResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getApisByOrg(-36620090.94182621);
  console.log(result);
})();

getOrgJobs

  • HTTP Method: GET
  • Endpoint: /orgs/{id}/jobs

Required Parameters

Name Type Description
id number
offset number
limit number

Optional Parameters

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

Name Type Description
sortBy OrgSortBy
direction Direction
statuses string[]
createdByIds number[]
apiSlug string
apiVersion string
buildType string[]

Return Type

PaginatedOrgJobsResponseWithTotalCount

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getOrgJobs(
    62585972.94759464,
    35676006.65498817,
    -14320554.26633282,
    {
      sortBy: 'startTime',
      direction: 'asc',
      statuses: ['IN_PROGRESS', 'FAILURE'],
      createdByIds: [-71271966.24114482, 24690251.78862241],
      apiSlug: 'apiSlug',
      apiVersion: 'apiVersion',
      buildType: ['SNIPPETS', 'SNIPPETS'],
    },
  );
  console.log(result);
})();

getDocsByOrg

  • HTTP Method: GET
  • Endpoint: /orgs/{id}/docs

Required Parameters

Name Type Description
id number

Return Type

GetDocsByOrgResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getDocsByOrg(-31377236.31976232);
  console.log(result);
})();

getBuildByOrg

  • HTTP Method: GET
  • Endpoint: /orgs/{id}/builds

Required Parameters

Name Type Description
id number
offset number
limit number

Optional Parameters

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

Name Type Description
sortBy OrgSortBy
direction Direction
statuses string[]
tags number[]
createdByIds number[]
apiSlug string
apiVersion string

Return Type

PaginatedOrgBuildsWithJobsResponseWithTotalCount

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getBuildByOrg(
    31800578.29767278,
    7220589.216856912,
    -20412843.333371222,
    {
      sortBy: 'createdAt',
      direction: 'asc',
      statuses: ['FAILURE', 'IN_PROGRESS'],
      tags: [-69669842.91307661, -6347723.310458079],
      createdByIds: [-64205662.18834058, -74416947.286957],
      apiSlug: 'apiSlug',
      apiVersion: 'apiVersion',
    },
  );
  console.log(result);
})();

getOrgApiBuilds

  • HTTP Method: GET
  • Endpoint: /orgs/{id}/api-builds

Required Parameters

Name Type Description
id number

Return Type

GetOrgApiBuildsResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getOrgApiBuilds(-11564982.276290566);
  console.log(result);
})();

getOrgArtifacts

  • HTTP Method: GET
  • Endpoint: /orgs/{id}/artifacts

Required Parameters

Name Type Description
id number
offset number
limit number

Optional Parameters

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

Name Type Description
sortBy OrgSortBy
direction OrgDirection
artifactTypes ArtifactTypes
statuses OrgStatuses
createdByIds number[]

Return Type

PaginatedOrgArtifactsResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.org.getOrgArtifacts(
    -12338229.853676274,
    97865152.0108824,
    -54154326.73410881,
    {
      sortBy: 'status',
      direction: 'desc',
      artifactTypes: ['DOC', 'SDK'],
      statuses: [{ imports: [] }, { imports: [] }],
      createdByIds: [47700813.02901298, -88310417.79129176],
    },
  );
  console.log(result);
})();

createMember

  • HTTP Method: POST
  • Endpoint: /orgs/{orgId}/members

Required Parameters

Name Type Description
orgId number
input object Request body.

Return Type

OrgMemberResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { role: 'MEMBER', userId: 1 };
  const result = await sdk.orgMember.createMember(input, 40248349.00026262);
  console.log(result);
})();

getByOrgId

  • HTTP Method: GET
  • Endpoint: /orgs/{orgId}/members

Required Parameters

Name Type Description
orgId number
offset number
limit number

Optional Parameters

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

Name Type Description
email string
firstName string
lastName string
sortBy OrgMemberSortBy
direction Direction

Return Type

PaginatedOrgMemberResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgMember.getByOrgId(
    48721696.21724382,
    73956714.3846834,
    -18447142.48900312,
    {
      email: 'email',
      firstName: 'firstName',
      lastName: 'lastName',
      sortBy: 'createdAt',
      direction: 'asc',
    },
  );
  console.log(result);
})();

updateMember

  • HTTP Method: PATCH
  • Endpoint: /orgs/{orgId}/members/{userId}

Required Parameters

Name Type Description
userId number
orgId number
input object Request body.

Return Type

OrgMemberResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { orgId: 1, role: 'MEMBER' };
  const result = await sdk.orgMember.updateMember(input, -58243179.13873301, -93631982.10904215);
  console.log(result);
})();

removeMember

  • HTTP Method: DELETE
  • Endpoint: /orgs/{orgId}/members/{userId}

Required Parameters

Name Type Description
userId number
orgId number

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgMember.removeMember(-52890443.69981379, -23860756.57590738);
  console.log(result);
})();

leaveOrg

  • HTTP Method: DELETE
  • Endpoint: /orgs/{orgId}/leave

Required Parameters

Name Type Description
orgId number

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgMember.leaveOrg(-64282359.131071895);
  console.log(result);
})();

enableAllMembers

  • HTTP Method: PATCH
  • Endpoint: /orgs/{orgId}/enable

Required Parameters

Name Type Description
orgId number

Return Type

UpdateManyOrgMembersResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgMember.enableAllMembers(-79010693.15872386);
  console.log(result);
})();

disableAllMembers

  • HTTP Method: PATCH
  • Endpoint: /orgs/{orgId}/disable

Required Parameters

Name Type Description
orgId number

Return Type

UpdateManyOrgMembersResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.orgMember.disableAllMembers(-35510292.10145034);
  console.log(result);
})();

createArtifact

  • HTTP Method: POST
  • Endpoint: /artifacts

Required Parameters

| input | object | Request body. |

Return Type

ArtifactResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {
    artifactType: 'DOC',
    bucketKey: 'bucketKey',
    bucketName: 'bucketName',
    buildId: 1,
    status: 'SUCCESS',
  };
  const result = await sdk.artifact.createArtifact(input);
  console.log(result);
})();

getArtifacts

  • HTTP Method: GET
  • Endpoint: /artifacts

Required Parameters

Name Type Description
buildId number

Return Type

GetArtifactsResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.artifact.getArtifacts(-862974.7946000248);
  console.log(result);
})();

getArtifactStatuses

  • HTTP Method: GET
  • Endpoint: /artifacts/statuses

Return Type

GetArtifactStatusesResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.artifact.getArtifactStatuses();
  console.log(result);
})();

getArtifactById

  • HTTP Method: GET
  • Endpoint: /artifacts/{id}

Required Parameters

Name Type Description
id number

Return Type

ArtifactResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.artifact.getArtifactById(80218140.40069824);
  console.log(result);
})();

removeArtifact

  • HTTP Method: DELETE
  • Endpoint: /artifacts/{id}

Required Parameters

Name Type Description
id number

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.artifact.removeArtifact(57445186.50779322);
  console.log(result);
})();

createSdk

  • HTTP Method: POST
  • Endpoint: /sdks

Required Parameters

| input | object | Request body. |

Return Type

SdkResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {
    artifactId: 1,
    fileLocation: 'https://my-file.location',
    language: 'JAVA',
    version: '1.0.0',
  };
  const result = await sdk.sdk.createSdk(input);
  console.log(result);
})();

findSdks

  • HTTP Method: GET
  • Endpoint: /sdks

Required Parameters

Name Type Description
offset number
limit number

Optional Parameters

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

Name Type Description
artifactId number
sortBy SdkSortBy
direction Direction
languages string[]

Return Type

PaginatedSdkResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.sdk.findSdks(52161715.73194495, -68618405.00500882, {
    artifactId: 91181669.21116564,
    sortBy: 'createdAt',
    direction: 'asc',
    languages: ['TERRAFORM', 'GO'],
  });
  console.log(result);
})();

getSdkById

  • HTTP Method: GET
  • Endpoint: /sdks/{id}

Required Parameters

Name Type Description
id number

Return Type

SdkResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.sdk.getSdkById(-16863098.784481555);
  console.log(result);
})();

removeSdk

  • HTTP Method: DELETE
  • Endpoint: /sdks/{id}

Required Parameters

Name Type Description
id number

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.sdk.removeSdk(-50244693.72890503);
  console.log(result);
})();

getApprovedByOrgSlugAndApiSlug

  • HTTP Method: GET
  • Endpoint: /docs/approved

Required Parameters

Name Type Description
orgSlug string

Optional Parameters

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

Name Type Description
apiSlug string
apiVersion string

Return Type

DocResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.getApprovedByOrgSlugAndApiSlug('orgSlug', {
    apiSlug: 'apiSlug',
    apiVersion: 'apiVersion',
  });
  console.log(result);
})();

getAllApprovedByOrgSlugAndApiSlug

  • HTTP Method: GET
  • Endpoint: /docs/approved/all

Required Parameters

Name Type Description
orgSlug string

Optional Parameters

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

Name Type Description
apiSlug string
apiVersion string

Return Type

GetAllApprovedByOrgSlugAndApiSlugResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.getAllApprovedByOrgSlugAndApiSlug('orgSlug', {
    apiSlug: 'apiSlug',
    apiVersion: 'apiVersion',
  });
  console.log(result);
})();

createDoc

  • HTTP Method: POST
  • Endpoint: /docs

Required Parameters

| input | object | Request body. |

Return Type

DocCreatedResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {
    apiId: -20775788.24055925,
    artifactId: 1,
    fileLocation: 'https://example.com',
    previewSlug: 'previewSlug',
    version: '1.0.0',
  };
  const result = await sdk.doc.createDoc(input);
  console.log(result);
})();

findDocs

  • HTTP Method: GET
  • Endpoint: /docs

Required Parameters

Name Type Description
offset number
limit number
artifactId number

Return Type

PaginatedDocResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.findDocs(-78525559.7231166, -18337681.165534973, 96884780.2322757);
  console.log(result);
})();

approve

  • HTTP Method: POST
  • Endpoint: /docs/{previewSlug}/approve

Required Parameters

Name Type Description
previewSlug string

Return Type

DocResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.approve('previewSlug');
  console.log(result);
})();

unapprove

  • HTTP Method: POST
  • Endpoint: /docs/{previewSlug}/unapprove

Required Parameters

Name Type Description
previewSlug string

Return Type

DocResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.unapprove('previewSlug');
  console.log(result);
})();

getDocById

  • HTTP Method: GET
  • Endpoint: /docs/{id}

Required Parameters

Name Type Description
id number

Return Type

DocResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.getDocById(-1208021.57346192);
  console.log(result);
})();

removeDoc

  • HTTP Method: DELETE
  • Endpoint: /docs/{id}

Required Parameters

Name Type Description
id number

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.removeDoc(-38645302.20467453);
  console.log(result);
})();

updateDoc

  • HTTP Method: PUT
  • Endpoint: /docs/{id}

Required Parameters

Name Type Description
id number
input object Request body.

Return Type

DocResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { fileLocation: 'https://example.com', version: '1.0.0' };
  const result = await sdk.doc.updateDoc(input, -72361951.85604717);
  console.log(result);
})();

getDownloadUrl

  • HTTP Method: GET
  • Endpoint: /docs/{id}/getDownloadUrl

Required Parameters

Name Type Description
id number

Return Type

DocDownloadResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.doc.getDownloadUrl(99005808.24572289);
  console.log(result);
})();

sendShadowForm

  • HTTP Method: POST
  • Endpoint: /hubspot/shadow-form

Required Parameters

| input | object | Request body. |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { fields: [{ name: 'test-name', value: 'test-field' }] };
  const result = await sdk.hubSpot.sendShadowForm(input);
  console.log(result);
})();

getActiveSubscription

  • HTTP Method: GET
  • Endpoint: /orgs/{orgId}/subscriptions/active

Required Parameters

Name Type Description
orgId number

Return Type

SubscriptionResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.subscription.getActiveSubscription(94927508.54225919);
  console.log(result);
})();

cancelActiveSubscription

  • HTTP Method: POST
  • Endpoint: /orgs/{orgId}/subscriptions/active/cancel

Required Parameters

Name Type Description
orgId number

Return Type

SubscriptionResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.subscription.cancelActiveSubscription(28137269.918771774);
  console.log(result);
})();

getActiveSubscriptionStatus

  • HTTP Method: GET
  • Endpoint: /orgs/{orgId}/subscriptions/active/state

Required Parameters

Name Type Description
orgId number

Return Type

GetActiveSubscriptionStatusResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.subscription.getActiveSubscriptionStatus(-60324283.38277111);
  console.log(result);
})();

getSubscriptionPaymentMethodUpdateLink

  • HTTP Method: GET
  • Endpoint: /orgs/{orgId}/subscriptions/{subscriptionId}/payment-methods/update-link

Required Parameters

Name Type Description
orgId number
subscriptionId number

Return Type

CheckoutLinkResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.subscription.getSubscriptionPaymentMethodUpdateLink(
    -24282899.206446946,
    99438063.55804378,
  );
  console.log(result);
})();

getCheckoutLink

  • HTTP Method: GET
  • Endpoint: /orgs/{orgId}/subscriptions/checkout/link

Required Parameters

Name Type Description
orgId number
planId number
billingInterval BillingInterval

Return Type

CheckoutLinkResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.subscription.getCheckoutLink(
    -97183809.03663148,
    -36731155.57521198,
    'year',
  );
  console.log(result);
})();

createOpenSourceSubscription

  • HTTP Method: POST
  • Endpoint: /orgs/{orgId}/subscriptions/open-source

Required Parameters

Name Type Description
orgId number
input object Request body.

Return Type

SubscriptionResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { openSourceProjectUrl: 'https://github.com/liblaber/api' };
  const result = await sdk.subscription.createOpenSourceSubscription(input, -65779837.96204188);
  console.log(result);
})();

stripeWebhook

  • HTTP Method: POST
  • Endpoint: /payment-provider/stripe/webhook

Required Parameters

Name Type Description
stripeSignature string

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.paymentProvider.stripeWebhook('stripe-signature');
  console.log(result);
})();

syncStripeSubscriptions

  • HTTP Method: POST
  • Endpoint: /payment-provider/stripe/subscriptions/sync

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.paymentProvider.syncStripeSubscriptions();
  console.log(result);
})();

getCurrentUser

  • HTTP Method: GET
  • Endpoint: /users/current-user

Return Type

CurrentUserResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.user.getCurrentUser();
  console.log(result);
})();

createUser

  • HTTP Method: POST
  • Endpoint: /users

Required Parameters

| input | object | Request body. |

Return Type

UserResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {
    auth0Id: 'auth0|123',
    email: 'someone@example.com',
    firstName: 'John',
    lastName: 'Doe',
    password: 'Password123!',
    signupMethod: 'DEFAULT',
  };
  const result = await sdk.user.createUser(input);
  console.log(result);
})();

getUsers

  • HTTP Method: GET
  • Endpoint: /users

Required Parameters

Name Type Description
offset number
limit number

Optional Parameters

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

Name Type Description
orgId number
email string
firstName string
lastName string
orgIds number[]
sortBy UserSortBy
direction UserDirection

Return Type

UsersResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.user.getUsers(8830582.698466301, -63169394.912257195, {
    orgId: 99842719.24795645,
    email: 'email',
    firstName: 'firstName',
    lastName: 'lastName',
    orgIds: [83448460.90504241, 82026844.19600496],
    sortBy: 'createdAt',
    direction: 'desc',
  });
  console.log(result);
})();

getUserById

  • HTTP Method: GET
  • Endpoint: /users/{id}

Required Parameters

Name Type Description
id number

Return Type

UserResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.user.getUserById(26823139.940286905);
  console.log(result);
})();

updateUser

  • HTTP Method: PATCH
  • Endpoint: /users/{id}

Required Parameters

Name Type Description
id number
input object Request body.

Return Type

UserResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {
    email: 'someone@example.com',
    firstName: 'John',
    isEnabled: true,
    isLiblabAdmin: true,
    lastName: 'Doe',
    refreshTokenHash: 'refreshTokenHash',
  };
  const result = await sdk.user.updateUser(input, -24653011.15650305);
  console.log(result);
})();

removeUser

  • HTTP Method: DELETE
  • Endpoint: /users/{id}

Required Parameters

Name Type Description
id number

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.user.removeUser(41644941.29451275);
  console.log(result);
})();

updateEmailSubscription

  • HTTP Method: PATCH
  • Endpoint: /users/emails/subscriptions

Required Parameters

| input | object | Request body. |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { isSubscribedToEmails: true };
  const result = await sdk.user.updateEmailSubscription(input);
  console.log(result);
})();

getUserOrgs

  • HTTP Method: GET
  • Endpoint: /users/orgs

Required Parameters

Name Type Description
offset number
limit number

Return Type

PaginatedOrgResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.user.getUserOrgs(42374810.85676661, -95424349.09221289);
  console.log(result);
})();

getUserApis

  • HTTP Method: GET
  • Endpoint: /users/apis

Return Type

GetUserApisResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.user.getUserApis();
  console.log(result);
})();

getSnippetsByBuildId

  • HTTP Method: GET
  • Endpoint: /snippets/{id}

Required Parameters

Name Type Description
id number

Return Type

SnippetsResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.snippets.getSnippetsByBuildId(74793872.44383249);
  console.log(result);
})();

createToken

  • HTTP Method: POST
  • Endpoint: /auth/tokens

Required Parameters

| input | object | Request body. |

Return Type

CreateTokenResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {
    expiresAt: '2024-01-01T01:01:01.0Z',
    name: 'My token',
    scope: ['API', 'DOC', 'SDK', 'BUILD', 'ARTIFACT', 'ORG'],
  };
  const result = await sdk.token.createToken(input);
  console.log(result);
})();

findTokensByUserId

  • HTTP Method: GET
  • Endpoint: /auth/tokens

Required Parameters

Name Type Description
userId number

Return Type

FindTokensByUserIdResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.token.findTokensByUserId(46662221.82019371);
  console.log(result);
})();

getTokenById

  • HTTP Method: GET
  • Endpoint: /auth/tokens/{id}

Required Parameters

Name Type Description
id number

Return Type

GetTokenResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.token.getTokenById(51591848.27792585);
  console.log(result);
})();

removeToken

  • HTTP Method: DELETE
  • Endpoint: /auth/tokens/{id}

Required Parameters

Name Type Description
id number

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.token.removeToken(-33281085.52785687);
  console.log(result);
})();

createOrgInvite

  • HTTP Method: POST
  • Endpoint: /invitations/org/{orgId}/invite

Required Parameters

Name Type Description
orgId number
input object Request body.

Return Type

InvitationResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { email: 'harry@liblab.com' };
  const result = await sdk.invitation.createOrgInvite(input, 36126475.90427688);
  console.log(result);
})();

redeemInvite

  • HTTP Method: PATCH
  • Endpoint: /invitations/{inviteCode}/redeem

Required Parameters

Name Type Description
inviteCode string

Return Type

InvitationResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.invitation.redeemInvite('inviteCode');
  console.log(result);
})();

declineInvite

  • HTTP Method: PATCH
  • Endpoint: /invitations/{inviteCode}/decline

Required Parameters

Name Type Description
inviteCode string

Return Type

InvitationResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.invitation.declineInvite('inviteCode');
  console.log(result);
})();

getReceivedInvites

  • HTTP Method: GET
  • Endpoint: /invitations/received

Required Parameters

Name Type Description
offset number
limit number

Return Type

PaginatedOrgInvitesResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.invitation.getReceivedInvites(-24375352.674071938, -3464051.2007071674);
  console.log(result);
})();

getSentInvites

  • HTTP Method: GET
  • Endpoint: /invitations/sent

Required Parameters

Name Type Description
offset number
limit number

Return Type

PaginatedOrgInvitesResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.invitation.getSentInvites(45193843.37628311, -9013804.421277493);
  console.log(result);
})();

searchInvites

  • HTTP Method: GET
  • Endpoint: /invitations/search

Required Parameters

Name Type Description
offset number
limit number

Optional Parameters

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

Name Type Description
orgName string Name of the organization
status Status Status of the invitation
sortBy InvitationSortBy Field to sort by
direction InvitationDirection Direction to sort by

Return Type

PaginatedOrgInvitesResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.invitation.searchInvites(21003885.179783493, -89088412.17851742, {
    orgName: 'orgName',
    status: 'REDEEMED',
    sortBy: 'createdAt',
    direction: 'desc',
  });
  console.log(result);
})();

getInviteByCode

  • HTTP Method: GET
  • Endpoint: /invitations/{inviteCode}

Required Parameters

Name Type Description
inviteCode string

Return Type

InvitationResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.invitation.getInviteByCode('inviteCode');
  console.log(result);
})();

resetPasswordAuth0

  • HTTP Method: POST
  • Endpoint: /auth0/reset-password

Return Type

Auth0ResetPasswordResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.auth0.resetPasswordAuth0();
  console.log(result);
})();

getEnabledPlans

  • HTTP Method: GET
  • Endpoint: /plans/enabled

Return Type

GetEnabledPlansResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.plan.getEnabledPlans();
  console.log(result);
})();

getOrgInvoices

  • HTTP Method: GET
  • Endpoint: /orgs/{orgId}/invoices

Required Parameters

Name Type Description
orgId number

Return Type

OrgInvoicesResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.invoice.getOrgInvoices(68205751.0917134);
  console.log(result);
})();

validateSpec

  • HTTP Method: POST
  • Endpoint: /spec/validate

Required Parameters

| input | object | Request body. |

Return Type

ValidateSpecResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = {};
  const result = await sdk.spec.validateSpec(input);
  console.log(result);
})();

healthCheckControllerCheck

  • HTTP Method: GET
  • Endpoint: /health-check

Return Type

HealthCheckResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.healthCheck.healthCheckControllerCheck();
  console.log(result);
})();

create

  • HTTP Method: POST
  • Endpoint: /tags

Required Parameters

| input | object | Request body. |

Return Type

TagResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { name: 'tag' };
  const result = await sdk.tags.create(input);
  console.log(result);
})();

search

  • HTTP Method: GET
  • Endpoint: /tags

Required Parameters

Name Type Description
offset number
limit number
searchQuery string

Return Type

SearchResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.tags.search(66220480.66495013, -31578833.88995403, 'searchQuery');
  console.log(result);
})();

askAboutSpec

  • HTTP Method: POST
  • Endpoint: /ai/ask-about-spec

Required Parameters

| input | object | Request body. |

Return Type

AskAboutSpecResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { buildId: 12345, prompt: 'How can I login in this api?' };
  const result = await sdk.ai.askAboutSpec(input);
  console.log(result);
})();

sendFeedback

  • HTTP Method: POST
  • Endpoint: /feedback

Required Parameters

| input | object | Request body. |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { message: 'message', title: 'title' };
  const result = await sdk.feedback.sendFeedback(input);
  console.log(result);
})();

getUserEvents

  • HTTP Method: GET
  • Endpoint: /user-events

Required Parameters

Name Type Description
offset number
limit number

Optional Parameters

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

Name Type Description
email string
orgId number
sortBy UserEventSortBy
direction UserEventDirection
orgIds number[]
eventIds number[]

Return Type

PaginatedUserEventsResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.userEvent.getUserEvents(-82213463.15144044, -69163959.59860042, {
    email: 'email',
    orgId: 33552526.19611071,
    sortBy: 'timestamp',
    direction: 'desc',
    orgIds: [69974003.85694826, -90574864.32546203],
    eventIds: [27728325.954479784, 46468591.662644],
  });
  console.log(result);
})();

exportUserEventsToCsv

  • HTTP Method: GET
  • Endpoint: /user-events/export-to-csv

Optional Parameters

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

Name Type Description
email string
orgId number
filename string
orgIds number[]
eventIds number[]

Return Type

ExportUserEventsToCsvResponse

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const result = await sdk.userEvent.exportUserEventsToCsv({
    email: 'email',
    orgId: -61670013.41995748,
    filename: 'filename',
    orgIds: [-44136752.19071029, 24949078.963252887],
    eventIds: [72416542.43601352, 64688483.11460143],
  });
  console.log(result);
})();

trackUserPublishPrEvent

  • HTTP Method: POST
  • Endpoint: /user-events/track-user-publish-pr-event

Required Parameters

| input | object | Request body. |

Return Type

Returns a dict object.

Example Usage Code Snippet

import { Liblab } from '@liblab/sdk';

const sdk = new Liblab({ accessToken: process.env.LIBLAB_ACCESS_TOKEN });

(async () => {
  const input = { language: 'typescript', sdk: 'My SDK', success: true };
  const result = await sdk.userEvent.trackUserPublishPrEvent(input);
  console.log(result);
})();

License

License: MIT. See license in LICENSE.

Readme

Keywords

none

Package Sidebar

Install

npm i @liblab/sdk

Weekly Downloads

591

Version

0.1.170

License

MIT

Unpacked Size

358 kB

Total Files

6

Last publish

Collaborators

  • liblab-user