@wix/auto_sdk_urls_editor 1.0.18 → 1.0.20
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.js +2 -7
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -7
- package/build/cjs/index.typings.js +2 -7
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +1 -5
- package/build/cjs/meta.js +0 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.mjs +2 -7
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -7
- package/build/es/index.typings.mjs +2 -7
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +1 -5
- package/build/es/meta.mjs +0 -1
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.js +2 -7
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +1 -7
- package/build/internal/cjs/index.typings.js +2 -7
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +1 -5
- package/build/internal/cjs/meta.js +0 -1
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.mjs +2 -7
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +1 -7
- package/build/internal/es/index.typings.mjs +2 -7
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +1 -5
- package/build/internal/es/meta.mjs +0 -1
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +4 -4
package/build/cjs/index.js
CHANGED
|
@@ -82,7 +82,6 @@ function getEditorUrls(payload) {
|
|
|
82
82
|
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
83
83
|
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
84
84
|
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
85
|
-
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
86
85
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
87
86
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
88
87
|
EditorType2["PICASSO"] = "PICASSO";
|
|
@@ -93,8 +92,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
93
92
|
async function getEditorUrls2(options) {
|
|
94
93
|
const { httpClient, sideEffects } = arguments[1];
|
|
95
94
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
96
|
-
branchId: options?.branchId
|
|
97
|
-
editorType: options?.editorType
|
|
95
|
+
branchId: options?.branchId
|
|
98
96
|
});
|
|
99
97
|
const reqOpts = getEditorUrls(payload);
|
|
100
98
|
sideEffects?.onSiteCall?.();
|
|
@@ -107,10 +105,7 @@ async function getEditorUrls2(options) {
|
|
|
107
105
|
err,
|
|
108
106
|
{
|
|
109
107
|
spreadPathsToArguments: {},
|
|
110
|
-
explicitPathsToArguments: {
|
|
111
|
-
branchId: "$[0].branchId",
|
|
112
|
-
editorType: "$[0].editorType"
|
|
113
|
-
},
|
|
108
|
+
explicitPathsToArguments: { branchId: "$[0].branchId" },
|
|
114
109
|
singleArgumentUnchanged: false
|
|
115
110
|
},
|
|
116
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 /**
|
|
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 /** 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 /** Wixel */\n WIXEL = 'WIXEL',\n /** StudioTwo */\n STUDIO_TWO = 'STUDIO_TWO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL'\n | 'STUDIO_TWO';\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\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 });\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: { branchId: '$[0].branchId' },\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}\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 migrationOptions: {\n optInTransformResponse: true,\n },\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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;;;AD3BO,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAER,EAAAA,YAAA,gBAAa;AAdH,SAAAA;AAAA,GAAA;AAkEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,EACrB,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,EAAE,UAAU,gBAAgB;AAAA,QACtD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE3HO,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"]}
|
|
@@ -26,8 +26,6 @@ declare enum EditorType {
|
|
|
26
26
|
UNKNOWN = "UNKNOWN",
|
|
27
27
|
/** The classic Wix Editor. */
|
|
28
28
|
WIX_EDITOR = "WIX_EDITOR",
|
|
29
|
-
/** Deprecated. Expected end-of-life date: July 1, 2024. */
|
|
30
|
-
EDITOR_X = "EDITOR_X",
|
|
31
29
|
/** Wix's Editor built for agencies and enterprises. */
|
|
32
30
|
WIX_STUDIO = "WIX_STUDIO",
|
|
33
31
|
/** Editor 3 */
|
|
@@ -40,15 +38,13 @@ declare enum EditorType {
|
|
|
40
38
|
STUDIO_TWO = "STUDIO_TWO"
|
|
41
39
|
}
|
|
42
40
|
/** @enumType */
|
|
43
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | '
|
|
41
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL' | 'STUDIO_TWO';
|
|
44
42
|
interface GetEditorUrlsRequest {
|
|
45
43
|
/**
|
|
46
44
|
* Optional branch ID to include in generated URLs
|
|
47
45
|
* @format GUID
|
|
48
46
|
*/
|
|
49
47
|
branchId?: string | null;
|
|
50
|
-
/** Optional editor type override */
|
|
51
|
-
editorType?: EditorTypeWithLiterals;
|
|
52
48
|
}
|
|
53
49
|
interface GetEditorUrlsResponse {
|
|
54
50
|
/** Editor URL. */
|
|
@@ -84,8 +80,6 @@ interface GetEditorUrlsOptions {
|
|
|
84
80
|
* @format GUID
|
|
85
81
|
*/
|
|
86
82
|
branchId?: string | null;
|
|
87
|
-
/** Optional editor type override */
|
|
88
|
-
editorType?: EditorTypeWithLiterals;
|
|
89
83
|
}
|
|
90
84
|
|
|
91
85
|
export { EditorType, type EditorTypeWithLiterals, type EditorUrls, type GetEditorUrlsApplicationErrors, type GetEditorUrlsOptions, type GetEditorUrlsRequest, type GetEditorUrlsResponse, getEditorUrls };
|
|
@@ -82,7 +82,6 @@ function getEditorUrls(payload) {
|
|
|
82
82
|
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
83
83
|
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
84
84
|
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
85
|
-
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
86
85
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
87
86
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
88
87
|
EditorType2["PICASSO"] = "PICASSO";
|
|
@@ -93,8 +92,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
93
92
|
async function getEditorUrls2(options) {
|
|
94
93
|
const { httpClient, sideEffects } = arguments[1];
|
|
95
94
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
96
|
-
branchId: options?.branchId
|
|
97
|
-
editorType: options?.editorType
|
|
95
|
+
branchId: options?.branchId
|
|
98
96
|
});
|
|
99
97
|
const reqOpts = getEditorUrls(payload);
|
|
100
98
|
sideEffects?.onSiteCall?.();
|
|
@@ -107,10 +105,7 @@ async function getEditorUrls2(options) {
|
|
|
107
105
|
err,
|
|
108
106
|
{
|
|
109
107
|
spreadPathsToArguments: {},
|
|
110
|
-
explicitPathsToArguments: {
|
|
111
|
-
branchId: "$[0].branchId",
|
|
112
|
-
editorType: "$[0].editorType"
|
|
113
|
-
},
|
|
108
|
+
explicitPathsToArguments: { branchId: "$[0].branchId" },
|
|
114
109
|
singleArgumentUnchanged: false
|
|
115
110
|
},
|
|
116
111
|
["options"]
|
|
@@ -1 +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 /**
|
|
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 /** 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 /** Wixel */\n WIXEL = 'WIXEL',\n /** StudioTwo */\n STUDIO_TWO = 'STUDIO_TWO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL'\n | 'STUDIO_TWO';\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\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 });\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: { branchId: '$[0].branchId' },\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}\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 migrationOptions: {\n optInTransformResponse: true,\n },\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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;;;AD3BO,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAER,EAAAA,YAAA,gBAAa;AAdH,SAAAA;AAAA,GAAA;AAkEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,EACrB,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,EAAE,UAAU,gBAAgB;AAAA,QACtD,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
|
@@ -27,8 +27,6 @@ declare enum EditorType {
|
|
|
27
27
|
UNKNOWN = "UNKNOWN",
|
|
28
28
|
/** The classic Wix Editor. */
|
|
29
29
|
WIX_EDITOR = "WIX_EDITOR",
|
|
30
|
-
/** Deprecated. Expected end-of-life date: July 1, 2024. */
|
|
31
|
-
EDITOR_X = "EDITOR_X",
|
|
32
30
|
/** Wix's Editor built for agencies and enterprises. */
|
|
33
31
|
WIX_STUDIO = "WIX_STUDIO",
|
|
34
32
|
/** Editor 3 */
|
|
@@ -41,15 +39,13 @@ declare enum EditorType {
|
|
|
41
39
|
STUDIO_TWO = "STUDIO_TWO"
|
|
42
40
|
}
|
|
43
41
|
/** @enumType */
|
|
44
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | '
|
|
42
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL' | 'STUDIO_TWO';
|
|
45
43
|
interface GetEditorUrlsRequest {
|
|
46
44
|
/**
|
|
47
45
|
* Optional branch ID to include in generated URLs
|
|
48
46
|
* @format GUID
|
|
49
47
|
*/
|
|
50
48
|
branchId?: string | null;
|
|
51
|
-
/** Optional editor type override */
|
|
52
|
-
editorType?: EditorTypeWithLiterals;
|
|
53
49
|
}
|
|
54
50
|
interface GetEditorUrlsResponse {
|
|
55
51
|
/** Editor URL. */
|
package/build/cjs/meta.js
CHANGED
|
@@ -78,7 +78,6 @@ function getEditorUrls(payload) {
|
|
|
78
78
|
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
79
79
|
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
80
80
|
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
81
|
-
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
82
81
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
83
82
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
84
83
|
EditorType2["PICASSO"] = "PICASSO";
|
package/build/cjs/meta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../meta.ts","../../src/editorurls-v2-editor-urls-editor.http.ts","../../src/editorurls-v2-editor-urls-editor.types.ts","../../src/editorurls-v2-editor-urls-editor.meta.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.meta.js';\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 migrationOptions: {\n optInTransformResponse: true,\n },\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","export 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 /**
|
|
1
|
+
{"version":3,"sources":["../../meta.ts","../../src/editorurls-v2-editor-urls-editor.http.ts","../../src/editorurls-v2-editor-urls-editor.types.ts","../../src/editorurls-v2-editor-urls-editor.meta.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.meta.js';\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 migrationOptions: {\n optInTransformResponse: true,\n },\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","export 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 /** 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 /** Wixel */\n WIXEL = 'WIXEL',\n /** StudioTwo */\n STUDIO_TWO = 'STUDIO_TWO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL'\n | 'STUDIO_TWO';\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\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","import * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\nimport * as ambassadorWixEditorurlsV2EditorUrlsTypes from './editorurls-v2-editor-urls-editor.types.js';\nimport * as ambassadorWixEditorurlsV2EditorUrlsUniversalTypes from './editorurls-v2-editor-urls-editor.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getEditorUrls(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixEditorurlsV2EditorUrlsUniversalTypes.GetEditorUrlsRequest,\n ambassadorWixEditorurlsV2EditorUrlsTypes.GetEditorUrlsRequest,\n ambassadorWixEditorurlsV2EditorUrlsUniversalTypes.GetEditorUrlsResponse,\n ambassadorWixEditorurlsV2EditorUrlsTypes.GetEditorUrlsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/editor-urls',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport {\n EditorUrls as EditorUrlsOriginal,\n EditorType as EditorTypeOriginal,\n EditorTypeWithLiterals as EditorTypeWithLiteralsOriginal,\n GetEditorUrlsRequest as GetEditorUrlsRequestOriginal,\n GetEditorUrlsResponse as GetEditorUrlsResponseOriginal,\n GetEditorUrlsApplicationErrors as GetEditorUrlsApplicationErrorsOriginal,\n} from './editorurls-v2-editor-urls-editor.types.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA;AAAA;;;ACAA,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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;;;ACnCO,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAER,EAAAA,YAAA,gBAAa;AAdH,SAAAA;AAAA,GAAA;;;ACAL,SAASC,iBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACgC,cAAc,OAAO;AAE3D,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["getEditorUrls","import_rest_modules","EditorType","getEditorUrls"]}
|
package/build/es/index.mjs
CHANGED
|
@@ -58,7 +58,6 @@ function getEditorUrls(payload) {
|
|
|
58
58
|
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
59
59
|
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
60
60
|
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
61
|
-
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
62
61
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
63
62
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
64
63
|
EditorType2["PICASSO"] = "PICASSO";
|
|
@@ -69,8 +68,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
69
68
|
async function getEditorUrls2(options) {
|
|
70
69
|
const { httpClient, sideEffects } = arguments[1];
|
|
71
70
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
72
|
-
branchId: options?.branchId
|
|
73
|
-
editorType: options?.editorType
|
|
71
|
+
branchId: options?.branchId
|
|
74
72
|
});
|
|
75
73
|
const reqOpts = getEditorUrls(payload);
|
|
76
74
|
sideEffects?.onSiteCall?.();
|
|
@@ -83,10 +81,7 @@ async function getEditorUrls2(options) {
|
|
|
83
81
|
err,
|
|
84
82
|
{
|
|
85
83
|
spreadPathsToArguments: {},
|
|
86
|
-
explicitPathsToArguments: {
|
|
87
|
-
branchId: "$[0].branchId",
|
|
88
|
-
editorType: "$[0].editorType"
|
|
89
|
-
},
|
|
84
|
+
explicitPathsToArguments: { branchId: "$[0].branchId" },
|
|
90
85
|
singleArgumentUnchanged: false
|
|
91
86
|
},
|
|
92
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 /**
|
|
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 /** 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 /** Wixel */\n WIXEL = 'WIXEL',\n /** StudioTwo */\n STUDIO_TWO = 'STUDIO_TWO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL'\n | 'STUDIO_TWO';\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\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 });\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: { branchId: '$[0].branchId' },\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}\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 migrationOptions: {\n optInTransformResponse: true,\n },\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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;;;AD3BO,IAAK,aAAL,kBAAKA,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAER,EAAAA,YAAA,gBAAa;AAdH,SAAAA;AAAA,GAAA;AAkEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,EACrB,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,EAAE,UAAU,gBAAgB;AAAA,QACtD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE3HO,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"]}
|
|
@@ -26,8 +26,6 @@ declare enum EditorType {
|
|
|
26
26
|
UNKNOWN = "UNKNOWN",
|
|
27
27
|
/** The classic Wix Editor. */
|
|
28
28
|
WIX_EDITOR = "WIX_EDITOR",
|
|
29
|
-
/** Deprecated. Expected end-of-life date: July 1, 2024. */
|
|
30
|
-
EDITOR_X = "EDITOR_X",
|
|
31
29
|
/** Wix's Editor built for agencies and enterprises. */
|
|
32
30
|
WIX_STUDIO = "WIX_STUDIO",
|
|
33
31
|
/** Editor 3 */
|
|
@@ -40,15 +38,13 @@ declare enum EditorType {
|
|
|
40
38
|
STUDIO_TWO = "STUDIO_TWO"
|
|
41
39
|
}
|
|
42
40
|
/** @enumType */
|
|
43
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | '
|
|
41
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL' | 'STUDIO_TWO';
|
|
44
42
|
interface GetEditorUrlsRequest {
|
|
45
43
|
/**
|
|
46
44
|
* Optional branch ID to include in generated URLs
|
|
47
45
|
* @format GUID
|
|
48
46
|
*/
|
|
49
47
|
branchId?: string | null;
|
|
50
|
-
/** Optional editor type override */
|
|
51
|
-
editorType?: EditorTypeWithLiterals;
|
|
52
48
|
}
|
|
53
49
|
interface GetEditorUrlsResponse {
|
|
54
50
|
/** Editor URL. */
|
|
@@ -84,8 +80,6 @@ interface GetEditorUrlsOptions {
|
|
|
84
80
|
* @format GUID
|
|
85
81
|
*/
|
|
86
82
|
branchId?: string | null;
|
|
87
|
-
/** Optional editor type override */
|
|
88
|
-
editorType?: EditorTypeWithLiterals;
|
|
89
83
|
}
|
|
90
84
|
|
|
91
85
|
export { EditorType, type EditorTypeWithLiterals, type EditorUrls, type GetEditorUrlsApplicationErrors, type GetEditorUrlsOptions, type GetEditorUrlsRequest, type GetEditorUrlsResponse, getEditorUrls };
|
|
@@ -58,7 +58,6 @@ function getEditorUrls(payload) {
|
|
|
58
58
|
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
59
59
|
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
60
60
|
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
61
|
-
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
62
61
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
63
62
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
64
63
|
EditorType2["PICASSO"] = "PICASSO";
|
|
@@ -69,8 +68,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
69
68
|
async function getEditorUrls2(options) {
|
|
70
69
|
const { httpClient, sideEffects } = arguments[1];
|
|
71
70
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
72
|
-
branchId: options?.branchId
|
|
73
|
-
editorType: options?.editorType
|
|
71
|
+
branchId: options?.branchId
|
|
74
72
|
});
|
|
75
73
|
const reqOpts = getEditorUrls(payload);
|
|
76
74
|
sideEffects?.onSiteCall?.();
|
|
@@ -83,10 +81,7 @@ async function getEditorUrls2(options) {
|
|
|
83
81
|
err,
|
|
84
82
|
{
|
|
85
83
|
spreadPathsToArguments: {},
|
|
86
|
-
explicitPathsToArguments: {
|
|
87
|
-
branchId: "$[0].branchId",
|
|
88
|
-
editorType: "$[0].editorType"
|
|
89
|
-
},
|
|
84
|
+
explicitPathsToArguments: { branchId: "$[0].branchId" },
|
|
90
85
|
singleArgumentUnchanged: false
|
|
91
86
|
},
|
|
92
87
|
["options"]
|
|
@@ -1 +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 /**
|
|
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 /** 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 /** Wixel */\n WIXEL = 'WIXEL',\n /** StudioTwo */\n STUDIO_TWO = 'STUDIO_TWO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL'\n | 'STUDIO_TWO';\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\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 });\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: { branchId: '$[0].branchId' },\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}\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 migrationOptions: {\n optInTransformResponse: true,\n },\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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;;;AD3BO,IAAK,aAAL,kBAAKA,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAER,EAAAA,YAAA,gBAAa;AAdH,SAAAA;AAAA,GAAA;AAkEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,EACrB,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,EAAE,UAAU,gBAAgB;AAAA,QACtD,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
|
@@ -27,8 +27,6 @@ declare enum EditorType {
|
|
|
27
27
|
UNKNOWN = "UNKNOWN",
|
|
28
28
|
/** The classic Wix Editor. */
|
|
29
29
|
WIX_EDITOR = "WIX_EDITOR",
|
|
30
|
-
/** Deprecated. Expected end-of-life date: July 1, 2024. */
|
|
31
|
-
EDITOR_X = "EDITOR_X",
|
|
32
30
|
/** Wix's Editor built for agencies and enterprises. */
|
|
33
31
|
WIX_STUDIO = "WIX_STUDIO",
|
|
34
32
|
/** Editor 3 */
|
|
@@ -41,15 +39,13 @@ declare enum EditorType {
|
|
|
41
39
|
STUDIO_TWO = "STUDIO_TWO"
|
|
42
40
|
}
|
|
43
41
|
/** @enumType */
|
|
44
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | '
|
|
42
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL' | 'STUDIO_TWO';
|
|
45
43
|
interface GetEditorUrlsRequest {
|
|
46
44
|
/**
|
|
47
45
|
* Optional branch ID to include in generated URLs
|
|
48
46
|
* @format GUID
|
|
49
47
|
*/
|
|
50
48
|
branchId?: string | null;
|
|
51
|
-
/** Optional editor type override */
|
|
52
|
-
editorType?: EditorTypeWithLiterals;
|
|
53
49
|
}
|
|
54
50
|
interface GetEditorUrlsResponse {
|
|
55
51
|
/** Editor URL. */
|
package/build/es/meta.mjs
CHANGED
|
@@ -51,7 +51,6 @@ function getEditorUrls(payload) {
|
|
|
51
51
|
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
52
52
|
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
53
53
|
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
54
|
-
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
55
54
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
56
55
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
57
56
|
EditorType2["PICASSO"] = "PICASSO";
|
package/build/es/meta.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/editorurls-v2-editor-urls-editor.http.ts","../../src/editorurls-v2-editor-urls-editor.types.ts","../../src/editorurls-v2-editor-urls-editor.meta.ts"],"sourcesContent":["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 migrationOptions: {\n optInTransformResponse: true,\n },\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","export 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 /**
|
|
1
|
+
{"version":3,"sources":["../../src/editorurls-v2-editor-urls-editor.http.ts","../../src/editorurls-v2-editor-urls-editor.types.ts","../../src/editorurls-v2-editor-urls-editor.meta.ts"],"sourcesContent":["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 migrationOptions: {\n optInTransformResponse: true,\n },\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","export 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 /** 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 /** Wixel */\n WIXEL = 'WIXEL',\n /** StudioTwo */\n STUDIO_TWO = 'STUDIO_TWO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL'\n | 'STUDIO_TWO';\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\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","import * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\nimport * as ambassadorWixEditorurlsV2EditorUrlsTypes from './editorurls-v2-editor-urls-editor.types.js';\nimport * as ambassadorWixEditorurlsV2EditorUrlsUniversalTypes from './editorurls-v2-editor-urls-editor.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getEditorUrls(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixEditorurlsV2EditorUrlsUniversalTypes.GetEditorUrlsRequest,\n ambassadorWixEditorurlsV2EditorUrlsTypes.GetEditorUrlsRequest,\n ambassadorWixEditorurlsV2EditorUrlsUniversalTypes.GetEditorUrlsResponse,\n ambassadorWixEditorurlsV2EditorUrlsTypes.GetEditorUrlsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/editor-urls',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport {\n EditorUrls as EditorUrlsOriginal,\n EditorType as EditorTypeOriginal,\n EditorTypeWithLiterals as EditorTypeWithLiteralsOriginal,\n GetEditorUrlsRequest as GetEditorUrlsRequestOriginal,\n GetEditorUrlsResponse as GetEditorUrlsResponseOriginal,\n GetEditorUrlsApplicationErrors as GetEditorUrlsApplicationErrorsOriginal,\n} from './editorurls-v2-editor-urls-editor.types.js';\n"],"mappings":";AAAA,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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;;;ACnCO,IAAK,aAAL,kBAAKA,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAER,EAAAA,YAAA,gBAAa;AAdH,SAAAA;AAAA,GAAA;;;ACAL,SAASC,iBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACgC,cAAc,OAAO;AAE3D,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["EditorType","getEditorUrls"]}
|
|
@@ -82,7 +82,6 @@ function getEditorUrls(payload) {
|
|
|
82
82
|
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
83
83
|
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
84
84
|
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
85
|
-
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
86
85
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
87
86
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
88
87
|
EditorType2["PICASSO"] = "PICASSO";
|
|
@@ -93,8 +92,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
93
92
|
async function getEditorUrls2(options) {
|
|
94
93
|
const { httpClient, sideEffects } = arguments[1];
|
|
95
94
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
96
|
-
branchId: options?.branchId
|
|
97
|
-
editorType: options?.editorType
|
|
95
|
+
branchId: options?.branchId
|
|
98
96
|
});
|
|
99
97
|
const reqOpts = getEditorUrls(payload);
|
|
100
98
|
sideEffects?.onSiteCall?.();
|
|
@@ -107,10 +105,7 @@ async function getEditorUrls2(options) {
|
|
|
107
105
|
err,
|
|
108
106
|
{
|
|
109
107
|
spreadPathsToArguments: {},
|
|
110
|
-
explicitPathsToArguments: {
|
|
111
|
-
branchId: "$[0].branchId",
|
|
112
|
-
editorType: "$[0].editorType"
|
|
113
|
-
},
|
|
108
|
+
explicitPathsToArguments: { branchId: "$[0].branchId" },
|
|
114
109
|
singleArgumentUnchanged: false
|
|
115
110
|
},
|
|
116
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 /**
|
|
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 /** 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 /** Wixel */\n WIXEL = 'WIXEL',\n /** StudioTwo */\n STUDIO_TWO = 'STUDIO_TWO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL'\n | 'STUDIO_TWO';\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\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 });\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: { branchId: '$[0].branchId' },\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}\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 migrationOptions: {\n optInTransformResponse: true,\n },\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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;;;AD3BO,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAER,EAAAA,YAAA,gBAAa;AAdH,SAAAA;AAAA,GAAA;AAkEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,EACrB,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,EAAE,UAAU,gBAAgB;AAAA,QACtD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE3HO,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"]}
|
|
@@ -26,8 +26,6 @@ declare enum EditorType {
|
|
|
26
26
|
UNKNOWN = "UNKNOWN",
|
|
27
27
|
/** The classic Wix Editor. */
|
|
28
28
|
WIX_EDITOR = "WIX_EDITOR",
|
|
29
|
-
/** Deprecated. Expected end-of-life date: July 1, 2024. */
|
|
30
|
-
EDITOR_X = "EDITOR_X",
|
|
31
29
|
/** Wix's Editor built for agencies and enterprises. */
|
|
32
30
|
WIX_STUDIO = "WIX_STUDIO",
|
|
33
31
|
/** Editor 3 */
|
|
@@ -40,15 +38,13 @@ declare enum EditorType {
|
|
|
40
38
|
STUDIO_TWO = "STUDIO_TWO"
|
|
41
39
|
}
|
|
42
40
|
/** @enumType */
|
|
43
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | '
|
|
41
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL' | 'STUDIO_TWO';
|
|
44
42
|
interface GetEditorUrlsRequest {
|
|
45
43
|
/**
|
|
46
44
|
* Optional branch ID to include in generated URLs
|
|
47
45
|
* @format GUID
|
|
48
46
|
*/
|
|
49
47
|
branchId?: string | null;
|
|
50
|
-
/** Optional editor type override */
|
|
51
|
-
editorType?: EditorTypeWithLiterals;
|
|
52
48
|
}
|
|
53
49
|
interface GetEditorUrlsResponse {
|
|
54
50
|
/** Editor URL. */
|
|
@@ -84,8 +80,6 @@ interface GetEditorUrlsOptions {
|
|
|
84
80
|
* @format GUID
|
|
85
81
|
*/
|
|
86
82
|
branchId?: string | null;
|
|
87
|
-
/** Optional editor type override */
|
|
88
|
-
editorType?: EditorTypeWithLiterals;
|
|
89
83
|
}
|
|
90
84
|
|
|
91
85
|
export { EditorType, type EditorTypeWithLiterals, type EditorUrls, type GetEditorUrlsApplicationErrors, type GetEditorUrlsOptions, type GetEditorUrlsRequest, type GetEditorUrlsResponse, getEditorUrls };
|
|
@@ -82,7 +82,6 @@ function getEditorUrls(payload) {
|
|
|
82
82
|
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
83
83
|
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
84
84
|
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
85
|
-
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
86
85
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
87
86
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
88
87
|
EditorType2["PICASSO"] = "PICASSO";
|
|
@@ -93,8 +92,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
93
92
|
async function getEditorUrls2(options) {
|
|
94
93
|
const { httpClient, sideEffects } = arguments[1];
|
|
95
94
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
96
|
-
branchId: options?.branchId
|
|
97
|
-
editorType: options?.editorType
|
|
95
|
+
branchId: options?.branchId
|
|
98
96
|
});
|
|
99
97
|
const reqOpts = getEditorUrls(payload);
|
|
100
98
|
sideEffects?.onSiteCall?.();
|
|
@@ -107,10 +105,7 @@ async function getEditorUrls2(options) {
|
|
|
107
105
|
err,
|
|
108
106
|
{
|
|
109
107
|
spreadPathsToArguments: {},
|
|
110
|
-
explicitPathsToArguments: {
|
|
111
|
-
branchId: "$[0].branchId",
|
|
112
|
-
editorType: "$[0].editorType"
|
|
113
|
-
},
|
|
108
|
+
explicitPathsToArguments: { branchId: "$[0].branchId" },
|
|
114
109
|
singleArgumentUnchanged: false
|
|
115
110
|
},
|
|
116
111
|
["options"]
|
|
@@ -1 +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 /**
|
|
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 /** 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 /** Wixel */\n WIXEL = 'WIXEL',\n /** StudioTwo */\n STUDIO_TWO = 'STUDIO_TWO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL'\n | 'STUDIO_TWO';\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\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 });\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: { branchId: '$[0].branchId' },\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}\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 migrationOptions: {\n optInTransformResponse: true,\n },\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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;;;AD3BO,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAER,EAAAA,YAAA,gBAAa;AAdH,SAAAA;AAAA,GAAA;AAkEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,EACrB,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,EAAE,UAAU,gBAAgB;AAAA,QACtD,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"]}
|
|
@@ -27,8 +27,6 @@ declare enum EditorType {
|
|
|
27
27
|
UNKNOWN = "UNKNOWN",
|
|
28
28
|
/** The classic Wix Editor. */
|
|
29
29
|
WIX_EDITOR = "WIX_EDITOR",
|
|
30
|
-
/** Deprecated. Expected end-of-life date: July 1, 2024. */
|
|
31
|
-
EDITOR_X = "EDITOR_X",
|
|
32
30
|
/** Wix's Editor built for agencies and enterprises. */
|
|
33
31
|
WIX_STUDIO = "WIX_STUDIO",
|
|
34
32
|
/** Editor 3 */
|
|
@@ -41,15 +39,13 @@ declare enum EditorType {
|
|
|
41
39
|
STUDIO_TWO = "STUDIO_TWO"
|
|
42
40
|
}
|
|
43
41
|
/** @enumType */
|
|
44
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | '
|
|
42
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL' | 'STUDIO_TWO';
|
|
45
43
|
interface GetEditorUrlsRequest {
|
|
46
44
|
/**
|
|
47
45
|
* Optional branch ID to include in generated URLs
|
|
48
46
|
* @format GUID
|
|
49
47
|
*/
|
|
50
48
|
branchId?: string | null;
|
|
51
|
-
/** Optional editor type override */
|
|
52
|
-
editorType?: EditorTypeWithLiterals;
|
|
53
49
|
}
|
|
54
50
|
interface GetEditorUrlsResponse {
|
|
55
51
|
/** Editor URL. */
|
|
@@ -78,7 +78,6 @@ function getEditorUrls(payload) {
|
|
|
78
78
|
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
79
79
|
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
80
80
|
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
81
|
-
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
82
81
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
83
82
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
84
83
|
EditorType2["PICASSO"] = "PICASSO";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../meta.ts","../../../src/editorurls-v2-editor-urls-editor.http.ts","../../../src/editorurls-v2-editor-urls-editor.types.ts","../../../src/editorurls-v2-editor-urls-editor.meta.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.meta.js';\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 migrationOptions: {\n optInTransformResponse: true,\n },\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","export 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 /**
|
|
1
|
+
{"version":3,"sources":["../../../meta.ts","../../../src/editorurls-v2-editor-urls-editor.http.ts","../../../src/editorurls-v2-editor-urls-editor.types.ts","../../../src/editorurls-v2-editor-urls-editor.meta.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.meta.js';\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 migrationOptions: {\n optInTransformResponse: true,\n },\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","export 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 /** 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 /** Wixel */\n WIXEL = 'WIXEL',\n /** StudioTwo */\n STUDIO_TWO = 'STUDIO_TWO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL'\n | 'STUDIO_TWO';\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\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","import * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\nimport * as ambassadorWixEditorurlsV2EditorUrlsTypes from './editorurls-v2-editor-urls-editor.types.js';\nimport * as ambassadorWixEditorurlsV2EditorUrlsUniversalTypes from './editorurls-v2-editor-urls-editor.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getEditorUrls(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixEditorurlsV2EditorUrlsUniversalTypes.GetEditorUrlsRequest,\n ambassadorWixEditorurlsV2EditorUrlsTypes.GetEditorUrlsRequest,\n ambassadorWixEditorurlsV2EditorUrlsUniversalTypes.GetEditorUrlsResponse,\n ambassadorWixEditorurlsV2EditorUrlsTypes.GetEditorUrlsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/editor-urls',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport {\n EditorUrls as EditorUrlsOriginal,\n EditorType as EditorTypeOriginal,\n EditorTypeWithLiterals as EditorTypeWithLiteralsOriginal,\n GetEditorUrlsRequest as GetEditorUrlsRequestOriginal,\n GetEditorUrlsResponse as GetEditorUrlsResponseOriginal,\n GetEditorUrlsApplicationErrors as GetEditorUrlsApplicationErrorsOriginal,\n} from './editorurls-v2-editor-urls-editor.types.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA;AAAA;;;ACAA,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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;;;ACnCO,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAER,EAAAA,YAAA,gBAAa;AAdH,SAAAA;AAAA,GAAA;;;ACAL,SAASC,iBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACgC,cAAc,OAAO;AAE3D,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["getEditorUrls","import_rest_modules","EditorType","getEditorUrls"]}
|
|
@@ -58,7 +58,6 @@ function getEditorUrls(payload) {
|
|
|
58
58
|
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
59
59
|
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
60
60
|
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
61
|
-
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
62
61
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
63
62
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
64
63
|
EditorType2["PICASSO"] = "PICASSO";
|
|
@@ -69,8 +68,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
69
68
|
async function getEditorUrls2(options) {
|
|
70
69
|
const { httpClient, sideEffects } = arguments[1];
|
|
71
70
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
72
|
-
branchId: options?.branchId
|
|
73
|
-
editorType: options?.editorType
|
|
71
|
+
branchId: options?.branchId
|
|
74
72
|
});
|
|
75
73
|
const reqOpts = getEditorUrls(payload);
|
|
76
74
|
sideEffects?.onSiteCall?.();
|
|
@@ -83,10 +81,7 @@ async function getEditorUrls2(options) {
|
|
|
83
81
|
err,
|
|
84
82
|
{
|
|
85
83
|
spreadPathsToArguments: {},
|
|
86
|
-
explicitPathsToArguments: {
|
|
87
|
-
branchId: "$[0].branchId",
|
|
88
|
-
editorType: "$[0].editorType"
|
|
89
|
-
},
|
|
84
|
+
explicitPathsToArguments: { branchId: "$[0].branchId" },
|
|
90
85
|
singleArgumentUnchanged: false
|
|
91
86
|
},
|
|
92
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 /**
|
|
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 /** 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 /** Wixel */\n WIXEL = 'WIXEL',\n /** StudioTwo */\n STUDIO_TWO = 'STUDIO_TWO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL'\n | 'STUDIO_TWO';\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\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 });\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: { branchId: '$[0].branchId' },\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}\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 migrationOptions: {\n optInTransformResponse: true,\n },\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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;;;AD3BO,IAAK,aAAL,kBAAKA,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAER,EAAAA,YAAA,gBAAa;AAdH,SAAAA;AAAA,GAAA;AAkEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,EACrB,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,EAAE,UAAU,gBAAgB;AAAA,QACtD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE3HO,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"]}
|
|
@@ -26,8 +26,6 @@ declare enum EditorType {
|
|
|
26
26
|
UNKNOWN = "UNKNOWN",
|
|
27
27
|
/** The classic Wix Editor. */
|
|
28
28
|
WIX_EDITOR = "WIX_EDITOR",
|
|
29
|
-
/** Deprecated. Expected end-of-life date: July 1, 2024. */
|
|
30
|
-
EDITOR_X = "EDITOR_X",
|
|
31
29
|
/** Wix's Editor built for agencies and enterprises. */
|
|
32
30
|
WIX_STUDIO = "WIX_STUDIO",
|
|
33
31
|
/** Editor 3 */
|
|
@@ -40,15 +38,13 @@ declare enum EditorType {
|
|
|
40
38
|
STUDIO_TWO = "STUDIO_TWO"
|
|
41
39
|
}
|
|
42
40
|
/** @enumType */
|
|
43
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | '
|
|
41
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL' | 'STUDIO_TWO';
|
|
44
42
|
interface GetEditorUrlsRequest {
|
|
45
43
|
/**
|
|
46
44
|
* Optional branch ID to include in generated URLs
|
|
47
45
|
* @format GUID
|
|
48
46
|
*/
|
|
49
47
|
branchId?: string | null;
|
|
50
|
-
/** Optional editor type override */
|
|
51
|
-
editorType?: EditorTypeWithLiterals;
|
|
52
48
|
}
|
|
53
49
|
interface GetEditorUrlsResponse {
|
|
54
50
|
/** Editor URL. */
|
|
@@ -84,8 +80,6 @@ interface GetEditorUrlsOptions {
|
|
|
84
80
|
* @format GUID
|
|
85
81
|
*/
|
|
86
82
|
branchId?: string | null;
|
|
87
|
-
/** Optional editor type override */
|
|
88
|
-
editorType?: EditorTypeWithLiterals;
|
|
89
83
|
}
|
|
90
84
|
|
|
91
85
|
export { EditorType, type EditorTypeWithLiterals, type EditorUrls, type GetEditorUrlsApplicationErrors, type GetEditorUrlsOptions, type GetEditorUrlsRequest, type GetEditorUrlsResponse, getEditorUrls };
|
|
@@ -58,7 +58,6 @@ function getEditorUrls(payload) {
|
|
|
58
58
|
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
59
59
|
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
60
60
|
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
61
|
-
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
62
61
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
63
62
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
64
63
|
EditorType2["PICASSO"] = "PICASSO";
|
|
@@ -69,8 +68,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
69
68
|
async function getEditorUrls2(options) {
|
|
70
69
|
const { httpClient, sideEffects } = arguments[1];
|
|
71
70
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
72
|
-
branchId: options?.branchId
|
|
73
|
-
editorType: options?.editorType
|
|
71
|
+
branchId: options?.branchId
|
|
74
72
|
});
|
|
75
73
|
const reqOpts = getEditorUrls(payload);
|
|
76
74
|
sideEffects?.onSiteCall?.();
|
|
@@ -83,10 +81,7 @@ async function getEditorUrls2(options) {
|
|
|
83
81
|
err,
|
|
84
82
|
{
|
|
85
83
|
spreadPathsToArguments: {},
|
|
86
|
-
explicitPathsToArguments: {
|
|
87
|
-
branchId: "$[0].branchId",
|
|
88
|
-
editorType: "$[0].editorType"
|
|
89
|
-
},
|
|
84
|
+
explicitPathsToArguments: { branchId: "$[0].branchId" },
|
|
90
85
|
singleArgumentUnchanged: false
|
|
91
86
|
},
|
|
92
87
|
["options"]
|
|
@@ -1 +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 /**
|
|
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 /** 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 /** Wixel */\n WIXEL = 'WIXEL',\n /** StudioTwo */\n STUDIO_TWO = 'STUDIO_TWO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL'\n | 'STUDIO_TWO';\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\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 });\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: { branchId: '$[0].branchId' },\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}\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 migrationOptions: {\n optInTransformResponse: true,\n },\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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;;;AD3BO,IAAK,aAAL,kBAAKA,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAER,EAAAA,YAAA,gBAAa;AAdH,SAAAA;AAAA,GAAA;AAkEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,EACrB,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,EAAE,UAAU,gBAAgB;AAAA,QACtD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["EditorType","getEditorUrls"]}
|
|
@@ -27,8 +27,6 @@ declare enum EditorType {
|
|
|
27
27
|
UNKNOWN = "UNKNOWN",
|
|
28
28
|
/** The classic Wix Editor. */
|
|
29
29
|
WIX_EDITOR = "WIX_EDITOR",
|
|
30
|
-
/** Deprecated. Expected end-of-life date: July 1, 2024. */
|
|
31
|
-
EDITOR_X = "EDITOR_X",
|
|
32
30
|
/** Wix's Editor built for agencies and enterprises. */
|
|
33
31
|
WIX_STUDIO = "WIX_STUDIO",
|
|
34
32
|
/** Editor 3 */
|
|
@@ -41,15 +39,13 @@ declare enum EditorType {
|
|
|
41
39
|
STUDIO_TWO = "STUDIO_TWO"
|
|
42
40
|
}
|
|
43
41
|
/** @enumType */
|
|
44
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | '
|
|
42
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL' | 'STUDIO_TWO';
|
|
45
43
|
interface GetEditorUrlsRequest {
|
|
46
44
|
/**
|
|
47
45
|
* Optional branch ID to include in generated URLs
|
|
48
46
|
* @format GUID
|
|
49
47
|
*/
|
|
50
48
|
branchId?: string | null;
|
|
51
|
-
/** Optional editor type override */
|
|
52
|
-
editorType?: EditorTypeWithLiterals;
|
|
53
49
|
}
|
|
54
50
|
interface GetEditorUrlsResponse {
|
|
55
51
|
/** Editor URL. */
|
|
@@ -51,7 +51,6 @@ function getEditorUrls(payload) {
|
|
|
51
51
|
var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
52
52
|
EditorType2["UNKNOWN"] = "UNKNOWN";
|
|
53
53
|
EditorType2["WIX_EDITOR"] = "WIX_EDITOR";
|
|
54
|
-
EditorType2["EDITOR_X"] = "EDITOR_X";
|
|
55
54
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
56
55
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
57
56
|
EditorType2["PICASSO"] = "PICASSO";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/editorurls-v2-editor-urls-editor.http.ts","../../../src/editorurls-v2-editor-urls-editor.types.ts","../../../src/editorurls-v2-editor-urls-editor.meta.ts"],"sourcesContent":["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 migrationOptions: {\n optInTransformResponse: true,\n },\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","export 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 /**
|
|
1
|
+
{"version":3,"sources":["../../../src/editorurls-v2-editor-urls-editor.http.ts","../../../src/editorurls-v2-editor-urls-editor.types.ts","../../../src/editorurls-v2-editor-urls-editor.meta.ts"],"sourcesContent":["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 migrationOptions: {\n optInTransformResponse: true,\n },\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","export 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 /** 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 /** Wixel */\n WIXEL = 'WIXEL',\n /** StudioTwo */\n STUDIO_TWO = 'STUDIO_TWO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL'\n | 'STUDIO_TWO';\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\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","import * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\nimport * as ambassadorWixEditorurlsV2EditorUrlsTypes from './editorurls-v2-editor-urls-editor.types.js';\nimport * as ambassadorWixEditorurlsV2EditorUrlsUniversalTypes from './editorurls-v2-editor-urls-editor.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getEditorUrls(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixEditorurlsV2EditorUrlsUniversalTypes.GetEditorUrlsRequest,\n ambassadorWixEditorurlsV2EditorUrlsTypes.GetEditorUrlsRequest,\n ambassadorWixEditorurlsV2EditorUrlsUniversalTypes.GetEditorUrlsResponse,\n ambassadorWixEditorurlsV2EditorUrlsTypes.GetEditorUrlsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/editor-urls',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport {\n EditorUrls as EditorUrlsOriginal,\n EditorType as EditorTypeOriginal,\n EditorTypeWithLiterals as EditorTypeWithLiteralsOriginal,\n GetEditorUrlsRequest as GetEditorUrlsRequestOriginal,\n GetEditorUrlsResponse as GetEditorUrlsResponseOriginal,\n GetEditorUrlsApplicationErrors as GetEditorUrlsApplicationErrorsOriginal,\n} from './editorurls-v2-editor-urls-editor.types.js';\n"],"mappings":";AAAA,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,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,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;;;ACnCO,IAAK,aAAL,kBAAKA,gBAAL;AAEL,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAER,EAAAA,YAAA,gBAAa;AAdH,SAAAA;AAAA,GAAA;;;ACAL,SAASC,iBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACgC,cAAc,OAAO;AAE3D,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["EditorType","getEditorUrls"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/auto_sdk_urls_editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"service-plugins"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@wix/sdk-runtime": "^0.
|
|
33
|
-
"@wix/sdk-types": "^1.
|
|
32
|
+
"@wix/sdk-runtime": "^1.0.0",
|
|
33
|
+
"@wix/sdk-types": "^1.15.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"tsup": "^8.4.0",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"fqdn": "wix.editorurls.v2.editor_urls"
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
"falconPackageHash": "
|
|
53
|
+
"falconPackageHash": "801abd1ee0623174c44a7174808cc1b3ccf5bb621d15737f3197f1d6"
|
|
54
54
|
}
|