@wix/auto_sdk_urls_editor 1.0.13 → 1.0.14
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 +1 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +4 -2
- package/build/cjs/index.typings.js +1 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +4 -2
- package/build/cjs/meta.js +1 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.mjs +1 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +4 -2
- package/build/es/index.typings.mjs +1 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +4 -2
- package/build/es/meta.mjs +1 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.js +1 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +4 -2
- package/build/internal/cjs/index.typings.js +1 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +4 -2
- package/build/internal/cjs/meta.js +1 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.mjs +1 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +4 -2
- package/build/internal/es/index.typings.mjs +1 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +4 -2
- package/build/internal/es/meta.mjs +1 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.js
CHANGED
|
@@ -86,6 +86,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
86
86
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
87
87
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
88
88
|
EditorType2["PICASSO"] = "PICASSO";
|
|
89
|
+
EditorType2["WIXEL"] = "WIXEL";
|
|
89
90
|
return EditorType2;
|
|
90
91
|
})(EditorType || {});
|
|
91
92
|
async function getEditorUrls2(options) {
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../src/editorurls-v2-editor-urls-editor.universal.ts","../../src/editorurls-v2-editor-urls-editor.http.ts","../../src/editorurls-v2-editor-urls-editor.public.ts","../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/editorurls-v2-editor-urls-editor.universal.ts","../../src/editorurls-v2-editor-urls-editor.http.ts","../../src/editorurls-v2-editor-urls-editor.public.ts","../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n /** Wixel */\n WIXEL = 'WIXEL',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAdE,SAAAA;AAAA,GAAA;AAoEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEjIO,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"]}
|
|
@@ -33,10 +33,12 @@ declare enum EditorType {
|
|
|
33
33
|
/** Editor 3 */
|
|
34
34
|
ODEDITOR = "ODEDITOR",
|
|
35
35
|
/** Picasso */
|
|
36
|
-
PICASSO = "PICASSO"
|
|
36
|
+
PICASSO = "PICASSO",
|
|
37
|
+
/** Wixel */
|
|
38
|
+
WIXEL = "WIXEL"
|
|
37
39
|
}
|
|
38
40
|
/** @enumType */
|
|
39
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO';
|
|
41
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL';
|
|
40
42
|
interface GetEditorUrlsRequest {
|
|
41
43
|
/**
|
|
42
44
|
* Optional branch ID to include in generated URLs
|
|
@@ -86,6 +86,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
86
86
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
87
87
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
88
88
|
EditorType2["PICASSO"] = "PICASSO";
|
|
89
|
+
EditorType2["WIXEL"] = "WIXEL";
|
|
89
90
|
return EditorType2;
|
|
90
91
|
})(EditorType || {});
|
|
91
92
|
async function getEditorUrls2(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 /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/editorurls-v2-editor-urls-editor.universal.ts","../../src/editorurls-v2-editor-urls-editor.http.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n /** Wixel */\n WIXEL = 'WIXEL',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAdE,SAAAA;AAAA,GAAA;AAoEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getEditorUrls","import_rest_modules","EditorType","getEditorUrls","sdkTransformError"]}
|
package/build/cjs/meta.d.ts
CHANGED
|
@@ -34,10 +34,12 @@ declare enum EditorType {
|
|
|
34
34
|
/** Editor 3 */
|
|
35
35
|
ODEDITOR = "ODEDITOR",
|
|
36
36
|
/** Picasso */
|
|
37
|
-
PICASSO = "PICASSO"
|
|
37
|
+
PICASSO = "PICASSO",
|
|
38
|
+
/** Wixel */
|
|
39
|
+
WIXEL = "WIXEL"
|
|
38
40
|
}
|
|
39
41
|
/** @enumType */
|
|
40
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO';
|
|
42
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL';
|
|
41
43
|
interface GetEditorUrlsRequest {
|
|
42
44
|
/**
|
|
43
45
|
* Optional branch ID to include in generated URLs
|
package/build/cjs/meta.js
CHANGED
|
@@ -82,6 +82,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
82
82
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
83
83
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
84
84
|
EditorType2["PICASSO"] = "PICASSO";
|
|
85
|
+
EditorType2["WIXEL"] = "WIXEL";
|
|
85
86
|
return EditorType2;
|
|
86
87
|
})(EditorType || {});
|
|
87
88
|
|
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 /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n","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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;
|
|
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 /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n /** Wixel */\n WIXEL = 'WIXEL',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n","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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAdE,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
|
@@ -62,6 +62,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
62
62
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
63
63
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
64
64
|
EditorType2["PICASSO"] = "PICASSO";
|
|
65
|
+
EditorType2["WIXEL"] = "WIXEL";
|
|
65
66
|
return EditorType2;
|
|
66
67
|
})(EditorType || {});
|
|
67
68
|
async function getEditorUrls2(options) {
|
package/build/es/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/editorurls-v2-editor-urls-editor.universal.ts","../../src/editorurls-v2-editor-urls-editor.http.ts","../../src/editorurls-v2-editor-urls-editor.public.ts","../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;
|
|
1
|
+
{"version":3,"sources":["../../src/editorurls-v2-editor-urls-editor.universal.ts","../../src/editorurls-v2-editor-urls-editor.http.ts","../../src/editorurls-v2-editor-urls-editor.public.ts","../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n /** Wixel */\n WIXEL = 'WIXEL',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAdE,SAAAA;AAAA,GAAA;AAoEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEjIO,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"]}
|
|
@@ -33,10 +33,12 @@ declare enum EditorType {
|
|
|
33
33
|
/** Editor 3 */
|
|
34
34
|
ODEDITOR = "ODEDITOR",
|
|
35
35
|
/** Picasso */
|
|
36
|
-
PICASSO = "PICASSO"
|
|
36
|
+
PICASSO = "PICASSO",
|
|
37
|
+
/** Wixel */
|
|
38
|
+
WIXEL = "WIXEL"
|
|
37
39
|
}
|
|
38
40
|
/** @enumType */
|
|
39
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO';
|
|
41
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL';
|
|
40
42
|
interface GetEditorUrlsRequest {
|
|
41
43
|
/**
|
|
42
44
|
* Optional branch ID to include in generated URLs
|
|
@@ -62,6 +62,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
62
62
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
63
63
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
64
64
|
EditorType2["PICASSO"] = "PICASSO";
|
|
65
|
+
EditorType2["WIXEL"] = "WIXEL";
|
|
65
66
|
return EditorType2;
|
|
66
67
|
})(EditorType || {});
|
|
67
68
|
async function getEditorUrls2(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 /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;
|
|
1
|
+
{"version":3,"sources":["../../src/editorurls-v2-editor-urls-editor.universal.ts","../../src/editorurls-v2-editor-urls-editor.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n /** Wixel */\n WIXEL = 'WIXEL',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAdE,SAAAA;AAAA,GAAA;AAoEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["EditorType","getEditorUrls"]}
|
package/build/es/meta.d.mts
CHANGED
|
@@ -34,10 +34,12 @@ declare enum EditorType {
|
|
|
34
34
|
/** Editor 3 */
|
|
35
35
|
ODEDITOR = "ODEDITOR",
|
|
36
36
|
/** Picasso */
|
|
37
|
-
PICASSO = "PICASSO"
|
|
37
|
+
PICASSO = "PICASSO",
|
|
38
|
+
/** Wixel */
|
|
39
|
+
WIXEL = "WIXEL"
|
|
38
40
|
}
|
|
39
41
|
/** @enumType */
|
|
40
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO';
|
|
42
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL';
|
|
41
43
|
interface GetEditorUrlsRequest {
|
|
42
44
|
/**
|
|
43
45
|
* Optional branch ID to include in generated URLs
|
package/build/es/meta.mjs
CHANGED
|
@@ -55,6 +55,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
55
55
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
56
56
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
57
57
|
EditorType2["PICASSO"] = "PICASSO";
|
|
58
|
+
EditorType2["WIXEL"] = "WIXEL";
|
|
58
59
|
return EditorType2;
|
|
59
60
|
})(EditorType || {});
|
|
60
61
|
|
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 /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n","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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;
|
|
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 /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n /** Wixel */\n WIXEL = 'WIXEL',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n","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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAdE,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"]}
|
|
@@ -86,6 +86,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
86
86
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
87
87
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
88
88
|
EditorType2["PICASSO"] = "PICASSO";
|
|
89
|
+
EditorType2["WIXEL"] = "WIXEL";
|
|
89
90
|
return EditorType2;
|
|
90
91
|
})(EditorType || {});
|
|
91
92
|
async function getEditorUrls2(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../index.ts","../../../src/editorurls-v2-editor-urls-editor.universal.ts","../../../src/editorurls-v2-editor-urls-editor.http.ts","../../../src/editorurls-v2-editor-urls-editor.public.ts","../../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;
|
|
1
|
+
{"version":3,"sources":["../../../index.ts","../../../src/editorurls-v2-editor-urls-editor.universal.ts","../../../src/editorurls-v2-editor-urls-editor.http.ts","../../../src/editorurls-v2-editor-urls-editor.public.ts","../../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n /** Wixel */\n WIXEL = 'WIXEL',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAdE,SAAAA;AAAA,GAAA;AAoEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEjIO,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"]}
|
|
@@ -33,10 +33,12 @@ declare enum EditorType {
|
|
|
33
33
|
/** Editor 3 */
|
|
34
34
|
ODEDITOR = "ODEDITOR",
|
|
35
35
|
/** Picasso */
|
|
36
|
-
PICASSO = "PICASSO"
|
|
36
|
+
PICASSO = "PICASSO",
|
|
37
|
+
/** Wixel */
|
|
38
|
+
WIXEL = "WIXEL"
|
|
37
39
|
}
|
|
38
40
|
/** @enumType */
|
|
39
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO';
|
|
41
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL';
|
|
40
42
|
interface GetEditorUrlsRequest {
|
|
41
43
|
/**
|
|
42
44
|
* Optional branch ID to include in generated URLs
|
|
@@ -86,6 +86,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
86
86
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
87
87
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
88
88
|
EditorType2["PICASSO"] = "PICASSO";
|
|
89
|
+
EditorType2["WIXEL"] = "WIXEL";
|
|
89
90
|
return EditorType2;
|
|
90
91
|
})(EditorType || {});
|
|
91
92
|
async function getEditorUrls2(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 /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;
|
|
1
|
+
{"version":3,"sources":["../../../index.typings.ts","../../../src/editorurls-v2-editor-urls-editor.universal.ts","../../../src/editorurls-v2-editor-urls-editor.http.ts"],"sourcesContent":["export * from './src/editorurls-v2-editor-urls-editor.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n /** Wixel */\n WIXEL = 'WIXEL',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAdE,SAAAA;AAAA,GAAA;AAoEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getEditorUrls","import_rest_modules","EditorType","getEditorUrls","sdkTransformError"]}
|
|
@@ -34,10 +34,12 @@ declare enum EditorType {
|
|
|
34
34
|
/** Editor 3 */
|
|
35
35
|
ODEDITOR = "ODEDITOR",
|
|
36
36
|
/** Picasso */
|
|
37
|
-
PICASSO = "PICASSO"
|
|
37
|
+
PICASSO = "PICASSO",
|
|
38
|
+
/** Wixel */
|
|
39
|
+
WIXEL = "WIXEL"
|
|
38
40
|
}
|
|
39
41
|
/** @enumType */
|
|
40
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO';
|
|
42
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL';
|
|
41
43
|
interface GetEditorUrlsRequest {
|
|
42
44
|
/**
|
|
43
45
|
* Optional branch ID to include in generated URLs
|
|
@@ -82,6 +82,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
82
82
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
83
83
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
84
84
|
EditorType2["PICASSO"] = "PICASSO";
|
|
85
|
+
EditorType2["WIXEL"] = "WIXEL";
|
|
85
86
|
return EditorType2;
|
|
86
87
|
})(EditorType || {});
|
|
87
88
|
|
|
@@ -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 /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n","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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;
|
|
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 /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n /** Wixel */\n WIXEL = 'WIXEL',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n","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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAdE,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"]}
|
|
@@ -62,6 +62,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
62
62
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
63
63
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
64
64
|
EditorType2["PICASSO"] = "PICASSO";
|
|
65
|
+
EditorType2["WIXEL"] = "WIXEL";
|
|
65
66
|
return EditorType2;
|
|
66
67
|
})(EditorType || {});
|
|
67
68
|
async function getEditorUrls2(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/editorurls-v2-editor-urls-editor.universal.ts","../../../src/editorurls-v2-editor-urls-editor.http.ts","../../../src/editorurls-v2-editor-urls-editor.public.ts","../../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;
|
|
1
|
+
{"version":3,"sources":["../../../src/editorurls-v2-editor-urls-editor.universal.ts","../../../src/editorurls-v2-editor-urls-editor.http.ts","../../../src/editorurls-v2-editor-urls-editor.public.ts","../../../src/editorurls-v2-editor-urls-editor.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n /** Wixel */\n WIXEL = 'WIXEL',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAdE,SAAAA;AAAA,GAAA;AAoEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEjIO,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"]}
|
|
@@ -33,10 +33,12 @@ declare enum EditorType {
|
|
|
33
33
|
/** Editor 3 */
|
|
34
34
|
ODEDITOR = "ODEDITOR",
|
|
35
35
|
/** Picasso */
|
|
36
|
-
PICASSO = "PICASSO"
|
|
36
|
+
PICASSO = "PICASSO",
|
|
37
|
+
/** Wixel */
|
|
38
|
+
WIXEL = "WIXEL"
|
|
37
39
|
}
|
|
38
40
|
/** @enumType */
|
|
39
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO';
|
|
41
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL';
|
|
40
42
|
interface GetEditorUrlsRequest {
|
|
41
43
|
/**
|
|
42
44
|
* Optional branch ID to include in generated URLs
|
|
@@ -62,6 +62,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
62
62
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
63
63
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
64
64
|
EditorType2["PICASSO"] = "PICASSO";
|
|
65
|
+
EditorType2["WIXEL"] = "WIXEL";
|
|
65
66
|
return EditorType2;
|
|
66
67
|
})(EditorType || {});
|
|
67
68
|
async function getEditorUrls2(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 /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;
|
|
1
|
+
{"version":3,"sources":["../../../src/editorurls-v2-editor-urls-editor.universal.ts","../../../src/editorurls-v2-editor-urls-editor.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n /**\n * Editor type.\n * @readonly\n */\n editorType?: EditorTypeWithLiterals;\n /**\n * Editor URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n editorUrl?: string | null;\n /**\n * Preview URL.\n * @maxLength 2048\n * @format WEB_URL\n * @readonly\n */\n previewUrl?: string | null;\n}\n\nexport enum EditorType {\n /** Unknown editor type. */\n UNKNOWN = 'UNKNOWN',\n /** The classic Wix Editor. */\n WIX_EDITOR = 'WIX_EDITOR',\n /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n /** Wixel */\n WIXEL = 'WIXEL',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n branchId: options?.branchId,\n editorType: options?.editorType,\n });\n\n const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n branchId: '$[0].branchId',\n editorType: '$[0].editorType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetEditorUrlsOptions {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/editor-urls',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/editorurls/v2/editor-urls',\n destPath: '/v2/editor-urls',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n function __getEditorUrls({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.editorurls.v2.editor_urls',\n method: 'GET' as any,\n methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n packageName: PACKAGE_NAME,\n 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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAdE,SAAAA;AAAA,GAAA;AAoEZ,eAAsBC,eAAc,SAIlC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD,UAAU,SAAS;AAAA,IACnB,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAA8C,cAAc,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["EditorType","getEditorUrls"]}
|
|
@@ -34,10 +34,12 @@ declare enum EditorType {
|
|
|
34
34
|
/** Editor 3 */
|
|
35
35
|
ODEDITOR = "ODEDITOR",
|
|
36
36
|
/** Picasso */
|
|
37
|
-
PICASSO = "PICASSO"
|
|
37
|
+
PICASSO = "PICASSO",
|
|
38
|
+
/** Wixel */
|
|
39
|
+
WIXEL = "WIXEL"
|
|
38
40
|
}
|
|
39
41
|
/** @enumType */
|
|
40
|
-
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO';
|
|
42
|
+
type EditorTypeWithLiterals = EditorType | 'UNKNOWN' | 'WIX_EDITOR' | 'EDITOR_X' | 'WIX_STUDIO' | 'ODEDITOR' | 'PICASSO' | 'WIXEL';
|
|
41
43
|
interface GetEditorUrlsRequest {
|
|
42
44
|
/**
|
|
43
45
|
* Optional branch ID to include in generated URLs
|
|
@@ -55,6 +55,7 @@ var EditorType = /* @__PURE__ */ ((EditorType2) => {
|
|
|
55
55
|
EditorType2["WIX_STUDIO"] = "WIX_STUDIO";
|
|
56
56
|
EditorType2["ODEDITOR"] = "ODEDITOR";
|
|
57
57
|
EditorType2["PICASSO"] = "PICASSO";
|
|
58
|
+
EditorType2["WIXEL"] = "WIXEL";
|
|
58
59
|
return EditorType2;
|
|
59
60
|
})(EditorType || {});
|
|
60
61
|
|
|
@@ -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 /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n","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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;
|
|
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 /** Deprecated. Expected end-of-life date: July 1, 2024. */\n EDITOR_X = 'EDITOR_X',\n /** Wix's Editor built for agencies and enterprises. */\n WIX_STUDIO = 'WIX_STUDIO',\n /** Editor 3 */\n ODEDITOR = 'ODEDITOR',\n /** Picasso */\n PICASSO = 'PICASSO',\n /** Wixel */\n WIXEL = 'WIXEL',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n | EditorType\n | 'UNKNOWN'\n | 'WIX_EDITOR'\n | 'EDITOR_X'\n | 'WIX_STUDIO'\n | 'ODEDITOR'\n | 'PICASSO'\n | 'WIXEL';\n\nexport interface GetEditorUrlsRequest {\n /**\n * Optional branch ID to include in generated URLs\n * @format GUID\n */\n branchId?: string | null;\n /** Optional editor type override */\n editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n /** Editor URL. */\n urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n | {\n code?: 'UNABLE_TO_EXTRACT_MS_ID';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SITE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'EDITOR_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n","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,cAAW;AAEX,EAAAA,YAAA,gBAAa;AAEb,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,aAAU;AAEV,EAAAA,YAAA,WAAQ;AAdE,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.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"fqdn": "wix.editorurls.v2.editor_urls"
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
"falconPackageHash": "
|
|
53
|
+
"falconPackageHash": "da4f15bbb226dc759700bedf3aafc20d45ffa9420e20dd3881d58527"
|
|
54
54
|
}
|