Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.

Commit 35b9eb7

Browse files
authored
Merge pull request #4 from unkeyed/speakeasy-sdk-regen-1743577103
chore: 🐝 Update SDK - Generate 2.0.0-alpha.2
2 parents a71e68d + e4ff228 commit 35b9eb7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+358
-1089
lines changed

.speakeasy/gen.lock

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ id: 4ae464f3-5455-4bce-932c-85c7fc085db8
33
management:
44
docChecksum: d32c409ca16bfb64eed3c26906f2835b
55
docVersion: 2.0.0
6-
speakeasyVersion: 1.524.0
7-
generationVersion: 2.562.2
8-
releaseVersion: 2.0.0-alpha.1
9-
configChecksum: ced7af67912943185c51d929991fe39c
6+
speakeasyVersion: 1.527.1
7+
generationVersion: 2.564.5
8+
releaseVersion: 2.0.0-alpha.2
9+
configChecksum: b1983b3119d551c7e7e77d9627b050ce
1010
repoURL: https://github.com/unkeyed/unkey-ts.git
1111
installationURL: https://github.com/unkeyed/unkey-ts
12+
published: true
1213
features:
1314
typescript:
1415
additionalDependencies: 0.1.0
@@ -36,6 +37,7 @@ generatedFiles:
3637
- RUNTIMES.md
3738
- USAGE.md
3839
- docs/lib/utils/retryconfig.md
40+
- docs/models/components/httpmetadata.md
3941
- docs/models/components/security.md
4042
- docs/models/components/v2livenessresponsebody.md
4143
- docs/models/components/v2ratelimitdeleteoverriderequestbody.md
@@ -48,11 +50,7 @@ generatedFiles:
4850
- docs/models/components/v2ratelimitsetoverrideresponsebody.md
4951
- docs/models/components/validationerror.md
5052
- docs/models/errors/badrequesterror.md
51-
- docs/models/errors/forbiddenerror.md
52-
- docs/models/errors/internalservererror.md
53-
- docs/models/errors/notfounderror.md
54-
- docs/models/errors/preconditionfailederror.md
55-
- docs/models/errors/unauthorizederror.md
53+
- docs/models/errors/baseerror.md
5654
- docs/models/operations/livenessresponse.md
5755
- docs/models/operations/ratelimitdeleteoverrideresponse.md
5856
- docs/models/operations/ratelimitgetoverrideresponse.md
@@ -90,6 +88,7 @@ generatedFiles:
9088
- src/lib/sdks.ts
9189
- src/lib/security.ts
9290
- src/lib/url.ts
91+
- src/models/components/httpmetadata.ts
9392
- src/models/components/index.ts
9493
- src/models/components/security.ts
9594
- src/models/components/v2livenessresponsebody.ts
@@ -104,14 +103,10 @@ generatedFiles:
104103
- src/models/components/validationerror.ts
105104
- src/models/errors/apierror.ts
106105
- src/models/errors/badrequesterror.ts
107-
- src/models/errors/forbiddenerror.ts
106+
- src/models/errors/baseerror.ts
108107
- src/models/errors/httpclienterrors.ts
109108
- src/models/errors/index.ts
110-
- src/models/errors/internalservererror.ts
111-
- src/models/errors/notfounderror.ts
112-
- src/models/errors/preconditionfailederror.ts
113109
- src/models/errors/sdkvalidationerror.ts
114-
- src/models/errors/unauthorizederror.ts
115110
- src/models/operations/index.ts
116111
- src/models/operations/liveness.ts
117112
- src/models/operations/ratelimitdeleteoverride.ts

.speakeasy/gen.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ generation:
1818
oAuth2ClientCredentialsEnabled: true
1919
oAuth2PasswordEnabled: true
2020
typescript:
21-
version: 2.0.0-alpha.1
21+
version: 2.0.0-alpha.2
2222
additionalDependencies:
2323
dependencies: {}
2424
devDependencies: {}
@@ -49,7 +49,7 @@ typescript:
4949
methodArguments: require-security-and-request
5050
moduleFormat: dual
5151
outputModelSuffix: output
52-
packageName: "@unkey/api"
52+
packageName: '@unkey/api'
5353
responseFormat: envelope-http
5454
templateVersion: v2
5555
useIndexModules: true

