@wix/auto_sdk_stores_customizations-v-3 1.0.107 → 1.0.109

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.
@@ -6,6 +6,12 @@ import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types';
6
6
  * Options are designed to add variations to a product, where modifiers add a customizable change to the product but without creating another variant.
7
7
  */
8
8
  interface Customization extends CustomizationTypeSpecificSettingsOneOf, CustomizationCustomizationSettingsOneOf {
9
+ /**
10
+ * Modifier-specific settings.
11
+ *
12
+ * Only supported when `customizationType` is `MODIFIER`.
13
+ */
14
+ modifierSettings?: ModifierSettings;
9
15
  /**
10
16
  * Free text input settings.
11
17
  *
@@ -80,6 +86,12 @@ interface Customization extends CustomizationTypeSpecificSettingsOneOf, Customiz
80
86
  }
81
87
  /** @oneof */
82
88
  interface CustomizationTypeSpecificSettingsOneOf {
89
+ /**
90
+ * Modifier-specific settings.
91
+ *
92
+ * Only supported when `customizationType` is `MODIFIER`.
93
+ */
94
+ modifierSettings?: ModifierSettings;
83
95
  }
84
96
  /** @oneof */
85
97
  interface CustomizationCustomizationSettingsOneOf {
@@ -112,7 +124,17 @@ declare enum CustomizationRenderType {
112
124
  }
113
125
  /** @enumType */
114
126
  type CustomizationRenderTypeWithLiterals = CustomizationRenderType | 'FREE_TEXT' | 'TEXT_CHOICES' | 'SWATCH_CHOICES';
127
+ /** Settings specific to modifier customizations. */
115
128
  interface ModifierSettings {
129
+ /**
130
+ * Whether customer input is required for this modifier by default.
131
+ *
132
+ * Applies to `modifiers.mandatory` on a product that uses this modifier without setting
133
+ * `mandatory` explicitly. A product that sets `modifiers.mandatory` overrides this default.
134
+ *
135
+ * Default: `false`
136
+ */
137
+ defaultMandatory?: boolean | null;
116
138
  }
117
139
  interface FreeTextSettings {
118
140
  /** Minimum text character length. */
@@ -434,7 +456,22 @@ interface URIs {
434
456
  interface CreateCustomizationRequest {
435
457
  /** Customization to create. */
436
458
  customization: Customization;
459
+ /**
460
+ * Fields to include in the response.
461
+ *
462
+ * Supported values: `ASSIGNED_PRODUCTS_COUNT`
463
+ * @maxSize 100
464
+ */
465
+ fields?: RequestedFieldsWithLiterals[];
437
466
  }
467
+ declare enum RequestedFields {
468
+ /** Assigned products count. */
469
+ ASSIGNED_PRODUCTS_COUNT = "ASSIGNED_PRODUCTS_COUNT",
470
+ /** Returns display images for choices. */
471
+ CHOICE_DISPLAY_IMAGE = "CHOICE_DISPLAY_IMAGE"
472
+ }
473
+ /** @enumType */
474
+ type RequestedFieldsWithLiterals = RequestedFields | 'ASSIGNED_PRODUCTS_COUNT' | 'CHOICE_DISPLAY_IMAGE';
438
475
  interface CreateCustomizationResponse {
439
476
  /** Created customization. */
440
477
  customization?: Customization;
@@ -453,14 +490,6 @@ interface GetCustomizationRequest {
453
490
  */
454
491
  fields?: RequestedFieldsWithLiterals[];
455
492
  }
456
- declare enum RequestedFields {
457
- /** Assigned products count. */
458
- ASSIGNED_PRODUCTS_COUNT = "ASSIGNED_PRODUCTS_COUNT",
459
- /** Returns display images for choices. */
460
- CHOICE_DISPLAY_IMAGE = "CHOICE_DISPLAY_IMAGE"
461
- }
462
- /** @enumType */
463
- type RequestedFieldsWithLiterals = RequestedFields | 'ASSIGNED_PRODUCTS_COUNT' | 'CHOICE_DISPLAY_IMAGE';
464
493
  interface GetCustomizationResponse {
465
494
  /** Customization. */
466
495
  customization?: Customization;
@@ -612,6 +641,13 @@ interface BulkCreateCustomizationsRequest {
612
641
  * Default: `false`
613
642
  */
614
643
  returnEntity?: boolean;
644
+ /**
645
+ * Fields to include in the response.
646
+ *
647
+ * Supported values: `ASSIGNED_PRODUCTS_COUNT`
648
+ * @maxSize 100
649
+ */
650
+ fields?: RequestedFieldsWithLiterals[];
615
651
  }
616
652
  interface BulkCreateCustomizationsResponse {
617
653
  /**
@@ -1533,10 +1569,19 @@ declare function onCustomizationUpdated(handler: (event: CustomizationUpdatedEnv
1533
1569
  * @returns Created customization.
1534
1570
  * @fqn wix.stores.catalog.customization.v3.CustomizationService.CreateCustomization
1535
1571
  */
1536
- declare function createCustomization(customization: NonNullablePaths<Customization, `choicesSettings.choices` | `customizationRenderType` | `customizationType` | `freeTextInput.title` | `name`, 1>): Promise<NonNullablePaths<Customization, `freeTextInput.minCharCount` | `freeTextInput.maxCharCount` | `freeTextInput.title` | `choicesSettings.choices` | `choicesSettings.choices.${number}.colorCode` | `choicesSettings.choices.${number}._id` | `choicesSettings.choices.${number}.choiceType` | `choicesSettings.choices.${number}.name` | `name` | `customizationType` | `customizationRenderType`, 3> & {
1572
+ declare function createCustomization(customization: NonNullablePaths<Customization, `choicesSettings.choices` | `customizationRenderType` | `customizationType` | `freeTextInput.title` | `name`, 1>, options?: CreateCustomizationOptions): Promise<NonNullablePaths<Customization, `freeTextInput.minCharCount` | `freeTextInput.maxCharCount` | `freeTextInput.title` | `choicesSettings.choices` | `choicesSettings.choices.${number}.colorCode` | `choicesSettings.choices.${number}._id` | `choicesSettings.choices.${number}.choiceType` | `choicesSettings.choices.${number}.name` | `name` | `customizationType` | `customizationRenderType`, 3> & {
1537
1573
  __applicationErrorsType?: CreateCustomizationApplicationErrors;
1538
1574
  __validationErrorsType?: CreateCustomizationValidationErrors;
1539
1575
  }>;
1576
+ interface CreateCustomizationOptions {
1577
+ /**
1578
+ * Fields to include in the response.
1579
+ *
1580
+ * Supported values: `ASSIGNED_PRODUCTS_COUNT`
1581
+ * @maxSize 100
1582
+ */
1583
+ fields?: RequestedFieldsWithLiterals[];
1584
+ }
1540
1585
  /**
1541
1586
  * Retrieves a customization.
1542
1587
  * @param customizationId - Customization ID.
@@ -1577,6 +1622,12 @@ declare function updateCustomization(_id: string, customization: NonNullablePath
1577
1622
  __applicationErrorsType?: UpdateCustomizationApplicationErrors;
1578
1623
  }>;
1579
1624
  interface UpdateCustomization {
1625
+ /**
1626
+ * Modifier-specific settings.
1627
+ *
1628
+ * Only supported when `customizationType` is `MODIFIER`.
1629
+ */
1630
+ modifierSettings?: ModifierSettings;
1580
1631
  /**
1581
1632
  * Free text input settings.
1582
1633
  *
@@ -1858,6 +1909,13 @@ interface BulkCreateCustomizationsOptions {
1858
1909
  * Default: `false`
1859
1910
  */
1860
1911
  returnEntity?: boolean;
1912
+ /**
1913
+ * Fields to include in the response.
1914
+ *
1915
+ * Supported values: `ASSIGNED_PRODUCTS_COUNT`
1916
+ * @maxSize 100
1917
+ */
1918
+ fields?: RequestedFieldsWithLiterals[];
1861
1919
  }
1862
1920
  /**
1863
1921
  * Adds choices to a customization.
@@ -2082,4 +2140,4 @@ interface BulkUpdateCustomizationsOptions {
2082
2140
  fields?: RequestedFieldsWithLiterals[];
2083
2141
  }
2084
2142
 
2085
- export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type AddCustomizationChoicesApplicationErrors, type AddCustomizationChoicesOptions, type AddCustomizationChoicesRequest, type AddCustomizationChoicesResponse, type AddCustomizationChoicesValidationErrors, type App, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkAddCustomizationChoicesApplicationErrors, type BulkAddCustomizationChoicesOptions, type BulkAddCustomizationChoicesRequest, type BulkAddCustomizationChoicesResponse, type BulkAddCustomizationChoicesValidationErrors, type BulkCreateCustomizationsApplicationErrors, type BulkCreateCustomizationsForMigrationRequest, type BulkCreateCustomizationsForMigrationResponse, type BulkCreateCustomizationsOptions, type BulkCreateCustomizationsRequest, type BulkCreateCustomizationsResponse, type BulkCreateCustomizationsValidationErrors, type BulkCustomizationResult, type BulkUpdateCustomizationsApplicationErrors, type BulkUpdateCustomizationsOptions, type BulkUpdateCustomizationsRequest, type BulkUpdateCustomizationsResponse, type CatalogRollbackRequested, type Choice, type ChoiceIdsMismatchData, ChoiceSortStrategy, type ChoiceSortStrategyWithLiterals, ChoiceType, type ChoiceTypeWithLiterals, type ChoiceValueOneOf, type ChoicesSettings, type CommonQueryWithEntityContext, type CountCustomizationsOptions, type CountCustomizationsRequest, type CountCustomizationsResponse, type CreateCustomizationApplicationErrors, type CreateCustomizationRequest, type CreateCustomizationResponse, type CreateCustomizationValidationErrors, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type CustomTag, type Customization, type CustomizationChoices, type CustomizationCreatedEnvelope, type CustomizationCustomizationSettingsOneOf, type CustomizationDeletedEnvelope, type CustomizationIdsWrapper, type CustomizationQuery, type CustomizationQuerySpec, CustomizationRenderType, type CustomizationRenderTypeWithLiterals, CustomizationType, type CustomizationTypeSpecificSettingsOneOf, type CustomizationTypeWithLiterals, type CustomizationUpdatedEnvelope, type CustomizationsQueryBuilder, type CustomizationsQueryResult, type DeleteCustomizationRequest, type DeleteCustomizationResponse, type DeleteCustomizationValidationErrors, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type File, type FocalPoint, type FreeTextSettings, type GetCustomizationOptions, type GetCustomizationRequest, type GetCustomizationResponse, type IdentificationData, type IdentificationDataIdOneOf, type InvalidateCache, type InvalidateCacheGetByOneOf, type ItemMetadata, type MaskedChoice, type MaskedCustomization, type MessageEnvelope, type ModifierSettings, type MultipleColors, type Page, type Pages, type QueryCustomizationsOptions, type QueryCustomizationsRequest, type QueryCustomizationsResponse, type RecloneSiteRequest, type RecloneSiteResponse, type RemoveCustomizationChoicesApplicationErrors, type RemoveCustomizationChoicesOptions, type RemoveCustomizationChoicesRequest, type RemoveCustomizationChoicesResponse, type RemoveCustomizationChoicesValidationErrors, type ReorderCustomizationChoicesApplicationErrors, type ReorderCustomizationChoicesOptions, type ReorderCustomizationChoicesRequest, type ReorderCustomizationChoicesResponse, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, type SetCustomizationChoicesApplicationErrors, type SetCustomizationChoicesOptions, type SetCustomizationChoicesRequest, type SetCustomizationChoicesResponse, type SetCustomizationChoicesValidationErrors, SortOrder, type SortOrderWithLiterals, type Sorting, type URI, type URIs, type UpdateCustomization, type UpdateCustomizationApplicationErrors, type UpdateCustomizationChoicesApplicationErrors, type UpdateCustomizationChoicesOptions, type UpdateCustomizationChoicesRequest, type UpdateCustomizationChoicesResponse, type UpdateCustomizationChoicesValidationErrors, type UpdateCustomizationOptions, type UpdateCustomizationRequest, type UpdateCustomizationResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, addCustomizationChoices, bulkAddCustomizationChoices, bulkCreateCustomizations, bulkUpdateCustomizations, countCustomizations, createCustomization, deleteCustomization, getCustomization, onCustomizationCreated, onCustomizationDeleted, onCustomizationUpdated, queryCustomizations, removeCustomizationChoices, reorderCustomizationChoices, setCustomizationChoices, typedQueryCustomizations, updateCustomization, updateCustomizationChoices, utils };
2143
+ export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type AddCustomizationChoicesApplicationErrors, type AddCustomizationChoicesOptions, type AddCustomizationChoicesRequest, type AddCustomizationChoicesResponse, type AddCustomizationChoicesValidationErrors, type App, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkAddCustomizationChoicesApplicationErrors, type BulkAddCustomizationChoicesOptions, type BulkAddCustomizationChoicesRequest, type BulkAddCustomizationChoicesResponse, type BulkAddCustomizationChoicesValidationErrors, type BulkCreateCustomizationsApplicationErrors, type BulkCreateCustomizationsForMigrationRequest, type BulkCreateCustomizationsForMigrationResponse, type BulkCreateCustomizationsOptions, type BulkCreateCustomizationsRequest, type BulkCreateCustomizationsResponse, type BulkCreateCustomizationsValidationErrors, type BulkCustomizationResult, type BulkUpdateCustomizationsApplicationErrors, type BulkUpdateCustomizationsOptions, type BulkUpdateCustomizationsRequest, type BulkUpdateCustomizationsResponse, type CatalogRollbackRequested, type Choice, type ChoiceIdsMismatchData, ChoiceSortStrategy, type ChoiceSortStrategyWithLiterals, ChoiceType, type ChoiceTypeWithLiterals, type ChoiceValueOneOf, type ChoicesSettings, type CommonQueryWithEntityContext, type CountCustomizationsOptions, type CountCustomizationsRequest, type CountCustomizationsResponse, type CreateCustomizationApplicationErrors, type CreateCustomizationOptions, type CreateCustomizationRequest, type CreateCustomizationResponse, type CreateCustomizationValidationErrors, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type CustomTag, type Customization, type CustomizationChoices, type CustomizationCreatedEnvelope, type CustomizationCustomizationSettingsOneOf, type CustomizationDeletedEnvelope, type CustomizationIdsWrapper, type CustomizationQuery, type CustomizationQuerySpec, CustomizationRenderType, type CustomizationRenderTypeWithLiterals, CustomizationType, type CustomizationTypeSpecificSettingsOneOf, type CustomizationTypeWithLiterals, type CustomizationUpdatedEnvelope, type CustomizationsQueryBuilder, type CustomizationsQueryResult, type DeleteCustomizationRequest, type DeleteCustomizationResponse, type DeleteCustomizationValidationErrors, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type File, type FocalPoint, type FreeTextSettings, type GetCustomizationOptions, type GetCustomizationRequest, type GetCustomizationResponse, type IdentificationData, type IdentificationDataIdOneOf, type InvalidateCache, type InvalidateCacheGetByOneOf, type ItemMetadata, type MaskedChoice, type MaskedCustomization, type MessageEnvelope, type ModifierSettings, type MultipleColors, type Page, type Pages, type QueryCustomizationsOptions, type QueryCustomizationsRequest, type QueryCustomizationsResponse, type RecloneSiteRequest, type RecloneSiteResponse, type RemoveCustomizationChoicesApplicationErrors, type RemoveCustomizationChoicesOptions, type RemoveCustomizationChoicesRequest, type RemoveCustomizationChoicesResponse, type RemoveCustomizationChoicesValidationErrors, type ReorderCustomizationChoicesApplicationErrors, type ReorderCustomizationChoicesOptions, type ReorderCustomizationChoicesRequest, type ReorderCustomizationChoicesResponse, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, type SetCustomizationChoicesApplicationErrors, type SetCustomizationChoicesOptions, type SetCustomizationChoicesRequest, type SetCustomizationChoicesResponse, type SetCustomizationChoicesValidationErrors, SortOrder, type SortOrderWithLiterals, type Sorting, type URI, type URIs, type UpdateCustomization, type UpdateCustomizationApplicationErrors, type UpdateCustomizationChoicesApplicationErrors, type UpdateCustomizationChoicesOptions, type UpdateCustomizationChoicesRequest, type UpdateCustomizationChoicesResponse, type UpdateCustomizationChoicesValidationErrors, type UpdateCustomizationOptions, type UpdateCustomizationRequest, type UpdateCustomizationResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, addCustomizationChoices, bulkAddCustomizationChoices, bulkCreateCustomizations, bulkUpdateCustomizations, countCustomizations, createCustomization, deleteCustomization, getCustomization, onCustomizationCreated, onCustomizationDeleted, onCustomizationUpdated, queryCustomizations, removeCustomizationChoices, reorderCustomizationChoices, setCustomizationChoices, typedQueryCustomizations, updateCustomization, updateCustomizationChoices, utils };
@@ -789,10 +789,13 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
789
789
  WebhookIdentityType2["APP"] = "APP";
790
790
  return WebhookIdentityType2;
791
791
  })(WebhookIdentityType || {});
792
- async function createCustomization2(customization) {
793
- const { httpClient, sideEffects } = arguments[1];
792
+ async function createCustomization2(customization, options) {
793
+ const { httpClient, sideEffects } = arguments[2];
794
794
  const payload = (0, import_transform_paths2.transformPaths)(
795
- (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ customization }),
795
+ (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
796
+ customization,
797
+ fields: options?.fields
798
+ }),
796
799
  [
797
800
  {
798
801
  transformFn: import_image.transformSDKImageToRESTImage,
@@ -818,10 +821,13 @@ async function createCustomization2(customization) {
818
821
  err,
819
822
  {
820
823
  spreadPathsToArguments: {},
821
- explicitPathsToArguments: { customization: "$[0]" },
824
+ explicitPathsToArguments: {
825
+ customization: "$[0]",
826
+ fields: "$[1].fields"
827
+ },
822
828
  singleArgumentUnchanged: false
823
829
  },
824
- ["customization"]
830
+ ["customization", "options"]
825
831
  );
826
832
  sideEffects?.onError?.(err);
827
833
  throw transformedError;
@@ -1051,7 +1057,8 @@ async function bulkCreateCustomizations2(customizations, options) {
1051
1057
  const payload = (0, import_transform_paths2.transformPaths)(
1052
1058
  (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1053
1059
  customizations,
1054
- returnEntity: options?.returnEntity
1060
+ returnEntity: options?.returnEntity,
1061
+ fields: options?.fields
1055
1062
  }),
1056
1063
  [
1057
1064
  {
@@ -1080,7 +1087,8 @@ async function bulkCreateCustomizations2(customizations, options) {
1080
1087
  spreadPathsToArguments: {},
1081
1088
  explicitPathsToArguments: {
1082
1089
  customizations: "$[0]",
1083
- returnEntity: "$[1].returnEntity"
1090
+ returnEntity: "$[1].returnEntity",
1091
+ fields: "$[1].fields"
1084
1092
  },
1085
1093
  singleArgumentUnchanged: false
1086
1094
  },