@vercel/sdk 14.0.0-canary.7 → 14.0.0-canary.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devcontainer/README.md +1 -1
- package/README.md +25 -0
- package/docs/sdks/authentication/README.md +69 -0
- package/docs/sdks/marketplace/README.md +694 -0
- package/docs/sdks/projects/README.md +85 -0
- package/esm/funcs/authenticationExchangeSsoToken.d.ts +15 -0
- package/esm/funcs/authenticationExchangeSsoToken.d.ts.map +1 -0
- package/esm/funcs/authenticationExchangeSsoToken.js +66 -0
- package/esm/funcs/authenticationExchangeSsoToken.js.map +1 -0
- package/esm/funcs/marketplaceCreateEvent.d.ts +15 -0
- package/esm/funcs/marketplaceCreateEvent.d.ts.map +1 -0
- package/esm/funcs/marketplaceCreateEvent.js +73 -0
- package/esm/funcs/marketplaceCreateEvent.js.map +1 -0
- package/esm/funcs/marketplaceExchangeSsoToken.d.ts +15 -0
- package/esm/funcs/marketplaceExchangeSsoToken.d.ts.map +1 -0
- package/esm/funcs/marketplaceExchangeSsoToken.js +66 -0
- package/esm/funcs/marketplaceExchangeSsoToken.js.map +1 -0
- package/esm/funcs/marketplaceGetAccountInfo.d.ts +15 -0
- package/esm/funcs/marketplaceGetAccountInfo.d.ts.map +1 -0
- package/esm/funcs/marketplaceGetAccountInfo.js +71 -0
- package/esm/funcs/marketplaceGetAccountInfo.js.map +1 -0
- package/esm/funcs/marketplaceGetInvoice.d.ts +15 -0
- package/esm/funcs/marketplaceGetInvoice.d.ts.map +1 -0
- package/esm/funcs/marketplaceGetInvoice.js +75 -0
- package/esm/funcs/marketplaceGetInvoice.js.map +1 -0
- package/esm/funcs/marketplaceGetMember.d.ts +15 -0
- package/esm/funcs/marketplaceGetMember.d.ts.map +1 -0
- package/esm/funcs/marketplaceGetMember.js +75 -0
- package/esm/funcs/marketplaceGetMember.js.map +1 -0
- package/esm/funcs/marketplaceSubmitBillingData.d.ts +15 -0
- package/esm/funcs/marketplaceSubmitBillingData.d.ts.map +1 -0
- package/esm/funcs/marketplaceSubmitBillingData.js +73 -0
- package/esm/funcs/marketplaceSubmitBillingData.js.map +1 -0
- package/esm/funcs/marketplaceSubmitInvoice.d.ts +15 -0
- package/esm/funcs/marketplaceSubmitInvoice.d.ts.map +1 -0
- package/esm/funcs/marketplaceSubmitInvoice.js +72 -0
- package/esm/funcs/marketplaceSubmitInvoice.js.map +1 -0
- package/esm/funcs/marketplaceUpdateInvoice.d.ts +15 -0
- package/esm/funcs/marketplaceUpdateInvoice.d.ts.map +1 -0
- package/esm/funcs/marketplaceUpdateInvoice.js +77 -0
- package/esm/funcs/marketplaceUpdateInvoice.js.map +1 -0
- package/esm/funcs/marketplaceUpdateResourceSecrets.d.ts +15 -0
- package/esm/funcs/marketplaceUpdateResourceSecrets.d.ts.map +1 -0
- package/esm/funcs/marketplaceUpdateResourceSecrets.js +78 -0
- package/esm/funcs/marketplaceUpdateResourceSecrets.js.map +1 -0
- package/esm/funcs/projectsGetProjectDomains.d.ts +15 -0
- package/esm/funcs/projectsGetProjectDomains.d.ts.map +1 -0
- package/esm/funcs/projectsGetProjectDomains.js +89 -0
- package/esm/funcs/projectsGetProjectDomains.js.map +1 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/components/authuser.d.ts +6 -3
- package/esm/models/components/authuser.d.ts.map +1 -1
- package/esm/models/components/authuser.js +2 -1
- package/esm/models/components/authuser.js.map +1 -1
- package/esm/models/components/security.d.ts +2 -2
- package/esm/models/components/security.d.ts.map +1 -1
- package/esm/models/components/security.js +2 -2
- package/esm/models/components/security.js.map +1 -1
- package/esm/models/operations/createevent.d.ts +187 -0
- package/esm/models/operations/createevent.d.ts.map +1 -0
- package/esm/models/operations/createevent.js +195 -0
- package/esm/models/operations/createevent.js.map +1 -0
- package/esm/models/operations/createproject.d.ts +4 -0
- package/esm/models/operations/createproject.d.ts.map +1 -1
- package/esm/models/operations/createproject.js +4 -0
- package/esm/models/operations/createproject.js.map +1 -1
- package/esm/models/operations/createteam.d.ts +15 -15
- package/esm/models/operations/createteam.d.ts.map +1 -1
- package/esm/models/operations/createteam.js +15 -15
- package/esm/models/operations/createteam.js.map +1 -1
- package/esm/models/operations/deletedeployment.d.ts +8 -8
- package/esm/models/operations/deletedeployment.d.ts.map +1 -1
- package/esm/models/operations/deletedeployment.js +12 -12
- package/esm/models/operations/deletedeployment.js.map +1 -1
- package/esm/models/operations/exchangessotoken.d.ts +81 -0
- package/esm/models/operations/exchangessotoken.d.ts.map +1 -0
- package/esm/models/operations/exchangessotoken.js +93 -0
- package/esm/models/operations/exchangessotoken.js.map +1 -0
- package/esm/models/operations/getaccountinfo.d.ts +85 -0
- package/esm/models/operations/getaccountinfo.d.ts.map +1 -0
- package/esm/models/operations/getaccountinfo.js +87 -0
- package/esm/models/operations/getaccountinfo.js.map +1 -0
- package/esm/models/operations/getinvoice.d.ts +232 -0
- package/esm/models/operations/getinvoice.d.ts.map +1 -0
- package/esm/models/operations/getinvoice.js +219 -0
- package/esm/models/operations/getinvoice.js.map +1 -0
- package/esm/models/operations/getmember.d.ts +84 -0
- package/esm/models/operations/getmember.d.ts.map +1 -0
- package/esm/models/operations/getmember.js +79 -0
- package/esm/models/operations/getmember.js.map +1 -0
- package/esm/models/operations/getprojectdomains.d.ts +367 -0
- package/esm/models/operations/getprojectdomains.d.ts.map +1 -0
- package/esm/models/operations/getprojectdomains.js +272 -0
- package/esm/models/operations/getprojectdomains.js.map +1 -0
- package/esm/models/operations/getprojects.d.ts +4 -0
- package/esm/models/operations/getprojects.d.ts.map +1 -1
- package/esm/models/operations/getprojects.js +4 -0
- package/esm/models/operations/getprojects.js.map +1 -1
- package/esm/models/operations/putfirewallconfig.d.ts +44 -44
- package/esm/models/operations/putfirewallconfig.d.ts.map +1 -1
- package/esm/models/operations/putfirewallconfig.js +71 -72
- package/esm/models/operations/putfirewallconfig.js.map +1 -1
- package/esm/models/operations/submitbillingdata.d.ts +448 -0
- package/esm/models/operations/submitbillingdata.d.ts.map +1 -0
- package/esm/models/operations/submitbillingdata.js +355 -0
- package/esm/models/operations/submitbillingdata.js.map +1 -0
- package/esm/models/operations/submitinvoice.d.ts +299 -0
- package/esm/models/operations/submitinvoice.d.ts.map +1 -0
- package/esm/models/operations/submitinvoice.js +269 -0
- package/esm/models/operations/submitinvoice.js.map +1 -0
- package/esm/models/operations/updateinvoice.d.ts +91 -0
- package/esm/models/operations/updateinvoice.d.ts.map +1 -0
- package/esm/models/operations/updateinvoice.js +92 -0
- package/esm/models/operations/updateinvoice.js.map +1 -0
- package/esm/models/operations/updateproject.d.ts +4 -0
- package/esm/models/operations/updateproject.d.ts.map +1 -1
- package/esm/models/operations/updateproject.js +4 -0
- package/esm/models/operations/updateproject.js.map +1 -1
- package/esm/models/operations/updateprojectdatacache.d.ts +4 -0
- package/esm/models/operations/updateprojectdatacache.d.ts.map +1 -1
- package/esm/models/operations/updateprojectdatacache.js +4 -0
- package/esm/models/operations/updateprojectdatacache.js.map +1 -1
- package/esm/models/operations/updateresourcesecrets.d.ts +87 -0
- package/esm/models/operations/updateresourcesecrets.d.ts.map +1 -0
- package/esm/models/operations/updateresourcesecrets.js +100 -0
- package/esm/models/operations/updateresourcesecrets.js.map +1 -0
- package/esm/sdk/authentication.d.ts +8 -0
- package/esm/sdk/authentication.d.ts.map +1 -1
- package/esm/sdk/authentication.js +10 -0
- package/esm/sdk/authentication.js.map +1 -1
- package/esm/sdk/marketplace.d.ts +76 -0
- package/esm/sdk/marketplace.d.ts.map +1 -0
- package/esm/sdk/marketplace.js +98 -0
- package/esm/sdk/marketplace.js.map +1 -0
- package/esm/sdk/projects.d.ts +8 -0
- package/esm/sdk/projects.d.ts.map +1 -1
- package/esm/sdk/projects.js +10 -0
- package/esm/sdk/projects.js.map +1 -1
- package/esm/sdk/sdk.d.ts +5 -2
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +9 -4
- package/esm/sdk/sdk.js.map +1 -1
- package/package.json +2 -2
- package/src/funcs/authenticationExchangeSsoToken.ts +125 -0
- package/src/funcs/marketplaceCreateEvent.ts +137 -0
- package/src/funcs/marketplaceExchangeSsoToken.ts +125 -0
- package/src/funcs/marketplaceGetAccountInfo.ts +137 -0
- package/src/funcs/marketplaceGetInvoice.ts +141 -0
- package/src/funcs/marketplaceGetMember.ts +141 -0
- package/src/funcs/marketplaceSubmitBillingData.ts +137 -0
- package/src/funcs/marketplaceSubmitInvoice.ts +138 -0
- package/src/funcs/marketplaceUpdateInvoice.ts +141 -0
- package/src/funcs/marketplaceUpdateResourceSecrets.ts +146 -0
- package/src/funcs/projectsGetProjectDomains.ts +150 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/authuser.ts +2 -1
- package/src/models/components/security.ts +4 -4
- package/src/models/operations/createevent.ts +373 -0
- package/src/models/operations/createproject.ts +8 -0
- package/src/models/operations/createteam.ts +31 -24
- package/src/models/operations/deletedeployment.ts +16 -15
- package/src/models/operations/exchangessotoken.ts +192 -0
- package/src/models/operations/getaccountinfo.ts +187 -0
- package/src/models/operations/getinvoice.ts +454 -0
- package/src/models/operations/getmember.ts +160 -0
- package/src/models/operations/getprojectdomains.ts +571 -0
- package/src/models/operations/getprojects.ts +8 -0
- package/src/models/operations/putfirewallconfig.ts +102 -93
- package/src/models/operations/submitbillingdata.ts +813 -0
- package/src/models/operations/submitinvoice.ts +593 -0
- package/src/models/operations/updateinvoice.ts +180 -0
- package/src/models/operations/updateproject.ts +8 -0
- package/src/models/operations/updateprojectdatacache.ts +8 -0
- package/src/models/operations/updateresourcesecrets.ts +206 -0
- package/src/sdk/authentication.ts +22 -0
- package/src/sdk/marketplace.ts +194 -0
- package/src/sdk/projects.ts +22 -0
- package/src/sdk/sdk.ts +11 -5
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* [createProject](#createproject) - Create a new project
|
|
11
11
|
* [updateProject](#updateproject) - Update an existing project
|
|
12
12
|
* [deleteProject](#deleteproject) - Delete a Project
|
|
13
|
+
* [getProjectDomains](#getprojectdomains) - Retrieve project domains by project by id or name
|
|
13
14
|
* [getProjectDomain](#getprojectdomain) - Get a project domain
|
|
14
15
|
* [updateProjectDomain](#updateprojectdomain) - Update a project domain
|
|
15
16
|
* [removeProjectDomain](#removeprojectdomain) - Remove a domain from a project
|
|
@@ -420,6 +421,90 @@ run();
|
|
|
420
421
|
| --------------- | --------------- | --------------- |
|
|
421
422
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
422
423
|
|
|
424
|
+
## getProjectDomains
|
|
425
|
+
|
|
426
|
+
Retrieve the domains associated with a given project by passing either the project `id` or `name` in the URL.
|
|
427
|
+
|
|
428
|
+
### Example Usage
|
|
429
|
+
|
|
430
|
+
```typescript
|
|
431
|
+
import { Vercel } from "@vercel/sdk";
|
|
432
|
+
|
|
433
|
+
const vercel = new Vercel({
|
|
434
|
+
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
async function run() {
|
|
438
|
+
const result = await vercel.projects.getProjectDomains({
|
|
439
|
+
idOrName: "<value>",
|
|
440
|
+
redirect: "example.com",
|
|
441
|
+
limit: 20,
|
|
442
|
+
since: 1609499532000,
|
|
443
|
+
until: 1612264332000,
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
// Handle the result
|
|
447
|
+
console.log(result);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
run();
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### Standalone function
|
|
454
|
+
|
|
455
|
+
The standalone function version of this method:
|
|
456
|
+
|
|
457
|
+
```typescript
|
|
458
|
+
import { VercelCore } from "@vercel/sdk/core.js";
|
|
459
|
+
import { projectsGetProjectDomains } from "@vercel/sdk/funcs/projectsGetProjectDomains.js";
|
|
460
|
+
|
|
461
|
+
// Use `VercelCore` for best tree-shaking performance.
|
|
462
|
+
// You can create one instance of it to use across an application.
|
|
463
|
+
const vercel = new VercelCore({
|
|
464
|
+
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
async function run() {
|
|
468
|
+
const res = await projectsGetProjectDomains(vercel, {
|
|
469
|
+
idOrName: "<value>",
|
|
470
|
+
redirect: "example.com",
|
|
471
|
+
limit: 20,
|
|
472
|
+
since: 1609499532000,
|
|
473
|
+
until: 1612264332000,
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
if (!res.ok) {
|
|
477
|
+
throw res.error;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
const { value: result } = res;
|
|
481
|
+
|
|
482
|
+
// Handle the result
|
|
483
|
+
console.log(result);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
run();
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
### Parameters
|
|
490
|
+
|
|
491
|
+
| Parameter | Type | Required | Description |
|
|
492
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
493
|
+
| `request` | [operations.GetProjectDomainsRequest](../../models/operations/getprojectdomainsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
494
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
495
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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. |
|
|
496
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
497
|
+
|
|
498
|
+
### Response
|
|
499
|
+
|
|
500
|
+
**Promise\<[operations.GetProjectDomainsResponseBody](../../models/operations/getprojectdomainsresponsebody.md)\>**
|
|
501
|
+
|
|
502
|
+
### Errors
|
|
503
|
+
|
|
504
|
+
| Error Type | Status Code | Content Type |
|
|
505
|
+
| --------------- | --------------- | --------------- |
|
|
506
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
507
|
+
|
|
423
508
|
## getProjectDomain
|
|
424
509
|
|
|
425
510
|
Get project domain by project id/name and domain name.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VercelCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
5
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
6
|
+
import { ExchangeSsoTokenRequestBody, ExchangeSsoTokenResponseBody } from "../models/operations/exchangessotoken.js";
|
|
7
|
+
import { Result } from "../types/fp.js";
|
|
8
|
+
/**
|
|
9
|
+
* SSO Token Exchange
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* 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. This is used to verify the identity of the user during the [**Open in Provider** flow](https://vercel.com/docs/integrations/marketplace-flows#open-in-provider-button-flow). Providers should not persist the returned `id_token` in a database since the token will expire.
|
|
13
|
+
*/
|
|
14
|
+
export declare function authenticationExchangeSsoToken(client: VercelCore, request?: ExchangeSsoTokenRequestBody | undefined, options?: RequestOptions): Promise<Result<ExchangeSsoTokenResponseBody, SDKError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
|
|
15
|
+
//# sourceMappingURL=authenticationExchangeSsoToken.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticationExchangeSsoToken.d.ts","sourceRoot":"","sources":["../../src/funcs/authenticationExchangeSsoToken.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,2BAA2B,EAE3B,4BAA4B,EAE7B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,UAAU,EAClB,OAAO,CAAC,EAAE,2BAA2B,GAAG,SAAS,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CACR,MAAM,CACJ,4BAA4B,EAC1B,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CA4EA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
5
|
+
import * as M from "../lib/matchers.js";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { pathToFunc } from "../lib/url.js";
|
|
8
|
+
import { ExchangeSsoTokenRequestBody$outboundSchema, ExchangeSsoTokenResponseBody$inboundSchema, } from "../models/operations/exchangessotoken.js";
|
|
9
|
+
/**
|
|
10
|
+
* SSO Token Exchange
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* 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. This is used to verify the identity of the user during the [**Open in Provider** flow](https://vercel.com/docs/integrations/marketplace-flows#open-in-provider-button-flow). Providers should not persist the returned `id_token` in a database since the token will expire.
|
|
14
|
+
*/
|
|
15
|
+
export async function authenticationExchangeSsoToken(client, request, options) {
|
|
16
|
+
const parsed = safeParse(request, (value) => ExchangeSsoTokenRequestBody$outboundSchema.optional().parse(value), "Input validation failed");
|
|
17
|
+
if (!parsed.ok) {
|
|
18
|
+
return parsed;
|
|
19
|
+
}
|
|
20
|
+
const payload = parsed.value;
|
|
21
|
+
const body = payload === undefined
|
|
22
|
+
? null
|
|
23
|
+
: encodeJSON("body", payload, { explode: true });
|
|
24
|
+
const path = pathToFunc("/v1/integrations/sso/token")();
|
|
25
|
+
const headers = new Headers({
|
|
26
|
+
"Content-Type": "application/json",
|
|
27
|
+
Accept: "application/json",
|
|
28
|
+
});
|
|
29
|
+
const context = {
|
|
30
|
+
operationID: "exchange-sso-token",
|
|
31
|
+
oAuth2Scopes: [],
|
|
32
|
+
resolvedSecurity: null,
|
|
33
|
+
securitySource: null,
|
|
34
|
+
retryConfig: (options === null || options === void 0 ? void 0 : options.retries)
|
|
35
|
+
|| client._options.retryConfig
|
|
36
|
+
|| { strategy: "none" },
|
|
37
|
+
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
38
|
+
};
|
|
39
|
+
const requestRes = client._createRequest(context, {
|
|
40
|
+
method: "POST",
|
|
41
|
+
path: path,
|
|
42
|
+
headers: headers,
|
|
43
|
+
body: body,
|
|
44
|
+
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || client._options.timeoutMs || -1,
|
|
45
|
+
}, options);
|
|
46
|
+
if (!requestRes.ok) {
|
|
47
|
+
return requestRes;
|
|
48
|
+
}
|
|
49
|
+
const req = requestRes.value;
|
|
50
|
+
const doResult = await client._do(req, {
|
|
51
|
+
context,
|
|
52
|
+
errorCodes: ["400", "404", "4XX", "500", "5XX"],
|
|
53
|
+
retryConfig: context.retryConfig,
|
|
54
|
+
retryCodes: context.retryCodes,
|
|
55
|
+
});
|
|
56
|
+
if (!doResult.ok) {
|
|
57
|
+
return doResult;
|
|
58
|
+
}
|
|
59
|
+
const response = doResult.value;
|
|
60
|
+
const [result] = await M.match(M.json(200, ExchangeSsoTokenResponseBody$inboundSchema), M.fail([400, 404, "4XX", 500, "5XX"]))(response);
|
|
61
|
+
if (!result.ok) {
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=authenticationExchangeSsoToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticationExchangeSsoToken.js","sourceRoot":"","sources":["../../src/funcs/authenticationExchangeSsoToken.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C,OAAO,EAEL,0CAA0C,EAE1C,0CAA0C,GAC3C,MAAM,0CAA0C,CAAC;AAGlD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,MAAkB,EAClB,OAAiD,EACjD,OAAwB;IAaxB,MAAM,MAAM,GAAG,SAAS,CACtB,OAAO,EACP,CAAC,KAAK,EAAE,EAAE,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,SAAS,IAAI,CAAC,CAAC;KACjE,EAAE,OAAO,CAAC,CAAC;IACZ,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;QACnB,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,MAAM,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC;IAE7B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE;QACrC,OAAO;QACP,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;QAC/C,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEhC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAU5B,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,0CAA0C,CAAC,EACvD,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CACtC,CAAC,QAAQ,CAAC,CAAC;IACZ,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VercelCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
5
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
6
|
+
import { CreateEventRequest } from "../models/operations/createevent.js";
|
|
7
|
+
import { Result } from "../types/fp.js";
|
|
8
|
+
/**
|
|
9
|
+
* Create Event
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* 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/> <br/> 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/>
|
|
13
|
+
*/
|
|
14
|
+
export declare function marketplaceCreateEvent(client: VercelCore, request: CreateEventRequest, options?: RequestOptions): Promise<Result<void, SDKError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
|
|
15
|
+
//# sourceMappingURL=marketplaceCreateEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplaceCreateEvent.d.ts","sourceRoot":"","sources":["../../src/funcs/marketplaceCreateEvent.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,kBAAkB,EAEnB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,kBAAkB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CACR,MAAM,CACJ,IAAI,EACF,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAwFA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod";
|
|
5
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
6
|
+
import * as M from "../lib/matchers.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
9
|
+
import { pathToFunc } from "../lib/url.js";
|
|
10
|
+
import { CreateEventRequest$outboundSchema, } from "../models/operations/createevent.js";
|
|
11
|
+
/**
|
|
12
|
+
* Create Event
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* 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/> <br/> 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/>
|
|
16
|
+
*/
|
|
17
|
+
export async function marketplaceCreateEvent(client, request, options) {
|
|
18
|
+
const parsed = safeParse(request, (value) => CreateEventRequest$outboundSchema.parse(value), "Input validation failed");
|
|
19
|
+
if (!parsed.ok) {
|
|
20
|
+
return parsed;
|
|
21
|
+
}
|
|
22
|
+
const payload = parsed.value;
|
|
23
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
24
|
+
const pathParams = {
|
|
25
|
+
integrationConfigurationId: encodeSimple("integrationConfigurationId", payload.integrationConfigurationId, { explode: false, charEncoding: "percent" }),
|
|
26
|
+
};
|
|
27
|
+
const path = pathToFunc("/v1/installations/{integrationConfigurationId}/events")(pathParams);
|
|
28
|
+
const headers = new Headers({
|
|
29
|
+
"Content-Type": "application/json",
|
|
30
|
+
Accept: "*/*",
|
|
31
|
+
});
|
|
32
|
+
const secConfig = await extractSecurity(client._options.bearerToken);
|
|
33
|
+
const securityInput = secConfig == null ? {} : { bearerToken: secConfig };
|
|
34
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
35
|
+
const context = {
|
|
36
|
+
operationID: "create-event",
|
|
37
|
+
oAuth2Scopes: [],
|
|
38
|
+
resolvedSecurity: requestSecurity,
|
|
39
|
+
securitySource: client._options.bearerToken,
|
|
40
|
+
retryConfig: (options === null || options === void 0 ? void 0 : options.retries)
|
|
41
|
+
|| client._options.retryConfig
|
|
42
|
+
|| { strategy: "none" },
|
|
43
|
+
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
44
|
+
};
|
|
45
|
+
const requestRes = client._createRequest(context, {
|
|
46
|
+
security: requestSecurity,
|
|
47
|
+
method: "POST",
|
|
48
|
+
path: path,
|
|
49
|
+
headers: headers,
|
|
50
|
+
body: body,
|
|
51
|
+
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || client._options.timeoutMs || -1,
|
|
52
|
+
}, options);
|
|
53
|
+
if (!requestRes.ok) {
|
|
54
|
+
return requestRes;
|
|
55
|
+
}
|
|
56
|
+
const req = requestRes.value;
|
|
57
|
+
const doResult = await client._do(req, {
|
|
58
|
+
context,
|
|
59
|
+
errorCodes: ["400", "401", "403", "4XX", "5XX"],
|
|
60
|
+
retryConfig: context.retryConfig,
|
|
61
|
+
retryCodes: context.retryCodes,
|
|
62
|
+
});
|
|
63
|
+
if (!doResult.ok) {
|
|
64
|
+
return doResult;
|
|
65
|
+
}
|
|
66
|
+
const response = doResult.value;
|
|
67
|
+
const [result] = await M.match(M.nil(201, z.void()), M.fail([400, 401, 403, "4XX", "5XX"]))(response);
|
|
68
|
+
if (!result.ok) {
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=marketplaceCreateEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplaceCreateEvent.js","sourceRoot":"","sources":["../../src/funcs/marketplaceCreateEvent.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C,OAAO,EAEL,iCAAiC,GAClC,MAAM,qCAAqC,CAAC;AAG7C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAAkB,EAClB,OAA2B,EAC3B,OAAwB;IAaxB,MAAM,MAAM,GAAG,SAAS,CACtB,OAAO,EACP,CAAC,KAAK,EAAE,EAAE,CAAC,iCAAiC,CAAC,KAAK,CAAC,KAAK,CAAC,EACzD,yBAAyB,CAC1B,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;IAC7B,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAExE,MAAM,UAAU,GAAG;QACjB,0BAA0B,EAAE,YAAY,CACtC,4BAA4B,EAC5B,OAAO,CAAC,0BAA0B,EAClC,EAAE,OAA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AC,SAAS,IAAI,CAAC,CAAC;KACjE,EAAE,OAAO,CAAC,CAAC;IACZ,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;QACnB,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,MAAM,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC;IAE7B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE;QACrC,OAAO;QACP,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;QAC/C,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEhC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAU5B,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,EACpB,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CACtC,CAAC,QAAQ,CAAC,CAAC;IACZ,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VercelCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
5
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
6
|
+
import { ExchangeSsoTokenRequestBody, ExchangeSsoTokenResponseBody } from "../models/operations/exchangessotoken.js";
|
|
7
|
+
import { Result } from "../types/fp.js";
|
|
8
|
+
/**
|
|
9
|
+
* SSO Token Exchange
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* 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. This is used to verify the identity of the user during the [**Open in Provider** flow](https://vercel.com/docs/integrations/marketplace-flows#open-in-provider-button-flow). Providers should not persist the returned `id_token` in a database since the token will expire.
|
|
13
|
+
*/
|
|
14
|
+
export declare function marketplaceExchangeSsoToken(client: VercelCore, request?: ExchangeSsoTokenRequestBody | undefined, options?: RequestOptions): Promise<Result<ExchangeSsoTokenResponseBody, SDKError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
|
|
15
|
+
//# sourceMappingURL=marketplaceExchangeSsoToken.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplaceExchangeSsoToken.d.ts","sourceRoot":"","sources":["../../src/funcs/marketplaceExchangeSsoToken.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,2BAA2B,EAE3B,4BAA4B,EAE7B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,UAAU,EAClB,OAAO,CAAC,EAAE,2BAA2B,GAAG,SAAS,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CACR,MAAM,CACJ,4BAA4B,EAC1B,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CA4EA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
5
|
+
import * as M from "../lib/matchers.js";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { pathToFunc } from "../lib/url.js";
|
|
8
|
+
import { ExchangeSsoTokenRequestBody$outboundSchema, ExchangeSsoTokenResponseBody$inboundSchema, } from "../models/operations/exchangessotoken.js";
|
|
9
|
+
/**
|
|
10
|
+
* SSO Token Exchange
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* 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. This is used to verify the identity of the user during the [**Open in Provider** flow](https://vercel.com/docs/integrations/marketplace-flows#open-in-provider-button-flow). Providers should not persist the returned `id_token` in a database since the token will expire.
|
|
14
|
+
*/
|
|
15
|
+
export async function marketplaceExchangeSsoToken(client, request, options) {
|
|
16
|
+
const parsed = safeParse(request, (value) => ExchangeSsoTokenRequestBody$outboundSchema.optional().parse(value), "Input validation failed");
|
|
17
|
+
if (!parsed.ok) {
|
|
18
|
+
return parsed;
|
|
19
|
+
}
|
|
20
|
+
const payload = parsed.value;
|
|
21
|
+
const body = payload === undefined
|
|
22
|
+
? null
|
|
23
|
+
: encodeJSON("body", payload, { explode: true });
|
|
24
|
+
const path = pathToFunc("/v1/integrations/sso/token")();
|
|
25
|
+
const headers = new Headers({
|
|
26
|
+
"Content-Type": "application/json",
|
|
27
|
+
Accept: "application/json",
|
|
28
|
+
});
|
|
29
|
+
const context = {
|
|
30
|
+
operationID: "exchange-sso-token",
|
|
31
|
+
oAuth2Scopes: [],
|
|
32
|
+
resolvedSecurity: null,
|
|
33
|
+
securitySource: null,
|
|
34
|
+
retryConfig: (options === null || options === void 0 ? void 0 : options.retries)
|
|
35
|
+
|| client._options.retryConfig
|
|
36
|
+
|| { strategy: "none" },
|
|
37
|
+
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
38
|
+
};
|
|
39
|
+
const requestRes = client._createRequest(context, {
|
|
40
|
+
method: "POST",
|
|
41
|
+
path: path,
|
|
42
|
+
headers: headers,
|
|
43
|
+
body: body,
|
|
44
|
+
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || client._options.timeoutMs || -1,
|
|
45
|
+
}, options);
|
|
46
|
+
if (!requestRes.ok) {
|
|
47
|
+
return requestRes;
|
|
48
|
+
}
|
|
49
|
+
const req = requestRes.value;
|
|
50
|
+
const doResult = await client._do(req, {
|
|
51
|
+
context,
|
|
52
|
+
errorCodes: ["400", "404", "4XX", "500", "5XX"],
|
|
53
|
+
retryConfig: context.retryConfig,
|
|
54
|
+
retryCodes: context.retryCodes,
|
|
55
|
+
});
|
|
56
|
+
if (!doResult.ok) {
|
|
57
|
+
return doResult;
|
|
58
|
+
}
|
|
59
|
+
const response = doResult.value;
|
|
60
|
+
const [result] = await M.match(M.json(200, ExchangeSsoTokenResponseBody$inboundSchema), M.fail([400, 404, "4XX", 500, "5XX"]))(response);
|
|
61
|
+
if (!result.ok) {
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=marketplaceExchangeSsoToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplaceExchangeSsoToken.js","sourceRoot":"","sources":["../../src/funcs/marketplaceExchangeSsoToken.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C,OAAO,EAEL,0CAA0C,EAE1C,0CAA0C,GAC3C,MAAM,0CAA0C,CAAC;AAGlD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,MAAkB,EAClB,OAAiD,EACjD,OAAwB;IAaxB,MAAM,MAAM,GAAG,SAAS,CACtB,OAAO,EACP,CAAC,KAAK,EAAE,EAAE,CACR,0CAA0C,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EACpE,yBAAyB,CAC1B,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;IAC7B,MAAM,IAAI,GAAG,OAAO,KAAK,SAAS;QAChC,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAEnD,MAAM,IAAI,GAAG,UAAU,CAAC,4BAA4B,CAAC,EAAE,CAAC;IAExD,MAAM,OAAO,GAAG,IAAI,OAA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EAAE,CAAC;QACjB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEhC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAU5B,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,0CAA0C,CAAC,EACvD,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CACtC,CAAC,QAAQ,CAAC,CAAC;IACZ,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VercelCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
5
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
6
|
+
import { GetAccountInfoRequest, GetAccountInfoResponseBody } from "../models/operations/getaccountinfo.js";
|
|
7
|
+
import { Result } from "../types/fp.js";
|
|
8
|
+
/**
|
|
9
|
+
* Get Account Information
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Fetches the best account or user’s contact info
|
|
13
|
+
*/
|
|
14
|
+
export declare function marketplaceGetAccountInfo(client: VercelCore, request: GetAccountInfoRequest, options?: RequestOptions): Promise<Result<GetAccountInfoResponseBody, SDKError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
|
|
15
|
+
//# sourceMappingURL=marketplaceGetAccountInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplaceGetAccountInfo.d.ts","sourceRoot":"","sources":["../../src/funcs/marketplaceGetAccountInfo.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,qBAAqB,EAErB,0BAA0B,EAE3B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,qBAAqB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CACR,MAAM,CACJ,0BAA0B,EACxB,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAuFA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
5
|
+
import * as M from "../lib/matchers.js";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
8
|
+
import { pathToFunc } from "../lib/url.js";
|
|
9
|
+
import { GetAccountInfoRequest$outboundSchema, GetAccountInfoResponseBody$inboundSchema, } from "../models/operations/getaccountinfo.js";
|
|
10
|
+
/**
|
|
11
|
+
* Get Account Information
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* Fetches the best account or user’s contact info
|
|
15
|
+
*/
|
|
16
|
+
export async function marketplaceGetAccountInfo(client, request, options) {
|
|
17
|
+
const parsed = safeParse(request, (value) => GetAccountInfoRequest$outboundSchema.parse(value), "Input validation failed");
|
|
18
|
+
if (!parsed.ok) {
|
|
19
|
+
return parsed;
|
|
20
|
+
}
|
|
21
|
+
const payload = parsed.value;
|
|
22
|
+
const body = null;
|
|
23
|
+
const pathParams = {
|
|
24
|
+
integrationConfigurationId: encodeSimple("integrationConfigurationId", payload.integrationConfigurationId, { explode: false, charEncoding: "percent" }),
|
|
25
|
+
};
|
|
26
|
+
const path = pathToFunc("/v1/installations/{integrationConfigurationId}/account")(pathParams);
|
|
27
|
+
const headers = new Headers({
|
|
28
|
+
Accept: "application/json",
|
|
29
|
+
});
|
|
30
|
+
const secConfig = await extractSecurity(client._options.bearerToken);
|
|
31
|
+
const securityInput = secConfig == null ? {} : { bearerToken: secConfig };
|
|
32
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
33
|
+
const context = {
|
|
34
|
+
operationID: "get-account-info",
|
|
35
|
+
oAuth2Scopes: [],
|
|
36
|
+
resolvedSecurity: requestSecurity,
|
|
37
|
+
securitySource: client._options.bearerToken,
|
|
38
|
+
retryConfig: (options === null || options === void 0 ? void 0 : options.retries)
|
|
39
|
+
|| client._options.retryConfig
|
|
40
|
+
|| { strategy: "none" },
|
|
41
|
+
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
42
|
+
};
|
|
43
|
+
const requestRes = client._createRequest(context, {
|
|
44
|
+
security: requestSecurity,
|
|
45
|
+
method: "GET",
|
|
46
|
+
path: path,
|
|
47
|
+
headers: headers,
|
|
48
|
+
body: body,
|
|
49
|
+
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || client._options.timeoutMs || -1,
|
|
50
|
+
}, options);
|
|
51
|
+
if (!requestRes.ok) {
|
|
52
|
+
return requestRes;
|
|
53
|
+
}
|
|
54
|
+
const req = requestRes.value;
|
|
55
|
+
const doResult = await client._do(req, {
|
|
56
|
+
context,
|
|
57
|
+
errorCodes: ["400", "401", "403", "4XX", "5XX"],
|
|
58
|
+
retryConfig: context.retryConfig,
|
|
59
|
+
retryCodes: context.retryCodes,
|
|
60
|
+
});
|
|
61
|
+
if (!doResult.ok) {
|
|
62
|
+
return doResult;
|
|
63
|
+
}
|
|
64
|
+
const response = doResult.value;
|
|
65
|
+
const [result] = await M.match(M.json(200, GetAccountInfoResponseBody$inboundSchema), M.fail([400, 401, 403, "4XX", "5XX"]))(response);
|
|
66
|
+
if (!result.ok) {
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=marketplaceGetAccountInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplaceGetAccountInfo.js","sourceRoot":"","sources":["../../src/funcs/marketplaceGetAccountInfo.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C,OAAO,EAEL,oCAAoC,EAEpC,wCAAwC,GACzC,MAAM,wCAAwC,CAAC;AAGhD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,MAAkB,EAClB,OAA8B,EAC9B,OAAwB;IAaxB,MAAM,MAAM,GAAG,SAAS,CACtB,OAAO,EACP,CAAC,KAAK,EAAE,EAAE,CAAC,oCAAoC,CAAC,KAAK,CAAC,KAAK,CAAC,EAC5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|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VercelCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
5
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
6
|
+
import { GetInvoiceRequest, GetInvoiceResponseBody } from "../models/operations/getinvoice.js";
|
|
7
|
+
import { Result } from "../types/fp.js";
|
|
8
|
+
/**
|
|
9
|
+
* Get Invoice
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Get Invoice details and status for a given invoice ID.<br/> <br/> See Billing Events with Webhooks documentation on how to receive invoice events. This endpoint is used to retrieve the invoice details.
|
|
13
|
+
*/
|
|
14
|
+
export declare function marketplaceGetInvoice(client: VercelCore, request: GetInvoiceRequest, options?: RequestOptions): Promise<Result<GetInvoiceResponseBody, SDKError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
|
|
15
|
+
//# sourceMappingURL=marketplaceGetInvoice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplaceGetInvoice.d.ts","sourceRoot":"","sources":["../../src/funcs/marketplaceGetInvoice.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,iBAAiB,EAEjB,sBAAsB,EAEvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CACR,MAAM,CACJ,sBAAsB,EACpB,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CA2FA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
5
|
+
import * as M from "../lib/matchers.js";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
8
|
+
import { pathToFunc } from "../lib/url.js";
|
|
9
|
+
import { GetInvoiceRequest$outboundSchema, GetInvoiceResponseBody$inboundSchema, } from "../models/operations/getinvoice.js";
|
|
10
|
+
/**
|
|
11
|
+
* Get Invoice
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* Get Invoice details and status for a given invoice ID.<br/> <br/> See Billing Events with Webhooks documentation on how to receive invoice events. This endpoint is used to retrieve the invoice details.
|
|
15
|
+
*/
|
|
16
|
+
export async function marketplaceGetInvoice(client, request, options) {
|
|
17
|
+
const parsed = safeParse(request, (value) => GetInvoiceRequest$outboundSchema.parse(value), "Input validation failed");
|
|
18
|
+
if (!parsed.ok) {
|
|
19
|
+
return parsed;
|
|
20
|
+
}
|
|
21
|
+
const payload = parsed.value;
|
|
22
|
+
const body = null;
|
|
23
|
+
const pathParams = {
|
|
24
|
+
integrationConfigurationId: encodeSimple("integrationConfigurationId", payload.integrationConfigurationId, { explode: false, charEncoding: "percent" }),
|
|
25
|
+
invoiceId: encodeSimple("invoiceId", payload.invoiceId, {
|
|
26
|
+
explode: false,
|
|
27
|
+
charEncoding: "percent",
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
const path = pathToFunc("/v1/installations/{integrationConfigurationId}/billing/invoices/{invoiceId}")(pathParams);
|
|
31
|
+
const headers = new Headers({
|
|
32
|
+
Accept: "application/json",
|
|
33
|
+
});
|
|
34
|
+
const secConfig = await extractSecurity(client._options.bearerToken);
|
|
35
|
+
const securityInput = secConfig == null ? {} : { bearerToken: secConfig };
|
|
36
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
37
|
+
const context = {
|
|
38
|
+
operationID: "get-invoice",
|
|
39
|
+
oAuth2Scopes: [],
|
|
40
|
+
resolvedSecurity: requestSecurity,
|
|
41
|
+
securitySource: client._options.bearerToken,
|
|
42
|
+
retryConfig: (options === null || options === void 0 ? void 0 : options.retries)
|
|
43
|
+
|| client._options.retryConfig
|
|
44
|
+
|| { strategy: "none" },
|
|
45
|
+
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
46
|
+
};
|
|
47
|
+
const requestRes = client._createRequest(context, {
|
|
48
|
+
security: requestSecurity,
|
|
49
|
+
method: "GET",
|
|
50
|
+
path: path,
|
|
51
|
+
headers: headers,
|
|
52
|
+
body: body,
|
|
53
|
+
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || client._options.timeoutMs || -1,
|
|
54
|
+
}, options);
|
|
55
|
+
if (!requestRes.ok) {
|
|
56
|
+
return requestRes;
|
|
57
|
+
}
|
|
58
|
+
const req = requestRes.value;
|
|
59
|
+
const doResult = await client._do(req, {
|
|
60
|
+
context,
|
|
61
|
+
errorCodes: ["400", "401", "403", "404", "4XX", "5XX"],
|
|
62
|
+
retryConfig: context.retryConfig,
|
|
63
|
+
retryCodes: context.retryCodes,
|
|
64
|
+
});
|
|
65
|
+
if (!doResult.ok) {
|
|
66
|
+
return doResult;
|
|
67
|
+
}
|
|
68
|
+
const response = doResult.value;
|
|
69
|
+
const [result] = await M.match(M.json(200, GetInvoiceResponseBody$inboundSchema), M.fail([400, 401, 403, 404, "4XX", "5XX"]))(response);
|
|
70
|
+
if (!result.ok) {
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=marketplaceGetInvoice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplaceGetInvoice.js","sourceRoot":"","sources":["../../src/funcs/marketplaceGetInvoice.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C,OAAO,EAEL,gCAAgC,EAEhC,oCAAoC,GACrC,MAAM,oCAAoC,CAAC;AAG5C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,MAAkB,EAClB,OAA0B,EAC1B,OAAwB;IAaxB,MAAM,MAAM,GAAG,SAAS,CACtB,OAAO,EACP,CAAC,KAAK,EAAE,EAAE,CAAC,gCAAgC,CAAC,KAAK,CAAC,KAAK,CAAC,EACxD,yBAAyB,CAC1B,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,CAAC;IAElB,MAAM,UAAU,GAAG;QACjB,0BAA0B,EAAE,YAAY,CAC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|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
5
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
6
|
+
import { GetMemberRequest, GetMemberResponseBody } from "../models/operations/getmember.js";
|
|
7
|
+
import { Result } from "../types/fp.js";
|
|
8
|
+
/**
|
|
9
|
+
* Get Member Information
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Returns the member role and other information for a given member ID ("user_id" claim in the SSO OIDC token).
|
|
13
|
+
*/
|
|
14
|
+
export declare function marketplaceGetMember(client: VercelCore, request: GetMemberRequest, options?: RequestOptions): Promise<Result<GetMemberResponseBody, SDKError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
|
|
15
|
+
//# sourceMappingURL=marketplaceGetMember.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplaceGetMember.d.ts","sourceRoot":"","sources":["../../src/funcs/marketplaceGetMember.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,gBAAgB,EAEhB,qBAAqB,EAEtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CACR,MAAM,CACJ,qBAAqB,EACnB,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CA2FA"}
|