@wix/auto_sdk_seatings_seating-plan 1.0.11 → 1.0.13

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,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  interface SeatingPlan {
2
4
  /**
3
5
  * Auto generated unique plan id
@@ -974,6 +976,20 @@ interface GetSeatingPlanThumbnailRequest {
974
976
  interface GetSeatingPlanThumbnailResponse {
975
977
  thumbnail?: SeatingPlanThumbnail;
976
978
  }
979
+ type CreateSeatingPlanApplicationErrors = {
980
+ code?: 'PLAN_MAX_CAPACITY_EXCEEDED';
981
+ description?: string;
982
+ data?: CapacityExceededViolation;
983
+ } | {
984
+ code?: 'ELEMENT_MAX_CAPACITY_EXCEEDED';
985
+ description?: string;
986
+ data?: CapacityExceededViolation;
987
+ };
988
+ type UpdateSeatingPlanApplicationErrors = {
989
+ code?: 'INVALID_FIELD_MASK';
990
+ description?: string;
991
+ data?: Record<string, any>;
992
+ };
977
993
  interface BaseEventMetadata {
978
994
  /**
979
995
  * App instance ID.
@@ -1022,20 +1038,100 @@ interface SeatingPlanCreatedEnvelope {
1022
1038
  entity: SeatingPlan;
1023
1039
  metadata: EventMetadata;
1024
1040
  }
1041
+ /** @permissionScope Manage Events
1042
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1043
+ * @permissionScope Manage Restaurants - all permissions
1044
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1045
+ * @permissionId SEATING_PLANS.READ_SEATING_PLANS
1046
+ * @webhook
1047
+ * @eventType wix.seating.v1.seating_plan_created
1048
+ * @slug created
1049
+ * @documentationMaturity preview
1050
+ */
1051
+ declare function onSeatingPlanCreated(handler: (event: SeatingPlanCreatedEnvelope) => void | Promise<void>): void;
1025
1052
  interface SeatingPlanDeletedEnvelope {
1026
1053
  entity: SeatingPlan;
1027
1054
  metadata: EventMetadata;
1028
1055
  }
1056
+ /** @permissionScope Manage Events
1057
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1058
+ * @permissionScope Manage Restaurants - all permissions
1059
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1060
+ * @permissionId SEATING_PLANS.READ_SEATING_PLANS
1061
+ * @webhook
1062
+ * @eventType wix.seating.v1.seating_plan_deleted
1063
+ * @slug deleted
1064
+ * @documentationMaturity preview
1065
+ */
1066
+ declare function onSeatingPlanDeleted(handler: (event: SeatingPlanDeletedEnvelope) => void | Promise<void>): void;
1029
1067
  interface SeatingPlanUpdatedEnvelope {
1030
1068
  entity: SeatingPlan;
1031
1069
  metadata: EventMetadata;
1032
1070
  }
1071
+ /** @permissionScope Manage Events
1072
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1073
+ * @permissionScope Manage Restaurants - all permissions
1074
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1075
+ * @permissionId SEATING_PLANS.READ_SEATING_PLANS
1076
+ * @webhook
1077
+ * @eventType wix.seating.v1.seating_plan_updated
1078
+ * @slug updated
1079
+ * @documentationMaturity preview
1080
+ */
1081
+ declare function onSeatingPlanUpdated(handler: (event: SeatingPlanUpdatedEnvelope) => void | Promise<void>): void;
1082
+ type SeatingPlanNonNullablePaths = `sections` | `sections.${number}._id` | `sections.${number}.default` | `categories` | `categories.${number}._id` | `categories.${number}.title` | `uncategorizedPlaces` | `uncategorizedPlaces.${number}.index` | `uncategorizedPlaces.${number}.label` | `uncategorizedPlaces.${number}.elementType` | `uncategorizedPlaces.${number}.type` | `elementGroups` | `elementGroups.${number}._id`;
1083
+ /**
1084
+ * Crates a seating plan
1085
+ * @param plan - A plan to be created
1086
+ * @public
1087
+ * @documentationMaturity preview
1088
+ * @requiredField plan
1089
+ * @requiredField plan.sections.elements.title
1090
+ * @requiredField plan.title
1091
+ * @permissionId SEATING_PLANS.MANAGE_SEATING_PLANS
1092
+ * @applicableIdentity APP
1093
+ * @returns The created plan
1094
+ * @fqn com.wixpress.seating.SeatingPlanManagement.CreateSeatingPlan
1095
+ */
1096
+ declare function createSeatingPlan(plan: NonNullablePaths<SeatingPlan, `sections.${number}.elements.${number}.title` | `title`>): Promise<NonNullablePaths<SeatingPlan, SeatingPlanNonNullablePaths> & {
1097
+ __applicationErrorsType?: CreateSeatingPlanApplicationErrors;
1098
+ }>;
1099
+ /**
1100
+ * Updates the seating plan
1101
+ * @public
1102
+ * @documentationMaturity preview
1103
+ * @requiredField options.plan._id
1104
+ * @requiredField options.plan.sections.elements.title
1105
+ * @permissionId SEATING_PLANS.MANAGE_SEATING_PLANS
1106
+ * @applicableIdentity APP
1107
+ * @returns The updated plan
1108
+ * @fqn com.wixpress.seating.SeatingPlanManagement.UpdateSeatingPlan
1109
+ */
1110
+ declare function updateSeatingPlan(options?: NonNullablePaths<UpdateSeatingPlanOptions, `plan._id` | `plan.sections.${number}.elements.${number}.title`>): Promise<NonNullablePaths<SeatingPlan, SeatingPlanNonNullablePaths> & {
1111
+ __applicationErrorsType?: UpdateSeatingPlanApplicationErrors;
1112
+ }>;
1033
1113
  interface UpdateSeatingPlanOptions {
1034
1114
  /** The plan updates */
1035
1115
  plan?: SeatingPlan;
1036
1116
  /** A set of field paths, specifying which parts of seating plan to update */
1037
1117
  fields?: string[];
1038
1118
  }
1119
+ /**
1120
+ * Copies the seating plan
1121
+ * @param _id - The id of the plan to be copied
1122
+ * @public
1123
+ * @documentationMaturity preview
1124
+ * @requiredField _id
1125
+ * @requiredField options
1126
+ * @requiredField options.externalId
1127
+ * @requiredField options.title
1128
+ * @permissionId SEATING_PLANS.MANAGE_SEATING_PLANS
1129
+ * @applicableIdentity APP
1130
+ * @fqn com.wixpress.seating.SeatingPlanManagement.CopySeatingPlan
1131
+ */
1132
+ declare function copySeatingPlan(_id: string, options: NonNullablePaths<CopySeatingPlanOptions, `externalId` | `title`>): Promise<NonNullablePaths<CopySeatingPlanResponse, {
1133
+ [P in SeatingPlanNonNullablePaths]: `plan.${P}`;
1134
+ }[SeatingPlanNonNullablePaths]>>;
1039
1135
  interface CopySeatingPlanOptions {
1040
1136
  /**
1041
1137
  * New plan title
@@ -1050,6 +1146,16 @@ interface CopySeatingPlanOptions {
1050
1146
  */
1051
1147
  externalId: string | null;
1052
1148
  }
1149
+ /**
1150
+ * Lists seating plans by provided query request
1151
+ * @public
1152
+ * @documentationMaturity preview
1153
+ * @permissionId SEATING_PLANS.READ_SEATING_PLANS
1154
+ * @applicableIdentity APP
1155
+ * @applicableIdentity VISITOR
1156
+ * @fqn com.wixpress.seating.SeatingPlanManagement.QuerySeatingPlan
1157
+ */
1158
+ declare function querySeatingPlan(options?: QuerySeatingPlanOptions): PlansQueryBuilder;
1053
1159
  interface QuerySeatingPlanOptions {
1054
1160
  /** A fieldset for the response */
1055
1161
  fieldset?: FieldsetWithLiterals[] | undefined;
@@ -1079,6 +1185,19 @@ interface PlansQueryBuilder {
1079
1185
  /** @documentationMaturity preview */
1080
1186
  find: () => Promise<PlansQueryResult>;
1081
1187
  }
1188
+ /**
1189
+ * Returns the seating plan. Fails of not fond.
1190
+ * @param _id - The id of the plan
1191
+ * @public
1192
+ * @documentationMaturity preview
1193
+ * @requiredField _id
1194
+ * @permissionId SEATING_PLANS.READ_SEATING_PLANS
1195
+ * @applicableIdentity APP
1196
+ * @applicableIdentity VISITOR
1197
+ * @returns The plan
1198
+ * @fqn com.wixpress.seating.SeatingPlanManagement.GetSeatingPlan
1199
+ */
1200
+ declare function getSeatingPlan(_id: string, options?: GetSeatingPlanOptions): Promise<NonNullablePaths<SeatingPlan, SeatingPlanNonNullablePaths>>;
1082
1201
  interface GetSeatingPlanOptions {
1083
1202
  /**
1084
1203
  * A fieldset for the response
@@ -1093,6 +1212,20 @@ interface GetSeatingPlanOptions {
1093
1212
  /** Seating Plan Mask */
1094
1213
  seatingPlanMask?: SeatingPlanMask;
1095
1214
  }
1215
+ /**
1216
+ * Returns the first seating plan found by filter request.
1217
+ * @param filter - The filter of the plan
1218
+ * @public
1219
+ * @documentationMaturity preview
1220
+ * @requiredField filter
1221
+ * @permissionId SEATING_PLANS.READ_SEATING_PLANS
1222
+ * @applicableIdentity APP
1223
+ * @applicableIdentity VISITOR
1224
+ * @fqn com.wixpress.seating.SeatingPlanManagement.FindSeatingPlan
1225
+ */
1226
+ declare function findSeatingPlan(filter: Record<string, any>, options?: FindSeatingPlanOptions): Promise<NonNullablePaths<FindSeatingPlanResponse, {
1227
+ [P in SeatingPlanNonNullablePaths]: `plan.${P}`;
1228
+ }[SeatingPlanNonNullablePaths]>>;
1096
1229
  interface FindSeatingPlanOptions {
1097
1230
  /**
1098
1231
  * A fieldset for the response
@@ -1107,5 +1240,40 @@ interface FindSeatingPlanOptions {
1107
1240
  /** Seating Plan Mask */
1108
1241
  seatingPlanMask?: SeatingPlanMask;
1109
1242
  }
1243
+ /**
1244
+ * Deletes the seating plan.
1245
+ * @param _id - The id of the plan
1246
+ * @public
1247
+ * @documentationMaturity preview
1248
+ * @requiredField _id
1249
+ * @permissionId SEATING_PLANS.MANAGE_SEATING_PLANS
1250
+ * @applicableIdentity APP
1251
+ * @fqn com.wixpress.seating.SeatingPlanManagement.DeleteSeatingPlan
1252
+ */
1253
+ declare function deleteSeatingPlan(_id: string): Promise<NonNullablePaths<DeleteSeatingPlanResponse, {
1254
+ [P in SeatingPlanNonNullablePaths]: `plan.${P}`;
1255
+ }[SeatingPlanNonNullablePaths]>>;
1256
+ /**
1257
+ * Updates seating plan thumbnail.
1258
+ * @public
1259
+ * @documentationMaturity preview
1260
+ * @requiredField thumbnail
1261
+ * @requiredField thumbnail._id
1262
+ * @requiredField thumbnail.img
1263
+ * @permissionId SEATING_PLANS.MANAGE_SEATING_PLANS
1264
+ * @applicableIdentity APP
1265
+ * @fqn com.wixpress.seating.SeatingPlanThumbnailService.UpdateSeatingPlanThumbnail
1266
+ */
1267
+ declare function updateSeatingPlanThumbnail(thumbnail: NonNullablePaths<SeatingPlanThumbnail, `_id` | `img`>): Promise<UpdateSeatingPlanThumbnailResponse>;
1268
+ /**
1269
+ * Get seating plan thumbnail.
1270
+ * @public
1271
+ * @documentationMaturity preview
1272
+ * @requiredField _id
1273
+ * @permissionId SEATING_PLANS.MANAGE_SEATING_PLANS
1274
+ * @applicableIdentity APP
1275
+ * @fqn com.wixpress.seating.SeatingPlanThumbnailService.GetSeatingPlanThumbnail
1276
+ */
1277
+ declare function getSeatingPlanThumbnail(_id: string): Promise<GetSeatingPlanThumbnailResponse>;
1110
1278
 
1111
- export { type QuerySeatingPlanResponse as $, type CreateSeatingPlanResponse as A, type CapacityExceededViolation as B, type CopySeatingPlanOptions as C, type DeleteSeatingPlanResponse as D, type Element as E, type FindSeatingPlanOptions as F, type GetSeatingPlanOptions as G, type UpdateSeatingPlanRequest as H, Icon as I, type UpdateSeatingPlanResponse as J, type CopySeatingPlanRequest as K, type QuerySeatingPlanRequest as L, type MultiRowProperties as M, Numbering as N, type QueryV2 as O, type PlansQueryBuilder as P, type QuerySeatingPlanOptions as Q, type ReservationOptions as R, type SeatingPlan as S, Type as T, type UpdateSeatingPlanOptions as U, type VerticalSequencing as V, WebhookIdentityType as W, type QueryV2PagingMethodOneOf as X, type Sorting as Y, type Paging as Z, type CursorPaging as _, type CopySeatingPlanResponse as a, type GetSeatingPlanRequest as a0, type SeatingPlanMask as a1, type GetSeatingPlanResponse as a2, type FindSeatingPlanRequest as a3, type DeleteSeatingPlanRequest as a4, type DomainEvent as a5, type DomainEventBodyOneOf as a6, type EntityCreatedEvent as a7, type RestoreInfo as a8, type EntityUpdatedEvent as a9, type EntityDeletedEvent as aa, type ActionEvent as ab, type MessageEnvelope as ac, type IdentificationData as ad, type IdentificationDataIdOneOf as ae, type SaveSeatingPlanVersionRequest as af, type SaveSeatingPlanVersionResponse as ag, type QuerySeatingPlanVersionsRequest as ah, type QuerySeatingPlanVersionsResponse as ai, type PagingMetadataV2 as aj, type Cursors as ak, type DiscardSeatingPlanVersionsRequest as al, type DiscardSeatingPlanVersionsResponse as am, type RestoreSeatingPlanRequest as an, type RestoreSeatingPlanResponse as ao, type UpdateSeatingPlanThumbnailRequest as ap, type GetSeatingPlanThumbnailRequest as aq, type BaseEventMetadata as ar, type EventMetadata as as, type PlansQueryResult as at, type FindSeatingPlanResponse as b, type SeatingPlanThumbnail as c, type UpdateSeatingPlanThumbnailResponse as d, type GetSeatingPlanThumbnailResponse as e, type SeatingPlanCreatedEnvelope as f, type SeatingPlanDeletedEnvelope as g, type SeatingPlanUpdatedEnvelope as h, PlaceTypeEnumType as i, ShapeTypeEnumType as j, Position as k, SortOrder as l, Fieldset as m, type Section as n, type Sequencing as o, type Place as p, type ElementUiProperties as q, type Image as r, type RowElement as s, type RowElementUiProperties as t, type Category as u, type ExtendedFields as v, type SeatingPlanUiProperties as w, type ElementGroup as x, type ElementGroupUiProperties as y, type CreateSeatingPlanRequest as z };
1279
+ export { type ActionEvent, type BaseEventMetadata, type CapacityExceededViolation, type Category, type CopySeatingPlanOptions, type CopySeatingPlanRequest, type CopySeatingPlanResponse, type CreateSeatingPlanApplicationErrors, type CreateSeatingPlanRequest, type CreateSeatingPlanResponse, type CursorPaging, type Cursors, type DeleteSeatingPlanRequest, type DeleteSeatingPlanResponse, type DiscardSeatingPlanVersionsRequest, type DiscardSeatingPlanVersionsResponse, type DomainEvent, type DomainEventBodyOneOf, type Element, type ElementGroup, type ElementGroupUiProperties, type ElementUiProperties, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, Fieldset, type FieldsetWithLiterals, type FindSeatingPlanOptions, type FindSeatingPlanRequest, type FindSeatingPlanResponse, type GetSeatingPlanOptions, type GetSeatingPlanRequest, type GetSeatingPlanResponse, type GetSeatingPlanThumbnailRequest, type GetSeatingPlanThumbnailResponse, Icon, type IconWithLiterals, type IdentificationData, type IdentificationDataIdOneOf, type Image, type MessageEnvelope, type MultiRowProperties, Numbering, type NumberingWithLiterals, type Paging, type PagingMetadataV2, type Place, PlaceTypeEnumType, type PlaceTypeEnumTypeWithLiterals, type PlansQueryBuilder, type PlansQueryResult, Position, type PositionWithLiterals, type QuerySeatingPlanOptions, type QuerySeatingPlanRequest, type QuerySeatingPlanResponse, type QuerySeatingPlanVersionsRequest, type QuerySeatingPlanVersionsResponse, type QueryV2, type QueryV2PagingMethodOneOf, type ReservationOptions, type RestoreInfo, type RestoreSeatingPlanRequest, type RestoreSeatingPlanResponse, type RowElement, type RowElementUiProperties, type SaveSeatingPlanVersionRequest, type SaveSeatingPlanVersionResponse, type SeatingPlan, type SeatingPlanCreatedEnvelope, type SeatingPlanDeletedEnvelope, type SeatingPlanMask, type SeatingPlanThumbnail, type SeatingPlanUiProperties, type SeatingPlanUpdatedEnvelope, type Section, type Sequencing, ShapeTypeEnumType, type ShapeTypeEnumTypeWithLiterals, SortOrder, type SortOrderWithLiterals, type Sorting, Type, type TypeWithLiterals, type UpdateSeatingPlanApplicationErrors, type UpdateSeatingPlanOptions, type UpdateSeatingPlanRequest, type UpdateSeatingPlanResponse, type UpdateSeatingPlanThumbnailRequest, type UpdateSeatingPlanThumbnailResponse, type VerticalSequencing, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, copySeatingPlan, createSeatingPlan, deleteSeatingPlan, findSeatingPlan, getSeatingPlan, getSeatingPlanThumbnail, onSeatingPlanCreated, onSeatingPlanDeleted, onSeatingPlanUpdated, querySeatingPlan, updateSeatingPlan, updateSeatingPlanThumbnail };