@wix/auto_sdk_restaurants_sections 1.0.28 → 1.0.29

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.
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { D as DuplicateSectionOptions, a as DuplicateSectionResponse, S as Section, B as BulkCreateSectionsOptions, b as BulkCreateSectionsResponse, L as ListSectionsOptions, c as ListSectionsResponse, d as SectionsQueryBuilder, U as UpdateSection, M as MaskedSection, e as BulkUpdateSectionOptions, f as BulkUpdateSectionResponse, g as BulkDeleteSectionsResponse, h as SectionCreatedEnvelope, i as SectionDeletedEnvelope, j as SectionUpdatedEnvelope } from './restaurants-menus-v1-section-sections.universal-DQ9fychQ.js';
3
- export { a8 as ActionEvent, A as App, u as ApplicationError, ag as BaseEventMetadata, v as BulkActionMetadata, s as BulkCreateSectionResult, r as BulkCreateSectionsRequest, $ as BulkDeleteSectionResult, _ as BulkDeleteSectionsRequest, ac as BulkItemResult, X as BulkSectionResult, aa as BulkUpdateBusinessLocationIdRequest, ab as BulkUpdateBusinessLocationIdResponse, V as BulkUpdateSectionRequest, a0 as CloneSectionsRequest, a1 as CloneSectionsResponse, p as CreateSectionRequest, q as CreateSectionResponse, y as CursorPaging, z as CursorPagingMetadata, J as CursorQuery, K as CursorQueryPagingMethodOneOf, H as Cursors, C as CustomTag, o as DeleteLocationIdFromItems, Y as DeleteSectionRequest, Z as DeleteSectionResponse, a2 as DomainEvent, a3 as DomainEventBodyOneOf, l as DuplicateSectionRequest, a9 as Empty, a4 as EntityCreatedEvent, a7 as EntityDeletedEvent, a6 as EntityUpdatedEvent, ah as EventMetadata, E as ExtendedFields, F as File, G as GetSectionRequest, w as GetSectionResponse, ae as IdentificationData, af as IdentificationDataIdOneOf, I as InvalidateCache, m as InvalidateCacheGetByOneOf, t as ItemMetadata, x as ListSectionsRequest, ad as MessageEnvelope, P as Page, Q as QuerySectionsRequest, O as QuerySectionsResponse, a5 as RestoreInfo, ai as SectionsQueryResult, k as SortOrder, N as Sorting, n as URI, R as UpdateSectionRequest, T as UpdateSectionResponse, W as WebhookIdentityType } from './restaurants-menus-v1-section-sections.universal-DQ9fychQ.js';
2
+ import { DuplicateSectionOptions, DuplicateSectionResponse, Section, BulkCreateSectionsOptions, BulkCreateSectionsResponse, ListSectionsOptions, ListSectionsResponse, SectionsQueryBuilder, UpdateSection, MaskedSection, BulkUpdateSectionOptions, BulkUpdateSectionResponse, BulkDeleteSectionsResponse, SectionCreatedEnvelope, SectionDeletedEnvelope, SectionUpdatedEnvelope } from './index.typings.js';
3
+ export { ActionEvent, App, ApplicationError, BaseEventMetadata, BulkActionMetadata, BulkCreateSectionResult, BulkCreateSectionsRequest, BulkDeleteSectionResult, BulkDeleteSectionsRequest, BulkItemResult, BulkSectionResult, BulkUpdateBusinessLocationIdRequest, BulkUpdateBusinessLocationIdResponse, BulkUpdateSectionRequest, CloneSectionsRequest, CloneSectionsResponse, CreateSectionRequest, CreateSectionResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, CustomTag, DeleteLocationIdFromItems, DeleteSectionRequest, DeleteSectionResponse, DomainEvent, DomainEventBodyOneOf, DuplicateSectionRequest, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, File, GetSectionRequest, GetSectionResponse, IdentificationData, IdentificationDataIdOneOf, InvalidateCache, InvalidateCacheGetByOneOf, ItemMetadata, ListSectionsRequest, MessageEnvelope, Page, QuerySectionsRequest, QuerySectionsResponse, RestoreInfo, SectionsQueryResult, SortOrder, Sorting, URI, UpdateSectionRequest, UpdateSectionResponse, WebhookIdentityType } from './index.typings.js';
4
4
 
