@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>
198 lines • 16.2 kB
TypeScript
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import { CreateEventRequest } from "../models/createeventop.js";
import { CreateInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationItemsRequest } from "../models/createinstallationsbyintegrationconfigurationidresourcesbyresourceidexperimentationitemsop.js";
import { DeleteInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationItemsByItemIdRequest } from "../models/deleteinstallationsbyintegrationconfigurationidresourcesbyresourceidexperimentationitemsbyitemidop.js";
import { DeleteIntegrationResourceRequest } from "../models/deleteintegrationresourceop.js";
import { ExchangeSsoTokenRequestBody, ExchangeSsoTokenResponseBody } from "../models/exchangessotokenop.js";
import { FinalizeInstallationRequest } from "../models/finalizeinstallationop.js";
import { GetAccountInfoRequest, GetAccountInfoResponseBody } from "../models/getaccountinfoop.js";
import { GetInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationEdgeConfigRequest, GetInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationEdgeConfigResponseBody } from "../models/getinstallationsbyintegrationconfigurationidresourcesbyresourceidexperimentationedgeconfigop.js";
import { GetIntegrationResourceRequest, GetIntegrationResourceResponseBody } from "../models/getintegrationresourceop.js";
import { GetIntegrationResourcesRequest, GetIntegrationResourcesResponseBody } from "../models/getintegrationresourcesop.js";
import { GetInvoiceRequest, GetInvoiceResponseBody } from "../models/getinvoiceop.js";
import { GetMemberRequest, GetMemberResponseBody } from "../models/getmemberop.js";
import { HeadInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationEdgeConfigRequest, HeadInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationEdgeConfigResponseBody } from "../models/headinstallationsbyintegrationconfigurationidresourcesbyresourceidexperimentationedgeconfigop.js";
import { ImportResourceRequest, ImportResourceResponseBody } from "../models/importresourceop.js";
import { ReplaceInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationEdgeConfigRequest, ReplaceInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationEdgeConfigResponseBody } from "../models/replaceinstallationsbyintegrationconfigurationidresourcesbyresourceidexperimentationedgeconfigop.js";
import { SubmitBillingDataRequest } from "../models/submitbillingdataop.js";
import { SubmitInvoiceRequest, SubmitInvoiceResponseBody } from "../models/submitinvoiceop.js";
import { SubmitPrepaymentBalancesRequest } from "../models/submitprepaymentbalancesop.js";
import { UpdateInstallationRequest } from "../models/updateinstallationop.js";
import { UpdateInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationItemsByItemIdRequest } from "../models/updateinstallationsbyintegrationconfigurationidresourcesbyresourceidexperimentationitemsbyitemidop.js";
import { UpdateInvoiceRequest } from "../models/updateinvoiceop.js";
import { UpdateResourceRequest, UpdateResourceResponseBody } from "../models/updateresourceop.js";
import { UpdateResourceSecretsByIdRequest } from "../models/updateresourcesecretsbyidop.js";
import { UpdateResourceSecretsRequest } from "../models/updateresourcesecretsop.js";
export declare class Marketplace extends ClientSDK {
/**
* Update Installation
*
* @remarks
* This endpoint updates an integration installation.
*/
updateInstallation(request: UpdateInstallationRequest, options?: RequestOptions): Promise<void>;
/**
* Get Account Information
*
* @remarks
* Fetches the best account or user’s contact info
*/
getAccountInfo(request: GetAccountInfoRequest, options?: RequestOptions): Promise<GetAccountInfoResponseBody>;
/**
* Get Member Information
*
* @remarks
* Returns the member role and other information for a given member ID ("user_id" claim in the SSO OIDC token).
*/
getMember(request: GetMemberRequest, options?: RequestOptions): Promise<GetMemberResponseBody>;
/**
* Create Event
*
* @remarks
* Partner notifies Vercel of any changes made to an Installation or a Resource. Vercel is expected to use `list-resources` and other read APIs to get the new state.<br/> <br/> `resource.updated` event should be dispatched when any state of a resource linked to Vercel is modified by the partner.<br/> `installation.updated` event should be dispatched when an installation's billing plan is changed via the provider instead of Vercel.<br/> <br/> Resource update use cases: <br/> <br/> - The user renames a database in the partner’s application. The partner should dispatch a `resource.updated` event to notify Vercel to update the resource in Vercel’s datastores.<br/> - A resource has been suspended due to a lack of use. The partner should dispatch a `resource.updated` event to notify Vercel to update the resource's status in Vercel's datastores.<br/>
*/
createEvent(request: CreateEventRequest, options?: RequestOptions): Promise<void>;
/**
* Get Integration Resources
*
* @remarks
* Get all resources for a given installation ID.
*/
getIntegrationResources(request: GetIntegrationResourcesRequest, options?: RequestOptions): Promise<GetIntegrationResourcesResponseBody>;
/**
* Get Integration Resource
*
* @remarks
* Get a resource by its partner ID.
*/
getIntegrationResource(request: GetIntegrationResourceRequest, options?: RequestOptions): Promise<GetIntegrationResourceResponseBody>;
/**
* Delete Integration Resource
*
* @remarks
* Delete a resource owned by the selected installation ID.
*/
deleteIntegrationResource(request: DeleteIntegrationResourceRequest, options?: RequestOptions): Promise<void>;
/**
* Import Resource
*
* @remarks
* This endpoint imports (upserts) a resource to Vercel's installation. This may be needed if resources can be independently created on the partner's side and need to be synchronized to Vercel. When importing as part of the user-initiated import flow, call this endpoint before redirecting the user back to Vercel. See the [Import existing resources flow](https://vercel.com/docs/integrations/create-integration/marketplace-flows#import-existing-resources-flow) for the full contract.
*/
importResource(request: ImportResourceRequest, options?: RequestOptions): Promise<ImportResourceResponseBody>;
/**
* Update Resource
*
* @remarks
* This endpoint updates an existing resource in the installation. All parameters are optional, allowing partial updates.
*/
updateResource(request: UpdateResourceRequest, options?: RequestOptions): Promise<UpdateResourceResponseBody>;
/**
* Submit Billing Data
*
* @remarks
* Sends the billing and usage data. The partner should do this at least once a day and ideally once per hour. <br/> Use the `credentials.access_token` we provided in the [Upsert Installation](#upsert-installation) body to authorize this request.
*/
submitBillingData(request: SubmitBillingDataRequest, options?: RequestOptions): Promise<void>;
/**
* Submit Invoice
*
* @remarks
* This endpoint allows the partner to submit an invoice to Vercel. The invoice is created in Vercel's billing system and sent to the customer. Depending on the type of billing plan, the invoice can be sent at a time of signup, at the start of the billing period, or at the end of the billing period.<br/> <br/> Use the `credentials.access_token` we provided in the [Upsert Installation](#upsert-installation) body to authorize this request. <br/> There are several limitations to the invoice submission:<br/> <br/> 1. A resource can only be billed once per the billing period and the billing plan.<br/> 2. The billing plan used to bill the resource must have been active for this resource during the billing period.<br/> 3. The billing plan used must be a subscription plan.<br/> 4. The interim usage data must be sent hourly for all types of subscriptions. See [Send subscription billing and usage data](#send-subscription-billing-and-usage-data) API on how to send interim billing and usage data.<br/> 5. If provided, `externalId` must be unique for the installation.<br/>
*/
submitInvoice(request: SubmitInvoiceRequest, options?: RequestOptions): Promise<SubmitInvoiceResponseBody>;
/**
* Finalize Installation
*
* @remarks
* This endpoint allows the partner to mark an installation as finalized. This means you will not send any more invoices for the installation. Use this after a customer has requested uninstall and you have sent any remaining invoices. This will allow the uninstall process to proceed immediately after all invoices have been paid. <br/> Use the `credentials.access_token` we provided in the [Upsert Installation](#upsert-installation) body to authorize this request.
*/
finalizeInstallation(request: FinalizeInstallationRequest, options?: RequestOptions): Promise<void>;
/**
* Get Invoice
*
* @remarks
* Get Invoice details and status for a given invoice ID.<br/> <br/> See [Billing Events with Webhooks documentation](https://vercel.com/docs/integrations/create-integration/marketplace-api#working-with-billing-events-through-webhooks) on how to receive invoice events. This endpoint is used to retrieve the invoice details.
*/
getInvoice(request: GetInvoiceRequest, options?: RequestOptions): Promise<GetInvoiceResponseBody>;
/**
* Invoice Actions
*
* @remarks
* This endpoint allows the partner to request a refund for an invoice to Vercel. The invoice is created using the [Submit Invoice API](#submit-invoice-api).
*/
updateInvoice(request: UpdateInvoiceRequest, options?: RequestOptions): Promise<void>;
/**
* Submit Prepayment Balances
*
* @remarks
* Sends the prepayment balances. The partner should do this at least once a day and ideally once per hour. <br/> Use the `credentials.access_token` we provided in the [Upsert Installation](#upsert-installation) body to authorize this request.
*/
submitPrepaymentBalances(request: SubmitPrepaymentBalancesRequest, options?: RequestOptions): Promise<void>;
/**
* Deprecated: true. Update Resource Secrets (Deprecated)
*
* @remarks
* This endpoint is deprecated and replaced with the endpoint [Update Resource Secrets](#update-resource-secrets). <br/> This endpoint updates the secrets of a resource. If a resource has projects connected, the connected secrets are updated with the new secrets. The old secrets may still be used by existing connected projects because they are not automatically redeployed. Redeployment is a manual action and must be completed by the user. All new project connections will use the new secrets.<br/> <br/> Use cases for this endpoint:<br/> <br/> - Resetting the credentials of a database in the partner. If the user requests the credentials to be updated in the partner’s application, the partner post the new set of secrets to Vercel, the user should redeploy their application and the expire the old credentials.<br/>
*
* @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
*/
updateResourceSecrets(request: UpdateResourceSecretsRequest, options?: RequestOptions): Promise<void>;
/**
* Update Resource Secrets
*
* @remarks
* This endpoint updates the secrets of a resource. If a resource has projects connected, the connected secrets are updated with the new secrets. The old secrets may still be used by existing connected projects because they are not automatically redeployed. Redeployment is a manual action and must be completed by the user. All new project connections will use the new secrets.<br/> <br/> Use cases for this endpoint:<br/> <br/> - Resetting the credentials of a database in the partner. If the user requests the credentials to be updated in the partner’s application, the partner post the new set of secrets to Vercel, the user should redeploy their application and the expire the old credentials.<br/>
*/
updateResourceSecretsById(request: UpdateResourceSecretsByIdRequest, options?: RequestOptions): Promise<void>;
/**
* SSO Token Exchange
*
* @remarks
* During the autorization process, Vercel sends the user to the provider [redirectLoginUrl](https://vercel.com/docs/integrations/create-integration/submit-integration#redirect-login-url), that includes the OAuth authorization `code` parameter. The provider then calls the SSO Token Exchange endpoint with the sent code and receives the OIDC token. They log the user in based on this token and redirects the user back to the Vercel account using deep-link parameters included the redirectLoginUrl. Providers should not persist the returned `id_token` in a database since the token will expire. See [**Authentication with SSO**](https://vercel.com/docs/integrations/create-integration/marketplace-api#authentication-with-sso) for more details.
*/
exchangeSsoToken(request: ExchangeSsoTokenRequestBody, options?: RequestOptions): Promise<ExchangeSsoTokenResponseBody>;
/**
* Create one or multiple experimentation items
*
* @remarks
* Create one or multiple experimentation items
*/
createInstallationIntegrationConfiguration(request: CreateInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationItemsRequest, options?: RequestOptions): Promise<void>;
/**
* Patch an existing experimentation item
*
* @remarks
* Patch an existing experimentation item
*/
updateInstallationIntegrationConfiguration(request: UpdateInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationItemsByItemIdRequest, options?: RequestOptions): Promise<void>;
/**
* Delete an existing experimentation item
*
* @remarks
* Delete an existing experimentation item
*/
deleteInstallationIntegrationConfiguration(request: DeleteInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationItemsByItemIdRequest, options?: RequestOptions): Promise<void>;
/**
* Get the data of a user-provided Edge Config
*
* @remarks
* When the user enabled Edge Config syncing, then this endpoint can be used by the partner to fetch the contents of the Edge Config.
*/
createInstallationIntegrationEdgeConfig(request: HeadInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationEdgeConfigRequest, options?: RequestOptions): Promise<HeadInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationEdgeConfigResponseBody | undefined>;
/**
* Get the data of a user-provided Edge Config
*
* @remarks
* When the user enabled Edge Config syncing, then this endpoint can be used by the partner to fetch the contents of the Edge Config.
*/
getInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationEdgeConfig(request: GetInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationEdgeConfigRequest, options?: RequestOptions): Promise<GetInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationEdgeConfigResponseBody | undefined>;
/**
* Push data into a user-provided Edge Config
*
* @remarks
* When the user enabled Edge Config syncing, then this endpoint can be used by the partner to push their configuration data into the relevant Edge Config.
*/
updateInstallationIntegrationEdgeConfig(request: ReplaceInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationEdgeConfigRequest, options?: RequestOptions): Promise<ReplaceInstallationsByIntegrationConfigurationIdResourcesByResourceIdExperimentationEdgeConfigResponseBody>;
}
//# sourceMappingURL=marketplace.d.ts.map