@algolia/ingestion 1.0.0-alpha.7 → 1.0.0-alpha.71
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 +5 -5
- package/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/node.d.ts +5 -5
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/{ingestion.cjs.js → ingestion.cjs} +1205 -820
- package/dist/ingestion.esm.browser.js +1386 -967
- package/dist/ingestion.esm.node.js +1203 -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/deleteResponse.d.ts +6 -6
- package/dist/model/deleteResponse.d.ts.map +1 -1
- package/dist/model/destination.d.ts +26 -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 +14 -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 +109 -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/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 +14 -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 +10 -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 +13 -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/sourceInput.d.ts +7 -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 +11 -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 +7 -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/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 +5 -0
- package/dist/model/taskCreateTrigger.d.ts.map +1 -0
- package/dist/model/taskInput.d.ts +4 -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 +4 -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 +465 -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/deleteResponse.ts +1 -1
- package/model/destination.ts +10 -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 +7 -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 +52 -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/mappingTypeCSV.ts +8 -0
- package/model/methodType.ts +1 -1
- package/model/onDemandDateUtilsInput.ts +16 -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 +11 -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 +15 -1
- package/model/sourceBigQuery.ts +37 -0
- package/model/sourceCSV.ts +28 -0
- package/model/sourceCommercetools.ts +6 -1
- package/model/sourceCreate.ts +5 -2
- package/model/sourceCreateResponse.ts +4 -1
- package/model/sourceDocker.ts +25 -0
- package/model/sourceInput.ts +12 -3
- package/model/sourceJSON.ts +17 -0
- package/model/sourceSearch.ts +5 -0
- package/model/sourceSortKeys.ts +6 -0
- package/model/sourceType.ts +8 -2
- package/model/sourceUpdate.ts +6 -6
- package/model/sourceUpdateCommercetools.ts +13 -0
- package/model/sourceUpdateDocker.ts +22 -0
- package/model/sourceUpdateInput.ts +14 -0
- package/model/sourceUpdateResponse.ts +4 -1
- 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 +10 -0
- package/model/taskInput.ts +6 -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 +5 -17
- package/model/triggerType.ts +5 -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,12 +243,12 @@ 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 {
|
|
226
|
-
constructor(message, status, stackTrace) {
|
|
227
|
-
super(message, stackTrace,
|
|
250
|
+
constructor(message, status, stackTrace, name = 'ApiError') {
|
|
251
|
+
super(message, stackTrace, name);
|
|
228
252
|
_defineProperty(this, "status", void 0);
|
|
229
253
|
this.status = status;
|
|
230
254
|
}
|
|
@@ -236,6 +260,14 @@ class DeserializationError extends AlgoliaError {
|
|
|
236
260
|
this.response = response;
|
|
237
261
|
}
|
|
238
262
|
}
|
|
263
|
+
// DetailedApiError is only used by the ingestion client to return more informative error, other clients will use ApiClient.
|
|
264
|
+
class DetailedApiError extends ApiError {
|
|
265
|
+
constructor(message, status, error, stackTrace) {
|
|
266
|
+
super(message, status, stackTrace, 'DetailedApiError');
|
|
267
|
+
_defineProperty(this, "error", void 0);
|
|
268
|
+
this.error = error;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
239
271
|
function serializeUrl(host, path, queryParameters) {
|
|
240
272
|
const queryParametersAsString = serializeQueryParameters(queryParameters);
|
|
241
273
|
let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.substr(1) : path}`;
|
|
@@ -283,13 +315,16 @@ function deserializeFailure({
|
|
|
283
315
|
content,
|
|
284
316
|
status
|
|
285
317
|
}, stackFrame) {
|
|
286
|
-
let message = content;
|
|
287
318
|
try {
|
|
288
|
-
|
|
319
|
+
const parsed = JSON.parse(content);
|
|
320
|
+
if ('error' in parsed) {
|
|
321
|
+
return new DetailedApiError(parsed.message, status, parsed.error, stackFrame);
|
|
322
|
+
}
|
|
323
|
+
return new ApiError(parsed.message, status, stackFrame);
|
|
289
324
|
} catch (e) {
|
|
290
325
|
// ..
|
|
291
326
|
}
|
|
292
|
-
return new ApiError(
|
|
327
|
+
return new ApiError(content, status, stackFrame);
|
|
293
328
|
}
|
|
294
329
|
|
|
295
330
|
function isNetworkError({
|
|
@@ -357,16 +392,16 @@ function createTransporter({
|
|
|
357
392
|
return {
|
|
358
393
|
hosts: compatibleHostsAvailable,
|
|
359
394
|
getTimeout(timeoutsCount, baseTimeout) {
|
|
360
|
-
/**
|
|
361
|
-
* Imagine that you have 4 hosts, if timeouts will increase
|
|
362
|
-
* on the following way: 1 (timed out) > 4 (timed out) > 5 (200).
|
|
363
|
-
*
|
|
364
|
-
* Note that, the very next request, we start from the previous timeout.
|
|
365
|
-
*
|
|
366
|
-
* 5 (timed out) > 6 (timed out) > 7 ...
|
|
367
|
-
*
|
|
368
|
-
* This strategy may need to be reviewed, but is the strategy on the our
|
|
369
|
-
* 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.
|
|
370
405
|
*/
|
|
371
406
|
const timeoutMultiplier = hostsTimedOut.length === 0 && timeoutsCount === 0 ? 1 : hostsTimedOut.length + 3 + timeoutsCount;
|
|
372
407
|
return timeoutMultiplier * baseTimeout;
|
|
@@ -375,8 +410,8 @@ function createTransporter({
|
|
|
375
410
|
}
|
|
376
411
|
async function retryableRequest(request, requestOptions, isRead = true) {
|
|
377
412
|
const stackTrace = [];
|
|
378
|
-
/**
|
|
379
|
-
* First we prepare the payload that do not depend from hosts.
|
|
413
|
+
/**
|
|
414
|
+
* First we prepare the payload that do not depend from hosts.
|
|
380
415
|
*/
|
|
381
416
|
const data = serializeData(request, requestOptions);
|
|
382
417
|
const headers = serializeHeaders(baseHeaders, request.headers, requestOptions.headers);
|
|
@@ -407,8 +442,8 @@ function createTransporter({
|
|
|
407
442
|
}
|
|
408
443
|
let timeoutsCount = 0;
|
|
409
444
|
const retry = async (retryableHosts, getTimeout) => {
|
|
410
|
-
/**
|
|
411
|
-
* We iterate on each host, until there is no host left.
|
|
445
|
+
/**
|
|
446
|
+
* We iterate on each host, until there is no host left.
|
|
412
447
|
*/
|
|
413
448
|
const host = retryableHosts.pop();
|
|
414
449
|
if (host === undefined) {
|
|
@@ -426,10 +461,10 @@ function createTransporter({
|
|
|
426
461
|
connectTimeout: getTimeout(timeoutsCount, timeouts.connect),
|
|
427
462
|
responseTimeout: getTimeout(timeoutsCount, responseTimeout)
|
|
428
463
|
};
|
|
429
|
-
/**
|
|
430
|
-
* The stackFrame is pushed to the stackTrace so we
|
|
431
|
-
* can have information about onRetry and onFailure
|
|
432
|
-
* decisions.
|
|
464
|
+
/**
|
|
465
|
+
* The stackFrame is pushed to the stackTrace so we
|
|
466
|
+
* can have information about onRetry and onFailure
|
|
467
|
+
* decisions.
|
|
433
468
|
*/
|
|
434
469
|
const pushToStackTrace = response => {
|
|
435
470
|
const stackFrame = {
|
|
@@ -448,17 +483,17 @@ function createTransporter({
|
|
|
448
483
|
if (response.isTimedOut) {
|
|
449
484
|
timeoutsCount++;
|
|
450
485
|
}
|
|
451
|
-
/**
|
|
452
|
-
* Failures are individually sent to the logger, allowing
|
|
453
|
-
* the end user to debug / store stack frames even
|
|
454
|
-
* 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.
|
|
455
490
|
*/
|
|
456
491
|
// eslint-disable-next-line no-console -- this will be fixed by exposing a `logger` to the transporter
|
|
457
492
|
console.log('Retryable failure', stackFrameWithoutCredentials(stackFrame));
|
|
458
|
-
/**
|
|
459
|
-
* We also store the state of the host in failure cases. If the host, is
|
|
460
|
-
* down it will remain down for the next 2 minutes. In a timeout situation,
|
|
461
|
-
* 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.
|
|
462
497
|
*/
|
|
463
498
|
await hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? 'timed out' : 'down'));
|
|
464
499
|
return retry(retryableHosts, getTimeout);
|
|
@@ -469,56 +504,56 @@ function createTransporter({
|
|
|
469
504
|
pushToStackTrace(response);
|
|
470
505
|
throw deserializeFailure(response, stackTrace);
|
|
471
506
|
};
|
|
472
|
-
/**
|
|
473
|
-
* Finally, for each retryable host perform request until we got a non
|
|
474
|
-
* retryable response. Some notes here:
|
|
475
|
-
*
|
|
476
|
-
* 1. The reverse here is applied so we can apply a `pop` later on => more performant.
|
|
477
|
-
* 2. We also get from the retryable options a timeout multiplier that is tailored
|
|
478
|
-
* 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.
|
|
479
514
|
*/
|
|
480
515
|
const compatibleHosts = hosts.filter(host => host.accept === 'readWrite' || (isRead ? host.accept === 'read' : host.accept === 'write'));
|
|
481
516
|
const options = await createRetryableOptions(compatibleHosts);
|
|
482
517
|
return retry([...options.hosts].reverse(), options.getTimeout);
|
|
483
518
|
}
|
|
484
519
|
function createRequest(request, requestOptions = {}) {
|
|
485
|
-
/**
|
|
486
|
-
* A read request is either a `GET` request, or a request that we make
|
|
487
|
-
* 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`).
|
|
488
523
|
*/
|
|
489
524
|
const isRead = request.useReadTransporter || request.method === 'GET';
|
|
490
525
|
if (!isRead) {
|
|
491
|
-
/**
|
|
492
|
-
* On write requests, no cache mechanisms are applied, and we
|
|
493
|
-
* 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.
|
|
494
529
|
*/
|
|
495
530
|
return retryableRequest(request, requestOptions, isRead);
|
|
496
531
|
}
|
|
497
532
|
const createRetryableRequest = () => {
|
|
498
|
-
/**
|
|
499
|
-
* Then, we prepare a function factory that contains the construction of
|
|
500
|
-
* the retryable request. At this point, we may *not* perform the actual
|
|
501
|
-
* 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.
|
|
502
537
|
*/
|
|
503
538
|
return retryableRequest(request, requestOptions);
|
|
504
539
|
};
|
|
505
|
-
/**
|
|
506
|
-
* Once we have the function factory ready, we need to determine of the
|
|
507
|
-
* request is "cacheable" - should be cached. Note that, once again,
|
|
508
|
-
* 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.
|
|
509
544
|
*/
|
|
510
545
|
const cacheable = requestOptions.cacheable || request.cacheable;
|
|
511
|
-
/**
|
|
512
|
-
* If is not "cacheable", we immediately trigger the retryable request, no
|
|
513
|
-
* need to check cache implementations.
|
|
546
|
+
/**
|
|
547
|
+
* If is not "cacheable", we immediately trigger the retryable request, no
|
|
548
|
+
* need to check cache implementations.
|
|
514
549
|
*/
|
|
515
550
|
if (cacheable !== true) {
|
|
516
551
|
return createRetryableRequest();
|
|
517
552
|
}
|
|
518
|
-
/**
|
|
519
|
-
* If the request is "cacheable", we need to first compute the key to ask
|
|
520
|
-
* the cache implementations if this request is on progress or if the
|
|
521
|
-
* 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.
|
|
522
557
|
*/
|
|
523
558
|
const key = {
|
|
524
559
|
request,
|
|
@@ -528,27 +563,27 @@ function createTransporter({
|
|
|
528
563
|
headers: baseHeaders
|
|
529
564
|
}
|
|
530
565
|
};
|
|
531
|
-
/**
|
|
532
|
-
* With the computed key, we first ask the responses cache
|
|
533
|
-
* 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.
|
|
534
569
|
*/
|
|
535
570
|
return responsesCache.get(key, () => {
|
|
536
|
-
/**
|
|
537
|
-
* If the request has never resolved before, we actually ask if there
|
|
538
|
-
* 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.
|
|
539
574
|
*/
|
|
540
575
|
return requestsCache.get(key, () =>
|
|
541
|
-
/**
|
|
542
|
-
* Finally, if there is no request in progress with the same key,
|
|
543
|
-
* this `createRetryableRequest()` will actually trigger the
|
|
544
|
-
* 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.
|
|
545
580
|
*/
|
|
546
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));
|
|
547
582
|
}, {
|
|
548
|
-
/**
|
|
549
|
-
* Of course, once we get this response back from the server, we
|
|
550
|
-
* tell response cache to actually store the received response
|
|
551
|
-
* 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.
|
|
552
587
|
*/
|
|
553
588
|
miss: response => responsesCache.set(key, response)
|
|
554
589
|
});
|
|
@@ -598,884 +633,1268 @@ const DEFAULT_CONNECT_TIMEOUT_BROWSER = 1000;
|
|
|
598
633
|
const DEFAULT_READ_TIMEOUT_BROWSER = 2000;
|
|
599
634
|
const DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;
|
|
600
635
|
|
|
601
|
-
function createXhrRequester() {
|
|
602
|
-
function send(request) {
|
|
603
|
-
return new Promise((resolve) => {
|
|
604
|
-
const baseRequester = new XMLHttpRequest();
|
|
605
|
-
baseRequester.open(request.method, request.url, true);
|
|
606
|
-
Object.keys(request.headers).forEach((key) => baseRequester.setRequestHeader(key, request.headers[key]));
|
|
607
|
-
const createTimeout = (timeout, content) => {
|
|
608
|
-
return setTimeout(() => {
|
|
609
|
-
baseRequester.abort();
|
|
610
|
-
resolve({
|
|
611
|
-
status: 0,
|
|
612
|
-
content,
|
|
613
|
-
isTimedOut: true,
|
|
614
|
-
});
|
|
615
|
-
}, timeout);
|
|
616
|
-
};
|
|
617
|
-
const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');
|
|
618
|
-
let responseTimeout;
|
|
619
|
-
baseRequester.onreadystatechange = () => {
|
|
620
|
-
if (baseRequester.readyState > baseRequester.OPENED &&
|
|
621
|
-
responseTimeout === undefined) {
|
|
622
|
-
clearTimeout(connectTimeout);
|
|
623
|
-
responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');
|
|
624
|
-
}
|
|
625
|
-
};
|
|
626
|
-
baseRequester.onerror = () => {
|
|
627
|
-
// istanbul ignore next
|
|
628
|
-
if (baseRequester.status === 0) {
|
|
629
|
-
clearTimeout(connectTimeout);
|
|
630
|
-
clearTimeout(responseTimeout);
|
|
631
|
-
resolve({
|
|
632
|
-
content: baseRequester.responseText || 'Network request failed',
|
|
633
|
-
status: baseRequester.status,
|
|
634
|
-
isTimedOut: false,
|
|
635
|
-
});
|
|
636
|
-
}
|
|
637
|
-
};
|
|
638
|
-
baseRequester.onload = () => {
|
|
639
|
-
clearTimeout(connectTimeout);
|
|
640
|
-
clearTimeout(responseTimeout);
|
|
641
|
-
resolve({
|
|
642
|
-
content: baseRequester.responseText,
|
|
643
|
-
status: baseRequester.status,
|
|
644
|
-
isTimedOut: false,
|
|
645
|
-
});
|
|
646
|
-
};
|
|
647
|
-
baseRequester.send(request.data);
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
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 };
|
|
651
686
|
}
|
|
652
687
|
|
|
653
|
-
//
|
|
654
|
-
const apiClientVersion = '1.0.0-alpha.
|
|
655
|
-
const REGIONS = ['us'];
|
|
656
|
-
function getDefaultHosts(region) {
|
|
657
|
-
const url = 'data.{region}.algolia.com'.replace('{region}', region);
|
|
658
|
-
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
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
|
-
* @param
|
|
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
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
}
|
|
824
|
-
const
|
|
825
|
-
const
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
*
|
|
837
|
-
*
|
|
838
|
-
* @
|
|
839
|
-
* @param
|
|
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
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
*
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
*
|
|
975
|
-
*
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
const
|
|
984
|
-
const
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
queryParameters
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
*
|
|
1086
|
-
*
|
|
1087
|
-
* @
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
*
|
|
1112
|
-
*
|
|
1113
|
-
* @
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
}
|
|
1122
|
-
const
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
*
|
|
1135
|
-
*
|
|
1136
|
-
* @
|
|
1137
|
-
* @param
|
|
1138
|
-
* @param
|
|
1139
|
-
* @param
|
|
1140
|
-
* @param
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
const
|
|
1145
|
-
const
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
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
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
*
|
|
1243
|
-
*
|
|
1244
|
-
* @
|
|
1245
|
-
* @param
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
}
|
|
1253
|
-
const
|
|
1254
|
-
const
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
* Get
|
|
1266
|
-
*
|
|
1267
|
-
* @
|
|
1268
|
-
* @param
|
|
1269
|
-
* @param
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
const requestPath = '/1/
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
}
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
*
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
const
|
|
1433
|
-
const
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
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.71';
|
|
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
|
+
* @summary Create a authentication.
|
|
777
|
+
* @param authenticationCreate -.
|
|
778
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
779
|
+
*/
|
|
780
|
+
createAuthentication(authenticationCreate, requestOptions) {
|
|
781
|
+
if (!authenticationCreate) {
|
|
782
|
+
throw new Error('Parameter `authenticationCreate` is required when calling `createAuthentication`.');
|
|
783
|
+
}
|
|
784
|
+
if (!authenticationCreate.type) {
|
|
785
|
+
throw new Error('Parameter `authenticationCreate.type` is required when calling `createAuthentication`.');
|
|
786
|
+
}
|
|
787
|
+
if (!authenticationCreate.name) {
|
|
788
|
+
throw new Error('Parameter `authenticationCreate.name` is required when calling `createAuthentication`.');
|
|
789
|
+
}
|
|
790
|
+
if (!authenticationCreate.input) {
|
|
791
|
+
throw new Error('Parameter `authenticationCreate.input` is required when calling `createAuthentication`.');
|
|
792
|
+
}
|
|
793
|
+
const requestPath = '/1/authentications';
|
|
794
|
+
const headers = {};
|
|
795
|
+
const queryParameters = {};
|
|
796
|
+
const request = {
|
|
797
|
+
method: 'POST',
|
|
798
|
+
path: requestPath,
|
|
799
|
+
queryParameters,
|
|
800
|
+
headers,
|
|
801
|
+
data: authenticationCreate,
|
|
802
|
+
};
|
|
803
|
+
return transporter.request(request, requestOptions);
|
|
804
|
+
},
|
|
805
|
+
/**
|
|
806
|
+
* Create a destination.
|
|
807
|
+
*
|
|
808
|
+
* @summary Create a destination.
|
|
809
|
+
* @param destinationCreate -.
|
|
810
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
811
|
+
*/
|
|
812
|
+
createDestination(destinationCreate, requestOptions) {
|
|
813
|
+
if (!destinationCreate) {
|
|
814
|
+
throw new Error('Parameter `destinationCreate` is required when calling `createDestination`.');
|
|
815
|
+
}
|
|
816
|
+
if (!destinationCreate.type) {
|
|
817
|
+
throw new Error('Parameter `destinationCreate.type` is required when calling `createDestination`.');
|
|
818
|
+
}
|
|
819
|
+
if (!destinationCreate.name) {
|
|
820
|
+
throw new Error('Parameter `destinationCreate.name` is required when calling `createDestination`.');
|
|
821
|
+
}
|
|
822
|
+
if (!destinationCreate.input) {
|
|
823
|
+
throw new Error('Parameter `destinationCreate.input` is required when calling `createDestination`.');
|
|
824
|
+
}
|
|
825
|
+
const requestPath = '/1/destinations';
|
|
826
|
+
const headers = {};
|
|
827
|
+
const queryParameters = {};
|
|
828
|
+
const request = {
|
|
829
|
+
method: 'POST',
|
|
830
|
+
path: requestPath,
|
|
831
|
+
queryParameters,
|
|
832
|
+
headers,
|
|
833
|
+
data: destinationCreate,
|
|
834
|
+
};
|
|
835
|
+
return transporter.request(request, requestOptions);
|
|
836
|
+
},
|
|
837
|
+
/**
|
|
838
|
+
* Create a source.
|
|
839
|
+
*
|
|
840
|
+
* @summary Create a source.
|
|
841
|
+
* @param sourceCreate -.
|
|
842
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
843
|
+
*/
|
|
844
|
+
createSource(sourceCreate, requestOptions) {
|
|
845
|
+
if (!sourceCreate) {
|
|
846
|
+
throw new Error('Parameter `sourceCreate` is required when calling `createSource`.');
|
|
847
|
+
}
|
|
848
|
+
if (!sourceCreate.type) {
|
|
849
|
+
throw new Error('Parameter `sourceCreate.type` is required when calling `createSource`.');
|
|
850
|
+
}
|
|
851
|
+
if (!sourceCreate.name) {
|
|
852
|
+
throw new Error('Parameter `sourceCreate.name` is required when calling `createSource`.');
|
|
853
|
+
}
|
|
854
|
+
if (!sourceCreate.input) {
|
|
855
|
+
throw new Error('Parameter `sourceCreate.input` is required when calling `createSource`.');
|
|
856
|
+
}
|
|
857
|
+
const requestPath = '/1/sources';
|
|
858
|
+
const headers = {};
|
|
859
|
+
const queryParameters = {};
|
|
860
|
+
const request = {
|
|
861
|
+
method: 'POST',
|
|
862
|
+
path: requestPath,
|
|
863
|
+
queryParameters,
|
|
864
|
+
headers,
|
|
865
|
+
data: sourceCreate,
|
|
866
|
+
};
|
|
867
|
+
return transporter.request(request, requestOptions);
|
|
868
|
+
},
|
|
869
|
+
/**
|
|
870
|
+
* Create a task.
|
|
871
|
+
*
|
|
872
|
+
* @summary Create a task.
|
|
873
|
+
* @param taskCreate -.
|
|
874
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
875
|
+
*/
|
|
876
|
+
createTask(taskCreate, requestOptions) {
|
|
877
|
+
if (!taskCreate) {
|
|
878
|
+
throw new Error('Parameter `taskCreate` is required when calling `createTask`.');
|
|
879
|
+
}
|
|
880
|
+
if (!taskCreate.sourceID) {
|
|
881
|
+
throw new Error('Parameter `taskCreate.sourceID` is required when calling `createTask`.');
|
|
882
|
+
}
|
|
883
|
+
if (!taskCreate.destinationID) {
|
|
884
|
+
throw new Error('Parameter `taskCreate.destinationID` is required when calling `createTask`.');
|
|
885
|
+
}
|
|
886
|
+
if (!taskCreate.trigger) {
|
|
887
|
+
throw new Error('Parameter `taskCreate.trigger` is required when calling `createTask`.');
|
|
888
|
+
}
|
|
889
|
+
if (!taskCreate.action) {
|
|
890
|
+
throw new Error('Parameter `taskCreate.action` is required when calling `createTask`.');
|
|
891
|
+
}
|
|
892
|
+
const requestPath = '/1/tasks';
|
|
893
|
+
const headers = {};
|
|
894
|
+
const queryParameters = {};
|
|
895
|
+
const request = {
|
|
896
|
+
method: 'POST',
|
|
897
|
+
path: requestPath,
|
|
898
|
+
queryParameters,
|
|
899
|
+
headers,
|
|
900
|
+
data: taskCreate,
|
|
901
|
+
};
|
|
902
|
+
return transporter.request(request, requestOptions);
|
|
903
|
+
},
|
|
904
|
+
/**
|
|
905
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
906
|
+
*
|
|
907
|
+
* @summary Send requests to the Algolia REST API.
|
|
908
|
+
* @param customDelete - The customDelete object.
|
|
909
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
910
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
911
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
912
|
+
*/
|
|
913
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
914
|
+
if (!path) {
|
|
915
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
916
|
+
}
|
|
917
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
918
|
+
const headers = {};
|
|
919
|
+
const queryParameters = parameters ? parameters : {};
|
|
920
|
+
const request = {
|
|
921
|
+
method: 'DELETE',
|
|
922
|
+
path: requestPath,
|
|
923
|
+
queryParameters,
|
|
924
|
+
headers,
|
|
925
|
+
};
|
|
926
|
+
return transporter.request(request, requestOptions);
|
|
927
|
+
},
|
|
928
|
+
/**
|
|
929
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
930
|
+
*
|
|
931
|
+
* @summary Send requests to the Algolia REST API.
|
|
932
|
+
* @param customGet - The customGet object.
|
|
933
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
934
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
935
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
936
|
+
*/
|
|
937
|
+
customGet({ path, parameters }, requestOptions) {
|
|
938
|
+
if (!path) {
|
|
939
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
940
|
+
}
|
|
941
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
942
|
+
const headers = {};
|
|
943
|
+
const queryParameters = parameters ? parameters : {};
|
|
944
|
+
const request = {
|
|
945
|
+
method: 'GET',
|
|
946
|
+
path: requestPath,
|
|
947
|
+
queryParameters,
|
|
948
|
+
headers,
|
|
949
|
+
};
|
|
950
|
+
return transporter.request(request, requestOptions);
|
|
951
|
+
},
|
|
952
|
+
/**
|
|
953
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
954
|
+
*
|
|
955
|
+
* @summary Send requests to the Algolia REST API.
|
|
956
|
+
* @param customPost - The customPost object.
|
|
957
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
958
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
959
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
960
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
961
|
+
*/
|
|
962
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
963
|
+
if (!path) {
|
|
964
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
965
|
+
}
|
|
966
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
967
|
+
const headers = {};
|
|
968
|
+
const queryParameters = parameters ? parameters : {};
|
|
969
|
+
const request = {
|
|
970
|
+
method: 'POST',
|
|
971
|
+
path: requestPath,
|
|
972
|
+
queryParameters,
|
|
973
|
+
headers,
|
|
974
|
+
data: body ? body : {},
|
|
975
|
+
};
|
|
976
|
+
return transporter.request(request, requestOptions);
|
|
977
|
+
},
|
|
978
|
+
/**
|
|
979
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
980
|
+
*
|
|
981
|
+
* @summary Send requests to the Algolia REST API.
|
|
982
|
+
* @param customPut - The customPut object.
|
|
983
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
984
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
985
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
986
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
987
|
+
*/
|
|
988
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
989
|
+
if (!path) {
|
|
990
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
991
|
+
}
|
|
992
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
993
|
+
const headers = {};
|
|
994
|
+
const queryParameters = parameters ? parameters : {};
|
|
995
|
+
const request = {
|
|
996
|
+
method: 'PUT',
|
|
997
|
+
path: requestPath,
|
|
998
|
+
queryParameters,
|
|
999
|
+
headers,
|
|
1000
|
+
data: body ? body : {},
|
|
1001
|
+
};
|
|
1002
|
+
return transporter.request(request, requestOptions);
|
|
1003
|
+
},
|
|
1004
|
+
/**
|
|
1005
|
+
* Soft delete the authentication of the given authenticationID.
|
|
1006
|
+
*
|
|
1007
|
+
* @summary Delete a authentication.
|
|
1008
|
+
* @param deleteAuthentication - The deleteAuthentication object.
|
|
1009
|
+
* @param deleteAuthentication.authenticationID - The authentication UUID.
|
|
1010
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1011
|
+
*/
|
|
1012
|
+
deleteAuthentication({ authenticationID }, requestOptions) {
|
|
1013
|
+
if (!authenticationID) {
|
|
1014
|
+
throw new Error('Parameter `authenticationID` is required when calling `deleteAuthentication`.');
|
|
1015
|
+
}
|
|
1016
|
+
const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
|
|
1017
|
+
const headers = {};
|
|
1018
|
+
const queryParameters = {};
|
|
1019
|
+
const request = {
|
|
1020
|
+
method: 'DELETE',
|
|
1021
|
+
path: requestPath,
|
|
1022
|
+
queryParameters,
|
|
1023
|
+
headers,
|
|
1024
|
+
};
|
|
1025
|
+
return transporter.request(request, requestOptions);
|
|
1026
|
+
},
|
|
1027
|
+
/**
|
|
1028
|
+
* Soft delete the destination of the given destinationID.
|
|
1029
|
+
*
|
|
1030
|
+
* @summary Delete a destination.
|
|
1031
|
+
* @param deleteDestination - The deleteDestination object.
|
|
1032
|
+
* @param deleteDestination.destinationID - The destination UUID.
|
|
1033
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1034
|
+
*/
|
|
1035
|
+
deleteDestination({ destinationID }, requestOptions) {
|
|
1036
|
+
if (!destinationID) {
|
|
1037
|
+
throw new Error('Parameter `destinationID` is required when calling `deleteDestination`.');
|
|
1038
|
+
}
|
|
1039
|
+
const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
|
|
1040
|
+
const headers = {};
|
|
1041
|
+
const queryParameters = {};
|
|
1042
|
+
const request = {
|
|
1043
|
+
method: 'DELETE',
|
|
1044
|
+
path: requestPath,
|
|
1045
|
+
queryParameters,
|
|
1046
|
+
headers,
|
|
1047
|
+
};
|
|
1048
|
+
return transporter.request(request, requestOptions);
|
|
1049
|
+
},
|
|
1050
|
+
/**
|
|
1051
|
+
* Soft delete the source of the given sourceID.
|
|
1052
|
+
*
|
|
1053
|
+
* @summary Delete a source.
|
|
1054
|
+
* @param deleteSource - The deleteSource object.
|
|
1055
|
+
* @param deleteSource.sourceID - The source UUID.
|
|
1056
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1057
|
+
*/
|
|
1058
|
+
deleteSource({ sourceID }, requestOptions) {
|
|
1059
|
+
if (!sourceID) {
|
|
1060
|
+
throw new Error('Parameter `sourceID` is required when calling `deleteSource`.');
|
|
1061
|
+
}
|
|
1062
|
+
const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
|
|
1063
|
+
const headers = {};
|
|
1064
|
+
const queryParameters = {};
|
|
1065
|
+
const request = {
|
|
1066
|
+
method: 'DELETE',
|
|
1067
|
+
path: requestPath,
|
|
1068
|
+
queryParameters,
|
|
1069
|
+
headers,
|
|
1070
|
+
};
|
|
1071
|
+
return transporter.request(request, requestOptions);
|
|
1072
|
+
},
|
|
1073
|
+
/**
|
|
1074
|
+
* Soft delete the task of the given taskID.
|
|
1075
|
+
*
|
|
1076
|
+
* @summary Delete a task.
|
|
1077
|
+
* @param deleteTask - The deleteTask object.
|
|
1078
|
+
* @param deleteTask.taskID - The task UUID.
|
|
1079
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1080
|
+
*/
|
|
1081
|
+
deleteTask({ taskID }, requestOptions) {
|
|
1082
|
+
if (!taskID) {
|
|
1083
|
+
throw new Error('Parameter `taskID` is required when calling `deleteTask`.');
|
|
1084
|
+
}
|
|
1085
|
+
const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1086
|
+
const headers = {};
|
|
1087
|
+
const queryParameters = {};
|
|
1088
|
+
const request = {
|
|
1089
|
+
method: 'DELETE',
|
|
1090
|
+
path: requestPath,
|
|
1091
|
+
queryParameters,
|
|
1092
|
+
headers,
|
|
1093
|
+
};
|
|
1094
|
+
return transporter.request(request, requestOptions);
|
|
1095
|
+
},
|
|
1096
|
+
/**
|
|
1097
|
+
* Disable the task of the given taskID.
|
|
1098
|
+
*
|
|
1099
|
+
* @summary Disable a task.
|
|
1100
|
+
* @param disableTask - The disableTask object.
|
|
1101
|
+
* @param disableTask.taskID - The task UUID.
|
|
1102
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1103
|
+
*/
|
|
1104
|
+
disableTask({ taskID }, requestOptions) {
|
|
1105
|
+
if (!taskID) {
|
|
1106
|
+
throw new Error('Parameter `taskID` is required when calling `disableTask`.');
|
|
1107
|
+
}
|
|
1108
|
+
const requestPath = '/1/tasks/{taskID}/disable'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1109
|
+
const headers = {};
|
|
1110
|
+
const queryParameters = {};
|
|
1111
|
+
const request = {
|
|
1112
|
+
method: 'PUT',
|
|
1113
|
+
path: requestPath,
|
|
1114
|
+
queryParameters,
|
|
1115
|
+
headers,
|
|
1116
|
+
};
|
|
1117
|
+
return transporter.request(request, requestOptions);
|
|
1118
|
+
},
|
|
1119
|
+
/**
|
|
1120
|
+
* Enable the task of the given taskID.
|
|
1121
|
+
*
|
|
1122
|
+
* @summary Enable a task.
|
|
1123
|
+
* @param enableTask - The enableTask object.
|
|
1124
|
+
* @param enableTask.taskID - The task UUID.
|
|
1125
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1126
|
+
*/
|
|
1127
|
+
enableTask({ taskID }, requestOptions) {
|
|
1128
|
+
if (!taskID) {
|
|
1129
|
+
throw new Error('Parameter `taskID` is required when calling `enableTask`.');
|
|
1130
|
+
}
|
|
1131
|
+
const requestPath = '/1/tasks/{taskID}/enable'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1132
|
+
const headers = {};
|
|
1133
|
+
const queryParameters = {};
|
|
1134
|
+
const request = {
|
|
1135
|
+
method: 'PUT',
|
|
1136
|
+
path: requestPath,
|
|
1137
|
+
queryParameters,
|
|
1138
|
+
headers,
|
|
1139
|
+
};
|
|
1140
|
+
return transporter.request(request, requestOptions);
|
|
1141
|
+
},
|
|
1142
|
+
/**
|
|
1143
|
+
* Get the authentication of the given authenticationID.
|
|
1144
|
+
*
|
|
1145
|
+
* @summary Get a authentication.
|
|
1146
|
+
* @param getAuthentication - The getAuthentication object.
|
|
1147
|
+
* @param getAuthentication.authenticationID - The authentication UUID.
|
|
1148
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1149
|
+
*/
|
|
1150
|
+
getAuthentication({ authenticationID }, requestOptions) {
|
|
1151
|
+
if (!authenticationID) {
|
|
1152
|
+
throw new Error('Parameter `authenticationID` is required when calling `getAuthentication`.');
|
|
1153
|
+
}
|
|
1154
|
+
const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
|
|
1155
|
+
const headers = {};
|
|
1156
|
+
const queryParameters = {};
|
|
1157
|
+
const request = {
|
|
1158
|
+
method: 'GET',
|
|
1159
|
+
path: requestPath,
|
|
1160
|
+
queryParameters,
|
|
1161
|
+
headers,
|
|
1162
|
+
};
|
|
1163
|
+
return transporter.request(request, requestOptions);
|
|
1164
|
+
},
|
|
1165
|
+
/**
|
|
1166
|
+
* Get a list of authentications for the given query parameters, with pagination details.
|
|
1167
|
+
*
|
|
1168
|
+
* @summary Get a list of authentications.
|
|
1169
|
+
* @param getAuthentications - The getAuthentications object.
|
|
1170
|
+
* @param getAuthentications.itemsPerPage - The number of items per page to return.
|
|
1171
|
+
* @param getAuthentications.page - The page number to fetch, starting at 1.
|
|
1172
|
+
* @param getAuthentications.type - The type of the authentications to retrieve.
|
|
1173
|
+
* @param getAuthentications.platform - The platform of the authentications to retrieve.
|
|
1174
|
+
* @param getAuthentications.sort - The key by which the list should be sorted.
|
|
1175
|
+
* @param getAuthentications.order - The order of the returned list.
|
|
1176
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1177
|
+
*/
|
|
1178
|
+
getAuthentications({ itemsPerPage, page, type, platform, sort, order, } = {}, requestOptions = undefined) {
|
|
1179
|
+
const requestPath = '/1/authentications';
|
|
1180
|
+
const headers = {};
|
|
1181
|
+
const queryParameters = {};
|
|
1182
|
+
if (itemsPerPage !== undefined) {
|
|
1183
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1184
|
+
}
|
|
1185
|
+
if (page !== undefined) {
|
|
1186
|
+
queryParameters.page = page.toString();
|
|
1187
|
+
}
|
|
1188
|
+
if (type !== undefined) {
|
|
1189
|
+
queryParameters.type = type.toString();
|
|
1190
|
+
}
|
|
1191
|
+
if (platform !== undefined) {
|
|
1192
|
+
queryParameters.platform = platform.toString();
|
|
1193
|
+
}
|
|
1194
|
+
if (sort !== undefined) {
|
|
1195
|
+
queryParameters.sort = sort.toString();
|
|
1196
|
+
}
|
|
1197
|
+
if (order !== undefined) {
|
|
1198
|
+
queryParameters.order = order.toString();
|
|
1199
|
+
}
|
|
1200
|
+
const request = {
|
|
1201
|
+
method: 'GET',
|
|
1202
|
+
path: requestPath,
|
|
1203
|
+
queryParameters,
|
|
1204
|
+
headers,
|
|
1205
|
+
};
|
|
1206
|
+
return transporter.request(request, requestOptions);
|
|
1207
|
+
},
|
|
1208
|
+
/**
|
|
1209
|
+
* Get the destination of the given destinationID.
|
|
1210
|
+
*
|
|
1211
|
+
* @summary Get a destination.
|
|
1212
|
+
* @param getDestination - The getDestination object.
|
|
1213
|
+
* @param getDestination.destinationID - The destination UUID.
|
|
1214
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1215
|
+
*/
|
|
1216
|
+
getDestination({ destinationID }, requestOptions) {
|
|
1217
|
+
if (!destinationID) {
|
|
1218
|
+
throw new Error('Parameter `destinationID` is required when calling `getDestination`.');
|
|
1219
|
+
}
|
|
1220
|
+
const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
|
|
1221
|
+
const headers = {};
|
|
1222
|
+
const queryParameters = {};
|
|
1223
|
+
const request = {
|
|
1224
|
+
method: 'GET',
|
|
1225
|
+
path: requestPath,
|
|
1226
|
+
queryParameters,
|
|
1227
|
+
headers,
|
|
1228
|
+
};
|
|
1229
|
+
return transporter.request(request, requestOptions);
|
|
1230
|
+
},
|
|
1231
|
+
/**
|
|
1232
|
+
* Get a list of destinations for the given query parameters, with pagination details.
|
|
1233
|
+
*
|
|
1234
|
+
* @summary Get a list of destinations.
|
|
1235
|
+
* @param getDestinations - The getDestinations object.
|
|
1236
|
+
* @param getDestinations.itemsPerPage - The number of items per page to return.
|
|
1237
|
+
* @param getDestinations.page - The page number to fetch, starting at 1.
|
|
1238
|
+
* @param getDestinations.type - The type of the destinations to retrive.
|
|
1239
|
+
* @param getDestinations.authenticationID - The authenticationIDs of the destinations to retrive.
|
|
1240
|
+
* @param getDestinations.sort - The key by which the list should be sorted.
|
|
1241
|
+
* @param getDestinations.order - The order of the returned list.
|
|
1242
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1243
|
+
*/
|
|
1244
|
+
getDestinations({ itemsPerPage, page, type, authenticationID, sort, order, } = {}, requestOptions = undefined) {
|
|
1245
|
+
const requestPath = '/1/destinations';
|
|
1246
|
+
const headers = {};
|
|
1247
|
+
const queryParameters = {};
|
|
1248
|
+
if (itemsPerPage !== undefined) {
|
|
1249
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1250
|
+
}
|
|
1251
|
+
if (page !== undefined) {
|
|
1252
|
+
queryParameters.page = page.toString();
|
|
1253
|
+
}
|
|
1254
|
+
if (type !== undefined) {
|
|
1255
|
+
queryParameters.type = type.toString();
|
|
1256
|
+
}
|
|
1257
|
+
if (authenticationID !== undefined) {
|
|
1258
|
+
queryParameters.authenticationID = authenticationID.toString();
|
|
1259
|
+
}
|
|
1260
|
+
if (sort !== undefined) {
|
|
1261
|
+
queryParameters.sort = sort.toString();
|
|
1262
|
+
}
|
|
1263
|
+
if (order !== undefined) {
|
|
1264
|
+
queryParameters.order = order.toString();
|
|
1265
|
+
}
|
|
1266
|
+
const request = {
|
|
1267
|
+
method: 'GET',
|
|
1268
|
+
path: requestPath,
|
|
1269
|
+
queryParameters,
|
|
1270
|
+
headers,
|
|
1271
|
+
};
|
|
1272
|
+
return transporter.request(request, requestOptions);
|
|
1273
|
+
},
|
|
1274
|
+
/**
|
|
1275
|
+
* Retrieve a stream listing for a given Singer specification compatible docker type source ID.
|
|
1276
|
+
*
|
|
1277
|
+
* @summary Retrieve a stream listing.
|
|
1278
|
+
* @param getDockerSourceStreams - The getDockerSourceStreams object.
|
|
1279
|
+
* @param getDockerSourceStreams.sourceID - The source UUID.
|
|
1280
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1281
|
+
*/
|
|
1282
|
+
getDockerSourceStreams({ sourceID }, requestOptions) {
|
|
1283
|
+
if (!sourceID) {
|
|
1284
|
+
throw new Error('Parameter `sourceID` is required when calling `getDockerSourceStreams`.');
|
|
1285
|
+
}
|
|
1286
|
+
const requestPath = '/1/sources/{sourceID}/discover'.replace('{sourceID}', encodeURIComponent(sourceID));
|
|
1287
|
+
const headers = {};
|
|
1288
|
+
const queryParameters = {};
|
|
1289
|
+
const request = {
|
|
1290
|
+
method: 'GET',
|
|
1291
|
+
path: requestPath,
|
|
1292
|
+
queryParameters,
|
|
1293
|
+
headers,
|
|
1294
|
+
};
|
|
1295
|
+
return transporter.request(request, requestOptions);
|
|
1296
|
+
},
|
|
1297
|
+
/**
|
|
1298
|
+
* Get a single event for a specific runID.
|
|
1299
|
+
*
|
|
1300
|
+
* @summary Get an event.
|
|
1301
|
+
* @param getEvent - The getEvent object.
|
|
1302
|
+
* @param getEvent.runID - The run UUID.
|
|
1303
|
+
* @param getEvent.eventID - The event UUID.
|
|
1304
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1305
|
+
*/
|
|
1306
|
+
getEvent({ runID, eventID }, requestOptions) {
|
|
1307
|
+
if (!runID) {
|
|
1308
|
+
throw new Error('Parameter `runID` is required when calling `getEvent`.');
|
|
1309
|
+
}
|
|
1310
|
+
if (!eventID) {
|
|
1311
|
+
throw new Error('Parameter `eventID` is required when calling `getEvent`.');
|
|
1312
|
+
}
|
|
1313
|
+
const requestPath = '/1/runs/{runID}/events/{eventID}'
|
|
1314
|
+
.replace('{runID}', encodeURIComponent(runID))
|
|
1315
|
+
.replace('{eventID}', encodeURIComponent(eventID));
|
|
1316
|
+
const headers = {};
|
|
1317
|
+
const queryParameters = {};
|
|
1318
|
+
const request = {
|
|
1319
|
+
method: 'GET',
|
|
1320
|
+
path: requestPath,
|
|
1321
|
+
queryParameters,
|
|
1322
|
+
headers,
|
|
1323
|
+
};
|
|
1324
|
+
return transporter.request(request, requestOptions);
|
|
1325
|
+
},
|
|
1326
|
+
/**
|
|
1327
|
+
* Get a list of events associated to the given runID, for the given query parameters.
|
|
1328
|
+
*
|
|
1329
|
+
* @summary Get a list of events.
|
|
1330
|
+
* @param getEvents - The getEvents object.
|
|
1331
|
+
* @param getEvents.runID - The run UUID.
|
|
1332
|
+
* @param getEvents.itemsPerPage - The number of items per page to return.
|
|
1333
|
+
* @param getEvents.page - The page number to fetch, starting at 1.
|
|
1334
|
+
* @param getEvents.status - Filter the status of the events.
|
|
1335
|
+
* @param getEvents.type - Filter the type of the events.
|
|
1336
|
+
* @param getEvents.sort - The key by which the list should be sorted.
|
|
1337
|
+
* @param getEvents.order - The order of the returned list.
|
|
1338
|
+
* @param getEvents.startDate - The start date (in RFC3339 format) of the events fetching window. Defaults to \'now\'-3 hours if omitted.
|
|
1339
|
+
* @param getEvents.endDate - The end date (in RFC3339 format) of the events fetching window. Defaults to \'now\' days if omitted.
|
|
1340
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1341
|
+
*/
|
|
1342
|
+
getEvents({ runID, itemsPerPage, page, status, type, sort, order, startDate, endDate, }, requestOptions) {
|
|
1343
|
+
if (!runID) {
|
|
1344
|
+
throw new Error('Parameter `runID` is required when calling `getEvents`.');
|
|
1345
|
+
}
|
|
1346
|
+
const requestPath = '/1/runs/{runID}/events'.replace('{runID}', encodeURIComponent(runID));
|
|
1347
|
+
const headers = {};
|
|
1348
|
+
const queryParameters = {};
|
|
1349
|
+
if (itemsPerPage !== undefined) {
|
|
1350
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1351
|
+
}
|
|
1352
|
+
if (page !== undefined) {
|
|
1353
|
+
queryParameters.page = page.toString();
|
|
1354
|
+
}
|
|
1355
|
+
if (status !== undefined) {
|
|
1356
|
+
queryParameters.status = status.toString();
|
|
1357
|
+
}
|
|
1358
|
+
if (type !== undefined) {
|
|
1359
|
+
queryParameters.type = type.toString();
|
|
1360
|
+
}
|
|
1361
|
+
if (sort !== undefined) {
|
|
1362
|
+
queryParameters.sort = sort.toString();
|
|
1363
|
+
}
|
|
1364
|
+
if (order !== undefined) {
|
|
1365
|
+
queryParameters.order = order.toString();
|
|
1366
|
+
}
|
|
1367
|
+
if (startDate !== undefined) {
|
|
1368
|
+
queryParameters.startDate = startDate.toString();
|
|
1369
|
+
}
|
|
1370
|
+
if (endDate !== undefined) {
|
|
1371
|
+
queryParameters.endDate = endDate.toString();
|
|
1372
|
+
}
|
|
1373
|
+
const request = {
|
|
1374
|
+
method: 'GET',
|
|
1375
|
+
path: requestPath,
|
|
1376
|
+
queryParameters,
|
|
1377
|
+
headers,
|
|
1378
|
+
};
|
|
1379
|
+
return transporter.request(request, requestOptions);
|
|
1380
|
+
},
|
|
1381
|
+
/**
|
|
1382
|
+
* Get a single run for the given ID.
|
|
1383
|
+
*
|
|
1384
|
+
* @summary Get a run.
|
|
1385
|
+
* @param getRun - The getRun object.
|
|
1386
|
+
* @param getRun.runID - The run UUID.
|
|
1387
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1388
|
+
*/
|
|
1389
|
+
getRun({ runID }, requestOptions) {
|
|
1390
|
+
if (!runID) {
|
|
1391
|
+
throw new Error('Parameter `runID` is required when calling `getRun`.');
|
|
1392
|
+
}
|
|
1393
|
+
const requestPath = '/1/runs/{runID}'.replace('{runID}', encodeURIComponent(runID));
|
|
1394
|
+
const headers = {};
|
|
1395
|
+
const queryParameters = {};
|
|
1396
|
+
const request = {
|
|
1397
|
+
method: 'GET',
|
|
1398
|
+
path: requestPath,
|
|
1399
|
+
queryParameters,
|
|
1400
|
+
headers,
|
|
1401
|
+
};
|
|
1402
|
+
return transporter.request(request, requestOptions);
|
|
1403
|
+
},
|
|
1404
|
+
/**
|
|
1405
|
+
* Get a list of runs for the given query parameters, with pagination details.
|
|
1406
|
+
*
|
|
1407
|
+
* @summary Get a list of runs.
|
|
1408
|
+
* @param getRuns - The getRuns object.
|
|
1409
|
+
* @param getRuns.itemsPerPage - The number of items per page to return.
|
|
1410
|
+
* @param getRuns.page - The page number to fetch, starting at 1.
|
|
1411
|
+
* @param getRuns.status - Filter the status of the runs.
|
|
1412
|
+
* @param getRuns.taskID - Filter by taskID.
|
|
1413
|
+
* @param getRuns.sort - The key by which the list should be sorted.
|
|
1414
|
+
* @param getRuns.order - The order of the returned list.
|
|
1415
|
+
* @param getRuns.startDate - The start date (in RFC3339 format) of the runs fetching window. Defaults to \'now\'-7 days if omitted.
|
|
1416
|
+
* @param getRuns.endDate - The end date (in RFC3339 format) of the runs fetching window. Defaults to \'now\' days if omitted.
|
|
1417
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1418
|
+
*/
|
|
1419
|
+
getRuns({ itemsPerPage, page, status, taskID, sort, order, startDate, endDate, } = {}, requestOptions = undefined) {
|
|
1420
|
+
const requestPath = '/1/runs';
|
|
1421
|
+
const headers = {};
|
|
1422
|
+
const queryParameters = {};
|
|
1423
|
+
if (itemsPerPage !== undefined) {
|
|
1424
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1425
|
+
}
|
|
1426
|
+
if (page !== undefined) {
|
|
1427
|
+
queryParameters.page = page.toString();
|
|
1428
|
+
}
|
|
1429
|
+
if (status !== undefined) {
|
|
1430
|
+
queryParameters.status = status.toString();
|
|
1431
|
+
}
|
|
1432
|
+
if (taskID !== undefined) {
|
|
1433
|
+
queryParameters.taskID = taskID.toString();
|
|
1434
|
+
}
|
|
1435
|
+
if (sort !== undefined) {
|
|
1436
|
+
queryParameters.sort = sort.toString();
|
|
1437
|
+
}
|
|
1438
|
+
if (order !== undefined) {
|
|
1439
|
+
queryParameters.order = order.toString();
|
|
1440
|
+
}
|
|
1441
|
+
if (startDate !== undefined) {
|
|
1442
|
+
queryParameters.startDate = startDate.toString();
|
|
1443
|
+
}
|
|
1444
|
+
if (endDate !== undefined) {
|
|
1445
|
+
queryParameters.endDate = endDate.toString();
|
|
1446
|
+
}
|
|
1447
|
+
const request = {
|
|
1448
|
+
method: 'GET',
|
|
1449
|
+
path: requestPath,
|
|
1450
|
+
queryParameters,
|
|
1451
|
+
headers,
|
|
1452
|
+
};
|
|
1453
|
+
return transporter.request(request, requestOptions);
|
|
1454
|
+
},
|
|
1455
|
+
/**
|
|
1456
|
+
* Get the source of the given sourceID.
|
|
1457
|
+
*
|
|
1458
|
+
* @summary Get a source.
|
|
1459
|
+
* @param getSource - The getSource object.
|
|
1460
|
+
* @param getSource.sourceID - The source UUID.
|
|
1461
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1462
|
+
*/
|
|
1463
|
+
getSource({ sourceID }, requestOptions) {
|
|
1464
|
+
if (!sourceID) {
|
|
1465
|
+
throw new Error('Parameter `sourceID` is required when calling `getSource`.');
|
|
1466
|
+
}
|
|
1467
|
+
const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
|
|
1468
|
+
const headers = {};
|
|
1469
|
+
const queryParameters = {};
|
|
1470
|
+
const request = {
|
|
1471
|
+
method: 'GET',
|
|
1472
|
+
path: requestPath,
|
|
1473
|
+
queryParameters,
|
|
1474
|
+
headers,
|
|
1475
|
+
};
|
|
1476
|
+
return transporter.request(request, requestOptions);
|
|
1477
|
+
},
|
|
1478
|
+
/**
|
|
1479
|
+
* Get a list of sources for the given query parameters, with pagination details.
|
|
1480
|
+
*
|
|
1481
|
+
* @summary Get a list of sources.
|
|
1482
|
+
* @param getSources - The getSources object.
|
|
1483
|
+
* @param getSources.itemsPerPage - The number of items per page to return.
|
|
1484
|
+
* @param getSources.page - The page number to fetch, starting at 1.
|
|
1485
|
+
* @param getSources.type - The type of the sources to retrieve.
|
|
1486
|
+
* @param getSources.authenticationID - The authenticationIDs of the sources to retrieve. \'none\' returns sources that doesn\'t have an authentication.
|
|
1487
|
+
* @param getSources.sort - The key by which the list should be sorted.
|
|
1488
|
+
* @param getSources.order - The order of the returned list.
|
|
1489
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1490
|
+
*/
|
|
1491
|
+
getSources({ itemsPerPage, page, type, authenticationID, sort, order, } = {}, requestOptions = undefined) {
|
|
1492
|
+
const requestPath = '/1/sources';
|
|
1493
|
+
const headers = {};
|
|
1494
|
+
const queryParameters = {};
|
|
1495
|
+
if (itemsPerPage !== undefined) {
|
|
1496
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1497
|
+
}
|
|
1498
|
+
if (page !== undefined) {
|
|
1499
|
+
queryParameters.page = page.toString();
|
|
1500
|
+
}
|
|
1501
|
+
if (type !== undefined) {
|
|
1502
|
+
queryParameters.type = type.toString();
|
|
1503
|
+
}
|
|
1504
|
+
if (authenticationID !== undefined) {
|
|
1505
|
+
queryParameters.authenticationID = authenticationID.toString();
|
|
1506
|
+
}
|
|
1507
|
+
if (sort !== undefined) {
|
|
1508
|
+
queryParameters.sort = sort.toString();
|
|
1509
|
+
}
|
|
1510
|
+
if (order !== undefined) {
|
|
1511
|
+
queryParameters.order = order.toString();
|
|
1512
|
+
}
|
|
1513
|
+
const request = {
|
|
1514
|
+
method: 'GET',
|
|
1515
|
+
path: requestPath,
|
|
1516
|
+
queryParameters,
|
|
1517
|
+
headers,
|
|
1518
|
+
};
|
|
1519
|
+
return transporter.request(request, requestOptions);
|
|
1520
|
+
},
|
|
1521
|
+
/**
|
|
1522
|
+
* Get the task of the given taskID.
|
|
1523
|
+
*
|
|
1524
|
+
* @summary Get a task.
|
|
1525
|
+
* @param getTask - The getTask object.
|
|
1526
|
+
* @param getTask.taskID - The task UUID.
|
|
1527
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1528
|
+
*/
|
|
1529
|
+
getTask({ taskID }, requestOptions) {
|
|
1530
|
+
if (!taskID) {
|
|
1531
|
+
throw new Error('Parameter `taskID` is required when calling `getTask`.');
|
|
1532
|
+
}
|
|
1533
|
+
const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
|
|
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 tasks for the given query parameters, with pagination details.
|
|
1546
|
+
*
|
|
1547
|
+
* @summary Get a list of tasks.
|
|
1548
|
+
* @param getTasks - The getTasks object.
|
|
1549
|
+
* @param getTasks.itemsPerPage - The number of items per page to return.
|
|
1550
|
+
* @param getTasks.page - The page number to fetch, starting at 1.
|
|
1551
|
+
* @param getTasks.action - The action of the tasks to retrieve.
|
|
1552
|
+
* @param getTasks.enabled - Whether the task is enabled or not.
|
|
1553
|
+
* @param getTasks.sourceID - The sourceIDs of the tasks to retrive.
|
|
1554
|
+
* @param getTasks.destinationID - The destinationIDs of the tasks to retrive.
|
|
1555
|
+
* @param getTasks.triggerType - The trigger type of the task.
|
|
1556
|
+
* @param getTasks.sort - The key by which the list should be sorted.
|
|
1557
|
+
* @param getTasks.order - The order of the returned list.
|
|
1558
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1559
|
+
*/
|
|
1560
|
+
getTasks({ itemsPerPage, page, action, enabled, sourceID, destinationID, triggerType, sort, order, } = {}, requestOptions = undefined) {
|
|
1561
|
+
const requestPath = '/1/tasks';
|
|
1562
|
+
const headers = {};
|
|
1563
|
+
const queryParameters = {};
|
|
1564
|
+
if (itemsPerPage !== undefined) {
|
|
1565
|
+
queryParameters.itemsPerPage = itemsPerPage.toString();
|
|
1566
|
+
}
|
|
1567
|
+
if (page !== undefined) {
|
|
1568
|
+
queryParameters.page = page.toString();
|
|
1569
|
+
}
|
|
1570
|
+
if (action !== undefined) {
|
|
1571
|
+
queryParameters.action = action.toString();
|
|
1572
|
+
}
|
|
1573
|
+
if (enabled !== undefined) {
|
|
1574
|
+
queryParameters.enabled = enabled.toString();
|
|
1575
|
+
}
|
|
1576
|
+
if (sourceID !== undefined) {
|
|
1577
|
+
queryParameters.sourceID = sourceID.toString();
|
|
1578
|
+
}
|
|
1579
|
+
if (destinationID !== undefined) {
|
|
1580
|
+
queryParameters.destinationID = destinationID.toString();
|
|
1581
|
+
}
|
|
1582
|
+
if (triggerType !== undefined) {
|
|
1583
|
+
queryParameters.triggerType = triggerType.toString();
|
|
1584
|
+
}
|
|
1585
|
+
if (sort !== undefined) {
|
|
1586
|
+
queryParameters.sort = sort.toString();
|
|
1587
|
+
}
|
|
1588
|
+
if (order !== undefined) {
|
|
1589
|
+
queryParameters.order = order.toString();
|
|
1590
|
+
}
|
|
1591
|
+
const request = {
|
|
1592
|
+
method: 'GET',
|
|
1593
|
+
path: requestPath,
|
|
1594
|
+
queryParameters,
|
|
1595
|
+
headers,
|
|
1596
|
+
};
|
|
1597
|
+
return transporter.request(request, requestOptions);
|
|
1598
|
+
},
|
|
1599
|
+
/**
|
|
1600
|
+
* Run the task of the given taskID.
|
|
1601
|
+
*
|
|
1602
|
+
* @summary Run a task.
|
|
1603
|
+
* @param runTask - The runTask object.
|
|
1604
|
+
* @param runTask.taskID - The task UUID.
|
|
1605
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1606
|
+
*/
|
|
1607
|
+
runTask({ taskID }, requestOptions) {
|
|
1608
|
+
if (!taskID) {
|
|
1609
|
+
throw new Error('Parameter `taskID` is required when calling `runTask`.');
|
|
1610
|
+
}
|
|
1611
|
+
const requestPath = '/1/tasks/{taskID}/run'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1612
|
+
const headers = {};
|
|
1613
|
+
const queryParameters = {};
|
|
1614
|
+
const request = {
|
|
1615
|
+
method: 'POST',
|
|
1616
|
+
path: requestPath,
|
|
1617
|
+
queryParameters,
|
|
1618
|
+
headers,
|
|
1619
|
+
};
|
|
1620
|
+
return transporter.request(request, requestOptions);
|
|
1621
|
+
},
|
|
1622
|
+
/**
|
|
1623
|
+
* Search among authentications with a defined set of parameters.
|
|
1624
|
+
*
|
|
1625
|
+
* @summary Search among authentications.
|
|
1626
|
+
* @param authenticationSearch - The authenticationSearch object.
|
|
1627
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1628
|
+
*/
|
|
1629
|
+
searchAuthentications(authenticationSearch, requestOptions) {
|
|
1630
|
+
if (!authenticationSearch) {
|
|
1631
|
+
throw new Error('Parameter `authenticationSearch` is required when calling `searchAuthentications`.');
|
|
1632
|
+
}
|
|
1633
|
+
if (!authenticationSearch.authenticationIDs) {
|
|
1634
|
+
throw new Error('Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.');
|
|
1635
|
+
}
|
|
1636
|
+
const requestPath = '/1/authentications/search';
|
|
1637
|
+
const headers = {};
|
|
1638
|
+
const queryParameters = {};
|
|
1639
|
+
const request = {
|
|
1640
|
+
method: 'POST',
|
|
1641
|
+
path: requestPath,
|
|
1642
|
+
queryParameters,
|
|
1643
|
+
headers,
|
|
1644
|
+
data: authenticationSearch,
|
|
1645
|
+
};
|
|
1646
|
+
return transporter.request(request, requestOptions);
|
|
1647
|
+
},
|
|
1648
|
+
/**
|
|
1649
|
+
* Search among destinations with a defined set of parameters.
|
|
1650
|
+
*
|
|
1651
|
+
* @summary Search among destinations.
|
|
1652
|
+
* @param destinationSearch - The destinationSearch object.
|
|
1653
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1654
|
+
*/
|
|
1655
|
+
searchDestinations(destinationSearch, requestOptions) {
|
|
1656
|
+
if (!destinationSearch) {
|
|
1657
|
+
throw new Error('Parameter `destinationSearch` is required when calling `searchDestinations`.');
|
|
1658
|
+
}
|
|
1659
|
+
if (!destinationSearch.destinationIDs) {
|
|
1660
|
+
throw new Error('Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.');
|
|
1661
|
+
}
|
|
1662
|
+
const requestPath = '/1/destinations/search';
|
|
1663
|
+
const headers = {};
|
|
1664
|
+
const queryParameters = {};
|
|
1665
|
+
const request = {
|
|
1666
|
+
method: 'POST',
|
|
1667
|
+
path: requestPath,
|
|
1668
|
+
queryParameters,
|
|
1669
|
+
headers,
|
|
1670
|
+
data: destinationSearch,
|
|
1671
|
+
};
|
|
1672
|
+
return transporter.request(request, requestOptions);
|
|
1673
|
+
},
|
|
1674
|
+
/**
|
|
1675
|
+
* Search among sources with a defined set of parameters.
|
|
1676
|
+
*
|
|
1677
|
+
* @summary Search among sources.
|
|
1678
|
+
* @param sourceSearch - The sourceSearch object.
|
|
1679
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1680
|
+
*/
|
|
1681
|
+
searchSources(sourceSearch, requestOptions) {
|
|
1682
|
+
if (!sourceSearch) {
|
|
1683
|
+
throw new Error('Parameter `sourceSearch` is required when calling `searchSources`.');
|
|
1684
|
+
}
|
|
1685
|
+
if (!sourceSearch.sourceIDs) {
|
|
1686
|
+
throw new Error('Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.');
|
|
1687
|
+
}
|
|
1688
|
+
const requestPath = '/1/sources/search';
|
|
1689
|
+
const headers = {};
|
|
1690
|
+
const queryParameters = {};
|
|
1691
|
+
const request = {
|
|
1692
|
+
method: 'POST',
|
|
1693
|
+
path: requestPath,
|
|
1694
|
+
queryParameters,
|
|
1695
|
+
headers,
|
|
1696
|
+
data: sourceSearch,
|
|
1697
|
+
};
|
|
1698
|
+
return transporter.request(request, requestOptions);
|
|
1699
|
+
},
|
|
1700
|
+
/**
|
|
1701
|
+
* Search among tasks with a defined set of parameters.
|
|
1702
|
+
*
|
|
1703
|
+
* @summary Search among tasks.
|
|
1704
|
+
* @param taskSearch - The taskSearch object.
|
|
1705
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1706
|
+
*/
|
|
1707
|
+
searchTasks(taskSearch, requestOptions) {
|
|
1708
|
+
if (!taskSearch) {
|
|
1709
|
+
throw new Error('Parameter `taskSearch` is required when calling `searchTasks`.');
|
|
1710
|
+
}
|
|
1711
|
+
if (!taskSearch.taskIDs) {
|
|
1712
|
+
throw new Error('Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.');
|
|
1713
|
+
}
|
|
1714
|
+
const requestPath = '/1/tasks/search';
|
|
1715
|
+
const headers = {};
|
|
1716
|
+
const queryParameters = {};
|
|
1717
|
+
const request = {
|
|
1718
|
+
method: 'POST',
|
|
1719
|
+
path: requestPath,
|
|
1720
|
+
queryParameters,
|
|
1721
|
+
headers,
|
|
1722
|
+
data: taskSearch,
|
|
1723
|
+
};
|
|
1724
|
+
return transporter.request(request, requestOptions);
|
|
1725
|
+
},
|
|
1726
|
+
/**
|
|
1727
|
+
* Trigger a stream listing request for a Singer specification compatible docker type source.
|
|
1728
|
+
*
|
|
1729
|
+
* @summary Trigger a stream listing request.
|
|
1730
|
+
* @param triggerDockerSourceDiscover - The triggerDockerSourceDiscover object.
|
|
1731
|
+
* @param triggerDockerSourceDiscover.sourceID - The source UUID.
|
|
1732
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1733
|
+
*/
|
|
1734
|
+
triggerDockerSourceDiscover({ sourceID }, requestOptions) {
|
|
1735
|
+
if (!sourceID) {
|
|
1736
|
+
throw new Error('Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.');
|
|
1737
|
+
}
|
|
1738
|
+
const requestPath = '/1/sources/{sourceID}/discover'.replace('{sourceID}', encodeURIComponent(sourceID));
|
|
1739
|
+
const headers = {};
|
|
1740
|
+
const queryParameters = {};
|
|
1741
|
+
const request = {
|
|
1742
|
+
method: 'POST',
|
|
1743
|
+
path: requestPath,
|
|
1744
|
+
queryParameters,
|
|
1745
|
+
headers,
|
|
1746
|
+
};
|
|
1747
|
+
return transporter.request(request, requestOptions);
|
|
1748
|
+
},
|
|
1749
|
+
/**
|
|
1750
|
+
* Update the authentication of the given authenticationID.
|
|
1751
|
+
*
|
|
1752
|
+
* @summary Update a authentication.
|
|
1753
|
+
* @param updateAuthentication - The updateAuthentication object.
|
|
1754
|
+
* @param updateAuthentication.authenticationID - The authentication UUID.
|
|
1755
|
+
* @param updateAuthentication.authenticationUpdate - The authenticationUpdate object.
|
|
1756
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1757
|
+
*/
|
|
1758
|
+
updateAuthentication({ authenticationID, authenticationUpdate }, requestOptions) {
|
|
1759
|
+
if (!authenticationID) {
|
|
1760
|
+
throw new Error('Parameter `authenticationID` is required when calling `updateAuthentication`.');
|
|
1761
|
+
}
|
|
1762
|
+
if (!authenticationUpdate) {
|
|
1763
|
+
throw new Error('Parameter `authenticationUpdate` is required when calling `updateAuthentication`.');
|
|
1764
|
+
}
|
|
1765
|
+
const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
|
|
1766
|
+
const headers = {};
|
|
1767
|
+
const queryParameters = {};
|
|
1768
|
+
const request = {
|
|
1769
|
+
method: 'PATCH',
|
|
1770
|
+
path: requestPath,
|
|
1771
|
+
queryParameters,
|
|
1772
|
+
headers,
|
|
1773
|
+
data: authenticationUpdate,
|
|
1774
|
+
};
|
|
1775
|
+
return transporter.request(request, requestOptions);
|
|
1776
|
+
},
|
|
1777
|
+
/**
|
|
1778
|
+
* Update the destination of the given destinationID.
|
|
1779
|
+
*
|
|
1780
|
+
* @summary Update a destination.
|
|
1781
|
+
* @param updateDestination - The updateDestination object.
|
|
1782
|
+
* @param updateDestination.destinationID - The destination UUID.
|
|
1783
|
+
* @param updateDestination.destinationUpdate - The destinationUpdate object.
|
|
1784
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1785
|
+
*/
|
|
1786
|
+
updateDestination({ destinationID, destinationUpdate }, requestOptions) {
|
|
1787
|
+
if (!destinationID) {
|
|
1788
|
+
throw new Error('Parameter `destinationID` is required when calling `updateDestination`.');
|
|
1789
|
+
}
|
|
1790
|
+
if (!destinationUpdate) {
|
|
1791
|
+
throw new Error('Parameter `destinationUpdate` is required when calling `updateDestination`.');
|
|
1792
|
+
}
|
|
1793
|
+
const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
|
|
1794
|
+
const headers = {};
|
|
1795
|
+
const queryParameters = {};
|
|
1796
|
+
const request = {
|
|
1797
|
+
method: 'PATCH',
|
|
1798
|
+
path: requestPath,
|
|
1799
|
+
queryParameters,
|
|
1800
|
+
headers,
|
|
1801
|
+
data: destinationUpdate,
|
|
1802
|
+
};
|
|
1803
|
+
return transporter.request(request, requestOptions);
|
|
1804
|
+
},
|
|
1805
|
+
/**
|
|
1806
|
+
* Update the source of the given sourceID.
|
|
1807
|
+
*
|
|
1808
|
+
* @summary Update a source.
|
|
1809
|
+
* @param updateSource - The updateSource object.
|
|
1810
|
+
* @param updateSource.sourceID - The source UUID.
|
|
1811
|
+
* @param updateSource.sourceUpdate - The sourceUpdate object.
|
|
1812
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1813
|
+
*/
|
|
1814
|
+
updateSource({ sourceID, sourceUpdate }, requestOptions) {
|
|
1815
|
+
if (!sourceID) {
|
|
1816
|
+
throw new Error('Parameter `sourceID` is required when calling `updateSource`.');
|
|
1817
|
+
}
|
|
1818
|
+
if (!sourceUpdate) {
|
|
1819
|
+
throw new Error('Parameter `sourceUpdate` is required when calling `updateSource`.');
|
|
1820
|
+
}
|
|
1821
|
+
const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
|
|
1822
|
+
const headers = {};
|
|
1823
|
+
const queryParameters = {};
|
|
1824
|
+
const request = {
|
|
1825
|
+
method: 'PATCH',
|
|
1826
|
+
path: requestPath,
|
|
1827
|
+
queryParameters,
|
|
1828
|
+
headers,
|
|
1829
|
+
data: sourceUpdate,
|
|
1830
|
+
};
|
|
1831
|
+
return transporter.request(request, requestOptions);
|
|
1832
|
+
},
|
|
1833
|
+
/**
|
|
1834
|
+
* Update the task of the given taskID.
|
|
1835
|
+
*
|
|
1836
|
+
* @summary Update a task.
|
|
1837
|
+
* @param updateTask - The updateTask object.
|
|
1838
|
+
* @param updateTask.taskID - The task UUID.
|
|
1839
|
+
* @param updateTask.taskUpdate - The taskUpdate object.
|
|
1840
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1841
|
+
*/
|
|
1842
|
+
updateTask({ taskID, taskUpdate }, requestOptions) {
|
|
1843
|
+
if (!taskID) {
|
|
1844
|
+
throw new Error('Parameter `taskID` is required when calling `updateTask`.');
|
|
1845
|
+
}
|
|
1846
|
+
if (!taskUpdate) {
|
|
1847
|
+
throw new Error('Parameter `taskUpdate` is required when calling `updateTask`.');
|
|
1848
|
+
}
|
|
1849
|
+
const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1850
|
+
const headers = {};
|
|
1851
|
+
const queryParameters = {};
|
|
1852
|
+
const request = {
|
|
1853
|
+
method: 'PATCH',
|
|
1854
|
+
path: requestPath,
|
|
1855
|
+
queryParameters,
|
|
1856
|
+
headers,
|
|
1857
|
+
data: taskUpdate,
|
|
1858
|
+
};
|
|
1859
|
+
return transporter.request(request, requestOptions);
|
|
1860
|
+
},
|
|
1861
|
+
};
|
|
1443
1862
|
}
|
|
1444
1863
|
|
|
1445
|
-
//
|
|
1446
|
-
function ingestionClient(appId, apiKey, region, options) {
|
|
1447
|
-
if (!appId || typeof appId !== 'string') {
|
|
1448
|
-
throw new Error('`appId` is missing.');
|
|
1449
|
-
}
|
|
1450
|
-
if (!apiKey || typeof apiKey !== 'string') {
|
|
1451
|
-
throw new Error('`apiKey` is missing.');
|
|
1452
|
-
}
|
|
1453
|
-
if (!region ||
|
|
1454
|
-
(region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
|
|
1455
|
-
throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
|
|
1456
|
-
}
|
|
1457
|
-
return createIngestionClient({
|
|
1458
|
-
appId,
|
|
1459
|
-
apiKey,
|
|
1460
|
-
region,
|
|
1461
|
-
timeouts: {
|
|
1462
|
-
connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,
|
|
1463
|
-
read: DEFAULT_READ_TIMEOUT_BROWSER,
|
|
1464
|
-
write: DEFAULT_WRITE_TIMEOUT_BROWSER,
|
|
1465
|
-
},
|
|
1466
|
-
requester: createXhrRequester(),
|
|
1467
|
-
algoliaAgents: [{ segment: 'Browser' }],
|
|
1468
|
-
authMode: 'WithinQueryParameters',
|
|
1469
|
-
responsesCache: createMemoryCache(),
|
|
1470
|
-
requestsCache: createMemoryCache({ serializable: false }),
|
|
1471
|
-
hostsCache: createFallbackableCache({
|
|
1472
|
-
caches: [
|
|
1473
|
-
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
|
|
1474
|
-
createMemoryCache(),
|
|
1475
|
-
],
|
|
1476
|
-
}),
|
|
1477
|
-
...options,
|
|
1478
|
-
});
|
|
1864
|
+
// 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.
|
|
1865
|
+
function ingestionClient(appId, apiKey, region, options) {
|
|
1866
|
+
if (!appId || typeof appId !== 'string') {
|
|
1867
|
+
throw new Error('`appId` is missing.');
|
|
1868
|
+
}
|
|
1869
|
+
if (!apiKey || typeof apiKey !== 'string') {
|
|
1870
|
+
throw new Error('`apiKey` is missing.');
|
|
1871
|
+
}
|
|
1872
|
+
if (!region ||
|
|
1873
|
+
(region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
|
|
1874
|
+
throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
|
|
1875
|
+
}
|
|
1876
|
+
return createIngestionClient({
|
|
1877
|
+
appId,
|
|
1878
|
+
apiKey,
|
|
1879
|
+
region,
|
|
1880
|
+
timeouts: {
|
|
1881
|
+
connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,
|
|
1882
|
+
read: DEFAULT_READ_TIMEOUT_BROWSER,
|
|
1883
|
+
write: DEFAULT_WRITE_TIMEOUT_BROWSER,
|
|
1884
|
+
},
|
|
1885
|
+
requester: createXhrRequester(),
|
|
1886
|
+
algoliaAgents: [{ segment: 'Browser' }],
|
|
1887
|
+
authMode: 'WithinQueryParameters',
|
|
1888
|
+
responsesCache: createMemoryCache(),
|
|
1889
|
+
requestsCache: createMemoryCache({ serializable: false }),
|
|
1890
|
+
hostsCache: createFallbackableCache({
|
|
1891
|
+
caches: [
|
|
1892
|
+
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
|
|
1893
|
+
createMemoryCache(),
|
|
1894
|
+
],
|
|
1895
|
+
}),
|
|
1896
|
+
...options,
|
|
1897
|
+
});
|
|
1479
1898
|
}
|
|
1480
1899
|
|
|
1481
|
-
export { apiClientVersion, ingestionClient };
|
|
1900
|
+
export { apiClientVersion, ingestionClient, isOnDemandTrigger, isScheduleTrigger, isSubscriptionTrigger };
|