@wix/auto_sdk_online-programs_sections 1.0.32 → 1.0.34

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,18 +1,18 @@
1
- import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { Section, CreateSectionOptions, BulkCreateSectionsOptions, BulkCreateSectionsResponse, GetSectionOptions, UpdateSectionOptions, ListSectionsOptions, ListSectionsResponse, CloneSectionOptions, CloneSectionResponse, MoveSectionOptions, MoveSectionResponse, SectionQuery, QuerySectionsOptions, typedQuerySections, SectionsQueryBuilder } from './index.typings.js';
3
- export { AccountInfo, ActionEvent, AddressLocation, ApplicationError, BulkActionMetadata, BulkActionType, BulkActionTypeWithLiterals, BulkCloneSectionRequest, BulkCloneSectionResponse, BulkCreateSectionRequest, BulkCreateSectionResponse, BulkCreateSectionsRequest, BulkSectionResult, CloneSectionRequest, CommonQueryWithEntityContext, CreateSectionRequest, CreateSectionResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteAllProgramSectionsRequest, DeleteAllProgramSectionsResponse, DeleteByFilterOperation, DeleteByIdsOperation, DeleteSectionRequest, DeleteSectionResponse, Description, DescriptionFieldSet, DescriptionFieldSetWithLiterals, DocumentImage, DocumentPayload, DocumentUpdateOperation, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, Enum, EnumWithLiterals, ExtendedFields, GetSectionRequest, GetSectionResponse, IdentificationData, IdentificationDataIdOneOf, IndexDocument, ItemMetadata, ListSectionsRequest, MessageEnvelope, MoveSectionRequest, QuerySectionsRequest, QuerySectionsResponse, RequestedFields, RequestedFieldsWithLiterals, RestoreInfo, RestoreSectionFromTrashRequest, RestoreSectionFromTrashResponse, SearchIndexingNotification, SearchIndexingNotificationState, SearchIndexingNotificationStateWithLiterals, SectionCloned, SectionDeleted, SectionMoved, SectionQuerySpec, SectionUpdated, SectionsQueryResult, SortOrder, SortOrderWithLiterals, Sorting, State, StateWithLiterals, UpdateByFilterOperation, UpdateDocumentsEvent, UpdateDocumentsEventOperationOneOf, UpdateExistingOperation, UpdateSectionRequest, UpdateSectionResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.js';
1
+ import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
+ import { Section, CreateSectionOptions, BulkCreateSectionsOptions, BulkCreateSectionsResponse, GetSectionOptions, UpdateSectionOptions, ListSectionsOptions, ListSectionsResponse, CloneSectionOptions, CloneSectionResponse, MoveSectionOptions, MoveSectionResponse, SectionClonedEnvelope, SectionCreatedEnvelope, SectionDeletedEnvelope, SectionUpdatedEnvelope, SectionQuery, QuerySectionsOptions, typedQuerySections, SectionsQueryBuilder } from './index.typings.js';
3
+ export { AccountInfo, AccountInfoMetadata, ActionEvent, AddressLocation, ApplicationError, BaseEventMetadata, BulkActionMetadata, BulkActionType, BulkActionTypeWithLiterals, BulkCloneSectionRequest, BulkCloneSectionResponse, BulkCreateSectionRequest, BulkCreateSectionResponse, BulkCreateSectionsRequest, BulkSectionResult, CloneSectionRequest, CommonQueryWithEntityContext, CreateSectionRequest, CreateSectionResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteAllProgramSectionsRequest, DeleteAllProgramSectionsResponse, DeleteByFilterOperation, DeleteByIdsOperation, DeleteSectionRequest, DeleteSectionResponse, Description, DescriptionFieldSet, DescriptionFieldSetWithLiterals, DocumentImage, DocumentPayload, DocumentUpdateOperation, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, Enum, EnumWithLiterals, EventMetadata, ExtendedFields, GetSectionRequest, GetSectionResponse, IdentificationData, IdentificationDataIdOneOf, IndexDocument, ItemMetadata, ListSectionsRequest, MessageEnvelope, MoveSectionRequest, QuerySectionsRequest, QuerySectionsResponse, RequestedFields, RequestedFieldsWithLiterals, RestoreInfo, RestoreSectionFromTrashRequest, RestoreSectionFromTrashResponse, SearchIndexingNotification, SearchIndexingNotificationState, SearchIndexingNotificationStateWithLiterals, SectionCloned, SectionDeleted, SectionMoved, SectionQuerySpec, SectionUpdated, SectionsQueryResult, SortOrder, SortOrderWithLiterals, Sorting, State, StateWithLiterals, UpdateByFilterOperation, UpdateDocumentsEvent, UpdateDocumentsEventOperationOneOf, UpdateExistingOperation, UpdateSectionRequest, UpdateSectionResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.js';
4
4
 
5
5
  declare function createSection$1(httpClient: HttpClient): CreateSectionSignature;
6
6
  interface CreateSectionSignature {
7
7
  /**
8
8
  * Creates a section.
9
9
  *
10
- * The section is added to the program identified by `section.program_id`. Provide that program ID in the request. Set `section.description.title` for the section title. The stored ordering value is assigned automatically.
10
+ * The section is added to the program identified by `section.programId`. Specify that program ID in the request. Set `section.description.title` for the section title. The stored ordering value is assigned automatically.
11
11
  *
12
12
  * A program can contain up to 1,000 sections. This call fails if creating the section would exceed that limit.
13
13
  *
14
14
  * To create multiple sections in a single API call, call [Bulk Create Sections](https://dev.wix.com/docs/api-reference/business-management/online-programs/sections/bulk-create-sections).
15
- * @param - Section to create. Must include `section.program_id`.
15
+ * @param - Section to create. Must include `section.programId`.
16
16
  * @returns Created section.
17
17
  */
18
18
  (section: NonNullablePaths<Section, `programId`, 0>, options?: CreateSectionOptions): Promise<NonNullablePaths<Section, `programId` | `description.title` | `ordering` | `delayInDays`, 1>>;
@@ -22,12 +22,12 @@ interface BulkCreateSectionsSignature {
22
22
  /**
23
23
  * Creates up to 100 sections in a single API call.
24
24
  *
25
- * All sections in the request must include `program_id` and belong to the same program. Set `description.title` for each section title. The stored ordering values are assigned automatically.
25
+ * All sections in the request must include `programId` and belong to the same program. Set `description.title` for each section title. The stored ordering values are assigned automatically.
26
26
  *
27
27
  * A program can contain up to 1,000 sections. This call fails if creating the requested sections would exceed that limit.
28
28
  *
29
29
  * To create a single section, call [Create Section](https://dev.wix.com/docs/api-reference/business-management/online-programs/sections/create-section).
30
- * @param - List of sections to create. Each section must include `program_id`, and all sections must belong to the same program.
30
+ * @param - List of sections to create. Each section must include `programId`, and all sections must belong to the same program.
31
31
  */
32
32
  (sections: NonNullablePaths<Section, `programId`, 0>[], options?: BulkCreateSectionsOptions): Promise<NonNullablePaths<BulkCreateSectionsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `results.${number}.action` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 4>>;
33
33
  }
@@ -84,6 +84,8 @@ interface CloneSectionSignature {
84
84
  *
85
85
  * The cloned section is added to the same program after the current last section. Translation content and extended field data are copied to the cloned section.
86
86
  *
87
+ * This method triggers both a Section Created lifecycle event for the new section and a Section Cloned action event containing the source and cloned sections.
88
+ *
87
89
  * Steps are cloned asynchronously after this call returns. The `section.total_steps` value in the response may not reflect the eventual number of cloned steps. Until cloning finishes, Get, List, and Query calls may return a lower actual step count.
88
90
  *
89
91
  * A program can contain up to 1,000 sections. This call fails if cloning the section would exceed that limit.
@@ -103,6 +105,10 @@ interface MoveSectionSignature {
103
105
  */
104
106
  (sectionId: string, options?: MoveSectionOptions): Promise<NonNullablePaths<MoveSectionResponse, `section.programId` | `section.description.title` | `section.ordering` | `section.delayInDays`, 2>>;
105
107
  }
108
+ declare const onSectionCloned$1: EventDefinition<SectionClonedEnvelope, "wix.online_programs.v3.section_cloned">;
109
+ declare const onSectionCreated$1: EventDefinition<SectionCreatedEnvelope, "wix.online_programs.v3.section_created">;
110
+ declare const onSectionDeleted$1: EventDefinition<SectionDeletedEnvelope, "wix.online_programs.v3.section_deleted">;
111
+ declare const onSectionUpdated$1: EventDefinition<SectionUpdatedEnvelope, "wix.online_programs.v3.section_updated">;
106
112
 
107
113
  declare function customQuerySections(httpClient: HttpClient): {
108
114
  (query: SectionQuery, options?: QuerySectionsOptions): ReturnType<typeof typedQuerySections>;
@@ -117,5 +123,21 @@ declare const listSections: MaybeContext<BuildRESTFunction<typeof listSections$1
117
123
  declare const cloneSection: MaybeContext<BuildRESTFunction<typeof cloneSection$1> & typeof cloneSection$1>;
118
124
  declare const moveSection: MaybeContext<BuildRESTFunction<typeof moveSection$1> & typeof moveSection$1>;
119
125
  declare const querySections: MaybeContext<BuildRESTFunction<typeof customQuerySections> & typeof customQuerySections>;
126
+ /**
127
+ * Triggered when a section is cloned.
128
+ */
129
+ declare const onSectionCloned: BuildEventDefinition<typeof onSectionCloned$1> & typeof onSectionCloned$1;
130
+ /**
131
+ * Triggered when a section is created.
132
+ */
133
+ declare const onSectionCreated: BuildEventDefinition<typeof onSectionCreated$1> & typeof onSectionCreated$1;
134
+ /**
135
+ * Triggered when a section is deleted.
136
+ */
137
+ declare const onSectionDeleted: BuildEventDefinition<typeof onSectionDeleted$1> & typeof onSectionDeleted$1;
138
+ /**
139
+ * Triggered when a section is updated.
140
+ */
141
+ declare const onSectionUpdated: BuildEventDefinition<typeof onSectionUpdated$1> & typeof onSectionUpdated$1;
120
142
 
121
- export { BulkCreateSectionsOptions, BulkCreateSectionsResponse, CloneSectionOptions, CloneSectionResponse, CreateSectionOptions, GetSectionOptions, ListSectionsOptions, ListSectionsResponse, MoveSectionOptions, MoveSectionResponse, QuerySectionsOptions, Section, SectionQuery, SectionsQueryBuilder, UpdateSectionOptions, bulkCreateSections, cloneSection, createSection, deleteSection, getSection, listSections, moveSection, querySections, updateSection };
143
+ export { BulkCreateSectionsOptions, BulkCreateSectionsResponse, CloneSectionOptions, CloneSectionResponse, CreateSectionOptions, GetSectionOptions, ListSectionsOptions, ListSectionsResponse, MoveSectionOptions, MoveSectionResponse, QuerySectionsOptions, Section, SectionClonedEnvelope, SectionCreatedEnvelope, SectionDeletedEnvelope, SectionQuery, SectionUpdatedEnvelope, SectionsQueryBuilder, UpdateSectionOptions, bulkCreateSections, cloneSection, createSection, deleteSection, getSection, listSections, moveSection, onSectionCloned, onSectionCreated, onSectionDeleted, onSectionUpdated, querySections, updateSection };
@@ -35,12 +35,23 @@ __export(index_exports, {
35
35
  getSection: () => getSection4,
36
36
  listSections: () => listSections4,
37
37
  moveSection: () => moveSection4,
38
+ onSectionCloned: () => onSectionCloned2,
39
+ onSectionCreated: () => onSectionCreated2,
40
+ onSectionDeleted: () => onSectionDeleted2,
41
+ onSectionUpdated: () => onSectionUpdated2,
38
42
  querySections: () => querySections4,
39
43
  updateSection: () => updateSection4,
40
44
  utils: () => utils
41
45
  });
42
46
  module.exports = __toCommonJS(index_exports);
43
47
 
48
+ // src/online-programs-v3-section-sections.public.ts
49
+ var import_rename_all_nested_keys2 = require("@wix/sdk-runtime/rename-all-nested-keys");
50
+ var import_float3 = require("@wix/sdk-runtime/transformations/float");
51
+ var import_timestamp3 = require("@wix/sdk-runtime/transformations/timestamp");
52
+ var import_transform_paths3 = require("@wix/sdk-runtime/transformations/transform-paths");
53
+ var import_sdk_types = require("@wix/sdk-types");
54
+
44
55
  // src/online-programs-v3-section-sections.universal.ts
45
56
  var import_transform_error = require("@wix/sdk-runtime/transform-error");
46
57
  var import_query_builder = require("@wix/sdk-runtime/query-builder");
@@ -934,9 +945,100 @@ function moveSection3(httpClient) {
934
945
  { httpClient }
935
946
  );
936
947
  }
948
+ var onSectionCloned = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
949
+ "wix.online_programs.v3.section_cloned",
950
+ true,
951
+ (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
952
+ (0, import_transform_paths3.transformPaths)(event, [
953
+ {
954
+ transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
955
+ paths: [
956
+ { path: "data.prototype.createdDate" },
957
+ { path: "data.prototype.updatedDate" },
958
+ { path: "data.cloned.createdDate" },
959
+ { path: "data.cloned.updatedDate" },
960
+ { path: "metadata.eventTime" }
961
+ ]
962
+ },
963
+ {
964
+ transformFn: import_float3.transformRESTFloatToSDKFloat,
965
+ paths: [
966
+ { path: "data.prototype.ordering" },
967
+ { path: "data.cloned.ordering" }
968
+ ]
969
+ }
970
+ ])
971
+ )
972
+ )();
973
+ var onSectionCreated = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
974
+ "wix.online_programs.v3.section_created",
975
+ true,
976
+ (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
977
+ (0, import_transform_paths3.transformPaths)(event, [
978
+ {
979
+ transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
980
+ paths: [
981
+ { path: "entity.createdDate" },
982
+ { path: "entity.updatedDate" },
983
+ { path: "metadata.eventTime" }
984
+ ]
985
+ },
986
+ {
987
+ transformFn: import_float3.transformRESTFloatToSDKFloat,
988
+ paths: [{ path: "entity.ordering" }]
989
+ }
990
+ ])
991
+ )
992
+ )();
993
+ var onSectionDeleted = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
994
+ "wix.online_programs.v3.section_deleted",
995
+ true,
996
+ (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
997
+ (0, import_transform_paths3.transformPaths)(event, [
998
+ {
999
+ transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
1000
+ paths: [
1001
+ { path: "entity.createdDate" },
1002
+ { path: "entity.updatedDate" },
1003
+ { path: "metadata.eventTime" }
1004
+ ]
1005
+ },
1006
+ {
1007
+ transformFn: import_float3.transformRESTFloatToSDKFloat,
1008
+ paths: [{ path: "entity.ordering" }]
1009
+ }
1010
+ ])
1011
+ )
1012
+ )();
1013
+ var onSectionUpdated = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
1014
+ "wix.online_programs.v3.section_updated",
1015
+ true,
1016
+ (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
1017
+ (0, import_transform_paths3.transformPaths)(event, [
1018
+ {
1019
+ transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
1020
+ paths: [
1021
+ { path: "entity.createdDate" },
1022
+ { path: "entity.updatedDate" },
1023
+ { path: "metadata.eventTime" },
1024
+ { path: "modifiedFields.createdDate" },
1025
+ { path: "modifiedFields.updatedDate" }
1026
+ ]
1027
+ },
1028
+ {
1029
+ transformFn: import_float3.transformRESTFloatToSDKFloat,
1030
+ paths: [
1031
+ { path: "entity.ordering" },
1032
+ { path: "modifiedFields.ordering" }
1033
+ ]
1034
+ }
1035
+ ])
1036
+ )
1037
+ )();
937
1038
 
