Skip to content

Commit 5ef75e1

Browse files
SDK regeneration
1 parent cbfed34 commit 5ef75e1

File tree

11 files changed

+82
-11
lines changed

11 files changed

+82
-11
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ The official Markup AI SDK for interacting with the Markup AI API.
77

88
## Table of Contents
99

10+
- [Table of Contents](#table-of-contents)
11+
- [Installation](#installation)
12+
- [Reference](#reference)
13+
- [Usage](#usage)
14+
- [Request and Response Types](#request-and-response-types)
15+
- [Exception Handling](#exception-handling)
16+
- [Advanced](#advanced)
17+
- [Additional Headers](#additional-headers)
18+
- [Additional Query String Parameters](#additional-query-string-parameters)
19+
- [Retries](#retries)
20+
- [Timeouts](#timeouts)
21+
- [Aborting Requests](#aborting-requests)
22+
- [Access Raw Response Data](#access-raw-response-data)
23+
- [Runtime Compatibility](#runtime-compatibility)
24+
- [Contributing](#contributing)
25+
26+
## Table of Contents
27+
1028
- [Installation](#installation)
1129
- [Reference](#reference)
1230
- [Usage](#usage)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@markupai/api",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"private": false,
55
"repository": "github:markupai/markup-ai-typescript-sdk",
66
"license": "Apache-2.0",

src/Client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export class MarkupAIClient {
4949
{
5050
"X-Fern-Language": "JavaScript",
5151
"X-Fern-SDK-Name": "@markupai/api",
52-
"X-Fern-SDK-Version": "1.1.0",
53-
"User-Agent": "@markupai/api/1.1.0",
52+
"X-Fern-SDK-Version": "1.2.0",
53+
"User-Agent": "@markupai/api/1.2.0",
5454
"X-Fern-Runtime": core.RUNTIME.type,
5555
"X-Fern-Runtime-Version": core.RUNTIME.version,
5656
},

src/api/errors/ConflictError.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as errors from "../../errors/index.js";
6+
import * as MarkupAI from "../index.js";
7+
import * as core from "../../core/index.js";
8+
9+
export class ConflictError extends errors.MarkupAIError {
10+
constructor(body: MarkupAI.ErrorResponse, rawResponse?: core.RawResponse) {
11+
super({
12+
message: "ConflictError",
13+
statusCode: 409,
14+
body: body,
15+
rawResponse: rawResponse,
16+
});
17+
Object.setPrototypeOf(this, ConflictError.prototype);
18+
}
19+
}

src/api/errors/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export * from "./UnauthorizedError.js";
22
export * from "./ForbiddenError.js";
33
export * from "./UnprocessableEntityError.js";
44
export * from "./InternalServerError.js";
5+
export * from "./ConflictError.js";
56
export * from "./ContentTooLargeError.js";
67
export * from "./NotFoundError.js";
78
export * from "./TooManyRequestsError.js";

src/api/resources/styleGuides/client/Client.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ export class StyleGuides {
142142
*
143143
* @throws {@link MarkupAI.UnauthorizedError}
144144
* @throws {@link MarkupAI.ForbiddenError}
145+
* @throws {@link MarkupAI.ConflictError}
145146
* @throws {@link MarkupAI.ContentTooLargeError}
146147
* @throws {@link MarkupAI.UnprocessableEntityError}
147148
* @throws {@link MarkupAI.InternalServerError}
@@ -213,6 +214,11 @@ export class StyleGuides {
213214
_response.error.body as MarkupAI.ErrorResponse,
214215
_response.rawResponse,
215216
);
217+
case 409:
218+
throw new MarkupAI.ConflictError(
219+
_response.error.body as MarkupAI.ErrorResponse,
220+
_response.rawResponse,
221+
);
216222
case 413:
217223
throw new MarkupAI.ContentTooLargeError(
218224
_response.error.body as MarkupAI.ErrorResponse,
@@ -463,6 +469,7 @@ export class StyleGuides {
463469
* @throws {@link MarkupAI.UnauthorizedError}
464470
* @throws {@link MarkupAI.ForbiddenError}
465471
* @throws {@link MarkupAI.NotFoundError}
472+
* @throws {@link MarkupAI.ConflictError}
466473
* @throws {@link MarkupAI.UnprocessableEntityError}
467474
* @throws {@link MarkupAI.InternalServerError}
468475
*
@@ -527,6 +534,11 @@ export class StyleGuides {
527534
_response.error.body as MarkupAI.ErrorResponse,
528535
_response.rawResponse,
529536
);
537+
case 409:
538+
throw new MarkupAI.ConflictError(
539+
_response.error.body as MarkupAI.ErrorResponse,
540+
_response.rawResponse,
541+
);
530542
case 422:
531543
throw new MarkupAI.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
532544
case 500:

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const SDK_VERSION = "1.1.0";
1+
export const SDK_VERSION = "1.2.0";

tests/wire/styleChecks.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe("StyleChecks", () => {
8080
workflow: {
8181
id: "chk-2b5f8d3a-9c7e-4f2b-a8d1-6e9c3f7b4a2d",
8282
api_version: "1.0.0",
83-
filename: "filename",
83+
filename: "example_document.txt",
8484
generated_at: "2025-01-15T14:22:33Z",
8585
status: "completed",
8686
type: "checks",
@@ -187,7 +187,7 @@ describe("StyleChecks", () => {
187187
workflow: {
188188
id: "chk-2b5f8d3a-9c7e-4f2b-a8d1-6e9c3f7b4a2d",
189189
api_version: "1.0.0",
190-
filename: "filename",
190+
filename: "example_document.txt",
191191
generated_at: "2025-01-15T14:22:33Z",
192192
status: "completed",
193193
type: "checks",

tests/wire/styleGuides.test.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,27 @@ describe("StyleGuides", () => {
443443
});
444444

445445
test("updateStyleGuide (5)", async () => {
446+
const server = mockServerPool.createServer();
447+
const client = new MarkupAIClient({ token: "test", environment: server.baseUrl });
448+
const rawRequestBody = { name: "x" };
449+
const rawResponseBody = { detail: "detail", status: 1, request_id: "request_id" };
450+
server
451+
.mockEndpoint()
452+
.patch("/v1/style-guides/style_guide_id")
453+
.jsonBody(rawRequestBody)
454+
.respondWith()
455+
.statusCode(409)
456+
.jsonBody(rawResponseBody)
457+
.build();
458+
459+
await expect(async () => {
460+
return await client.styleGuides.updateStyleGuide("style_guide_id", {
461+
name: "x",
462+
});
463+
}).rejects.toThrow(MarkupAI.ConflictError);
464+
});
465+
466+
test("updateStyleGuide (6)", async () => {
446467
const server = mockServerPool.createServer();
447468
const client = new MarkupAIClient({ token: "test", environment: server.baseUrl });
448469
const rawRequestBody = { name: "x" };
@@ -463,7 +484,7 @@ describe("StyleGuides", () => {
463484
}).rejects.toThrow(MarkupAI.UnprocessableEntityError);
464485
});
465486

466-
test("updateStyleGuide (6)", async () => {
487+
test("updateStyleGuide (7)", async () => {
467488
const server = mockServerPool.createServer();
468489
const client = new MarkupAIClient({ token: "test", environment: server.baseUrl });
469490
const rawRequestBody = { name: "x" };

tests/wire/styleRewrites.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ describe("StyleRewrites", () => {
100100
workflow: {
101101
id: "rewrites-3fa85f64-5717-4562-b3fc-2c963f66afa6",
102102
api_version: "1.0.0",
103-
filename: "filename",
103+
filename: "example_document.txt",
104104
generated_at: "2025-01-15T15:12:45Z",
105105
status: "completed",
106106
type: "rewrites",
@@ -232,7 +232,7 @@ describe("StyleRewrites", () => {
232232
workflow: {
233233
id: "rewrites-3fa85f64-5717-4562-b3fc-2c963f66afa6",
234234
api_version: "1.0.0",
235-
filename: "filename",
235+
filename: "example_document.txt",
236236
generated_at: "2025-01-15T15:12:45Z",
237237
status: "completed",
238238
type: "rewrites",

0 commit comments

Comments
 (0)