@wix/auto_sdk_editor-branches_branches 1.0.27 → 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,14 +1,13 @@
1
1
  import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { Branch, CreateBranchApplicationErrors, UpdateBranch, UpdateBranchApplicationErrors, DeleteBranchApplicationErrors, BranchesQueryBuilder, SetDefaultBranchResponse, GetDefaultBranchResponse, BranchCreatedEnvelope, BranchDeletedEnvelope, BranchUpdatedEnvelope } from './index.typings.js';
3
- export { ActionEvent, Asset, BaseEventMetadata, BranchSourceOneOf, BranchesQueryResult, CreateBranchRequest, CreateBranchResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteBranchRequest, DeleteBranchResponse, DeleteContext, DeleteStatus, DeleteStatusWithLiterals, DomainEvent, DomainEventBodyOneOf, EditorType, EditorTypeOptions, EditorTypeOptionsWithLiterals, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, GetBranchRequest, GetBranchResponse, GetDefaultBranchRequest, HtmlSitePublished, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, MetaSiteSpecialEvent, MetaSiteSpecialEventPayloadOneOf, Namespace, NamespaceChanged, NamespaceWithLiterals, OdeditorAssigned, OdeditorUnassigned, Page, PicassoAssigned, PicassoUnassigned, QueryBranchesRequest, QueryBranchesResponse, RestoreInfo, ServiceProvisioned, ServiceRemoved, SetDefaultBranchRequest, SiteCreated, SiteCreatedContext, SiteCreatedContextWithLiterals, SiteDeleted, SiteHardDeleted, SiteMarkedAsTemplate, SiteMarkedAsWixSite, SitePublished, SitePurgedExternally, SiteRenamed, SiteTransferred, SiteUndeleted, SiteUnpublished, SiteUrlChanged, SortOrder, SortOrderWithLiterals, Sorting, SourceBranch, SourceTemplate, SourceType, SourceTypeWithLiterals, State, StateWithLiterals, StudioAssigned, StudioTwoAssigned, StudioTwoUnassigned, StudioUnassigned, Type, TypeWithLiterals, UpdateBranchRequest, UpdateBranchResponse, UpdateExtendedFieldsRequest, UpdateExtendedFieldsResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WixelAssigned, WixelUnassigned } from './index.typings.js';
2
+ import { Branch, CreateBranchApplicationErrors, UpdateBranch, UpdateBranchApplicationErrors, DeleteBranchApplicationErrors, SetDefaultBranchResponse, GetDefaultBranchResponse, BranchCreatedEnvelope, BranchDeletedEnvelope, BranchUpdatedEnvelope, BranchesQueryBuilder, CursorQuery, typedQueryBranches } from './index.typings.js';
3
+ export { ActionEvent, Asset, BaseEventMetadata, BranchSourceOneOf, BranchesQueryResult, CreateBranchRequest, CreateBranchResponse, CursorPaging, CursorPagingMetadata, CursorQueryPagingMethodOneOf, Cursors, DeleteBranchRequest, DeleteBranchResponse, DeleteContext, DeleteStatus, DeleteStatusWithLiterals, DomainEvent, DomainEventBodyOneOf, EditorType, EditorTypeOptions, EditorTypeOptionsWithLiterals, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, GetBranchRequest, GetBranchResponse, GetDefaultBranchRequest, HtmlSitePublished, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, MetaSiteSpecialEvent, MetaSiteSpecialEventPayloadOneOf, Namespace, NamespaceChanged, NamespaceWithLiterals, OdeditorAssigned, OdeditorUnassigned, Page, PicassoAssigned, PicassoUnassigned, QueryBranchesRequest, QueryBranchesResponse, RestoreInfo, ServiceProvisioned, ServiceRemoved, SetDefaultBranchRequest, SiteCreated, SiteCreatedContext, SiteCreatedContextWithLiterals, SiteDeleted, SiteHardDeleted, SiteMarkedAsTemplate, SiteMarkedAsWixSite, SitePublished, SitePurgedExternally, SiteRenamed, SiteTransferred, SiteUndeleted, SiteUnpublished, SiteUrlChanged, SortOrder, SortOrderWithLiterals, Sorting, SourceBranch, SourceTemplate, SourceType, SourceTypeWithLiterals, State, StateWithLiterals, StudioAssigned, StudioTwoAssigned, StudioTwoUnassigned, StudioUnassigned, Type, TypeWithLiterals, UpdateBranchRequest, UpdateBranchResponse, UpdateExtendedFieldsRequest, UpdateExtendedFieldsResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WixelAssigned, WixelUnassigned } from './index.typings.js';
4
4
 
5
5
  declare function createBranch$1(httpClient: HttpClient): CreateBranchSignature;
6
6
  interface CreateBranchSignature {
7
7
  /**
8
8
  * Creates a branch.
9
- * If a source branch is not provided, the branch will include a blank website.
10
9
  *
11
- * If a source branch is not provided, the branch will include a blank website.
10
+ * If a source branch isn't provided, the branch will include a blank website.
12
11
  *
13
12
  * > **Important:** Align the `sourceType` field with its corresponding source properties:
14
13
  * > - When `sourceType` is `SOURCE_BRANCH`, provide `sourceBranchProperties`.
@@ -54,13 +53,6 @@ interface DeleteBranchSignature {
54
53
  __applicationErrorsType?: DeleteBranchApplicationErrors;
55
54
  }>;
56
55
  }
57
- declare function queryBranches$1(httpClient: HttpClient): QueryBranchesSignature;
58
- interface QueryBranchesSignature {
59
- /**
60
- * Retrieves a list of branches, given the specified [paging, filtering, and sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language).
61
- */
62
- (): BranchesQueryBuilder;
63
- }
64
56
  declare function setDefaultBranch$1(httpClient: HttpClient): SetDefaultBranchSignature;
65
57
  interface SetDefaultBranchSignature {
66
58
  /**
@@ -80,13 +72,17 @@ declare const onBranchCreated$1: EventDefinition<BranchCreatedEnvelope, "wix.edi
80
72
  declare const onBranchDeleted$1: EventDefinition<BranchDeletedEnvelope, "wix.editor.branches.v1.branch_deleted">;
81
73
  declare const onBranchUpdated$1: EventDefinition<BranchUpdatedEnvelope, "wix.editor.branches.v1.branch_updated">;
82
74
 
75
+ declare function customQueryBranches(httpClient: HttpClient): {
76
+ (): BranchesQueryBuilder;
77
+ (query: CursorQuery): ReturnType<typeof typedQueryBranches>;
78
+ };
83
79
  declare const createBranch: MaybeContext<BuildRESTFunction<typeof createBranch$1> & typeof createBranch$1>;
84
80
  declare const getBranch: MaybeContext<BuildRESTFunction<typeof getBranch$1> & typeof getBranch$1>;
85
81
  declare const updateBranch: MaybeContext<BuildRESTFunction<typeof updateBranch$1> & typeof updateBranch$1>;
86
82
  declare const deleteBranch: MaybeContext<BuildRESTFunction<typeof deleteBranch$1> & typeof deleteBranch$1>;
87
- declare const queryBranches: MaybeContext<BuildRESTFunction<typeof queryBranches$1> & typeof queryBranches$1>;
88
83
  declare const setDefaultBranch: MaybeContext<BuildRESTFunction<typeof setDefaultBranch$1> & typeof setDefaultBranch$1>;
89
84
  declare const getDefaultBranch: MaybeContext<BuildRESTFunction<typeof getDefaultBranch$1> & typeof getDefaultBranch$1>;
85
+ declare const queryBranches: MaybeContext<BuildRESTFunction<typeof customQueryBranches> & typeof customQueryBranches>;
90
86
  /**
91
87
  * Triggered when a branch is created.
92
88
  */
@@ -100,4 +96,4 @@ declare const onBranchDeleted: BuildEventDefinition<typeof onBranchDeleted$1> &
100
96
  */
101
97
  declare const onBranchUpdated: BuildEventDefinition<typeof onBranchUpdated$1> & typeof onBranchUpdated$1;
102
98
 
103
- export { Branch, BranchCreatedEnvelope, BranchDeletedEnvelope, BranchUpdatedEnvelope, BranchesQueryBuilder, CreateBranchApplicationErrors, DeleteBranchApplicationErrors, GetDefaultBranchResponse, SetDefaultBranchResponse, UpdateBranch, UpdateBranchApplicationErrors, createBranch, deleteBranch, getBranch, getDefaultBranch, onBranchCreated, onBranchDeleted, onBranchUpdated, queryBranches, setDefaultBranch, updateBranch };
99
+ export { Branch, BranchCreatedEnvelope, BranchDeletedEnvelope, BranchUpdatedEnvelope, BranchesQueryBuilder, CreateBranchApplicationErrors, CursorQuery, DeleteBranchApplicationErrors, GetDefaultBranchResponse, SetDefaultBranchResponse, UpdateBranch, UpdateBranchApplicationErrors, createBranch, deleteBranch, getBranch, getDefaultBranch, onBranchCreated, onBranchDeleted, onBranchUpdated, queryBranches, setDefaultBranch, updateBranch };
@@ -572,6 +572,29 @@ function queryBranches2() {
572
572
  transformationPaths: {}
573
573
  });