.speakeasy/workflow.lock

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
speakeasyVersion: 1.524.0
1+
speakeasyVersion: 1.527.1
22
sources:
33
Unkey API:
44
sourceNamespace: unkey-api
5-
sourceRevisionDigest: sha256:d1b6923d89a67cd40d106a5a673534fac7099ea32e1917d20ef4bffec86fd417
5+
sourceRevisionDigest: sha256:18e88a99a35b022f4fa8aff9625054a11f3925fd921d1a440d84a25024fecc8e
66
sourceBlobDigest: sha256:411d7a08cddea23554e812add92b683e49ce24e0ab269bd188bc98ffaf5763d9
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1742602508
9+
- speakeasy-sdk-regen-1743577103
1010
- 2.0.0
1111
targets:
1212
unkey:
1313
source: Unkey API
1414
sourceNamespace: unkey-api
15-
sourceRevisionDigest: sha256:d1b6923d89a67cd40d106a5a673534fac7099ea32e1917d20ef4bffec86fd417
15+
sourceRevisionDigest: sha256:18e88a99a35b022f4fa8aff9625054a11f3925fd921d1a440d84a25024fecc8e
1616
sourceBlobDigest: sha256:411d7a08cddea23554e812add92b683e49ce24e0ab269bd188bc98ffaf5763d9
1717
codeSamplesNamespace: unkey-api-typescript-code-samples
18-
codeSamplesRevisionDigest: sha256:d79377e915643475184c0b9f720c57abcacd3801386ae55e1ed4634bda7ffde1
18+
codeSamplesRevisionDigest: sha256:bd448cfc67388ab278f8ca23c08ee6b25f751ca633162a0d48c6a06851e30b57
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest
@@ -31,6 +31,9 @@ workflow:
3131
unkey:
3232
target: typescript
3333
source: Unkey API
34+
publish:
35+
npm:
36+
token: $npm_token
3437
codeSamples:
3538
registry:
3639
location: registry.speakeasyapi.dev/unkey/unkey/unkey-api-typescript-code-samples

README.md

Lines changed: 15 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -44,34 +44,30 @@ Developer-friendly & type-safe Typescript SDK specifically catered to leverage *
4444
<!-- Start SDK Installation [installation] -->
4545
## SDK Installation
4646

