@markupai/api 1.2.0 → 1.3.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 (149) hide show
  1. package/README.md +0 -18
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +7 -2
  4. package/dist/cjs/api/resources/index.d.ts +2 -0
  5. package/dist/cjs/api/resources/index.js +3 -1
  6. package/dist/cjs/api/resources/styleGuides/client/Client.d.ts +4 -6
  7. package/dist/cjs/api/resources/styleGuides/client/Client.js +11 -8
  8. package/dist/cjs/api/resources/styleGuides/client/requests/BodyStyleGuidesUpdateStyleGuide.d.ts +13 -0
  9. package/dist/cjs/api/resources/styleGuides/client/requests/StyleGuideRequestBody.d.ts +2 -0
  10. package/dist/cjs/api/resources/styleGuides/client/requests/index.d.ts +1 -1
  11. package/dist/cjs/api/resources/terminology/client/Client.d.ts +333 -0
  12. package/dist/cjs/api/resources/terminology/client/Client.js +1314 -0
  13. package/dist/cjs/api/resources/terminology/client/index.d.ts +2 -0
  14. package/dist/cjs/api/resources/terminology/client/index.js +17 -0
  15. package/dist/cjs/api/resources/terminology/client/requests/BodyTerminologyImportTerminology.d.ts +17 -0
  16. package/dist/cjs/api/resources/terminology/client/requests/BodyTerminologyImportTerminology.js +5 -0
  17. package/dist/cjs/api/resources/{styleGuides/client/requests/BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch.d.ts → terminology/client/requests/DomainCreateRequest.d.ts} +2 -2
  18. package/dist/cjs/api/resources/terminology/client/requests/DomainCreateRequest.js +5 -0
  19. package/dist/cjs/api/resources/terminology/client/requests/DomainUpdateRequest.d.ts +11 -0
  20. package/dist/cjs/api/resources/terminology/client/requests/DomainUpdateRequest.js +5 -0
  21. package/dist/cjs/api/resources/terminology/client/requests/TermSetCreateRequest.d.ts +15 -0
  22. package/dist/cjs/api/resources/terminology/client/requests/TermSetCreateRequest.js +5 -0
  23. package/dist/cjs/api/resources/terminology/client/requests/TermSetUpdateRequest.d.ts +11 -0
  24. package/dist/cjs/api/resources/terminology/client/requests/TermSetUpdateRequest.js +5 -0
  25. package/dist/cjs/api/resources/terminology/client/requests/TermUpdateRequest.d.ts +15 -0
  26. package/dist/cjs/api/resources/terminology/client/requests/TermUpdateRequest.js +5 -0
  27. package/dist/cjs/api/resources/terminology/client/requests/TerminologyListDomainsRequest.d.ts +19 -0
  28. package/dist/cjs/api/resources/terminology/client/requests/TerminologyListDomainsRequest.js +5 -0
  29. package/dist/cjs/api/resources/terminology/client/requests/TerminologyListTermSetsRequest.d.ts +21 -0
  30. package/dist/cjs/api/resources/terminology/client/requests/TerminologyListTermSetsRequest.js +5 -0
  31. package/dist/cjs/api/resources/terminology/client/requests/TerminologySearchTerminologyRequest.d.ts +14 -0
  32. package/dist/cjs/api/resources/terminology/client/requests/TerminologySearchTerminologyRequest.js +5 -0
  33. package/dist/cjs/api/resources/terminology/client/requests/index.d.ts +9 -0
  34. package/dist/cjs/api/resources/terminology/client/requests/index.js +2 -0
  35. package/dist/cjs/api/resources/terminology/index.d.ts +1 -0
  36. package/dist/cjs/api/resources/terminology/index.js +17 -0
  37. package/dist/cjs/api/types/ConsistencyCategory.d.ts +1 -4
  38. package/dist/cjs/api/types/ConsistencyCategory.js +0 -3
  39. package/dist/cjs/api/types/DomainResponse.d.ts +13 -0
  40. package/dist/cjs/api/types/DomainResponse.js +5 -0
  41. package/dist/cjs/api/types/DomainSummary.d.ts +7 -0
  42. package/dist/cjs/api/types/DomainSummary.js +5 -0
  43. package/dist/cjs/api/types/ImportSummary.d.ts +12 -0
  44. package/dist/cjs/api/types/ImportSummary.js +5 -0
  45. package/dist/cjs/api/types/MatchedTerm.d.ts +7 -0
  46. package/dist/cjs/api/types/MatchedTerm.js +5 -0
  47. package/dist/cjs/api/types/PaginatedDomainsResponse.d.ts +11 -0
  48. package/dist/cjs/api/types/PaginatedDomainsResponse.js +5 -0
  49. package/dist/cjs/api/types/PaginatedTermSetsResponse.d.ts +15 -0
  50. package/dist/cjs/api/types/PaginatedTermSetsResponse.js +5 -0
  51. package/dist/cjs/api/types/StyleGuideResponse.d.ts +2 -0
  52. package/dist/cjs/api/types/TermCreateRequest.d.ts +11 -0
  53. package/dist/cjs/api/types/TermCreateRequest.js +5 -0
  54. package/dist/cjs/api/types/TermDetail.d.ts +16 -0
  55. package/dist/cjs/api/types/TermDetail.js +5 -0
  56. package/dist/cjs/api/types/TermItem.d.ts +7 -0
  57. package/dist/cjs/api/types/TermItem.js +5 -0
  58. package/dist/cjs/api/types/TermResponse.d.ts +16 -0
  59. package/dist/cjs/api/types/TermResponse.js +5 -0
  60. package/dist/cjs/api/types/TermSetResponse.d.ts +14 -0
  61. package/dist/cjs/api/types/TermSetResponse.js +5 -0
  62. package/dist/cjs/api/types/TermSetResult.d.ts +9 -0
  63. package/dist/cjs/api/types/TermSetResult.js +5 -0
  64. package/dist/cjs/api/types/TermSetWithTerms.d.ts +17 -0
  65. package/dist/cjs/api/types/TermSetWithTerms.js +5 -0
  66. package/dist/cjs/api/types/TermType.d.ts +12 -0
  67. package/dist/cjs/api/types/TermType.js +11 -0
  68. package/dist/cjs/api/types/TerminologySearchResponse.d.ts +7 -0
  69. package/dist/cjs/api/types/TerminologySearchResponse.js +5 -0
  70. package/dist/cjs/api/types/index.d.ts +15 -0
  71. package/dist/cjs/api/types/index.js +15 -0
  72. package/dist/cjs/version.d.ts +1 -1
  73. package/dist/cjs/version.js +1 -1
  74. package/dist/esm/Client.d.mts +3 -0
  75. package/dist/esm/Client.mjs +7 -2
  76. package/dist/esm/api/resources/index.d.mts +2 -0
  77. package/dist/esm/api/resources/index.mjs +2 -0
  78. package/dist/esm/api/resources/styleGuides/client/Client.d.mts +4 -6
  79. package/dist/esm/api/resources/styleGuides/client/Client.mjs +11 -8
  80. package/dist/esm/api/resources/styleGuides/client/requests/BodyStyleGuidesUpdateStyleGuide.d.mts +13 -0
  81. package/dist/esm/api/resources/styleGuides/client/requests/StyleGuideRequestBody.d.mts +2 -0
  82. package/dist/esm/api/resources/styleGuides/client/requests/index.d.mts +1 -1
  83. package/dist/esm/api/resources/terminology/client/Client.d.mts +333 -0
  84. package/dist/esm/api/resources/terminology/client/Client.mjs +1277 -0
  85. package/dist/esm/api/resources/terminology/client/index.d.mts +2 -0
  86. package/dist/esm/api/resources/terminology/client/index.mjs +1 -0
  87. package/dist/esm/api/resources/terminology/client/requests/BodyTerminologyImportTerminology.d.mts +17 -0
  88. package/dist/esm/api/resources/terminology/client/requests/BodyTerminologyImportTerminology.mjs +4 -0
  89. package/dist/esm/api/resources/{styleGuides/client/requests/BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch.d.mts → terminology/client/requests/DomainCreateRequest.d.mts} +2 -2
  90. package/dist/esm/api/resources/terminology/client/requests/DomainCreateRequest.mjs +4 -0
  91. package/dist/esm/api/resources/terminology/client/requests/DomainUpdateRequest.d.mts +11 -0
  92. package/dist/esm/api/resources/terminology/client/requests/DomainUpdateRequest.mjs +4 -0
  93. package/dist/esm/api/resources/terminology/client/requests/TermSetCreateRequest.d.mts +15 -0
  94. package/dist/esm/api/resources/terminology/client/requests/TermSetCreateRequest.mjs +4 -0
  95. package/dist/esm/api/resources/terminology/client/requests/TermSetUpdateRequest.d.mts +11 -0
  96. package/dist/esm/api/resources/terminology/client/requests/TermSetUpdateRequest.mjs +4 -0
  97. package/dist/esm/api/resources/terminology/client/requests/TermUpdateRequest.d.mts +15 -0
  98. package/dist/esm/api/resources/terminology/client/requests/TermUpdateRequest.mjs +4 -0
  99. package/dist/esm/api/resources/terminology/client/requests/TerminologyListDomainsRequest.d.mts +19 -0
  100. package/dist/esm/api/resources/terminology/client/requests/TerminologyListDomainsRequest.mjs +4 -0
  101. package/dist/esm/api/resources/terminology/client/requests/TerminologyListTermSetsRequest.d.mts +21 -0
  102. package/dist/esm/api/resources/terminology/client/requests/TerminologyListTermSetsRequest.mjs +4 -0
  103. package/dist/esm/api/resources/terminology/client/requests/TerminologySearchTerminologyRequest.d.mts +14 -0
  104. package/dist/esm/api/resources/terminology/client/requests/TerminologySearchTerminologyRequest.mjs +4 -0
  105. package/dist/esm/api/resources/terminology/client/requests/index.d.mts +9 -0
  106. package/dist/esm/api/resources/terminology/client/requests/index.mjs +1 -0
  107. package/dist/esm/api/resources/terminology/index.d.mts +1 -0
  108. package/dist/esm/api/resources/terminology/index.mjs +1 -0
  109. package/dist/esm/api/types/ConsistencyCategory.d.mts +1 -4
  110. package/dist/esm/api/types/ConsistencyCategory.mjs +0 -3
  111. package/dist/esm/api/types/DomainResponse.d.mts +13 -0
  112. package/dist/esm/api/types/DomainResponse.mjs +4 -0
  113. package/dist/esm/api/types/DomainSummary.d.mts +7 -0
  114. package/dist/esm/api/types/DomainSummary.mjs +4 -0
  115. package/dist/esm/api/types/ImportSummary.d.mts +12 -0
  116. package/dist/esm/api/types/ImportSummary.mjs +4 -0
  117. package/dist/esm/api/types/MatchedTerm.d.mts +7 -0
  118. package/dist/esm/api/types/MatchedTerm.mjs +4 -0
  119. package/dist/esm/api/types/PaginatedDomainsResponse.d.mts +11 -0
  120. package/dist/esm/api/types/PaginatedDomainsResponse.mjs +4 -0
  121. package/dist/esm/api/types/PaginatedTermSetsResponse.d.mts +15 -0
  122. package/dist/esm/api/types/PaginatedTermSetsResponse.mjs +4 -0
  123. package/dist/esm/api/types/StyleGuideResponse.d.mts +2 -0
  124. package/dist/esm/api/types/TermCreateRequest.d.mts +11 -0
  125. package/dist/esm/api/types/TermCreateRequest.mjs +4 -0
  126. package/dist/esm/api/types/TermDetail.d.mts +16 -0
  127. package/dist/esm/api/types/TermDetail.mjs +4 -0
  128. package/dist/esm/api/types/TermItem.d.mts +7 -0
  129. package/dist/esm/api/types/TermItem.mjs +4 -0
  130. package/dist/esm/api/types/TermResponse.d.mts +16 -0
  131. package/dist/esm/api/types/TermResponse.mjs +4 -0
  132. package/dist/esm/api/types/TermSetResponse.d.mts +14 -0
  133. package/dist/esm/api/types/TermSetResponse.mjs +4 -0
  134. package/dist/esm/api/types/TermSetResult.d.mts +9 -0
  135. package/dist/esm/api/types/TermSetResult.mjs +4 -0
  136. package/dist/esm/api/types/TermSetWithTerms.d.mts +17 -0
  137. package/dist/esm/api/types/TermSetWithTerms.mjs +4 -0
  138. package/dist/esm/api/types/TermType.d.mts +12 -0
  139. package/dist/esm/api/types/TermType.mjs +8 -0
  140. package/dist/esm/api/types/TerminologySearchResponse.d.mts +7 -0
  141. package/dist/esm/api/types/TerminologySearchResponse.mjs +4 -0
  142. package/dist/esm/api/types/index.d.mts +15 -0
  143. package/dist/esm/api/types/index.mjs +15 -0
  144. package/dist/esm/version.d.mts +1 -1
  145. package/dist/esm/version.mjs +1 -1
  146. package/package.json +1 -1
  147. package/reference.md +998 -5
  148. /package/dist/cjs/api/resources/styleGuides/client/requests/{BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch.js → BodyStyleGuidesUpdateStyleGuide.js} +0 -0
  149. /package/dist/esm/api/resources/styleGuides/client/requests/{BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch.mjs → BodyStyleGuidesUpdateStyleGuide.mjs} +0 -0
