@wix/auto_sdk_editor-branches_branches 1.0.26 → 1.0.28
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.
- package/build/cjs/index.d.ts +23 -10
- package/build/cjs/index.js +43 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +28 -3
- package/build/cjs/index.typings.js +25 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +23 -10
- package/build/es/index.mjs +43 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +28 -3
- package/build/es/index.typings.mjs +24 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +9 -17
- package/build/internal/cjs/index.js +43 -1
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +10 -5
- package/build/internal/cjs/index.typings.js +25 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +9 -17
- package/build/internal/es/index.mjs +43 -1
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +10 -5
- package/build/internal/es/index.typings.mjs +24 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +3 -3
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
-
import { Branch, CreateBranchApplicationErrors, UpdateBranch, UpdateBranchApplicationErrors, DeleteBranchApplicationErrors,
|
|
3
|
-
export { ActionEvent, Asset, BaseEventMetadata, BranchSourceOneOf, BranchesQueryResult, CreateBranchRequest, CreateBranchResponse, CursorPaging, CursorPagingMetadata,
|
|
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
|
|
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,22 +53,36 @@ interface DeleteBranchSignature {
|
|
|
54
53
|
__applicationErrorsType?: DeleteBranchApplicationErrors;
|
|
55
54
|
}>;
|
|
56
55
|
}
|
|
57
|
-
declare function
|
|
58
|
-
interface
|
|
56
|
+
declare function setDefaultBranch$1(httpClient: HttpClient): SetDefaultBranchSignature;
|
|
57
|
+
interface SetDefaultBranchSignature {
|
|
59
58
|
/**
|
|
60
|
-
*
|
|
59
|
+
* Sets the specified branch as the default.
|
|
60
|
+
* @param - Branch ID.
|
|
61
61
|
*/
|
|
62
|
-
():
|
|
62
|
+
(branchId: string): Promise<NonNullablePaths<SetDefaultBranchResponse, `branch.sourceBranchProperties.branchId` | `branch.sourceTemplateProperties.templateId` | `branch.type` | `branch.sourceType` | `branch.editorType.editorTypeOptions`, 4>>;
|
|
63
|
+
}
|
|
64
|
+
declare function getDefaultBranch$1(httpClient: HttpClient): GetDefaultBranchSignature;
|
|
65
|
+
interface GetDefaultBranchSignature {
|
|
66
|
+
/**
|
|
67
|
+
* Retrieves the default branch.
|
|
68
|
+
*/
|
|
69
|
+
(): Promise<NonNullablePaths<GetDefaultBranchResponse, `branch.sourceBranchProperties.branchId` | `branch.sourceTemplateProperties.templateId` | `branch.type` | `branch.sourceType` | `branch.editorType.editorTypeOptions`, 4>>;
|
|
63
70
|
}
|
|
64
71
|
declare const onBranchCreated$1: EventDefinition<BranchCreatedEnvelope, "wix.editor.branches.v1.branch_created">;
|
|
65
72
|
declare const onBranchDeleted$1: EventDefinition<BranchDeletedEnvelope, "wix.editor.branches.v1.branch_deleted">;
|
|
66
73
|
declare const onBranchUpdated$1: EventDefinition<BranchUpdatedEnvelope, "wix.editor.branches.v1.branch_updated">;
|
|
67
74
|
|
|
75
|
+
declare function customQueryBranches(httpClient: HttpClient): {
|
|
76
|
+
(): BranchesQueryBuilder;
|
|
77
|
+
(query: CursorQuery): ReturnType<typeof typedQueryBranches>;
|
|
78
|
+
};
|
|
68
79
|
declare const createBranch: MaybeContext<BuildRESTFunction<typeof createBranch$1> & typeof createBranch$1>;
|
|
69
80
|
declare const getBranch: MaybeContext<BuildRESTFunction<typeof getBranch$1> & typeof getBranch$1>;
|
|
70
81
|
declare const updateBranch: MaybeContext<BuildRESTFunction<typeof updateBranch$1> & typeof updateBranch$1>;
|
|
71
82
|
declare const deleteBranch: MaybeContext<BuildRESTFunction<typeof deleteBranch$1> & typeof deleteBranch$1>;
|
|
72
|
-
declare const
|
|
83
|
+
declare const setDefaultBranch: MaybeContext<BuildRESTFunction<typeof setDefaultBranch$1> & typeof setDefaultBranch$1>;
|
|
84
|
+
declare const getDefaultBranch: MaybeContext<BuildRESTFunction<typeof getDefaultBranch$1> & typeof getDefaultBranch$1>;
|
|
85
|
+
declare const queryBranches: MaybeContext<BuildRESTFunction<typeof customQueryBranches> & typeof customQueryBranches>;
|
|
73
86
|
/**
|
|
74
87
|
* Triggered when a branch is created.
|
|
75
88
|
*/
|
|
@@ -83,4 +96,4 @@ declare const onBranchDeleted: BuildEventDefinition<typeof onBranchDeleted$1> &
|
|
|
83
96
|
*/
|
|
84
97
|
declare const onBranchUpdated: BuildEventDefinition<typeof onBranchUpdated$1> & typeof onBranchUpdated$1;
|
|
85
98
|
|
|
86
|
-
export { Branch, BranchCreatedEnvelope, BranchDeletedEnvelope, BranchUpdatedEnvelope, BranchesQueryBuilder, CreateBranchApplicationErrors, DeleteBranchApplicationErrors, UpdateBranch, UpdateBranchApplicationErrors, createBranch, deleteBranch, getBranch, onBranchCreated, onBranchDeleted, onBranchUpdated, queryBranches, 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 };
|
package/build/cjs/index.js
CHANGED
|
@@ -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);
|