(integrations)
Integrations
- getConfigurations - Get configurations for the authenticated user or team
- getConfiguration - Retrieve an integration configuration
- deleteConfiguration - Delete an integration configuration
- getGitNamespaces - List git namespaces by provider
- searchRepos - List git repositories linked to namespace by provider
Allows to retrieve all configurations for an authenticated integration. When the project
view is used, configurations generated for the authorization flow will be filtered out of the results.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.integrations.getConfigurations("account");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { integrationsGetConfigurations } from "@simplesagar/vercel/funcs/integrationsGetConfigurations.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await integrationsGetConfigurations(vercel, "account");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
view |
models.View | ✔️ | N/A |
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. |
slug |
string | ➖ | The Team slug to perform the request on behalf of. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.GetConfigurationsResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Allows to retrieve a the configuration with the provided id in case it exists. The authenticated user or team must be the owner of the config in order to access it.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.integrations.getConfiguration("icfg_cuwj0AdCdH3BwWT4LPijCC7t");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { integrationsGetConfiguration } from "@simplesagar/vercel/funcs/integrationsGetConfiguration.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await integrationsGetConfiguration(vercel, "icfg_cuwj0AdCdH3BwWT4LPijCC7t");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
id |
string | ✔️ | ID of the configuration to check | [object Object] |
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. | |
slug |
string | ➖ | The Team slug to perform the request on behalf of. | |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. | |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
|
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.GetConfigurationResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Allows to remove the configuration with the id
provided in the parameters. The configuration and all of its resources will be removed. This includes Webhooks, LogDrains and Project Env variables.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await vercel.integrations.deleteConfiguration("<id>");
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { integrationsDeleteConfiguration } from "@simplesagar/vercel/funcs/integrationsDeleteConfiguration.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await integrationsDeleteConfiguration(vercel, "<id>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | N/A |
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. |
slug |
string | ➖ | The Team slug to perform the request on behalf of. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<void>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Lists git namespaces for a supported provider. Supported providers are github
, gitlab
and bitbucket
. If the provider is not provided, it will try to obtain it from the user that authenticated the request.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.integrations.getGitNamespaces();
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { integrationsGetGitNamespaces } from "@simplesagar/vercel/funcs/integrationsGetGitNamespaces.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await integrationsGetGitNamespaces(vercel);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
host |
string | ➖ | The custom Git host if using a custom Git provider, like GitHub Enterprise Server | [object Object] |
provider |
models.Provider | ➖ | N/A | |
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. | |
slug |
string | ➖ | The Team slug to perform the request on behalf of. | |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. | |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
|
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.GitNamespacesResponseBody[]>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Lists git repositories linked to a namespace id
for a supported provider. A specific namespace id
can be obtained via the git-namespaces
endpoint. Supported providers are github
, gitlab
and bitbucket
. If the provider or namespace is not provided, it will try to obtain it from the user that authenticated the request.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.integrations.searchRepos({});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { integrationsSearchRepos } from "@simplesagar/vercel/funcs/integrationsSearchRepos.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await integrationsSearchRepos(vercel, {});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.SearchRepoRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.SearchRepoResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |