@wix/auto_sdk_online-programs_sections 1.0.2 → 1.0.3

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, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { Section, CreateSectionOptions, BulkCreateSectionOptions, BulkCreateSectionResponse, BulkCreateSectionMigrationResponse, GetSectionOptions, UpdateSectionOptions, QuerySectionsOptions, SectionsQueryBuilder, ListSectionsOptions, ListSectionsResponse, CloneSectionOptions, CloneSectionResponse, MoveSectionOptions, MoveSectionResponse, PublishSectionOptions, PublishSectionResponse } from './index.typings.mjs';
3
- export { ActionEvent, ApplicationError, BulkActionMetadata, BulkActionType, BulkActionTypeWithLiterals, BulkCloneSectionRequest, BulkCloneSectionResponse, BulkCreateSectionMigrationRequest, BulkCreateSectionRequest, BulkSectionResult, CloneSectionRequest, CreateSectionRequest, CreateSectionResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteAllProgramSectionsRequest, DeleteAllProgramSectionsResponse, DeleteByFilterOperation, DeleteByIdsOperation, DeleteSectionRequest, DeleteSectionResponse, Description, DescriptionFieldSet, DescriptionFieldSetWithLiterals, DescriptionMediaOneOf, DocumentImage, DocumentPayload, DocumentUpdateOperation, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, Enum, EnumWithLiterals, ExtendedFields, FocalPoint, GetSectionRequest, GetSectionResponse, IdentificationData, IdentificationDataIdOneOf, IndexDocument, ItemMetadata, ListSectionsRequest, MessageEnvelope, MoveSectionRequest, PublishSectionRequest, QuerySectionsRequest, QuerySectionsResponse, RequestedFields, RequestedFieldsWithLiterals, RestoreInfo, RestoreSectionFromTrashRequest, RestoreSectionFromTrashResponse, SearchIndexingNotification, SearchIndexingNotificationState, SearchIndexingNotificationStateWithLiterals, SectionCloned, SectionDeleted, SectionMoved, SectionPublished, SectionUpdated, SectionsQueryResult, SortOrder, SortOrderWithLiterals, Sorting, State, StateWithLiterals, UpdateByFilterOperation, UpdateDocumentsEvent, UpdateDocumentsEventOperationOneOf, UpdateExistingOperation, UpdateSectionRequest, UpdateSectionResponse, VideoResolution, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.mjs';
2
+ import { Section, CreateSectionOptions, BulkCreateSectionOptions, BulkCreateSectionResponse, BulkCreateSectionMigrationResponse, GetSectionOptions, UpdateSectionOptions, ListSectionsOptions, ListSectionsResponse, CloneSectionOptions, CloneSectionResponse, MoveSectionOptions, MoveSectionResponse, PublishSectionOptions, PublishSectionResponse, CursorQuery, typedQuerySections, QuerySectionsOptions, SectionsQueryBuilder } from './index.typings.mjs';
3
+ export { ActionEvent, ApplicationError, BulkActionMetadata, BulkActionType, BulkActionTypeWithLiterals, BulkCloneSectionRequest, BulkCloneSectionResponse, BulkCreateSectionMigrationRequest, BulkCreateSectionRequest, BulkSectionResult, CloneSectionRequest, CreateSectionRequest, CreateSectionResponse, CursorPaging, CursorPagingMetadata, CursorQueryPagingMethodOneOf, Cursors, DeleteAllProgramSectionsRequest, DeleteAllProgramSectionsResponse, DeleteByFilterOperation, DeleteByIdsOperation, DeleteSectionRequest, DeleteSectionResponse, Description, DescriptionFieldSet, DescriptionFieldSetWithLiterals, DescriptionMediaOneOf, DocumentImage, DocumentPayload, DocumentUpdateOperation, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, Enum, EnumWithLiterals, ExtendedFields, FocalPoint, GetSectionRequest, GetSectionResponse, IdentificationData, IdentificationDataIdOneOf, IndexDocument, ItemMetadata, ListSectionsRequest, MessageEnvelope, MoveSectionRequest, PublishSectionRequest, QuerySectionsRequest, QuerySectionsResponse, RequestedFields, RequestedFieldsWithLiterals, RestoreInfo, RestoreSectionFromTrashRequest, RestoreSectionFromTrashResponse, SearchIndexingNotification, SearchIndexingNotificationState, SearchIndexingNotificationStateWithLiterals, SectionCloned, SectionDeleted, SectionMoved, SectionPublished, SectionUpdated, SectionsQueryResult, SortOrder, SortOrderWithLiterals, Sorting, State, StateWithLiterals, UpdateByFilterOperation, UpdateDocumentsEvent, UpdateDocumentsEventOperationOneOf, UpdateExistingOperation, UpdateSectionRequest, UpdateSectionResponse, VideoResolution, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.mjs';
4
4
 
5
5
  declare function createSection$1(httpClient: HttpClient): CreateSectionSignature;
6
6
  interface CreateSectionSignature {
@@ -54,15 +54,6 @@ interface DeleteSectionSignature {
54
54
  */
55
55
  (sectionId: string): Promise<void>;
56
56
  }
57
- declare function querySections$1(httpClient: HttpClient): QuerySectionsSignature;
58
- interface QuerySectionsSignature {
59
- /**
60
- * Retrieves a list of Sections, given the provided [paging, filtering, and sorting][1].
61
- *
62
- * Up to 1,000 Sections can be returned per request.
63
- */
64
- (options?: QuerySectionsOptions): SectionsQueryBuilder;
65
- }
66
57
  declare function listSections$1(httpClient: HttpClient): ListSectionsSignature;
67
58
  interface ListSectionsSignature {
68
59
  /**
@@ -94,16 +85,22 @@ interface PublishSectionSignature {
94
85
  (options?: PublishSectionOptions): Promise<NonNullablePaths<PublishSectionResponse, `section.programId` | `section.description.title` | `section.state` | `section.oldTotalSteps` | `section.trialSection` | `section.ordering` | `section.delayInDays`, 4>>;
95
86
  }
96
87
 
88
+ declare function customQuerySections(httpClient: HttpClient): {
89
+ (query: CursorQuery): ReturnType<typeof typedQuerySections>;
90
+ (query: CursorQuery, options: QuerySectionsOptions): ReturnType<typeof typedQuerySections>;
91
+ (): SectionsQueryBuilder;
92
+ (options: QuerySectionsOptions): SectionsQueryBuilder;
93
+ };
97
94
  declare const createSection: MaybeContext<BuildRESTFunction<typeof createSection$1> & typeof createSection$1>;
98
95
  declare const bulkCreateSection: MaybeContext<BuildRESTFunction<typeof bulkCreateSection$1> & typeof bulkCreateSection$1>;
99
96
  declare const bulkCreateSectionMigration: MaybeContext<BuildRESTFunction<typeof bulkCreateSectionMigration$1> & typeof bulkCreateSectionMigration$1>;
100
97
  declare const getSection: MaybeContext<BuildRESTFunction<typeof getSection$1> & typeof getSection$1>;
101
98
  declare const updateSection: MaybeContext<BuildRESTFunction<typeof updateSection$1> & typeof updateSection$1>;
102
99
  declare const deleteSection: MaybeContext<BuildRESTFunction<typeof deleteSection$1> & typeof deleteSection$1>;
103
- declare const querySections: MaybeContext<BuildRESTFunction<typeof querySections$1> & typeof querySections$1>;
104
100
  declare const listSections: MaybeContext<BuildRESTFunction<typeof listSections$1> & typeof listSections$1>;
105
101
  declare const cloneSection: MaybeContext<BuildRESTFunction<typeof cloneSection$1> & typeof cloneSection$1>;
106
102
  declare const moveSection: MaybeContext<BuildRESTFunction<typeof moveSection$1> & typeof moveSection$1>;
107
103
  declare const publishSection: MaybeContext<BuildRESTFunction<typeof publishSection$1> & typeof publishSection$1>;
104
+ declare const querySections: MaybeContext<BuildRESTFunction<typeof customQuerySections> & typeof customQuerySections>;
108
105
 
109
- export { BulkCreateSectionMigrationResponse, BulkCreateSectionOptions, BulkCreateSectionResponse, CloneSectionOptions, CloneSectionResponse, CreateSectionOptions, GetSectionOptions, ListSectionsOptions, ListSectionsResponse, MoveSectionOptions, MoveSectionResponse, PublishSectionOptions, PublishSectionResponse, QuerySectionsOptions, Section, SectionsQueryBuilder, UpdateSectionOptions, bulkCreateSection, bulkCreateSectionMigration, cloneSection, createSection, deleteSection, getSection, listSections, moveSection, publishSection, querySections, updateSection };
106
+ export { BulkCreateSectionMigrationResponse, BulkCreateSectionOptions, BulkCreateSectionResponse, CloneSectionOptions, CloneSectionResponse, CreateSectionOptions, CursorQuery, GetSectionOptions, ListSectionsOptions, ListSectionsResponse, MoveSectionOptions, MoveSectionResponse, PublishSectionOptions, PublishSectionResponse, QuerySectionsOptions, Section, SectionsQueryBuilder, UpdateSectionOptions, bulkCreateSection, bulkCreateSectionMigration, cloneSection, createSection, deleteSection, getSection, listSections, moveSection, publishSection, querySections, updateSection };
@@ -1181,6 +1181,43 @@ function querySections2(options) {
1181
1181
  transformationPaths: {}
1182
1182
  });
1183
1183
  }
1184
+ async function typedQuerySections(query, options) {
1185
+ const { httpClient, sideEffects } = arguments[2];
1186
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1187
+ query,
1188
+ ...options
1189
+ });
1190
+ const reqOpts = querySections(payload);
1191
+ sideEffects?.onSiteCall?.();
1192
+ try {
1193
+ const result = await httpClient.request(reqOpts);
1194
+ sideEffects?.onSuccess?.(result);
1195
+ return renameKeysFromRESTResponseToSDKResponse(
1196
+ transformPaths2(result.data, [
1197
+ {
1198
+ transformFn: transformRESTImageToSDKImage,
1199
+ paths: [{ path: "sections.description.image" }]
1200
+ },
1201
+ {
1202
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1203
+ paths: [{ path: "sections.description.video" }]
1204
+ }
1205
+ ])
1206
+ );
1207
+ } catch (err) {
1208
+ const transformedError = sdkTransformError(
1209
+ err,
1210
+ {
1211
+ spreadPathsToArguments: {},
1212
+ explicitPathsToArguments: { query: "$[0]" },
1213
+ singleArgumentUnchanged: false
1214
+ },
1215
+ ["query", "options"]
1216
+ );
1217
+ sideEffects?.onError?.(err);
1218
+ throw transformedError;
1219
+ }
1220
+ }
1184
1221
  async function listSections2(programId, options) {
1185
1222
  const { httpClient, sideEffects } = arguments[2];
1186
1223
  const payload = renameKeysFromSDKRequestToRESTRequest({
@@ -1401,6 +1438,14 @@ function querySections3(httpClient) {
1401
1438
  { httpClient }
1402
1439
  );
1403
1440
  }
1441
+ function typedQuerySections2(httpClient) {
1442
+ return (query, options) => typedQuerySections(
1443
+ query,
1444
+ options,
1445
+ // @ts-ignore
1446
+ { httpClient }
1447
+ );
1448
+ }
1404
1449
  function listSections3(httpClient) {
1405
1450
  return (programId, options) => listSections2(
1406
1451
  programId,
@@ -1434,17 +1479,29 @@ function publishSection3(httpClient) {
1434
1479
 
1435
1480
  // src/online-programs-v3-section-sections.context.ts
1436
1481
  import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
1482
+ import { createQueryOverloadRouter } from "@wix/sdk-runtime/query-method-router";
1483
+ function customQuerySections(httpClient) {
1484
+ const router = createQueryOverloadRouter({
1485
+ builderQueryFunction: (options) => querySections3(httpClient)(options),
1486
+ typedQueryFunction: (query, options) => typedQuerySections2(httpClient)(query, options),
1487
+ hasOptionsParameter: true
1488
+ });
1489
+ function overloadedQuery(queryOrOptions, options) {
1490
+ return router(...arguments);
1491
+ }
1492
+ return overloadedQuery;
1493
+ }
1437
1494
  var createSection4 = /* @__PURE__ */ createRESTModule(createSection3);
1438
1495
  var bulkCreateSection4 = /* @__PURE__ */ createRESTModule(bulkCreateSection3);
1439
1496
  var bulkCreateSectionMigration4 = /* @__PURE__ */ createRESTModule(bulkCreateSectionMigration3);
1440
1497
  var getSection4 = /* @__PURE__ */ createRESTModule(getSection3);
1441
1498
  var updateSection4 = /* @__PURE__ */ createRESTModule(updateSection3);
1442
1499
  var deleteSection4 = /* @__PURE__ */ createRESTModule(deleteSection3);
1443
- var querySections4 = /* @__PURE__ */ createRESTModule(querySections3);
1444
1500
  var listSections4 = /* @__PURE__ */ createRESTModule(listSections3);
1445
1501
  var cloneSection4 = /* @__PURE__ */ createRESTModule(cloneSection3);
1446
1502
  var moveSection4 = /* @__PURE__ */ createRESTModule(moveSection3);
1447
1503
  var publishSection4 = /* @__PURE__ */ createRESTModule(publishSection3);
1504
+ var querySections4 = /* @__PURE__ */ createRESTModule(customQuerySections);
1448
1505
  export {
1449
1506
  BulkActionType,
1450
1507
  DescriptionFieldSet,