@quantum-hub/qhub-api 1.0.4
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 +9 -0
- package/dist/api/platform/BaseClient.d.ts +43 -0
- package/dist/api/platform/BaseClient.js +66 -0
- package/dist/api/platform/Client.d.ts +41 -0
- package/dist/api/platform/Client.js +62 -0
- package/dist/api/platform/api/errors/BadRequestError.d.ts +5 -0
- package/dist/api/platform/api/errors/BadRequestError.js +54 -0
- package/dist/api/platform/api/errors/ForbiddenError.d.ts +5 -0
- package/dist/api/platform/api/errors/ForbiddenError.js +54 -0
- package/dist/api/platform/api/errors/InternalServerError.d.ts +5 -0
- package/dist/api/platform/api/errors/InternalServerError.js +54 -0
- package/dist/api/platform/api/errors/NotFoundError.d.ts +5 -0
- package/dist/api/platform/api/errors/NotFoundError.js +54 -0
- package/dist/api/platform/api/errors/UnauthorizedError.d.ts +5 -0
- package/dist/api/platform/api/errors/UnauthorizedError.js +54 -0
- package/dist/api/platform/api/errors/index.d.ts +5 -0
- package/dist/api/platform/api/errors/index.js +21 -0
- package/dist/api/platform/api/index.d.ts +3 -0
- package/dist/api/platform/api/index.js +19 -0
- package/dist/api/platform/api/resources/applications/client/Client.d.ts +120 -0
- package/dist/api/platform/api/resources/applications/client/Client.js +425 -0
- package/dist/api/platform/api/resources/applications/client/index.d.ts +1 -0
- package/dist/api/platform/api/resources/applications/client/index.js +17 -0
- package/dist/api/platform/api/resources/applications/client/requests/CreateApplicationRequest.d.ts +7 -0
- package/dist/api/platform/api/resources/applications/client/requests/CreateApplicationRequest.js +3 -0
- package/dist/api/platform/api/resources/applications/client/requests/DeleteApplicationRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/applications/client/requests/DeleteApplicationRequest.js +3 -0
- package/dist/api/platform/api/resources/applications/client/requests/GetApplicationAccessKeysRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/applications/client/requests/GetApplicationAccessKeysRequest.js +3 -0
- package/dist/api/platform/api/resources/applications/client/requests/GetApplicationRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/applications/client/requests/GetApplicationRequest.js +3 -0
- package/dist/api/platform/api/resources/applications/client/requests/GetApplicationSubscriptionsRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/applications/client/requests/GetApplicationSubscriptionsRequest.js +3 -0
- package/dist/api/platform/api/resources/applications/client/requests/index.d.ts +5 -0
- package/dist/api/platform/api/resources/applications/client/requests/index.js +2 -0
- package/dist/api/platform/api/resources/applications/index.d.ts +1 -0
- package/dist/api/platform/api/resources/applications/index.js +17 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/Client.d.ts +163 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/Client.js +538 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/index.d.ts +1 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/index.js +17 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/AddConstraint1Request.d.ts +14 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/AddConstraint1Request.js +3 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/DeleteConstraint1Request.d.ts +13 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/DeleteConstraint1Request.js +3 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/DeleteShare1Request.d.ts +11 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/DeleteShare1Request.js +3 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/GetSharesForDataPoolRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/GetSharesForDataPoolRequest.js +3 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/ShareDataPoolRequest.d.ts +12 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/ShareDataPoolRequest.js +3 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/UpdateRole1Request.d.ts +14 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/UpdateRole1Request.js +3 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/UpdateTimeBasedConstraint1Request.d.ts +19 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/UpdateTimeBasedConstraint1Request.js +3 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/index.d.ts +7 -0
- package/dist/api/platform/api/resources/dataPoolShares/client/requests/index.js +2 -0
- package/dist/api/platform/api/resources/dataPoolShares/index.d.ts +2 -0
- package/dist/api/platform/api/resources/dataPoolShares/index.js +18 -0
- package/dist/api/platform/api/resources/dataPoolShares/types/AddConstraint1Response.d.ts +2 -0
- package/dist/api/platform/api/resources/dataPoolShares/types/AddConstraint1Response.js +3 -0
- package/dist/api/platform/api/resources/dataPoolShares/types/UpdateTimeBasedConstraint1RequestBody.d.ts +2 -0
- package/dist/api/platform/api/resources/dataPoolShares/types/UpdateTimeBasedConstraint1RequestBody.js +3 -0
- package/dist/api/platform/api/resources/dataPoolShares/types/UpdateTimeBasedConstraint1Response.d.ts +2 -0
- package/dist/api/platform/api/resources/dataPoolShares/types/UpdateTimeBasedConstraint1Response.js +3 -0
- package/dist/api/platform/api/resources/dataPoolShares/types/index.d.ts +3 -0
- package/dist/api/platform/api/resources/dataPoolShares/types/index.js +19 -0
- package/dist/api/platform/api/resources/dataPools/client/Client.d.ts +170 -0
- package/dist/api/platform/api/resources/dataPools/client/Client.js +624 -0
- package/dist/api/platform/api/resources/dataPools/client/index.d.ts +1 -0
- package/dist/api/platform/api/resources/dataPools/client/index.js +17 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/AddDataPoolFileRequest.d.ts +13 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/AddDataPoolFileRequest.js +3 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/CreateDataPoolRequest.d.ts +14 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/CreateDataPoolRequest.js +3 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/DeleteDataPoolFileRequest.d.ts +11 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/DeleteDataPoolFileRequest.js +3 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/DeleteDataPoolRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/DeleteDataPoolRequest.js +3 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/GetDataPoolFileRequest.d.ts +11 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/GetDataPoolFileRequest.js +3 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/GetDataPoolFilesRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/GetDataPoolFilesRequest.js +3 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/GetDataPoolRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/GetDataPoolRequest.js +3 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/UpdateDataPoolRequest.d.ts +17 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/UpdateDataPoolRequest.js +3 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/index.d.ts +8 -0
- package/dist/api/platform/api/resources/dataPools/client/requests/index.js +2 -0
- package/dist/api/platform/api/resources/dataPools/index.d.ts +1 -0
- package/dist/api/platform/api/resources/dataPools/index.js +17 -0
- package/dist/api/platform/api/resources/index.d.ts +23 -0
- package/dist/api/platform/api/resources/index.js +62 -0
- package/dist/api/platform/api/resources/organizations/client/Client.d.ts +33 -0
- package/dist/api/platform/api/resources/organizations/client/Client.js +119 -0
- package/dist/api/platform/api/resources/organizations/client/index.d.ts +1 -0
- package/dist/api/platform/api/resources/organizations/client/index.js +17 -0
- package/dist/api/platform/api/resources/organizations/client/requests/GetServiceExecutions1Request.d.ts +9 -0
- package/dist/api/platform/api/resources/organizations/client/requests/GetServiceExecutions1Request.js +3 -0
- package/dist/api/platform/api/resources/organizations/client/requests/index.d.ts +1 -0
- package/dist/api/platform/api/resources/organizations/client/requests/index.js +2 -0
- package/dist/api/platform/api/resources/organizations/index.d.ts +1 -0
- package/dist/api/platform/api/resources/organizations/index.js +17 -0
- package/dist/api/platform/api/resources/quantumJobs/client/Client.d.ts +31 -0
- package/dist/api/platform/api/resources/quantumJobs/client/Client.js +113 -0
- package/dist/api/platform/api/resources/quantumJobs/client/index.d.ts +1 -0
- package/dist/api/platform/api/resources/quantumJobs/client/index.js +17 -0
- package/dist/api/platform/api/resources/quantumJobs/client/requests/GetQuantumJobCostsRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/quantumJobs/client/requests/GetQuantumJobCostsRequest.js +3 -0
- package/dist/api/platform/api/resources/quantumJobs/client/requests/index.d.ts +1 -0
- package/dist/api/platform/api/resources/quantumJobs/client/requests/index.js +2 -0
- package/dist/api/platform/api/resources/quantumJobs/index.d.ts +1 -0
- package/dist/api/platform/api/resources/quantumJobs/index.js +17 -0
- package/dist/api/platform/api/resources/quantumWorkloads/client/Client.d.ts +31 -0
- package/dist/api/platform/api/resources/quantumWorkloads/client/Client.js +113 -0
- package/dist/api/platform/api/resources/quantumWorkloads/client/index.d.ts +1 -0
- package/dist/api/platform/api/resources/quantumWorkloads/client/index.js +17 -0
- package/dist/api/platform/api/resources/quantumWorkloads/client/requests/GetQuantumWorkloadCostsRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/quantumWorkloads/client/requests/GetQuantumWorkloadCostsRequest.js +3 -0
- package/dist/api/platform/api/resources/quantumWorkloads/client/requests/index.d.ts +1 -0
- package/dist/api/platform/api/resources/quantumWorkloads/client/requests/index.js +2 -0
- package/dist/api/platform/api/resources/quantumWorkloads/index.d.ts +1 -0
- package/dist/api/platform/api/resources/quantumWorkloads/index.js +17 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/Client.d.ts +167 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/Client.js +623 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/index.d.ts +1 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/index.js +17 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/CancelServiceExecutionRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/CancelServiceExecutionRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionCostsRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionCostsRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionLogsRequest.d.ts +13 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionLogsRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionMetricsRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionMetricsRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionResultFileRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionResultFileRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionResultRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionResultRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionsRequest.d.ts +24 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionsRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/HeadServiceExecutionRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/HeadServiceExecutionRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/index.d.ts +9 -0
- package/dist/api/platform/api/resources/serviceExecutions/client/requests/index.js +2 -0
- package/dist/api/platform/api/resources/serviceExecutions/index.d.ts +2 -0
- package/dist/api/platform/api/resources/serviceExecutions/index.js +18 -0
- package/dist/api/platform/api/resources/serviceExecutions/types/GetServiceExecutionResponse.d.ts +2 -0
- package/dist/api/platform/api/resources/serviceExecutions/types/GetServiceExecutionResponse.js +3 -0
- package/dist/api/platform/api/resources/serviceExecutions/types/index.d.ts +1 -0
- package/dist/api/platform/api/resources/serviceExecutions/types/index.js +17 -0
- package/dist/api/platform/api/resources/serviceJobs/client/Client.d.ts +87 -0
- package/dist/api/platform/api/resources/serviceJobs/client/Client.js +322 -0
- package/dist/api/platform/api/resources/serviceJobs/client/index.d.ts +1 -0
- package/dist/api/platform/api/resources/serviceJobs/client/index.js +17 -0
- package/dist/api/platform/api/resources/serviceJobs/client/requests/CreateServiceJobRequest.d.ts +14 -0
- package/dist/api/platform/api/resources/serviceJobs/client/requests/CreateServiceJobRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceJobs/client/requests/GetServiceJobRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/serviceJobs/client/requests/GetServiceJobRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceJobs/client/requests/GetServiceJobsRequest.d.ts +22 -0
- package/dist/api/platform/api/resources/serviceJobs/client/requests/GetServiceJobsRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceJobs/client/requests/RerunServiceJobRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/serviceJobs/client/requests/RerunServiceJobRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceJobs/client/requests/index.d.ts +4 -0
- package/dist/api/platform/api/resources/serviceJobs/client/requests/index.js +2 -0
- package/dist/api/platform/api/resources/serviceJobs/index.d.ts +1 -0
- package/dist/api/platform/api/resources/serviceJobs/index.js +17 -0
- package/dist/api/platform/api/resources/serviceShares/client/Client.d.ts +163 -0
- package/dist/api/platform/api/resources/serviceShares/client/Client.js +538 -0
- package/dist/api/platform/api/resources/serviceShares/client/index.d.ts +1 -0
- package/dist/api/platform/api/resources/serviceShares/client/index.js +17 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/AddConstraintRequest.d.ts +14 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/AddConstraintRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/DeleteConstraintRequest.d.ts +13 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/DeleteConstraintRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/DeleteShareRequest.d.ts +11 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/DeleteShareRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/GetSharesForServiceRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/GetSharesForServiceRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/ShareServiceRequest.d.ts +12 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/ShareServiceRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/UpdateRoleRequest.d.ts +14 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/UpdateRoleRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/UpdateTimeBasedConstraintRequest.d.ts +19 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/UpdateTimeBasedConstraintRequest.js +3 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/index.d.ts +7 -0
- package/dist/api/platform/api/resources/serviceShares/client/requests/index.js +2 -0
- package/dist/api/platform/api/resources/serviceShares/index.d.ts +2 -0
- package/dist/api/platform/api/resources/serviceShares/index.js +18 -0
- package/dist/api/platform/api/resources/serviceShares/types/AddConstraintResponse.d.ts +2 -0
- package/dist/api/platform/api/resources/serviceShares/types/AddConstraintResponse.js +3 -0
- package/dist/api/platform/api/resources/serviceShares/types/UpdateTimeBasedConstraintRequestBody.d.ts +2 -0
- package/dist/api/platform/api/resources/serviceShares/types/UpdateTimeBasedConstraintRequestBody.js +3 -0
- package/dist/api/platform/api/resources/serviceShares/types/UpdateTimeBasedConstraintResponse.d.ts +2 -0
- package/dist/api/platform/api/resources/serviceShares/types/UpdateTimeBasedConstraintResponse.js +3 -0
- package/dist/api/platform/api/resources/serviceShares/types/index.d.ts +3 -0
- package/dist/api/platform/api/resources/serviceShares/types/index.js +19 -0
- package/dist/api/platform/api/resources/subscriptions/client/Client.d.ts +87 -0
- package/dist/api/platform/api/resources/subscriptions/client/Client.js +305 -0
- package/dist/api/platform/api/resources/subscriptions/client/index.d.ts +1 -0
- package/dist/api/platform/api/resources/subscriptions/client/index.js +17 -0
- package/dist/api/platform/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.d.ts +8 -0
- package/dist/api/platform/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.js +3 -0
- package/dist/api/platform/api/resources/subscriptions/client/requests/DeleteSubscriptionRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/subscriptions/client/requests/DeleteSubscriptionRequest.js +3 -0
- package/dist/api/platform/api/resources/subscriptions/client/requests/GetSubscriptionRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/subscriptions/client/requests/GetSubscriptionRequest.js +3 -0
- package/dist/api/platform/api/resources/subscriptions/client/requests/GetSubscriptionServiceExecutionsRequest.d.ts +9 -0
- package/dist/api/platform/api/resources/subscriptions/client/requests/GetSubscriptionServiceExecutionsRequest.js +3 -0
- package/dist/api/platform/api/resources/subscriptions/client/requests/index.d.ts +4 -0
- package/dist/api/platform/api/resources/subscriptions/client/requests/index.js +2 -0
- package/dist/api/platform/api/resources/subscriptions/index.d.ts +1 -0
- package/dist/api/platform/api/resources/subscriptions/index.js +17 -0
- package/dist/api/platform/api/types/AccessKey.d.ts +12 -0
- package/dist/api/platform/api/types/AccessKey.js +11 -0
- package/dist/api/platform/api/types/ActivityInstance.d.ts +19 -0
- package/dist/api/platform/api/types/ActivityInstance.js +12 -0
- package/dist/api/platform/api/types/ApplicationDto.d.ts +19 -0
- package/dist/api/platform/api/types/ApplicationDto.js +13 -0
- package/dist/api/platform/api/types/CostEntry.d.ts +20 -0
- package/dist/api/platform/api/types/CostEntry.js +3 -0
- package/dist/api/platform/api/types/CreateShareConstraintDto.d.ts +7 -0
- package/dist/api/platform/api/types/CreateShareConstraintDto.js +3 -0
- package/dist/api/platform/api/types/CreateShareRequestDto.d.ts +13 -0
- package/dist/api/platform/api/types/CreateShareRequestDto.js +12 -0
- package/dist/api/platform/api/types/CreateTimeBasedConstraintDto.d.ts +4 -0
- package/dist/api/platform/api/types/CreateTimeBasedConstraintDto.js +3 -0
- package/dist/api/platform/api/types/DataPoolDto.d.ts +25 -0
- package/dist/api/platform/api/types/DataPoolDto.js +13 -0
- package/dist/api/platform/api/types/DataPoolFileDto.d.ts +16 -0
- package/dist/api/platform/api/types/DataPoolFileDto.js +3 -0
- package/dist/api/platform/api/types/Incident.d.ts +8 -0
- package/dist/api/platform/api/types/Incident.js +3 -0
- package/dist/api/platform/api/types/LogEntry.d.ts +19 -0
- package/dist/api/platform/api/types/LogEntry.js +15 -0
- package/dist/api/platform/api/types/MetricDataPoint.d.ts +9 -0
- package/dist/api/platform/api/types/MetricDataPoint.js +3 -0
- package/dist/api/platform/api/types/OauthScope.d.ts +4 -0
- package/dist/api/platform/api/types/OauthScope.js +7 -0
- package/dist/api/platform/api/types/OrganizationSearchResultDto.d.ts +4 -0
- package/dist/api/platform/api/types/OrganizationSearchResultDto.js +3 -0
- package/dist/api/platform/api/types/OrganizationTenant.d.ts +3 -0
- package/dist/api/platform/api/types/OrganizationTenant.js +3 -0
- package/dist/api/platform/api/types/PageResponseServiceExecutionDto.d.ts +28 -0
- package/dist/api/platform/api/types/PageResponseServiceExecutionDto.js +3 -0
- package/dist/api/platform/api/types/PageResponseServiceJobDto.d.ts +28 -0
- package/dist/api/platform/api/types/PageResponseServiceJobDto.js +3 -0
- package/dist/api/platform/api/types/PricingPlanDto.d.ts +14 -0
- package/dist/api/platform/api/types/PricingPlanDto.js +12 -0
- package/dist/api/platform/api/types/ProductDto.d.ts +36 -0
- package/dist/api/platform/api/types/ProductDto.js +32 -0
- package/dist/api/platform/api/types/QuantumJobCosts.d.ts +2 -0
- package/dist/api/platform/api/types/QuantumJobCosts.js +3 -0
- package/dist/api/platform/api/types/QuantumWorkloadCosts.d.ts +9 -0
- package/dist/api/platform/api/types/QuantumWorkloadCosts.js +3 -0
- package/dist/api/platform/api/types/ServiceConsumerDto.d.ts +24 -0
- package/dist/api/platform/api/types/ServiceConsumerDto.js +17 -0
- package/dist/api/platform/api/types/ServiceExecution.d.ts +4 -0
- package/dist/api/platform/api/types/ServiceExecution.js +3 -0
- package/dist/api/platform/api/types/ServiceExecutionCosts.d.ts +2 -0
- package/dist/api/platform/api/types/ServiceExecutionCosts.js +3 -0
- package/dist/api/platform/api/types/ServiceExecutionDto.d.ts +41 -0
- package/dist/api/platform/api/types/ServiceExecutionDto.js +22 -0
- package/dist/api/platform/api/types/ServiceExecutionLogs.d.ts +2 -0
- package/dist/api/platform/api/types/ServiceExecutionLogs.js +3 -0
- package/dist/api/platform/api/types/ServiceExecutionMetrics.d.ts +20 -0
- package/dist/api/platform/api/types/ServiceExecutionMetrics.js +3 -0
- package/dist/api/platform/api/types/ServiceJobDto.d.ts +42 -0
- package/dist/api/platform/api/types/ServiceJobDto.js +22 -0
- package/dist/api/platform/api/types/ShareConstraintDto.d.ts +13 -0
- package/dist/api/platform/api/types/ShareConstraintDto.js +3 -0
- package/dist/api/platform/api/types/ShareDto.d.ts +22 -0
- package/dist/api/platform/api/types/ShareDto.js +12 -0
- package/dist/api/platform/api/types/SortOrder.d.ts +17 -0
- package/dist/api/platform/api/types/SortOrder.js +12 -0
- package/dist/api/platform/api/types/SubscriptionDto.d.ts +8 -0
- package/dist/api/platform/api/types/SubscriptionDto.js +3 -0
- package/dist/api/platform/api/types/TenantId.d.ts +13 -0
- package/dist/api/platform/api/types/TenantId.js +3 -0
- package/dist/api/platform/api/types/TimeBasedConstraintDto.d.ts +5 -0
- package/dist/api/platform/api/types/TimeBasedConstraintDto.js +3 -0
- package/dist/api/platform/api/types/UpdateResourceShareRoleDto.d.ts +11 -0
- package/dist/api/platform/api/types/UpdateResourceShareRoleDto.js +12 -0
- package/dist/api/platform/api/types/UserTenant.d.ts +3 -0
- package/dist/api/platform/api/types/UserTenant.js +3 -0
- package/dist/api/platform/api/types/VariableInstance.d.ts +9 -0
- package/dist/api/platform/api/types/VariableInstance.js +3 -0
- package/dist/api/platform/api/types/WorkflowInstance.d.ts +21 -0
- package/dist/api/platform/api/types/WorkflowInstance.js +15 -0
- package/dist/api/platform/api/types/WorkflowServiceExecutionDto.d.ts +44 -0
- package/dist/api/platform/api/types/WorkflowServiceExecutionDto.js +22 -0
- package/dist/api/platform/api/types/index.d.ts +39 -0
- package/dist/api/platform/api/types/index.js +55 -0
- package/dist/api/platform/auth/HeaderAuthProvider.d.ts +20 -0
- package/dist/api/platform/auth/HeaderAuthProvider.js +70 -0
- package/dist/api/platform/auth/index.d.ts +1 -0
- package/dist/api/platform/auth/index.js +5 -0
- package/dist/api/platform/core/auth/AuthProvider.d.ts +7 -0
- package/dist/api/platform/core/auth/AuthProvider.js +2 -0
- package/dist/api/platform/core/auth/AuthRequest.d.ts +9 -0
- package/dist/api/platform/core/auth/AuthRequest.js +2 -0
- package/dist/api/platform/core/auth/BasicAuth.d.ts +8 -0
- package/dist/api/platform/core/auth/BasicAuth.js +27 -0
- package/dist/api/platform/core/auth/BearerToken.d.ts +7 -0
- package/dist/api/platform/core/auth/BearerToken.js +16 -0
- package/dist/api/platform/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/api/platform/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/api/platform/core/auth/index.d.ts +5 -0
- package/dist/api/platform/core/auth/index.js +9 -0
- package/dist/api/platform/core/base64.d.ts +2 -0
- package/dist/api/platform/core/base64.js +26 -0
- package/dist/api/platform/core/exports.d.ts +2 -0
- package/dist/api/platform/core/exports.js +18 -0
- package/dist/api/platform/core/fetcher/APIResponse.d.ts +20 -0
- package/dist/api/platform/core/fetcher/APIResponse.js +2 -0
- package/dist/api/platform/core/fetcher/BinaryResponse.d.ts +19 -0
- package/dist/api/platform/core/fetcher/BinaryResponse.js +17 -0
- package/dist/api/platform/core/fetcher/EndpointMetadata.d.ts +13 -0
- package/dist/api/platform/core/fetcher/EndpointMetadata.js +2 -0
- package/dist/api/platform/core/fetcher/EndpointSupplier.d.ts +12 -0
- package/dist/api/platform/core/fetcher/EndpointSupplier.js +13 -0
- package/dist/api/platform/core/fetcher/Fetcher.d.ts +48 -0
- package/dist/api/platform/core/fetcher/Fetcher.js +305 -0
- package/dist/api/platform/core/fetcher/Headers.d.ts +2 -0
- package/dist/api/platform/core/fetcher/Headers.js +85 -0
- package/dist/api/platform/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/api/platform/core/fetcher/HttpResponsePromise.js +94 -0
- package/dist/api/platform/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/api/platform/core/fetcher/RawResponse.js +44 -0
- package/dist/api/platform/core/fetcher/Supplier.d.ts +4 -0
- package/dist/api/platform/core/fetcher/Supplier.js +13 -0
- package/dist/api/platform/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/api/platform/core/fetcher/createRequestUrl.js +8 -0
- package/dist/api/platform/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/dist/api/platform/core/fetcher/getErrorResponseBody.js +33 -0
- package/dist/api/platform/core/fetcher/getFetchFn.d.ts +1 -0
- package/dist/api/platform/core/fetcher/getFetchFn.js +6 -0
- package/dist/api/platform/core/fetcher/getHeader.d.ts +1 -0
- package/dist/api/platform/core/fetcher/getHeader.js +11 -0
- package/dist/api/platform/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/api/platform/core/fetcher/getRequestBody.js +16 -0
- package/dist/api/platform/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/api/platform/core/fetcher/getResponseBody.js +58 -0
- package/dist/api/platform/core/fetcher/index.d.ts +11 -0
- package/dist/api/platform/core/fetcher/index.js +17 -0
- package/dist/api/platform/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/api/platform/core/fetcher/makeRequest.js +31 -0
- package/dist/api/platform/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/api/platform/core/fetcher/requestWithRetries.js +56 -0
- package/dist/api/platform/core/fetcher/signals.d.ts +5 -0
- package/dist/api/platform/core/fetcher/signals.js +24 -0
- package/dist/api/platform/core/file/exports.d.ts +1 -0
- package/dist/api/platform/core/file/exports.js +2 -0
- package/dist/api/platform/core/file/file.d.ts +10 -0
- package/dist/api/platform/core/file/file.js +202 -0
- package/dist/api/platform/core/file/index.d.ts +2 -0
- package/dist/api/platform/core/file/index.js +18 -0
- package/dist/api/platform/core/file/types.d.ts +66 -0
- package/dist/api/platform/core/file/types.js +2 -0
- package/dist/api/platform/core/form-data-utils/FormDataWrapper.d.ts +15 -0
- package/dist/api/platform/core/form-data-utils/FormDataWrapper.js +143 -0
- package/dist/api/platform/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
- package/dist/api/platform/core/form-data-utils/encodeAsFormParameter.js +12 -0
- package/dist/api/platform/core/form-data-utils/index.d.ts +2 -0
- package/dist/api/platform/core/form-data-utils/index.js +20 -0
- package/dist/api/platform/core/headers.d.ts +2 -0
- package/dist/api/platform/core/headers.js +31 -0
- package/dist/api/platform/core/index.d.ts +8 -0
- package/dist/api/platform/core/index.js +47 -0
- package/dist/api/platform/core/json.d.ts +15 -0
- package/dist/api/platform/core/json.js +24 -0
- package/dist/api/platform/core/logging/exports.d.ts +18 -0
- package/dist/api/platform/core/logging/exports.js +45 -0
- package/dist/api/platform/core/logging/index.d.ts +1 -0
- package/dist/api/platform/core/logging/index.js +17 -0
- package/dist/api/platform/core/logging/logger.d.ts +126 -0
- package/dist/api/platform/core/logging/logger.js +146 -0
- package/dist/api/platform/core/runtime/index.d.ts +1 -0
- package/dist/api/platform/core/runtime/index.js +5 -0
- package/dist/api/platform/core/runtime/runtime.d.ts +9 -0
- package/dist/api/platform/core/runtime/runtime.js +102 -0
- package/dist/api/platform/core/url/encodePathParam.d.ts +1 -0
- package/dist/api/platform/core/url/encodePathParam.js +21 -0
- package/dist/api/platform/core/url/index.d.ts +3 -0
- package/dist/api/platform/core/url/index.js +9 -0
- package/dist/api/platform/core/url/join.d.ts +1 -0
- package/dist/api/platform/core/url/join.js +68 -0
- package/dist/api/platform/core/url/qs.d.ts +6 -0
- package/dist/api/platform/core/url/qs.js +67 -0
- package/dist/api/platform/environments.d.ts +4 -0
- package/dist/api/platform/environments.js +7 -0
- package/dist/api/platform/errors/HubPlatformError.d.ts +12 -0
- package/dist/api/platform/errors/HubPlatformError.js +35 -0
- package/dist/api/platform/errors/HubPlatformTimeoutError.d.ts +3 -0
- package/dist/api/platform/errors/HubPlatformTimeoutError.js +15 -0
- package/dist/api/platform/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/api/platform/errors/handleNonStatusCodeError.js +65 -0
- package/dist/api/platform/errors/index.d.ts +2 -0
- package/dist/api/platform/errors/index.js +7 -0
- package/dist/api/platform/exports.d.ts +1 -0
- package/dist/api/platform/exports.js +17 -0
- package/dist/api/platform/index.d.ts +6 -0
- package/dist/api/platform/index.js +48 -0
- package/dist/api/service/BaseClient.d.ts +39 -0
- package/dist/api/service/BaseClient.js +65 -0
- package/dist/api/service/Client.d.ts +14 -0
- package/dist/api/service/Client.js +17 -0
- package/dist/api/service/api/index.d.ts +2 -0
- package/dist/api/service/api/index.js +18 -0
- package/dist/api/service/api/resources/index.d.ts +2 -0
- package/dist/api/service/api/resources/index.js +41 -0
- package/dist/api/service/api/resources/serviceApi/client/Client.d.ts +100 -0
- package/dist/api/service/api/resources/serviceApi/client/Client.js +356 -0
- package/dist/api/service/api/resources/serviceApi/client/index.d.ts +1 -0
- package/dist/api/service/api/resources/serviceApi/client/index.js +17 -0
- package/dist/api/service/api/resources/serviceApi/client/requests/CancelExecutionRequest.d.ts +10 -0
- package/dist/api/service/api/resources/serviceApi/client/requests/CancelExecutionRequest.js +3 -0
- package/dist/api/service/api/resources/serviceApi/client/requests/GetLogsRequest.d.ts +10 -0
- package/dist/api/service/api/resources/serviceApi/client/requests/GetLogsRequest.js +3 -0
- package/dist/api/service/api/resources/serviceApi/client/requests/GetResultFileRequest.d.ts +6 -0
- package/dist/api/service/api/resources/serviceApi/client/requests/GetResultFileRequest.js +3 -0
- package/dist/api/service/api/resources/serviceApi/client/requests/GetResultRequest.d.ts +10 -0
- package/dist/api/service/api/resources/serviceApi/client/requests/GetResultRequest.js +3 -0
- package/dist/api/service/api/resources/serviceApi/client/requests/GetStatusRequest.d.ts +10 -0
- package/dist/api/service/api/resources/serviceApi/client/requests/GetStatusRequest.js +3 -0
- package/dist/api/service/api/resources/serviceApi/client/requests/index.d.ts +5 -0
- package/dist/api/service/api/resources/serviceApi/client/requests/index.js +2 -0
- package/dist/api/service/api/resources/serviceApi/index.d.ts +1 -0
- package/dist/api/service/api/resources/serviceApi/index.js +17 -0
- package/dist/api/service/api/types/HalLink.d.ts +18 -0
- package/dist/api/service/api/types/HalLink.js +3 -0
- package/dist/api/service/api/types/LogEntry.d.ts +19 -0
- package/dist/api/service/api/types/LogEntry.js +15 -0
- package/dist/api/service/api/types/RequestBody.d.ts +1 -0
- package/dist/api/service/api/types/RequestBody.js +3 -0
- package/dist/api/service/api/types/ResultResponse.d.ts +15 -0
- package/dist/api/service/api/types/ResultResponse.js +3 -0
- package/dist/api/service/api/types/ServiceExecution.d.ts +38 -0
- package/dist/api/service/api/types/ServiceExecution.js +21 -0
- package/dist/api/service/api/types/index.d.ts +5 -0
- package/dist/api/service/api/types/index.js +21 -0
- package/dist/api/service/auth/BearerAuthProvider.d.ts +20 -0
- package/dist/api/service/auth/BearerAuthProvider.js +69 -0
- package/dist/api/service/auth/index.d.ts +1 -0
- package/dist/api/service/auth/index.js +5 -0
- package/dist/api/service/core/auth/AuthProvider.d.ts +7 -0
- package/dist/api/service/core/auth/AuthProvider.js +2 -0
- package/dist/api/service/core/auth/AuthRequest.d.ts +9 -0
- package/dist/api/service/core/auth/AuthRequest.js +2 -0
- package/dist/api/service/core/auth/BasicAuth.d.ts +8 -0
- package/dist/api/service/core/auth/BasicAuth.js +27 -0
- package/dist/api/service/core/auth/BearerToken.d.ts +7 -0
- package/dist/api/service/core/auth/BearerToken.js +16 -0
- package/dist/api/service/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/api/service/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/api/service/core/auth/index.d.ts +5 -0
- package/dist/api/service/core/auth/index.js +9 -0
- package/dist/api/service/core/base64.d.ts +2 -0
- package/dist/api/service/core/base64.js +26 -0
- package/dist/api/service/core/exports.d.ts +1 -0
- package/dist/api/service/core/exports.js +17 -0
- package/dist/api/service/core/fetcher/APIResponse.d.ts +20 -0
- package/dist/api/service/core/fetcher/APIResponse.js +2 -0
- package/dist/api/service/core/fetcher/BinaryResponse.d.ts +19 -0
- package/dist/api/service/core/fetcher/BinaryResponse.js +17 -0
- package/dist/api/service/core/fetcher/EndpointMetadata.d.ts +13 -0
- package/dist/api/service/core/fetcher/EndpointMetadata.js +2 -0
- package/dist/api/service/core/fetcher/EndpointSupplier.d.ts +12 -0
- package/dist/api/service/core/fetcher/EndpointSupplier.js +13 -0
- package/dist/api/service/core/fetcher/Fetcher.d.ts +48 -0
- package/dist/api/service/core/fetcher/Fetcher.js +305 -0
- package/dist/api/service/core/fetcher/Headers.d.ts +2 -0
- package/dist/api/service/core/fetcher/Headers.js +85 -0
- package/dist/api/service/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/api/service/core/fetcher/HttpResponsePromise.js +94 -0
- package/dist/api/service/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/api/service/core/fetcher/RawResponse.js +44 -0
- package/dist/api/service/core/fetcher/Supplier.d.ts +4 -0
- package/dist/api/service/core/fetcher/Supplier.js +13 -0
- package/dist/api/service/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/api/service/core/fetcher/createRequestUrl.js +8 -0
- package/dist/api/service/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/dist/api/service/core/fetcher/getErrorResponseBody.js +33 -0
- package/dist/api/service/core/fetcher/getFetchFn.d.ts +1 -0
- package/dist/api/service/core/fetcher/getFetchFn.js +6 -0
- package/dist/api/service/core/fetcher/getHeader.d.ts +1 -0
- package/dist/api/service/core/fetcher/getHeader.js +11 -0
- package/dist/api/service/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/api/service/core/fetcher/getRequestBody.js +16 -0
- package/dist/api/service/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/api/service/core/fetcher/getResponseBody.js +58 -0
- package/dist/api/service/core/fetcher/index.d.ts +11 -0
- package/dist/api/service/core/fetcher/index.js +17 -0
- package/dist/api/service/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/api/service/core/fetcher/makeRequest.js +31 -0
- package/dist/api/service/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/api/service/core/fetcher/requestWithRetries.js +56 -0
- package/dist/api/service/core/fetcher/signals.d.ts +5 -0
- package/dist/api/service/core/fetcher/signals.js +24 -0
- package/dist/api/service/core/headers.d.ts +2 -0
- package/dist/api/service/core/headers.js +31 -0
- package/dist/api/service/core/index.d.ts +6 -0
- package/dist/api/service/core/index.js +45 -0
- package/dist/api/service/core/json.d.ts +15 -0
- package/dist/api/service/core/json.js +24 -0
- package/dist/api/service/core/logging/exports.d.ts +18 -0
- package/dist/api/service/core/logging/exports.js +45 -0
- package/dist/api/service/core/logging/index.d.ts +1 -0
- package/dist/api/service/core/logging/index.js +17 -0
- package/dist/api/service/core/logging/logger.d.ts +126 -0
- package/dist/api/service/core/logging/logger.js +146 -0
- package/dist/api/service/core/runtime/index.d.ts +1 -0
- package/dist/api/service/core/runtime/index.js +5 -0
- package/dist/api/service/core/runtime/runtime.d.ts +9 -0
- package/dist/api/service/core/runtime/runtime.js +102 -0
- package/dist/api/service/core/url/encodePathParam.d.ts +1 -0
- package/dist/api/service/core/url/encodePathParam.js +21 -0
- package/dist/api/service/core/url/index.d.ts +3 -0
- package/dist/api/service/core/url/index.js +9 -0
- package/dist/api/service/core/url/join.d.ts +1 -0
- package/dist/api/service/core/url/join.js +68 -0
- package/dist/api/service/core/url/qs.d.ts +6 -0
- package/dist/api/service/core/url/qs.js +67 -0
- package/dist/api/service/environments.d.ts +4 -0
- package/dist/api/service/environments.js +7 -0
- package/dist/api/service/errors/HubServiceError.d.ts +12 -0
- package/dist/api/service/errors/HubServiceError.js +35 -0
- package/dist/api/service/errors/HubServiceTimeoutError.d.ts +3 -0
- package/dist/api/service/errors/HubServiceTimeoutError.js +15 -0
- package/dist/api/service/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/api/service/errors/handleNonStatusCodeError.js +65 -0
- package/dist/api/service/errors/index.d.ts +2 -0
- package/dist/api/service/errors/index.js +7 -0
- package/dist/api/service/exports.d.ts +1 -0
- package/dist/api/service/exports.js +17 -0
- package/dist/api/service/index.d.ts +6 -0
- package/dist/api/service/index.js +48 -0
- package/eslint.config.mjs +11 -0
- package/package.json +44 -0
- package/src/api/platform/BaseClient.ts +87 -0
- package/src/api/platform/Client.ts +78 -0
- package/src/api/platform/api/errors/BadRequestError.ts +21 -0
- package/src/api/platform/api/errors/ForbiddenError.ts +21 -0
- package/src/api/platform/api/errors/InternalServerError.ts +21 -0
- package/src/api/platform/api/errors/NotFoundError.ts +21 -0
- package/src/api/platform/api/errors/UnauthorizedError.ts +21 -0
- package/src/api/platform/api/errors/index.ts +5 -0
- package/src/api/platform/api/index.ts +3 -0
- package/src/api/platform/api/resources/applications/client/Client.ts +514 -0
- package/src/api/platform/api/resources/applications/client/index.ts +1 -0
- package/src/api/platform/api/resources/applications/client/requests/CreateApplicationRequest.ts +9 -0
- package/src/api/platform/api/resources/applications/client/requests/DeleteApplicationRequest.ts +11 -0
- package/src/api/platform/api/resources/applications/client/requests/GetApplicationAccessKeysRequest.ts +11 -0
- package/src/api/platform/api/resources/applications/client/requests/GetApplicationRequest.ts +11 -0
- package/src/api/platform/api/resources/applications/client/requests/GetApplicationSubscriptionsRequest.ts +11 -0
- package/src/api/platform/api/resources/applications/client/requests/index.ts +5 -0
- package/src/api/platform/api/resources/applications/index.ts +1 -0
- package/src/api/platform/api/resources/dataPoolShares/client/Client.ts +662 -0
- package/src/api/platform/api/resources/dataPoolShares/client/index.ts +1 -0
- package/src/api/platform/api/resources/dataPoolShares/client/requests/AddConstraint1Request.ts +17 -0
- package/src/api/platform/api/resources/dataPoolShares/client/requests/DeleteConstraint1Request.ts +15 -0
- package/src/api/platform/api/resources/dataPoolShares/client/requests/DeleteShare1Request.ts +13 -0
- package/src/api/platform/api/resources/dataPoolShares/client/requests/GetSharesForDataPoolRequest.ts +11 -0
- package/src/api/platform/api/resources/dataPoolShares/client/requests/ShareDataPoolRequest.ts +15 -0
- package/src/api/platform/api/resources/dataPoolShares/client/requests/UpdateRole1Request.ts +17 -0
- package/src/api/platform/api/resources/dataPoolShares/client/requests/UpdateTimeBasedConstraint1Request.ts +22 -0
- package/src/api/platform/api/resources/dataPoolShares/client/requests/index.ts +7 -0
- package/src/api/platform/api/resources/dataPoolShares/index.ts +2 -0
- package/src/api/platform/api/resources/dataPoolShares/types/AddConstraint1Response.ts +5 -0
- package/src/api/platform/api/resources/dataPoolShares/types/UpdateTimeBasedConstraint1RequestBody.ts +5 -0
- package/src/api/platform/api/resources/dataPoolShares/types/UpdateTimeBasedConstraint1Response.ts +5 -0
- package/src/api/platform/api/resources/dataPoolShares/types/index.ts +3 -0
- package/src/api/platform/api/resources/dataPools/client/Client.ts +767 -0
- package/src/api/platform/api/resources/dataPools/client/index.ts +1 -0
- package/src/api/platform/api/resources/dataPools/client/requests/AddDataPoolFileRequest.ts +16 -0
- package/src/api/platform/api/resources/dataPools/client/requests/CreateDataPoolRequest.ts +16 -0
- package/src/api/platform/api/resources/dataPools/client/requests/DeleteDataPoolFileRequest.ts +13 -0
- package/src/api/platform/api/resources/dataPools/client/requests/DeleteDataPoolRequest.ts +11 -0
- package/src/api/platform/api/resources/dataPools/client/requests/GetDataPoolFileRequest.ts +13 -0
- package/src/api/platform/api/resources/dataPools/client/requests/GetDataPoolFilesRequest.ts +11 -0
- package/src/api/platform/api/resources/dataPools/client/requests/GetDataPoolRequest.ts +11 -0
- package/src/api/platform/api/resources/dataPools/client/requests/UpdateDataPoolRequest.ts +19 -0
- package/src/api/platform/api/resources/dataPools/client/requests/index.ts +8 -0
- package/src/api/platform/api/resources/dataPools/index.ts +1 -0
- package/src/api/platform/api/resources/index.ts +23 -0
- package/src/api/platform/api/resources/organizations/client/Client.ts +110 -0
- package/src/api/platform/api/resources/organizations/client/index.ts +1 -0
- package/src/api/platform/api/resources/organizations/client/requests/GetServiceExecutions1Request.ts +11 -0
- package/src/api/platform/api/resources/organizations/client/requests/index.ts +1 -0
- package/src/api/platform/api/resources/organizations/index.ts +1 -0
- package/src/api/platform/api/resources/quantumJobs/client/Client.ts +104 -0
- package/src/api/platform/api/resources/quantumJobs/client/index.ts +1 -0
- package/src/api/platform/api/resources/quantumJobs/client/requests/GetQuantumJobCostsRequest.ts +11 -0
- package/src/api/platform/api/resources/quantumJobs/client/requests/index.ts +1 -0
- package/src/api/platform/api/resources/quantumJobs/index.ts +1 -0
- package/src/api/platform/api/resources/quantumWorkloads/client/Client.ts +104 -0
- package/src/api/platform/api/resources/quantumWorkloads/client/index.ts +1 -0
- package/src/api/platform/api/resources/quantumWorkloads/client/requests/GetQuantumWorkloadCostsRequest.ts +11 -0
- package/src/api/platform/api/resources/quantumWorkloads/client/requests/index.ts +1 -0
- package/src/api/platform/api/resources/quantumWorkloads/index.ts +1 -0
- package/src/api/platform/api/resources/serviceExecutions/client/Client.ts +788 -0
- package/src/api/platform/api/resources/serviceExecutions/client/index.ts +1 -0
- package/src/api/platform/api/resources/serviceExecutions/client/requests/CancelServiceExecutionRequest.ts +11 -0
- package/src/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionCostsRequest.ts +11 -0
- package/src/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionLogsRequest.ts +15 -0
- package/src/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionMetricsRequest.ts +11 -0
- package/src/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionRequest.ts +11 -0
- package/src/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionResultFileRequest.ts +11 -0
- package/src/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionResultRequest.ts +11 -0
- package/src/api/platform/api/resources/serviceExecutions/client/requests/GetServiceExecutionsRequest.ts +26 -0
- package/src/api/platform/api/resources/serviceExecutions/client/requests/HeadServiceExecutionRequest.ts +11 -0
- package/src/api/platform/api/resources/serviceExecutions/client/requests/index.ts +9 -0
- package/src/api/platform/api/resources/serviceExecutions/index.ts +2 -0
- package/src/api/platform/api/resources/serviceExecutions/types/GetServiceExecutionResponse.ts +5 -0
- package/src/api/platform/api/resources/serviceExecutions/types/index.ts +1 -0
- package/src/api/platform/api/resources/serviceJobs/client/Client.ts +367 -0
- package/src/api/platform/api/resources/serviceJobs/client/index.ts +1 -0
- package/src/api/platform/api/resources/serviceJobs/client/requests/CreateServiceJobRequest.ts +16 -0
- package/src/api/platform/api/resources/serviceJobs/client/requests/GetServiceJobRequest.ts +11 -0
- package/src/api/platform/api/resources/serviceJobs/client/requests/GetServiceJobsRequest.ts +24 -0
- package/src/api/platform/api/resources/serviceJobs/client/requests/RerunServiceJobRequest.ts +11 -0
- package/src/api/platform/api/resources/serviceJobs/client/requests/index.ts +4 -0
- package/src/api/platform/api/resources/serviceJobs/index.ts +1 -0
- package/src/api/platform/api/resources/serviceShares/client/Client.ts +662 -0
- package/src/api/platform/api/resources/serviceShares/client/index.ts +1 -0
- package/src/api/platform/api/resources/serviceShares/client/requests/AddConstraintRequest.ts +17 -0
- package/src/api/platform/api/resources/serviceShares/client/requests/DeleteConstraintRequest.ts +15 -0
- package/src/api/platform/api/resources/serviceShares/client/requests/DeleteShareRequest.ts +13 -0
- package/src/api/platform/api/resources/serviceShares/client/requests/GetSharesForServiceRequest.ts +11 -0
- package/src/api/platform/api/resources/serviceShares/client/requests/ShareServiceRequest.ts +15 -0
- package/src/api/platform/api/resources/serviceShares/client/requests/UpdateRoleRequest.ts +17 -0
- package/src/api/platform/api/resources/serviceShares/client/requests/UpdateTimeBasedConstraintRequest.ts +22 -0
- package/src/api/platform/api/resources/serviceShares/client/requests/index.ts +7 -0
- package/src/api/platform/api/resources/serviceShares/index.ts +2 -0
- package/src/api/platform/api/resources/serviceShares/types/AddConstraintResponse.ts +5 -0
- package/src/api/platform/api/resources/serviceShares/types/UpdateTimeBasedConstraintRequestBody.ts +5 -0
- package/src/api/platform/api/resources/serviceShares/types/UpdateTimeBasedConstraintResponse.ts +5 -0
- package/src/api/platform/api/resources/serviceShares/types/index.ts +3 -0
- package/src/api/platform/api/resources/subscriptions/client/Client.ts +355 -0
- package/src/api/platform/api/resources/subscriptions/client/index.ts +1 -0
- package/src/api/platform/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts +10 -0
- package/src/api/platform/api/resources/subscriptions/client/requests/DeleteSubscriptionRequest.ts +11 -0
- package/src/api/platform/api/resources/subscriptions/client/requests/GetSubscriptionRequest.ts +11 -0
- package/src/api/platform/api/resources/subscriptions/client/requests/GetSubscriptionServiceExecutionsRequest.ts +11 -0
- package/src/api/platform/api/resources/subscriptions/client/requests/index.ts +4 -0
- package/src/api/platform/api/resources/subscriptions/index.ts +1 -0
- package/src/api/platform/api/types/AccessKey.ts +15 -0
- package/src/api/platform/api/types/ActivityInstance.ts +23 -0
- package/src/api/platform/api/types/ApplicationDto.ts +22 -0
- package/src/api/platform/api/types/CostEntry.ts +22 -0
- package/src/api/platform/api/types/CreateShareConstraintDto.ts +11 -0
- package/src/api/platform/api/types/CreateShareRequestDto.ts +17 -0
- package/src/api/platform/api/types/CreateTimeBasedConstraintDto.ts +6 -0
- package/src/api/platform/api/types/DataPoolDto.ts +28 -0
- package/src/api/platform/api/types/DataPoolFileDto.ts +18 -0
- package/src/api/platform/api/types/Incident.ts +10 -0
- package/src/api/platform/api/types/LogEntry.ts +22 -0
- package/src/api/platform/api/types/MetricDataPoint.ts +11 -0
- package/src/api/platform/api/types/OauthScope.ts +6 -0
- package/src/api/platform/api/types/OrganizationSearchResultDto.ts +6 -0
- package/src/api/platform/api/types/OrganizationTenant.ts +5 -0
- package/src/api/platform/api/types/PageResponseServiceExecutionDto.ts +31 -0
- package/src/api/platform/api/types/PageResponseServiceJobDto.ts +31 -0
- package/src/api/platform/api/types/PricingPlanDto.ts +18 -0
- package/src/api/platform/api/types/ProductDto.ts +39 -0
- package/src/api/platform/api/types/QuantumJobCosts.ts +5 -0
- package/src/api/platform/api/types/QuantumWorkloadCosts.ts +11 -0
- package/src/api/platform/api/types/ServiceConsumerDto.ts +27 -0
- package/src/api/platform/api/types/ServiceExecution.ts +6 -0
- package/src/api/platform/api/types/ServiceExecutionCosts.ts +5 -0
- package/src/api/platform/api/types/ServiceExecutionDto.ts +44 -0
- package/src/api/platform/api/types/ServiceExecutionLogs.ts +5 -0
- package/src/api/platform/api/types/ServiceExecutionMetrics.ts +23 -0
- package/src/api/platform/api/types/ServiceJobDto.ts +45 -0
- package/src/api/platform/api/types/ShareConstraintDto.ts +18 -0
- package/src/api/platform/api/types/ShareDto.ts +27 -0
- package/src/api/platform/api/types/SortOrder.ts +20 -0
- package/src/api/platform/api/types/SubscriptionDto.ts +11 -0
- package/src/api/platform/api/types/TenantId.ts +19 -0
- package/src/api/platform/api/types/TimeBasedConstraintDto.ts +7 -0
- package/src/api/platform/api/types/UpdateResourceShareRoleDto.ts +14 -0
- package/src/api/platform/api/types/UserTenant.ts +5 -0
- package/src/api/platform/api/types/VariableInstance.ts +11 -0
- package/src/api/platform/api/types/WorkflowInstance.ts +25 -0
- package/src/api/platform/api/types/WorkflowServiceExecutionDto.ts +48 -0
- package/src/api/platform/api/types/index.ts +39 -0
- package/src/api/platform/auth/HeaderAuthProvider.ts +48 -0
- package/src/api/platform/auth/index.ts +1 -0
- package/src/api/platform/core/auth/AuthProvider.ts +6 -0
- package/src/api/platform/core/auth/AuthRequest.ts +9 -0
- package/src/api/platform/core/auth/BasicAuth.ts +32 -0
- package/src/api/platform/core/auth/BearerToken.ts +20 -0
- package/src/api/platform/core/auth/NoOpAuthProvider.ts +8 -0
- package/src/api/platform/core/auth/index.ts +5 -0
- package/src/api/platform/core/base64.ts +27 -0
- package/src/api/platform/core/exports.ts +2 -0
- package/src/api/platform/core/fetcher/APIResponse.ts +23 -0
- package/src/api/platform/core/fetcher/BinaryResponse.ts +34 -0
- package/src/api/platform/core/fetcher/EndpointMetadata.ts +13 -0
- package/src/api/platform/core/fetcher/EndpointSupplier.ts +14 -0
- package/src/api/platform/core/fetcher/Fetcher.ts +397 -0
- package/src/api/platform/core/fetcher/Headers.ts +93 -0
- package/src/api/platform/core/fetcher/HttpResponsePromise.ts +116 -0
- package/src/api/platform/core/fetcher/RawResponse.ts +61 -0
- package/src/api/platform/core/fetcher/Supplier.ts +11 -0
- package/src/api/platform/core/fetcher/createRequestUrl.ts +6 -0
- package/src/api/platform/core/fetcher/getErrorResponseBody.ts +33 -0
- package/src/api/platform/core/fetcher/getFetchFn.ts +3 -0
- package/src/api/platform/core/fetcher/getHeader.ts +8 -0
- package/src/api/platform/core/fetcher/getRequestBody.ts +20 -0
- package/src/api/platform/core/fetcher/getResponseBody.ts +58 -0
- package/src/api/platform/core/fetcher/index.ts +11 -0
- package/src/api/platform/core/fetcher/makeRequest.ts +42 -0
- package/src/api/platform/core/fetcher/requestWithRetries.ts +64 -0
- package/src/api/platform/core/fetcher/signals.ts +26 -0
- package/src/api/platform/core/file/exports.ts +1 -0
- package/src/api/platform/core/file/file.ts +217 -0
- package/src/api/platform/core/file/index.ts +2 -0
- package/src/api/platform/core/file/types.ts +81 -0
- package/src/api/platform/core/form-data-utils/FormDataWrapper.ts +140 -0
- package/src/api/platform/core/form-data-utils/encodeAsFormParameter.ts +12 -0
- package/src/api/platform/core/form-data-utils/index.ts +2 -0
- package/src/api/platform/core/headers.ts +33 -0
- package/src/api/platform/core/index.ts +8 -0
- package/src/api/platform/core/json.ts +27 -0
- package/src/api/platform/core/logging/exports.ts +19 -0
- package/src/api/platform/core/logging/index.ts +1 -0
- package/src/api/platform/core/logging/logger.ts +203 -0
- package/src/api/platform/core/runtime/index.ts +1 -0
- package/src/api/platform/core/runtime/runtime.ts +134 -0
- package/src/api/platform/core/url/encodePathParam.ts +18 -0
- package/src/api/platform/core/url/index.ts +3 -0
- package/src/api/platform/core/url/join.ts +79 -0
- package/src/api/platform/core/url/qs.ts +74 -0
- package/src/api/platform/environments.ts +7 -0
- package/src/api/platform/errors/HubPlatformError.ts +58 -0
- package/src/api/platform/errors/HubPlatformTimeoutError.ts +13 -0
- package/src/api/platform/errors/handleNonStatusCodeError.ts +37 -0
- package/src/api/platform/errors/index.ts +2 -0
- package/src/api/platform/exports.ts +1 -0
- package/src/api/platform/index.ts +6 -0
- package/src/api/service/BaseClient.ts +82 -0
- package/src/api/service/Client.ts +24 -0
- package/src/api/service/api/index.ts +2 -0
- package/src/api/service/api/resources/index.ts +2 -0
- package/src/api/service/api/resources/serviceApi/client/Client.ts +443 -0
- package/src/api/service/api/resources/serviceApi/client/index.ts +1 -0
- package/src/api/service/api/resources/serviceApi/client/requests/CancelExecutionRequest.ts +12 -0
- package/src/api/service/api/resources/serviceApi/client/requests/GetLogsRequest.ts +12 -0
- package/src/api/service/api/resources/serviceApi/client/requests/GetResultFileRequest.ts +8 -0
- package/src/api/service/api/resources/serviceApi/client/requests/GetResultRequest.ts +12 -0
- package/src/api/service/api/resources/serviceApi/client/requests/GetStatusRequest.ts +12 -0
- package/src/api/service/api/resources/serviceApi/client/requests/index.ts +5 -0
- package/src/api/service/api/resources/serviceApi/index.ts +1 -0
- package/src/api/service/api/types/HalLink.ts +20 -0
- package/src/api/service/api/types/LogEntry.ts +22 -0
- package/src/api/service/api/types/RequestBody.ts +3 -0
- package/src/api/service/api/types/ResultResponse.ts +20 -0
- package/src/api/service/api/types/ServiceExecution.ts +41 -0
- package/src/api/service/api/types/index.ts +5 -0
- package/src/api/service/auth/BearerAuthProvider.ts +47 -0
- package/src/api/service/auth/index.ts +1 -0
- package/src/api/service/core/auth/AuthProvider.ts +6 -0
- package/src/api/service/core/auth/AuthRequest.ts +9 -0
- package/src/api/service/core/auth/BasicAuth.ts +32 -0
- package/src/api/service/core/auth/BearerToken.ts +20 -0
- package/src/api/service/core/auth/NoOpAuthProvider.ts +8 -0
- package/src/api/service/core/auth/index.ts +5 -0
- package/src/api/service/core/base64.ts +27 -0
- package/src/api/service/core/exports.ts +1 -0
- package/src/api/service/core/fetcher/APIResponse.ts +23 -0
- package/src/api/service/core/fetcher/BinaryResponse.ts +34 -0
- package/src/api/service/core/fetcher/EndpointMetadata.ts +13 -0
- package/src/api/service/core/fetcher/EndpointSupplier.ts +14 -0
- package/src/api/service/core/fetcher/Fetcher.ts +397 -0
- package/src/api/service/core/fetcher/Headers.ts +93 -0
- package/src/api/service/core/fetcher/HttpResponsePromise.ts +116 -0
- package/src/api/service/core/fetcher/RawResponse.ts +61 -0
- package/src/api/service/core/fetcher/Supplier.ts +11 -0
- package/src/api/service/core/fetcher/createRequestUrl.ts +6 -0
- package/src/api/service/core/fetcher/getErrorResponseBody.ts +33 -0
- package/src/api/service/core/fetcher/getFetchFn.ts +3 -0
- package/src/api/service/core/fetcher/getHeader.ts +8 -0
- package/src/api/service/core/fetcher/getRequestBody.ts +20 -0
- package/src/api/service/core/fetcher/getResponseBody.ts +58 -0
- package/src/api/service/core/fetcher/index.ts +11 -0
- package/src/api/service/core/fetcher/makeRequest.ts +42 -0
- package/src/api/service/core/fetcher/requestWithRetries.ts +64 -0
- package/src/api/service/core/fetcher/signals.ts +26 -0
- package/src/api/service/core/headers.ts +33 -0
- package/src/api/service/core/index.ts +6 -0
- package/src/api/service/core/json.ts +27 -0
- package/src/api/service/core/logging/exports.ts +19 -0
- package/src/api/service/core/logging/index.ts +1 -0
- package/src/api/service/core/logging/logger.ts +203 -0
- package/src/api/service/core/runtime/index.ts +1 -0
- package/src/api/service/core/runtime/runtime.ts +134 -0
- package/src/api/service/core/url/encodePathParam.ts +18 -0
- package/src/api/service/core/url/index.ts +3 -0
- package/src/api/service/core/url/join.ts +79 -0
- package/src/api/service/core/url/qs.ts +74 -0
- package/src/api/service/environments.ts +7 -0
- package/src/api/service/errors/HubServiceError.ts +58 -0
- package/src/api/service/errors/HubServiceTimeoutError.ts +13 -0
- package/src/api/service/errors/handleNonStatusCodeError.ts +37 -0
- package/src/api/service/errors/index.ts +2 -0
- package/src/api/service/exports.ts +1 -0
- package/src/api/service/index.ts +6 -0
- package/src/client.test.ts +29 -0
- package/tsconfig.json +18 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { toJson } from "../json.js";
|
|
2
|
+
import { createLogger, type LogConfig, type Logger } from "../logging/logger.js";
|
|
3
|
+
import type { APIResponse } from "./APIResponse.js";
|
|
4
|
+
import { createRequestUrl } from "./createRequestUrl.js";
|
|
5
|
+
import type { EndpointMetadata } from "./EndpointMetadata.js";
|
|
6
|
+
import { EndpointSupplier } from "./EndpointSupplier.js";
|
|
7
|
+
import { getErrorResponseBody } from "./getErrorResponseBody.js";
|
|
8
|
+
import { getFetchFn } from "./getFetchFn.js";
|
|
9
|
+
import { getRequestBody } from "./getRequestBody.js";
|
|
10
|
+
import { getResponseBody } from "./getResponseBody.js";
|
|
11
|
+
import { Headers } from "./Headers.js";
|
|
12
|
+
import { makeRequest } from "./makeRequest.js";
|
|
13
|
+
import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.js";
|
|
14
|
+
import { requestWithRetries } from "./requestWithRetries.js";
|
|
15
|
+
|
|
16
|
+
export type FetchFunction = <R = unknown>(args: Fetcher.Args) => Promise<APIResponse<R, Fetcher.Error>>;
|
|
17
|
+
|
|
18
|
+
export declare namespace Fetcher {
|
|
19
|
+
export interface Args {
|
|
20
|
+
url: string;
|
|
21
|
+
method: string;
|
|
22
|
+
contentType?: string;
|
|
23
|
+
headers?: Record<string, unknown>;
|
|
24
|
+
queryParameters?: Record<string, unknown>;
|
|
25
|
+
body?: unknown;
|
|
26
|
+
timeoutMs?: number;
|
|
27
|
+
maxRetries?: number;
|
|
28
|
+
withCredentials?: boolean;
|
|
29
|
+
abortSignal?: AbortSignal;
|
|
30
|
+
requestType?: "json" | "file" | "bytes" | "form" | "other";
|
|
31
|
+
responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer" | "binary-response";
|
|
32
|
+
duplex?: "half";
|
|
33
|
+
endpointMetadata?: EndpointMetadata;
|
|
34
|
+
fetchFn?: typeof fetch;
|
|
35
|
+
logging?: LogConfig | Logger;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type Error = FailedStatusCodeError | NonJsonError | BodyIsNullError | TimeoutError | UnknownError;
|
|
39
|
+
|
|
40
|
+
export interface FailedStatusCodeError {
|
|
41
|
+
reason: "status-code";
|
|
42
|
+
statusCode: number;
|
|
43
|
+
body: unknown;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface NonJsonError {
|
|
47
|
+
reason: "non-json";
|
|
48
|
+
statusCode: number;
|
|
49
|
+
rawBody: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface BodyIsNullError {
|
|
53
|
+
reason: "body-is-null";
|
|
54
|
+
statusCode: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface TimeoutError {
|
|
58
|
+
reason: "timeout";
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface UnknownError {
|
|
62
|
+
reason: "unknown";
|
|
63
|
+
errorMessage: string;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const SENSITIVE_HEADERS = new Set([
|
|
68
|
+
"authorization",
|
|
69
|
+
"www-authenticate",
|
|
70
|
+
"x-api-key",
|
|
71
|
+
"api-key",
|
|
72
|
+
"apikey",
|
|
73
|
+
"x-api-token",
|
|
74
|
+
"x-auth-token",
|
|
75
|
+
"auth-token",
|
|
76
|
+
"cookie",
|
|
77
|
+
"set-cookie",
|
|
78
|
+
"proxy-authorization",
|
|
79
|
+
"proxy-authenticate",
|
|
80
|
+
"x-csrf-token",
|
|
81
|
+
"x-xsrf-token",
|
|
82
|
+
"x-session-token",
|
|
83
|
+
"x-access-token",
|
|
84
|
+
]);
|
|
85
|
+
|
|
86
|
+
function redactHeaders(headers: Headers | Record<string, string>): Record<string, string> {
|
|
87
|
+
const filtered: Record<string, string> = {};
|
|
88
|
+
for (const [key, value] of headers instanceof Headers ? headers.entries() : Object.entries(headers)) {
|
|
89
|
+
if (SENSITIVE_HEADERS.has(key.toLowerCase())) {
|
|
90
|
+
filtered[key] = "[REDACTED]";
|
|
91
|
+
} else {
|
|
92
|
+
filtered[key] = value;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return filtered;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const SENSITIVE_QUERY_PARAMS = new Set([
|
|
99
|
+
"api_key",
|
|
100
|
+
"api-key",
|
|
101
|
+
"apikey",
|
|
102
|
+
"token",
|
|
103
|
+
"access_token",
|
|
104
|
+
"access-token",
|
|
105
|
+
"auth_token",
|
|
106
|
+
"auth-token",
|
|
107
|
+
"password",
|
|
108
|
+
"passwd",
|
|
109
|
+
"secret",
|
|
110
|
+
"api_secret",
|
|
111
|
+
"api-secret",
|
|
112
|
+
"apisecret",
|
|
113
|
+
"key",
|
|
114
|
+
"session",
|
|
115
|
+
"session_id",
|
|
116
|
+
"session-id",
|
|
117
|
+
]);
|
|
118
|
+
|
|
119
|
+
function redactQueryParameters(queryParameters?: Record<string, unknown>): Record<string, unknown> | undefined {
|
|
120
|
+
if (queryParameters == null) {
|
|
121
|
+
return queryParameters;
|
|
122
|
+
}
|
|
123
|
+
const redacted: Record<string, unknown> = {};
|
|
124
|
+
for (const [key, value] of Object.entries(queryParameters)) {
|
|
125
|
+
if (SENSITIVE_QUERY_PARAMS.has(key.toLowerCase())) {
|
|
126
|
+
redacted[key] = "[REDACTED]";
|
|
127
|
+
} else {
|
|
128
|
+
redacted[key] = value;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return redacted;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function redactUrl(url: string): string {
|
|
135
|
+
const protocolIndex = url.indexOf("://");
|
|
136
|
+
if (protocolIndex === -1) return url;
|
|
137
|
+
|
|
138
|
+
const afterProtocol = protocolIndex + 3;
|
|
139
|
+
|
|
140
|
+
// Find the first delimiter that marks the end of the authority section
|
|
141
|
+
const pathStart = url.indexOf("/", afterProtocol);
|
|
142
|
+
let queryStart = url.indexOf("?", afterProtocol);
|
|
143
|
+
let fragmentStart = url.indexOf("#", afterProtocol);
|
|
144
|
+
|
|
145
|
+
const firstDelimiter = Math.min(
|
|
146
|
+
pathStart === -1 ? url.length : pathStart,
|
|
147
|
+
queryStart === -1 ? url.length : queryStart,
|
|
148
|
+
fragmentStart === -1 ? url.length : fragmentStart,
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
// Find the LAST @ before the delimiter (handles multiple @ in credentials)
|
|
152
|
+
let atIndex = -1;
|
|
153
|
+
for (let i = afterProtocol; i < firstDelimiter; i++) {
|
|
154
|
+
if (url[i] === "@") {
|
|
155
|
+
atIndex = i;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (atIndex !== -1) {
|
|
160
|
+
url = `${url.slice(0, afterProtocol)}[REDACTED]@${url.slice(atIndex + 1)}`;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Recalculate queryStart since url might have changed
|
|
164
|
+
queryStart = url.indexOf("?");
|
|
165
|
+
if (queryStart === -1) return url;
|
|
166
|
+
|
|
167
|
+
fragmentStart = url.indexOf("#", queryStart);
|
|
168
|
+
const queryEnd = fragmentStart !== -1 ? fragmentStart : url.length;
|
|
169
|
+
const queryString = url.slice(queryStart + 1, queryEnd);
|
|
170
|
+
|
|
171
|
+
if (queryString.length === 0) return url;
|
|
172
|
+
|
|
173
|
+
// FAST PATH: Quick check if any sensitive keywords present
|
|
174
|
+
// Using indexOf is faster than regex for simple substring matching
|
|
175
|
+
const lower = queryString.toLowerCase();
|
|
176
|
+
const hasSensitive =
|
|
177
|
+
lower.includes("token") ||
|
|
178
|
+
lower.includes("key") ||
|
|
179
|
+
lower.includes("password") ||
|
|
180
|
+
lower.includes("passwd") ||
|
|
181
|
+
lower.includes("secret") ||
|
|
182
|
+
lower.includes("session") ||
|
|
183
|
+
lower.includes("auth");
|
|
184
|
+
|
|
185
|
+
if (!hasSensitive) {
|
|
186
|
+
return url;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// SLOW PATH: Parse and redact
|
|
190
|
+
const redactedParams: string[] = [];
|
|
191
|
+
const params = queryString.split("&");
|
|
192
|
+
|
|
193
|
+
for (const param of params) {
|
|
194
|
+
const equalIndex = param.indexOf("=");
|
|
195
|
+
if (equalIndex === -1) {
|
|
196
|
+
redactedParams.push(param);
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const key = param.slice(0, equalIndex);
|
|
201
|
+
let shouldRedact = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase());
|
|
202
|
+
|
|
203
|
+
if (!shouldRedact && key.includes("%")) {
|
|
204
|
+
try {
|
|
205
|
+
const decodedKey = decodeURIComponent(key);
|
|
206
|
+
shouldRedact = SENSITIVE_QUERY_PARAMS.has(decodedKey.toLowerCase());
|
|
207
|
+
} catch {}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
redactedParams.push(shouldRedact ? `${key}=[REDACTED]` : param);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return url.slice(0, queryStart + 1) + redactedParams.join("&") + url.slice(queryEnd);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
async function getHeaders(args: Fetcher.Args): Promise<Headers> {
|
|
217
|
+
const newHeaders: Headers = new Headers();
|
|
218
|
+
|
|
219
|
+
newHeaders.set(
|
|
220
|
+
"Accept",
|
|
221
|
+
args.responseType === "json"
|
|
222
|
+
? "application/json"
|
|
223
|
+
: args.responseType === "text"
|
|
224
|
+
? "text/plain"
|
|
225
|
+
: args.responseType === "sse"
|
|
226
|
+
? "text/event-stream"
|
|
227
|
+
: "*/*",
|
|
228
|
+
);
|
|
229
|
+
if (args.body !== undefined && args.contentType != null) {
|
|
230
|
+
newHeaders.set("Content-Type", args.contentType);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (args.headers == null) {
|
|
234
|
+
return newHeaders;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
for (const [key, value] of Object.entries(args.headers)) {
|
|
238
|
+
const result = await EndpointSupplier.get(value, { endpointMetadata: args.endpointMetadata ?? {} });
|
|
239
|
+
if (typeof result === "string") {
|
|
240
|
+
newHeaders.set(key, result);
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
if (result == null) {
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
newHeaders.set(key, `${result}`);
|
|
247
|
+
}
|
|
248
|
+
return newHeaders;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export async function fetcherImpl<R = unknown>(args: Fetcher.Args): Promise<APIResponse<R, Fetcher.Error>> {
|
|
252
|
+
const url = createRequestUrl(args.url, args.queryParameters);
|
|
253
|
+
const requestBody: BodyInit | undefined = await getRequestBody({
|
|
254
|
+
body: args.body,
|
|
255
|
+
type: args.requestType ?? "other",
|
|
256
|
+
});
|
|
257
|
+
const fetchFn = args.fetchFn ?? (await getFetchFn());
|
|
258
|
+
const headers = await getHeaders(args);
|
|
259
|
+
const logger = createLogger(args.logging);
|
|
260
|
+
|
|
261
|
+
if (logger.isDebug()) {
|
|
262
|
+
const metadata = {
|
|
263
|
+
method: args.method,
|
|
264
|
+
url: redactUrl(url),
|
|
265
|
+
headers: redactHeaders(headers),
|
|
266
|
+
queryParameters: redactQueryParameters(args.queryParameters),
|
|
267
|
+
hasBody: requestBody != null,
|
|
268
|
+
};
|
|
269
|
+
logger.debug("Making HTTP request", metadata);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
try {
|
|
273
|
+
const response = await requestWithRetries(
|
|
274
|
+
async () =>
|
|
275
|
+
makeRequest(
|
|
276
|
+
fetchFn,
|
|
277
|
+
url,
|
|
278
|
+
args.method,
|
|
279
|
+
headers,
|
|
280
|
+
requestBody,
|
|
281
|
+
args.timeoutMs,
|
|
282
|
+
args.abortSignal,
|
|
283
|
+
args.withCredentials,
|
|
284
|
+
args.duplex,
|
|
285
|
+
),
|
|
286
|
+
args.maxRetries,
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
if (response.status >= 200 && response.status < 400) {
|
|
290
|
+
if (logger.isDebug()) {
|
|
291
|
+
const metadata = {
|
|
292
|
+
method: args.method,
|
|
293
|
+
url: redactUrl(url),
|
|
294
|
+
statusCode: response.status,
|
|
295
|
+
responseHeaders: redactHeaders(response.headers),
|
|
296
|
+
};
|
|
297
|
+
logger.debug("HTTP request succeeded", metadata);
|
|
298
|
+
}
|
|
299
|
+
const body = await getResponseBody(response, args.responseType);
|
|
300
|
+
return {
|
|
301
|
+
ok: true,
|
|
302
|
+
body: body as R,
|
|
303
|
+
headers: response.headers,
|
|
304
|
+
rawResponse: toRawResponse(response),
|
|
305
|
+
};
|
|
306
|
+
} else {
|
|
307
|
+
if (logger.isError()) {
|
|
308
|
+
const metadata = {
|
|
309
|
+
method: args.method,
|
|
310
|
+
url: redactUrl(url),
|
|
311
|
+
statusCode: response.status,
|
|
312
|
+
responseHeaders: redactHeaders(Object.fromEntries(response.headers.entries())),
|
|
313
|
+
};
|
|
314
|
+
logger.error("HTTP request failed with error status", metadata);
|
|
315
|
+
}
|
|
316
|
+
return {
|
|
317
|
+
ok: false,
|
|
318
|
+
error: {
|
|
319
|
+
reason: "status-code",
|
|
320
|
+
statusCode: response.status,
|
|
321
|
+
body: await getErrorResponseBody(response),
|
|
322
|
+
},
|
|
323
|
+
rawResponse: toRawResponse(response),
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
} catch (error) {
|
|
327
|
+
if (args.abortSignal?.aborted) {
|
|
328
|
+
if (logger.isError()) {
|
|
329
|
+
const metadata = {
|
|
330
|
+
method: args.method,
|
|
331
|
+
url: redactUrl(url),
|
|
332
|
+
};
|
|
333
|
+
logger.error("HTTP request was aborted", metadata);
|
|
334
|
+
}
|
|
335
|
+
return {
|
|
336
|
+
ok: false,
|
|
337
|
+
error: {
|
|
338
|
+
reason: "unknown",
|
|
339
|
+
errorMessage: "The user aborted a request",
|
|
340
|
+
},
|
|
341
|
+
rawResponse: abortRawResponse,
|
|
342
|
+
};
|
|
343
|
+
} else if (error instanceof Error && error.name === "AbortError") {
|
|
344
|
+
if (logger.isError()) {
|
|
345
|
+
const metadata = {
|
|
346
|
+
method: args.method,
|
|
347
|
+
url: redactUrl(url),
|
|
348
|
+
timeoutMs: args.timeoutMs,
|
|
349
|
+
};
|
|
350
|
+
logger.error("HTTP request timed out", metadata);
|
|
351
|
+
}
|
|
352
|
+
return {
|
|
353
|
+
ok: false,
|
|
354
|
+
error: {
|
|
355
|
+
reason: "timeout",
|
|
356
|
+
},
|
|
357
|
+
rawResponse: abortRawResponse,
|
|
358
|
+
};
|
|
359
|
+
} else if (error instanceof Error) {
|
|
360
|
+
if (logger.isError()) {
|
|
361
|
+
const metadata = {
|
|
362
|
+
method: args.method,
|
|
363
|
+
url: redactUrl(url),
|
|
364
|
+
errorMessage: error.message,
|
|
365
|
+
};
|
|
366
|
+
logger.error("HTTP request failed with error", metadata);
|
|
367
|
+
}
|
|
368
|
+
return {
|
|
369
|
+
ok: false,
|
|
370
|
+
error: {
|
|
371
|
+
reason: "unknown",
|
|
372
|
+
errorMessage: error.message,
|
|
373
|
+
},
|
|
374
|
+
rawResponse: unknownRawResponse,
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
if (logger.isError()) {
|
|
379
|
+
const metadata = {
|
|
380
|
+
method: args.method,
|
|
381
|
+
url: redactUrl(url),
|
|
382
|
+
error: toJson(error),
|
|
383
|
+
};
|
|
384
|
+
logger.error("HTTP request failed with unknown error", metadata);
|
|
385
|
+
}
|
|
386
|
+
return {
|
|
387
|
+
ok: false,
|
|
388
|
+
error: {
|
|
389
|
+
reason: "unknown",
|
|
390
|
+
errorMessage: toJson(error),
|
|
391
|
+
},
|
|
392
|
+
rawResponse: unknownRawResponse,
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export const fetcher: FetchFunction = fetcherImpl;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
let Headers: typeof globalThis.Headers;
|
|
2
|
+
|
|
3
|
+
if (typeof globalThis.Headers !== "undefined") {
|
|
4
|
+
Headers = globalThis.Headers;
|
|
5
|
+
} else {
|
|
6
|
+
Headers = class Headers implements Headers {
|
|
7
|
+
private headers: Map<string, string[]>;
|
|
8
|
+
|
|
9
|
+
constructor(init?: HeadersInit) {
|
|
10
|
+
this.headers = new Map();
|
|
11
|
+
|
|
12
|
+
if (init) {
|
|
13
|
+
if (init instanceof Headers) {
|
|
14
|
+
init.forEach((value, key) => this.append(key, value));
|
|
15
|
+
} else if (Array.isArray(init)) {
|
|
16
|
+
for (const [key, value] of init) {
|
|
17
|
+
if (typeof key === "string" && typeof value === "string") {
|
|
18
|
+
this.append(key, value);
|
|
19
|
+
} else {
|
|
20
|
+
throw new TypeError("Each header entry must be a [string, string] tuple");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
} else {
|
|
24
|
+
for (const [key, value] of Object.entries(init)) {
|
|
25
|
+
if (typeof value === "string") {
|
|
26
|
+
this.append(key, value);
|
|
27
|
+
} else {
|
|
28
|
+
throw new TypeError("Header values must be strings");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
append(name: string, value: string): void {
|
|
36
|
+
const key = name.toLowerCase();
|
|
37
|
+
const existing = this.headers.get(key) || [];
|
|
38
|
+
this.headers.set(key, [...existing, value]);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
delete(name: string): void {
|
|
42
|
+
const key = name.toLowerCase();
|
|
43
|
+
this.headers.delete(key);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
get(name: string): string | null {
|
|
47
|
+
const key = name.toLowerCase();
|
|
48
|
+
const values = this.headers.get(key);
|
|
49
|
+
return values ? values.join(", ") : null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
has(name: string): boolean {
|
|
53
|
+
const key = name.toLowerCase();
|
|
54
|
+
return this.headers.has(key);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
set(name: string, value: string): void {
|
|
58
|
+
const key = name.toLowerCase();
|
|
59
|
+
this.headers.set(key, [value]);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: unknown): void {
|
|
63
|
+
const boundCallback = thisArg ? callbackfn.bind(thisArg) : callbackfn;
|
|
64
|
+
this.headers.forEach((values, key) => boundCallback(values.join(", "), key, this));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
getSetCookie(): string[] {
|
|
68
|
+
return this.headers.get("set-cookie") || [];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
*entries(): HeadersIterator<[string, string]> {
|
|
72
|
+
for (const [key, values] of this.headers.entries()) {
|
|
73
|
+
yield [key, values.join(", ")];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
*keys(): HeadersIterator<string> {
|
|
78
|
+
yield* this.headers.keys();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
*values(): HeadersIterator<string> {
|
|
82
|
+
for (const values of this.headers.values()) {
|
|
83
|
+
yield values.join(", ");
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
[Symbol.iterator](): HeadersIterator<[string, string]> {
|
|
88
|
+
return this.entries();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export { Headers };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { WithRawResponse } from "./RawResponse.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A promise that returns the parsed response and lets you retrieve the raw response too.
|
|
5
|
+
*/
|
|
6
|
+
export class HttpResponsePromise<T> extends Promise<T> {
|
|
7
|
+
private innerPromise: Promise<WithRawResponse<T>>;
|
|
8
|
+
private unwrappedPromise: Promise<T> | undefined;
|
|
9
|
+
|
|
10
|
+
private constructor(promise: Promise<WithRawResponse<T>>) {
|
|
11
|
+
// Initialize with a no-op to avoid premature parsing
|
|
12
|
+
super((resolve) => {
|
|
13
|
+
resolve(undefined as unknown as T);
|
|
14
|
+
});
|
|
15
|
+
this.innerPromise = promise;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Creates an `HttpResponsePromise` from a function that returns a promise.
|
|
20
|
+
*
|
|
21
|
+
* @param fn - A function that returns a promise resolving to a `WithRawResponse` object.
|
|
22
|
+
* @param args - Arguments to pass to the function.
|
|
23
|
+
* @returns An `HttpResponsePromise` instance.
|
|
24
|
+
*/
|
|
25
|
+
public static fromFunction<F extends (...args: never[]) => Promise<WithRawResponse<T>>, T>(
|
|
26
|
+
fn: F,
|
|
27
|
+
...args: Parameters<F>
|
|
28
|
+
): HttpResponsePromise<T> {
|
|
29
|
+
return new HttpResponsePromise<T>(fn(...args));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Creates a function that returns an `HttpResponsePromise` from a function that returns a promise.
|
|
34
|
+
*
|
|
35
|
+
* @param fn - A function that returns a promise resolving to a `WithRawResponse` object.
|
|
36
|
+
* @returns A function that returns an `HttpResponsePromise` instance.
|
|
37
|
+
*/
|
|
38
|
+
public static interceptFunction<
|
|
39
|
+
F extends (...args: never[]) => Promise<WithRawResponse<T>>,
|
|
40
|
+
T = Awaited<ReturnType<F>>["data"],
|
|
41
|
+
>(fn: F): (...args: Parameters<F>) => HttpResponsePromise<T> {
|
|
42
|
+
return (...args: Parameters<F>): HttpResponsePromise<T> => {
|
|
43
|
+
return HttpResponsePromise.fromPromise<T>(fn(...args));
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Creates an `HttpResponsePromise` from an existing promise.
|
|
49
|
+
*
|
|
50
|
+
* @param promise - A promise resolving to a `WithRawResponse` object.
|
|
51
|
+
* @returns An `HttpResponsePromise` instance.
|
|
52
|
+
*/
|
|
53
|
+
public static fromPromise<T>(promise: Promise<WithRawResponse<T>>): HttpResponsePromise<T> {
|
|
54
|
+
return new HttpResponsePromise<T>(promise);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Creates an `HttpResponsePromise` from an executor function.
|
|
59
|
+
*
|
|
60
|
+
* @param executor - A function that takes resolve and reject callbacks to create a promise.
|
|
61
|
+
* @returns An `HttpResponsePromise` instance.
|
|
62
|
+
*/
|
|
63
|
+
public static fromExecutor<T>(
|
|
64
|
+
executor: (resolve: (value: WithRawResponse<T>) => void, reject: (reason?: unknown) => void) => void,
|
|
65
|
+
): HttpResponsePromise<T> {
|
|
66
|
+
const promise = new Promise<WithRawResponse<T>>(executor);
|
|
67
|
+
return new HttpResponsePromise<T>(promise);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Creates an `HttpResponsePromise` from a resolved result.
|
|
72
|
+
*
|
|
73
|
+
* @param result - A `WithRawResponse` object to resolve immediately.
|
|
74
|
+
* @returns An `HttpResponsePromise` instance.
|
|
75
|
+
*/
|
|
76
|
+
public static fromResult<T>(result: WithRawResponse<T>): HttpResponsePromise<T> {
|
|
77
|
+
const promise = Promise.resolve(result);
|
|
78
|
+
return new HttpResponsePromise<T>(promise);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
private unwrap(): Promise<T> {
|
|
82
|
+
if (!this.unwrappedPromise) {
|
|
83
|
+
this.unwrappedPromise = this.innerPromise.then(({ data }) => data);
|
|
84
|
+
}
|
|
85
|
+
return this.unwrappedPromise;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** @inheritdoc */
|
|
89
|
+
public override then<TResult1 = T, TResult2 = never>(
|
|
90
|
+
onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
|
|
91
|
+
onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null,
|
|
92
|
+
): Promise<TResult1 | TResult2> {
|
|
93
|
+
return this.unwrap().then(onfulfilled, onrejected);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** @inheritdoc */
|
|
97
|
+
public override catch<TResult = never>(
|
|
98
|
+
onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null,
|
|
99
|
+
): Promise<T | TResult> {
|
|
100
|
+
return this.unwrap().catch(onrejected);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** @inheritdoc */
|
|
104
|
+
public override finally(onfinally?: (() => void) | null): Promise<T> {
|
|
105
|
+
return this.unwrap().finally(onfinally);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Retrieves the data and raw response.
|
|
110
|
+
*
|
|
111
|
+
* @returns A promise resolving to a `WithRawResponse` object.
|
|
112
|
+
*/
|
|
113
|
+
public async withRawResponse(): Promise<WithRawResponse<T>> {
|
|
114
|
+
return await this.innerPromise;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Headers } from "./Headers.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The raw response from the fetch call excluding the body.
|
|
5
|
+
*/
|
|
6
|
+
export type RawResponse = Omit<
|
|
7
|
+
{
|
|
8
|
+
[K in keyof Response as Response[K] extends Function ? never : K]: Response[K]; // strips out functions
|
|
9
|
+
},
|
|
10
|
+
"ok" | "body" | "bodyUsed"
|
|
11
|
+
>; // strips out body and bodyUsed
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A raw response indicating that the request was aborted.
|
|
15
|
+
*/
|
|
16
|
+
export const abortRawResponse: RawResponse = {
|
|
17
|
+
headers: new Headers(),
|
|
18
|
+
redirected: false,
|
|
19
|
+
status: 499,
|
|
20
|
+
statusText: "Client Closed Request",
|
|
21
|
+
type: "error",
|
|
22
|
+
url: "",
|
|
23
|
+
} as const;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A raw response indicating an unknown error.
|
|
27
|
+
*/
|
|
28
|
+
export const unknownRawResponse: RawResponse = {
|
|
29
|
+
headers: new Headers(),
|
|
30
|
+
redirected: false,
|
|
31
|
+
status: 0,
|
|
32
|
+
statusText: "Unknown Error",
|
|
33
|
+
type: "error",
|
|
34
|
+
url: "",
|
|
35
|
+
} as const;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Converts a `RawResponse` object into a `RawResponse` by extracting its properties,
|
|
39
|
+
* excluding the `body` and `bodyUsed` fields.
|
|
40
|
+
*
|
|
41
|
+
* @param response - The `RawResponse` object to convert.
|
|
42
|
+
* @returns A `RawResponse` object containing the extracted properties of the input response.
|
|
43
|
+
*/
|
|
44
|
+
export function toRawResponse(response: Response): RawResponse {
|
|
45
|
+
return {
|
|
46
|
+
headers: response.headers,
|
|
47
|
+
redirected: response.redirected,
|
|
48
|
+
status: response.status,
|
|
49
|
+
statusText: response.statusText,
|
|
50
|
+
type: response.type,
|
|
51
|
+
url: response.url,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Creates a `RawResponse` from a standard `Response` object.
|
|
57
|
+
*/
|
|
58
|
+
export interface WithRawResponse<T> {
|
|
59
|
+
readonly data: T;
|
|
60
|
+
readonly rawResponse: RawResponse;
|
|
61
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type Supplier<T> = T | Promise<T> | (() => T | Promise<T>);
|
|
2
|
+
|
|
3
|
+
export const Supplier = {
|
|
4
|
+
get: async <T>(supplier: Supplier<T>): Promise<T> => {
|
|
5
|
+
if (typeof supplier === "function") {
|
|
6
|
+
return (supplier as () => T)();
|
|
7
|
+
} else {
|
|
8
|
+
return supplier;
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { toQueryString } from "../url/qs.js";
|
|
2
|
+
|
|
3
|
+
export function createRequestUrl(baseUrl: string, queryParameters?: Record<string, unknown>): string {
|
|
4
|
+
const queryString = toQueryString(queryParameters, { arrayFormat: "repeat" });
|
|
5
|
+
return queryString ? `${baseUrl}?${queryString}` : baseUrl;
|
|
6
|
+
}
|