New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@liblab/sdk

Package Overview
Dependencies
Maintainers
1
Versions
433
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@liblab/sdk

Liblab

  • 0.1.346
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Liblab Typescript SDK 0.1.346

The Typescript SDK for Liblab.

  • API version: 0.1.346
  • SDK version: 0.1.346

Table of Contents

  • Installation
  • Authentication
  • API Endpoint Services
  • API Models
  • Sample Usage
  • Environments
  • Liblab Services
  • License

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

MethodDescription
createBuild
getBuilds
createSimpleBuild
createBuildArtifact
getBuildStatuses
getById
removeById
tag
untag
approveBuild
unApproveBuild

Api

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

Org

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

OrgMember

MethodDescription
createMember
getByOrgId
updateMember
removeMember
leaveOrg
enableAllMembers
disableAllMembers

Artifact

MethodDescription
createArtifact
getArtifacts
getArtifactStatuses
getArtifactById
removeArtifact

Sdk

MethodDescription
createSdk
findSdks
getSdkById
removeSdk

Doc

MethodDescription
getApprovedByOrgSlugAndApiSlug
getAllApprovedByOrgSlugAndApiSlug
createDoc
findDocs
approve
unapprove
getDocById
removeDoc
updateDoc
getDownloadUrl

HubSpot

MethodDescription
sendShadowForm

OrgSubscriptions

MethodDescription
getActiveSubscription
cancelActiveSubscription
getActiveSubscriptionStatus
getSubscriptionPaymentMethodUpdateLink
getCheckoutLink

Subscriptions

MethodDescription
getSubscriptionsOverview

PaymentProvider

MethodDescription
stripeWebhook
syncStripeSubscriptions

User

MethodDescription
getCurrentUser
createUser
getUsers
getUserById
updateUser
removeUser
updateEmailSubscription
getUserOrgs
getUserApis

Snippets

MethodDescription
getSnippetsByBuildId

Workflows

MethodDescription
uploadWorkflows

SpecValidation

MethodDescription
validateSpec
getSpecValidation

Token

MethodDescription
createToken
findTokensByUserId
getTokenById
removeToken

Invitation

MethodDescription
createOrgInvite
redeemInvite
declineInvite
getReceivedInvites
getSentInvites
searchInvites
getInviteByCode

Auth0

MethodDescription
resetPasswordAuth0
passwordlessVerifyPassword
passwordlessSetupPassword

Plan

MethodDescription
getEnabledPlans

Invoice

MethodDescription
getOrgInvoices

HealthCheck

MethodDescription
healthCheckControllerCheck

Tags

MethodDescription
create
search

Ai

MethodDescription
askAboutSpec

Feedback

MethodDescription
sendFeedback

UserEvent

MethodDescription
getUserEvents
exportUserEventsToCsv
trackUserPublishPrEvent

ThirdPartyApplications

MethodDescription
thirdPartyApplicationsControllerCreate
thirdPartyApplicationsControllerGetAll
thirdPartyApplicationsControllerGetByOrgId
thirdPartyApplicationsControllerDeleteById

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

NameTypeDescription
offsetnumber
limitnumber
orgIdnumber
apiSlugstring

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(
    -83215341.94533959,
    -67616548.5623457,
    20442911.769958094,
    'apiSlug',
  );
  console.log(result);
})();

createSimpleBuild

  • HTTP Method: POST
  • Endpoint: /builds/simple

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 = {
    apiId: 1,
    authentication: {},
    baseUrl: 'https://api-dev.liblab.com',
    docs: ['enhancedApiSpec', 'snippets', 'api'],
    languages: ['typescript'],
    liblabVersion: '2',
    sdkName: 'liblab',
    sdkVersion: '1.0.0',
  };
  const result = await sdk.build.createSimpleBuild(input);
  console.log(result);
})();

createBuildArtifact

  • HTTP Method: POST
  • Endpoint: /builds/{id}/artifact

Required Parameters

NameTypeDescription
idnumber
inputobjectRequest 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.createBuildArtifact(input, 99362000.98300713);
  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

NameTypeDescription
idnumber

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(63015827.67131135);
  console.log(result);
})();

removeById

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

Required Parameters

