@algolia/ingestion 1.5.3 → 1.6.1

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/README.md CHANGED
@@ -32,24 +32,31 @@
32
32
 
33
33
  ## 💡 Getting Started
34
34
 
35
- To get started, you first need to install @algolia/ingestion (or any other available API client package).
36
35
 
36
+ To get started, you first need to install @algolia/ingestion (or any other available API client package).
37
37
  All of our clients comes with type definition, and are available for both browser and node environments.
38
38
 
39
+ ### With a package manager
40
+
41
+
39
42
  ```bash
40
- yarn add @algolia/ingestion
43
+ yarn add @algolia/ingestion@1.6.1
44
+ # or
45
+ npm install @algolia/ingestion@1.6.1
41
46
  # or
42
- npm install @algolia/ingestion
47
+ pnpm add @algolia/ingestion@1.6.1
43
48
  ```
44
49
 
45
- Without a package manager
50
+ ### Without a package manager
46
51
 
47
52
  Add the following JavaScript snippet to the <head> of your website:
48
53
 
49
54
  ```html
50
- <script src="https://cdn.jsdelivr.net/npm/algoliasearch/dist/ingestion.umd.min.js"></script>
55
+ <script src="https://cdn.jsdelivr.net/npm/@algolia/ingestion@1.6.1/dist/builds/browser.umd.js"></script>
51
56
  ```
52
57
 
58
+ ### Usage
59
+
53
60
  You can now import the Algolia API client in your project and play with it.
54
61
 
55
62
  ```js
@@ -58,7 +65,7 @@ import { ingestionClient } from '@algolia/ingestion';
58
65
  const client = ingestionClient('YOUR_APP_ID', 'YOUR_API_KEY');
59
66
  ```
60
67
 
