@wix/auto_sdk_urls_editor 1.0.10 → 1.0.12
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 +7 -5
- package/build/cjs/index.js +6 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/{editorurls-v2-editor-urls-editor.universal-Che3A1Tl.d.ts → index.typings.d.ts} +31 -1
- package/build/cjs/index.typings.js +122 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +4 -1
- package/build/es/index.d.mts +7 -5
- package/build/es/index.mjs +6 -2
- package/build/es/index.mjs.map +1 -1
- package/build/es/{editorurls-v2-editor-urls-editor.universal-Che3A1Tl.d.mts → index.typings.d.mts} +31 -1
- package/build/es/index.typings.mjs +97 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +4 -1
- package/build/internal/cjs/index.d.ts +7 -5
- package/build/internal/cjs/index.js +6 -2
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/{editorurls-v2-editor-urls-editor.universal-Che3A1Tl.d.ts → index.typings.d.ts} +31 -1
- package/build/internal/cjs/index.typings.js +122 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +4 -1
- package/build/internal/es/index.d.mts +7 -5
- package/build/internal/es/index.mjs +6 -2
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/{editorurls-v2-editor-urls-editor.universal-Che3A1Tl.d.mts → index.typings.d.mts} +31 -1
- package/build/internal/es/index.typings.mjs +97 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +4 -1
- package/package.json +5 -4
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
1
|
+
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { GetEditorUrlsOptions, GetEditorUrlsResponse, GetEditorUrlsApplicationErrors } from './index.typings.js';
|
|
3
|
+
export { EditorType, EditorTypeWithLiterals, EditorUrls, GetEditorUrlsRequest } from './index.typings.js';
|
|
4
4
|
|
|
5
5
|
declare function getEditorUrls$1(httpClient: HttpClient): GetEditorUrlsSignature;
|
|
6
6
|
interface GetEditorUrlsSignature {
|
|
7
7
|
/**
|
|
8
8
|
* Retrieves a site's Editor URLs.
|
|
9
9
|
*/
|
|
10
|
-
(options?: GetEditorUrlsOptions
|
|
10
|
+
(options?: GetEditorUrlsOptions): Promise<NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {
|
|
11
|
+
__applicationErrorsType?: GetEditorUrlsApplicationErrors;
|
|
12
|
+
}>;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
declare const getEditorUrls: MaybeContext<BuildRESTFunction<typeof getEditorUrls$1> & typeof getEditorUrls$1>;
|
|
14
16
|
|
|
15
|
-
export { GetEditorUrlsOptions, GetEditorUrlsResponse, getEditorUrls };
|
|
17
|
+
export { GetEditorUrlsApplicationErrors, GetEditorUrlsOptions, GetEditorUrlsResponse, getEditorUrls };
|
package/build/cjs/index.js
CHANGED
|
@@ -88,7 +88,8 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
88
88
|
async function getEditorUrls2(options) {
|
|
89
89
|
const { httpClient, sideEffects } = arguments[1];
|
|
90
90
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
91
|
-
branchId: options?.branchId
|
|
91
|
+
branchId: options?.branchId,
|
|
92
|
+
editorType: options?.editorType
|
|
92
93
|
});
|
|
93
94
|
const reqOpts = getEditorUrls(payload);
|
|
94
95
|
sideEffects?.onSiteCall?.();
|
|
@@ -101,7 +102,10 @@ async function getEditorUrls2(options) {
|
|
|
101
102
|
err,
|
|
102
103
|
{
|
|
103
104
|
spreadPathsToArguments: {},
|
|
104
|
-
explicitPathsToArguments: {
|
|
105
|
+
explicitPathsToArguments: {
|
|
106
|
+
branchId: "$[0].branchId",
|
|
107
|
+
editorType: "$[0].editorType"
|
|
108
|
+
},
|
|
105
109
|
singleArgumentUnchanged: false
|
|
106
110
|
},
|
|
107
111
|
["options"]
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../src/editorurls-v2-editor-urls-editor.universal.ts","../../src/editorurls-v2-editor-urls-editor.http.ts","../../src/editorurls-v2-editor-urls-editor.public.ts","../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/editorurls-v2-editor-urls-editor.universal.ts","../../src/editorurls-v2-editor-urls-editor.http.ts","../../src/editorurls-v2-editor-urls-editor.public.ts","../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n url: resolveWixEditorurlsV2EditorUrlsApiUrl({\n protoPath: '/v2/editor-urls',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getEditorUrls;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n GetEditorUrlsApplicationErrors,\n GetEditorUrlsOptions,\n GetEditorUrlsResponse,\n getEditorUrls as universalGetEditorUrls,\n} from './editorurls-v2-editor-urls-editor.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/urls' };\n\nexport function getEditorUrls(httpClient: HttpClient): GetEditorUrlsSignature {\n return (options?: GetEditorUrlsOptions) =>\n universalGetEditorUrls(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetEditorUrlsSignature {\n /**\n * Retrieves a site's Editor URLs.\n */\n (options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n >;\n}\n\nexport {\n EditorType,\n EditorUrls,\n GetEditorUrlsOptions,\n GetEditorUrlsRequest,\n GetEditorUrlsResponse,\n} from './editorurls-v2-editor-urls-editor.universal.js';\n","import { getEditorUrls as publicGetEditorUrls } from './editorurls-v2-editor-urls-editor.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getEditorUrls: MaybeContext<\n BuildRESTFunction<typeof publicGetEditorUrls> & typeof publicGetEditorUrls\n> = /*#__PURE__*/ createRESTModule(publicGetEditorUrls);\n\nexport { EditorType } from './editorurls-v2-editor-urls-editor.universal.js';\nexport {\n EditorUrls,\n GetEditorUrlsRequest,\n GetEditorUrlsResponse,\n GetEditorUrlsOptions,\n} from './editorurls-v2-editor-urls-editor.universal.js';\nexport {\n EditorTypeWithLiterals,\n GetEditorUrlsApplicationErrors,\n} from './editorurls-v2-editor-urls-editor.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,cAAc,SAA6C;AACzE,WAAS,gBAAgB,EAAE,KAAK,GAAQ;AACtC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,uCAAuC;AAAA,QAC1C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,YAAQ,uCAAkB,OAAO;AAAA,IACnC;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADxBO,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAZA,SAAAA;AAAA,GAAA;AAiEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE9HO,SAASC,eAAc,YAAgD;AAC5E,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AChBA,IAAAC,uBAAiC;AAG1B,IAAMC,iBAEK,2DAAiBA,cAAmB;","names":["getEditorUrls","import_rest_modules","EditorType","getEditorUrls","sdkTransformError","getEditorUrls","import_rest_modules","getEditorUrls"]}
|
package/build/cjs/{editorurls-v2-editor-urls-editor.universal-Che3A1Tl.d.ts → index.typings.d.ts}
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
1
3
|
interface EditorUrls {
|
|
2
4
|
/**
|
|
3
5
|
* Editor type.
|
|
@@ -41,17 +43,45 @@ interface GetEditorUrlsRequest {
|
|
|
41
43
|
* @format GUID
|
|
42
44
|
*/
|
|
43
45
|
branchId?: string | null;
|
|
46
|
+
/** Optional editor type override */
|
|
47
|
+
editorType?: EditorTypeWithLiterals;
|
|
44
48
|
}
|
|
45
49
|
interface GetEditorUrlsResponse {
|
|
46
50
|
/** Editor URL. */
|
|
47
51
|
urls?: EditorUrls;
|
|
48
52
|
}
|
|
53
|
+
/** @docsIgnore */
|
|
54
|
+
type GetEditorUrlsApplicationErrors = {
|
|
55
|
+
code?: 'UNABLE_TO_EXTRACT_MS_ID';
|
|
56
|
+
description?: string;
|
|
57
|
+
data?: Record<string, any>;
|
|
58
|
+
} | {
|
|
59
|
+
code?: 'SITE_NOT_FOUND';
|
|
60
|
+
description?: string;
|
|
61
|
+
data?: Record<string, any>;
|
|
62
|
+
} | {
|
|
63
|
+
code?: 'EDITOR_NOT_FOUND';
|
|
64
|
+
description?: string;
|
|
65
|
+
data?: Record<string, any>;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Retrieves a site's Editor URLs.
|
|
69
|
+
* @public
|
|
70
|
+
* @permissionId MetaSite.Read
|
|
71
|
+
* @applicableIdentity APP
|
|
72
|
+
* @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls
|
|
73
|
+
*/
|
|
74
|
+
declare function getEditorUrls(options?: GetEditorUrlsOptions): Promise<NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {
|
|
75
|
+
__applicationErrorsType?: GetEditorUrlsApplicationErrors;
|
|
76
|
+
}>;
|
|
49
77
|
interface GetEditorUrlsOptions {
|
|
50
78
|
/**
|
|
51
79
|
* Optional branch ID to include in generated URLs
|
|
52
80
|
* @format GUID
|
|
53
81
|
*/
|
|
54
82
|
branchId?: string | null;
|
|
83
|
+
/** Optional editor type override */
|
|
84
|
+
editorType?: EditorTypeWithLiterals;
|
|
55
85
|
}
|
|
56
86
|
|
|
57
|
-
export { EditorType
|
|
87
|
+
export { EditorType, type EditorTypeWithLiterals, type EditorUrls, type GetEditorUrlsApplicationErrors, type GetEditorUrlsOptions, type GetEditorUrlsRequest, type GetEditorUrlsResponse, getEditorUrls };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.typings.ts
|
|
21
|
+
var index_typings_exports = {};
|
|
22
|
+
__export(index_typings_exports, {
|
|
23
|
+
EditorType: () => EditorType,
|
|
24
|
+
getEditorUrls: () => getEditorUrls2
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(index_typings_exports);
|
|
27
|
+
|
|
28
|
+
// src/editorurls-v2-editor-urls-editor.universal.ts
|
|
29
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
30
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
31
|
+
|
|
32
|
+
// src/editorurls-v2-editor-urls-editor.http.ts
|
|
33
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
34
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
35
|
+
function resolveWixEditorurlsV2EditorUrlsApiUrl(opts) {
|
|
36
|
+
const domainToMappings = {
|
|
37
|
+
"manage._base_domain_": [
|
|
38
|
+
{
|
|
39
|
+
srcPath: "/_api/editor-urls",
|
|
40
|
+
destPath: ""
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"www.wixapis.com": [
|
|
44
|
+
{
|
|
45
|
+
srcPath: "/editor-urls",
|
|
46
|
+
destPath: "/v2/editor-urls"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"*.dev.wix-code.com": [
|
|
50
|
+
{
|
|
51
|
+
srcPath: "/editorurls/v2/editor-urls",
|
|
52
|
+
destPath: "/v2/editor-urls"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
};
|
|
56
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
57
|
+
}
|
|
58
|
+
var PACKAGE_NAME = "@wix/auto_sdk_urls_editor";
|
|
59
|
+
function getEditorUrls(payload) {
|
|
60
|
+
function __getEditorUrls({ host }) {
|
|
61
|
+
const metadata = {
|
|
62
|
+
entityFqdn: "wix.editorurls.v2.editor_urls",
|
|
63
|
+
method: "GET",
|
|
64
|
+
methodFqn: "wix.editorurls.v2.EditorUrlsApi.GetEditorUrls",
|
|
65
|
+
packageName: PACKAGE_NAME,
|
|
66
|
+
url: resolveWixEditorurlsV2EditorUrlsApiUrl({
|
|
67
|
+
protoPath: "/v2/editor-urls",
|
|
68
|
+
data: payload,
|
|
69
|
+
host
|
|
70
|
+
}),
|
|
71
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
72
|
+
};
|
|
73
|
+
return metadata;
|
|
74
|
+
}
|
|
75
|
+
return __getEditorUrls;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// src/editorurls-v2-editor-urls-editor.universal.ts
|
|
79
|
+
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
80
|
+
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
81
|
+
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
82
|
+
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
83
|
+
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
84
|
+
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
85
|
+
EditorType2["PICASSO"] = "PICASSO";
|
|
86
|
+
return EditorType2;
|
|
87
|
+
})(EditorType || {});
|
|
88
|
+
async function getEditorUrls2(options) {
|
|
89
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
90
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
91
|
+
branchId: options?.branchId,
|
|
92
|
+
editorType: options?.editorType
|
|
93
|
+
});
|
|
94
|
+
const reqOpts = getEditorUrls(payload);
|
|
95
|
+
sideEffects?.onSiteCall?.();
|
|
96
|
+
try {
|
|
97
|
+
const result = await httpClient.request(reqOpts);
|
|
98
|
+
sideEffects?.onSuccess?.(result);
|
|
99
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
100
|
+
} catch (err) {
|
|
101
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
102
|
+
err,
|
|
103
|
+
{
|
|
104
|
+
spreadPathsToArguments: {},
|
|
105
|
+
explicitPathsToArguments: {
|
|
106
|
+
branchId: "$[0].branchId",
|
|
107
|
+
editorType: "$[0].editorType"
|
|
108
|
+
},
|
|
109
|
+
singleArgumentUnchanged: false
|
|
110
|
+
},
|
|
111
|
+
["options"]
|
|
112
|
+
);
|
|
113
|
+
sideEffects?.onError?.(err);
|
|
114
|
+
throw transformedError;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
118
|
+
0 && (module.exports = {
|
|
119
|
+
EditorType,
|
|
120
|
+
getEditorUrls
|
|
121
|
+
});
|
|
122
|
+
//# sourceMappingURL=index.typings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/editorurls-v2-editor-urls-editor.universal.ts","../../src/editorurls-v2-editor-urls-editor.http.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n url: resolveWixEditorurlsV2EditorUrlsApiUrl({\n protoPath: '/v2/editor-urls',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getEditorUrls;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,cAAc,SAA6C;AACzE,WAAS,gBAAgB,EAAE,KAAK,GAAQ;AACtC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,uCAAuC;AAAA,QAC1C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,YAAQ,uCAAkB,OAAO;AAAA,IACnC;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADxBO,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAZA,SAAAA;AAAA,GAAA;AAiEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getEditorUrls","import_rest_modules","EditorType","getEditorUrls","sdkTransformError"]}
|
package/build/cjs/meta.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetEditorUrlsRequest as GetEditorUrlsRequest$1, GetEditorUrlsResponse as GetEditorUrlsResponse$1 } from './index.typings.js';
|
|
2
|
+
import '@wix/sdk-types';
|
|
2
3
|
|
|
3
4
|
interface EditorUrls {
|
|
4
5
|
/**
|
|
@@ -43,6 +44,8 @@ interface GetEditorUrlsRequest {
|
|
|
43
44
|
* @format GUID
|
|
44
45
|
*/
|
|
45
46
|
branchId?: string | null;
|
|
47
|
+
/** Optional editor type override */
|
|
48
|
+
editorType?: EditorTypeWithLiterals;
|
|
46
49
|
}
|
|
47
50
|
interface GetEditorUrlsResponse {
|
|
48
51
|
/** Editor URL. */
|
package/build/es/index.d.mts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
1
|
+
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { GetEditorUrlsOptions, GetEditorUrlsResponse, GetEditorUrlsApplicationErrors } from './index.typings.mjs';
|
|
3
|
+
export { EditorType, EditorTypeWithLiterals, EditorUrls, GetEditorUrlsRequest } from './index.typings.mjs';
|
|
4
4
|
|
|
5
5
|
declare function getEditorUrls$1(httpClient: HttpClient): GetEditorUrlsSignature;
|
|
6
6
|
interface GetEditorUrlsSignature {
|
|
7
7
|
/**
|
|
8
8
|
* Retrieves a site's Editor URLs.
|
|
9
9
|
*/
|
|
10
|
-
(options?: GetEditorUrlsOptions
|
|
10
|
+
(options?: GetEditorUrlsOptions): Promise<NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {
|
|
11
|
+
__applicationErrorsType?: GetEditorUrlsApplicationErrors;
|
|
12
|
+
}>;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
declare const getEditorUrls: MaybeContext<BuildRESTFunction<typeof getEditorUrls$1> & typeof getEditorUrls$1>;
|
|
14
16
|
|
|
15
|
-
export { GetEditorUrlsOptions, GetEditorUrlsResponse, getEditorUrls };
|
|
17
|
+
export { GetEditorUrlsApplicationErrors, GetEditorUrlsOptions, GetEditorUrlsResponse, getEditorUrls };
|
package/build/es/index.mjs
CHANGED
|
@@ -64,7 +64,8 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
64
64
|
async function getEditorUrls2(options) {
|
|
65
65
|
const { httpClient, sideEffects } = arguments[1];
|
|
66
66
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
67
|
-
branchId: options?.branchId
|
|
67
|
+
branchId: options?.branchId,
|
|
68
|
+
editorType: options?.editorType
|
|
68
69
|
});
|
|
69
70
|
const reqOpts = getEditorUrls(payload);
|
|
70
71
|
sideEffects?.onSiteCall?.();
|
|
@@ -77,7 +78,10 @@ async function getEditorUrls2(options) {
|
|
|
77
78
|
err,
|
|
78
79
|
{
|
|
79
80
|
spreadPathsToArguments: {},
|
|
80
|
-
explicitPathsToArguments: {
|
|
81
|
+
explicitPathsToArguments: {
|
|
82
|
+
branchId: "$[0].branchId",
|
|
83
|
+
editorType: "$[0].editorType"
|
|
84
|
+
},
|
|
81
85
|
singleArgumentUnchanged: false
|
|
82
86
|
},
|
|
83
87
|
["options"]
|
package/build/es/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/editorurls-v2-editor-urls-editor.universal.ts","../../src/editorurls-v2-editor-urls-editor.http.ts","../../src/editorurls-v2-editor-urls-editor.public.ts","../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\
|
|
1
|
+
{"version":3,"sources":["../../src/editorurls-v2-editor-urls-editor.universal.ts","../../src/editorurls-v2-editor-urls-editor.http.ts","../../src/editorurls-v2-editor-urls-editor.public.ts","../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n url: resolveWixEditorurlsV2EditorUrlsApiUrl({\n protoPath: '/v2/editor-urls',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getEditorUrls;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n GetEditorUrlsApplicationErrors,\n GetEditorUrlsOptions,\n GetEditorUrlsResponse,\n getEditorUrls as universalGetEditorUrls,\n} from './editorurls-v2-editor-urls-editor.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/urls' };\n\nexport function getEditorUrls(httpClient: HttpClient): GetEditorUrlsSignature {\n return (options?: GetEditorUrlsOptions) =>\n universalGetEditorUrls(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetEditorUrlsSignature {\n /**\n * Retrieves a site's Editor URLs.\n */\n (options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n >;\n}\n\nexport {\n EditorType,\n EditorUrls,\n GetEditorUrlsOptions,\n GetEditorUrlsRequest,\n GetEditorUrlsResponse,\n} from './editorurls-v2-editor-urls-editor.universal.js';\n","import { getEditorUrls as publicGetEditorUrls } from './editorurls-v2-editor-urls-editor.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getEditorUrls: MaybeContext<\n BuildRESTFunction<typeof publicGetEditorUrls> & typeof publicGetEditorUrls\n> = /*#__PURE__*/ createRESTModule(publicGetEditorUrls);\n\nexport { EditorType } from './editorurls-v2-editor-urls-editor.universal.js';\nexport {\n EditorUrls,\n GetEditorUrlsRequest,\n GetEditorUrlsResponse,\n GetEditorUrlsOptions,\n} from './editorurls-v2-editor-urls-editor.universal.js';\nexport {\n EditorTypeWithLiterals,\n GetEditorUrlsApplicationErrors,\n} from './editorurls-v2-editor-urls-editor.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,cAAc,SAA6C;AACzE,WAAS,gBAAgB,EAAE,KAAK,GAAQ;AACtC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,uCAAuC;AAAA,QAC1C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,QAAQ,kBAAkB,OAAO;AAAA,IACnC;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADxBO,IAAK,aAAL,kBAAKA,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAZA,SAAAA;AAAA,GAAA;AAiEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE9HO,SAASC,eAAc,YAAgD;AAC5E,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AChBA,SAAS,wBAAwB;AAG1B,IAAMC,iBAEK,iCAAiBA,cAAmB;","names":["EditorType","getEditorUrls","getEditorUrls","getEditorUrls"]}
|
package/build/es/{editorurls-v2-editor-urls-editor.universal-Che3A1Tl.d.mts → index.typings.d.mts}
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
1
3
|
interface EditorUrls {
|
|
2
4
|
/**
|
|
3
5
|
* Editor type.
|
|
@@ -41,17 +43,45 @@ interface GetEditorUrlsRequest {
|
|
|
41
43
|
* @format GUID
|
|
42
44
|
*/
|
|
43
45
|
branchId?: string | null;
|
|
46
|
+
/** Optional editor type override */
|
|
47
|
+
editorType?: EditorTypeWithLiterals;
|
|
44
48
|
}
|
|
45
49
|
interface GetEditorUrlsResponse {
|
|
46
50
|
/** Editor URL. */
|
|
47
51
|
urls?: EditorUrls;
|
|
48
52
|
}
|
|
53
|
+
/** @docsIgnore */
|
|
54
|
+
type GetEditorUrlsApplicationErrors = {
|
|
55
|
+
code?: 'UNABLE_TO_EXTRACT_MS_ID';
|
|
56
|
+
description?: string;
|
|
57
|
+
data?: Record<string, any>;
|
|
58
|
+
} | {
|
|
59
|
+
code?: 'SITE_NOT_FOUND';
|
|
60
|
+
description?: string;
|
|
61
|
+
data?: Record<string, any>;
|
|
62
|
+
} | {
|
|
63
|
+
code?: 'EDITOR_NOT_FOUND';
|
|
64
|
+
description?: string;
|
|
65
|
+
data?: Record<string, any>;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Retrieves a site's Editor URLs.
|
|
69
|
+
* @public
|
|
70
|
+
* @permissionId MetaSite.Read
|
|
71
|
+
* @applicableIdentity APP
|
|
72
|
+
* @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls
|
|
73
|
+
*/
|
|
74
|
+
declare function getEditorUrls(options?: GetEditorUrlsOptions): Promise<NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {
|
|
75
|
+
__applicationErrorsType?: GetEditorUrlsApplicationErrors;
|
|
76
|
+
}>;
|
|
49
77
|
interface GetEditorUrlsOptions {
|
|
50
78
|
/**
|
|
51
79
|
* Optional branch ID to include in generated URLs
|
|
52
80
|
* @format GUID
|
|
53
81
|
*/
|
|
54
82
|
branchId?: string | null;
|
|
83
|
+
/** Optional editor type override */
|
|
84
|
+
editorType?: EditorTypeWithLiterals;
|
|
55
85
|
}
|
|
56
86
|
|
|
57
|
-
export { EditorType
|
|
87
|
+
export { EditorType, type EditorTypeWithLiterals, type EditorUrls, type GetEditorUrlsApplicationErrors, type GetEditorUrlsOptions, type GetEditorUrlsRequest, type GetEditorUrlsResponse, getEditorUrls };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// src/editorurls-v2-editor-urls-editor.universal.ts
|
|
2
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
+
import {
|
|
4
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
5
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
6
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
7
|
+
|
|
8
|
+
// src/editorurls-v2-editor-urls-editor.http.ts
|
|
9
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
10
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
11
|
+
function resolveWixEditorurlsV2EditorUrlsApiUrl(opts) {
|
|
12
|
+
const domainToMappings = {
|
|
13
|
+
"manage._base_domain_": [
|
|
14
|
+
{
|
|
15
|
+
srcPath: "/_api/editor-urls",
|
|
16
|
+
destPath: ""
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"www.wixapis.com": [
|
|
20
|
+
{
|
|
21
|
+
srcPath: "/editor-urls",
|
|
22
|
+
destPath: "/v2/editor-urls"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"*.dev.wix-code.com": [
|
|
26
|
+
{
|
|
27
|
+
srcPath: "/editorurls/v2/editor-urls",
|
|
28
|
+
destPath: "/v2/editor-urls"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
};
|
|
32
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
33
|
+
}
|
|
34
|
+
var PACKAGE_NAME = "@wix/auto_sdk_urls_editor";
|
|
35
|
+
function getEditorUrls(payload) {
|
|
36
|
+
function __getEditorUrls({ host }) {
|
|
37
|
+
const metadata = {
|
|
38
|
+
entityFqdn: "wix.editorurls.v2.editor_urls",
|
|
39
|
+
method: "GET",
|
|
40
|
+
methodFqn: "wix.editorurls.v2.EditorUrlsApi.GetEditorUrls",
|
|
41
|
+
packageName: PACKAGE_NAME,
|
|
42
|
+
url: resolveWixEditorurlsV2EditorUrlsApiUrl({
|
|
43
|
+
protoPath: "/v2/editor-urls",
|
|
44
|
+
data: payload,
|
|
45
|
+
host
|
|
46
|
+
}),
|
|
47
|
+
params: toURLSearchParams(payload)
|
|
48
|
+
};
|
|
49
|
+
return metadata;
|
|
50
|
+
}
|
|
51
|
+
return __getEditorUrls;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// src/editorurls-v2-editor-urls-editor.universal.ts
|
|
55
|
+
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
56
|
+
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
57
|
+
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
58
|
+
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
59
|
+
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
60
|
+
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
61
|
+
EditorType2["PICASSO"] = "PICASSO";
|
|
62
|
+
return EditorType2;
|
|
63
|
+
})(EditorType || {});
|
|
64
|
+
async function getEditorUrls2(options) {
|
|
65
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
66
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
67
|
+
branchId: options?.branchId,
|
|
68
|
+
editorType: options?.editorType
|
|
69
|
+
});
|
|
70
|
+
const reqOpts = getEditorUrls(payload);
|
|
71
|
+
sideEffects?.onSiteCall?.();
|
|
72
|
+
try {
|
|
73
|
+
const result = await httpClient.request(reqOpts);
|
|
74
|
+
sideEffects?.onSuccess?.(result);
|
|
75
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
76
|
+
} catch (err) {
|
|
77
|
+
const transformedError = sdkTransformError(
|
|
78
|
+
err,
|
|
79
|
+
{
|
|
80
|
+
spreadPathsToArguments: {},
|
|
81
|
+
explicitPathsToArguments: {
|
|
82
|
+
branchId: "$[0].branchId",
|
|
83
|
+
editorType: "$[0].editorType"
|
|
84
|
+
},
|
|
85
|
+
singleArgumentUnchanged: false
|
|
86
|
+
},
|
|
87
|
+
["options"]
|
|
88
|
+
);
|
|
89
|
+
sideEffects?.onError?.(err);
|
|
90
|
+
throw transformedError;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
EditorType,
|
|
95
|
+
getEditorUrls2 as getEditorUrls
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=index.typings.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/editorurls-v2-editor-urls-editor.universal.ts","../../src/editorurls-v2-editor-urls-editor.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n url: resolveWixEditorurlsV2EditorUrlsApiUrl({\n protoPath: '/v2/editor-urls',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getEditorUrls;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,cAAc,SAA6C;AACzE,WAAS,gBAAgB,EAAE,KAAK,GAAQ;AACtC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,uCAAuC;AAAA,QAC1C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,QAAQ,kBAAkB,OAAO;AAAA,IACnC;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADxBO,IAAK,aAAL,kBAAKA,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAZA,SAAAA;AAAA,GAAA;AAiEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["EditorType","getEditorUrls"]}
|
package/build/es/meta.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetEditorUrlsRequest as GetEditorUrlsRequest$1, GetEditorUrlsResponse as GetEditorUrlsResponse$1 } from './index.typings.mjs';
|
|
2
|
+
import '@wix/sdk-types';
|
|
2
3
|
|
|
3
4
|
interface EditorUrls {
|
|
4
5
|
/**
|
|
@@ -43,6 +44,8 @@ interface GetEditorUrlsRequest {
|
|
|
43
44
|
* @format GUID
|
|
44
45
|
*/
|
|
45
46
|
branchId?: string | null;
|
|
47
|
+
/** Optional editor type override */
|
|
48
|
+
editorType?: EditorTypeWithLiterals;
|
|
46
49
|
}
|
|
47
50
|
interface GetEditorUrlsResponse {
|
|
48
51
|
/** Editor URL. */
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
1
|
+
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { GetEditorUrlsOptions, GetEditorUrlsResponse, GetEditorUrlsApplicationErrors } from './index.typings.js';
|
|
3
|
+
export { EditorType, EditorTypeWithLiterals, EditorUrls, GetEditorUrlsRequest } from './index.typings.js';
|
|
4
4
|
|
|
5
5
|
declare function getEditorUrls$1(httpClient: HttpClient): GetEditorUrlsSignature;
|
|
6
6
|
interface GetEditorUrlsSignature {
|
|
7
7
|
/**
|
|
8
8
|
* Retrieves a site's Editor URLs.
|
|
9
9
|
*/
|
|
10
|
-
(options?: GetEditorUrlsOptions
|
|
10
|
+
(options?: GetEditorUrlsOptions): Promise<NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {
|
|
11
|
+
__applicationErrorsType?: GetEditorUrlsApplicationErrors;
|
|
12
|
+
}>;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
declare const getEditorUrls: MaybeContext<BuildRESTFunction<typeof getEditorUrls$1> & typeof getEditorUrls$1>;
|
|
14
16
|
|
|
15
|
-
export { GetEditorUrlsOptions, GetEditorUrlsResponse, getEditorUrls };
|
|
17
|
+
export { GetEditorUrlsApplicationErrors, GetEditorUrlsOptions, GetEditorUrlsResponse, getEditorUrls };
|
|
@@ -88,7 +88,8 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
88
88
|
async function getEditorUrls2(options) {
|
|
89
89
|
const { httpClient, sideEffects } = arguments[1];
|
|
90
90
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
91
|
-
branchId: options?.branchId
|
|
91
|
+
branchId: options?.branchId,
|
|
92
|
+
editorType: options?.editorType
|
|
92
93
|
});
|
|
93
94
|
const reqOpts = getEditorUrls(payload);
|
|
94
95
|
sideEffects?.onSiteCall?.();
|
|
@@ -101,7 +102,10 @@ async function getEditorUrls2(options) {
|
|
|
101
102
|
err,
|
|
102
103
|
{
|
|
103
104
|
spreadPathsToArguments: {},
|
|
104
|
-
explicitPathsToArguments: {
|
|
105
|
+
explicitPathsToArguments: {
|
|
106
|
+
branchId: "$[0].branchId",
|
|
107
|
+
editorType: "$[0].editorType"
|
|
108
|
+
},
|
|
105
109
|
singleArgumentUnchanged: false
|
|
106
110
|
},
|
|
107
111
|
["options"]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../index.ts","../../../src/editorurls-v2-editor-urls-editor.universal.ts","../../../src/editorurls-v2-editor-urls-editor.http.ts","../../../src/editorurls-v2-editor-urls-editor.public.ts","../../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\
|
|
1
|
+
{"version":3,"sources":["../../../index.ts","../../../src/editorurls-v2-editor-urls-editor.universal.ts","../../../src/editorurls-v2-editor-urls-editor.http.ts","../../../src/editorurls-v2-editor-urls-editor.public.ts","../../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n url: resolveWixEditorurlsV2EditorUrlsApiUrl({\n protoPath: '/v2/editor-urls',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getEditorUrls;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n GetEditorUrlsApplicationErrors,\n GetEditorUrlsOptions,\n GetEditorUrlsResponse,\n getEditorUrls as universalGetEditorUrls,\n} from './editorurls-v2-editor-urls-editor.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/urls' };\n\nexport function getEditorUrls(httpClient: HttpClient): GetEditorUrlsSignature {\n return (options?: GetEditorUrlsOptions) =>\n universalGetEditorUrls(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetEditorUrlsSignature {\n /**\n * Retrieves a site's Editor URLs.\n */\n (options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n >;\n}\n\nexport {\n EditorType,\n EditorUrls,\n GetEditorUrlsOptions,\n GetEditorUrlsRequest,\n GetEditorUrlsResponse,\n} from './editorurls-v2-editor-urls-editor.universal.js';\n","import { getEditorUrls as publicGetEditorUrls } from './editorurls-v2-editor-urls-editor.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getEditorUrls: MaybeContext<\n BuildRESTFunction<typeof publicGetEditorUrls> & typeof publicGetEditorUrls\n> = /*#__PURE__*/ createRESTModule(publicGetEditorUrls);\n\nexport { EditorType } from './editorurls-v2-editor-urls-editor.universal.js';\nexport {\n EditorUrls,\n GetEditorUrlsRequest,\n GetEditorUrlsResponse,\n GetEditorUrlsOptions,\n} from './editorurls-v2-editor-urls-editor.universal.js';\nexport {\n EditorTypeWithLiterals,\n GetEditorUrlsApplicationErrors,\n} from './editorurls-v2-editor-urls-editor.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,cAAc,SAA6C;AACzE,WAAS,gBAAgB,EAAE,KAAK,GAAQ;AACtC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,uCAAuC;AAAA,QAC1C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,YAAQ,uCAAkB,OAAO;AAAA,IACnC;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADxBO,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAZA,SAAAA;AAAA,GAAA;AAiEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE9HO,SAASC,eAAc,YAAgD;AAC5E,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AChBA,IAAAC,uBAAiC;AAG1B,IAAMC,iBAEK,2DAAiBA,cAAmB;","names":["getEditorUrls","import_rest_modules","EditorType","getEditorUrls","sdkTransformError","getEditorUrls","import_rest_modules","getEditorUrls"]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
1
3
|
interface EditorUrls {
|
|
2
4
|
/**
|
|
3
5
|
* Editor type.
|
|
@@ -41,17 +43,45 @@ interface GetEditorUrlsRequest {
|
|
|
41
43
|
* @format GUID
|
|
42
44
|
*/
|
|
43
45
|
branchId?: string | null;
|
|
46
|
+
/** Optional editor type override */
|
|
47
|
+
editorType?: EditorTypeWithLiterals;
|
|
44
48
|
}
|
|
45
49
|
interface GetEditorUrlsResponse {
|
|
46
50
|
/** Editor URL. */
|
|
47
51
|
urls?: EditorUrls;
|
|
48
52
|
}
|
|
53
|
+
/** @docsIgnore */
|
|
54
|
+
type GetEditorUrlsApplicationErrors = {
|
|
55
|
+
code?: 'UNABLE_TO_EXTRACT_MS_ID';
|
|
56
|
+
description?: string;
|
|
57
|
+
data?: Record<string, any>;
|
|
58
|
+
} | {
|
|
59
|
+
code?: 'SITE_NOT_FOUND';
|
|
60
|
+
description?: string;
|
|
61
|
+
data?: Record<string, any>;
|
|
62
|
+
} | {
|
|
63
|
+
code?: 'EDITOR_NOT_FOUND';
|
|
64
|
+
description?: string;
|
|
65
|
+
data?: Record<string, any>;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Retrieves a site's Editor URLs.
|
|
69
|
+
* @public
|
|
70
|
+
* @permissionId MetaSite.Read
|
|
71
|
+
* @applicableIdentity APP
|
|
72
|
+
* @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls
|
|
73
|
+
*/
|
|
74
|
+
declare function getEditorUrls(options?: GetEditorUrlsOptions): Promise<NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {
|
|
75
|
+
__applicationErrorsType?: GetEditorUrlsApplicationErrors;
|
|
76
|
+
}>;
|
|
49
77
|
interface GetEditorUrlsOptions {
|
|
50
78
|
/**
|
|
51
79
|
* Optional branch ID to include in generated URLs
|
|
52
80
|
* @format GUID
|
|
53
81
|
*/
|
|
54
82
|
branchId?: string | null;
|
|
83
|
+
/** Optional editor type override */
|
|
84
|
+
editorType?: EditorTypeWithLiterals;
|
|
55
85
|
}
|
|
56
86
|
|
|
57
|
-
export { EditorType
|
|
87
|
+
export { EditorType, type EditorTypeWithLiterals, type EditorUrls, type GetEditorUrlsApplicationErrors, type GetEditorUrlsOptions, type GetEditorUrlsRequest, type GetEditorUrlsResponse, getEditorUrls };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.typings.ts
|
|
21
|
+
var index_typings_exports = {};
|
|
22
|
+
__export(index_typings_exports, {
|
|
23
|
+
EditorType: () => EditorType,
|
|
24
|
+
getEditorUrls: () => getEditorUrls2
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(index_typings_exports);
|
|
27
|
+
|
|
28
|
+
// src/editorurls-v2-editor-urls-editor.universal.ts
|
|
29
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
30
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
31
|
+
|
|
32
|
+
// src/editorurls-v2-editor-urls-editor.http.ts
|
|
33
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
34
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
35
|
+
function resolveWixEditorurlsV2EditorUrlsApiUrl(opts) {
|
|
36
|
+
const domainToMappings = {
|
|
37
|
+
"manage._base_domain_": [
|
|
38
|
+
{
|
|
39
|
+
srcPath: "/_api/editor-urls",
|
|
40
|
+
destPath: ""
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"www.wixapis.com": [
|
|
44
|
+
{
|
|
45
|
+
srcPath: "/editor-urls",
|
|
46
|
+
destPath: "/v2/editor-urls"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"*.dev.wix-code.com": [
|
|
50
|
+
{
|
|
51
|
+
srcPath: "/editorurls/v2/editor-urls",
|
|
52
|
+
destPath: "/v2/editor-urls"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
};
|
|
56
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
57
|
+
}
|
|
58
|
+
var PACKAGE_NAME = "@wix/auto_sdk_urls_editor";
|
|
59
|
+
function getEditorUrls(payload) {
|
|
60
|
+
function __getEditorUrls({ host }) {
|
|
61
|
+
const metadata = {
|
|
62
|
+
entityFqdn: "wix.editorurls.v2.editor_urls",
|
|
63
|
+
method: "GET",
|
|
64
|
+
methodFqn: "wix.editorurls.v2.EditorUrlsApi.GetEditorUrls",
|
|
65
|
+
packageName: PACKAGE_NAME,
|
|
66
|
+
url: resolveWixEditorurlsV2EditorUrlsApiUrl({
|
|
67
|
+
protoPath: "/v2/editor-urls",
|
|
68
|
+
data: payload,
|
|
69
|
+
host
|
|
70
|
+
}),
|
|
71
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
72
|
+
};
|
|
73
|
+
return metadata;
|
|
74
|
+
}
|
|
75
|
+
return __getEditorUrls;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// src/editorurls-v2-editor-urls-editor.universal.ts
|
|
79
|
+
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
80
|
+
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
81
|
+
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
82
|
+
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
83
|
+
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
84
|
+
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
85
|
+
EditorType2["PICASSO"] = "PICASSO";
|
|
86
|
+
return EditorType2;
|
|
87
|
+
})(EditorType || {});
|
|
88
|
+
async function getEditorUrls2(options) {
|
|
89
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
90
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
91
|
+
branchId: options?.branchId,
|
|
92
|
+
editorType: options?.editorType
|
|
93
|
+
});
|
|
94
|
+
const reqOpts = getEditorUrls(payload);
|
|
95
|
+
sideEffects?.onSiteCall?.();
|
|
96
|
+
try {
|
|
97
|
+
const result = await httpClient.request(reqOpts);
|
|
98
|
+
sideEffects?.onSuccess?.(result);
|
|
99
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
100
|
+
} catch (err) {
|
|
101
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
102
|
+
err,
|
|
103
|
+
{
|
|
104
|
+
spreadPathsToArguments: {},
|
|
105
|
+
explicitPathsToArguments: {
|
|
106
|
+
branchId: "$[0].branchId",
|
|
107
|
+
editorType: "$[0].editorType"
|
|
108
|
+
},
|
|
109
|
+
singleArgumentUnchanged: false
|
|
110
|
+
},
|
|
111
|
+
["options"]
|
|
112
|
+
);
|
|
113
|
+
sideEffects?.onError?.(err);
|
|
114
|
+
throw transformedError;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
118
|
+
0 && (module.exports = {
|
|
119
|
+
EditorType,
|
|
120
|
+
getEditorUrls
|
|
121
|
+
});
|
|
122
|
+
//# sourceMappingURL=index.typings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../index.typings.ts","../../../src/editorurls-v2-editor-urls-editor.universal.ts","../../../src/editorurls-v2-editor-urls-editor.http.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n url: resolveWixEditorurlsV2EditorUrlsApiUrl({\n protoPath: '/v2/editor-urls',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getEditorUrls;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,cAAc,SAA6C;AACzE,WAAS,gBAAgB,EAAE,KAAK,GAAQ;AACtC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,uCAAuC;AAAA,QAC1C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,YAAQ,uCAAkB,OAAO;AAAA,IACnC;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADxBO,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAZA,SAAAA;AAAA,GAAA;AAiEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getEditorUrls","import_rest_modules","EditorType","getEditorUrls","sdkTransformError"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetEditorUrlsRequest as GetEditorUrlsRequest$1, GetEditorUrlsResponse as GetEditorUrlsResponse$1 } from './index.typings.js';
|
|
2
|
+
import '@wix/sdk-types';
|
|
2
3
|
|
|
3
4
|
interface EditorUrls {
|
|
4
5
|
/**
|
|
@@ -43,6 +44,8 @@ interface GetEditorUrlsRequest {
|
|
|
43
44
|
* @format GUID
|
|
44
45
|
*/
|
|
45
46
|
branchId?: string | null;
|
|
47
|
+
/** Optional editor type override */
|
|
48
|
+
editorType?: EditorTypeWithLiterals;
|
|
46
49
|
}
|
|
47
50
|
interface GetEditorUrlsResponse {
|
|
48
51
|
/** Editor URL. */
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
1
|
+
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { GetEditorUrlsOptions, GetEditorUrlsResponse, GetEditorUrlsApplicationErrors } from './index.typings.mjs';
|
|
3
|
+
export { EditorType, EditorTypeWithLiterals, EditorUrls, GetEditorUrlsRequest } from './index.typings.mjs';
|
|
4
4
|
|
|
5
5
|
declare function getEditorUrls$1(httpClient: HttpClient): GetEditorUrlsSignature;
|
|
6
6
|
interface GetEditorUrlsSignature {
|
|
7
7
|
/**
|
|
8
8
|
* Retrieves a site's Editor URLs.
|
|
9
9
|
*/
|
|
10
|
-
(options?: GetEditorUrlsOptions
|
|
10
|
+
(options?: GetEditorUrlsOptions): Promise<NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {
|
|
11
|
+
__applicationErrorsType?: GetEditorUrlsApplicationErrors;
|
|
12
|
+
}>;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
declare const getEditorUrls: MaybeContext<BuildRESTFunction<typeof getEditorUrls$1> & typeof getEditorUrls$1>;
|
|
14
16
|
|
|
15
|
-
export { GetEditorUrlsOptions, GetEditorUrlsResponse, getEditorUrls };
|
|
17
|
+
export { GetEditorUrlsApplicationErrors, GetEditorUrlsOptions, GetEditorUrlsResponse, getEditorUrls };
|
|
@@ -64,7 +64,8 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
64
64
|
async function getEditorUrls2(options) {
|
|
65
65
|
const { httpClient, sideEffects } = arguments[1];
|
|
66
66
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
67
|
-
branchId: options?.branchId
|
|
67
|
+
branchId: options?.branchId,
|
|
68
|
+
editorType: options?.editorType
|
|
68
69
|
});
|
|
69
70
|
const reqOpts = getEditorUrls(payload);
|
|
70
71
|
sideEffects?.onSiteCall?.();
|
|
@@ -77,7 +78,10 @@ async function getEditorUrls2(options) {
|
|
|
77
78
|
err,
|
|
78
79
|
{
|
|
79
80
|
spreadPathsToArguments: {},
|
|
80
|
-
explicitPathsToArguments: {
|
|
81
|
+
explicitPathsToArguments: {
|
|
82
|
+
branchId: "$[0].branchId",
|
|
83
|
+
editorType: "$[0].editorType"
|
|
84
|
+
},
|
|
81
85
|
singleArgumentUnchanged: false
|
|
82
86
|
},
|
|
83
87
|
["options"]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/editorurls-v2-editor-urls-editor.universal.ts","../../../src/editorurls-v2-editor-urls-editor.http.ts","../../../src/editorurls-v2-editor-urls-editor.public.ts","../../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\
|
|
1
|
+
{"version":3,"sources":["../../../src/editorurls-v2-editor-urls-editor.universal.ts","../../../src/editorurls-v2-editor-urls-editor.http.ts","../../../src/editorurls-v2-editor-urls-editor.public.ts","../../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n url: resolveWixEditorurlsV2EditorUrlsApiUrl({\n protoPath: '/v2/editor-urls',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getEditorUrls;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n GetEditorUrlsApplicationErrors,\n GetEditorUrlsOptions,\n GetEditorUrlsResponse,\n getEditorUrls as universalGetEditorUrls,\n} from './editorurls-v2-editor-urls-editor.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/urls' };\n\nexport function getEditorUrls(httpClient: HttpClient): GetEditorUrlsSignature {\n return (options?: GetEditorUrlsOptions) =>\n universalGetEditorUrls(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetEditorUrlsSignature {\n /**\n * Retrieves a site's Editor URLs.\n */\n (options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n >;\n}\n\nexport {\n EditorType,\n EditorUrls,\n GetEditorUrlsOptions,\n GetEditorUrlsRequest,\n GetEditorUrlsResponse,\n} from './editorurls-v2-editor-urls-editor.universal.js';\n","import { getEditorUrls as publicGetEditorUrls } from './editorurls-v2-editor-urls-editor.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getEditorUrls: MaybeContext<\n BuildRESTFunction<typeof publicGetEditorUrls> & typeof publicGetEditorUrls\n> = /*#__PURE__*/ createRESTModule(publicGetEditorUrls);\n\nexport { EditorType } from './editorurls-v2-editor-urls-editor.universal.js';\nexport {\n EditorUrls,\n GetEditorUrlsRequest,\n GetEditorUrlsResponse,\n GetEditorUrlsOptions,\n} from './editorurls-v2-editor-urls-editor.universal.js';\nexport {\n EditorTypeWithLiterals,\n GetEditorUrlsApplicationErrors,\n} from './editorurls-v2-editor-urls-editor.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,cAAc,SAA6C;AACzE,WAAS,gBAAgB,EAAE,KAAK,GAAQ;AACtC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,uCAAuC;AAAA,QAC1C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,QAAQ,kBAAkB,OAAO;AAAA,IACnC;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADxBO,IAAK,aAAL,kBAAKA,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAZA,SAAAA;AAAA,GAAA;AAiEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE9HO,SAASC,eAAc,YAAgD;AAC5E,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AChBA,SAAS,wBAAwB;AAG1B,IAAMC,iBAEK,iCAAiBA,cAAmB;","names":["EditorType","getEditorUrls","getEditorUrls","getEditorUrls"]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
1
3
|
interface EditorUrls {
|
|
2
4
|
/**
|
|
3
5
|
* Editor type.
|
|
@@ -41,17 +43,45 @@ interface GetEditorUrlsRequest {
|
|
|
41
43
|
* @format GUID
|
|
42
44
|
*/
|
|
43
45
|
branchId?: string | null;
|
|
46
|
+
/** Optional editor type override */
|
|
47
|
+
editorType?: EditorTypeWithLiterals;
|
|
44
48
|
}
|
|
45
49
|
interface GetEditorUrlsResponse {
|
|
46
50
|
/** Editor URL. */
|
|
47
51
|
urls?: EditorUrls;
|
|
48
52
|
}
|
|
53
|
+
/** @docsIgnore */
|
|
54
|
+
type GetEditorUrlsApplicationErrors = {
|
|
55
|
+
code?: 'UNABLE_TO_EXTRACT_MS_ID';
|
|
56
|
+
description?: string;
|
|
57
|
+
data?: Record<string, any>;
|
|
58
|
+
} | {
|
|
59
|
+
code?: 'SITE_NOT_FOUND';
|
|
60
|
+
description?: string;
|
|
61
|
+
data?: Record<string, any>;
|
|
62
|
+
} | {
|
|
63
|
+
code?: 'EDITOR_NOT_FOUND';
|
|
64
|
+
description?: string;
|
|
65
|
+
data?: Record<string, any>;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Retrieves a site's Editor URLs.
|
|
69
|
+
* @public
|
|
70
|
+
* @permissionId MetaSite.Read
|
|
71
|
+
* @applicableIdentity APP
|
|
72
|
+
* @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls
|
|
73
|
+
*/
|
|
74
|
+
declare function getEditorUrls(options?: GetEditorUrlsOptions): Promise<NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {
|
|
75
|
+
__applicationErrorsType?: GetEditorUrlsApplicationErrors;
|
|
76
|
+
}>;
|
|
49
77
|
interface GetEditorUrlsOptions {
|
|
50
78
|
/**
|
|
51
79
|
* Optional branch ID to include in generated URLs
|
|
52
80
|
* @format GUID
|
|
53
81
|
*/
|
|
54
82
|
branchId?: string | null;
|
|
83
|
+
/** Optional editor type override */
|
|
84
|
+
editorType?: EditorTypeWithLiterals;
|
|
55
85
|
}
|
|
56
86
|
|
|
57
|
-
export { EditorType
|
|
87
|
+
export { EditorType, type EditorTypeWithLiterals, type EditorUrls, type GetEditorUrlsApplicationErrors, type GetEditorUrlsOptions, type GetEditorUrlsRequest, type GetEditorUrlsResponse, getEditorUrls };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// src/editorurls-v2-editor-urls-editor.universal.ts
|
|
2
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
+
import {
|
|
4
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
5
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
6
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
7
|
+
|
|
8
|
+
// src/editorurls-v2-editor-urls-editor.http.ts
|
|
9
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
10
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
11
|
+
function resolveWixEditorurlsV2EditorUrlsApiUrl(opts) {
|
|
12
|
+
const domainToMappings = {
|
|
13
|
+
"manage._base_domain_": [
|
|
14
|
+
{
|
|
15
|
+
srcPath: "/_api/editor-urls",
|
|
16
|
+
destPath: ""
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"www.wixapis.com": [
|
|
20
|
+
{
|
|
21
|
+
srcPath: "/editor-urls",
|
|
22
|
+
destPath: "/v2/editor-urls"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"*.dev.wix-code.com": [
|
|
26
|
+
{
|
|
27
|
+
srcPath: "/editorurls/v2/editor-urls",
|
|
28
|
+
destPath: "/v2/editor-urls"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
};
|
|
32
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
33
|
+
}
|
|
34
|
+
var PACKAGE_NAME = "@wix/auto_sdk_urls_editor";
|
|
35
|
+
function getEditorUrls(payload) {
|
|
36
|
+
function __getEditorUrls({ host }) {
|
|
37
|
+
const metadata = {
|
|
38
|
+
entityFqdn: "wix.editorurls.v2.editor_urls",
|
|
39
|
+
method: "GET",
|
|
40
|
+
methodFqn: "wix.editorurls.v2.EditorUrlsApi.GetEditorUrls",
|
|
41
|
+
packageName: PACKAGE_NAME,
|
|
42
|
+
url: resolveWixEditorurlsV2EditorUrlsApiUrl({
|
|
43
|
+
protoPath: "/v2/editor-urls",
|
|
44
|
+
data: payload,
|
|
45
|
+
host
|
|
46
|
+
}),
|
|
47
|
+
params: toURLSearchParams(payload)
|
|
48
|
+
};
|
|
49
|
+
return metadata;
|
|
50
|
+
}
|
|
51
|
+
return __getEditorUrls;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// src/editorurls-v2-editor-urls-editor.universal.ts
|
|
55
|
+
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
56
|
+
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
57
|
+
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
58
|
+
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
59
|
+
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
60
|
+
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
61
|
+
EditorType2["PICASSO"] = "PICASSO";
|
|
62
|
+
return EditorType2;
|
|
63
|
+
})(EditorType || {});
|
|
64
|
+
async function getEditorUrls2(options) {
|
|
65
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
66
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
67
|
+
branchId: options?.branchId,
|
|
68
|
+
editorType: options?.editorType
|
|
69
|
+
});
|
|
70
|
+
const reqOpts = getEditorUrls(payload);
|
|
71
|
+
sideEffects?.onSiteCall?.();
|
|
72
|
+
try {
|
|
73
|
+
const result = await httpClient.request(reqOpts);
|
|
74
|
+
sideEffects?.onSuccess?.(result);
|
|
75
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
76
|
+
} catch (err) {
|
|
77
|
+
const transformedError = sdkTransformError(
|
|
78
|
+
err,
|
|
79
|
+
{
|
|
80
|
+
spreadPathsToArguments: {},
|
|
81
|
+
explicitPathsToArguments: {
|
|
82
|
+
branchId: "$[0].branchId",
|
|
83
|
+
editorType: "$[0].editorType"
|
|
84
|
+
},
|
|
85
|
+
singleArgumentUnchanged: false
|
|
86
|
+
},
|
|
87
|
+
["options"]
|
|
88
|
+
);
|
|
89
|
+
sideEffects?.onError?.(err);
|
|
90
|
+
throw transformedError;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
EditorType,
|
|
95
|
+
getEditorUrls2 as getEditorUrls
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=index.typings.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/editorurls-v2-editor-urls-editor.universal.ts","../../../src/editorurls-v2-editor-urls-editor.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n url: resolveWixEditorurlsV2EditorUrlsApiUrl({\n protoPath: '/v2/editor-urls',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getEditorUrls;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,cAAc,SAA6C;AACzE,WAAS,gBAAgB,EAAE,KAAK,GAAQ;AACtC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,uCAAuC;AAAA,QAC1C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,QAAQ,kBAAkB,OAAO;AAAA,IACnC;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADxBO,IAAK,aAAL,kBAAKA,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAZA,SAAAA;AAAA,GAAA;AAiEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["EditorType","getEditorUrls"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetEditorUrlsRequest as GetEditorUrlsRequest$1, GetEditorUrlsResponse as GetEditorUrlsResponse$1 } from './index.typings.mjs';
|
|
2
|
+
import '@wix/sdk-types';
|
|
2
3
|
|
|
3
4
|
interface EditorUrls {
|
|
4
5
|
/**
|
|
@@ -43,6 +44,8 @@ interface GetEditorUrlsRequest {
|
|
|
43
44
|
* @format GUID
|
|
44
45
|
*/
|
|
45
46
|
branchId?: string | null;
|
|
47
|
+
/** Optional editor type override */
|
|
48
|
+
editorType?: EditorTypeWithLiterals;
|
|
46
49
|
}
|
|
47
50
|
interface GetEditorUrlsResponse {
|
|
48
51
|
/** Editor URL. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/auto_sdk_urls_editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"publishConfig": {
|
|
5
6
|
"registry": "https://registry.npmjs.org/",
|
|
6
7
|
"access": "public"
|
|
@@ -28,8 +29,8 @@
|
|
|
28
29
|
"service-plugins"
|
|
29
30
|
],
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@wix/sdk-runtime": "^0.3.
|
|
32
|
-
"@wix/sdk-types": "^1.13.
|
|
32
|
+
"@wix/sdk-runtime": "^0.3.55",
|
|
33
|
+
"@wix/sdk-types": "^1.13.35"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
36
|
"tsup": "^8.4.0",
|
|
@@ -49,5 +50,5 @@
|
|
|
49
50
|
"fqdn": "wix.editorurls.v2.editor_urls"
|
|
50
51
|
}
|
|
51
52
|
},
|
|
52
|
-
"falconPackageHash": "
|
|
53
|
+
"falconPackageHash": "9a14a8d047dbf59c07e6ac454039bb044b689ad8c468085836154c26"
|
|
53
54
|
}
|