NameTypeDescription
buildIdnumber
apiSlugstring
orgIdnumber

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(-87790891.51382822, 'apiSlug', 11847050.501020283);
  console.log(result);
})();

tag

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

Required Parameters

NameTypeDescription
buildIdnumber
tagIdnumber

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(42243271.19032255, -26577272.567566454);
  console.log(result);
})();

untag

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

Required Parameters

NameTypeDescription
buildIdnumber
tagIdnumber

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(-97538115.75367513, 81360428.68486172);
  console.log(result);
})();

approveBuild

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

Required Parameters

NameTypeDescription
buildIdnumber

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(45781238.526785195);
  console.log(result);
})();

unApproveBuild

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

Required Parameters

NameTypeDescription
buildIdnumber

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(-89324465.47852635);
  console.log(result);
})();

getApiBuilds

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

Required Parameters

NameTypeDescription
idnumber
offsetnumber
limitnumber

Optional Parameters

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

NameTypeDescription
sortBySortBy
directionDirection
statusesstring[]
tagsnumber[]
createdByIdsnumber[]

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(
    73122582.83314651,
    -76646165.75125955,
    -40711089.17931215,
    {
      sortBy: 'status',
      direction: 'asc',
      statuses: ['SUCCESS', 'IN_PROGRESS'],
      tags: [17013901.21561323, 35085404.26250577],
      createdByIds: [-90017651.1106793, 9051541.281343937],
    },
  );
  console.log(result);
})();

getApiBuildTags

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

Required Parameters

NameTypeDescription
idnumber

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(-22629740.42899652);
  console.log(result);
})();

getApiSdks

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

Required Parameters

NameTypeDescription
idnumber
offsetnumber
limitnumber

Optional Parameters

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

NameTypeDescription
statusesstring[]
tagsnumber[]
createdByIdsnumber[]
languagesstring[]
sortByApiSortBy
directionDirection

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(
    -47544081.907073244,
    -83041543.73743567,
    -65057253.91768037,
    {
      statuses: ['FAIL', 'IN_PROGRESS'],
      tags: [87907600.5582884, 84097925.32551038],
      createdByIds: [81236044.3826249, -23845287.931775033],
      languages: ['CSHARP', 'PHP'],
      sortBy: 'createdAt',
      direction: 'asc',
    },
  );
  console.log(result);
})();

getApiDocs

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

Required Parameters

NameTypeDescription
idnumber
offsetnumber
limitnumber

Optional Parameters

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

NameTypeDescription
sortByApiSortBy
directionDirection
statusesstring[]
tagsnumber[]
createdByIdsnumber[]

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(
    -85119973.52979898,
    -14990792.37830703,
    -65279828.7217211,
    {
      sortBy: 'createdAt',
      direction: 'asc',
      statuses: ['IN_PROGRESS', 'FAIL'],
      tags: [4690866.823789671, -34674244.75452545],
      createdByIds: [79518371.36911887, 53153983.94148186],
    },
  );
  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

NameTypeDescription
orgIdnumber

Optional Parameters

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

NameTypeDescription
apiSlugstring

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(-94541188.40029979, { apiSlug: 'apiSlug' });
  console.log(result);
})();

searchApis

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

Required Parameters

NameTypeDescription
offsetnumber
limitnumber

Optional Parameters

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

NameTypeDescription
namestring
sortByApiSortBy
orgIdnumber
directionApiDirection
orgIdsnumber[]

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(46348869.209112704, -95028065.33808433, {
    name: 'name',
    sortBy: 'createdAt',
    orgId: 98045618.3279599,
    direction: 'desc',
    orgIds: [-55586208.288178615, 74464424.24137682],
  });
  console.log(result);
})();

getApiById

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

Required Parameters

NameTypeDescription
idnumber

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(38791569.15292171);
  console.log(result);
})();

updateApi

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

Required Parameters

NameTypeDescription
idnumber
inputobjectRequest 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, -9082398.051585153);
  console.log(result);
})();

getApiMembers

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

Required Parameters

NameTypeDescription
idnumber

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(-8539381.25681442);
  console.log(result);
})();

removeApi

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

Required Parameters

