mavenagi 1.2.6 → 1.2.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.
- package/Client.d.ts +0 -3
- package/Client.js +28 -33
- package/README.md +21 -1
- package/api/resources/commons/types/ConversationResponse.d.ts +2 -1
- package/api/resources/commons/types/ConversationSummary.d.ts +2 -0
- package/api/resources/commons/types/EntityIdBase.d.ts +12 -1
- package/api/resources/commons/types/InboxItem.d.ts +24 -1
- package/api/resources/commons/types/InboxItemCustom.d.ts +5 -0
- package/api/resources/commons/types/index.d.ts +1 -0
- package/api/resources/commons/types/index.js +1 -0
- package/api/resources/conversation/client/Client.d.ts +31 -12
- package/api/resources/conversation/client/Client.js +106 -12
- package/api/resources/conversation/client/requests/SimulationImportRequest.d.ts +5 -0
- package/api/resources/conversation/client/requests/index.d.ts +1 -0
- package/api/resources/events/client/Client.d.ts +2 -2
- package/api/resources/events/client/Client.js +2 -2
- package/api/resources/index.d.ts +0 -2
- package/api/resources/index.js +1 -3
- package/api/resources/knowledge/client/Client.d.ts +24 -0
- package/api/resources/knowledge/client/Client.js +104 -0
- package/api/resources/knowledge/client/requests/KnowledgeDocumentPatchRequest.d.ts +13 -0
- package/api/resources/knowledge/client/requests/index.d.ts +1 -0
- package/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -4
- package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +1 -1
- package/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +7 -1
- package/api/resources/knowledge/types/KnowledgeDocumentFilter.d.ts +4 -0
- package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +9 -2
- package/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +8 -1
- package/api/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +30 -0
- package/api/resources/knowledge/types/KnowledgeDocumentStatus.d.ts +6 -0
- package/api/resources/knowledge/types/KnowledgeDocumentStatus.js +9 -0
- package/api/resources/knowledge/types/index.d.ts +1 -0
- package/api/resources/knowledge/types/index.js +1 -0
- package/api/resources/users/types/AgentUserFilter.d.ts +5 -0
- package/core/exports.d.ts +1 -0
- package/{api/resources/agentCapabilities/index.js → core/exports.js} +1 -2
- package/core/file/exports.d.ts +1 -0
- package/core/file/file.d.ts +5 -0
- package/core/file/file.js +203 -0
- package/{dist/serialization/resources/agentCapabilities → core/file}/index.d.ts +1 -0
- package/{dist/serialization/resources/agentCapabilities → core/file}/index.js +1 -0
- package/core/file/types.d.ts +66 -0
- package/core/form-data-utils/FormDataWrapper.d.ts +16 -0
- package/core/form-data-utils/FormDataWrapper.js +208 -0
- package/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
- package/core/form-data-utils/encodeAsFormParameter.js +12 -0
- package/core/form-data-utils/index.d.ts +2 -0
- package/core/form-data-utils/index.js +20 -0
- package/core/index.d.ts +2 -0
- package/core/index.js +3 -1
- package/dist/Client.d.ts +0 -3
- package/dist/Client.js +28 -33
- package/dist/api/resources/commons/types/ConversationResponse.d.ts +2 -1
- package/dist/api/resources/commons/types/ConversationSummary.d.ts +2 -0
- package/dist/api/resources/commons/types/EntityIdBase.d.ts +12 -1
- package/dist/api/resources/commons/types/InboxItem.d.ts +24 -1
- package/dist/api/resources/commons/types/InboxItemCustom.d.ts +5 -0
- package/dist/api/resources/commons/types/index.d.ts +1 -0
- package/dist/api/resources/commons/types/index.js +1 -0
- package/dist/api/resources/conversation/client/Client.d.ts +31 -12
- package/dist/api/resources/conversation/client/Client.js +106 -12
- package/dist/api/resources/conversation/client/requests/SimulationImportRequest.d.ts +5 -0
- package/dist/api/resources/conversation/client/requests/index.d.ts +1 -0
- package/dist/api/resources/events/client/Client.d.ts +2 -2
- package/dist/api/resources/events/client/Client.js +2 -2
- package/dist/api/resources/index.d.ts +0 -2
- package/dist/api/resources/index.js +1 -3
- package/dist/api/resources/knowledge/client/Client.d.ts +24 -0
- package/dist/api/resources/knowledge/client/Client.js +104 -0
- package/dist/api/resources/knowledge/client/requests/KnowledgeDocumentPatchRequest.d.ts +13 -0
- package/dist/api/resources/knowledge/client/requests/index.d.ts +1 -0
- package/dist/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -4
- package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +1 -1
- package/dist/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +7 -1
- package/dist/api/resources/knowledge/types/KnowledgeDocumentFilter.d.ts +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +9 -2
- package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +8 -1
- package/dist/api/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +30 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentStatus.d.ts +6 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentStatus.js +9 -0
- package/dist/api/resources/knowledge/types/index.d.ts +1 -0
- package/dist/api/resources/knowledge/types/index.js +1 -0
- package/dist/api/resources/users/types/AgentUserFilter.d.ts +5 -0
- package/dist/core/exports.d.ts +1 -0
- package/dist/{api/resources/agentCapabilities/index.js → core/exports.js} +1 -2
- package/dist/core/file/exports.d.ts +1 -0
- package/dist/core/file/exports.js +2 -0
- package/dist/core/file/file.d.ts +5 -0
- package/dist/core/file/file.js +203 -0
- package/{serialization/resources/agentCapabilities → dist/core/file}/index.d.ts +1 -0
- package/{serialization/resources/agentCapabilities → dist/core/file}/index.js +1 -0
- package/dist/core/file/types.d.ts +66 -0
- package/dist/core/file/types.js +2 -0
- package/dist/core/form-data-utils/FormDataWrapper.d.ts +16 -0
- package/dist/core/form-data-utils/FormDataWrapper.js +208 -0
- package/dist/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
- package/dist/core/form-data-utils/encodeAsFormParameter.js +12 -0
- package/dist/core/form-data-utils/index.d.ts +2 -0
- package/dist/core/form-data-utils/index.js +20 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +3 -1
- package/dist/exports.d.ts +1 -0
- package/dist/exports.js +17 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/serialization/resources/commons/types/ConversationSummary.d.ts +1 -0
- package/dist/serialization/resources/commons/types/ConversationSummary.js +1 -0
- package/dist/serialization/resources/commons/types/InboxItem.d.ts +5 -1
- package/dist/serialization/resources/commons/types/InboxItem.js +2 -0
- package/dist/serialization/resources/commons/types/InboxItemCustom.d.ts +10 -0
- package/dist/serialization/resources/{agentCapabilities/types/ExecuteCapabilityRequest.js → commons/types/InboxItemCustom.js} +7 -4
- package/dist/serialization/resources/commons/types/index.d.ts +1 -0
- package/dist/serialization/resources/commons/types/index.js +1 -0
- package/dist/serialization/resources/index.d.ts +0 -2
- package/dist/serialization/resources/index.js +1 -3
- package/dist/serialization/resources/knowledge/client/requests/KnowledgeDocumentPatchRequest.d.ts +11 -0
- package/dist/serialization/resources/{agentCapabilities/types/PatchAgentCapabilityRequest.js → knowledge/client/requests/KnowledgeDocumentPatchRequest.js} +6 -6
- package/dist/serialization/resources/knowledge/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/knowledge/client/requests/index.js +3 -1
- package/dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -2
- package/dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.js +0 -2
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +1 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +1 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +2 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +2 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentFilter.d.ts +3 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentFilter.js +3 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +4 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +4 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +4 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.js +4 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentStatus.d.ts +7 -0
- package/{serialization/resources/agentCapabilities/types/AgentCapabilityType.js → dist/serialization/resources/knowledge/types/KnowledgeDocumentStatus.js} +2 -2
- package/dist/serialization/resources/knowledge/types/index.d.ts +1 -0
- package/dist/serialization/resources/knowledge/types/index.js +1 -0
- package/dist/serialization/resources/users/types/AgentUserFilter.d.ts +1 -0
- package/dist/serialization/resources/users/types/AgentUserFilter.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/exports.d.ts +1 -0
- package/exports.js +17 -0
- package/index.d.ts +1 -0
- package/index.js +4 -0
- package/package.json +1 -1
- package/reference.md +102 -280
- package/serialization/resources/commons/types/ConversationSummary.d.ts +1 -0
- package/serialization/resources/commons/types/ConversationSummary.js +1 -0
- package/serialization/resources/commons/types/InboxItem.d.ts +5 -1
- package/serialization/resources/commons/types/InboxItem.js +2 -0
- package/serialization/resources/commons/types/InboxItemCustom.d.ts +10 -0
- package/{dist/serialization/resources/agentCapabilities/types/AgentCapabilityField.js → serialization/resources/commons/types/InboxItemCustom.js} +7 -2
- package/serialization/resources/commons/types/index.d.ts +1 -0
- package/serialization/resources/commons/types/index.js +1 -0
- package/serialization/resources/index.d.ts +0 -2
- package/serialization/resources/index.js +1 -3
- package/serialization/resources/knowledge/client/requests/KnowledgeDocumentPatchRequest.d.ts +11 -0
- package/serialization/resources/{agentCapabilities/types/ExecuteCapabilityRequest.js → knowledge/client/requests/KnowledgeDocumentPatchRequest.js} +6 -4
- package/serialization/resources/knowledge/client/requests/index.d.ts +1 -0
- package/serialization/resources/knowledge/client/requests/index.js +3 -1
- package/serialization/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -2
- package/serialization/resources/knowledge/types/BaseKnowledgeDocument.js +0 -2
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +1 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +1 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +2 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +2 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentFilter.d.ts +3 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentFilter.js +3 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +4 -1
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -1
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +4 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +4 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.js +4 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentStatus.d.ts +7 -0
- package/{dist/serialization/resources/agentCapabilities/types/AgentCapabilityType.js → serialization/resources/knowledge/types/KnowledgeDocumentStatus.js} +2 -2
- package/serialization/resources/knowledge/types/index.d.ts +1 -0
- package/serialization/resources/knowledge/types/index.js +1 -0
- package/serialization/resources/users/types/AgentUserFilter.d.ts +1 -0
- package/serialization/resources/users/types/AgentUserFilter.js +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/agentCapabilities/client/Client.d.ts +0 -101
- package/api/resources/agentCapabilities/client/Client.js +0 -450
- package/api/resources/agentCapabilities/client/index.d.ts +0 -1
- package/api/resources/agentCapabilities/index.d.ts +0 -2
- package/api/resources/agentCapabilities/types/ActionCapability.d.ts +0 -13
- package/api/resources/agentCapabilities/types/AgentCapability.d.ts +0 -10
- package/api/resources/agentCapabilities/types/AgentCapabilityBase.d.ts +0 -12
- package/api/resources/agentCapabilities/types/AgentCapabilityField.d.ts +0 -8
- package/api/resources/agentCapabilities/types/AgentCapabilityField.js +0 -11
- package/api/resources/agentCapabilities/types/AgentCapabilityListRequest.d.ts +0 -11
- package/api/resources/agentCapabilities/types/AgentCapabilityType.d.ts +0 -5
- package/api/resources/agentCapabilities/types/AgentCapabilityType.js +0 -8
- package/api/resources/agentCapabilities/types/ExecuteCapabilityRequest.d.ts +0 -4
- package/api/resources/agentCapabilities/types/ExecuteCapabilityResponse.d.ts +0 -4
- package/api/resources/agentCapabilities/types/ListAgentCapabilitiesResponse.d.ts +0 -5
- package/api/resources/agentCapabilities/types/ListAgentCapabilitiesResponse.js +0 -3
- package/api/resources/agentCapabilities/types/PatchAgentCapabilityRequest.d.ts +0 -8
- package/api/resources/agentCapabilities/types/PatchAgentCapabilityRequest.js +0 -3
- package/api/resources/agentCapabilities/types/TriggerCapability.d.ts +0 -4
- package/api/resources/agentCapabilities/types/TriggerCapability.js +0 -3
- package/api/resources/agentCapabilities/types/TriggerType.d.ts +0 -7
- package/api/resources/agentCapabilities/types/TriggerType.js +0 -10
- package/api/resources/agentCapabilities/types/index.d.ts +0 -12
- package/api/resources/agentCapabilities/types/index.js +0 -28
- package/dist/api/resources/agentCapabilities/client/Client.d.ts +0 -101
- package/dist/api/resources/agentCapabilities/client/Client.js +0 -450
- package/dist/api/resources/agentCapabilities/client/index.d.ts +0 -1
- package/dist/api/resources/agentCapabilities/index.d.ts +0 -2
- package/dist/api/resources/agentCapabilities/types/ActionCapability.d.ts +0 -13
- package/dist/api/resources/agentCapabilities/types/ActionCapability.js +0 -3
- package/dist/api/resources/agentCapabilities/types/AgentCapability.d.ts +0 -10
- package/dist/api/resources/agentCapabilities/types/AgentCapability.js +0 -3
- package/dist/api/resources/agentCapabilities/types/AgentCapabilityBase.d.ts +0 -12
- package/dist/api/resources/agentCapabilities/types/AgentCapabilityBase.js +0 -3
- package/dist/api/resources/agentCapabilities/types/AgentCapabilityField.d.ts +0 -8
- package/dist/api/resources/agentCapabilities/types/AgentCapabilityField.js +0 -11
- package/dist/api/resources/agentCapabilities/types/AgentCapabilityListRequest.d.ts +0 -11
- package/dist/api/resources/agentCapabilities/types/AgentCapabilityListRequest.js +0 -3
- package/dist/api/resources/agentCapabilities/types/AgentCapabilityType.d.ts +0 -5
- package/dist/api/resources/agentCapabilities/types/AgentCapabilityType.js +0 -8
- package/dist/api/resources/agentCapabilities/types/ExecuteCapabilityRequest.d.ts +0 -4
- package/dist/api/resources/agentCapabilities/types/ExecuteCapabilityRequest.js +0 -3
- package/dist/api/resources/agentCapabilities/types/ExecuteCapabilityResponse.d.ts +0 -4
- package/dist/api/resources/agentCapabilities/types/ExecuteCapabilityResponse.js +0 -3
- package/dist/api/resources/agentCapabilities/types/ListAgentCapabilitiesResponse.d.ts +0 -5
- package/dist/api/resources/agentCapabilities/types/ListAgentCapabilitiesResponse.js +0 -3
- package/dist/api/resources/agentCapabilities/types/PatchAgentCapabilityRequest.d.ts +0 -8
- package/dist/api/resources/agentCapabilities/types/PatchAgentCapabilityRequest.js +0 -3
- package/dist/api/resources/agentCapabilities/types/TriggerCapability.d.ts +0 -4
- package/dist/api/resources/agentCapabilities/types/TriggerCapability.js +0 -3
- package/dist/api/resources/agentCapabilities/types/TriggerType.d.ts +0 -7
- package/dist/api/resources/agentCapabilities/types/TriggerType.js +0 -10
- package/dist/api/resources/agentCapabilities/types/index.d.ts +0 -12
- package/dist/api/resources/agentCapabilities/types/index.js +0 -28
- package/dist/serialization/resources/agentCapabilities/types/ActionCapability.d.ts +0 -17
- package/dist/serialization/resources/agentCapabilities/types/ActionCapability.js +0 -52
- package/dist/serialization/resources/agentCapabilities/types/AgentCapability.d.ts +0 -15
- package/dist/serialization/resources/agentCapabilities/types/AgentCapability.js +0 -49
- package/dist/serialization/resources/agentCapabilities/types/AgentCapabilityBase.d.ts +0 -15
- package/dist/serialization/resources/agentCapabilities/types/AgentCapabilityBase.js +0 -47
- package/dist/serialization/resources/agentCapabilities/types/AgentCapabilityField.d.ts +0 -7
- package/dist/serialization/resources/agentCapabilities/types/AgentCapabilityListRequest.d.ts +0 -18
- package/dist/serialization/resources/agentCapabilities/types/AgentCapabilityListRequest.js +0 -52
- package/dist/serialization/resources/agentCapabilities/types/AgentCapabilityType.d.ts +0 -7
- package/dist/serialization/resources/agentCapabilities/types/ExecuteCapabilityRequest.d.ts +0 -9
- package/dist/serialization/resources/agentCapabilities/types/ExecuteCapabilityResponse.d.ts +0 -10
- package/dist/serialization/resources/agentCapabilities/types/ExecuteCapabilityResponse.js +0 -42
- package/dist/serialization/resources/agentCapabilities/types/ListAgentCapabilitiesResponse.d.ts +0 -12
- package/dist/serialization/resources/agentCapabilities/types/ListAgentCapabilitiesResponse.js +0 -46
- package/dist/serialization/resources/agentCapabilities/types/PatchAgentCapabilityRequest.d.ts +0 -11
- package/dist/serialization/resources/agentCapabilities/types/TriggerCapability.d.ts +0 -11
- package/dist/serialization/resources/agentCapabilities/types/TriggerCapability.js +0 -45
- package/dist/serialization/resources/agentCapabilities/types/TriggerType.d.ts +0 -7
- package/dist/serialization/resources/agentCapabilities/types/TriggerType.js +0 -39
- package/dist/serialization/resources/agentCapabilities/types/index.d.ts +0 -12
- package/dist/serialization/resources/agentCapabilities/types/index.js +0 -28
- package/serialization/resources/agentCapabilities/types/ActionCapability.d.ts +0 -17
- package/serialization/resources/agentCapabilities/types/ActionCapability.js +0 -52
- package/serialization/resources/agentCapabilities/types/AgentCapability.d.ts +0 -15
- package/serialization/resources/agentCapabilities/types/AgentCapability.js +0 -49
- package/serialization/resources/agentCapabilities/types/AgentCapabilityBase.d.ts +0 -15
- package/serialization/resources/agentCapabilities/types/AgentCapabilityBase.js +0 -47
- package/serialization/resources/agentCapabilities/types/AgentCapabilityField.d.ts +0 -7
- package/serialization/resources/agentCapabilities/types/AgentCapabilityField.js +0 -39
- package/serialization/resources/agentCapabilities/types/AgentCapabilityListRequest.d.ts +0 -18
- package/serialization/resources/agentCapabilities/types/AgentCapabilityListRequest.js +0 -52
- package/serialization/resources/agentCapabilities/types/AgentCapabilityType.d.ts +0 -7
- package/serialization/resources/agentCapabilities/types/ExecuteCapabilityRequest.d.ts +0 -9
- package/serialization/resources/agentCapabilities/types/ExecuteCapabilityResponse.d.ts +0 -10
- package/serialization/resources/agentCapabilities/types/ExecuteCapabilityResponse.js +0 -42
- package/serialization/resources/agentCapabilities/types/ListAgentCapabilitiesResponse.d.ts +0 -12
- package/serialization/resources/agentCapabilities/types/ListAgentCapabilitiesResponse.js +0 -46
- package/serialization/resources/agentCapabilities/types/PatchAgentCapabilityRequest.d.ts +0 -11
- package/serialization/resources/agentCapabilities/types/PatchAgentCapabilityRequest.js +0 -43
- package/serialization/resources/agentCapabilities/types/TriggerCapability.d.ts +0 -11
- package/serialization/resources/agentCapabilities/types/TriggerCapability.js +0 -45
- package/serialization/resources/agentCapabilities/types/TriggerType.d.ts +0 -7
- package/serialization/resources/agentCapabilities/types/TriggerType.js +0 -39
- package/serialization/resources/agentCapabilities/types/index.d.ts +0 -12
- package/serialization/resources/agentCapabilities/types/index.js +0 -28
- /package/api/resources/{agentCapabilities/types/ActionCapability.js → commons/types/InboxItemCustom.js} +0 -0
- /package/api/resources/{agentCapabilities/types/AgentCapability.js → conversation/client/requests/SimulationImportRequest.js} +0 -0
- /package/api/resources/{agentCapabilities/types/AgentCapabilityBase.js → knowledge/client/requests/KnowledgeDocumentPatchRequest.js} +0 -0
- /package/{api/resources/agentCapabilities/client/index.js → core/file/exports.js} +0 -0
- /package/{dist/api/resources/agentCapabilities/client/index.js → core/file/types.js} +0 -0
- /package/{api/resources/agentCapabilities/types/AgentCapabilityListRequest.js → dist/api/resources/commons/types/InboxItemCustom.js} +0 -0
- /package/{api/resources/agentCapabilities/types/ExecuteCapabilityRequest.js → dist/api/resources/conversation/client/requests/SimulationImportRequest.js} +0 -0
- /package/{api/resources/agentCapabilities/types/ExecuteCapabilityResponse.js → dist/api/resources/knowledge/client/requests/KnowledgeDocumentPatchRequest.js} +0 -0
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
import * as MavenAGI from "../../../index";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* knowledgeDocumentId: {
|
|
6
|
+
* referenceId: "how-it-works",
|
|
7
|
+
* appId: "help-center",
|
|
8
|
+
* organizationId: "acme",
|
|
9
|
+
* agentId: "support",
|
|
10
|
+
* type: MavenAGI.EntityType.KnowledgeDocument
|
|
11
|
+
* },
|
|
12
|
+
* knowledgeBaseVersionId: {
|
|
13
|
+
* referenceId: "version-1",
|
|
14
|
+
* appId: "help-center",
|
|
15
|
+
* organizationId: "acme",
|
|
16
|
+
* agentId: "support",
|
|
17
|
+
* type: MavenAGI.EntityType.KnowledgeBaseVersion
|
|
18
|
+
* },
|
|
19
|
+
* title: "How it works",
|
|
20
|
+
* llmInclusionStatus: MavenAGI.LlmInclusionStatus.WhenRelevant,
|
|
21
|
+
* url: "https://help-center.acme.com/how-it-works",
|
|
22
|
+
* createdAt: new Date("2024-01-01T00:00:00.000Z"),
|
|
23
|
+
* updatedAt: new Date("2024-02-02T00:00:00.000Z")
|
|
24
|
+
* }
|
|
25
|
+
*/
|
|
2
26
|
export interface KnowledgeDocumentSearchResponse extends MavenAGI.BaseKnowledgeDocument {
|
|
3
27
|
/** ID that uniquely identifies this knowledge document within its knowledge base */
|
|
4
28
|
knowledgeDocumentId: MavenAGI.EntityId;
|
|
@@ -9,4 +33,10 @@ export interface KnowledgeDocumentSearchResponse extends MavenAGI.BaseKnowledgeD
|
|
|
9
33
|
knowledgeBaseVersionId?: MavenAGI.EntityId;
|
|
10
34
|
/** The title of the document. Will be shown as part of answers. May be missing on legacy documents. */
|
|
11
35
|
title?: string;
|
|
36
|
+
/** Whether the document is included in the agent's knowledge. */
|
|
37
|
+
llmInclusionStatus: MavenAGI.LlmInclusionStatus;
|
|
38
|
+
/** The time at which this document was created. */
|
|
39
|
+
createdAt: Date;
|
|
40
|
+
/** The time at which this document was last modified. */
|
|
41
|
+
updatedAt: Date;
|
|
12
42
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The current processing status of the knowledge document */
|
|
2
|
+
export declare const KnowledgeDocumentStatus: {
|
|
3
|
+
readonly Succeeded: "SUCCEEDED";
|
|
4
|
+
readonly InProgress: "IN_PROGRESS";
|
|
5
|
+
};
|
|
6
|
+
export type KnowledgeDocumentStatus = (typeof KnowledgeDocumentStatus)[keyof typeof KnowledgeDocumentStatus];
|
|
@@ -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.KnowledgeDocumentStatus = void 0;
|
|
5
|
+
/** The current processing status of the knowledge document */
|
|
6
|
+
exports.KnowledgeDocumentStatus = {
|
|
7
|
+
Succeeded: "SUCCEEDED",
|
|
8
|
+
InProgress: "IN_PROGRESS",
|
|
9
|
+
};
|
|
@@ -14,6 +14,7 @@ export * from "./KnowledgeDocumentContentType";
|
|
|
14
14
|
export * from "./KnowledgeDeleteRequest";
|
|
15
15
|
export * from "./KnowledgeDocumentRequest";
|
|
16
16
|
export * from "./KnowledgeDocumentResponse";
|
|
17
|
+
export * from "./KnowledgeDocumentStatus";
|
|
17
18
|
export * from "./KnowledgeBaseField";
|
|
18
19
|
export * from "./KnowledgeDocumentField";
|
|
19
20
|
export * from "./KnowledgeBaseFilter";
|
|
@@ -30,6 +30,7 @@ __exportStar(require("./KnowledgeDocumentContentType"), exports);
|
|
|
30
30
|
__exportStar(require("./KnowledgeDeleteRequest"), exports);
|
|
31
31
|
__exportStar(require("./KnowledgeDocumentRequest"), exports);
|
|
32
32
|
__exportStar(require("./KnowledgeDocumentResponse"), exports);
|
|
33
|
+
__exportStar(require("./KnowledgeDocumentStatus"), exports);
|
|
33
34
|
__exportStar(require("./KnowledgeBaseField"), exports);
|
|
34
35
|
__exportStar(require("./KnowledgeDocumentField"), exports);
|
|
35
36
|
__exportStar(require("./KnowledgeBaseFilter"), exports);
|
|
@@ -6,6 +6,11 @@ export interface AgentUserFilter {
|
|
|
6
6
|
search?: string;
|
|
7
7
|
/** Filter by identifiers */
|
|
8
8
|
identifiers?: string[];
|
|
9
|
+
/**
|
|
10
|
+
* Full-text search query for matching agent users by display name.
|
|
11
|
+
* When you search with this parameter, you're performing a full-text search across the user display names.
|
|
12
|
+
*/
|
|
13
|
+
displayName?: string;
|
|
9
14
|
/**
|
|
10
15
|
* Filter by anonymous users. When true, only anonymous users are returned.
|
|
11
16
|
* When false, only non-anonymous users are returned. An anonymous user is one without any identifiers or name data.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./file/exports";
|
|
@@ -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("./
|
|
18
|
-
__exportStar(require("./client"), exports);
|
|
17
|
+
__exportStar(require("./file/exports"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { Uploadable } from "./types";
|
|
@@ -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
|
+
}
|
|
@@ -14,4 +14,5 @@ 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("./file"), exports);
|
|
17
18
|
__exportStar(require("./types"), 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
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface FormDataRequest<Body> {
|
|
2
|
+
body: Body;
|
|
3
|
+
headers: Record<string, string>;
|
|
4
|
+
duplex?: "half";
|
|
5
|
+
}
|
|
6
|
+
export declare function newFormData(): Promise<FormDataWrapper>;
|
|
7
|
+
export declare class FormDataWrapper {
|
|
8
|
+
private fd;
|
|
9
|
+
setup(): Promise<void>;
|
|
10
|
+
append(key: string, value: unknown): void;
|
|
11
|
+
private getFileName;
|
|
12
|
+
private convertToBlob;
|
|
13
|
+
appendFile(key: string, value: unknown, fileName?: string): Promise<void>;
|
|
14
|
+
getRequest(): FormDataRequest<FormData>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,208 @@
|
|
|
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
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
45
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
46
|
+
var m = o[Symbol.asyncIterator], i;
|
|
47
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
48
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
49
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
50
|
+
};
|
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
+
exports.FormDataWrapper = void 0;
|
|
53
|
+
exports.newFormData = newFormData;
|
|
54
|
+
const json_1 = require("../../core/json");
|
|
55
|
+
const index_1 = require("../runtime/index");
|
|
56
|
+
function isNamedValue(value) {
|
|
57
|
+
return typeof value === "object" && value != null && "name" in value;
|
|
58
|
+
}
|
|
59
|
+
function isPathedValue(value) {
|
|
60
|
+
return typeof value === "object" && value != null && "path" in value;
|
|
61
|
+
}
|
|
62
|
+
function isStreamLike(value) {
|
|
63
|
+
return typeof value === "object" && value != null && ("read" in value || "pipe" in value);
|
|
64
|
+
}
|
|
65
|
+
function isReadableStream(value) {
|
|
66
|
+
return typeof value === "object" && value != null && "getReader" in value;
|
|
67
|
+
}
|
|
68
|
+
function isBuffer(value) {
|
|
69
|
+
return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value);
|
|
70
|
+
}
|
|
71
|
+
function isArrayBufferView(value) {
|
|
72
|
+
return ArrayBuffer.isView(value);
|
|
73
|
+
}
|
|
74
|
+
function getLastPathSegment(pathStr) {
|
|
75
|
+
const lastForwardSlash = pathStr.lastIndexOf("/");
|
|
76
|
+
const lastBackSlash = pathStr.lastIndexOf("\\");
|
|
77
|
+
const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash);
|
|
78
|
+
return lastSlashIndex >= 0 ? pathStr.substring(lastSlashIndex + 1) : pathStr;
|
|
79
|
+
}
|
|
80
|
+
function streamToBuffer(stream) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
var _a, stream_1, stream_1_1;
|
|
83
|
+
var _b, e_1, _c, _d;
|
|
84
|
+
if (index_1.RUNTIME.type === "node") {
|
|
85
|
+
const { Readable } = yield Promise.resolve().then(() => __importStar(require("stream")));
|
|
86
|
+
if (stream instanceof Readable) {
|
|
87
|
+
const chunks = [];
|
|
88
|
+
try {
|
|
89
|
+
for (_a = true, stream_1 = __asyncValues(stream); stream_1_1 = yield stream_1.next(), _b = stream_1_1.done, !_b; _a = true) {
|
|
90
|
+
_d = stream_1_1.value;
|
|
91
|
+
_a = false;
|
|
92
|
+
const chunk = _d;
|
|
93
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
97
|
+
finally {
|
|
98
|
+
try {
|
|
99
|
+
if (!_a && !_b && (_c = stream_1.return)) yield _c.call(stream_1);
|
|
100
|
+
}
|
|
101
|
+
finally { if (e_1) throw e_1.error; }
|
|
102
|
+
}
|
|
103
|
+
return Buffer.concat(chunks);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (isReadableStream(stream)) {
|
|
107
|
+
const reader = stream.getReader();
|
|
108
|
+
const chunks = [];
|
|
109
|
+
try {
|
|
110
|
+
while (true) {
|
|
111
|
+
const { done, value } = yield reader.read();
|
|
112
|
+
if (done)
|
|
113
|
+
break;
|
|
114
|
+
chunks.push(value);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
finally {
|
|
118
|
+
reader.releaseLock();
|
|
119
|
+
}
|
|
120
|
+
const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0);
|
|
121
|
+
const result = new Uint8Array(totalLength);
|
|
122
|
+
let offset = 0;
|
|
123
|
+
for (const chunk of chunks) {
|
|
124
|
+
result.set(chunk, offset);
|
|
125
|
+
offset += chunk.length;
|
|
126
|
+
}
|
|
127
|
+
return Buffer.from(result);
|
|
128
|
+
}
|
|
129
|
+
throw new Error("Unsupported stream type: " + typeof stream + ". Expected Node.js Readable stream or Web ReadableStream.");
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function newFormData() {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
return new FormDataWrapper();
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
class FormDataWrapper {
|
|
138
|
+
constructor() {
|
|
139
|
+
this.fd = new FormData();
|
|
140
|
+
}
|
|
141
|
+
setup() {
|
|
142
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
143
|
+
// noop
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
append(key, value) {
|
|
147
|
+
this.fd.append(key, String(value));
|
|
148
|
+
}
|
|
149
|
+
getFileName(value, filename) {
|
|
150
|
+
if (filename != null) {
|
|
151
|
+
return filename;
|
|
152
|
+
}
|
|
153
|
+
if (isNamedValue(value)) {
|
|
154
|
+
return value.name;
|
|
155
|
+
}
|
|
156
|
+
if (isPathedValue(value) && value.path) {
|
|
157
|
+
return getLastPathSegment(value.path.toString());
|
|
158
|
+
}
|
|
159
|
+
return undefined;
|
|
160
|
+
}
|
|
161
|
+
convertToBlob(value) {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
if (isStreamLike(value) || isReadableStream(value)) {
|
|
164
|
+
const buffer = yield streamToBuffer(value);
|
|
165
|
+
return new Blob([buffer]);
|
|
166
|
+
}
|
|
167
|
+
if (value instanceof Blob) {
|
|
168
|
+
return value;
|
|
169
|
+
}
|
|
170
|
+
if (isBuffer(value)) {
|
|
171
|
+
return new Blob([value]);
|
|
172
|
+
}
|
|
173
|
+
if (value instanceof ArrayBuffer) {
|
|
174
|
+
return new Blob([value]);
|
|
175
|
+
}
|
|
176
|
+
if (isArrayBufferView(value)) {
|
|
177
|
+
return new Blob([value]);
|
|
178
|
+
}
|
|
179
|
+
if (typeof value === "string") {
|
|
180
|
+
return new Blob([value]);
|
|
181
|
+
}
|
|
182
|
+
if (typeof value === "object" && value !== null) {
|
|
183
|
+
return new Blob([(0, json_1.toJson)(value)], { type: "application/json" });
|
|
184
|
+
}
|
|
185
|
+
return new Blob([String(value)]);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
appendFile(key, value, fileName) {
|
|
189
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
190
|
+
fileName = this.getFileName(value, fileName);
|
|
191
|
+
const blob = yield this.convertToBlob(value);
|
|
192
|
+
if (fileName) {
|
|
193
|
+
this.fd.append(key, blob, fileName);
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
this.fd.append(key, blob);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
getRequest() {
|
|
201
|
+
return {
|
|
202
|
+
body: this.fd,
|
|
203
|
+
headers: {},
|
|
204
|
+
duplex: "half",
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
exports.FormDataWrapper = FormDataWrapper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function encodeAsFormParameter(value: unknown): Record<string, string>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.encodeAsFormParameter = encodeAsFormParameter;
|
|
4
|
+
const qs_1 = require("../url/qs");
|
|
5
|
+
function encodeAsFormParameter(value) {
|
|
6
|
+
const stringified = (0, qs_1.toQueryString)(value, { encode: false });
|
|
7
|
+
const keyValuePairs = stringified.split("&").map((pair) => {
|
|
8
|
+
const [key, value] = pair.split("=");
|
|
9
|
+
return [key, value];
|
|
10
|
+
});
|
|
11
|
+
return Object.fromEntries(keyValuePairs);
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
exports.encodeAsFormParameter = void 0;
|
|
18
|
+
var encodeAsFormParameter_1 = require("./encodeAsFormParameter");
|
|
19
|
+
Object.defineProperty(exports, "encodeAsFormParameter", { enumerable: true, get: function () { return encodeAsFormParameter_1.encodeAsFormParameter; } });
|
|
20
|
+
__exportStar(require("./FormDataWrapper"), exports);
|