@platform/sdk-labs
Typed TypeScript client for services/labs. The page is generated from the SDK package source plus its generated OpenAPI types.
Installation
npm install @platform/sdk-labsYou’ll also need the shared auth/client helpers:
npm install @platform/hosts @platform/sdkQuick start
import { LoopClient } from "@platform/sdk";
import { platformHost, SERVICE_NAMES } from "@platform/hosts";
import { createLabsClient } from "@platform/sdk-labs";
const loop = new LoopClient({
clientId: process.env.LOOP_CLIENT_ID!,
clientSecret: process.env.LOOP_CLIENT_SECRET!,
redirectUri: "https://your-app.example.com/auth/loop/callback",
});
const labs = createLabsClient({
baseUrl: platformHost({ service: SERVICE_NAMES.LABS }),
accessToken: tokens.access_token,
});Use the convenience helpers below when the SDK exposes them, or call the typed endpoint methods directly with GET / POST / PATCH / DELETE.
Convenience helpers
This SDK does not add convenience helpers beyond the typed endpoint calls below.
Endpoint calls
GET /readyz
Underlying REST endpoint: GET /readyz
Parameters
None
Return type
Promise<{
data?: paths["/readyz"]["get"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.GET("/readyz");GET /v1/catalog/markers
Underlying REST endpoint: GET /v1/catalog/markers
Parameters
query?: paths["/v1/catalog/markers"]["get"]["parameters"]["query"]
Return type
Promise<{
data?: paths["/v1/catalog/markers"]["get"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.GET("/v1/catalog/markers", {
params: {
query: {
/* paths["/v1/catalog/markers"]["get"]["parameters"]["query"] */
},
},
});POST /v1/checkout
Underlying REST endpoint: POST /v1/checkout
Parameters
body: paths["/v1/checkout"]["post"]["requestBody"]["content"]["application/json"]
Return type
Promise<{
data?: paths["/v1/checkout"]["post"]["responses"]["201"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.POST("/v1/checkout", {
body: {
/* paths["/v1/checkout"]["post"]["requestBody"]["content"]["application/json"] */
},
});GET /v1/lab-catalog/panels
Underlying REST endpoint: GET /v1/lab-catalog/panels
Parameters
None
Return type
Promise<{
data?: paths["/v1/lab-catalog/panels"]["get"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.GET("/v1/lab-catalog/panels");GET /v1/lab-shares
Underlying REST endpoint: GET /v1/lab-shares
Parameters
query?: paths["/v1/lab-shares"]["get"]["parameters"]["query"]
Return type
Promise<{
data?: paths["/v1/lab-shares"]["get"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.GET("/v1/lab-shares", {
params: {
query: {
/* paths["/v1/lab-shares"]["get"]["parameters"]["query"] */
},
},
});POST /v1/lab-shares
Underlying REST endpoint: POST /v1/lab-shares
Parameters
body: paths["/v1/lab-shares"]["post"]["requestBody"]["content"]["application/json"]
Return type
Promise<{
data?: paths["/v1/lab-shares"]["post"]["responses"]["201"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.POST("/v1/lab-shares", {
body: {
/* paths["/v1/lab-shares"]["post"]["requestBody"]["content"]["application/json"] */
},
});POST /v1/lab-shares/{id}/revoke
Underlying REST endpoint: POST /v1/lab-shares/\{id\}/revoke
Parameters
path: paths["/v1/lab-shares/{id}/revoke"]["post"]["parameters"]["path"]
Return type
Promise<{
data?: paths["/v1/lab-shares/{id}/revoke"]["post"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.POST("/v1/lab-shares/{id}/revoke", {
params: {
path: {
id: "<id>",
},
},
});GET /v1/lab-shares/curated
Underlying REST endpoint: GET /v1/lab-shares/curated
Parameters
None
Return type
Promise<{
data?: paths["/v1/lab-shares/curated"]["get"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.GET("/v1/lab-shares/curated");GET /v1/lab-shares/l/{token}
Underlying REST endpoint: GET /v1/lab-shares/l/\{token\}
Parameters
path: paths["/v1/lab-shares/l/{token}"]["get"]["parameters"]["path"]query?: paths["/v1/lab-shares/l/{token}"]["get"]["parameters"]["query"]
Return type
Promise<{
data?: paths["/v1/lab-shares/l/{token}"]["get"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.GET("/v1/lab-shares/l/{token}", {
params: {
path: {
token: "<token>",
},
query: {
/* paths["/v1/lab-shares/l/{token}"]["get"]["parameters"]["query"] */
},
},
});GET /v1/lab-shares/locations
Underlying REST endpoint: GET /v1/lab-shares/locations
Parameters
query: paths["/v1/lab-shares/locations"]["get"]["parameters"]["query"]
Return type
Promise<{
data?: paths["/v1/lab-shares/locations"]["get"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.GET("/v1/lab-shares/locations", {
params: {
query: {
/* paths["/v1/lab-shares/locations"]["get"]["parameters"]["query"] */
},
},
});POST /v1/lab-shares/quote
Underlying REST endpoint: POST /v1/lab-shares/quote
Parameters
body: paths["/v1/lab-shares/quote"]["post"]["requestBody"]["content"]["application/json"]
Return type
Promise<{
data?: paths["/v1/lab-shares/quote"]["post"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.POST("/v1/lab-shares/quote", {
body: {
/* paths["/v1/lab-shares/quote"]["post"]["requestBody"]["content"]["application/json"] */
},
});GET /v1/orders/{id}
Underlying REST endpoint: GET /v1/orders/\{id\}
Parameters
path: paths["/v1/orders/{id}"]["get"]["parameters"]["path"]
Return type
Promise<{
data?: paths["/v1/orders/{id}"]["get"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.GET("/v1/orders/{id}", {
params: {
path: {
id: "<id>",
},
},
});POST /v1/orders/{id}/approval-denied
Underlying REST endpoint: POST /v1/orders/\{id\}/approval-denied
Parameters
path: paths["/v1/orders/{id}/approval-denied"]["post"]["parameters"]["path"]body?: paths["/v1/orders/{id}/approval-denied"]["post"]["requestBody"]["content"]["application/json"]
Return type
Promise<{
data?: paths["/v1/orders/{id}/approval-denied"]["post"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.POST("/v1/orders/{id}/approval-denied", {
params: {
path: {
id: "<id>",
},
},
body: {
/* paths["/v1/orders/{id}/approval-denied"]["post"]["requestBody"]["content"]["application/json"] */
},
});POST /v1/orders/{id}/approval-granted
Underlying REST endpoint: POST /v1/orders/\{id\}/approval-granted
Parameters
path: paths["/v1/orders/{id}/approval-granted"]["post"]["parameters"]["path"]
Return type
Promise<{
data?: paths["/v1/orders/{id}/approval-granted"]["post"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.POST("/v1/orders/{id}/approval-granted", {
params: {
path: {
id: "<id>",
},
},
});GET /v1/orders/{id}/notification-context
Underlying REST endpoint: GET /v1/orders/\{id\}/notification-context
Parameters
path: paths["/v1/orders/{id}/notification-context"]["get"]["parameters"]["path"]
Return type
Promise<{
data?: paths["/v1/orders/{id}/notification-context"]["get"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.GET("/v1/orders/{id}/notification-context", {
params: {
path: {
id: "<id>",
},
},
});POST /v1/orders/{id}/results-ready
Underlying REST endpoint: POST /v1/orders/\{id\}/results-ready
Parameters
path: paths["/v1/orders/{id}/results-ready"]["post"]["parameters"]["path"]body?: paths["/v1/orders/{id}/results-ready"]["post"]["requestBody"]["content"]["application/json"]
Return type
Promise<{
data?: paths["/v1/orders/{id}/results-ready"]["post"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.POST("/v1/orders/{id}/results-ready", {
params: {
path: {
id: "<id>",
},
},
body: {
/* paths["/v1/orders/{id}/results-ready"]["post"]["requestBody"]["content"]["application/json"] */
},
});DELETE /v1/orders/{orderId}/appointment
Underlying REST endpoint: DELETE /v1/orders/\{orderId\}/appointment
Parameters
path: paths["/v1/orders/{orderId}/appointment"]["delete"]["parameters"]["path"]body: paths["/v1/orders/{orderId}/appointment"]["delete"]["requestBody"]["content"]["application/json"]
Return type
Promise<{
data?: paths["/v1/orders/{orderId}/appointment"]["delete"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.DELETE("/v1/orders/{orderId}/appointment", {
params: {
path: {
orderId: "<orderId>",
},
},
body: {
/* paths["/v1/orders/{orderId}/appointment"]["delete"]["requestBody"]["content"]["application/json"] */
},
});GET /v1/orders/{orderId}/appointment
Underlying REST endpoint: GET /v1/orders/\{orderId\}/appointment
Parameters
path: paths["/v1/orders/{orderId}/appointment"]["get"]["parameters"]["path"]query: paths["/v1/orders/{orderId}/appointment"]["get"]["parameters"]["query"]
Return type
Promise<{
data?: paths["/v1/orders/{orderId}/appointment"]["get"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.GET("/v1/orders/{orderId}/appointment", {
params: {
path: {
orderId: "<orderId>",
},
query: {
/* paths["/v1/orders/{orderId}/appointment"]["get"]["parameters"]["query"] */
},
},
});PATCH /v1/orders/{orderId}/appointment
Underlying REST endpoint: PATCH /v1/orders/\{orderId\}/appointment
Parameters
path: paths["/v1/orders/{orderId}/appointment"]["patch"]["parameters"]["path"]body: paths["/v1/orders/{orderId}/appointment"]["patch"]["requestBody"]["content"]["application/json"]
Return type
Promise<{
data?: paths["/v1/orders/{orderId}/appointment"]["patch"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.PATCH("/v1/orders/{orderId}/appointment", {
params: {
path: {
orderId: "<orderId>",
},
},
body: {
/* paths["/v1/orders/{orderId}/appointment"]["patch"]["requestBody"]["content"]["application/json"] */
},
});POST /v1/orders/{orderId}/appointment
Underlying REST endpoint: POST /v1/orders/\{orderId\}/appointment
Parameters
path: paths["/v1/orders/{orderId}/appointment"]["post"]["parameters"]["path"]body: paths["/v1/orders/{orderId}/appointment"]["post"]["requestBody"]["content"]["application/json"]
Return type
Promise<{
data?: paths["/v1/orders/{orderId}/appointment"]["post"]["responses"]["201"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.POST("/v1/orders/{orderId}/appointment", {
params: {
path: {
orderId: "<orderId>",
},
},
body: {
/* paths["/v1/orders/{orderId}/appointment"]["post"]["requestBody"]["content"]["application/json"] */
},
});GET /v1/orders/{orderId}/documents/{kind}
Underlying REST endpoint: GET /v1/orders/\{orderId\}/documents/\{kind\}
Parameters
path: paths["/v1/orders/{orderId}/documents/{kind}"]["get"]["parameters"]["path"]query: paths["/v1/orders/{orderId}/documents/{kind}"]["get"]["parameters"]["query"]
Return type
Promise<{
data?: paths["/v1/orders/{orderId}/documents/{kind}"]["get"]["responses"]["200"]["content"]["application/pdf"];
error?: unknown;
response: Response;
}>Example
const result = await labs.GET("/v1/orders/{orderId}/documents/{kind}", {
params: {
path: {
orderId: "<orderId>",
kind: "<kind>",
},
query: {
/* paths["/v1/orders/{orderId}/documents/{kind}"]["get"]["parameters"]["query"] */
},
},
});GET /v1/orders/{orderId}/results
Underlying REST endpoint: GET /v1/orders/\{orderId\}/results
Parameters
path: paths["/v1/orders/{orderId}/results"]["get"]["parameters"]["path"]query: paths["/v1/orders/{orderId}/results"]["get"]["parameters"]["query"]
Return type
Promise<{
data?: paths["/v1/orders/{orderId}/results"]["get"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.GET("/v1/orders/{orderId}/results", {
params: {
path: {
orderId: "<orderId>",
},
query: {
/* paths["/v1/orders/{orderId}/results"]["get"]["parameters"]["query"] */
},
},
});GET /v1/orders/history
Underlying REST endpoint: GET /v1/orders/history
Parameters
query: paths["/v1/orders/history"]["get"]["parameters"]["query"]
Return type
Promise<{
data?: paths["/v1/orders/history"]["get"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.GET("/v1/orders/history", {
params: {
query: {
/* paths["/v1/orders/history"]["get"]["parameters"]["query"] */
},
},
});POST /v1/orders/history/request
Underlying REST endpoint: POST /v1/orders/history/request
Parameters
body: paths["/v1/orders/history/request"]["post"]["requestBody"]["content"]["application/json"]
Return type
Promise<{
data?: paths["/v1/orders/history/request"]["post"]["responses"]["202"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await labs.POST("/v1/orders/history/request", {
body: {
/* paths["/v1/orders/history/request"]["post"]["requestBody"]["content"]["application/json"] */
},
});