Comparing version 0.30.4 to 0.31.0
@@ -13,2 +13,3 @@ # Links | ||
* [createMany](#createmany) - Bulk create links | ||
* [updateMany](#updatemany) - Bulk update links | ||
* [upsert](#upsert) - Upsert a link | ||
@@ -375,2 +376,57 @@ | ||
## updateMany | ||
Bulk update up to 100 links with the same data for the authenticated workspace. | ||
### Example Usage | ||
```typescript | ||
import { Dub } from "dub"; | ||
const dub = new Dub({ | ||
token: "DUB_API_KEY", | ||
}); | ||
async function run() { | ||
const result = await dub.links.updateMany({ | ||
linkIds: [ | ||
"<value>", | ||
], | ||
data: {}, | ||
}); | ||
// Handle the result | ||
console.log(result) | ||
} | ||
run(); | ||
``` | ||
### Parameters | ||
| Parameter | Type | Required | Description | | ||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| `request` | [operations.BulkUpdateLinksRequestBody](../../models/operations/bulkupdatelinksrequestbody.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. | | ||
### Response | ||
**Promise\<[components.LinkSchema[]](../../models/.md)\>** | ||
### Errors | ||
| 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 | */* | | ||
## upsert | ||
@@ -377,0 +433,0 @@ |
@@ -35,6 +35,6 @@ import { HTTPClient } from "./http.js"; | ||
readonly openapiDocVersion: "0.0.1"; | ||
readonly sdkVersion: "0.30.4"; | ||
readonly genVersion: "2.356.0"; | ||
readonly userAgent: "speakeasy-sdk/typescript 0.30.4 2.356.0 0.0.1 dub"; | ||
readonly sdkVersion: "0.31.0"; | ||
readonly genVersion: "2.359.0"; | ||
readonly userAgent: "speakeasy-sdk/typescript 0.31.0 2.359.0 0.0.1 dub"; | ||
}; | ||
//# sourceMappingURL=config.d.ts.map |
@@ -35,6 +35,6 @@ "use strict"; | ||
openapiDocVersion: "0.0.1", | ||
sdkVersion: "0.30.4", | ||
genVersion: "2.356.0", | ||
userAgent: "speakeasy-sdk/typescript 0.30.4 2.356.0 0.0.1 dub", | ||
sdkVersion: "0.31.0", | ||
genVersion: "2.359.0", | ||
userAgent: "speakeasy-sdk/typescript 0.31.0 2.359.0 0.0.1 dub", | ||
}; | ||
//# sourceMappingURL=config.js.map |
export * from "./bulkcreatelinks.js"; | ||
export * from "./bulkupdatelinks.js"; | ||
export * from "./createdomain.js"; | ||
@@ -3,0 +4,0 @@ export * from "./createlink.js"; |
@@ -21,2 +21,3 @@ "use strict"; | ||
__exportStar(require("./bulkcreatelinks.js"), exports); | ||
__exportStar(require("./bulkupdatelinks.js"), exports); | ||
__exportStar(require("./createdomain.js"), exports); | ||
@@ -23,0 +24,0 @@ __exportStar(require("./createlink.js"), exports); |
{ | ||
"name": "dub", | ||
"version": "0.30.4", | ||
"author": "Dub", | ||
"version": "0.31.0", | ||
"author": "Dub", | ||
"main": "./index.js", | ||
@@ -6,0 +6,0 @@ "sideEffects": false, |
@@ -111,2 +111,3 @@ <div align="center"> | ||
* [createMany](docs/sdks/links/README.md#createmany) - Bulk create links | ||
* [updateMany](docs/sdks/links/README.md#updatemany) - Bulk update links | ||
* [upsert](docs/sdks/links/README.md#upsert) - Upsert a link | ||
@@ -113,0 +114,0 @@ |
@@ -58,2 +58,9 @@ import { SDKOptions } from "../lib/config.js"; | ||
/** | ||
* Bulk update links | ||
* | ||
* @remarks | ||
* Bulk update up to 100 links with the same data for the authenticated workspace. | ||
*/ | ||
updateMany(request?: operations.BulkUpdateLinksRequestBody | undefined, options?: RequestOptions): Promise<Array<components.LinkSchema>>; | ||
/** | ||
* Upsert a link | ||
@@ -60,0 +67,0 @@ * |
@@ -644,2 +644,77 @@ "use strict"; | ||
/** | ||
* Bulk update links | ||
* | ||
* @remarks | ||
* Bulk update up to 100 links with the same data for the authenticated workspace. | ||
*/ | ||
async updateMany(request, options) { | ||
const input$ = request; | ||
const headers$ = new Headers(); | ||
headers$.set("user-agent", config_js_1.SDK_METADATA.userAgent); | ||
headers$.set("Content-Type", "application/json"); | ||
headers$.set("Accept", "application/json"); | ||
const payload$ = schemas$.parse(input$, (value$) => operations.BulkUpdateLinksRequestBody$.outboundSchema.optional().parse(value$), "Input validation failed"); | ||
const body$ = payload$ === undefined ? null : (0, encodings_js_1.encodeJSON)("body", payload$, { explode: true }); | ||
const path$ = this.templateURLComponent("/links/bulk")(); | ||
const query$ = ""; | ||
let security$; | ||
if (typeof this.options$.token === "function") { | ||
security$ = { token: await this.options$.token() }; | ||
} | ||
else if (this.options$.token) { | ||
security$ = { token: this.options$.token }; | ||
} | ||
else { | ||
security$ = {}; | ||
} | ||
const context = { | ||
operationID: "bulkUpdateLinks", | ||
oAuth2Scopes: [], | ||
securitySource: this.options$.token, | ||
}; | ||
const securitySettings$ = this.resolveGlobalSecurity(security$); | ||
const doOptions = { | ||
context, | ||
errorCodes: [ | ||
"400", | ||
"401", | ||
"403", | ||
"404", | ||
"409", | ||
"410", | ||
"422", | ||
"429", | ||
"4XX", | ||
"500", | ||
"5XX", | ||
], | ||
}; | ||
const request$ = this.createRequest$(context, { | ||
security: securitySettings$, | ||
method: "PATCH", | ||
path: path$, | ||
headers: headers$, | ||
query: query$, | ||
body: body$, | ||
}, options); | ||
const response = await this.do$(request$, doOptions); | ||
const responseFields$ = { | ||
HttpMeta: { Response: response, Request: request$ }, | ||
}; | ||
const [result$] = await this.matcher() | ||
.json(200, z.array(components.LinkSchema$.inboundSchema)) | ||
.json(400, errors.BadRequest$, { err: true }) | ||
.json(401, errors.Unauthorized$, { err: true }) | ||
.json(403, errors.Forbidden$, { err: true }) | ||
.json(404, errors.NotFound$, { err: true }) | ||
.json(409, errors.Conflict$, { err: true }) | ||
.json(410, errors.InviteExpired$, { err: true }) | ||
.json(422, errors.UnprocessableEntity$, { err: true }) | ||
.json(429, errors.RateLimitExceeded$, { err: true }) | ||
.json(500, errors.InternalServerError$, { err: true }) | ||
.fail(["4XX", "5XX"]) | ||
.match(response, { extraFields: responseFields$ }); | ||
return result$; | ||
} | ||
/** | ||
* Upsert a link | ||
@@ -646,0 +721,0 @@ * |
@@ -67,5 +67,5 @@ /* | ||
openapiDocVersion: "0.0.1", | ||
sdkVersion: "0.30.4", | ||
genVersion: "2.356.0", | ||
userAgent: "speakeasy-sdk/typescript 0.30.4 2.356.0 0.0.1 dub", | ||
sdkVersion: "0.31.0", | ||
genVersion: "2.359.0", | ||
userAgent: "speakeasy-sdk/typescript 0.31.0 2.359.0 0.0.1 dub", | ||
} as const; |
@@ -6,2 +6,3 @@ /* | ||
export * from "./bulkcreatelinks.js"; | ||
export * from "./bulkupdatelinks.js"; | ||
export * from "./createdomain.js"; | ||
@@ -8,0 +9,0 @@ export * from "./createlink.js"; |
@@ -766,2 +766,98 @@ /* | ||
/** | ||
* Bulk update links | ||
* | ||
* @remarks | ||
* Bulk update up to 100 links with the same data for the authenticated workspace. | ||
*/ | ||
async updateMany( | ||
request?: operations.BulkUpdateLinksRequestBody | undefined, | ||
options?: RequestOptions | ||
): Promise<Array<components.LinkSchema>> { | ||
const input$ = request; | ||
const headers$ = new Headers(); | ||
headers$.set("user-agent", SDK_METADATA.userAgent); | ||
headers$.set("Content-Type", "application/json"); | ||
headers$.set("Accept", "application/json"); | ||
const payload$ = schemas$.parse( | ||
input$, | ||
(value$) => | ||
operations.BulkUpdateLinksRequestBody$.outboundSchema.optional().parse(value$), | ||
"Input validation failed" | ||
); | ||
const body$ = | ||
payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); | ||
const path$ = this.templateURLComponent("/links/bulk")(); | ||
const query$ = ""; | ||
let security$; | ||
if (typeof this.options$.token === "function") { | ||
security$ = { token: await this.options$.token() }; | ||
} else if (this.options$.token) { | ||
security$ = { token: this.options$.token }; | ||
} else { | ||
security$ = {}; | ||
} | ||
const context = { | ||
operationID: "bulkUpdateLinks", | ||
oAuth2Scopes: [], | ||
securitySource: this.options$.token, | ||
}; | ||
const securitySettings$ = this.resolveGlobalSecurity(security$); | ||
const doOptions = { | ||
context, | ||
errorCodes: [ | ||
"400", | ||
"401", | ||
"403", | ||
"404", | ||
"409", | ||
"410", | ||
"422", | ||
"429", | ||
"4XX", | ||
"500", | ||
"5XX", | ||
], | ||
}; | ||
const request$ = this.createRequest$( | ||
context, | ||
{ | ||
security: securitySettings$, | ||
method: "PATCH", | ||
path: path$, | ||
headers: headers$, | ||
query: query$, | ||
body: body$, | ||
}, | ||
options | ||
); | ||
const response = await this.do$(request$, doOptions); | ||
const responseFields$ = { | ||
HttpMeta: { Response: response, Request: request$ }, | ||
}; | ||
const [result$] = await this.matcher<Array<components.LinkSchema>>() | ||
.json(200, z.array(components.LinkSchema$.inboundSchema)) | ||
.json(400, errors.BadRequest$, { err: true }) | ||
.json(401, errors.Unauthorized$, { err: true }) | ||
.json(403, errors.Forbidden$, { err: true }) | ||
.json(404, errors.NotFound$, { err: true }) | ||
.json(409, errors.Conflict$, { err: true }) | ||
.json(410, errors.InviteExpired$, { err: true }) | ||
.json(422, errors.UnprocessableEntity$, { err: true }) | ||
.json(429, errors.RateLimitExceeded$, { err: true }) | ||
.json(500, errors.InternalServerError$, { err: true }) | ||
.fail(["4XX", "5XX"]) | ||
.match(response, { extraFields: responseFields$ }); | ||
return result$; | ||
} | ||
/** | ||
* Upsert a link | ||
@@ -768,0 +864,0 @@ * |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1831353
552
36148
395