@constructor-io/constructorio-node 5.5.1 → 5.7.0

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.
@@ -15,6 +15,10 @@ import {
15
15
  SynonymGroup,
16
16
  SearchabilityConfiguration,
17
17
  SearchabilityConfigurationResponse,
18
+ FacetConfigurationV2,
19
+ FacetConfigurationV2Response,
20
+ SearchabilityConfigurationV2,
21
+ SearchabilityConfigurationV2Response,
18
22
  } from '.';
19
23
 
20
24
  export default Catalog;
@@ -173,6 +177,7 @@ export interface ReplaceCatalogParameters {
173
177
  items?: File | fs.ReadStream | Duplex
174
178
  variations?: File | fs.ReadStream | Duplex;
175
179
  itemGroups?: File | fs.ReadStream | Duplex;
180
+ format?: 'csv' | 'jsonl';
176
181
  }
177
182
 
178
183
  export interface UpdateCatalogParameters extends ReplaceCatalogParameters {}
@@ -185,6 +190,7 @@ export interface PatchCatalogParameters {
185
190
  items?: File | fs.ReadStream | Duplex
186
191
  variations?: File | fs.ReadStream | Duplex;
187
192
  itemGroups?: File | fs.ReadStream | Duplex;
193
+ format?: 'csv' | 'jsonl';
188
194
  }
189
195
 