5
5
  declare function duplicateSection$1(httpClient: HttpClient): DuplicateSectionSignature;
6
6
  interface DuplicateSectionSignature {
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  interface Section {
2
4
  /**
3
5
  * Section ID.
@@ -659,13 +661,55 @@ interface SectionCreatedEnvelope {
659
661
  entity: Section;
660
662
  metadata: EventMetadata;
661
663
  }
664
+ /** @permissionScope Manage Restaurants - all permissions
665
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
666
+ * @permissionId RESTAURANTS.SECTION_READ
667
+ * @webhook
668
+ * @eventType wix.restaurants.menus.v1.section_created
669
+ * @serviceIdentifier com.wixpress.restaurants.menus_section.v1.RestaurantsMenusSection
670
+ * @slug created
671
+ * @documentationMaturity preview
672
+ */
673
+ declare function onSectionCreated(handler: (event: SectionCreatedEnvelope) => void | Promise<void>): void;
662
674
  interface SectionDeletedEnvelope {
663
675
  metadata: EventMetadata;
664
676
  }
677
+ /** @permissionScope Manage Restaurants - all permissions
678
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
679
+ * @permissionId RESTAURANTS.SECTION_READ
680
+ * @webhook
681
+ * @eventType wix.restaurants.menus.v1.section_deleted
682
+ * @serviceIdentifier com.wixpress.restaurants.menus_section.v1.RestaurantsMenusSection
683
+ * @slug deleted
684
+ * @documentationMaturity preview
685
+ */
686
+ declare function onSectionDeleted(handler: (event: SectionDeletedEnvelope) => void | Promise<void>): void;
665
687
  interface SectionUpdatedEnvelope {
666
688
  entity: Section;
667
689
  metadata: EventMetadata;
668
690
  }
691
+ /**
692
+ * Triggered when a section is updated.
693
+ * @permissionScope Manage Restaurants - all permissions
694
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
695
+ * @permissionId RESTAURANTS.SECTION_READ
696
+ * @webhook
697
+ * @eventType wix.restaurants.menus.v1.section_updated
698
+ * @serviceIdentifier com.wixpress.restaurants.menus_section.v1.RestaurantsMenusSection
699
+ * @slug updated
700
+ * @documentationMaturity preview
701
+ */
702
+ declare function onSectionUpdated(handler: (event: SectionUpdatedEnvelope) => void | Promise<void>): void;
703
+ type SectionNonNullablePaths = `name` | `additionalImages` | `itemIds`;
704
+ /** @param _id - Section id to be duplicated.
705
+ * @public
706
+ * @documentationMaturity preview
707
+ * @requiredField _id
708
+ * @permissionId RESTAURANTS.SECTION_CREATE
709
+ * @applicableIdentity APP
710
+ * @fqn com.wixpress.restaurants.menus_section.v1.restaurants_duplicate_section.RestaurantsDuplicateSection.DuplicateSection
711
+ */
712
+ declare function duplicateSection(_id: string, options?: DuplicateSectionOptions): Promise<NonNullablePaths<DuplicateSectionResponse, `sectionId`>>;
669
713
  interface DuplicateSectionOptions {
670
714
  /**
671
715
  * Business location ids to duplicate the section to.
@@ -676,10 +720,70 @@ interface DuplicateSectionOptions {
676
720
  /** Indicates whether sub-entities (such as items) should be duplicated as well. */
677
721
  duplicateSubEntities?: boolean | null;
678
722
  }
723
+ /**
724
+ * > **Note:** The Sections API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new).
725
+ *
726
+ * Creates a section.
727
+ *
728
+ * To create multiple sections at once, use [Bulk Create Sections](/sections/bulk-create-sections).
729
+ * @param section - Section details.
730
+ * @public
731
+ * @documentationMaturity preview
732
+ * @requiredField section
733
+ * @permissionId RESTAURANTS.SECTION_CREATE
734
+ * @applicableIdentity APP
735
+ * @returns Section.
736
+ * @fqn com.wixpress.restaurants.menus_section.v1.RestaurantsMenusSection.CreateSection
737
+ */
738
+ declare function createSection(section: Section): Promise<NonNullablePaths<Section, SectionNonNullablePaths>>;
739
+ /**
740
+ * > **Note:** The Section API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new).
741
+ *
742
+ * Creates multiple sections at once.
743
+ * @param sections - Sections details.
744
+ * @public
745
+ * @documentationMaturity preview
746
+ * @requiredField sections
747
+ * @permissionId RESTAURANTS.SECTION_CREATE
748
+ * @applicableIdentity APP
749
+ * @fqn com.wixpress.restaurants.menus_section.v1.RestaurantsMenusSection.BulkCreateSections
750
+ */
751
+ declare function bulkCreateSections(sections: Section[], options?: BulkCreateSectionsOptions): Promise<NonNullablePaths<BulkCreateSectionsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | {
752
+ [P in SectionNonNullablePaths]: `results.${number}.item.${P}`;
753
+ }[SectionNonNullablePaths] | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`>>;
679
754
  interface BulkCreateSectionsOptions {
680
755
  /** Whether to receive the created sections in the response. */
681
756
  returnEntity?: boolean;
682
757
  }
758
+ /**
759
+ * > **Note:** The Section API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new).
760
+ *
761
+ * Retrieves a section by ID.
762
+ * @param sectionId - Section ID.
763
+ * @public
764
+ * @documentationMaturity preview
765
+ * @requiredField sectionId
766
+ * @permissionId RESTAURANTS.SECTION_READ
767
+ * @applicableIdentity APP
768
+ * @applicableIdentity VISITOR
769
+ * @returns Section.
770
+ * @fqn com.wixpress.restaurants.menus_section.v1.RestaurantsMenusSection.GetSection
771
+ */
772
+ declare function getSection(sectionId: string): Promise<NonNullablePaths<Section, SectionNonNullablePaths>>;
773
+ /**
774
+ * > **Note:** The Section API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new).
775
+ *
776
+ * Retrieves a list of up to 500 sections.
777
+ * @public
778
+ * @documentationMaturity preview
779
+ * @permissionId RESTAURANTS.SECTION_READ
780
+ * @applicableIdentity APP
781
+ * @applicableIdentity VISITOR
782
+ * @fqn com.wixpress.restaurants.menus_section.v1.RestaurantsMenusSection.ListSections
783
+ */
784
+ declare function listSections(options?: ListSectionsOptions): Promise<NonNullablePaths<ListSectionsResponse, {
785
+ [P in SectionNonNullablePaths]: `sections.${number}.${P}`;
786
+ }[SectionNonNullablePaths]>>;
683
787
  interface ListSectionsOptions {
684
788
  /**
685
789
  * Section IDs.
@@ -692,6 +796,28 @@ interface ListSectionsOptions {
692
796
  /** Whether to return only sections that are visible to site visitors. */
693
797
  onlyVisible?: boolean | null;
694
798
  }
799
+ /**
800
+ * Creates a query to retrieve a list of sections.
801
+ *
802
+ * The `querySections()` function builds a query to retrieve a list of sections and returns a `SectionsQueryBuilder` object.
803
+ *
804
+ * The returned object contains the query definition, which is used to run the query using the [`find()`](/sections/sections-query-builder/find) function.
805
+ *
806
+ * You can refine the query by chaining `SectionsQueryBuilder` functions onto the query. `SectionsQueryBuilder` functions enable you to filter, sort, and control the results that `querySections()` returns.
807
+ *
808
+ * `querySections()` runs with the following `SectionsQueryBuilder` defaults, which you can override:
809
+ *
810
+ * * [`limit(100)`](/sections/sections-query-builder/limit)
811
+ *
812
+ * The following `SectionsQueryBuilder` functions are supported for `querySections()`. For a full description of the section object, see the object returned for the [`items`](/sections/sections-query-result/items) property in `SectionsQueryResult`.
813
+ * @public
814
+ * @documentationMaturity preview
815
+ * @permissionId RESTAURANTS.SECTION_READ
816
+ * @applicableIdentity APP
817
+ * @applicableIdentity VISITOR
818
+ * @fqn com.wixpress.restaurants.menus_section.v1.RestaurantsMenusSection.QuerySections
819
+ */
820
+ declare function querySections(): SectionsQueryBuilder;
695
821
  interface QueryCursorResult {
696
822
  cursors: Cursors;
697
823
  hasNext: () => boolean;
@@ -761,6 +887,24 @@ interface SectionsQueryBuilder {
761
887
  /** @documentationMaturity preview */
762
888
  find: () => Promise<SectionsQueryResult>;
763
889
  }
890
+ /**
891
+ * > **Note:** The Section API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new).
892
+ *
893
+ * Updates a section.
894
+ *
895
+ * Each time a section is updated, its revision increments by 1. The existing revision must be included when updating a section. This ensures you're working with the latest section information, and it prevents unintended overwrites.
896
+ * @param _id - Section ID.
897
+ * @public
898
+ * @documentationMaturity preview
899
+ * @requiredField _id
900
+ * @requiredField section
901
+ * @requiredField section.revision
902
+ * @permissionId RESTAURANTS.SECTION_UPDATE
903
+ * @applicableIdentity APP
904
+ * @returns Updated section.
905
+ * @fqn com.wixpress.restaurants.menus_section.v1.RestaurantsMenusSection.UpdateSection
906
+ */
907
+ declare function updateSection(_id: string, section: NonNullablePaths<UpdateSection, `revision`>): Promise<NonNullablePaths<Section, SectionNonNullablePaths>>;
764
908
  interface UpdateSection {
765
909
  /**
766
910
  * Section ID.
@@ -818,9 +962,54 @@ interface UpdateSection {
818
962
  */
819
963
  businessLocationId?: string | null;
820
964
  }
965
+ /**
966
+ * > **Note:** The Section API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new).
967
+ *
968
+ * Updates multiple sections at once.
969
+ *
970
+ * Each time a section is updated, its revision increments by 1. The existing revision must be included when updating a section. This ensures you're working with the latest section information, and it prevents unintended overwrites.
971
+ * @param sections - Sections to update.
972
+ * @public
973
+ * @documentationMaturity preview
974
+ * @requiredField sections
975
+ * @requiredField sections.section._id
976
+ * @requiredField sections.section.revision
977
+ * @permissionId RESTAURANTS.SECTION_UPDATE
978
+ * @applicableIdentity APP
979
+ * @fqn com.wixpress.restaurants.menus_section.v1.RestaurantsMenusSection.BulkUpdateSection
980
+ */
981
+ declare function bulkUpdateSection(sections: NonNullablePaths<MaskedSection, `section._id` | `section.revision`>[], options?: BulkUpdateSectionOptions): Promise<NonNullablePaths<BulkUpdateSectionResponse, `results` | `results.${number}.sectionMetadata.originalIndex` | `results.${number}.sectionMetadata.success` | `results.${number}.sectionMetadata.error.code` | `results.${number}.sectionMetadata.error.description` | {
982
+ [P in SectionNonNullablePaths]: `results.${number}.section.${P}`;
983
+ }[SectionNonNullablePaths] | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`>>;
821
984
  interface BulkUpdateSectionOptions {
822
985
  /** Whether to receive the updated sections in the response. */
823
986
  returnEntity?: boolean;
824
987
  }
988
+ /**
989
+ * > **Note:** The Section API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new).
990
+ *
991
+ * Deletes a section.
992
+ * @param sectionId - Section ID.
993
+ * @public
994
+ * @documentationMaturity preview
995
+ * @requiredField sectionId
996
+ * @permissionId RESTAURANTS.SECTION_DELETE
997
+ * @applicableIdentity APP
998
+ * @fqn com.wixpress.restaurants.menus_section.v1.RestaurantsMenusSection.DeleteSection
999
+ */
1000
+ declare function deleteSection(sectionId: string): Promise<void>;
1001
+ /**
1002
+ * > **Note:** The Section API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the [Wix App Market](https://www.wix.com/app-market/wix-restaurants-menus-new).
1003
+ *
1004
+ * Deletes multiple sections at once.
1005
+ * @param ids - Section IDs.
1006
+ * @public
1007
+ * @documentationMaturity preview
1008
+ * @requiredField ids
1009
+ * @permissionId RESTAURANTS.SECTION_DELETE
1010
+ * @applicableIdentity APP
1011
+ * @fqn com.wixpress.restaurants.menus_section.v1.RestaurantsMenusSection.BulkDeleteSections
1012
+ */
1013
+ declare function bulkDeleteSections(ids: string[]): Promise<NonNullablePaths<BulkDeleteSectionsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`>>;
825
1014
 
826
- export { type BulkDeleteSectionResult as $, type App as A, type BulkCreateSectionsOptions as B, type CustomTag as C, type DuplicateSectionOptions as D, type ExtendedFields as E, type File as F, type GetSectionRequest as G, type Cursors as H, type InvalidateCache as I, type CursorQuery as J, type CursorQueryPagingMethodOneOf as K, type ListSectionsOptions as L, type MaskedSection as M, type Sorting as N, type QuerySectionsResponse as O, type Page as P, type QuerySectionsRequest as Q, type UpdateSectionRequest as R, type Section as S, type UpdateSectionResponse as T, type UpdateSection as U, type BulkUpdateSectionRequest as V, WebhookIdentityType as W, type BulkSectionResult as X, type DeleteSectionRequest as Y, type DeleteSectionResponse as Z, type BulkDeleteSectionsRequest as _, type DuplicateSectionResponse as a, type CloneSectionsRequest as a0, type CloneSectionsResponse as a1, type DomainEvent as a2, type DomainEventBodyOneOf as a3, type EntityCreatedEvent as a4, type RestoreInfo as a5, type EntityUpdatedEvent as a6, type EntityDeletedEvent as a7, type ActionEvent as a8, type Empty as a9, type BulkUpdateBusinessLocationIdRequest as aa, type BulkUpdateBusinessLocationIdResponse as ab, type BulkItemResult as ac, type MessageEnvelope as ad, type IdentificationData as ae, type IdentificationDataIdOneOf as af, type BaseEventMetadata as ag, type EventMetadata as ah, type SectionsQueryResult as ai, type BulkCreateSectionsResponse as b, type ListSectionsResponse as c, type SectionsQueryBuilder as d, type BulkUpdateSectionOptions as e, type BulkUpdateSectionResponse as f, type BulkDeleteSectionsResponse as g, type SectionCreatedEnvelope as h, type SectionDeletedEnvelope as i, type SectionUpdatedEnvelope as j, SortOrder as k, type DuplicateSectionRequest as l, type InvalidateCacheGetByOneOf as m, type URI as n, type DeleteLocationIdFromItems as o, type CreateSectionRequest as p, type CreateSectionResponse as q, type BulkCreateSectionsRequest as r, type BulkCreateSectionResult as s, type ItemMetadata as t, type ApplicationError as u, type BulkActionMetadata as v, type GetSectionResponse as w, type ListSectionsRequest as x, type CursorPaging as y, type CursorPagingMetadata as z };
1015
+ export { type ActionEvent, type App, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkCreateSectionResult, type BulkCreateSectionsOptions, type BulkCreateSectionsRequest, type BulkCreateSectionsResponse, type BulkDeleteSectionResult, type BulkDeleteSectionsRequest, type BulkDeleteSectionsResponse, type BulkItemResult, type BulkSectionResult, type BulkUpdateBusinessLocationIdRequest, type BulkUpdateBusinessLocationIdResponse, type BulkUpdateSectionOptions, type BulkUpdateSectionRequest, type BulkUpdateSectionResponse, type CloneSectionsRequest, type CloneSectionsResponse, type CreateSectionRequest, type CreateSectionResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type CustomTag, type DeleteLocationIdFromItems, type DeleteSectionRequest, type DeleteSectionResponse, type DomainEvent, type DomainEventBodyOneOf, type DuplicateSectionOptions, type DuplicateSectionRequest, type DuplicateSectionResponse, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type File, type GetSectionRequest, type GetSectionResponse, type IdentificationData, type IdentificationDataIdOneOf, type InvalidateCache, type InvalidateCacheGetByOneOf, type ItemMetadata, type ListSectionsOptions, type ListSectionsRequest, type ListSectionsResponse, type MaskedSection, type MessageEnvelope, type Page, type QuerySectionsRequest, type QuerySectionsResponse, type RestoreInfo, type Section, type SectionCreatedEnvelope, type SectionDeletedEnvelope, type SectionUpdatedEnvelope, type SectionsQueryBuilder, type SectionsQueryResult, SortOrder, type SortOrderWithLiterals, type Sorting, type URI, type UpdateSection, type UpdateSectionRequest, type UpdateSectionResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCreateSections, bulkDeleteSections, bulkUpdateSection, createSection, deleteSection, duplicateSection, getSection, listSections, onSectionCreated, onSectionDeleted, onSectionUpdated, querySections, updateSection };