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

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 (116) 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/types/AgentsAgentCard.d.ts +2 -2
  6. package/dist/cjs/api/types/AgentsErrorResponse.d.ts +2 -2
  7. package/dist/cjs/api/types/CodesGeneralResponse.d.ts +1 -1
  8. package/dist/cjs/api/types/CommonCodingSystemEnum.d.ts +4 -0
  9. package/dist/cjs/api/types/CommonCodingSystemEnum.js +4 -0
  10. package/dist/cjs/api/types/StreamConfig.d.ts +2 -0
  11. package/dist/cjs/api/types/StreamConfigXCortiRetentionPolicy.d.ts +6 -0
  12. package/dist/cjs/api/types/StreamConfigXCortiRetentionPolicy.js +9 -0
  13. package/dist/cjs/api/types/index.d.ts +1 -0
  14. package/dist/cjs/api/types/index.js +1 -0
  15. package/dist/cjs/custom/CortiClient.js +1 -1
  16. package/dist/cjs/custom/auth/CortiAuth.d.ts +1 -0
  17. package/dist/cjs/custom/auth/CortiAuth.js +7 -3
  18. package/dist/cjs/custom/auth/OAuthAuthCodeAuthProvider.js +1 -1
  19. package/dist/cjs/custom/auth/OAuthPkceAuthProvider.js +1 -1
  20. package/dist/cjs/custom/auth/OAuthRopcAuthProvider.js +1 -1
  21. package/dist/cjs/custom/overrides/OAuthAuthProvider.js +1 -1
  22. package/dist/cjs/custom/overrides/fetcher/index.d.ts +2 -2
  23. package/dist/cjs/custom/overrides/fetcher/index.js +4 -4
  24. package/dist/cjs/custom/overrides/index.d.ts +5 -5
  25. package/dist/cjs/custom/overrides/index.js +7 -7
  26. package/dist/cjs/custom/proxy/CustomProxyStream.d.ts +1 -1
  27. package/dist/cjs/custom/proxy/CustomProxyTranscribe.d.ts +1 -1
  28. package/dist/cjs/custom/stream/CustomStream.d.ts +2 -2
  29. package/dist/cjs/custom/stream/CustomStream.js +4 -4
  30. package/dist/cjs/custom/transcribe/CustomTranscribe.d.ts +2 -2
  31. package/dist/cjs/custom/transcribe/CustomTranscribe.js +4 -4
  32. package/dist/cjs/custom/utils/encodeHeadersAsWsProtocols.js +2 -11
  33. package/dist/cjs/custom/utils/index.d.ts +2 -2
  34. package/dist/cjs/custom/utils/index.js +3 -3
  35. package/dist/cjs/custom/utils/sdkHeaderNames.d.ts +1 -0
  36. package/dist/cjs/custom/utils/sdkHeaderNames.js +12 -0
  37. package/dist/cjs/custom/utils/stripFernNormalizedHeaders.d.ts +5 -0
  38. package/dist/cjs/custom/utils/stripFernNormalizedHeaders.js +27 -0
  39. package/dist/cjs/custom/utils/withCredentialsConfig.js +1 -1
  40. package/dist/cjs/serialization/types/AgentsAgentCard.d.ts +2 -2
  41. package/dist/cjs/serialization/types/AgentsAgentCard.js +2 -2
  42. package/dist/cjs/serialization/types/AgentsErrorResponse.d.ts +2 -2
  43. package/dist/cjs/serialization/types/AgentsErrorResponse.js +1 -2
  44. package/dist/cjs/serialization/types/AgentsValidationErrorResponse.d.ts +3 -2
  45. package/dist/cjs/serialization/types/AgentsValidationErrorResponse.js +2 -2
  46. package/dist/cjs/serialization/types/CodesGeneralResponse.d.ts +1 -1
  47. package/dist/cjs/serialization/types/CodesGeneralResponse.js +1 -1
  48. package/dist/cjs/serialization/types/CommonCodingSystemEnum.d.ts +1 -1
  49. package/dist/cjs/serialization/types/CommonCodingSystemEnum.js +10 -1
  50. package/dist/cjs/serialization/types/StreamConfig.d.ts +2 -0
  51. package/dist/cjs/serialization/types/StreamConfig.js +2 -0
  52. package/dist/cjs/serialization/types/StreamConfigXCortiRetentionPolicy.d.ts +7 -0
  53. package/dist/cjs/serialization/types/StreamConfigXCortiRetentionPolicy.js +39 -0
  54. package/dist/cjs/serialization/types/index.d.ts +1 -0
  55. package/dist/cjs/serialization/types/index.js +1 -0
  56. package/dist/cjs/version.d.ts +1 -1
  57. package/dist/cjs/version.js +1 -1
  58. package/dist/esm/BaseClient.mjs +2 -2
  59. package/dist/esm/api/resources/codes/client/Client.d.mts +1 -1
  60. package/dist/esm/api/resources/codes/client/Client.mjs +1 -1
  61. package/dist/esm/api/types/AgentsAgentCard.d.mts +2 -2
  62. package/dist/esm/api/types/AgentsErrorResponse.d.mts +2 -2
  63. package/dist/esm/api/types/CodesGeneralResponse.d.mts +1 -1
  64. package/dist/esm/api/types/CommonCodingSystemEnum.d.mts +4 -0
  65. package/dist/esm/api/types/CommonCodingSystemEnum.mjs +4 -0
  66. package/dist/esm/api/types/StreamConfig.d.mts +2 -0
  67. package/dist/esm/api/types/StreamConfigXCortiRetentionPolicy.d.mts +6 -0
  68. package/dist/esm/api/types/StreamConfigXCortiRetentionPolicy.mjs +6 -0
  69. package/dist/esm/api/types/index.d.mts +1 -0
  70. package/dist/esm/api/types/index.mjs +1 -0
  71. package/dist/esm/custom/CortiClient.mjs +1 -1
  72. package/dist/esm/custom/auth/CortiAuth.d.mts +1 -0
  73. package/dist/esm/custom/auth/CortiAuth.mjs +7 -3
  74. package/dist/esm/custom/auth/OAuthAuthCodeAuthProvider.mjs +1 -1
  75. package/dist/esm/custom/auth/OAuthPkceAuthProvider.mjs +1 -1
  76. package/dist/esm/custom/auth/OAuthRopcAuthProvider.mjs +1 -1
  77. package/dist/esm/custom/overrides/OAuthAuthProvider.mjs +1 -1
  78. package/dist/esm/custom/overrides/fetcher/index.d.mts +2 -2
  79. package/dist/esm/custom/overrides/fetcher/index.mjs +2 -2
  80. package/dist/esm/custom/overrides/index.d.mts +5 -5
  81. package/dist/esm/custom/overrides/index.mjs +3 -5
  82. package/dist/esm/custom/proxy/CustomProxyStream.d.mts +1 -1
  83. package/dist/esm/custom/proxy/CustomProxyStream.mjs +0 -1
  84. package/dist/esm/custom/proxy/CustomProxyTranscribe.d.mts +1 -1
  85. package/dist/esm/custom/proxy/CustomProxyTranscribe.mjs +0 -1
  86. package/dist/esm/custom/stream/CustomStream.d.mts +2 -2
  87. package/dist/esm/custom/stream/CustomStream.mjs +4 -4
  88. package/dist/esm/custom/transcribe/CustomTranscribe.d.mts +2 -2
  89. package/dist/esm/custom/transcribe/CustomTranscribe.mjs +4 -4
  90. package/dist/esm/custom/utils/encodeHeadersAsWsProtocols.mjs +1 -10
  91. package/dist/esm/custom/utils/index.d.mts +2 -2
  92. package/dist/esm/custom/utils/index.mjs +1 -1
  93. package/dist/esm/custom/utils/sdkHeaderNames.d.mts +1 -0
  94. package/dist/esm/custom/utils/sdkHeaderNames.mjs +9 -0
  95. package/dist/esm/custom/utils/stripFernNormalizedHeaders.d.mts +5 -0
  96. package/dist/esm/custom/utils/stripFernNormalizedHeaders.mjs +24 -0
  97. package/dist/esm/custom/utils/withCredentialsConfig.mjs +1 -1
  98. package/dist/esm/serialization/types/AgentsAgentCard.d.mts +2 -2
  99. package/dist/esm/serialization/types/AgentsAgentCard.mjs +2 -2
  100. package/dist/esm/serialization/types/AgentsErrorResponse.d.mts +2 -2
  101. package/dist/esm/serialization/types/AgentsErrorResponse.mjs +1 -2
  102. package/dist/esm/serialization/types/AgentsValidationErrorResponse.d.mts +3 -2
  103. package/dist/esm/serialization/types/AgentsValidationErrorResponse.mjs +2 -2
  104. package/dist/esm/serialization/types/CodesGeneralResponse.d.mts +1 -1
  105. package/dist/esm/serialization/types/CodesGeneralResponse.mjs +1 -1
  106. package/dist/esm/serialization/types/CommonCodingSystemEnum.d.mts +1 -1
  107. package/dist/esm/serialization/types/CommonCodingSystemEnum.mjs +10 -1
  108. package/dist/esm/serialization/types/StreamConfig.d.mts +2 -0
  109. package/dist/esm/serialization/types/StreamConfig.mjs +2 -0
  110. package/dist/esm/serialization/types/StreamConfigXCortiRetentionPolicy.d.mts +7 -0
  111. package/dist/esm/serialization/types/StreamConfigXCortiRetentionPolicy.mjs +3 -0
  112. package/dist/esm/serialization/types/index.d.mts +1 -0
  113. package/dist/esm/serialization/types/index.mjs +1 -0
  114. package/dist/esm/version.d.mts +1 -1
  115. package/dist/esm/version.mjs +1 -1
  116. package/package.json +3 -2
