@corti/sdk 2.2.0-rc.3 → 3.0.0-template-policies

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 (159) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/documents/resources/sections/client/Client.d.ts +3 -0
  3. package/dist/cjs/api/resources/documents/resources/sections/client/Client.js +7 -2
  4. package/dist/cjs/api/resources/documents/resources/sections/resources/index.d.ts +1 -0
  5. package/dist/cjs/api/resources/documents/resources/sections/resources/index.js +5 -4
  6. package/dist/cjs/api/resources/documents/resources/sections/resources/policies/client/Client.d.ts +45 -0
  7. package/dist/cjs/api/resources/documents/resources/sections/resources/policies/client/Client.js +187 -0
  8. package/dist/cjs/api/resources/documents/resources/sections/resources/policies/client/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/documents/resources/sections/resources/policies/client/index.js +2 -0
  10. package/dist/cjs/api/resources/documents/resources/sections/resources/policies/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/documents/resources/sections/resources/policies/index.js +17 -0
  12. package/dist/cjs/api/resources/documents/resources/templates/client/Client.d.ts +3 -0
  13. package/dist/cjs/api/resources/documents/resources/templates/client/Client.js +7 -2
  14. package/dist/cjs/api/resources/documents/resources/templates/resources/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/documents/resources/templates/resources/index.js +5 -4
  16. package/dist/cjs/api/resources/documents/resources/templates/resources/policies/client/Client.d.ts +45 -0
  17. package/dist/cjs/api/resources/documents/resources/templates/resources/policies/client/Client.js +187 -0
  18. package/dist/cjs/api/resources/documents/resources/templates/resources/policies/client/index.d.ts +1 -0
  19. package/dist/cjs/api/resources/documents/resources/templates/resources/policies/client/index.js +2 -0
  20. package/dist/cjs/api/resources/documents/resources/templates/resources/policies/index.d.ts +1 -0
  21. package/dist/cjs/api/resources/documents/resources/templates/resources/policies/index.js +17 -0
  22. package/dist/cjs/api/resources/transcripts/client/Client.d.ts +1 -1
  23. package/dist/cjs/api/resources/transcripts/client/Client.js +1 -1
  24. package/dist/cjs/api/resources/transcripts/client/requests/TranscriptsCreateRequest.d.ts +3 -1
  25. package/dist/cjs/api/types/GuidedArrayNode.d.ts +3 -2
  26. package/dist/cjs/api/types/GuidedBoolNode.d.ts +2 -2
  27. package/dist/cjs/api/types/GuidedDocumentsGenerateBase.d.ts +2 -0
  28. package/dist/cjs/api/types/GuidedEphemeralDocument.d.ts +5 -0
  29. package/dist/cjs/api/types/GuidedFieldDefinition.d.ts +4 -1
  30. package/dist/cjs/api/types/GuidedNumberNode.d.ts +3 -3
  31. package/dist/cjs/api/types/GuidedObjectNode.d.ts +3 -3
  32. package/dist/cjs/api/types/GuidedStringNode.d.ts +4 -4
  33. package/dist/cjs/api/types/TranscribeAudioEventsConfig.d.ts +1 -1
  34. package/dist/cjs/api/types/TranscribeCommand.d.ts +3 -3
  35. package/dist/cjs/api/types/TranscribeCommandVariable.d.ts +2 -2
  36. package/dist/cjs/api/types/TranscribeConfig.d.ts +5 -3
  37. package/dist/cjs/api/types/TranscribeConfigReplacementsItem.d.ts +6 -0
  38. package/dist/cjs/api/types/TranscribeConfigReplacementsItem.js +3 -0
  39. package/dist/cjs/api/types/TranscribeSupportedLanguage.d.ts +1 -1
  40. package/dist/cjs/api/types/index.d.ts +1 -0
  41. package/dist/cjs/api/types/index.js +1 -0
  42. package/dist/cjs/serialization/resources/documents/resources/sections/resources/index.d.ts +1 -0
  43. package/dist/cjs/serialization/resources/documents/resources/sections/resources/index.js +5 -4
  44. package/dist/cjs/serialization/resources/documents/resources/sections/resources/policies/client/create.d.ts +13 -0
  45. package/dist/cjs/serialization/resources/documents/resources/sections/resources/policies/client/create.js +42 -0
  46. package/dist/cjs/serialization/resources/documents/resources/sections/resources/policies/client/index.d.ts +2 -0
  47. package/dist/cjs/serialization/resources/documents/resources/sections/resources/policies/client/index.js +38 -0
  48. package/dist/cjs/serialization/resources/documents/resources/sections/resources/policies/client/list.d.ts +8 -0
  49. package/dist/cjs/serialization/resources/documents/resources/sections/resources/policies/client/list.js +40 -0
  50. package/dist/cjs/serialization/resources/documents/resources/sections/resources/policies/index.d.ts +1 -0
  51. package/dist/cjs/serialization/resources/documents/resources/sections/resources/policies/index.js +17 -0
  52. package/dist/cjs/serialization/resources/documents/resources/templates/resources/index.d.ts +1 -0
  53. package/dist/cjs/serialization/resources/documents/resources/templates/resources/index.js +5 -4
  54. package/dist/cjs/serialization/resources/documents/resources/templates/resources/policies/client/create.d.ts +13 -0
  55. package/dist/cjs/serialization/resources/documents/resources/templates/resources/policies/client/create.js +42 -0
  56. package/dist/cjs/serialization/resources/documents/resources/templates/resources/policies/client/index.d.ts +2 -0
  57. package/dist/cjs/serialization/resources/documents/resources/templates/resources/policies/client/index.js +38 -0
  58. package/dist/cjs/serialization/resources/documents/resources/templates/resources/policies/client/list.d.ts +8 -0
  59. package/dist/cjs/serialization/resources/documents/resources/templates/resources/policies/client/list.js +40 -0
  60. package/dist/cjs/serialization/resources/documents/resources/templates/resources/policies/index.d.ts +1 -0
  61. package/dist/cjs/serialization/resources/documents/resources/templates/resources/policies/index.js +17 -0
  62. package/dist/cjs/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.d.ts +1 -0
  63. package/dist/cjs/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.js +1 -0
  64. package/dist/cjs/serialization/types/GuidedDocumentsGenerateBase.d.ts +2 -0
  65. package/dist/cjs/serialization/types/GuidedDocumentsGenerateBase.js +2 -0
  66. package/dist/cjs/serialization/types/GuidedEphemeralDocument.d.ts +3 -0
  67. package/dist/cjs/serialization/types/GuidedEphemeralDocument.js +3 -0
  68. package/dist/cjs/serialization/types/GuidedFieldDefinition.d.ts +1 -0
  69. package/dist/cjs/serialization/types/GuidedFieldDefinition.js +1 -0
  70. package/dist/cjs/serialization/types/TranscribeAudioEventsConfig.d.ts +1 -1
  71. package/dist/cjs/serialization/types/TranscribeAudioEventsConfig.js +1 -1
  72. package/dist/cjs/serialization/types/TranscribeConfig.d.ts +2 -0
  73. package/dist/cjs/serialization/types/TranscribeConfig.js +2 -0
  74. package/dist/cjs/serialization/types/TranscribeConfigReplacementsItem.d.ts +10 -0
  75. package/dist/cjs/serialization/types/TranscribeConfigReplacementsItem.js +42 -0
  76. package/dist/cjs/serialization/types/index.d.ts +1 -0
  77. package/dist/cjs/serialization/types/index.js +1 -0
  78. package/dist/cjs/version.d.ts +1 -1
  79. package/dist/cjs/version.js +1 -1
  80. package/dist/esm/BaseClient.mjs +2 -2
  81. package/dist/esm/api/resources/documents/resources/sections/client/Client.d.mts +3 -0
  82. package/dist/esm/api/resources/documents/resources/sections/client/Client.mjs +5 -0
  83. package/dist/esm/api/resources/documents/resources/sections/resources/index.d.mts +1 -0
  84. package/dist/esm/api/resources/documents/resources/sections/resources/index.mjs +1 -0
  85. package/dist/esm/api/resources/documents/resources/sections/resources/policies/client/Client.d.mts +45 -0
  86. package/dist/esm/api/resources/documents/resources/sections/resources/policies/client/Client.mjs +150 -0
  87. package/dist/esm/api/resources/documents/resources/sections/resources/policies/client/index.d.mts +1 -0
  88. package/dist/esm/api/resources/documents/resources/sections/resources/policies/client/index.mjs +1 -0
  89. package/dist/esm/api/resources/documents/resources/sections/resources/policies/index.d.mts +1 -0
  90. package/dist/esm/api/resources/documents/resources/sections/resources/policies/index.mjs +1 -0
  91. package/dist/esm/api/resources/documents/resources/templates/client/Client.d.mts +3 -0
  92. package/dist/esm/api/resources/documents/resources/templates/client/Client.mjs +5 -0
  93. package/dist/esm/api/resources/documents/resources/templates/resources/index.d.mts +1 -0
  94. package/dist/esm/api/resources/documents/resources/templates/resources/index.mjs +1 -0
  95. package/dist/esm/api/resources/documents/resources/templates/resources/policies/client/Client.d.mts +45 -0
  96. package/dist/esm/api/resources/documents/resources/templates/resources/policies/client/Client.mjs +150 -0
  97. package/dist/esm/api/resources/documents/resources/templates/resources/policies/client/index.d.mts +1 -0
  98. package/dist/esm/api/resources/documents/resources/templates/resources/policies/client/index.mjs +1 -0
  99. package/dist/esm/api/resources/documents/resources/templates/resources/policies/index.d.mts +1 -0
  100. package/dist/esm/api/resources/documents/resources/templates/resources/policies/index.mjs +1 -0
  101. package/dist/esm/api/resources/transcripts/client/Client.d.mts +1 -1
  102. package/dist/esm/api/resources/transcripts/client/Client.mjs +1 -1
  103. package/dist/esm/api/resources/transcripts/client/requests/TranscriptsCreateRequest.d.mts +3 -1
  104. package/dist/esm/api/types/GuidedArrayNode.d.mts +3 -2
  105. package/dist/esm/api/types/GuidedBoolNode.d.mts +2 -2
  106. package/dist/esm/api/types/GuidedDocumentsGenerateBase.d.mts +2 -0
  107. package/dist/esm/api/types/GuidedEphemeralDocument.d.mts +5 -0
  108. package/dist/esm/api/types/GuidedFieldDefinition.d.mts +4 -1
  109. package/dist/esm/api/types/GuidedNumberNode.d.mts +3 -3
  110. package/dist/esm/api/types/GuidedObjectNode.d.mts +3 -3
  111. package/dist/esm/api/types/GuidedStringNode.d.mts +4 -4
  112. package/dist/esm/api/types/TranscribeAudioEventsConfig.d.mts +1 -1
  113. package/dist/esm/api/types/TranscribeCommand.d.mts +3 -3
  114. package/dist/esm/api/types/TranscribeCommandVariable.d.mts +2 -2
  115. package/dist/esm/api/types/TranscribeConfig.d.mts +5 -3
  116. package/dist/esm/api/types/TranscribeConfigReplacementsItem.d.mts +6 -0
  117. package/dist/esm/api/types/TranscribeConfigReplacementsItem.mjs +2 -0
  118. package/dist/esm/api/types/TranscribeSupportedLanguage.d.mts +1 -1
  119. package/dist/esm/api/types/index.d.mts +1 -0
  120. package/dist/esm/api/types/index.mjs +1 -0
  121. package/dist/esm/serialization/resources/documents/resources/sections/resources/index.d.mts +1 -0
  122. package/dist/esm/serialization/resources/documents/resources/sections/resources/index.mjs +1 -0
  123. package/dist/esm/serialization/resources/documents/resources/sections/resources/policies/client/create.d.mts +13 -0
  124. package/dist/esm/serialization/resources/documents/resources/sections/resources/policies/client/create.mjs +6 -0
  125. package/dist/esm/serialization/resources/documents/resources/sections/resources/policies/client/index.d.mts +2 -0
  126. package/dist/esm/serialization/resources/documents/resources/sections/resources/policies/client/index.mjs +2 -0
  127. package/dist/esm/serialization/resources/documents/resources/sections/resources/policies/client/list.d.mts +8 -0
  128. package/dist/esm/serialization/resources/documents/resources/sections/resources/policies/client/list.mjs +4 -0
  129. package/dist/esm/serialization/resources/documents/resources/sections/resources/policies/index.d.mts +1 -0
  130. package/dist/esm/serialization/resources/documents/resources/sections/resources/policies/index.mjs +1 -0
  131. package/dist/esm/serialization/resources/documents/resources/templates/resources/index.d.mts +1 -0
  132. package/dist/esm/serialization/resources/documents/resources/templates/resources/index.mjs +1 -0
  133. package/dist/esm/serialization/resources/documents/resources/templates/resources/policies/client/create.d.mts +13 -0
  134. package/dist/esm/serialization/resources/documents/resources/templates/resources/policies/client/create.mjs +6 -0
  135. package/dist/esm/serialization/resources/documents/resources/templates/resources/policies/client/index.d.mts +2 -0
  136. package/dist/esm/serialization/resources/documents/resources/templates/resources/policies/client/index.mjs +2 -0
  137. package/dist/esm/serialization/resources/documents/resources/templates/resources/policies/client/list.d.mts +8 -0
  138. package/dist/esm/serialization/resources/documents/resources/templates/resources/policies/client/list.mjs +4 -0
  139. package/dist/esm/serialization/resources/documents/resources/templates/resources/policies/index.d.mts +1 -0
  140. package/dist/esm/serialization/resources/documents/resources/templates/resources/policies/index.mjs +1 -0
  141. package/dist/esm/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.d.mts +1 -0
  142. package/dist/esm/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.mjs +1 -0
  143. package/dist/esm/serialization/types/GuidedDocumentsGenerateBase.d.mts +2 -0
  144. package/dist/esm/serialization/types/GuidedDocumentsGenerateBase.mjs +2 -0
  145. package/dist/esm/serialization/types/GuidedEphemeralDocument.d.mts +3 -0
  146. package/dist/esm/serialization/types/GuidedEphemeralDocument.mjs +3 -0
  147. package/dist/esm/serialization/types/GuidedFieldDefinition.d.mts +1 -0
  148. package/dist/esm/serialization/types/GuidedFieldDefinition.mjs +1 -0
  149. package/dist/esm/serialization/types/TranscribeAudioEventsConfig.d.mts +1 -1
  150. package/dist/esm/serialization/types/TranscribeAudioEventsConfig.mjs +1 -1
  151. package/dist/esm/serialization/types/TranscribeConfig.d.mts +2 -0
  152. package/dist/esm/serialization/types/TranscribeConfig.mjs +2 -0
  153. package/dist/esm/serialization/types/TranscribeConfigReplacementsItem.d.mts +10 -0
  154. package/dist/esm/serialization/types/TranscribeConfigReplacementsItem.mjs +6 -0
  155. package/dist/esm/serialization/types/index.d.mts +1 -0
  156. package/dist/esm/serialization/types/index.mjs +1 -0
  157. package/dist/esm/version.d.mts +1 -1
  158. package/dist/esm/version.mjs +1 -1
  159. package/package.json +1 -1
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@corti/sdk",
46
- "X-Fern-SDK-Version": "2.2.0-rc.3",
47
- "User-Agent": "@corti/sdk/2.2.0-rc.3",
46
+ "X-Fern-SDK-Version": "3.0.0-template-policies",
47
+ "User-Agent": "@corti/sdk/3.0.0-template-policies",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  "Tenant-Name": options === null || options === void 0 ? void 0 : options.tenantName,
@@ -2,6 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../Ba
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
3
3
  import * as core from "../../../../../../core/index.js";
