@markupai/api 0.0.6 → 0.1.1

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 (98) hide show
  1. package/api/errors/ContentTooLargeError.d.ts +2 -1
  2. package/api/errors/UnauthorizedError.d.ts +9 -0
  3. package/api/errors/UnauthorizedError.js +52 -0
  4. package/api/errors/index.d.ts +2 -1
  5. package/api/errors/index.js +2 -1
  6. package/api/resources/styleChecks/client/Client.d.ts +8 -5
  7. package/api/resources/styleChecks/client/Client.js +22 -9
  8. package/api/resources/styleChecks/client/requests/{StyleChecksCreateStyleCheckRequest.d.ts → CreateStyleCheckV1StyleChecksPostRequest.d.ts} +2 -3
  9. package/api/resources/styleChecks/client/requests/index.d.ts +1 -1
  10. package/api/resources/styleGuides/client/Client.d.ts +18 -3
  11. package/api/resources/styleGuides/client/Client.js +54 -15
  12. package/{dist/api/resources/styleGuides/client/requests/BodyStyleGuidesUpdateStyleGuide.d.ts → api/resources/styleGuides/client/requests/BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch.d.ts} +1 -1
  13. package/api/resources/styleGuides/client/requests/StyleGuideRequestBody.d.ts +5 -3
  14. package/api/resources/styleGuides/client/requests/index.d.ts +1 -1
  15. package/api/resources/styleRewrites/client/Client.d.ts +8 -5
  16. package/api/resources/styleRewrites/client/Client.js +22 -9
  17. package/{dist/api/resources/styleChecks/client/requests/StyleChecksCreateStyleCheckRequest.d.ts → api/resources/styleRewrites/client/requests/CreateStyleRewriteV1StyleRewritesPostRequest.d.ts} +2 -3
  18. package/api/resources/styleRewrites/client/requests/index.d.ts +1 -1
  19. package/api/resources/styleSuggestions/client/Client.d.ts +8 -5
  20. package/api/resources/styleSuggestions/client/Client.js +22 -9
  21. package/api/resources/{styleRewrites/client/requests/StyleRewritesCreateStyleRewriteRequest.d.ts → styleSuggestions/client/requests/CreateStyleSuggestionV1StyleSuggestionsPostRequest.d.ts} +2 -3
  22. package/api/resources/styleSuggestions/client/requests/index.d.ts +1 -1
  23. package/api/types/AnalysisScore.d.ts +8 -0
  24. package/api/types/ClarityCategory.d.ts +4 -0
  25. package/api/types/ClarityScore.d.ts +3 -5
  26. package/api/types/ErrorResponse.d.ts +1 -1
  27. package/api/types/IssueCategory.d.ts +2 -4
  28. package/api/types/IssueCategory.js +1 -3
  29. package/api/types/QualityScore.d.ts +4 -0
  30. package/api/types/RewriteResponse.d.ts +1 -1
  31. package/api/types/ScoreOutput.d.ts +1 -5
  32. package/api/types/StyleCheckResponse.d.ts +1 -1
  33. package/api/types/Subcategory.d.ts +1 -1
  34. package/api/types/SuggestionResponse.d.ts +1 -1
  35. package/api/types/ToneScore.d.ts +2 -4
  36. package/api/types/index.d.ts +2 -0
  37. package/api/types/index.js +2 -0
  38. package/dist/api/errors/ContentTooLargeError.d.ts +2 -1
  39. package/dist/api/errors/UnauthorizedError.d.ts +9 -0
  40. package/dist/api/errors/UnauthorizedError.js +52 -0
  41. package/dist/api/errors/index.d.ts +2 -1
  42. package/dist/api/errors/index.js +2 -1
  43. package/dist/api/resources/styleChecks/client/Client.d.ts +8 -5
  44. package/dist/api/resources/styleChecks/client/Client.js +22 -9
  45. package/dist/api/resources/{styleRewrites/client/requests/StyleRewritesCreateStyleRewriteRequest.d.ts → styleChecks/client/requests/CreateStyleCheckV1StyleChecksPostRequest.d.ts} +2 -3
  46. package/dist/api/resources/styleChecks/client/requests/index.d.ts +1 -1
  47. package/dist/api/resources/styleGuides/client/Client.d.ts +18 -3
  48. package/dist/api/resources/styleGuides/client/Client.js +54 -15
  49. package/{api/resources/styleGuides/client/requests/BodyStyleGuidesUpdateStyleGuide.d.ts → dist/api/resources/styleGuides/client/requests/BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch.d.ts} +1 -1
  50. package/dist/api/resources/styleGuides/client/requests/StyleGuideRequestBody.d.ts +5 -3
  51. package/dist/api/resources/styleGuides/client/requests/index.d.ts +1 -1
  52. package/dist/api/resources/styleRewrites/client/Client.d.ts +8 -5
  53. package/dist/api/resources/styleRewrites/client/Client.js +22 -9
  54. package/dist/api/resources/styleRewrites/client/requests/CreateStyleRewriteV1StyleRewritesPostRequest.d.ts +21 -0
  55. package/dist/api/resources/styleRewrites/client/requests/CreateStyleRewriteV1StyleRewritesPostRequest.js +5 -0
  56. package/dist/api/resources/styleRewrites/client/requests/index.d.ts +1 -1
  57. package/dist/api/resources/styleSuggestions/client/Client.d.ts +8 -5
  58. package/dist/api/resources/styleSuggestions/client/Client.js +22 -9
  59. package/dist/api/resources/styleSuggestions/client/requests/CreateStyleSuggestionV1StyleSuggestionsPostRequest.d.ts +21 -0
  60. package/dist/api/resources/styleSuggestions/client/requests/CreateStyleSuggestionV1StyleSuggestionsPostRequest.js +5 -0
  61. package/dist/api/resources/styleSuggestions/client/requests/index.d.ts +1 -1
  62. package/dist/api/types/AnalysisScore.d.ts +8 -0
  63. package/dist/api/types/AnalysisScore.js +5 -0
  64. package/dist/api/types/ClarityCategory.d.ts +4 -0
  65. package/dist/api/types/ClarityCategory.js +5 -0
  66. package/dist/api/types/ClarityScore.d.ts +3 -5
  67. package/dist/api/types/ErrorResponse.d.ts +1 -1
  68. package/dist/api/types/IssueCategory.d.ts +2 -4
  69. package/dist/api/types/IssueCategory.js +1 -3
  70. package/dist/api/types/QualityScore.d.ts +4 -0
  71. package/dist/api/types/RewriteResponse.d.ts +1 -1
  72. package/dist/api/types/ScoreOutput.d.ts +1 -5
  73. package/dist/api/types/StyleCheckResponse.d.ts +1 -1
  74. package/dist/api/types/Subcategory.d.ts +1 -1
  75. package/dist/api/types/SuggestionResponse.d.ts +1 -1
  76. package/dist/api/types/ToneScore.d.ts +2 -4
  77. package/dist/api/types/index.d.ts +2 -0
  78. package/dist/api/types/index.js +2 -0
  79. package/dist/environments.d.ts +2 -2
  80. package/dist/environments.js +1 -1
  81. package/dist/version.d.ts +1 -1
  82. package/dist/version.js +1 -1
  83. package/environments.d.ts +2 -2
  84. package/environments.js +1 -1
  85. package/package.json +1 -1
  86. package/reference.md +13 -14
  87. package/version.d.ts +1 -1
  88. package/version.js +1 -1
  89. package/api/resources/styleSuggestions/client/requests/StyleSuggestionsCreateStyleSuggestionRequest.d.ts +0 -22
  90. package/dist/api/resources/styleSuggestions/client/requests/StyleSuggestionsCreateStyleSuggestionRequest.d.ts +0 -22
  91. /package/api/resources/styleChecks/client/requests/{StyleChecksCreateStyleCheckRequest.js → CreateStyleCheckV1StyleChecksPostRequest.js} +0 -0
  92. /package/api/resources/styleGuides/client/requests/{BodyStyleGuidesUpdateStyleGuide.js → BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch.js} +0 -0
  93. /package/api/resources/styleRewrites/client/requests/{StyleRewritesCreateStyleRewriteRequest.js → CreateStyleRewriteV1StyleRewritesPostRequest.js} +0 -0
  94. /package/api/resources/styleSuggestions/client/requests/{StyleSuggestionsCreateStyleSuggestionRequest.js → CreateStyleSuggestionV1StyleSuggestionsPostRequest.js} +0 -0
  95. /package/{dist/api/resources/styleChecks/client/requests/StyleChecksCreateStyleCheckRequest.js → api/types/AnalysisScore.js} +0 -0
  96. /package/{dist/api/resources/styleGuides/client/requests/BodyStyleGuidesUpdateStyleGuide.js → api/types/ClarityCategory.js} +0 -0
  97. /package/dist/api/resources/{styleRewrites/client/requests/StyleRewritesCreateStyleRewriteRequest.js → styleChecks/client/requests/CreateStyleCheckV1StyleChecksPostRequest.js} +0 -0
  98. /package/dist/api/resources/{styleSuggestions/client/requests/StyleSuggestionsCreateStyleSuggestionRequest.js → styleGuides/client/requests/BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch.js} +0 -0
