@algolia/ingestion 1.0.0-beta.6 → 1.0.0-beta.7
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/ingestion.cjs
CHANGED
|
@@ -4,7 +4,7 @@ var clientCommon = require('@algolia/client-common');
|
|
|
4
4
|
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
5
5
|
|
|
6
6
|
// 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.
|
|
7
|
-
const apiClientVersion = '1.0.0-beta.
|
|
7
|
+
const apiClientVersion = '1.0.0-beta.7';
|
|
8
8
|
const REGIONS = ['eu', 'us'];
|
|
9
9
|
function getDefaultHosts(region) {
|
|
10
10
|
const url = 'data.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -1281,7 +1281,7 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1281
1281
|
return transporter.request(request, requestOptions);
|
|
1282
1282
|
},
|
|
1283
1283
|
/**
|
|
1284
|
-
*
|
|
1284
|
+
* Try a transformation.
|
|
1285
1285
|
*
|
|
1286
1286
|
* Required API Key ACLs:
|
|
1287
1287
|
* - addObject
|
|
@@ -676,7 +676,7 @@ function createXhrRequester() {
|
|
|
676
676
|
}
|
|
677
677
|
|
|
678
678
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
679
|
-
const apiClientVersion = '1.0.0-beta.
|
|
679
|
+
const apiClientVersion = '1.0.0-beta.7';
|
|
680
680
|
const REGIONS = ['eu', 'us'];
|
|
681
681
|
function getDefaultHosts(region) {
|
|
682
682
|
const url = 'data.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -1953,7 +1953,7 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1953
1953
|
return transporter.request(request, requestOptions);
|
|
1954
1954
|
},
|
|
1955
1955
|
/**
|
|
1956
|
-
*
|
|
1956
|
+
* Try a transformation.
|
|
1957
1957
|
*
|
|
1958
1958
|
* Required API Key ACLs:
|
|
1959
1959
|
* - addObject
|
|
@@ -2,7 +2,7 @@ import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT
|
|
|
2
2
|
import { createHttpRequester } from '@algolia/requester-node-http';
|
|
3
3
|
|
|
4
4
|
// 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.
|
|
5
|
-
const apiClientVersion = '1.0.0-beta.
|
|
5
|
+
const apiClientVersion = '1.0.0-beta.7';
|
|
6
6
|
const REGIONS = ['eu', 'us'];
|
|
7
7
|
function getDefaultHosts(region) {
|
|
8
8
|
const url = 'data.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -1279,7 +1279,7 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1279
1279
|
return transporter.request(request, requestOptions);
|
|
1280
1280
|
},
|
|
1281
1281
|
/**
|
|
1282
|
-
*
|
|
1282
|
+
* Try a transformation.
|
|
1283
1283
|
*
|
|
1284
1284
|
* Required API Key ACLs:
|
|
1285
1285
|
* - addObject
|
package/dist/ingestion.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! ingestion.umd.js | 1.0.0-beta.
|
|
2
|
-
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/ingestion"]={})}(this,(function(e){"use strict";function r(e){let r;const t=`algolia-client-js-${e.key}`;function a(){return void 0===r&&(r=e.localStorage||window.localStorage),r}function n(){return JSON.parse(a().getItem(t)||"{}")}function o(e){a().setItem(t,JSON.stringify(e))}return{get:(r,t,a={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>(function(){const r=e.timeToLive?1e3*e.timeToLive:null,t=n(),a=Object.fromEntries(Object.entries(t).filter((([,e])=>void 0!==e.timestamp)));if(o(a),!r)return;o(Object.fromEntries(Object.entries(a).filter((([,e])=>{const t=(new Date).getTime();return!(e.timestamp+r<t)}))))}(),n()[JSON.stringify(r)]))).then((e=>Promise.all([e?e.value:t(),void 0!==e]))).then((([e,r])=>Promise.all([e,r||a.miss(e)]))).then((([e])=>e)),set:(e,r)=>Promise.resolve().then((()=>{const o=n();return o[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:r},a().setItem(t,JSON.stringify(o)),r})),delete:e=>Promise.resolve().then((()=>{const r=n();delete r[JSON.stringify(e)],a().setItem(t,JSON.stringify(r))})),clear:()=>Promise.resolve().then((()=>{a().removeItem(t)}))}}function t(e){const r=[...e.caches],a=r.shift();return void 0===a?{get:(e,r,t={miss:()=>Promise.resolve()})=>r().then((e=>Promise.all([e,t.miss(e)]))).then((([e])=>e)),set:(e,r)=>Promise.resolve(r),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,n,o={miss:()=>Promise.resolve()})=>a.get(e,n,o).catch((()=>t({caches:r}).get(e,n,o))),set:(e,n)=>a.set(e,n).catch((()=>t({caches:r}).set(e,n))),delete:e=>a.delete(e).catch((()=>t({caches:r}).delete(e))),clear:()=>a.clear().catch((()=>t({caches:r}).clear()))}}function a(e={serializable:!0}){let r={};return{get(t,a,n={miss:()=>Promise.resolve()}){const o=JSON.stringify(t);if(o in r)return Promise.resolve(e.serializable?JSON.parse(r[o]):r[o]);const s=a();return s.then((e=>n.miss(e))).then((()=>s))},set:(t,a)=>(r[JSON.stringify(t)]=e.serializable?JSON.stringify(a):a,Promise.resolve(a)),delete:e=>(delete r[JSON.stringify(e)],Promise.resolve()),clear:()=>(r={},Promise.resolve())}}const n=12e4;function o(e,r="up"){const t=Date.now();return{...e,status:r,lastUpdate:t,isUp:function(){return"up"===r||Date.now()-t>n},isTimedOut:function(){return"timed out"===r&&Date.now()-t<=n}}}function s(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,r||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}class i extends Error{constructor(e,r){super(e),s(this,"name","AlgoliaError"),r&&(this.name=r)}}class u extends i{constructor(e,r,t){super(e,t),s(this,"stackTrace",void 0),this.stackTrace=r}}class c extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",e,"RetryError")}}class d extends u{constructor(e,r,t,a="ApiError"){super(e,t,a),s(this,"status",void 0),this.status=r}}class h extends i{constructor(e,r){super(e,"DeserializationError"),s(this,"response",void 0),this.response=r}}class m extends d{constructor(e,r,t,a){super(e,r,a,"DetailedApiError"),s(this,"error",void 0),this.error=t}}function l(e,r,t){const a=(n=t,Object.keys(n).filter((e=>void 0!==n[e])).sort().map((e=>`${e}=${encodeURIComponent("[object Array]"===Object.prototype.toString.call(n[e])?n[e].join(","):n[e]).replaceAll("+","%20")}`)).join("&"));var n;let o=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===r.charAt(0)?r.substring(1):r}`;return a.length&&(o+=`?${a}`),o}function p(e){const r=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...r}}}}function g({hosts:e,hostsCache:r,baseHeaders:t,baseQueryParameters:a,algoliaAgent:n,timeouts:s,requester:i,requestsCache:u,responsesCache:g}){async function w(u,g,w=!0){const f=[],P=function(e,r){if("GET"===e.method||void 0===e.data&&void 0===r.data)return;const t=Array.isArray(e.data)?e.data:{...e.data,...r.data};return JSON.stringify(t)}(u,g),q=function(e,r,t){const a={Accept:"application/json",...e,...r,...t},n={};return Object.keys(a).forEach((e=>{const r=a[e];n[e.toLowerCase()]=r})),n}(t,u.headers,g.headers),D="GET"===u.method?{...u.data,...g.data}:{},I={...a,...u.queryParameters,...D};if(n.value&&(I["x-algolia-agent"]=n.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?I[e]=g.queryParameters[e].toString():I[e]=g.queryParameters[e];let y=0;const T=async(e,t)=>{const a=e.pop();if(void 0===a)throw new c(function(e){return e.map((e=>p(e)))}(f));let n=w?g.timeouts?.read||s.read:g.timeouts?.write||s.write;const D={data:P,headers:q,method:u.method,url:l(a,u.path,I),connectTimeout:t(y,g.timeouts?.connect||s.connect),responseTimeout:t(y,n)},v=r=>{const t={request:D,response:r,host:a,triesLeft:e.length};return f.push(t),t},E=await i.send(D);if(function({isTimedOut:e,status:r}){return e||function({isTimedOut:e,status:r}){return!e&&!~~r}({isTimedOut:e,status:r})||2!=~~(r/100)&&4!=~~(r/100)}(E)){const n=v(E);return E.isTimedOut&&y++,console.log("Retryable failure",p(n)),await r.set(a,o(a,E.isTimedOut?"timed out":"down")),T(e,t)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(r){throw new h(r.message,e)}}(E);throw v(E),function({content:e,status:r},t){try{const a=JSON.parse(e);return"error"in a?new m(a.message,r,a.error,t):new d(a.message,r,t)}catch(e){}return new d(e,r,t)}(E,f)},v=e.filter((e=>"readWrite"===e.accept||(w?"read"===e.accept:"write"===e.accept))),E=await async function(e){const t=await Promise.all(e.map((e=>r.get(e,(()=>Promise.resolve(o(e))))))),a=t.filter((e=>e.isUp())),n=t.filter((e=>e.isTimedOut())),s=[...a,...n];return{hosts:s.length>0?s:e,getTimeout:(e,r)=>(0===n.length&&0===e?1:n.length+3+e)*r}}(v);return T([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:r,requester:i,timeouts:s,algoliaAgent:n,baseHeaders:t,baseQueryParameters:a,hosts:e,request:function(e,r={}){const n=e.useReadTransporter||"GET"===e.method;if(!n)return w(e,r,n);const o=()=>w(e,r);if(!0!==(r.cacheable||e.cacheable))return o();const s={request:e,requestOptions:r,transporter:{queryParameters:a,headers:t}};return g.get(s,(()=>u.get(s,(()=>u.set(s,o()).then((e=>Promise.all([u.delete(s),e])),(e=>Promise.all([u.delete(s),Promise.reject(e)]))).then((([e,r])=>r))))),{miss:e=>g.set(s,e)})},requestsCache:u,responsesCache:g}}function w({algoliaAgents:e,client:r,version:t}){const a=function(e){const r={value:`Algolia for JavaScript (${e})`,add(e){const t=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===r.value.indexOf(t)&&(r.value=`${r.value}${t}`),r}};return r}(t).add({segment:r,version:t});return e.forEach((e=>a.add(e))),a}const f="1.0.0-beta.6",P=["eu","us"];e.apiClientVersion=f,e.ingestionClient=function(e,n,o,s){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!n||"string"!=typeof n)throw new Error("`apiKey` is missing.");if(!o||o&&("string"!=typeof o||!P.includes(o)))throw new Error(`\`region\` is required and must be one of the following: ${P.join(", ")}`);return function({appId:e,apiKey:r,authMode:t,algoliaAgents:a,region:n,...o}){const s=function(e,r,t="WithinHeaders"){const a={"x-algolia-api-key":r,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===t?a:{},queryParameters:()=>"WithinQueryParameters"===t?a:{}}}(e,r,t),i=g({hosts:(u=n,[{url:"data.{region}.algolia.com".replace("{region}",u),accept:"readWrite",protocol:"https"}]),...o,algoliaAgent:w({algoliaAgents:a,client:"Ingestion",version:f}),baseHeaders:{"content-type":"text/plain",...s.headers(),...o.baseHeaders},baseQueryParameters:{...s.queryParameters(),...o.baseQueryParameters}});var u;return{transporter:i,appId:e,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((()=>{})),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,r){i.algoliaAgent.add({segment:e,version:r})},createAuthentication(e,r){if(!e)throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");if(!e.type)throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");if(!e.name)throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");if(!e.input)throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");const t={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return i.request(t,r)},createDestination(e,r){if(!e)throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");if(!e.type)throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");if(!e.name)throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");if(!e.input)throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");const t={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return i.request(t,r)},createSource(e,r){if(!e)throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");if(!e.type)throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");if(!e.name)throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");if(!e.input)throw new Error("Parameter `sourceCreate.input` is required when calling `createSource`.");const t={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return i.request(t,r)},createTask(e,r){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTask`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");if(!e.trigger)throw new Error("Parameter `taskCreate.trigger` is required when calling `createTask`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");const t={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return i.request(t,r)},createTransformation(e,r){if(!e)throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");if(!e.code)throw new Error("Parameter `transformationCreate.code` is required when calling `createTransformation`.");if(!e.name)throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");if(!e.description)throw new Error("Parameter `transformationCreate.description` is required when calling `createTransformation`.");const t={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e};return i.request(t,r)},customDelete({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(a,t)},customGet({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(a,t)},customPost({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const n={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return i.request(n,a)},customPut({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const n={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return i.request(n,a)},deleteAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");const t={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");const t={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");const t={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTask`.");const t={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");const t={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},disableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTask`.");const t={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},enableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTask`.");const t={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");const t={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getAuthentications({itemsPerPage:e,page:r,type:t,platform:a,sort:n,order:o}={},s=void 0){const u={};void 0!==e&&(u.itemsPerPage=e.toString()),void 0!==r&&(u.page=r.toString()),void 0!==t&&(u.type=t.toString()),void 0!==a&&(u.platform=a.toString()),void 0!==n&&(u.sort=n.toString()),void 0!==o&&(u.order=o.toString());const c={method:"GET",path:"/1/authentications",queryParameters:u,headers:{}};return i.request(c,s)},getDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `getDestination`.");const t={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getDestinations({itemsPerPage:e,page:r,type:t,authenticationID:a,sort:n,order:o}={},s=void 0){const u={};void 0!==e&&(u.itemsPerPage=e.toString()),void 0!==r&&(u.page=r.toString()),void 0!==t&&(u.type=t.toString()),void 0!==a&&(u.authenticationID=a.toString()),void 0!==n&&(u.sort=n.toString()),void 0!==o&&(u.order=o.toString());const c={method:"GET",path:"/1/destinations",queryParameters:u,headers:{}};return i.request(c,s)},getEvent({runID:e,eventID:r},t){if(!e)throw new Error("Parameter `runID` is required when calling `getEvent`.");if(!r)throw new Error("Parameter `eventID` is required when calling `getEvent`.");const a={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(a,t)},getEvents({runID:e,itemsPerPage:r,page:t,status:a,type:n,sort:o,order:s,startDate:u,endDate:c},d){if(!e)throw new Error("Parameter `runID` is required when calling `getEvents`.");const h="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),m={};void 0!==r&&(m.itemsPerPage=r.toString()),void 0!==t&&(m.page=t.toString()),void 0!==a&&(m.status=a.toString()),void 0!==n&&(m.type=n.toString()),void 0!==o&&(m.sort=o.toString()),void 0!==s&&(m.order=s.toString()),void 0!==u&&(m.startDate=u.toString()),void 0!==c&&(m.endDate=c.toString());const l={method:"GET",path:h,queryParameters:m,headers:{}};return i.request(l,d)},getRun({runID:e},r){if(!e)throw new Error("Parameter `runID` is required when calling `getRun`.");const t={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getRuns({itemsPerPage:e,page:r,status:t,taskID:a,sort:n,order:o,startDate:s,endDate:u}={},c=void 0){const d={};void 0!==e&&(d.itemsPerPage=e.toString()),void 0!==r&&(d.page=r.toString()),void 0!==t&&(d.status=t.toString()),void 0!==a&&(d.taskID=a.toString()),void 0!==n&&(d.sort=n.toString()),void 0!==o&&(d.order=o.toString()),void 0!==s&&(d.startDate=s.toString()),void 0!==u&&(d.endDate=u.toString());const h={method:"GET",path:"/1/runs",queryParameters:d,headers:{}};return i.request(h,c)},getSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `getSource`.");const t={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getSources({itemsPerPage:e,page:r,type:t,authenticationID:a,sort:n,order:o}={},s=void 0){const u={};void 0!==e&&(u.itemsPerPage=e.toString()),void 0!==r&&(u.page=r.toString()),void 0!==t&&(u.type=t.toString()),void 0!==a&&(u.authenticationID=a.toString()),void 0!==n&&(u.sort=n.toString()),void 0!==o&&(u.order=o.toString());const c={method:"GET",path:"/1/sources",queryParameters:u,headers:{}};return i.request(c,s)},getTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTask`.");const t={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getTasks({itemsPerPage:e,page:r,action:t,enabled:a,sourceID:n,destinationID:o,triggerType:s,sort:u,order:c}={},d=void 0){const h={};void 0!==e&&(h.itemsPerPage=e.toString()),void 0!==r&&(h.page=r.toString()),void 0!==t&&(h.action=t.toString()),void 0!==a&&(h.enabled=a.toString()),void 0!==n&&(h.sourceID=n.toString()),void 0!==o&&(h.destinationID=o.toString()),void 0!==s&&(h.triggerType=s.toString()),void 0!==u&&(h.sort=u.toString()),void 0!==c&&(h.order=c.toString());const m={method:"GET",path:"/1/tasks",queryParameters:h,headers:{}};return i.request(m,d)},getTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");const t={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getTransformations({sort:e,order:r}={},t=void 0){const a={};void 0!==e&&(a.sort=e.toString()),void 0!==r&&(a.order=r.toString());const n={method:"GET",path:"/1/transformations",queryParameters:a,headers:{}};return i.request(n,t)},runTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `runTask`.");const t={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},searchAuthentications(e,r){if(!e)throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");if(!e.authenticationIDs)throw new Error("Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.");const t={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchDestinations(e,r){if(!e)throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");if(!e.destinationIDs)throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");const t={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchSources(e,r){if(!e)throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");if(!e.sourceIDs)throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");const t={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchTasks(e,r){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");const t={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchTransformations(e,r){if(!e)throw new Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");if(!e.transformationsIDs)throw new Error("Parameter `transformationSearch.transformationsIDs` is required when calling `searchTransformations`.");const t={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},triggerDockerSourceDiscover({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");const t={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},tryTransformations(e,r){if(!e)throw new Error("Parameter `transformationTry` is required when calling `tryTransformations`.");if(!e.code)throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformations`.");if(!e.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformations`.");const t={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e};return i.request(t,r)},updateAuthentication({authenticationID:e,authenticationUpdate:r},t){if(!e)throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");if(!r)throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");const a={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},updateDestination({destinationID:e,destinationUpdate:r},t){if(!e)throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");if(!r)throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");const a={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},updateSource({sourceID:e,sourceUpdate:r},t){if(!e)throw new Error("Parameter `sourceID` is required when calling `updateSource`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");const a={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},updateTask({taskID:e,taskUpdate:r},t){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTask`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");const a={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},updateTransformation({transformationID:e,transformationCreate:r},t){if(!e)throw new Error("Parameter `transformationID` is required when calling `updateTransformation`.");if(!r)throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");if(!r.code)throw new Error("Parameter `transformationCreate.code` is required when calling `updateTransformation`.");if(!r.name)throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");if(!r.description)throw new Error("Parameter `transformationCreate.description` is required when calling `updateTransformation`.");const a={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},validateSource(e,r=void 0){const t={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return i.request(t,r)},validateSourceBeforeUpdate({sourceID:e,sourceUpdate:r},t){if(!e)throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");const a={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)}}}({appId:e,apiKey:n,region:o,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((r=>{const t=new XMLHttpRequest;t.open(e.method,e.url,!0),Object.keys(e.headers).forEach((r=>t.setRequestHeader(r,e.headers[r])));const a=(e,a)=>setTimeout((()=>{t.abort(),r({status:0,content:a,isTimedOut:!0})}),e),n=a(e.connectTimeout,"Connection timeout");let o;t.onreadystatechange=()=>{t.readyState>t.OPENED&&void 0===o&&(clearTimeout(n),o=a(e.responseTimeout,"Socket timeout"))},t.onerror=()=>{0===t.status&&(clearTimeout(n),clearTimeout(o),r({content:t.responseText||"Network request failed",status:t.status,isTimedOut:!1}))},t.onload=()=>{clearTimeout(n),clearTimeout(o),r({content:t.responseText,status:t.status,isTimedOut:!1})},t.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:a(),requestsCache:a({serializable:!1}),hostsCache:t({caches:[r({key:`${f}-${e}`}),a()]}),...s})},e.isOnDemandTrigger=function(e){return"onDemand"===e.type},e.isScheduleTrigger=function(e){return"schedule"===e.type},e.isSubscriptionTrigger=function(e){return"subscription"===e.type}}));
|
|
1
|
+
/*! ingestion.umd.js | 1.0.0-beta.7 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
|
|
2
|
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/ingestion"]={})}(this,(function(e){"use strict";function r(e){let r;const t=`algolia-client-js-${e.key}`;function a(){return void 0===r&&(r=e.localStorage||window.localStorage),r}function n(){return JSON.parse(a().getItem(t)||"{}")}function o(e){a().setItem(t,JSON.stringify(e))}return{get:(r,t,a={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>(function(){const r=e.timeToLive?1e3*e.timeToLive:null,t=n(),a=Object.fromEntries(Object.entries(t).filter((([,e])=>void 0!==e.timestamp)));if(o(a),!r)return;o(Object.fromEntries(Object.entries(a).filter((([,e])=>{const t=(new Date).getTime();return!(e.timestamp+r<t)}))))}(),n()[JSON.stringify(r)]))).then((e=>Promise.all([e?e.value:t(),void 0!==e]))).then((([e,r])=>Promise.all([e,r||a.miss(e)]))).then((([e])=>e)),set:(e,r)=>Promise.resolve().then((()=>{const o=n();return o[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:r},a().setItem(t,JSON.stringify(o)),r})),delete:e=>Promise.resolve().then((()=>{const r=n();delete r[JSON.stringify(e)],a().setItem(t,JSON.stringify(r))})),clear:()=>Promise.resolve().then((()=>{a().removeItem(t)}))}}function t(e){const r=[...e.caches],a=r.shift();return void 0===a?{get:(e,r,t={miss:()=>Promise.resolve()})=>r().then((e=>Promise.all([e,t.miss(e)]))).then((([e])=>e)),set:(e,r)=>Promise.resolve(r),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,n,o={miss:()=>Promise.resolve()})=>a.get(e,n,o).catch((()=>t({caches:r}).get(e,n,o))),set:(e,n)=>a.set(e,n).catch((()=>t({caches:r}).set(e,n))),delete:e=>a.delete(e).catch((()=>t({caches:r}).delete(e))),clear:()=>a.clear().catch((()=>t({caches:r}).clear()))}}function a(e={serializable:!0}){let r={};return{get(t,a,n={miss:()=>Promise.resolve()}){const o=JSON.stringify(t);if(o in r)return Promise.resolve(e.serializable?JSON.parse(r[o]):r[o]);const s=a();return s.then((e=>n.miss(e))).then((()=>s))},set:(t,a)=>(r[JSON.stringify(t)]=e.serializable?JSON.stringify(a):a,Promise.resolve(a)),delete:e=>(delete r[JSON.stringify(e)],Promise.resolve()),clear:()=>(r={},Promise.resolve())}}const n=12e4;function o(e,r="up"){const t=Date.now();return{...e,status:r,lastUpdate:t,isUp:function(){return"up"===r||Date.now()-t>n},isTimedOut:function(){return"timed out"===r&&Date.now()-t<=n}}}function s(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,r||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}class i extends Error{constructor(e,r){super(e),s(this,"name","AlgoliaError"),r&&(this.name=r)}}class u extends i{constructor(e,r,t){super(e,t),s(this,"stackTrace",void 0),this.stackTrace=r}}class c extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",e,"RetryError")}}class d extends u{constructor(e,r,t,a="ApiError"){super(e,t,a),s(this,"status",void 0),this.status=r}}class h extends i{constructor(e,r){super(e,"DeserializationError"),s(this,"response",void 0),this.response=r}}class m extends d{constructor(e,r,t,a){super(e,r,a,"DetailedApiError"),s(this,"error",void 0),this.error=t}}function l(e,r,t){const a=(n=t,Object.keys(n).filter((e=>void 0!==n[e])).sort().map((e=>`${e}=${encodeURIComponent("[object Array]"===Object.prototype.toString.call(n[e])?n[e].join(","):n[e]).replaceAll("+","%20")}`)).join("&"));var n;let o=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===r.charAt(0)?r.substring(1):r}`;return a.length&&(o+=`?${a}`),o}function p(e){const r=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...r}}}}function g({hosts:e,hostsCache:r,baseHeaders:t,baseQueryParameters:a,algoliaAgent:n,timeouts:s,requester:i,requestsCache:u,responsesCache:g}){async function w(u,g,w=!0){const f=[],P=function(e,r){if("GET"===e.method||void 0===e.data&&void 0===r.data)return;const t=Array.isArray(e.data)?e.data:{...e.data,...r.data};return JSON.stringify(t)}(u,g),q=function(e,r,t){const a={Accept:"application/json",...e,...r,...t},n={};return Object.keys(a).forEach((e=>{const r=a[e];n[e.toLowerCase()]=r})),n}(t,u.headers,g.headers),D="GET"===u.method?{...u.data,...g.data}:{},I={...a,...u.queryParameters,...D};if(n.value&&(I["x-algolia-agent"]=n.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?I[e]=g.queryParameters[e].toString():I[e]=g.queryParameters[e];let y=0;const T=async(e,t)=>{const a=e.pop();if(void 0===a)throw new c(function(e){return e.map((e=>p(e)))}(f));let n=w?g.timeouts?.read||s.read:g.timeouts?.write||s.write;const D={data:P,headers:q,method:u.method,url:l(a,u.path,I),connectTimeout:t(y,g.timeouts?.connect||s.connect),responseTimeout:t(y,n)},v=r=>{const t={request:D,response:r,host:a,triesLeft:e.length};return f.push(t),t},E=await i.send(D);if(function({isTimedOut:e,status:r}){return e||function({isTimedOut:e,status:r}){return!e&&!~~r}({isTimedOut:e,status:r})||2!=~~(r/100)&&4!=~~(r/100)}(E)){const n=v(E);return E.isTimedOut&&y++,console.log("Retryable failure",p(n)),await r.set(a,o(a,E.isTimedOut?"timed out":"down")),T(e,t)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(r){throw new h(r.message,e)}}(E);throw v(E),function({content:e,status:r},t){try{const a=JSON.parse(e);return"error"in a?new m(a.message,r,a.error,t):new d(a.message,r,t)}catch(e){}return new d(e,r,t)}(E,f)},v=e.filter((e=>"readWrite"===e.accept||(w?"read"===e.accept:"write"===e.accept))),E=await async function(e){const t=await Promise.all(e.map((e=>r.get(e,(()=>Promise.resolve(o(e))))))),a=t.filter((e=>e.isUp())),n=t.filter((e=>e.isTimedOut())),s=[...a,...n];return{hosts:s.length>0?s:e,getTimeout:(e,r)=>(0===n.length&&0===e?1:n.length+3+e)*r}}(v);return T([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:r,requester:i,timeouts:s,algoliaAgent:n,baseHeaders:t,baseQueryParameters:a,hosts:e,request:function(e,r={}){const n=e.useReadTransporter||"GET"===e.method;if(!n)return w(e,r,n);const o=()=>w(e,r);if(!0!==(r.cacheable||e.cacheable))return o();const s={request:e,requestOptions:r,transporter:{queryParameters:a,headers:t}};return g.get(s,(()=>u.get(s,(()=>u.set(s,o()).then((e=>Promise.all([u.delete(s),e])),(e=>Promise.all([u.delete(s),Promise.reject(e)]))).then((([e,r])=>r))))),{miss:e=>g.set(s,e)})},requestsCache:u,responsesCache:g}}function w({algoliaAgents:e,client:r,version:t}){const a=function(e){const r={value:`Algolia for JavaScript (${e})`,add(e){const t=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===r.value.indexOf(t)&&(r.value=`${r.value}${t}`),r}};return r}(t).add({segment:r,version:t});return e.forEach((e=>a.add(e))),a}const f="1.0.0-beta.7",P=["eu","us"];e.apiClientVersion=f,e.ingestionClient=function(e,n,o,s){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!n||"string"!=typeof n)throw new Error("`apiKey` is missing.");if(!o||o&&("string"!=typeof o||!P.includes(o)))throw new Error(`\`region\` is required and must be one of the following: ${P.join(", ")}`);return function({appId:e,apiKey:r,authMode:t,algoliaAgents:a,region:n,...o}){const s=function(e,r,t="WithinHeaders"){const a={"x-algolia-api-key":r,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===t?a:{},queryParameters:()=>"WithinQueryParameters"===t?a:{}}}(e,r,t),i=g({hosts:(u=n,[{url:"data.{region}.algolia.com".replace("{region}",u),accept:"readWrite",protocol:"https"}]),...o,algoliaAgent:w({algoliaAgents:a,client:"Ingestion",version:f}),baseHeaders:{"content-type":"text/plain",...s.headers(),...o.baseHeaders},baseQueryParameters:{...s.queryParameters(),...o.baseQueryParameters}});var u;return{transporter:i,appId:e,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((()=>{})),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,r){i.algoliaAgent.add({segment:e,version:r})},createAuthentication(e,r){if(!e)throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");if(!e.type)throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");if(!e.name)throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");if(!e.input)throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");const t={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return i.request(t,r)},createDestination(e,r){if(!e)throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");if(!e.type)throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");if(!e.name)throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");if(!e.input)throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");const t={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return i.request(t,r)},createSource(e,r){if(!e)throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");if(!e.type)throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");if(!e.name)throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");if(!e.input)throw new Error("Parameter `sourceCreate.input` is required when calling `createSource`.");const t={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return i.request(t,r)},createTask(e,r){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTask`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");if(!e.trigger)throw new Error("Parameter `taskCreate.trigger` is required when calling `createTask`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");const t={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return i.request(t,r)},createTransformation(e,r){if(!e)throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");if(!e.code)throw new Error("Parameter `transformationCreate.code` is required when calling `createTransformation`.");if(!e.name)throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");if(!e.description)throw new Error("Parameter `transformationCreate.description` is required when calling `createTransformation`.");const t={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e};return i.request(t,r)},customDelete({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(a,t)},customGet({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(a,t)},customPost({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const n={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return i.request(n,a)},customPut({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const n={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return i.request(n,a)},deleteAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");const t={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");const t={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");const t={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTask`.");const t={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");const t={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},disableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTask`.");const t={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},enableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTask`.");const t={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");const t={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getAuthentications({itemsPerPage:e,page:r,type:t,platform:a,sort:n,order:o}={},s=void 0){const u={};void 0!==e&&(u.itemsPerPage=e.toString()),void 0!==r&&(u.page=r.toString()),void 0!==t&&(u.type=t.toString()),void 0!==a&&(u.platform=a.toString()),void 0!==n&&(u.sort=n.toString()),void 0!==o&&(u.order=o.toString());const c={method:"GET",path:"/1/authentications",queryParameters:u,headers:{}};return i.request(c,s)},getDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `getDestination`.");const t={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getDestinations({itemsPerPage:e,page:r,type:t,authenticationID:a,sort:n,order:o}={},s=void 0){const u={};void 0!==e&&(u.itemsPerPage=e.toString()),void 0!==r&&(u.page=r.toString()),void 0!==t&&(u.type=t.toString()),void 0!==a&&(u.authenticationID=a.toString()),void 0!==n&&(u.sort=n.toString()),void 0!==o&&(u.order=o.toString());const c={method:"GET",path:"/1/destinations",queryParameters:u,headers:{}};return i.request(c,s)},getEvent({runID:e,eventID:r},t){if(!e)throw new Error("Parameter `runID` is required when calling `getEvent`.");if(!r)throw new Error("Parameter `eventID` is required when calling `getEvent`.");const a={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(a,t)},getEvents({runID:e,itemsPerPage:r,page:t,status:a,type:n,sort:o,order:s,startDate:u,endDate:c},d){if(!e)throw new Error("Parameter `runID` is required when calling `getEvents`.");const h="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),m={};void 0!==r&&(m.itemsPerPage=r.toString()),void 0!==t&&(m.page=t.toString()),void 0!==a&&(m.status=a.toString()),void 0!==n&&(m.type=n.toString()),void 0!==o&&(m.sort=o.toString()),void 0!==s&&(m.order=s.toString()),void 0!==u&&(m.startDate=u.toString()),void 0!==c&&(m.endDate=c.toString());const l={method:"GET",path:h,queryParameters:m,headers:{}};return i.request(l,d)},getRun({runID:e},r){if(!e)throw new Error("Parameter `runID` is required when calling `getRun`.");const t={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getRuns({itemsPerPage:e,page:r,status:t,taskID:a,sort:n,order:o,startDate:s,endDate:u}={},c=void 0){const d={};void 0!==e&&(d.itemsPerPage=e.toString()),void 0!==r&&(d.page=r.toString()),void 0!==t&&(d.status=t.toString()),void 0!==a&&(d.taskID=a.toString()),void 0!==n&&(d.sort=n.toString()),void 0!==o&&(d.order=o.toString()),void 0!==s&&(d.startDate=s.toString()),void 0!==u&&(d.endDate=u.toString());const h={method:"GET",path:"/1/runs",queryParameters:d,headers:{}};return i.request(h,c)},getSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `getSource`.");const t={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getSources({itemsPerPage:e,page:r,type:t,authenticationID:a,sort:n,order:o}={},s=void 0){const u={};void 0!==e&&(u.itemsPerPage=e.toString()),void 0!==r&&(u.page=r.toString()),void 0!==t&&(u.type=t.toString()),void 0!==a&&(u.authenticationID=a.toString()),void 0!==n&&(u.sort=n.toString()),void 0!==o&&(u.order=o.toString());const c={method:"GET",path:"/1/sources",queryParameters:u,headers:{}};return i.request(c,s)},getTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTask`.");const t={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getTasks({itemsPerPage:e,page:r,action:t,enabled:a,sourceID:n,destinationID:o,triggerType:s,sort:u,order:c}={},d=void 0){const h={};void 0!==e&&(h.itemsPerPage=e.toString()),void 0!==r&&(h.page=r.toString()),void 0!==t&&(h.action=t.toString()),void 0!==a&&(h.enabled=a.toString()),void 0!==n&&(h.sourceID=n.toString()),void 0!==o&&(h.destinationID=o.toString()),void 0!==s&&(h.triggerType=s.toString()),void 0!==u&&(h.sort=u.toString()),void 0!==c&&(h.order=c.toString());const m={method:"GET",path:"/1/tasks",queryParameters:h,headers:{}};return i.request(m,d)},getTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");const t={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getTransformations({sort:e,order:r}={},t=void 0){const a={};void 0!==e&&(a.sort=e.toString()),void 0!==r&&(a.order=r.toString());const n={method:"GET",path:"/1/transformations",queryParameters:a,headers:{}};return i.request(n,t)},runTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `runTask`.");const t={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},searchAuthentications(e,r){if(!e)throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");if(!e.authenticationIDs)throw new Error("Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.");const t={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchDestinations(e,r){if(!e)throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");if(!e.destinationIDs)throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");const t={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchSources(e,r){if(!e)throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");if(!e.sourceIDs)throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");const t={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchTasks(e,r){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");const t={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchTransformations(e,r){if(!e)throw new Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");if(!e.transformationsIDs)throw new Error("Parameter `transformationSearch.transformationsIDs` is required when calling `searchTransformations`.");const t={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},triggerDockerSourceDiscover({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");const t={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},tryTransformations(e,r){if(!e)throw new Error("Parameter `transformationTry` is required when calling `tryTransformations`.");if(!e.code)throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformations`.");if(!e.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformations`.");const t={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e};return i.request(t,r)},updateAuthentication({authenticationID:e,authenticationUpdate:r},t){if(!e)throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");if(!r)throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");const a={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},updateDestination({destinationID:e,destinationUpdate:r},t){if(!e)throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");if(!r)throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");const a={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},updateSource({sourceID:e,sourceUpdate:r},t){if(!e)throw new Error("Parameter `sourceID` is required when calling `updateSource`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");const a={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},updateTask({taskID:e,taskUpdate:r},t){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTask`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");const a={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},updateTransformation({transformationID:e,transformationCreate:r},t){if(!e)throw new Error("Parameter `transformationID` is required when calling `updateTransformation`.");if(!r)throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");if(!r.code)throw new Error("Parameter `transformationCreate.code` is required when calling `updateTransformation`.");if(!r.name)throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");if(!r.description)throw new Error("Parameter `transformationCreate.description` is required when calling `updateTransformation`.");const a={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},validateSource(e,r=void 0){const t={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return i.request(t,r)},validateSourceBeforeUpdate({sourceID:e,sourceUpdate:r},t){if(!e)throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");const a={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)}}}({appId:e,apiKey:n,region:o,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((r=>{const t=new XMLHttpRequest;t.open(e.method,e.url,!0),Object.keys(e.headers).forEach((r=>t.setRequestHeader(r,e.headers[r])));const a=(e,a)=>setTimeout((()=>{t.abort(),r({status:0,content:a,isTimedOut:!0})}),e),n=a(e.connectTimeout,"Connection timeout");let o;t.onreadystatechange=()=>{t.readyState>t.OPENED&&void 0===o&&(clearTimeout(n),o=a(e.responseTimeout,"Socket timeout"))},t.onerror=()=>{0===t.status&&(clearTimeout(n),clearTimeout(o),r({content:t.responseText||"Network request failed",status:t.status,isTimedOut:!1}))},t.onload=()=>{clearTimeout(n),clearTimeout(o),r({content:t.responseText,status:t.status,isTimedOut:!1})},t.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:a(),requestsCache:a({serializable:!1}),hostsCache:t({caches:[r({key:`${f}-${e}`}),a()]}),...s})},e.isOnDemandTrigger=function(e){return"onDemand"===e.type},e.isScheduleTrigger=function(e){return"schedule"===e.type},e.isSubscriptionTrigger=function(e){return"subscription"===e.type}}));
|
|
@@ -44,7 +44,7 @@ import type { TransformationTry } from '../model/transformationTry';
|
|
|
44
44
|
import type { TransformationTryResponse } from '../model/transformationTryResponse';
|
|
45
45
|
import type { TransformationUpdateResponse } from '../model/transformationUpdateResponse';
|
|
46
46
|
import type { Trigger } from '../model/trigger';
|
|
47
|
-
export declare const apiClientVersion = "1.0.0-beta.
|
|
47
|
+
export declare const apiClientVersion = "1.0.0-beta.7";
|
|
48
48
|
export declare const REGIONS: readonly ["eu", "us"];
|
|
49
49
|
export type Region = (typeof REGIONS)[number];
|
|
50
50
|
/**
|
|
@@ -569,7 +569,7 @@ export declare function createIngestionClient({ appId: appIdOption, apiKey: apiK
|
|
|
569
569
|
*/
|
|
570
570
|
triggerDockerSourceDiscover({ sourceID }: TriggerDockerSourceDiscoverProps, requestOptions?: RequestOptions): Promise<SourceWatchResponse>;
|
|
571
571
|
/**
|
|
572
|
-
*
|
|
572
|
+
* Try a transformation.
|
|
573
573
|
*
|
|
574
574
|
* Required API Key ACLs:
|
|
575
575
|
* - addObject
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algolia/ingestion",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.7",
|
|
4
4
|
"description": "JavaScript client for ingestion",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"clean": "rm -rf ./dist || true"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@algolia/client-common": "5.0.0-beta.
|
|
46
|
-
"@algolia/requester-browser-xhr": "5.0.0-beta.
|
|
47
|
-
"@algolia/requester-node-http": "5.0.0-beta.
|
|
45
|
+
"@algolia/client-common": "5.0.0-beta.8",
|
|
46
|
+
"@algolia/requester-browser-xhr": "5.0.0-beta.8",
|
|
47
|
+
"@algolia/requester-node-http": "5.0.0-beta.8"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/node": "20.14.8",
|