mirror of
https://github.com/storytold/placeholder-artcraft.git
synced 2026-10-09 00:09:55 +00:00
mirror repo (WIP)
Need to remove secrets before entire repo can be made public.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@nx/react/babel",
|
||||
{
|
||||
"runtime": "automatic",
|
||||
"useBuiltIns": "usage"
|
||||
}
|
||||
]
|
||||
],
|
||||
"plugins": []
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"extends": [
|
||||
"plugin:@nx/react",
|
||||
"../../.eslintrc.json"
|
||||
],
|
||||
"ignorePatterns": [
|
||||
"!**/*",
|
||||
"**/vite.config.*.timestamp*",
|
||||
"**/vitest.config.*.timestamp*"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"*.ts",
|
||||
"*.tsx",
|
||||
"*.js",
|
||||
"*.jsx"
|
||||
],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"*.ts",
|
||||
"*.tsx"
|
||||
],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"*.js",
|
||||
"*.jsx"
|
||||
],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# @frontend/tauri-api
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `nx test @frontend/tauri-api` to execute the unit tests via [Vitest](https://vitest.dev/).
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
export * from './lib/artcraft/ArtcraftGetCredits.js';
|
||||
export * from './lib/artcraft/ArtcraftGetSubscription.js';
|
||||
export * from './lib/common/CommandStatus.js';
|
||||
export * from './lib/enqueue/EnqueueContextualEditImage.js';
|
||||
export * from './lib/enqueue/EnqueueImageBgRemovalCommand.js';
|
||||
export * from './lib/enqueue/EnqueueImageInpaint.js';
|
||||
export * from './lib/enqueue/EnqueueImageTo3dObject.js';
|
||||
export * from './lib/enqueue/EnqueueImageToVideo.js';
|
||||
export * from './lib/enqueue/EnqueueTextToImage.js';
|
||||
export * from './lib/events/BasicEventWrapper.js';
|
||||
export * from './lib/events/CanvasBgRemovedEvent.js';
|
||||
export * from './lib/fal/FalBackgroundRemoval.js';
|
||||
export * from './lib/fal/FalHunyuanImageTo3d.js';
|
||||
export * from './lib/fal/FalKlingImageToVideo.js';
|
||||
export * from './lib/fal/GetFalApiKey.js';
|
||||
export * from './lib/fal/SetFalApiKey.js';
|
||||
export * from './lib/midjourney/MidjourneyGetCredentialInfo.js';
|
||||
export * from './lib/openai/GetOpenAIApiKey.js';
|
||||
export * from './lib/openai/SetOpenAIApiKey.js';
|
||||
export * from './lib/providers/GetProviderOrder.js';
|
||||
export * from './lib/providers/Provider.js';
|
||||
export * from './lib/providers/SetProviderOrder.js';
|
||||
export * from './lib/settings/GetAppPreferences.js';
|
||||
export * from './lib/settings/UpdateAppPreference.js';
|
||||
export * from './lib/sora/CheckSoraSession.js';
|
||||
export * from './lib/sora/LogoutSoraSession.js';
|
||||
export * from './lib/sora/SoraImageRemix.js';
|
||||
export * from './lib/sora/useSoraLoginListener.js';
|
||||
export * from './lib/sora/waitForSoraLogin.js';
|
||||
export * from './lib/system/GetAppInfo.js';
|
||||
export * from './lib/util/LoadWithoutCors.js';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iDAAiD,CAAC;AAChE,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC"}
|
||||
+273
@@ -0,0 +1,273 @@
|
||||
import { useEffect as s } from "react";
|
||||
function l(e, r = !1) {
|
||||
return window.__TAURI_INTERNALS__.transformCallback(e, r);
|
||||
}
|
||||
async function _(e, r = {}, a) {
|
||||
return window.__TAURI_INTERNALS__.invoke(e, r, a);
|
||||
}
|
||||
const P = async () => {
|
||||
try {
|
||||
return await _("storyteller_get_credits_command");
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
}, V = async () => {
|
||||
try {
|
||||
return await _("storyteller_get_subscription_command");
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
var c = /* @__PURE__ */ ((e) => (e.Success = "success", e))(c || {}), m = /* @__PURE__ */ ((e) => (e.BadRequest = "bad_request", e.Unauthorized = "unauthorized", e.ServerError = "server_error", e))(m || {}), u = /* @__PURE__ */ ((e) => (e.ModelNotSpecified = "model_not_specified", e.NoProviderAvailable = "no_provider_available", e.BadRequest = "bad_request", e.ServerError = "server_error", e.TooManyConcurrentTasks = "too_many_concurrent_tasks", e.SoraLoginRequired = "sora_login_required", e.SoraUsernameNotYetCreated = "sora_username_not_yet_created", e.SoraIsHavingProblems = "sora_is_having_problems", e))(u || {}), f = /* @__PURE__ */ ((e) => (e.GptImage1 = "gpt_image_1", e.FluxProKontextMax = "flux_pro_kontext_max", e))(f || {}), p = /* @__PURE__ */ ((e) => (e.Auto = "auto", e.Square = "square", e.Wide = "wide", e.Tall = "tall", e))(p || {}), g = /* @__PURE__ */ ((e) => (e.Auto = "auto", e.High = "high", e.Medium = "medium", e.Low = "low", e))(g || {});
|
||||
const J = async (e) => {
|
||||
let r;
|
||||
if (e.model && (typeof e.model == "string" ? r = e.model : typeof e.model.tauriId == "string" && (r = e.model.tauriId)), !r)
|
||||
throw new Error("No model specified in request: " + JSON.stringify(e));
|
||||
let a = {
|
||||
model: r,
|
||||
prompt: e.prompt
|
||||
};
|
||||
return e.scene_image_media_token && (a.scene_image_media_token = e.scene_image_media_token), e.image_media_tokens && (a.image_media_tokens = e.image_media_tokens), e.aspect_ratio && (a.aspect_ratio = e.aspect_ratio), e.image_count && (a.image_count = e.image_count), e.image_quality && (a.image_quality = e.image_quality), e.disable_system_prompt && (a.disable_system_prompt = e.disable_system_prompt), await _("enqueue_contextual_edit_image_command", {
|
||||
request: a
|
||||
});
|
||||
};
|
||||
var v = /* @__PURE__ */ ((e) => (e.ModelNotSpecified = "model_not_specified", e.ServerError = "server_error", e.NeedsFalApiKey = "needs_fal_api_key", e.FalError = "fal_error", e))(v || {});
|
||||
const Y = async (e) => {
|
||||
let r = {};
|
||||
return e.image_media_token && (r.image_media_token = e.image_media_token), e.base64_image && (r.base64_image = e.base64_image), e.frontend_caller && (r.frontend_caller = e.frontend_caller), e.frontend_subscriber_id && (r.frontend_subscriber_id = e.frontend_subscriber_id), await _("enqueue_image_bg_removal_command", {
|
||||
request: r
|
||||
});
|
||||
};
|
||||
var y = /* @__PURE__ */ ((e) => (e.ModelNotSpecified = "model_not_specified", e.NoProviderAvailable = "no_provider_available", e.BadRequest = "bad_request", e.ServerError = "server_error", e.TooManyConcurrentTasks = "too_many_concurrent_tasks", e.SoraLoginRequired = "sora_login_required", e.SoraUsernameNotYetCreated = "sora_username_not_yet_created", e.SoraIsHavingProblems = "sora_is_having_problems", e))(y || {}), b = /* @__PURE__ */ ((e) => (e.FluxPro1 = "flux_pro_1", e.FluxDevJuggernaut = "flux_dev_juggernaut", e))(b || {});
|
||||
const B = async (e) => {
|
||||
let r;
|
||||
if (e.model && (typeof e.model == "string" ? r = e.model : "tauriId" in e.model && typeof e.model.tauriId == "string" ? r = e.model.tauriId : "tauri_id" in e.model && typeof e.model.tauri_id == "string" && (r = e.model.tauri_id)), !r)
|
||||
throw new Error("No model specified in request: " + JSON.stringify(e));
|
||||
let a = {
|
||||
model: r,
|
||||
prompt: e.prompt
|
||||
};
|
||||
return e.image_media_token && (a.image_media_token = e.image_media_token), e.mask_image_raw_bytes && (a.mask_image_raw_bytes = e.mask_image_raw_bytes), e.image_count && (a.image_count = e.image_count), e.frontend_caller && (a.frontend_caller = e.frontend_caller), e.frontend_subscriber_id && (a.frontend_subscriber_id = e.frontend_subscriber_id), await _("enqueue_image_inpaint_command", {
|
||||
request: a
|
||||
});
|
||||
};
|
||||
var w = /* @__PURE__ */ ((e) => (e.ModelNotSpecified = "model_not_specified", e.ServerError = "server_error", e.NeedsFalApiKey = "needs_fal_api_key", e.FalError = "fal_error", e.NeedsStorytellerCredentials = "needs_storyteller_credentials", e))(w || {}), k = /* @__PURE__ */ ((e) => (e.Hunyuan3d2 = "hunyuan_3d_2", e.Hunyuan3d2_0 = "hunyuan_3d_2_0", e.Hunyuan3d2_1 = "hunyuan_3d_2_1", e))(k || {});
|
||||
const Z = async (e) => await _("enqueue_image_to_3d_object_command", {
|
||||
request: {
|
||||
image_media_token: e.image_media_token,
|
||||
model: e.model
|
||||
}
|
||||
});
|
||||
var S = /* @__PURE__ */ ((e) => (e.ModelNotSpecified = "model_not_specified", e.ServerError = "server_error", e.NeedsFalApiKey = "needs_fal_api_key", e.FalError = "fal_error", e))(S || {});
|
||||
const X = async (e) => {
|
||||
var t;
|
||||
let r = {
|
||||
model: (t = e.model) == null ? void 0 : t.tauriId,
|
||||
image_media_token: e.image_media_token
|
||||
};
|
||||
return e.prompt && (r.prompt = e.prompt), e.end_frame_image_media_token && (r.end_frame_image_media_token = e.end_frame_image_media_token), e.frontend_caller && (r.frontend_caller = e.frontend_caller), e.frontend_subscriber_id && (r.frontend_subscriber_id = e.frontend_subscriber_id), await _("enqueue_image_to_video_command", {
|
||||
request: r
|
||||
});
|
||||
};
|
||||
var N = /* @__PURE__ */ ((e) => (e.ModelNotSpecified = "model_not_specified", e.ServerError = "server_error", e.NeedsFalApiKey = "needs_fal_api_key", e.FalError = "fal_error", e))(N || {}), h = /* @__PURE__ */ ((e) => (e.FluxProUltra = "flux_pro_ultra", e.GptImage1 = "gpt_image_1", e.Recraft3 = "recraft_3", e))(h || {}), A = /* @__PURE__ */ ((e) => (e.Auto = "auto", e.Square = "square", e.Wide = "wide", e.Tall = "tall", e))(A || {});
|
||||
const $ = async (e) => {
|
||||
let r;
|
||||
if (e.model && (typeof e.model == "string" ? r = e.model : typeof e.model.tauriId == "string" && (r = e.model.tauriId)), !r)
|
||||
throw new Error("No model specified in request: " + JSON.stringify(e));
|
||||
let a = {
|
||||
model: r,
|
||||
prompt: e.prompt
|
||||
};
|
||||
return e.aspect_ratio && (a.aspect_ratio = e.aspect_ratio), e.number_images && (a.number_images = e.number_images), e.image_media_tokens && e.image_media_tokens.length > 0 && (a.image_media_tokens = e.image_media_tokens), e.frontend_caller && (a.frontend_caller = e.frontend_caller), e.frontend_subscriber_id && (a.frontend_subscriber_id = e.frontend_subscriber_id), await _("enqueue_text_to_image_command", {
|
||||
request: a
|
||||
});
|
||||
};
|
||||
var D = /* @__PURE__ */ ((e) => (e.Success = "success", e.Failure = "failure", e))(D || {}), i;
|
||||
(function(e) {
|
||||
e.WINDOW_RESIZED = "tauri://resize", e.WINDOW_MOVED = "tauri://move", e.WINDOW_CLOSE_REQUESTED = "tauri://close-requested", e.WINDOW_DESTROYED = "tauri://destroyed", e.WINDOW_FOCUS = "tauri://focus", e.WINDOW_BLUR = "tauri://blur", e.WINDOW_SCALE_FACTOR_CHANGED = "tauri://scale-change", e.WINDOW_THEME_CHANGED = "tauri://theme-changed", e.WINDOW_CREATED = "tauri://window-created", e.WEBVIEW_CREATED = "tauri://webview-created", e.DRAG_ENTER = "tauri://drag-enter", e.DRAG_OVER = "tauri://drag-over", e.DRAG_DROP = "tauri://drag-drop", e.DRAG_LEAVE = "tauri://drag-leave";
|
||||
})(i || (i = {}));
|
||||
async function W(e, r) {
|
||||
window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(e, r), await _("plugin:event|unlisten", {
|
||||
event: e,
|
||||
eventId: r
|
||||
});
|
||||
}
|
||||
async function n(e, r, a) {
|
||||
var t;
|
||||
const o = (t = void 0) !== null && t !== void 0 ? t : { kind: "Any" };
|
||||
return _("plugin:event|listen", {
|
||||
event: e,
|
||||
target: o,
|
||||
handler: l(r)
|
||||
}).then((d) => async () => W(e, d));
|
||||
}
|
||||
const F = "canvas_bg_removed_event", j = (e) => {
|
||||
s(() => {
|
||||
let r = !1, a;
|
||||
return (async () => {
|
||||
a = n(F, async (o) => {
|
||||
await e(o.payload.data);
|
||||
}), r && a.then((o) => o());
|
||||
})(), () => {
|
||||
r = !0, a.then((o) => o());
|
||||
};
|
||||
}, []);
|
||||
};
|
||||
var R = /* @__PURE__ */ ((e) => (e.ServerError = "server_error", e.NeedsFalApiKey = "needs_fal_api_key", e))(R || {});
|
||||
const Q = async (e) => await _("fal_background_removal_command", {
|
||||
request: {
|
||||
image_media_token: e.image_media_token,
|
||||
base64_image: e.base64_image
|
||||
}
|
||||
});
|
||||
var L = /* @__PURE__ */ ((e) => (e.ServerError = "server_error", e.NeedsFalApiKey = "needs_fal_api_key", e))(L || {});
|
||||
const z = async (e) => await _("fal_hunyuan_image_to_3d_command", {
|
||||
request: {
|
||||
image_media_token: e.image_media_token,
|
||||
base64_image: e.base64_image
|
||||
}
|
||||
});
|
||||
var G = /* @__PURE__ */ ((e) => (e.ServerError = "server_error", e.NeedsFalApiKey = "needs_fal_api_key", e))(G || {});
|
||||
const x = async (e) => await _("fal_kling_image_to_video_command", {
|
||||
request: {
|
||||
image_media_token: e.image_media_token,
|
||||
base64_image: e.base64_image
|
||||
}
|
||||
}), I = async () => await _("get_fal_api_key_command"), E = async (e) => await _("set_fal_api_key_command", {
|
||||
request: {
|
||||
key: e
|
||||
}
|
||||
}), T = async () => await _("midjourney_get_credential_info_command"), q = async () => await _("get_openai_api_key_command"), ee = async (e) => await _("set_openai_api_key_command", {
|
||||
request: {
|
||||
key: e
|
||||
}
|
||||
}), re = async () => {
|
||||
try {
|
||||
return await _("get_provider_order_command");
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
var O = /* @__PURE__ */ ((e) => (e.ArtCraft = "artcraft", e.Fal = "fal", e.Sora = "sora", e))(O || {});
|
||||
const ae = async (e) => await _("set_provider_order_command", {
|
||||
request: {
|
||||
providers: e.providers
|
||||
}
|
||||
}), _e = async () => await _("get_app_preferences_command");
|
||||
var U = /* @__PURE__ */ ((e) => (e.PreferredDownloadDirectory = "preferred_download_directory", e.PlaySounds = "play_sounds", e.EnqueueSuccessSound = "enqueue_success_sound", e.EnqueueFailureSound = "enqueue_failure_sound", e.GenerationSuccessSound = "generation_success_sound", e.GenerationFailureSound = "generation_failure_sound", e.GenerationEnqueueSound = "generation_enqueue_sound", e))(U || {});
|
||||
const te = async (e) => await _("update_app_preferences_command", {
|
||||
request: {
|
||||
preference: e.preference,
|
||||
value: e.value
|
||||
}
|
||||
});
|
||||
var K = /* @__PURE__ */ ((e) => (e.NotSetUp = "not_set_up", e.ExpiredOrError = "expired_or_error", e.Valid = "valid", e))(K || {});
|
||||
const oe = async () => {
|
||||
const e = await _("check_sora_session_command");
|
||||
return console.log(">>> sora result", e), e;
|
||||
}, ne = async () => await _("sora_logout_command");
|
||||
var H = /* @__PURE__ */ ((e) => (e.Square = "square", e.Wide = "wide", e.Tall = "tall", e))(H || {}), C = /* @__PURE__ */ ((e) => (e.ServerError = "server_error", e.TooManyConcurrentTasks = "too_many_concurrent_tasks", e.SoraIsHavingProblems = "sora_is_having_problems", e.SoraLoginRequired = "sora_login_required", e.SoraUsernameNotYetCreated = "sora_username_not_yet_created", e))(C || {});
|
||||
const ie = async (e) => {
|
||||
try {
|
||||
return await _("sora_image_remix_command", {
|
||||
request: e
|
||||
});
|
||||
} catch (r) {
|
||||
let a = r;
|
||||
if ("status" in a)
|
||||
return a;
|
||||
throw r;
|
||||
}
|
||||
};
|
||||
function se(e) {
|
||||
s(() => {
|
||||
let r;
|
||||
return (async () => {
|
||||
r = await n(
|
||||
"sora-login-success",
|
||||
(o) => {
|
||||
e(o.payload);
|
||||
}
|
||||
);
|
||||
})(), () => {
|
||||
r && r();
|
||||
};
|
||||
}, [e]);
|
||||
}
|
||||
function de() {
|
||||
return new Promise((e) => {
|
||||
let r;
|
||||
n("sora-login-success", () => {
|
||||
r && r(), e();
|
||||
}).then((a) => {
|
||||
r = a;
|
||||
});
|
||||
});
|
||||
}
|
||||
const le = async () => {
|
||||
try {
|
||||
return await _("get_app_info_command");
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
}, ce = async (e) => {
|
||||
try {
|
||||
return await _("load_without_cors_command", { url: e });
|
||||
} catch (r) {
|
||||
throw console.error("LoadWithoutCors error", r), r;
|
||||
}
|
||||
};
|
||||
export {
|
||||
P as ArtcraftGetCredits,
|
||||
V as ArtcraftGetSubscription,
|
||||
D as BasicEventStatus,
|
||||
oe as CheckSoraSession,
|
||||
m as CommandErrorStatus,
|
||||
c as CommandSuccessStatus,
|
||||
J as EnqueueContextualEditImage,
|
||||
u as EnqueueContextualEditImageErrorType,
|
||||
f as EnqueueContextualEditImageModel,
|
||||
g as EnqueueContextualEditImageQuality,
|
||||
p as EnqueueContextualEditImageSize,
|
||||
Y as EnqueueImageBgRemoval,
|
||||
v as EnqueueImageBgRemovalErrorType,
|
||||
B as EnqueueImageInpaint,
|
||||
y as EnqueueImageInpaintErrorType,
|
||||
b as EnqueueImageInpaintModel,
|
||||
Z as EnqueueImageTo3dObject,
|
||||
w as EnqueueImageTo3dObjectErrorType,
|
||||
k as EnqueueImageTo3dObjectModel,
|
||||
X as EnqueueImageToVideo,
|
||||
S as EnqueueImageToVideoErrorType,
|
||||
$ as EnqueueTextToImage,
|
||||
N as EnqueueTextToImageErrorType,
|
||||
h as EnqueueTextToImageModel,
|
||||
A as EnqueueTextToImageSize,
|
||||
Q as FalBackgroundRemoval,
|
||||
R as FalBackgroundRemovalErrorType,
|
||||
z as FalHunyuanImageTo3d,
|
||||
L as FalHunyuanImageTo3dErrorType,
|
||||
x as FalKlingImageToVideo,
|
||||
G as FalKlingImageToVideoErrorType,
|
||||
le as GetAppInfo,
|
||||
_e as GetAppPreferences,
|
||||
I as GetFalApiKey,
|
||||
q as GetOpenAIApiKey,
|
||||
re as GetProviderOrder,
|
||||
ce as LoadWithoutCors,
|
||||
ne as LogoutSoraSession,
|
||||
T as MidjourneyGetCredentialInfo,
|
||||
U as PreferenceName,
|
||||
O as Provider,
|
||||
E as SetFalApiKey,
|
||||
ee as SetOpenAIApiKey,
|
||||
ae as SetProviderOrder,
|
||||
ie as SoraImageRemix,
|
||||
H as SoraImageRemixAspectRatio,
|
||||
C as SoraImageRemixErrorType,
|
||||
K as SoraSessionState,
|
||||
te as UpdateAppPreferences,
|
||||
j as useCanvasBgRemovedEvent,
|
||||
se as useSoraLoginListener,
|
||||
de as waitForSoraLogin
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
export interface ArtcraftGetCreditsSuccess extends CommandResult {
|
||||
payload: ArtcraftGetCreditsPayload;
|
||||
}
|
||||
export interface ArtcraftGetCreditsPayload {
|
||||
free_credits: number;
|
||||
monthly_credits: number;
|
||||
banked_credits: number;
|
||||
sum_total_credits: number;
|
||||
}
|
||||
export declare const ArtcraftGetCredits: () => Promise<ArtcraftGetCreditsSuccess>;
|
||||
//# sourceMappingURL=ArtcraftGetCredits.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ArtcraftGetCredits.d.ts","sourceRoot":"","sources":["../../../src/lib/artcraft/ArtcraftGetCredits.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,WAAW,yBAA0B,SAAQ,aAAa;IAC9D,OAAO,EAAE,yBAAyB,CAAC;CACpC;AAED,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,kBAAkB,QAAc,OAAO,CAAC,yBAAyB,CAM7E,CAAA"}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
export interface ArtcraftGetSubscriptionSuccess extends CommandResult {
|
||||
payload: ArtcraftGetSubscriptionPayload;
|
||||
}
|
||||
export interface ArtcraftGetSubscriptionPayload {
|
||||
active_subscription?: ActiveSubscriptionInfo;
|
||||
}
|
||||
export interface ActiveSubscriptionInfo {
|
||||
subscription_token: string;
|
||||
product_slug: string;
|
||||
namespace: string;
|
||||
next_bill_at?: string;
|
||||
subscription_end_at?: string;
|
||||
}
|
||||
export declare const ArtcraftGetSubscription: () => Promise<ArtcraftGetSubscriptionSuccess>;
|
||||
//# sourceMappingURL=ArtcraftGetSubscription.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ArtcraftGetSubscription.d.ts","sourceRoot":"","sources":["../../../src/lib/artcraft/ArtcraftGetSubscription.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,WAAW,8BAA+B,SAAQ,aAAa;IACnE,OAAO,EAAE,8BAA8B,CAAC;CACzC;AAED,MAAM,WAAW,8BAA8B;IAC7C,mBAAmB,CAAC,EAAE,sBAAsB,CAAA;CAC7C;AAED,MAAM,WAAW,sBAAsB;IACrC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,uBAAuB,QAAc,OAAO,CAAC,8BAA8B,CAMvF,CAAA"}
|
||||
@@ -0,0 +1,13 @@
|
||||
export declare enum CommandSuccessStatus {
|
||||
Success = "success"
|
||||
}
|
||||
export declare enum CommandErrorStatus {
|
||||
BadRequest = "bad_request",
|
||||
Unauthorized = "unauthorized",
|
||||
ServerError = "server_error"
|
||||
}
|
||||
export type CommandStatus = CommandSuccessStatus | CommandErrorStatus;
|
||||
export interface CommandResult {
|
||||
status: CommandStatus;
|
||||
}
|
||||
//# sourceMappingURL=CommandStatus.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CommandStatus.d.ts","sourceRoot":"","sources":["../../../src/lib/common/CommandStatus.ts"],"names":[],"mappings":"AAEA,oBAAY,oBAAoB;IAC9B,OAAO,YAAY;CACpB;AAED,oBAAY,kBAAkB;IAC5B,UAAU,gBAAgB;IAC1B,YAAY,iBAAiB;IAC7B,WAAW,iBAAiB;CAC7B;AAED,MAAM,MAAM,aAAa,GAAG,oBAAoB,GAAG,kBAAkB,CAAC;AAEtE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,aAAa,CAAC;CACvB"}
|
||||
@@ -0,0 +1,50 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
import { ImageModel } from '@storyteller/model-list';
|
||||
export interface EnqueueContextualEditImageRequest {
|
||||
model?: ImageModel | EnqueueContextualEditImageModel;
|
||||
scene_image_media_token?: string;
|
||||
image_media_tokens?: string[];
|
||||
prompt?: string;
|
||||
disable_system_prompt?: boolean;
|
||||
image_count?: number;
|
||||
aspect_ratio?: EnqueueContextualEditImageSize;
|
||||
image_quality?: EnqueueContextualEditImageQuality;
|
||||
}
|
||||
export declare enum EnqueueContextualEditImageErrorType {
|
||||
ModelNotSpecified = "model_not_specified",
|
||||
NoProviderAvailable = "no_provider_available",
|
||||
BadRequest = "bad_request",
|
||||
ServerError = "server_error",
|
||||
TooManyConcurrentTasks = "too_many_concurrent_tasks",
|
||||
SoraLoginRequired = "sora_login_required",
|
||||
SoraUsernameNotYetCreated = "sora_username_not_yet_created",
|
||||
SoraIsHavingProblems = "sora_is_having_problems"
|
||||
}
|
||||
export declare enum EnqueueContextualEditImageModel {
|
||||
GptImage1 = "gpt_image_1",
|
||||
FluxProKontextMax = "flux_pro_kontext_max"
|
||||
}
|
||||
export declare enum EnqueueContextualEditImageSize {
|
||||
Auto = "auto",
|
||||
Square = "square",
|
||||
Wide = "wide",
|
||||
Tall = "tall"
|
||||
}
|
||||
export declare enum EnqueueContextualEditImageQuality {
|
||||
Auto = "auto",
|
||||
High = "high",
|
||||
Medium = "medium",
|
||||
Low = "low"
|
||||
}
|
||||
export interface EnqueueContextualEditImageError extends CommandResult {
|
||||
error_type: EnqueueContextualEditImageErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
export interface EnqueueContextualEditImagePayload {
|
||||
}
|
||||
export interface EnqueueContextualEditImageSuccess extends CommandResult {
|
||||
payload: EnqueueContextualEditImagePayload;
|
||||
}
|
||||
export type EnqueueContextualEditImageResult = EnqueueContextualEditImageSuccess | EnqueueContextualEditImageError;
|
||||
export declare const EnqueueContextualEditImage: (request: EnqueueContextualEditImageRequest) => Promise<EnqueueContextualEditImageResult>;
|
||||
//# sourceMappingURL=EnqueueContextualEditImage.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"EnqueueContextualEditImage.d.ts","sourceRoot":"","sources":["../../../src/lib/enqueue/EnqueueContextualEditImage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,MAAM,WAAW,iCAAiC;IAGhD,KAAK,CAAC,EAAE,UAAU,GAAG,+BAA+B,CAAC;IAKrD,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAKjC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAG9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAGhC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,YAAY,CAAC,EAAE,8BAA8B,CAAC;IAE9C,aAAa,CAAC,EAAE,iCAAiC,CAAC;CACnD;AAgBD,oBAAY,mCAAmC;IAC7C,iBAAiB,wBAAwB;IACzC,mBAAmB,0BAA0B;IAC7C,UAAU,gBAAgB;IAC1B,WAAW,iBAAiB;IAC5B,sBAAsB,8BAA8B;IACpD,iBAAiB,wBAAwB;IACzC,yBAAyB,kCAAkC;IAC3D,oBAAoB,4BAA4B;CACjD;AAED,oBAAY,+BAA+B;IACzC,SAAS,gBAAgB;IACzB,iBAAiB,yBAAyB;CAC3C;AAED,oBAAY,8BAA8B;IACxC,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,oBAAY,iCAAiC;IAC3C,IAAI,SAAS;IACb,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,GAAG,QAAQ;CACZ;AAED,MAAM,WAAW,+BAAgC,SAAQ,aAAa;IACpE,UAAU,EAAE,mCAAmC,CAAC;IAChD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iCAAiC;CACjD;AAED,MAAM,WAAW,iCAAkC,SAAQ,aAAa;IACtE,OAAO,EAAE,iCAAiC,CAAC;CAC5C;AAED,MAAM,MAAM,gCAAgC,GAAG,iCAAiC,GAAG,+BAA+B,CAAC;AAEnH,eAAO,MAAM,0BAA0B,GAAU,SAAS,iCAAiC,KAAI,OAAO,CAAC,gCAAgC,CAkDtI,CAAA"}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
export interface EnqueueImageBgRemovalRequest {
|
||||
image_media_token?: string;
|
||||
base64_image?: string;
|
||||
frontend_caller?: string;
|
||||
frontend_subscriber_id?: string;
|
||||
}
|
||||
export declare enum EnqueueImageBgRemovalErrorType {
|
||||
ModelNotSpecified = "model_not_specified",
|
||||
ServerError = "server_error",
|
||||
NeedsFalApiKey = "needs_fal_api_key",
|
||||
FalError = "fal_error"
|
||||
}
|
||||
export interface EnqueueImageBgRemovalError extends CommandResult {
|
||||
error_type: EnqueueImageBgRemovalErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
export interface EnqueueImageBgRemovalPayload {
|
||||
}
|
||||
export interface EnqueueImageBgRemovalSuccess extends CommandResult {
|
||||
payload: EnqueueImageBgRemovalPayload;
|
||||
}
|
||||
export type EnqueueImageBgRemovalResult = EnqueueImageBgRemovalSuccess | EnqueueImageBgRemovalError;
|
||||
export declare const EnqueueImageBgRemoval: (request: EnqueueImageBgRemovalRequest) => Promise<EnqueueImageBgRemovalResult>;
|
||||
//# sourceMappingURL=EnqueueImageBgRemovalCommand.d.ts.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"EnqueueImageBgRemovalCommand.d.ts","sourceRoot":"","sources":["../../../src/lib/enqueue/EnqueueImageBgRemovalCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,WAAW,4BAA4B;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,eAAe,CAAC,EAAE,MAAM,CAAC;IAGzB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AASD,oBAAY,8BAA8B;IAExC,iBAAiB,wBAAwB;IAEzC,WAAW,iBAAiB;IAE5B,cAAc,sBAAsB;IAEpC,QAAQ,cAAc;CACvB;AAED,MAAM,WAAW,0BAA2B,SAAQ,aAAa;IAC/D,UAAU,EAAE,8BAA8B,CAAC;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,4BAA4B;CAC5C;AAED,MAAM,WAAW,4BAA6B,SAAQ,aAAa;IACjE,OAAO,EAAE,4BAA4B,CAAC;CACvC;AAED,MAAM,MAAM,2BAA2B,GAAG,4BAA4B,GAAG,0BAA0B,CAAC;AAEpG,eAAO,MAAM,qBAAqB,GAAU,SAAS,4BAA4B,KAAI,OAAO,CAAC,2BAA2B,CAwBvH,CAAA"}
|
||||
@@ -0,0 +1,37 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
import { ImageModel, ModelInfo } from '@storyteller/model-list';
|
||||
export interface EnqueueImageInpaintRequest {
|
||||
model?: ImageModel | ModelInfo | EnqueueImageInpaintModel;
|
||||
image_media_token?: string;
|
||||
mask_image_raw_bytes?: Uint8Array;
|
||||
prompt?: string;
|
||||
image_count?: number;
|
||||
frontend_caller?: string;
|
||||
frontend_subscriber_id?: string;
|
||||
}
|
||||
export declare enum EnqueueImageInpaintErrorType {
|
||||
ModelNotSpecified = "model_not_specified",
|
||||
NoProviderAvailable = "no_provider_available",
|
||||
BadRequest = "bad_request",
|
||||
ServerError = "server_error",
|
||||
TooManyConcurrentTasks = "too_many_concurrent_tasks",
|
||||
SoraLoginRequired = "sora_login_required",
|
||||
SoraUsernameNotYetCreated = "sora_username_not_yet_created",
|
||||
SoraIsHavingProblems = "sora_is_having_problems"
|
||||
}
|
||||
export declare enum EnqueueImageInpaintModel {
|
||||
FluxPro1 = "flux_pro_1",
|
||||
FluxDevJuggernaut = "flux_dev_juggernaut"
|
||||
}
|
||||
export interface EnqueueImageInpaintError extends CommandResult {
|
||||
error_type: EnqueueImageInpaintErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
export interface EnqueueImageInpaintPayload {
|
||||
}
|
||||
export interface EnqueueImageInpaintSuccess extends CommandResult {
|
||||
payload: EnqueueImageInpaintPayload;
|
||||
}
|
||||
export type EnqueueImageInpaintResult = EnqueueImageInpaintSuccess | EnqueueImageInpaintError;
|
||||
export declare const EnqueueImageInpaint: (request: EnqueueImageInpaintRequest) => Promise<EnqueueImageInpaintResult>;
|
||||
//# sourceMappingURL=EnqueueImageInpaint.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"EnqueueImageInpaint.d.ts","sourceRoot":"","sources":["../../../src/lib/enqueue/EnqueueImageInpaint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,0BAA0B;IAEzC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,wBAAwB,CAAC;IAG1D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAG3B,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAGlC,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,eAAe,CAAC,EAAE,MAAM,CAAC;IAGzB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAeD,oBAAY,4BAA4B;IACtC,iBAAiB,wBAAwB;IACzC,mBAAmB,0BAA0B;IAC7C,UAAU,gBAAgB;IAC1B,WAAW,iBAAiB;IAC5B,sBAAsB,8BAA8B;IACpD,iBAAiB,wBAAwB;IACzC,yBAAyB,kCAAkC;IAC3D,oBAAoB,4BAA4B;CACjD;AAED,oBAAY,wBAAwB;IAClC,QAAQ,eAAe;IACvB,iBAAiB,wBAAwB;CAC1C;AAED,MAAM,WAAW,wBAAyB,SAAQ,aAAa;IAC7D,UAAU,EAAE,4BAA4B,CAAC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,0BAA0B;CAC1C;AAED,MAAM,WAAW,0BAA2B,SAAQ,aAAa;IAC/D,OAAO,EAAE,0BAA0B,CAAC;CACrC;AAED,MAAM,MAAM,yBAAyB,GAAG,0BAA0B,GAAG,wBAAwB,CAAC;AAE9F,eAAO,MAAM,mBAAmB,GAAU,SAAS,0BAA0B,KAAI,OAAO,CAAC,yBAAyB,CA+CjH,CAAA"}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
export declare enum EnqueueImageTo3dObjectErrorType {
|
||||
ModelNotSpecified = "model_not_specified",
|
||||
ServerError = "server_error",
|
||||
NeedsFalApiKey = "needs_fal_api_key",
|
||||
FalError = "fal_error",
|
||||
NeedsStorytellerCredentials = "needs_storyteller_credentials"
|
||||
}
|
||||
export interface EnqueueImageTo3dObjectRequest {
|
||||
image_media_token?: string;
|
||||
model?: EnqueueImageTo3dObjectModel;
|
||||
}
|
||||
export declare enum EnqueueImageTo3dObjectModel {
|
||||
Hunyuan3d2 = "hunyuan_3d_2",
|
||||
Hunyuan3d2_0 = "hunyuan_3d_2_0",
|
||||
Hunyuan3d2_1 = "hunyuan_3d_2_1"
|
||||
}
|
||||
export interface EnqueueImageTo3dObjectError extends CommandResult {
|
||||
error_type: EnqueueImageTo3dObjectErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
export interface EnqueueImageTo3dObjectPayload {
|
||||
}
|
||||
export interface EnqueueImageTo3dObjectSuccess extends CommandResult {
|
||||
payload: EnqueueImageTo3dObjectPayload;
|
||||
}
|
||||
export type EnqueueImageTo3dObjectResult = EnqueueImageTo3dObjectSuccess | EnqueueImageTo3dObjectError;
|
||||
export declare const EnqueueImageTo3dObject: (request: EnqueueImageTo3dObjectRequest) => Promise<EnqueueImageTo3dObjectResult>;
|
||||
//# sourceMappingURL=EnqueueImageTo3dObject.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"EnqueueImageTo3dObject.d.ts","sourceRoot":"","sources":["../../../src/lib/enqueue/EnqueueImageTo3dObject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,oBAAY,+BAA+B;IAEzC,iBAAiB,wBAAwB;IAEzC,WAAW,iBAAiB;IAE5B,cAAc,sBAAsB;IAEpC,QAAQ,cAAc;IAEtB,2BAA2B,kCAAkC;CAC9D;AAED,MAAM,WAAW,6BAA6B;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,2BAA2B,CAAC;CACrC;AAED,oBAAY,2BAA2B;IACrC,UAAU,iBAAiB;IAC3B,YAAY,mBAAmB;IAC/B,YAAY,mBAAmB;CAChC;AAED,MAAM,WAAW,2BAA4B,SAAQ,aAAa;IAChE,UAAU,EAAE,+BAA+B,CAAC;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,6BAA6B;CAC7C;AAED,MAAM,WAAW,6BAA8B,SAAQ,aAAa;IAClE,OAAO,EAAE,6BAA6B,CAAC;CACxC;AAED,MAAM,MAAM,4BAA4B,GAAG,6BAA6B,GAAG,2BAA2B,CAAC;AAEvG,eAAO,MAAM,sBAAsB,GAAU,SAAS,6BAA6B,KAAI,OAAO,CAAC,4BAA4B,CAQ1H,CAAA"}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
import { Model } from '@storyteller/model-list';
|
||||
export declare enum EnqueueImageToVideoErrorType {
|
||||
ModelNotSpecified = "model_not_specified",
|
||||
ServerError = "server_error",
|
||||
NeedsFalApiKey = "needs_fal_api_key",
|
||||
FalError = "fal_error"
|
||||
}
|
||||
export interface EnqueueImageToVideoRequest {
|
||||
model?: Model;
|
||||
image_media_token?: string;
|
||||
end_frame_image_media_token?: string;
|
||||
prompt?: string;
|
||||
frontend_caller?: string;
|
||||
frontend_subscriber_id?: string;
|
||||
}
|
||||
export interface EnqueueImageToVideoError extends CommandResult {
|
||||
error_type: EnqueueImageToVideoErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
export interface EnqueueImageToVideoPayload {
|
||||
}
|
||||
export interface EnqueueImageToVideoSuccess extends CommandResult {
|
||||
payload: EnqueueImageToVideoPayload;
|
||||
}
|
||||
export type EnqueueImageToVideoResult = EnqueueImageToVideoSuccess | EnqueueImageToVideoError;
|
||||
export declare const EnqueueImageToVideo: (request: EnqueueImageToVideoRequest) => Promise<EnqueueImageToVideoResult>;
|
||||
//# sourceMappingURL=EnqueueImageToVideo.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"EnqueueImageToVideo.d.ts","sourceRoot":"","sources":["../../../src/lib/enqueue/EnqueueImageToVideo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,oBAAY,4BAA4B;IAEtC,iBAAiB,wBAAwB;IAEzC,WAAW,iBAAiB;IAE5B,cAAc,sBAAsB;IAEpC,QAAQ,cAAc;CACvB;AAED,MAAM,WAAW,0BAA0B;IAEzC,KAAK,CAAC,EAAE,KAAK,CAAC;IAGd,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAG3B,2BAA2B,CAAC,EAAE,MAAM,CAAC;IAGrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,eAAe,CAAC,EAAE,MAAM,CAAC;IAGzB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAWD,MAAM,WAAW,wBAAyB,SAAQ,aAAa;IAC7D,UAAU,EAAE,4BAA4B,CAAC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,0BAA0B;CAAG;AAE9C,MAAM,WAAW,0BAA2B,SAAQ,aAAa;IAC/D,OAAO,EAAE,0BAA0B,CAAC;CACrC;AAED,MAAM,MAAM,yBAAyB,GACjC,0BAA0B,GAC1B,wBAAwB,CAAC;AAE7B,eAAO,MAAM,mBAAmB,GAC9B,SAAS,0BAA0B,KAClC,OAAO,CAAC,yBAAyB,CA4BnC,CAAC"}
|
||||
@@ -0,0 +1,43 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
import { Model } from '@storyteller/model-list';
|
||||
export declare enum EnqueueTextToImageErrorType {
|
||||
ModelNotSpecified = "model_not_specified",
|
||||
ServerError = "server_error",
|
||||
NeedsFalApiKey = "needs_fal_api_key",
|
||||
FalError = "fal_error"
|
||||
}
|
||||
export interface EnqueueTextToImageRequest {
|
||||
model?: Model | EnqueueTextToImageModel;
|
||||
prompt?: string;
|
||||
aspect_ratio?: EnqueueTextToImageSize;
|
||||
number_images?: number;
|
||||
image_media_tokens?: string[];
|
||||
frontend_caller?: string;
|
||||
frontend_subscriber_id?: string;
|
||||
}
|
||||
export declare enum EnqueueTextToImageModel {
|
||||
FluxProUltra = "flux_pro_ultra",
|
||||
GptImage1 = "gpt_image_1",
|
||||
Recraft3 = "recraft_3"
|
||||
}
|
||||
export declare enum EnqueueTextToImageSize {
|
||||
Auto = "auto",
|
||||
Square = "square",
|
||||
Wide = "wide",
|
||||
Tall = "tall"
|
||||
}
|
||||
export interface EnqueueTextToImageError extends CommandResult {
|
||||
error_type: EnqueueTextToImageErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
export interface EnqueueTextToImagePayload {
|
||||
media_token: string;
|
||||
cdn_url: string;
|
||||
base64_bytes: string;
|
||||
}
|
||||
export interface EnqueueTextToImageSuccess extends CommandResult {
|
||||
payload: EnqueueTextToImagePayload;
|
||||
}
|
||||
export type EnqueueTextToImageResult = EnqueueTextToImageSuccess | EnqueueTextToImageError;
|
||||
export declare const EnqueueTextToImage: (request: EnqueueTextToImageRequest) => Promise<EnqueueTextToImageResult>;
|
||||
//# sourceMappingURL=EnqueueTextToImage.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"EnqueueTextToImage.d.ts","sourceRoot":"","sources":["../../../src/lib/enqueue/EnqueueTextToImage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,oBAAY,2BAA2B;IAErC,iBAAiB,wBAAwB;IAEzC,WAAW,iBAAiB;IAE5B,cAAc,sBAAsB;IAEpC,QAAQ,cAAc;CACvB;AAED,MAAM,WAAW,yBAAyB;IAExC,KAAK,CAAC,EAAE,KAAK,GAAG,uBAAuB,CAAC;IAGxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,YAAY,CAAC,EAAE,sBAAsB,CAAC;IAGtC,aAAa,CAAC,EAAE,MAAM,CAAC;IAMvB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAI9B,eAAe,CAAC,EAAE,MAAM,CAAC;IAGzB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAcD,oBAAY,uBAAuB;IACjC,YAAY,mBAAmB;IAC/B,SAAS,gBAAgB;IACzB,QAAQ,cAAc;CACvB;AAED,oBAAY,sBAAsB;IAChC,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,MAAM,WAAW,uBAAwB,SAAQ,aAAa;IAC5D,UAAU,EAAE,2BAA2B,CAAC;IACxC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,yBAA0B,SAAQ,aAAa;IAC9D,OAAO,EAAE,yBAAyB,CAAC;CACpC;AAED,MAAM,MAAM,wBAAwB,GAAG,yBAAyB,GAAG,uBAAuB,CAAC;AAE3F,eAAO,MAAM,kBAAkB,GAAU,SAAS,yBAAyB,KAAI,OAAO,CAAC,wBAAwB,CA8C9G,CAAA"}
|
||||
@@ -0,0 +1,9 @@
|
||||
export declare enum BasicEventStatus {
|
||||
Success = "success",
|
||||
Failure = "failure"
|
||||
}
|
||||
export interface BasicEventWrapper<T> {
|
||||
status: BasicEventStatus;
|
||||
data: T;
|
||||
}
|
||||
//# sourceMappingURL=BasicEventWrapper.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BasicEventWrapper.d.ts","sourceRoot":"","sources":["../../../src/lib/events/BasicEventWrapper.ts"],"names":[],"mappings":"AACA,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,CAAC,CAAC;CACT"}
|
||||
@@ -0,0 +1,8 @@
|
||||
export interface CanvasBgRemovedEvent {
|
||||
media_token: string;
|
||||
image_cdn_url: string;
|
||||
maybe_frontend_subscriber_id?: string;
|
||||
maybe_frontend_subscriber_payload?: string;
|
||||
}
|
||||
export declare const useCanvasBgRemovedEvent: (asyncCallback: (event: CanvasBgRemovedEvent) => Promise<void>) => void;
|
||||
//# sourceMappingURL=CanvasBgRemovedEvent.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CanvasBgRemovedEvent.d.ts","sourceRoot":"","sources":["../../../src/lib/events/CanvasBgRemovedEvent.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,iCAAiC,CAAC,EAAE,MAAM,CAAC;CAC5C;AAED,eAAO,MAAM,uBAAuB,GAAI,eAAe,CAAC,KAAK,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,SAuBpG,CAAA"}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
export declare enum FalBackgroundRemovalErrorType {
|
||||
ServerError = "server_error",
|
||||
NeedsFalApiKey = "needs_fal_api_key"
|
||||
}
|
||||
export interface FalBackgroundRemovalRequest {
|
||||
image_media_token?: string;
|
||||
base64_image?: string;
|
||||
}
|
||||
export interface FalBackgroundRemovalError extends CommandResult {
|
||||
error_type: FalBackgroundRemovalErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
export interface FalBackgroundRemovalPayload {
|
||||
media_token: string;
|
||||
cdn_url: string;
|
||||
base64_bytes: string;
|
||||
}
|
||||
export interface FalBackgroundRemovalSuccess extends CommandResult {
|
||||
payload: FalBackgroundRemovalPayload;
|
||||
}
|
||||
export type FalBackgroundRemovalResult = FalBackgroundRemovalSuccess | FalBackgroundRemovalError;
|
||||
export declare const FalBackgroundRemoval: (request: FalBackgroundRemovalRequest) => Promise<FalBackgroundRemovalResult>;
|
||||
//# sourceMappingURL=FalBackgroundRemoval.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FalBackgroundRemoval.d.ts","sourceRoot":"","sources":["../../../src/lib/fal/FalBackgroundRemoval.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,oBAAY,6BAA6B;IACvC,WAAW,iBAAiB;IAC5B,cAAc,sBAAsB;CACrC;AAED,MAAM,WAAW,2BAA2B;IAC1C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,yBAA0B,SAAQ,aAAa;IAC9D,UAAU,EAAE,6BAA6B,CAAC;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,2BAA4B,SAAQ,aAAa;IAChE,OAAO,EAAE,2BAA2B,CAAC;CACtC;AAED,MAAM,MAAM,0BAA0B,GAAG,2BAA2B,GAAG,yBAAyB,CAAC;AAEjG,eAAO,MAAM,oBAAoB,GAAU,SAAS,2BAA2B,KAAI,OAAO,CAAC,0BAA0B,CAQpH,CAAA"}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
export declare enum FalHunyuanImageTo3dErrorType {
|
||||
ServerError = "server_error",
|
||||
NeedsFalApiKey = "needs_fal_api_key"
|
||||
}
|
||||
export interface FalHunyuanImageTo3dRequest {
|
||||
image_media_token?: string;
|
||||
base64_image?: string;
|
||||
}
|
||||
export interface FalHunyuanImageTo3dError extends CommandResult {
|
||||
error_type: FalHunyuanImageTo3dErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
export interface FalHunyuanImageTo3dPayload {
|
||||
media_token: string;
|
||||
cdn_url: string;
|
||||
base64_bytes: string;
|
||||
}
|
||||
export interface FalHunyuanImageTo3dSuccess extends CommandResult {
|
||||
payload: FalHunyuanImageTo3dPayload;
|
||||
}
|
||||
export type FalHunyuanImageTo3dResult = FalHunyuanImageTo3dSuccess | FalHunyuanImageTo3dError;
|
||||
export declare const FalHunyuanImageTo3d: (request: FalHunyuanImageTo3dRequest) => Promise<FalHunyuanImageTo3dResult>;
|
||||
//# sourceMappingURL=FalHunyuanImageTo3d.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FalHunyuanImageTo3d.d.ts","sourceRoot":"","sources":["../../../src/lib/fal/FalHunyuanImageTo3d.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,oBAAY,4BAA4B;IACtC,WAAW,iBAAiB;IAC5B,cAAc,sBAAsB;CACrC;AAED,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,wBAAyB,SAAQ,aAAa;IAC7D,UAAU,EAAE,4BAA4B,CAAC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,0BAA2B,SAAQ,aAAa;IAC/D,OAAO,EAAE,0BAA0B,CAAC;CACrC;AAED,MAAM,MAAM,yBAAyB,GAAG,0BAA0B,GAAG,wBAAwB,CAAC;AAE9F,eAAO,MAAM,mBAAmB,GAAU,SAAS,0BAA0B,KAAI,OAAO,CAAC,yBAAyB,CAQjH,CAAA"}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
export declare enum FalKlingImageToVideoErrorType {
|
||||
ServerError = "server_error",
|
||||
NeedsFalApiKey = "needs_fal_api_key"
|
||||
}
|
||||
export interface FalKlingImageToVideoRequest {
|
||||
image_media_token?: string;
|
||||
base64_image?: string;
|
||||
}
|
||||
export interface FalKlingImageToVideoError extends CommandResult {
|
||||
error_type: FalKlingImageToVideoErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
export interface FalKlingImageToVideoPayload {
|
||||
media_token: string;
|
||||
cdn_url: string;
|
||||
base64_bytes: string;
|
||||
}
|
||||
export interface FalKlingImageToVideoSuccess extends CommandResult {
|
||||
payload: FalKlingImageToVideoPayload;
|
||||
}
|
||||
export type FalKlingImageToVideoResult = FalKlingImageToVideoSuccess | FalKlingImageToVideoError;
|
||||
export declare const FalKlingImageToVideo: (request: FalKlingImageToVideoRequest) => Promise<FalKlingImageToVideoResult>;
|
||||
//# sourceMappingURL=FalKlingImageToVideo.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FalKlingImageToVideo.d.ts","sourceRoot":"","sources":["../../../src/lib/fal/FalKlingImageToVideo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,oBAAY,6BAA6B;IACvC,WAAW,iBAAiB;IAC5B,cAAc,sBAAsB;CACrC;AAED,MAAM,WAAW,2BAA2B;IAC1C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,yBAA0B,SAAQ,aAAa;IAC9D,UAAU,EAAE,6BAA6B,CAAC;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,2BAA4B,SAAQ,aAAa;IAChE,OAAO,EAAE,2BAA2B,CAAC;CACtC;AAED,MAAM,MAAM,0BAA0B,GAAG,2BAA2B,GAAG,yBAAyB,CAAC;AAEjG,eAAO,MAAM,oBAAoB,GAAU,SAAS,2BAA2B,KAAI,OAAO,CAAC,0BAA0B,CAQpH,CAAA"}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
export interface GetFalApiKeySuccessResult extends CommandResult {
|
||||
payload: {
|
||||
key: string;
|
||||
};
|
||||
}
|
||||
export type GetFalApiKeyResult = GetFalApiKeySuccessResult | CommandResult;
|
||||
export declare const GetFalApiKey: () => Promise<GetFalApiKeyResult>;
|
||||
//# sourceMappingURL=GetFalApiKey.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"GetFalApiKey.d.ts","sourceRoot":"","sources":["../../../src/lib/fal/GetFalApiKey.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,WAAW,yBAA0B,SAAQ,aAAa;IAC9D,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,MAAM,MAAM,kBAAkB,GAAG,yBAAyB,GAAG,aAAa,CAAC;AAE3E,eAAO,MAAM,YAAY,QAAa,OAAO,CAAC,kBAAkB,CAG/D,CAAC"}
|
||||
@@ -0,0 +1,3 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
export declare const SetFalApiKey: (key: string) => Promise<CommandResult>;
|
||||
//# sourceMappingURL=SetFalApiKey.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SetFalApiKey.d.ts","sourceRoot":"","sources":["../../../src/lib/fal/SetFalApiKey.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,eAAO,MAAM,YAAY,GAAU,KAAK,MAAM,KAAI,OAAO,CAAC,aAAa,CAOtE,CAAA"}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
export interface MidjourneyGetCredentialInfoPayload {
|
||||
maybe_email?: string;
|
||||
can_clear_state: boolean;
|
||||
}
|
||||
export interface MidjourneyGetCredentialInfoSuccess extends CommandResult {
|
||||
payload: MidjourneyGetCredentialInfoPayload;
|
||||
}
|
||||
export declare const MidjourneyGetCredentialInfo: () => Promise<MidjourneyGetCredentialInfoSuccess>;
|
||||
//# sourceMappingURL=MidjourneyGetCredentialInfo.d.ts.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"MidjourneyGetCredentialInfo.d.ts","sourceRoot":"","sources":["../../../src/lib/midjourney/MidjourneyGetCredentialInfo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,WAAW,kCAAkC;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,kCAAmC,SAAQ,aAAa;IACvE,OAAO,EAAE,kCAAkC,CAAC;CAC7C;AAED,eAAO,MAAM,2BAA2B,QAAa,OAAO,CAAC,kCAAkC,CAG9F,CAAC"}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
export interface GetOpenAIApiKeySuccessResult extends CommandResult {
|
||||
payload: {
|
||||
key: string;
|
||||
};
|
||||
}
|
||||
export type GetOpenAIApiKeyResult = GetOpenAIApiKeySuccessResult | CommandResult;
|
||||
export declare const GetOpenAIApiKey: () => Promise<GetOpenAIApiKeyResult>;
|
||||
//# sourceMappingURL=GetOpenAIApiKey.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"GetOpenAIApiKey.d.ts","sourceRoot":"","sources":["../../../src/lib/openai/GetOpenAIApiKey.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,WAAW,4BAA6B,SAAQ,aAAa;IACjE,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,MAAM,MAAM,qBAAqB,GAAG,4BAA4B,GAAG,aAAa,CAAC;AAEjF,eAAO,MAAM,eAAe,QAAa,OAAO,CAAC,qBAAqB,CAGrE,CAAC"}
|
||||
@@ -0,0 +1,3 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
export declare const SetOpenAIApiKey: (key: string) => Promise<CommandResult>;
|
||||
//# sourceMappingURL=SetOpenAIApiKey.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SetOpenAIApiKey.d.ts","sourceRoot":"","sources":["../../../src/lib/openai/SetOpenAIApiKey.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,eAAO,MAAM,eAAe,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,aAAa,CAOxE,CAAC"}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
import { Provider } from './Provider';
|
||||
export interface GetProviderOrderSuccess extends CommandResult {
|
||||
payload: GetProviderOrderPayload;
|
||||
}
|
||||
export interface GetProviderOrderPayload {
|
||||
providers: Provider[];
|
||||
}
|
||||
export declare const GetProviderOrder: () => Promise<GetProviderOrderSuccess>;
|
||||
//# sourceMappingURL=GetProviderOrder.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"GetProviderOrder.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/GetProviderOrder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,uBAAwB,SAAQ,aAAa;IAC5D,OAAO,EAAE,uBAAuB,CAAC;CAClC;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB;AAID,eAAO,MAAM,gBAAgB,QAAc,OAAO,CAAC,uBAAuB,CAOzE,CAAA"}
|
||||
@@ -0,0 +1,6 @@
|
||||
export declare enum Provider {
|
||||
ArtCraft = "artcraft",
|
||||
Fal = "fal",
|
||||
Sora = "sora"
|
||||
}
|
||||
//# sourceMappingURL=Provider.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/Provider.ts"],"names":[],"mappings":"AACA,oBAAY,QAAQ;IAClB,QAAQ,aAAa;IACrB,GAAG,QAAQ;IACX,IAAI,SAAS;CACd"}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
import { Provider } from './Provider';
|
||||
export interface SetProviderOrderRequest {
|
||||
providers: Provider[];
|
||||
}
|
||||
export declare const SetProviderOrder: (request: SetProviderOrderRequest) => Promise<CommandResult>;
|
||||
//# sourceMappingURL=SetProviderOrder.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SetProviderOrder.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/SetProviderOrder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,gBAAgB,GAAU,SAAS,uBAAuB,KAAI,OAAO,CAAC,aAAa,CAQ/F,CAAA"}
|
||||
@@ -0,0 +1,21 @@
|
||||
export interface GetAppPreferencesResult {
|
||||
preferences: AppPreferencesPayload;
|
||||
}
|
||||
export interface AppPreferencesPayload {
|
||||
preferred_download_directory: PreferredDownloadDirectory;
|
||||
play_sounds: boolean;
|
||||
enqueue_success_sound?: string;
|
||||
enqueue_failure_sound?: string;
|
||||
generation_success_sound?: string;
|
||||
generation_failure_sound?: string;
|
||||
generation_enqueue_sound?: string;
|
||||
}
|
||||
export type PreferredDownloadDirectory = SystemDirectory | CustomDirectory;
|
||||
export interface SystemDirectory {
|
||||
system: string;
|
||||
}
|
||||
export interface CustomDirectory {
|
||||
custom: string;
|
||||
}
|
||||
export declare const GetAppPreferences: () => Promise<GetAppPreferencesResult>;
|
||||
//# sourceMappingURL=GetAppPreferences.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"GetAppPreferences.d.ts","sourceRoot":"","sources":["../../../src/lib/settings/GetAppPreferences.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,qBAAqB,CAAC;CACpC;AAED,MAAM,WAAW,qBAAqB;IAEpC,4BAA4B,EAAE,0BAA0B,CAAC;IAGzD,WAAW,EAAE,OAAO,CAAC;IAIrB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,MAAM,MAAM,0BAA0B,GAAG,eAAe,GAAG,eAAe,CAAC;AAE3E,MAAM,WAAW,eAAe;IAE9B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAE9B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,iBAAiB,QAAc,OAAO,CAAC,uBAAuB,CAG1E,CAAA"}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { PreferredDownloadDirectory } from './GetAppPreferences';
|
||||
export interface UpdateAppPreferencesRequest {
|
||||
preference: PreferenceName;
|
||||
value: undefined | string | boolean | PreferredDownloadDirectory;
|
||||
}
|
||||
export declare enum PreferenceName {
|
||||
PreferredDownloadDirectory = "preferred_download_directory",
|
||||
PlaySounds = "play_sounds",
|
||||
EnqueueSuccessSound = "enqueue_success_sound",
|
||||
EnqueueFailureSound = "enqueue_failure_sound",
|
||||
GenerationSuccessSound = "generation_success_sound",
|
||||
GenerationFailureSound = "generation_failure_sound",
|
||||
GenerationEnqueueSound = "generation_enqueue_sound"
|
||||
}
|
||||
export interface UpdateAppPreferencesResult {
|
||||
success: boolean;
|
||||
}
|
||||
export declare const UpdateAppPreferences: (request: UpdateAppPreferencesRequest) => Promise<UpdateAppPreferencesResult>;
|
||||
//# sourceMappingURL=UpdateAppPreference.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"UpdateAppPreference.d.ts","sourceRoot":"","sources":["../../../src/lib/settings/UpdateAppPreference.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,cAAc,CAAC;IAC3B,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,0BAA0B,CAAC;CAClE;AAED,oBAAY,cAAc;IACxB,0BAA0B,iCAAiC;IAC3D,UAAU,gBAAgB;IAC1B,mBAAmB,0BAA0B;IAC7C,mBAAmB,0BAA0B;IAC7C,sBAAsB,6BAA6B;IACnD,sBAAsB,6BAA6B;IACnD,sBAAsB,6BAA6B;CACpD;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,eAAO,MAAM,oBAAoB,GAAU,SAAS,2BAA2B,KAAI,OAAO,CAAC,0BAA0B,CAQpH,CAAA"}
|
||||
@@ -0,0 +1,11 @@
|
||||
export interface CheckSoraSessionResult {
|
||||
state: SoraSessionState;
|
||||
maybe_account_email?: string;
|
||||
}
|
||||
export declare enum SoraSessionState {
|
||||
NotSetUp = "not_set_up",
|
||||
ExpiredOrError = "expired_or_error",
|
||||
Valid = "valid"
|
||||
}
|
||||
export declare const CheckSoraSession: () => Promise<CheckSoraSessionResult>;
|
||||
//# sourceMappingURL=CheckSoraSession.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CheckSoraSession.d.ts","sourceRoot":"","sources":["../../../src/lib/sora/CheckSoraSession.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,gBAAgB,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,oBAAY,gBAAgB;IAC1B,QAAQ,eAAe;IACvB,cAAc,qBAAqB;IACnC,KAAK,UAAU;CAChB;AAED,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,sBAAsB,CAIvE,CAAC"}
|
||||
@@ -0,0 +1,2 @@
|
||||
export declare const LogoutSoraSession: () => Promise<void>;
|
||||
//# sourceMappingURL=LogoutSoraSession.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"LogoutSoraSession.d.ts","sourceRoot":"","sources":["../../../src/lib/sora/LogoutSoraSession.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,QAAa,OAAO,CAAC,IAAI,CAEtD,CAAC"}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
export interface SoraImageRemixRequest {
|
||||
snapshot_media_token: string;
|
||||
disable_system_prompt: boolean;
|
||||
prompt: string;
|
||||
maybe_additional_images: string[];
|
||||
maybe_number_of_samples: number;
|
||||
aspect_ratio?: SoraImageRemixAspectRatio;
|
||||
}
|
||||
export declare enum SoraImageRemixAspectRatio {
|
||||
Square = "square",
|
||||
Wide = "wide",
|
||||
Tall = "tall"
|
||||
}
|
||||
export interface SoraImageRemixSuccess extends CommandResult {
|
||||
}
|
||||
export declare enum SoraImageRemixErrorType {
|
||||
ServerError = "server_error",
|
||||
TooManyConcurrentTasks = "too_many_concurrent_tasks",
|
||||
SoraIsHavingProblems = "sora_is_having_problems",
|
||||
SoraLoginRequired = "sora_login_required",
|
||||
SoraUsernameNotYetCreated = "sora_username_not_yet_created"
|
||||
}
|
||||
export interface SoraImageRemixError extends CommandResult {
|
||||
error_type: SoraImageRemixErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
export type SoraImageRemixResult = SoraImageRemixSuccess | SoraImageRemixError;
|
||||
export declare const SoraImageRemix: (request: SoraImageRemixRequest) => Promise<SoraImageRemixResult>;
|
||||
//# sourceMappingURL=SoraImageRemix.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SoraImageRemix.d.ts","sourceRoot":"","sources":["../../../src/lib/sora/SoraImageRemix.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,WAAW,qBAAqB;IAEpC,oBAAoB,EAAE,MAAM,CAAC;IAG7B,qBAAqB,EAAE,OAAO,CAAC;IAG/B,MAAM,EAAE,MAAM,CAAC;IAGf,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAGlC,uBAAuB,EAAE,MAAM,CAAC;IAGhC,YAAY,CAAC,EAAE,yBAAyB,CAAC;CAC1C;AAED,oBAAY,yBAAyB;IACnC,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,MAAM,WAAW,qBAAsB,SAAQ,aAAa;CAE3D;AAED,oBAAY,uBAAuB;IACjC,WAAW,iBAAiB;IAC5B,sBAAsB,8BAA8B;IACpD,oBAAoB,4BAA4B;IAChD,iBAAiB,wBAAwB;IACzC,yBAAyB,kCAAkC;CAC5D;AAED,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,UAAU,EAAE,uBAAuB,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,GAAG,mBAAmB,CAAC;AAI/E,eAAO,MAAM,cAAc,GAAU,SAAS,qBAAqB,KAAI,OAAO,CAAC,oBAAoB,CAclG,CAAA"}
|
||||
@@ -0,0 +1,4 @@
|
||||
type SoraLoginSuccessPayload = {};
|
||||
export declare function useSoraLoginListener(onSuccess: (payload: SoraLoginSuccessPayload) => void): void;
|
||||
export {};
|
||||
//# sourceMappingURL=useSoraLoginListener.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"useSoraLoginListener.d.ts","sourceRoot":"","sources":["../../../src/lib/sora/useSoraLoginListener.ts"],"names":[],"mappings":"AAGA,KAAK,uBAAuB,GAAG,EAE9B,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,QAqBtD"}
|
||||
@@ -0,0 +1,2 @@
|
||||
export declare function waitForSoraLogin(): Promise<void>;
|
||||
//# sourceMappingURL=waitForSoraLogin.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"waitForSoraLogin.d.ts","sourceRoot":"","sources":["../../../src/lib/sora/waitForSoraLogin.ts"],"names":[],"mappings":"AAEA,wBAAgB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAUhD"}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { CommandResult } from '../common/CommandStatus';
|
||||
export interface GetAppInfoSuccess extends CommandResult {
|
||||
payload: GetAppInfoPayload;
|
||||
}
|
||||
export interface GetAppInfoPayload {
|
||||
artcraft_version: string;
|
||||
build_timestamp: string;
|
||||
git_commit_id?: string | null;
|
||||
git_commit_short_id?: string | null;
|
||||
git_commit_timestamp?: string | null;
|
||||
storyteller_host?: string | null;
|
||||
os_platform?: string | null;
|
||||
os_version?: string | null;
|
||||
}
|
||||
export declare const GetAppInfo: () => Promise<GetAppInfoSuccess>;
|
||||
//# sourceMappingURL=GetAppInfo.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"GetAppInfo.d.ts","sourceRoot":"","sources":["../../../src/lib/system/GetAppInfo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAID,eAAO,MAAM,UAAU,QAAc,OAAO,CAAC,iBAAiB,CAO7D,CAAA"}
|
||||
@@ -0,0 +1,2 @@
|
||||
export declare const LoadWithoutCors: (url: string) => Promise<ArrayBuffer>;
|
||||
//# sourceMappingURL=LoadWithoutCors.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"LoadWithoutCors.d.ts","sourceRoot":"","sources":["../../../src/lib/util/LoadWithoutCors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,GAAU,KAAK,MAAM,KAAI,OAAO,CAAC,WAAW,CAUvE,CAAA"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
//# sourceMappingURL=server.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":""}
|
||||
@@ -0,0 +1 @@
|
||||
//# sourceMappingURL=test-setup.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":"AACA,OAAO,oCAAoC,CAAC"}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "@storyteller/tauri-api",
|
||||
"version": "0.0.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": {
|
||||
"development": "./src/index.ts",
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.js",
|
||||
"default": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.4.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
export * from "./lib/artcraft/ArtcraftGetCredits.js";
|
||||
export * from "./lib/artcraft/ArtcraftGetSubscription.js";
|
||||
export * from "./lib/common/CommandStatus.js";
|
||||
export * from "./lib/enqueue/EnqueueContextualEditImage.js";
|
||||
export * from "./lib/enqueue/EnqueueImageBgRemovalCommand.js";
|
||||
export * from "./lib/enqueue/EnqueueImageInpaint.js";
|
||||
export * from "./lib/enqueue/EnqueueImageTo3dObject.js";
|
||||
export * from "./lib/enqueue/EnqueueImageToVideo.js";
|
||||
export * from "./lib/enqueue/EnqueueTextToImage.js";
|
||||
export * from "./lib/events/BasicEventWrapper.js";
|
||||
export * from "./lib/events/CanvasBgRemovedEvent.js";
|
||||
export * from "./lib/fal/FalBackgroundRemoval.js";
|
||||
export * from "./lib/fal/FalHunyuanImageTo3d.js";
|
||||
export * from "./lib/fal/FalKlingImageToVideo.js";
|
||||
export * from "./lib/fal/GetFalApiKey.js";
|
||||
export * from "./lib/fal/SetFalApiKey.js";
|
||||
export * from "./lib/midjourney/MidjourneyGetCredentialInfo.js";
|
||||
export * from "./lib/openai/GetOpenAIApiKey.js";
|
||||
export * from "./lib/openai/SetOpenAIApiKey.js";
|
||||
export * from "./lib/providers/GetProviderOrder.js";
|
||||
export * from "./lib/providers/Provider.js";
|
||||
export * from "./lib/providers/SetProviderOrder.js";
|
||||
export * from "./lib/settings/GetAppPreferences.js";
|
||||
export * from "./lib/settings/UpdateAppPreference.js";
|
||||
export * from "./lib/sora/CheckSoraSession.js";
|
||||
export * from "./lib/sora/LogoutSoraSession.js";
|
||||
export * from "./lib/sora/SoraImageRemix.js";
|
||||
export * from "./lib/sora/useSoraLoginListener.js";
|
||||
export * from "./lib/sora/waitForSoraLogin.js";
|
||||
export * from "./lib/system/GetAppInfo.js";
|
||||
export * from "./lib/util/LoadWithoutCors.js";
|
||||
@@ -0,0 +1,21 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
|
||||
export interface ArtcraftGetCreditsSuccess extends CommandResult {
|
||||
payload: ArtcraftGetCreditsPayload;
|
||||
}
|
||||
|
||||
export interface ArtcraftGetCreditsPayload {
|
||||
free_credits: number,
|
||||
monthly_credits: number,
|
||||
banked_credits: number,
|
||||
sum_total_credits: number,
|
||||
}
|
||||
|
||||
export const ArtcraftGetCredits = async () : Promise<ArtcraftGetCreditsSuccess> => {
|
||||
try {
|
||||
return await invoke("storyteller_get_credits_command") as ArtcraftGetCreditsSuccess;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
|
||||
export interface ArtcraftGetSubscriptionSuccess extends CommandResult {
|
||||
payload: ArtcraftGetSubscriptionPayload;
|
||||
}
|
||||
|
||||
export interface ArtcraftGetSubscriptionPayload {
|
||||
active_subscription?: ActiveSubscriptionInfo
|
||||
}
|
||||
|
||||
export interface ActiveSubscriptionInfo {
|
||||
subscription_token: string,
|
||||
product_slug: string,
|
||||
namespace: string,
|
||||
next_bill_at?: string,
|
||||
subscription_end_at?: string,
|
||||
}
|
||||
|
||||
export const ArtcraftGetSubscription = async () : Promise<ArtcraftGetSubscriptionSuccess> => {
|
||||
try {
|
||||
return await invoke("storyteller_get_subscription_command") as ArtcraftGetSubscriptionSuccess;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
export enum CommandSuccessStatus {
|
||||
Success = "success",
|
||||
}
|
||||
|
||||
export enum CommandErrorStatus {
|
||||
BadRequest = "bad_request",
|
||||
Unauthorized = "unauthorized",
|
||||
ServerError = "server_error",
|
||||
}
|
||||
|
||||
export type CommandStatus = CommandSuccessStatus | CommandErrorStatus;
|
||||
|
||||
export interface CommandResult {
|
||||
status: CommandStatus;
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
import { ImageModel } from "@storyteller/model-list";
|
||||
|
||||
export interface EnqueueContextualEditImageRequest {
|
||||
|
||||
/// The model to use.
|
||||
model?: ImageModel | EnqueueContextualEditImageModel;
|
||||
|
||||
/// If set, this is the first image in the contextual image set.
|
||||
/// This gets submitted along with `image_media_tokens` and will
|
||||
// be prompt engineered by Tauri.
|
||||
scene_image_media_token?: string;
|
||||
|
||||
/// Images to use for the image edit.
|
||||
/// The first image is typically a 2D canvas or 3D stage, but doesn't have to be.
|
||||
/// There must be at least one image.
|
||||
image_media_tokens?: string[];
|
||||
|
||||
/// The user's image generation prompt.
|
||||
prompt?: string;
|
||||
|
||||
/// Turn off the system prompt.
|
||||
disable_system_prompt?: boolean;
|
||||
|
||||
/// Number of images to generate.
|
||||
image_count?: number;
|
||||
|
||||
aspect_ratio?: EnqueueContextualEditImageSize;
|
||||
|
||||
image_quality?: EnqueueContextualEditImageQuality;
|
||||
}
|
||||
|
||||
|
||||
// Shape of request sent to Tauri
|
||||
// (We do some transformations from the public-facing request object.)
|
||||
interface RawEnqueueContextualEditImageRequest {
|
||||
model?: EnqueueContextualEditImageModel | string;
|
||||
scene_image_media_token?: string;
|
||||
image_media_tokens?: string[];
|
||||
prompt?: string;
|
||||
disable_system_prompt?: boolean;
|
||||
image_count?: number;
|
||||
aspect_ratio?: EnqueueContextualEditImageSize;
|
||||
image_quality?: EnqueueContextualEditImageQuality;
|
||||
}
|
||||
|
||||
export enum EnqueueContextualEditImageErrorType {
|
||||
ModelNotSpecified = "model_not_specified",
|
||||
NoProviderAvailable = "no_provider_available",
|
||||
BadRequest = "bad_request",
|
||||
ServerError = "server_error",
|
||||
TooManyConcurrentTasks = "too_many_concurrent_tasks",
|
||||
SoraLoginRequired = "sora_login_required",
|
||||
SoraUsernameNotYetCreated = "sora_username_not_yet_created",
|
||||
SoraIsHavingProblems = "sora_is_having_problems",
|
||||
}
|
||||
|
||||
export enum EnqueueContextualEditImageModel {
|
||||
GptImage1 = "gpt_image_1",
|
||||
FluxProKontextMax = "flux_pro_kontext_max",
|
||||
}
|
||||
|
||||
export enum EnqueueContextualEditImageSize {
|
||||
Auto = "auto",
|
||||
Square = "square",
|
||||
Wide = "wide",
|
||||
Tall = "tall",
|
||||
}
|
||||
|
||||
export enum EnqueueContextualEditImageQuality {
|
||||
Auto = "auto",
|
||||
High = "high",
|
||||
Medium = "medium",
|
||||
Low = "low",
|
||||
}
|
||||
|
||||
export interface EnqueueContextualEditImageError extends CommandResult {
|
||||
error_type: EnqueueContextualEditImageErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
|
||||
export interface EnqueueContextualEditImagePayload {
|
||||
}
|
||||
|
||||
export interface EnqueueContextualEditImageSuccess extends CommandResult {
|
||||
payload: EnqueueContextualEditImagePayload;
|
||||
}
|
||||
|
||||
export type EnqueueContextualEditImageResult = EnqueueContextualEditImageSuccess | EnqueueContextualEditImageError;
|
||||
|
||||
export const EnqueueContextualEditImage = async (request: EnqueueContextualEditImageRequest) : Promise<EnqueueContextualEditImageResult> => {
|
||||
let modelName = undefined;
|
||||
|
||||
if (!!request.model) {
|
||||
// NB: We can't use "instanceof" checks with Vite minification and class name mangling.
|
||||
if (typeof request.model === "string") {
|
||||
modelName = request.model;
|
||||
} else if (typeof request.model.tauriId === "string") {
|
||||
modelName = request.model.tauriId;
|
||||
}
|
||||
}
|
||||
|
||||
if (!modelName) {
|
||||
throw new Error("No model specified in request: " + JSON.stringify(request));
|
||||
}
|
||||
|
||||
let mutableRequest : RawEnqueueContextualEditImageRequest = {
|
||||
model: modelName,
|
||||
prompt: request.prompt,
|
||||
};
|
||||
|
||||
if (!!request.scene_image_media_token) {
|
||||
mutableRequest.scene_image_media_token = request.scene_image_media_token;
|
||||
}
|
||||
|
||||
if (!!request.image_media_tokens) {
|
||||
mutableRequest.image_media_tokens = request.image_media_tokens;
|
||||
}
|
||||
|
||||
if (!!request.aspect_ratio) {
|
||||
mutableRequest.aspect_ratio = request.aspect_ratio;
|
||||
}
|
||||
|
||||
if (!!request.image_count) {
|
||||
mutableRequest.image_count = request.image_count;
|
||||
}
|
||||
|
||||
if (!!request.image_quality) {
|
||||
mutableRequest.image_quality = request.image_quality;
|
||||
}
|
||||
|
||||
if (!!request.disable_system_prompt) {
|
||||
mutableRequest.disable_system_prompt = request.disable_system_prompt;
|
||||
}
|
||||
|
||||
const result = await invoke("enqueue_contextual_edit_image_command", {
|
||||
request: mutableRequest,
|
||||
});
|
||||
|
||||
return (result as EnqueueContextualEditImageResult);
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
|
||||
export interface EnqueueImageBgRemovalRequest {
|
||||
image_media_token?: string;
|
||||
base64_image?: string;
|
||||
|
||||
// TODO: Actual enum.
|
||||
frontend_caller?: string;
|
||||
|
||||
// We'll use the node id here.
|
||||
frontend_subscriber_id?: string;
|
||||
}
|
||||
|
||||
interface RawEnqueueImageBgRemovalRequest {
|
||||
image_media_token?: string;
|
||||
base64_image?: string;
|
||||
frontend_caller?: string;
|
||||
frontend_subscriber_id?: string;
|
||||
}
|
||||
|
||||
export enum EnqueueImageBgRemovalErrorType {
|
||||
/// Caller didn't specify a model
|
||||
ModelNotSpecified = "model_not_specified",
|
||||
/// Generic server error
|
||||
ServerError = "server_error",
|
||||
/// No Fal API key available
|
||||
NeedsFalApiKey = "needs_fal_api_key",
|
||||
/// Fal had an API error
|
||||
FalError = "fal_error",
|
||||
}
|
||||
|
||||
export interface EnqueueImageBgRemovalError extends CommandResult {
|
||||
error_type: EnqueueImageBgRemovalErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
|
||||
export interface EnqueueImageBgRemovalPayload {
|
||||
}
|
||||
|
||||
export interface EnqueueImageBgRemovalSuccess extends CommandResult {
|
||||
payload: EnqueueImageBgRemovalPayload;
|
||||
}
|
||||
|
||||
export type EnqueueImageBgRemovalResult = EnqueueImageBgRemovalSuccess | EnqueueImageBgRemovalError;
|
||||
|
||||
export const EnqueueImageBgRemoval = async (request: EnqueueImageBgRemovalRequest) : Promise<EnqueueImageBgRemovalResult> => {
|
||||
let mutableRequest : RawEnqueueImageBgRemovalRequest = {};
|
||||
|
||||
if (!!request.image_media_token) {
|
||||
mutableRequest.image_media_token = request.image_media_token;
|
||||
}
|
||||
|
||||
if (!!request.base64_image) {
|
||||
mutableRequest.base64_image = request.base64_image;
|
||||
}
|
||||
|
||||
if (!!request.frontend_caller) {
|
||||
mutableRequest.frontend_caller = request.frontend_caller;
|
||||
}
|
||||
|
||||
if (!!request.frontend_subscriber_id) {
|
||||
mutableRequest.frontend_subscriber_id = request.frontend_subscriber_id;
|
||||
}
|
||||
|
||||
const result = await invoke("enqueue_image_bg_removal_command", {
|
||||
request: mutableRequest,
|
||||
});
|
||||
|
||||
return (result as EnqueueImageBgRemovalResult);
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
import { ImageModel, ModelInfo } from "@storyteller/model-list";
|
||||
|
||||
export interface EnqueueImageInpaintRequest {
|
||||
// The model to use.
|
||||
model?: ImageModel | ModelInfo | EnqueueImageInpaintModel;
|
||||
|
||||
// The image we're editing.
|
||||
image_media_token?: string;
|
||||
|
||||
// The mask to focus the edit (raw bytes).
|
||||
mask_image_raw_bytes?: Uint8Array;
|
||||
|
||||
// The user's image generation prompt.
|
||||
prompt?: string;
|
||||
|
||||
// Number of images to generate.
|
||||
image_count?: number;
|
||||
|
||||
// TODO: Actual enum.
|
||||
frontend_caller?: string;
|
||||
|
||||
// Optional frontend state to return later.
|
||||
frontend_subscriber_id?: string;
|
||||
}
|
||||
|
||||
|
||||
// Shape of request sent to Tauri
|
||||
// (We do some transformations from the public-facing request object.)
|
||||
interface RawEnqueueImageInpaintRequest {
|
||||
model?: EnqueueImageInpaintModel | string;
|
||||
image_media_token?: string;
|
||||
mask_image_raw_bytes?: Uint8Array;
|
||||
prompt?: string;
|
||||
image_count?: number;
|
||||
frontend_caller?: string;
|
||||
frontend_subscriber_id?: string;
|
||||
}
|
||||
|
||||
export enum EnqueueImageInpaintErrorType {
|
||||
ModelNotSpecified = "model_not_specified",
|
||||
NoProviderAvailable = "no_provider_available",
|
||||
BadRequest = "bad_request",
|
||||
ServerError = "server_error",
|
||||
TooManyConcurrentTasks = "too_many_concurrent_tasks",
|
||||
SoraLoginRequired = "sora_login_required",
|
||||
SoraUsernameNotYetCreated = "sora_username_not_yet_created",
|
||||
SoraIsHavingProblems = "sora_is_having_problems",
|
||||
}
|
||||
|
||||
export enum EnqueueImageInpaintModel {
|
||||
FluxPro1 = "flux_pro_1",
|
||||
FluxDevJuggernaut = "flux_dev_juggernaut",
|
||||
}
|
||||
|
||||
export interface EnqueueImageInpaintError extends CommandResult {
|
||||
error_type: EnqueueImageInpaintErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
|
||||
export interface EnqueueImageInpaintPayload {
|
||||
}
|
||||
|
||||
export interface EnqueueImageInpaintSuccess extends CommandResult {
|
||||
payload: EnqueueImageInpaintPayload;
|
||||
}
|
||||
|
||||
export type EnqueueImageInpaintResult = EnqueueImageInpaintSuccess | EnqueueImageInpaintError;
|
||||
|
||||
export const EnqueueImageInpaint = async (request: EnqueueImageInpaintRequest) : Promise<EnqueueImageInpaintResult> => {
|
||||
let modelName = undefined;
|
||||
|
||||
if (!!request.model) {
|
||||
if (typeof request.model === "string") {
|
||||
modelName = request.model;
|
||||
} else if ("tauriId" in request.model && typeof request.model.tauriId === "string") {
|
||||
modelName = request.model.tauriId;
|
||||
} else if ("tauri_id" in request.model && typeof request.model.tauri_id === "string") {
|
||||
modelName = request.model.tauri_id;
|
||||
}
|
||||
}
|
||||
|
||||
if (!modelName) {
|
||||
throw new Error("No model specified in request: " + JSON.stringify(request));
|
||||
}
|
||||
|
||||
let mutableRequest : RawEnqueueImageInpaintRequest = {
|
||||
model: modelName,
|
||||
prompt: request.prompt,
|
||||
};
|
||||
|
||||
if (!!request.image_media_token) {
|
||||
mutableRequest.image_media_token = request.image_media_token;
|
||||
}
|
||||
|
||||
if (!!request.mask_image_raw_bytes) {
|
||||
mutableRequest.mask_image_raw_bytes = request.mask_image_raw_bytes;
|
||||
}
|
||||
|
||||
if (!!request.image_count) {
|
||||
mutableRequest.image_count = request.image_count;
|
||||
}
|
||||
|
||||
if (!!request.frontend_caller) {
|
||||
mutableRequest.frontend_caller = request.frontend_caller;
|
||||
}
|
||||
|
||||
if (!!request.frontend_subscriber_id) {
|
||||
mutableRequest.frontend_subscriber_id = request.frontend_subscriber_id;
|
||||
}
|
||||
|
||||
const result = await invoke("enqueue_image_inpaint_command", {
|
||||
request: mutableRequest,
|
||||
});
|
||||
|
||||
return (result as EnqueueImageInpaintResult);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
|
||||
export enum EnqueueImageTo3dObjectErrorType {
|
||||
/// Caller didn't specify a model
|
||||
ModelNotSpecified = "model_not_specified",
|
||||
/// Generic server error
|
||||
ServerError = "server_error",
|
||||
/// No Fal API key available
|
||||
NeedsFalApiKey = "needs_fal_api_key",
|
||||
/// Fal had an API error
|
||||
FalError = "fal_error",
|
||||
/// Need tobe logged into Artcraft
|
||||
NeedsStorytellerCredentials = "needs_storyteller_credentials",
|
||||
}
|
||||
|
||||
export interface EnqueueImageTo3dObjectRequest {
|
||||
image_media_token?: string;
|
||||
model?: EnqueueImageTo3dObjectModel;
|
||||
}
|
||||
|
||||
export enum EnqueueImageTo3dObjectModel {
|
||||
Hunyuan3d2 = "hunyuan_3d_2",
|
||||
Hunyuan3d2_0 = "hunyuan_3d_2_0",
|
||||
Hunyuan3d2_1 = "hunyuan_3d_2_1",
|
||||
}
|
||||
|
||||
export interface EnqueueImageTo3dObjectError extends CommandResult {
|
||||
error_type: EnqueueImageTo3dObjectErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
|
||||
export interface EnqueueImageTo3dObjectPayload {
|
||||
}
|
||||
|
||||
export interface EnqueueImageTo3dObjectSuccess extends CommandResult {
|
||||
payload: EnqueueImageTo3dObjectPayload;
|
||||
}
|
||||
|
||||
export type EnqueueImageTo3dObjectResult = EnqueueImageTo3dObjectSuccess | EnqueueImageTo3dObjectError;
|
||||
|
||||
export const EnqueueImageTo3dObject = async (request: EnqueueImageTo3dObjectRequest) : Promise<EnqueueImageTo3dObjectResult> => {
|
||||
let result = await invoke("enqueue_image_to_3d_object_command", {
|
||||
request: {
|
||||
image_media_token: request.image_media_token,
|
||||
model: request.model,
|
||||
}
|
||||
});
|
||||
return (result as EnqueueImageTo3dObjectResult);
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
import { Model } from "@storyteller/model-list";
|
||||
|
||||
export enum EnqueueImageToVideoErrorType {
|
||||
/// Caller didn't specify a model
|
||||
ModelNotSpecified = "model_not_specified",
|
||||
/// Generic server error
|
||||
ServerError = "server_error",
|
||||
/// No Fal API key available
|
||||
NeedsFalApiKey = "needs_fal_api_key",
|
||||
/// Fal had an API error
|
||||
FalError = "fal_error",
|
||||
}
|
||||
|
||||
export interface EnqueueImageToVideoRequest {
|
||||
// Required. The model to use.
|
||||
model?: Model;
|
||||
|
||||
// Required. Starting frame.
|
||||
image_media_token?: string;
|
||||
|
||||
// Optional. Ending frame.
|
||||
end_frame_image_media_token?: string;
|
||||
|
||||
// Optional. Text prompt to direct the video.
|
||||
prompt?: string;
|
||||
|
||||
// Optional frontend state to return later.
|
||||
frontend_caller?: string;
|
||||
|
||||
// Optional frontend state to return later.
|
||||
frontend_subscriber_id?: string;
|
||||
}
|
||||
|
||||
interface RawEnqueueImageToVideoRequest {
|
||||
model?: string;
|
||||
image_media_token?: string;
|
||||
end_frame_image_media_token?: string;
|
||||
prompt?: string;
|
||||
frontend_caller?: string;
|
||||
frontend_subscriber_id?: string;
|
||||
}
|
||||
|
||||
export interface EnqueueImageToVideoError extends CommandResult {
|
||||
error_type: EnqueueImageToVideoErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
|
||||
export interface EnqueueImageToVideoPayload {}
|
||||
|
||||
export interface EnqueueImageToVideoSuccess extends CommandResult {
|
||||
payload: EnqueueImageToVideoPayload;
|
||||
}
|
||||
|
||||
export type EnqueueImageToVideoResult =
|
||||
| EnqueueImageToVideoSuccess
|
||||
| EnqueueImageToVideoError;
|
||||
|
||||
export const EnqueueImageToVideo = async (
|
||||
request: EnqueueImageToVideoRequest
|
||||
): Promise<EnqueueImageToVideoResult> => {
|
||||
let mutableRequest: RawEnqueueImageToVideoRequest = {
|
||||
model: request.model?.tauriId,
|
||||
image_media_token: request.image_media_token,
|
||||
};
|
||||
|
||||
if (!!request.prompt) {
|
||||
mutableRequest.prompt = request.prompt;
|
||||
}
|
||||
|
||||
if (!!request.end_frame_image_media_token) {
|
||||
mutableRequest.end_frame_image_media_token =
|
||||
request.end_frame_image_media_token;
|
||||
}
|
||||
|
||||
if (!!request.frontend_caller) {
|
||||
mutableRequest.frontend_caller = request.frontend_caller;
|
||||
}
|
||||
|
||||
if (!!request.frontend_subscriber_id) {
|
||||
mutableRequest.frontend_subscriber_id = request.frontend_subscriber_id;
|
||||
}
|
||||
|
||||
const result = await invoke("enqueue_image_to_video_command", {
|
||||
request: mutableRequest,
|
||||
});
|
||||
|
||||
return result as EnqueueImageToVideoResult;
|
||||
};
|
||||
@@ -0,0 +1,131 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
import { Model } from "@storyteller/model-list";
|
||||
|
||||
export enum EnqueueTextToImageErrorType {
|
||||
/// Caller didn't specify a model
|
||||
ModelNotSpecified = "model_not_specified",
|
||||
/// Generic server error
|
||||
ServerError = "server_error",
|
||||
/// No Fal API key available
|
||||
NeedsFalApiKey = "needs_fal_api_key",
|
||||
/// Fal had an API error
|
||||
FalError = "fal_error",
|
||||
}
|
||||
|
||||
export interface EnqueueTextToImageRequest {
|
||||
// The model to use.
|
||||
model?: Model | EnqueueTextToImageModel;
|
||||
|
||||
// The text prompt.
|
||||
prompt?: string;
|
||||
|
||||
// The desired output aspect ratio.
|
||||
aspect_ratio?: EnqueueTextToImageSize;
|
||||
|
||||
// The number of images to generate.
|
||||
number_images?: number;
|
||||
|
||||
// Optional image-to-image prompts
|
||||
// These are not semantic buckets, but rather just "reference images",
|
||||
// and models do not have any further instruction about them. (ie. they
|
||||
// are not "style", "character", etc. references)
|
||||
image_media_tokens?: string[];
|
||||
|
||||
// Optional frontend state to return later.
|
||||
// TODO: Actual enum.
|
||||
frontend_caller?: string;
|
||||
|
||||
// Optional frontend state to return later.
|
||||
frontend_subscriber_id?: string;
|
||||
}
|
||||
|
||||
// Shape of request sent to Tauri
|
||||
// (We do some transformations from the public-facing request object.)
|
||||
interface EnqueueTextToImageRawRequest {
|
||||
prompt?: string;
|
||||
model?: EnqueueTextToImageModel | string; // TODO: Shouldn't allow string
|
||||
aspect_ratio?: EnqueueTextToImageSize;
|
||||
number_images?: number;
|
||||
image_media_tokens?: string[];
|
||||
frontend_caller?: string;
|
||||
frontend_subscriber_id?: string;
|
||||
}
|
||||
|
||||
export enum EnqueueTextToImageModel {
|
||||
FluxProUltra = "flux_pro_ultra",
|
||||
GptImage1 = "gpt_image_1",
|
||||
Recraft3 = "recraft_3",
|
||||
}
|
||||
|
||||
export enum EnqueueTextToImageSize {
|
||||
Auto = "auto",
|
||||
Square = "square",
|
||||
Wide = "wide",
|
||||
Tall = "tall",
|
||||
}
|
||||
|
||||
export interface EnqueueTextToImageError extends CommandResult {
|
||||
error_type: EnqueueTextToImageErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
|
||||
export interface EnqueueTextToImagePayload {
|
||||
media_token: string;
|
||||
cdn_url: string;
|
||||
base64_bytes: string;
|
||||
}
|
||||
|
||||
export interface EnqueueTextToImageSuccess extends CommandResult {
|
||||
payload: EnqueueTextToImagePayload;
|
||||
}
|
||||
|
||||
export type EnqueueTextToImageResult = EnqueueTextToImageSuccess | EnqueueTextToImageError;
|
||||
|
||||
export const EnqueueTextToImage = async (request: EnqueueTextToImageRequest) : Promise<EnqueueTextToImageResult> => {
|
||||
let modelName = undefined;
|
||||
|
||||
if (!!request.model) {
|
||||
// NB: We can't use "instanceof" checks with Vite minification and class name mangling.
|
||||
if (typeof request.model === "string") {
|
||||
modelName = request.model;
|
||||
} else if (typeof request.model.tauriId === "string") {
|
||||
modelName = request.model.tauriId;
|
||||
}
|
||||
}
|
||||
|
||||
if (!modelName) {
|
||||
throw new Error("No model specified in request: " + JSON.stringify(request));
|
||||
}
|
||||
|
||||
let mutableRequest : EnqueueTextToImageRawRequest = {
|
||||
model: modelName,
|
||||
prompt: request.prompt,
|
||||
};
|
||||
|
||||
if (!!request.aspect_ratio) {
|
||||
mutableRequest.aspect_ratio = request.aspect_ratio;
|
||||
}
|
||||
|
||||
if (!!request.number_images) {
|
||||
mutableRequest.number_images = request.number_images;
|
||||
}
|
||||
|
||||
if (!!request.image_media_tokens && request.image_media_tokens.length > 0) {
|
||||
mutableRequest.image_media_tokens = request.image_media_tokens;
|
||||
}
|
||||
|
||||
if (!!request.frontend_caller) {
|
||||
mutableRequest.frontend_caller = request.frontend_caller;
|
||||
}
|
||||
|
||||
if (!!request.frontend_subscriber_id) {
|
||||
mutableRequest.frontend_subscriber_id = request.frontend_subscriber_id;
|
||||
}
|
||||
|
||||
const result = await invoke("enqueue_text_to_image_command", {
|
||||
request: mutableRequest,
|
||||
});
|
||||
|
||||
return (result as EnqueueTextToImageResult);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
export enum BasicEventStatus {
|
||||
Success = "success",
|
||||
Failure = "failure",
|
||||
};
|
||||
|
||||
export interface BasicEventWrapper<T> {
|
||||
status: BasicEventStatus,
|
||||
data: T,
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
import { listen, UnlistenFn } from '@tauri-apps/api/event';
|
||||
import { BasicEventWrapper } from './BasicEventWrapper';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
const EVENT_NAME : string = 'canvas_bg_removed_event';
|
||||
|
||||
export interface CanvasBgRemovedEvent {
|
||||
media_token: string,
|
||||
image_cdn_url: string,
|
||||
maybe_frontend_subscriber_id?: string,
|
||||
maybe_frontend_subscriber_payload?: string,
|
||||
}
|
||||
|
||||
export const useCanvasBgRemovedEvent = (asyncCallback: (event: CanvasBgRemovedEvent) => Promise<void>) => {
|
||||
useEffect(() => {
|
||||
let isUnmounted = false;
|
||||
let unlisten: Promise<UnlistenFn>;
|
||||
|
||||
const setup = async () => {
|
||||
unlisten = listen<BasicEventWrapper<CanvasBgRemovedEvent>>(EVENT_NAME, async (wrappedEvent) => {
|
||||
await asyncCallback(wrappedEvent.payload.data);
|
||||
});
|
||||
|
||||
if (isUnmounted) {
|
||||
unlisten.then(f => f()); // Unsubscribe if unmounted early.
|
||||
}
|
||||
};
|
||||
|
||||
setup();
|
||||
|
||||
return () => {
|
||||
isUnmounted = true;
|
||||
unlisten.then(f => f());
|
||||
};
|
||||
|
||||
}, []);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
|
||||
export enum FalBackgroundRemovalErrorType {
|
||||
ServerError = "server_error",
|
||||
NeedsFalApiKey = "needs_fal_api_key",
|
||||
}
|
||||
|
||||
export interface FalBackgroundRemovalRequest {
|
||||
image_media_token?: string;
|
||||
base64_image?: string;
|
||||
}
|
||||
|
||||
export interface FalBackgroundRemovalError extends CommandResult {
|
||||
error_type: FalBackgroundRemovalErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
|
||||
export interface FalBackgroundRemovalPayload {
|
||||
media_token: string;
|
||||
cdn_url: string;
|
||||
base64_bytes: string;
|
||||
}
|
||||
|
||||
export interface FalBackgroundRemovalSuccess extends CommandResult {
|
||||
payload: FalBackgroundRemovalPayload;
|
||||
}
|
||||
|
||||
export type FalBackgroundRemovalResult = FalBackgroundRemovalSuccess | FalBackgroundRemovalError;
|
||||
|
||||
export const FalBackgroundRemoval = async (request: FalBackgroundRemovalRequest) : Promise<FalBackgroundRemovalResult> => {
|
||||
let result = await invoke("fal_background_removal_command", {
|
||||
request: {
|
||||
image_media_token: request.image_media_token,
|
||||
base64_image: request.base64_image,
|
||||
}
|
||||
});
|
||||
return (result as FalBackgroundRemovalResult);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
|
||||
export enum FalHunyuanImageTo3dErrorType {
|
||||
ServerError = "server_error",
|
||||
NeedsFalApiKey = "needs_fal_api_key",
|
||||
}
|
||||
|
||||
export interface FalHunyuanImageTo3dRequest {
|
||||
image_media_token?: string;
|
||||
base64_image?: string;
|
||||
}
|
||||
|
||||
export interface FalHunyuanImageTo3dError extends CommandResult {
|
||||
error_type: FalHunyuanImageTo3dErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
|
||||
export interface FalHunyuanImageTo3dPayload {
|
||||
media_token: string;
|
||||
cdn_url: string;
|
||||
base64_bytes: string;
|
||||
}
|
||||
|
||||
export interface FalHunyuanImageTo3dSuccess extends CommandResult {
|
||||
payload: FalHunyuanImageTo3dPayload;
|
||||
}
|
||||
|
||||
export type FalHunyuanImageTo3dResult = FalHunyuanImageTo3dSuccess | FalHunyuanImageTo3dError;
|
||||
|
||||
export const FalHunyuanImageTo3d = async (request: FalHunyuanImageTo3dRequest) : Promise<FalHunyuanImageTo3dResult> => {
|
||||
let result = await invoke("fal_hunyuan_image_to_3d_command", {
|
||||
request: {
|
||||
image_media_token: request.image_media_token,
|
||||
base64_image: request.base64_image,
|
||||
}
|
||||
});
|
||||
return (result as FalHunyuanImageTo3dResult);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
|
||||
export enum FalKlingImageToVideoErrorType {
|
||||
ServerError = "server_error",
|
||||
NeedsFalApiKey = "needs_fal_api_key",
|
||||
}
|
||||
|
||||
export interface FalKlingImageToVideoRequest {
|
||||
image_media_token?: string;
|
||||
base64_image?: string;
|
||||
}
|
||||
|
||||
export interface FalKlingImageToVideoError extends CommandResult {
|
||||
error_type: FalKlingImageToVideoErrorType;
|
||||
error_message?: string;
|
||||
}
|
||||
|
||||
export interface FalKlingImageToVideoPayload {
|
||||
media_token: string;
|
||||
cdn_url: string;
|
||||
base64_bytes: string;
|
||||
}
|
||||
|
||||
export interface FalKlingImageToVideoSuccess extends CommandResult {
|
||||
payload: FalKlingImageToVideoPayload;
|
||||
}
|
||||
|
||||
export type FalKlingImageToVideoResult = FalKlingImageToVideoSuccess | FalKlingImageToVideoError;
|
||||
|
||||
export const FalKlingImageToVideo = async (request: FalKlingImageToVideoRequest) : Promise<FalKlingImageToVideoResult> => {
|
||||
let result = await invoke("fal_kling_image_to_video_command", {
|
||||
request: {
|
||||
image_media_token: request.image_media_token,
|
||||
base64_image: request.base64_image,
|
||||
}
|
||||
});
|
||||
return (result as FalKlingImageToVideoResult);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
|
||||
export interface GetFalApiKeySuccessResult extends CommandResult {
|
||||
payload: {
|
||||
key: string;
|
||||
};
|
||||
}
|
||||
|
||||
export type GetFalApiKeyResult = GetFalApiKeySuccessResult | CommandResult;
|
||||
|
||||
export const GetFalApiKey = async (): Promise<GetFalApiKeyResult> => {
|
||||
let result = await invoke("get_fal_api_key_command");
|
||||
return result as GetFalApiKeyResult;
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
|
||||
export const SetFalApiKey = async (key: string) : Promise<CommandResult> => {
|
||||
let result = await invoke("set_fal_api_key_command", {
|
||||
request: {
|
||||
key: key,
|
||||
}
|
||||
});
|
||||
return (result as CommandResult);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
|
||||
export interface MidjourneyGetCredentialInfoPayload {
|
||||
maybe_email?: string;
|
||||
can_clear_state: boolean;
|
||||
}
|
||||
|
||||
export interface MidjourneyGetCredentialInfoSuccess extends CommandResult {
|
||||
payload: MidjourneyGetCredentialInfoPayload;
|
||||
}
|
||||
|
||||
export const MidjourneyGetCredentialInfo = async (): Promise<MidjourneyGetCredentialInfoSuccess> => {
|
||||
const result = await invoke("midjourney_get_credential_info_command");
|
||||
return result as MidjourneyGetCredentialInfoSuccess;
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
|
||||
export interface GetOpenAIApiKeySuccessResult extends CommandResult {
|
||||
payload: {
|
||||
key: string;
|
||||
};
|
||||
}
|
||||
|
||||
export type GetOpenAIApiKeyResult = GetOpenAIApiKeySuccessResult | CommandResult;
|
||||
|
||||
export const GetOpenAIApiKey = async (): Promise<GetOpenAIApiKeyResult> => {
|
||||
const result = await invoke("get_openai_api_key_command");
|
||||
return result as GetOpenAIApiKeyResult;
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
|
||||
export const SetOpenAIApiKey = async (key: string): Promise<CommandResult> => {
|
||||
const result = await invoke("set_openai_api_key_command", {
|
||||
request: {
|
||||
key: key,
|
||||
}
|
||||
});
|
||||
return result as CommandResult;
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
import { Provider } from "./Provider";
|
||||
|
||||
export interface GetProviderOrderSuccess extends CommandResult {
|
||||
payload: GetProviderOrderPayload;
|
||||
}
|
||||
|
||||
export interface GetProviderOrderPayload {
|
||||
providers: Provider[];
|
||||
}
|
||||
|
||||
// Returns the Success and Error variants directly.
|
||||
// Throws on Network/Tauri errors.
|
||||
export const GetProviderOrder = async () : Promise<GetProviderOrderSuccess> => {
|
||||
try {
|
||||
return await invoke("get_provider_order_command") as GetProviderOrderSuccess;
|
||||
} catch (error) {
|
||||
// NB: Endpoint should be infalliable
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
export enum Provider {
|
||||
ArtCraft = "artcraft",
|
||||
Fal = "fal",
|
||||
Sora = "sora",
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { CommandResult } from "../common/CommandStatus";
|
||||
import { Provider } from "./Provider";
|
||||
|
||||
export interface SetProviderOrderRequest {
|
||||
providers: Provider[];
|
||||
}
|
||||
|
||||
export const SetProviderOrder = async (request: SetProviderOrderRequest) : Promise<CommandResult> => {
|
||||
const result = await invoke("set_provider_order_command", {
|
||||
request: {
|
||||
providers: request.providers,
|
||||
}
|
||||
});
|
||||
|
||||
return (result as CommandResult);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
|
||||
export interface GetAppPreferencesResult {
|
||||
preferences: AppPreferencesPayload,
|
||||
}
|
||||
|
||||
export interface AppPreferencesPayload {
|
||||
// Preferred download directory
|
||||
preferred_download_directory: PreferredDownloadDirectory,
|
||||
|
||||
// Play sounds on events.
|
||||
play_sounds: boolean,
|
||||
|
||||
// Sound names to play.
|
||||
// These are keys, not filenames, and are defined by the frontend.
|
||||
enqueue_success_sound?: string,
|
||||
enqueue_failure_sound?: string,
|
||||
generation_success_sound?: string,
|
||||
generation_failure_sound?: string,
|
||||
generation_enqueue_sound?: string,
|
||||
}
|
||||
|
||||
export type PreferredDownloadDirectory = SystemDirectory | CustomDirectory;
|
||||
|
||||
export interface SystemDirectory {
|
||||
// If the directory is a system directory.
|
||||
system: string,
|
||||
}
|
||||
|
||||
export interface CustomDirectory {
|
||||
// If the directory is a custom user directory.
|
||||
custom: string,
|
||||
}
|
||||
|
||||
export const GetAppPreferences = async () : Promise<GetAppPreferencesResult> => {
|
||||
let result = await invoke("get_app_preferences_command");
|
||||
return (result as GetAppPreferencesResult);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { PreferredDownloadDirectory } from "./GetAppPreferences";
|
||||
|
||||
export interface UpdateAppPreferencesRequest {
|
||||
preference: PreferenceName,
|
||||
value: undefined | string | boolean | PreferredDownloadDirectory,
|
||||
}
|
||||
|
||||
export enum PreferenceName {
|
||||
PreferredDownloadDirectory = "preferred_download_directory",
|
||||
PlaySounds = "play_sounds",
|
||||
EnqueueSuccessSound = "enqueue_success_sound",
|
||||
EnqueueFailureSound = "enqueue_failure_sound",
|
||||
GenerationSuccessSound = "generation_success_sound",
|
||||
GenerationFailureSound = "generation_failure_sound",
|
||||
GenerationEnqueueSound = "generation_enqueue_sound",
|
||||
}
|
||||
|
||||
export interface UpdateAppPreferencesResult {
|
||||
success: boolean
|
||||
}
|
||||
|
||||
export const UpdateAppPreferences = async (request: UpdateAppPreferencesRequest) : Promise<UpdateAppPreferencesResult> => {
|
||||
let result = await invoke("update_app_preferences_command", {
|
||||
request: {
|
||||
preference: request.preference,
|
||||
value: request.value,
|
||||
}
|
||||
});
|
||||
return (result as UpdateAppPreferencesResult);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
|
||||
export interface CheckSoraSessionResult {
|
||||
state: SoraSessionState;
|
||||
maybe_account_email?: string;
|
||||
}
|
||||
|
||||
export enum SoraSessionState {
|
||||
NotSetUp = "not_set_up",
|
||||
ExpiredOrError = "expired_or_error",
|
||||
Valid = "valid",
|
||||
}
|
||||
|
||||
export const CheckSoraSession = async (): Promise<CheckSoraSessionResult> => {
|
||||
const result = await invoke("check_sora_session_command");
|
||||
console.log(">>> sora result", result);
|
||||
return result as CheckSoraSessionResult;
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
|
||||
export const LogoutSoraSession = async (): Promise<void> => {
|
||||
return await invoke("sora_logout_command");
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user