package/README.md CHANGED
@@ -7,24 +7,6 @@ The official Markup AI SDK for interacting with the Markup AI API.
7
7
 
8
8
  ## Table of Contents
9
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
10
  - [Installation](#installation)
29
11
  - [Reference](#reference)
30
12
  - [Usage](#usage)
@@ -7,6 +7,7 @@ import { StyleGuides } from "./api/resources/styleGuides/client/Client.js";
7
7
  import { StyleChecks } from "./api/resources/styleChecks/client/Client.js";
8
8
  import { StyleSuggestions } from "./api/resources/styleSuggestions/client/Client.js";
9
9
  import { StyleRewrites } from "./api/resources/styleRewrites/client/Client.js";
10
+ import { Terminology } from "./api/resources/terminology/client/Client.js";
10
11
  export declare namespace MarkupAIClient {
11
12
  interface Options {
12
13
  environment?: core.Supplier<environments.MarkupAIEnvironment | string>;
@@ -36,9 +37,11 @@ export declare class MarkupAIClient {
36
37
  protected _styleChecks: StyleChecks | undefined;
37
38
  protected _styleSuggestions: StyleSuggestions | undefined;
38
39
  protected _styleRewrites: StyleRewrites | undefined;
40
+ protected _terminology: Terminology | undefined;
39
41
  constructor(_options: MarkupAIClient.Options);
40
42
  get styleGuides(): StyleGuides;
41
43
  get styleChecks(): StyleChecks;
42
44
  get styleSuggestions(): StyleSuggestions;
43
45
  get styleRewrites(): StyleRewrites;
46
+ get terminology(): Terminology;
44
47
  }
@@ -43,13 +43,14 @@ const Client_js_1 = require("./api/resources/styleGuides/client/Client.js");
43
43
  const Client_js_2 = require("./api/resources/styleChecks/client/Client.js");
44
44
  const Client_js_3 = require("./api/resources/styleSuggestions/client/Client.js");
45
45
  const Client_js_4 = require("./api/resources/styleRewrites/client/Client.js");
46
+ const Client_js_5 = require("./api/resources/terminology/client/Client.js");
46
47
  class MarkupAIClient {
47
48
  constructor(_options) {
48
49
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
49
50
  "X-Fern-Language": "JavaScript",
50
51
  "X-Fern-SDK-Name": "@markupai/api",
51
- "X-Fern-SDK-Version": "1.2.0",
52
- "User-Agent": "@markupai/api/1.2.0",
52
+ "X-Fern-SDK-Version": "1.3.0",
53
+ "User-Agent": "@markupai/api/1.3.0",
53
54
  "X-Fern-Runtime": core.RUNTIME.type,
54
55
  "X-Fern-Runtime-Version": core.RUNTIME.version,
55
56
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -70,5 +71,9 @@ class MarkupAIClient {
70
71
  var _a;
71
72
  return ((_a = this._styleRewrites) !== null && _a !== void 0 ? _a : (this._styleRewrites = new Client_js_4.StyleRewrites(this._options)));
72
73
  }
74
+ get terminology() {
75
+ var _a;
76
+ return ((_a = this._terminology) !== null && _a !== void 0 ? _a : (this._terminology = new Client_js_5.Terminology(this._options)));
77
+ }
73
78
  }
74
79
  exports.MarkupAIClient = MarkupAIClient;
@@ -2,7 +2,9 @@ export * as styleGuides from "./styleGuides/index.js";
2
2
  export * as styleChecks from "./styleChecks/index.js";
3
3
  export * as styleSuggestions from "./styleSuggestions/index.js";
4
4
  export * as styleRewrites from "./styleRewrites/index.js";
5
+ export * as terminology from "./terminology/index.js";
5
6
  export * from "./styleGuides/client/requests/index.js";
6
7
  export * from "./styleChecks/client/requests/index.js";
7
8
  export * from "./styleSuggestions/client/requests/index.js";
8
9
  export * from "./styleRewrites/client/requests/index.js";
10
+ export * from "./terminology/client/requests/index.js";
@@ -36,12 +36,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.styleRewrites = exports.styleSuggestions = exports.styleChecks = exports.styleGuides = void 0;
39
+ exports.terminology = exports.styleRewrites = exports.styleSuggestions = exports.styleChecks = exports.styleGuides = void 0;
40
40
  exports.styleGuides = __importStar(require("./styleGuides/index.js"));
41
41
  exports.styleChecks = __importStar(require("./styleChecks/index.js"));
42
42
  exports.styleSuggestions = __importStar(require("./styleSuggestions/index.js"));
43
43
  exports.styleRewrites = __importStar(require("./styleRewrites/index.js"));
44
+ exports.terminology = __importStar(require("./terminology/index.js"));
44
45
  __exportStar(require("./styleGuides/client/requests/index.js"), exports);
45
46
  __exportStar(require("./styleChecks/client/requests/index.js"), exports);
46
47
  __exportStar(require("./styleSuggestions/client/requests/index.js"), exports);
47
48
  __exportStar(require("./styleRewrites/client/requests/index.js"), exports);
49
+ __exportStar(require("./terminology/client/requests/index.js"), exports);
@@ -105,10 +105,10 @@ export declare class StyleGuides {
105
105
  deleteStyleGuide(styleGuideId: string, requestOptions?: StyleGuides.RequestOptions): core.HttpResponsePromise<void>;
106
106
  private __deleteStyleGuide;
107
107
  /**
108
- * Update the name of an existing style guide.
108
+ * Update the name and/or terminology domain IDs of an existing style guide.
109
109
  *
110
110
  * @param {string} styleGuideId - The ID of the style guide.
111
- * @param {MarkupAI.BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch} request
111
+ * @param {MarkupAI.BodyStyleGuidesUpdateStyleGuide} request
112
112
  * @param {StyleGuides.RequestOptions} requestOptions - Request-specific configuration.
113
113
  *
114
114
  * @throws {@link MarkupAI.UnauthorizedError}
@@ -119,11 +119,9 @@ export declare class StyleGuides {
119
119
  * @throws {@link MarkupAI.InternalServerError}
120
120
  *
121
121
  * @example
122
- * await client.styleGuides.updateStyleGuide("style_guide_id", {
123
- * name: "name"
124
- * })
122
+ * await client.styleGuides.updateStyleGuide("style_guide_id")
125
123
  */
126
- updateStyleGuide(styleGuideId: string, request: MarkupAI.BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch, requestOptions?: StyleGuides.RequestOptions): core.HttpResponsePromise<MarkupAI.StyleGuideResponse>;
124
+ updateStyleGuide(styleGuideId: string, request?: MarkupAI.BodyStyleGuidesUpdateStyleGuide, requestOptions?: StyleGuides.RequestOptions): core.HttpResponsePromise<MarkupAI.StyleGuideResponse>;
127
125
  private __updateStyleGuide;
128
126
  protected _getAuthorizationHeader(): Promise<string>;
129
127
  }
@@ -157,6 +157,11 @@ class StyleGuides {
157
157
  if (request.base_style_guide != null) {
158
158
  _request.append("base_style_guide", request.base_style_guide);
159
159
  }
160
+ if (request.terminology_domain_ids != null) {
161
+ for (const _item of request.terminology_domain_ids) {
162
+ _request.append("terminology_domain_ids", _item);
163
+ }
164
+ }
160
165
  const _maybeEncodedRequest = yield _request.getRequest();
161
166
  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);
162
167
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -356,10 +361,10 @@ class StyleGuides {
356
361
  });
357
362
  }
358
363
  /**
359
- * Update the name of an existing style guide.
364
+ * Update the name and/or terminology domain IDs of an existing style guide.
360
365
  *
361
366
  * @param {string} styleGuideId - The ID of the style guide.
362
- * @param {MarkupAI.BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch} request
367
+ * @param {MarkupAI.BodyStyleGuidesUpdateStyleGuide} request
363
368
  * @param {StyleGuides.RequestOptions} requestOptions - Request-specific configuration.
364
369
  *
365
370
  * @throws {@link MarkupAI.UnauthorizedError}
@@ -370,15 +375,13 @@ class StyleGuides {
370
375
  * @throws {@link MarkupAI.InternalServerError}
371
376
  *
372
377
  * @example
373
- * await client.styleGuides.updateStyleGuide("style_guide_id", {
374
- * name: "name"
375
- * })
378
+ * await client.styleGuides.updateStyleGuide("style_guide_id")
376
379
  */
377
- updateStyleGuide(styleGuideId, request, requestOptions) {
380
+ updateStyleGuide(styleGuideId, request = {}, requestOptions) {
378
381
  return core.HttpResponsePromise.fromPromise(this.__updateStyleGuide(styleGuideId, request, requestOptions));
379
382
  }
380
- __updateStyleGuide(styleGuideId, request, requestOptions) {
381
- return __awaiter(this, void 0, void 0, function* () {
383
+ __updateStyleGuide(styleGuideId_1) {
384
+ return __awaiter(this, arguments, void 0, function* (styleGuideId, request = {}, requestOptions) {
382
385
  var _a, _b, _c, _d;
383
386
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
384
387
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface BodyStyleGuidesUpdateStyleGuide {
9
+ /** The name of the style guide. */
10
+ name?: string;
11
+ /** List of domain IDs to filter terminology searches by. NULL or empty list means no filtering. */
12
+ terminology_domain_ids?: string[];
13
+ }
@@ -17,4 +17,6 @@ export interface StyleGuideRequestBody {
17
17
  name: string;
18
18
  /** The base style guide to extend (AP, Chicago, or Microsoft). If not provided, the style guide will be created from scratch. */
19
19
  base_style_guide?: MarkupAI.BaseStyleGuideType;
20
+ /** List of domain IDs to filter terminology searches by. NULL or empty list means no filtering. */
21
+ terminology_domain_ids?: string[];
20
22
  }
@@ -1,2 +1,2 @@
1
1
  export { type StyleGuideRequestBody } from "./StyleGuideRequestBody.js";
2
- export { type BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch } from "./BodyUpdateStyleGuideV1StyleGuidesStyleGuideIdPatch.js";
2
+ export { type BodyStyleGuidesUpdateStyleGuide } from "./BodyStyleGuidesUpdateStyleGuide.js";
@@ -0,0 +1,333 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../environments.js";
5
+ import * as core from "../../../../core/index.js";
6
+ import * as MarkupAI from "../../../index.js";
7
+ export declare namespace Terminology {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.MarkupAIEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
12
+ token: core.Supplier<core.BearerToken>;
13
+ /** Additional headers to include in requests. */
14
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
+ fetcher?: core.FetchFunction;
16
+ }
17
+ interface RequestOptions {
18
+ /** The maximum time to wait for a response in seconds. */
19
+ timeoutInSeconds?: number;
20
+ /** The number of times to retry the request. Defaults to 2. */
21
+ maxRetries?: number;
22
+ /** A hook to abort the request. */
23
+ abortSignal?: AbortSignal;
24
+ /** Additional query string parameters to include in the request. */
25
+ queryParams?: Record<string, unknown>;
26
+ /** Additional headers to include in the request. */
27
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
28
+ }
29
+ }
30
+ /**
31
+ * Manage term sets and terms.
32
+ */
33
+ export declare class Terminology {
34
+ protected readonly _options: Terminology.Options;
35
+ constructor(_options: Terminology.Options);
36
+ /**
37
+ * Exports all term sets, terms and domains to CSV. The exported CSV follows the same format as the CSV import.
38
+ *
39
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
40
+ *
41
+ * @throws {@link MarkupAI.UnauthorizedError}
42
+ * @throws {@link MarkupAI.ForbiddenError}
43
+ * @throws {@link MarkupAI.InternalServerError}
44
+ *
45
+ * @example
46
+ * await client.terminology.exportTerminology()
47
+ */
48
+ exportTerminology(requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<unknown>;
49
+ private __exportTerminology;
50
+ /**
51
+ * Uploads a CSV or ACTIF XML file and imports terminology.
52
+ *
53
+ * **CSV Format Requirements:**
54
+ * - CSV must include columns: Prohibited, Preferred, Context-Dependent, Instructions, Domains
55
+ * - The first row must contain the column headers in the exact same order as shown above
56
+ * - Multiple values within a single cell should be separated by semicolons with a space (e.g., term1; term2; term3)
57
+ * - Empty cells are allowed
58
+ * - The CSV import format is the same as the CSV export format.
59
+ *
60
+ * @param {MarkupAI.BodyTerminologyImportTerminology} request
61
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
62
+ *
63
+ * @throws {@link MarkupAI.UnauthorizedError}
64
+ * @throws {@link MarkupAI.ForbiddenError}
65
+ * @throws {@link MarkupAI.UnprocessableEntityError}
66
+ * @throws {@link MarkupAI.InternalServerError}
67
+ *
68
+ * @example
69
+ * import { createReadStream } from "fs";
70
+ * await client.terminology.importTerminology({
71
+ * file: fs.createReadStream("/path/to/your/file"),
72
+ * delete_existing: true
73
+ * })
74
+ */
75
+ importTerminology(request: MarkupAI.BodyTerminologyImportTerminology, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<MarkupAI.ImportSummary>;
76
+ private __importTerminology;
77
+ /**
78
+ * Searches the text for relevant terminology and returns matched term sets.
79
+ *
80
+ * Term sets are matched if any word sequence (up to 5 words) in the text is similar to one of the terms of the term set.
81
+ * The similarity measure used is a trigram similarity of 0.5 or higher between the word sequence and the term.
82
+ *
83
+ * @param {MarkupAI.TerminologySearchTerminologyRequest} request
84
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
85
+ *
86
+ * @throws {@link MarkupAI.UnauthorizedError}
87
+ * @throws {@link MarkupAI.ForbiddenError}
88
+ * @throws {@link MarkupAI.UnprocessableEntityError}
89
+ * @throws {@link MarkupAI.InternalServerError}
90
+ *
91
+ * @example
92
+ * await client.terminology.searchTerminology({
93
+ * query: "query"
94
+ * })
95
+ */
96
+ searchTerminology(request: MarkupAI.TerminologySearchTerminologyRequest, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<MarkupAI.TerminologySearchResponse>;
97
+ private __searchTerminology;
98
+ /**
99
+ * Get a pageable list of term sets with all their associated terms and domains.
100
+ *
101
+ * The search filter searches the term set instructions and term text fields.
102
+ *
103
+ * @param {MarkupAI.TerminologyListTermSetsRequest} request
104
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
105
+ *
106
+ * @throws {@link MarkupAI.UnauthorizedError}
107
+ * @throws {@link MarkupAI.ForbiddenError}
108
+ * @throws {@link MarkupAI.UnprocessableEntityError}
109
+ * @throws {@link MarkupAI.InternalServerError}
110
+ *
111
+ * @example
112
+ * await client.terminology.listTermSets({
113
+ * page: 1,
114
+ * page_size: 1,
115
+ * search_term: "search_term"
116
+ * })
117
+ */
118
+ listTermSets(request?: MarkupAI.TerminologyListTermSetsRequest, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<MarkupAI.PaginatedTermSetsResponse>;
119
+ private __listTermSets;
120
+ /**
121
+ * Create a new term set. Terms and domains are linked to term sets.
122
+ * The term set instructions text will be used to determine whether a term should be flagged in the text and what the term replacement should be.
123
+ *
124
+ * @param {MarkupAI.TermSetCreateRequest} request
125
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
126
+ *
127
+ * @throws {@link MarkupAI.UnauthorizedError}
128
+ * @throws {@link MarkupAI.ForbiddenError}
129
+ * @throws {@link MarkupAI.UnprocessableEntityError}
130
+ * @throws {@link MarkupAI.InternalServerError}
131
+ *
132
+ * @example
133
+ * await client.terminology.createTermSet({
134
+ * instructions: "instructions"
135
+ * })
136
+ */
137
+ createTermSet(request: MarkupAI.TermSetCreateRequest, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<MarkupAI.TermSetResponse>;
138
+ private __createTermSet;
139
+ /**
140
+ * @param {string} termSetId - UUID of the term set
141
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
142
+ *
143
+ * @throws {@link MarkupAI.UnauthorizedError}
144
+ * @throws {@link MarkupAI.ForbiddenError}
145
+ * @throws {@link MarkupAI.UnprocessableEntityError}
146
+ * @throws {@link MarkupAI.InternalServerError}
147
+ *
148
+ * @example
149
+ * await client.terminology.getTermSet("term_set_id")
150
+ */
151
+ getTermSet(termSetId: string, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<MarkupAI.TermSetWithTerms>;
152
+ private __getTermSet;
153
+ /**
154
+ * @param {string} termSetId - UUID of the term set
155
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
156
+ *
157
+ * @throws {@link MarkupAI.UnauthorizedError}
158
+ * @throws {@link MarkupAI.ForbiddenError}
159
+ * @throws {@link MarkupAI.UnprocessableEntityError}
160
+ * @throws {@link MarkupAI.InternalServerError}
161
+ *
162
+ * @example
163
+ * await client.terminology.deleteTermSet("term_set_id")
164
+ */
165
+ deleteTermSet(termSetId: string, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<void>;
166
+ private __deleteTermSet;
167
+ /**
168
+ * @param {string} termSetId - UUID of the term set
169
+ * @param {MarkupAI.TermSetUpdateRequest} request
170
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
171
+ *
172
+ * @throws {@link MarkupAI.UnauthorizedError}
173
+ * @throws {@link MarkupAI.ForbiddenError}
174
+ * @throws {@link MarkupAI.UnprocessableEntityError}
175
+ * @throws {@link MarkupAI.InternalServerError}
176
+ *
177
+ * @example
178
+ * await client.terminology.updateTermSet("term_set_id")
179
+ */
180
+ updateTermSet(termSetId: string, request?: MarkupAI.TermSetUpdateRequest, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<MarkupAI.TermSetResponse>;
181
+ private __updateTermSet;
182
+ /**
183
+ * Create terms that should be matched in the text. The term types are:
184
+ *
185
+ * * **preferred**: this is the preferred term for the associated term set
186
+ * * **prohibited**: this term should not be used to talk about the term set
187
+ * * **context_dependent**: this term is correct in certain cases, but incorrect in others, the instructions field of the term set should explain when the term is correct and when it is incorrect
188
+ *
189
+ * @param {string} termSetId - UUID of the term set
190
+ * @param {MarkupAI.TermCreateRequest} request
191
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
192
+ *
193
+ * @throws {@link MarkupAI.UnauthorizedError}
194
+ * @throws {@link MarkupAI.ForbiddenError}
195
+ * @throws {@link MarkupAI.UnprocessableEntityError}
196
+ * @throws {@link MarkupAI.InternalServerError}
197
+ *
198
+ * @example
199
+ * await client.terminology.createTerm("term_set_id", {
200
+ * term: "term",
201
+ * type: "preferred"
202
+ * })
203
+ */
204
+ createTerm(termSetId: string, request: MarkupAI.TermCreateRequest, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<MarkupAI.TermResponse>;
205
+ private __createTerm;
206
+ /**
207
+ * @param {string} termSetId - UUID of the term set
208
+ * @param {string} termId - UUID of the term
209
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
210
+ *
211
+ * @throws {@link MarkupAI.UnauthorizedError}
212
+ * @throws {@link MarkupAI.ForbiddenError}
213
+ * @throws {@link MarkupAI.UnprocessableEntityError}
214
+ * @throws {@link MarkupAI.InternalServerError}
215
+ *
216
+ * @example
217
+ * await client.terminology.getTerm("term_set_id", "term_id")
218
+ */
219
+ getTerm(termSetId: string, termId: string, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<MarkupAI.TermResponse>;
220
+ private __getTerm;
221
+ /**
222
+ * @param {string} termSetId - UUID of the term set
223
+ * @param {string} termId - UUID of the term
224
+ * @param {MarkupAI.TermUpdateRequest} request
225
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
226
+ *
227
+ * @throws {@link MarkupAI.UnauthorizedError}
228
+ * @throws {@link MarkupAI.ForbiddenError}
229
+ * @throws {@link MarkupAI.UnprocessableEntityError}
230
+ * @throws {@link MarkupAI.InternalServerError}
231
+ *
232
+ * @example
233
+ * await client.terminology.updateTerm("term_set_id", "term_id", {
234
+ * term: "term",
235
+ * type: "preferred"
236
+ * })
237
+ */
238
+ updateTerm(termSetId: string, termId: string, request: MarkupAI.TermUpdateRequest, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<MarkupAI.TermResponse>;
239
+ private __updateTerm;
240
+ /**
241
+ * @param {string} termSetId - UUID of the term set
242
+ * @param {string} termId - UUID of the term
243
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
244
+ *
245
+ * @throws {@link MarkupAI.UnauthorizedError}
246
+ * @throws {@link MarkupAI.ForbiddenError}
247
+ * @throws {@link MarkupAI.UnprocessableEntityError}
248
+ * @throws {@link MarkupAI.InternalServerError}
249
+ *
250
+ * @example
251
+ * await client.terminology.deleteTerm("term_set_id", "term_id")
252
+ */
253
+ deleteTerm(termSetId: string, termId: string, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<void>;
254
+ private __deleteTerm;
255
+ /**
256
+ * @param {MarkupAI.TerminologyListDomainsRequest} request
257
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
258
+ *
259
+ * @throws {@link MarkupAI.UnauthorizedError}
260
+ * @throws {@link MarkupAI.ForbiddenError}
261
+ * @throws {@link MarkupAI.UnprocessableEntityError}
262
+ * @throws {@link MarkupAI.InternalServerError}
263
+ *
264
+ * @example
265
+ * await client.terminology.listDomains({
266
+ * page: 1,
267
+ * page_size: 1,
268
+ * search: "search"
269
+ * })
270
+ */
271
+ listDomains(request?: MarkupAI.TerminologyListDomainsRequest, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<MarkupAI.PaginatedDomainsResponse>;
272
+ private __listDomains;
273
+ /**
274
+ * @param {MarkupAI.DomainCreateRequest} request
275
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
276
+ *
277
+ * @throws {@link MarkupAI.UnauthorizedError}
278
+ * @throws {@link MarkupAI.ForbiddenError}
279
+ * @throws {@link MarkupAI.UnprocessableEntityError}
280
+ * @throws {@link MarkupAI.InternalServerError}
281
+ *
282
+ * @example
283
+ * await client.terminology.createDomain({
284
+ * name: "name"
285
+ * })
286
+ */
287
+ createDomain(request: MarkupAI.DomainCreateRequest, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<MarkupAI.DomainResponse>;
288
+ private __createDomain;
289
+ /**
290
+ * @param {string} domainId - UUID of the domain
291
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
292
+ *
293
+ * @throws {@link MarkupAI.UnauthorizedError}
294
+ * @throws {@link MarkupAI.ForbiddenError}
295
+ * @throws {@link MarkupAI.UnprocessableEntityError}
296
+ * @throws {@link MarkupAI.InternalServerError}
297
+ *
298
+ * @example
299
+ * await client.terminology.getDomain("domain_id")
300
+ */
301
+ getDomain(domainId: string, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<MarkupAI.DomainResponse>;
302
+ private __getDomain;
303
+ /**
304
+ * @param {string} domainId - UUID of the domain
305
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
306
+ *
307
+ * @throws {@link MarkupAI.UnauthorizedError}
308
+ * @throws {@link MarkupAI.ForbiddenError}
309
+ * @throws {@link MarkupAI.UnprocessableEntityError}
310
+ * @throws {@link MarkupAI.InternalServerError}
311
+ *
312
+ * @example
313
+ * await client.terminology.deleteDomain("domain_id")
314
+ */
315
+ deleteDomain(domainId: string, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<void>;
316
+ private __deleteDomain;
317
+ /**
318
+ * @param {string} domainId - UUID of the domain
319
+ * @param {MarkupAI.DomainUpdateRequest} request
320
+ * @param {Terminology.RequestOptions} requestOptions - Request-specific configuration.
321
+ *
322
+ * @throws {@link MarkupAI.UnauthorizedError}
323
+ * @throws {@link MarkupAI.ForbiddenError}
324
+ * @throws {@link MarkupAI.UnprocessableEntityError}
325
+ * @throws {@link MarkupAI.InternalServerError}
326
+ *
327
+ * @example
328
+ * await client.terminology.updateDomain("domain_id")
329
+ */
330
+ updateDomain(domainId: string, request?: MarkupAI.DomainUpdateRequest, requestOptions?: Terminology.RequestOptions): core.HttpResponsePromise<MarkupAI.DomainResponse>;
331
+ private __updateDomain;
332
+ protected _getAuthorizationHeader(): Promise<string>;
333
+ }