47-
> [!TIP]
48-
> To finish publishing your SDK to npm and others you must [run your first generation action](https://www.speakeasy.com/docs/github-setup#step-by-step-guide).
49-
50-
5147
The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
5248

5349
### NPM
5450

5551
```bash
56-
npm add https://github.com/unkeyed/unkey-ts
52+
npm add @unkey/api
5753
```
5854

5955
### PNPM
6056

6157
```bash
62-
pnpm add https://github.com/unkeyed/unkey-ts
58+
pnpm add @unkey/api
6359
```
6460

6561
### Bun
6662

6763
```bash
68-
bun add https://github.com/unkeyed/unkey-ts
64+
bun add @unkey/api
6965
```
7066

7167
### Yarn
7268

7369
```bash
74-
yarn add https://github.com/unkeyed/unkey-ts zod
70+
yarn add @unkey/api zod
7571

7672
# Note that Yarn does not install peer dependencies automatically. You will need
7773
# to install zod as shown above.
@@ -277,26 +273,21 @@ run();
277273

278274
Some methods specify known errors which can be thrown. All the known errors are enumerated in the `models/errors/errors.ts` module. The known errors for a method are documented under the *Errors* tables in SDK docs. For example, the `limit` method may throw the following errors:
279275

280-
| Error Type | Status Code | Content Type |
281-
| -------------------------- | ----------- | ------------------------ |
282-
| errors.BadRequestError | 400 | application/problem+json |
283-
| errors.UnauthorizedError | 401 | application/problem+json |
284-
| errors.ForbiddenError | 403 | application/problem+json |
285-
| errors.NotFoundError | 404 | application/problem+json |
286-
| errors.InternalServerError | 500 | application/problem+json |
287-
| errors.APIError | 4XX, 5XX | \*/\* |
276+
| Error Type | Status Code | Content Type |
277+
| ---------------------- | ------------- | ------------------------ |
278+
| errors.BadRequestError | 400 | application/problem+json |
279+
| errors.BaseError | 401, 403, 404 | application/problem+json |
280+
| errors.BaseError | 500 | application/problem+json |
281+
| errors.APIError | 4XX, 5XX | \*/\* |
288282

289283
If the method throws an error and it is not captured by the known errors, it will default to throwing a `APIError`.
290284

291285
```typescript
292286
import { Unkey } from "@unkey/api";
293287
import {
294288
BadRequestError,
295-
ForbiddenError,
296-
InternalServerError,
297-
NotFoundError,
289+
BaseError,
298290
SDKValidationError,
299-
UnauthorizedError,
300291
} from "@unkey/api/models/errors";
301292

302293
const unkey = new Unkey({
@@ -330,23 +321,13 @@ async function run() {
330321
console.error(err);
331322
return;
332323
}
333-
case (err instanceof UnauthorizedError): {
334-
// Handle err.data$: UnauthorizedErrorData
335-
console.error(err);
336-
return;
337-
}
338-
case (err instanceof ForbiddenError): {
339-
// Handle err.data$: ForbiddenErrorData
340-
console.error(err);
341-
return;
342-
}
343-
case (err instanceof NotFoundError): {
344-
// Handle err.data$: NotFoundErrorData
324+
case (err instanceof BaseError): {
325+
// Handle err.data$: BaseErrorData
345326
console.error(err);
346327
return;
347328
}
348-
case (err instanceof InternalServerError): {
349-
// Handle err.data$: InternalServerErrorData
329+
case (err instanceof BaseError): {
330+
// Handle err.data$: BaseErrorData
350331
console.error(err);
351332
return;
352333
}

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,14 @@ Based on:
1414
- OpenAPI Doc
1515
- Speakeasy CLI 1.524.0 (2.562.2) https://github.com/speakeasy-api/speakeasy
1616
### Generated
17-
- [typescript v2.0.0-alpha.1] .
17+
- [typescript v2.0.0-alpha.1] .
18+
19+
## 2025-04-02 06:58:07
20+
### Changes
21+
Based on:
22+
- OpenAPI Doc
23+
- Speakeasy CLI 1.527.1 (2.564.5) https://github.com/speakeasy-api/speakeasy
24+
### Generated
25+
- [typescript v2.0.0-alpha.2] .
26+
### Releases
27+
- [NPM v2.0.0-alpha.2] https://www.npmjs.com/package/@unkey/api/v/2.0.0-alpha.2 - .
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# HTTPMetadata
2+
3+
## Example Usage
4+
5+
```typescript
6+
import { HTTPMetadata } from "@unkey/api/models/components";
7+
8+
let value: HTTPMetadata = {
9+
response: new Response("{\"message\": \"hello world\"}", {
10+
headers: { "Content-Type": "application/json" },
11+
}),
12+
request: new Request("https://example.com"),
13+
};
14+
```
15+
16+
## Fields
17+
18+
| Field | Type | Required | Description |
19+
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
20+
| `response` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
21+
| `request` | *Request* | :heavy_check_mark: | Raw HTTP request; suitable for debugging |

docs/models/components/v2ratelimitgetoverrideresponsebody.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import { V2RatelimitGetOverrideResponseBody } from "@unkey/api/models/components
88
let value: V2RatelimitGetOverrideResponseBody = {
99
namespaceId: "<id>",
1010
overrideId: "<id>",
11-
duration: 832620,
11+
duration: 891773,
1212
identifier: "<value>",
13-
limit: 778157,
13+
limit: 963663,
1414
};
1515
```
1616

docs/models/components/v2ratelimitlimitrequestbody.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { V2RatelimitLimitRequestBody } from "@unkey/api/models/components";
77

88
let value: V2RatelimitLimitRequestBody = {
99
namespace: "sms.sign_up",
10-
duration: 925597,
10+
duration: 544883,
1111
identifier: "<value>",
12-
limit: 71036,
12+
limit: 423655,
1313
};
1414
```
1515

docs/models/components/v2ratelimitlimitresponsebody.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import { V2RatelimitLimitResponseBody } from "@unkey/api/models/components";
77

88
let value: V2RatelimitLimitResponseBody = {
9-
limit: 791725,
10-
remaining: 528895,
11-
reset: 568045,
9+
limit: 548814,
10+
remaining: 715190,
11+
reset: 602763,
1212
success: false,
1313
};
1414
```

docs/models/components/v2ratelimitsetoverriderequestbody.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Sets a new or overwrites an existing override.
88
import { V2RatelimitSetOverrideRequestBody } from "@unkey/api/models/components";
99

1010
let value: V2RatelimitSetOverrideRequestBody = {
11-
duration: 87129,
11+
duration: 645894,
1212
identifier: "<value>",
13-
limit: 20218,
13+
limit: 437587,
1414
};
1515
```
1616

0 commit comments

Comments
 (0)