@markupai/api 1.0.0 → 1.2.0

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.
Files changed (65) hide show
  1. package/README.md +36 -1
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/errors/ConflictError.d.ts +9 -0
  4. package/dist/cjs/api/errors/ConflictError.js +52 -0
  5. package/dist/cjs/api/errors/index.d.ts +1 -0
  6. package/dist/cjs/api/errors/index.js +1 -0
  7. package/dist/cjs/api/resources/styleChecks/client/Client.d.ts +2 -2
  8. package/dist/cjs/api/resources/styleChecks/client/Client.js +2 -2
  9. package/dist/cjs/api/resources/{styleSuggestions/client/requests/CreateStyleSuggestionV1StyleSuggestionsPostRequest.d.ts → styleChecks/client/requests/StyleCheckRequestBody.d.ts} +4 -4
  10. package/dist/cjs/api/resources/styleChecks/client/requests/index.d.ts +1 -1
  11. package/dist/cjs/api/resources/styleGuides/client/Client.d.ts +2 -0
  12. package/dist/cjs/api/resources/styleGuides/client/Client.js +9 -0
  13. package/dist/cjs/api/resources/styleGuides/client/requests/StyleGuideRequestBody.d.ts +3 -0
  14. package/dist/cjs/api/resources/styleRewrites/client/Client.d.ts +2 -2
  15. package/dist/cjs/api/resources/styleRewrites/client/Client.js +2 -2
  16. package/dist/cjs/api/resources/{styleChecks/client/requests/CreateStyleCheckV1StyleChecksPostRequest.d.ts → styleRewrites/client/requests/StyleRewriteRequestBody.d.ts} +4 -4
  17. package/dist/cjs/api/resources/styleRewrites/client/requests/index.d.ts +1 -1
  18. package/dist/cjs/api/resources/styleSuggestions/client/Client.d.ts +2 -2
  19. package/dist/cjs/api/resources/styleSuggestions/client/Client.js +2 -2
  20. package/dist/cjs/api/resources/{styleRewrites/client/requests/CreateStyleRewriteV1StyleRewritesPostRequest.d.ts → styleSuggestions/client/requests/StyleSuggestionRequestBody.d.ts} +4 -4
  21. package/dist/cjs/api/resources/styleSuggestions/client/requests/index.d.ts +1 -1
  22. package/dist/cjs/api/types/BaseStyleGuideType.d.ts +9 -0
  23. package/dist/cjs/api/types/BaseStyleGuideType.js +11 -0
  24. package/dist/cjs/api/types/StyleGuideResponse.d.ts +2 -0
  25. package/dist/cjs/api/types/WorkflowInfo.d.ts +2 -0
  26. package/dist/cjs/api/types/index.d.ts +1 -0
  27. package/dist/cjs/api/types/index.js +1 -0
  28. package/dist/cjs/version.d.ts +1 -1
  29. package/dist/cjs/version.js +1 -1
  30. package/dist/esm/Client.mjs +2 -2
  31. package/dist/esm/api/errors/ConflictError.d.mts +9 -0
  32. package/dist/esm/api/errors/ConflictError.mjs +15 -0
  33. package/dist/esm/api/errors/index.d.mts +1 -0
  34. package/dist/esm/api/errors/index.mjs +1 -0
  35. package/dist/esm/api/resources/styleChecks/client/Client.d.mts +2 -2
  36. package/dist/esm/api/resources/styleChecks/client/Client.mjs +2 -2
  37. package/dist/esm/api/resources/{styleSuggestions/client/requests/CreateStyleSuggestionV1StyleSuggestionsPostRequest.d.mts → styleChecks/client/requests/StyleCheckRequestBody.d.mts} +4 -4
  38. package/dist/esm/api/resources/styleChecks/client/requests/index.d.mts +1 -1
  39. package/dist/esm/api/resources/styleGuides/client/Client.d.mts +2 -0
  40. package/dist/esm/api/resources/styleGuides/client/Client.mjs +9 -0
  41. package/dist/esm/api/resources/styleGuides/client/requests/StyleGuideRequestBody.d.mts +3 -0
  42. package/dist/esm/api/resources/styleRewrites/client/Client.d.mts +2 -2
  43. package/dist/esm/api/resources/styleRewrites/client/Client.mjs +2 -2
  44. package/dist/esm/api/resources/styleRewrites/client/requests/{CreateStyleRewriteV1StyleRewritesPostRequest.d.mts → StyleRewriteRequestBody.d.mts} +4 -4
  45. package/dist/esm/api/resources/styleRewrites/client/requests/index.d.mts +1 -1
  46. package/dist/esm/api/resources/styleSuggestions/client/Client.d.mts +2 -2
  47. package/dist/esm/api/resources/styleSuggestions/client/Client.mjs +2 -2
  48. package/dist/esm/api/resources/{styleChecks/client/requests/CreateStyleCheckV1StyleChecksPostRequest.d.mts → styleSuggestions/client/requests/StyleSuggestionRequestBody.d.mts} +4 -4
  49. package/dist/esm/api/resources/styleSuggestions/client/requests/index.d.mts +1 -1
  50. package/dist/esm/api/types/BaseStyleGuideType.d.mts +9 -0
  51. package/dist/esm/api/types/BaseStyleGuideType.mjs +8 -0
  52. package/dist/esm/api/types/StyleGuideResponse.d.mts +2 -0
  53. package/dist/esm/api/types/WorkflowInfo.d.mts +2 -0
  54. package/dist/esm/api/types/index.d.mts +1 -0
  55. package/dist/esm/api/types/index.mjs +1 -0
  56. package/dist/esm/version.d.mts +1 -1
  57. package/dist/esm/version.mjs +1 -1
  58. package/package.json +1 -1
  59. package/reference.md +3 -3
  60. /package/dist/cjs/api/resources/styleChecks/client/requests/{CreateStyleCheckV1StyleChecksPostRequest.js → StyleCheckRequestBody.js} +0 -0
  61. /package/dist/cjs/api/resources/styleRewrites/client/requests/{CreateStyleRewriteV1StyleRewritesPostRequest.js → StyleRewriteRequestBody.js} +0 -0
  62. /package/dist/cjs/api/resources/styleSuggestions/client/requests/{CreateStyleSuggestionV1StyleSuggestionsPostRequest.js → StyleSuggestionRequestBody.js} +0 -0
  63. /package/dist/esm/api/resources/styleChecks/client/requests/{CreateStyleCheckV1StyleChecksPostRequest.mjs → StyleCheckRequestBody.mjs} +0 -0
  64. /package/dist/esm/api/resources/styleRewrites/client/requests/{CreateStyleRewriteV1StyleRewritesPostRequest.mjs → StyleRewriteRequestBody.mjs} +0 -0
  65. /package/dist/esm/api/resources/styleSuggestions/client/requests/{CreateStyleSuggestionV1StyleSuggestionsPostRequest.mjs → StyleSuggestionRequestBody.mjs} +0 -0
