@algolia/ingestion 1.0.0-alpha.9 → 1.0.0-beta.10
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/LICENSE +21 -0
- package/dist/builds/browser.d.ts +60 -5
- package/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/node.d.ts +60 -5
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/ingestion.cjs +1565 -0
- package/dist/ingestion.esm.browser.js +1724 -979
- package/dist/ingestion.esm.node.js +1552 -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 +509 -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/dockerStreamsInput.d.ts +4 -0
- package/dist/model/dockerStreamsInput.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 +134 -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/listTransformationsResponse.d.ts +10 -0
- package/dist/model/listTransformationsResponse.d.ts.map +1 -0
- 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/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/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/sortKeys.d.ts +5 -0
- package/dist/model/sortKeys.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/sourceWatchResponse.d.ts +20 -0
- package/dist/model/sourceWatchResponse.d.ts.map +1 -0
- package/dist/model/streamingInput.d.ts +8 -0
- package/dist/model/streamingInput.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/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 +40 -18
- package/dist/model/task.d.ts.map +1 -1
- package/dist/model/taskCreate.d.ts +31 -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 +8 -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/transformation.d.ts +27 -0
- package/dist/model/transformation.d.ts.map +1 -0
- package/dist/model/transformationCreate.d.ts +18 -0
- package/dist/model/transformationCreate.d.ts.map +1 -0
- package/dist/model/transformationCreateResponse.d.ts +14 -0
- package/dist/model/transformationCreateResponse.d.ts.map +1 -0
- package/dist/model/transformationSearch.d.ts +4 -0
- package/dist/model/transformationSearch.d.ts.map +1 -0
- package/dist/model/transformationTry.d.ts +11 -0
- package/dist/model/transformationTry.d.ts.map +1 -0
- package/dist/model/transformationTryResponse.d.ts +9 -0
- package/dist/model/transformationTryResponse.d.ts.map +1 -0
- package/dist/model/transformationTryResponseError.d.ts +14 -0
- package/dist/model/transformationTryResponseError.d.ts.map +1 -0
- package/dist/model/transformationUpdateResponse.d.ts +14 -0
- package/dist/model/transformationUpdateResponse.d.ts.map +1 -0
- 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 +669 -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 +284 -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/dockerStreamsInput.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 +77 -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/listTransformationsResponse.ts +13 -0
- 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/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/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/sortKeys.ts +6 -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/sourceWatchResponse.ts +25 -0
- package/model/streamingInput.ts +10 -0
- package/model/streamingTrigger.ts +10 -0
- package/model/streamingTriggerType.ts +6 -0
- package/model/subscriptionTrigger.ts +10 -0
- package/model/subscriptionTriggerType.ts +6 -0
- package/model/task.ts +29 -4
- package/model/taskCreate.ts +28 -3
- package/model/taskCreateResponse.ts +8 -2
- package/model/taskCreateTrigger.ts +12 -0
- package/model/taskInput.ts +10 -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/transformation.ts +33 -0
- package/model/transformationCreate.ts +21 -0
- package/model/transformationCreateResponse.ts +16 -0
- package/model/transformationSearch.ts +5 -0
- package/model/transformationTry.ts +13 -0
- package/model/transformationTryResponse.ts +12 -0
- package/model/transformationTryResponseError.ts +16 -0
- package/model/transformationUpdateResponse.ts +16 -0
- 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 +14 -10
- 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,33 +195,27 @@ function createStatefulHost(host, status = 'up') {
|
|
|
171
195
|
};
|
|
172
196
|
}
|
|
173
197
|
|
|
174
|
-
function _defineProperty(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
writable: true
|
|
182
|
-
});
|
|
183
|
-
} else {
|
|
184
|
-
obj[key] = value;
|
|
185
|
-
}
|
|
186
|
-
return obj;
|
|
198
|
+
function _defineProperty(e, r, t) {
|
|
199
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
200
|
+
value: t,
|
|
201
|
+
enumerable: !0,
|
|
202
|
+
configurable: !0,
|
|
203
|
+
writable: !0
|
|
204
|
+
}) : e[r] = t, e;
|
|
187
205
|
}
|
|
188
|
-
function _toPrimitive(
|
|
189
|
-
if (
|
|
190
|
-
var
|
|
191
|
-
if (
|
|
192
|
-
var
|
|
193
|
-
if (
|
|
206
|
+
function _toPrimitive(t, r) {
|
|
207
|
+
if ("object" != typeof t || !t) return t;
|
|
208
|
+
var e = t[Symbol.toPrimitive];
|
|
209
|
+
if (void 0 !== e) {
|
|
210
|
+
var i = e.call(t, r || "default");
|
|
211
|
+
if ("object" != typeof i) return i;
|
|
194
212
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
195
213
|
}
|
|
196
|
-
return (
|
|
214
|
+
return ("string" === r ? String : Number)(t);
|
|
197
215
|
}
|
|
198
|
-
function _toPropertyKey(
|
|
199
|
-
var
|
|
200
|
-
return
|
|
216
|
+
function _toPropertyKey(t) {
|
|
217
|
+
var i = _toPrimitive(t, "string");
|
|
218
|
+
return "symbol" == typeof i ? i : i + "";
|
|
201
219
|
}
|
|
202
220
|
|
|
203
221
|
class AlgoliaError extends Error {
|
|
@@ -219,7 +237,7 @@ class ErrorWithStackTrace extends AlgoliaError {
|
|
|
219
237
|
}
|
|
220
238
|
class RetryError extends ErrorWithStackTrace {
|
|
221
239
|
constructor(stackTrace) {
|
|
222
|
-
super('Unreachable hosts - your application id may be incorrect. If the error persists,
|
|
240
|
+
super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');
|
|
223
241
|
}
|
|
224
242
|
}
|
|
225
243
|
class ApiError extends ErrorWithStackTrace {
|
|
@@ -246,15 +264,14 @@ class DetailedApiError extends ApiError {
|
|
|
246
264
|
}
|
|
247
265
|
function serializeUrl(host, path, queryParameters) {
|
|
248
266
|
const queryParametersAsString = serializeQueryParameters(queryParameters);
|
|
249
|
-
let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.
|
|
267
|
+
let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;
|
|
250
268
|
if (queryParametersAsString.length) {
|
|
251
269
|
url += `?${queryParametersAsString}`;
|
|
252
270
|
}
|
|
253
271
|
return url;
|
|
254
272
|
}
|
|
255
273
|
function serializeQueryParameters(parameters) {
|
|
256
|
-
|
|
257
|
-
return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key])}`).join('&');
|
|
274
|
+
return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');
|
|
258
275
|
}
|
|
259
276
|
function serializeData(request, requestOptions) {
|
|
260
277
|
if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {
|
|
@@ -368,16 +385,16 @@ function createTransporter({
|
|
|
368
385
|
return {
|
|
369
386
|
hosts: compatibleHostsAvailable,
|
|
370
387
|
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.
|
|
388
|
+
/**
|
|
389
|
+
* Imagine that you have 4 hosts, if timeouts will increase
|
|
390
|
+
* on the following way: 1 (timed out) > 4 (timed out) > 5 (200).
|
|
391
|
+
*
|
|
392
|
+
* Note that, the very next request, we start from the previous timeout.
|
|
393
|
+
*
|
|
394
|
+
* 5 (timed out) > 6 (timed out) > 7 ...
|
|
395
|
+
*
|
|
396
|
+
* This strategy may need to be reviewed, but is the strategy on the our
|
|
397
|
+
* current v3 version.
|
|
381
398
|
*/
|
|
382
399
|
const timeoutMultiplier = hostsTimedOut.length === 0 && timeoutsCount === 0 ? 1 : hostsTimedOut.length + 3 + timeoutsCount;
|
|
383
400
|
return timeoutMultiplier * baseTimeout;
|
|
@@ -386,8 +403,8 @@ function createTransporter({
|
|
|
386
403
|
}
|
|
387
404
|
async function retryableRequest(request, requestOptions, isRead = true) {
|
|
388
405
|
const stackTrace = [];
|
|
389
|
-
/**
|
|
390
|
-
* First we prepare the payload that do not depend from hosts.
|
|
406
|
+
/**
|
|
407
|
+
* First we prepare the payload that do not depend from hosts.
|
|
391
408
|
*/
|
|
392
409
|
const data = serializeData(request, requestOptions);
|
|
393
410
|
const headers = serializeHeaders(baseHeaders, request.headers, requestOptions.headers);
|
|
@@ -418,29 +435,26 @@ function createTransporter({
|
|
|
418
435
|
}
|
|
419
436
|
let timeoutsCount = 0;
|
|
420
437
|
const retry = async (retryableHosts, getTimeout) => {
|
|
421
|
-
/**
|
|
422
|
-
* We iterate on each host, until there is no host left.
|
|
438
|
+
/**
|
|
439
|
+
* We iterate on each host, until there is no host left.
|
|
423
440
|
*/
|
|
424
441
|
const host = retryableHosts.pop();
|
|
425
442
|
if (host === undefined) {
|
|
426
443
|
throw new RetryError(stackTraceWithoutCredentials(stackTrace));
|
|
427
444
|
}
|
|
428
|
-
let responseTimeout = requestOptions.
|
|
429
|
-
if (responseTimeout === undefined) {
|
|
430
|
-
responseTimeout = isRead ? timeouts.read : timeouts.write;
|
|
431
|
-
}
|
|
445
|
+
let responseTimeout = isRead ? requestOptions.timeouts?.read || timeouts.read : requestOptions.timeouts?.write || timeouts.write;
|
|
432
446
|
const payload = {
|
|
433
447
|
data,
|
|
434
448
|
headers,
|
|
435
449
|
method: request.method,
|
|
436
450
|
url: serializeUrl(host, request.path, queryParameters),
|
|
437
|
-
connectTimeout: getTimeout(timeoutsCount, timeouts.connect),
|
|
451
|
+
connectTimeout: getTimeout(timeoutsCount, requestOptions.timeouts?.connect || timeouts.connect),
|
|
438
452
|
responseTimeout: getTimeout(timeoutsCount, responseTimeout)
|
|
439
453
|
};
|
|
440
|
-
/**
|
|
441
|
-
* The stackFrame is pushed to the stackTrace so we
|
|
442
|
-
* can have information about onRetry and onFailure
|
|
443
|
-
* decisions.
|
|
454
|
+
/**
|
|
455
|
+
* The stackFrame is pushed to the stackTrace so we
|
|
456
|
+
* can have information about onRetry and onFailure
|
|
457
|
+
* decisions.
|
|
444
458
|
*/
|
|
445
459
|
const pushToStackTrace = response => {
|
|
446
460
|
const stackFrame = {
|
|
@@ -459,17 +473,17 @@ function createTransporter({
|
|
|
459
473
|
if (response.isTimedOut) {
|
|
460
474
|
timeoutsCount++;
|
|
461
475
|
}
|
|
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.
|
|
476
|
+
/**
|
|
477
|
+
* Failures are individually sent to the logger, allowing
|
|
478
|
+
* the end user to debug / store stack frames even
|
|
479
|
+
* when a retry error does not happen.
|
|
466
480
|
*/
|
|
467
481
|
// eslint-disable-next-line no-console -- this will be fixed by exposing a `logger` to the transporter
|
|
468
482
|
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.
|
|
483
|
+
/**
|
|
484
|
+
* We also store the state of the host in failure cases. If the host, is
|
|
485
|
+
* down it will remain down for the next 2 minutes. In a timeout situation,
|
|
486
|
+
* this host will be added end of the list of hosts on the next request.
|
|
473
487
|
*/
|
|
474
488
|
await hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? 'timed out' : 'down'));
|
|
475
489
|
return retry(retryableHosts, getTimeout);
|
|
@@ -480,56 +494,56 @@ function createTransporter({
|
|
|
480
494
|
pushToStackTrace(response);
|
|
481
495
|
throw deserializeFailure(response, stackTrace);
|
|
482
496
|
};
|
|
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.
|
|
497
|
+
/**
|
|
498
|
+
* Finally, for each retryable host perform request until we got a non
|
|
499
|
+
* retryable response. Some notes here:
|
|
500
|
+
*
|
|
501
|
+
* 1. The reverse here is applied so we can apply a `pop` later on => more performant.
|
|
502
|
+
* 2. We also get from the retryable options a timeout multiplier that is tailored
|
|
503
|
+
* for the current context.
|
|
490
504
|
*/
|
|
491
505
|
const compatibleHosts = hosts.filter(host => host.accept === 'readWrite' || (isRead ? host.accept === 'read' : host.accept === 'write'));
|
|
492
506
|
const options = await createRetryableOptions(compatibleHosts);
|
|
493
507
|
return retry([...options.hosts].reverse(), options.getTimeout);
|
|
494
508
|
}
|
|
495
509
|
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`).
|
|
510
|
+
/**
|
|
511
|
+
* A read request is either a `GET` request, or a request that we make
|
|
512
|
+
* via the `read` transporter (e.g. `search`).
|
|
499
513
|
*/
|
|
500
514
|
const isRead = request.useReadTransporter || request.method === 'GET';
|
|
501
515
|
if (!isRead) {
|
|
502
|
-
/**
|
|
503
|
-
* On write requests, no cache mechanisms are applied, and we
|
|
504
|
-
* proxy the request immediately to the requester.
|
|
516
|
+
/**
|
|
517
|
+
* On write requests, no cache mechanisms are applied, and we
|
|
518
|
+
* proxy the request immediately to the requester.
|
|
505
519
|
*/
|
|
506
520
|
return retryableRequest(request, requestOptions, isRead);
|
|
507
521
|
}
|
|
508
522
|
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.
|
|
523
|
+
/**
|
|
524
|
+
* Then, we prepare a function factory that contains the construction of
|
|
525
|
+
* the retryable request. At this point, we may *not* perform the actual
|
|
526
|
+
* request. But we want to have the function factory ready.
|
|
513
527
|
*/
|
|
514
528
|
return retryableRequest(request, requestOptions);
|
|
515
529
|
};
|
|
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.
|
|
530
|
+
/**
|
|
531
|
+
* Once we have the function factory ready, we need to determine of the
|
|
532
|
+
* request is "cacheable" - should be cached. Note that, once again,
|
|
533
|
+
* the user can force this option.
|
|
520
534
|
*/
|
|
521
535
|
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.
|
|
536
|
+
/**
|
|
537
|
+
* If is not "cacheable", we immediately trigger the retryable request, no
|
|
538
|
+
* need to check cache implementations.
|
|
525
539
|
*/
|
|
526
540
|
if (cacheable !== true) {
|
|
527
541
|
return createRetryableRequest();
|
|
528
542
|
}
|
|
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.
|
|
543
|
+
/**
|
|
544
|
+
* If the request is "cacheable", we need to first compute the key to ask
|
|
545
|
+
* the cache implementations if this request is on progress or if the
|
|
546
|
+
* response already exists on the cache.
|
|
533
547
|
*/
|
|
534
548
|
const key = {
|
|
535
549
|
request,
|
|
@@ -539,27 +553,27 @@ function createTransporter({
|
|
|
539
553
|
headers: baseHeaders
|
|
540
554
|
}
|
|
541
555
|
};
|
|
542
|
-
/**
|
|
543
|
-
* With the computed key, we first ask the responses cache
|
|
544
|
-
* implementation if this request was been resolved before.
|
|
556
|
+
/**
|
|
557
|
+
* With the computed key, we first ask the responses cache
|
|
558
|
+
* implementation if this request was been resolved before.
|
|
545
559
|
*/
|
|
546
560
|
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.
|
|
561
|
+
/**
|
|
562
|
+
* If the request has never resolved before, we actually ask if there
|
|
563
|
+
* is a current request with the same key on progress.
|
|
550
564
|
*/
|
|
551
565
|
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.
|
|
566
|
+
/**
|
|
567
|
+
* Finally, if there is no request in progress with the same key,
|
|
568
|
+
* this `createRetryableRequest()` will actually trigger the
|
|
569
|
+
* retryable request.
|
|
556
570
|
*/
|
|
557
571
|
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
572
|
}, {
|
|
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.
|
|
573
|
+
/**
|
|
574
|
+
* Of course, once we get this response back from the server, we
|
|
575
|
+
* tell response cache to actually store the received response
|
|
576
|
+
* to be used later.
|
|
563
577
|
*/
|
|
564
578
|
miss: response => responsesCache.set(key, response)
|
|
565
579
|
});
|
|
@@ -609,884 +623,1615 @@ const DEFAULT_CONNECT_TIMEOUT_BROWSER = 1000;
|
|
|
609
623
|
const DEFAULT_READ_TIMEOUT_BROWSER = 2000;
|
|
610
624
|
const DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;
|
|
611
625
|
|
|
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 };
|
|
626
|
+
function createXhrRequester() {
|
|
627
|
+
function send(request) {
|
|
628
|
+
return new Promise((resolve) => {
|
|
629
|
+
const baseRequester = new XMLHttpRequest();
|
|
630
|
+
baseRequester.open(request.method, request.url, true);
|
|
631
|
+
Object.keys(request.headers).forEach((key) => baseRequester.setRequestHeader(key, request.headers[key]));
|
|
632
|
+
const createTimeout = (timeout, content) => {
|
|
633
|
+
return setTimeout(() => {
|
|
634
|
+
baseRequester.abort();
|
|
635
|
+
resolve({
|
|
636
|
+
status: 0,
|
|
637
|
+
content,
|
|
638
|
+
isTimedOut: true,
|
|
639
|
+
});
|
|
640
|
+
}, timeout);
|
|
641
|
+
};
|
|
642
|
+
const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');
|
|
643
|
+
let responseTimeout;
|
|
644
|
+
baseRequester.onreadystatechange = () => {
|
|
645
|
+
if (baseRequester.readyState > baseRequester.OPENED &&
|
|
646
|
+
responseTimeout === undefined) {
|
|
647
|
+
clearTimeout(connectTimeout);
|
|
648
|
+
responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
baseRequester.onerror = () => {
|
|
652
|
+
// istanbul ignore next
|
|
653
|
+
if (baseRequester.status === 0) {
|
|
654
|
+
clearTimeout(connectTimeout);
|
|
655
|
+
clearTimeout(responseTimeout);
|
|
656
|
+
resolve({
|
|
657
|
+
content: baseRequester.responseText || 'Network request failed',
|
|
658
|
+
status: baseRequester.status,
|
|
659
|
+
isTimedOut: false,
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
};
|
|
663
|
+
baseRequester.onload = () => {
|
|
664
|
+
clearTimeout(connectTimeout);
|
|
665
|
+
clearTimeout(responseTimeout);
|
|
666
|
+
resolve({
|
|
667
|
+
content: baseRequester.responseText,
|
|
668
|
+
status: baseRequester.status,
|
|
669
|
+
isTimedOut: false,
|
|
670
|
+
});
|
|
671
|
+
};
|
|
672
|
+
baseRequester.send(request.data);
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
return { send };
|
|
662
676
|
}
|
|
663
677
|
|
|
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
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
if (!
|
|
902
|
-
throw new Error('Parameter `
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
const
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
*
|
|
921
|
-
*
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
*
|
|
944
|
-
*
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
*
|
|
967
|
-
*
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
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
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
};
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
*
|
|
1098
|
-
*
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
*
|
|
1123
|
-
*
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
*
|
|
1146
|
-
*
|
|
1147
|
-
*
|
|
1148
|
-
* @param
|
|
1149
|
-
* @param
|
|
1150
|
-
* @param
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
const
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
*
|
|
1173
|
-
*
|
|
1174
|
-
*
|
|
1175
|
-
* @param
|
|
1176
|
-
* @param
|
|
1177
|
-
* @param
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
}
|
|
1185
|
-
const
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
queryParameters
|
|
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
|
-
* @param
|
|
1230
|
-
* @param
|
|
1231
|
-
* @param
|
|
1232
|
-
* @param
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
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
|
-
|
|
678
|
+
// 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.
|
|
679
|
+
const apiClientVersion = '1.0.0-beta.10';
|
|
680
|
+
const REGIONS = ['eu', 'us'];
|
|
681
|
+
function getDefaultHosts(region) {
|
|
682
|
+
const url = 'data.{region}.algolia.com'.replace('{region}', region);
|
|
683
|
+
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Guard: Return strongly typed specific OnDemandTrigger for a given Trigger.
|
|
687
|
+
*
|
|
688
|
+
* @summary Guard method that returns a strongly typed specific OnDemandTrigger for a given Trigger.
|
|
689
|
+
* @param trigger - The given Task Trigger.
|
|
690
|
+
*/
|
|
691
|
+
function isOnDemandTrigger(trigger) {
|
|
692
|
+
return trigger.type === 'onDemand';
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Guard: Return strongly typed specific ScheduleTrigger for a given Trigger.
|
|
696
|
+
*
|
|
697
|
+
* @summary Guard method that returns a strongly typed specific ScheduleTrigger for a given Trigger.
|
|
698
|
+
* @param trigger - The given Task Trigger.
|
|
699
|
+
*/
|
|
700
|
+
function isScheduleTrigger(trigger) {
|
|
701
|
+
return trigger.type === 'schedule';
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Guard: Return strongly typed specific SubscriptionTrigger for a given Trigger.
|
|
705
|
+
*
|
|
706
|
+
* @summary Guard method that returns a strongly typed specific SubscriptionTrigger for a given Trigger.
|
|
707
|
+
* @param trigger - The given Task Trigger.
|
|
708
|
+
*/
|
|
709
|
+
function isSubscriptionTrigger(trigger) {
|
|
710
|
+
return trigger.type === 'subscription';
|
|
711
|
+
}
|
|
712
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
713
|
+
function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
|
|
714
|
+
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
|
715
|
+
const transporter = createTransporter({
|
|
716
|
+
hosts: getDefaultHosts(regionOption),
|
|
717
|
+
...options,
|
|
718
|
+
algoliaAgent: getAlgoliaAgent({
|
|
719
|
+
algoliaAgents,
|
|
720
|
+
client: 'Ingestion',
|
|
721
|
+
version: apiClientVersion,
|
|
722
|
+
}),
|
|
723
|
+
baseHeaders: {
|
|
724
|
+
'content-type': 'text/plain',
|
|
725
|
+
...auth.headers(),
|
|
726
|
+
...options.baseHeaders,
|
|
727
|
+
},
|
|
728
|
+
baseQueryParameters: {
|
|
729
|
+
...auth.queryParameters(),
|
|
730
|
+
...options.baseQueryParameters,
|
|
731
|
+
},
|
|
732
|
+
});
|
|
733
|
+
return {
|
|
734
|
+
transporter,
|
|
735
|
+
/**
|
|
736
|
+
* The `appId` currently in use.
|
|
737
|
+
*/
|
|
738
|
+
appId: appIdOption,
|
|
739
|
+
/**
|
|
740
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
741
|
+
*/
|
|
742
|
+
clearCache() {
|
|
743
|
+
return Promise.all([
|
|
744
|
+
transporter.requestsCache.clear(),
|
|
745
|
+
transporter.responsesCache.clear(),
|
|
746
|
+
]).then(() => undefined);
|
|
747
|
+
},
|
|
748
|
+
/**
|
|
749
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
750
|
+
*/
|
|
751
|
+
get _ua() {
|
|
752
|
+
return transporter.algoliaAgent.value;
|
|
753
|
+
},
|
|
754
|
+
/**
|
|
755
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
756
|
+
*
|
|
757
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
758
|
+
* @param version - The version of the agent.
|
|
759
|
+
*/
|
|
760
|
+
addAlgoliaAgent(segment, version) {
|
|
761
|
+
transporter.algoliaAgent.add({ segment, version });
|
|
762
|
+
},
|
|
763
|
+
/**
|
|
764
|
+
* Creates a new authentication resource.
|
|
765
|
+
*
|
|
766
|
+
* Required API Key ACLs:
|
|
767
|
+
* - addObject
|
|
768
|
+
* - deleteIndex
|
|
769
|
+
* - editSettings.
|
|
770
|
+
*
|
|
771
|
+
* @param authenticationCreate -.
|
|
772
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
773
|
+
*/
|
|
774
|
+
createAuthentication(authenticationCreate, requestOptions) {
|
|
775
|
+
if (!authenticationCreate) {
|
|
776
|
+
throw new Error('Parameter `authenticationCreate` is required when calling `createAuthentication`.');
|
|
777
|
+
}
|
|
778
|
+
if (!authenticationCreate.type) {
|
|
779
|
+
throw new Error('Parameter `authenticationCreate.type` is required when calling `createAuthentication`.');
|
|
780
|
+
}
|
|
781
|
+
if (!authenticationCreate.name) {
|
|
782
|
+
throw new Error('Parameter `authenticationCreate.name` is required when calling `createAuthentication`.');
|
|
783
|
+
}
|
|
784
|
+
if (!authenticationCreate.input) {
|
|
785
|
+
throw new Error('Parameter `authenticationCreate.input` is required when calling `createAuthentication`.');
|
|
786
|
+
}
|
|
787
|
+
const requestPath = '/1/authentications';
|
|
788
|
+
const headers = {};
|
|
789
|
+
const queryParameters = {};
|
|
790
|
+
const request = {
|
|
791
|
+
method: 'POST',
|
|
792
|
+
path: requestPath,
|
|
793
|
+
queryParameters,
|
|
794
|
+
headers,
|
|
795
|
+
data: authenticationCreate,
|
|
796
|
+
};
|
|
797
|
+
return transporter.request(request, requestOptions);
|
|
798
|
+
},
|
|
799
|
+
/**
|
|
800
|
+
* Creates a new destination.
|
|
801
|
+
*
|
|
802
|
+
* Required API Key ACLs:
|
|
803
|
+
* - addObject
|
|
804
|
+
* - deleteIndex
|
|
805
|
+
* - editSettings.
|
|
806
|
+
*
|
|
807
|
+
* @param destinationCreate -.
|
|
808
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
809
|
+
*/
|
|
810
|
+
createDestination(destinationCreate, requestOptions) {
|
|
811
|
+
if (!destinationCreate) {
|
|
812
|
+
throw new Error('Parameter `destinationCreate` is required when calling `createDestination`.');
|
|
813
|
+
}
|
|
814
|
+
if (!destinationCreate.type) {
|
|
815
|
+
throw new Error('Parameter `destinationCreate.type` is required when calling `createDestination`.');
|
|
816
|
+
}
|
|
817
|
+
if (!destinationCreate.name) {
|
|
818
|
+
throw new Error('Parameter `destinationCreate.name` is required when calling `createDestination`.');
|
|
819
|
+
}
|
|
820
|
+
if (!destinationCreate.input) {
|
|
821
|
+
throw new Error('Parameter `destinationCreate.input` is required when calling `createDestination`.');
|
|
822
|
+
}
|
|
823
|
+
const requestPath = '/1/destinations';
|
|
824
|
+
const headers = {};
|
|
825
|
+
const queryParameters = {};
|
|
826
|
+
const request = {
|
|
827
|
+
method: 'POST',
|
|
828
|
+
path: requestPath,
|
|
829
|
+
queryParameters,
|
|
830
|
+
headers,
|
|
831
|
+
data: destinationCreate,
|
|
832
|
+
};
|
|
833
|
+
return transporter.request(request, requestOptions);
|
|
834
|
+
},
|
|
835
|
+
/**
|
|
836
|
+
* Creates a new source.
|
|
837
|
+
*
|
|
838
|
+
* Required API Key ACLs:
|
|
839
|
+
* - addObject
|
|
840
|
+
* - deleteIndex
|
|
841
|
+
* - editSettings.
|
|
842
|
+
*
|
|
843
|
+
* @param sourceCreate -.
|
|
844
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
845
|
+
*/
|
|
846
|
+
createSource(sourceCreate, requestOptions) {
|
|
847
|
+
if (!sourceCreate) {
|
|
848
|
+
throw new Error('Parameter `sourceCreate` is required when calling `createSource`.');
|
|
849
|
+
}
|
|
850
|
+
if (!sourceCreate.type) {
|
|
851
|
+
throw new Error('Parameter `sourceCreate.type` is required when calling `createSource`.');
|
|
852
|
+
}
|
|
853
|
+
if (!sourceCreate.name) {
|
|
854
|
+
throw new Error('Parameter `sourceCreate.name` is required when calling `createSource`.');
|
|
855
|
+
}
|
|
856
|
+
if (!sourceCreate.input) {
|
|
857
|
+
throw new Error('Parameter `sourceCreate.input` is required when calling `createSource`.');
|
|
858
|
+
}
|
|
859
|
+
const requestPath = '/1/sources';
|
|
860
|
+
const headers = {};
|
|
861
|
+
const queryParameters = {};
|
|
862
|
+
const request = {
|
|
863
|
+
method: 'POST',
|
|
864
|
+
path: requestPath,
|
|
865
|
+
queryParameters,
|
|
866
|
+
headers,
|
|
867
|
+
data: sourceCreate,
|
|
868
|
+
};
|
|
869
|
+
return transporter.request(request, requestOptions);
|
|
870
|
+
},
|
|
871
|
+
/**
|
|
872
|
+
* Creates a new task.
|
|
873
|
+
*
|
|
874
|
+
* @param taskCreate - Request body for creating a task.
|
|
875
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
876
|
+
*/
|
|
877
|
+
createTask(taskCreate, requestOptions) {
|
|
878
|
+
if (!taskCreate) {
|
|
879
|
+
throw new Error('Parameter `taskCreate` is required when calling `createTask`.');
|
|
880
|
+
}
|
|
881
|
+
if (!taskCreate.sourceID) {
|
|
882
|
+
throw new Error('Parameter `taskCreate.sourceID` is required when calling `createTask`.');
|
|
883
|
+
}
|
|
884
|
+
if (!taskCreate.destinationID) {
|
|
885
|
+
throw new Error('Parameter `taskCreate.destinationID` is required when calling `createTask`.');
|
|
886
|
+
}
|
|
887
|
+
if (!taskCreate.trigger) {
|
|
888
|
+
throw new Error('Parameter `taskCreate.trigger` is required when calling `createTask`.');
|
|
889
|
+
}
|
|
890
|
+
if (!taskCreate.action) {
|
|
891
|
+
throw new Error('Parameter `taskCreate.action` is required when calling `createTask`.');
|
|
892
|
+
}
|
|
893
|
+
const requestPath = '/1/tasks';
|
|
894
|
+
const headers = {};
|
|
895
|
+
const queryParameters = {};
|
|
896
|
+
const request = {
|
|
897
|
+
method: 'POST',
|
|
898
|
+
path: requestPath,
|
|
899
|
+
queryParameters,
|
|
900
|
+
headers,
|
|
901
|
+
data: taskCreate,
|
|
902
|
+
};
|
|
903
|
+
return transporter.request(request, requestOptions);
|
|
904
|
+
},
|
|
905
|
+
/**
|
|
906
|
+
* Creates a new transformation.
|
|
907
|
+
*
|
|
908
|
+
* @param transformationCreate - Request body for creating a transformation.
|
|
909
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
910
|
+
*/
|
|
911
|
+
createTransformation(transformationCreate, requestOptions) {
|
|
912
|
+
if (!transformationCreate) {
|
|
913
|
+
throw new Error('Parameter `transformationCreate` is required when calling `createTransformation`.');
|
|
914
|
+
}
|
|
915
|
+
if (!transformationCreate.code) {
|
|
916
|
+
throw new Error('Parameter `transformationCreate.code` is required when calling `createTransformation`.');
|
|
917
|
+
}
|
|
918
|
+
if (!transformationCreate.name) {
|
|
919
|
+
throw new Error('Parameter `transformationCreate.name` is required when calling `createTransformation`.');
|
|
920
|
+
}
|
|
921
|
+
const requestPath = '/1/transformations';
|
|
922
|
+
const headers = {};
|
|
923
|
+
const queryParameters = {};
|
|
924
|
+
const request = {
|
|
925
|
+
method: 'POST',
|
|
926
|
+
path: requestPath,
|
|
927
|
+
queryParameters,
|
|
928
|
+
headers,
|
|
929
|
+
data: transformationCreate,
|
|
930
|
+
};
|
|
931
|
+
return transporter.request(request, requestOptions);
|
|
932
|
+
},
|
|
933
|
+
/**
|
|
934
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
935
|
+
*
|
|
936
|
+
* @param customDelete - The customDelete object.
|
|
937
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
938
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
939
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
940
|
+
*/
|
|
941
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
942
|
+
if (!path) {
|
|
943
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
944
|
+
}
|
|
945
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
946
|
+
const headers = {};
|
|
947
|
+
const queryParameters = parameters ? parameters : {};
|
|
948
|
+
const request = {
|
|
949
|
+
method: 'DELETE',
|
|
950
|
+
path: requestPath,
|
|
951
|
+
queryParameters,
|
|
952
|
+
headers,
|
|
953
|
+
};
|
|
954
|
+
return transporter.request(request, requestOptions);
|
|
955
|
+
},
|
|
956
|
+
/**
|
|
957
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
958
|
+
*
|
|
959
|
+
* @param customGet - The customGet object.
|
|
960
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
961
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
962
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
963
|
+
*/
|
|
964
|
+
customGet({ path, parameters }, requestOptions) {
|
|
965
|
+
if (!path) {
|
|
966
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
967
|
+
}
|
|
968
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
969
|
+
const headers = {};
|
|
970
|
+
const queryParameters = parameters ? parameters : {};
|
|
971
|
+
const request = {
|
|
972
|
+
method: 'GET',
|
|
973
|
+
path: requestPath,
|
|
974
|
+
queryParameters,
|
|
975
|
+
headers,
|
|
976
|
+
};
|
|
977
|
+
return transporter.request(request, requestOptions);
|
|
978
|
+
},
|
|
979
|
+
/**
|
|
980
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
981
|
+
*
|
|
982
|
+
* @param customPost - The customPost object.
|
|
983
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
984
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
985
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
986
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
987
|
+
*/
|
|
988
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
989
|
+
if (!path) {
|
|
990
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
991
|
+
}
|
|
992
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
993
|
+
const headers = {};
|
|
994
|
+
const queryParameters = parameters ? parameters : {};
|
|
995
|
+
const request = {
|
|
996
|
+
method: 'POST',
|
|
997
|
+
path: requestPath,
|
|
998
|
+
queryParameters,
|
|
999
|
+
headers,
|
|
1000
|
+
data: body ? body : {},
|
|
1001
|
+
};
|
|
1002
|
+
return transporter.request(request, requestOptions);
|
|
1003
|
+
},
|
|
1004
|
+
/**
|
|
1005
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
1006
|
+
*
|
|
1007
|
+
* @param customPut - The customPut object.
|
|
1008
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1009
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
1010
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
1011
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1012
|
+
*/
|
|
1013
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
1014
|
+
if (!path) {
|
|
1015
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
1016
|
+
}
|
|
1017
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
1018
|
+
const headers = {};
|
|
1019
|
+
const queryParameters = parameters ? parameters : {};
|
|
1020
|
+
const request = {
|
|
1021
|
+
method: 'PUT',
|
|
1022
|
+
path: requestPath,
|
|
1023
|
+
queryParameters,
|
|
1024
|
+
headers,
|
|
1025
|
+
data: body ? body : {},
|
|
1026
|
+
};
|
|
1027
|
+
return transporter.request(request, requestOptions);
|
|
1028
|
+
},
|
|
1029
|
+
/**
|
|
1030
|
+
* Deletes an authentication resource. You can\'t delete authentication resources that are used by a source or a destination.
|
|
1031
|
+
*
|
|
1032
|
+
* Required API Key ACLs:
|
|
1033
|
+
* - addObject
|
|
1034
|
+
* - deleteIndex
|
|
1035
|
+
* - editSettings.
|
|
1036
|
+
*
|
|
1037
|
+
* @param deleteAuthentication - The deleteAuthentication object.
|
|
1038
|
+
* @param deleteAuthentication.authenticationID - Unique identifier of an authentication resource.
|
|
1039
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1040
|
+
*/
|
|
1041
|
+
deleteAuthentication({ authenticationID }, requestOptions) {
|
|
1042
|
+
if (!authenticationID) {
|
|
1043
|
+
throw new Error('Parameter `authenticationID` is required when calling `deleteAuthentication`.');
|
|
1044
|
+
}
|
|
1045
|
+
const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
|
|
1046
|
+
const headers = {};
|
|
1047
|
+
const queryParameters = {};
|
|
1048
|
+
const request = {
|
|
1049
|
+
method: 'DELETE',
|
|
1050
|
+
path: requestPath,
|
|
1051
|
+
queryParameters,
|
|
1052
|
+
headers,
|
|
1053
|
+
};
|
|
1054
|
+
return transporter.request(request, requestOptions);
|
|
1055
|
+
},
|
|
1056
|
+
/**
|
|
1057
|
+
* Deletes a destination by its ID. You can\'t delete destinations that are referenced in tasks.
|
|
1058
|
+
*
|
|
1059
|
+
* Required API Key ACLs:
|
|
1060
|
+
* - addObject
|
|
1061
|
+
* - deleteIndex
|
|
1062
|
+
* - editSettings.
|
|
1063
|
+
*
|
|
1064
|
+
* @param deleteDestination - The deleteDestination object.
|
|
1065
|
+
* @param deleteDestination.destinationID - Unique identifier of a destination.
|
|
1066
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1067
|
+
*/
|
|
1068
|
+
deleteDestination({ destinationID }, requestOptions) {
|
|
1069
|
+
if (!destinationID) {
|
|
1070
|
+
throw new Error('Parameter `destinationID` is required when calling `deleteDestination`.');
|
|
1071
|
+
}
|
|
1072
|
+
const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
|
|
1073
|
+
const headers = {};
|
|
1074
|
+
const queryParameters = {};
|
|
1075
|
+
const request = {
|
|
1076
|
+
method: 'DELETE',
|
|
1077
|
+
path: requestPath,
|
|
1078
|
+
queryParameters,
|
|
1079
|
+
headers,
|
|
1080
|
+
};
|
|
1081
|
+
return transporter.request(request, requestOptions);
|
|
1082
|
+
},
|
|
1083
|
+
/**
|
|
1084
|
+
* Deletes a source by its ID. You can\'t delete sources that are referenced in tasks.
|
|
1085
|
+
*
|
|
1086
|
+
* Required API Key ACLs:
|
|
1087
|
+
* - addObject
|
|
1088
|
+
* - deleteIndex
|
|
1089
|
+
* - editSettings.
|
|
1090
|
+
*
|
|
1091
|
+
* @param deleteSource - The deleteSource object.
|
|
1092
|
+
* @param deleteSource.sourceID - Unique identifier of a source.
|
|
1093
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1094
|
+
*/
|
|
1095
|
+
deleteSource({ sourceID }, requestOptions) {
|
|
1096
|
+
if (!sourceID) {
|
|
1097
|
+
throw new Error('Parameter `sourceID` is required when calling `deleteSource`.');
|
|
1098
|
+
}
|
|
1099
|
+
const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
|
|
1100
|
+
const headers = {};
|
|
1101
|
+
const queryParameters = {};
|
|
1102
|
+
const request = {
|
|
1103
|
+
method: 'DELETE',
|
|
1104
|
+
path: requestPath,
|
|
1105
|
+
queryParameters,
|
|
1106
|
+
headers,
|
|
1107
|
+
};
|
|
1108
|
+
return transporter.request(request, requestOptions);
|
|
1109
|
+
},
|
|
1110
|
+
/**
|
|
1111
|
+
* Deletes a task by its ID.
|
|
1112
|
+
*
|
|
1113
|
+
* @param deleteTask - The deleteTask object.
|
|
1114
|
+
* @param deleteTask.taskID - Unique identifier of a task.
|
|
1115
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1116
|
+
*/
|
|
1117
|
+
deleteTask({ taskID }, requestOptions) {
|
|
1118
|
+
if (!taskID) {
|
|
1119
|
+
throw new Error('Parameter `taskID` is required when calling `deleteTask`.');
|
|
1120
|
+
}
|
|
1121
|
+
const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1122
|
+
const headers = {};
|
|
1123
|
+
const queryParameters = {};
|
|
1124
|
+
const request = {
|
|
1125
|
+
method: 'DELETE',
|
|
1126
|
+
path: requestPath,
|
|
1127
|
+
queryParameters,
|
|
1128
|
+
headers,
|
|
1129
|
+
};
|
|
1130
|
+
return transporter.request(request, requestOptions);
|
|
1131
|
+
},
|
|
1132
|
+
/**
|
|
1133
|
+
* Deletes a transformation by its ID.
|
|
1134
|
+
*
|
|
1135
|
+
* @param deleteTransformation - The deleteTransformation object.
|
|
1136
|
+
* @param deleteTransformation.transformationID - Unique identifier of a transformation.
|
|
1137
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1138
|
+
*/
|
|
1139
|
+
deleteTransformation({ transformationID }, requestOptions) {
|
|
1140
|
+
if (!transformationID) {
|
|
1141
|
+
throw new Error('Parameter `transformationID` is required when calling `deleteTransformation`.');
|
|
1142
|
+
}
|
|
1143
|
+
const requestPath = '/1/transformations/{transformationID}'.replace('{transformationID}', encodeURIComponent(transformationID));
|
|
1144
|
+
const headers = {};
|
|
1145
|
+
const queryParameters = {};
|
|
1146
|
+
const request = {
|
|
1147
|
+
method: 'DELETE',
|
|
1148
|
+
path: requestPath,
|
|
1149
|
+
queryParameters,
|
|
1150
|
+
headers,
|
|
1151
|
+
};
|
|
1152
|
+
return transporter.request(request, requestOptions);
|
|
1153
|
+
},
|
|
1154
|
+
/**
|
|
1155
|
+
* Disables a task.
|
|
1156
|
+
*
|
|
1157
|
+
* Required API Key ACLs:
|
|
1158
|
+
* - addObject
|
|
1159
|
+
* - deleteIndex
|
|
1160
|
+
* - editSettings.
|
|
1161
|
+
*
|
|
1162
|
+
* @param disableTask - The disableTask object.
|
|
1163
|
+
* @param disableTask.taskID - Unique identifier of a task.
|
|
1164
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1165
|
+
*/
|
|
1166
|
+
disableTask({ taskID }, requestOptions) {
|
|
1167
|
+
if (!taskID) {
|
|
1168
|
+
throw new Error('Parameter `taskID` is required when calling `disableTask`.');
|
|
1169
|
+
}
|
|
1170
|
+
const requestPath = '/1/tasks/{taskID}/disable'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1171
|
+
const headers = {};
|
|
1172
|
+
const queryParameters = {};
|
|
1173
|
+
const request = {
|
|
1174
|
+
method: 'PUT',
|
|
1175
|
+
path: requestPath,
|
|
1176
|
+
queryParameters,
|
|
1177
|
+
headers,
|
|
1178
|
+
};
|
|
1179
|
+
return transporter.request(request, requestOptions);
|
|
1180
|
+
},
|
|
1181
|
+
/**
|
|
1182
|
+
* Enables a task.
|
|
1183
|
+
*
|
|
1184
|
+
* Required API Key ACLs:
|
|
1185
|
+
* - addObject
|
|
1186
|
+
* - deleteIndex
|
|
1187
|
+
* - editSettings.
|
|
1188
|
+
*
|
|
1189
|
+
* @param enableTask - The enableTask object.
|
|
1190
|
+
* @param enableTask.taskID - Unique identifier of a task.
|
|
1191
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1192
|
+
*/
|
|
1193
|
+
enableTask({ taskID }, requestOptions) {
|
|
1194
|
+
if (!taskID) {
|
|
1195
|
+
throw new Error('Parameter `taskID` is required when calling `enableTask`.');
|
|
1196
|
+
}
|
|
1197
|
+
const requestPath = '/1/tasks/{taskID}/enable'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1198
|
+
const headers = {};
|
|
1199
|
+
const queryParameters = {};
|
|
1200
|
+
const request = {
|
|
1201
|
+
method: 'PUT',
|
|
1202
|
+
path: requestPath,
|
|
1203
|
+
queryParameters,
|
|
1204
|
+
headers,
|
|
1205
|
+
};
|
|
1206
|
+
return transporter.request(request, requestOptions);
|
|
1207
|
+
},
|
|
1208
|
+
/**
|
|
1209
|
+
* Retrieves an authentication resource by its ID.
|
|
1210
|
+
*
|
|
1211
|
+
* Required API Key ACLs:
|
|
1212
|
+
* - addObject
|
|
1213
|
+
* - deleteIndex
|
|
1214
|
+
* - editSettings.
|
|
1215
|
+
*
|
|
1216
|
+
* @param getAuthentication - The getAuthentication object.
|
|
1217
|
+
* @param getAuthentication.authenticationID - Unique identifier of an authentication resource.
|
|
1218
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1219
|
+
*/
|
|
1220
|
+
getAuthentication({ authenticationID }, requestOptions) {
|
|
1221
|
+
if (!authenticationID) {
|
|
1222
|
+
throw new Error('Parameter `authenticationID` is required when calling `getAuthentication`.');
|
|
1223
|
+
}
|
|
1224
|
+
const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
|
|
1225
|
+
const headers = {};
|
|
1226
|
+
const queryParameters = {};
|
|
1227
|
+
const request = {
|
|
1228
|
+
method: 'GET',
|
|
1229
|
+
path: requestPath,
|
|
1230
|
+
queryParameters,
|
|
1231
|
+
headers,
|
|
1232
|
+
};
|
|
1233
|
+
return transporter.request(request, requestOptions);
|
|
1234
|
+
},
|
|
1235
|
+
/**
|
|
1236
|
+
* Retrieves a list of all authentication resources.
|
|
1237
|
+
*
|
|
1238
|
+
* Required API Key ACLs:
|
|
1239
|
+
* - addObject
|
|
1240
|
+
* - deleteIndex
|
|
1241
|
+
* - editSettings.
|
|
1242
|
+
*
|
|
1243
|
+
* @param getAuthentications - The getAuthentications object.
|
|
1244
|
+
* @param getAuthentications.itemsPerPage - Number of items per page.
|
|
1245
|
+
* @param getAuthentications.page - Page number of the paginated API response.
|
|
1246
|
+
* @param getAuthentications.type - Type of authentication resource to retrieve.
|
|
1247
|
+
* @param getAuthentications.platform - Ecommerce platform for which to retrieve authentication resources.
|
|
1248
|
+
* @param getAuthentications.sort - Property by which to sort the list of authentication resources.
|
|
1249
|
+
* @param getAuthentications.order - Sort order of the response, ascending or descending.
|
|
1250
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1251
|
+
*/
|
|
1252
|
+
getAuthentications({ itemsPerPage, page, type, platform, sort, order, } = {}, requestOptions = undefined) {
|
|
1253
|
+
const requestPath = '/1/authentications';
|
|
1254
|
+
const headers = {};
|
|
1255
|
+
const queryParameters = {};
|
|
1256
|
+
if (itemsPerPage !== undefined) {
|
|
1257
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1258
|
+
}
|
|
1259
|
+
if (page !== undefined) {
|
|
1260
|
+
queryParameters.page = page.toString();
|
|
1261
|
+
}
|
|
1262
|
+
if (type !== undefined) {
|
|
1263
|
+
queryParameters.type = type.toString();
|
|
1264
|
+
}
|
|
1265
|
+
if (platform !== undefined) {
|
|
1266
|
+
queryParameters.platform = platform.toString();
|
|
1267
|
+
}
|
|
1268
|
+
if (sort !== undefined) {
|
|
1269
|
+
queryParameters.sort = sort.toString();
|
|
1270
|
+
}
|
|
1271
|
+
if (order !== undefined) {
|
|
1272
|
+
queryParameters.order = order.toString();
|
|
1273
|
+
}
|
|
1274
|
+
const request = {
|
|
1275
|
+
method: 'GET',
|
|
1276
|
+
path: requestPath,
|
|
1277
|
+
queryParameters,
|
|
1278
|
+
headers,
|
|
1279
|
+
};
|
|
1280
|
+
return transporter.request(request, requestOptions);
|
|
1281
|
+
},
|
|
1282
|
+
/**
|
|
1283
|
+
* Retrieves a destination by its ID.
|
|
1284
|
+
*
|
|
1285
|
+
* Required API Key ACLs:
|
|
1286
|
+
* - addObject
|
|
1287
|
+
* - deleteIndex
|
|
1288
|
+
* - editSettings.
|
|
1289
|
+
*
|
|
1290
|
+
* @param getDestination - The getDestination object.
|
|
1291
|
+
* @param getDestination.destinationID - Unique identifier of a destination.
|
|
1292
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1293
|
+
*/
|
|
1294
|
+
getDestination({ destinationID }, requestOptions) {
|
|
1295
|
+
if (!destinationID) {
|
|
1296
|
+
throw new Error('Parameter `destinationID` is required when calling `getDestination`.');
|
|
1297
|
+
}
|
|
1298
|
+
const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
|
|
1299
|
+
const headers = {};
|
|
1300
|
+
const queryParameters = {};
|
|
1301
|
+
const request = {
|
|
1302
|
+
method: 'GET',
|
|
1303
|
+
path: requestPath,
|
|
1304
|
+
queryParameters,
|
|
1305
|
+
headers,
|
|
1306
|
+
};
|
|
1307
|
+
return transporter.request(request, requestOptions);
|
|
1308
|
+
},
|
|
1309
|
+
/**
|
|
1310
|
+
* Retrieves a list of destinations.
|
|
1311
|
+
*
|
|
1312
|
+
* Required API Key ACLs:
|
|
1313
|
+
* - addObject
|
|
1314
|
+
* - deleteIndex
|
|
1315
|
+
* - editSettings.
|
|
1316
|
+
*
|
|
1317
|
+
* @param getDestinations - The getDestinations object.
|
|
1318
|
+
* @param getDestinations.itemsPerPage - Number of items per page.
|
|
1319
|
+
* @param getDestinations.page - Page number of the paginated API response.
|
|
1320
|
+
* @param getDestinations.type - Destination type.
|
|
1321
|
+
* @param getDestinations.authenticationID - Authentication ID used by destinations.
|
|
1322
|
+
* @param getDestinations.sort - Property by which to sort the destinations.
|
|
1323
|
+
* @param getDestinations.order - Sort order of the response, ascending or descending.
|
|
1324
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1325
|
+
*/
|
|
1326
|
+
getDestinations({ itemsPerPage, page, type, authenticationID, sort, order, } = {}, requestOptions = undefined) {
|
|
1327
|
+
const requestPath = '/1/destinations';
|
|
1328
|
+
const headers = {};
|
|
1329
|
+
const queryParameters = {};
|
|
1330
|
+
if (itemsPerPage !== undefined) {
|
|
1331
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1332
|
+
}
|
|
1333
|
+
if (page !== undefined) {
|
|
1334
|
+
queryParameters.page = page.toString();
|
|
1335
|
+
}
|
|
1336
|
+
if (type !== undefined) {
|
|
1337
|
+
queryParameters.type = type.toString();
|
|
1338
|
+
}
|
|
1339
|
+
if (authenticationID !== undefined) {
|
|
1340
|
+
queryParameters.authenticationID = authenticationID.toString();
|
|
1341
|
+
}
|
|
1342
|
+
if (sort !== undefined) {
|
|
1343
|
+
queryParameters.sort = sort.toString();
|
|
1344
|
+
}
|
|
1345
|
+
if (order !== undefined) {
|
|
1346
|
+
queryParameters.order = order.toString();
|
|
1347
|
+
}
|
|
1348
|
+
const request = {
|
|
1349
|
+
method: 'GET',
|
|
1350
|
+
path: requestPath,
|
|
1351
|
+
queryParameters,
|
|
1352
|
+
headers,
|
|
1353
|
+
};
|
|
1354
|
+
return transporter.request(request, requestOptions);
|
|
1355
|
+
},
|
|
1356
|
+
/**
|
|
1357
|
+
* Retrieves a single task run event by its ID.
|
|
1358
|
+
*
|
|
1359
|
+
* Required API Key ACLs:
|
|
1360
|
+
* - addObject
|
|
1361
|
+
* - deleteIndex
|
|
1362
|
+
* - editSettings.
|
|
1363
|
+
*
|
|
1364
|
+
* @param getEvent - The getEvent object.
|
|
1365
|
+
* @param getEvent.runID - Unique identifier of a task run.
|
|
1366
|
+
* @param getEvent.eventID - Unique identifier of an event.
|
|
1367
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1368
|
+
*/
|
|
1369
|
+
getEvent({ runID, eventID }, requestOptions) {
|
|
1370
|
+
if (!runID) {
|
|
1371
|
+
throw new Error('Parameter `runID` is required when calling `getEvent`.');
|
|
1372
|
+
}
|
|
1373
|
+
if (!eventID) {
|
|
1374
|
+
throw new Error('Parameter `eventID` is required when calling `getEvent`.');
|
|
1375
|
+
}
|
|
1376
|
+
const requestPath = '/1/runs/{runID}/events/{eventID}'
|
|
1377
|
+
.replace('{runID}', encodeURIComponent(runID))
|
|
1378
|
+
.replace('{eventID}', encodeURIComponent(eventID));
|
|
1379
|
+
const headers = {};
|
|
1380
|
+
const queryParameters = {};
|
|
1381
|
+
const request = {
|
|
1382
|
+
method: 'GET',
|
|
1383
|
+
path: requestPath,
|
|
1384
|
+
queryParameters,
|
|
1385
|
+
headers,
|
|
1386
|
+
};
|
|
1387
|
+
return transporter.request(request, requestOptions);
|
|
1388
|
+
},
|
|
1389
|
+
/**
|
|
1390
|
+
* Retrieves a list of events for a task run, identified by it\'s ID.
|
|
1391
|
+
*
|
|
1392
|
+
* Required API Key ACLs:
|
|
1393
|
+
* - addObject
|
|
1394
|
+
* - deleteIndex
|
|
1395
|
+
* - editSettings.
|
|
1396
|
+
*
|
|
1397
|
+
* @param getEvents - The getEvents object.
|
|
1398
|
+
* @param getEvents.runID - Unique identifier of a task run.
|
|
1399
|
+
* @param getEvents.itemsPerPage - Number of items per page.
|
|
1400
|
+
* @param getEvents.page - Page number of the paginated API response.
|
|
1401
|
+
* @param getEvents.status - Event status for filtering the list of task runs.
|
|
1402
|
+
* @param getEvents.type - Event type for filtering the list of task runs.
|
|
1403
|
+
* @param getEvents.sort - Property by which to sort the list of task run events.
|
|
1404
|
+
* @param getEvents.order - Sort order of the response, ascending or descending.
|
|
1405
|
+
* @param getEvents.startDate - Date and time in RFC 3339 format for the earliest events to retrieve. By default, the current time minus three hours is used.
|
|
1406
|
+
* @param getEvents.endDate - Date and time in RFC 3339 format for the latest events to retrieve. By default, the current time is used.
|
|
1407
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1408
|
+
*/
|
|
1409
|
+
getEvents({ runID, itemsPerPage, page, status, type, sort, order, startDate, endDate, }, requestOptions) {
|
|
1410
|
+
if (!runID) {
|
|
1411
|
+
throw new Error('Parameter `runID` is required when calling `getEvents`.');
|
|
1412
|
+
}
|
|
1413
|
+
const requestPath = '/1/runs/{runID}/events'.replace('{runID}', encodeURIComponent(runID));
|
|
1414
|
+
const headers = {};
|
|
1415
|
+
const queryParameters = {};
|
|
1416
|
+
if (itemsPerPage !== undefined) {
|
|
1417
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1418
|
+
}
|
|
1419
|
+
if (page !== undefined) {
|
|
1420
|
+
queryParameters.page = page.toString();
|
|
1421
|
+
}
|
|
1422
|
+
if (status !== undefined) {
|
|
1423
|
+
queryParameters.status = status.toString();
|
|
1424
|
+
}
|
|
1425
|
+
if (type !== undefined) {
|
|
1426
|
+
queryParameters.type = type.toString();
|
|
1427
|
+
}
|
|
1428
|
+
if (sort !== undefined) {
|
|
1429
|
+
queryParameters.sort = sort.toString();
|
|
1430
|
+
}
|
|
1431
|
+
if (order !== undefined) {
|
|
1432
|
+
queryParameters.order = order.toString();
|
|
1433
|
+
}
|
|
1434
|
+
if (startDate !== undefined) {
|
|
1435
|
+
queryParameters.startDate = startDate.toString();
|
|
1436
|
+
}
|
|
1437
|
+
if (endDate !== undefined) {
|
|
1438
|
+
queryParameters.endDate = endDate.toString();
|
|
1439
|
+
}
|
|
1440
|
+
const request = {
|
|
1441
|
+
method: 'GET',
|
|
1442
|
+
path: requestPath,
|
|
1443
|
+
queryParameters,
|
|
1444
|
+
headers,
|
|
1445
|
+
};
|
|
1446
|
+
return transporter.request(request, requestOptions);
|
|
1447
|
+
},
|
|
1448
|
+
/**
|
|
1449
|
+
* Retrieve a single task run by its ID.
|
|
1450
|
+
*
|
|
1451
|
+
* Required API Key ACLs:
|
|
1452
|
+
* - addObject
|
|
1453
|
+
* - deleteIndex
|
|
1454
|
+
* - editSettings.
|
|
1455
|
+
*
|
|
1456
|
+
* @param getRun - The getRun object.
|
|
1457
|
+
* @param getRun.runID - Unique identifier of a task run.
|
|
1458
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1459
|
+
*/
|
|
1460
|
+
getRun({ runID }, requestOptions) {
|
|
1461
|
+
if (!runID) {
|
|
1462
|
+
throw new Error('Parameter `runID` is required when calling `getRun`.');
|
|
1463
|
+
}
|
|
1464
|
+
const requestPath = '/1/runs/{runID}'.replace('{runID}', encodeURIComponent(runID));
|
|
1465
|
+
const headers = {};
|
|
1466
|
+
const queryParameters = {};
|
|
1467
|
+
const request = {
|
|
1468
|
+
method: 'GET',
|
|
1469
|
+
path: requestPath,
|
|
1470
|
+
queryParameters,
|
|
1471
|
+
headers,
|
|
1472
|
+
};
|
|
1473
|
+
return transporter.request(request, requestOptions);
|
|
1474
|
+
},
|
|
1475
|
+
/**
|
|
1476
|
+
* Retrieve a list of task runs.
|
|
1477
|
+
*
|
|
1478
|
+
* Required API Key ACLs:
|
|
1479
|
+
* - addObject
|
|
1480
|
+
* - deleteIndex
|
|
1481
|
+
* - editSettings.
|
|
1482
|
+
*
|
|
1483
|
+
* @param getRuns - The getRuns object.
|
|
1484
|
+
* @param getRuns.itemsPerPage - Number of items per page.
|
|
1485
|
+
* @param getRuns.page - Page number of the paginated API response.
|
|
1486
|
+
* @param getRuns.status - Run status for filtering the list of task runs.
|
|
1487
|
+
* @param getRuns.taskID - Task ID for filtering the list of task runs.
|
|
1488
|
+
* @param getRuns.sort - Property by which to sort the list of task runs.
|
|
1489
|
+
* @param getRuns.order - Sort order of the response, ascending or descending.
|
|
1490
|
+
* @param getRuns.startDate - Date in RFC 3339 format for the earliest run to retrieve. By default, the current day minus seven days is used.
|
|
1491
|
+
* @param getRuns.endDate - Date in RFC 3339 format for the latest run to retrieve. By default, the current day is used.
|
|
1492
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1493
|
+
*/
|
|
1494
|
+
getRuns({ itemsPerPage, page, status, taskID, sort, order, startDate, endDate, } = {}, requestOptions = undefined) {
|
|
1495
|
+
const requestPath = '/1/runs';
|
|
1496
|
+
const headers = {};
|
|
1497
|
+
const queryParameters = {};
|
|
1498
|
+
if (itemsPerPage !== undefined) {
|
|
1499
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1500
|
+
}
|
|
1501
|
+
if (page !== undefined) {
|
|
1502
|
+
queryParameters.page = page.toString();
|
|
1503
|
+
}
|
|
1504
|
+
if (status !== undefined) {
|
|
1505
|
+
queryParameters.status = status.toString();
|
|
1506
|
+
}
|
|
1507
|
+
if (taskID !== undefined) {
|
|
1508
|
+
queryParameters.taskID = taskID.toString();
|
|
1509
|
+
}
|
|
1510
|
+
if (sort !== undefined) {
|
|
1511
|
+
queryParameters.sort = sort.toString();
|
|
1512
|
+
}
|
|
1513
|
+
if (order !== undefined) {
|
|
1514
|
+
queryParameters.order = order.toString();
|
|
1515
|
+
}
|
|
1516
|
+
if (startDate !== undefined) {
|
|
1517
|
+
queryParameters.startDate = startDate.toString();
|
|
1518
|
+
}
|
|
1519
|
+
if (endDate !== undefined) {
|
|
1520
|
+
queryParameters.endDate = endDate.toString();
|
|
1521
|
+
}
|
|
1522
|
+
const request = {
|
|
1523
|
+
method: 'GET',
|
|
1524
|
+
path: requestPath,
|
|
1525
|
+
queryParameters,
|
|
1526
|
+
headers,
|
|
1527
|
+
};
|
|
1528
|
+
return transporter.request(request, requestOptions);
|
|
1529
|
+
},
|
|
1530
|
+
/**
|
|
1531
|
+
* Retrieve a source by its ID.
|
|
1532
|
+
*
|
|
1533
|
+
* Required API Key ACLs:
|
|
1534
|
+
* - addObject
|
|
1535
|
+
* - deleteIndex
|
|
1536
|
+
* - editSettings.
|
|
1537
|
+
*
|
|
1538
|
+
* @param getSource - The getSource object.
|
|
1539
|
+
* @param getSource.sourceID - Unique identifier of a source.
|
|
1540
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1541
|
+
*/
|
|
1542
|
+
getSource({ sourceID }, requestOptions) {
|
|
1543
|
+
if (!sourceID) {
|
|
1544
|
+
throw new Error('Parameter `sourceID` is required when calling `getSource`.');
|
|
1545
|
+
}
|
|
1546
|
+
const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
|
|
1547
|
+
const headers = {};
|
|
1548
|
+
const queryParameters = {};
|
|
1549
|
+
const request = {
|
|
1550
|
+
method: 'GET',
|
|
1551
|
+
path: requestPath,
|
|
1552
|
+
queryParameters,
|
|
1553
|
+
headers,
|
|
1554
|
+
};
|
|
1555
|
+
return transporter.request(request, requestOptions);
|
|
1556
|
+
},
|
|
1557
|
+
/**
|
|
1558
|
+
* Retrieves a list of sources.
|
|
1559
|
+
*
|
|
1560
|
+
* Required API Key ACLs:
|
|
1561
|
+
* - addObject
|
|
1562
|
+
* - deleteIndex
|
|
1563
|
+
* - editSettings.
|
|
1564
|
+
*
|
|
1565
|
+
* @param getSources - The getSources object.
|
|
1566
|
+
* @param getSources.itemsPerPage - Number of items per page.
|
|
1567
|
+
* @param getSources.page - Page number of the paginated API response.
|
|
1568
|
+
* @param getSources.type - Source type. Some sources require authentication.
|
|
1569
|
+
* @param getSources.authenticationID - Authentication IDs of the sources to retrieve. \'none\' returns sources that doesn\'t have an authentication resource.
|
|
1570
|
+
* @param getSources.sort - Property by which to sort the list of sources.
|
|
1571
|
+
* @param getSources.order - Sort order of the response, ascending or descending.
|
|
1572
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1573
|
+
*/
|
|
1574
|
+
getSources({ itemsPerPage, page, type, authenticationID, sort, order, } = {}, requestOptions = undefined) {
|
|
1575
|
+
const requestPath = '/1/sources';
|
|
1576
|
+
const headers = {};
|
|
1577
|
+
const queryParameters = {};
|
|
1578
|
+
if (itemsPerPage !== undefined) {
|
|
1579
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1580
|
+
}
|
|
1581
|
+
if (page !== undefined) {
|
|
1582
|
+
queryParameters.page = page.toString();
|
|
1583
|
+
}
|
|
1584
|
+
if (type !== undefined) {
|
|
1585
|
+
queryParameters.type = type.toString();
|
|
1586
|
+
}
|
|
1587
|
+
if (authenticationID !== undefined) {
|
|
1588
|
+
queryParameters.authenticationID = authenticationID.toString();
|
|
1589
|
+
}
|
|
1590
|
+
if (sort !== undefined) {
|
|
1591
|
+
queryParameters.sort = sort.toString();
|
|
1592
|
+
}
|
|
1593
|
+
if (order !== undefined) {
|
|
1594
|
+
queryParameters.order = order.toString();
|
|
1595
|
+
}
|
|
1596
|
+
const request = {
|
|
1597
|
+
method: 'GET',
|
|
1598
|
+
path: requestPath,
|
|
1599
|
+
queryParameters,
|
|
1600
|
+
headers,
|
|
1601
|
+
};
|
|
1602
|
+
return transporter.request(request, requestOptions);
|
|
1603
|
+
},
|
|
1604
|
+
/**
|
|
1605
|
+
* Retrieves a task by its ID.
|
|
1606
|
+
*
|
|
1607
|
+
* Required API Key ACLs:
|
|
1608
|
+
* - addObject
|
|
1609
|
+
* - deleteIndex
|
|
1610
|
+
* - editSettings.
|
|
1611
|
+
*
|
|
1612
|
+
* @param getTask - The getTask object.
|
|
1613
|
+
* @param getTask.taskID - Unique identifier of a task.
|
|
1614
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1615
|
+
*/
|
|
1616
|
+
getTask({ taskID }, requestOptions) {
|
|
1617
|
+
if (!taskID) {
|
|
1618
|
+
throw new Error('Parameter `taskID` is required when calling `getTask`.');
|
|
1619
|
+
}
|
|
1620
|
+
const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1621
|
+
const headers = {};
|
|
1622
|
+
const queryParameters = {};
|
|
1623
|
+
const request = {
|
|
1624
|
+
method: 'GET',
|
|
1625
|
+
path: requestPath,
|
|
1626
|
+
queryParameters,
|
|
1627
|
+
headers,
|
|
1628
|
+
};
|
|
1629
|
+
return transporter.request(request, requestOptions);
|
|
1630
|
+
},
|
|
1631
|
+
/**
|
|
1632
|
+
* Retrieves a list of tasks.
|
|
1633
|
+
*
|
|
1634
|
+
* Required API Key ACLs:
|
|
1635
|
+
* - addObject
|
|
1636
|
+
* - deleteIndex
|
|
1637
|
+
* - editSettings.
|
|
1638
|
+
*
|
|
1639
|
+
* @param getTasks - The getTasks object.
|
|
1640
|
+
* @param getTasks.itemsPerPage - Number of items per page.
|
|
1641
|
+
* @param getTasks.page - Page number of the paginated API response.
|
|
1642
|
+
* @param getTasks.action - Actions for filtering the list of tasks.
|
|
1643
|
+
* @param getTasks.enabled - Whether to filter the list of tasks by the `enabled` status.
|
|
1644
|
+
* @param getTasks.sourceID - Source IDs for filtering the list of tasks.
|
|
1645
|
+
* @param getTasks.destinationID - Destination IDs for filtering the list of tasks.
|
|
1646
|
+
* @param getTasks.triggerType - Type of task trigger for filtering the list of tasks.
|
|
1647
|
+
* @param getTasks.sort - Property by which to sort the list of tasks.
|
|
1648
|
+
* @param getTasks.order - Sort order of the response, ascending or descending.
|
|
1649
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1650
|
+
*/
|
|
1651
|
+
getTasks({ itemsPerPage, page, action, enabled, sourceID, destinationID, triggerType, sort, order, } = {}, requestOptions = undefined) {
|
|
1652
|
+
const requestPath = '/1/tasks';
|
|
1653
|
+
const headers = {};
|
|
1654
|
+
const queryParameters = {};
|
|
1655
|
+
if (itemsPerPage !== undefined) {
|
|
1656
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1657
|
+
}
|
|
1658
|
+
if (page !== undefined) {
|
|
1659
|
+
queryParameters.page = page.toString();
|
|
1660
|
+
}
|
|
1661
|
+
if (action !== undefined) {
|
|
1662
|
+
queryParameters.action = action.toString();
|
|
1663
|
+
}
|
|
1664
|
+
if (enabled !== undefined) {
|
|
1665
|
+
queryParameters.enabled = enabled.toString();
|
|
1666
|
+
}
|
|
1667
|
+
if (sourceID !== undefined) {
|
|
1668
|
+
queryParameters.sourceID = sourceID.toString();
|
|
1669
|
+
}
|
|
1670
|
+
if (destinationID !== undefined) {
|
|
1671
|
+
queryParameters.destinationID = destinationID.toString();
|
|
1672
|
+
}
|
|
1673
|
+
if (triggerType !== undefined) {
|
|
1674
|
+
queryParameters.triggerType = triggerType.toString();
|
|
1675
|
+
}
|
|
1676
|
+
if (sort !== undefined) {
|
|
1677
|
+
queryParameters.sort = sort.toString();
|
|
1678
|
+
}
|
|
1679
|
+
if (order !== undefined) {
|
|
1680
|
+
queryParameters.order = order.toString();
|
|
1681
|
+
}
|
|
1682
|
+
const request = {
|
|
1683
|
+
method: 'GET',
|
|
1684
|
+
path: requestPath,
|
|
1685
|
+
queryParameters,
|
|
1686
|
+
headers,
|
|
1687
|
+
};
|
|
1688
|
+
return transporter.request(request, requestOptions);
|
|
1689
|
+
},
|
|
1690
|
+
/**
|
|
1691
|
+
* Retrieves a transformation by its ID.
|
|
1692
|
+
*
|
|
1693
|
+
* Required API Key ACLs:
|
|
1694
|
+
* - addObject
|
|
1695
|
+
* - deleteIndex
|
|
1696
|
+
* - editSettings.
|
|
1697
|
+
*
|
|
1698
|
+
* @param getTransformation - The getTransformation object.
|
|
1699
|
+
* @param getTransformation.transformationID - Unique identifier of a transformation.
|
|
1700
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1701
|
+
*/
|
|
1702
|
+
getTransformation({ transformationID }, requestOptions) {
|
|
1703
|
+
if (!transformationID) {
|
|
1704
|
+
throw new Error('Parameter `transformationID` is required when calling `getTransformation`.');
|
|
1705
|
+
}
|
|
1706
|
+
const requestPath = '/1/transformations/{transformationID}'.replace('{transformationID}', encodeURIComponent(transformationID));
|
|
1707
|
+
const headers = {};
|
|
1708
|
+
const queryParameters = {};
|
|
1709
|
+
const request = {
|
|
1710
|
+
method: 'GET',
|
|
1711
|
+
path: requestPath,
|
|
1712
|
+
queryParameters,
|
|
1713
|
+
headers,
|
|
1714
|
+
};
|
|
1715
|
+
return transporter.request(request, requestOptions);
|
|
1716
|
+
},
|
|
1717
|
+
/**
|
|
1718
|
+
* Retrieves a list of transformations.
|
|
1719
|
+
*
|
|
1720
|
+
* Required API Key ACLs:
|
|
1721
|
+
* - addObject
|
|
1722
|
+
* - deleteIndex
|
|
1723
|
+
* - editSettings.
|
|
1724
|
+
*
|
|
1725
|
+
* @param getTransformations - The getTransformations object.
|
|
1726
|
+
* @param getTransformations.sort - Property by which to sort the list.
|
|
1727
|
+
* @param getTransformations.order - Sort order of the response, ascending or descending.
|
|
1728
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1729
|
+
*/
|
|
1730
|
+
getTransformations({ sort, order } = {}, requestOptions = undefined) {
|
|
1731
|
+
const requestPath = '/1/transformations';
|
|
1732
|
+
const headers = {};
|
|
1733
|
+
const queryParameters = {};
|
|
1734
|
+
if (sort !== undefined) {
|
|
1735
|
+
queryParameters.sort = sort.toString();
|
|
1736
|
+
}
|
|
1737
|
+
if (order !== undefined) {
|
|
1738
|
+
queryParameters.order = order.toString();
|
|
1739
|
+
}
|
|
1740
|
+
const request = {
|
|
1741
|
+
method: 'GET',
|
|
1742
|
+
path: requestPath,
|
|
1743
|
+
queryParameters,
|
|
1744
|
+
headers,
|
|
1745
|
+
};
|
|
1746
|
+
return transporter.request(request, requestOptions);
|
|
1747
|
+
},
|
|
1748
|
+
/**
|
|
1749
|
+
* Runs a task. You can check the status of task runs with the observability endpoints.
|
|
1750
|
+
*
|
|
1751
|
+
* Required API Key ACLs:
|
|
1752
|
+
* - addObject
|
|
1753
|
+
* - deleteIndex
|
|
1754
|
+
* - editSettings.
|
|
1755
|
+
*
|
|
1756
|
+
* @param runTask - The runTask object.
|
|
1757
|
+
* @param runTask.taskID - Unique identifier of a task.
|
|
1758
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1759
|
+
*/
|
|
1760
|
+
runTask({ taskID }, requestOptions) {
|
|
1761
|
+
if (!taskID) {
|
|
1762
|
+
throw new Error('Parameter `taskID` is required when calling `runTask`.');
|
|
1763
|
+
}
|
|
1764
|
+
const requestPath = '/1/tasks/{taskID}/run'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1765
|
+
const headers = {};
|
|
1766
|
+
const queryParameters = {};
|
|
1767
|
+
const request = {
|
|
1768
|
+
method: 'POST',
|
|
1769
|
+
path: requestPath,
|
|
1770
|
+
queryParameters,
|
|
1771
|
+
headers,
|
|
1772
|
+
};
|
|
1773
|
+
return transporter.request(request, requestOptions);
|
|
1774
|
+
},
|
|
1775
|
+
/**
|
|
1776
|
+
* Searches for authentication resources.
|
|
1777
|
+
*
|
|
1778
|
+
* Required API Key ACLs:
|
|
1779
|
+
* - addObject
|
|
1780
|
+
* - deleteIndex
|
|
1781
|
+
* - editSettings.
|
|
1782
|
+
*
|
|
1783
|
+
* @param authenticationSearch - The authenticationSearch object.
|
|
1784
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1785
|
+
*/
|
|
1786
|
+
searchAuthentications(authenticationSearch, requestOptions) {
|
|
1787
|
+
if (!authenticationSearch) {
|
|
1788
|
+
throw new Error('Parameter `authenticationSearch` is required when calling `searchAuthentications`.');
|
|
1789
|
+
}
|
|
1790
|
+
if (!authenticationSearch.authenticationIDs) {
|
|
1791
|
+
throw new Error('Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.');
|
|
1792
|
+
}
|
|
1793
|
+
const requestPath = '/1/authentications/search';
|
|
1794
|
+
const headers = {};
|
|
1795
|
+
const queryParameters = {};
|
|
1796
|
+
const request = {
|
|
1797
|
+
method: 'POST',
|
|
1798
|
+
path: requestPath,
|
|
1799
|
+
queryParameters,
|
|
1800
|
+
headers,
|
|
1801
|
+
data: authenticationSearch,
|
|
1802
|
+
};
|
|
1803
|
+
return transporter.request(request, requestOptions);
|
|
1804
|
+
},
|
|
1805
|
+
/**
|
|
1806
|
+
* Searches for destinations.
|
|
1807
|
+
*
|
|
1808
|
+
* Required API Key ACLs:
|
|
1809
|
+
* - addObject
|
|
1810
|
+
* - deleteIndex
|
|
1811
|
+
* - editSettings.
|
|
1812
|
+
*
|
|
1813
|
+
* @param destinationSearch - The destinationSearch object.
|
|
1814
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1815
|
+
*/
|
|
1816
|
+
searchDestinations(destinationSearch, requestOptions) {
|
|
1817
|
+
if (!destinationSearch) {
|
|
1818
|
+
throw new Error('Parameter `destinationSearch` is required when calling `searchDestinations`.');
|
|
1819
|
+
}
|
|
1820
|
+
if (!destinationSearch.destinationIDs) {
|
|
1821
|
+
throw new Error('Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.');
|
|
1822
|
+
}
|
|
1823
|
+
const requestPath = '/1/destinations/search';
|
|
1824
|
+
const headers = {};
|
|
1825
|
+
const queryParameters = {};
|
|
1826
|
+
const request = {
|
|
1827
|
+
method: 'POST',
|
|
1828
|
+
path: requestPath,
|
|
1829
|
+
queryParameters,
|
|
1830
|
+
headers,
|
|
1831
|
+
data: destinationSearch,
|
|
1832
|
+
};
|
|
1833
|
+
return transporter.request(request, requestOptions);
|
|
1834
|
+
},
|
|
1835
|
+
/**
|
|
1836
|
+
* Searches for sources.
|
|
1837
|
+
*
|
|
1838
|
+
* Required API Key ACLs:
|
|
1839
|
+
* - addObject
|
|
1840
|
+
* - deleteIndex
|
|
1841
|
+
* - editSettings.
|
|
1842
|
+
*
|
|
1843
|
+
* @param sourceSearch - The sourceSearch object.
|
|
1844
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1845
|
+
*/
|
|
1846
|
+
searchSources(sourceSearch, requestOptions) {
|
|
1847
|
+
if (!sourceSearch) {
|
|
1848
|
+
throw new Error('Parameter `sourceSearch` is required when calling `searchSources`.');
|
|
1849
|
+
}
|
|
1850
|
+
if (!sourceSearch.sourceIDs) {
|
|
1851
|
+
throw new Error('Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.');
|
|
1852
|
+
}
|
|
1853
|
+
const requestPath = '/1/sources/search';
|
|
1854
|
+
const headers = {};
|
|
1855
|
+
const queryParameters = {};
|
|
1856
|
+
const request = {
|
|
1857
|
+
method: 'POST',
|
|
1858
|
+
path: requestPath,
|
|
1859
|
+
queryParameters,
|
|
1860
|
+
headers,
|
|
1861
|
+
data: sourceSearch,
|
|
1862
|
+
};
|
|
1863
|
+
return transporter.request(request, requestOptions);
|
|
1864
|
+
},
|
|
1865
|
+
/**
|
|
1866
|
+
* Searches for tasks.
|
|
1867
|
+
*
|
|
1868
|
+
* Required API Key ACLs:
|
|
1869
|
+
* - addObject
|
|
1870
|
+
* - deleteIndex
|
|
1871
|
+
* - editSettings.
|
|
1872
|
+
*
|
|
1873
|
+
* @param taskSearch - The taskSearch object.
|
|
1874
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1875
|
+
*/
|
|
1876
|
+
searchTasks(taskSearch, requestOptions) {
|
|
1877
|
+
if (!taskSearch) {
|
|
1878
|
+
throw new Error('Parameter `taskSearch` is required when calling `searchTasks`.');
|
|
1879
|
+
}
|
|
1880
|
+
if (!taskSearch.taskIDs) {
|
|
1881
|
+
throw new Error('Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.');
|
|
1882
|
+
}
|
|
1883
|
+
const requestPath = '/1/tasks/search';
|
|
1884
|
+
const headers = {};
|
|
1885
|
+
const queryParameters = {};
|
|
1886
|
+
const request = {
|
|
1887
|
+
method: 'POST',
|
|
1888
|
+
path: requestPath,
|
|
1889
|
+
queryParameters,
|
|
1890
|
+
headers,
|
|
1891
|
+
data: taskSearch,
|
|
1892
|
+
};
|
|
1893
|
+
return transporter.request(request, requestOptions);
|
|
1894
|
+
},
|
|
1895
|
+
/**
|
|
1896
|
+
* Searches for transformations.
|
|
1897
|
+
*
|
|
1898
|
+
* Required API Key ACLs:
|
|
1899
|
+
* - addObject
|
|
1900
|
+
* - deleteIndex
|
|
1901
|
+
* - editSettings.
|
|
1902
|
+
*
|
|
1903
|
+
* @param transformationSearch - The transformationSearch object.
|
|
1904
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1905
|
+
*/
|
|
1906
|
+
searchTransformations(transformationSearch, requestOptions) {
|
|
1907
|
+
if (!transformationSearch) {
|
|
1908
|
+
throw new Error('Parameter `transformationSearch` is required when calling `searchTransformations`.');
|
|
1909
|
+
}
|
|
1910
|
+
if (!transformationSearch.transformationsIDs) {
|
|
1911
|
+
throw new Error('Parameter `transformationSearch.transformationsIDs` is required when calling `searchTransformations`.');
|
|
1912
|
+
}
|
|
1913
|
+
const requestPath = '/1/transformations/search';
|
|
1914
|
+
const headers = {};
|
|
1915
|
+
const queryParameters = {};
|
|
1916
|
+
const request = {
|
|
1917
|
+
method: 'POST',
|
|
1918
|
+
path: requestPath,
|
|
1919
|
+
queryParameters,
|
|
1920
|
+
headers,
|
|
1921
|
+
data: transformationSearch,
|
|
1922
|
+
};
|
|
1923
|
+
return transporter.request(request, requestOptions);
|
|
1924
|
+
},
|
|
1925
|
+
/**
|
|
1926
|
+
* Triggers a stream-listing request for a source. Triggering stream-listing requests only works with sources with `type: docker` and `imageType: singer`.
|
|
1927
|
+
*
|
|
1928
|
+
* Required API Key ACLs:
|
|
1929
|
+
* - addObject
|
|
1930
|
+
* - deleteIndex
|
|
1931
|
+
* - editSettings.
|
|
1932
|
+
*
|
|
1933
|
+
* @param triggerDockerSourceDiscover - The triggerDockerSourceDiscover object.
|
|
1934
|
+
* @param triggerDockerSourceDiscover.sourceID - Unique identifier of a source.
|
|
1935
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1936
|
+
*/
|
|
1937
|
+
triggerDockerSourceDiscover({ sourceID }, requestOptions) {
|
|
1938
|
+
if (!sourceID) {
|
|
1939
|
+
throw new Error('Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.');
|
|
1940
|
+
}
|
|
1941
|
+
const requestPath = '/1/sources/{sourceID}/discover'.replace('{sourceID}', encodeURIComponent(sourceID));
|
|
1942
|
+
const headers = {};
|
|
1943
|
+
const queryParameters = {};
|
|
1944
|
+
const request = {
|
|
1945
|
+
method: 'POST',
|
|
1946
|
+
path: requestPath,
|
|
1947
|
+
queryParameters,
|
|
1948
|
+
headers,
|
|
1949
|
+
};
|
|
1950
|
+
return transporter.request(request, requestOptions);
|
|
1951
|
+
},
|
|
1952
|
+
/**
|
|
1953
|
+
* Try a transformation.
|
|
1954
|
+
*
|
|
1955
|
+
* Required API Key ACLs:
|
|
1956
|
+
* - addObject
|
|
1957
|
+
* - deleteIndex
|
|
1958
|
+
* - editSettings.
|
|
1959
|
+
*
|
|
1960
|
+
* @param transformationTry - The transformationTry object.
|
|
1961
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1962
|
+
*/
|
|
1963
|
+
tryTransformations(transformationTry, requestOptions) {
|
|
1964
|
+
if (!transformationTry) {
|
|
1965
|
+
throw new Error('Parameter `transformationTry` is required when calling `tryTransformations`.');
|
|
1966
|
+
}
|
|
1967
|
+
if (!transformationTry.code) {
|
|
1968
|
+
throw new Error('Parameter `transformationTry.code` is required when calling `tryTransformations`.');
|
|
1969
|
+
}
|
|
1970
|
+
if (!transformationTry.sampleRecord) {
|
|
1971
|
+
throw new Error('Parameter `transformationTry.sampleRecord` is required when calling `tryTransformations`.');
|
|
1972
|
+
}
|
|
1973
|
+
const requestPath = '/1/transformations/try';
|
|
1974
|
+
const headers = {};
|
|
1975
|
+
const queryParameters = {};
|
|
1976
|
+
const request = {
|
|
1977
|
+
method: 'POST',
|
|
1978
|
+
path: requestPath,
|
|
1979
|
+
queryParameters,
|
|
1980
|
+
headers,
|
|
1981
|
+
data: transformationTry,
|
|
1982
|
+
};
|
|
1983
|
+
return transporter.request(request, requestOptions);
|
|
1984
|
+
},
|
|
1985
|
+
/**
|
|
1986
|
+
* Updates an authentication resource.
|
|
1987
|
+
*
|
|
1988
|
+
* Required API Key ACLs:
|
|
1989
|
+
* - addObject
|
|
1990
|
+
* - deleteIndex
|
|
1991
|
+
* - editSettings.
|
|
1992
|
+
*
|
|
1993
|
+
* @param updateAuthentication - The updateAuthentication object.
|
|
1994
|
+
* @param updateAuthentication.authenticationID - Unique identifier of an authentication resource.
|
|
1995
|
+
* @param updateAuthentication.authenticationUpdate - The authenticationUpdate object.
|
|
1996
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1997
|
+
*/
|
|
1998
|
+
updateAuthentication({ authenticationID, authenticationUpdate }, requestOptions) {
|
|
1999
|
+
if (!authenticationID) {
|
|
2000
|
+
throw new Error('Parameter `authenticationID` is required when calling `updateAuthentication`.');
|
|
2001
|
+
}
|
|
2002
|
+
if (!authenticationUpdate) {
|
|
2003
|
+
throw new Error('Parameter `authenticationUpdate` is required when calling `updateAuthentication`.');
|
|
2004
|
+
}
|
|
2005
|
+
const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
|
|
2006
|
+
const headers = {};
|
|
2007
|
+
const queryParameters = {};
|
|
2008
|
+
const request = {
|
|
2009
|
+
method: 'PATCH',
|
|
2010
|
+
path: requestPath,
|
|
2011
|
+
queryParameters,
|
|
2012
|
+
headers,
|
|
2013
|
+
data: authenticationUpdate,
|
|
2014
|
+
};
|
|
2015
|
+
return transporter.request(request, requestOptions);
|
|
2016
|
+
},
|
|
2017
|
+
/**
|
|
2018
|
+
* Updates the destination by its ID.
|
|
2019
|
+
*
|
|
2020
|
+
* Required API Key ACLs:
|
|
2021
|
+
* - addObject
|
|
2022
|
+
* - deleteIndex
|
|
2023
|
+
* - editSettings.
|
|
2024
|
+
*
|
|
2025
|
+
* @param updateDestination - The updateDestination object.
|
|
2026
|
+
* @param updateDestination.destinationID - Unique identifier of a destination.
|
|
2027
|
+
* @param updateDestination.destinationUpdate - The destinationUpdate object.
|
|
2028
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2029
|
+
*/
|
|
2030
|
+
updateDestination({ destinationID, destinationUpdate }, requestOptions) {
|
|
2031
|
+
if (!destinationID) {
|
|
2032
|
+
throw new Error('Parameter `destinationID` is required when calling `updateDestination`.');
|
|
2033
|
+
}
|
|
2034
|
+
if (!destinationUpdate) {
|
|
2035
|
+
throw new Error('Parameter `destinationUpdate` is required when calling `updateDestination`.');
|
|
2036
|
+
}
|
|
2037
|
+
const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
|
|
2038
|
+
const headers = {};
|
|
2039
|
+
const queryParameters = {};
|
|
2040
|
+
const request = {
|
|
2041
|
+
method: 'PATCH',
|
|
2042
|
+
path: requestPath,
|
|
2043
|
+
queryParameters,
|
|
2044
|
+
headers,
|
|
2045
|
+
data: destinationUpdate,
|
|
2046
|
+
};
|
|
2047
|
+
return transporter.request(request, requestOptions);
|
|
2048
|
+
},
|
|
2049
|
+
/**
|
|
2050
|
+
* Updates a source by its ID.
|
|
2051
|
+
*
|
|
2052
|
+
* Required API Key ACLs:
|
|
2053
|
+
* - addObject
|
|
2054
|
+
* - deleteIndex
|
|
2055
|
+
* - editSettings.
|
|
2056
|
+
*
|
|
2057
|
+
* @param updateSource - The updateSource object.
|
|
2058
|
+
* @param updateSource.sourceID - Unique identifier of a source.
|
|
2059
|
+
* @param updateSource.sourceUpdate - The sourceUpdate object.
|
|
2060
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2061
|
+
*/
|
|
2062
|
+
updateSource({ sourceID, sourceUpdate }, requestOptions) {
|
|
2063
|
+
if (!sourceID) {
|
|
2064
|
+
throw new Error('Parameter `sourceID` is required when calling `updateSource`.');
|
|
2065
|
+
}
|
|
2066
|
+
if (!sourceUpdate) {
|
|
2067
|
+
throw new Error('Parameter `sourceUpdate` is required when calling `updateSource`.');
|
|
2068
|
+
}
|
|
2069
|
+
const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
|
|
2070
|
+
const headers = {};
|
|
2071
|
+
const queryParameters = {};
|
|
2072
|
+
const request = {
|
|
2073
|
+
method: 'PATCH',
|
|
2074
|
+
path: requestPath,
|
|
2075
|
+
queryParameters,
|
|
2076
|
+
headers,
|
|
2077
|
+
data: sourceUpdate,
|
|
2078
|
+
};
|
|
2079
|
+
return transporter.request(request, requestOptions);
|
|
2080
|
+
},
|
|
2081
|
+
/**
|
|
2082
|
+
* Updates a task by its ID.
|
|
2083
|
+
*
|
|
2084
|
+
* @param updateTask - The updateTask object.
|
|
2085
|
+
* @param updateTask.taskID - Unique identifier of a task.
|
|
2086
|
+
* @param updateTask.taskUpdate - The taskUpdate object.
|
|
2087
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2088
|
+
*/
|
|
2089
|
+
updateTask({ taskID, taskUpdate }, requestOptions) {
|
|
2090
|
+
if (!taskID) {
|
|
2091
|
+
throw new Error('Parameter `taskID` is required when calling `updateTask`.');
|
|
2092
|
+
}
|
|
2093
|
+
if (!taskUpdate) {
|
|
2094
|
+
throw new Error('Parameter `taskUpdate` is required when calling `updateTask`.');
|
|
2095
|
+
}
|
|
2096
|
+
const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
|
|
2097
|
+
const headers = {};
|
|
2098
|
+
const queryParameters = {};
|
|
2099
|
+
const request = {
|
|
2100
|
+
method: 'PATCH',
|
|
2101
|
+
path: requestPath,
|
|
2102
|
+
queryParameters,
|
|
2103
|
+
headers,
|
|
2104
|
+
data: taskUpdate,
|
|
2105
|
+
};
|
|
2106
|
+
return transporter.request(request, requestOptions);
|
|
2107
|
+
},
|
|
2108
|
+
/**
|
|
2109
|
+
* Updates a transformation by its ID.
|
|
2110
|
+
*
|
|
2111
|
+
* @param updateTransformation - The updateTransformation object.
|
|
2112
|
+
* @param updateTransformation.transformationID - Unique identifier of a transformation.
|
|
2113
|
+
* @param updateTransformation.transformationCreate - The transformationCreate object.
|
|
2114
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2115
|
+
*/
|
|
2116
|
+
updateTransformation({ transformationID, transformationCreate }, requestOptions) {
|
|
2117
|
+
if (!transformationID) {
|
|
2118
|
+
throw new Error('Parameter `transformationID` is required when calling `updateTransformation`.');
|
|
2119
|
+
}
|
|
2120
|
+
if (!transformationCreate) {
|
|
2121
|
+
throw new Error('Parameter `transformationCreate` is required when calling `updateTransformation`.');
|
|
2122
|
+
}
|
|
2123
|
+
if (!transformationCreate.code) {
|
|
2124
|
+
throw new Error('Parameter `transformationCreate.code` is required when calling `updateTransformation`.');
|
|
2125
|
+
}
|
|
2126
|
+
if (!transformationCreate.name) {
|
|
2127
|
+
throw new Error('Parameter `transformationCreate.name` is required when calling `updateTransformation`.');
|
|
2128
|
+
}
|
|
2129
|
+
const requestPath = '/1/transformations/{transformationID}'.replace('{transformationID}', encodeURIComponent(transformationID));
|
|
2130
|
+
const headers = {};
|
|
2131
|
+
const queryParameters = {};
|
|
2132
|
+
const request = {
|
|
2133
|
+
method: 'PUT',
|
|
2134
|
+
path: requestPath,
|
|
2135
|
+
queryParameters,
|
|
2136
|
+
headers,
|
|
2137
|
+
data: transformationCreate,
|
|
2138
|
+
};
|
|
2139
|
+
return transporter.request(request, requestOptions);
|
|
2140
|
+
},
|
|
2141
|
+
/**
|
|
2142
|
+
* Validates a source payload to ensure it can be created and that the data source can be reached by Algolia.
|
|
2143
|
+
*
|
|
2144
|
+
* Required API Key ACLs:
|
|
2145
|
+
* - addObject
|
|
2146
|
+
* - deleteIndex
|
|
2147
|
+
* - editSettings.
|
|
2148
|
+
*
|
|
2149
|
+
* @param sourceCreate -.
|
|
2150
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2151
|
+
*/
|
|
2152
|
+
validateSource(sourceCreate, requestOptions = undefined) {
|
|
2153
|
+
const requestPath = '/1/sources/validate';
|
|
2154
|
+
const headers = {};
|
|
2155
|
+
const queryParameters = {};
|
|
2156
|
+
const request = {
|
|
2157
|
+
method: 'POST',
|
|
2158
|
+
path: requestPath,
|
|
2159
|
+
queryParameters,
|
|
2160
|
+
headers,
|
|
2161
|
+
data: sourceCreate ? sourceCreate : {},
|
|
2162
|
+
};
|
|
2163
|
+
return transporter.request(request, requestOptions);
|
|
2164
|
+
},
|
|
2165
|
+
/**
|
|
2166
|
+
* Validates an update of a source payload to ensure it can be created and that the data source can be reached by Algolia.
|
|
2167
|
+
*
|
|
2168
|
+
* Required API Key ACLs:
|
|
2169
|
+
* - addObject
|
|
2170
|
+
* - deleteIndex
|
|
2171
|
+
* - editSettings.
|
|
2172
|
+
*
|
|
2173
|
+
* @param validateSourceBeforeUpdate - The validateSourceBeforeUpdate object.
|
|
2174
|
+
* @param validateSourceBeforeUpdate.sourceID - Unique identifier of a source.
|
|
2175
|
+
* @param validateSourceBeforeUpdate.sourceUpdate - The sourceUpdate object.
|
|
2176
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2177
|
+
*/
|
|
2178
|
+
validateSourceBeforeUpdate({ sourceID, sourceUpdate }, requestOptions) {
|
|
2179
|
+
if (!sourceID) {
|
|
2180
|
+
throw new Error('Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.');
|
|
2181
|
+
}
|
|
2182
|
+
if (!sourceUpdate) {
|
|
2183
|
+
throw new Error('Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.');
|
|
2184
|
+
}
|
|
2185
|
+
const requestPath = '/1/sources/{sourceID}/validate'.replace('{sourceID}', encodeURIComponent(sourceID));
|
|
2186
|
+
const headers = {};
|
|
2187
|
+
const queryParameters = {};
|
|
2188
|
+
const request = {
|
|
2189
|
+
method: 'POST',
|
|
2190
|
+
path: requestPath,
|
|
2191
|
+
queryParameters,
|
|
2192
|
+
headers,
|
|
2193
|
+
data: sourceUpdate,
|
|
2194
|
+
};
|
|
2195
|
+
return transporter.request(request, requestOptions);
|
|
2196
|
+
},
|
|
2197
|
+
};
|
|
1454
2198
|
}
|
|
1455
2199
|
|
|
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
|
-
|
|
2200
|
+
// 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.
|
|
2201
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
2202
|
+
function ingestionClient(appId, apiKey, region, options) {
|
|
2203
|
+
if (!appId || typeof appId !== 'string') {
|
|
2204
|
+
throw new Error('`appId` is missing.');
|
|
2205
|
+
}
|
|
2206
|
+
if (!apiKey || typeof apiKey !== 'string') {
|
|
2207
|
+
throw new Error('`apiKey` is missing.');
|
|
2208
|
+
}
|
|
2209
|
+
if (!region ||
|
|
2210
|
+
(region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
|
|
2211
|
+
throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
|
|
2212
|
+
}
|
|
2213
|
+
return createIngestionClient({
|
|
2214
|
+
appId,
|
|
2215
|
+
apiKey,
|
|
2216
|
+
region,
|
|
2217
|
+
timeouts: {
|
|
2218
|
+
connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,
|
|
2219
|
+
read: DEFAULT_READ_TIMEOUT_BROWSER,
|
|
2220
|
+
write: DEFAULT_WRITE_TIMEOUT_BROWSER,
|
|
2221
|
+
},
|
|
2222
|
+
requester: createXhrRequester(),
|
|
2223
|
+
algoliaAgents: [{ segment: 'Browser' }],
|
|
2224
|
+
authMode: 'WithinQueryParameters',
|
|
2225
|
+
responsesCache: createMemoryCache(),
|
|
2226
|
+
requestsCache: createMemoryCache({ serializable: false }),
|
|
2227
|
+
hostsCache: createFallbackableCache({
|
|
2228
|
+
caches: [
|
|
2229
|
+
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
|
|
2230
|
+
createMemoryCache(),
|
|
2231
|
+
],
|
|
2232
|
+
}),
|
|
2233
|
+
...options,
|
|
2234
|
+
});
|
|
1490
2235
|
}
|
|
1491
2236
|
|
|
1492
|
-
export { apiClientVersion, ingestionClient };
|
|
2237
|
+
export { apiClientVersion, ingestionClient, isOnDemandTrigger, isScheduleTrigger, isSubscriptionTrigger };
|