NameTypeDescription
apiSlugstring
orgIdnumber

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', -45189898.51708599);
  console.log(result);
})();

getApiByOrgSlugAndApiSlug

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

Required Parameters

NameTypeDescription
orgSlugstring
apiSlugstring

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

NameTypeDescription
offsetnumber
limitnumber

Optional Parameters

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

NameTypeDescription
directionDirection
sortByOrgSortBy

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(-99689478.85931012, -73610302.9699369, {
    direction: 'asc',
    sortBy: 'startTime',
  });
  console.log(result);
})();

searchOrgs

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

Required Parameters

NameTypeDescription
offsetnumber
limitnumber

Optional Parameters

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

NameTypeDescription
websitestring
domainstring
namestring

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(-65231341.547675245, -95393184.27051769, {
    website: 'website',
    domain: 'domain',
    name: 'name',
  });
  console.log(result);
})();

getOrgById

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

Required Parameters

NameTypeDescription
idnumber

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(-82005424.77297139);
  console.log(result);
})();

updateOrg

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

Required Parameters

NameTypeDescription
idnumber
inputobjectRequest 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, -8710292.057702377);
  console.log(result);
})();

removeOrg

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

Required Parameters

NameTypeDescription
idnumber

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(-80555927.46942294);
  console.log(result);
})();

getApisByOrg

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

Required Parameters

NameTypeDescription
idnumber

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(-59539046.88916496);
  console.log(result);
})();

getOrgJobs

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

Required Parameters

NameTypeDescription
idnumber
offsetnumber
limitnumber

Optional Parameters

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

NameTypeDescription
sortByOrgSortBy
directionDirection
statusesstring[]
createdByIdsnumber[]
apiSlugstring
apiVersionstring
buildTypestring[]

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(
    -8425584.610679105,
    -75083795.83248681,
    -17677991.079212114,
    {
      sortBy: 'status',
      direction: 'asc',
      statuses: ['SUCCESS', 'IN_PROGRESS'],
      createdByIds: [40409271.917010814, -77479505.92979994],
      apiSlug: 'apiSlug',
      apiVersion: 'apiVersion',
      buildType: ['DOC', 'SDK'],
    },
  );
  console.log(result);
})();

getDocsByOrg

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

Required Parameters

NameTypeDescription
idnumber

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(-80024009.40144874);
  console.log(result);
})();

getBuildByOrg

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

Required Parameters

NameTypeDescription
idnumber
offsetnumber
limitnumber

Optional Parameters

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

NameTypeDescription
sortByOrgSortBy
directionDirection
statusesstring[]
tagsnumber[]
createdByIdsnumber[]
apiSlugstring
apiVersionstring

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(
    40354778.52739784,
    -52073488.43756887,
    -81565294.52232155,
    {
      sortBy: 'status',
      direction: 'asc',
      statuses: ['IN_PROGRESS', 'IN_PROGRESS'],
      tags: [-41172638.86242304, -10922224.555274561],
      createdByIds: [-79837103.07438563, 56025660.461156964],
      apiSlug: 'apiSlug',
      apiVersion: 'apiVersion',
    },
  );
  console.log(result);
})();

getOrgApiBuilds

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

Required Parameters

NameTypeDescription
idnumber

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(-63499547.471065655);
  console.log(result);
})();

getOrgArtifacts

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

Required Parameters

NameTypeDescription
idnumber
offsetnumber
limitnumber

Optional Parameters

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

NameTypeDescription
sortByOrgSortBy
directionOrgDirection
artifactTypesArtifactTypes
statusesOrgStatuses
createdByIdsnumber[]

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(
    96898176.24526751,
    8628543.6252639,
    -92761027.76756868,
    {
      sortBy: 'startTime',
      direction: 'desc',
      artifactTypes: ['DOC', 'SDK'],
      statuses: [{ imports: [] }, { imports: [] }],
      createdByIds: [24013387.06917602, 44921439.06854901],
    },
  );
  console.log(result);
})();

createMember

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

Required Parameters

NameTypeDescription
orgIdnumber
inputobjectRequest 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, -28149763.41898538);
  console.log(result);
})();

getByOrgId

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

Required Parameters