574
574
  }
575
+ async function typedQueryBranches(query) {
576
+ const { httpClient, sideEffects } = arguments[1];
577
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
578
+ const reqOpts = queryBranches(payload);
579
+ sideEffects?.onSiteCall?.();
580
+ try {
581
+ const result = await httpClient.request(reqOpts);
582
+ sideEffects?.onSuccess?.(result);
583
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
584
+ } catch (err) {
585
+ const transformedError = (0, import_transform_error.transformError)(
586
+ err,
587
+ {
588
+ spreadPathsToArguments: {},
589
+ explicitPathsToArguments: { query: "$[0]" },
590
+ singleArgumentUnchanged: false
591
+ },
592
+ ["query"]
593
+ );
594
+ sideEffects?.onError?.(err);
595
+ throw transformedError;
596
+ }
597
+ }
575
598
  async function setDefaultBranch2(branchId) {
576
599
  const { httpClient, sideEffects } = arguments[1];
577
600
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ branchId });
@@ -655,6 +678,13 @@ function queryBranches3(httpClient) {
655
678
  { httpClient }
656
679
  );
657
680
  }
681
+ function typedQueryBranches2(httpClient) {
682
+ return (query) => typedQueryBranches(
683
+ query,
684
+ // @ts-ignore
685
+ { httpClient }
686
+ );
687
+ }
658
688
  function setDefaultBranch3(httpClient) {
659
689
  return (branchId) => setDefaultBranch2(
660
690
  branchId,
@@ -720,13 +750,25 @@ var onBranchUpdated = (0, import_sdk_types.EventDefinition)(
720
750
  // src/editor-branches-v1-branch-branches.context.ts
721
751
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
722
752
  var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
753
+ var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
754
+ function customQueryBranches(httpClient) {
755
+ const router = (0, import_query_method_router.createQueryOverloadRouter)({
756
+ builderQueryFunction: () => queryBranches3(httpClient)(),
757
+ typedQueryFunction: (query) => typedQueryBranches2(httpClient)(query),
758
+ hasOptionsParameter: false
759
+ });
760
+ function overloadedQuery(query) {
761
+ return router(...arguments);
762
+ }
763
+ return overloadedQuery;
764
+ }
723
765
  var createBranch4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createBranch3);
724
766
  var getBranch4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getBranch3);
725
767
  var updateBranch4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateBranch3);
726
768
  var deleteBranch4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteBranch3);
727
- var queryBranches4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryBranches3);
728
769
  var setDefaultBranch4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(setDefaultBranch3);
729
770
  var getDefaultBranch4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getDefaultBranch3);
771
+ var queryBranches4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryBranches);
730
772
  var onBranchCreated2 = (0, import_event_definition_modules.createEventModule)(onBranchCreated);
731
773
  var onBranchDeleted2 = (0, import_event_definition_modules.createEventModule)(onBranchDeleted);
732
774
  var onBranchUpdated2 = (0, import_event_definition_modules.createEventModule)(onBranchUpdated);