@inowu/cashdro 0.1.0
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 +335 -0
- package/dist/BaseClient.d.ts +43 -0
- package/dist/BaseClient.d.ts.map +1 -0
- package/dist/BaseClient.js +44 -0
- package/dist/BaseClient.js.map +1 -0
- package/dist/Client.d.ts +181 -0
- package/dist/Client.d.ts.map +1 -0
- package/dist/Client.js +655 -0
- package/dist/Client.js.map +1 -0
- package/dist/api/client/index.d.ts +2 -0
- package/dist/api/client/index.d.ts.map +1 -0
- package/dist/api/client/index.js +2 -0
- package/dist/api/client/index.js.map +1 -0
- package/dist/api/client/requests/AcknowledgeOperationIdRequest.d.ts +13 -0
- package/dist/api/client/requests/AcknowledgeOperationIdRequest.d.ts.map +1 -0
- package/dist/api/client/requests/AcknowledgeOperationIdRequest.js +3 -0
- package/dist/api/client/requests/AcknowledgeOperationIdRequest.js.map +1 -0
- package/dist/api/client/requests/AskMovementsRequest.d.ts +21 -0
- package/dist/api/client/requests/AskMovementsRequest.d.ts.map +1 -0
- package/dist/api/client/requests/AskMovementsRequest.js +3 -0
- package/dist/api/client/requests/AskMovementsRequest.js.map +1 -0
- package/dist/api/client/requests/AskOperationExecutingRequest.d.ts +11 -0
- package/dist/api/client/requests/AskOperationExecutingRequest.d.ts.map +1 -0
- package/dist/api/client/requests/AskOperationExecutingRequest.js +3 -0
- package/dist/api/client/requests/AskOperationExecutingRequest.js.map +1 -0
- package/dist/api/client/requests/AskOperationRequest.d.ts +13 -0
- package/dist/api/client/requests/AskOperationRequest.d.ts.map +1 -0
- package/dist/api/client/requests/AskOperationRequest.js +3 -0
- package/dist/api/client/requests/AskOperationRequest.js.map +1 -0
- package/dist/api/client/requests/AskPendingOperationsRequest.d.ts +15 -0
- package/dist/api/client/requests/AskPendingOperationsRequest.d.ts.map +1 -0
- package/dist/api/client/requests/AskPendingOperationsRequest.js +3 -0
- package/dist/api/client/requests/AskPendingOperationsRequest.js.map +1 -0
- package/dist/api/client/requests/DoTestRequest.d.ts +11 -0
- package/dist/api/client/requests/DoTestRequest.d.ts.map +1 -0
- package/dist/api/client/requests/DoTestRequest.js +3 -0
- package/dist/api/client/requests/DoTestRequest.js.map +1 -0
- package/dist/api/client/requests/FinishOperationRequest.d.ts +18 -0
- package/dist/api/client/requests/FinishOperationRequest.d.ts.map +1 -0
- package/dist/api/client/requests/FinishOperationRequest.js +3 -0
- package/dist/api/client/requests/FinishOperationRequest.js.map +1 -0
- package/dist/api/client/requests/GetAlertsRequest.d.ts +11 -0
- package/dist/api/client/requests/GetAlertsRequest.d.ts.map +1 -0
- package/dist/api/client/requests/GetAlertsRequest.js +3 -0
- package/dist/api/client/requests/GetAlertsRequest.js.map +1 -0
- package/dist/api/client/requests/GetDiagnosisRequest.d.ts +11 -0
- package/dist/api/client/requests/GetDiagnosisRequest.d.ts.map +1 -0
- package/dist/api/client/requests/GetDiagnosisRequest.js +3 -0
- package/dist/api/client/requests/GetDiagnosisRequest.js.map +1 -0
- package/dist/api/client/requests/GetPiecesCurrencyRequest.d.ts +17 -0
- package/dist/api/client/requests/GetPiecesCurrencyRequest.d.ts.map +1 -0
- package/dist/api/client/requests/GetPiecesCurrencyRequest.js +3 -0
- package/dist/api/client/requests/GetPiecesCurrencyRequest.js.map +1 -0
- package/dist/api/client/requests/SetOperationImportedRequest.d.ts +13 -0
- package/dist/api/client/requests/SetOperationImportedRequest.d.ts.map +1 -0
- package/dist/api/client/requests/SetOperationImportedRequest.js +3 -0
- package/dist/api/client/requests/SetOperationImportedRequest.js.map +1 -0
- package/dist/api/client/requests/StartOperationRequest.d.ts +27 -0
- package/dist/api/client/requests/StartOperationRequest.d.ts.map +1 -0
- package/dist/api/client/requests/StartOperationRequest.js +3 -0
- package/dist/api/client/requests/StartOperationRequest.js.map +1 -0
- package/dist/api/client/requests/index.d.ts +13 -0
- package/dist/api/client/requests/index.d.ts.map +1 -0
- package/dist/api/client/requests/index.js +2 -0
- package/dist/api/client/requests/index.js.map +1 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +3 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/types/AcknowledgeOperationIdRequestOperation.d.ts +5 -0
- package/dist/api/types/AcknowledgeOperationIdRequestOperation.d.ts.map +1 -0
- package/dist/api/types/AcknowledgeOperationIdRequestOperation.js +5 -0
- package/dist/api/types/AcknowledgeOperationIdRequestOperation.js.map +1 -0
- package/dist/api/types/Alert.d.ts +12 -0
- package/dist/api/types/Alert.d.ts.map +1 -0
- package/dist/api/types/Alert.js +3 -0
- package/dist/api/types/Alert.js.map +1 -0
- package/dist/api/types/AlertsResponse.d.ts +21 -0
- package/dist/api/types/AlertsResponse.d.ts.map +1 -0
- package/dist/api/types/AlertsResponse.js +3 -0
- package/dist/api/types/AlertsResponse.js.map +1 -0
- package/dist/api/types/AskMovementsRequestOperation.d.ts +5 -0
- package/dist/api/types/AskMovementsRequestOperation.d.ts.map +1 -0
- package/dist/api/types/AskMovementsRequestOperation.js +5 -0
- package/dist/api/types/AskMovementsRequestOperation.js.map +1 -0
- package/dist/api/types/AskOperationExecutingRequestOperation.d.ts +5 -0
- package/dist/api/types/AskOperationExecutingRequestOperation.d.ts.map +1 -0
- package/dist/api/types/AskOperationExecutingRequestOperation.js +5 -0
- package/dist/api/types/AskOperationExecutingRequestOperation.js.map +1 -0
- package/dist/api/types/AskOperationRequestOperation.d.ts +5 -0
- package/dist/api/types/AskOperationRequestOperation.d.ts.map +1 -0
- package/dist/api/types/AskOperationRequestOperation.js +5 -0
- package/dist/api/types/AskOperationRequestOperation.js.map +1 -0
- package/dist/api/types/AskOperationResponse.d.ts +27 -0
- package/dist/api/types/AskOperationResponse.d.ts.map +1 -0
- package/dist/api/types/AskOperationResponse.js +3 -0
- package/dist/api/types/AskOperationResponse.js.map +1 -0
- package/dist/api/types/AskPendingOperationsRequestOperation.d.ts +5 -0
- package/dist/api/types/AskPendingOperationsRequestOperation.d.ts.map +1 -0
- package/dist/api/types/AskPendingOperationsRequestOperation.js +5 -0
- package/dist/api/types/AskPendingOperationsRequestOperation.js.map +1 -0
- package/dist/api/types/CurrencyPiece.d.ts +19 -0
- package/dist/api/types/CurrencyPiece.d.ts.map +1 -0
- package/dist/api/types/CurrencyPiece.js +3 -0
- package/dist/api/types/CurrencyPiece.js.map +1 -0
- package/dist/api/types/Device.d.ts +12 -0
- package/dist/api/types/Device.d.ts.map +1 -0
- package/dist/api/types/Device.js +3 -0
- package/dist/api/types/Device.js.map +1 -0
- package/dist/api/types/DiagnosisResponse.d.ts +22 -0
- package/dist/api/types/DiagnosisResponse.d.ts.map +1 -0
- package/dist/api/types/DiagnosisResponse.js +3 -0
- package/dist/api/types/DiagnosisResponse.js.map +1 -0
- package/dist/api/types/DoTestRequestOperation.d.ts +5 -0
- package/dist/api/types/DoTestRequestOperation.d.ts.map +1 -0
- package/dist/api/types/DoTestRequestOperation.js +5 -0
- package/dist/api/types/DoTestRequestOperation.js.map +1 -0
- package/dist/api/types/ExecutingOperation.d.ts +33 -0
- package/dist/api/types/ExecutingOperation.d.ts.map +1 -0
- package/dist/api/types/ExecutingOperation.js +3 -0
- package/dist/api/types/ExecutingOperation.js.map +1 -0
- package/dist/api/types/ExecutingResponse.d.ts +14 -0
- package/dist/api/types/ExecutingResponse.d.ts.map +1 -0
- package/dist/api/types/ExecutingResponse.js +3 -0
- package/dist/api/types/ExecutingResponse.js.map +1 -0
- package/dist/api/types/FinishOperationRequestOperation.d.ts +5 -0
- package/dist/api/types/FinishOperationRequestOperation.d.ts.map +1 -0
- package/dist/api/types/FinishOperationRequestOperation.js +5 -0
- package/dist/api/types/FinishOperationRequestOperation.js.map +1 -0
- package/dist/api/types/GetAlertsRequestOperation.d.ts +5 -0
- package/dist/api/types/GetAlertsRequestOperation.d.ts.map +1 -0
- package/dist/api/types/GetAlertsRequestOperation.js +5 -0
- package/dist/api/types/GetAlertsRequestOperation.js.map +1 -0
- package/dist/api/types/GetDiagnosisRequestOperation.d.ts +5 -0
- package/dist/api/types/GetDiagnosisRequestOperation.d.ts.map +1 -0
- package/dist/api/types/GetDiagnosisRequestOperation.js +5 -0
- package/dist/api/types/GetDiagnosisRequestOperation.js.map +1 -0
- package/dist/api/types/GetPiecesCurrencyRequestOperation.d.ts +5 -0
- package/dist/api/types/GetPiecesCurrencyRequestOperation.d.ts.map +1 -0
- package/dist/api/types/GetPiecesCurrencyRequestOperation.js +5 -0
- package/dist/api/types/GetPiecesCurrencyRequestOperation.js.map +1 -0
- package/dist/api/types/MovementsResponse.d.ts +20 -0
- package/dist/api/types/MovementsResponse.d.ts.map +1 -0
- package/dist/api/types/MovementsResponse.js +3 -0
- package/dist/api/types/MovementsResponse.js.map +1 -0
- package/dist/api/types/OperationStatus.d.ts +33 -0
- package/dist/api/types/OperationStatus.d.ts.map +1 -0
- package/dist/api/types/OperationStatus.js +3 -0
- package/dist/api/types/OperationStatus.js.map +1 -0
- package/dist/api/types/PendingOperationsResponse.d.ts +30 -0
- package/dist/api/types/PendingOperationsResponse.d.ts.map +1 -0
- package/dist/api/types/PendingOperationsResponse.js +3 -0
- package/dist/api/types/PendingOperationsResponse.js.map +1 -0
- package/dist/api/types/Piece.d.ts +22 -0
- package/dist/api/types/Piece.d.ts.map +1 -0
- package/dist/api/types/Piece.js +3 -0
- package/dist/api/types/Piece.js.map +1 -0
- package/dist/api/types/PiecesCurrencyResponse.d.ts +21 -0
- package/dist/api/types/PiecesCurrencyResponse.d.ts.map +1 -0
- package/dist/api/types/PiecesCurrencyResponse.js +3 -0
- package/dist/api/types/PiecesCurrencyResponse.js.map +1 -0
- package/dist/api/types/SetOperationImportedRequestOperation.d.ts +5 -0
- package/dist/api/types/SetOperationImportedRequestOperation.d.ts.map +1 -0
- package/dist/api/types/SetOperationImportedRequestOperation.js +5 -0
- package/dist/api/types/SetOperationImportedRequestOperation.js.map +1 -0
- package/dist/api/types/SimpleResponse.d.ts +13 -0
- package/dist/api/types/SimpleResponse.d.ts.map +1 -0
- package/dist/api/types/SimpleResponse.js +3 -0
- package/dist/api/types/SimpleResponse.js.map +1 -0
- package/dist/api/types/StartOperationRequestOperation.d.ts +5 -0
- package/dist/api/types/StartOperationRequestOperation.d.ts.map +1 -0
- package/dist/api/types/StartOperationRequestOperation.js +5 -0
- package/dist/api/types/StartOperationRequestOperation.js.map +1 -0
- package/dist/api/types/StartOperationResponse.d.ts +21 -0
- package/dist/api/types/StartOperationResponse.d.ts.map +1 -0
- package/dist/api/types/StartOperationResponse.js +3 -0
- package/dist/api/types/StartOperationResponse.js.map +1 -0
- package/dist/api/types/index.d.ts +28 -0
- package/dist/api/types/index.d.ts.map +1 -0
- package/dist/api/types/index.js +28 -0
- package/dist/api/types/index.js.map +1 -0
- package/dist/auth/BasicAuthProvider.d.ts +25 -0
- package/dist/auth/BasicAuthProvider.d.ts.map +1 -0
- package/dist/auth/BasicAuthProvider.js +42 -0
- package/dist/auth/BasicAuthProvider.js.map +1 -0
- package/dist/auth/index.d.ts +2 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +2 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/cashdro.d.ts +194 -0
- package/dist/cashdro.d.ts.map +1 -0
- package/dist/cashdro.js +233 -0
- package/dist/cashdro.js.map +1 -0
- package/dist/core/auth/AuthProvider.d.ts +9 -0
- package/dist/core/auth/AuthProvider.d.ts.map +1 -0
- package/dist/core/auth/AuthProvider.js +7 -0
- package/dist/core/auth/AuthProvider.js.map +1 -0
- package/dist/core/auth/AuthRequest.d.ts +10 -0
- package/dist/core/auth/AuthRequest.d.ts.map +1 -0
- package/dist/core/auth/AuthRequest.js +2 -0
- package/dist/core/auth/AuthRequest.js.map +1 -0
- package/dist/core/auth/BasicAuth.d.ts +9 -0
- package/dist/core/auth/BasicAuth.d.ts.map +1 -0
- package/dist/core/auth/BasicAuth.js +30 -0
- package/dist/core/auth/BasicAuth.js.map +1 -0
- package/dist/core/auth/BearerToken.d.ts +8 -0
- package/dist/core/auth/BearerToken.d.ts.map +1 -0
- package/dist/core/auth/BearerToken.js +14 -0
- package/dist/core/auth/BearerToken.js.map +1 -0
- package/dist/core/auth/NoOpAuthProvider.d.ts +6 -0
- package/dist/core/auth/NoOpAuthProvider.d.ts.map +1 -0
- package/dist/core/auth/NoOpAuthProvider.js +6 -0
- package/dist/core/auth/NoOpAuthProvider.js.map +1 -0
- package/dist/core/auth/index.d.ts +6 -0
- package/dist/core/auth/index.d.ts.map +1 -0
- package/dist/core/auth/index.js +5 -0
- package/dist/core/auth/index.js.map +1 -0
- package/dist/core/base64.d.ts +3 -0
- package/dist/core/base64.d.ts.map +1 -0
- package/dist/core/base64.js +23 -0
- package/dist/core/base64.js.map +1 -0
- package/dist/core/exports.d.ts +2 -0
- package/dist/core/exports.d.ts.map +1 -0
- package/dist/core/exports.js +2 -0
- package/dist/core/exports.js.map +1 -0
- package/dist/core/fetcher/APIResponse.d.ts +21 -0
- package/dist/core/fetcher/APIResponse.d.ts.map +1 -0
- package/dist/core/fetcher/APIResponse.js +2 -0
- package/dist/core/fetcher/APIResponse.js.map +1 -0
- package/dist/core/fetcher/BinaryResponse.d.ts +20 -0
- package/dist/core/fetcher/BinaryResponse.d.ts.map +1 -0
- package/dist/core/fetcher/BinaryResponse.js +15 -0
- package/dist/core/fetcher/BinaryResponse.js.map +1 -0
- package/dist/core/fetcher/EndpointMetadata.d.ts +14 -0
- package/dist/core/fetcher/EndpointMetadata.d.ts.map +1 -0
- package/dist/core/fetcher/EndpointMetadata.js +2 -0
- package/dist/core/fetcher/EndpointMetadata.js.map +1 -0
- package/dist/core/fetcher/EndpointSupplier.d.ts +13 -0
- package/dist/core/fetcher/EndpointSupplier.d.ts.map +1 -0
- package/dist/core/fetcher/EndpointSupplier.js +11 -0
- package/dist/core/fetcher/EndpointSupplier.js.map +1 -0
- package/dist/core/fetcher/Fetcher.d.ts +57 -0
- package/dist/core/fetcher/Fetcher.d.ts.map +1 -0
- package/dist/core/fetcher/Fetcher.js +307 -0
- package/dist/core/fetcher/Fetcher.js.map +1 -0
- package/dist/core/fetcher/Headers.d.ts +3 -0
- package/dist/core/fetcher/Headers.d.ts.map +1 -0
- package/dist/core/fetcher/Headers.js +84 -0
- package/dist/core/fetcher/Headers.js.map +1 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +59 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts.map +1 -0
- package/dist/core/fetcher/HttpResponsePromise.js +91 -0
- package/dist/core/fetcher/HttpResponsePromise.js.map +1 -0
- package/dist/core/fetcher/RawResponse.d.ts +30 -0
- package/dist/core/fetcher/RawResponse.d.ts.map +1 -0
- package/dist/core/fetcher/RawResponse.js +41 -0
- package/dist/core/fetcher/RawResponse.js.map +1 -0
- package/dist/core/fetcher/Supplier.d.ts +5 -0
- package/dist/core/fetcher/Supplier.d.ts.map +1 -0
- package/dist/core/fetcher/Supplier.js +11 -0
- package/dist/core/fetcher/Supplier.js.map +1 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +2 -0
- package/dist/core/fetcher/createRequestUrl.d.ts.map +1 -0
- package/dist/core/fetcher/createRequestUrl.js +6 -0
- package/dist/core/fetcher/createRequestUrl.js.map +1 -0
- package/dist/core/fetcher/getErrorResponseBody.d.ts +2 -0
- package/dist/core/fetcher/getErrorResponseBody.d.ts.map +1 -0
- package/dist/core/fetcher/getErrorResponseBody.js +31 -0
- package/dist/core/fetcher/getErrorResponseBody.js.map +1 -0
- package/dist/core/fetcher/getFetchFn.d.ts +2 -0
- package/dist/core/fetcher/getFetchFn.d.ts.map +1 -0
- package/dist/core/fetcher/getFetchFn.js +4 -0
- package/dist/core/fetcher/getFetchFn.js.map +1 -0
- package/dist/core/fetcher/getHeader.d.ts +2 -0
- package/dist/core/fetcher/getHeader.d.ts.map +1 -0
- package/dist/core/fetcher/getHeader.js +9 -0
- package/dist/core/fetcher/getHeader.js.map +1 -0
- package/dist/core/fetcher/getRequestBody.d.ts +8 -0
- package/dist/core/fetcher/getRequestBody.d.ts.map +1 -0
- package/dist/core/fetcher/getRequestBody.js +14 -0
- package/dist/core/fetcher/getRequestBody.js.map +1 -0
- package/dist/core/fetcher/getResponseBody.d.ts +2 -0
- package/dist/core/fetcher/getResponseBody.d.ts.map +1 -0
- package/dist/core/fetcher/getResponseBody.js +56 -0
- package/dist/core/fetcher/getResponseBody.js.map +1 -0
- package/dist/core/fetcher/index.d.ts +14 -0
- package/dist/core/fetcher/index.d.ts.map +1 -0
- package/dist/core/fetcher/index.js +8 -0
- package/dist/core/fetcher/index.js.map +1 -0
- package/dist/core/fetcher/makePassthroughRequest.d.ts +50 -0
- package/dist/core/fetcher/makePassthroughRequest.d.ts.map +1 -0
- package/dist/core/fetcher/makePassthroughRequest.js +120 -0
- package/dist/core/fetcher/makePassthroughRequest.js.map +1 -0
- package/dist/core/fetcher/makeRequest.d.ts +7 -0
- package/dist/core/fetcher/makeRequest.d.ts.map +1 -0
- package/dist/core/fetcher/makeRequest.js +54 -0
- package/dist/core/fetcher/makeRequest.js.map +1 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +2 -0
- package/dist/core/fetcher/requestWithRetries.d.ts.map +1 -0
- package/dist/core/fetcher/requestWithRetries.js +57 -0
- package/dist/core/fetcher/requestWithRetries.js.map +1 -0
- package/dist/core/fetcher/signals.d.ts +6 -0
- package/dist/core/fetcher/signals.d.ts.map +1 -0
- package/dist/core/fetcher/signals.js +21 -0
- package/dist/core/fetcher/signals.js.map +1 -0
- package/dist/core/headers.d.ts +3 -0
- package/dist/core/headers.d.ts.map +1 -0
- package/dist/core/headers.js +28 -0
- package/dist/core/headers.js.map +1 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +7 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/json.d.ts +16 -0
- package/dist/core/json.d.ts.map +1 -0
- package/dist/core/json.js +20 -0
- package/dist/core/json.js.map +1 -0
- package/dist/core/logging/exports.d.ts +19 -0
- package/dist/core/logging/exports.d.ts.map +1 -0
- package/dist/core/logging/exports.js +10 -0
- package/dist/core/logging/exports.js.map +1 -0
- package/dist/core/logging/index.d.ts +2 -0
- package/dist/core/logging/index.d.ts.map +1 -0
- package/dist/core/logging/index.js +2 -0
- package/dist/core/logging/index.js.map +1 -0
- package/dist/core/logging/logger.d.ts +127 -0
- package/dist/core/logging/logger.d.ts.map +1 -0
- package/dist/core/logging/logger.js +141 -0
- package/dist/core/logging/logger.js.map +1 -0
- package/dist/core/runtime/index.d.ts +2 -0
- package/dist/core/runtime/index.d.ts.map +1 -0
- package/dist/core/runtime/index.js +2 -0
- package/dist/core/runtime/index.js.map +1 -0
- package/dist/core/runtime/runtime.d.ts +10 -0
- package/dist/core/runtime/runtime.d.ts.map +1 -0
- package/dist/core/runtime/runtime.js +101 -0
- package/dist/core/runtime/runtime.js.map +1 -0
- package/dist/core/url/QueryStringBuilder.d.ts +48 -0
- package/dist/core/url/QueryStringBuilder.d.ts.map +1 -0
- package/dist/core/url/QueryStringBuilder.js +79 -0
- package/dist/core/url/QueryStringBuilder.js.map +1 -0
- package/dist/core/url/encodePathParam.d.ts +2 -0
- package/dist/core/url/encodePathParam.d.ts.map +1 -0
- package/dist/core/url/encodePathParam.js +19 -0
- package/dist/core/url/encodePathParam.js.map +1 -0
- package/dist/core/url/index.d.ts +5 -0
- package/dist/core/url/index.d.ts.map +1 -0
- package/dist/core/url/index.js +5 -0
- package/dist/core/url/index.js.map +1 -0
- package/dist/core/url/join.d.ts +2 -0
- package/dist/core/url/join.d.ts.map +1 -0
- package/dist/core/url/join.js +66 -0
- package/dist/core/url/join.js.map +1 -0
- package/dist/core/url/qs.d.ts +8 -0
- package/dist/core/url/qs.d.ts.map +1 -0
- package/dist/core/url/qs.js +77 -0
- package/dist/core/url/qs.js.map +1 -0
- package/dist/environments.d.ts +5 -0
- package/dist/environments.d.ts.map +1 -0
- package/dist/environments.js +5 -0
- package/dist/environments.js.map +1 -0
- package/dist/errors/CashDroApiError.d.ts +15 -0
- package/dist/errors/CashDroApiError.d.ts.map +1 -0
- package/dist/errors/CashDroApiError.js +36 -0
- package/dist/errors/CashDroApiError.js.map +1 -0
- package/dist/errors/CashDroApiTimeoutError.d.ts +7 -0
- package/dist/errors/CashDroApiTimeoutError.d.ts.map +1 -0
- package/dist/errors/CashDroApiTimeoutError.js +16 -0
- package/dist/errors/CashDroApiTimeoutError.js.map +1 -0
- package/dist/errors/handleNonStatusCodeError.d.ts +3 -0
- package/dist/errors/handleNonStatusCodeError.d.ts.map +1 -0
- package/dist/errors/handleNonStatusCodeError.js +33 -0
- package/dist/errors/handleNonStatusCodeError.js.map +1 -0
- package/dist/errors/index.d.ts +3 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +3 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/exports.d.ts +2 -0
- package/dist/exports.d.ts.map +1 -0
- package/dist/exports.js +2 -0
- package/dist/exports.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +13 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +15 -0
- package/dist/main.js.map +1 -0
- package/package.json +47 -0
package/dist/cashdro.js
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CashDroClient — the primary, hand-written client for the CashDro Web Service.
|
|
3
|
+
* It wraps the generated `CashDroApiClient` (./index.js) in this package.
|
|
4
|
+
*
|
|
5
|
+
* Why this exists: the CashDro web service dispatches on a constant `operation`
|
|
6
|
+
* query parameter that must be sent on every call. Fern's generated SDK always
|
|
7
|
+
* sources query params from the caller, so the raw client requires you to pass
|
|
8
|
+
* `{ operation: "doTest" }` etc. on every method — redundant, since it is fixed
|
|
9
|
+
* per endpoint. This layer injects `operation` for you and exposes the rest of
|
|
10
|
+
* each call with plain arguments. It also lets `startOperation` take an `amount`
|
|
11
|
+
* directly instead of a pre-encoded JSON string.
|
|
12
|
+
*
|
|
13
|
+
* The generated SDK remains the source of transport, types, and auth; this is
|
|
14
|
+
* purely a nicer surface and is never overwritten by `fern generate`.
|
|
15
|
+
*/
|
|
16
|
+
import { CashDroApiClient } from "./index.js";
|
|
17
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
18
|
+
/** Thrown when a CashDro call returns a non-success `code`. Carries the raw response. */
|
|
19
|
+
export class CashDroError extends Error {
|
|
20
|
+
response;
|
|
21
|
+
constructor(message, response) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.response = response;
|
|
24
|
+
this.name = "CashDroError";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/** Thrown when {@link CashDroClient.pollUntilFinished} exceeds its timeout. Carries the last poll. */
|
|
28
|
+
export class CashDroTimeoutError extends Error {
|
|
29
|
+
operationId;
|
|
30
|
+
last;
|
|
31
|
+
constructor(operationId, last) {
|
|
32
|
+
super(`operation ${operationId} did not reach state F before the timeout`);
|
|
33
|
+
this.operationId = operationId;
|
|
34
|
+
this.last = last;
|
|
35
|
+
this.name = "CashDroTimeoutError";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const toEnglishPiece = (p) => ({
|
|
39
|
+
value: String(p.value),
|
|
40
|
+
level: String(p.level),
|
|
41
|
+
isBill: String(p.isBill),
|
|
42
|
+
});
|
|
43
|
+
const toSpanishPiece = (p) => ({
|
|
44
|
+
valor: String(p.value),
|
|
45
|
+
nivel: String(p.level),
|
|
46
|
+
isBillete: String(p.isBill),
|
|
47
|
+
});
|
|
48
|
+
export class CashDroClient {
|
|
49
|
+
/** The underlying Fern-generated client, exposed for escape-hatch access. */
|
|
50
|
+
api;
|
|
51
|
+
constructor(options) {
|
|
52
|
+
this.api = new CashDroApiClient(options);
|
|
53
|
+
}
|
|
54
|
+
/** Verify connection and credentials. */
|
|
55
|
+
doTest(requestOptions) {
|
|
56
|
+
return this.api.doTest({ operation: "doTest" }, requestOptions);
|
|
57
|
+
}
|
|
58
|
+
/** Open a cash-movement transaction; returns an operationId. */
|
|
59
|
+
startOperation(params, requestOptions) {
|
|
60
|
+
const parameters = params.parameters ??
|
|
61
|
+
(params.amount != null ? JSON.stringify({ amount: String(params.amount) }) : undefined);
|
|
62
|
+
return this.api.startOperation({
|
|
63
|
+
operation: "startOperation",
|
|
64
|
+
type: params.type,
|
|
65
|
+
parameters,
|
|
66
|
+
posid: params.posid,
|
|
67
|
+
posuser: params.posuser,
|
|
68
|
+
aliasid: params.aliasid,
|
|
69
|
+
}, requestOptions);
|
|
70
|
+
}
|
|
71
|
+
/** Confirm + launch a started operation. */
|
|
72
|
+
acknowledgeOperationId(operationId, requestOptions) {
|
|
73
|
+
return this.api.acknowledgeOperationId({ operation: "acknowledgeOperationId", operationId }, requestOptions);
|
|
74
|
+
}
|
|
75
|
+
/** Poll an operation's status. */
|
|
76
|
+
askOperation(operationId, requestOptions) {
|
|
77
|
+
return this.api.askOperation({ operation: "askOperation", operationId }, requestOptions);
|
|
78
|
+
}
|
|
79
|
+
/** Query the operation currently executing (OperationId -1 when idle). */
|
|
80
|
+
askOperationExecuting(requestOptions) {
|
|
81
|
+
return this.api.askOperationExecuting({ operation: "askOperationExecuting" }, requestOptions);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Finalize (type=1), cancel (type=2), or finalize-with-piece-list (type=4)
|
|
85
|
+
* an operation. For type=4 pass the Spanish-keyed `params` string (see
|
|
86
|
+
* {@link finishWithPieces} for a typed builder).
|
|
87
|
+
*/
|
|
88
|
+
finishOperation(operationId, type, params, requestOptions) {
|
|
89
|
+
return this.api.finishOperation({ operation: "finishOperation", operationId, type, params }, requestOptions);
|
|
90
|
+
}
|
|
91
|
+
/** Mark an operation as imported by the Host. */
|
|
92
|
+
setOperationImported(operationId, requestOptions) {
|
|
93
|
+
return this.api.setOperationImported({ operation: "setOperationImported", operationId }, requestOptions);
|
|
94
|
+
}
|
|
95
|
+
/** List operations pending to import. */
|
|
96
|
+
askPendingOperations(params, requestOptions) {
|
|
97
|
+
return this.api.askPendingOperations({ operation: "askPendingOperations", ...params }, requestOptions);
|
|
98
|
+
}
|
|
99
|
+
/** Query cash levels per denomination. */
|
|
100
|
+
getPiecesCurrency(params, requestOptions) {
|
|
101
|
+
return this.api.getPiecesCurrency({ operation: "getPiecesCurrency", ...params }, requestOptions);
|
|
102
|
+
}
|
|
103
|
+
/** Query active denomination alerts. */
|
|
104
|
+
getAlerts(requestOptions) {
|
|
105
|
+
return this.api.getAlerts({ operation: "getAlerts" }, requestOptions);
|
|
106
|
+
}
|
|
107
|
+
/** Query unit diagnosis / device errors. */
|
|
108
|
+
getDiagnosis(requestOptions) {
|
|
109
|
+
return this.api.getDiagnosis({ operation: "getDiagnosis" }, requestOptions);
|
|
110
|
+
}
|
|
111
|
+
/** Query operations between two dates. */
|
|
112
|
+
askMovements(params, requestOptions) {
|
|
113
|
+
return this.api.askMovements({ operation: "askMovements", ...params }, requestOptions);
|
|
114
|
+
}
|
|
115
|
+
// ----- ergonomic orchestration helpers -------------------------------------
|
|
116
|
+
/**
|
|
117
|
+
* Poll askOperation until the operation reaches state "F" (finished),
|
|
118
|
+
* returning the full final response (totals, device levels, messages...).
|
|
119
|
+
* Throws {@link CashDroTimeoutError} on timeout — the operation stays open,
|
|
120
|
+
* so cancel it with `finishOperation(id, 2)` if you want to abort.
|
|
121
|
+
*/
|
|
122
|
+
async pollUntilFinished(operationId, opts = {}) {
|
|
123
|
+
const { intervalMs = 1000, timeoutMs = 120_000, signal, onPoll } = opts;
|
|
124
|
+
const deadline = Date.now() + timeoutMs;
|
|
125
|
+
while (true) {
|
|
126
|
+
const status = await this.askOperation(operationId);
|
|
127
|
+
onPoll?.(status);
|
|
128
|
+
if (status.response?.operation?.operation?.state === "F")
|
|
129
|
+
return status;
|
|
130
|
+
if (signal?.aborted)
|
|
131
|
+
throw new CashDroError(`poll aborted for operation ${operationId}`, status);
|
|
132
|
+
if (Date.now() >= deadline)
|
|
133
|
+
throw new CashDroTimeoutError(operationId, status);
|
|
134
|
+
await sleep(intervalMs);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Run the shared transaction boilerplate: startOperation → (acknowledge) →
|
|
139
|
+
* optionally poll until finished → optionally import. Returns every raw
|
|
140
|
+
* response — including the operationId — so nothing useful is hidden.
|
|
141
|
+
*
|
|
142
|
+
* By default it does NOT wait for completion: a sale blocks on the customer
|
|
143
|
+
* inserting cash, so the caller usually wants the operationId back immediately
|
|
144
|
+
* (to display it, poll it, or cancel it). Set `waitForFinish` for self-
|
|
145
|
+
* completing operations.
|
|
146
|
+
*/
|
|
147
|
+
async runOperation(params, opts = {}) {
|
|
148
|
+
const { acknowledge = true, waitForFinish = false, autoImport = false, onStart, poll } = opts;
|
|
149
|
+
const started = await this.startOperation(params);
|
|
150
|
+
const operationId = Number(started.response?.operation?.operationId);
|
|
151
|
+
if (started.code !== 1 || Number.isNaN(operationId)) {
|
|
152
|
+
throw new CashDroError(`startOperation failed (code ${started.code})`, started);
|
|
153
|
+
}
|
|
154
|
+
onStart?.(operationId, started);
|
|
155
|
+
const result = { operationId, started };
|
|
156
|
+
if (acknowledge)
|
|
157
|
+
await this.acknowledgeOperationId(operationId);
|
|
158
|
+
if (waitForFinish)
|
|
159
|
+
result.final = await this.pollUntilFinished(operationId, poll);
|
|
160
|
+
if (autoImport)
|
|
161
|
+
result.imported = await this.setOperationImported(operationId);
|
|
162
|
+
return result;
|
|
163
|
+
}
|
|
164
|
+
/** Shared plumbing for the per-transaction conveniences below. */
|
|
165
|
+
txn(type, opts, extra) {
|
|
166
|
+
const { posid, posuser, aliasid, ...run } = opts;
|
|
167
|
+
return this.runOperation({ type, posid, posuser, aliasid, amount: extra?.amount, parameters: extra?.parameters }, run);
|
|
168
|
+
}
|
|
169
|
+
// --- amount-based transactions (parameters = {"amount":"<minor units>"}) ---
|
|
170
|
+
/** Sale / venta (type 4). */
|
|
171
|
+
sale(amount, opts = {}) {
|
|
172
|
+
return this.txn(4, opts, { amount });
|
|
173
|
+
}
|
|
174
|
+
/** Payment / pago (type 3). */
|
|
175
|
+
payment(amount, opts = {}) {
|
|
176
|
+
return this.txn(3, opts, { amount });
|
|
177
|
+
}
|
|
178
|
+
/** Deposit by amount / ingreso por importe (type 17). */
|
|
179
|
+
depositByAmount(amount, opts = {}) {
|
|
180
|
+
return this.txn(17, opts, { amount });
|
|
181
|
+
}
|
|
182
|
+
// --- denomination-based payment (parameters = {"pieces":{"piece":[...]}}) ---
|
|
183
|
+
/** Pay by denomination / pago por denominación (type 3) — dispense the given pieces. */
|
|
184
|
+
paymentByDenomination(pieces, opts = {}) {
|
|
185
|
+
const parameters = JSON.stringify({ pieces: { piece: pieces.map(toEnglishPiece) } });
|
|
186
|
+
return this.txn(3, opts, { parameters });
|
|
187
|
+
}
|
|
188
|
+
// --- transactions with no startOperation parameters ---
|
|
189
|
+
// (driven to completion on the unit's web UI, by finishOperation, or by the
|
|
190
|
+
// operator; use waitForFinish / finishOperation / finishWithPieces as needed)
|
|
191
|
+
/** Deposit / ingreso (type 16). Finalize with finishOperation(id, 1) once the user is done. */
|
|
192
|
+
deposit(opts = {}) {
|
|
193
|
+
return this.txn(16, opts);
|
|
194
|
+
}
|
|
195
|
+
/** Change / cambio (type 18). */
|
|
196
|
+
change(opts = {}) {
|
|
197
|
+
return this.txn(18, opts);
|
|
198
|
+
}
|
|
199
|
+
/** Load / carga (type 1). */
|
|
200
|
+
load(opts = {}) {
|
|
201
|
+
return this.txn(1, opts);
|
|
202
|
+
}
|
|
203
|
+
/** Withdrawal / retirada (type 2), driven by the unit's web UI. */
|
|
204
|
+
withdraw(opts = {}) {
|
|
205
|
+
return this.txn(2, opts);
|
|
206
|
+
}
|
|
207
|
+
/** Transfer to cassette / traspaso a casete (type 8), driven by the unit's web UI. */
|
|
208
|
+
transferToCassette(opts = {}) {
|
|
209
|
+
return this.txn(8, opts);
|
|
210
|
+
}
|
|
211
|
+
/** Empty the note cassette / retirada casete de billetes (type 10). */
|
|
212
|
+
emptyNoteCassette(opts = {}) {
|
|
213
|
+
return this.txn(10, opts);
|
|
214
|
+
}
|
|
215
|
+
/** Empty the coin cassette / retirada casete de monedas (type 11). */
|
|
216
|
+
emptyCoinCassette(opts = {}) {
|
|
217
|
+
return this.txn(11, opts);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Finalize a "sin interfaz web" withdrawal (type 2) or transfer to cassette
|
|
221
|
+
* (type 8) by supplying the explicit piece list — calls finishOperation with
|
|
222
|
+
* type=4 and the Spanish-keyed `params`. Pieces taken from the recyclers go
|
|
223
|
+
* in `recycler`; pieces taken from the cassette go in `cassette`.
|
|
224
|
+
*/
|
|
225
|
+
finishWithPieces(operationId, pieces) {
|
|
226
|
+
const params = JSON.stringify({
|
|
227
|
+
Piezas: { pieza: (pieces.recycler ?? []).map(toSpanishPiece) },
|
|
228
|
+
PiezasCasete: { pieza: (pieces.cassette ?? []).map(toSpanishPiece) },
|
|
229
|
+
});
|
|
230
|
+
return this.finishOperation(operationId, 4, params);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=cashdro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cashdro.js","sourceRoot":"","sources":["../cashdro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,gBAAgB,EAAc,MAAM,YAAY,CAAC;AAE1D,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAEpE,yFAAyF;AACzF,MAAM,OAAO,YAAa,SAAQ,KAAK;IAGtB;IAFb,YACI,OAAe,EACN,QAAiB;QAE1B,KAAK,CAAC,OAAO,CAAC,CAAC;QAFN,aAAQ,GAAR,QAAQ,CAAS;QAG1B,IAA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CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACH,gBAAgB,CACZ,WAAmB,EACnB,MAA0E;QAE1E,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC;YAC1B,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;YAC9D,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;SACvE,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC;CACJ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EndpointMetadata } from "../fetcher/EndpointMetadata.js";
|
|
2
|
+
import type { AuthRequest } from "./AuthRequest.js";
|
|
3
|
+
export interface AuthProvider {
|
|
4
|
+
getAuthRequest(arg?: {
|
|
5
|
+
endpointMetadata?: EndpointMetadata;
|
|
6
|
+
}): Promise<AuthRequest>;
|
|
7
|
+
}
|
|
8
|
+
export declare function isAuthProvider(value: unknown): value is AuthProvider;
|
|
9
|
+
//# sourceMappingURL=AuthProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthProvider.d.ts","sourceRoot":"","sources":["../../../core/auth/AuthProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,WAAW,YAAY;IACzB,cAAc,CAAC,GAAG,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CACvF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAOpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthProvider.js","sourceRoot":"","sources":["../../../core/auth/AuthProvider.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,cAAc,CAAC,KAAc;IACzC,OAAO,CACH,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,gBAAgB,IAAI,KAAK;QACzB,OAAO,KAAK,CAAC,cAAc,KAAK,UAAU,CAC7C,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthRequest.d.ts","sourceRoot":"","sources":["../../../core/auth/AuthRequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthRequest.js","sourceRoot":"","sources":["../../../core/auth/AuthRequest.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface BasicAuth {
|
|
2
|
+
username?: string;
|
|
3
|
+
password?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const BasicAuth: {
|
|
6
|
+
toAuthorizationHeader: (basicAuth: BasicAuth | undefined) => string | undefined;
|
|
7
|
+
fromAuthorizationHeader: (header: string) => BasicAuth;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=BasicAuth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BasicAuth.d.ts","sourceRoot":"","sources":["../../../core/auth/BasicAuth.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAID,eAAO,MAAM,SAAS;uCACiB,SAAS,GAAG,SAAS,KAAG,MAAM,GAAG,SAAS;sCAY3C,MAAM,KAAG,SAAS;CAcvD,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { base64Decode, base64Encode } from "../base64.js";
|
|
2
|
+
const BASIC_AUTH_HEADER_PREFIX = /^Basic /i;
|
|
3
|
+
export const BasicAuth = {
|
|
4
|
+
toAuthorizationHeader: (basicAuth) => {
|
|
5
|
+
if (basicAuth == null) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
const username = basicAuth.username ?? "";
|
|
9
|
+
const password = basicAuth.password ?? "";
|
|
10
|
+
if (username === "" && password === "") {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
const token = base64Encode(`${username}:${password}`);
|
|
14
|
+
return `Basic ${token}`;
|
|
15
|
+
},
|
|
16
|
+
fromAuthorizationHeader: (header) => {
|
|
17
|
+
const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, "");
|
|
18
|
+
const decoded = base64Decode(credentials);
|
|
19
|
+
const [username, ...passwordParts] = decoded.split(":");
|
|
20
|
+
const password = passwordParts.length > 0 ? passwordParts.join(":") : undefined;
|
|
21
|
+
if (username == null || password == null) {
|
|
22
|
+
throw new Error("Invalid basic auth");
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
username,
|
|
26
|
+
password,
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=BasicAuth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BasicAuth.js","sourceRoot":"","sources":["../../../core/auth/BasicAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAO1D,MAAM,wBAAwB,GAAG,UAAU,CAAC;AAE5C,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,qBAAqB,EAAE,CAAC,SAAgC,EAAsB,EAAE;QAC5E,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;YACpB,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,IAAI,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,IAAI,EAAE,CAAC;QAC1C,IAAI,QAAQ,KAAK,EAAE,IAAI,QAAQ,KAAK,EAAE,EAAE,CAAC;YACrC,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAC,CAAC;QACtD,OAAO,SAAS,KAAK,EAAE,CAAC;IAC5B,CAAC;IACD,uBAAuB,EAAE,CAAC,MAAc,EAAa,EAAE;QACnD,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;QACjE,MAAM,OAAO,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;QAC1C,MAAM,CAAC,QAAQ,EAAE,GAAG,aAAa,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACxD,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEhF,IAAI,QAAQ,IAAI,IAAI,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO;YACH,QAAQ;YACR,QAAQ;SACX,CAAC;IACN,CAAC;CACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type BearerToken = string;
|
|
2
|
+
declare function toAuthorizationHeader(token: string | undefined): string | undefined;
|
|
3
|
+
export declare const BearerToken: {
|
|
4
|
+
toAuthorizationHeader: typeof toAuthorizationHeader;
|
|
5
|
+
fromAuthorizationHeader: (header: string) => BearerToken;
|
|
6
|
+
};
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=BearerToken.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BearerToken.d.ts","sourceRoot":"","sources":["../../../core/auth/BearerToken.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAIjC,iBAAS,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAK5E;AAED,eAAO,MAAM,WAAW,EAAE;IACtB,qBAAqB,EAAE,OAAO,qBAAqB,CAAC;IACpD,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,WAAW,CAAC;CAM5D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const BEARER_AUTH_HEADER_PREFIX = /^Bearer /i;
|
|
2
|
+
function toAuthorizationHeader(token) {
|
|
3
|
+
if (token == null) {
|
|
4
|
+
return undefined;
|
|
5
|
+
}
|
|
6
|
+
return `Bearer ${token}`;
|
|
7
|
+
}
|
|
8
|
+
export const BearerToken = {
|
|
9
|
+
toAuthorizationHeader: toAuthorizationHeader,
|
|
10
|
+
fromAuthorizationHeader: (header) => {
|
|
11
|
+
return header.replace(BEARER_AUTH_HEADER_PREFIX, "").trim();
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=BearerToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BearerToken.js","sourceRoot":"","sources":["../../../core/auth/BearerToken.ts"],"names":[],"mappings":"AAEA,MAAM,yBAAyB,GAAG,WAAW,CAAC;AAE9C,SAAS,qBAAqB,CAAC,KAAyB;IACpD,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAChB,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,UAAU,KAAK,EAAE,CAAC;AAC7B,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAGpB;IACA,qBAAqB,EAAE,qBAAqB;IAC5C,uBAAuB,EAAE,CAAC,MAAc,EAAe,EAAE;QACrD,OAAO,MAAM,CAAC,OAAO,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC,IAAI,EAAiB,CAAC;IAC/E,CAAC;CACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AuthProvider } from "./AuthProvider.js";
|
|
2
|
+
import type { AuthRequest } from "./AuthRequest.js";
|
|
3
|
+
export declare class NoOpAuthProvider implements AuthProvider {
|
|
4
|
+
getAuthRequest(): Promise<AuthRequest>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=NoOpAuthProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoOpAuthProvider.d.ts","sourceRoot":"","sources":["../../../core/auth/NoOpAuthProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,qBAAa,gBAAiB,YAAW,YAAY;IAC1C,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC;CAGhD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoOpAuthProvider.js","sourceRoot":"","sources":["../../../core/auth/NoOpAuthProvider.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,gBAAgB;IAClB,cAAc;QACjB,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5C,CAAC;CACJ"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { type AuthProvider, isAuthProvider } from "./AuthProvider.js";
|
|
2
|
+
export type { AuthRequest } from "./AuthRequest.js";
|
|
3
|
+
export { BasicAuth } from "./BasicAuth.js";
|
|
4
|
+
export { BearerToken } from "./BearerToken.js";
|
|
5
|
+
export { NoOpAuthProvider } from "./NoOpAuthProvider.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../core/base64.ts"],"names":[],"mappings":"AAUA,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOlD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOlD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function base64ToBytes(base64) {
|
|
2
|
+
const binString = atob(base64);
|
|
3
|
+
return Uint8Array.from(binString, (m) => m.codePointAt(0));
|
|
4
|
+
}
|
|
5
|
+
function bytesToBase64(bytes) {
|
|
6
|
+
const binString = String.fromCodePoint(...bytes);
|
|
7
|
+
return btoa(binString);
|
|
8
|
+
}
|
|
9
|
+
export function base64Encode(input) {
|
|
10
|
+
if (typeof Buffer !== "undefined") {
|
|
11
|
+
return Buffer.from(input, "utf8").toString("base64");
|
|
12
|
+
}
|
|
13
|
+
const bytes = new TextEncoder().encode(input);
|
|
14
|
+
return bytesToBase64(bytes);
|
|
15
|
+
}
|
|
16
|
+
export function base64Decode(input) {
|
|
17
|
+
if (typeof Buffer !== "undefined") {
|
|
18
|
+
return Buffer.from(input, "base64").toString("utf8");
|
|
19
|
+
}
|
|
20
|
+
const bytes = base64ToBytes(input);
|
|
21
|
+
return new TextDecoder().decode(bytes);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=base64.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../core/base64.ts"],"names":[],"mappings":"AAAA,SAAS,aAAa,CAAC,MAAc;IACjC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAE,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,aAAa,CAAC,KAAiB;IACpC,MAAM,SAAS,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC,CAAC;IACjD,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAa;IACtC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAa;IACtC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACnC,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../core/exports.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../core/exports.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { RawResponse } from "./RawResponse.js";
|
|
2
|
+
/**
|
|
3
|
+
* The response of an API call.
|
|
4
|
+
* It is a successful response or a failed response.
|
|
5
|
+
*/
|
|
6
|
+
export type APIResponse<Success, Failure> = SuccessfulResponse<Success> | FailedResponse<Failure>;
|
|
7
|
+
export interface SuccessfulResponse<T> {
|
|
8
|
+
ok: true;
|
|
9
|
+
body: T;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use `rawResponse` instead
|
|
12
|
+
*/
|
|
13
|
+
headers?: Record<string, any>;
|
|
14
|
+
rawResponse: RawResponse;
|
|
15
|
+
}
|
|
16
|
+
export interface FailedResponse<T> {
|
|
17
|
+
ok: false;
|
|
18
|
+
error: T;
|
|
19
|
+
rawResponse: RawResponse;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=APIResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"APIResponse.d.ts","sourceRoot":"","sources":["../../../core/fetcher/APIResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;AAElG,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACjC,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,CAAC,CAAC;IACR;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,WAAW,EAAE,WAAW,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc,CAAC,CAAC;IAC7B,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE,CAAC,CAAC;IACT,WAAW,EAAE,WAAW,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"APIResponse.js","sourceRoot":"","sources":["../../../core/fetcher/APIResponse.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type BinaryResponse = {
|
|
2
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
|
|
3
|
+
bodyUsed: Response["bodyUsed"];
|
|
4
|
+
/**
|
|
5
|
+
* Returns a ReadableStream of the response body.
|
|
6
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body)
|
|
7
|
+
*/
|
|
8
|
+
stream: () => Response["body"];
|
|
9
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
|
|
10
|
+
arrayBuffer: () => ReturnType<Response["arrayBuffer"]>;
|
|
11
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
|
|
12
|
+
blob: () => ReturnType<Response["blob"]>;
|
|
13
|
+
/**
|
|
14
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes)
|
|
15
|
+
* Some versions of the Fetch API may not support this method.
|
|
16
|
+
*/
|
|
17
|
+
bytes?(): Promise<Uint8Array>;
|
|
18
|
+
};
|
|
19
|
+
export declare function getBinaryResponse(response: Response): BinaryResponse;
|
|
20
|
+
//# sourceMappingURL=BinaryResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BinaryResponse.d.ts","sourceRoot":"","sources":["../../../core/fetcher/BinaryResponse.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IACzB,mFAAmF;IACnF,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC/B;;;OAGG;IACH,MAAM,EAAE,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,sFAAsF;IACtF,WAAW,EAAE,MAAM,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;IACvD,+EAA+E;IAC/E,IAAI,EAAE,MAAM,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IACzC;;;OAGG;IACH,KAAK,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;CACjC,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,cAAc,CAcpE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function getBinaryResponse(response) {
|
|
2
|
+
const binaryResponse = {
|
|
3
|
+
get bodyUsed() {
|
|
4
|
+
return response.bodyUsed;
|
|
5
|
+
},
|
|
6
|
+
stream: () => response.body,
|
|
7
|
+
arrayBuffer: response.arrayBuffer.bind(response),
|
|
8
|
+
blob: response.blob.bind(response),
|
|
9
|
+
};
|
|
10
|
+
if ("bytes" in response && typeof response.bytes === "function") {
|
|
11
|
+
binaryResponse.bytes = response.bytes.bind(response);
|
|
12
|
+
}
|
|
13
|
+
return binaryResponse;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=BinaryResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BinaryResponse.js","sourceRoot":"","sources":["../../../core/fetcher/BinaryResponse.ts"],"names":[],"mappings":"AAmBA,MAAM,UAAU,iBAAiB,CAAC,QAAkB;IAChD,MAAM,cAAc,GAAmB;QACnC,IAAI,QAAQ;YACR,OAAO,QAAQ,CAAC,QAAQ,CAAC;QAC7B,CAAC;QACD,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI;QAC3B,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC;QAChD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;KACrC,CAAC;IACF,IAAI,OAAO,IAAI,QAAQ,IAAI,OAAO,QAAQ,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;QAC9D,cAAc,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,cAAc,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type SecuritySchemeKey = string;
|
|
2
|
+
/**
|
|
3
|
+
* A collection of security schemes, where the key is the name of the security scheme and the value is the list of scopes required for that scheme.
|
|
4
|
+
* All schemes in the collection must be satisfied for authentication to be successful.
|
|
5
|
+
*/
|
|
6
|
+
export type SecuritySchemeCollection = Record<SecuritySchemeKey, AuthScope[]>;
|
|
7
|
+
export type AuthScope = string;
|
|
8
|
+
export type EndpointMetadata = {
|
|
9
|
+
/**
|
|
10
|
+
* An array of security scheme collections. Each collection represents an alternative way to authenticate.
|
|
11
|
+
*/
|
|
12
|
+
security?: SecuritySchemeCollection[];
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=EndpointMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EndpointMetadata.d.ts","sourceRoot":"","sources":["../../../core/fetcher/EndpointMetadata.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACvC;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,iBAAiB,EAAE,SAAS,EAAE,CAAC,CAAC;AAC9E,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAC/B,MAAM,MAAM,gBAAgB,GAAG;IAC3B;;OAEG;IACH,QAAQ,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACzC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EndpointMetadata.js","sourceRoot":"","sources":["../../../core/fetcher/EndpointMetadata.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EndpointMetadata } from "./EndpointMetadata.js";
|
|
2
|
+
import type { Supplier } from "./Supplier.js";
|
|
3
|
+
type EndpointSupplierFn<T> = (arg: {
|
|
4
|
+
endpointMetadata?: EndpointMetadata;
|
|
5
|
+
}) => T | Promise<T>;
|
|
6
|
+
export type EndpointSupplier<T> = Supplier<T> | EndpointSupplierFn<T>;
|
|
7
|
+
export declare const EndpointSupplier: {
|
|
8
|
+
get: <T>(supplier: EndpointSupplier<T>, arg: {
|
|
9
|
+
endpointMetadata?: EndpointMetadata;
|
|
10
|
+
}) => Promise<T>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=EndpointSupplier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EndpointSupplier.d.ts","sourceRoot":"","sources":["../../../core/fetcher/EndpointSupplier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,KAAK,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;IAAE,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;CAAE,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC9F,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;AACtE,eAAO,MAAM,gBAAgB;UACb,CAAC,YAAY,gBAAgB,CAAC,CAAC,CAAC,OAAO;QAAE,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;KAAE,KAAG,OAAO,CAAC,CAAC,CAAC;CAO1G,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EndpointSupplier.js","sourceRoot":"","sources":["../../../core/fetcher/EndpointSupplier.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,GAAG,EAAE,KAAK,EAAK,QAA6B,EAAE,GAA4C,EAAc,EAAE;QACtG,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;YACjC,OAAQ,QAAkC,CAAC,GAAG,CAAC,CAAC;QACpD,CAAC;aAAM,CAAC;YACJ,OAAO,QAAQ,CAAC;QACpB,CAAC;IACL,CAAC;CACJ,CAAC"}
|