@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
@@ -62,12 +62,14 @@ class StyleSuggestions {
62
62
  this._options = _options;
63
63
  }
64
64
  /**
65
- * Start a style and brand suggestion workflow. Returns a workflow ID to use for polling results.
65
+ * Get suggested corrections for text.
66
66
  *
67
67
  * @param {File | fs.ReadStream | Blob} file_upload
68
- * @param {MarkupAI.StyleSuggestionsCreateStyleSuggestionRequest} request
68
+ * @param {MarkupAI.CreateStyleSuggestionV1StyleSuggestionsPostRequest} request
69
69
  * @param {StyleSuggestions.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 StyleSuggestions {
75
77
  * @example
76
78
  * await client.styleSuggestions.createStyleSuggestion(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 StyleSuggestions {
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/suggestions"),
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/suggestions"),
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 StyleSuggestions {
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 StyleSuggestions {
142
149
  });
143
150
  }
144
151
  /**
145
- * Retrieve the results of a style and brand suggestion workflow. Returns `running` or `complete` status.
152
+ * Retrieve suggestion results.
146
153
  *
147
154
  * @param {string} workflowId
148
155
  * @param {StyleSuggestions.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 StyleSuggestions {
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/suggestions/${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/suggestions/${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 StyleSuggestions {
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:
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as MarkupAI from "../../../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * dialect: "american_english",
9
+ * style_guide: "style_guide"
10
+ * }
11
+ */
12
+ export interface CreateStyleSuggestionV1StyleSuggestionsPostRequest {
13
+ /** The language variant you'd like us to use for analysis. Choose from American English, British English, or other supported dialects. */
14
+ dialect: MarkupAI.Dialects;
15
+ /** The tone variation you're aiming for. Options include formal, academic, casual, and other tone variations to match your content goals. */
16
+ tone?: MarkupAI.Tones;
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`. */
18
+ style_guide: string;
19
+ /** A URL that results will be POSTed to once the process completes. */
20
+ webhook_url?: string;
21
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1 @@
1
- export { type StyleSuggestionsCreateStyleSuggestionRequest } from "./StyleSuggestionsCreateStyleSuggestionRequest";
1
+ export { type CreateStyleSuggestionV1StyleSuggestionsPostRequest } from "./CreateStyleSuggestionV1StyleSuggestionsPostRequest";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as MarkupAI from "../index";
5
+ export interface AnalysisScore {
6
+ clarity?: MarkupAI.ClarityScore;
7
+ tone?: MarkupAI.ToneScore;
8
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type ClarityCategory = "clarity";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,13 +2,11 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface ClarityScore {
5
- average_sentence_length?: number;
6
- flesch_kincaid_grade?: number;
7
- flesch_reading_ease?: number;
8
- lexical_diversity?: number;
9
5
  score?: number;
6
+ flesch_reading_ease?: number;
10
7
  sentence_complexity?: number;
11
- sentence_count?: number;
12
8
  vocabulary_complexity?: number;
9
+ sentence_count?: number;
13
10
  word_count?: number;
11
+ average_sentence_length?: number;
14
12
  }
@@ -4,7 +4,7 @@
4
4
  export interface ErrorResponse {
5
5
  /** A description of the error that occurred. */
6
6
  detail: string;
7
- /** the HTTP status code generated by the server for this issue */
7
+ /** The HTTP status code generated by the server for this issue */
8
8
  status: number;
9
9
  /** A unique ID associated with the HTTP request. */
10
10
  request_id: string;
@@ -1,12 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type IssueCategory = "grammar" | "sentence_length" | "sentence_structure" | "simple_vocab" | "style_guide" | "terminology" | "tone";
4
+ export type IssueCategory = "clarity" | "grammar" | "style_guide" | "terminology" | "tone";
5
5
  export declare const IssueCategory: {
6
+ readonly Clarity: "clarity";
6
7
  readonly Grammar: "grammar";
7
- readonly SentenceLength: "sentence_length";
8
- readonly SentenceStructure: "sentence_structure";
9
- readonly SimpleVocab: "simple_vocab";
10
8
  readonly StyleGuide: "style_guide";
11
9
  readonly Terminology: "terminology";
12
10
  readonly Tone: "tone";
@@ -5,10 +5,8 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.IssueCategory = void 0;
7
7
  exports.IssueCategory = {
8
+ Clarity: "clarity",
8
9
  Grammar: "grammar",
9
- SentenceLength: "sentence_length",
10
- SentenceStructure: "sentence_structure",
11
- SimpleVocab: "simple_vocab",
12
10
  StyleGuide: "style_guide",
13
11
  Terminology: "terminology",
14
12
  Tone: "tone",
@@ -1,6 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as MarkupAI from "../index";
4
5
  export interface QualityScore {
5
6
  score?: number;
7
+ grammar?: MarkupAI.GrammarScore;
8
+ style_guide?: MarkupAI.StyleGuideScore;
9
+ terminology?: MarkupAI.TerminologyScore;
6
10
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as MarkupAI from "../index";
5
5
  export interface RewriteResponse {
6
- workflow_id?: string;
6
+ workflow_id: string;
7
7
  status?: MarkupAI.WorkflowStatus;
8
8
  scores?: MarkupAI.ScoreOutput;
9
9
  issues?: MarkupAI.Suggestion[];
@@ -4,9 +4,5 @@
4
4
  import * as MarkupAI from "../index";
5
5
  export interface ScoreOutput {
6
6
  quality?: MarkupAI.QualityScore;
7
- clarity?: MarkupAI.ClarityScore;
8
- grammar?: MarkupAI.GrammarScore;
9
- style_guide?: MarkupAI.StyleGuideScore;
10
- tone?: MarkupAI.ToneScore;
11
- terminology?: MarkupAI.TerminologyScore;
7
+ analysis?: MarkupAI.AnalysisScore;
12
8
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as MarkupAI from "../index";
5
5
  export interface StyleCheckResponse {
6
- workflow_id?: string;
6
+ workflow_id: string;
7
7
  status?: MarkupAI.WorkflowStatus;
8
8
  scores?: MarkupAI.ScoreOutput;
9
9
  issues?: MarkupAI.Issue[];
@@ -5,4 +5,4 @@ import * as MarkupAI from "../index";
5
5
  /**
6
6
  * The sub-category of the change
7
7
  */
8
- export type Subcategory = MarkupAI.GrammarCategory | MarkupAI.SimpleVocabCategory | MarkupAI.SentenceStructureCategory | MarkupAI.SentenceLengthCategory | MarkupAI.ToneCategory | MarkupAI.StyleGuideCategory | MarkupAI.TermReplaceCategory;
8
+ export type Subcategory = MarkupAI.GrammarCategory | MarkupAI.SimpleVocabCategory | MarkupAI.SentenceStructureCategory | MarkupAI.SentenceLengthCategory | MarkupAI.ToneCategory | MarkupAI.StyleGuideCategory | MarkupAI.TermReplaceCategory | MarkupAI.ClarityCategory;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as MarkupAI from "../index";
5
5
  export interface SuggestionResponse {
6
- workflow_id?: string;
6
+ workflow_id: string;
7
7
  status?: MarkupAI.WorkflowStatus;
8
8
  scores?: MarkupAI.ScoreOutput;
9
9
  issues?: MarkupAI.Suggestion[];
@@ -5,8 +5,6 @@ export interface ToneScore {
5
5
  score?: number;
6
6
  informality?: number;
7
7
  liveliness?: number;
8
- target_informality?: number;
9
- target_liveliness?: number;
10
- informality_tolerance?: number;
11
- liveliness_tolerance?: number;
8
+ informality_alignment?: number;
9
+ liveliness_alignment?: number;
12
10
  }
@@ -1,4 +1,6 @@
1
+ export * from "./AnalysisScore";
1
2
  export * from "./CheckOptions";
3
+ export * from "./ClarityCategory";
2
4
  export * from "./ClarityScore";
3
5
  export * from "./Dialects";
4
6
  export * from "./ErrorResponse";
@@ -14,7 +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("./AnalysisScore"), exports);
17
18
  __exportStar(require("./CheckOptions"), exports);
19
+ __exportStar(require("./ClarityCategory"), exports);
18
20
  __exportStar(require("./ClarityScore"), exports);
19
21
  __exportStar(require("./Dialects"), exports);
20
22
  __exportStar(require("./ErrorResponse"), exports);
@@ -2,6 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export declare const MarkupAIEnvironment: {
5
- readonly Production: "https://app.acrolinx.cloud";
5
+ readonly Default: "https://api.markup.ai";
6
6
  };
7
- export type MarkupAIEnvironment = typeof MarkupAIEnvironment.Production;
7
+ export type MarkupAIEnvironment = typeof MarkupAIEnvironment.Default;
@@ -5,5 +5,5 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.MarkupAIEnvironment = void 0;
7
7
  exports.MarkupAIEnvironment = {
8
- Production: "https://app.acrolinx.cloud",
8
+ Default: "https://api.markup.ai",
9
9
  };
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.6";
1
+ export declare const SDK_VERSION = "0.1.1";
package/dist/version.js CHANGED
@@ -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 = "0.0.6";
4
+ exports.SDK_VERSION = "0.1.1";
package/environments.d.ts CHANGED
@@ -2,6 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export declare const MarkupAIEnvironment: {
5
- readonly Production: "https://app.acrolinx.cloud";
5
+ readonly Default: "https://api.markup.ai";
6
6
  };
7
- export type MarkupAIEnvironment = typeof MarkupAIEnvironment.Production;
7
+ export type MarkupAIEnvironment = typeof MarkupAIEnvironment.Default;
package/environments.js CHANGED
@@ -5,5 +5,5 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.MarkupAIEnvironment = void 0;
7
7
  exports.MarkupAIEnvironment = {
8
- Production: "https://app.acrolinx.cloud",
8
+ Default: "https://api.markup.ai",
9
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markupai/api",
3
- "version": "0.0.6",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
5
  "repository": "https://github.com/markupai/markup-ai-typescript-sdk",
6
6
  "license": "Apache-2.0",
package/reference.md CHANGED
@@ -85,7 +85,9 @@ Create a new style guide that can be used in checks, suggestions, and rewrites.
85
85
  <dd>
86
86
 
87
87
  ```typescript
88
- await client.styleGuides.createStyleGuide(fs.createReadStream("/path/to/your/file"), {});
88
+ await client.styleGuides.createStyleGuide(fs.createReadStream("/path/to/your/file"), {
89
+ name: "name",
90
+ });
89
91
  ```
90
92
 
91
93
  </dd>
@@ -308,7 +310,7 @@ await client.styleGuides.updateStyleGuide("style_guide_id", {
308
310
  <dl>
309
311
  <dd>
310
312
 
311
- **request:** `MarkupAI.BodyStyleGuidesUpdateStyleGuide`
313
+ **request:** `MarkupAI.BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch`
312
314
 
313
315
  </dd>
314
316
  </dl>
@@ -341,7 +343,7 @@ await client.styleGuides.updateStyleGuide("style_guide_id", {
341
343
  <dl>
342
344
  <dd>
343
345
 
344
- Start a style and brand check workflow. Returns a workflow ID to use for polling results.
346
+ Analyze text for grammar, style, and clarity issues.
345
347
 
346
348
  </dd>
347
349
  </dl>
@@ -359,7 +361,6 @@ Start a style and brand check workflow. Returns a workflow ID to use for polling
359
361
  ```typescript
360
362
  await client.styleChecks.createStyleCheck(fs.createReadStream("/path/to/your/file"), {
361
363
  dialect: "american_english",
362
- tone: "academic",
363
364
  style_guide: "style_guide",
364
365
  });
365
366
  ```
@@ -385,7 +386,7 @@ await client.styleChecks.createStyleCheck(fs.createReadStream("/path/to/your/fil
385
386
  <dl>
386
387
  <dd>
387
388
 
388
- **request:** `MarkupAI.StyleChecksCreateStyleCheckRequest`
389
+ **request:** `MarkupAI.CreateStyleCheckV1StyleChecksPostRequest`
389
390
 
390
391
  </dd>
391
392
  </dl>
@@ -416,7 +417,7 @@ await client.styleChecks.createStyleCheck(fs.createReadStream("/path/to/your/fil
416
417
  <dl>
417
418
  <dd>
418
419
 
419
- Retrieve the results of a style and brand check workflow. Returns `running` or `complete` status.
420
+ Retrieve style check results.
420
421
 
421
422
  </dd>
422
423
  </dl>
@@ -481,7 +482,7 @@ await client.styleChecks.getStyleCheck("workflow_id");
481
482
  <dl>
482
483
  <dd>
483
484
 
484
- Start a style and brand suggestion workflow. Returns a workflow ID to use for polling results.
485
+ Get suggested corrections for text.
485
486
 
486
487
  </dd>
487
488
  </dl>
@@ -499,7 +500,6 @@ Start a style and brand suggestion workflow. Returns a workflow ID to use for po
499
500
  ```typescript
500
501
  await client.styleSuggestions.createStyleSuggestion(fs.createReadStream("/path/to/your/file"), {
501
502
  dialect: "american_english",
502
- tone: "academic",
503
503
  style_guide: "style_guide",
504
504
  });
505
505
  ```
@@ -525,7 +525,7 @@ await client.styleSuggestions.createStyleSuggestion(fs.createReadStream("/path/t
525
525
  <dl>
526
526
  <dd>
527
527
 
528
- **request:** `MarkupAI.StyleSuggestionsCreateStyleSuggestionRequest`
528
+ **request:** `MarkupAI.CreateStyleSuggestionV1StyleSuggestionsPostRequest`
529
529
 
530
530
  </dd>
531
531
  </dl>
@@ -556,7 +556,7 @@ await client.styleSuggestions.createStyleSuggestion(fs.createReadStream("/path/t
556
556
  <dl>
557
557
  <dd>
558
558
 
559
- Retrieve the results of a style and brand suggestion workflow. Returns `running` or `complete` status.
559
+ Retrieve suggestion results.
560
560
 
561
561
  </dd>
562
562
  </dl>
@@ -621,7 +621,7 @@ await client.styleSuggestions.getStyleSuggestion("workflow_id");
621
621
  <dl>
622
622
  <dd>
623
623
 
624
- Start a style and brand rewrite workflow. Returns a workflow ID to use for polling results.
624
+ Rewrite text with style corrections applied.
625
625
 
626
626
  </dd>
627
627
  </dl>
@@ -639,7 +639,6 @@ Start a style and brand rewrite workflow. Returns a workflow ID to use for polli
639
639
  ```typescript
640
640
  await client.styleRewrites.createStyleRewrite(fs.createReadStream("/path/to/your/file"), {
641
641
  dialect: "american_english",
642
- tone: "academic",
643
642
  style_guide: "style_guide",
644
643
  });
645
644
  ```
@@ -665,7 +664,7 @@ await client.styleRewrites.createStyleRewrite(fs.createReadStream("/path/to/your
665
664
  <dl>
666
665
  <dd>
667
666
 
668
- **request:** `MarkupAI.StyleRewritesCreateStyleRewriteRequest`
667
+ **request:** `MarkupAI.CreateStyleRewriteV1StyleRewritesPostRequest`
669
668
 
670
669
  </dd>
671
670
  </dl>
@@ -696,7 +695,7 @@ await client.styleRewrites.createStyleRewrite(fs.createReadStream("/path/to/your
696
695
  <dl>
697
696
  <dd>
698
697
 
699
- Retrieve the results of a rewrite workflow. Returns `running` or `complete` status.
698
+ Retrieve rewrite results.
700
699
 
701
700
  </dd>
702
701
  </dl>
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.6";
1
+ export declare const SDK_VERSION = "0.1.1";
package/version.js CHANGED
@@ -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 = "0.0.6";
4
+ exports.SDK_VERSION = "0.1.1";
@@ -1,22 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as MarkupAI from "../../../../index";
5
- /**
6
- * @example
7
- * {
8
- * dialect: "american_english",
9
- * tone: "academic",
10
- * style_guide: "style_guide"
11
- * }
12
- */
13
- export interface StyleSuggestionsCreateStyleSuggestionRequest {
14
- /** The language variant you'd like us to use for analysis. Choose from American English, British English, or other supported dialects. */
15
- dialect: MarkupAI.Dialects;
16
- /** 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;
18
- /** 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
- style_guide: string;
20
- /** A URL that results will be POSTed to once the process completes. */
21
- webhook_url?: string;
22
- }
@@ -1,22 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as MarkupAI from "../../../../index";
5
- /**
6
- * @example
7
- * {
8
- * dialect: "american_english",
9
- * tone: "academic",
10
- * style_guide: "style_guide"
11
- * }
12
- */
13
- export interface StyleSuggestionsCreateStyleSuggestionRequest {
14
- /** The language variant you'd like us to use for analysis. Choose from American English, British English, or other supported dialects. */
15
- dialect: MarkupAI.Dialects;
16
- /** 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;
18
- /** 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
- style_guide: string;
20
- /** A URL that results will be POSTed to once the process completes. */
21
- webhook_url?: string;
22
- }