package/README.md CHANGED
@@ -5,6 +5,41 @@
5
5
 
6
6
  The official Markup AI SDK for interacting with the Markup AI API.
7
7
 
8
+ ## Table of Contents
9
+
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
+
28
+ - [Installation](#installation)
29
+ - [Reference](#reference)
30
+ - [Usage](#usage)
31
+ - [Request and Response Types](#request-and-response-types)
32
+ - [Exception Handling](#exception-handling)
33
+ - [Advanced](#advanced)
34
+ - [Additional Headers](#additional-headers)
35
+ - [Additional Query String Parameters](#additional-query-string-parameters)
36
+ - [Retries](#retries)
37
+ - [Timeouts](#timeouts)
38
+ - [Aborting Requests](#aborting-requests)
39
+ - [Access Raw Response Data](#access-raw-response-data)
40
+ - [Runtime Compatibility](#runtime-compatibility)
41
+ - [Contributing](#contributing)
42
+
8
43
  ## Installation
9
44
 
10
45
  ```sh
@@ -26,7 +61,7 @@ const client = new MarkupAIClient({ token: "YOUR_TOKEN" });
26
61
  await client.styleGuides.listStyleGuides();
27
62
  ```
28
63
 
29
- ## Request And Response Types
64
+ ## Request and Response Types
30
65
 
31
66
  The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
32
67
  following namespace:
@@ -48,8 +48,8 @@ class MarkupAIClient {
48
48
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
49
49
  "X-Fern-Language": "JavaScript",
50
50
  "X-Fern-SDK-Name": "@markupai/api",
51
- "X-Fern-SDK-Version": "1.0.0",
52
- "User-Agent": "@markupai/api/1.0.0",
51
+ "X-Fern-SDK-Version": "1.2.0",
52
+ "User-Agent": "@markupai/api/1.2.0",
53
53
  "X-Fern-Runtime": core.RUNTIME.type,
54
54
  "X-Fern-Runtime-Version": core.RUNTIME.version,
55
55
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as errors from "../../errors/index.js";
5
+ import * as MarkupAI from "../index.js";
6
+ import * as core from "../../core/index.js";
7
+ export declare class ConflictError extends errors.MarkupAIError {
8
+ constructor(body: MarkupAI.ErrorResponse, rawResponse?: core.RawResponse);
9
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.ConflictError = void 0;
40
+ const errors = __importStar(require("../../errors/index.js"));
41
+ class ConflictError extends errors.MarkupAIError {
42
+ constructor(body, rawResponse) {
43
+ super({
44
+ message: "ConflictError",
45
+ statusCode: 409,
46
+ body: body,
47
+ rawResponse: rawResponse,
48
+ });
49
+ Object.setPrototypeOf(this, ConflictError.prototype);
50
+ }
51
+ }
52
+ exports.ConflictError = ConflictError;
@@ -2,6 +2,7 @@ export * from "./UnauthorizedError.js";
2
2
  export * from "./ForbiddenError.js";
3
3
  export * from "./UnprocessableEntityError.js";
4
4
  export * from "./InternalServerError.js";
5
+ export * from "./ConflictError.js";
5
6
  export * from "./ContentTooLargeError.js";
6
7
  export * from "./NotFoundError.js";
7
8
  export * from "./TooManyRequestsError.js";
@@ -18,6 +18,7 @@ __exportStar(require("./UnauthorizedError.js"), exports);
18
18
  __exportStar(require("./ForbiddenError.js"), exports);
19
19
  __exportStar(require("./UnprocessableEntityError.js"), exports);
20
20
  __exportStar(require("./InternalServerError.js"), exports);
21
+ __exportStar(require("./ConflictError.js"), exports);
21
22
  __exportStar(require("./ContentTooLargeError.js"), exports);
22
23
  __exportStar(require("./NotFoundError.js"), exports);
23
24
  __exportStar(require("./TooManyRequestsError.js"), exports);
@@ -36,7 +36,7 @@ export declare class StyleChecks {
36
36
  /**
37
37
  * Analyze text for grammar, style, and clarity issues.
38
38
  *
39
- * @param {MarkupAI.CreateStyleCheckV1StyleChecksPostRequest} request
39
+ * @param {MarkupAI.StyleCheckRequestBody} request
40
40
  * @param {StyleChecks.RequestOptions} requestOptions - Request-specific configuration.
41
41
  *
42
42
  * @throws {@link MarkupAI.UnauthorizedError}
@@ -54,7 +54,7 @@ export declare class StyleChecks {
54
54
  * style_guide: "style_guide"
55
55
  * })
56
56
  */
57
- createStyleCheck(request: MarkupAI.CreateStyleCheckV1StyleChecksPostRequest, requestOptions?: StyleChecks.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
57
+ createStyleCheck(request: MarkupAI.StyleCheckRequestBody, requestOptions?: StyleChecks.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
58
58
  private __createStyleCheck;
59
59
  /**
60
60
  * Retrieve style check results.
@@ -61,7 +61,7 @@ class StyleChecks {
61
61
  /**
62
62
  * Analyze text for grammar, style, and clarity issues.
63
63
  *
64
- * @param {MarkupAI.CreateStyleCheckV1StyleChecksPostRequest} request
64
+ * @param {MarkupAI.StyleCheckRequestBody} request
65
65
  * @param {StyleChecks.RequestOptions} requestOptions - Request-specific configuration.
66
66
  *
67
67
  * @throws {@link MarkupAI.UnauthorizedError}
@@ -86,7 +86,6 @@ class StyleChecks {
86
86
  return __awaiter(this, void 0, void 0, function* () {
87
87
  var _a, _b, _c, _d;
88
88
  const _request = yield core.newFormData();
89
- yield _request.appendFile("file_upload", request.file_upload);
90
89
  _request.append("dialect", request.dialect);
91
90
  if (request.tone != null) {
92
91
  _request.append("tone", request.tone);
@@ -95,6 +94,7 @@ class StyleChecks {
95
94
  if (request.webhook_url != null) {
96
95
  _request.append("webhook_url", request.webhook_url);
97
96
  }
97
+ yield _request.appendFile("file_upload", request.file_upload);
98
98
  const _maybeEncodedRequest = yield _request.getRequest();
99
99
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
100
100
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as core from "../../../../../core/index.js";
5
4
  import * as MarkupAI from "../../../../index.js";
5
+ import * as core from "../../../../../core/index.js";
6
6
  /**
7
7
  * @example
8
8
  * {
@@ -11,9 +11,7 @@ import * as MarkupAI from "../../../../index.js";
11
11
  * style_guide: "style_guide"
12
12
  * }
13
13
  */
14
- export interface CreateStyleSuggestionV1StyleSuggestionsPostRequest {
15
- /** The document to analyze. Text files (.txt), PDFs (.pdf), and Markdown files (.md) are accepted. The max file size is 1.5 MB */
16
- file_upload: core.file.Uploadable.FileLike;
14
+ export interface StyleCheckRequestBody {
17
15
  /** The language variant you'd like us to use for analysis. Choose from American English, British English, or other supported dialects. */
18
16
  dialect: MarkupAI.Dialects;
19
17
  /** The tone variation you're aiming for. Options include formal, academic, casual, and other tone variations to match your content goals. */
@@ -22,4 +20,6 @@ export interface CreateStyleSuggestionV1StyleSuggestionsPostRequest {
22
20
  style_guide: string;
23
21
  /** A URL that results will be POSTed to once the process completes. */
24
22
  webhook_url?: string;
23
+ /** The document to analyze. Text (.txt), Markdown (.md), HTML (.html .htm), DITA (.dita, .xml), and PDF (.pdf) files are accepted. The max file size is 1.5 MB. */
24
+ file_upload: core.file.Uploadable.FileLike;
25
25
  }
@@ -1 +1 @@
1
- export { type CreateStyleCheckV1StyleChecksPostRequest } from "./CreateStyleCheckV1StyleChecksPostRequest.js";
1
+ export { type StyleCheckRequestBody } from "./StyleCheckRequestBody.js";
@@ -56,6 +56,7 @@ export declare class StyleGuides {
56
56
  *
57
57
  * @throws {@link MarkupAI.UnauthorizedError}
58
58
  * @throws {@link MarkupAI.ForbiddenError}
59
+ * @throws {@link MarkupAI.ConflictError}
59
60
  * @throws {@link MarkupAI.ContentTooLargeError}
60
61
  * @throws {@link MarkupAI.UnprocessableEntityError}
61
62
  * @throws {@link MarkupAI.InternalServerError}
@@ -113,6 +114,7 @@ export declare class StyleGuides {
113
114
  * @throws {@link MarkupAI.UnauthorizedError}
114
115
  * @throws {@link MarkupAI.ForbiddenError}
115
116
  * @throws {@link MarkupAI.NotFoundError}
117
+ * @throws {@link MarkupAI.ConflictError}
116
118
  * @throws {@link MarkupAI.UnprocessableEntityError}
117
119
  * @throws {@link MarkupAI.InternalServerError}
118
120
  *
@@ -133,6 +133,7 @@ class StyleGuides {
133
133
  *
134
134
  * @throws {@link MarkupAI.UnauthorizedError}
135
135
  * @throws {@link MarkupAI.ForbiddenError}
136
+ * @throws {@link MarkupAI.ConflictError}
136
137
  * @throws {@link MarkupAI.ContentTooLargeError}
137
138
  * @throws {@link MarkupAI.UnprocessableEntityError}
138
139
  * @throws {@link MarkupAI.InternalServerError}
@@ -153,6 +154,9 @@ class StyleGuides {
153
154
  const _request = yield core.newFormData();
154
155
  yield _request.appendFile("file_upload", request.file_upload);
155
156
  _request.append("name", request.name);
157
+ if (request.base_style_guide != null) {
158
+ _request.append("base_style_guide", request.base_style_guide);
159
+ }
156
160
  const _maybeEncodedRequest = yield _request.getRequest();
157
161
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
158
162
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -176,6 +180,8 @@ class StyleGuides {
176
180
  throw new MarkupAI.UnauthorizedError(_response.error.body, _response.rawResponse);
177
181
  case 403:
178
182
  throw new MarkupAI.ForbiddenError(_response.error.body, _response.rawResponse);
183
+ case 409:
184
+ throw new MarkupAI.ConflictError(_response.error.body, _response.rawResponse);
179
185
  case 413:
180
186
  throw new MarkupAI.ContentTooLargeError(_response.error.body, _response.rawResponse);
181
187
  case 422:
@@ -359,6 +365,7 @@ class StyleGuides {
359
365
  * @throws {@link MarkupAI.UnauthorizedError}
360
366
  * @throws {@link MarkupAI.ForbiddenError}
361
367
  * @throws {@link MarkupAI.NotFoundError}
368
+ * @throws {@link MarkupAI.ConflictError}
362
369
  * @throws {@link MarkupAI.UnprocessableEntityError}
363
370
  * @throws {@link MarkupAI.InternalServerError}
364
371
  *
@@ -397,6 +404,8 @@ class StyleGuides {
397
404
  throw new MarkupAI.ForbiddenError(_response.error.body, _response.rawResponse);
398
405
  case 404:
399
406
  throw new MarkupAI.NotFoundError(_response.error.body, _response.rawResponse);
407
+ case 409:
408
+ throw new MarkupAI.ConflictError(_response.error.body, _response.rawResponse);
400
409
  case 422:
401
410
  throw new MarkupAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
402
411
  case 500:
@@ -2,6 +2,7 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as core from "../../../../../core/index.js";
5
+ import * as MarkupAI from "../../../../index.js";
5
6
  /**
6
7
  * @example
7
8
  * {
@@ -14,4 +15,6 @@ export interface StyleGuideRequestBody {
14
15
  file_upload: core.file.Uploadable.FileLike;
15
16
  /** A friendly name for your style guide to help you identify it later. */
16
17
  name: string;
18
+ /** The base style guide to extend (AP, Chicago, or Microsoft). If not provided, the style guide will be created from scratch. */
19
+ base_style_guide?: MarkupAI.BaseStyleGuideType;
17
20
  }
@@ -36,7 +36,7 @@ export declare class StyleRewrites {
36
36
  /**
37
37
  * Rewrite text with style corrections applied.
38
38
  *
39
- * @param {MarkupAI.CreateStyleRewriteV1StyleRewritesPostRequest} request
39
+ * @param {MarkupAI.StyleRewriteRequestBody} request
40
40
  * @param {StyleRewrites.RequestOptions} requestOptions - Request-specific configuration.
41
41
  *
42
42
  * @throws {@link MarkupAI.UnauthorizedError}
@@ -54,7 +54,7 @@ export declare class StyleRewrites {
54
54
  * style_guide: "style_guide"
55
55
  * })
56
56
  */
57
- createStyleRewrite(request: MarkupAI.CreateStyleRewriteV1StyleRewritesPostRequest, requestOptions?: StyleRewrites.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
57
+ createStyleRewrite(request: MarkupAI.StyleRewriteRequestBody, requestOptions?: StyleRewrites.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
58
58
  private __createStyleRewrite;
59
59
  /**
60
60
  * Retrieve rewrite results.
@@ -61,7 +61,7 @@ class StyleRewrites {
61
61
  /**
62
62
  * Rewrite text with style corrections applied.
63
63
  *
64
- * @param {MarkupAI.CreateStyleRewriteV1StyleRewritesPostRequest} request
64
+ * @param {MarkupAI.StyleRewriteRequestBody} request
65
65
  * @param {StyleRewrites.RequestOptions} requestOptions - Request-specific configuration.
66
66
  *
67
67
  * @throws {@link MarkupAI.UnauthorizedError}
@@ -86,7 +86,6 @@ class StyleRewrites {
86
86
  return __awaiter(this, void 0, void 0, function* () {
87
87
  var _a, _b, _c, _d;
88
88
  const _request = yield core.newFormData();
89
- yield _request.appendFile("file_upload", request.file_upload);
90
89
  _request.append("dialect", request.dialect);
91
90
  if (request.tone != null) {
92
91
  _request.append("tone", request.tone);
@@ -95,6 +94,7 @@ class StyleRewrites {
95
94
  if (request.webhook_url != null) {
96
95
  _request.append("webhook_url", request.webhook_url);
97
96
  }
97
+ yield _request.appendFile("file_upload", request.file_upload);
98
98
  const _maybeEncodedRequest = yield _request.getRequest();
99
99
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
100
100
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as core from "../../../../../core/index.js";
5
4
  import * as MarkupAI from "../../../../index.js";
5
+ import * as core from "../../../../../core/index.js";
6
6
  /**
7
7
  * @example
8
8
  * {
@@ -11,9 +11,7 @@ import * as MarkupAI from "../../../../index.js";
11
11
  * style_guide: "style_guide"
12
12
  * }
13
13
  */
14
- export interface CreateStyleCheckV1StyleChecksPostRequest {
15
- /** The document to analyze. Text files (.txt), PDFs (.pdf), and Markdown files (.md) are accepted. The max file size is 1.5 MB */
16
- file_upload: core.file.Uploadable.FileLike;
14
+ export interface StyleRewriteRequestBody {
17
15
  /** The language variant you'd like us to use for analysis. Choose from American English, British English, or other supported dialects. */
18
16
  dialect: MarkupAI.Dialects;
19
17
  /** The tone variation you're aiming for. Options include formal, academic, casual, and other tone variations to match your content goals. */
@@ -22,4 +20,6 @@ export interface CreateStyleCheckV1StyleChecksPostRequest {
22
20
  style_guide: string;
23
21
  /** A URL that results will be POSTed to once the process completes. */
24
22
  webhook_url?: string;
23
+ /** The document to rewrite. Text (.txt), Markdown (.md), HTML (.html .htm), and DITA (.dita, .xml) files are accepted. The max file size is 1.5 MB. */
24
+ file_upload: core.file.Uploadable.FileLike;
25
25
  }
@@ -1 +1 @@
1
- export { type CreateStyleRewriteV1StyleRewritesPostRequest } from "./CreateStyleRewriteV1StyleRewritesPostRequest.js";
1
+ export { type StyleRewriteRequestBody } from "./StyleRewriteRequestBody.js";
@@ -36,7 +36,7 @@ export declare class StyleSuggestions {
36
36
  /**
37
37
  * Get suggested corrections for text.
38
38
  *
39
- * @param {MarkupAI.CreateStyleSuggestionV1StyleSuggestionsPostRequest} request
39
+ * @param {MarkupAI.StyleSuggestionRequestBody} request
40
40
  * @param {StyleSuggestions.RequestOptions} requestOptions - Request-specific configuration.
41
41
  *
42
42
  * @throws {@link MarkupAI.UnauthorizedError}
@@ -54,7 +54,7 @@ export declare class StyleSuggestions {
54
54
  * style_guide: "style_guide"
55
55
  * })
56
56
  */
57
- createStyleSuggestion(request: MarkupAI.CreateStyleSuggestionV1StyleSuggestionsPostRequest, requestOptions?: StyleSuggestions.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
57
+ createStyleSuggestion(request: MarkupAI.StyleSuggestionRequestBody, requestOptions?: StyleSuggestions.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
58
58
  private __createStyleSuggestion;
59
59
  /**
60
60
  * Retrieve suggestion results.
@@ -61,7 +61,7 @@ class StyleSuggestions {
61
61
  /**
62
62
  * Get suggested corrections for text.
63
63
  *
64
- * @param {MarkupAI.CreateStyleSuggestionV1StyleSuggestionsPostRequest} request
64
+ * @param {MarkupAI.StyleSuggestionRequestBody} request
65
65
  * @param {StyleSuggestions.RequestOptions} requestOptions - Request-specific configuration.
66
66
  *
67
67
  * @throws {@link MarkupAI.UnauthorizedError}
@@ -86,7 +86,6 @@ class StyleSuggestions {
86
86
  return __awaiter(this, void 0, void 0, function* () {
87
87
  var _a, _b, _c, _d;
88
88
  const _request = yield core.newFormData();
89
- yield _request.appendFile("file_upload", request.file_upload);
90
89
  _request.append("dialect", request.dialect);
91
90
  if (request.tone != null) {
92
91
  _request.append("tone", request.tone);
@@ -95,6 +94,7 @@ class StyleSuggestions {
95
94
  if (request.webhook_url != null) {
96
95
  _request.append("webhook_url", request.webhook_url);
97
96
  }
97
+ yield _request.appendFile("file_upload", request.file_upload);
98
98
  const _maybeEncodedRequest = yield _request.getRequest();
99
99
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
100
100
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as core from "../../../../../core/index.js";
5
4
  import * as MarkupAI from "../../../../index.js";
5
+ import * as core from "../../../../../core/index.js";
6
6
  /**
7
7
  * @example
8
8
  * {
@@ -11,9 +11,7 @@ import * as MarkupAI from "../../../../index.js";
11
11
  * style_guide: "style_guide"
12
12
  * }
13
13
  */
14
- export interface CreateStyleRewriteV1StyleRewritesPostRequest {
15
- /** The document to analyze. Text files (.txt), PDFs (.pdf), and Markdown files (.md) are accepted. The max file size is 1.5 MB */
16
- file_upload: core.file.Uploadable.FileLike;
14
+ export interface StyleSuggestionRequestBody {
17
15
  /** The language variant you'd like us to use for analysis. Choose from American English, British English, or other supported dialects. */
18
16
  dialect: MarkupAI.Dialects;
19
17
  /** The tone variation you're aiming for. Options include formal, academic, casual, and other tone variations to match your content goals. */
@@ -22,4 +20,6 @@ export interface CreateStyleRewriteV1StyleRewritesPostRequest {
22
20
  style_guide: string;
23
21
  /** A URL that results will be POSTed to once the process completes. */
24
22
  webhook_url?: string;
23
+ /** The document to analyze. Text (.txt), Markdown (.md), HTML (.html .htm), DITA (.dita, .xml), and PDF (.pdf) files are accepted. The max file size is 1.5 MB. */
24
+ file_upload: core.file.Uploadable.FileLike;
25
25
  }
@@ -1 +1 @@
1
- export { type CreateStyleSuggestionV1StyleSuggestionsPostRequest } from "./CreateStyleSuggestionV1StyleSuggestionsPostRequest.js";
1
+ export { type StyleSuggestionRequestBody } from "./StyleSuggestionRequestBody.js";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type BaseStyleGuideType = "ap" | "chicago" | "microsoft";
5
+ export declare const BaseStyleGuideType: {
6
+ readonly Ap: "ap";
7
+ readonly Chicago: "chicago";
8
+ readonly Microsoft: "microsoft";
9
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.BaseStyleGuideType = void 0;
7
+ exports.BaseStyleGuideType = {
8
+ Ap: "ap",
9
+ Chicago: "chicago",
10
+ Microsoft: "microsoft",
11
+ };
@@ -18,4 +18,6 @@ export interface StyleGuideResponse {
18
18
  updated_by?: string;
19
19
  /** User-friendly summary of the style guide's contents and characteristics */
20
20
  summary?: string;
21
+ /** The base style guide type that this style guide extends (AP, Chicago, or Microsoft). */
22
+ base_style_guide_type?: MarkupAI.BaseStyleGuideType;
21
23
  }
@@ -7,6 +7,8 @@ export interface WorkflowInfo {
7
7
  id: string;
8
8
  /** API version */
9
9
  api_version?: string;
10
+ /** The original name of the file passed into the workflow */
11
+ filename?: string;
10
12
  /** UTC timestamp when the result was generated */
11
13
  generated_at?: string;
12
14
  status?: MarkupAI.WorkflowStatus;
@@ -1,4 +1,5 @@
1
1
  export * from "./AnalysisScore.js";
2
+ export * from "./BaseStyleGuideType.js";
2
3
  export * from "./ClarityCategory.js";
3
4
  export * from "./ClarityScore.js";
4
5
  export * from "./ConfigOptions.js";
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./AnalysisScore.js"), exports);
18
+ __exportStar(require("./BaseStyleGuideType.js"), exports);
18
19
  __exportStar(require("./ClarityCategory.js"), exports);
19
20
  __exportStar(require("./ClarityScore.js"), exports);
20
21
  __exportStar(require("./ConfigOptions.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.0";
1
+ export declare const SDK_VERSION = "1.2.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.0.0";
4
+ exports.SDK_VERSION = "1.2.0";
@@ -12,8 +12,8 @@ export class MarkupAIClient {
12
12
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
13
13
  "X-Fern-Language": "JavaScript",
14
14
  "X-Fern-SDK-Name": "@markupai/api",
15
- "X-Fern-SDK-Version": "1.0.0",
16
- "User-Agent": "@markupai/api/1.0.0",
15
+ "X-Fern-SDK-Version": "1.2.0",
16
+ "User-Agent": "@markupai/api/1.2.0",
17
17
  "X-Fern-Runtime": core.RUNTIME.type,
18
18
  "X-Fern-Runtime-Version": core.RUNTIME.version,
19
19
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as errors from "../../errors/index.mjs";
5
+ import * as MarkupAI from "../index.mjs";
6
+ import * as core from "../../core/index.mjs";
7
+ export declare class ConflictError extends errors.MarkupAIError {
8
+ constructor(body: MarkupAI.ErrorResponse, rawResponse?: core.RawResponse);
9
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as errors from "../../errors/index.mjs";
5
+ export class ConflictError extends errors.MarkupAIError {
6
+ constructor(body, rawResponse) {
7
+ super({
8
+ message: "ConflictError",
9
+ statusCode: 409,
10
+ body: body,
11
+ rawResponse: rawResponse,
12
+ });
13
+ Object.setPrototypeOf(this, ConflictError.prototype);
14
+ }
15
+ }
@@ -2,6 +2,7 @@ export * from "./UnauthorizedError.mjs";
2
2
  export * from "./ForbiddenError.mjs";
3
3
  export * from "./UnprocessableEntityError.mjs";
4
4
  export * from "./InternalServerError.mjs";
5
+ export * from "./ConflictError.mjs";
5
6
  export * from "./ContentTooLargeError.mjs";
6
7
  export * from "./NotFoundError.mjs";
7
8
  export * from "./TooManyRequestsError.mjs";
@@ -2,6 +2,7 @@ export * from "./UnauthorizedError.mjs";
2
2
  export * from "./ForbiddenError.mjs";
3
3
  export * from "./UnprocessableEntityError.mjs";
4
4
  export * from "./InternalServerError.mjs";
5
+ export * from "./ConflictError.mjs";
5
6
  export * from "./ContentTooLargeError.mjs";
6
7
  export * from "./NotFoundError.mjs";
7
8
  export * from "./TooManyRequestsError.mjs";
@@ -36,7 +36,7 @@ export declare class StyleChecks {
36
36
  /**
37
37
  * Analyze text for grammar, style, and clarity issues.
38
38
  *
39
- * @param {MarkupAI.CreateStyleCheckV1StyleChecksPostRequest} request
39
+ * @param {MarkupAI.StyleCheckRequestBody} request
40
40
  * @param {StyleChecks.RequestOptions} requestOptions - Request-specific configuration.
41
41
  *
42
42
  * @throws {@link MarkupAI.UnauthorizedError}
@@ -54,7 +54,7 @@ export declare class StyleChecks {
54
54
  * style_guide: "style_guide"
55
55
  * })
56
56
  */
57
- createStyleCheck(request: MarkupAI.CreateStyleCheckV1StyleChecksPostRequest, requestOptions?: StyleChecks.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
57
+ createStyleCheck(request: MarkupAI.StyleCheckRequestBody, requestOptions?: StyleChecks.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
58
58
  private __createStyleCheck;
59
59
  /**
60
60
  * Retrieve style check results.
@@ -25,7 +25,7 @@ export class StyleChecks {
25
25
  /**
26
26
  * Analyze text for grammar, style, and clarity issues.
27
27
  *
28
- * @param {MarkupAI.CreateStyleCheckV1StyleChecksPostRequest} request
28
+ * @param {MarkupAI.StyleCheckRequestBody} request
29
29
  * @param {StyleChecks.RequestOptions} requestOptions - Request-specific configuration.
30
30
  *
31
31
  * @throws {@link MarkupAI.UnauthorizedError}
@@ -50,7 +50,6 @@ export class StyleChecks {
50
50
  return __awaiter(this, void 0, void 0, function* () {
51
51
  var _a, _b, _c, _d;
52
52
  const _request = yield core.newFormData();
53
- yield _request.appendFile("file_upload", request.file_upload);
54
53
  _request.append("dialect", request.dialect);
55
54
  if (request.tone != null) {
56
55
  _request.append("tone", request.tone);
@@ -59,6 +58,7 @@ export class StyleChecks {
59
58
  if (request.webhook_url != null) {
60
59
  _request.append("webhook_url", request.webhook_url);
61
60
  }
61
+ yield _request.appendFile("file_upload", request.file_upload);
62
62
  const _maybeEncodedRequest = yield _request.getRequest();
63
63
  let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
64
64
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as core from "../../../../../core/index.mjs";
5
4
  import * as MarkupAI from "../../../../index.mjs";
5
+ import * as core from "../../../../../core/index.mjs";
6
6
  /**
7
7
  * @example
8
8
  * {
@@ -11,9 +11,7 @@ import * as MarkupAI from "../../../../index.mjs";
11
11
  * style_guide: "style_guide"
12
12
  * }
13
13
  */
14
- export interface CreateStyleSuggestionV1StyleSuggestionsPostRequest {
15
- /** The document to analyze. Text files (.txt), PDFs (.pdf), and Markdown files (.md) are accepted. The max file size is 1.5 MB */
16
- file_upload: core.file.Uploadable.FileLike;
14
+ export interface StyleCheckRequestBody {
17
15
  /** The language variant you'd like us to use for analysis. Choose from American English, British English, or other supported dialects. */
18
16
  dialect: MarkupAI.Dialects;
19
17
  /** The tone variation you're aiming for. Options include formal, academic, casual, and other tone variations to match your content goals. */
@@ -22,4 +20,6 @@ export interface CreateStyleSuggestionV1StyleSuggestionsPostRequest {
22
20
  style_guide: string;
23
21
  /** A URL that results will be POSTed to once the process completes. */
24
22
  webhook_url?: string;
23
+ /** The document to analyze. Text (.txt), Markdown (.md), HTML (.html .htm), DITA (.dita, .xml), and PDF (.pdf) files are accepted. The max file size is 1.5 MB. */
24
+ file_upload: core.file.Uploadable.FileLike;
25
25
  }
@@ -1 +1 @@
1
- export { type CreateStyleCheckV1StyleChecksPostRequest } from "./CreateStyleCheckV1StyleChecksPostRequest.mjs";
1
+ export { type StyleCheckRequestBody } from "./StyleCheckRequestBody.mjs";
@@ -56,6 +56,7 @@ export declare class StyleGuides {
56
56
  *
57
57
  * @throws {@link MarkupAI.UnauthorizedError}
58
58
  * @throws {@link MarkupAI.ForbiddenError}
59
+ * @throws {@link MarkupAI.ConflictError}
59
60
  * @throws {@link MarkupAI.ContentTooLargeError}
60
61
  * @throws {@link MarkupAI.UnprocessableEntityError}
61
62
  * @throws {@link MarkupAI.InternalServerError}
@@ -113,6 +114,7 @@ export declare class StyleGuides {
113
114
  * @throws {@link MarkupAI.UnauthorizedError}
114
115
  * @throws {@link MarkupAI.ForbiddenError}
115
116
  * @throws {@link MarkupAI.NotFoundError}
117
+ * @throws {@link MarkupAI.ConflictError}
116
118
  * @throws {@link MarkupAI.UnprocessableEntityError}
117
119
  * @throws {@link MarkupAI.InternalServerError}
118
120
  *
@@ -97,6 +97,7 @@ export class StyleGuides {
97
97
  *
98
98
  * @throws {@link MarkupAI.UnauthorizedError}
99
99
  * @throws {@link MarkupAI.ForbiddenError}
100
+ * @throws {@link MarkupAI.ConflictError}
100
101
  * @throws {@link MarkupAI.ContentTooLargeError}
101
102
  * @throws {@link MarkupAI.UnprocessableEntityError}
102
103
  * @throws {@link MarkupAI.InternalServerError}
@@ -117,6 +118,9 @@ export class StyleGuides {
117
118
  const _request = yield core.newFormData();
118
119
  yield _request.appendFile("file_upload", request.file_upload);
119
120
  _request.append("name", request.name);
121
+ if (request.base_style_guide != null) {
122
+ _request.append("base_style_guide", request.base_style_guide);
123
+ }
120
124
  const _maybeEncodedRequest = yield _request.getRequest();
121
125
  let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
122
126
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -140,6 +144,8 @@ export class StyleGuides {
140
144
  throw new MarkupAI.UnauthorizedError(_response.error.body, _response.rawResponse);
141
145
  case 403:
142
146
  throw new MarkupAI.ForbiddenError(_response.error.body, _response.rawResponse);
147
+ case 409:
148
+ throw new MarkupAI.ConflictError(_response.error.body, _response.rawResponse);
143
149
  case 413:
144
150
  throw new MarkupAI.ContentTooLargeError(_response.error.body, _response.rawResponse);
145
151
  case 422:
@@ -323,6 +329,7 @@ export class StyleGuides {
323
329
  * @throws {@link MarkupAI.UnauthorizedError}
324
330
  * @throws {@link MarkupAI.ForbiddenError}
325
331
  * @throws {@link MarkupAI.NotFoundError}
332
+ * @throws {@link MarkupAI.ConflictError}
326
333
  * @throws {@link MarkupAI.UnprocessableEntityError}
327
334
  * @throws {@link MarkupAI.InternalServerError}
328
335
  *
@@ -361,6 +368,8 @@ export class StyleGuides {
361
368
  throw new MarkupAI.ForbiddenError(_response.error.body, _response.rawResponse);
362
369
  case 404:
363
370
  throw new MarkupAI.NotFoundError(_response.error.body, _response.rawResponse);
371
+ case 409:
372
+ throw new MarkupAI.ConflictError(_response.error.body, _response.rawResponse);
364
373
  case 422:
365
374
  throw new MarkupAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
366
375
  case 500:
@@ -2,6 +2,7 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as core from "../../../../../core/index.mjs";
5
+ import * as MarkupAI from "../../../../index.mjs";
5
6
  /**
6
7
  * @example
7
8
  * {
@@ -14,4 +15,6 @@ export interface StyleGuideRequestBody {
14
15
  file_upload: core.file.Uploadable.FileLike;
15
16
  /** A friendly name for your style guide to help you identify it later. */
16
17
  name: string;
18
+ /** The base style guide to extend (AP, Chicago, or Microsoft). If not provided, the style guide will be created from scratch. */
19
+ base_style_guide?: MarkupAI.BaseStyleGuideType;
17
20
  }
@@ -36,7 +36,7 @@ export declare class StyleRewrites {
36
36
  /**
37
37
  * Rewrite text with style corrections applied.
38
38
  *
39
- * @param {MarkupAI.CreateStyleRewriteV1StyleRewritesPostRequest} request
39
+ * @param {MarkupAI.StyleRewriteRequestBody} request
40
40
  * @param {StyleRewrites.RequestOptions} requestOptions - Request-specific configuration.
41
41
  *
42
42
  * @throws {@link MarkupAI.UnauthorizedError}
@@ -54,7 +54,7 @@ export declare class StyleRewrites {
54
54
  * style_guide: "style_guide"
55
55
  * })
56
56
  */
57
- createStyleRewrite(request: MarkupAI.CreateStyleRewriteV1StyleRewritesPostRequest, requestOptions?: StyleRewrites.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
57
+ createStyleRewrite(request: MarkupAI.StyleRewriteRequestBody, requestOptions?: StyleRewrites.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
58
58
  private __createStyleRewrite;
59
59
  /**
60
60
  * Retrieve rewrite results.
@@ -25,7 +25,7 @@ export class StyleRewrites {
25
25
  /**
26
26
  * Rewrite text with style corrections applied.
27
27
  *
28
- * @param {MarkupAI.CreateStyleRewriteV1StyleRewritesPostRequest} request
28
+ * @param {MarkupAI.StyleRewriteRequestBody} request
29
29
  * @param {StyleRewrites.RequestOptions} requestOptions - Request-specific configuration.
30
30
  *
31
31
  * @throws {@link MarkupAI.UnauthorizedError}
@@ -50,7 +50,6 @@ export class StyleRewrites {
50
50
  return __awaiter(this, void 0, void 0, function* () {
51
51
  var _a, _b, _c, _d;
52
52
  const _request = yield core.newFormData();
53
- yield _request.appendFile("file_upload", request.file_upload);
54
53
  _request.append("dialect", request.dialect);
55
54
  if (request.tone != null) {
56
55
  _request.append("tone", request.tone);
@@ -59,6 +58,7 @@ export class StyleRewrites {
59
58
  if (request.webhook_url != null) {
60
59
  _request.append("webhook_url", request.webhook_url);
61
60
  }
61
+ yield _request.appendFile("file_upload", request.file_upload);
62
62
  const _maybeEncodedRequest = yield _request.getRequest();
63
63
  let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
64
64
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as core from "../../../../../core/index.mjs";
5
4
  import * as MarkupAI from "../../../../index.mjs";
5
+ import * as core from "../../../../../core/index.mjs";
6
6
  /**
7
7
  * @example
8
8
  * {
@@ -11,9 +11,7 @@ import * as MarkupAI from "../../../../index.mjs";
11
11
  * style_guide: "style_guide"
12
12
  * }
13
13
  */
14
- export interface CreateStyleRewriteV1StyleRewritesPostRequest {
15
- /** The document to analyze. Text files (.txt), PDFs (.pdf), and Markdown files (.md) are accepted. The max file size is 1.5 MB */
16
- file_upload: core.file.Uploadable.FileLike;
14
+ export interface StyleRewriteRequestBody {
17
15
  /** The language variant you'd like us to use for analysis. Choose from American English, British English, or other supported dialects. */
18
16
  dialect: MarkupAI.Dialects;
19
17
  /** The tone variation you're aiming for. Options include formal, academic, casual, and other tone variations to match your content goals. */
@@ -22,4 +20,6 @@ export interface CreateStyleRewriteV1StyleRewritesPostRequest {
22
20
  style_guide: string;
23
21
  /** A URL that results will be POSTed to once the process completes. */
24
22
  webhook_url?: string;
23
+ /** The document to rewrite. Text (.txt), Markdown (.md), HTML (.html .htm), and DITA (.dita, .xml) files are accepted. The max file size is 1.5 MB. */
24
+ file_upload: core.file.Uploadable.FileLike;
25
25
  }
@@ -1 +1 @@
1
- export { type CreateStyleRewriteV1StyleRewritesPostRequest } from "./CreateStyleRewriteV1StyleRewritesPostRequest.mjs";
1
+ export { type StyleRewriteRequestBody } from "./StyleRewriteRequestBody.mjs";
@@ -36,7 +36,7 @@ export declare class StyleSuggestions {
36
36
  /**
37
37
  * Get suggested corrections for text.
38
38
  *
39
- * @param {MarkupAI.CreateStyleSuggestionV1StyleSuggestionsPostRequest} request
39
+ * @param {MarkupAI.StyleSuggestionRequestBody} request
40
40
  * @param {StyleSuggestions.RequestOptions} requestOptions - Request-specific configuration.
41
41
  *
42
42
  * @throws {@link MarkupAI.UnauthorizedError}
@@ -54,7 +54,7 @@ export declare class StyleSuggestions {
54
54
  * style_guide: "style_guide"
55
55
  * })
56
56
  */
57
- createStyleSuggestion(request: MarkupAI.CreateStyleSuggestionV1StyleSuggestionsPostRequest, requestOptions?: StyleSuggestions.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
57
+ createStyleSuggestion(request: MarkupAI.StyleSuggestionRequestBody, requestOptions?: StyleSuggestions.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
58
58
  private __createStyleSuggestion;
59
59
  /**
60
60
  * Retrieve suggestion results.
@@ -25,7 +25,7 @@ export class StyleSuggestions {
25
25
  /**
26
26
  * Get suggested corrections for text.
27
27
  *
28
- * @param {MarkupAI.CreateStyleSuggestionV1StyleSuggestionsPostRequest} request
28
+ * @param {MarkupAI.StyleSuggestionRequestBody} request
29
29
  * @param {StyleSuggestions.RequestOptions} requestOptions - Request-specific configuration.
30
30
  *
31
31
  * @throws {@link MarkupAI.UnauthorizedError}
@@ -50,7 +50,6 @@ export class StyleSuggestions {
50
50
  return __awaiter(this, void 0, void 0, function* () {
51
51
  var _a, _b, _c, _d;
52
52
  const _request = yield core.newFormData();
53
- yield _request.appendFile("file_upload", request.file_upload);
54
53
  _request.append("dialect", request.dialect);
55
54
  if (request.tone != null) {
56
55
  _request.append("tone", request.tone);
@@ -59,6 +58,7 @@ export class StyleSuggestions {
59
58
  if (request.webhook_url != null) {
60
59
  _request.append("webhook_url", request.webhook_url);
61
60
  }
61
+ yield _request.appendFile("file_upload", request.file_upload);
62
62
  const _maybeEncodedRequest = yield _request.getRequest();
63
63
  let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
64
64
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as core from "../../../../../core/index.mjs";
5
4
  import * as MarkupAI from "../../../../index.mjs";
5
+ import * as core from "../../../../../core/index.mjs";
6
6
  /**
7
7
  * @example
8
8
  * {
@@ -11,9 +11,7 @@ import * as MarkupAI from "../../../../index.mjs";
11
11
  * style_guide: "style_guide"
12
12
  * }
13
13
  */
14
- export interface CreateStyleCheckV1StyleChecksPostRequest {
15
- /** The document to analyze. Text files (.txt), PDFs (.pdf), and Markdown files (.md) are accepted. The max file size is 1.5 MB */
16
- file_upload: core.file.Uploadable.FileLike;
14
+ export interface StyleSuggestionRequestBody {
17
15
  /** The language variant you'd like us to use for analysis. Choose from American English, British English, or other supported dialects. */
18
16
  dialect: MarkupAI.Dialects;
19
17
  /** The tone variation you're aiming for. Options include formal, academic, casual, and other tone variations to match your content goals. */
@@ -22,4 +20,6 @@ export interface CreateStyleCheckV1StyleChecksPostRequest {
22
20
  style_guide: string;
23
21
  /** A URL that results will be POSTed to once the process completes. */
24
22
  webhook_url?: string;
23
+ /** The document to analyze. Text (.txt), Markdown (.md), HTML (.html .htm), DITA (.dita, .xml), and PDF (.pdf) files are accepted. The max file size is 1.5 MB. */
24
+ file_upload: core.file.Uploadable.FileLike;
25
25
  }
@@ -1 +1 @@
1
- export { type CreateStyleSuggestionV1StyleSuggestionsPostRequest } from "./CreateStyleSuggestionV1StyleSuggestionsPostRequest.mjs";
1
+ export { type StyleSuggestionRequestBody } from "./StyleSuggestionRequestBody.mjs";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type BaseStyleGuideType = "ap" | "chicago" | "microsoft";
5
+ export declare const BaseStyleGuideType: {
6
+ readonly Ap: "ap";
7
+ readonly Chicago: "chicago";
8
+ readonly Microsoft: "microsoft";
9
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export const BaseStyleGuideType = {
5
+ Ap: "ap",
6
+ Chicago: "chicago",
7
+ Microsoft: "microsoft",
8
+ };
@@ -18,4 +18,6 @@ export interface StyleGuideResponse {
18
18
  updated_by?: string;
19
19
  /** User-friendly summary of the style guide's contents and characteristics */
20
20
  summary?: string;
21
+ /** The base style guide type that this style guide extends (AP, Chicago, or Microsoft). */
22
+ base_style_guide_type?: MarkupAI.BaseStyleGuideType;
21
23
  }
@@ -7,6 +7,8 @@ export interface WorkflowInfo {
7
7
  id: string;
8
8
  /** API version */
9
9
  api_version?: string;
10
+ /** The original name of the file passed into the workflow */
11
+ filename?: string;
10
12
  /** UTC timestamp when the result was generated */
11
13
  generated_at?: string;
12
14
  status?: MarkupAI.WorkflowStatus;
@@ -1,4 +1,5 @@
1
1
  export * from "./AnalysisScore.mjs";
2
+ export * from "./BaseStyleGuideType.mjs";
2
3
  export * from "./ClarityCategory.mjs";
3
4
  export * from "./ClarityScore.mjs";
4
5
  export * from "./ConfigOptions.mjs";
@@ -1,4 +1,5 @@
1
1
  export * from "./AnalysisScore.mjs";
2
+ export * from "./BaseStyleGuideType.mjs";
2
3
  export * from "./ClarityCategory.mjs";
3
4
  export * from "./ClarityScore.mjs";
4
5
  export * from "./ConfigOptions.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.0";
1
+ export declare const SDK_VERSION = "1.2.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.0.0";
1
+ export const SDK_VERSION = "1.2.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markupai/api",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "private": false,
5
5
  "repository": "github:markupai/markup-ai-typescript-sdk",
6
6
  "license": "Apache-2.0",
package/reference.md CHANGED
@@ -372,7 +372,7 @@ await client.styleChecks.createStyleCheck({
372
372
  <dl>
373
373
  <dd>
374
374
 
375
- **request:** `MarkupAI.CreateStyleCheckV1StyleChecksPostRequest`
375
+ **request:** `MarkupAI.StyleCheckRequestBody`
376
376
 
377
377
  </dd>
378
378
  </dl>
@@ -504,7 +504,7 @@ await client.styleSuggestions.createStyleSuggestion({
504
504
  <dl>
505
505
  <dd>
506
506
 
507
- **request:** `MarkupAI.CreateStyleSuggestionV1StyleSuggestionsPostRequest`
507
+ **request:** `MarkupAI.StyleSuggestionRequestBody`
508
508
 
509
509
  </dd>
510
510
  </dl>
@@ -636,7 +636,7 @@ await client.styleRewrites.createStyleRewrite({
636
636
  <dl>
637
637
  <dd>
638
638
 
639
- **request:** `MarkupAI.CreateStyleRewriteV1StyleRewritesPostRequest`
639
+ **request:** `MarkupAI.StyleRewriteRequestBody`
640
640
 
641
641
  </dd>
642
642
  </dl>