NameTypeDescription
orgIdnumber
offsetnumber
limitnumber

Optional Parameters

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

NameTypeDescription
emailstring
firstNamestring
lastNamestring
sortByOrgMemberSortBy
directionDirection

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(
    90027733.61251837,
    25823948.840221122,
    -86258213.58463855,
    {
      email: 'email',
      firstName: 'firstName',
      lastName: 'lastName',
      sortBy: 'createdAt',
      direction: 'asc',
    },
  );
  console.log(result);
})();

updateMember

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

Required Parameters

NameTypeDescription
userIdnumber
orgIdnumber
inputobjectRequest 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, 67387276.54156339, -80791721.6214693);
  console.log(result);
})();

removeMember

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

Required Parameters

NameTypeDescription
userIdnumber
orgIdnumber

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(-33572158.607363135, 19831152.721365303);
  console.log(result);
})();

leaveOrg

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

Required Parameters

NameTypeDescription
orgIdnumber

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(40619385.2057533);
  console.log(result);
})();

enableAllMembers

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

Required Parameters

NameTypeDescription
orgIdnumber

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(37911071.82434389);
  console.log(result);
})();

disableAllMembers

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

Required Parameters

NameTypeDescription
orgIdnumber

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(58312339.508603066);
  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

NameTypeDescription
buildIdnumber

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(41911406.76875889);
  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

NameTypeDescription
idnumber

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(94016051.5604473);
  console.log(result);
})();

removeArtifact

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

Required Parameters

NameTypeDescription
idnumber

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(-59966937.95277568);
  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

NameTypeDescription
offsetnumber
limitnumber

Optional Parameters

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

NameTypeDescription
artifactIdnumber
sortBySdkSortBy
directionDirection
languagesstring[]

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(-31124935.740910724, -51735411.72089415, {
    artifactId: -16617744.312318414,
    sortBy: 'version',
    direction: 'asc',
    languages: ['TERRAFORM', 'TYPESCRIPT'],
  });
  console.log(result);
})();

getSdkById

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

Required Parameters

NameTypeDescription
idnumber

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(60387710.818670064);
  console.log(result);
})();

removeSdk

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

Required Parameters

NameTypeDescription
idnumber

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(-21852972.692654938);
  console.log(result);
})();

getApprovedByOrgSlugAndApiSlug

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

Required Parameters

NameTypeDescription
orgSlugstring

Optional Parameters

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

NameTypeDescription
apiSlugstring
apiVersionstring

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

NameTypeDescription
orgSlugstring

Optional Parameters

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

NameTypeDescription
apiSlugstring
apiVersionstring

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: -52163707.012023374,
    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

NameTypeDescription
offsetnumber
limitnumber
artifactIdnumber

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(
    22167091.544198006,
    -31973874.040948853,
    -75183554.20543864,
  );
  console.log(result);
})();

approve

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

Required Parameters

NameTypeDescription
previewSlugstring

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

NameTypeDescription
previewSlugstring

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

NameTypeDescription
idnumber

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(25596416.20404589);
  console.log(result);
})();

removeDoc

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

Required Parameters

NameTypeDescription
idnumber

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(4077165.4730666876);
  console.log(result);
})();

updateDoc

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

Required Parameters

NameTypeDescription
idnumber
inputobjectRequest 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, -61401299.312518895);
  console.log(result);
})();

getDownloadUrl

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

Required Parameters

NameTypeDescription
idnumber

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(33286979.682141155);
  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

NameTypeDescription
orgIdnumber

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.orgSubscriptions.getActiveSubscription(82491487.84293982);
  console.log(result);
})();

cancelActiveSubscription

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

Required Parameters

NameTypeDescription
orgIdnumber

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.orgSubscriptions.cancelActiveSubscription(88247792.79261377);
  console.log(result);
})();

getActiveSubscriptionStatus

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

Required Parameters

NameTypeDescription
orgIdnumber

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.orgSubscriptions.getActiveSubscriptionStatus(-35399477.57252699);
  console.log(result);
})();

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

Required Parameters

NameTypeDescription
orgIdnumber
subscriptionIdnumber

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.orgSubscriptions.getSubscriptionPaymentMethodUpdateLink(
    -90878399.28328724,
    -74308026.39640644,
  );
  console.log(result);
})();

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

