@corti/sdk 1.0.0-alpha.2 → 1.0.0-rc-8

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 (166) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/api/resources/codes/client/Client.d.ts +1 -1
  4. package/dist/cjs/api/resources/codes/client/Client.js +1 -1
  5. package/dist/cjs/api/resources/stream/client/Socket.d.ts +1 -1
  6. package/dist/cjs/api/resources/transcribe/client/Socket.d.ts +1 -1
  7. package/dist/cjs/api/types/AgentsAgentCard.d.ts +2 -2
  8. package/dist/cjs/api/types/AgentsErrorResponse.d.ts +2 -2
  9. package/dist/cjs/api/types/CodesGeneralResponse.d.ts +1 -1
  10. package/dist/cjs/api/types/CommonCodingSystemEnum.d.ts +9 -0
  11. package/dist/cjs/api/types/CommonCodingSystemEnum.js +9 -0
  12. package/dist/cjs/api/types/StreamConfig.d.ts +2 -0
  13. package/dist/cjs/api/types/StreamConfigStatusMessageType.d.ts +0 -1
  14. package/dist/cjs/api/types/StreamConfigStatusMessageType.js +0 -1
  15. package/dist/cjs/api/types/StreamConfigXCortiRetentionPolicy.d.ts +6 -0
  16. package/dist/cjs/api/types/StreamConfigXCortiRetentionPolicy.js +9 -0
  17. package/dist/cjs/api/types/StreamDeltaUsageMessage.d.ts +5 -0
  18. package/dist/cjs/api/types/StreamDeltaUsageMessage.js +3 -0
  19. package/dist/cjs/api/types/TranscribeConfigStatusMessageType.d.ts +2 -0
  20. package/dist/cjs/api/types/TranscribeConfigStatusMessageType.js +2 -0
  21. package/dist/cjs/api/types/TranscribeDeltaUsageMessage.d.ts +5 -0
  22. package/dist/cjs/api/types/TranscribeDeltaUsageMessage.js +3 -0
  23. package/dist/cjs/api/types/index.d.ts +3 -0
  24. package/dist/cjs/api/types/index.js +3 -0
  25. package/dist/cjs/custom/CortiClient.d.ts +25 -69
  26. package/dist/cjs/custom/CortiClient.js +70 -1
  27. package/dist/cjs/custom/agents/CustomAgents.d.ts +20 -0
  28. package/dist/cjs/custom/agents/CustomAgents.js +73 -0
  29. package/dist/cjs/custom/auth/CortiAuth.d.ts +27 -0
  30. package/dist/cjs/custom/auth/CortiAuth.js +10 -4
  31. package/dist/cjs/custom/auth/OAuthAuthCodeAuthProvider.js +1 -1
  32. package/dist/cjs/custom/auth/OAuthPkceAuthProvider.js +1 -1
  33. package/dist/cjs/custom/auth/OAuthRopcAuthProvider.js +1 -1
  34. package/dist/cjs/custom/overrides/OAuthAuthProvider.js +1 -1
  35. package/dist/cjs/custom/overrides/fetcher/index.d.ts +2 -2
  36. package/dist/cjs/custom/overrides/fetcher/index.js +4 -4
  37. package/dist/cjs/custom/overrides/index.d.ts +5 -5
  38. package/dist/cjs/custom/overrides/index.js +7 -7
  39. package/dist/cjs/custom/proxy/CustomProxyStream.d.ts +1 -1
  40. package/dist/cjs/custom/proxy/CustomProxyTranscribe.d.ts +1 -1
  41. package/dist/cjs/custom/stream/CustomStream.d.ts +2 -2
  42. package/dist/cjs/custom/stream/CustomStream.js +9 -7
  43. package/dist/cjs/custom/transcribe/CustomTranscribe.d.ts +2 -2
  44. package/dist/cjs/custom/transcribe/CustomTranscribe.js +10 -6
  45. package/dist/cjs/custom/utils/encodeHeadersAsWsProtocols.js +2 -11
  46. package/dist/cjs/custom/utils/index.d.ts +2 -2
  47. package/dist/cjs/custom/utils/index.js +3 -3
  48. package/dist/cjs/custom/utils/sdkHeaderNames.d.ts +1 -0
  49. package/dist/cjs/custom/utils/sdkHeaderNames.js +12 -0
  50. package/dist/cjs/custom/utils/stripFernNormalizedHeaders.d.ts +5 -0
  51. package/dist/cjs/custom/utils/stripFernNormalizedHeaders.js +27 -0
  52. package/dist/cjs/custom/utils/withCredentialsConfig.js +1 -1
  53. package/dist/cjs/serialization/resources/stream/client/socket/StreamSocketResponse.d.ts +3 -2
  54. package/dist/cjs/serialization/resources/stream/client/socket/StreamSocketResponse.js +2 -0
  55. package/dist/cjs/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.d.ts +3 -2
  56. package/dist/cjs/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.js +2 -0
  57. package/dist/cjs/serialization/types/AgentsAgentCard.d.ts +2 -2
  58. package/dist/cjs/serialization/types/AgentsAgentCard.js +2 -2
  59. package/dist/cjs/serialization/types/AgentsErrorResponse.d.ts +2 -2
  60. package/dist/cjs/serialization/types/AgentsErrorResponse.js +1 -2
  61. package/dist/cjs/serialization/types/AgentsValidationErrorResponse.d.ts +3 -2
  62. package/dist/cjs/serialization/types/AgentsValidationErrorResponse.js +2 -2
  63. package/dist/cjs/serialization/types/CodesGeneralResponse.d.ts +1 -1
  64. package/dist/cjs/serialization/types/CodesGeneralResponse.js +1 -1
  65. package/dist/cjs/serialization/types/CommonCodingSystemEnum.d.ts +1 -1
  66. package/dist/cjs/serialization/types/CommonCodingSystemEnum.js +15 -1
  67. package/dist/cjs/serialization/types/StreamConfig.d.ts +2 -0
  68. package/dist/cjs/serialization/types/StreamConfig.js +2 -0
  69. package/dist/cjs/serialization/types/StreamConfigStatusMessageType.d.ts +1 -1
  70. package/dist/cjs/serialization/types/StreamConfigStatusMessageType.js +0 -1
  71. package/dist/cjs/serialization/types/StreamConfigXCortiRetentionPolicy.d.ts +7 -0
  72. package/dist/cjs/serialization/types/StreamConfigXCortiRetentionPolicy.js +39 -0
  73. package/dist/cjs/serialization/types/StreamDeltaUsageMessage.d.ts +10 -0
  74. package/dist/cjs/serialization/types/StreamDeltaUsageMessage.js +42 -0
  75. package/dist/cjs/serialization/types/TranscribeConfigStatusMessageType.d.ts +1 -1
  76. package/dist/cjs/serialization/types/TranscribeConfigStatusMessageType.js +7 -1
  77. package/dist/cjs/serialization/types/TranscribeDeltaUsageMessage.d.ts +10 -0
  78. package/dist/cjs/serialization/types/TranscribeDeltaUsageMessage.js +42 -0
  79. package/dist/cjs/serialization/types/index.d.ts +3 -0
  80. package/dist/cjs/serialization/types/index.js +3 -0
  81. package/dist/cjs/version.d.ts +1 -1
  82. package/dist/cjs/version.js +1 -1
  83. package/dist/esm/BaseClient.mjs +2 -2
  84. package/dist/esm/api/resources/codes/client/Client.d.mts +1 -1
  85. package/dist/esm/api/resources/codes/client/Client.mjs +1 -1
  86. package/dist/esm/api/resources/stream/client/Socket.d.mts +1 -1
  87. package/dist/esm/api/resources/transcribe/client/Socket.d.mts +1 -1
  88. package/dist/esm/api/types/AgentsAgentCard.d.mts +2 -2
  89. package/dist/esm/api/types/AgentsErrorResponse.d.mts +2 -2
  90. package/dist/esm/api/types/CodesGeneralResponse.d.mts +1 -1
  91. package/dist/esm/api/types/CommonCodingSystemEnum.d.mts +9 -0
  92. package/dist/esm/api/types/CommonCodingSystemEnum.mjs +9 -0
  93. package/dist/esm/api/types/StreamConfig.d.mts +2 -0
  94. package/dist/esm/api/types/StreamConfigStatusMessageType.d.mts +0 -1
  95. package/dist/esm/api/types/StreamConfigStatusMessageType.mjs +0 -1
  96. package/dist/esm/api/types/StreamConfigXCortiRetentionPolicy.d.mts +6 -0
  97. package/dist/esm/api/types/StreamConfigXCortiRetentionPolicy.mjs +6 -0
  98. package/dist/esm/api/types/StreamDeltaUsageMessage.d.mts +5 -0
  99. package/dist/esm/api/types/StreamDeltaUsageMessage.mjs +2 -0
  100. package/dist/esm/api/types/TranscribeConfigStatusMessageType.d.mts +2 -0
  101. package/dist/esm/api/types/TranscribeConfigStatusMessageType.mjs +2 -0
  102. package/dist/esm/api/types/TranscribeDeltaUsageMessage.d.mts +5 -0
  103. package/dist/esm/api/types/TranscribeDeltaUsageMessage.mjs +2 -0
  104. package/dist/esm/api/types/index.d.mts +3 -0
  105. package/dist/esm/api/types/index.mjs +3 -0
  106. package/dist/esm/custom/CortiClient.d.mts +25 -69
  107. package/dist/esm/custom/CortiClient.mjs +37 -1
  108. package/dist/esm/custom/agents/CustomAgents.d.mts +20 -0
  109. package/dist/esm/custom/agents/CustomAgents.mjs +36 -0
  110. package/dist/esm/custom/auth/CortiAuth.d.mts +27 -0
  111. package/dist/esm/custom/auth/CortiAuth.mjs +10 -4
  112. package/dist/esm/custom/auth/OAuthAuthCodeAuthProvider.mjs +1 -1
  113. package/dist/esm/custom/auth/OAuthPkceAuthProvider.mjs +1 -1
  114. package/dist/esm/custom/auth/OAuthRopcAuthProvider.mjs +1 -1
  115. package/dist/esm/custom/overrides/OAuthAuthProvider.mjs +1 -1
  116. package/dist/esm/custom/overrides/fetcher/index.d.mts +2 -2
  117. package/dist/esm/custom/overrides/fetcher/index.mjs +2 -2
  118. package/dist/esm/custom/overrides/index.d.mts +5 -5
  119. package/dist/esm/custom/overrides/index.mjs +3 -5
  120. package/dist/esm/custom/proxy/CustomProxyStream.d.mts +1 -1
  121. package/dist/esm/custom/proxy/CustomProxyStream.mjs +0 -1
  122. package/dist/esm/custom/proxy/CustomProxyTranscribe.d.mts +1 -1
  123. package/dist/esm/custom/proxy/CustomProxyTranscribe.mjs +0 -1
  124. package/dist/esm/custom/stream/CustomStream.d.mts +2 -2
  125. package/dist/esm/custom/stream/CustomStream.mjs +9 -7
  126. package/dist/esm/custom/transcribe/CustomTranscribe.d.mts +2 -2
  127. package/dist/esm/custom/transcribe/CustomTranscribe.mjs +10 -6
  128. package/dist/esm/custom/utils/encodeHeadersAsWsProtocols.mjs +1 -10
  129. package/dist/esm/custom/utils/index.d.mts +2 -2
  130. package/dist/esm/custom/utils/index.mjs +1 -1
  131. package/dist/esm/custom/utils/sdkHeaderNames.d.mts +1 -0
  132. package/dist/esm/custom/utils/sdkHeaderNames.mjs +9 -0
  133. package/dist/esm/custom/utils/stripFernNormalizedHeaders.d.mts +5 -0
  134. package/dist/esm/custom/utils/stripFernNormalizedHeaders.mjs +24 -0
  135. package/dist/esm/custom/utils/withCredentialsConfig.mjs +1 -1
  136. package/dist/esm/serialization/resources/stream/client/socket/StreamSocketResponse.d.mts +3 -2
  137. package/dist/esm/serialization/resources/stream/client/socket/StreamSocketResponse.mjs +2 -0
  138. package/dist/esm/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.d.mts +3 -2
  139. package/dist/esm/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.mjs +2 -0
  140. package/dist/esm/serialization/types/AgentsAgentCard.d.mts +2 -2
  141. package/dist/esm/serialization/types/AgentsAgentCard.mjs +2 -2
  142. package/dist/esm/serialization/types/AgentsErrorResponse.d.mts +2 -2
  143. package/dist/esm/serialization/types/AgentsErrorResponse.mjs +1 -2
  144. package/dist/esm/serialization/types/AgentsValidationErrorResponse.d.mts +3 -2
  145. package/dist/esm/serialization/types/AgentsValidationErrorResponse.mjs +2 -2
  146. package/dist/esm/serialization/types/CodesGeneralResponse.d.mts +1 -1
  147. package/dist/esm/serialization/types/CodesGeneralResponse.mjs +1 -1
  148. package/dist/esm/serialization/types/CommonCodingSystemEnum.d.mts +1 -1
  149. package/dist/esm/serialization/types/CommonCodingSystemEnum.mjs +15 -1
  150. package/dist/esm/serialization/types/StreamConfig.d.mts +2 -0
  151. package/dist/esm/serialization/types/StreamConfig.mjs +2 -0
  152. package/dist/esm/serialization/types/StreamConfigStatusMessageType.d.mts +1 -1
  153. package/dist/esm/serialization/types/StreamConfigStatusMessageType.mjs +0 -1
  154. package/dist/esm/serialization/types/StreamConfigXCortiRetentionPolicy.d.mts +7 -0
  155. package/dist/esm/serialization/types/StreamConfigXCortiRetentionPolicy.mjs +3 -0
  156. package/dist/esm/serialization/types/StreamDeltaUsageMessage.d.mts +10 -0
  157. package/dist/esm/serialization/types/StreamDeltaUsageMessage.mjs +6 -0
  158. package/dist/esm/serialization/types/TranscribeConfigStatusMessageType.d.mts +1 -1
  159. package/dist/esm/serialization/types/TranscribeConfigStatusMessageType.mjs +7 -1
  160. package/dist/esm/serialization/types/TranscribeDeltaUsageMessage.d.mts +10 -0
  161. package/dist/esm/serialization/types/TranscribeDeltaUsageMessage.mjs +6 -0
  162. package/dist/esm/serialization/types/index.d.mts +3 -0
  163. package/dist/esm/serialization/types/index.mjs +3 -0
  164. package/dist/esm/version.d.mts +1 -1
  165. package/dist/esm/version.mjs +1 -1
  166. package/package.json +3 -2
