@corti/sdk 0.1.3-alpha → 0.1.3-rc
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.
- package/README.md +29 -16
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/errors/NotFoundError.d.ts +1 -2
- package/dist/cjs/api/index.d.ts +4 -0
- package/dist/cjs/api/index.js +4 -0
- package/dist/cjs/api/resources/documents/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/documents/client/Client.js +4 -10
- package/dist/cjs/api/resources/facts/client/Client.d.ts +6 -4
- package/dist/cjs/api/resources/facts/client/Client.js +6 -4
- package/dist/cjs/api/resources/facts/client/requests/FactsUpdateRequest.d.ts +2 -2
- package/dist/cjs/api/resources/index.d.ts +1 -2
- package/dist/cjs/api/resources/index.js +2 -3
- package/dist/cjs/api/resources/interactions/client/Client.d.ts +5 -5
- package/dist/cjs/api/resources/interactions/client/Client.js +5 -5
- package/dist/cjs/api/resources/recordings/client/Client.d.ts +6 -8
- package/dist/cjs/api/resources/recordings/client/Client.js +13 -24
- package/dist/cjs/api/resources/templates/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/templates/client/Client.js +2 -2
- package/dist/cjs/api/resources/transcripts/client/Client.d.ts +5 -6
- package/dist/cjs/api/resources/transcripts/client/Client.js +5 -6
- package/dist/cjs/api/resources/transcripts/client/requests/TranscriptsCreateRequest.d.ts +1 -4
- package/dist/cjs/api/resources/transcripts/index.d.ts +0 -1
- package/dist/cjs/api/resources/transcripts/index.js +0 -1
- package/dist/cjs/api/types/CommonTranscriptRequest.d.ts +17 -0
- package/dist/cjs/api/types/{CommonTranscript.d.ts → CommonTranscriptResponse.d.ts} +1 -1
- package/dist/cjs/api/types/DocumentsContext.d.ts +11 -5
- package/dist/cjs/api/types/DocumentsContextWithFacts.d.ts +8 -0
- package/dist/cjs/api/types/DocumentsContextWithString.d.ts +7 -0
- package/dist/cjs/api/types/DocumentsContextWithString.js +5 -0
- package/dist/cjs/api/types/DocumentsContextWithTranscript.d.ts +8 -0
- package/dist/cjs/api/types/DocumentsContextWithTranscript.js +5 -0
- package/dist/cjs/api/types/DocumentsCreateRequest.d.ts +7 -1
- package/dist/cjs/api/types/DocumentsCreateRequestWithTemplate.d.ts +2 -4
- package/dist/cjs/api/types/DocumentsCreateRequestWithTemplateKey.d.ts +2 -4
- package/dist/cjs/api/types/DocumentsTemplate.d.ts +1 -10
- package/dist/cjs/api/types/DocumentsTemplateWithSectionKeys.d.ts +11 -0
- package/dist/cjs/api/types/DocumentsTemplateWithSectionKeys.js +5 -0
- package/dist/cjs/api/types/FactsBatchUpdateInput.d.ts +1 -1
- package/dist/cjs/api/types/FactsCreateItem.d.ts +1 -1
- package/dist/cjs/api/types/FactsListItem.d.ts +1 -1
- package/dist/cjs/api/types/TemplatesSection.d.ts +1 -1
- package/dist/cjs/api/types/TemplatesSectionTranslation.d.ts +11 -0
- package/dist/cjs/api/types/TemplatesSectionTranslation.js +5 -0
- package/dist/cjs/api/types/TemplatesTranslation.d.ts +2 -2
- package/dist/cjs/api/types/TranscriptsData.d.ts +1 -1
- package/dist/cjs/api/types/TranscriptsResponse.d.ts +1 -1
- package/dist/cjs/api/types/index.d.ts +7 -4
- package/dist/cjs/api/types/index.js +7 -4
- package/dist/cjs/core/exports.d.ts +1 -0
- package/dist/cjs/{api/resources/transcripts/types/index.js → core/exports.js} +1 -1
- package/dist/cjs/core/file/exports.d.ts +1 -0
- package/dist/cjs/core/file/exports.js +2 -0
- package/dist/cjs/core/file/file.d.ts +5 -0
- package/dist/cjs/core/file/file.js +203 -0
- package/dist/cjs/core/file/index.d.ts +2 -0
- package/dist/cjs/core/file/index.js +18 -0
- package/dist/cjs/core/file/types.d.ts +66 -0
- package/dist/cjs/core/file/types.js +2 -0
- package/dist/cjs/core/index.d.ts +1 -0
- package/dist/cjs/core/index.js +2 -1
- package/dist/cjs/core/schemas/utils/maybeSkipValidation.js +1 -1
- package/dist/cjs/core/websocket/ws.js +1 -1
- package/dist/cjs/custom/CortiAuth.d.ts +8 -0
- package/dist/cjs/custom/CortiAuth.js +7 -0
- package/dist/cjs/custom/CortiClient.js +6 -11
- package/dist/cjs/custom/RefreshBearerProvider.d.ts +10 -5
- package/dist/cjs/custom/RefreshBearerProvider.js +1 -1
- package/dist/cjs/custom/index.d.ts +1 -0
- package/dist/cjs/{serialization/resources/transcripts/types → custom}/index.js +1 -1
- package/dist/cjs/custom/utils/getEnvironmentFromString.d.ts +6 -0
- package/dist/cjs/custom/utils/getEnvironmentFromString.js +13 -0
- package/dist/cjs/environments.d.ts +4 -6
- package/dist/cjs/environments.js +2 -5
- package/dist/cjs/exports.d.ts +1 -0
- package/dist/cjs/exports.js +17 -0
- package/dist/cjs/serialization/resources/index.d.ts +1 -2
- package/dist/cjs/serialization/resources/index.js +2 -3
- package/dist/cjs/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.d.ts +0 -2
- package/dist/cjs/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.js +0 -2
- package/dist/cjs/serialization/resources/transcripts/index.d.ts +0 -1
- package/dist/cjs/serialization/resources/transcripts/index.js +0 -1
- package/dist/cjs/serialization/types/CommonTranscriptRequest.d.ts +17 -0
- package/dist/cjs/serialization/types/CommonTranscriptRequest.js +48 -0
- package/dist/cjs/serialization/types/{CommonTranscript.d.ts → CommonTranscriptResponse.d.ts} +2 -2
- package/dist/cjs/serialization/types/{CommonTranscript.js → CommonTranscriptResponse.js} +2 -2
- package/dist/cjs/serialization/types/DocumentsContext.d.ts +13 -6
- package/dist/cjs/serialization/types/DocumentsContext.js +12 -5
- package/dist/cjs/serialization/types/DocumentsContextWithFacts.d.ts +13 -0
- package/dist/cjs/serialization/{resources/transcripts/types/TranscriptsCreateRequestModelName.js → types/DocumentsContextWithFacts.js} +6 -3
- package/dist/cjs/serialization/types/DocumentsContextWithString.d.ts +12 -0
- package/dist/cjs/serialization/types/{DocumentsContextTypeEnum.js → DocumentsContextWithString.js} +4 -2
- package/dist/cjs/serialization/types/DocumentsContextWithTranscript.d.ts +13 -0
- package/dist/cjs/serialization/types/{DocumentsContextData.js → DocumentsContextWithTranscript.js} +5 -8
- package/dist/cjs/serialization/types/DocumentsCreateRequest.d.ts +1 -2
- package/dist/cjs/serialization/types/DocumentsCreateRequest.js +0 -2
- package/dist/cjs/serialization/types/DocumentsCreateRequestWithTemplate.d.ts +0 -1
- package/dist/cjs/serialization/types/DocumentsCreateRequestWithTemplate.js +0 -1
- package/dist/cjs/serialization/types/DocumentsCreateRequestWithTemplateKey.d.ts +0 -1
- package/dist/cjs/serialization/types/DocumentsCreateRequestWithTemplateKey.js +0 -1
- package/dist/cjs/serialization/types/DocumentsTemplate.d.ts +2 -7
- package/dist/cjs/serialization/types/DocumentsTemplate.js +2 -41
- package/dist/cjs/serialization/types/DocumentsTemplateWithSectionKeys.d.ts +14 -0
- package/dist/cjs/serialization/types/DocumentsTemplateWithSectionKeys.js +45 -0
- package/dist/cjs/serialization/types/TemplatesSection.d.ts +2 -2
- package/dist/cjs/serialization/types/TemplatesSection.js +2 -2
- package/dist/cjs/serialization/types/TemplatesSectionTranslation.d.ts +14 -0
- package/dist/cjs/serialization/types/TemplatesSectionTranslation.js +45 -0
- package/dist/cjs/serialization/types/TemplatesTranslation.d.ts +2 -2
- package/dist/cjs/serialization/types/TemplatesTranslation.js +2 -2
- package/dist/cjs/serialization/types/TranscriptsData.d.ts +2 -2
- package/dist/cjs/serialization/types/TranscriptsData.js +2 -2
- package/dist/cjs/serialization/types/TranscriptsResponse.d.ts +2 -2
- package/dist/cjs/serialization/types/TranscriptsResponse.js +2 -2
- package/dist/cjs/serialization/types/index.d.ts +7 -4
- package/dist/cjs/serialization/types/index.js +7 -4
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/errors/NotFoundError.d.mts +1 -2
- package/dist/esm/api/index.d.mts +4 -0
- package/dist/esm/api/index.mjs +4 -0
- package/dist/esm/api/resources/documents/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/documents/client/Client.mjs +4 -10
- package/dist/esm/api/resources/facts/client/Client.d.mts +6 -4
- package/dist/esm/api/resources/facts/client/Client.mjs +6 -4
- package/dist/esm/api/resources/facts/client/requests/FactsUpdateRequest.d.mts +2 -2
- package/dist/esm/api/resources/index.d.mts +1 -2
- package/dist/esm/api/resources/index.mjs +1 -2
- package/dist/esm/api/resources/interactions/client/Client.d.mts +5 -5
- package/dist/esm/api/resources/interactions/client/Client.mjs +5 -5
- package/dist/esm/api/resources/recordings/client/Client.d.mts +6 -8
- package/dist/esm/api/resources/recordings/client/Client.mjs +13 -24
- package/dist/esm/api/resources/templates/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/templates/client/Client.mjs +2 -2
- package/dist/esm/api/resources/transcripts/client/Client.d.mts +5 -6
- package/dist/esm/api/resources/transcripts/client/Client.mjs +5 -6
- package/dist/esm/api/resources/transcripts/client/requests/TranscriptsCreateRequest.d.mts +1 -4
- package/dist/esm/api/resources/transcripts/index.d.mts +0 -1
- package/dist/esm/api/resources/transcripts/index.mjs +0 -1
- package/dist/esm/api/types/CommonTranscriptRequest.d.mts +17 -0
- package/dist/esm/api/types/{CommonTranscript.d.mts → CommonTranscriptResponse.d.mts} +1 -1
- package/dist/esm/api/types/DocumentsContext.d.mts +11 -5
- package/dist/esm/api/types/DocumentsContextWithFacts.d.mts +8 -0
- package/dist/esm/api/types/DocumentsContextWithString.d.mts +7 -0
- package/dist/esm/api/types/DocumentsContextWithString.mjs +4 -0
- package/dist/esm/api/types/DocumentsContextWithTranscript.d.mts +8 -0
- package/dist/esm/api/types/DocumentsContextWithTranscript.mjs +4 -0
- package/dist/esm/api/types/DocumentsCreateRequest.d.mts +7 -1
- package/dist/esm/api/types/DocumentsCreateRequestWithTemplate.d.mts +2 -4
- package/dist/esm/api/types/DocumentsCreateRequestWithTemplateKey.d.mts +2 -4
- package/dist/esm/api/types/DocumentsTemplate.d.mts +1 -10
- package/dist/esm/api/types/DocumentsTemplateWithSectionKeys.d.mts +11 -0
- package/dist/esm/api/types/DocumentsTemplateWithSectionKeys.mjs +4 -0
- package/dist/esm/api/types/FactsBatchUpdateInput.d.mts +1 -1
- package/dist/esm/api/types/FactsCreateItem.d.mts +1 -1
- package/dist/esm/api/types/FactsListItem.d.mts +1 -1
- package/dist/esm/api/types/TemplatesSection.d.mts +1 -1
- package/dist/esm/api/types/TemplatesSectionTranslation.d.mts +11 -0
- package/dist/esm/api/types/TemplatesSectionTranslation.mjs +4 -0
- package/dist/esm/api/types/TemplatesTranslation.d.mts +2 -2
- package/dist/esm/api/types/TranscriptsData.d.mts +1 -1
- package/dist/esm/api/types/TranscriptsResponse.d.mts +1 -1
- package/dist/esm/api/types/index.d.mts +7 -4
- package/dist/esm/api/types/index.mjs +7 -4
- package/dist/esm/core/exports.d.mts +1 -0
- package/dist/esm/core/exports.mjs +1 -0
- package/dist/esm/core/file/exports.d.mts +1 -0
- package/dist/esm/core/file/exports.mjs +1 -0
- package/dist/esm/core/file/file.d.mts +5 -0
- package/dist/esm/core/file/file.mjs +167 -0
- package/dist/esm/core/file/index.d.mts +2 -0
- package/dist/esm/core/file/index.mjs +2 -0
- package/dist/esm/core/file/types.d.mts +66 -0
- package/dist/esm/core/file/types.mjs +1 -0
- package/dist/esm/core/index.d.mts +1 -0
- package/dist/esm/core/index.mjs +1 -0
- package/dist/esm/core/schemas/utils/maybeSkipValidation.mjs +1 -1
- package/dist/esm/core/websocket/ws.mjs +1 -1
- package/dist/esm/custom/CortiAuth.d.mts +8 -0
- package/dist/esm/custom/CortiAuth.mjs +7 -0
- package/dist/esm/custom/CortiClient.mjs +6 -11
- package/dist/esm/custom/RefreshBearerProvider.d.mts +10 -5
- package/dist/esm/custom/RefreshBearerProvider.mjs +1 -1
- package/dist/esm/custom/index.d.mts +1 -0
- package/dist/esm/custom/index.mjs +1 -0
- package/dist/esm/custom/utils/getEnvironmentFromString.d.mts +6 -0
- package/dist/esm/custom/utils/getEnvironmentFromString.mjs +10 -0
- package/dist/esm/environments.d.mts +4 -6
- package/dist/esm/environments.mjs +2 -5
- package/dist/esm/exports.d.mts +1 -0
- package/dist/esm/exports.mjs +1 -0
- package/dist/esm/serialization/resources/index.d.mts +1 -2
- package/dist/esm/serialization/resources/index.mjs +1 -2
- package/dist/esm/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.d.mts +0 -2
- package/dist/esm/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.mjs +0 -2
- package/dist/esm/serialization/resources/transcripts/index.d.mts +0 -1
- package/dist/esm/serialization/resources/transcripts/index.mjs +0 -1
- package/dist/esm/serialization/types/CommonTranscriptRequest.d.mts +17 -0
- package/dist/esm/serialization/types/CommonTranscriptRequest.mjs +12 -0
- package/dist/esm/serialization/types/{CommonTranscript.d.mts → CommonTranscriptResponse.d.mts} +2 -2
- package/dist/esm/serialization/types/{CommonTranscript.mjs → CommonTranscriptResponse.mjs} +1 -1
- package/dist/esm/serialization/types/DocumentsContext.d.mts +13 -6
- package/dist/esm/serialization/types/DocumentsContext.mjs +12 -5
- package/dist/esm/serialization/types/DocumentsContextWithFacts.d.mts +13 -0
- package/dist/esm/serialization/types/DocumentsContextWithFacts.mjs +8 -0
- package/dist/esm/serialization/types/DocumentsContextWithString.d.mts +12 -0
- package/dist/esm/serialization/types/{DocumentsContextTypeEnum.mjs → DocumentsContextWithString.mjs} +3 -1
- package/dist/esm/serialization/types/DocumentsContextWithTranscript.d.mts +13 -0
- package/dist/esm/serialization/types/DocumentsContextWithTranscript.mjs +8 -0
- package/dist/esm/serialization/types/DocumentsCreateRequest.d.mts +1 -2
- package/dist/esm/serialization/types/DocumentsCreateRequest.mjs +0 -2
- package/dist/esm/serialization/types/DocumentsCreateRequestWithTemplate.d.mts +0 -1
- package/dist/esm/serialization/types/DocumentsCreateRequestWithTemplate.mjs +0 -1
- package/dist/esm/serialization/types/DocumentsCreateRequestWithTemplateKey.d.mts +0 -1
- package/dist/esm/serialization/types/DocumentsCreateRequestWithTemplateKey.mjs +0 -1
- package/dist/esm/serialization/types/DocumentsTemplate.d.mts +2 -7
- package/dist/esm/serialization/types/DocumentsTemplate.mjs +2 -8
- package/dist/esm/serialization/types/DocumentsTemplateWithSectionKeys.d.mts +14 -0
- package/dist/esm/serialization/types/DocumentsTemplateWithSectionKeys.mjs +9 -0
- package/dist/esm/serialization/types/TemplatesSection.d.mts +2 -2
- package/dist/esm/serialization/types/TemplatesSection.mjs +2 -2
- package/dist/esm/serialization/types/TemplatesSectionTranslation.d.mts +14 -0
- package/dist/esm/serialization/types/TemplatesSectionTranslation.mjs +9 -0
- package/dist/esm/serialization/types/TemplatesTranslation.d.mts +2 -2
- package/dist/esm/serialization/types/TemplatesTranslation.mjs +2 -2
- package/dist/esm/serialization/types/TranscriptsData.d.mts +2 -2
- package/dist/esm/serialization/types/TranscriptsData.mjs +2 -2
- package/dist/esm/serialization/types/TranscriptsResponse.d.mts +2 -2
- package/dist/esm/serialization/types/TranscriptsResponse.mjs +2 -2
- package/dist/esm/serialization/types/index.d.mts +7 -4
- package/dist/esm/serialization/types/index.mjs +7 -4
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +4 -3
- package/dist/cjs/api/resources/transcripts/types/TranscriptsCreateRequestModelName.d.ts +0 -12
- package/dist/cjs/api/resources/transcripts/types/TranscriptsCreateRequestModelName.js +0 -11
- package/dist/cjs/api/resources/transcripts/types/index.d.ts +0 -1
- package/dist/cjs/api/types/DocumentsContextData.d.ts +0 -14
- package/dist/cjs/api/types/DocumentsContextTypeEnum.d.ts +0 -9
- package/dist/cjs/api/types/DocumentsContextTypeEnum.js +0 -11
- package/dist/cjs/api/types/DocumentsCreateRequestWithTemplateId.d.ts +0 -16
- package/dist/cjs/serialization/resources/transcripts/types/TranscriptsCreateRequestModelName.d.ts +0 -10
- package/dist/cjs/serialization/resources/transcripts/types/index.d.ts +0 -1
- package/dist/cjs/serialization/types/DocumentsContextData.d.ts +0 -12
- package/dist/cjs/serialization/types/DocumentsContextTypeEnum.d.ts +0 -10
- package/dist/cjs/serialization/types/DocumentsCreateRequestWithTemplateId.d.ts +0 -18
- package/dist/cjs/serialization/types/DocumentsCreateRequestWithTemplateId.js +0 -49
- package/dist/esm/api/resources/transcripts/types/TranscriptsCreateRequestModelName.d.mts +0 -12
- package/dist/esm/api/resources/transcripts/types/TranscriptsCreateRequestModelName.mjs +0 -8
- package/dist/esm/api/resources/transcripts/types/index.d.mts +0 -1
- package/dist/esm/api/resources/transcripts/types/index.mjs +0 -1
- package/dist/esm/api/types/DocumentsContextData.d.mts +0 -14
- package/dist/esm/api/types/DocumentsContextTypeEnum.d.mts +0 -9
- package/dist/esm/api/types/DocumentsContextTypeEnum.mjs +0 -8
- package/dist/esm/api/types/DocumentsCreateRequestWithTemplateId.d.mts +0 -16
- package/dist/esm/serialization/resources/transcripts/types/TranscriptsCreateRequestModelName.d.mts +0 -10
- package/dist/esm/serialization/resources/transcripts/types/TranscriptsCreateRequestModelName.mjs +0 -5
- package/dist/esm/serialization/resources/transcripts/types/index.d.mts +0 -1
- package/dist/esm/serialization/resources/transcripts/types/index.mjs +0 -1
- package/dist/esm/serialization/types/DocumentsContextData.d.mts +0 -12
- package/dist/esm/serialization/types/DocumentsContextData.mjs +0 -11
- package/dist/esm/serialization/types/DocumentsContextTypeEnum.d.mts +0 -10
- package/dist/esm/serialization/types/DocumentsCreateRequestWithTemplateId.d.mts +0 -18
- package/dist/esm/serialization/types/DocumentsCreateRequestWithTemplateId.mjs +0 -13
- package/reference.md +0 -1706
- /package/dist/cjs/api/types/{CommonTranscript.js → CommonTranscriptRequest.js} +0 -0
- /package/dist/cjs/api/types/{DocumentsContextData.js → CommonTranscriptResponse.js} +0 -0
- /package/dist/cjs/api/types/{DocumentsCreateRequestWithTemplateId.js → DocumentsContextWithFacts.js} +0 -0
- /package/dist/esm/api/types/{CommonTranscript.mjs → CommonTranscriptRequest.mjs} +0 -0
- /package/dist/esm/api/types/{DocumentsContextData.mjs → CommonTranscriptResponse.mjs} +0 -0
- /package/dist/esm/api/types/{DocumentsCreateRequestWithTemplateId.mjs → DocumentsContextWithFacts.mjs} +0 -0
|
@@ -0,0 +1,203 @@
|
|
|
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
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.toBinaryUploadRequest = toBinaryUploadRequest;
|
|
46
|
+
function toBinaryUploadRequest(file) {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
const { data, filename, contentLength, contentType } = yield getFileWithMetadata(file);
|
|
49
|
+
const request = {
|
|
50
|
+
body: data,
|
|
51
|
+
headers: {},
|
|
52
|
+
};
|
|
53
|
+
if (filename) {
|
|
54
|
+
request.headers["Content-Disposition"] = `attachment; filename="${filename}"`;
|
|
55
|
+
}
|
|
56
|
+
if (contentType) {
|
|
57
|
+
request.headers["Content-Type"] = contentType;
|
|
58
|
+
}
|
|
59
|
+
if (contentLength != null) {
|
|
60
|
+
request.headers["Content-Length"] = contentLength.toString();
|
|
61
|
+
}
|
|
62
|
+
return request;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function getFileWithMetadata(file) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
var _a, _b, _c, _d, _e;
|
|
68
|
+
if (isFileLike(file)) {
|
|
69
|
+
return getFileWithMetadata({
|
|
70
|
+
data: file,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
if ("path" in file) {
|
|
74
|
+
const fs = yield Promise.resolve().then(() => __importStar(require("fs")));
|
|
75
|
+
if (!fs || !fs.createReadStream) {
|
|
76
|
+
throw new Error("File path uploads are not supported in this environment.");
|
|
77
|
+
}
|
|
78
|
+
const data = fs.createReadStream(file.path);
|
|
79
|
+
const contentLength = (_a = file.contentLength) !== null && _a !== void 0 ? _a : (yield tryGetFileSizeFromPath(file.path));
|
|
80
|
+
const filename = (_b = file.filename) !== null && _b !== void 0 ? _b : getNameFromPath(file.path);
|
|
81
|
+
return {
|
|
82
|
+
data,
|
|
83
|
+
filename,
|
|
84
|
+
contentType: file.contentType,
|
|
85
|
+
contentLength,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if ("data" in file) {
|
|
89
|
+
const data = file.data;
|
|
90
|
+
const contentLength = (_c = file.contentLength) !== null && _c !== void 0 ? _c : (yield tryGetContentLengthFromFileLike(data));
|
|
91
|
+
const filename = (_d = file.filename) !== null && _d !== void 0 ? _d : tryGetNameFromFileLike(data);
|
|
92
|
+
return {
|
|
93
|
+
data,
|
|
94
|
+
filename,
|
|
95
|
+
contentType: (_e = file.contentType) !== null && _e !== void 0 ? _e : tryGetContentTypeFromFileLike(data),
|
|
96
|
+
contentLength,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
throw new Error(`Invalid FileUpload of type ${typeof file}: ${JSON.stringify(file)}`);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function isFileLike(value) {
|
|
103
|
+
return (isBuffer(value) ||
|
|
104
|
+
isArrayBufferView(value) ||
|
|
105
|
+
isArrayBuffer(value) ||
|
|
106
|
+
isUint8Array(value) ||
|
|
107
|
+
isBlob(value) ||
|
|
108
|
+
isFile(value) ||
|
|
109
|
+
isStreamLike(value) ||
|
|
110
|
+
isReadableStream(value));
|
|
111
|
+
}
|
|
112
|
+
function tryGetFileSizeFromPath(path) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
try {
|
|
115
|
+
const fs = yield Promise.resolve().then(() => __importStar(require("fs")));
|
|
116
|
+
if (!fs || !fs.promises || !fs.promises.stat) {
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
const fileStat = yield fs.promises.stat(path);
|
|
120
|
+
return fileStat.size;
|
|
121
|
+
}
|
|
122
|
+
catch (fallbackError) {
|
|
123
|
+
return undefined;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function tryGetNameFromFileLike(data) {
|
|
128
|
+
if (isNamedValue(data)) {
|
|
129
|
+
return data.name;
|
|
130
|
+
}
|
|
131
|
+
if (isPathedValue(data)) {
|
|
132
|
+
return getNameFromPath(data.path.toString());
|
|
133
|
+
}
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
function tryGetContentLengthFromFileLike(data) {
|
|
137
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
+
if (isBuffer(data)) {
|
|
139
|
+
return data.length;
|
|
140
|
+
}
|
|
141
|
+
if (isArrayBufferView(data)) {
|
|
142
|
+
return data.byteLength;
|
|
143
|
+
}
|
|
144
|
+
if (isArrayBuffer(data)) {
|
|
145
|
+
return data.byteLength;
|
|
146
|
+
}
|
|
147
|
+
if (isBlob(data)) {
|
|
148
|
+
return data.size;
|
|
149
|
+
}
|
|
150
|
+
if (isFile(data)) {
|
|
151
|
+
return data.size;
|
|
152
|
+
}
|
|
153
|
+
if (isPathedValue(data)) {
|
|
154
|
+
return yield tryGetFileSizeFromPath(data.path.toString());
|
|
155
|
+
}
|
|
156
|
+
return undefined;
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function tryGetContentTypeFromFileLike(data) {
|
|
160
|
+
if (isBlob(data)) {
|
|
161
|
+
return data.type;
|
|
162
|
+
}
|
|
163
|
+
if (isFile(data)) {
|
|
164
|
+
return data.type;
|
|
165
|
+
}
|
|
166
|
+
return undefined;
|
|
167
|
+
}
|
|
168
|
+
function getNameFromPath(path) {
|
|
169
|
+
const lastForwardSlash = path.lastIndexOf("/");
|
|
170
|
+
const lastBackSlash = path.lastIndexOf("\\");
|
|
171
|
+
const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash);
|
|
172
|
+
return lastSlashIndex >= 0 ? path.substring(lastSlashIndex + 1) : path;
|
|
173
|
+
}
|
|
174
|
+
function isNamedValue(value) {
|
|
175
|
+
return typeof value === "object" && value != null && "name" in value;
|
|
176
|
+
}
|
|
177
|
+
function isPathedValue(value) {
|
|
178
|
+
return typeof value === "object" && value != null && "path" in value;
|
|
179
|
+
}
|
|
180
|
+
function isStreamLike(value) {
|
|
181
|
+
return typeof value === "object" && value != null && ("read" in value || "pipe" in value);
|
|
182
|
+
}
|
|
183
|
+
function isReadableStream(value) {
|
|
184
|
+
return typeof value === "object" && value != null && "getReader" in value;
|
|
185
|
+
}
|
|
186
|
+
function isBuffer(value) {
|
|
187
|
+
return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value);
|
|
188
|
+
}
|
|
189
|
+
function isArrayBufferView(value) {
|
|
190
|
+
return typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView(value);
|
|
191
|
+
}
|
|
192
|
+
function isArrayBuffer(value) {
|
|
193
|
+
return typeof ArrayBuffer !== "undefined" && value instanceof ArrayBuffer;
|
|
194
|
+
}
|
|
195
|
+
function isUint8Array(value) {
|
|
196
|
+
return typeof Uint8Array !== "undefined" && value instanceof Uint8Array;
|
|
197
|
+
}
|
|
198
|
+
function isBlob(value) {
|
|
199
|
+
return typeof Blob !== "undefined" && value instanceof Blob;
|
|
200
|
+
}
|
|
201
|
+
function isFile(value) {
|
|
202
|
+
return typeof File !== "undefined" && value instanceof File;
|
|
203
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./file.js"), exports);
|
|
18
|
+
__exportStar(require("./types.js"), exports);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A file that can be uploaded. Can be a file-like object (stream, buffer, blob, etc.),
|
|
3
|
+
* a path to a file, or an object with a file-like object and metadata.
|
|
4
|
+
*/
|
|
5
|
+
export type Uploadable = Uploadable.FileLike | Uploadable.FromPath | Uploadable.WithMetadata;
|
|
6
|
+
export declare namespace Uploadable {
|
|
7
|
+
/**
|
|
8
|
+
* Various file-like objects that can be used to upload a file.
|
|
9
|
+
*/
|
|
10
|
+
type FileLike = ArrayBuffer | ArrayBufferLike | ArrayBufferView | Uint8Array | import("buffer").Buffer | import("buffer").Blob | import("buffer").File | import("stream").Readable | import("stream/web").ReadableStream | globalThis.Blob | globalThis.File | ReadableStream;
|
|
11
|
+
/**
|
|
12
|
+
* A file path with optional metadata, used for uploading a file from the file system.
|
|
13
|
+
*/
|
|
14
|
+
type FromPath = {
|
|
15
|
+
/** The path to the file to upload */
|
|
16
|
+
path: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional override for the file name (defaults to basename of path).
|
|
19
|
+
* This is used to set the `Content-Disposition` header in upload requests.
|
|
20
|
+
*/
|
|
21
|
+
filename?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional MIME type of the file (e.g., 'image/jpeg', 'text/plain').
|
|
24
|
+
* This is used to set the `Content-Type` header in upload requests.
|
|
25
|
+
*/
|
|
26
|
+
contentType?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Optional file size in bytes.
|
|
29
|
+
* If not provided, the file size will be determined from the file system.
|
|
30
|
+
* The content length is used to set the `Content-Length` header in upload requests.
|
|
31
|
+
*/
|
|
32
|
+
contentLength?: number;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* A file-like object with metadata, used for uploading files.
|
|
36
|
+
*/
|
|
37
|
+
type WithMetadata = {
|
|
38
|
+
/** The file data */
|
|
39
|
+
data: FileLike;
|
|
40
|
+
/**
|
|
41
|
+
* Optional override for the file name (defaults to basename of path).
|
|
42
|
+
* This is used to set the `Content-Disposition` header in upload requests.
|
|
43
|
+
*/
|
|
44
|
+
filename?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Optional MIME type of the file (e.g., 'image/jpeg', 'text/plain').
|
|
47
|
+
* This is used to set the `Content-Type` header in upload requests.
|
|
48
|
+
*
|
|
49
|
+
* If not provided, the content type may be determined from the data itself.
|
|
50
|
+
* * If the data is a `File`, `Blob`, or similar, the content type will be determined from the file itself, if the type is set.
|
|
51
|
+
* * Any other data type will not have a content type set, and the upload request will use `Content-Type: application/octet-stream` instead.
|
|
52
|
+
*/
|
|
53
|
+
contentType?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Optional file size in bytes.
|
|
56
|
+
* The content length is used to set the `Content-Length` header in upload requests.
|
|
57
|
+
* If the content length is not provided and cannot be determined, the upload request will not include the `Content-Length` header, but will use `Transfer-Encoding: chunked` instead.
|
|
58
|
+
*
|
|
59
|
+
* If not provided, the file size will be determined depending on the data type.
|
|
60
|
+
* * If the data is of type `fs.ReadStream` (`createReadStream`), the size will be determined from the file system.
|
|
61
|
+
* * If the data is a `Buffer`, `ArrayBuffer`, `Uint8Array`, `Blob`, `File`, or similar, the size will be determined from the data itself.
|
|
62
|
+
* * If the data is a `Readable` or `ReadableStream`, the size will not be determined.
|
|
63
|
+
*/
|
|
64
|
+
contentLength?: number;
|
|
65
|
+
};
|
|
66
|
+
}
|
package/dist/cjs/core/index.d.ts
CHANGED
package/dist/cjs/core/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.serialization = exports.url = void 0;
|
|
39
|
+
exports.file = exports.serialization = exports.url = void 0;
|
|
40
40
|
__exportStar(require("./auth/index.js"), exports);
|
|
41
41
|
__exportStar(require("./fetcher/index.js"), exports);
|
|
42
42
|
__exportStar(require("./runtime/index.js"), exports);
|
|
@@ -46,3 +46,4 @@ __exportStar(require("./websocket/index.js"), exports);
|
|
|
46
46
|
__exportStar(require("./base64.js"), exports);
|
|
47
47
|
__exportStar(require("./utils/index.js"), exports);
|
|
48
48
|
__exportStar(require("./pagination/index.js"), exports);
|
|
49
|
+
exports.file = __importStar(require("./file/index.js"));
|
|
@@ -9,7 +9,7 @@ function transformAndMaybeSkipValidation(transform) {
|
|
|
9
9
|
const transformed = transform(value, opts);
|
|
10
10
|
const { skipValidation = false } = opts !== null && opts !== void 0 ? opts : {};
|
|
11
11
|
if (!transformed.ok && skipValidation) {
|
|
12
|
-
//
|
|
12
|
+
// biome-ignore lint/suspicious/noConsole: allow console
|
|
13
13
|
console.warn([
|
|
14
14
|
"Failed to validate.",
|
|
15
15
|
...transformed.errors.map((error) => " - " +
|
|
@@ -322,7 +322,7 @@ class ReconnectingWebSocket {
|
|
|
322
322
|
if (this._options.debug) {
|
|
323
323
|
// not using spread because compiled version uses Symbols
|
|
324
324
|
// tslint:disable-next-line
|
|
325
|
-
//
|
|
325
|
+
// biome-ignore lint/suspicious/noConsole: allow console
|
|
326
326
|
console.log.apply(console, ["RWS>", ...args]);
|
|
327
327
|
}
|
|
328
328
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
import { Auth as FernAuth } from "../api/resources/auth/client/Client.js";
|
|
15
15
|
import * as core from "../core/index.js";
|
|
16
16
|
import * as Corti from "../api/index.js";
|
|
17
|
+
import * as environments from "../environments.js";
|
|
17
18
|
interface AuthorizationCodeClient {
|
|
18
19
|
clientId: string;
|
|
19
20
|
redirectUri: string;
|
|
@@ -32,7 +33,14 @@ interface AuthorizationRefreshServer {
|
|
|
32
33
|
interface Options {
|
|
33
34
|
skipRedirect?: boolean;
|
|
34
35
|
}
|
|
36
|
+
type AuthOptions = Omit<FernAuth.Options, 'environment'> & {
|
|
37
|
+
environment: core.Supplier<environments.CortiEnvironment | environments.CortiEnvironmentUrls> | string;
|
|
38
|
+
};
|
|
35
39
|
export declare class Auth extends FernAuth {
|
|
40
|
+
/**
|
|
41
|
+
* Patch: use custom AuthOptions type to support string-based environment
|
|
42
|
+
*/
|
|
43
|
+
constructor(_options: AuthOptions);
|
|
36
44
|
/**
|
|
37
45
|
* Patch: called custom implementation this.__getToken_custom instead of this.__getToken
|
|
38
46
|
*/
|
|
@@ -61,7 +61,14 @@ const core = __importStar(require("../core/index.js"));
|
|
|
61
61
|
const headers_js_1 = require("../core/headers.js");
|
|
62
62
|
const serializers = __importStar(require("../serialization/index.js"));
|
|
63
63
|
const errors = __importStar(require("../errors/index.js"));
|
|
64
|
+
const getEnvironmentFromString_js_1 = require("./utils/getEnvironmentFromString.js");
|
|
64
65
|
class Auth extends Client_js_1.Auth {
|
|
66
|
+
/**
|
|
67
|
+
* Patch: use custom AuthOptions type to support string-based environment
|
|
68
|
+
*/
|
|
69
|
+
constructor(_options) {
|
|
70
|
+
super(Object.assign(Object.assign({}, _options), { environment: (0, getEnvironmentFromString_js_1.getEnvironment)(_options.environment) }));
|
|
71
|
+
}
|
|
65
72
|
/**
|
|
66
73
|
* Patch: called custom implementation this.__getToken_custom instead of this.__getToken
|
|
67
74
|
*/
|
|
@@ -84,6 +84,7 @@ const RefreshBearerProvider_js_1 = require("./RefreshBearerProvider.js");
|
|
|
84
84
|
* Patch: added SDK_VERSION import
|
|
85
85
|
*/
|
|
86
86
|
const version_js_1 = require("../version.js");
|
|
87
|
+
const getEnvironmentFromString_js_1 = require("./utils/getEnvironmentFromString.js");
|
|
87
88
|
class CortiClient {
|
|
88
89
|
constructor(_options) {
|
|
89
90
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
@@ -97,18 +98,11 @@ class CortiClient {
|
|
|
97
98
|
"User-Agent": `@corti/sdk/${version_js_1.SDK_VERSION}`,
|
|
98
99
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
99
100
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
100
|
-
}, _options === null || _options === void 0 ? void 0 : _options.headers), clientId: "clientId" in _options.auth ? _options.auth.clientId : undefined, clientSecret: "clientSecret" in _options.auth ? _options.auth.clientSecret : undefined, token: "accessToken" in _options.auth ? _options.auth.accessToken : undefined, environment:
|
|
101
|
-
? {
|
|
102
|
-
base: `https://api.${_options.environment}.corti.app/v2`,
|
|
103
|
-
wss: `wss://api.${_options.environment}.corti.app`,
|
|
104
|
-
login: `https://auth.${_options.environment}.corti.app/realms`,
|
|
105
|
-
}
|
|
106
|
-
: _options.environment });
|
|
101
|
+
}, _options === null || _options === void 0 ? void 0 : _options.headers), clientId: "clientId" in _options.auth ? _options.auth.clientId : undefined, clientSecret: "clientSecret" in _options.auth ? _options.auth.clientSecret : undefined, token: "accessToken" in _options.auth ? _options.auth.accessToken : undefined, environment: (0, getEnvironmentFromString_js_1.getEnvironment)(_options.environment) });
|
|
107
102
|
/**
|
|
108
|
-
* Patch: if `
|
|
103
|
+
* Patch: if `clientId` is provided, use OAuthTokenProvider, otherwise use BearerProvider
|
|
109
104
|
*/
|
|
110
|
-
this._oauthTokenProvider = "
|
|
111
|
-
new RefreshBearerProvider_js_1.RefreshBearerProvider(_options.auth) :
|
|
105
|
+
this._oauthTokenProvider = "clientId" in _options.auth ?
|
|
112
106
|
new core.OAuthTokenProvider({
|
|
113
107
|
clientId: _options.auth.clientId,
|
|
114
108
|
clientSecret: _options.auth.clientSecret,
|
|
@@ -116,7 +110,8 @@ class CortiClient {
|
|
|
116
110
|
* Patch: provide whole `options` object to the Auth client, since it depends on both tenantName and environment
|
|
117
111
|
*/
|
|
118
112
|
authClient: new CortiAuth_js_1.Auth(this._options),
|
|
119
|
-
})
|
|
113
|
+
}) :
|
|
114
|
+
new RefreshBearerProvider_js_1.RefreshBearerProvider(_options.auth);
|
|
120
115
|
}
|
|
121
116
|
get interactions() {
|
|
122
117
|
var _a;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* RefreshBearerProvider used as a replacement of OAuthTokenProvider, in case when accessToken from outside of library was used instead of Client credentials.
|
|
3
3
|
*/
|
|
4
|
-
import * as core from "../core/index.js";
|
|
5
4
|
import * as api from "../api/index.js";
|
|
6
|
-
type
|
|
7
|
-
|
|
8
|
-
refreshAccessToken?: RefreshAccessTokenFunction;
|
|
9
|
-
accessToken: core.Supplier<string>;
|
|
5
|
+
type ExpectedTokenResponse = Omit<api.GetTokenResponse, 'tokenType'> & {
|
|
6
|
+
tokenType?: string;
|
|
10
7
|
};
|
|
8
|
+
type RefreshAccessTokenFunction = (refreshToken?: string) => Promise<ExpectedTokenResponse> | ExpectedTokenResponse;
|
|
9
|
+
export type BearerOptions = Partial<Omit<api.GetTokenResponse, 'accessToken'>> & ({
|
|
10
|
+
refreshAccessToken?: RefreshAccessTokenFunction;
|
|
11
|
+
accessToken: string;
|
|
12
|
+
} | {
|
|
13
|
+
refreshAccessToken: RefreshAccessTokenFunction;
|
|
14
|
+
accessToken?: string;
|
|
15
|
+
});
|
|
11
16
|
export declare class RefreshBearerProvider {
|
|
12
17
|
private readonly BUFFER_IN_MINUTES;
|
|
13
18
|
private _accessToken;
|
|
@@ -52,7 +52,7 @@ class RefreshBearerProvider {
|
|
|
52
52
|
this.BUFFER_IN_MINUTES = 2;
|
|
53
53
|
this._expiresAt = this.getExpiresAt(expiresIn, this.BUFFER_IN_MINUTES);
|
|
54
54
|
this._refreshExpiresAt = this.getExpiresAt(refreshExpiresIn, 0);
|
|
55
|
-
this._accessToken = accessToken;
|
|
55
|
+
this._accessToken = accessToken || 'no_token';
|
|
56
56
|
this._refreshToken = refreshToken;
|
|
57
57
|
this._refreshAccessToken = refreshAccessToken;
|
|
58
58
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RefreshBearerProvider.js";
|
|
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./RefreshBearerProvider.js"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as core from "../../core/index.js";
|
|
2
|
+
import * as environments from "../../environments.js";
|
|
3
|
+
type Environment = core.Supplier<environments.CortiEnvironment | environments.CortiEnvironmentUrls> | string;
|
|
4
|
+
type CortiEnvironment = core.Supplier<environments.CortiEnvironment | environments.CortiEnvironmentUrls>;
|
|
5
|
+
export declare function getEnvironment(environment: Environment): CortiEnvironment;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEnvironment = getEnvironment;
|
|
4
|
+
function getEnvironment(environment) {
|
|
5
|
+
return typeof environment === "string"
|
|
6
|
+
? {
|
|
7
|
+
base: `https://api.${environment}.corti.app/v2`,
|
|
8
|
+
wss: `wss://api.${environment}.corti.app`,
|
|
9
|
+
login: `https://auth.${environment}.corti.app/realms`,
|
|
10
|
+
agents: `https://api.${environment}.corti.app/agents`,
|
|
11
|
+
}
|
|
12
|
+
: environment;
|
|
13
|
+
}
|
|
@@ -5,22 +5,20 @@ export interface CortiEnvironmentUrls {
|
|
|
5
5
|
base: string;
|
|
6
6
|
wss: string;
|
|
7
7
|
login: string;
|
|
8
|
+
agents: string;
|
|
8
9
|
}
|
|
9
10
|
export declare const CortiEnvironment: {
|
|
10
|
-
readonly BetaEu: {
|
|
11
|
-
readonly base: "https://api.beta-eu.corti.app/v2";
|
|
12
|
-
readonly wss: "wss://api.beta-eu.corti.app";
|
|
13
|
-
readonly login: "https://auth.beta-eu.corti.app/realms";
|
|
14
|
-
};
|
|
15
11
|
readonly Eu: {
|
|
16
12
|
readonly base: "https://api.eu.corti.app/v2";
|
|
17
13
|
readonly wss: "wss://api.eu.corti.app";
|
|
18
14
|
readonly login: "https://auth.eu.corti.app/realms";
|
|
15
|
+
readonly agents: "https://api.eu.corti.app/agents";
|
|
19
16
|
};
|
|
20
17
|
readonly Us: {
|
|
21
18
|
readonly base: "https://api.us.corti.app/v2";
|
|
22
19
|
readonly wss: "wss://api.us.corti.app";
|
|
23
20
|
readonly login: "https://auth.us.corti.app/realms";
|
|
21
|
+
readonly agents: "https://api.us.corti.app/agents";
|
|
24
22
|
};
|
|
25
23
|
};
|
|
26
|
-
export type CortiEnvironment = typeof CortiEnvironment.
|
|
24
|
+
export type CortiEnvironment = typeof CortiEnvironment.Eu | typeof CortiEnvironment.Us;
|
package/dist/cjs/environments.js
CHANGED
|
@@ -5,19 +5,16 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CortiEnvironment = void 0;
|
|
7
7
|
exports.CortiEnvironment = {
|
|
8
|
-
BetaEu: {
|
|
9
|
-
base: "https://api.beta-eu.corti.app/v2",
|
|
10
|
-
wss: "wss://api.beta-eu.corti.app",
|
|
11
|
-
login: "https://auth.beta-eu.corti.app/realms",
|
|
12
|
-
},
|
|
13
8
|
Eu: {
|
|
14
9
|
base: "https://api.eu.corti.app/v2",
|
|
15
10
|
wss: "wss://api.eu.corti.app",
|
|
16
11
|
login: "https://auth.eu.corti.app/realms",
|
|
12
|
+
agents: "https://api.eu.corti.app/agents",
|
|
17
13
|
},
|
|
18
14
|
Us: {
|
|
19
15
|
base: "https://api.us.corti.app/v2",
|
|
20
16
|
wss: "wss://api.us.corti.app",
|
|
21
17
|
login: "https://auth.us.corti.app/realms",
|
|
18
|
+
agents: "https://api.us.corti.app/agents",
|
|
22
19
|
},
|
|
23
20
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./core/exports.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("./core/exports.js"), exports);
|
|
@@ -4,11 +4,10 @@ export * as transcribe from "./transcribe/index.js";
|
|
|
4
4
|
export * from "./transcribe/client/socket/index.js";
|
|
5
5
|
export * as interactions from "./interactions/index.js";
|
|
6
6
|
export * from "./interactions/types/index.js";
|
|
7
|
-
export * as transcripts from "./transcripts/index.js";
|
|
8
|
-
export * from "./transcripts/types/index.js";
|
|
9
7
|
export * as auth from "./auth/index.js";
|
|
10
8
|
export * from "./auth/types/index.js";
|
|
11
9
|
export * from "./interactions/client/requests/index.js";
|
|
10
|
+
export * as transcripts from "./transcripts/index.js";
|
|
12
11
|
export * from "./transcripts/client/requests/index.js";
|
|
13
12
|
export * as facts from "./facts/index.js";
|
|
14
13
|
export * from "./facts/client/requests/index.js";
|
|
@@ -36,18 +36,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.documents = exports.facts = exports.
|
|
39
|
+
exports.documents = exports.facts = exports.transcripts = exports.auth = exports.interactions = exports.transcribe = exports.stream = void 0;
|
|
40
40
|
exports.stream = __importStar(require("./stream/index.js"));
|
|
41
41
|
__exportStar(require("./stream/client/socket/index.js"), exports);
|
|
42
42
|
exports.transcribe = __importStar(require("./transcribe/index.js"));
|
|
43
43
|
__exportStar(require("./transcribe/client/socket/index.js"), exports);
|
|
44
44
|
exports.interactions = __importStar(require("./interactions/index.js"));
|
|
45
45
|
__exportStar(require("./interactions/types/index.js"), exports);
|
|
46
|
-
exports.transcripts = __importStar(require("./transcripts/index.js"));
|
|
47
|
-
__exportStar(require("./transcripts/types/index.js"), exports);
|
|
48
46
|
exports.auth = __importStar(require("./auth/index.js"));
|
|
49
47
|
__exportStar(require("./auth/types/index.js"), exports);
|
|
50
48
|
__exportStar(require("./interactions/client/requests/index.js"), exports);
|
|
49
|
+
exports.transcripts = __importStar(require("./transcripts/index.js"));
|
|
51
50
|
__exportStar(require("./transcripts/client/requests/index.js"), exports);
|
|
52
51
|
exports.facts = __importStar(require("./facts/index.js"));
|
|
53
52
|
__exportStar(require("./facts/client/requests/index.js"), exports);
|
package/dist/cjs/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import * as Corti from "../../../../../api/index.js";
|
|
|
6
6
|
import * as core from "../../../../../core/index.js";
|
|
7
7
|
import { Uuid } from "../../../../types/Uuid.js";
|
|
8
8
|
import { TranscriptsParticipant } from "../../../../types/TranscriptsParticipant.js";
|
|
9
|
-
import { TranscriptsCreateRequestModelName } from "../../types/TranscriptsCreateRequestModelName.js";
|
|
10
9
|
export declare const TranscriptsCreateRequest: core.serialization.Schema<serializers.TranscriptsCreateRequest.Raw, Corti.TranscriptsCreateRequest>;
|
|
11
10
|
export declare namespace TranscriptsCreateRequest {
|
|
12
11
|
interface Raw {
|
|
@@ -16,6 +15,5 @@ export declare namespace TranscriptsCreateRequest {
|
|
|
16
15
|
isMultichannel?: boolean | null;
|
|
17
16
|
diarize?: boolean | null;
|
|
18
17
|
participants?: TranscriptsParticipant.Raw[] | null;
|
|
19
|
-
modelName: TranscriptsCreateRequestModelName.Raw;
|
|
20
18
|
}
|
|
21
19
|
}
|
package/dist/cjs/serialization/resources/transcripts/client/requests/TranscriptsCreateRequest.js
CHANGED
|
@@ -40,7 +40,6 @@ exports.TranscriptsCreateRequest = void 0;
|
|
|
40
40
|
const core = __importStar(require("../../../../../core/index.js"));
|
|
41
41
|
const Uuid_js_1 = require("../../../../types/Uuid.js");
|
|
42
42
|
const TranscriptsParticipant_js_1 = require("../../../../types/TranscriptsParticipant.js");
|
|
43
|
-
const TranscriptsCreateRequestModelName_js_1 = require("../../types/TranscriptsCreateRequestModelName.js");
|
|
44
43
|
exports.TranscriptsCreateRequest = core.serialization.object({
|
|
45
44
|
recordingId: Uuid_js_1.Uuid,
|
|
46
45
|
primaryLanguage: core.serialization.string(),
|
|
@@ -48,5 +47,4 @@ exports.TranscriptsCreateRequest = core.serialization.object({
|
|
|
48
47
|
isMultichannel: core.serialization.boolean().optional(),
|
|
49
48
|
diarize: core.serialization.boolean().optional(),
|
|
50
49
|
participants: core.serialization.list(TranscriptsParticipant_js_1.TranscriptsParticipant).optional(),
|
|
51
|
-
modelName: TranscriptsCreateRequestModelName_js_1.TranscriptsCreateRequestModelName,
|
|
52
50
|
});
|
|
@@ -14,5 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./types/index.js"), exports);
|
|
18
17
|
__exportStar(require("./client/index.js"), exports);
|