The Typescript SDK for Liblab.
- API version: 0.1.185
- SDK version: 0.1.185
- Installation
- Authentication
- API Endpoint Services
- API Models
- Sample Usage
- Environments
- Liblab Services
- License
npm install sdk
To see whether an endpoint needs a specific type of authentication check the endpoint's documentation.
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')
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);
}
})();
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);
A list of all services and services methods.
-
Services
Method | Description |
---|---|
createBuild | |
getBuilds | |
getBuildStatuses | |
getById | |
removeById | |
tag | |
untag | |
approveBuild | |
unApproveBuild |
Method | Description |
---|---|
getApiBuilds | |
getApiBuildTags | |
getApiSdks | |
getApiDocs | |
createApi | |
getApis | |
searchApis | |
getApiById | |
updateApi | |
getApiMembers | |
removeApi | |
getApiByOrgSlugAndApiSlug |
Method | Description |
---|---|
createOrg | |
getOrgs | |
searchOrgs | |
getOrgById | |
updateOrg | |
removeOrg | |
getApisByOrg | |
getOrgJobs | |
getDocsByOrg | |
getBuildByOrg | |
getOrgApiBuilds | |
getOrgArtifacts |
Method | Description |
---|---|
createMember | |
getByOrgId | |
updateMember | |
removeMember | |
leaveOrg | |
enableAllMembers | |
disableAllMembers |
Method | Description |
---|---|
createArtifact | |
getArtifacts | |
getArtifactStatuses | |
getArtifactById | |
removeArtifact |
Method | Description |
---|---|
createSdk | |
findSdks | |
getSdkById | |
removeSdk |
Method | Description |
---|---|
getApprovedByOrgSlugAndApiSlug | |
getAllApprovedByOrgSlugAndApiSlug | |
createDoc | |
findDocs | |
approve | |
unapprove | |
getDocById | |
removeDoc | |
updateDoc | |
getDownloadUrl |
Method | Description |
---|---|
sendShadowForm |
Method | Description |
---|---|
getActiveSubscription | |
cancelActiveSubscription | |
getActiveSubscriptionStatus | |
getSubscriptionPaymentMethodUpdateLink | |
getCheckoutLink | |
createOpenSourceSubscription |
Method | Description |
---|---|
stripeWebhook | |
syncStripeSubscriptions |
Method | Description |
---|---|
getCurrentUser | |
createUser | |
getUsers | |
getUserById | |
updateUser | |
removeUser | |
updateEmailSubscription | |
getUserOrgs | |
getUserApis |
Method | Description |
---|---|
getSnippetsByBuildId |
Method | Description |
---|---|
createToken | |
findTokensByUserId | |
getTokenById | |
removeToken |
Method | Description |
---|---|
createOrgInvite | |
redeemInvite | |
declineInvite | |
getReceivedInvites | |
getSentInvites | |
searchInvites | |
getInviteByCode |
Method | Description |
---|---|
resetPasswordAuth0 |
Method | Description |
---|---|
getEnabledPlans |
Method | Description |
---|---|
getOrgInvoices |
Method | Description |
---|---|
validateSpec |
Method | Description |
---|---|
healthCheckControllerCheck |
Method | Description |
---|---|
create | |
search |
Method | Description |
---|---|
askAboutSpec |
Method | Description |
---|---|
sendFeedback |
Method | Description |
---|---|
getUserEvents | |
exportUserEventsToCsv | |
trackUserPublishPrEvent |
- 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);
})();
- 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(
26815295.71302192,
-82420038.77660586,
-11817193.073469982,
'apiSlug',
);
console.log(result);
})();
- 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);
})();
- 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(-33061718.1545847);
console.log(result);
})();
- 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(-89590331.15426812, 'apiSlug', 51608576.90003842);
console.log(result);
})();
- 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(-37609255.26720489, -6697941.315958336);
console.log(result);
})();
- 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(-28936591.532296866, 56727144.59049946);
console.log(result);
})();
- 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(-83015548.45260029);
console.log(result);
})();
- 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(-78572397.8376526);
console.log(result);
})();
- 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(
-11363804.373702541,
39927502.81556684,
-65925843.21878693,
{
sortBy: 'status',
direction: 'asc',
statuses: ['FAILURE', 'IN_PROGRESS'],
tags: [53295023.65096301, -99182627.74780646],
createdByIds: [-78520316.77873428, -79606028.13628794],
},
);
console.log(result);
})();
- 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(18882312.747745812);
console.log(result);
})();
- 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(
-51835042.2763985,
-53114209.17925931,
-37160016.27215338,
{
statuses: ['IN_PROGRESS', 'SUCCESS'],
tags: [-27788717.15342021, 57666823.00285515],
createdByIds: [-26509699.239304975, 74745691.72099167],
languages: ['SWIFT', 'TYPESCRIPT'],
sortBy: 'createdAt',
direction: 'asc',
},
);
console.log(result);
})();
- 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(
87804326.79209295,
-11107639.54780744,
-57332664.68895092,
{
sortBy: 'createdAt',
direction: 'asc',
statuses: ['IN_PROGRESS', 'IN_PROGRESS'],
tags: [-66645639.95916981, 6869242.836644858],
createdByIds: [50381051.95675814, 98010875.24024653],
},
);
console.log(result);
})();
- 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);
})();
- 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(11439864.679566637, { apiSlug: 'apiSlug' });
console.log(result);
})();
- 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(-37101289.32062995, -4440776.041026399, {
name: 'name',
sortBy: 'createdAt',
orgId: 24544767.49697347,
direction: 'desc',
orgIds: [56215017.70926568, -54458472.72545512],
});
console.log(result);
})();
- 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(5435287.514028758);
console.log(result);
})();
- 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, -51365072.40143806);
console.log(result);
})();
- 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(-57336301.418710224);
console.log(result);
})();
- 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', 40346282.29858875);
console.log(result);
})();
- 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);
})();
- 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);
})();
- 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(-40833501.65626856, -37608413.23517456, {
direction: 'asc',
sortBy: 'startTime',
});
console.log(result);
})();
- 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(-78156203.3753179, -14859805.959770054, {
website: 'website',
domain: 'domain',
name: 'name',
});
console.log(result);
})();
- 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(10218699.190855533);
console.log(result);
})();
- 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, 69503106.25902492);
console.log(result);
})();
- 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(-28015103.949097678);
console.log(result);
})();
- 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(36224083.0958167);
console.log(result);
})();
- 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(
5461775.187048182,
51203987.85613686,
-68175819.44734299,
{
sortBy: 'startTime',
direction: 'asc',
statuses: ['IN_PROGRESS', 'IN_PROGRESS'],
createdByIds: [62664596.886624485, -81083292.59305945],
apiSlug: 'apiSlug',
apiVersion: 'apiVersion',
buildType: ['SDK', 'SNIPPETS'],
},
);
console.log(result);
})();
- 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(23008442.60942325);
console.log(result);
})();
- 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(
-7885511.539187685,
-95476557.5642528,
-39799774.110592216,
{
sortBy: 'createdAt',
direction: 'asc',
statuses: ['FAILURE', 'IN_PROGRESS'],
tags: [-16910455.6087258, -55802948.32164312],
createdByIds: [78207779.89439502, -59445905.57928357],
apiSlug: 'apiSlug',
apiVersion: 'apiVersion',
},
);
console.log(result);
})();
- 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(11572941.498785824);
console.log(result);
})();
- 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(
-46321631.07819171,
59602285.00751498,
-73131465.29648602,
{
sortBy: 'startTime',
direction: 'desc',
artifactTypes: ['DOC', 'SDK'],
statuses: [{ imports: [] }, { imports: [] }],
createdByIds: [-85474184.75583939, -35881285.985102855],
},
);
console.log(result);
})();
- 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, -35561784.90514048);
console.log(result);
})();
- 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 |
---|---|---|
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(
9789175.913530678,
94907359.02747524,
-49772296.28512635,
{
email: 'email',
firstName: 'firstName',
lastName: 'lastName',
sortBy: 'createdAt',
direction: 'asc',
},
);
console.log(result);
})();
- 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, -67000217.83529988, 52443198.51946667);
console.log(result);
})();
- 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(-27833897.87550758, 35926489.76623276);
console.log(result);
})();
- 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(-10896122.112556934);
console.log(result);
})();
- 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(32096802.340308845);
console.log(result);
})();
- 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(9963735.17862548);
console.log(result);
})();
- 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);
})();
- 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(99688550.2989062);
console.log(result);
})();
- 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);
})();
- 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(-56707853.52546805);
console.log(result);
})();
- 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(60171514.74655208);
console.log(result);
})();
- 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);
})();
- 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(71584013.27183595, -76067528.97482353, {
artifactId: 48890050.54165217,
sortBy: 'language',
direction: 'asc',
languages: ['PHP', 'JAVA'],
});
console.log(result);
})();
- 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(86779810.14950284);
console.log(result);
})();
- 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(-85102511.60966131);
console.log(result);
})();
- 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);
})();
- 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);
})();
- 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: 13350537.7943338,
artifactId: 1,
fileLocation: 'https://example.com',
previewSlug: 'previewSlug',
version: '1.0.0',
};
const result = await sdk.doc.createDoc(input);
console.log(result);
})();
- 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(60534124.21541336, -66340799.85884464, 77523481.1399574);
console.log(result);
})();
- 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);
})();
- 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);
})();
- 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(-58512347.264779404);
console.log(result);
})();
- 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(-4736358.586577356);
console.log(result);
})();
- 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, -24552055.03905748);
console.log(result);
})();
- 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(-40477458.63885961);
console.log(result);
})();
- 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);
})();
- 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(-95448227.22228722);
console.log(result);
})();
- 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(-48447083.67048986);
console.log(result);
})();
- 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(85619338.00097239);
console.log(result);
})();
- 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(
89930175.0973014,
33906595.960939124,
);
console.log(result);
})();
- 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(
-58894576.42058109,
29218059.27673544,
'month',
);
console.log(result);
})();
- 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, 35349327.376689434);
console.log(result);
})();
- 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);
})();
- 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);
})();
- 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);
})();
- 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);
})();
- 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 | |
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(30065900.421330705, -8806198.43687512, {
orgId: -68105950.21946968,
email: 'email',
firstName: 'firstName',
lastName: 'lastName',
orgIds: [-6528457.339019328, 42995315.11981726],
sortBy: 'createdAt',
direction: 'desc',
});
console.log(result);
})();
- 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(-36766331.446354926);
console.log(result);
})();
- 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 = {
auth0Id: 'auth0Id',
email: 'someone@example.com',
firstName: 'John',
isEnabled: true,
isLiblabAdmin: true,
lastName: 'Doe',
refreshTokenHash: 'refreshTokenHash',
utmParams: {},
};
const result = await sdk.user.updateUser(input, 30740264.932908624);
console.log(result);
})();
- 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(91820323.09553728);
console.log(result);
})();
- 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);
})();
- 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(4226132.455980733, -60419757.30503928);
console.log(result);
})();
- 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);
})();
- 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(-91435219.8315437);
console.log(result);
})();
- 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);
})();
- 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(-88864865.72255747);
console.log(result);
})();
- 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(-5561173.16626738);
console.log(result);
})();
- 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(25997396.124600902);
console.log(result);
})();
- 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, 91965631.77402762);
console.log(result);
})();
- 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);
})();
- 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);
})();
- 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(95420949.05127224, -73643141.84812067);
console.log(result);
})();
- 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(-86551435.99746658, -59472374.80965751);
console.log(result);
})();
- 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(26766296.169091582, -10063485.09746784, {
orgName: 'orgName',
status: 'REDEEMED',
sortBy: 'createdAt',
direction: 'desc',
});
console.log(result);
})();
- 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);
})();
- 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);
})();
- 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);
})();
- 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(-87635856.38002898);
console.log(result);
})();
- 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);
})();
- 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);
})();
- 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
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(-63247560.332134254, -40576878.707932964, 'searchQuery');
console.log(result);
})();
- 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);
})();
- 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);
})();
- 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 |
---|---|---|
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(38828421.25872624, -14175210.652228639, {
email: 'email',
orgId: 59179034.990170866,
sortBy: 'timestamp',
direction: 'desc',
orgIds: [54045869.83640006, 60309149.52213737],
eventIds: [23960314.072720394, -57269467.67769743],
});
console.log(result);
})();
- 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 |
---|---|---|
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: 10901144.699485958,
filename: 'filename',
orgIds: [-3945396.2256617844, -29863124.838313565],
eventIds: [-4445397.00509949, -16285545.007521302],
});
console.log(result);
})();
- 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: MIT. See license in LICENSE.