@space-runners/ablo-ts-sdk
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -40,4 +40,4 @@ "use strict"; | ||
this.photoTransformer = new photo_transformer_1.PhotoTransformerService(this.axios, this.storage); | ||
this.imageMaker = new image_maker_1.ImageMakerService(this.axios); | ||
this.fontMaker = new font_maker_1.FontMakerService(this.axios); | ||
this.imageMaker = new image_maker_1.ImageMakerService(this.axios, this.storage); | ||
this.fontMaker = new font_maker_1.FontMakerService(this.axios, this.storage); | ||
this.upscale = new upscale_1.UpscaleService(this.axios); | ||
@@ -44,0 +44,0 @@ this.removeBackground = new background_removal_1.BackgroundRemoverService(this.axios); |
import { AxiosInstance } from 'axios'; | ||
import { IFontMakerRequest } from './font-maker-request.interface'; | ||
import { IImageGenerationResponse } from '../../interfaces/image-generation-response.interface'; | ||
import { StorageService } from '../storage'; | ||
export declare class FontMakerService { | ||
private readonly axios; | ||
constructor(axios: AxiosInstance); | ||
private readonly storageService; | ||
constructor(axios: AxiosInstance, storageService: StorageService); | ||
/** | ||
@@ -12,3 +14,3 @@ * Generates a FontMaker image based on the provided request. | ||
*/ | ||
run: (params: IFontMakerRequest) => Promise<IImageGenerationResponse>; | ||
run: (params: IFontMakerRequest, referenceImageContentType?: string) => Promise<IImageGenerationResponse>; | ||
} |
@@ -14,4 +14,5 @@ "use strict"; | ||
class FontMakerService { | ||
constructor(axios) { | ||
constructor(axios, storageService) { | ||
this.axios = axios; | ||
this.storageService = storageService; | ||
/** | ||
@@ -22,3 +23,11 @@ * Generates a FontMaker image based on the provided request. | ||
*/ | ||
this.run = (params) => __awaiter(this, void 0, void 0, function* () { | ||
this.run = (params, referenceImageContentType) => __awaiter(this, void 0, void 0, function* () { | ||
// Handle reference image | ||
if (params.referenceImageFile) { | ||
if (!referenceImageContentType) { | ||
throw new Error('Reference image content type is required'); | ||
} | ||
params.referenceImageUrl = yield this.storageService.uploadBlob(params.referenceImageFile, referenceImageContentType); | ||
delete params.referenceImageFile; | ||
} | ||
const { data } = yield this.axios.post('/fontmaker', params, { | ||
@@ -25,0 +34,0 @@ headers: { |
import { AxiosInstance } from 'axios'; | ||
import { IImageMakerRequest } from './image-maker-request.interface'; | ||
import { IImageGenerationResponse } from '../../interfaces/image-generation-response.interface'; | ||
import { StorageService } from '../storage'; | ||
export declare class ImageMakerService { | ||
private readonly axios; | ||
constructor(axios: AxiosInstance); | ||
private readonly storageService; | ||
constructor(axios: AxiosInstance, storageService: StorageService); | ||
/** | ||
@@ -12,3 +14,3 @@ * Generates an image based on the provided text. | ||
*/ | ||
run: (params: IImageMakerRequest) => Promise<IImageGenerationResponse>; | ||
run: (params: IImageMakerRequest, referenceImageContentType?: string) => Promise<IImageGenerationResponse>; | ||
} |
@@ -14,4 +14,5 @@ "use strict"; | ||
class ImageMakerService { | ||
constructor(axios) { | ||
constructor(axios, storageService) { | ||
this.axios = axios; | ||
this.storageService = storageService; | ||
/** | ||
@@ -22,3 +23,11 @@ * Generates an image based on the provided text. | ||
*/ | ||
this.run = (params) => __awaiter(this, void 0, void 0, function* () { | ||
this.run = (params, referenceImageContentType) => __awaiter(this, void 0, void 0, function* () { | ||
// Handle reference image | ||
if (params.referenceImageFile) { | ||
if (!referenceImageContentType) { | ||
throw new Error('Reference image content type is required'); | ||
} | ||
params.referenceImageUrl = yield this.storageService.uploadBlob(params.referenceImageFile, referenceImageContentType); | ||
delete params.referenceImageFile; | ||
} | ||
const { data } = yield this.axios.post('/image-maker', params, { | ||
@@ -25,0 +34,0 @@ headers: { |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "A TypeScript SDK for Ablo Services", | ||
@@ -9,0 +9,0 @@ "main": "lib/index.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
38693
783
1