@algolia/ingestion 1.0.0-alpha.9 → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builds/browser.d.ts +52 -5
- package/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/node.d.ts +52 -5
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/ingestion.cjs +1332 -0
- package/dist/ingestion.esm.browser.js +1488 -969
- package/dist/ingestion.esm.node.js +1319 -819
- package/dist/ingestion.umd.js +2 -2
- package/dist/model/actionType.d.ts +4 -1
- package/dist/model/actionType.d.ts.map +1 -1
- package/dist/model/authAPIKey.d.ts +9 -3
- package/dist/model/authAPIKey.d.ts.map +1 -1
- package/dist/model/authAPIKeyPartial.d.ts +10 -0
- package/dist/model/authAPIKeyPartial.d.ts.map +1 -0
- package/dist/model/authAlgolia.d.ts +13 -4
- package/dist/model/authAlgolia.d.ts.map +1 -1
- package/dist/model/authAlgoliaInsights.d.ts +14 -0
- package/dist/model/authAlgoliaInsights.d.ts.map +1 -0
- package/dist/model/authAlgoliaInsightsPartial.d.ts +14 -0
- package/dist/model/authAlgoliaInsightsPartial.d.ts.map +1 -0
- package/dist/model/authAlgoliaPartial.d.ts +14 -0
- package/dist/model/authAlgoliaPartial.d.ts.map +1 -0
- package/dist/model/authBasic.d.ts +13 -4
- package/dist/model/authBasic.d.ts.map +1 -1
- package/dist/model/authBasicPartial.d.ts +14 -0
- package/dist/model/authBasicPartial.d.ts.map +1 -0
- package/dist/model/authGoogleServiceAccount.d.ts +13 -4
- package/dist/model/authGoogleServiceAccount.d.ts.map +1 -1
- package/dist/model/authGoogleServiceAccountPartial.d.ts +14 -0
- package/dist/model/authGoogleServiceAccountPartial.d.ts.map +1 -0
- package/dist/model/authInput.d.ts +7 -6
- package/dist/model/authInput.d.ts.map +1 -1
- package/dist/model/authInputPartial.d.ts +8 -0
- package/dist/model/authInputPartial.d.ts.map +1 -0
- package/dist/model/authOAuth.d.ts +21 -6
- package/dist/model/authOAuth.d.ts.map +1 -1
- package/dist/model/authOAuthPartial.d.ts +22 -0
- package/dist/model/authOAuthPartial.d.ts.map +1 -0
- package/dist/model/authentication.d.ts +27 -16
- package/dist/model/authentication.d.ts.map +1 -1
- package/dist/model/authenticationCreate.d.ts +15 -9
- package/dist/model/authenticationCreate.d.ts.map +1 -1
- package/dist/model/authenticationCreateResponse.d.ts +17 -8
- package/dist/model/authenticationCreateResponse.d.ts.map +1 -1
- package/dist/model/authenticationSearch.d.ts +7 -0
- package/dist/model/authenticationSearch.d.ts.map +1 -0
- package/dist/model/authenticationSortKeys.d.ts +5 -0
- package/dist/model/authenticationSortKeys.d.ts.map +1 -0
- package/dist/model/authenticationType.d.ts +4 -1
- package/dist/model/authenticationType.d.ts.map +1 -1
- package/dist/model/authenticationUpdate.d.ts +15 -9
- package/dist/model/authenticationUpdate.d.ts.map +1 -1
- package/dist/model/authenticationUpdateResponse.d.ts +17 -8
- package/dist/model/authenticationUpdateResponse.d.ts.map +1 -1
- package/dist/model/bigCommerceChannel.d.ts +11 -0
- package/dist/model/bigCommerceChannel.d.ts.map +1 -0
- package/dist/model/bigCommerceMetafield.d.ts +11 -0
- package/dist/model/bigCommerceMetafield.d.ts.map +1 -0
- package/dist/model/bigQueryDataType.d.ts +2 -0
- package/dist/model/bigQueryDataType.d.ts.map +1 -0
- package/dist/model/clientMethodProps.d.ts +465 -282
- package/dist/model/clientMethodProps.d.ts.map +1 -1
- package/dist/model/commercetoolsCustomFields.d.ts +18 -0
- package/dist/model/commercetoolsCustomFields.d.ts.map +1 -0
- package/dist/model/deleteResponse.d.ts +6 -6
- package/dist/model/deleteResponse.d.ts.map +1 -1
- package/dist/model/destination.d.ts +29 -17
- package/dist/model/destination.d.ts.map +1 -1
- package/dist/model/destinationCreate.d.ts +17 -8
- package/dist/model/destinationCreate.d.ts.map +1 -1
- package/dist/model/destinationCreateResponse.d.ts +17 -8
- package/dist/model/destinationCreateResponse.d.ts.map +1 -1
- package/dist/model/destinationIndexName.d.ts +12 -3
- package/dist/model/destinationIndexName.d.ts.map +1 -1
- package/dist/model/destinationIndexPrefix.d.ts +6 -3
- package/dist/model/destinationIndexPrefix.d.ts.map +1 -1
- package/dist/model/destinationInput.d.ts +3 -3
- package/dist/model/destinationInput.d.ts.map +1 -1
- package/dist/model/destinationSearch.d.ts +7 -0
- package/dist/model/destinationSearch.d.ts.map +1 -0
- package/dist/model/destinationSortKeys.d.ts +5 -0
- package/dist/model/destinationSortKeys.d.ts.map +1 -0
- package/dist/model/destinationType.d.ts +4 -1
- package/dist/model/destinationType.d.ts.map +1 -1
- package/dist/model/destinationUpdate.d.ts +17 -8
- package/dist/model/destinationUpdate.d.ts.map +1 -1
- package/dist/model/destinationUpdateResponse.d.ts +17 -8
- package/dist/model/destinationUpdateResponse.d.ts.map +1 -1
- package/dist/model/dockerImageType.d.ts +5 -0
- package/dist/model/dockerImageType.d.ts.map +1 -0
- package/dist/model/dockerRegistry.d.ts +5 -0
- package/dist/model/dockerRegistry.d.ts.map +1 -0
- package/dist/model/dockerSourceDiscover.d.ts +11 -0
- package/dist/model/dockerSourceDiscover.d.ts.map +1 -0
- package/dist/model/dockerSourceStreams.d.ts +4 -0
- package/dist/model/dockerSourceStreams.d.ts.map +1 -0
- package/dist/model/errorBase.d.ts +6 -6
- package/dist/model/errorBase.d.ts.map +1 -1
- package/dist/model/event.d.ts +30 -14
- package/dist/model/event.d.ts.map +1 -1
- package/dist/model/eventSortKeys.d.ts +5 -0
- package/dist/model/eventSortKeys.d.ts.map +1 -0
- package/dist/model/eventStatus.d.ts +1 -1
- package/dist/model/eventStatus.d.ts.map +1 -1
- package/dist/model/eventType.d.ts +1 -1
- package/dist/model/eventType.d.ts.map +1 -1
- package/dist/model/index.d.ts +126 -63
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/listAuthenticationsResponse.d.ts +6 -6
- package/dist/model/listAuthenticationsResponse.d.ts.map +1 -1
- package/dist/model/listDestinationsResponse.d.ts +6 -6
- package/dist/model/listDestinationsResponse.d.ts.map +1 -1
- package/dist/model/listEventsResponse.d.ts +8 -6
- package/dist/model/listEventsResponse.d.ts.map +1 -1
- package/dist/model/listSourcesResponse.d.ts +6 -6
- package/dist/model/listSourcesResponse.d.ts.map +1 -1
- package/dist/model/listTasksResponse.d.ts +9 -6
- package/dist/model/listTasksResponse.d.ts.map +1 -1
- package/dist/model/mappingFieldDirective.d.ts +14 -0
- package/dist/model/mappingFieldDirective.d.ts.map +1 -0
- package/dist/model/mappingFormatSchema.d.ts +5 -0
- package/dist/model/mappingFormatSchema.d.ts.map +1 -0
- package/dist/model/mappingInput.d.ts +10 -0
- package/dist/model/mappingInput.d.ts.map +1 -0
- package/dist/model/mappingKitAction.d.ts +20 -0
- package/dist/model/mappingKitAction.d.ts.map +1 -0
- package/dist/model/mappingTypeCSV.d.ts +2 -0
- package/dist/model/mappingTypeCSV.d.ts.map +1 -0
- package/dist/model/methodType.d.ts +4 -1
- package/dist/model/methodType.d.ts.map +1 -1
- package/dist/model/onDemandDateUtilsInput.d.ts +16 -0
- package/dist/model/onDemandDateUtilsInput.d.ts.map +1 -0
- package/dist/model/onDemandTrigger.d.ts +12 -0
- package/dist/model/onDemandTrigger.d.ts.map +1 -0
- package/dist/model/onDemandTriggerInput.d.ts +8 -0
- package/dist/model/onDemandTriggerInput.d.ts.map +1 -0
- package/dist/model/onDemandTriggerType.d.ts +5 -0
- package/dist/model/onDemandTriggerType.d.ts.map +1 -0
- package/dist/model/orderKeys.d.ts +5 -0
- package/dist/model/orderKeys.d.ts.map +1 -0
- package/dist/model/pagination.d.ts +21 -6
- package/dist/model/pagination.d.ts.map +1 -1
- package/dist/model/platform.d.ts +5 -0
- package/dist/model/platform.d.ts.map +1 -0
- package/dist/model/platformNone.d.ts +5 -0
- package/dist/model/platformNone.d.ts.map +1 -0
- package/dist/model/platformWithNone.d.ts +4 -0
- package/dist/model/platformWithNone.d.ts.map +1 -0
- package/dist/model/recordType.d.ts +5 -0
- package/dist/model/recordType.d.ts.map +1 -0
- package/dist/model/run.d.ts +41 -29
- package/dist/model/run.d.ts.map +1 -1
- package/dist/model/runListResponse.d.ts +8 -6
- package/dist/model/runListResponse.d.ts.map +1 -1
- package/dist/model/runOutcome.d.ts +4 -1
- package/dist/model/runOutcome.d.ts.map +1 -1
- package/dist/model/runProgress.d.ts +4 -4
- package/dist/model/runProgress.d.ts.map +1 -1
- package/dist/model/runReasonCode.d.ts +5 -0
- package/dist/model/runReasonCode.d.ts.map +1 -0
- package/dist/model/runResponse.d.ts +13 -7
- package/dist/model/runResponse.d.ts.map +1 -1
- package/dist/model/runSortKeys.d.ts +5 -0
- package/dist/model/runSortKeys.d.ts.map +1 -0
- package/dist/model/runStatus.d.ts +4 -1
- package/dist/model/runStatus.d.ts.map +1 -1
- package/dist/model/runType.d.ts +4 -1
- package/dist/model/runType.d.ts.map +1 -1
- package/dist/model/scheduleDateUtilsInput.d.ts +12 -0
- package/dist/model/scheduleDateUtilsInput.d.ts.map +1 -0
- package/dist/model/scheduleTrigger.d.ts +20 -0
- package/dist/model/scheduleTrigger.d.ts.map +1 -0
- package/dist/model/scheduleTriggerInput.d.ts +12 -0
- package/dist/model/scheduleTriggerInput.d.ts.map +1 -0
- package/dist/model/scheduleTriggerType.d.ts +5 -0
- package/dist/model/scheduleTriggerType.d.ts.map +1 -0
- package/dist/model/shopifyInput.d.ts +10 -0
- package/dist/model/shopifyInput.d.ts.map +1 -0
- package/dist/model/shopifyMarket.d.ts +9 -0
- package/dist/model/shopifyMarket.d.ts.map +1 -0
- package/dist/model/shopifyMetafield.d.ts +9 -0
- package/dist/model/shopifyMetafield.d.ts.map +1 -0
- package/dist/model/source.d.ts +23 -17
- package/dist/model/source.d.ts.map +1 -1
- package/dist/model/sourceBigCommerce.d.ts +12 -3
- package/dist/model/sourceBigCommerce.d.ts.map +1 -1
- package/dist/model/sourceBigQuery.d.ts +29 -0
- package/dist/model/sourceBigQuery.d.ts.map +1 -0
- package/dist/model/sourceCSV.d.ts +22 -0
- package/dist/model/sourceCSV.d.ts.map +1 -0
- package/dist/model/sourceCommercetools.d.ts +15 -9
- package/dist/model/sourceCommercetools.d.ts.map +1 -1
- package/dist/model/sourceCreate.d.ts +14 -8
- package/dist/model/sourceCreate.d.ts.map +1 -1
- package/dist/model/sourceCreateResponse.d.ts +14 -8
- package/dist/model/sourceCreateResponse.d.ts.map +1 -1
- package/dist/model/sourceDocker.d.ts +19 -0
- package/dist/model/sourceDocker.d.ts.map +1 -0
- package/dist/model/sourceGA4BigQueryExport.d.ts +15 -0
- package/dist/model/sourceGA4BigQueryExport.d.ts.map +1 -0
- package/dist/model/sourceInput.d.ts +9 -4
- package/dist/model/sourceInput.d.ts.map +1 -1
- package/dist/model/sourceJSON.d.ts +13 -0
- package/dist/model/sourceJSON.d.ts.map +1 -0
- package/dist/model/sourceSearch.d.ts +4 -0
- package/dist/model/sourceSearch.d.ts.map +1 -0
- package/dist/model/sourceShopify.d.ts +4 -0
- package/dist/model/sourceShopify.d.ts.map +1 -0
- package/dist/model/sourceShopifyBase.d.ts +7 -0
- package/dist/model/sourceShopifyBase.d.ts.map +1 -0
- package/dist/model/sourceSortKeys.d.ts +5 -0
- package/dist/model/sourceSortKeys.d.ts.map +1 -0
- package/dist/model/sourceType.d.ts +1 -1
- package/dist/model/sourceType.d.ts.map +1 -1
- package/dist/model/sourceUpdate.d.ts +12 -8
- package/dist/model/sourceUpdate.d.ts.map +1 -1
- package/dist/model/sourceUpdateCommercetools.d.ts +15 -0
- package/dist/model/sourceUpdateCommercetools.d.ts.map +1 -0
- package/dist/model/sourceUpdateDocker.d.ts +17 -0
- package/dist/model/sourceUpdateDocker.d.ts.map +1 -0
- package/dist/model/sourceUpdateInput.d.ts +9 -0
- package/dist/model/sourceUpdateInput.d.ts.map +1 -0
- package/dist/model/sourceUpdateResponse.d.ts +14 -8
- package/dist/model/sourceUpdateResponse.d.ts.map +1 -1
- package/dist/model/sourceUpdateShopify.d.ts +31 -0
- package/dist/model/sourceUpdateShopify.d.ts.map +1 -0
- package/dist/model/streamingTrigger.d.ts +8 -0
- package/dist/model/streamingTrigger.d.ts.map +1 -0
- package/dist/model/streamingTriggerType.d.ts +5 -0
- package/dist/model/streamingTriggerType.d.ts.map +1 -0
- package/dist/model/streamingUtilsInput.d.ts +8 -0
- package/dist/model/streamingUtilsInput.d.ts.map +1 -0
- package/dist/model/subscriptionTrigger.d.ts +8 -0
- package/dist/model/subscriptionTrigger.d.ts.map +1 -0
- package/dist/model/subscriptionTriggerType.d.ts +5 -0
- package/dist/model/subscriptionTriggerType.d.ts.map +1 -0
- package/dist/model/task.d.ts +36 -18
- package/dist/model/task.d.ts.map +1 -1
- package/dist/model/taskCreate.d.ts +27 -9
- package/dist/model/taskCreate.d.ts.map +1 -1
- package/dist/model/taskCreateResponse.d.ts +13 -7
- package/dist/model/taskCreateResponse.d.ts.map +1 -1
- package/dist/model/taskCreateTrigger.d.ts +6 -0
- package/dist/model/taskCreateTrigger.d.ts.map +1 -0
- package/dist/model/taskInput.d.ts +9 -0
- package/dist/model/taskInput.d.ts.map +1 -0
- package/dist/model/taskSearch.d.ts +4 -0
- package/dist/model/taskSearch.d.ts.map +1 -0
- package/dist/model/taskSortKeys.d.ts +5 -0
- package/dist/model/taskSortKeys.d.ts.map +1 -0
- package/dist/model/taskUpdate.d.ts +21 -6
- package/dist/model/taskUpdate.d.ts.map +1 -1
- package/dist/model/taskUpdateResponse.d.ts +13 -7
- package/dist/model/taskUpdateResponse.d.ts.map +1 -1
- package/dist/model/trigger.d.ts +8 -13
- package/dist/model/trigger.d.ts.map +1 -1
- package/dist/model/triggerType.d.ts +4 -1
- package/dist/model/triggerType.d.ts.map +1 -1
- package/dist/model/triggerUpdateInput.d.ts +10 -0
- package/dist/model/triggerUpdateInput.d.ts.map +1 -0
- package/dist/model/window.d.ts +14 -0
- package/dist/model/window.d.ts.map +1 -0
- package/dist/src/ingestionClient.d.ts +574 -325
- package/dist/src/ingestionClient.d.ts.map +1 -1
- package/index.js +1 -1
- package/model/actionType.ts +5 -2
- package/model/authAPIKey.ts +7 -1
- package/model/authAPIKeyPartial.ts +11 -0
- package/model/authAlgolia.ts +10 -1
- package/model/authAlgoliaInsights.ts +16 -0
- package/model/authAlgoliaInsightsPartial.ts +16 -0
- package/model/authAlgoliaPartial.ts +16 -0
- package/model/authBasic.ts +10 -1
- package/model/authBasicPartial.ts +16 -0
- package/model/authGoogleServiceAccount.ts +10 -1
- package/model/authGoogleServiceAccountPartial.ts +16 -0
- package/model/authInput.ts +3 -1
- package/model/authInputPartial.ts +16 -0
- package/model/authOAuth.ts +16 -1
- package/model/authOAuthPartial.ts +26 -0
- package/model/authentication.ts +17 -5
- package/model/authenticationCreate.ts +9 -3
- package/model/authenticationCreateResponse.ts +11 -2
- package/model/authenticationSearch.ts +8 -0
- package/model/authenticationSortKeys.ts +11 -0
- package/model/authenticationType.ts +5 -1
- package/model/authenticationUpdate.ts +11 -5
- package/model/authenticationUpdateResponse.ts +11 -2
- package/model/bigCommerceChannel.ts +13 -0
- package/model/bigCommerceMetafield.ts +13 -0
- package/model/bigQueryDataType.ts +3 -0
- package/model/clientMethodProps.ts +236 -48
- package/model/commercetoolsCustomFields.ts +21 -0
- package/model/deleteResponse.ts +2 -2
- package/model/destination.ts +15 -3
- package/model/destinationCreate.ts +11 -2
- package/model/destinationCreateResponse.ts +11 -2
- package/model/destinationIndexName.ts +13 -1
- package/model/destinationIndexPrefix.ts +4 -1
- package/model/destinationInput.ts +1 -1
- package/model/destinationSearch.ts +8 -0
- package/model/destinationSortKeys.ts +6 -0
- package/model/destinationType.ts +5 -2
- package/model/destinationUpdate.ts +10 -1
- package/model/destinationUpdateResponse.ts +11 -2
- package/model/dockerImageType.ts +6 -0
- package/model/dockerRegistry.ts +6 -0
- package/model/dockerSourceDiscover.ts +13 -0
- package/model/dockerSourceStreams.ts +5 -0
- package/model/errorBase.ts +1 -1
- package/model/event.ts +19 -2
- package/model/eventSortKeys.ts +6 -0
- package/model/eventStatus.ts +2 -1
- package/model/eventType.ts +2 -2
- package/model/index.ts +69 -6
- package/model/listAuthenticationsResponse.ts +1 -1
- package/model/listDestinationsResponse.ts +1 -1
- package/model/listEventsResponse.ts +4 -1
- package/model/listSourcesResponse.ts +1 -1
- package/model/listTasksResponse.ts +4 -1
- package/model/mappingFieldDirective.ts +16 -0
- package/model/mappingFormatSchema.ts +6 -0
- package/model/mappingInput.ts +13 -0
- package/model/mappingKitAction.ts +25 -0
- package/model/mappingTypeCSV.ts +8 -0
- package/model/methodType.ts +4 -1
- package/model/onDemandDateUtilsInput.ts +20 -0
- package/model/onDemandTrigger.ts +15 -0
- package/model/onDemandTriggerInput.ts +10 -0
- package/model/onDemandTriggerType.ts +6 -0
- package/model/orderKeys.ts +6 -0
- package/model/pagination.ts +16 -1
- package/model/platform.ts +6 -0
- package/model/platformNone.ts +6 -0
- package/model/platformWithNone.ts +6 -0
- package/model/recordType.ts +6 -0
- package/model/run.ts +22 -8
- package/model/runListResponse.ts +4 -1
- package/model/runOutcome.ts +5 -2
- package/model/runProgress.ts +1 -1
- package/model/runReasonCode.ts +13 -0
- package/model/runResponse.ts +8 -2
- package/model/runSortKeys.ts +6 -0
- package/model/runStatus.ts +10 -2
- package/model/runType.ts +5 -2
- package/model/scheduleDateUtilsInput.ts +15 -0
- package/model/scheduleTrigger.ts +25 -0
- package/model/scheduleTriggerInput.ts +15 -0
- package/model/scheduleTriggerType.ts +6 -0
- package/model/shopifyInput.ts +13 -0
- package/model/shopifyMarket.ts +12 -0
- package/model/shopifyMetafield.ts +12 -0
- package/model/source.ts +9 -3
- package/model/sourceBigCommerce.ts +16 -2
- package/model/sourceBigQuery.ts +37 -0
- package/model/sourceCSV.ts +28 -0
- package/model/sourceCommercetools.ts +11 -2
- package/model/sourceCreate.ts +8 -2
- package/model/sourceCreateResponse.ts +8 -2
- package/model/sourceDocker.ts +25 -0
- package/model/sourceGA4BigQueryExport.ts +18 -0
- package/model/sourceInput.ts +16 -3
- package/model/sourceJSON.ts +17 -0
- package/model/sourceSearch.ts +5 -0
- package/model/sourceShopify.ts +6 -0
- package/model/sourceShopifyBase.ts +8 -0
- package/model/sourceSortKeys.ts +6 -0
- package/model/sourceType.ts +11 -2
- package/model/sourceUpdate.ts +9 -6
- package/model/sourceUpdateCommercetools.ts +21 -0
- package/model/sourceUpdateDocker.ts +22 -0
- package/model/sourceUpdateInput.ts +18 -0
- package/model/sourceUpdateResponse.ts +8 -2
- package/model/sourceUpdateShopify.ts +38 -0
- package/model/streamingTrigger.ts +10 -0
- package/model/streamingTriggerType.ts +6 -0
- package/model/streamingUtilsInput.ts +10 -0
- package/model/subscriptionTrigger.ts +10 -0
- package/model/subscriptionTriggerType.ts +6 -0
- package/model/task.ts +24 -4
- package/model/taskCreate.ts +23 -3
- package/model/taskCreateResponse.ts +8 -2
- package/model/taskCreateTrigger.ts +12 -0
- package/model/taskInput.ts +15 -0
- package/model/taskSearch.ts +5 -0
- package/model/taskSortKeys.ts +11 -0
- package/model/taskUpdate.ts +20 -3
- package/model/taskUpdateResponse.ts +8 -2
- package/model/trigger.ts +15 -19
- package/model/triggerType.ts +9 -2
- package/model/triggerUpdateInput.ts +11 -0
- package/model/window.ts +16 -0
- package/package.json +10 -9
- package/dist/ingestion.cjs.js +0 -831
- package/dist/model/authenticationInput.d.ts +0 -5
- package/dist/model/authenticationInput.d.ts.map +0 -1
- package/dist/model/authenticationWithInput.d.ts +0 -4
- package/dist/model/authenticationWithInput.d.ts.map +0 -1
- package/dist/model/platformType.d.ts +0 -2
- package/dist/model/platformType.d.ts.map +0 -1
- package/dist/model/sourceJson.d.ts +0 -6
- package/dist/model/sourceJson.d.ts.map +0 -1
- package/dist/model/triggerInput.d.ts +0 -6
- package/dist/model/triggerInput.d.ts.map +0 -1
- package/model/authenticationInput.ts +0 -7
- package/model/authenticationWithInput.ts +0 -6
- package/model/platformType.ts +0 -3
- package/model/sourceJson.ts +0 -9
- package/model/triggerInput.ts +0 -9
|
@@ -26,14 +26,35 @@ function createBrowserLocalStorageCache(options) {
|
|
|
26
26
|
function getNamespace() {
|
|
27
27
|
return JSON.parse(getStorage().getItem(namespaceKey) || '{}');
|
|
28
28
|
}
|
|
29
|
+
function setNamespace(namespace) {
|
|
30
|
+
getStorage().setItem(namespaceKey, JSON.stringify(namespace));
|
|
31
|
+
}
|
|
32
|
+
function removeOutdatedCacheItems() {
|
|
33
|
+
const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;
|
|
34
|
+
const namespace = getNamespace();
|
|
35
|
+
const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(Object.entries(namespace).filter(([, cacheItem]) => {
|
|
36
|
+
return cacheItem.timestamp !== undefined;
|
|
37
|
+
}));
|
|
38
|
+
setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);
|
|
39
|
+
if (!timeToLive) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const filteredNamespaceWithoutExpiredItems = Object.fromEntries(Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {
|
|
43
|
+
const currentTimestamp = new Date().getTime();
|
|
44
|
+
const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;
|
|
45
|
+
return !isExpired;
|
|
46
|
+
}));
|
|
47
|
+
setNamespace(filteredNamespaceWithoutExpiredItems);
|
|
48
|
+
}
|
|
29
49
|
return {
|
|
30
50
|
get(key, defaultValue, events = {
|
|
31
51
|
miss: () => Promise.resolve()
|
|
32
52
|
}) {
|
|
33
53
|
return Promise.resolve().then(() => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
54
|
+
removeOutdatedCacheItems();
|
|
55
|
+
return getNamespace()[JSON.stringify(key)];
|
|
56
|
+
}).then(value => {
|
|
57
|
+
return Promise.all([value ? value.value : defaultValue(), value !== undefined]);
|
|
37
58
|
}).then(([value, exists]) => {
|
|
38
59
|
return Promise.all([value, exists || events.miss(value)]);
|
|
39
60
|
}).then(([value]) => value);
|
|
@@ -41,7 +62,10 @@ function createBrowserLocalStorageCache(options) {
|
|
|
41
62
|
set(key, value) {
|
|
42
63
|
return Promise.resolve().then(() => {
|
|
43
64
|
const namespace = getNamespace();
|
|
44
|
-
namespace[JSON.stringify(key)] =
|
|
65
|
+
namespace[JSON.stringify(key)] = {
|
|
66
|
+
timestamp: new Date().getTime(),
|
|
67
|
+
value
|
|
68
|
+
};
|
|
45
69
|
getStorage().setItem(namespaceKey, JSON.stringify(namespace));
|
|
46
70
|
return value;
|
|
47
71
|
});
|
|
@@ -171,6 +195,20 @@ function createStatefulHost(host, status = 'up') {
|
|
|
171
195
|
};
|
|
172
196
|
}
|
|
173
197
|
|
|
198
|
+
function _toPrimitive(t, r) {
|
|
199
|
+
if ("object" != typeof t || !t) return t;
|
|
200
|
+
var e = t[Symbol.toPrimitive];
|
|
201
|
+
if (void 0 !== e) {
|
|
202
|
+
var i = e.call(t, r || "default");
|
|
203
|
+
if ("object" != typeof i) return i;
|
|
204
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
205
|
+
}
|
|
206
|
+
return ("string" === r ? String : Number)(t);
|
|
207
|
+
}
|
|
208
|
+
function _toPropertyKey(t) {
|
|
209
|
+
var i = _toPrimitive(t, "string");
|
|
210
|
+
return "symbol" == typeof i ? i : i + "";
|
|
211
|
+
}
|
|
174
212
|
function _defineProperty(obj, key, value) {
|
|
175
213
|
key = _toPropertyKey(key);
|
|
176
214
|
if (key in obj) {
|
|
@@ -185,20 +223,6 @@ function _defineProperty(obj, key, value) {
|
|
|
185
223
|
}
|
|
186
224
|
return obj;
|
|
187
225
|
}
|
|
188
|
-
function _toPrimitive(input, hint) {
|
|
189
|
-
if (typeof input !== "object" || input === null) return input;
|
|
190
|
-
var prim = input[Symbol.toPrimitive];
|
|
191
|
-
if (prim !== undefined) {
|
|
192
|
-
var res = prim.call(input, hint || "default");
|
|
193
|
-
if (typeof res !== "object") return res;
|
|
194
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
195
|
-
}
|
|
196
|
-
return (hint === "string" ? String : Number)(input);
|
|
197
|
-
}
|
|
198
|
-
function _toPropertyKey(arg) {
|
|
199
|
-
var key = _toPrimitive(arg, "string");
|
|
200
|
-
return typeof key === "symbol" ? key : String(key);
|
|
201
|
-
}
|
|
202
226
|
|
|
203
227
|
class AlgoliaError extends Error {
|
|
204
228
|
constructor(message, name) {
|
|
@@ -219,7 +243,7 @@ class ErrorWithStackTrace extends AlgoliaError {
|
|
|
219
243
|
}
|
|
220
244
|
class RetryError extends ErrorWithStackTrace {
|
|
221
245
|
constructor(stackTrace) {
|
|
222
|
-
super('Unreachable hosts - your application id may be incorrect. If the error persists,
|
|
246
|
+
super('Unreachable hosts - your application id may be incorrect. If the error persists, please create a ticket at https://support.algolia.com/ sharing steps we can use to reproduce the issue.', stackTrace, 'RetryError');
|
|
223
247
|
}
|
|
224
248
|
}
|
|
225
249
|
class ApiError extends ErrorWithStackTrace {
|
|
@@ -246,7 +270,7 @@ class DetailedApiError extends ApiError {
|
|
|
246
270
|
}
|
|
247
271
|
function serializeUrl(host, path, queryParameters) {
|
|
248
272
|
const queryParametersAsString = serializeQueryParameters(queryParameters);
|
|
249
|
-
let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.
|
|
273
|
+
let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;
|
|
250
274
|
if (queryParametersAsString.length) {
|
|
251
275
|
url += `?${queryParametersAsString}`;
|
|
252
276
|
}
|
|
@@ -254,7 +278,7 @@ function serializeUrl(host, path, queryParameters) {
|
|
|
254
278
|
}
|
|
255
279
|
function serializeQueryParameters(parameters) {
|
|
256
280
|
const isObjectOrArray = value => Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]';
|
|
257
|
-
return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key])}`).join('&');
|
|
281
|
+
return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]).replaceAll('+', '%20')}`).join('&');
|
|
258
282
|
}
|
|
259
283
|
function serializeData(request, requestOptions) {
|
|
260
284
|
if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {
|
|
@@ -368,16 +392,16 @@ function createTransporter({
|
|
|
368
392
|
return {
|
|
369
393
|
hosts: compatibleHostsAvailable,
|
|
370
394
|
getTimeout(timeoutsCount, baseTimeout) {
|
|
371
|
-
/**
|
|
372
|
-
* Imagine that you have 4 hosts, if timeouts will increase
|
|
373
|
-
* on the following way: 1 (timed out) > 4 (timed out) > 5 (200).
|
|
374
|
-
*
|
|
375
|
-
* Note that, the very next request, we start from the previous timeout.
|
|
376
|
-
*
|
|
377
|
-
* 5 (timed out) > 6 (timed out) > 7 ...
|
|
378
|
-
*
|
|
379
|
-
* This strategy may need to be reviewed, but is the strategy on the our
|
|
380
|
-
* current v3 version.
|
|
395
|
+
/**
|
|
396
|
+
* Imagine that you have 4 hosts, if timeouts will increase
|
|
397
|
+
* on the following way: 1 (timed out) > 4 (timed out) > 5 (200).
|
|
398
|
+
*
|
|
399
|
+
* Note that, the very next request, we start from the previous timeout.
|
|
400
|
+
*
|
|
401
|
+
* 5 (timed out) > 6 (timed out) > 7 ...
|
|
402
|
+
*
|
|
403
|
+
* This strategy may need to be reviewed, but is the strategy on the our
|
|
404
|
+
* current v3 version.
|
|
381
405
|
*/
|
|
382
406
|
const timeoutMultiplier = hostsTimedOut.length === 0 && timeoutsCount === 0 ? 1 : hostsTimedOut.length + 3 + timeoutsCount;
|
|
383
407
|
return timeoutMultiplier * baseTimeout;
|
|
@@ -386,8 +410,8 @@ function createTransporter({
|
|
|
386
410
|
}
|
|
387
411
|
async function retryableRequest(request, requestOptions, isRead = true) {
|
|
388
412
|
const stackTrace = [];
|
|
389
|
-
/**
|
|
390
|
-
* First we prepare the payload that do not depend from hosts.
|
|
413
|
+
/**
|
|
414
|
+
* First we prepare the payload that do not depend from hosts.
|
|
391
415
|
*/
|
|
392
416
|
const data = serializeData(request, requestOptions);
|
|
393
417
|
const headers = serializeHeaders(baseHeaders, request.headers, requestOptions.headers);
|
|
@@ -418,29 +442,26 @@ function createTransporter({
|
|
|
418
442
|
}
|
|
419
443
|
let timeoutsCount = 0;
|
|
420
444
|
const retry = async (retryableHosts, getTimeout) => {
|
|
421
|
-
/**
|
|
422
|
-
* We iterate on each host, until there is no host left.
|
|
445
|
+
/**
|
|
446
|
+
* We iterate on each host, until there is no host left.
|
|
423
447
|
*/
|
|
424
448
|
const host = retryableHosts.pop();
|
|
425
449
|
if (host === undefined) {
|
|
426
450
|
throw new RetryError(stackTraceWithoutCredentials(stackTrace));
|
|
427
451
|
}
|
|
428
|
-
let responseTimeout = requestOptions.
|
|
429
|
-
if (responseTimeout === undefined) {
|
|
430
|
-
responseTimeout = isRead ? timeouts.read : timeouts.write;
|
|
431
|
-
}
|
|
452
|
+
let responseTimeout = isRead ? requestOptions.timeouts?.read || timeouts.read : requestOptions.timeouts?.write || timeouts.write;
|
|
432
453
|
const payload = {
|
|
433
454
|
data,
|
|
434
455
|
headers,
|
|
435
456
|
method: request.method,
|
|
436
457
|
url: serializeUrl(host, request.path, queryParameters),
|
|
437
|
-
connectTimeout: getTimeout(timeoutsCount, timeouts.connect),
|
|
458
|
+
connectTimeout: getTimeout(timeoutsCount, requestOptions.timeouts?.connect || timeouts.connect),
|
|
438
459
|
responseTimeout: getTimeout(timeoutsCount, responseTimeout)
|
|
439
460
|
};
|
|
440
|
-
/**
|
|
441
|
-
* The stackFrame is pushed to the stackTrace so we
|
|
442
|
-
* can have information about onRetry and onFailure
|
|
443
|
-
* decisions.
|
|
461
|
+
/**
|
|
462
|
+
* The stackFrame is pushed to the stackTrace so we
|
|
463
|
+
* can have information about onRetry and onFailure
|
|
464
|
+
* decisions.
|
|
444
465
|
*/
|
|
445
466
|
const pushToStackTrace = response => {
|
|
446
467
|
const stackFrame = {
|
|
@@ -459,17 +480,17 @@ function createTransporter({
|
|
|
459
480
|
if (response.isTimedOut) {
|
|
460
481
|
timeoutsCount++;
|
|
461
482
|
}
|
|
462
|
-
/**
|
|
463
|
-
* Failures are individually sent to the logger, allowing
|
|
464
|
-
* the end user to debug / store stack frames even
|
|
465
|
-
* when a retry error does not happen.
|
|
483
|
+
/**
|
|
484
|
+
* Failures are individually sent to the logger, allowing
|
|
485
|
+
* the end user to debug / store stack frames even
|
|
486
|
+
* when a retry error does not happen.
|
|
466
487
|
*/
|
|
467
488
|
// eslint-disable-next-line no-console -- this will be fixed by exposing a `logger` to the transporter
|
|
468
489
|
console.log('Retryable failure', stackFrameWithoutCredentials(stackFrame));
|
|
469
|
-
/**
|
|
470
|
-
* We also store the state of the host in failure cases. If the host, is
|
|
471
|
-
* down it will remain down for the next 2 minutes. In a timeout situation,
|
|
472
|
-
* this host will be added end of the list of hosts on the next request.
|
|
490
|
+
/**
|
|
491
|
+
* We also store the state of the host in failure cases. If the host, is
|
|
492
|
+
* down it will remain down for the next 2 minutes. In a timeout situation,
|
|
493
|
+
* this host will be added end of the list of hosts on the next request.
|
|
473
494
|
*/
|
|
474
495
|
await hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? 'timed out' : 'down'));
|
|
475
496
|
return retry(retryableHosts, getTimeout);
|
|
@@ -480,56 +501,56 @@ function createTransporter({
|
|
|
480
501
|
pushToStackTrace(response);
|
|
481
502
|
throw deserializeFailure(response, stackTrace);
|
|
482
503
|
};
|
|
483
|
-
/**
|
|
484
|
-
* Finally, for each retryable host perform request until we got a non
|
|
485
|
-
* retryable response. Some notes here:
|
|
486
|
-
*
|
|
487
|
-
* 1. The reverse here is applied so we can apply a `pop` later on => more performant.
|
|
488
|
-
* 2. We also get from the retryable options a timeout multiplier that is tailored
|
|
489
|
-
* for the current context.
|
|
504
|
+
/**
|
|
505
|
+
* Finally, for each retryable host perform request until we got a non
|
|
506
|
+
* retryable response. Some notes here:
|
|
507
|
+
*
|
|
508
|
+
* 1. The reverse here is applied so we can apply a `pop` later on => more performant.
|
|
509
|
+
* 2. We also get from the retryable options a timeout multiplier that is tailored
|
|
510
|
+
* for the current context.
|
|
490
511
|
*/
|
|
491
512
|
const compatibleHosts = hosts.filter(host => host.accept === 'readWrite' || (isRead ? host.accept === 'read' : host.accept === 'write'));
|
|
492
513
|
const options = await createRetryableOptions(compatibleHosts);
|
|
493
514
|
return retry([...options.hosts].reverse(), options.getTimeout);
|
|
494
515
|
}
|
|
495
516
|
function createRequest(request, requestOptions = {}) {
|
|
496
|
-
/**
|
|
497
|
-
* A read request is either a `GET` request, or a request that we make
|
|
498
|
-
* via the `read` transporter (e.g. `search`).
|
|
517
|
+
/**
|
|
518
|
+
* A read request is either a `GET` request, or a request that we make
|
|
519
|
+
* via the `read` transporter (e.g. `search`).
|
|
499
520
|
*/
|
|
500
521
|
const isRead = request.useReadTransporter || request.method === 'GET';
|
|
501
522
|
if (!isRead) {
|
|
502
|
-
/**
|
|
503
|
-
* On write requests, no cache mechanisms are applied, and we
|
|
504
|
-
* proxy the request immediately to the requester.
|
|
523
|
+
/**
|
|
524
|
+
* On write requests, no cache mechanisms are applied, and we
|
|
525
|
+
* proxy the request immediately to the requester.
|
|
505
526
|
*/
|
|
506
527
|
return retryableRequest(request, requestOptions, isRead);
|
|
507
528
|
}
|
|
508
529
|
const createRetryableRequest = () => {
|
|
509
|
-
/**
|
|
510
|
-
* Then, we prepare a function factory that contains the construction of
|
|
511
|
-
* the retryable request. At this point, we may *not* perform the actual
|
|
512
|
-
* request. But we want to have the function factory ready.
|
|
530
|
+
/**
|
|
531
|
+
* Then, we prepare a function factory that contains the construction of
|
|
532
|
+
* the retryable request. At this point, we may *not* perform the actual
|
|
533
|
+
* request. But we want to have the function factory ready.
|
|
513
534
|
*/
|
|
514
535
|
return retryableRequest(request, requestOptions);
|
|
515
536
|
};
|
|
516
|
-
/**
|
|
517
|
-
* Once we have the function factory ready, we need to determine of the
|
|
518
|
-
* request is "cacheable" - should be cached. Note that, once again,
|
|
519
|
-
* the user can force this option.
|
|
537
|
+
/**
|
|
538
|
+
* Once we have the function factory ready, we need to determine of the
|
|
539
|
+
* request is "cacheable" - should be cached. Note that, once again,
|
|
540
|
+
* the user can force this option.
|
|
520
541
|
*/
|
|
521
542
|
const cacheable = requestOptions.cacheable || request.cacheable;
|
|
522
|
-
/**
|
|
523
|
-
* If is not "cacheable", we immediately trigger the retryable request, no
|
|
524
|
-
* need to check cache implementations.
|
|
543
|
+
/**
|
|
544
|
+
* If is not "cacheable", we immediately trigger the retryable request, no
|
|
545
|
+
* need to check cache implementations.
|
|
525
546
|
*/
|
|
526
547
|
if (cacheable !== true) {
|
|
527
548
|
return createRetryableRequest();
|
|
528
549
|
}
|
|
529
|
-
/**
|
|
530
|
-
* If the request is "cacheable", we need to first compute the key to ask
|
|
531
|
-
* the cache implementations if this request is on progress or if the
|
|
532
|
-
* response already exists on the cache.
|
|
550
|
+
/**
|
|
551
|
+
* If the request is "cacheable", we need to first compute the key to ask
|
|
552
|
+
* the cache implementations if this request is on progress or if the
|
|
553
|
+
* response already exists on the cache.
|
|
533
554
|
*/
|
|
534
555
|
const key = {
|
|
535
556
|
request,
|
|
@@ -539,27 +560,27 @@ function createTransporter({
|
|
|
539
560
|
headers: baseHeaders
|
|
540
561
|
}
|
|
541
562
|
};
|
|
542
|
-
/**
|
|
543
|
-
* With the computed key, we first ask the responses cache
|
|
544
|
-
* implementation if this request was been resolved before.
|
|
563
|
+
/**
|
|
564
|
+
* With the computed key, we first ask the responses cache
|
|
565
|
+
* implementation if this request was been resolved before.
|
|
545
566
|
*/
|
|
546
567
|
return responsesCache.get(key, () => {
|
|
547
|
-
/**
|
|
548
|
-
* If the request has never resolved before, we actually ask if there
|
|
549
|
-
* is a current request with the same key on progress.
|
|
568
|
+
/**
|
|
569
|
+
* If the request has never resolved before, we actually ask if there
|
|
570
|
+
* is a current request with the same key on progress.
|
|
550
571
|
*/
|
|
551
572
|
return requestsCache.get(key, () =>
|
|
552
|
-
/**
|
|
553
|
-
* Finally, if there is no request in progress with the same key,
|
|
554
|
-
* this `createRetryableRequest()` will actually trigger the
|
|
555
|
-
* retryable request.
|
|
573
|
+
/**
|
|
574
|
+
* Finally, if there is no request in progress with the same key,
|
|
575
|
+
* this `createRetryableRequest()` will actually trigger the
|
|
576
|
+
* retryable request.
|
|
556
577
|
*/
|
|
557
578
|
requestsCache.set(key, createRetryableRequest()).then(response => Promise.all([requestsCache.delete(key), response]), err => Promise.all([requestsCache.delete(key), Promise.reject(err)])).then(([_, response]) => response));
|
|
558
579
|
}, {
|
|
559
|
-
/**
|
|
560
|
-
* Of course, once we get this response back from the server, we
|
|
561
|
-
* tell response cache to actually store the received response
|
|
562
|
-
* to be used later.
|
|
580
|
+
/**
|
|
581
|
+
* Of course, once we get this response back from the server, we
|
|
582
|
+
* tell response cache to actually store the received response
|
|
583
|
+
* to be used later.
|
|
563
584
|
*/
|
|
564
585
|
miss: response => responsesCache.set(key, response)
|
|
565
586
|
});
|
|
@@ -609,884 +630,1382 @@ const DEFAULT_CONNECT_TIMEOUT_BROWSER = 1000;
|
|
|
609
630
|
const DEFAULT_READ_TIMEOUT_BROWSER = 2000;
|
|
610
631
|
const DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;
|
|
611
632
|
|
|
612
|
-
function createXhrRequester() {
|
|
613
|
-
function send(request) {
|
|
614
|
-
return new Promise((resolve) => {
|
|
615
|
-
const baseRequester = new XMLHttpRequest();
|
|
616
|
-
baseRequester.open(request.method, request.url, true);
|
|
617
|
-
Object.keys(request.headers).forEach((key) => baseRequester.setRequestHeader(key, request.headers[key]));
|
|
618
|
-
const createTimeout = (timeout, content) => {
|
|
619
|
-
return setTimeout(() => {
|
|
620
|
-
baseRequester.abort();
|
|
621
|
-
resolve({
|
|
622
|
-
status: 0,
|
|
623
|
-
content,
|
|
624
|
-
isTimedOut: true,
|
|
625
|
-
});
|
|
626
|
-
}, timeout);
|
|
627
|
-
};
|
|
628
|
-
const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');
|
|
629
|
-
let responseTimeout;
|
|
630
|
-
baseRequester.onreadystatechange = () => {
|
|
631
|
-
if (baseRequester.readyState > baseRequester.OPENED &&
|
|
632
|
-
responseTimeout === undefined) {
|
|
633
|
-
clearTimeout(connectTimeout);
|
|
634
|
-
responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');
|
|
635
|
-
}
|
|
636
|
-
};
|
|
637
|
-
baseRequester.onerror = () => {
|
|
638
|
-
// istanbul ignore next
|
|
639
|
-
if (baseRequester.status === 0) {
|
|
640
|
-
clearTimeout(connectTimeout);
|
|
641
|
-
clearTimeout(responseTimeout);
|
|
642
|
-
resolve({
|
|
643
|
-
content: baseRequester.responseText || 'Network request failed',
|
|
644
|
-
status: baseRequester.status,
|
|
645
|
-
isTimedOut: false,
|
|
646
|
-
});
|
|
647
|
-
}
|
|
648
|
-
};
|
|
649
|
-
baseRequester.onload = () => {
|
|
650
|
-
clearTimeout(connectTimeout);
|
|
651
|
-
clearTimeout(responseTimeout);
|
|
652
|
-
resolve({
|
|
653
|
-
content: baseRequester.responseText,
|
|
654
|
-
status: baseRequester.status,
|
|
655
|
-
isTimedOut: false,
|
|
656
|
-
});
|
|
657
|
-
};
|
|
658
|
-
baseRequester.send(request.data);
|
|
659
|
-
});
|
|
660
|
-
}
|
|
661
|
-
return { send };
|
|
633
|
+
function createXhrRequester() {
|
|
634
|
+
function send(request) {
|
|
635
|
+
return new Promise((resolve) => {
|
|
636
|
+
const baseRequester = new XMLHttpRequest();
|
|
637
|
+
baseRequester.open(request.method, request.url, true);
|
|
638
|
+
Object.keys(request.headers).forEach((key) => baseRequester.setRequestHeader(key, request.headers[key]));
|
|
639
|
+
const createTimeout = (timeout, content) => {
|
|
640
|
+
return setTimeout(() => {
|
|
641
|
+
baseRequester.abort();
|
|
642
|
+
resolve({
|
|
643
|
+
status: 0,
|
|
644
|
+
content,
|
|
645
|
+
isTimedOut: true,
|
|
646
|
+
});
|
|
647
|
+
}, timeout);
|
|
648
|
+
};
|
|
649
|
+
const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');
|
|
650
|
+
let responseTimeout;
|
|
651
|
+
baseRequester.onreadystatechange = () => {
|
|
652
|
+
if (baseRequester.readyState > baseRequester.OPENED &&
|
|
653
|
+
responseTimeout === undefined) {
|
|
654
|
+
clearTimeout(connectTimeout);
|
|
655
|
+
responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
baseRequester.onerror = () => {
|
|
659
|
+
// istanbul ignore next
|
|
660
|
+
if (baseRequester.status === 0) {
|
|
661
|
+
clearTimeout(connectTimeout);
|
|
662
|
+
clearTimeout(responseTimeout);
|
|
663
|
+
resolve({
|
|
664
|
+
content: baseRequester.responseText || 'Network request failed',
|
|
665
|
+
status: baseRequester.status,
|
|
666
|
+
isTimedOut: false,
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
baseRequester.onload = () => {
|
|
671
|
+
clearTimeout(connectTimeout);
|
|
672
|
+
clearTimeout(responseTimeout);
|
|
673
|
+
resolve({
|
|
674
|
+
content: baseRequester.responseText,
|
|
675
|
+
status: baseRequester.status,
|
|
676
|
+
isTimedOut: false,
|
|
677
|
+
});
|
|
678
|
+
};
|
|
679
|
+
baseRequester.send(request.data);
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
return { send };
|
|
662
683
|
}
|
|
663
684
|
|
|
664
|
-
//
|
|
665
|
-
const apiClientVersion = '1.0.0-
|
|
666
|
-
const REGIONS = ['us'];
|
|
667
|
-
function getDefaultHosts(region) {
|
|
668
|
-
const url = 'data.{region}.algolia.com'.replace('{region}', region);
|
|
669
|
-
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
/**
|
|
726
|
-
*
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
*
|
|
751
|
-
*
|
|
752
|
-
*
|
|
753
|
-
*
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
}
|
|
811
|
-
const
|
|
812
|
-
const
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
*
|
|
825
|
-
*
|
|
826
|
-
*
|
|
827
|
-
*
|
|
828
|
-
*
|
|
829
|
-
* @param
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
}
|
|
881
|
-
const
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
*
|
|
894
|
-
*
|
|
895
|
-
* @
|
|
896
|
-
* @param
|
|
897
|
-
* @param
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
}
|
|
904
|
-
const
|
|
905
|
-
const
|
|
906
|
-
const
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
*
|
|
917
|
-
*
|
|
918
|
-
* @
|
|
919
|
-
* @param
|
|
920
|
-
* @param
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
}
|
|
927
|
-
const
|
|
928
|
-
const
|
|
929
|
-
const
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
*
|
|
940
|
-
*
|
|
941
|
-
* @
|
|
942
|
-
* @param
|
|
943
|
-
* @param
|
|
944
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
945
|
-
*/
|
|
946
|
-
|
|
947
|
-
if (!
|
|
948
|
-
throw new Error('Parameter `
|
|
949
|
-
}
|
|
950
|
-
const requestPath = '/
|
|
951
|
-
const headers = {};
|
|
952
|
-
const queryParameters = {};
|
|
953
|
-
const request = {
|
|
954
|
-
method: '
|
|
955
|
-
path: requestPath,
|
|
956
|
-
queryParameters,
|
|
957
|
-
headers,
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
*
|
|
964
|
-
*
|
|
965
|
-
* @param
|
|
966
|
-
* @param
|
|
967
|
-
* @param
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
const
|
|
976
|
-
const
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
*
|
|
989
|
-
*
|
|
990
|
-
*
|
|
991
|
-
*
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
if (
|
|
1001
|
-
|
|
1002
|
-
}
|
|
1003
|
-
const
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
*
|
|
1016
|
-
*
|
|
1017
|
-
*
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
};
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
};
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
const headers = {};
|
|
1081
|
-
const queryParameters = {};
|
|
1082
|
-
const request = {
|
|
1083
|
-
method: '
|
|
1084
|
-
path: requestPath,
|
|
1085
|
-
queryParameters,
|
|
1086
|
-
headers,
|
|
1087
|
-
};
|
|
1088
|
-
return transporter.request(request, requestOptions);
|
|
1089
|
-
},
|
|
1090
|
-
/**
|
|
1091
|
-
*
|
|
1092
|
-
*
|
|
1093
|
-
*
|
|
1094
|
-
*
|
|
1095
|
-
*
|
|
1096
|
-
*
|
|
1097
|
-
*
|
|
1098
|
-
* @param
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
*
|
|
1123
|
-
*
|
|
1124
|
-
*
|
|
1125
|
-
* @param
|
|
1126
|
-
* @param
|
|
1127
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1128
|
-
*/
|
|
1129
|
-
|
|
1130
|
-
if (!
|
|
1131
|
-
throw new Error('Parameter `
|
|
1132
|
-
}
|
|
1133
|
-
const requestPath = '/1/
|
|
1134
|
-
const headers = {};
|
|
1135
|
-
const queryParameters = {};
|
|
1136
|
-
const request = {
|
|
1137
|
-
method: '
|
|
1138
|
-
path: requestPath,
|
|
1139
|
-
queryParameters,
|
|
1140
|
-
headers,
|
|
1141
|
-
};
|
|
1142
|
-
return transporter.request(request, requestOptions);
|
|
1143
|
-
},
|
|
1144
|
-
/**
|
|
1145
|
-
*
|
|
1146
|
-
*
|
|
1147
|
-
*
|
|
1148
|
-
*
|
|
1149
|
-
*
|
|
1150
|
-
*
|
|
1151
|
-
*
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
if (
|
|
1158
|
-
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
}
|
|
1163
|
-
const request = {
|
|
1164
|
-
method: 'GET',
|
|
1165
|
-
path: requestPath,
|
|
1166
|
-
queryParameters,
|
|
1167
|
-
headers,
|
|
1168
|
-
};
|
|
1169
|
-
return transporter.request(request, requestOptions);
|
|
1170
|
-
},
|
|
1171
|
-
/**
|
|
1172
|
-
*
|
|
1173
|
-
*
|
|
1174
|
-
*
|
|
1175
|
-
*
|
|
1176
|
-
*
|
|
1177
|
-
*
|
|
1178
|
-
*
|
|
1179
|
-
* @param
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
*
|
|
1227
|
-
*
|
|
1228
|
-
* @
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
const
|
|
1236
|
-
const
|
|
1237
|
-
const
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
*
|
|
1254
|
-
*
|
|
1255
|
-
* @
|
|
1256
|
-
* @param
|
|
1257
|
-
* @param
|
|
1258
|
-
* @param
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
const
|
|
1265
|
-
const
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
queryParameters
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
}
|
|
1310
|
-
const
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
*
|
|
1321
|
-
*
|
|
1322
|
-
*
|
|
1323
|
-
*
|
|
1324
|
-
*
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
*
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
if (
|
|
1380
|
-
|
|
1381
|
-
}
|
|
1382
|
-
if (
|
|
1383
|
-
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
685
|
+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
686
|
+
const apiClientVersion = '1.0.0-beta.2';
|
|
687
|
+
const REGIONS = ['eu', 'us'];
|
|
688
|
+
function getDefaultHosts(region) {
|
|
689
|
+
const url = 'data.{region}.algolia.com'.replace('{region}', region);
|
|
690
|
+
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Guard: Return strongly typed specific OnDemandTrigger for a given Trigger.
|
|
694
|
+
*
|
|
695
|
+
* @summary Guard method that returns a strongly typed specific OnDemandTrigger for a given Trigger.
|
|
696
|
+
* @param trigger - The given Task Trigger.
|
|
697
|
+
*/
|
|
698
|
+
function isOnDemandTrigger(trigger) {
|
|
699
|
+
return trigger.type === 'onDemand';
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Guard: Return strongly typed specific ScheduleTrigger for a given Trigger.
|
|
703
|
+
*
|
|
704
|
+
* @summary Guard method that returns a strongly typed specific ScheduleTrigger for a given Trigger.
|
|
705
|
+
* @param trigger - The given Task Trigger.
|
|
706
|
+
*/
|
|
707
|
+
function isScheduleTrigger(trigger) {
|
|
708
|
+
return trigger.type === 'schedule';
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* Guard: Return strongly typed specific SubscriptionTrigger for a given Trigger.
|
|
712
|
+
*
|
|
713
|
+
* @summary Guard method that returns a strongly typed specific SubscriptionTrigger for a given Trigger.
|
|
714
|
+
* @param trigger - The given Task Trigger.
|
|
715
|
+
*/
|
|
716
|
+
function isSubscriptionTrigger(trigger) {
|
|
717
|
+
return trigger.type === 'subscription';
|
|
718
|
+
}
|
|
719
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
720
|
+
function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
|
|
721
|
+
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
|
722
|
+
const transporter = createTransporter({
|
|
723
|
+
hosts: getDefaultHosts(regionOption),
|
|
724
|
+
...options,
|
|
725
|
+
algoliaAgent: getAlgoliaAgent({
|
|
726
|
+
algoliaAgents,
|
|
727
|
+
client: 'Ingestion',
|
|
728
|
+
version: apiClientVersion,
|
|
729
|
+
}),
|
|
730
|
+
baseHeaders: {
|
|
731
|
+
'content-type': 'text/plain',
|
|
732
|
+
...auth.headers(),
|
|
733
|
+
...options.baseHeaders,
|
|
734
|
+
},
|
|
735
|
+
baseQueryParameters: {
|
|
736
|
+
...auth.queryParameters(),
|
|
737
|
+
...options.baseQueryParameters,
|
|
738
|
+
},
|
|
739
|
+
});
|
|
740
|
+
return {
|
|
741
|
+
transporter,
|
|
742
|
+
/**
|
|
743
|
+
* The `appId` currently in use.
|
|
744
|
+
*/
|
|
745
|
+
appId: appIdOption,
|
|
746
|
+
/**
|
|
747
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
748
|
+
*/
|
|
749
|
+
clearCache() {
|
|
750
|
+
return Promise.all([
|
|
751
|
+
transporter.requestsCache.clear(),
|
|
752
|
+
transporter.responsesCache.clear(),
|
|
753
|
+
]).then(() => undefined);
|
|
754
|
+
},
|
|
755
|
+
/**
|
|
756
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
757
|
+
*/
|
|
758
|
+
get _ua() {
|
|
759
|
+
return transporter.algoliaAgent.value;
|
|
760
|
+
},
|
|
761
|
+
/**
|
|
762
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
763
|
+
*
|
|
764
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
765
|
+
* @param version - The version of the agent.
|
|
766
|
+
*/
|
|
767
|
+
addAlgoliaAgent(segment, version) {
|
|
768
|
+
transporter.algoliaAgent.add({ segment, version });
|
|
769
|
+
},
|
|
770
|
+
/**
|
|
771
|
+
* Creates a new authentication resource.
|
|
772
|
+
*
|
|
773
|
+
* Required API Key ACLs:
|
|
774
|
+
* - addObject
|
|
775
|
+
* - deleteIndex
|
|
776
|
+
* - editSettings.
|
|
777
|
+
*
|
|
778
|
+
* @param authenticationCreate -.
|
|
779
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
780
|
+
*/
|
|
781
|
+
createAuthentication(authenticationCreate, requestOptions) {
|
|
782
|
+
if (!authenticationCreate) {
|
|
783
|
+
throw new Error('Parameter `authenticationCreate` is required when calling `createAuthentication`.');
|
|
784
|
+
}
|
|
785
|
+
if (!authenticationCreate.type) {
|
|
786
|
+
throw new Error('Parameter `authenticationCreate.type` is required when calling `createAuthentication`.');
|
|
787
|
+
}
|
|
788
|
+
if (!authenticationCreate.name) {
|
|
789
|
+
throw new Error('Parameter `authenticationCreate.name` is required when calling `createAuthentication`.');
|
|
790
|
+
}
|
|
791
|
+
if (!authenticationCreate.input) {
|
|
792
|
+
throw new Error('Parameter `authenticationCreate.input` is required when calling `createAuthentication`.');
|
|
793
|
+
}
|
|
794
|
+
const requestPath = '/1/authentications';
|
|
795
|
+
const headers = {};
|
|
796
|
+
const queryParameters = {};
|
|
797
|
+
const request = {
|
|
798
|
+
method: 'POST',
|
|
799
|
+
path: requestPath,
|
|
800
|
+
queryParameters,
|
|
801
|
+
headers,
|
|
802
|
+
data: authenticationCreate,
|
|
803
|
+
};
|
|
804
|
+
return transporter.request(request, requestOptions);
|
|
805
|
+
},
|
|
806
|
+
/**
|
|
807
|
+
* Creates a new destination.
|
|
808
|
+
*
|
|
809
|
+
* Required API Key ACLs:
|
|
810
|
+
* - addObject
|
|
811
|
+
* - deleteIndex
|
|
812
|
+
* - editSettings.
|
|
813
|
+
*
|
|
814
|
+
* @param destinationCreate -.
|
|
815
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
816
|
+
*/
|
|
817
|
+
createDestination(destinationCreate, requestOptions) {
|
|
818
|
+
if (!destinationCreate) {
|
|
819
|
+
throw new Error('Parameter `destinationCreate` is required when calling `createDestination`.');
|
|
820
|
+
}
|
|
821
|
+
if (!destinationCreate.type) {
|
|
822
|
+
throw new Error('Parameter `destinationCreate.type` is required when calling `createDestination`.');
|
|
823
|
+
}
|
|
824
|
+
if (!destinationCreate.name) {
|
|
825
|
+
throw new Error('Parameter `destinationCreate.name` is required when calling `createDestination`.');
|
|
826
|
+
}
|
|
827
|
+
if (!destinationCreate.input) {
|
|
828
|
+
throw new Error('Parameter `destinationCreate.input` is required when calling `createDestination`.');
|
|
829
|
+
}
|
|
830
|
+
const requestPath = '/1/destinations';
|
|
831
|
+
const headers = {};
|
|
832
|
+
const queryParameters = {};
|
|
833
|
+
const request = {
|
|
834
|
+
method: 'POST',
|
|
835
|
+
path: requestPath,
|
|
836
|
+
queryParameters,
|
|
837
|
+
headers,
|
|
838
|
+
data: destinationCreate,
|
|
839
|
+
};
|
|
840
|
+
return transporter.request(request, requestOptions);
|
|
841
|
+
},
|
|
842
|
+
/**
|
|
843
|
+
* Creates a new source.
|
|
844
|
+
*
|
|
845
|
+
* Required API Key ACLs:
|
|
846
|
+
* - addObject
|
|
847
|
+
* - deleteIndex
|
|
848
|
+
* - editSettings.
|
|
849
|
+
*
|
|
850
|
+
* @param sourceCreate -.
|
|
851
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
852
|
+
*/
|
|
853
|
+
createSource(sourceCreate, requestOptions) {
|
|
854
|
+
if (!sourceCreate) {
|
|
855
|
+
throw new Error('Parameter `sourceCreate` is required when calling `createSource`.');
|
|
856
|
+
}
|
|
857
|
+
if (!sourceCreate.type) {
|
|
858
|
+
throw new Error('Parameter `sourceCreate.type` is required when calling `createSource`.');
|
|
859
|
+
}
|
|
860
|
+
if (!sourceCreate.name) {
|
|
861
|
+
throw new Error('Parameter `sourceCreate.name` is required when calling `createSource`.');
|
|
862
|
+
}
|
|
863
|
+
if (!sourceCreate.input) {
|
|
864
|
+
throw new Error('Parameter `sourceCreate.input` is required when calling `createSource`.');
|
|
865
|
+
}
|
|
866
|
+
const requestPath = '/1/sources';
|
|
867
|
+
const headers = {};
|
|
868
|
+
const queryParameters = {};
|
|
869
|
+
const request = {
|
|
870
|
+
method: 'POST',
|
|
871
|
+
path: requestPath,
|
|
872
|
+
queryParameters,
|
|
873
|
+
headers,
|
|
874
|
+
data: sourceCreate,
|
|
875
|
+
};
|
|
876
|
+
return transporter.request(request, requestOptions);
|
|
877
|
+
},
|
|
878
|
+
/**
|
|
879
|
+
* Creates a new task.
|
|
880
|
+
*
|
|
881
|
+
* @param taskCreate - Request body for creating a task.
|
|
882
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
883
|
+
*/
|
|
884
|
+
createTask(taskCreate, requestOptions) {
|
|
885
|
+
if (!taskCreate) {
|
|
886
|
+
throw new Error('Parameter `taskCreate` is required when calling `createTask`.');
|
|
887
|
+
}
|
|
888
|
+
if (!taskCreate.sourceID) {
|
|
889
|
+
throw new Error('Parameter `taskCreate.sourceID` is required when calling `createTask`.');
|
|
890
|
+
}
|
|
891
|
+
if (!taskCreate.destinationID) {
|
|
892
|
+
throw new Error('Parameter `taskCreate.destinationID` is required when calling `createTask`.');
|
|
893
|
+
}
|
|
894
|
+
if (!taskCreate.trigger) {
|
|
895
|
+
throw new Error('Parameter `taskCreate.trigger` is required when calling `createTask`.');
|
|
896
|
+
}
|
|
897
|
+
if (!taskCreate.action) {
|
|
898
|
+
throw new Error('Parameter `taskCreate.action` is required when calling `createTask`.');
|
|
899
|
+
}
|
|
900
|
+
const requestPath = '/1/tasks';
|
|
901
|
+
const headers = {};
|
|
902
|
+
const queryParameters = {};
|
|
903
|
+
const request = {
|
|
904
|
+
method: 'POST',
|
|
905
|
+
path: requestPath,
|
|
906
|
+
queryParameters,
|
|
907
|
+
headers,
|
|
908
|
+
data: taskCreate,
|
|
909
|
+
};
|
|
910
|
+
return transporter.request(request, requestOptions);
|
|
911
|
+
},
|
|
912
|
+
/**
|
|
913
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
914
|
+
*
|
|
915
|
+
* @param customDelete - The customDelete object.
|
|
916
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
917
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
918
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
919
|
+
*/
|
|
920
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
921
|
+
if (!path) {
|
|
922
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
923
|
+
}
|
|
924
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
925
|
+
const headers = {};
|
|
926
|
+
const queryParameters = parameters ? parameters : {};
|
|
927
|
+
const request = {
|
|
928
|
+
method: 'DELETE',
|
|
929
|
+
path: requestPath,
|
|
930
|
+
queryParameters,
|
|
931
|
+
headers,
|
|
932
|
+
};
|
|
933
|
+
return transporter.request(request, requestOptions);
|
|
934
|
+
},
|
|
935
|
+
/**
|
|
936
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
937
|
+
*
|
|
938
|
+
* @param customGet - The customGet object.
|
|
939
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
940
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
941
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
942
|
+
*/
|
|
943
|
+
customGet({ path, parameters }, requestOptions) {
|
|
944
|
+
if (!path) {
|
|
945
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
946
|
+
}
|
|
947
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
948
|
+
const headers = {};
|
|
949
|
+
const queryParameters = parameters ? parameters : {};
|
|
950
|
+
const request = {
|
|
951
|
+
method: 'GET',
|
|
952
|
+
path: requestPath,
|
|
953
|
+
queryParameters,
|
|
954
|
+
headers,
|
|
955
|
+
};
|
|
956
|
+
return transporter.request(request, requestOptions);
|
|
957
|
+
},
|
|
958
|
+
/**
|
|
959
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
960
|
+
*
|
|
961
|
+
* @param customPost - The customPost object.
|
|
962
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
963
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
964
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
965
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
966
|
+
*/
|
|
967
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
968
|
+
if (!path) {
|
|
969
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
970
|
+
}
|
|
971
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
972
|
+
const headers = {};
|
|
973
|
+
const queryParameters = parameters ? parameters : {};
|
|
974
|
+
const request = {
|
|
975
|
+
method: 'POST',
|
|
976
|
+
path: requestPath,
|
|
977
|
+
queryParameters,
|
|
978
|
+
headers,
|
|
979
|
+
data: body ? body : {},
|
|
980
|
+
};
|
|
981
|
+
return transporter.request(request, requestOptions);
|
|
982
|
+
},
|
|
983
|
+
/**
|
|
984
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
985
|
+
*
|
|
986
|
+
* @param customPut - The customPut object.
|
|
987
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
988
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
989
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
990
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
991
|
+
*/
|
|
992
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
993
|
+
if (!path) {
|
|
994
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
995
|
+
}
|
|
996
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
997
|
+
const headers = {};
|
|
998
|
+
const queryParameters = parameters ? parameters : {};
|
|
999
|
+
const request = {
|
|
1000
|
+
method: 'PUT',
|
|
1001
|
+
path: requestPath,
|
|
1002
|
+
queryParameters,
|
|
1003
|
+
headers,
|
|
1004
|
+
data: body ? body : {},
|
|
1005
|
+
};
|
|
1006
|
+
return transporter.request(request, requestOptions);
|
|
1007
|
+
},
|
|
1008
|
+
/**
|
|
1009
|
+
* Deletes an authentication resource. You can\'t delete authentication resources that are used by a source or a destination.
|
|
1010
|
+
*
|
|
1011
|
+
* Required API Key ACLs:
|
|
1012
|
+
* - addObject
|
|
1013
|
+
* - deleteIndex
|
|
1014
|
+
* - editSettings.
|
|
1015
|
+
*
|
|
1016
|
+
* @param deleteAuthentication - The deleteAuthentication object.
|
|
1017
|
+
* @param deleteAuthentication.authenticationID - Unique identifier of an authentication resource.
|
|
1018
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1019
|
+
*/
|
|
1020
|
+
deleteAuthentication({ authenticationID }, requestOptions) {
|
|
1021
|
+
if (!authenticationID) {
|
|
1022
|
+
throw new Error('Parameter `authenticationID` is required when calling `deleteAuthentication`.');
|
|
1023
|
+
}
|
|
1024
|
+
const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
|
|
1025
|
+
const headers = {};
|
|
1026
|
+
const queryParameters = {};
|
|
1027
|
+
const request = {
|
|
1028
|
+
method: 'DELETE',
|
|
1029
|
+
path: requestPath,
|
|
1030
|
+
queryParameters,
|
|
1031
|
+
headers,
|
|
1032
|
+
};
|
|
1033
|
+
return transporter.request(request, requestOptions);
|
|
1034
|
+
},
|
|
1035
|
+
/**
|
|
1036
|
+
* Deletes a destination by its ID. You can\'t delete destinations that are referenced in tasks.
|
|
1037
|
+
*
|
|
1038
|
+
* Required API Key ACLs:
|
|
1039
|
+
* - addObject
|
|
1040
|
+
* - deleteIndex
|
|
1041
|
+
* - editSettings.
|
|
1042
|
+
*
|
|
1043
|
+
* @param deleteDestination - The deleteDestination object.
|
|
1044
|
+
* @param deleteDestination.destinationID - Unique identifier of a destination.
|
|
1045
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1046
|
+
*/
|
|
1047
|
+
deleteDestination({ destinationID }, requestOptions) {
|
|
1048
|
+
if (!destinationID) {
|
|
1049
|
+
throw new Error('Parameter `destinationID` is required when calling `deleteDestination`.');
|
|
1050
|
+
}
|
|
1051
|
+
const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
|
|
1052
|
+
const headers = {};
|
|
1053
|
+
const queryParameters = {};
|
|
1054
|
+
const request = {
|
|
1055
|
+
method: 'DELETE',
|
|
1056
|
+
path: requestPath,
|
|
1057
|
+
queryParameters,
|
|
1058
|
+
headers,
|
|
1059
|
+
};
|
|
1060
|
+
return transporter.request(request, requestOptions);
|
|
1061
|
+
},
|
|
1062
|
+
/**
|
|
1063
|
+
* Deletes a source by its ID. You can\'t delete sources that are referenced in tasks.
|
|
1064
|
+
*
|
|
1065
|
+
* Required API Key ACLs:
|
|
1066
|
+
* - addObject
|
|
1067
|
+
* - deleteIndex
|
|
1068
|
+
* - editSettings.
|
|
1069
|
+
*
|
|
1070
|
+
* @param deleteSource - The deleteSource object.
|
|
1071
|
+
* @param deleteSource.sourceID - Unique identifier of a source.
|
|
1072
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1073
|
+
*/
|
|
1074
|
+
deleteSource({ sourceID }, requestOptions) {
|
|
1075
|
+
if (!sourceID) {
|
|
1076
|
+
throw new Error('Parameter `sourceID` is required when calling `deleteSource`.');
|
|
1077
|
+
}
|
|
1078
|
+
const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
|
|
1079
|
+
const headers = {};
|
|
1080
|
+
const queryParameters = {};
|
|
1081
|
+
const request = {
|
|
1082
|
+
method: 'DELETE',
|
|
1083
|
+
path: requestPath,
|
|
1084
|
+
queryParameters,
|
|
1085
|
+
headers,
|
|
1086
|
+
};
|
|
1087
|
+
return transporter.request(request, requestOptions);
|
|
1088
|
+
},
|
|
1089
|
+
/**
|
|
1090
|
+
* Deletes a task by its ID.
|
|
1091
|
+
*
|
|
1092
|
+
* @param deleteTask - The deleteTask object.
|
|
1093
|
+
* @param deleteTask.taskID - Unique identifier of a task.
|
|
1094
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1095
|
+
*/
|
|
1096
|
+
deleteTask({ taskID }, requestOptions) {
|
|
1097
|
+
if (!taskID) {
|
|
1098
|
+
throw new Error('Parameter `taskID` is required when calling `deleteTask`.');
|
|
1099
|
+
}
|
|
1100
|
+
const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1101
|
+
const headers = {};
|
|
1102
|
+
const queryParameters = {};
|
|
1103
|
+
const request = {
|
|
1104
|
+
method: 'DELETE',
|
|
1105
|
+
path: requestPath,
|
|
1106
|
+
queryParameters,
|
|
1107
|
+
headers,
|
|
1108
|
+
};
|
|
1109
|
+
return transporter.request(request, requestOptions);
|
|
1110
|
+
},
|
|
1111
|
+
/**
|
|
1112
|
+
* Disables a task.
|
|
1113
|
+
*
|
|
1114
|
+
* Required API Key ACLs:
|
|
1115
|
+
* - addObject
|
|
1116
|
+
* - deleteIndex
|
|
1117
|
+
* - editSettings.
|
|
1118
|
+
*
|
|
1119
|
+
* @param disableTask - The disableTask object.
|
|
1120
|
+
* @param disableTask.taskID - Unique identifier of a task.
|
|
1121
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1122
|
+
*/
|
|
1123
|
+
disableTask({ taskID }, requestOptions) {
|
|
1124
|
+
if (!taskID) {
|
|
1125
|
+
throw new Error('Parameter `taskID` is required when calling `disableTask`.');
|
|
1126
|
+
}
|
|
1127
|
+
const requestPath = '/1/tasks/{taskID}/disable'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1128
|
+
const headers = {};
|
|
1129
|
+
const queryParameters = {};
|
|
1130
|
+
const request = {
|
|
1131
|
+
method: 'PUT',
|
|
1132
|
+
path: requestPath,
|
|
1133
|
+
queryParameters,
|
|
1134
|
+
headers,
|
|
1135
|
+
};
|
|
1136
|
+
return transporter.request(request, requestOptions);
|
|
1137
|
+
},
|
|
1138
|
+
/**
|
|
1139
|
+
* Enables a task.
|
|
1140
|
+
*
|
|
1141
|
+
* Required API Key ACLs:
|
|
1142
|
+
* - addObject
|
|
1143
|
+
* - deleteIndex
|
|
1144
|
+
* - editSettings.
|
|
1145
|
+
*
|
|
1146
|
+
* @param enableTask - The enableTask object.
|
|
1147
|
+
* @param enableTask.taskID - Unique identifier of a task.
|
|
1148
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1149
|
+
*/
|
|
1150
|
+
enableTask({ taskID }, requestOptions) {
|
|
1151
|
+
if (!taskID) {
|
|
1152
|
+
throw new Error('Parameter `taskID` is required when calling `enableTask`.');
|
|
1153
|
+
}
|
|
1154
|
+
const requestPath = '/1/tasks/{taskID}/enable'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1155
|
+
const headers = {};
|
|
1156
|
+
const queryParameters = {};
|
|
1157
|
+
const request = {
|
|
1158
|
+
method: 'PUT',
|
|
1159
|
+
path: requestPath,
|
|
1160
|
+
queryParameters,
|
|
1161
|
+
headers,
|
|
1162
|
+
};
|
|
1163
|
+
return transporter.request(request, requestOptions);
|
|
1164
|
+
},
|
|
1165
|
+
/**
|
|
1166
|
+
* Retrieves an authentication resource by its ID.
|
|
1167
|
+
*
|
|
1168
|
+
* Required API Key ACLs:
|
|
1169
|
+
* - addObject
|
|
1170
|
+
* - deleteIndex
|
|
1171
|
+
* - editSettings.
|
|
1172
|
+
*
|
|
1173
|
+
* @param getAuthentication - The getAuthentication object.
|
|
1174
|
+
* @param getAuthentication.authenticationID - Unique identifier of an authentication resource.
|
|
1175
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1176
|
+
*/
|
|
1177
|
+
getAuthentication({ authenticationID }, requestOptions) {
|
|
1178
|
+
if (!authenticationID) {
|
|
1179
|
+
throw new Error('Parameter `authenticationID` is required when calling `getAuthentication`.');
|
|
1180
|
+
}
|
|
1181
|
+
const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
|
|
1182
|
+
const headers = {};
|
|
1183
|
+
const queryParameters = {};
|
|
1184
|
+
const request = {
|
|
1185
|
+
method: 'GET',
|
|
1186
|
+
path: requestPath,
|
|
1187
|
+
queryParameters,
|
|
1188
|
+
headers,
|
|
1189
|
+
};
|
|
1190
|
+
return transporter.request(request, requestOptions);
|
|
1191
|
+
},
|
|
1192
|
+
/**
|
|
1193
|
+
* Retrieves a list of all authentication resources.
|
|
1194
|
+
*
|
|
1195
|
+
* Required API Key ACLs:
|
|
1196
|
+
* - addObject
|
|
1197
|
+
* - deleteIndex
|
|
1198
|
+
* - editSettings.
|
|
1199
|
+
*
|
|
1200
|
+
* @param getAuthentications - The getAuthentications object.
|
|
1201
|
+
* @param getAuthentications.itemsPerPage - Number of items per page.
|
|
1202
|
+
* @param getAuthentications.page - Page number of the paginated API response.
|
|
1203
|
+
* @param getAuthentications.type - Type of authentication resource to retrieve.
|
|
1204
|
+
* @param getAuthentications.platform - Ecommerce platform for which to retrieve authentication resources.
|
|
1205
|
+
* @param getAuthentications.sort - Property by which to sort the list of authentication resources.
|
|
1206
|
+
* @param getAuthentications.order - Sort order of the response, ascending or descending.
|
|
1207
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1208
|
+
*/
|
|
1209
|
+
getAuthentications({ itemsPerPage, page, type, platform, sort, order, } = {}, requestOptions = undefined) {
|
|
1210
|
+
const requestPath = '/1/authentications';
|
|
1211
|
+
const headers = {};
|
|
1212
|
+
const queryParameters = {};
|
|
1213
|
+
if (itemsPerPage !== undefined) {
|
|
1214
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1215
|
+
}
|
|
1216
|
+
if (page !== undefined) {
|
|
1217
|
+
queryParameters.page = page.toString();
|
|
1218
|
+
}
|
|
1219
|
+
if (type !== undefined) {
|
|
1220
|
+
queryParameters.type = type.toString();
|
|
1221
|
+
}
|
|
1222
|
+
if (platform !== undefined) {
|
|
1223
|
+
queryParameters.platform = platform.toString();
|
|
1224
|
+
}
|
|
1225
|
+
if (sort !== undefined) {
|
|
1226
|
+
queryParameters.sort = sort.toString();
|
|
1227
|
+
}
|
|
1228
|
+
if (order !== undefined) {
|
|
1229
|
+
queryParameters.order = order.toString();
|
|
1230
|
+
}
|
|
1231
|
+
const request = {
|
|
1232
|
+
method: 'GET',
|
|
1233
|
+
path: requestPath,
|
|
1234
|
+
queryParameters,
|
|
1235
|
+
headers,
|
|
1236
|
+
};
|
|
1237
|
+
return transporter.request(request, requestOptions);
|
|
1238
|
+
},
|
|
1239
|
+
/**
|
|
1240
|
+
* Retrieves a destination by its ID.
|
|
1241
|
+
*
|
|
1242
|
+
* Required API Key ACLs:
|
|
1243
|
+
* - addObject
|
|
1244
|
+
* - deleteIndex
|
|
1245
|
+
* - editSettings.
|
|
1246
|
+
*
|
|
1247
|
+
* @param getDestination - The getDestination object.
|
|
1248
|
+
* @param getDestination.destinationID - Unique identifier of a destination.
|
|
1249
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1250
|
+
*/
|
|
1251
|
+
getDestination({ destinationID }, requestOptions) {
|
|
1252
|
+
if (!destinationID) {
|
|
1253
|
+
throw new Error('Parameter `destinationID` is required when calling `getDestination`.');
|
|
1254
|
+
}
|
|
1255
|
+
const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
|
|
1256
|
+
const headers = {};
|
|
1257
|
+
const queryParameters = {};
|
|
1258
|
+
const request = {
|
|
1259
|
+
method: 'GET',
|
|
1260
|
+
path: requestPath,
|
|
1261
|
+
queryParameters,
|
|
1262
|
+
headers,
|
|
1263
|
+
};
|
|
1264
|
+
return transporter.request(request, requestOptions);
|
|
1265
|
+
},
|
|
1266
|
+
/**
|
|
1267
|
+
* Retrieves a list of destinations.
|
|
1268
|
+
*
|
|
1269
|
+
* Required API Key ACLs:
|
|
1270
|
+
* - addObject
|
|
1271
|
+
* - deleteIndex
|
|
1272
|
+
* - editSettings.
|
|
1273
|
+
*
|
|
1274
|
+
* @param getDestinations - The getDestinations object.
|
|
1275
|
+
* @param getDestinations.itemsPerPage - Number of items per page.
|
|
1276
|
+
* @param getDestinations.page - Page number of the paginated API response.
|
|
1277
|
+
* @param getDestinations.type - Destination type.
|
|
1278
|
+
* @param getDestinations.authenticationID - Authentication ID used by destinations.
|
|
1279
|
+
* @param getDestinations.sort - Property by which to sort the destinations.
|
|
1280
|
+
* @param getDestinations.order - Sort order of the response, ascending or descending.
|
|
1281
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1282
|
+
*/
|
|
1283
|
+
getDestinations({ itemsPerPage, page, type, authenticationID, sort, order, } = {}, requestOptions = undefined) {
|
|
1284
|
+
const requestPath = '/1/destinations';
|
|
1285
|
+
const headers = {};
|
|
1286
|
+
const queryParameters = {};
|
|
1287
|
+
if (itemsPerPage !== undefined) {
|
|
1288
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1289
|
+
}
|
|
1290
|
+
if (page !== undefined) {
|
|
1291
|
+
queryParameters.page = page.toString();
|
|
1292
|
+
}
|
|
1293
|
+
if (type !== undefined) {
|
|
1294
|
+
queryParameters.type = type.toString();
|
|
1295
|
+
}
|
|
1296
|
+
if (authenticationID !== undefined) {
|
|
1297
|
+
queryParameters.authenticationID = authenticationID.toString();
|
|
1298
|
+
}
|
|
1299
|
+
if (sort !== undefined) {
|
|
1300
|
+
queryParameters.sort = sort.toString();
|
|
1301
|
+
}
|
|
1302
|
+
if (order !== undefined) {
|
|
1303
|
+
queryParameters.order = order.toString();
|
|
1304
|
+
}
|
|
1305
|
+
const request = {
|
|
1306
|
+
method: 'GET',
|
|
1307
|
+
path: requestPath,
|
|
1308
|
+
queryParameters,
|
|
1309
|
+
headers,
|
|
1310
|
+
};
|
|
1311
|
+
return transporter.request(request, requestOptions);
|
|
1312
|
+
},
|
|
1313
|
+
/**
|
|
1314
|
+
* Retrieves a stream listing for a source. Listing streams only works with sources with `type: docker` and `imageType: singer`.
|
|
1315
|
+
*
|
|
1316
|
+
* Required API Key ACLs:
|
|
1317
|
+
* - addObject
|
|
1318
|
+
* - deleteIndex
|
|
1319
|
+
* - editSettings.
|
|
1320
|
+
*
|
|
1321
|
+
* @param getDockerSourceStreams - The getDockerSourceStreams object.
|
|
1322
|
+
* @param getDockerSourceStreams.sourceID - Unique identifier of a source.
|
|
1323
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1324
|
+
*/
|
|
1325
|
+
getDockerSourceStreams({ sourceID }, requestOptions) {
|
|
1326
|
+
if (!sourceID) {
|
|
1327
|
+
throw new Error('Parameter `sourceID` is required when calling `getDockerSourceStreams`.');
|
|
1328
|
+
}
|
|
1329
|
+
const requestPath = '/1/sources/{sourceID}/discover'.replace('{sourceID}', encodeURIComponent(sourceID));
|
|
1330
|
+
const headers = {};
|
|
1331
|
+
const queryParameters = {};
|
|
1332
|
+
const request = {
|
|
1333
|
+
method: 'GET',
|
|
1334
|
+
path: requestPath,
|
|
1335
|
+
queryParameters,
|
|
1336
|
+
headers,
|
|
1337
|
+
};
|
|
1338
|
+
return transporter.request(request, requestOptions);
|
|
1339
|
+
},
|
|
1340
|
+
/**
|
|
1341
|
+
* Retrieves a single task run event by its ID.
|
|
1342
|
+
*
|
|
1343
|
+
* Required API Key ACLs:
|
|
1344
|
+
* - addObject
|
|
1345
|
+
* - deleteIndex
|
|
1346
|
+
* - editSettings.
|
|
1347
|
+
*
|
|
1348
|
+
* @param getEvent - The getEvent object.
|
|
1349
|
+
* @param getEvent.runID - Unique identifier of a task run.
|
|
1350
|
+
* @param getEvent.eventID - Unique identifier of an event.
|
|
1351
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1352
|
+
*/
|
|
1353
|
+
getEvent({ runID, eventID }, requestOptions) {
|
|
1354
|
+
if (!runID) {
|
|
1355
|
+
throw new Error('Parameter `runID` is required when calling `getEvent`.');
|
|
1356
|
+
}
|
|
1357
|
+
if (!eventID) {
|
|
1358
|
+
throw new Error('Parameter `eventID` is required when calling `getEvent`.');
|
|
1359
|
+
}
|
|
1360
|
+
const requestPath = '/1/runs/{runID}/events/{eventID}'
|
|
1361
|
+
.replace('{runID}', encodeURIComponent(runID))
|
|
1362
|
+
.replace('{eventID}', encodeURIComponent(eventID));
|
|
1363
|
+
const headers = {};
|
|
1364
|
+
const queryParameters = {};
|
|
1365
|
+
const request = {
|
|
1366
|
+
method: 'GET',
|
|
1367
|
+
path: requestPath,
|
|
1368
|
+
queryParameters,
|
|
1369
|
+
headers,
|
|
1370
|
+
};
|
|
1371
|
+
return transporter.request(request, requestOptions);
|
|
1372
|
+
},
|
|
1373
|
+
/**
|
|
1374
|
+
* Retrieves a list of events for a task run, identified by it\'s ID.
|
|
1375
|
+
*
|
|
1376
|
+
* Required API Key ACLs:
|
|
1377
|
+
* - addObject
|
|
1378
|
+
* - deleteIndex
|
|
1379
|
+
* - editSettings.
|
|
1380
|
+
*
|
|
1381
|
+
* @param getEvents - The getEvents object.
|
|
1382
|
+
* @param getEvents.runID - Unique identifier of a task run.
|
|
1383
|
+
* @param getEvents.itemsPerPage - Number of items per page.
|
|
1384
|
+
* @param getEvents.page - Page number of the paginated API response.
|
|
1385
|
+
* @param getEvents.status - Event status for filtering the list of task runs.
|
|
1386
|
+
* @param getEvents.type - Event type for filtering the list of task runs.
|
|
1387
|
+
* @param getEvents.sort - Property by which to sort the list of task run events.
|
|
1388
|
+
* @param getEvents.order - Sort order of the response, ascending or descending.
|
|
1389
|
+
* @param getEvents.startDate - Date and time in RFC3339 format for the earliest events to retrieve. By default, the current time minus three hours is used.
|
|
1390
|
+
* @param getEvents.endDate - Date and time in RFC3339 format for the latest events to retrieve. By default, the current time is used.
|
|
1391
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1392
|
+
*/
|
|
1393
|
+
getEvents({ runID, itemsPerPage, page, status, type, sort, order, startDate, endDate, }, requestOptions) {
|
|
1394
|
+
if (!runID) {
|
|
1395
|
+
throw new Error('Parameter `runID` is required when calling `getEvents`.');
|
|
1396
|
+
}
|
|
1397
|
+
const requestPath = '/1/runs/{runID}/events'.replace('{runID}', encodeURIComponent(runID));
|
|
1398
|
+
const headers = {};
|
|
1399
|
+
const queryParameters = {};
|
|
1400
|
+
if (itemsPerPage !== undefined) {
|
|
1401
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1402
|
+
}
|
|
1403
|
+
if (page !== undefined) {
|
|
1404
|
+
queryParameters.page = page.toString();
|
|
1405
|
+
}
|
|
1406
|
+
if (status !== undefined) {
|
|
1407
|
+
queryParameters.status = status.toString();
|
|
1408
|
+
}
|
|
1409
|
+
if (type !== undefined) {
|
|
1410
|
+
queryParameters.type = type.toString();
|
|
1411
|
+
}
|
|
1412
|
+
if (sort !== undefined) {
|
|
1413
|
+
queryParameters.sort = sort.toString();
|
|
1414
|
+
}
|
|
1415
|
+
if (order !== undefined) {
|
|
1416
|
+
queryParameters.order = order.toString();
|
|
1417
|
+
}
|
|
1418
|
+
if (startDate !== undefined) {
|
|
1419
|
+
queryParameters.startDate = startDate.toString();
|
|
1420
|
+
}
|
|
1421
|
+
if (endDate !== undefined) {
|
|
1422
|
+
queryParameters.endDate = endDate.toString();
|
|
1423
|
+
}
|
|
1424
|
+
const request = {
|
|
1425
|
+
method: 'GET',
|
|
1426
|
+
path: requestPath,
|
|
1427
|
+
queryParameters,
|
|
1428
|
+
headers,
|
|
1429
|
+
};
|
|
1430
|
+
return transporter.request(request, requestOptions);
|
|
1431
|
+
},
|
|
1432
|
+
/**
|
|
1433
|
+
* Retrieve a single task run by its ID.
|
|
1434
|
+
*
|
|
1435
|
+
* Required API Key ACLs:
|
|
1436
|
+
* - addObject
|
|
1437
|
+
* - deleteIndex
|
|
1438
|
+
* - editSettings.
|
|
1439
|
+
*
|
|
1440
|
+
* @param getRun - The getRun object.
|
|
1441
|
+
* @param getRun.runID - Unique identifier of a task run.
|
|
1442
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1443
|
+
*/
|
|
1444
|
+
getRun({ runID }, requestOptions) {
|
|
1445
|
+
if (!runID) {
|
|
1446
|
+
throw new Error('Parameter `runID` is required when calling `getRun`.');
|
|
1447
|
+
}
|
|
1448
|
+
const requestPath = '/1/runs/{runID}'.replace('{runID}', encodeURIComponent(runID));
|
|
1449
|
+
const headers = {};
|
|
1450
|
+
const queryParameters = {};
|
|
1451
|
+
const request = {
|
|
1452
|
+
method: 'GET',
|
|
1453
|
+
path: requestPath,
|
|
1454
|
+
queryParameters,
|
|
1455
|
+
headers,
|
|
1456
|
+
};
|
|
1457
|
+
return transporter.request(request, requestOptions);
|
|
1458
|
+
},
|
|
1459
|
+
/**
|
|
1460
|
+
* Retrieve a list of task runs.
|
|
1461
|
+
*
|
|
1462
|
+
* Required API Key ACLs:
|
|
1463
|
+
* - addObject
|
|
1464
|
+
* - deleteIndex
|
|
1465
|
+
* - editSettings.
|
|
1466
|
+
*
|
|
1467
|
+
* @param getRuns - The getRuns object.
|
|
1468
|
+
* @param getRuns.itemsPerPage - Number of items per page.
|
|
1469
|
+
* @param getRuns.page - Page number of the paginated API response.
|
|
1470
|
+
* @param getRuns.status - Run status for filtering the list of task runs.
|
|
1471
|
+
* @param getRuns.taskID - Task ID for filtering the list of task runs.
|
|
1472
|
+
* @param getRuns.sort - Property by which to sort the list of task runs.
|
|
1473
|
+
* @param getRuns.order - Sort order of the response, ascending or descending.
|
|
1474
|
+
* @param getRuns.startDate - Date in RFC3339 format for the earliest run to retrieve. By default, the current day minus seven days is used.
|
|
1475
|
+
* @param getRuns.endDate - Date in RFC3339 format for the latest run to retrieve. By default, the current day is used.
|
|
1476
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1477
|
+
*/
|
|
1478
|
+
getRuns({ itemsPerPage, page, status, taskID, sort, order, startDate, endDate, } = {}, requestOptions = undefined) {
|
|
1479
|
+
const requestPath = '/1/runs';
|
|
1480
|
+
const headers = {};
|
|
1481
|
+
const queryParameters = {};
|
|
1482
|
+
if (itemsPerPage !== undefined) {
|
|
1483
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1484
|
+
}
|
|
1485
|
+
if (page !== undefined) {
|
|
1486
|
+
queryParameters.page = page.toString();
|
|
1487
|
+
}
|
|
1488
|
+
if (status !== undefined) {
|
|
1489
|
+
queryParameters.status = status.toString();
|
|
1490
|
+
}
|
|
1491
|
+
if (taskID !== undefined) {
|
|
1492
|
+
queryParameters.taskID = taskID.toString();
|
|
1493
|
+
}
|
|
1494
|
+
if (sort !== undefined) {
|
|
1495
|
+
queryParameters.sort = sort.toString();
|
|
1496
|
+
}
|
|
1497
|
+
if (order !== undefined) {
|
|
1498
|
+
queryParameters.order = order.toString();
|
|
1499
|
+
}
|
|
1500
|
+
if (startDate !== undefined) {
|
|
1501
|
+
queryParameters.startDate = startDate.toString();
|
|
1502
|
+
}
|
|
1503
|
+
if (endDate !== undefined) {
|
|
1504
|
+
queryParameters.endDate = endDate.toString();
|
|
1505
|
+
}
|
|
1506
|
+
const request = {
|
|
1507
|
+
method: 'GET',
|
|
1508
|
+
path: requestPath,
|
|
1509
|
+
queryParameters,
|
|
1510
|
+
headers,
|
|
1511
|
+
};
|
|
1512
|
+
return transporter.request(request, requestOptions);
|
|
1513
|
+
},
|
|
1514
|
+
/**
|
|
1515
|
+
* Retrieve a source by its ID.
|
|
1516
|
+
*
|
|
1517
|
+
* Required API Key ACLs:
|
|
1518
|
+
* - addObject
|
|
1519
|
+
* - deleteIndex
|
|
1520
|
+
* - editSettings.
|
|
1521
|
+
*
|
|
1522
|
+
* @param getSource - The getSource object.
|
|
1523
|
+
* @param getSource.sourceID - Unique identifier of a source.
|
|
1524
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1525
|
+
*/
|
|
1526
|
+
getSource({ sourceID }, requestOptions) {
|
|
1527
|
+
if (!sourceID) {
|
|
1528
|
+
throw new Error('Parameter `sourceID` is required when calling `getSource`.');
|
|
1529
|
+
}
|
|
1530
|
+
const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
|
|
1531
|
+
const headers = {};
|
|
1532
|
+
const queryParameters = {};
|
|
1533
|
+
const request = {
|
|
1534
|
+
method: 'GET',
|
|
1535
|
+
path: requestPath,
|
|
1536
|
+
queryParameters,
|
|
1537
|
+
headers,
|
|
1538
|
+
};
|
|
1539
|
+
return transporter.request(request, requestOptions);
|
|
1540
|
+
},
|
|
1541
|
+
/**
|
|
1542
|
+
* Retrieves a list of sources.
|
|
1543
|
+
*
|
|
1544
|
+
* Required API Key ACLs:
|
|
1545
|
+
* - addObject
|
|
1546
|
+
* - deleteIndex
|
|
1547
|
+
* - editSettings.
|
|
1548
|
+
*
|
|
1549
|
+
* @param getSources - The getSources object.
|
|
1550
|
+
* @param getSources.itemsPerPage - Number of items per page.
|
|
1551
|
+
* @param getSources.page - Page number of the paginated API response.
|
|
1552
|
+
* @param getSources.type - Source type. Some sources require authentication.
|
|
1553
|
+
* @param getSources.authenticationID - Authentication IDs of the sources to retrieve. \'none\' returns sources that doesn\'t have an authentication resource.
|
|
1554
|
+
* @param getSources.sort - Property by which to sort the list of sources.
|
|
1555
|
+
* @param getSources.order - Sort order of the response, ascending or descending.
|
|
1556
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1557
|
+
*/
|
|
1558
|
+
getSources({ itemsPerPage, page, type, authenticationID, sort, order, } = {}, requestOptions = undefined) {
|
|
1559
|
+
const requestPath = '/1/sources';
|
|
1560
|
+
const headers = {};
|
|
1561
|
+
const queryParameters = {};
|
|
1562
|
+
if (itemsPerPage !== undefined) {
|
|
1563
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1564
|
+
}
|
|
1565
|
+
if (page !== undefined) {
|
|
1566
|
+
queryParameters.page = page.toString();
|
|
1567
|
+
}
|
|
1568
|
+
if (type !== undefined) {
|
|
1569
|
+
queryParameters.type = type.toString();
|
|
1570
|
+
}
|
|
1571
|
+
if (authenticationID !== undefined) {
|
|
1572
|
+
queryParameters.authenticationID = authenticationID.toString();
|
|
1573
|
+
}
|
|
1574
|
+
if (sort !== undefined) {
|
|
1575
|
+
queryParameters.sort = sort.toString();
|
|
1576
|
+
}
|
|
1577
|
+
if (order !== undefined) {
|
|
1578
|
+
queryParameters.order = order.toString();
|
|
1579
|
+
}
|
|
1580
|
+
const request = {
|
|
1581
|
+
method: 'GET',
|
|
1582
|
+
path: requestPath,
|
|
1583
|
+
queryParameters,
|
|
1584
|
+
headers,
|
|
1585
|
+
};
|
|
1586
|
+
return transporter.request(request, requestOptions);
|
|
1587
|
+
},
|
|
1588
|
+
/**
|
|
1589
|
+
* Retrieves a task by its ID.
|
|
1590
|
+
*
|
|
1591
|
+
* Required API Key ACLs:
|
|
1592
|
+
* - addObject
|
|
1593
|
+
* - deleteIndex
|
|
1594
|
+
* - editSettings.
|
|
1595
|
+
*
|
|
1596
|
+
* @param getTask - The getTask object.
|
|
1597
|
+
* @param getTask.taskID - Unique identifier of a task.
|
|
1598
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1599
|
+
*/
|
|
1600
|
+
getTask({ taskID }, requestOptions) {
|
|
1601
|
+
if (!taskID) {
|
|
1602
|
+
throw new Error('Parameter `taskID` is required when calling `getTask`.');
|
|
1603
|
+
}
|
|
1604
|
+
const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1605
|
+
const headers = {};
|
|
1606
|
+
const queryParameters = {};
|
|
1607
|
+
const request = {
|
|
1608
|
+
method: 'GET',
|
|
1609
|
+
path: requestPath,
|
|
1610
|
+
queryParameters,
|
|
1611
|
+
headers,
|
|
1612
|
+
};
|
|
1613
|
+
return transporter.request(request, requestOptions);
|
|
1614
|
+
},
|
|
1615
|
+
/**
|
|
1616
|
+
* Retrieves a list of tasks.
|
|
1617
|
+
*
|
|
1618
|
+
* Required API Key ACLs:
|
|
1619
|
+
* - addObject
|
|
1620
|
+
* - deleteIndex
|
|
1621
|
+
* - editSettings.
|
|
1622
|
+
*
|
|
1623
|
+
* @param getTasks - The getTasks object.
|
|
1624
|
+
* @param getTasks.itemsPerPage - Number of items per page.
|
|
1625
|
+
* @param getTasks.page - Page number of the paginated API response.
|
|
1626
|
+
* @param getTasks.action - Actions for filtering the list of tasks.
|
|
1627
|
+
* @param getTasks.enabled - Whether to filter the list of tasks by the `enabled` status.
|
|
1628
|
+
* @param getTasks.sourceID - Source IDs for filtering the list of tasks.
|
|
1629
|
+
* @param getTasks.destinationID - Destination IDs for filtering the list of tasks.
|
|
1630
|
+
* @param getTasks.triggerType - Type of task trigger for filtering the list of tasks.
|
|
1631
|
+
* @param getTasks.sort - Property by which to sort the list of tasks.
|
|
1632
|
+
* @param getTasks.order - Sort order of the response, ascending or descending.
|
|
1633
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1634
|
+
*/
|
|
1635
|
+
getTasks({ itemsPerPage, page, action, enabled, sourceID, destinationID, triggerType, sort, order, } = {}, requestOptions = undefined) {
|
|
1636
|
+
const requestPath = '/1/tasks';
|
|
1637
|
+
const headers = {};
|
|
1638
|
+
const queryParameters = {};
|
|
1639
|
+
if (itemsPerPage !== undefined) {
|
|
1640
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1641
|
+
}
|
|
1642
|
+
if (page !== undefined) {
|
|
1643
|
+
queryParameters.page = page.toString();
|
|
1644
|
+
}
|
|
1645
|
+
if (action !== undefined) {
|
|
1646
|
+
queryParameters.action = action.toString();
|
|
1647
|
+
}
|
|
1648
|
+
if (enabled !== undefined) {
|
|
1649
|
+
queryParameters.enabled = enabled.toString();
|
|
1650
|
+
}
|
|
1651
|
+
if (sourceID !== undefined) {
|
|
1652
|
+
queryParameters.sourceID = sourceID.toString();
|
|
1653
|
+
}
|
|
1654
|
+
if (destinationID !== undefined) {
|
|
1655
|
+
queryParameters.destinationID = destinationID.toString();
|
|
1656
|
+
}
|
|
1657
|
+
if (triggerType !== undefined) {
|
|
1658
|
+
queryParameters.triggerType = triggerType.toString();
|
|
1659
|
+
}
|
|
1660
|
+
if (sort !== undefined) {
|
|
1661
|
+
queryParameters.sort = sort.toString();
|
|
1662
|
+
}
|
|
1663
|
+
if (order !== undefined) {
|
|
1664
|
+
queryParameters.order = order.toString();
|
|
1665
|
+
}
|
|
1666
|
+
const request = {
|
|
1667
|
+
method: 'GET',
|
|
1668
|
+
path: requestPath,
|
|
1669
|
+
queryParameters,
|
|
1670
|
+
headers,
|
|
1671
|
+
};
|
|
1672
|
+
return transporter.request(request, requestOptions);
|
|
1673
|
+
},
|
|
1674
|
+
/**
|
|
1675
|
+
* Runs a task. You can check the status of task runs with the observability endpoints.
|
|
1676
|
+
*
|
|
1677
|
+
* Required API Key ACLs:
|
|
1678
|
+
* - addObject
|
|
1679
|
+
* - deleteIndex
|
|
1680
|
+
* - editSettings.
|
|
1681
|
+
*
|
|
1682
|
+
* @param runTask - The runTask object.
|
|
1683
|
+
* @param runTask.taskID - Unique identifier of a task.
|
|
1684
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1685
|
+
*/
|
|
1686
|
+
runTask({ taskID }, requestOptions) {
|
|
1687
|
+
if (!taskID) {
|
|
1688
|
+
throw new Error('Parameter `taskID` is required when calling `runTask`.');
|
|
1689
|
+
}
|
|
1690
|
+
const requestPath = '/1/tasks/{taskID}/run'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1691
|
+
const headers = {};
|
|
1692
|
+
const queryParameters = {};
|
|
1693
|
+
const request = {
|
|
1694
|
+
method: 'POST',
|
|
1695
|
+
path: requestPath,
|
|
1696
|
+
queryParameters,
|
|
1697
|
+
headers,
|
|
1698
|
+
};
|
|
1699
|
+
return transporter.request(request, requestOptions);
|
|
1700
|
+
},
|
|
1701
|
+
/**
|
|
1702
|
+
* Searches for authentication resources.
|
|
1703
|
+
*
|
|
1704
|
+
* Required API Key ACLs:
|
|
1705
|
+
* - addObject
|
|
1706
|
+
* - deleteIndex
|
|
1707
|
+
* - editSettings.
|
|
1708
|
+
*
|
|
1709
|
+
* @param authenticationSearch - The authenticationSearch object.
|
|
1710
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1711
|
+
*/
|
|
1712
|
+
searchAuthentications(authenticationSearch, requestOptions) {
|
|
1713
|
+
if (!authenticationSearch) {
|
|
1714
|
+
throw new Error('Parameter `authenticationSearch` is required when calling `searchAuthentications`.');
|
|
1715
|
+
}
|
|
1716
|
+
if (!authenticationSearch.authenticationIDs) {
|
|
1717
|
+
throw new Error('Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.');
|
|
1718
|
+
}
|
|
1719
|
+
const requestPath = '/1/authentications/search';
|
|
1720
|
+
const headers = {};
|
|
1721
|
+
const queryParameters = {};
|
|
1722
|
+
const request = {
|
|
1723
|
+
method: 'POST',
|
|
1724
|
+
path: requestPath,
|
|
1725
|
+
queryParameters,
|
|
1726
|
+
headers,
|
|
1727
|
+
data: authenticationSearch,
|
|
1728
|
+
};
|
|
1729
|
+
return transporter.request(request, requestOptions);
|
|
1730
|
+
},
|
|
1731
|
+
/**
|
|
1732
|
+
* Searches for destinations.
|
|
1733
|
+
*
|
|
1734
|
+
* Required API Key ACLs:
|
|
1735
|
+
* - addObject
|
|
1736
|
+
* - deleteIndex
|
|
1737
|
+
* - editSettings.
|
|
1738
|
+
*
|
|
1739
|
+
* @param destinationSearch - The destinationSearch object.
|
|
1740
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1741
|
+
*/
|
|
1742
|
+
searchDestinations(destinationSearch, requestOptions) {
|
|
1743
|
+
if (!destinationSearch) {
|
|
1744
|
+
throw new Error('Parameter `destinationSearch` is required when calling `searchDestinations`.');
|
|
1745
|
+
}
|
|
1746
|
+
if (!destinationSearch.destinationIDs) {
|
|
1747
|
+
throw new Error('Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.');
|
|
1748
|
+
}
|
|
1749
|
+
const requestPath = '/1/destinations/search';
|
|
1750
|
+
const headers = {};
|
|
1751
|
+
const queryParameters = {};
|
|
1752
|
+
const request = {
|
|
1753
|
+
method: 'POST',
|
|
1754
|
+
path: requestPath,
|
|
1755
|
+
queryParameters,
|
|
1756
|
+
headers,
|
|
1757
|
+
data: destinationSearch,
|
|
1758
|
+
};
|
|
1759
|
+
return transporter.request(request, requestOptions);
|
|
1760
|
+
},
|
|
1761
|
+
/**
|
|
1762
|
+
* Searches for sources.
|
|
1763
|
+
*
|
|
1764
|
+
* Required API Key ACLs:
|
|
1765
|
+
* - addObject
|
|
1766
|
+
* - deleteIndex
|
|
1767
|
+
* - editSettings.
|
|
1768
|
+
*
|
|
1769
|
+
* @param sourceSearch - The sourceSearch object.
|
|
1770
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1771
|
+
*/
|
|
1772
|
+
searchSources(sourceSearch, requestOptions) {
|
|
1773
|
+
if (!sourceSearch) {
|
|
1774
|
+
throw new Error('Parameter `sourceSearch` is required when calling `searchSources`.');
|
|
1775
|
+
}
|
|
1776
|
+
if (!sourceSearch.sourceIDs) {
|
|
1777
|
+
throw new Error('Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.');
|
|
1778
|
+
}
|
|
1779
|
+
const requestPath = '/1/sources/search';
|
|
1780
|
+
const headers = {};
|
|
1781
|
+
const queryParameters = {};
|
|
1782
|
+
const request = {
|
|
1783
|
+
method: 'POST',
|
|
1784
|
+
path: requestPath,
|
|
1785
|
+
queryParameters,
|
|
1786
|
+
headers,
|
|
1787
|
+
data: sourceSearch,
|
|
1788
|
+
};
|
|
1789
|
+
return transporter.request(request, requestOptions);
|
|
1790
|
+
},
|
|
1791
|
+
/**
|
|
1792
|
+
* Searches for tasks.
|
|
1793
|
+
*
|
|
1794
|
+
* Required API Key ACLs:
|
|
1795
|
+
* - addObject
|
|
1796
|
+
* - deleteIndex
|
|
1797
|
+
* - editSettings.
|
|
1798
|
+
*
|
|
1799
|
+
* @param taskSearch - The taskSearch object.
|
|
1800
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1801
|
+
*/
|
|
1802
|
+
searchTasks(taskSearch, requestOptions) {
|
|
1803
|
+
if (!taskSearch) {
|
|
1804
|
+
throw new Error('Parameter `taskSearch` is required when calling `searchTasks`.');
|
|
1805
|
+
}
|
|
1806
|
+
if (!taskSearch.taskIDs) {
|
|
1807
|
+
throw new Error('Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.');
|
|
1808
|
+
}
|
|
1809
|
+
const requestPath = '/1/tasks/search';
|
|
1810
|
+
const headers = {};
|
|
1811
|
+
const queryParameters = {};
|
|
1812
|
+
const request = {
|
|
1813
|
+
method: 'POST',
|
|
1814
|
+
path: requestPath,
|
|
1815
|
+
queryParameters,
|
|
1816
|
+
headers,
|
|
1817
|
+
data: taskSearch,
|
|
1818
|
+
};
|
|
1819
|
+
return transporter.request(request, requestOptions);
|
|
1820
|
+
},
|
|
1821
|
+
/**
|
|
1822
|
+
* Triggers a stream-listing request for a source. Triggering stream-listing requests only works with sources with `type: docker` and `imageType: singer`.
|
|
1823
|
+
*
|
|
1824
|
+
* Required API Key ACLs:
|
|
1825
|
+
* - addObject
|
|
1826
|
+
* - deleteIndex
|
|
1827
|
+
* - editSettings.
|
|
1828
|
+
*
|
|
1829
|
+
* @param triggerDockerSourceDiscover - The triggerDockerSourceDiscover object.
|
|
1830
|
+
* @param triggerDockerSourceDiscover.sourceID - Unique identifier of a source.
|
|
1831
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1832
|
+
*/
|
|
1833
|
+
triggerDockerSourceDiscover({ sourceID }, requestOptions) {
|
|
1834
|
+
if (!sourceID) {
|
|
1835
|
+
throw new Error('Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.');
|
|
1836
|
+
}
|
|
1837
|
+
const requestPath = '/1/sources/{sourceID}/discover'.replace('{sourceID}', encodeURIComponent(sourceID));
|
|
1838
|
+
const headers = {};
|
|
1839
|
+
const queryParameters = {};
|
|
1840
|
+
const request = {
|
|
1841
|
+
method: 'POST',
|
|
1842
|
+
path: requestPath,
|
|
1843
|
+
queryParameters,
|
|
1844
|
+
headers,
|
|
1845
|
+
};
|
|
1846
|
+
return transporter.request(request, requestOptions);
|
|
1847
|
+
},
|
|
1848
|
+
/**
|
|
1849
|
+
* Updates an authentication resource.
|
|
1850
|
+
*
|
|
1851
|
+
* Required API Key ACLs:
|
|
1852
|
+
* - addObject
|
|
1853
|
+
* - deleteIndex
|
|
1854
|
+
* - editSettings.
|
|
1855
|
+
*
|
|
1856
|
+
* @param updateAuthentication - The updateAuthentication object.
|
|
1857
|
+
* @param updateAuthentication.authenticationID - Unique identifier of an authentication resource.
|
|
1858
|
+
* @param updateAuthentication.authenticationUpdate - The authenticationUpdate object.
|
|
1859
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1860
|
+
*/
|
|
1861
|
+
updateAuthentication({ authenticationID, authenticationUpdate }, requestOptions) {
|
|
1862
|
+
if (!authenticationID) {
|
|
1863
|
+
throw new Error('Parameter `authenticationID` is required when calling `updateAuthentication`.');
|
|
1864
|
+
}
|
|
1865
|
+
if (!authenticationUpdate) {
|
|
1866
|
+
throw new Error('Parameter `authenticationUpdate` is required when calling `updateAuthentication`.');
|
|
1867
|
+
}
|
|
1868
|
+
const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
|
|
1869
|
+
const headers = {};
|
|
1870
|
+
const queryParameters = {};
|
|
1871
|
+
const request = {
|
|
1872
|
+
method: 'PATCH',
|
|
1873
|
+
path: requestPath,
|
|
1874
|
+
queryParameters,
|
|
1875
|
+
headers,
|
|
1876
|
+
data: authenticationUpdate,
|
|
1877
|
+
};
|
|
1878
|
+
return transporter.request(request, requestOptions);
|
|
1879
|
+
},
|
|
1880
|
+
/**
|
|
1881
|
+
* Updates the destination by its ID.
|
|
1882
|
+
*
|
|
1883
|
+
* Required API Key ACLs:
|
|
1884
|
+
* - addObject
|
|
1885
|
+
* - deleteIndex
|
|
1886
|
+
* - editSettings.
|
|
1887
|
+
*
|
|
1888
|
+
* @param updateDestination - The updateDestination object.
|
|
1889
|
+
* @param updateDestination.destinationID - Unique identifier of a destination.
|
|
1890
|
+
* @param updateDestination.destinationUpdate - The destinationUpdate object.
|
|
1891
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1892
|
+
*/
|
|
1893
|
+
updateDestination({ destinationID, destinationUpdate }, requestOptions) {
|
|
1894
|
+
if (!destinationID) {
|
|
1895
|
+
throw new Error('Parameter `destinationID` is required when calling `updateDestination`.');
|
|
1896
|
+
}
|
|
1897
|
+
if (!destinationUpdate) {
|
|
1898
|
+
throw new Error('Parameter `destinationUpdate` is required when calling `updateDestination`.');
|
|
1899
|
+
}
|
|
1900
|
+
const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
|
|
1901
|
+
const headers = {};
|
|
1902
|
+
const queryParameters = {};
|
|
1903
|
+
const request = {
|
|
1904
|
+
method: 'PATCH',
|
|
1905
|
+
path: requestPath,
|
|
1906
|
+
queryParameters,
|
|
1907
|
+
headers,
|
|
1908
|
+
data: destinationUpdate,
|
|
1909
|
+
};
|
|
1910
|
+
return transporter.request(request, requestOptions);
|
|
1911
|
+
},
|
|
1912
|
+
/**
|
|
1913
|
+
* Updates a source by its ID.
|
|
1914
|
+
*
|
|
1915
|
+
* Required API Key ACLs:
|
|
1916
|
+
* - addObject
|
|
1917
|
+
* - deleteIndex
|
|
1918
|
+
* - editSettings.
|
|
1919
|
+
*
|
|
1920
|
+
* @param updateSource - The updateSource object.
|
|
1921
|
+
* @param updateSource.sourceID - Unique identifier of a source.
|
|
1922
|
+
* @param updateSource.sourceUpdate - The sourceUpdate object.
|
|
1923
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1924
|
+
*/
|
|
1925
|
+
updateSource({ sourceID, sourceUpdate }, requestOptions) {
|
|
1926
|
+
if (!sourceID) {
|
|
1927
|
+
throw new Error('Parameter `sourceID` is required when calling `updateSource`.');
|
|
1928
|
+
}
|
|
1929
|
+
if (!sourceUpdate) {
|
|
1930
|
+
throw new Error('Parameter `sourceUpdate` is required when calling `updateSource`.');
|
|
1931
|
+
}
|
|
1932
|
+
const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
|
|
1933
|
+
const headers = {};
|
|
1934
|
+
const queryParameters = {};
|
|
1935
|
+
const request = {
|
|
1936
|
+
method: 'PATCH',
|
|
1937
|
+
path: requestPath,
|
|
1938
|
+
queryParameters,
|
|
1939
|
+
headers,
|
|
1940
|
+
data: sourceUpdate,
|
|
1941
|
+
};
|
|
1942
|
+
return transporter.request(request, requestOptions);
|
|
1943
|
+
},
|
|
1944
|
+
/**
|
|
1945
|
+
* Updates a task by its ID.
|
|
1946
|
+
*
|
|
1947
|
+
* @param updateTask - The updateTask object.
|
|
1948
|
+
* @param updateTask.taskID - Unique identifier of a task.
|
|
1949
|
+
* @param updateTask.taskUpdate - The taskUpdate object.
|
|
1950
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1951
|
+
*/
|
|
1952
|
+
updateTask({ taskID, taskUpdate }, requestOptions) {
|
|
1953
|
+
if (!taskID) {
|
|
1954
|
+
throw new Error('Parameter `taskID` is required when calling `updateTask`.');
|
|
1955
|
+
}
|
|
1956
|
+
if (!taskUpdate) {
|
|
1957
|
+
throw new Error('Parameter `taskUpdate` is required when calling `updateTask`.');
|
|
1958
|
+
}
|
|
1959
|
+
const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1960
|
+
const headers = {};
|
|
1961
|
+
const queryParameters = {};
|
|
1962
|
+
const request = {
|
|
1963
|
+
method: 'PATCH',
|
|
1964
|
+
path: requestPath,
|
|
1965
|
+
queryParameters,
|
|
1966
|
+
headers,
|
|
1967
|
+
data: taskUpdate,
|
|
1968
|
+
};
|
|
1969
|
+
return transporter.request(request, requestOptions);
|
|
1970
|
+
},
|
|
1971
|
+
};
|
|
1454
1972
|
}
|
|
1455
1973
|
|
|
1456
|
-
//
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1974
|
+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
1975
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
1976
|
+
function ingestionClient(appId, apiKey, region, options) {
|
|
1977
|
+
if (!appId || typeof appId !== 'string') {
|
|
1978
|
+
throw new Error('`appId` is missing.');
|
|
1979
|
+
}
|
|
1980
|
+
if (!apiKey || typeof apiKey !== 'string') {
|
|
1981
|
+
throw new Error('`apiKey` is missing.');
|
|
1982
|
+
}
|
|
1983
|
+
if (!region ||
|
|
1984
|
+
(region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
|
|
1985
|
+
throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
|
|
1986
|
+
}
|
|
1987
|
+
return createIngestionClient({
|
|
1988
|
+
appId,
|
|
1989
|
+
apiKey,
|
|
1990
|
+
region,
|
|
1991
|
+
timeouts: {
|
|
1992
|
+
connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,
|
|
1993
|
+
read: DEFAULT_READ_TIMEOUT_BROWSER,
|
|
1994
|
+
write: DEFAULT_WRITE_TIMEOUT_BROWSER,
|
|
1995
|
+
},
|
|
1996
|
+
requester: createXhrRequester(),
|
|
1997
|
+
algoliaAgents: [{ segment: 'Browser' }],
|
|
1998
|
+
authMode: 'WithinQueryParameters',
|
|
1999
|
+
responsesCache: createMemoryCache(),
|
|
2000
|
+
requestsCache: createMemoryCache({ serializable: false }),
|
|
2001
|
+
hostsCache: createFallbackableCache({
|
|
2002
|
+
caches: [
|
|
2003
|
+
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
|
|
2004
|
+
createMemoryCache(),
|
|
2005
|
+
],
|
|
2006
|
+
}),
|
|
2007
|
+
...options,
|
|
2008
|
+
});
|
|
1490
2009
|
}
|
|
1491
2010
|
|
|
1492
|
-
export { apiClientVersion, ingestionClient };
|
|
2011
|
+
export { apiClientVersion, ingestionClient, isOnDemandTrigger, isScheduleTrigger, isSubscriptionTrigger };
|