@@ -0,0 +1,5 @@
1
+ import type { BaseClientOptions } from "../../BaseClient.mjs";
2
+ type Headers = BaseClientOptions["headers"];
3
+ type HeaderValue = NonNullable<Headers>[string];
4
+ export declare function stripFernNormalizedHeaders(headers: Headers): Record<string, HeaderValue>;
5
+ export {};
@@ -0,0 +1,24 @@
1
+ import { SDK_HEADER_NAMES } from "./sdkHeaderNames.mjs";
2
+ function normalizeHeaderKeys(headers) {
3
+ const result = {};
4
+ if (headers == null) {
5
+ return result;
6
+ }
7
+ for (const [key, value] of Object.entries(headers)) {
8
+ const insensitiveKey = key.toLowerCase();
9
+ if (value != null) {
10
+ result[insensitiveKey] = value;
11
+ }
12
+ else if (insensitiveKey in result) {
13
+ delete result[insensitiveKey];
14
+ }
15
+ }
16
+ return result;
17
+ }
18
+ export function stripFernNormalizedHeaders(headers) {
19
+ const normalized = normalizeHeaderKeys(headers);
20
+ for (const headerName of SDK_HEADER_NAMES) {
21
+ delete normalized[headerName.toLowerCase()];
22
+ }
23
+ return normalized;
24
+ }
@@ -2,7 +2,7 @@
2
2
  * Global default for fetcher withCredentials. Set by CortiClient when withCredentials