938
1039
  // src/online-programs-v3-section-sections.context.ts
939
1040
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
1041
+ var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
940
1042
  var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
941
1043
  function customQuerySections(httpClient) {
942
1044
  const router = /* @__PURE__ */ (0, import_query_method_router.createQueryOverloadRouter)({
@@ -958,6 +1060,18 @@ var listSections4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(l
958
1060
  var cloneSection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(cloneSection3);
959
1061
  var moveSection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(moveSection3);
960
1062
  var querySections4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQuerySections);
1063
+ var onSectionCloned2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
1064
+ onSectionCloned
1065
+ );
1066
+ var onSectionCreated2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
1067
+ onSectionCreated
1068
+ );
1069
+ var onSectionDeleted2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
1070
+ onSectionDeleted
1071
+ );
1072
+ var onSectionUpdated2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
1073
+ onSectionUpdated
1074
+ );
961
1075
  // Annotate the CommonJS export names for ESM import in node:
962
1076
  0 && (module.exports = {
963
1077
  BulkActionType,
@@ -975,6 +1089,10 @@ var querySections4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(
975
1089
  getSection,
976
1090
  listSections,
977
1091
  moveSection,
1092
+ onSectionCloned,
1093
+ onSectionCreated,
1094
+ onSectionDeleted,
1095
+ onSectionUpdated,
978
1096
  querySections,
979
1097
  updateSection,
980
1098
  utils