4
4
  import * as Corti from "../../../../../index.js";
5
+ import { PoliciesClient } from "../resources/policies/client/Client.js";
5
6
  import { VersionsClient } from "../resources/versions/client/Client.js";
6
7
  export declare namespace SectionsClient {
7
8
  type Options = BaseClientOptions;
@@ -11,8 +12,10 @@ export declare namespace SectionsClient {
11
12
  export declare class SectionsClient {
12
13
  protected readonly _options: NormalizedClientOptionsWithAuth<SectionsClient.Options>;
13
14
  protected _versions: VersionsClient | undefined;
15
+ protected _policies: PoliciesClient | undefined;
14
16
  constructor(options: SectionsClient.Options);
15
17
  get versions(): VersionsClient;
18
+ get policies(): PoliciesClient;
16
19
  /**
17
20
  * @param {Corti.documents.GuidedSectionsListRequest} request
18
21
  * @param {SectionsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -51,14 +51,19 @@ const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNo
51
51
  const errors = __importStar(require("../../../../../../errors/index.js"));
52
52
  const serializers = __importStar(require("../../../../../../serialization/index.js"));
53
53
  const Corti = __importStar(require("../../../../../index.js"));
54
- const Client_js_1 = require("../resources/versions/client/Client.js");
54
+ const Client_js_1 = require("../resources/policies/client/Client.js");
55
+ const Client_js_2 = require("../resources/versions/client/Client.js");
55
56
  class SectionsClient {
56
57
  constructor(options) {
57
58
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
58
59
  }
59
60
  get versions() {
60
61
  var _a;
61
- return ((_a = this._versions) !== null && _a !== void 0 ? _a : (this._versions = new Client_js_1.VersionsClient(this._options)));
62
+ return ((_a = this._versions) !== null && _a !== void 0 ? _a : (this._versions = new Client_js_2.VersionsClient(this._options)));
63
+ }
64
+ get policies() {
65
+ var _a;
66
+ return ((_a = this._policies) !== null && _a !== void 0 ? _a : (this._policies = new Client_js_1.PoliciesClient(this._options)));
62
67
  }
63
68
  /**
64
69
  * @param {Corti.documents.GuidedSectionsListRequest} request
@@ -1,2 +1,3 @@
1
+ export * as policies from "./policies/index.js";
1
2
  export * from "./versions/client/requests/index.js";
2
3
  export * as versions from "./versions/index.js";
@@ -15,9 +15,6 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
- };
21
18
  var __importStar = (this && this.__importStar) || (function () {
22
19
  var ownKeys = function(o) {
23
20
  ownKeys = Object.getOwnPropertyNames || function (o) {
@@ -35,7 +32,11 @@ var __importStar = (this && this.__importStar) || (function () {
35
32
  return result;
36
33
  };
37
34
  })();
35
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
+ };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.versions = void 0;
39
+ exports.versions = exports.policies = void 0;
40
+ exports.policies = __importStar(require("./policies/index.js"));
40
41
  __exportStar(require("./versions/client/requests/index.js"), exports);
41
42
  exports.versions = __importStar(require("./versions/index.js"));
@@ -0,0 +1,45 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../BaseClient.js";
3
+ import * as core from "../../../../../../../../core/index.js";
4
+ import * as Corti from "../../../../../../../index.js";
5
+ export declare namespace PoliciesClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class PoliciesClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<PoliciesClient.Options>;
12
+ constructor(options: PoliciesClient.Options);
13
+ /**
14
+ * @param {string} sectionID
15
+ * @param {PoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
16
+ *
17
+ * @throws {@link Corti.NotFoundError}
18
+ *
19
+ * @example
20
+ * await client.documents.sections.policies.list("sectionID")
21
+ */
22
+ list(sectionID: string, requestOptions?: PoliciesClient.RequestOptions): core.HttpResponsePromise<Corti.GuidedSectionPolicy[]>;
23
+ private __list;
24
+ /**
25
+ * @param {string} sectionID
26
+ * @param {Corti.GuidedSectionsCreatePolicyRequest[]} request
27
+ * @param {PoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
28
+ *
29
+ * @throws {@link Corti.BadRequestError}
30
+ * @throws {@link Corti.NotFoundError}
31
+ *
32
+ * @example
33
+ * await client.documents.sections.policies.create("sectionID", [{
34
+ * kind: "project"
35
+ * }])
36
+ *
37
+ * @example
38
+ * await client.documents.sections.policies.create("sectionID", [{
39
+ * kind: "customers",
40
+ * customerIds: ["customer-tenant-a", "customer-tenant-b"]
41
+ * }])
42
+ */
43
+ create(sectionID: string, request: Corti.GuidedSectionsCreatePolicyRequest[], requestOptions?: PoliciesClient.RequestOptions): core.HttpResponsePromise<Corti.GuidedSectionPolicy[]>;
44
+ private __create;
45
+ }
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.PoliciesClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../../../../../BaseClient.js");
48
+ const headers_js_1 = require("../../../../../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../../../../../core/index.js"));
50
+ const handleNonStatusCodeError_js_1 = require("../../../../../../../../errors/handleNonStatusCodeError.js");
51
+ const errors = __importStar(require("../../../../../../../../errors/index.js"));
52
+ const serializers = __importStar(require("../../../../../../../../serialization/index.js"));
53
+ const Corti = __importStar(require("../../../../../../../index.js"));
54
+ class PoliciesClient {
55
+ constructor(options) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
+ }
58
+ /**
59
+ * @param {string} sectionID
60
+ * @param {PoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
61
+ *
62
+ * @throws {@link Corti.NotFoundError}
63
+ *
64
+ * @example
65
+ * await client.documents.sections.policies.list("sectionID")
66
+ */
67
+ list(sectionID, requestOptions) {
68
+ return core.HttpResponsePromise.fromPromise(this.__list(sectionID, requestOptions));
69
+ }
70
+ __list(sectionID, requestOptions) {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
73
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
74
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Tenant-Name": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.tenantName }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
75
+ const _response = yield core.fetcher({
76
+ url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment)).base, `documents/sections/${core.url.encodePathParam(sectionID)}/policies/`),
77
+ method: "GET",
78
+ headers: _headers,
79
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
80
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
81
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
82
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
83
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
84
+ logging: this._options.logging,
85
+ });
86
+ if (_response.ok) {
87
+ return {
88
+ data: serializers.documents.sections.policies.list.Response.parseOrThrow(_response.body, {
89
+ unrecognizedObjectKeys: "passthrough",
90
+ allowUnrecognizedUnionMembers: true,
91
+ allowUnrecognizedEnumValues: true,
92
+ skipValidation: true,
93
+ breadcrumbsPrefix: ["response"],
94
+ }),
95
+ rawResponse: _response.rawResponse,
96
+ };
97
+ }
98
+ if (_response.error.reason === "status-code") {
99
+ switch (_response.error.statusCode) {
100
+ case 404:
101
+ throw new Corti.NotFoundError(_response.error.body, _response.rawResponse);
102
+ default:
103
+ throw new errors.CortiError({
104
+ statusCode: _response.error.statusCode,
105
+ body: _response.error.body,
106
+ rawResponse: _response.rawResponse,
107
+ });
108
+ }
109
+ }
110
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/documents/sections/{sectionID}/policies/");
111
+ });
112
+ }
113
+ /**
114
+ * @param {string} sectionID
115
+ * @param {Corti.GuidedSectionsCreatePolicyRequest[]} request
116
+ * @param {PoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
117
+ *
118
+ * @throws {@link Corti.BadRequestError}
119
+ * @throws {@link Corti.NotFoundError}
120
+ *
121
+ * @example
122
+ * await client.documents.sections.policies.create("sectionID", [{
123
+ * kind: "project"
124
+ * }])
125
+ *
126
+ * @example
127
+ * await client.documents.sections.policies.create("sectionID", [{
128
+ * kind: "customers",
129
+ * customerIds: ["customer-tenant-a", "customer-tenant-b"]
130
+ * }])
131
+ */
132
+ create(sectionID, request, requestOptions) {
133
+ return core.HttpResponsePromise.fromPromise(this.__create(sectionID, request, requestOptions));
134
+ }
135
+ __create(sectionID, request, requestOptions) {
136
+ return __awaiter(this, void 0, void 0, function* () {
137
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
138
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
139
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Tenant-Name": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.tenantName }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
140
+ const _response = yield core.fetcher({
141
+ url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment)).base, `documents/sections/${core.url.encodePathParam(sectionID)}/policies/`),
142
+ method: "POST",
143
+ headers: _headers,
144
+ contentType: "application/json",
145
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
146
+ requestType: "json",
147
+ body: serializers.documents.sections.policies.create.Request.jsonOrThrow(request, {
148
+ unrecognizedObjectKeys: "strip",
149
+ omitUndefined: true,
150
+ }),
151
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
152
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
153
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
154
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
155
+ logging: this._options.logging,
156
+ });
157
+ if (_response.ok) {
158
+ return {
159
+ data: serializers.documents.sections.policies.create.Response.parseOrThrow(_response.body, {
160
+ unrecognizedObjectKeys: "passthrough",
161
+ allowUnrecognizedUnionMembers: true,
162
+ allowUnrecognizedEnumValues: true,
163
+ skipValidation: true,
164
+ breadcrumbsPrefix: ["response"],
165
+ }),
166
+ rawResponse: _response.rawResponse,
167
+ };
168
+ }
169
+ if (_response.error.reason === "status-code") {
170
+ switch (_response.error.statusCode) {
171
+ case 400:
172
+ throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
173
+ case 404:
174
+ throw new Corti.NotFoundError(_response.error.body, _response.rawResponse);
175
+ default:
176
+ throw new errors.CortiError({
177
+ statusCode: _response.error.statusCode,
178
+ body: _response.error.body,
179
+ rawResponse: _response.rawResponse,
180
+ });
181
+ }
182
+ }
183
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/documents/sections/{sectionID}/policies/");
184
+ });
185
+ }
186
+ }
187
+ exports.PoliciesClient = PoliciesClient;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -2,6 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../Ba
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
3
3
  import * as core from "../../../../../../core/index.js";