@@ -2,7 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
+ import * as MarkupAI from "../index";
5
6
  import * as core from "../../core";
6
7
  export declare class ContentTooLargeError extends errors.MarkupAIError {
7
- constructor(body?: unknown, rawResponse?: core.RawResponse);
8
+ constructor(body: MarkupAI.ErrorResponse, rawResponse?: core.RawResponse);
8
9
  }
@@ -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";
5
+ import * as MarkupAI from "../index";
6
+ import * as core from "../../core";
7
+ export declare class UnauthorizedError 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.UnauthorizedError = void 0;
40
+ const errors = __importStar(require("../../errors/index"));
41
+ class UnauthorizedError extends errors.MarkupAIError {
42
+ constructor(body, rawResponse) {
43
+ super({
44
+ message: "UnauthorizedError",
45
+ statusCode: 401,
46
+ body: body,
47
+ rawResponse: rawResponse,
48
+ });
49
+ Object.setPrototypeOf(this, UnauthorizedError.prototype);
50
+ }
51
+ }
52
+ exports.UnauthorizedError = UnauthorizedError;
@@ -1,5 +1,6 @@
1
+ export * from "./UnauthorizedError";
2
+ export * from "./ForbiddenError";
1
3
  export * from "./UnprocessableEntityError";
2
4
  export * from "./InternalServerError";