Required Parameters

NameTypeDescription
orgIdnumber
planIdnumber
billingIntervalBillingInterval

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.orgSubscriptions.getCheckoutLink(
    -59719059.54607135,
    -48096601.571066566,
    'year',
  );
  console.log(result);
})();

getSubscriptionsOverview

  • HTTP Method: GET
  • Endpoint: /subscriptions

Return Type

SubscriptionsOverviewResponse

Example Usage Code Snippet

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

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

(async () => {
  const result = await sdk.subscriptions.getSubscriptionsOverview();
  console.log(result);
})();

stripeWebhook

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

Required Parameters

NameTypeDescription
stripeSignaturestring

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

NameTypeDescription
offsetnumber
limitnumber

Optional Parameters

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

NameTypeDescription
orgIdnumber
emailstring
firstNamestring
lastNamestring
orgIdsnumber[]
sortByUserSortBy
directionUserDirection

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(19669944.431398228, -97748849.35278863, {
    orgId: -49057939.84840266,
    email: 'email',
    firstName: 'firstName',
    lastName: 'lastName',
    orgIds: [-26364785.142752737, 92116343.20718268],
    sortBy: 'createdAt',
    direction: 'desc',
  });
  console.log(result);
})();

getUserById

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

Required Parameters

NameTypeDescription
idnumber

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(-34024660.77657325);
  console.log(result);
})();

updateUser

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

Required Parameters

NameTypeDescription
idnumber
inputobjectRequest 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: 'auth0Id',
    email: 'someone@example.com',
    firstName: 'John',
    isEnabled: true,
    isLiblabAdmin: true,
    isLiblabFinanceAdmin: false,
    lastName: 'Doe',
    refreshTokenHash: 'refreshTokenHash',
    utmParams: {},
  };
  const result = await sdk.user.updateUser(input, -44381185.20403735);
  console.log(result);
})();

removeUser

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

Required Parameters

NameTypeDescription
idnumber

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(-77376500.19288468);
  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

NameTypeDescription
offsetnumber
limitnumber

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(6719537.392789692, -13688248.110467881);
  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

NameTypeDescription
idnumber

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(75473230.04976979);
  console.log(result);
})();

uploadWorkflows

  • HTTP Method: POST
  • Endpoint: /workflows

Required Parameters

| input | object | Request body. |

Return Type

CreateWorkflowsResponse

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.workflows.uploadWorkflows(input);
  console.log(result);
})();

validateSpec

  • HTTP Method: POST
  • Endpoint: /spec-validations

Required Parameters

| input | object | Request body. |

Return Type

SpecValidationResponse

Example Usage Code Snippet

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

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

(async () => {
  const input = { apiId: 1 };
  const result = await sdk.specValidation.validateSpec(input);
  console.log(result);
})();

getSpecValidation

  • HTTP Method: GET
  • Endpoint: /spec-validations/{id}

Required Parameters

NameTypeDescription
idnumber

Return Type

SpecValidationResponse

Example Usage Code Snippet

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

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

(async () => {
  const result = await sdk.specValidation.getSpecValidation(56875084.772369325);
  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: '2025-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

NameTypeDescription
userIdnumber

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(-33619416.07427017);
  console.log(result);
})();

getTokenById

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

Required Parameters

NameTypeDescription
idnumber

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(66298940.83619732);
  console.log(result);
})();

removeToken

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

Required Parameters

NameTypeDescription
idnumber

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(7383298.7622538805);
  console.log(result);
})();

createOrgInvite

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

Required Parameters

NameTypeDescription
orgIdnumber
inputobjectRequest 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, 30906176.020276234);
  console.log(result);
})();

redeemInvite

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

Required Parameters

NameTypeDescription
inviteCodestring

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

NameTypeDescription
inviteCodestring

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

NameTypeDescription
offsetnumber
limitnumber

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(60400507.19605091, -32707400.074951097);
  console.log(result);
})();

getSentInvites

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

Required Parameters

NameTypeDescription
offsetnumber
limitnumber

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(-87054814.25675425, -67860905.79077382);
  console.log(result);
})();

searchInvites

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

