@wix/blog_blog-importer
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -1,4 +0,5 @@ | ||
import { startImport as publicStartImport, submitUrlForImport as publicSubmitUrlForImport, validateUrlForImport as publicValidateUrlForImport, getImportStatus as publicGetImportStatus, getNotImportedPosts as publicGetNotImportedPosts } from './blog-v1-wordpress-import-blog-importer.public'; | ||
import { startImport as publicStartImport, uploadFileForImport as publicUploadFileForImport, submitUrlForImport as publicSubmitUrlForImport, validateUrlForImport as publicValidateUrlForImport, getImportStatus as publicGetImportStatus, getNotImportedPosts as publicGetNotImportedPosts } from './blog-v1-wordpress-import-blog-importer.public'; | ||
import { BuildRESTFunction, MaybeContext } from '@wix/sdk-types'; | ||
export declare const startImport: MaybeContext<BuildRESTFunction<typeof publicStartImport> & typeof publicStartImport>; | ||
export declare const uploadFileForImport: MaybeContext<BuildRESTFunction<typeof publicUploadFileForImport> & typeof publicUploadFileForImport>; | ||
export declare const submitUrlForImport: MaybeContext<BuildRESTFunction<typeof publicSubmitUrlForImport> & typeof publicSubmitUrlForImport>; | ||
@@ -9,2 +10,2 @@ export declare const validateUrlForImport: MaybeContext<BuildRESTFunction<typeof publicValidateUrlForImport> & typeof publicValidateUrlForImport>; | ||
export { Status } from './blog-v1-wordpress-import-blog-importer.universal'; | ||
export { ImportStatus, StartImportRequest, StartImportResponse, SubmitUrlForImportRequest, SubmitUrlForImportResponse, ValidateUrlForImportRequest, ValidateUrlForImportResponse, GetImportStatusRequest, GetImportStatusResponse, GetNotImportedPostsRequest, GetNotImportedPostsResponse, Post, GetImportStatusResponseNonNullableFields, GetNotImportedPostsResponseNonNullableFields, StartImportOptions, } from './blog-v1-wordpress-import-blog-importer.universal'; | ||
export { ImportStatus, StartImportRequest, StartImportResponse, UploadFileForImportRequest, UploadFileForImportResponse, SubmitUrlForImportRequest, SubmitUrlForImportResponse, ValidateUrlForImportRequest, ValidateUrlForImportResponse, GetImportStatusRequest, GetImportStatusResponse, GetNotImportedPostsRequest, GetNotImportedPostsResponse, Post, GetImportStatusResponseNonNullableFields, GetNotImportedPostsResponseNonNullableFields, StartImportOptions, UploadFileForImportOptions, } from './blog-v1-wordpress-import-blog-importer.universal'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Status = exports.getNotImportedPosts = exports.getImportStatus = exports.validateUrlForImport = exports.submitUrlForImport = exports.startImport = void 0; | ||
exports.Status = exports.getNotImportedPosts = exports.getImportStatus = exports.validateUrlForImport = exports.submitUrlForImport = exports.uploadFileForImport = exports.startImport = void 0; | ||
const blog_v1_wordpress_import_blog_importer_public_1 = require("./blog-v1-wordpress-import-blog-importer.public"); | ||
const rest_modules_1 = require("@wix/sdk-runtime/rest-modules"); | ||
exports.startImport = (0, rest_modules_1.createRESTModule)(blog_v1_wordpress_import_blog_importer_public_1.startImport); | ||
exports.uploadFileForImport = (0, rest_modules_1.createRESTModule)(blog_v1_wordpress_import_blog_importer_public_1.uploadFileForImport); | ||
exports.submitUrlForImport = (0, rest_modules_1.createRESTModule)(blog_v1_wordpress_import_blog_importer_public_1.submitUrlForImport); | ||
@@ -8,0 +9,0 @@ exports.validateUrlForImport = (0, rest_modules_1.createRESTModule)(blog_v1_wordpress_import_blog_importer_public_1.validateUrlForImport); |
import { RequestOptionsFactory } from '@wix/sdk-types'; | ||
/** Starts wordpress import process. */ | ||
export declare function startImport(payload: object): RequestOptionsFactory<any>; | ||
export declare function uploadFileForImport(payload: object): RequestOptionsFactory<any>; | ||
/** | ||
@@ -5,0 +6,0 @@ * Submits wordpress import process from URL. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getNotImportedPosts = exports.getImportStatus = exports.validateUrlForImport = exports.submitUrlForImport = exports.startImport = void 0; | ||
exports.getNotImportedPosts = exports.getImportStatus = exports.validateUrlForImport = exports.submitUrlForImport = exports.uploadFileForImport = exports.startImport = void 0; | ||
const metro_runtime_1 = require("@wix/metro-runtime"); | ||
const bytes_1 = require("@wix/sdk-runtime/transformations/bytes"); | ||
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths"); | ||
const metro_runtime_2 = require("@wix/metro-runtime"); | ||
@@ -44,2 +46,27 @@ function resolveComWixBlogWordpressImportServiceUrl(opts) { | ||
exports.startImport = startImport; | ||
function uploadFileForImport(payload) { | ||
function __uploadFileForImport({ host }) { | ||
const serializedData = (0, transform_paths_1.transformPaths)(payload, [ | ||
{ | ||
transformFn: bytes_1.transformSDKBytesToRESTBytes, | ||
paths: [{ path: 'fileContent' }], | ||
}, | ||
]); | ||
const metadata = { | ||
entityFqdn: 'wix.blog.v1.wordpress_import', | ||
method: 'POST', | ||
methodFqn: 'com.wix.blog.WordpressImportService.UploadFileForImport', | ||
packageName: PACKAGE_NAME, | ||
url: resolveComWixBlogWordpressImportServiceUrl({ | ||
protoPath: '/v1/wordpress-import/file', | ||
data: serializedData, | ||
host, | ||
}), | ||
data: serializedData, | ||
}; | ||
return metadata; | ||
} | ||
return __uploadFileForImport; | ||
} | ||
exports.uploadFileForImport = uploadFileForImport; | ||
/** | ||
@@ -46,0 +73,0 @@ * Submits wordpress import process from URL. |
@@ -14,2 +14,3 @@ import * as ambassadorWixBlogV1WordpressImportTypes from './blog-v1-wordpress-import-blog-importer.types'; | ||
export declare function startImport(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixBlogV1WordpressImportUniversalTypes.StartImportRequest, ambassadorWixBlogV1WordpressImportTypes.StartImportRequest, ambassadorWixBlogV1WordpressImportUniversalTypes.StartImportResponse, ambassadorWixBlogV1WordpressImportTypes.StartImportResponse>; | ||
export declare function uploadFileForImport(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixBlogV1WordpressImportUniversalTypes.UploadFileForImportRequest, ambassadorWixBlogV1WordpressImportTypes.UploadFileForImportRequest, ambassadorWixBlogV1WordpressImportUniversalTypes.UploadFileForImportResponse, ambassadorWixBlogV1WordpressImportTypes.UploadFileForImportResponse>; | ||
export declare function submitUrlForImport(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixBlogV1WordpressImportUniversalTypes.SubmitUrlForImportRequest, ambassadorWixBlogV1WordpressImportTypes.SubmitUrlForImportRequest, ambassadorWixBlogV1WordpressImportUniversalTypes.SubmitUrlForImportResponse, ambassadorWixBlogV1WordpressImportTypes.SubmitUrlForImportResponse>; | ||
@@ -16,0 +17,0 @@ export declare function validateUrlForImport(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixBlogV1WordpressImportUniversalTypes.ValidateUrlForImportRequest, ambassadorWixBlogV1WordpressImportTypes.ValidateUrlForImportRequest, ambassadorWixBlogV1WordpressImportUniversalTypes.ValidateUrlForImportResponse, ambassadorWixBlogV1WordpressImportTypes.ValidateUrlForImportResponse>; |
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getNotImportedPosts = exports.getImportStatus = exports.validateUrlForImport = exports.submitUrlForImport = exports.startImport = void 0; | ||
exports.getNotImportedPosts = exports.getImportStatus = exports.validateUrlForImport = exports.submitUrlForImport = exports.uploadFileForImport = exports.startImport = void 0; | ||
const ambassadorWixBlogV1WordpressImport = __importStar(require("./blog-v1-wordpress-import-blog-importer.http")); | ||
@@ -48,2 +48,21 @@ function startImport() { | ||
exports.startImport = startImport; | ||
function uploadFileForImport() { | ||
const payload = {}; | ||
const getRequestOptions = ambassadorWixBlogV1WordpressImport.uploadFileForImport(payload); | ||
const getUrl = (context) => { | ||
const { url } = getRequestOptions(context); | ||
return url; | ||
}; | ||
return { | ||
getUrl, | ||
httpMethod: 'POST', | ||
path: '/v1/wordpress-import/file', | ||
pathParams: {}, | ||
__requestType: null, | ||
__originalRequestType: null, | ||
__responseType: null, | ||
__originalResponseType: null, | ||
}; | ||
} | ||
exports.uploadFileForImport = uploadFileForImport; | ||
function submitUrlForImport() { | ||
@@ -50,0 +69,0 @@ const payload = {}; |
import { HttpClient } from '@wix/sdk-types'; | ||
import { GetImportStatusResponse, GetImportStatusResponseNonNullableFields, GetNotImportedPostsResponse, GetNotImportedPostsResponseNonNullableFields, StartImportOptions, ValidateUrlForImportResponse } from './blog-v1-wordpress-import-blog-importer.universal'; | ||
import { GetImportStatusResponse, GetImportStatusResponseNonNullableFields, GetNotImportedPostsResponse, GetNotImportedPostsResponseNonNullableFields, StartImportOptions, UploadFileForImportOptions, ValidateUrlForImportResponse } from './blog-v1-wordpress-import-blog-importer.universal'; | ||
export declare const __metadata: { | ||
@@ -13,2 +13,7 @@ PACKAGE_NAME: string; | ||
} | ||
export declare function uploadFileForImport(httpClient: HttpClient): UploadFileForImportSignature; | ||
interface UploadFileForImportSignature { | ||
/** */ | ||
(options?: UploadFileForImportOptions | undefined): Promise<void>; | ||
} | ||
export declare function submitUrlForImport(httpClient: HttpClient): SubmitUrlForImportSignature; | ||
@@ -44,2 +49,2 @@ interface SubmitUrlForImportSignature { | ||
} | ||
export { GetImportStatusRequest, GetImportStatusResponse, GetImportStatusResponseNonNullableFields, GetNotImportedPostsRequest, GetNotImportedPostsResponse, GetNotImportedPostsResponseNonNullableFields, ImportStatus, Post, StartImportOptions, StartImportRequest, StartImportResponse, Status, SubmitUrlForImportRequest, SubmitUrlForImportResponse, ValidateUrlForImportRequest, ValidateUrlForImportResponse, } from './blog-v1-wordpress-import-blog-importer.universal'; | ||
export { GetImportStatusRequest, GetImportStatusResponse, GetImportStatusResponseNonNullableFields, GetNotImportedPostsRequest, GetNotImportedPostsResponse, GetNotImportedPostsResponseNonNullableFields, ImportStatus, Post, StartImportOptions, StartImportRequest, StartImportResponse, Status, SubmitUrlForImportRequest, SubmitUrlForImportResponse, UploadFileForImportOptions, UploadFileForImportRequest, UploadFileForImportResponse, ValidateUrlForImportRequest, ValidateUrlForImportResponse, } from './blog-v1-wordpress-import-blog-importer.universal'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Status = exports.getNotImportedPosts = exports.getImportStatus = exports.validateUrlForImport = exports.submitUrlForImport = exports.startImport = exports.__metadata = void 0; | ||
exports.Status = exports.getNotImportedPosts = exports.getImportStatus = exports.validateUrlForImport = exports.submitUrlForImport = exports.uploadFileForImport = exports.startImport = exports.__metadata = void 0; | ||
const blog_v1_wordpress_import_blog_importer_universal_1 = require("./blog-v1-wordpress-import-blog-importer.universal"); | ||
@@ -12,2 +12,8 @@ exports.__metadata = { PACKAGE_NAME: '@wix/blog' }; | ||
exports.startImport = startImport; | ||
function uploadFileForImport(httpClient) { | ||
return (options) => (0, blog_v1_wordpress_import_blog_importer_universal_1.uploadFileForImport)(options, | ||
// @ts-ignore | ||
{ httpClient }); | ||
} | ||
exports.uploadFileForImport = uploadFileForImport; | ||
function submitUrlForImport(httpClient) { | ||
@@ -14,0 +20,0 @@ return (url) => (0, blog_v1_wordpress_import_blog_importer_universal_1.submitUrlForImport)(url, |
@@ -28,2 +28,10 @@ export interface ImportStatus { | ||
} | ||
export interface UploadFileForImportRequest { | ||
/** The content of the WordPress XML file. */ | ||
fileContent?: Uint8Array | null; | ||
/** The name of the uploaded file. */ | ||
fileName?: string | null; | ||
} | ||
export interface UploadFileForImportResponse { | ||
} | ||
export interface SubmitUrlForImportRequest { | ||
@@ -30,0 +38,0 @@ /** Url to wordpress xml file. */ |
@@ -28,2 +28,10 @@ export interface ImportStatus { | ||
} | ||
export interface UploadFileForImportRequest { | ||
/** The content of the WordPress XML file. */ | ||
fileContent?: Uint8Array | null; | ||
/** The name of the uploaded file. */ | ||
fileName?: string | null; | ||
} | ||
export interface UploadFileForImportResponse { | ||
} | ||
export interface SubmitUrlForImportRequest { | ||
@@ -97,2 +105,13 @@ /** Url to wordpress xml file. */ | ||
} | ||
/** @public | ||
* @documentationMaturity preview | ||
* @permissionId BLOG.IMPORT_FROM_EXTERNAL_SITES | ||
*/ | ||
export declare function uploadFileForImport(options?: UploadFileForImportOptions): Promise<void>; | ||
export interface UploadFileForImportOptions { | ||
/** The content of the WordPress XML file. */ | ||
fileContent?: Uint8Array | null; | ||
/** The name of the uploaded file. */ | ||
fileName?: string | null; | ||
} | ||
/** | ||
@@ -99,0 +118,0 @@ * Submits wordpress import process from URL. |
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getNotImportedPosts = exports.getImportStatus = exports.validateUrlForImport = exports.submitUrlForImport = exports.startImport = exports.Status = void 0; | ||
exports.getNotImportedPosts = exports.getImportStatus = exports.validateUrlForImport = exports.submitUrlForImport = exports.uploadFileForImport = exports.startImport = exports.Status = void 0; | ||
const transform_error_1 = require("@wix/sdk-runtime/transform-error"); | ||
@@ -68,2 +68,33 @@ const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys"); | ||
exports.startImport = startImport; | ||
/** @public | ||
* @documentationMaturity preview | ||
* @permissionId BLOG.IMPORT_FROM_EXTERNAL_SITES | ||
*/ | ||
async function uploadFileForImport(options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
fileContent: options?.fileContent, | ||
fileName: options?.fileName, | ||
}); | ||
const reqOpts = ambassadorWixBlogV1WordpressImport.uploadFileForImport(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
fileContent: '$[0].fileContent', | ||
fileName: '$[0].fileName', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
exports.uploadFileForImport = uploadFileForImport; | ||
/** | ||
@@ -70,0 +101,0 @@ * Submits wordpress import process from URL. |
@@ -1,4 +0,5 @@ | ||
import { startImport as publicStartImport, submitUrlForImport as publicSubmitUrlForImport, validateUrlForImport as publicValidateUrlForImport, getImportStatus as publicGetImportStatus, getNotImportedPosts as publicGetNotImportedPosts } from './blog-v1-wordpress-import-blog-importer.public'; | ||
import { startImport as publicStartImport, uploadFileForImport as publicUploadFileForImport, submitUrlForImport as publicSubmitUrlForImport, validateUrlForImport as publicValidateUrlForImport, getImportStatus as publicGetImportStatus, getNotImportedPosts as publicGetNotImportedPosts } from './blog-v1-wordpress-import-blog-importer.public'; | ||
import { BuildRESTFunction, MaybeContext } from '@wix/sdk-types'; | ||
export declare const startImport: MaybeContext<BuildRESTFunction<typeof publicStartImport> & typeof publicStartImport>; | ||
export declare const uploadFileForImport: MaybeContext<BuildRESTFunction<typeof publicUploadFileForImport> & typeof publicUploadFileForImport>; | ||
export declare const submitUrlForImport: MaybeContext<BuildRESTFunction<typeof publicSubmitUrlForImport> & typeof publicSubmitUrlForImport>; | ||
@@ -9,2 +10,2 @@ export declare const validateUrlForImport: MaybeContext<BuildRESTFunction<typeof publicValidateUrlForImport> & typeof publicValidateUrlForImport>; | ||
export { Status } from './blog-v1-wordpress-import-blog-importer.universal'; | ||
export { ImportStatus, StartImportRequest, StartImportResponse, SubmitUrlForImportRequest, SubmitUrlForImportResponse, ValidateUrlForImportRequest, ValidateUrlForImportResponse, GetImportStatusRequest, GetImportStatusResponse, GetNotImportedPostsRequest, GetNotImportedPostsResponse, Post, GetImportStatusResponseNonNullableFields, GetNotImportedPostsResponseNonNullableFields, StartImportOptions, } from './blog-v1-wordpress-import-blog-importer.universal'; | ||
export { ImportStatus, StartImportRequest, StartImportResponse, UploadFileForImportRequest, UploadFileForImportResponse, SubmitUrlForImportRequest, SubmitUrlForImportResponse, ValidateUrlForImportRequest, ValidateUrlForImportResponse, GetImportStatusRequest, GetImportStatusResponse, GetNotImportedPostsRequest, GetNotImportedPostsResponse, Post, GetImportStatusResponseNonNullableFields, GetNotImportedPostsResponseNonNullableFields, StartImportOptions, UploadFileForImportOptions, } from './blog-v1-wordpress-import-blog-importer.universal'; |
@@ -1,4 +0,5 @@ | ||
import { startImport as publicStartImport, submitUrlForImport as publicSubmitUrlForImport, validateUrlForImport as publicValidateUrlForImport, getImportStatus as publicGetImportStatus, getNotImportedPosts as publicGetNotImportedPosts, } from './blog-v1-wordpress-import-blog-importer.public'; | ||
import { startImport as publicStartImport, uploadFileForImport as publicUploadFileForImport, submitUrlForImport as publicSubmitUrlForImport, validateUrlForImport as publicValidateUrlForImport, getImportStatus as publicGetImportStatus, getNotImportedPosts as publicGetNotImportedPosts, } from './blog-v1-wordpress-import-blog-importer.public'; | ||
import { createRESTModule } from '@wix/sdk-runtime/rest-modules'; | ||
export const startImport = createRESTModule(publicStartImport); | ||
export const uploadFileForImport = createRESTModule(publicUploadFileForImport); | ||
export const submitUrlForImport = createRESTModule(publicSubmitUrlForImport); | ||
@@ -5,0 +6,0 @@ export const validateUrlForImport = createRESTModule(publicValidateUrlForImport); |
import { RequestOptionsFactory } from '@wix/sdk-types'; | ||
/** Starts wordpress import process. */ | ||
export declare function startImport(payload: object): RequestOptionsFactory<any>; | ||
export declare function uploadFileForImport(payload: object): RequestOptionsFactory<any>; | ||
/** | ||
@@ -5,0 +6,0 @@ * Submits wordpress import process from URL. |
import { toURLSearchParams } from '@wix/metro-runtime'; | ||
import { transformSDKBytesToRESTBytes } from '@wix/sdk-runtime/transformations/bytes'; | ||
import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths'; | ||
import { resolveUrl } from '@wix/metro-runtime'; | ||
@@ -40,2 +42,26 @@ function resolveComWixBlogWordpressImportServiceUrl(opts) { | ||
} | ||
export function uploadFileForImport(payload) { | ||
function __uploadFileForImport({ host }) { | ||
const serializedData = transformPaths(payload, [ | ||
{ | ||
transformFn: transformSDKBytesToRESTBytes, | ||
paths: [{ path: 'fileContent' }], | ||
}, | ||
]); | ||
const metadata = { | ||
entityFqdn: 'wix.blog.v1.wordpress_import', | ||
method: 'POST', | ||
methodFqn: 'com.wix.blog.WordpressImportService.UploadFileForImport', | ||
packageName: PACKAGE_NAME, | ||
url: resolveComWixBlogWordpressImportServiceUrl({ | ||
protoPath: '/v1/wordpress-import/file', | ||
data: serializedData, | ||
host, | ||
}), | ||
data: serializedData, | ||
}; | ||
return metadata; | ||
} | ||
return __uploadFileForImport; | ||
} | ||
/** | ||
@@ -42,0 +68,0 @@ * Submits wordpress import process from URL. |
@@ -14,2 +14,3 @@ import * as ambassadorWixBlogV1WordpressImportTypes from './blog-v1-wordpress-import-blog-importer.types'; | ||
export declare function startImport(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixBlogV1WordpressImportUniversalTypes.StartImportRequest, ambassadorWixBlogV1WordpressImportTypes.StartImportRequest, ambassadorWixBlogV1WordpressImportUniversalTypes.StartImportResponse, ambassadorWixBlogV1WordpressImportTypes.StartImportResponse>; | ||
export declare function uploadFileForImport(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixBlogV1WordpressImportUniversalTypes.UploadFileForImportRequest, ambassadorWixBlogV1WordpressImportTypes.UploadFileForImportRequest, ambassadorWixBlogV1WordpressImportUniversalTypes.UploadFileForImportResponse, ambassadorWixBlogV1WordpressImportTypes.UploadFileForImportResponse>; | ||
export declare function submitUrlForImport(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixBlogV1WordpressImportUniversalTypes.SubmitUrlForImportRequest, ambassadorWixBlogV1WordpressImportTypes.SubmitUrlForImportRequest, ambassadorWixBlogV1WordpressImportUniversalTypes.SubmitUrlForImportResponse, ambassadorWixBlogV1WordpressImportTypes.SubmitUrlForImportResponse>; | ||
@@ -16,0 +17,0 @@ export declare function validateUrlForImport(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixBlogV1WordpressImportUniversalTypes.ValidateUrlForImportRequest, ambassadorWixBlogV1WordpressImportTypes.ValidateUrlForImportRequest, ambassadorWixBlogV1WordpressImportUniversalTypes.ValidateUrlForImportResponse, ambassadorWixBlogV1WordpressImportTypes.ValidateUrlForImportResponse>; |
@@ -20,2 +20,20 @@ import * as ambassadorWixBlogV1WordpressImport from './blog-v1-wordpress-import-blog-importer.http'; | ||
} | ||
export function uploadFileForImport() { | ||
const payload = {}; | ||
const getRequestOptions = ambassadorWixBlogV1WordpressImport.uploadFileForImport(payload); | ||
const getUrl = (context) => { | ||
const { url } = getRequestOptions(context); | ||
return url; | ||
}; | ||
return { | ||
getUrl, | ||
httpMethod: 'POST', | ||
path: '/v1/wordpress-import/file', | ||
pathParams: {}, | ||
__requestType: null, | ||
__originalRequestType: null, | ||
__responseType: null, | ||
__originalResponseType: null, | ||
}; | ||
} | ||
export function submitUrlForImport() { | ||
@@ -22,0 +40,0 @@ const payload = {}; |
import { HttpClient } from '@wix/sdk-types'; | ||
import { GetImportStatusResponse, GetImportStatusResponseNonNullableFields, GetNotImportedPostsResponse, GetNotImportedPostsResponseNonNullableFields, StartImportOptions, ValidateUrlForImportResponse } from './blog-v1-wordpress-import-blog-importer.universal'; | ||
import { GetImportStatusResponse, GetImportStatusResponseNonNullableFields, GetNotImportedPostsResponse, GetNotImportedPostsResponseNonNullableFields, StartImportOptions, UploadFileForImportOptions, ValidateUrlForImportResponse } from './blog-v1-wordpress-import-blog-importer.universal'; | ||
export declare const __metadata: { | ||
@@ -13,2 +13,7 @@ PACKAGE_NAME: string; | ||
} | ||
export declare function uploadFileForImport(httpClient: HttpClient): UploadFileForImportSignature; | ||
interface UploadFileForImportSignature { | ||
/** */ | ||
(options?: UploadFileForImportOptions | undefined): Promise<void>; | ||
} | ||
export declare function submitUrlForImport(httpClient: HttpClient): SubmitUrlForImportSignature; | ||
@@ -44,2 +49,2 @@ interface SubmitUrlForImportSignature { | ||
} | ||
export { GetImportStatusRequest, GetImportStatusResponse, GetImportStatusResponseNonNullableFields, GetNotImportedPostsRequest, GetNotImportedPostsResponse, GetNotImportedPostsResponseNonNullableFields, ImportStatus, Post, StartImportOptions, StartImportRequest, StartImportResponse, Status, SubmitUrlForImportRequest, SubmitUrlForImportResponse, ValidateUrlForImportRequest, ValidateUrlForImportResponse, } from './blog-v1-wordpress-import-blog-importer.universal'; | ||
export { GetImportStatusRequest, GetImportStatusResponse, GetImportStatusResponseNonNullableFields, GetNotImportedPostsRequest, GetNotImportedPostsResponse, GetNotImportedPostsResponseNonNullableFields, ImportStatus, Post, StartImportOptions, StartImportRequest, StartImportResponse, Status, SubmitUrlForImportRequest, SubmitUrlForImportResponse, UploadFileForImportOptions, UploadFileForImportRequest, UploadFileForImportResponse, ValidateUrlForImportRequest, ValidateUrlForImportResponse, } from './blog-v1-wordpress-import-blog-importer.universal'; |
@@ -1,2 +0,2 @@ | ||
import { getImportStatus as universalGetImportStatus, getNotImportedPosts as universalGetNotImportedPosts, startImport as universalStartImport, submitUrlForImport as universalSubmitUrlForImport, validateUrlForImport as universalValidateUrlForImport, } from './blog-v1-wordpress-import-blog-importer.universal'; | ||
import { getImportStatus as universalGetImportStatus, getNotImportedPosts as universalGetNotImportedPosts, startImport as universalStartImport, submitUrlForImport as universalSubmitUrlForImport, uploadFileForImport as universalUploadFileForImport, validateUrlForImport as universalValidateUrlForImport, } from './blog-v1-wordpress-import-blog-importer.universal'; | ||
export const __metadata = { PACKAGE_NAME: '@wix/blog' }; | ||
@@ -8,2 +8,7 @@ export function startImport(httpClient) { | ||
} | ||
export function uploadFileForImport(httpClient) { | ||
return (options) => universalUploadFileForImport(options, | ||
// @ts-ignore | ||
{ httpClient }); | ||
} | ||
export function submitUrlForImport(httpClient) { | ||
@@ -10,0 +15,0 @@ return (url) => universalSubmitUrlForImport(url, |
@@ -28,2 +28,10 @@ export interface ImportStatus { | ||
} | ||
export interface UploadFileForImportRequest { | ||
/** The content of the WordPress XML file. */ | ||
fileContent?: Uint8Array | null; | ||
/** The name of the uploaded file. */ | ||
fileName?: string | null; | ||
} | ||
export interface UploadFileForImportResponse { | ||
} | ||
export interface SubmitUrlForImportRequest { | ||
@@ -30,0 +38,0 @@ /** Url to wordpress xml file. */ |
@@ -28,2 +28,10 @@ export interface ImportStatus { | ||
} | ||
export interface UploadFileForImportRequest { | ||
/** The content of the WordPress XML file. */ | ||
fileContent?: Uint8Array | null; | ||
/** The name of the uploaded file. */ | ||
fileName?: string | null; | ||
} | ||
export interface UploadFileForImportResponse { | ||
} | ||
export interface SubmitUrlForImportRequest { | ||
@@ -97,2 +105,13 @@ /** Url to wordpress xml file. */ | ||
} | ||
/** @public | ||
* @documentationMaturity preview | ||
* @permissionId BLOG.IMPORT_FROM_EXTERNAL_SITES | ||
*/ | ||
export declare function uploadFileForImport(options?: UploadFileForImportOptions): Promise<void>; | ||
export interface UploadFileForImportOptions { | ||
/** The content of the WordPress XML file. */ | ||
fileContent?: Uint8Array | null; | ||
/** The name of the uploaded file. */ | ||
fileName?: string | null; | ||
} | ||
/** | ||
@@ -99,0 +118,0 @@ * Submits wordpress import process from URL. |
@@ -40,2 +40,32 @@ import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error'; | ||
} | ||
/** @public | ||
* @documentationMaturity preview | ||
* @permissionId BLOG.IMPORT_FROM_EXTERNAL_SITES | ||
*/ | ||
export async function uploadFileForImport(options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
fileContent: options?.fileContent, | ||
fileName: options?.fileName, | ||
}); | ||
const reqOpts = ambassadorWixBlogV1WordpressImport.uploadFileForImport(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
fileContent: '$[0].fileContent', | ||
fileName: '$[0].fileName', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
/** | ||
@@ -42,0 +72,0 @@ * Submits wordpress import process from URL. |
{ | ||
"name": "@wix/blog_blog-importer", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"publishConfig": { | ||
@@ -48,3 +48,3 @@ "registry": "https://registry.npmjs.org/", | ||
}, | ||
"falconPackageHash": "736762290cc0af704dfb607aa255073c472cb89f4a75bcd84b6d1179" | ||
"falconPackageHash": "6cf0f3a5af82c6a4a0752cf85bdaa9d66f203e6bf819ccb723fd87bb" | ||
} |
@@ -438,2 +438,10 @@ type HostModule<T, H extends Host> = { | ||
} | ||
interface UploadFileForImportRequest { | ||
/** The content of the WordPress XML file. */ | ||
fileContent?: Uint8Array | null; | ||
/** The name of the uploaded file. */ | ||
fileName?: string | null; | ||
} | ||
interface UploadFileForImportResponse { | ||
} | ||
interface SubmitUrlForImportRequest { | ||
@@ -500,2 +508,8 @@ /** Url to wordpress xml file. */ | ||
} | ||
interface UploadFileForImportOptions { | ||
/** The content of the WordPress XML file. */ | ||
fileContent?: Uint8Array | null; | ||
/** The name of the uploaded file. */ | ||
fileName?: string | null; | ||
} | ||
@@ -509,2 +523,7 @@ declare function startImport$1(httpClient: HttpClient): StartImportSignature; | ||
} | ||
declare function uploadFileForImport$1(httpClient: HttpClient): UploadFileForImportSignature; | ||
interface UploadFileForImportSignature { | ||
/** */ | ||
(options?: UploadFileForImportOptions | undefined): Promise<void>; | ||
} | ||
declare function submitUrlForImport$1(httpClient: HttpClient): SubmitUrlForImportSignature; | ||
@@ -542,2 +561,3 @@ interface SubmitUrlForImportSignature { | ||
declare const startImport: MaybeContext<BuildRESTFunction<typeof startImport$1> & typeof startImport$1>; | ||
declare const uploadFileForImport: MaybeContext<BuildRESTFunction<typeof uploadFileForImport$1> & typeof uploadFileForImport$1>; | ||
declare const submitUrlForImport: MaybeContext<BuildRESTFunction<typeof submitUrlForImport$1> & typeof submitUrlForImport$1>; | ||
@@ -548,2 +568,2 @@ declare const validateUrlForImport: MaybeContext<BuildRESTFunction<typeof validateUrlForImport$1> & typeof validateUrlForImport$1>; | ||
export { type GetImportStatusRequest, type GetImportStatusResponse, type GetImportStatusResponseNonNullableFields, type GetNotImportedPostsRequest, type GetNotImportedPostsResponse, type GetNotImportedPostsResponseNonNullableFields, type ImportStatus, type Post, type StartImportOptions, type StartImportRequest, type StartImportResponse, Status, type SubmitUrlForImportRequest, type SubmitUrlForImportResponse, type ValidateUrlForImportRequest, type ValidateUrlForImportResponse, getImportStatus, getNotImportedPosts, startImport, submitUrlForImport, validateUrlForImport }; | ||
export { type GetImportStatusRequest, type GetImportStatusResponse, type GetImportStatusResponseNonNullableFields, type GetNotImportedPostsRequest, type GetNotImportedPostsResponse, type GetNotImportedPostsResponseNonNullableFields, type ImportStatus, type Post, type StartImportOptions, type StartImportRequest, type StartImportResponse, Status, type SubmitUrlForImportRequest, type SubmitUrlForImportResponse, type UploadFileForImportOptions, type UploadFileForImportRequest, type UploadFileForImportResponse, type ValidateUrlForImportRequest, type ValidateUrlForImportResponse, getImportStatus, getNotImportedPosts, startImport, submitUrlForImport, uploadFileForImport, validateUrlForImport }; |
@@ -438,2 +438,10 @@ type HostModule<T, H extends Host> = { | ||
} | ||
interface UploadFileForImportRequest { | ||
/** The content of the WordPress XML file. */ | ||
fileContent?: Uint8Array | null; | ||
/** The name of the uploaded file. */ | ||
fileName?: string | null; | ||
} | ||
interface UploadFileForImportResponse { | ||
} | ||
interface SubmitUrlForImportRequest { | ||
@@ -500,2 +508,8 @@ /** Url to wordpress xml file. */ | ||
} | ||
interface UploadFileForImportOptions { | ||
/** The content of the WordPress XML file. */ | ||
fileContent?: Uint8Array | null; | ||
/** The name of the uploaded file. */ | ||
fileName?: string | null; | ||
} | ||
@@ -509,2 +523,7 @@ declare function startImport$1(httpClient: HttpClient): StartImportSignature; | ||
} | ||
declare function uploadFileForImport$1(httpClient: HttpClient): UploadFileForImportSignature; | ||
interface UploadFileForImportSignature { | ||
/** */ | ||
(options?: UploadFileForImportOptions | undefined): Promise<void>; | ||
} | ||
declare function submitUrlForImport$1(httpClient: HttpClient): SubmitUrlForImportSignature; | ||
@@ -542,2 +561,3 @@ interface SubmitUrlForImportSignature { | ||
declare const startImport: MaybeContext<BuildRESTFunction<typeof startImport$1> & typeof startImport$1>; | ||
declare const uploadFileForImport: MaybeContext<BuildRESTFunction<typeof uploadFileForImport$1> & typeof uploadFileForImport$1>; | ||
declare const submitUrlForImport: MaybeContext<BuildRESTFunction<typeof submitUrlForImport$1> & typeof submitUrlForImport$1>; | ||
@@ -548,2 +568,2 @@ declare const validateUrlForImport: MaybeContext<BuildRESTFunction<typeof validateUrlForImport$1> & typeof validateUrlForImport$1>; | ||
export { type GetImportStatusRequest, type GetImportStatusResponse, type GetImportStatusResponseNonNullableFields, type GetNotImportedPostsRequest, type GetNotImportedPostsResponse, type GetNotImportedPostsResponseNonNullableFields, type ImportStatus, type Post, type StartImportOptions, type StartImportRequest, type StartImportResponse, Status, type SubmitUrlForImportRequest, type SubmitUrlForImportResponse, type ValidateUrlForImportRequest, type ValidateUrlForImportResponse, getImportStatus, getNotImportedPosts, startImport, submitUrlForImport, validateUrlForImport }; | ||
export { type GetImportStatusRequest, type GetImportStatusResponse, type GetImportStatusResponseNonNullableFields, type GetNotImportedPostsRequest, type GetNotImportedPostsResponse, type GetNotImportedPostsResponseNonNullableFields, type ImportStatus, type Post, type StartImportOptions, type StartImportRequest, type StartImportResponse, Status, type SubmitUrlForImportRequest, type SubmitUrlForImportResponse, type UploadFileForImportOptions, type UploadFileForImportRequest, type UploadFileForImportResponse, type ValidateUrlForImportRequest, type ValidateUrlForImportResponse, getImportStatus, getNotImportedPosts, startImport, submitUrlForImport, uploadFileForImport, validateUrlForImport }; |
@@ -28,2 +28,10 @@ interface ImportStatus { | ||
} | ||
interface UploadFileForImportRequest { | ||
/** The content of the WordPress XML file. */ | ||
fileContent?: Uint8Array | null; | ||
/** The name of the uploaded file. */ | ||
fileName?: string | null; | ||
} | ||
interface UploadFileForImportResponse { | ||
} | ||
interface SubmitUrlForImportRequest { | ||
@@ -97,2 +105,13 @@ /** Url to wordpress xml file. */ | ||
} | ||
/** @public | ||
* @documentationMaturity preview | ||
* @permissionId BLOG.IMPORT_FROM_EXTERNAL_SITES | ||
*/ | ||
declare function uploadFileForImport(options?: UploadFileForImportOptions): Promise<void>; | ||
interface UploadFileForImportOptions { | ||
/** The content of the WordPress XML file. */ | ||
fileContent?: Uint8Array | null; | ||
/** The name of the uploaded file. */ | ||
fileName?: string | null; | ||
} | ||
/** | ||
@@ -132,2 +151,2 @@ * Submits wordpress import process from URL. | ||
export { type GetImportStatusRequest, type GetImportStatusResponse, type GetImportStatusResponseNonNullableFields, type GetNotImportedPostsRequest, type GetNotImportedPostsResponse, type GetNotImportedPostsResponseNonNullableFields, type ImportStatus, type Post, type StartImportOptions, type StartImportRequest, type StartImportResponse, Status, type SubmitUrlForImportRequest, type SubmitUrlForImportResponse, type ValidateUrlForImportRequest, type ValidateUrlForImportResponse, getImportStatus, getNotImportedPosts, startImport, submitUrlForImport, validateUrlForImport }; | ||
export { type GetImportStatusRequest, type GetImportStatusResponse, type GetImportStatusResponseNonNullableFields, type GetNotImportedPostsRequest, type GetNotImportedPostsResponse, type GetNotImportedPostsResponseNonNullableFields, type ImportStatus, type Post, type StartImportOptions, type StartImportRequest, type StartImportResponse, Status, type SubmitUrlForImportRequest, type SubmitUrlForImportResponse, type UploadFileForImportOptions, type UploadFileForImportRequest, type UploadFileForImportResponse, type ValidateUrlForImportRequest, type ValidateUrlForImportResponse, getImportStatus, getNotImportedPosts, startImport, submitUrlForImport, uploadFileForImport, validateUrlForImport }; |
@@ -28,2 +28,10 @@ interface ImportStatus$1 { | ||
} | ||
interface UploadFileForImportRequest$1 { | ||
/** The content of the WordPress XML file. */ | ||
fileContent?: Uint8Array | null; | ||
/** The name of the uploaded file. */ | ||
fileName?: string | null; | ||
} | ||
interface UploadFileForImportResponse$1 { | ||
} | ||
interface SubmitUrlForImportRequest$1 { | ||
@@ -114,2 +122,10 @@ /** Url to wordpress xml file. */ | ||
} | ||
interface UploadFileForImportRequest { | ||
/** The content of the WordPress XML file. */ | ||
fileContent?: Uint8Array | null; | ||
/** The name of the uploaded file. */ | ||
fileName?: string | null; | ||
} | ||
interface UploadFileForImportResponse { | ||
} | ||
interface SubmitUrlForImportRequest { | ||
@@ -184,2 +200,3 @@ /** Url to wordpress xml file. */ | ||
declare function startImport(): __PublicMethodMetaInfo<'POST', {}, StartImportRequest, StartImportRequest$1, StartImportResponse, StartImportResponse$1>; | ||
declare function uploadFileForImport(): __PublicMethodMetaInfo<'POST', {}, UploadFileForImportRequest, UploadFileForImportRequest$1, UploadFileForImportResponse, UploadFileForImportResponse$1>; | ||
declare function submitUrlForImport(): __PublicMethodMetaInfo<'POST', {}, SubmitUrlForImportRequest, SubmitUrlForImportRequest$1, SubmitUrlForImportResponse, SubmitUrlForImportResponse$1>; | ||
@@ -190,2 +207,2 @@ declare function validateUrlForImport(): __PublicMethodMetaInfo<'POST', {}, ValidateUrlForImportRequest, ValidateUrlForImportRequest$1, ValidateUrlForImportResponse, ValidateUrlForImportResponse$1>; | ||
export { type __PublicMethodMetaInfo, getImportStatus, getNotImportedPosts, startImport, submitUrlForImport, validateUrlForImport }; | ||
export { type __PublicMethodMetaInfo, getImportStatus, getNotImportedPosts, startImport, submitUrlForImport, uploadFileForImport, validateUrlForImport }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
159555
3198