190
196
  export interface ReplaceCatalogUsingTarArchiveParameters {
@@ -192,6 +198,7 @@ export interface ReplaceCatalogUsingTarArchiveParameters {
192
198
  notificationEmail?: string;
193
199
  force?: boolean;
194
200
  tarArchive?: File | fs.ReadStream | Duplex;
201
+ format?: 'csv' | 'jsonl';
195
202
  }
196
203
 
197
204
  export interface UpdateCatalogUsingTarArchiveParameters
@@ -272,6 +279,86 @@ export interface PatchSearchabilitiesParameters {
272
279
  section?: string;
273
280
  }
274
281
 
282
+ // V2 Facet Configuration Parameters
283
+ export type AddFacetConfigurationV2Parameters = FacetConfigurationV2;
284
+
285
+ export type ReplaceFacetConfigurationV2Parameters = FacetConfigurationV2;
286
+
287
+ export interface GetFacetConfigurationsV2Parameters {
288
+ page?: number;
289
+ numResultsPerPage?: number;
290
+ offset?: number;
291
+ section?: string;
292
+ }
293
+
294
+ export interface GetFacetConfigurationV2Parameters {
295
+ name: string;
296
+ section?: string;
297
+ }
298
+
299
+ export interface CreateOrReplaceFacetConfigurationsV2Parameters {
300
+ facetConfigurations: FacetConfigurationV2[];
301
+ section?: string;
302
+ }
303
+
304
+ export interface ModifyFacetConfigurationsV2Parameters {
305
+ facetConfigurations: (Partial<FacetConfigurationV2> & { name: string })[];
306
+ section?: string;
307
+ }
308
+
309
+ export interface RemoveFacetConfigurationV2Parameters {
310
+ name: string;
311
+ section?: string;
312
+ }
313
+
314
+ // V2 Searchabilities Parameters
315
+ export interface RetrieveSearchabilitiesV2Parameters {
316
+ name?: string;
317
+ page?: number;
318
+ offset?: number;
319
+ numResultsPerPage?: number;
320
+ fuzzySearchable?: boolean;
321
+ exactSearchable?: boolean;
322
+ displayable?: boolean;
323
+ matchType?: 'and' | 'or';
324
+ sortBy?: 'name';
325
+ sortOrder?: 'ascending' | 'descending';
326
+ section?: string;
327
+ }
328
+
329
+ export interface RetrieveSearchabilityV2Parameters {
330
+ name: string;
331
+ section?: string;
332
+ }
333
+
334
+ export interface PatchSearchabilitiesV2Parameters {
335
+ searchabilities: SearchabilityConfigurationV2[];
336
+ skipRebuild?: boolean;
337
+ section?: string;
338
+ }
339
+
340
+ export interface PatchSearchabilityV2Parameters {
341
+ name: string;
342
+ fuzzySearchable?: boolean;
343
+ exactSearchable?: boolean;
344
+ displayable?: boolean;
345
+ hidden?: boolean;
346
+ skipRebuild?: boolean;
347
+ section?: string;
348
+ }
349
+
350
+ export interface DeleteSearchabilitiesV2Parameters {
351
+ searchabilities: { name: string }[];
352
+ skipRebuild?: boolean;
353
+ section?: string;
354
+ }
355
+
356
+ export interface DeleteSearchabilityV2Parameters {
357
+ name: string;
358
+ skipRebuild?: boolean;
359
+ section?: string;
360
+ }
361
+
275
362
  interface CatalogMutationResponse {
276
363
  task_id: string;
277
364
  task_status_path: string;
@@ -512,11 +599,13 @@ declare class Catalog {
512
599
  networkParameters?: NetworkParameters
513
600
  ): Promise<CatalogMutationResponse>;
514
601
 
602
+ /** @deprecated Use addFacetConfigurationV2 instead. */
515
603
  addFacetConfiguration(
516
604
  parameters: FacetConfiguration,
517
605
  networkParameters?: NetworkParameters
518
606
  ): Promise<FacetConfiguration>;
519
607
 
608
+ /** @deprecated Use getFacetConfigurationsV2 instead. */
520
609
  getFacetConfigurations(
521
610
  parameters: GetFacetConfigurationsParameters,
522
611
  networkParameters?: NetworkParameters
@@ -526,26 +615,31 @@ declare class Catalog {
526
615
  [key: string]: any;
527
616
  }>;
528
617
 
618
+ /** @deprecated Use getFacetConfigurationV2 instead. */
529
619
  getFacetConfiguration(
530
620
  parameters: GetFacetConfigurationParameters,
531
621
  networkParameters?: NetworkParameters
532
622
  ): Promise<FacetConfiguration>;
533
623
 
624
+ /** @deprecated Use modifyFacetConfigurationsV2 instead. */
534
625
  modifyFacetConfigurations(
535
626
  parameters?: ModifyFacetConfigurationsParameters,
536
627
  networkParameters?: NetworkParameters
537
628
  ): Promise<FacetConfiguration[]>;
538
629
 
630
+ /** @deprecated Use replaceFacetConfigurationV2 instead. */
539
631
  replaceFacetConfiguration(
540
632
  parameters: FacetConfiguration,
541
633
  networkParameters?: NetworkParameters
542
634
  ): Promise<FacetConfiguration>;
543
635
 
636
+ /** @deprecated Use modifyFacetConfigurationV2 instead. */
544
637
  modifyFacetConfiguration(
545
638
  parameters: FacetConfiguration,
546
639
  networkParameters?: NetworkParameters
547
640
  ): Promise<FacetConfiguration>;
548
641
 
642
+ /** @deprecated Use removeFacetConfigurationV2 instead. */
549
643
  removeFacetConfiguration(
550
644
  parameters?: RemoveFacetConfigurationParameters,
551
645
  networkParameters?: NetworkParameters
@@ -590,6 +684,7 @@ declare class Catalog {
590
684
  networkParameters?: NetworkParameters
591
685
  ): Promise<FacetOptionConfiguration>;
592
686
 
687
+ /** @deprecated Use retrieveSearchabilitiesV2 instead. */
593
688
  retrieveSearchabilities(
594
689
  parameters?: RetrieveSearchabilitiesParameters,
595
690
  networkParameters?: NetworkParameters
@@ -598,10 +693,99 @@ declare class Catalog {
598
693
  total_count: number;
599
694
  }>;
600
695
 
696
+ /** @deprecated Use patchSearchabilitiesV2 instead. */
601
697
  patchSearchabilities(
602
698
  parameters: PatchSearchabilitiesParameters,
603
699
  networkParameters?: NetworkParameters
604
700
  ): Promise<{
605
701
  searchabilities: SearchabilityConfigurationResponse[];
606
702
  }>;
703
+
704
+ // V2 Facet Configuration Methods
705
+ addFacetConfigurationV2(
706
+ parameters: AddFacetConfigurationV2Parameters,
707
+ networkParameters?: NetworkParameters
708
+ ): Promise<FacetConfigurationV2Response>;
709
+
710
+ getFacetConfigurationsV2(
711
+ parameters?: GetFacetConfigurationsV2Parameters,
712
+ networkParameters?: NetworkParameters
713
+ ): Promise<{
714
+ facets: FacetConfigurationV2Response[];
715
+ total_count: number;
716
+ }>;
717
+
718
+ getFacetConfigurationV2(
719
+ parameters: GetFacetConfigurationV2Parameters,
720
+ networkParameters?: NetworkParameters
721
+ ): Promise<FacetConfigurationV2Response>;
722
+
723
+ createOrReplaceFacetConfigurationsV2(
724
+ parameters: CreateOrReplaceFacetConfigurationsV2Parameters,
725
+ networkParameters?: NetworkParameters
726
+ ): Promise<{
727
+ facets: FacetConfigurationV2Response[];
728
+ }>;
729
+
730
+ modifyFacetConfigurationsV2(
731
+ parameters: ModifyFacetConfigurationsV2Parameters,
732
+ networkParameters?: NetworkParameters
733
+ ): Promise<{
734
+ facets: FacetConfigurationV2Response[];
735
+ }>;
736
+
737
+ replaceFacetConfigurationV2(
738
+ parameters: ReplaceFacetConfigurationV2Parameters,
739
+ networkParameters?: NetworkParameters
740
+ ): Promise<FacetConfigurationV2Response>;
741
+
742
+ modifyFacetConfigurationV2(
743
+ parameters: Partial<FacetConfigurationV2> & { name: string },
744
+ networkParameters?: NetworkParameters
745
+ ): Promise<FacetConfigurationV2Response>;
746
+
747
+ removeFacetConfigurationV2(
748
+ parameters: RemoveFacetConfigurationV2Parameters,
749
+ networkParameters?: NetworkParameters
750
+ ): Promise<FacetConfigurationV2Response>;
751
+
752
+ // V2 Searchabilities Methods
753
+ retrieveSearchabilitiesV2(
754
+ parameters?: RetrieveSearchabilitiesV2Parameters,
755
+ networkParameters?: NetworkParameters
756
+ ): Promise<{
757
+ searchabilities: SearchabilityConfigurationV2Response[];
758
+ total_count: number;
759
+ }>;
760
+
761
+ retrieveSearchabilityV2(
762
+ parameters: RetrieveSearchabilityV2Parameters,
763
+ networkParameters?: NetworkParameters
764
+ ): Promise<SearchabilityConfigurationV2Response>;
765
+
766
+ patchSearchabilitiesV2(
767
+ parameters: PatchSearchabilitiesV2Parameters,
768
+ networkParameters?: NetworkParameters
769
+ ): Promise<{
770
+ searchabilities: SearchabilityConfigurationV2Response[];
771
+ total_count: number;
772
+ }>;
773
+
774
+ patchSearchabilityV2(
775
+ parameters: PatchSearchabilityV2Parameters,
776
+ networkParameters?: NetworkParameters
777
+ ): Promise<SearchabilityConfigurationV2Response>;
778
+
779
+ deleteSearchabilitiesV2(
780
+ parameters: DeleteSearchabilitiesV2Parameters,
781
+ networkParameters?: NetworkParameters
782
+ ): Promise<{
783
+ searchabilities: SearchabilityConfigurationV2Response[];
784
+ total_count: number;
785
+ }>;
786
+
787
+ deleteSearchabilityV2(
788
+ parameters: DeleteSearchabilityV2Parameters,
789
+ networkParameters?: NetworkParameters
790
+ ): Promise<SearchabilityConfigurationV2Response>;
607
791
  }
@@ -335,6 +335,70 @@ export interface SearchabilityConfiguration {
335
335
  hidden?: boolean,
336
336
  }
337
337
 
338
+ // V2 Facet Types
339
+ export interface FacetConfigurationV2Base {
340
+ name: string;
341
+ pathInMetadata: string;
342
+ displayName?: string;
343
+ sortOrder?: 'relevance' | 'value' | 'num_matches';
344
+ sortDescending?: boolean;
345
+ matchType?: 'any' | 'all' | 'none';
346
+ position?: number | null;
347
+ hidden?: boolean;
348
+ protected?: boolean;
349
+ countable?: boolean;
350
+ optionsLimit?: number;
351
+ data?: Record<string, unknown>;
352
+ section?: string;
353
+ }
354
+
355
+ export type FacetConfigurationV2 = FacetConfigurationV2Base & (
356
+ | { type: 'multiple' | 'hierarchical'; rangeType?: null; rangeFormat?: null; rangeInclusive?: null; rangeLimits?: null }
357
+ | { type: 'range'; rangeFormat: 'boundaries'; rangeType?: 'static'; rangeInclusive?: 'above' | 'below' | null; rangeLimits?: null }
358
+ | { type: 'range'; rangeFormat: 'options'; rangeLimits: number[]; rangeType?: 'static'; rangeInclusive?: 'above' | 'below' | null }
359
+ );
360
+
361
+ export interface FacetConfigurationV2Response {
362
+ name: string;
363
+ path_in_metadata: string;
364
+ type: 'multiple' | 'hierarchical' | 'range';
365
+ display_name?: string | null;
366
+ sort_order?: 'relevance' | 'value' | 'num_matches';
367
+ sort_descending?: boolean;
368
+ range_type?: 'static' | null;
369
+ range_format?: 'boundaries' | 'options' | null;
370
+ range_inclusive?: 'above' | 'below' | null;
371
+ range_limits?: number[] | null;
372
+ match_type?: 'any' | 'all' | 'none';
373
+ position?: number | null;
374
+ hidden?: boolean;
375
+ protected?: boolean;
376
+ countable?: boolean;
377
+ options_limit?: number;
378
+ data?: Record<string, unknown>;
379
+ created_at: string;
380
+ updated_at?: string;
381
+ }
382
+
383
+ // V2 Searchability Types
384
+ export interface SearchabilityConfigurationV2 {
385
+ name: string;
386
+ fuzzySearchable?: boolean;
387
+ exactSearchable?: boolean;
388
+ displayable?: boolean;
389
+ hidden?: boolean;
390
+ }
391
+
392
+ export interface SearchabilityConfigurationV2Response {
393
+ name: string;
394
+ fuzzy_searchable: boolean;
395
+ exact_searchable: boolean;
396
+ displayable: boolean;
397
+ hidden: boolean;
398
+ created_at: string;
399
+ updated_at?: string;
400
+ }
401
+
338
402
  export interface ItemTracked {
339
403
  itemName?: string;
340
404
  itemId?: string;