Required Parameters

NameTypeDescription
offsetnumber
limitnumber

Optional Parameters

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

NameTypeDescription
orgNamestringName of the organization
statusStatusStatus of the invitation
sortByInvitationSortByField to sort by
directionInvitationDirectionDirection 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(-33864949.04397579, -35153948.74386892, {
    orgName: 'orgName',
    status: 'REDEEMED',
    sortBy: 'createdAt',
    direction: 'desc',
  });
  console.log(result);
})();

getInviteByCode

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

Required Parameters

NameTypeDescription
inviteCodestring

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);
})();

passwordlessVerifyPassword

  • HTTP Method: POST
  • Endpoint: /auth0/passwordless/verify-password

Return Type

VerifyPasswordResponseDto

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.passwordlessVerifyPassword();
  console.log(result);
})();

passwordlessSetupPassword

  • HTTP Method: POST
  • Endpoint: /auth0/passwordless/setup-password

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 = { password: 'P@ssw0rd123' };
  const result = await sdk.auth0.passwordlessSetupPassword(input);
  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

NameTypeDescription
orgIdnumber

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(34417706.94895059);
  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);
})();

  • HTTP Method: GET
  • Endpoint: /tags

Required Parameters

NameTypeDescription
offsetnumber
limitnumber
searchQuerystring

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(5833277.400742397, -74395721.36800645, '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

NameTypeDescription
offsetnumber
limitnumber

Optional Parameters

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

NameTypeDescription
emailstring
orgIdnumber
sortByUserEventSortBy
directionUserEventDirection
orgIdsnumber[]
eventIdsnumber[]

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(61932207.06150472, -59754773.50568741, {
    email: 'email',
    orgId: 13889079.682712018,
    sortBy: 'timestamp',
    direction: 'desc',
    orgIds: [-90447434.59200265, -65964410.4207942],
    eventIds: [-53763964.83424015, 65144471.04700917],
  });
  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'}

NameTypeDescription
emailstring
orgIdnumber
filenamestring
orgIdsnumber[]
eventIdsnumber[]

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: 64324217.4852781,
    filename: 'filename',
    orgIds: [-92228321.42203777, 51774758.403790146],
    eventIds: [79154458.70100442, 84449590.64936987],
  });
  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);
})();

thirdPartyApplicationsControllerCreate

  • HTTP Method: POST
  • Endpoint: /third-party-applications

Required Parameters

| input | object | Request body. |

Return Type

ThirdPartyApplicationResponse

Example Usage Code Snippet

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

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

(async () => {
  const input = {
    callbackUrls: ['http://localhost:3000/api/auth/callback'],
    logoUrl: 'https://liblab.com/img/logo.svg',
    name: 'third-party application',
    orgId: 1,
  };
  const result = await sdk.thirdPartyApplications.thirdPartyApplicationsControllerCreate(input);
  console.log(result);
})();

thirdPartyApplicationsControllerGetAll

  • HTTP Method: GET
  • Endpoint: /third-party-applications

Return Type

ThirdPartyApplicationsControllerGetAllResponse

Example Usage Code Snippet

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

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

(async () => {
  const result = await sdk.thirdPartyApplications.thirdPartyApplicationsControllerGetAll();
  console.log(result);
})();

thirdPartyApplicationsControllerGetByOrgId

  • HTTP Method: GET
  • Endpoint: /third-party-applications/{id}

Required Parameters

NameTypeDescription
idnumber

Return Type

ThirdPartyApplicationsControllerGetByOrgIdResponse

Example Usage Code Snippet

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

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

(async () => {
  const result = await sdk.thirdPartyApplications.thirdPartyApplicationsControllerGetByOrgId(
    -25288976.18974875,
  );
  console.log(result);
})();

thirdPartyApplicationsControllerDeleteById

  • HTTP Method: DELETE
  • Endpoint: /third-party-applications/{id}

Required Parameters

NameTypeDescription
idnumber

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.thirdPartyApplications.thirdPartyApplicationsControllerDeleteById(
    -26711852.81312667,
  );
  console.log(result);
})();

License

License: MIT. See license in LICENSE.

FAQs

Package last updated on 23 Jan 2025

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