61
- For full documentation, visit the **[Algolia JavaScript API Client](https://www.algolia.com/doc/libraries/javascript/)**.
68
+ For full documentation, visit the **[Algolia JavaScript API Client](https://www.algolia.com/doc/libraries/javascript/v5/methods/ingestion/)**.
62
69
 
63
70
  ## ❓ Troubleshooting
64
71
 
package/dist/browser.d.ts CHANGED
@@ -278,9 +278,9 @@ type AuthenticationUpdateResponse = {
278
278
  type ActionType = 'append' | 'partial' | 'replace' | 'save';
279
279
 
280
280
  /**
281
- * Property by which to sort the list of authentication resources.
281
+ * Property by which to sort the list of authentications.
282
282
  */
283
- type AuthenticationSortKeys = 'auth_type' | 'createdAt' | 'name' | 'platform' | 'updatedAt';
283
+ type AuthenticationSortKeys = 'createdAt' | 'name' | 'platform' | 'type' | 'updatedAt';
284
284
 
285
285
  /**
286
286
  * Request body for updating an authentication resource.
@@ -415,11 +415,6 @@ type RunStatus = 'created' | 'finished' | 'idled' | 'skipped' | 'started';
415
415
  */
416
416
  type RunType = 'discover' | 'push' | 'reindex' | 'update' | 'validate';
417
417
 
418
- /**
419
- * Property by which to sort the list.
420
- */
421
- type SortKeys = 'createdAt' | 'name' | 'type' | 'updatedAt';
422
-
423
418
  /**
424
419
  * Property by which to sort the list of sources.
425
420
  */
@@ -773,6 +768,11 @@ type TransformationCreate = {
773
768
  authenticationIDs?: string[];
774
769
  };
775
770
 
771
+ /**
772
+ * Property by which to sort the list of transformations.
773
+ */
774
+ type TransformationSortKeys = 'createdAt' | 'name' | 'updatedAt';
775
+
776
776
  type TransformationTry = {
777
777
  /**
778
778
  * The source code of the transformation.
@@ -1033,11 +1033,11 @@ type ListAuthenticationsProps = {
1033
1033
  */
1034
1034
  type?: AuthenticationType[];
1035
1035
  /**
1036
- * Ecommerce platform for which to retrieve authentication resources.
1036
+ * Ecommerce platform for which to retrieve authentications.
1037
1037
  */
1038
1038
  platform?: PlatformWithNone[];
1039
1039
  /**
1040
- * Property by which to sort the list of authentication resources.
1040
+ * Property by which to sort the list of authentications.
1041
1041
  */
1042
1042
  sort?: AuthenticationSortKeys;
1043
1043
  /**
@@ -1065,6 +1065,10 @@ type ListDestinationsProps = {
1065
1065
  * Authentication ID used by destinations.
1066
1066
  */
1067
1067
  authenticationID?: string[];
1068
+ /**
1069
+ * Get the list of destinations used by a transformation.
1070
+ */
1071
+ transformationID?: string;
1068
1072
  /**
1069
1073
  * Property by which to sort the destinations.
1070
1074
  */
@@ -1173,7 +1177,7 @@ type ListSourcesProps = {
1173
1177
  */
1174
1178
  type?: SourceType[];
1175
1179
  /**
1176
- * Authentication IDs of the sources to retrieve. \'none\' returns sources that doesn\'t have an authentication resource.
1180
+ * Authentication IDs of the sources to retrieve. \'none\' returns sources that doesn\'t have an authentication.
1177
1181
  */
1178
1182
  authenticationID?: string[];
1179
1183
  /**
@@ -1280,9 +1284,9 @@ type ListTransformationsProps = {
1280
1284
  */
1281
1285
  page?: number;
1282
1286
  /**
1283
- * Property by which to sort the list.
1287
+ * Property by which to sort the list of transformations.
1284
1288
  */
1285
- sort?: SortKeys;
1289
+ sort?: TransformationSortKeys;
1286
1290
  /**
1287
1291
  * Sort order of the response, ascending or descending.
1288
1292
  */
@@ -2237,7 +2241,7 @@ type TransformationUpdateResponse = {
2237
2241
  updatedAt: string;
2238
2242
  };
2239
2243
 
2240
- declare const apiClientVersion = "1.5.3";
2244
+ declare const apiClientVersion = "1.6.1";
2241
2245
  declare const REGIONS: readonly ["eu", "us"];
2242
2246
  type Region = (typeof REGIONS)[number];
2243
2247
  /**
@@ -2620,8 +2624,8 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2620
2624
  * @param listAuthentications.itemsPerPage - Number of items per page.
2621
2625
  * @param listAuthentications.page - Page number of the paginated API response.
2622
2626
  * @param listAuthentications.type - Type of authentication resource to retrieve.
2623
- * @param listAuthentications.platform - Ecommerce platform for which to retrieve authentication resources.
2624
- * @param listAuthentications.sort - Property by which to sort the list of authentication resources.
2627
+ * @param listAuthentications.platform - Ecommerce platform for which to retrieve authentications.
2628
+ * @param listAuthentications.sort - Property by which to sort the list of authentications.
2625
2629
  * @param listAuthentications.order - Sort order of the response, ascending or descending.
2626
2630
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2627
2631
  */
@@ -2639,11 +2643,12 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2639
2643
  * @param listDestinations.page - Page number of the paginated API response.
2640
2644
  * @param listDestinations.type - Destination type.
2641
2645
  * @param listDestinations.authenticationID - Authentication ID used by destinations.
2646
+ * @param listDestinations.transformationID - Get the list of destinations used by a transformation.
2642
2647
  * @param listDestinations.sort - Property by which to sort the destinations.
2643
2648
  * @param listDestinations.order - Sort order of the response, ascending or descending.
2644
2649
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2645
2650
  */
2646
- listDestinations({ itemsPerPage, page, type, authenticationID, sort, order }?: ListDestinationsProps, requestOptions?: RequestOptions | undefined): Promise<ListDestinationsResponse>;
2651
+ listDestinations({ itemsPerPage, page, type, authenticationID, transformationID, sort, order }?: ListDestinationsProps, requestOptions?: RequestOptions | undefined): Promise<ListDestinationsResponse>;
2647
2652
  /**
2648
2653
  * Retrieves a list of events for a task run, identified by it\'s ID.
2649
2654
  *
@@ -2698,7 +2703,7 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2698
2703
  * @param listSources.itemsPerPage - Number of items per page.
2699
2704
  * @param listSources.page - Page number of the paginated API response.
2700
2705
  * @param listSources.type - Source type. Some sources require authentication.
2701
- * @param listSources.authenticationID - Authentication IDs of the sources to retrieve. \'none\' returns sources that doesn\'t have an authentication resource.
2706
+ * @param listSources.authenticationID - Authentication IDs of the sources to retrieve. \'none\' returns sources that doesn\'t have an authentication.
2702
2707
  * @param listSources.sort - Property by which to sort the list of sources.
2703
2708
  * @param listSources.order - Sort order of the response, ascending or descending.
2704
2709
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -2757,7 +2762,7 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2757
2762
  * @param listTransformations - The listTransformations object.
2758
2763
  * @param listTransformations.itemsPerPage - Number of items per page.
2759
2764
  * @param listTransformations.page - Page number of the paginated API response.
2760
- * @param listTransformations.sort - Property by which to sort the list.
2765
+ * @param listTransformations.sort - Property by which to sort the list of transformations.
2761
2766
  * @param listTransformations.order - Sort order of the response, ascending or descending.
2762
2767
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2763
2768
  */
@@ -3035,4 +3040,4 @@ type IngestionClient = ReturnType<typeof createIngestionClient>;
3035
3040
 
3036
3041
  declare function ingestionClient(appId: string, apiKey: string, region: Region, options?: ClientOptions): IngestionClient;
3037
3042
 
3038
- export { type Action, type ActionType, type AuthAPIKey, type AuthAPIKeyPartial, type AuthAlgolia, type AuthAlgoliaInsights, type AuthAlgoliaInsightsPartial, type AuthAlgoliaPartial, type AuthBasic, type AuthBasicPartial, type AuthGoogleServiceAccount, type AuthGoogleServiceAccountPartial, type AuthInput, type AuthInputPartial, type AuthOAuth, type AuthOAuthPartial, type Authentication, type AuthenticationCreate, type AuthenticationCreateResponse, type AuthenticationSearch, type AuthenticationSortKeys, type AuthenticationType, type AuthenticationUpdate, type AuthenticationUpdateResponse, type BigCommerceChannel, type BigCommerceMetafield, type BigQueryDataType, type CommercetoolsCustomFields, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteAuthenticationProps, type DeleteDestinationProps, type DeleteResponse, type DeleteSourceProps, type DeleteTaskProps, type DeleteTaskV1Props, type DeleteTransformationProps, type Destination, type DestinationCreate, type DestinationCreateResponse, type DestinationIndexName, type DestinationInput, type DestinationSearch, type DestinationSortKeys, type DestinationType, type DestinationUpdate, type DestinationUpdateResponse, type DisableTaskProps, type DisableTaskV1Props, type DockerImageType, type DockerRegistry, type DockerStreams, type DockerStreamsInput, type DockerStreamsSyncMode, type EnableTaskProps, type EnableTaskV1Props, type EntityType, type ErrorBase, type Event, type EventSortKeys, type EventStatus, type EventType, type GetAuthenticationProps, type GetDestinationProps, type GetEventProps, type GetRunProps, type GetSourceProps, type GetTaskProps, type GetTaskV1Props, type GetTransformationProps, type IngestionClient, type ListAuthenticationsProps, type ListAuthenticationsResponse, type ListDestinationsProps, type ListDestinationsResponse, type ListEventsProps, type ListEventsResponse, type ListRunsProps, type ListSourcesProps, type ListSourcesResponse, type ListTasksProps, type ListTasksResponse, type ListTasksResponseV1, type ListTasksV1Props, type ListTransformationsProps, type ListTransformationsResponse, type MappingFieldDirective, type MappingFormatSchema, type MappingInput, type MappingKitAction, type MappingTypeCSV, type MethodType, type OnDemandTrigger, type OnDemandTriggerInput, type OnDemandTriggerType, type OrderKeys, type Pagination, type Platform, type PlatformNone, type PlatformWithNone, type PushTaskPayload, type PushTaskProps, type PushTaskRecords, type RecordType, type Region, type Run, type RunListResponse, type RunOutcome, type RunProgress, type RunReasonCode, type RunResponse, type RunSortKeys, type RunSourcePayload, type RunSourceProps, type RunSourceResponse, type RunStatus, type RunTaskProps, type RunTaskV1Props, type RunType, type ScheduleTrigger, type ScheduleTriggerInput, type ScheduleTriggerType, type ShopifyInput, type ShopifyMarket, type ShopifyMetafield, type SortKeys, type Source, type SourceBigCommerce, type SourceBigQuery, type SourceCSV, type SourceCommercetools, type SourceCreate, type SourceCreateResponse, type SourceDocker, type SourceGA4BigQueryExport, type SourceInput, type SourceJSON, type SourceSearch, type SourceShopify, type SourceShopifyBase, type SourceSortKeys, type SourceType, type SourceUpdate, type SourceUpdateCommercetools, type SourceUpdateDocker, type SourceUpdateInput, type SourceUpdateResponse, type SourceUpdateShopify, type SourceWatchResponse, type StreamingInput, type StreamingTrigger, type StreamingTriggerType, type SubscriptionTrigger, type SubscriptionTriggerType, type Task, type TaskCreate, type TaskCreateResponse, type TaskCreateTrigger, type TaskCreateV1, type TaskInput, type TaskSearch, type TaskSortKeys, type TaskUpdate, type TaskUpdateResponse, type TaskUpdateV1, type TaskV1, type Transformation, type TransformationCreate, type TransformationCreateResponse, type TransformationError, type TransformationSearch, type TransformationTry, type TransformationTryResponse, type TransformationUpdateResponse, type Trigger, type TriggerDockerSourceDiscoverProps, type TriggerType, type TriggerUpdateInput, type TryTransformationBeforeUpdateProps, type UpdateAuthenticationProps, type UpdateDestinationProps, type UpdateSourceProps, type UpdateTaskProps, type UpdateTaskV1Props, type UpdateTransformationProps, type ValidateSourceBeforeUpdateProps, type Window, apiClientVersion, ingestionClient, isOnDemandTrigger, isScheduleTrigger, isSubscriptionTrigger };
3043
+ export { type Action, type ActionType, type AuthAPIKey, type AuthAPIKeyPartial, type AuthAlgolia, type AuthAlgoliaInsights, type AuthAlgoliaInsightsPartial, type AuthAlgoliaPartial, type AuthBasic, type AuthBasicPartial, type AuthGoogleServiceAccount, type AuthGoogleServiceAccountPartial, type AuthInput, type AuthInputPartial, type AuthOAuth, type AuthOAuthPartial, type Authentication, type AuthenticationCreate, type AuthenticationCreateResponse, type AuthenticationSearch, type AuthenticationSortKeys, type AuthenticationType, type AuthenticationUpdate, type AuthenticationUpdateResponse, type BigCommerceChannel, type BigCommerceMetafield, type BigQueryDataType, type CommercetoolsCustomFields, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteAuthenticationProps, type DeleteDestinationProps, type DeleteResponse, type DeleteSourceProps, type DeleteTaskProps, type DeleteTaskV1Props, type DeleteTransformationProps, type Destination, type DestinationCreate, type DestinationCreateResponse, type DestinationIndexName, type DestinationInput, type DestinationSearch, type DestinationSortKeys, type DestinationType, type DestinationUpdate, type DestinationUpdateResponse, type DisableTaskProps, type DisableTaskV1Props, type DockerImageType, type DockerRegistry, type DockerStreams, type DockerStreamsInput, type DockerStreamsSyncMode, type EnableTaskProps, type EnableTaskV1Props, type EntityType, type ErrorBase, type Event, type EventSortKeys, type EventStatus, type EventType, type GetAuthenticationProps, type GetDestinationProps, type GetEventProps, type GetRunProps, type GetSourceProps, type GetTaskProps, type GetTaskV1Props, type GetTransformationProps, type IngestionClient, type ListAuthenticationsProps, type ListAuthenticationsResponse, type ListDestinationsProps, type ListDestinationsResponse, type ListEventsProps, type ListEventsResponse, type ListRunsProps, type ListSourcesProps, type ListSourcesResponse, type ListTasksProps, type ListTasksResponse, type ListTasksResponseV1, type ListTasksV1Props, type ListTransformationsProps, type ListTransformationsResponse, type MappingFieldDirective, type MappingFormatSchema, type MappingInput, type MappingKitAction, type MappingTypeCSV, type MethodType, type OnDemandTrigger, type OnDemandTriggerInput, type OnDemandTriggerType, type OrderKeys, type Pagination, type Platform, type PlatformNone, type PlatformWithNone, type PushTaskPayload, type PushTaskProps, type PushTaskRecords, type RecordType, type Region, type Run, type RunListResponse, type RunOutcome, type RunProgress, type RunReasonCode, type RunResponse, type RunSortKeys, type RunSourcePayload, type RunSourceProps, type RunSourceResponse, type RunStatus, type RunTaskProps, type RunTaskV1Props, type RunType, type ScheduleTrigger, type ScheduleTriggerInput, type ScheduleTriggerType, type ShopifyInput, type ShopifyMarket, type ShopifyMetafield, type Source, type SourceBigCommerce, type SourceBigQuery, type SourceCSV, type SourceCommercetools, type SourceCreate, type SourceCreateResponse, type SourceDocker, type SourceGA4BigQueryExport, type SourceInput, type SourceJSON, type SourceSearch, type SourceShopify, type SourceShopifyBase, type SourceSortKeys, type SourceType, type SourceUpdate, type SourceUpdateCommercetools, type SourceUpdateDocker, type SourceUpdateInput, type SourceUpdateResponse, type SourceUpdateShopify, type SourceWatchResponse, type StreamingInput, type StreamingTrigger, type StreamingTriggerType, type SubscriptionTrigger, type SubscriptionTriggerType, type Task, type TaskCreate, type TaskCreateResponse, type TaskCreateTrigger, type TaskCreateV1, type TaskInput, type TaskSearch, type TaskSortKeys, type TaskUpdate, type TaskUpdateResponse, type TaskUpdateV1, type TaskV1, type Transformation, type TransformationCreate, type TransformationCreateResponse, type TransformationError, type TransformationSearch, type TransformationSortKeys, type TransformationTry, type TransformationTryResponse, type TransformationUpdateResponse, type Trigger, type TriggerDockerSourceDiscoverProps, type TriggerType, type TriggerUpdateInput, type TryTransformationBeforeUpdateProps, type UpdateAuthenticationProps, type UpdateDestinationProps, type UpdateSourceProps, type UpdateTaskProps, type UpdateTaskV1Props, type UpdateTransformationProps, type ValidateSourceBeforeUpdateProps, type Window, apiClientVersion, ingestionClient, isOnDemandTrigger, isScheduleTrigger, isSubscriptionTrigger };
@@ -1,5 +1,6 @@
1
1
  // builds/browser.ts
2
2
  import {
3
+ createNullLogger,
3
4
  createMemoryCache,
4
5
  createFallbackableCache,
5
6
  createBrowserLocalStorageCache,
@@ -11,7 +12,7 @@ import { createXhrRequester } from "@algolia/requester-browser-xhr";
11
12
 
12
13
  // src/ingestionClient.ts
13
14
  import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
14
- var apiClientVersion = "1.5.3";
15
+ var apiClientVersion = "1.6.1";
15
16
  var REGIONS = ["eu", "us"];
16
17
  function getDefaultHosts(region) {
17
18
  const url = "data.{region}.algolia.com".replace("{region}", region);
@@ -892,8 +893,8 @@ function createIngestionClient({
892
893
  * @param listAuthentications.itemsPerPage - Number of items per page.
893
894
  * @param listAuthentications.page - Page number of the paginated API response.
894
895
  * @param listAuthentications.type - Type of authentication resource to retrieve.
895
- * @param listAuthentications.platform - Ecommerce platform for which to retrieve authentication resources.
896
- * @param listAuthentications.sort - Property by which to sort the list of authentication resources.
896
+ * @param listAuthentications.platform - Ecommerce platform for which to retrieve authentications.
897
+ * @param listAuthentications.sort - Property by which to sort the list of authentications.
897
898
  * @param listAuthentications.order - Sort order of the response, ascending or descending.
898
899
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
899
900
  */
@@ -940,11 +941,12 @@ function createIngestionClient({
940
941
  * @param listDestinations.page - Page number of the paginated API response.
941
942
  * @param listDestinations.type - Destination type.
942
943
  * @param listDestinations.authenticationID - Authentication ID used by destinations.
944
+ * @param listDestinations.transformationID - Get the list of destinations used by a transformation.
943
945
  * @param listDestinations.sort - Property by which to sort the destinations.
944
946
  * @param listDestinations.order - Sort order of the response, ascending or descending.
945
947
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
946
948
  */
947
- listDestinations({ itemsPerPage, page, type, authenticationID, sort, order } = {}, requestOptions = void 0) {
949
+ listDestinations({ itemsPerPage, page, type, authenticationID, transformationID, sort, order } = {}, requestOptions = void 0) {
948
950
  const requestPath = "/1/destinations";
949
951
  const headers = {};
950
952
  const queryParameters = {};
@@ -960,6 +962,9 @@ function createIngestionClient({
960
962
  if (authenticationID !== void 0) {
961
963
  queryParameters.authenticationID = authenticationID.toString();
962
964
  }
965
+ if (transformationID !== void 0) {
966
+ queryParameters.transformationID = transformationID.toString();
967
+ }
963
968
  if (sort !== void 0) {
964
969
  queryParameters.sort = sort.toString();
965
970
  }
@@ -1104,7 +1109,7 @@ function createIngestionClient({
1104
1109
  * @param listSources.itemsPerPage - Number of items per page.
1105
1110
  * @param listSources.page - Page number of the paginated API response.
1106
1111
  * @param listSources.type - Source type. Some sources require authentication.
1107
- * @param listSources.authenticationID - Authentication IDs of the sources to retrieve. \'none\' returns sources that doesn\'t have an authentication resource.
1112
+ * @param listSources.authenticationID - Authentication IDs of the sources to retrieve. \'none\' returns sources that doesn\'t have an authentication.
1108
1113
  * @param listSources.sort - Property by which to sort the list of sources.
1109
1114
  * @param listSources.order - Sort order of the response, ascending or descending.
1110
1115
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -1268,7 +1273,7 @@ function createIngestionClient({
1268
1273
  * @param listTransformations - The listTransformations object.
1269
1274
  * @param listTransformations.itemsPerPage - Number of items per page.
1270
1275
  * @param listTransformations.page - Page number of the paginated API response.
1271
- * @param listTransformations.sort - Property by which to sort the list.
1276
+ * @param listTransformations.sort - Property by which to sort the list of transformations.
1272
1277
  * @param listTransformations.order - Sort order of the response, ascending or descending.
1273
1278
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1274
1279
  */
@@ -1975,6 +1980,7 @@ function ingestionClient(appId, apiKey, region, options) {
1975
1980
  read: DEFAULT_READ_TIMEOUT_BROWSER,
1976
1981
  write: DEFAULT_WRITE_TIMEOUT_BROWSER
1977
1982
  },
1983
+ logger: createNullLogger(),
1978
1984
  requester: createXhrRequester(),
1979
1985
  algoliaAgents: [{ segment: "Browser" }],
1980
1986
  authMode: "WithinQueryParameters",