@vercel/sdk
Version:
<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>
398 lines • 18.8 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { safeParse } from "../lib/schemas.js";
import * as types from "../types/primitives.js";
import { smartUnion } from "../types/smartUnion.js";
/**
* The configuration status. Optional. If not defined, assume 'ready'.
*/
export const GetConfigurationResponseBodyIntegrationsResponseStatus = {
Error: "error",
Onboarding: "onboarding",
Pending: "pending",
Ready: "ready",
Resumed: "resumed",
Suspended: "suspended",
Uninstalled: "uninstalled",
};
/**
* Source defines where the configuration was installed from. It is used to analyze user engagement for integration installations in product metrics.
*/
export const GetConfigurationResponseBodyIntegrationsResponseSource = {
Backoffice: "backoffice",
Cli: "cli",
DeployButton: "deploy-button",
External: "external",
ImportRecommendedIntegrations: "import-recommended-integrations",
Marketplace: "marketplace",
Oauth: "oauth",
Organization: "organization",
ResourceClaims: "resource-claims",
V0: "v0",
};
export const GetConfigurationResponseBodyIntegrationsResponseType = {
IntegrationConfiguration: "integration-configuration",
};
export const GetConfigurationResponseBodyIntegrationsResponseDisabledReason = {
AccountPlanDowngrade: "account-plan-downgrade",
DisabledByAdmin: "disabled-by-admin",
DisabledByOwner: "disabled-by-owner",
FeatureNotAvailable: "feature-not-available",
OriginalOwnerLeftTheTeam: "original-owner-left-the-team",
OriginalOwnerRoleDowngraded: "original-owner-role-downgraded",
};
/**
* Defines the installation type. - 'external' integrations are installed via the existing integrations flow - 'marketplace' integrations are natively installed: - when accepting the TOS of a partner during the store creation process - if undefined, assume 'external'
*/
export const GetConfigurationResponseBodyIntegrationsResponseInstallationType = {
External: "external",
Marketplace: "marketplace",
};
/**
* The configuration status. Optional. If not defined, assume 'ready'.
*/
export const GetConfigurationResponseBodyIntegrationsStatus = {
Error: "error",
Onboarding: "onboarding",
Pending: "pending",
Ready: "ready",
Resumed: "resumed",
Suspended: "suspended",
Uninstalled: "uninstalled",
};
/**
* Source defines where the configuration was installed from. It is used to analyze user engagement for integration installations in product metrics.
*/
export const GetConfigurationResponseBodyIntegrationsSource = {
Backoffice: "backoffice",
Cli: "cli",
DeployButton: "deploy-button",
External: "external",
ImportRecommendedIntegrations: "import-recommended-integrations",
Marketplace: "marketplace",
Oauth: "oauth",
Organization: "organization",
ResourceClaims: "resource-claims",
V0: "v0",
};
export const GetConfigurationResponseBodyIntegrationsType = {
IntegrationConfiguration: "integration-configuration",
};
export const GetConfigurationResponseBodyIntegrationsDisabledReason = {
AccountPlanDowngrade: "account-plan-downgrade",
DisabledByAdmin: "disabled-by-admin",
DisabledByOwner: "disabled-by-owner",
FeatureNotAvailable: "feature-not-available",
OriginalOwnerLeftTheTeam: "original-owner-left-the-team",
OriginalOwnerRoleDowngraded: "original-owner-role-downgraded",
};
/**
* Defines the installation type. - 'external' integrations are installed via the existing integrations flow - 'marketplace' integrations are natively installed: - when accepting the TOS of a partner during the store creation process - if undefined, assume 'external'
*/
export const GetConfigurationResponseBodyIntegrationsInstallationType = {
External: "external",
Marketplace: "marketplace",
};
/**
* A string representing the permission for projects. Possible values are `all` or `selected`.
*/
export const ProjectSelection = {
All: "all",
Selected: "selected",
};
export const GetConfigurationResponseBodyLevel = {
Error: "error",
Info: "info",
Warn: "warn",
};
export const TransferRequestType = {
Prepayment: "prepayment",
Subscription: "subscription",
};
export const TransferRequestScope = {
Installation: "installation",
Resource: "resource",
};
/**
* The configuration status. Optional. If not defined, assume 'ready'.
*/
export const GetConfigurationResponseBodyStatus = {
Error: "error",
Onboarding: "onboarding",
Pending: "pending",
Ready: "ready",
Resumed: "resumed",
Suspended: "suspended",
Uninstalled: "uninstalled",
};
export const GetConfigurationResponseBodyType = {
IntegrationConfiguration: "integration-configuration",
};
/**
* Source defines where the configuration was installed from. It is used to analyze user engagement for integration installations in product metrics.
*/
export const GetConfigurationResponseBodySource = {
Backoffice: "backoffice",
Cli: "cli",
DeployButton: "deploy-button",
External: "external",
ImportRecommendedIntegrations: "import-recommended-integrations",
Marketplace: "marketplace",
Oauth: "oauth",
Organization: "organization",
ResourceClaims: "resource-claims",
V0: "v0",
};
export const GetConfigurationResponseBodyDisabledReason = {
AccountPlanDowngrade: "account-plan-downgrade",
DisabledByAdmin: "disabled-by-admin",
DisabledByOwner: "disabled-by-owner",
FeatureNotAvailable: "feature-not-available",
OriginalOwnerLeftTheTeam: "original-owner-left-the-team",
OriginalOwnerRoleDowngraded: "original-owner-role-downgraded",
};
/**
* Defines the installation type. - 'external' integrations are installed via the existing integrations flow - 'marketplace' integrations are natively installed: - when accepting the TOS of a partner during the store creation process - if undefined, assume 'external'
*/
export const GetConfigurationResponseBodyInstallationType = {
External: "external",
Marketplace: "marketplace",
};
/** @internal */
export const GetConfigurationRequest$outboundSchema = z.object({
id: z.string(),
teamId: z.string().optional(),
slug: z.string().optional(),
});
export function getConfigurationRequestToJSON(getConfigurationRequest) {
return JSON.stringify(GetConfigurationRequest$outboundSchema.parse(getConfigurationRequest));
}
/** @internal */
export const GetConfigurationResponseBodyIntegrationsResponseStatus$inboundSchema = z.nativeEnum(GetConfigurationResponseBodyIntegrationsResponseStatus);
/** @internal */
export const GetConfigurationResponseBodyIntegrationsResponseSource$inboundSchema = z.nativeEnum(GetConfigurationResponseBodyIntegrationsResponseSource);
/** @internal */
export const GetConfigurationResponseBodyIntegrationsResponseType$inboundSchema = z.nativeEnum(GetConfigurationResponseBodyIntegrationsResponseType);
/** @internal */
export const GetConfigurationResponseBodyIntegrationsResponseDisabledReason$inboundSchema = z.nativeEnum(GetConfigurationResponseBodyIntegrationsResponseDisabledReason);
/** @internal */
export const GetConfigurationResponseBodyIntegrationsResponseInstallationType$inboundSchema = z.nativeEnum(GetConfigurationResponseBodyIntegrationsResponseInstallationType);
/** @internal */
export const GetConfigurationResponseBody3$inboundSchema = z.object({
completedAt: types.optional(types.number()),
createdAt: types.optional(types.number()),
id: types.optional(types.string()),
integrationId: types.optional(types.string()),
ownerId: types.optional(types.string()),
status: types.optional(GetConfigurationResponseBodyIntegrationsResponseStatus$inboundSchema),
externalId: types.optional(types.string()),
projects: types.optional(z.array(types.string())),
source: types.optional(GetConfigurationResponseBodyIntegrationsResponseSource$inboundSchema),
slug: types.optional(types.string()),
teamId: z.nullable(types.string()).optional(),
type: types.optional(GetConfigurationResponseBodyIntegrationsResponseType$inboundSchema),
updatedAt: types.optional(types.number()),
userId: types.optional(types.string()),
scopes: types.optional(z.array(types.string())),
disabledAt: types.optional(types.number()),
deletedAt: z.nullable(types.number()).optional(),
deleteRequestedAt: z.nullable(types.number()).optional(),
customerDeleteRequestedAt: z.nullable(types.number()).optional(),
disabledReason: types.optional(GetConfigurationResponseBodyIntegrationsResponseDisabledReason$inboundSchema),
installationType: types.optional(GetConfigurationResponseBodyIntegrationsResponseInstallationType$inboundSchema),
acceptedPoliciesInheritedFromInstallationId: types.optional(types.string()),
});
export function getConfigurationResponseBody3FromJSON(jsonString) {
return safeParse(jsonString, (x) => GetConfigurationResponseBody3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetConfigurationResponseBody3' from JSON`);
}
/** @internal */
export const GetConfigurationResponseBodyIntegrationsStatus$inboundSchema = z
.nativeEnum(GetConfigurationResponseBodyIntegrationsStatus);
/** @internal */
export const GetConfigurationResponseBodyIntegrationsSource$inboundSchema = z
.nativeEnum(GetConfigurationResponseBodyIntegrationsSource);
/** @internal */
export const GetConfigurationResponseBodyIntegrationsType$inboundSchema = z
.nativeEnum(GetConfigurationResponseBodyIntegrationsType);
/** @internal */
export const GetConfigurationResponseBodyIntegrationsDisabledReason$inboundSchema = z.nativeEnum(GetConfigurationResponseBodyIntegrationsDisabledReason);
/** @internal */
export const GetConfigurationResponseBodyIntegrationsInstallationType$inboundSchema = z.nativeEnum(GetConfigurationResponseBodyIntegrationsInstallationType);
/** @internal */
export const GetConfigurationResponseBody2$inboundSchema = z.object({
completedAt: types.optional(types.number()),
createdAt: types.number(),
id: types.string(),
integrationId: types.string(),
ownerId: types.string(),
status: types.optional(GetConfigurationResponseBodyIntegrationsStatus$inboundSchema),
externalId: types.optional(types.string()),
projects: types.optional(z.array(types.string())),
source: types.optional(GetConfigurationResponseBodyIntegrationsSource$inboundSchema),
slug: types.string(),
teamId: z.nullable(types.string()).optional(),
type: GetConfigurationResponseBodyIntegrationsType$inboundSchema,
updatedAt: types.number(),
userId: types.string(),
scopes: z.array(types.string()),
disabledAt: types.optional(types.number()),
deletedAt: z.nullable(types.number()).optional(),
deleteRequestedAt: z.nullable(types.number()).optional(),
customerDeleteRequestedAt: z.nullable(types.number()).optional(),
disabledReason: types.optional(GetConfigurationResponseBodyIntegrationsDisabledReason$inboundSchema),
installationType: types.optional(GetConfigurationResponseBodyIntegrationsInstallationType$inboundSchema),
acceptedPoliciesInheritedFromInstallationId: types.optional(types.string()),
});
export function getConfigurationResponseBody2FromJSON(jsonString) {
return safeParse(jsonString, (x) => GetConfigurationResponseBody2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetConfigurationResponseBody2' from JSON`);
}
/** @internal */
export const ProjectSelection$inboundSchema = z.nativeEnum(ProjectSelection);
/** @internal */
export const GetConfigurationResponseBodyLevel$inboundSchema = z.nativeEnum(GetConfigurationResponseBodyLevel);
/** @internal */
export const ResponseBodyNotification$inboundSchema = z.object({
level: GetConfigurationResponseBodyLevel$inboundSchema,
title: types.string(),
message: types.optional(types.string()),
href: types.optional(types.string()),
});
export function responseBodyNotificationFromJSON(jsonString) {
return safeParse(jsonString, (x) => ResponseBodyNotification$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseBodyNotification' from JSON`);
}
/** @internal */
export const TransferRequestRequester$inboundSchema = z.object({
name: types.string(),
email: types.optional(types.string()),
});
export function transferRequestRequesterFromJSON(jsonString) {
return safeParse(jsonString, (x) => TransferRequestRequester$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TransferRequestRequester' from JSON`);
}
/** @internal */
export const TransferRequest2$inboundSchema = z.object({
kind: types.literal("transfer-from-marketplace"),
requestId: types.string(),
transferId: types.string(),
requester: z.lazy(() => TransferRequestRequester$inboundSchema),
createdAt: types.number(),
expiresAt: types.number(),
discardedAt: types.optional(types.number()),
discardedBy: types.optional(types.string()),
approvedAt: types.optional(types.number()),
approvedBy: types.optional(types.string()),
authorizationId: types.optional(types.string()),
});
export function transferRequest2FromJSON(jsonString) {
return safeParse(jsonString, (x) => TransferRequest2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TransferRequest2' from JSON`);
}
/** @internal */
export const TransferRequestType$inboundSchema = z.nativeEnum(TransferRequestType);
/** @internal */
export const TransferRequestScope$inboundSchema = z.nativeEnum(TransferRequestScope);
/** @internal */
export const TransferRequestBillingPlan$inboundSchema = z.object({
id: types.string(),
type: TransferRequestType$inboundSchema,
scope: types.optional(TransferRequestScope$inboundSchema),
name: types.string(),
description: types.string(),
paymentMethodRequired: types.optional(types.boolean()),
preauthorizationAmount: types.optional(types.number()),
});
export function transferRequestBillingPlanFromJSON(jsonString) {
return safeParse(jsonString, (x) => TransferRequestBillingPlan$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TransferRequestBillingPlan' from JSON`);
}
/** @internal */
export const Requester$inboundSchema = z.object({
name: types.string(),
email: types.optional(types.string()),
});
export function requesterFromJSON(jsonString) {
return safeParse(jsonString, (x) => Requester$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Requester' from JSON`);
}
/** @internal */
export const TransferRequest1$inboundSchema = z.object({
kind: types.literal("transfer-to-marketplace"),
metadata: types.optional(z.record(z.any())),
billingPlan: types.optional(z.lazy(() => TransferRequestBillingPlan$inboundSchema)),
requestId: types.string(),
transferId: types.string(),
requester: z.lazy(() => Requester$inboundSchema),
createdAt: types.number(),
expiresAt: types.number(),
discardedAt: types.optional(types.number()),
discardedBy: types.optional(types.string()),
approvedAt: types.optional(types.number()),
approvedBy: types.optional(types.string()),
authorizationId: types.optional(types.string()),
});
export function transferRequest1FromJSON(jsonString) {
return safeParse(jsonString, (x) => TransferRequest1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TransferRequest1' from JSON`);
}
/** @internal */
export const TransferRequest$inboundSchema = z.union([
z.lazy(() => TransferRequest1$inboundSchema),
z.lazy(() => TransferRequest2$inboundSchema),
]);
export function transferRequestFromJSON(jsonString) {
return safeParse(jsonString, (x) => TransferRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TransferRequest' from JSON`);
}
/** @internal */
export const GetConfigurationResponseBodyStatus$inboundSchema = z.nativeEnum(GetConfigurationResponseBodyStatus);
/** @internal */
export const GetConfigurationResponseBodyType$inboundSchema = z.nativeEnum(GetConfigurationResponseBodyType);
/** @internal */
export const GetConfigurationResponseBodySource$inboundSchema = z.nativeEnum(GetConfigurationResponseBodySource);
/** @internal */
export const GetConfigurationResponseBodyDisabledReason$inboundSchema = z
.nativeEnum(GetConfigurationResponseBodyDisabledReason);
/** @internal */
export const GetConfigurationResponseBodyInstallationType$inboundSchema = z
.nativeEnum(GetConfigurationResponseBodyInstallationType);
/** @internal */
export const GetConfigurationResponseBody1$inboundSchema = z.object({
projectSelection: ProjectSelection$inboundSchema,
notification: z.lazy(() => ResponseBodyNotification$inboundSchema),
transferRequest: z.union([
z.lazy(() => TransferRequest1$inboundSchema),
z.lazy(() => TransferRequest2$inboundSchema),
]),
projects: types.optional(z.array(types.string())),
status: types.optional(GetConfigurationResponseBodyStatus$inboundSchema),
type: GetConfigurationResponseBodyType$inboundSchema,
id: types.string(),
slug: types.string(),
createdAt: types.number(),
updatedAt: types.number(),
ownerId: types.string(),
deletedAt: z.nullable(types.number()).optional(),
integrationId: types.string(),
userId: types.string(),
teamId: z.nullable(types.string()).optional(),
scopes: z.array(types.string()),
canConfigureOpenTelemetry: types.optional(types.boolean()),
completedAt: types.optional(types.number()),
externalId: types.optional(types.string()),
source: types.optional(GetConfigurationResponseBodySource$inboundSchema),
disabledAt: types.optional(types.number()),
deleteRequestedAt: z.nullable(types.number()).optional(),
customerDeleteRequestedAt: z.nullable(types.number()).optional(),
disabledReason: types.optional(GetConfigurationResponseBodyDisabledReason$inboundSchema),
installationType: types.optional(GetConfigurationResponseBodyInstallationType$inboundSchema),
acceptedPoliciesInheritedFromInstallationId: types.optional(types.string()),
});
export function getConfigurationResponseBody1FromJSON(jsonString) {
return safeParse(jsonString, (x) => GetConfigurationResponseBody1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetConfigurationResponseBody1' from JSON`);
}
/** @internal */
export const GetConfigurationResponseBody$inboundSchema = smartUnion([
z.lazy(() => GetConfigurationResponseBody1$inboundSchema),
z.lazy(() => GetConfigurationResponseBody2$inboundSchema),
z.lazy(() => GetConfigurationResponseBody3$inboundSchema),
]);
export function getConfigurationResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetConfigurationResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetConfigurationResponseBody' from JSON`);
}
//# sourceMappingURL=getconfigurationop.js.map