package/README.md CHANGED
@@ -29,7 +29,7 @@ The Corti JavaScript library provides convenient access to the Corti APIs from J
29
29
 
30
30
  ## Documentation
31
31
 
32
- - [Documentation](https://docs.corti.ai/)
32
+ - [Documentation](https://docs.corti.ai/sdk/js)
33
33
  - [API Reference](https://docs.corti.ai/api-reference)
34
34
  - [Console](https://console.corti.app/) — get your credentials here
35
35
  - [Examples](https://github.com/corticph/corti-examples)
@@ -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": "0.10.2",
47
- "User-Agent": "@corti/sdk/0.10.2",
46
+ "X-Fern-SDK-Version": "1.0.0-rc-8",
47
+ "User-Agent": "@corti/sdk/1.0.0-rc-8",
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,
@@ -11,7 +11,7 @@ export declare class CodesClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<CodesClient.Options>;
12
12
  constructor(options: CodesClient.Options);
13
13
  /**
14
- * Predict medical codes from provided context.<br/><Note>This is a stateless endpoint, designed to predict ICD-10-CM, ICD-10-PCS, and CPT codes based on input text string or documentId.<br/><br/>More than one code system may be defined in a single request.<br/><br/>Code prediction requests have two possible values for context:<br/>- `text`: One set of code prediction results will be returned based on all input text defined.<br/>- `documentId`: Code prediction will be based on that defined document only.<br/><br/>The response includes two sets of results:<br/>- `Codes`: Codes predicted by the model.<br/>- `Candidates`: Lower-confidence codes the model considered potentially relevant but excluded from the predicted set.<br/><br/>All predicted code results are based on input context defined in the request only (not other external data or assets associated with an interaction).</Note>
14
+ * Predict medical codes from provided context.<br/><Note>This is a stateless endpoint, designed to predict ICD-10-CM, ICD-10-PCS, ICD-10-UK, CIM-10-FR, ICD-10-GM, OPCS-4 and CPT codes based on input text string or documentId.<br/><br/>More than one code system may be defined in a single request.<br/><br/>Code prediction requests have two possible values for context:<br/>- `text`: One set of code prediction results will be returned based on all input text defined.<br/>- `documentId`: Code prediction will be based on that defined document only.<br/><br/>The response includes two sets of results:<br/>- `Codes`: Codes predicted by the model.<br/>- `Candidates`: Lower-confidence codes the model considered potentially relevant but excluded from the predicted set.<br/><br/>All predicted code results are based on input context defined in the request only (not other external data or assets associated with an interaction).</Note>
15
15
  *
16
16
  * @param {Corti.CodesGeneralPredictRequest} request
17
17
  * @param {CodesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -56,7 +56,7 @@ class CodesClient {
56
56
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
57
  }
58
58
  /**
59
- * Predict medical codes from provided context.<br/><Note>This is a stateless endpoint, designed to predict ICD-10-CM, ICD-10-PCS, and CPT codes based on input text string or documentId.<br/><br/>More than one code system may be defined in a single request.<br/><br/>Code prediction requests have two possible values for context:<br/>- `text`: One set of code prediction results will be returned based on all input text defined.<br/>- `documentId`: Code prediction will be based on that defined document only.<br/><br/>The response includes two sets of results:<br/>- `Codes`: Codes predicted by the model.<br/>- `Candidates`: Lower-confidence codes the model considered potentially relevant but excluded from the predicted set.<br/><br/>All predicted code results are based on input context defined in the request only (not other external data or assets associated with an interaction).</Note>
59
+ * Predict medical codes from provided context.<br/><Note>This is a stateless endpoint, designed to predict ICD-10-CM, ICD-10-PCS, ICD-10-UK, CIM-10-FR, ICD-10-GM, OPCS-4 and CPT codes based on input text string or documentId.<br/><br/>More than one code system may be defined in a single request.<br/><br/>Code prediction requests have two possible values for context:<br/>- `text`: One set of code prediction results will be returned based on all input text defined.<br/>- `documentId`: Code prediction will be based on that defined document only.<br/><br/>The response includes two sets of results:<br/>- `Codes`: Codes predicted by the model.<br/>- `Candidates`: Lower-confidence codes the model considered potentially relevant but excluded from the predicted set.<br/><br/>All predicted code results are based on input context defined in the request only (not other external data or assets associated with an interaction).</Note>
60
60
  *
61
61
  * @param {Corti.CodesGeneralPredictRequest} request
62
62
  * @param {CodesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -4,7 +4,7 @@ export declare namespace StreamSocket {
4
4
  interface Args {
5
5
  socket: core.ReconnectingWebSocket;
6
6
  }
7
- type Response = Corti.StreamTranscriptMessage | Corti.StreamFactsMessage | Corti.StreamFlushedMessage | Corti.StreamEndedMessage | Corti.StreamUsageMessage | Corti.StreamErrorMessage | Corti.StreamConfigStatusMessage;
7
+ type Response = Corti.StreamTranscriptMessage | Corti.StreamFactsMessage | Corti.StreamFlushedMessage | Corti.StreamDeltaUsageMessage | Corti.StreamEndedMessage | Corti.StreamUsageMessage | Corti.StreamErrorMessage | Corti.StreamConfigStatusMessage;
8
8
  type EventHandlers = {
9
9
  open?: () => void;
10
10
  message?: (message: Response) => void;
@@ -4,7 +4,7 @@ export declare namespace TranscribeSocket {
4
4
  interface Args {
5
5
  socket: core.ReconnectingWebSocket;
6
6
  }
7
- type Response = Corti.TranscribeUsageMessage | Corti.TranscribeFlushedMessage | Corti.TranscribeEndedMessage | Corti.TranscribeErrorMessage | Corti.TranscribeTranscriptMessage | Corti.TranscribeCommandMessage | Corti.TranscribeConfigStatusMessage;
7
+ type Response = Corti.TranscribeUsageMessage | Corti.TranscribeFlushedMessage | Corti.TranscribeDeltaUsageMessage | Corti.TranscribeEndedMessage | Corti.TranscribeErrorMessage | Corti.TranscribeTranscriptMessage | Corti.TranscribeCommandMessage | Corti.TranscribeConfigStatusMessage;
8
8
  type EventHandlers = {
9
9
  open?: () => void;
10
10
  message?: (message: Response) => void;
@@ -15,10 +15,10 @@ export interface AgentsAgentCard {
15
15
  iconUrl?: string | null;
16
16
  /** A URL to documentation describing how to interact with the agent. */
17
17
  documentationUrl?: string | null;
18
- provider?: Corti.AgentsAgentProvider;
18
+ provider?: Corti.AgentsAgentProvider | null;
19
19
  /** The version of the agent. */
20
20
  version: string;
21
- capabilities: Corti.AgentsAgentCapabilities;
21
+ capabilities: Corti.AgentsAgentCapabilities | null;
22
22
  /** A declaration of the security schemes available to authorize requests. The key is the scheme name. Follows the OpenAPI 3.0 Security Scheme Object. */
23
23
  securitySchemes?: Record<string, unknown> | null;
24
24
  /** A list of security requirement objects that apply to all agent interactions. Each object lists security schemes that can be used. Follows the OpenAPI 3.0 Security Requirement Object. This list can be seen as an OR of ANDs. Each object in the list describes one possible set of security requirements that must be present on a request. This allows specifying, for example, "callers must either use OAuth OR an API Key AND mTLS." */
@@ -1,4 +1,3 @@
1
- import type * as Corti from "../index.js";
2
1
  export interface AgentsErrorResponse {
3
2
  /** A machine-readable error code that identifies the type of error. */
4
3
  code: string;
@@ -8,5 +7,6 @@ export interface AgentsErrorResponse {
8
7
  howToFix?: string;
9
8
  /** An optional object containing additional details about the error. */
10
9
  details?: Record<string, unknown>;
11
- cause?: Corti.AgentsErrorResponse;
10
+ /** An optional object containing the cause of the error, following the same structure as the parent error response. */
11
+ cause?: Record<string, unknown>;
12
12
  }
@@ -4,5 +4,5 @@ export interface CodesGeneralResponse {
4
4
  codes: Corti.CodesGeneralReadResponse[];
5
5
  /** Lower-confidence codes the model considered potentially relevant but excluded from the predicted set. */
6
6
  candidates: Corti.CodesGeneralReadResponse[];
7
- usageInfo?: Corti.CommonUsageInfo;
7
+ usageInfo: Corti.CommonUsageInfo;
8
8
  }
@@ -3,5 +3,14 @@ export declare const CommonCodingSystemEnum: {
3
3
  readonly Icd10CmOutpatient: "icd10cm-outpatient";
4
4
  readonly Icd10Pcs: "icd10pcs";
5
5
  readonly Cpt: "cpt";
6
+ readonly Icd10IntInpatient: "icd10int-inpatient";
7
+ readonly Icd10IntOutpatient: "icd10int-outpatient";
8
+ readonly Icd10UkInpatient: "icd10uk-inpatient";
9
+ readonly Icd10UkOutpatient: "icd10uk-outpatient";
10
+ readonly Cim10FrInpatient: "cim10fr-inpatient";
11
+ readonly Cim10FrOutpatient: "cim10fr-outpatient";
12
+ readonly Icd10GmInpatient: "icd10gm-inpatient";
13
+ readonly Icd10GmOutpatient: "icd10gm-outpatient";
14
+ readonly Opcs4: "opcs4";
6
15
  };
7
16
  export type CommonCodingSystemEnum = (typeof CommonCodingSystemEnum)[keyof typeof CommonCodingSystemEnum];
@@ -7,4 +7,13 @@ exports.CommonCodingSystemEnum = {
7
7
  Icd10CmOutpatient: "icd10cm-outpatient",
8
8
  Icd10Pcs: "icd10pcs",
9
9
  Cpt: "cpt",
10
+ Icd10IntInpatient: "icd10int-inpatient",
11
+ Icd10IntOutpatient: "icd10int-outpatient",
12
+ Icd10UkInpatient: "icd10uk-inpatient",
13
+ Icd10UkOutpatient: "icd10uk-outpatient",
14
+ Cim10FrInpatient: "cim10fr-inpatient",
15
+ Cim10FrOutpatient: "cim10fr-outpatient",
16
+ Icd10GmInpatient: "icd10gm-inpatient",
17
+ Icd10GmOutpatient: "icd10gm-outpatient",
18
+ Opcs4: "opcs4",
10
19
  };
@@ -2,4 +2,6 @@ import type * as Corti from "../index.js";
2
2
  export interface StreamConfig {
3
3
  transcription: Corti.StreamConfigTranscription;
4
4
  mode: Corti.StreamConfigMode;
5
+ /** Optional parameter to specify data retention policy for the generated transcripts and facts. Use value 'none' to indicate data should not be stored in the database. Use value 'retain' to indicate that the data should be retained according to standard retention policies. If configuration is not provided, then the default retention policy will apply. */
6
+ xCortiRetentionPolicy?: Corti.StreamConfigXCortiRetentionPolicy;
5
7
  }
@@ -5,6 +5,5 @@ export declare const StreamConfigStatusMessageType: {
5
5
  readonly ConfigMissing: "CONFIG_MISSING";
6
6
  readonly ConfigNotProvided: "CONFIG_NOT_PROVIDED";
7
7
  readonly ConfigAlreadyReceived: "CONFIG_ALREADY_RECEIVED";
8
- readonly ConfigTimeout: "CONFIG_TIMEOUT";
9
8
  };
10
9
  export type StreamConfigStatusMessageType = (typeof StreamConfigStatusMessageType)[keyof typeof StreamConfigStatusMessageType];
@@ -9,5 +9,4 @@ exports.StreamConfigStatusMessageType = {
9
9
  ConfigMissing: "CONFIG_MISSING",
10
10
  ConfigNotProvided: "CONFIG_NOT_PROVIDED",
11
11
  ConfigAlreadyReceived: "CONFIG_ALREADY_RECEIVED",
12
- ConfigTimeout: "CONFIG_TIMEOUT",
13
12
  };
@@ -0,0 +1,6 @@
1
+ /** Optional parameter to specify data retention policy for the generated transcripts and facts. Use value 'none' to indicate data should not be stored in the database. Use value 'retain' to indicate that the data should be retained according to standard retention policies. If configuration is not provided, then the default retention policy will apply. */
2
+ export declare const StreamConfigXCortiRetentionPolicy: {
3
+ readonly Retain: "retain";
4
+ readonly None: "none";
5
+ };
6
+ export type StreamConfigXCortiRetentionPolicy = (typeof StreamConfigXCortiRetentionPolicy)[keyof typeof StreamConfigXCortiRetentionPolicy];
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.StreamConfigXCortiRetentionPolicy = void 0;
5
+ /** Optional parameter to specify data retention policy for the generated transcripts and facts. Use value 'none' to indicate data should not be stored in the database. Use value 'retain' to indicate that the data should be retained according to standard retention policies. If configuration is not provided, then the default retention policy will apply. */
6
+ exports.StreamConfigXCortiRetentionPolicy = {
7
+ Retain: "retain",
8
+ None: "none",
9
+ };
@@ -0,0 +1,5 @@
1
+ export interface StreamDeltaUsageMessage {
2
+ type: "delta_usage";
3
+ /** Approximate credits consumed since recording started. */
4
+ credits: number;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,5 +3,7 @@ export declare const TranscribeConfigStatusMessageType: {
3
3
  readonly ConfigAccepted: "CONFIG_ACCEPTED";
4
4
  readonly ConfigDenied: "CONFIG_DENIED";
5
5
  readonly ConfigTimeout: "CONFIG_TIMEOUT";
6
+ readonly ConfigAlreadyReceived: "CONFIG_ALREADY_RECEIVED";
7
+ readonly ConfigMissing: "CONFIG_MISSING";
6
8
  };
7
9
  export type TranscribeConfigStatusMessageType = (typeof TranscribeConfigStatusMessageType)[keyof typeof TranscribeConfigStatusMessageType];
@@ -7,4 +7,6 @@ exports.TranscribeConfigStatusMessageType = {
7
7
  ConfigAccepted: "CONFIG_ACCEPTED",
8
8
  ConfigDenied: "CONFIG_DENIED",
9
9
  ConfigTimeout: "CONFIG_TIMEOUT",
10
+ ConfigAlreadyReceived: "CONFIG_ALREADY_RECEIVED",
11
+ ConfigMissing: "CONFIG_MISSING",
10
12
  };
@@ -0,0 +1,5 @@
1
+ export interface TranscribeDeltaUsageMessage {
2
+ type: "delta_usage";
3
+ /** Approximate credits consumed since recording started. */
4
+ credits: number;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -135,6 +135,8 @@ export * from "./StreamConfigParticipantRole.js";
135
135
  export * from "./StreamConfigStatusMessage.js";
136
136
  export * from "./StreamConfigStatusMessageType.js";
137
137
  export * from "./StreamConfigTranscription.js";
138
+ export * from "./StreamConfigXCortiRetentionPolicy.js";
139
+ export * from "./StreamDeltaUsageMessage.js";
138
140
  export * from "./StreamEndedMessage.js";
139
141
  export * from "./StreamEndMessage.js";
140
142
  export * from "./StreamErrorDetail.js";
@@ -167,6 +169,7 @@ export * from "./TranscribeConfig.js";
167
169
  export * from "./TranscribeConfigMessage.js";
168
170
  export * from "./TranscribeConfigStatusMessage.js";
169
171
  export * from "./TranscribeConfigStatusMessageType.js";
172
+ export * from "./TranscribeDeltaUsageMessage.js";
170
173
  export * from "./TranscribeEndedMessage.js";
171
174
  export * from "./TranscribeEndMessage.js";
172
175
  export * from "./TranscribeErrorMessage.js";
@@ -151,6 +151,8 @@ __exportStar(require("./StreamConfigParticipantRole.js"), exports);
151
151
  __exportStar(require("./StreamConfigStatusMessage.js"), exports);
152
152
  __exportStar(require("./StreamConfigStatusMessageType.js"), exports);
153
153
  __exportStar(require("./StreamConfigTranscription.js"), exports);
154
+ __exportStar(require("./StreamConfigXCortiRetentionPolicy.js"), exports);
155
+ __exportStar(require("./StreamDeltaUsageMessage.js"), exports);
154
156
  __exportStar(require("./StreamEndedMessage.js"), exports);
155
157
  __exportStar(require("./StreamEndMessage.js"), exports);
156
158
  __exportStar(require("./StreamErrorDetail.js"), exports);
@@ -183,6 +185,7 @@ __exportStar(require("./TranscribeConfig.js"), exports);
183
185
  __exportStar(require("./TranscribeConfigMessage.js"), exports);
184
186
  __exportStar(require("./TranscribeConfigStatusMessage.js"), exports);
185
187
  __exportStar(require("./TranscribeConfigStatusMessageType.js"), exports);
188
+ __exportStar(require("./TranscribeDeltaUsageMessage.js"), exports);
186
189
  __exportStar(require("./TranscribeEndedMessage.js"), exports);
187
190
  __exportStar(require("./TranscribeEndMessage.js"), exports);
188
191
  __exportStar(require("./TranscribeErrorMessage.js"), exports);
@@ -1,25 +1,10 @@
1
- import type { OAuthAuthProvider } from "../auth/OAuthAuthProvider.js";
2
1
  import { CortiClient as BaseCortiClient } from "../Client.js";
3
2
  import type * as environments from "../environments.js";
3
+ import { CustomAgents } from "./agents/CustomAgents.js";
4
4
  import { CortiAuth } from "./auth/CortiAuth.js";
5
5
  import { CustomStream } from "./stream/CustomStream.js";
6
6
  import { CustomTranscribe } from "./transcribe/CustomTranscribe.js";
7
7
  import { type Environment } from "./utils/environment.js";
8
- type TokenDerivableAuth = {
9
- accessToken: string;
10
- refreshAccessToken?: OAuthAuthProvider.RefreshAccessTokenFunction;
11
- expiresIn?: number;
12
- refreshToken?: string;
13
- refreshExpiresIn?: number;
14
- clientId?: string;
15
- } | {
16
- refreshAccessToken: OAuthAuthProvider.RefreshAccessTokenFunction;
17
- accessToken?: string;
18
- expiresIn?: number;
19
- refreshToken?: string;
20
- refreshExpiresIn?: number;
21
- clientId?: string;
22
- };
23
8
  type OptionsBase = Omit<BaseCortiClient.Options, "clientId" | "clientSecret" | "token" | "environment" | "tenantName" | "baseUrl"> & {
24
9
  withCredentials?: boolean;
25
10
  /**
@@ -30,71 +15,23 @@ type OptionsBase = Omit<BaseCortiClient.Options, "clientId" | "clientSecret" | "
30
15
  encodeHeadersAsWsProtocols?: boolean;
31
16
  };
32
17
  export declare namespace CortiClient {
33
- type Auth = {
34
- clientId: string;
35
- clientSecret: string;
36
- } | {
37
- accessToken: string;
38
- refreshAccessToken?: OAuthAuthProvider.RefreshAccessTokenFunction;
39
- expiresIn?: number;
40
- refreshToken?: string;
41
- refreshExpiresIn?: number;
42
- clientId?: string;
43
- } | {
44
- clientId: string;
45
- username: string;
46
- password: string;
47
- } | {
48
- clientId: string;
49
- clientSecret: string;
50
- code: string;
51
- redirectUri: string;
52
- } | {
53
- clientId: string;
54
- code: string;
55
- redirectUri: string;
56
- codeVerifier?: string;
57
- } | {
58
- refreshAccessToken: OAuthAuthProvider.RefreshAccessTokenFunction;
59
- accessToken?: string;
60
- expiresIn?: number;
61
- refreshToken?: string;
62
- refreshExpiresIn?: number;
63
- clientId?: string;
64
- };
18
+ type Auth = CortiAuth.AuthServer | CortiAuth.AuthTokenDerivable;
65
19
  type Options = (OptionsBase & {
66
- auth: {
67
- clientId: string;
68
- clientSecret: string;
69
- } | {
70
- clientId: string;
71
- username: string;
72
- password: string;
73
- } | {
74
- clientId: string;
75
- clientSecret: string;
76
- code: string;
77
- redirectUri: string;
78
- } | {
79
- clientId: string;
80
- code: string;
81
- redirectUri: string;
82
- codeVerifier?: string;
83
- };
20
+ auth: CortiAuth.AuthServer;
84
21
  tenantName: string;
85
22
  environment: Environment;
86
23
  }) | (OptionsBase & {
87
- auth: TokenDerivableAuth;
24
+ auth: CortiAuth.AuthTokenDerivable;
88
25
  tenantName?: string;
89
26
  environment?: Environment;
90
27
  }) | (OptionsBase & {
91
28
  baseUrl: string;
92
- auth?: CortiClient.Auth;
29
+ auth?: Auth;
93
30
  tenantName?: string;
94
31
  environment?: Environment;
95
32
  }) | (OptionsBase & {
96
33
  environment: environments.CortiEnvironmentUrls;
97
- auth?: CortiClient.Auth;
34
+ auth?: Auth;
98
35
  tenantName?: string;
99
36
  });
100
37
  interface RequestOptions extends BaseCortiClient.RequestOptions {
@@ -104,10 +41,29 @@ export declare class CortiClient extends BaseCortiClient {
104
41
  protected _auth: CortiAuth | undefined;
105
42
  protected _stream: CustomStream | undefined;
106
43
  protected _transcribe: CustomTranscribe | undefined;
44
+ protected _agents: CustomAgents | undefined;
107
45
  private readonly _encodeHeadersAsWsProtocols;
108
46
  constructor(options: CortiClient.Options);
109
47
  get auth(): CortiAuth;
110
48
  get stream(): CustomStream;
111
49
  get transcribe(): CustomTranscribe;
50
+ get agents(): CustomAgents;
51
+ /**
52
+ * Retrieves authentication headers for API requests.
53
+ *
54
+ * This method returns a Headers object containing the Authorization header with a valid
55
+ * bearer token and the Tenant-Name header. The token is automatically refreshed if needed.
56
+ *
57
+ * @returns A Promise that resolves to a Headers object with Authorization and Tenant-Name headers
58
+ *
59
+ * @example
60
+ * ```typescript
61
+ * const client = new CortiClient({ ... });
62
+ * const headers = await client.getAuthHeaders();
63
+ * console.log(headers.get("Authorization")); // "Bearer ..."
64
+ * console.log(headers.get("Tenant-Name")); // "your-tenant"
65
+ * ```
66
+ */
67
+ getAuthHeaders: () => Promise<Headers>;
112
68
  }
113
69
  export {};
@@ -1,20 +1,85 @@
1
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
2
44
  Object.defineProperty(exports, "__esModule", { value: true });
3
45
  exports.CortiClient = void 0;
4
46
  const Client_js_1 = require("../Client.js");
47
+ const core = __importStar(require("../core/index.js"));
48
+ const CustomAgents_js_1 = require("./agents/CustomAgents.js");
5
49
  const CortiAuth_js_1 = require("./auth/CortiAuth.js");
6
50
  const CustomStream_js_1 = require("./stream/CustomStream.js");
7
51
  const CustomTranscribe_js_1 = require("./transcribe/CustomTranscribe.js");
8
52
  const authToBaseOptions_js_1 = require("./utils/authToBaseOptions.js");
9
- const withCredentialsConfig_js_1 = require("./utils/withCredentialsConfig.js");
10
53
  const environment_js_1 = require("./utils/environment.js");
11
54
  const resolveClientOptions_js_1 = require("./utils/resolveClientOptions.js");
55
+ const withCredentialsConfig_js_1 = require("./utils/withCredentialsConfig.js");
12
56
  class CortiClient extends Client_js_1.CortiClient {
13
57
  constructor(options) {
14
58
  const opts = options;
15
59
  const ctx = (0, resolveClientOptions_js_1.resolveClientOptions)(options);
16
60
  const restOptions = Object.assign(Object.assign(Object.assign({}, opts), { tenantName: ctx.tenantName, environment: (0, environment_js_1.getEnvironment)(ctx.environment) }), (ctx.initialTokenResponse != null ? { initialTokenResponse: ctx.initialTokenResponse } : {}));
17
61
  super((0, authToBaseOptions_js_1.authToBaseOptions)(opts.auth, restOptions));
62
+ /**
63
+ * Retrieves authentication headers for API requests.
64
+ *
65
+ * This method returns a Headers object containing the Authorization header with a valid
66
+ * bearer token and the Tenant-Name header. The token is automatically refreshed if needed.
67
+ *
68
+ * @returns A Promise that resolves to a Headers object with Authorization and Tenant-Name headers
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * const client = new CortiClient({ ... });
73
+ * const headers = await client.getAuthHeaders();
74
+ * console.log(headers.get("Authorization")); // "Bearer ..."
75
+ * console.log(headers.get("Tenant-Name")); // "your-tenant"
76
+ * ```
77
+ */
78
+ this.getAuthHeaders = () => __awaiter(this, void 0, void 0, function* () {
79
+ var _a;
80
+ const req = yield this._options.authProvider.getAuthRequest();
81
+ return new Headers(Object.assign(Object.assign({}, ((_a = req.headers) !== null && _a !== void 0 ? _a : {})), { "Tenant-Name": yield core.Supplier.get(this._options.tenantName) }));
82
+ });
18
83
  (0, withCredentialsConfig_js_1.setDefaultWithCredentials)(options.withCredentials);
19
84
  this._encodeHeadersAsWsProtocols = options.encodeHeadersAsWsProtocols;
20
85
  }
@@ -30,5 +95,9 @@ class CortiClient extends Client_js_1.CortiClient {
30
95
  var _a;
31
96
  return ((_a = this._transcribe) !== null && _a !== void 0 ? _a : (this._transcribe = new CustomTranscribe_js_1.CustomTranscribe(Object.assign(Object.assign({}, this._options), { encodeHeadersAsWsProtocols: this._encodeHeadersAsWsProtocols }))));
32
97
  }
98
+ get agents() {
99
+ var _a;
100
+ return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new CustomAgents_js_1.CustomAgents(this._options)));
101
+ }
33
102
  }
34
103
  exports.CortiClient = CortiClient;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * This file is the custom implementation of the Agents client (src/api/resources/agents/client/Client.ts)
3
+ *
4
+ * It extends the auto-generated Agents class and adds custom helper methods.
5
+ *
6
+ * All the patches marked with `// Patch: ...` comments.
7
+ */
8
+ import { AgentsClient } from "../../api/resources/agents/client/Client.js";
9
+ export declare class CustomAgents extends AgentsClient {
10
+ /**
11
+ * Returns the URL for the agent card JSON file.
12
+ *
13
+ * @param {string} agentId - The ID of the agent
14
+ * @returns {Promise<URL>} A Promise that resolves to the URL for the agent card
15
+ *
16
+ * @example
17
+ * const url = await client.agents.getAgentCardUrl("agent-123");
18
+ */
19
+ getCardUrl: (agentId: string) => Promise<URL>;
20
+ }
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ /**
3
+ * This file is the custom implementation of the Agents client (src/api/resources/agents/client/Client.ts)
4
+ *
5
+ * It extends the auto-generated Agents class and adds custom helper methods.
6
+ *
7
+ * All the patches marked with `// Patch: ...` comments.
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || (function () {
26
+ var ownKeys = function(o) {
27
+ ownKeys = Object.getOwnPropertyNames || function (o) {
28
+ var ar = [];
29
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
+ return ar;
31
+ };
32
+ return ownKeys(o);
33
+ };
34
+ return function (mod) {
35
+ if (mod && mod.__esModule) return mod;
36
+ var result = {};
37
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
+ __setModuleDefault(result, mod);
39
+ return result;
40
+ };
41
+ })();
42
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
43
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
44
+ return new (P || (P = Promise))(function (resolve, reject) {
45
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
46
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
47
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
48
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
49
+ });
50
+ };
51
+ Object.defineProperty(exports, "__esModule", { value: true });
52
+ exports.CustomAgents = void 0;
53
+ const Client_js_1 = require("../../api/resources/agents/client/Client.js");
54
+ const core = __importStar(require("../../core/index.js"));
55
+ class CustomAgents extends Client_js_1.AgentsClient {
56
+ constructor() {
57
+ super(...arguments);
58
+ /**
59
+ * Returns the URL for the agent card JSON file.
60
+ *
61
+ * @param {string} agentId - The ID of the agent
62
+ * @returns {Promise<URL>} A Promise that resolves to the URL for the agent card
63
+ *
64
+ * @example
65
+ * const url = await client.agents.getAgentCardUrl("agent-123");
66
+ */
67
+ this.getCardUrl = (agentId) => __awaiter(this, void 0, void 0, function* () {
68
+ const encodedAgentId = encodeURIComponent(agentId);
69
+ return new URL(`/agents/${encodedAgentId}/agent-card.json`, (yield core.Supplier.get(this._options.environment)).agents);
70
+ });
71
+ }
72
+ }
73
+ exports.CustomAgents = CustomAgents;
@@ -45,6 +45,32 @@ export declare namespace CortiAuth {
45
45
  codeVerifier?: string;
46
46
  scopes?: string[];
47
47
  }
48
+ /**
49
+ * Auth shapes used by `CortiClient` when passing `auth: ...`.
50
+ */
51
+ type AuthClientCredentials = {
52
+ clientId: string;
53
+ clientSecret: string;
54
+ };
55
+ type AuthRopc = Omit<GetRopcFlowTokenRequest, "scopes">;
56
+ type AuthCode = Omit<GetCodeFlowTokenRequest, "scopes">;
57
+ type AuthPkce = Omit<GetPkceFlowTokenRequest, "scopes">;
58
+ type AuthTokenDerivable = {
59
+ accessToken: string;
60
+ refreshAccessToken?: OAuthAuthProvider.RefreshAccessTokenFunction;
61
+ expiresIn?: number;
62
+ refreshToken?: string;
63
+ refreshExpiresIn?: number;
64
+ clientId?: string;
65
+ } | {
66
+ refreshAccessToken: OAuthAuthProvider.RefreshAccessTokenFunction;
67
+ accessToken?: string;
68
+ expiresIn?: number;
69
+ refreshToken?: string;
70
+ refreshExpiresIn?: number;
71
+ clientId?: string;
72
+ };
73
+ type AuthServer = AuthClientCredentials | AuthRopc | AuthCode | AuthPkce;
48
74
  /** Parameters for authorizeURL — builds the Keycloak authorization endpoint URL. */
49
75
  interface AuthorizationCodeClient {
50
76
  clientId: string;
@@ -61,6 +87,7 @@ export declare namespace CortiAuth {
61
87
  }
62
88
  }
63
89
  export declare class CortiAuth extends AuthClient {
90
+ private readonly _tenantName;
64
91
  /** No-op auth provider so super.token() does not trigger OAuth refresh. When auth is omitted, a dummy token is passed so the base constructor does not throw. */
65
92
  constructor(options: CortiAuth.Options);
66
93
  /**