3
- export * from "./ForbiddenError";
4
5
  export * from "./ContentTooLargeError";
5
6
  export * from "./NotFoundError";
@@ -14,8 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./UnauthorizedError"), exports);
18
+ __exportStar(require("./ForbiddenError"), exports);
17
19
  __exportStar(require("./UnprocessableEntityError"), exports);
18
20
  __exportStar(require("./InternalServerError"), exports);
19
- __exportStar(require("./ForbiddenError"), exports);
20
21
  __exportStar(require("./ContentTooLargeError"), exports);
21
22
  __exportStar(require("./NotFoundError"), exports);
@@ -32,12 +32,14 @@ export declare class StyleChecks {
32
32
  protected readonly _options: StyleChecks.Options;
33
33
  constructor(_options: StyleChecks.Options);
34
34
  /**
35
- * Start a style and brand check workflow. Returns a workflow ID to use for polling results.
35
+ * Analyze text for grammar, style, and clarity issues.
36
36
  *
37
37
  * @param {File | fs.ReadStream | Blob} file_upload
38
- * @param {MarkupAI.StyleChecksCreateStyleCheckRequest} request
38
+ * @param {MarkupAI.CreateStyleCheckV1StyleChecksPostRequest} request
39
39
  * @param {StyleChecks.RequestOptions} requestOptions - Request-specific configuration.
40
40
  *
41
+ * @throws {@link MarkupAI.UnauthorizedError}
42
+ * @throws {@link MarkupAI.ForbiddenError}
41
43
  * @throws {@link MarkupAI.ContentTooLargeError}
42
44
  * @throws {@link MarkupAI.UnprocessableEntityError}
43
45
  * @throws {@link MarkupAI.InternalServerError}
@@ -45,18 +47,19 @@ export declare class StyleChecks {
45
47
  * @example
46
48
  * await client.styleChecks.createStyleCheck(fs.createReadStream("/path/to/your/file"), {
47
49
  * dialect: "american_english",
48
- * tone: "academic",
49
50
  * style_guide: "style_guide"
50
51
  * })
51
52
  */
52
- createStyleCheck(file_upload: File | fs.ReadStream | Blob, request: MarkupAI.StyleChecksCreateStyleCheckRequest, requestOptions?: StyleChecks.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
53
+ createStyleCheck(file_upload: File | fs.ReadStream | Blob, request: MarkupAI.CreateStyleCheckV1StyleChecksPostRequest, requestOptions?: StyleChecks.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
53
54
  private __createStyleCheck;
54
55
  /**
55
- * Retrieve the results of a style and brand check workflow. Returns `running` or `complete` status.
56
+ * Retrieve style check results.
56
57
  *
57
58
  * @param {string} workflowId
58
59
  * @param {StyleChecks.RequestOptions} requestOptions - Request-specific configuration.
59
60
  *
61
+ * @throws {@link MarkupAI.UnauthorizedError}
62
+ * @throws {@link MarkupAI.ForbiddenError}
60
63
  * @throws {@link MarkupAI.NotFoundError}
61
64
  * @throws {@link MarkupAI.UnprocessableEntityError}
62
65
  * @throws {@link MarkupAI.InternalServerError}
@@ -62,12 +62,14 @@ class StyleChecks {
62
62
  this._options = _options;
63
63
  }
64
64
  /**
65
- * Start a style and brand check workflow. Returns a workflow ID to use for polling results.
65
+ * Analyze text for grammar, style, and clarity issues.
66
66
  *
67
67
  * @param {File | fs.ReadStream | Blob} file_upload
68
- * @param {MarkupAI.StyleChecksCreateStyleCheckRequest} request
68
+ * @param {MarkupAI.CreateStyleCheckV1StyleChecksPostRequest} request
69
69
  * @param {StyleChecks.RequestOptions} requestOptions - Request-specific configuration.
70
70
  *
71
+ * @throws {@link MarkupAI.UnauthorizedError}
72
+ * @throws {@link MarkupAI.ForbiddenError}
71
73
  * @throws {@link MarkupAI.ContentTooLargeError}
72
74
  * @throws {@link MarkupAI.UnprocessableEntityError}
73
75
  * @throws {@link MarkupAI.InternalServerError}
@@ -75,7 +77,6 @@ class StyleChecks {
75
77
  * @example
76
78
  * await client.styleChecks.createStyleCheck(fs.createReadStream("/path/to/your/file"), {
77
79
  * dialect: "american_english",
78
- * tone: "academic",
79
80
  * style_guide: "style_guide"
80
81
  * })
81
82
  */
@@ -88,16 +89,18 @@ class StyleChecks {
88
89
  const _request = yield core.newFormData();
89
90
  yield _request.appendFile("file_upload", file_upload);
90
91
  _request.append("dialect", request.dialect);
91
- _request.append("tone", request.tone);
92
+ if (request.tone != null) {
93
+ _request.append("tone", request.tone);
94
+ }
92
95
  _request.append("style_guide", request.style_guide);
93
96
  if (request.webhook_url != null) {
94
97
  _request.append("webhook_url", request.webhook_url);
95
98
  }
96
99
  const _maybeEncodedRequest = yield _request.getRequest();
97
100
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
98
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MarkupAIEnvironment.Production, "v1/style/checks"),
101
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MarkupAIEnvironment.Default, "v1/style/checks"),
99
102
  method: "POST",
100
- headers: Object.assign(Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@markupai/api", "X-Fern-SDK-Version": "0.0.6", "User-Agent": "@markupai/api/0.0.6", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
103
+ headers: Object.assign(Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@markupai/api", "X-Fern-SDK-Version": "0.1.1", "User-Agent": "@markupai/api/0.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
101
104
  requestType: "file",
102
105
  duplex: _maybeEncodedRequest.duplex,
103
106
  body: _maybeEncodedRequest.body,
@@ -110,6 +113,10 @@ class StyleChecks {
110
113
  }
111
114
  if (_response.error.reason === "status-code") {
112
115
  switch (_response.error.statusCode) {
116
+ case 401:
117
+ throw new MarkupAI.UnauthorizedError(_response.error.body, _response.rawResponse);
118
+ case 403:
119
+ throw new MarkupAI.ForbiddenError(_response.error.body, _response.rawResponse);
113
120
  case 413:
114
121
  throw new MarkupAI.ContentTooLargeError(_response.error.body, _response.rawResponse);
115
122
  case 422:
@@ -142,11 +149,13 @@ class StyleChecks {
142
149
  });
143
150
  }
144
151
  /**
145
- * Retrieve the results of a style and brand check workflow. Returns `running` or `complete` status.
152
+ * Retrieve style check results.
146
153
  *
147
154
  * @param {string} workflowId
148
155
  * @param {StyleChecks.RequestOptions} requestOptions - Request-specific configuration.
149
156
  *
157
+ * @throws {@link MarkupAI.UnauthorizedError}
158
+ * @throws {@link MarkupAI.ForbiddenError}
150
159
  * @throws {@link MarkupAI.NotFoundError}
151
160
  * @throws {@link MarkupAI.UnprocessableEntityError}
152
161
  * @throws {@link MarkupAI.InternalServerError}
@@ -161,9 +170,9 @@ class StyleChecks {
161
170
  return __awaiter(this, void 0, void 0, function* () {
162
171
  var _a, _b, _c;
163
172
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
164
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MarkupAIEnvironment.Production, `v1/style/checks/${encodeURIComponent(workflowId)}`),
173
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MarkupAIEnvironment.Default, `v1/style/checks/${encodeURIComponent(workflowId)}`),
165
174
  method: "GET",
166
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@markupai/api", "X-Fern-SDK-Version": "0.0.6", "User-Agent": "@markupai/api/0.0.6", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
175
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@markupai/api", "X-Fern-SDK-Version": "0.1.1", "User-Agent": "@markupai/api/0.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
167
176
  contentType: "application/json",
168
177
  requestType: "json",
169
178
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -175,6 +184,10 @@ class StyleChecks {
175
184
  }
176
185
  if (_response.error.reason === "status-code") {
177
186
  switch (_response.error.statusCode) {
187
+ case 401:
188
+ throw new MarkupAI.UnauthorizedError(_response.error.body, _response.rawResponse);
189
+ case 403:
190
+ throw new MarkupAI.ForbiddenError(_response.error.body, _response.rawResponse);
178
191
  case 404:
179
192
  throw new MarkupAI.NotFoundError(_response.error.body, _response.rawResponse);
180
193
  case 422:
@@ -6,15 +6,14 @@ import * as MarkupAI from "../../../../index";
6
6
  * @example
7
7
  * {
8
8
  * dialect: "american_english",
9
- * tone: "academic",
10
9
  * style_guide: "style_guide"
11
10
  * }
12
11
  */
13
- export interface StyleChecksCreateStyleCheckRequest {
12
+ export interface CreateStyleCheckV1StyleChecksPostRequest {
14
13
  /** The language variant you'd like us to use for analysis. Choose from American English, British English, or other supported dialects. */
15
14
  dialect: MarkupAI.Dialects;
16
15
  /** The tone variation you're aiming for. Options include formal, academic, casual, and other tone variations to match your content goals. */
17
- tone: MarkupAI.Tones;
16
+ tone?: MarkupAI.Tones;
18
17
  /** The style guide to follow for your content. You can use a style guide ID or choose from built-in options: `ap`, `chicago`, or `microsoft`. */
19
18
  style_guide: string;
20
19
  /** A URL that results will be POSTed to once the process completes. */
@@ -1 +1 @@
1
- export { type StyleChecksCreateStyleCheckRequest } from "./StyleChecksCreateStyleCheckRequest";
1
+ export { type CreateStyleCheckV1StyleChecksPostRequest } from "./CreateStyleCheckV1StyleChecksPostRequest";
@@ -36,6 +36,8 @@ export declare class StyleGuides {
36
36
  *
37
37
  * @param {StyleGuides.RequestOptions} requestOptions - Request-specific configuration.
38
38
  *
39
+ * @throws {@link MarkupAI.UnauthorizedError}
40
+ * @throws {@link MarkupAI.ForbiddenError}
39
41
  * @throws {@link MarkupAI.UnprocessableEntityError}
40
42
  * @throws {@link MarkupAI.InternalServerError}
41
43
  *
@@ -51,11 +53,16 @@ export declare class StyleGuides {
51
53
  * @param {MarkupAI.StyleGuideRequestBody} request
52
54
  * @param {StyleGuides.RequestOptions} requestOptions - Request-specific configuration.
53
55
  *
56
+ * @throws {@link MarkupAI.UnauthorizedError}
57
+ * @throws {@link MarkupAI.ForbiddenError}
58
+ * @throws {@link MarkupAI.ContentTooLargeError}
54
59
  * @throws {@link MarkupAI.UnprocessableEntityError}
55
60
  * @throws {@link MarkupAI.InternalServerError}
56
61
  *
57
62
  * @example
58
- * await client.styleGuides.createStyleGuide(fs.createReadStream("/path/to/your/file"), {})
63
+ * await client.styleGuides.createStyleGuide(fs.createReadStream("/path/to/your/file"), {
64
+ * name: "name"
65
+ * })
59
66
  */
60
67
  createStyleGuide(file_upload: File | fs.ReadStream | Blob, request: MarkupAI.StyleGuideRequestBody, requestOptions?: StyleGuides.RequestOptions): core.HttpResponsePromise<MarkupAI.StyleGuideResponse>;
61
68
  private __createStyleGuide;
@@ -65,6 +72,9 @@ export declare class StyleGuides {
65
72
  * @param {string} styleGuideId - The ID of the style guide.
66
73
  * @param {StyleGuides.RequestOptions} requestOptions - Request-specific configuration.
67
74
  *
75
+ * @throws {@link MarkupAI.UnauthorizedError}
76
+ * @throws {@link MarkupAI.ForbiddenError}
77
+ * @throws {@link MarkupAI.NotFoundError}
68
78
  * @throws {@link MarkupAI.UnprocessableEntityError}
69
79
  * @throws {@link MarkupAI.InternalServerError}
70
80
  *
@@ -79,6 +89,9 @@ export declare class StyleGuides {
79
89
  * @param {string} styleGuideId - The ID of the style guide.
80
90
  * @param {StyleGuides.RequestOptions} requestOptions - Request-specific configuration.
81
91
  *
92
+ * @throws {@link MarkupAI.UnauthorizedError}
93
+ * @throws {@link MarkupAI.ForbiddenError}
94
+ * @throws {@link MarkupAI.NotFoundError}
82
95
  * @throws {@link MarkupAI.UnprocessableEntityError}
83
96
  * @throws {@link MarkupAI.InternalServerError}
84
97
  *
@@ -91,10 +104,12 @@ export declare class StyleGuides {
91
104
  * Update the name of an existing style guide.
92
105
  *
93
106
  * @param {string} styleGuideId - The ID of the style guide.
94
- * @param {MarkupAI.BodyStyleGuidesUpdateStyleGuide} request
107
+ * @param {MarkupAI.BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch} request
95
108
  * @param {StyleGuides.RequestOptions} requestOptions - Request-specific configuration.
96
109
  *
110
+ * @throws {@link MarkupAI.UnauthorizedError}
97
111
  * @throws {@link MarkupAI.ForbiddenError}
112
+ * @throws {@link MarkupAI.NotFoundError}
98
113
  * @throws {@link MarkupAI.UnprocessableEntityError}
99
114
  * @throws {@link MarkupAI.InternalServerError}
100
115
  *
@@ -103,7 +118,7 @@ export declare class StyleGuides {
103
118
  * name: "name"
104
119
  * })
105
120
  */
106
- updateStyleGuide(styleGuideId: string, request: MarkupAI.BodyStyleGuidesUpdateStyleGuide, requestOptions?: StyleGuides.RequestOptions): core.HttpResponsePromise<MarkupAI.StyleGuideResponse>;
121
+ updateStyleGuide(styleGuideId: string, request: MarkupAI.BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch, requestOptions?: StyleGuides.RequestOptions): core.HttpResponsePromise<MarkupAI.StyleGuideResponse>;
107
122
  private __updateStyleGuide;
108
123
  protected _getAuthorizationHeader(): Promise<string>;
109
124
  }
@@ -66,6 +66,8 @@ class StyleGuides {
66
66
  *
67
67
  * @param {StyleGuides.RequestOptions} requestOptions - Request-specific configuration.
68
68
  *
69
+ * @throws {@link MarkupAI.UnauthorizedError}
70
+ * @throws {@link MarkupAI.ForbiddenError}
69
71
  * @throws {@link MarkupAI.UnprocessableEntityError}
70
72
  * @throws {@link MarkupAI.InternalServerError}
71
73
  *
@@ -79,9 +81,9 @@ class StyleGuides {
79
81
  return __awaiter(this, void 0, void 0, function* () {
80
82
  var _a, _b, _c;
81
83
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
82
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MarkupAIEnvironment.Production, "v1/style-guides"),
84
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MarkupAIEnvironment.Default, "v1/style-guides"),
83
85
  method: "GET",
84
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@markupai/api", "X-Fern-SDK-Version": "0.0.6", "User-Agent": "@markupai/api/0.0.6", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
86
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@markupai/api", "X-Fern-SDK-Version": "0.1.1", "User-Agent": "@markupai/api/0.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
85
87
  contentType: "application/json",
86
88
  requestType: "json",
87
89
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -93,6 +95,10 @@ class StyleGuides {
93
95
  }
94
96
  if (_response.error.reason === "status-code") {
95
97
  switch (_response.error.statusCode) {
98
+ case 401:
99
+ throw new MarkupAI.UnauthorizedError(_response.error.body, _response.rawResponse);
100
+ case 403:
101
+ throw new MarkupAI.ForbiddenError(_response.error.body, _response.rawResponse);
96
102
  case 422:
97
103
  throw new MarkupAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
98
104
  case 500:
@@ -129,11 +135,16 @@ class StyleGuides {
129
135
  * @param {MarkupAI.StyleGuideRequestBody} request
130
136
  * @param {StyleGuides.RequestOptions} requestOptions - Request-specific configuration.
131
137
  *
138
+ * @throws {@link MarkupAI.UnauthorizedError}
139
+ * @throws {@link MarkupAI.ForbiddenError}
140
+ * @throws {@link MarkupAI.ContentTooLargeError}
132
141
  * @throws {@link MarkupAI.UnprocessableEntityError}
133
142
  * @throws {@link MarkupAI.InternalServerError}
134
143
  *
135
144
  * @example
136
- * await client.styleGuides.createStyleGuide(fs.createReadStream("/path/to/your/file"), {})
145
+ * await client.styleGuides.createStyleGuide(fs.createReadStream("/path/to/your/file"), {
146
+ * name: "name"
147
+ * })
137
148
  */
138
149
  createStyleGuide(file_upload, request, requestOptions) {
139
150
  return core.HttpResponsePromise.fromPromise(this.__createStyleGuide(file_upload, request, requestOptions));
@@ -143,14 +154,12 @@ class StyleGuides {
143
154
  var _a, _b, _c;
144
155
  const _request = yield core.newFormData();
145
156
  yield _request.appendFile("file_upload", file_upload);
146
- if (request.name != null) {
147
- _request.append("name", request.name);
148
- }
157
+ _request.append("name", request.name);
149
158
  const _maybeEncodedRequest = yield _request.getRequest();
150
159
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
151
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MarkupAIEnvironment.Production, "v1/style-guides"),
160
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MarkupAIEnvironment.Default, "v1/style-guides"),
152
161
  method: "POST",
153
- headers: Object.assign(Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@markupai/api", "X-Fern-SDK-Version": "0.0.6", "User-Agent": "@markupai/api/0.0.6", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
162
+ headers: Object.assign(Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@markupai/api", "X-Fern-SDK-Version": "0.1.1", "User-Agent": "@markupai/api/0.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
154
163
  requestType: "file",
155
164
  duplex: _maybeEncodedRequest.duplex,
156
165
  body: _maybeEncodedRequest.body,
@@ -163,6 +172,12 @@ class StyleGuides {
163
172
  }
164
173
  if (_response.error.reason === "status-code") {
165
174
  switch (_response.error.statusCode) {
175
+ case 401:
176
+ throw new MarkupAI.UnauthorizedError(_response.error.body, _response.rawResponse);
177
+ case 403:
178
+ throw new MarkupAI.ForbiddenError(_response.error.body, _response.rawResponse);
179
+ case 413:
180
+ throw new MarkupAI.ContentTooLargeError(_response.error.body, _response.rawResponse);
166
181
  case 422:
167
182
  throw new MarkupAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
168
183
  case 500:
@@ -198,6 +213,9 @@ class StyleGuides {
198
213
  * @param {string} styleGuideId - The ID of the style guide.
199
214
  * @param {StyleGuides.RequestOptions} requestOptions - Request-specific configuration.
200
215
  *
216
+ * @throws {@link MarkupAI.UnauthorizedError}
217
+ * @throws {@link MarkupAI.ForbiddenError}
218
+ * @throws {@link MarkupAI.NotFoundError}
201
219
  * @throws {@link MarkupAI.UnprocessableEntityError}
202
220
  * @throws {@link MarkupAI.InternalServerError}
203
221
  *
@@ -211,9 +229,9 @@ class StyleGuides {
211
229
  return __awaiter(this, void 0, void 0, function* () {
212
230
  var _a, _b, _c;
213
231
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
214
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MarkupAIEnvironment.Production, `v1/style-guides/${encodeURIComponent(styleGuideId)}`),
232
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MarkupAIEnvironment.Default, `v1/style-guides/${encodeURIComponent(styleGuideId)}`),
215
233
  method: "GET",
216
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@markupai/api", "X-Fern-SDK-Version": "0.0.6", "User-Agent": "@markupai/api/0.0.6", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
234
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@markupai/api", "X-Fern-SDK-Version": "0.1.1", "User-Agent": "@markupai/api/0.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
217
235
  contentType: "application/json",
218
236
  requestType: "json",
219
237
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -225,6 +243,12 @@ class StyleGuides {
225
243
  }
226
244
  if (_response.error.reason === "status-code") {
227
245
  switch (_response.error.statusCode) {
246
+ case 401:
247
+ throw new MarkupAI.UnauthorizedError(_response.error.body, _response.rawResponse);
248
+ case 403:
249
+ throw new MarkupAI.ForbiddenError(_response.error.body, _response.rawResponse);
250
+ case 404:
251
+ throw new MarkupAI.NotFoundError(_response.error.body, _response.rawResponse);
228
252
  case 422:
229
253
  throw new MarkupAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
230
254
  case 500:
@@ -260,6 +284,9 @@ class StyleGuides {
260
284
  * @param {string} styleGuideId - The ID of the style guide.
261
285
  * @param {StyleGuides.RequestOptions} requestOptions - Request-specific configuration.
262
286
  *
287
+ * @throws {@link MarkupAI.UnauthorizedError}
288
+ * @throws {@link MarkupAI.ForbiddenError}
289
+ * @throws {@link MarkupAI.NotFoundError}
263
290
  * @throws {@link MarkupAI.UnprocessableEntityError}
264
291
  * @throws {@link MarkupAI.InternalServerError}
265
292
  *
@@ -273,9 +300,9 @@ class StyleGuides {
273
300
  return __awaiter(this, void 0, void 0, function* () {
274
301
  var _a, _b, _c;
275
302
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
276
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MarkupAIEnvironment.Production, `v1/style-guides/${encodeURIComponent(styleGuideId)}`),
303
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MarkupAIEnvironment.Default, `v1/style-guides/${encodeURIComponent(styleGuideId)}`),
277
304
  method: "DELETE",
278
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@markupai/api", "X-Fern-SDK-Version": "0.0.6", "User-Agent": "@markupai/api/0.0.6", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
305
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@markupai/api", "X-Fern-SDK-Version": "0.1.1", "User-Agent": "@markupai/api/0.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
279
306
  contentType: "application/json",
280
307
  requestType: "json",
281
308
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -287,6 +314,12 @@ class StyleGuides {
287
314
  }
288
315
  if (_response.error.reason === "status-code") {
289
316
  switch (_response.error.statusCode) {
317
+ case 401:
318
+ throw new MarkupAI.UnauthorizedError(_response.error.body, _response.rawResponse);
319
+ case 403:
320
+ throw new MarkupAI.ForbiddenError(_response.error.body, _response.rawResponse);
321
+ case 404:
322
+ throw new MarkupAI.NotFoundError(_response.error.body, _response.rawResponse);
290
323
  case 422:
291
324
  throw new MarkupAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
292
325
  case 500:
@@ -320,10 +353,12 @@ class StyleGuides {
320
353
  * Update the name of an existing style guide.
321
354
  *
322
355
  * @param {string} styleGuideId - The ID of the style guide.
323
- * @param {MarkupAI.BodyStyleGuidesUpdateStyleGuide} request
356
+ * @param {MarkupAI.BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch} request
324
357
  * @param {StyleGuides.RequestOptions} requestOptions - Request-specific configuration.
325
358
  *
359
+ * @throws {@link MarkupAI.UnauthorizedError}
326
360
  * @throws {@link MarkupAI.ForbiddenError}
361
+ * @throws {@link MarkupAI.NotFoundError}
327
362
  * @throws {@link MarkupAI.UnprocessableEntityError}
328
363
  * @throws {@link MarkupAI.InternalServerError}
329
364
  *
@@ -339,9 +374,9 @@ class StyleGuides {
339
374
  return __awaiter(this, void 0, void 0, function* () {
340
375
  var _a, _b, _c;
341
376
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
342
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MarkupAIEnvironment.Production, `v1/style-guides/${encodeURIComponent(styleGuideId)}`),
377
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MarkupAIEnvironment.Default, `v1/style-guides/${encodeURIComponent(styleGuideId)}`),
343
378
  method: "PATCH",
344
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@markupai/api", "X-Fern-SDK-Version": "0.0.6", "User-Agent": "@markupai/api/0.0.6", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
379
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@markupai/api", "X-Fern-SDK-Version": "0.1.1", "User-Agent": "@markupai/api/0.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
345
380
  contentType: "application/json",
346
381
  requestType: "json",
347
382
  body: request,
@@ -354,8 +389,12 @@ class StyleGuides {
354
389
  }
355
390
  if (_response.error.reason === "status-code") {
356
391
  switch (_response.error.statusCode) {
392
+ case 401:
393
+ throw new MarkupAI.UnauthorizedError(_response.error.body, _response.rawResponse);
357
394
  case 403:
358
395
  throw new MarkupAI.ForbiddenError(_response.error.body, _response.rawResponse);
396
+ case 404:
397
+ throw new MarkupAI.NotFoundError(_response.error.body, _response.rawResponse);
359
398
  case 422:
360
399
  throw new MarkupAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
361
400
  case 500:
@@ -7,7 +7,7 @@
7
7
  * name: "name"
8
8
  * }
9
9
  */
10
- export interface BodyStyleGuidesUpdateStyleGuide {
10
+ export interface BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch {
11
11
  /** The name of the style guide. */
12
12
  name: string;
13
13
  }
@@ -3,9 +3,11 @@
3
3
  */
4
4
  /**
5
5
  * @example
6
- * {}
6
+ * {
7
+ * name: "name"
8
+ * }
7
9
  */
8
10
  export interface StyleGuideRequestBody {
9
- /** A friendly name for your style guide to help you identify it later. If left empty, we'll generate one for you. */
10
- name?: string;
11
+ /** A friendly name for your style guide to help you identify it later. */
12
+ name: string;
11
13
  }
@@ -1,2 +1,2 @@
1
1
  export { type StyleGuideRequestBody } from "./StyleGuideRequestBody";
2
- export { type BodyStyleGuidesUpdateStyleGuide } from "./BodyStyleGuidesUpdateStyleGuide";
2
+ export { type BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch } from "./BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch";
@@ -32,12 +32,14 @@ export declare class StyleRewrites {
32
32
  protected readonly _options: StyleRewrites.Options;
33
33
  constructor(_options: StyleRewrites.Options);
34
34
  /**
35
- * Start a style and brand rewrite workflow. Returns a workflow ID to use for polling results.
35
+ * Rewrite text with style corrections applied.
36
36
  *
37
37
  * @param {File | fs.ReadStream | Blob} file_upload
38
- * @param {MarkupAI.StyleRewritesCreateStyleRewriteRequest} request
38
+ * @param {MarkupAI.CreateStyleRewriteV1StyleRewritesPostRequest} request
39
39
  * @param {StyleRewrites.RequestOptions} requestOptions - Request-specific configuration.
40
40
  *
41
+ * @throws {@link MarkupAI.UnauthorizedError}
42
+ * @throws {@link MarkupAI.ForbiddenError}
41
43
  * @throws {@link MarkupAI.ContentTooLargeError}
42
44
  * @throws {@link MarkupAI.UnprocessableEntityError}
43
45
  * @throws {@link MarkupAI.InternalServerError}
@@ -45,18 +47,19 @@ export declare class StyleRewrites {
45
47
  * @example
46
48
  * await client.styleRewrites.createStyleRewrite(fs.createReadStream("/path/to/your/file"), {
47
49
  * dialect: "american_english",
48
- * tone: "academic",
49
50
  * style_guide: "style_guide"
50
51
  * })
51
52
  */
52
- createStyleRewrite(file_upload: File | fs.ReadStream | Blob, request: MarkupAI.StyleRewritesCreateStyleRewriteRequest, requestOptions?: StyleRewrites.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
53
+ createStyleRewrite(file_upload: File | fs.ReadStream | Blob, request: MarkupAI.CreateStyleRewriteV1StyleRewritesPostRequest, requestOptions?: StyleRewrites.RequestOptions): core.HttpResponsePromise<MarkupAI.WorkflowResponse>;
53
54
  private __createStyleRewrite;
54
55
  /**
55
- * Retrieve the results of a rewrite workflow. Returns `running` or `complete` status.
56
+ * Retrieve rewrite results.
56
57
  *
57
58
  * @param {string} workflowId
58
59
  * @param {StyleRewrites.RequestOptions} requestOptions - Request-specific configuration.
59
60
  *
61
+ * @throws {@link MarkupAI.UnauthorizedError}
62
+ * @throws {@link MarkupAI.ForbiddenError}
60
63
  * @throws {@link MarkupAI.NotFoundError}
61
64
  * @throws {@link MarkupAI.UnprocessableEntityError}
62
65
  * @throws {@link MarkupAI.InternalServerError}