4
4
  import * as Corti from "../../../../../index.js";
5
+ import { PoliciesClient } from "../resources/policies/client/Client.js";
5
6
  import { VersionsClient } from "../resources/versions/client/Client.js";
6
7
  export declare namespace TemplatesClient {
7
8
  type Options = BaseClientOptions;
@@ -11,8 +12,10 @@ export declare namespace TemplatesClient {
11
12
  export declare class TemplatesClient {
12
13
  protected readonly _options: NormalizedClientOptionsWithAuth<TemplatesClient.Options>;
13
14
  protected _versions: VersionsClient | undefined;
15
+ protected _policies: PoliciesClient | undefined;
14
16
  constructor(options: TemplatesClient.Options);
15
17
  get versions(): VersionsClient;
18
+ get policies(): PoliciesClient;
16
19
  /**
17
20
  * @param {Corti.documents.GuidedTemplatesListRequest} request
18
21
  * @param {TemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -51,14 +51,19 @@ const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNo
51
51
  const errors = __importStar(require("../../../../../../errors/index.js"));
52
52
  const serializers = __importStar(require("../../../../../../serialization/index.js"));
53
53
  const Corti = __importStar(require("../../../../../index.js"));
54
- const Client_js_1 = require("../resources/versions/client/Client.js");
54
+ const Client_js_1 = require("../resources/policies/client/Client.js");
55
+ const Client_js_2 = require("../resources/versions/client/Client.js");
55
56
  class TemplatesClient {
56
57
  constructor(options) {
57
58
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
58
59
  }
59
60
  get versions() {
60
61
  var _a;
61
- return ((_a = this._versions) !== null && _a !== void 0 ? _a : (this._versions = new Client_js_1.VersionsClient(this._options)));
62
+ return ((_a = this._versions) !== null && _a !== void 0 ? _a : (this._versions = new Client_js_2.VersionsClient(this._options)));
63
+ }
64
+ get policies() {
65
+ var _a;
66
+ return ((_a = this._policies) !== null && _a !== void 0 ? _a : (this._policies = new Client_js_1.PoliciesClient(this._options)));
62
67
  }
63
68
  /**
64
69
  * @param {Corti.documents.GuidedTemplatesListRequest} request
@@ -1,2 +1,3 @@
1
+ export * as policies from "./policies/index.js";
1
2
  export * from "./versions/client/requests/index.js";
2
3
  export * as versions from "./versions/index.js";
@@ -15,9 +15,6 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
- };
21
18
  var __importStar = (this && this.__importStar) || (function () {
22
19
  var ownKeys = function(o) {
23
20
  ownKeys = Object.getOwnPropertyNames || function (o) {
@@ -35,7 +32,11 @@ var __importStar = (this && this.__importStar) || (function () {
35
32
  return result;
36
33
  };
37
34
  })();
35
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
+ };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.versions = void 0;
39
+ exports.versions = exports.policies = void 0;
40
+ exports.policies = __importStar(require("./policies/index.js"));
40
41
  __exportStar(require("./versions/client/requests/index.js"), exports);
41
42
  exports.versions = __importStar(require("./versions/index.js"));
@@ -0,0 +1,45 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../BaseClient.js";
3
+ import * as core from "../../../../../../../../core/index.js";
4
+ import * as Corti from "../../../../../../../index.js";
5
+ export declare namespace PoliciesClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class PoliciesClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<PoliciesClient.Options>;
12
+ constructor(options: PoliciesClient.Options);
13
+ /**
14
+ * @param {string} templateID
15
+ * @param {PoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
16
+ *
17
+ * @throws {@link Corti.NotFoundError}
18
+ *
19
+ * @example
20
+ * await client.documents.templates.policies.list("templateID")
21
+ */
22
+ list(templateID: string, requestOptions?: PoliciesClient.RequestOptions): core.HttpResponsePromise<Corti.GuidedTemplatePolicy[]>;
23
+ private __list;
24
+ /**
25
+ * @param {string} templateID
26
+ * @param {Corti.GuidedTemplatesCreatePolicyRequest[]} request
27
+ * @param {PoliciesClient.RequestOptions} requestOptions - Request-specific configuration.
28
+ *
29
+ * @throws {@link Corti.BadRequestError}
30
+ * @throws {@link Corti.NotFoundError}
31
+ *
32
+ * @example
33
+ * await client.documents.templates.policies.create("templateID", [{
34
+ * kind: "project"
35
+ * }])
36
+ *
37
+ * @example
38
+ * await client.documents.templates.policies.create("templateID", [{
39
+ * kind: "customers",
40
+ * customerIds: ["customer-tenant-a", "customer-tenant-b"]
41
+ * }])
42
+ */
43
+ create(templateID: string, request: Corti.GuidedTemplatesCreatePolicyRequest[], requestOptions?: PoliciesClient.RequestOptions): core.HttpResponsePromise<Corti.GuidedTemplatePolicy[]>;
44
+ private __create;
45
+ }