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