3
3
  * is passed in options; the core fetcher reads this when args.withCredentials is undefined.
4
4
  */
5
- let defaultWithCredentials = undefined;
5
+ let defaultWithCredentials;
6
6
  export function getDefaultWithCredentials() {
7
7
  return defaultWithCredentials;
8
8
  }
@@ -17,9 +17,9 @@ export declare namespace AgentsAgentCard {
17
17
  additionalInterfaces?: (AgentsAgentInterface.Raw[] | null | undefined) | null;
18
18
  iconUrl?: (string | null | undefined) | null;
19
19
  documentationUrl?: (string | null | undefined) | null;
20
- provider?: AgentsAgentProvider.Raw | null;
20
+ provider?: (AgentsAgentProvider.Raw | null | undefined) | null;
21
21
  version: string;
22
- capabilities: AgentsAgentCapabilities.Raw;
22
+ capabilities?: AgentsAgentCapabilities.Raw | null;
23
23
  securitySchemes?: (Record<string, unknown> | null | undefined) | null;
24
24
  security?: (Record<string, unknown> | null | undefined) | null;
25
25
  defaultInputModes: string[];
@@ -14,9 +14,9 @@ export const AgentsAgentCard = core.serialization.object({
14
14
  additionalInterfaces: core.serialization.list(AgentsAgentInterface).optionalNullable(),
15
15
  iconUrl: core.serialization.string().optionalNullable(),
16
16
  documentationUrl: core.serialization.string().optionalNullable(),
17
- provider: AgentsAgentProvider.optional(),
17
+ provider: AgentsAgentProvider.optionalNullable(),
18
18
  version: core.serialization.string(),
19
- capabilities: AgentsAgentCapabilities,
19
+ capabilities: AgentsAgentCapabilities.nullable(),
20
20
  securitySchemes: core.serialization
21
21
  .record(core.serialization.string(), core.serialization.unknown())
22
22
  .optionalNullable(),
@@ -1,6 +1,6 @@
1
1
  import type * as Corti from "../../api/index.mjs";
2
2
  import * as core from "../../core/index.mjs";
3
- import * as serializers from "../index.mjs";
3
+ import type * as serializers from "../index.mjs";
4
4
  export declare const AgentsErrorResponse: core.serialization.ObjectSchema<serializers.AgentsErrorResponse.Raw, Corti.AgentsErrorResponse>;
5
5
  export declare namespace AgentsErrorResponse {
6
6
  interface Raw {
@@ -8,6 +8,6 @@ export declare namespace AgentsErrorResponse {
8
8
  description: string;
9
9
  howToFix?: string | null;
10
10
  details?: Record<string, unknown> | null;
11
- cause?: serializers.AgentsErrorResponse.Raw | null;
11
+ cause?: Record<string, unknown> | null;
12
12
  }
13
13
  }
@@ -1,10 +1,9 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  import * as core from "../../core/index.mjs";
3
- import * as serializers from "../index.mjs";
4
3
  export const AgentsErrorResponse = core.serialization.object({
5
4
  code: core.serialization.string(),
6
5
  description: core.serialization.string(),
7
6
  howToFix: core.serialization.string().optional(),
8
7
  details: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
9
- cause: core.serialization.lazyObject(() => serializers.AgentsErrorResponse).optional(),
8
+ cause: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
10
9
  });
@@ -1,10 +1,11 @@
1
1
  import type * as Corti from "../../api/index.mjs";
2
2
  import * as core from "../../core/index.mjs";
3
- import * as serializers from "../index.mjs";
3
+ import type * as serializers from "../index.mjs";
4
+ import { AgentsErrorResponse } from "./AgentsErrorResponse.mjs";
4
5
  import { AgentsValidationError } from "./AgentsValidationError.mjs";
5
6
  export declare const AgentsValidationErrorResponse: core.serialization.ObjectSchema<serializers.AgentsValidationErrorResponse.Raw, Corti.AgentsValidationErrorResponse>;
6
7
  export declare namespace AgentsValidationErrorResponse {
7
- interface Raw extends serializers.AgentsErrorResponse.Raw {
8
+ interface Raw extends AgentsErrorResponse.Raw {
8
9
  detail?: AgentsValidationError.Raw[] | null;
9
10
  }
10
11
  }
@@ -1,9 +1,9 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  import * as core from "../../core/index.mjs";
3
- import * as serializers from "../index.mjs";
3
+ import { AgentsErrorResponse } from "./AgentsErrorResponse.mjs";
4
4
  import { AgentsValidationError } from "./AgentsValidationError.mjs";
5
5
  export const AgentsValidationErrorResponse = core.serialization
6
6
  .object({
7
7
  detail: core.serialization.list(AgentsValidationError).optional(),
8
8
  })
9
- .extend(core.serialization.lazyObject(() => serializers.AgentsErrorResponse));
9
+ .extend(AgentsErrorResponse);
@@ -8,6 +8,6 @@ export declare namespace CodesGeneralResponse {
8
8
  interface Raw {
9
9
  codes: CodesGeneralReadResponse.Raw[];
10
10
  candidates: CodesGeneralReadResponse.Raw[];
11
- usageInfo?: CommonUsageInfo.Raw | null;
11
+ usageInfo: CommonUsageInfo.Raw;
12
12
  }
13
13
  }
@@ -5,5 +5,5 @@ import { CommonUsageInfo } from "./CommonUsageInfo.mjs";
5
5
  export const CodesGeneralResponse = core.serialization.object({
6
6
  codes: core.serialization.list(CodesGeneralReadResponse),
7
7
  candidates: core.serialization.list(CodesGeneralReadResponse),
8
- usageInfo: CommonUsageInfo.optional(),
8
+ usageInfo: CommonUsageInfo,
9
9
  });
@@ -3,5 +3,5 @@ import * as core from "../../core/index.mjs";
3
3
  import type * as serializers from "../index.mjs";
4
4
  export declare const CommonCodingSystemEnum: core.serialization.Schema<serializers.CommonCodingSystemEnum.Raw, Corti.CommonCodingSystemEnum>;
5
5
  export declare namespace CommonCodingSystemEnum {
6
- type Raw = "icd10cm-inpatient" | "icd10cm-outpatient" | "icd10pcs" | "cpt";
6
+ type Raw = "icd10cm-inpatient" | "icd10cm-outpatient" | "icd10pcs" | "cpt" | "icd10int-inpatient" | "icd10int-outpatient" | "icd10uk-inpatient" | "icd10uk-outpatient";
7
7
  }
@@ -1,3 +1,12 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  import * as core from "../../core/index.mjs";
3
- export const CommonCodingSystemEnum = core.serialization.enum_(["icd10cm-inpatient", "icd10cm-outpatient", "icd10pcs", "cpt"]);
3
+ export const CommonCodingSystemEnum = core.serialization.enum_([
4
+ "icd10cm-inpatient",
5
+ "icd10cm-outpatient",
6
+ "icd10pcs",
7
+ "cpt",
8
+ "icd10int-inpatient",
9
+ "icd10int-outpatient",
10
+ "icd10uk-inpatient",
11
+ "icd10uk-outpatient",
12
+ ]);
@@ -3,10 +3,12 @@ import * as core from "../../core/index.mjs";
3
3
  import type * as serializers from "../index.mjs";
4
4
  import { StreamConfigMode } from "./StreamConfigMode.mjs";
5
5
  import { StreamConfigTranscription } from "./StreamConfigTranscription.mjs";
6
+ import { StreamConfigXCortiRetentionPolicy } from "./StreamConfigXCortiRetentionPolicy.mjs";
6
7
  export declare const StreamConfig: core.serialization.ObjectSchema<serializers.StreamConfig.Raw, Corti.StreamConfig>;
7
8
  export declare namespace StreamConfig {
8
9
  interface Raw {
9
10
  transcription: StreamConfigTranscription.Raw;
10
11
  mode: StreamConfigMode.Raw;
12
+ "X-Corti-Retention-Policy"?: StreamConfigXCortiRetentionPolicy.Raw | null;
11
13
  }
12
14
  }
@@ -2,7 +2,9 @@
2
2
  import * as core from "../../core/index.mjs";
3
3
  import { StreamConfigMode } from "./StreamConfigMode.mjs";
4
4
  import { StreamConfigTranscription } from "./StreamConfigTranscription.mjs";
5
+ import { StreamConfigXCortiRetentionPolicy } from "./StreamConfigXCortiRetentionPolicy.mjs";
5
6
  export const StreamConfig = core.serialization.object({
6
7
  transcription: StreamConfigTranscription,
7
8
  mode: StreamConfigMode,
9
+ xCortiRetentionPolicy: core.serialization.property("X-Corti-Retention-Policy", StreamConfigXCortiRetentionPolicy.optional()),
8
10
  });
@@ -0,0 +1,7 @@
1
+ import type * as Corti from "../../api/index.mjs";
2
+ import * as core from "../../core/index.mjs";
3
+ import type * as serializers from "../index.mjs";
4
+ export declare const StreamConfigXCortiRetentionPolicy: core.serialization.Schema<serializers.StreamConfigXCortiRetentionPolicy.Raw, Corti.StreamConfigXCortiRetentionPolicy>;
5
+ export declare namespace StreamConfigXCortiRetentionPolicy {
6
+ type Raw = "retain" | "none";
7
+ }
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as core from "../../core/index.mjs";
3
+ export const StreamConfigXCortiRetentionPolicy = core.serialization.enum_(["retain", "none"]);
@@ -135,6 +135,7 @@ export * from "./StreamConfigParticipantRole.mjs";
135
135
  export * from "./StreamConfigStatusMessage.mjs";
136
136
  export * from "./StreamConfigStatusMessageType.mjs";
137
137
  export * from "./StreamConfigTranscription.mjs";
138
+ export * from "./StreamConfigXCortiRetentionPolicy.mjs";
138
139
  export * from "./StreamEndedMessage.mjs";
139
140
  export * from "./StreamEndMessage.mjs";
140
141
  export * from "./StreamErrorDetail.mjs";
@@ -135,6 +135,7 @@ export * from "./StreamConfigParticipantRole.mjs";
135
135
  export * from "./StreamConfigStatusMessage.mjs";
136
136
  export * from "./StreamConfigStatusMessageType.mjs";
137
137
  export * from "./StreamConfigTranscription.mjs";
138
+ export * from "./StreamConfigXCortiRetentionPolicy.mjs";
138
139
  export * from "./StreamEndedMessage.mjs";
139
140
  export * from "./StreamEndMessage.mjs";
140
141
  export * from "./StreamErrorDetail.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.0-alpha.2";
1
+ export declare const SDK_VERSION = "1.0.0-rc.2";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.0.0-alpha.2";
1
+ export const SDK_VERSION = "1.0.0-rc.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corti/sdk",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-rc.2",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -65,7 +65,8 @@
65
65
  "build:esm": "tsc --project ./tsconfig.esm.json && node scripts/rename-to-esm-files.js dist/esm",
66
66
  "test": "vitest",
67
67
  "test:unit": "vitest --project unit",
68
- "test:wire": "vitest --project wire"
68
+ "test:wire": "vitest --project wire",
69
+ "test:integration": "vitest --config vitest.integration.config.mts"
69
70
  },
70
71
  "dependencies": {
71
72
  "ws": "^8.16.0"