mirror of
https://github.com/LukeHagar/dub-node.git
synced 2025-12-06 04:19:37 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.262.0
This commit is contained in:
@@ -45,12 +45,21 @@ run();
|
||||
|
||||
### Response
|
||||
|
||||
**Promise<[operations.ListDomainsResponse](../../models/operations/listdomainsresponse.md)>**
|
||||
**Promise<[operations.ListDomainsResponseBody[]](../../models/.md)>**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------- | --------------- | --------------- |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------- | -------------------------- | -------------------------- |
|
||||
| errors.BadRequest | 400 | application/json |
|
||||
| errors.Unauthorized | 401 | application/json |
|
||||
| errors.Forbidden | 403 | application/json |
|
||||
| errors.NotFound | 404 | application/json |
|
||||
| errors.Conflict | 409 | application/json |
|
||||
| errors.InviteExpired | 410 | application/json |
|
||||
| errors.UnprocessableEntity | 422 | application/json |
|
||||
| errors.RateLimitExceeded | 429 | application/json |
|
||||
| errors.InternalServerError | 500 | application/json |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## add
|
||||
|
||||
@@ -60,6 +69,7 @@ Add a domain to the authenticated workspace.
|
||||
|
||||
```typescript
|
||||
import { Dub } from "dub";
|
||||
import { Type } from "dub/models/operations";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
@@ -68,7 +78,12 @@ const dub = new Dub({
|
||||
|
||||
async function run() {
|
||||
const result = await dub.domains.add({
|
||||
slug: "<value>",
|
||||
slug: "acme.com",
|
||||
type: Type.Redirect,
|
||||
target: "https://acme.com/landing",
|
||||
expiredUrl: "https://acme.com/expired",
|
||||
archived: false,
|
||||
placeholder: "https://dub.co/help/article/what-is-dub",
|
||||
});
|
||||
|
||||
// Handle the result
|
||||
@@ -89,12 +104,21 @@ run();
|
||||
|
||||
### Response
|
||||
|
||||
**Promise<[operations.AddDomainResponse](../../models/operations/adddomainresponse.md)>**
|
||||
**Promise<[operations.AddDomainResponseBody](../../models/operations/adddomainresponsebody.md)>**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------- | --------------- | --------------- |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------- | -------------------------- | -------------------------- |
|
||||
| errors.BadRequest | 400 | application/json |
|
||||
| errors.Unauthorized | 401 | application/json |
|
||||
| errors.Forbidden | 403 | application/json |
|
||||
| errors.NotFound | 404 | application/json |
|
||||
| errors.Conflict | 409 | application/json |
|
||||
| errors.InviteExpired | 410 | application/json |
|
||||
| errors.UnprocessableEntity | 422 | application/json |
|
||||
| errors.RateLimitExceeded | 429 | application/json |
|
||||
| errors.InternalServerError | 500 | application/json |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## delete
|
||||
|
||||
@@ -133,12 +157,21 @@ run();
|
||||
|
||||
### Response
|
||||
|
||||
**Promise<[operations.DeleteDomainResponse](../../models/operations/deletedomainresponse.md)>**
|
||||
**Promise<[operations.DeleteDomainResponseBody](../../models/operations/deletedomainresponsebody.md)>**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------- | --------------- | --------------- |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------- | -------------------------- | -------------------------- |
|
||||
| errors.BadRequest | 400 | application/json |
|
||||
| errors.Unauthorized | 401 | application/json |
|
||||
| errors.Forbidden | 403 | application/json |
|
||||
| errors.NotFound | 404 | application/json |
|
||||
| errors.Conflict | 409 | application/json |
|
||||
| errors.InviteExpired | 410 | application/json |
|
||||
| errors.UnprocessableEntity | 422 | application/json |
|
||||
| errors.RateLimitExceeded | 429 | application/json |
|
||||
| errors.InternalServerError | 500 | application/json |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## update
|
||||
|
||||
@@ -148,6 +181,7 @@ Edit a domain for the authenticated workspace.
|
||||
|
||||
```typescript
|
||||
import { Dub } from "dub";
|
||||
import { EditDomainType } from "dub/models/operations";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
@@ -155,10 +189,17 @@ const dub = new Dub({
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.domains.update({
|
||||
const slug = "acme.com";
|
||||
const requestBody = {
|
||||
slug: "acme.com",
|
||||
requestBody: {},
|
||||
});
|
||||
type: EditDomainType.Redirect,
|
||||
target: "https://acme.com/landing",
|
||||
expiredUrl: "https://acme.com/expired",
|
||||
archived: false,
|
||||
placeholder: "https://dub.co/help/article/what-is-dub",
|
||||
};
|
||||
|
||||
const result = await dub.domains.update(slug, requestBody);
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
@@ -169,21 +210,31 @@ run();
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.EditDomainRequest](../../models/operations/editdomainrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
||||
| `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. |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `slug` | *string* | :heavy_check_mark: | The domain name. | [object Object] |
|
||||
| `requestBody` | [operations.EditDomainRequestBody](../../models/operations/editdomainrequestbody.md) | :heavy_minus_sign: | N/A | |
|
||||
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
|
||||
| `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. | |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**Promise<[operations.EditDomainResponse](../../models/operations/editdomainresponse.md)>**
|
||||
**Promise<[operations.EditDomainResponseBody](../../models/operations/editdomainresponsebody.md)>**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------- | --------------- | --------------- |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------- | -------------------------- | -------------------------- |
|
||||
| errors.BadRequest | 400 | application/json |
|
||||
| errors.Unauthorized | 401 | application/json |
|
||||
| errors.Forbidden | 403 | application/json |
|
||||
| errors.NotFound | 404 | application/json |
|
||||
| errors.Conflict | 409 | application/json |
|
||||
| errors.InviteExpired | 410 | application/json |
|
||||
| errors.UnprocessableEntity | 422 | application/json |
|
||||
| errors.RateLimitExceeded | 429 | application/json |
|
||||
| errors.InternalServerError | 500 | application/json |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## setPrimary
|
||||
|
||||
@@ -222,12 +273,21 @@ run();
|
||||
|
||||
### Response
|
||||
|
||||
**Promise<[operations.SetPrimaryDomainResponse](../../models/operations/setprimarydomainresponse.md)>**
|
||||
**Promise<[operations.SetPrimaryDomainResponseBody](../../models/operations/setprimarydomainresponsebody.md)>**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------- | --------------- | --------------- |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------- | -------------------------- | -------------------------- |
|
||||
| errors.BadRequest | 400 | application/json |
|
||||
| errors.Unauthorized | 401 | application/json |
|
||||
| errors.Forbidden | 403 | application/json |
|
||||
| errors.NotFound | 404 | application/json |
|
||||
| errors.Conflict | 409 | application/json |
|
||||
| errors.InviteExpired | 410 | application/json |
|
||||
| errors.UnprocessableEntity | 422 | application/json |
|
||||
| errors.RateLimitExceeded | 429 | application/json |
|
||||
| errors.InternalServerError | 500 | application/json |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## transfer
|
||||
|
||||
@@ -244,12 +304,12 @@ const dub = new Dub({
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.domains.transfer({
|
||||
slug: "acme.com",
|
||||
requestBody: {
|
||||
newWorkspaceId: "<value>",
|
||||
},
|
||||
});
|
||||
const slug = "acme.com";
|
||||
const requestBody = {
|
||||
newWorkspaceId: "<value>",
|
||||
};
|
||||
|
||||
const result = await dub.domains.transfer(slug, requestBody);
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
@@ -260,18 +320,28 @@ run();
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `request` | [operations.TransferDomainRequest](../../models/operations/transferdomainrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
||||
| `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. |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `slug` | *string* | :heavy_check_mark: | The domain name. | [object Object] |
|
||||
| `requestBody` | [operations.TransferDomainRequestBody](../../models/operations/transferdomainrequestbody.md) | :heavy_minus_sign: | N/A | |
|
||||
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
|
||||
| `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. | |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**Promise<[operations.TransferDomainResponse](../../models/operations/transferdomainresponse.md)>**
|
||||
**Promise<[operations.TransferDomainResponseBody](../../models/operations/transferdomainresponsebody.md)>**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------- | --------------- | --------------- |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------- | -------------------------- | -------------------------- |
|
||||
| errors.BadRequest | 400 | application/json |
|
||||
| errors.Unauthorized | 401 | application/json |
|
||||
| errors.Forbidden | 403 | application/json |
|
||||
| errors.NotFound | 404 | application/json |
|
||||
| errors.Conflict | 409 | application/json |
|
||||
| errors.InviteExpired | 410 | application/json |
|
||||
| errors.UnprocessableEntity | 422 | application/json |
|
||||
| errors.RateLimitExceeded | 429 | application/json |
|
||||
| errors.InternalServerError | 500 | application/json |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
Reference in New Issue
Block a user