mirror of
https://github.com/storytold/artcraft.git
synced 2026-10-21 09:22:41 -04:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14e954f6a3 | ||
|
|
ee2b5fb8b0 |
@@ -27,8 +27,10 @@ import { PromptBox } from "./comps/PromptBox";
|
||||
import { OnboardingHelper } from "./comps/OnboardingHelper";
|
||||
import { FocalLengthDisplay } from "./comps/FocalLengthDisplay/FocalLengthDisplay";
|
||||
|
||||
// import { Login } from "@frontend/login";
|
||||
import { api } from "@storyteller/api";
|
||||
import { Login } from "@frontend/login";
|
||||
// import { api } from "@storyteller/api";
|
||||
// import { AnalyticsApi } from "@storyteller/api";
|
||||
|
||||
|
||||
export const PageEditor = () => {
|
||||
useSignals();
|
||||
|
||||
@@ -1 +1,17 @@
|
||||
export * from './lib/api.js';
|
||||
export * from "./lib/AnalyticsApi.js";
|
||||
export * from "./lib/BillingApi.js";
|
||||
export * from "./lib/CommentsApi.js";
|
||||
export * from "./lib/EngineApi.js";
|
||||
export * from "./lib/FeaturedItemsApi.js";
|
||||
export * from "./lib/JobsApi.js";
|
||||
export * from "./lib/MediaFilesApi.js";
|
||||
export * from "./lib/MediaUploadApi.js";
|
||||
export * from "./lib/MiscApi.js";
|
||||
export * from "./lib/ModerationApi.js";
|
||||
export * from "./lib/PromptsApi.js";
|
||||
export * from "./lib/TtsApi.js";
|
||||
export * from "./lib/UserBookmarksApi.js";
|
||||
export * from "./lib/UsersApi.js";
|
||||
export * from "./lib/VideoApi.js";
|
||||
export * from "./lib/WeightsApi.js";
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { ApiManager, ApiResponse } from "./ApiManager";
|
||||
import { ApiManager, ApiResponse } from "./ApiManager.js";
|
||||
|
||||
export class AnalyticsApi extends ApiManager {
|
||||
public PostAnalytics({
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// import { bool } from "@techstark/opencv-js";
|
||||
import { API_TARGETS } from "../enums/Api";
|
||||
import { API_TARGETS } from "./enums/Api.js";
|
||||
|
||||
type NonNullableObject<T extends object> = NonNullable<T>;
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
import { ApiManager, ApiResponse } from "../apis/ApiManager";
|
||||
import { Subscription } from "../models/Billing";
|
||||
import { LoyaltyProgram } from "../enums/Billing";
|
||||
import { ApiManager, ApiResponse } from "./ApiManager.js";
|
||||
import { Subscription } from "./models/Billing.js";
|
||||
import { LoyaltyProgram } from "./enums/Billing.js";
|
||||
|
||||
export class BillingApi extends ApiManager {
|
||||
public async ListActiveSubscriptions(): Promise<
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
// libs/api-client/src/JobsApi.ts
|
||||
import { ApiManager, ApiResponse } from "../apis/ApiManager";
|
||||
import { Job, JobPreview } from "../models/Job";
|
||||
import { JobState } from "../models/JobState";
|
||||
import { ApiManager, ApiResponse } from "../../../api/src/lib/ApiManager.js";
|
||||
import { Job, JobPreview } from "./models/Job.js";
|
||||
import { JobState } from "./models/JobState.js";
|
||||
|
||||
export class JobsApi extends ApiManager {
|
||||
public GetPreviewStatusByJobToken({
|
||||
@@ -0,0 +1,364 @@
|
||||
import { MediaFile } from "./models/MediaFile.js";
|
||||
import { Pagination, PaginationInfinite } from "./models/Pagination.js";
|
||||
import { ApiManager, ApiResponse } from "./ApiManager.js";
|
||||
import { Visibility } from "./enums/Visibility.js";
|
||||
|
||||
import {
|
||||
FilterEngineCategories,
|
||||
FilterMediaClasses,
|
||||
FilterMediaType,
|
||||
} from "./enums/QueryFilters.js";
|
||||
|
||||
interface ListMediaQuery {
|
||||
sort_ascending?: boolean;
|
||||
page_size?: number;
|
||||
cursor?: string;
|
||||
cursor_is_reversed?: boolean;
|
||||
filter_media_classes?: FilterMediaClasses[];
|
||||
filter_media_type?: FilterMediaType[];
|
||||
filter_engine_categories?: FilterEngineCategories[];
|
||||
}
|
||||
|
||||
interface ListUserMediaQuery {
|
||||
username: string;
|
||||
sort_ascending?: boolean;
|
||||
page_size?: number;
|
||||
page_index?: number;
|
||||
filter_media_classes?: FilterMediaClasses[];
|
||||
filter_media_type?: FilterMediaType[];
|
||||
filter_engine_categories?: FilterEngineCategories[];
|
||||
}
|
||||
|
||||
interface SearchFeaturedMediaQuery {
|
||||
search_term: string;
|
||||
filter_media_classes?: FilterMediaClasses[];
|
||||
filter_media_type?: FilterMediaType[];
|
||||
filter_engine_categories?: FilterEngineCategories[];
|
||||
}
|
||||
|
||||
export class MediaFilesApi extends ApiManager {
|
||||
public async DeleteMediaFileByToken({
|
||||
mediaFileToken,
|
||||
asMod = true,
|
||||
setDelete = true,
|
||||
}: {
|
||||
mediaFileToken: string;
|
||||
asMod?: boolean;
|
||||
setDelete?: boolean;
|
||||
}): Promise<ApiResponse<MediaFile>> {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/media_files/file/${mediaFileToken}`;
|
||||
|
||||
const body = { as_mod: asMod, set_delete: setDelete };
|
||||
return await this.delete<
|
||||
{
|
||||
as_mod: boolean;
|
||||
set_delete: boolean;
|
||||
},
|
||||
{
|
||||
success?: boolean;
|
||||
BadInput?: string;
|
||||
}
|
||||
>({ endpoint, body })
|
||||
.then((response) => ({
|
||||
success: response.success ?? false,
|
||||
errorMessage: response.BadInput,
|
||||
}))
|
||||
.catch((err) => {
|
||||
return {
|
||||
success: false,
|
||||
errorMessage: err.message,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public async ListMediaFilesByTokens({
|
||||
mediaTokens,
|
||||
}: {
|
||||
mediaTokens: string[];
|
||||
}): Promise<ApiResponse<MediaFile[]>> {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/media_files/batch`;
|
||||
|
||||
return await this.get<{
|
||||
success: boolean;
|
||||
media_files: MediaFile[];
|
||||
error_reason?: string;
|
||||
}>({ endpoint, query: { tokens: mediaTokens.join(",") } })
|
||||
.then((response) => ({
|
||||
success: response.success,
|
||||
data: response.media_files,
|
||||
}))
|
||||
.catch((err) => {
|
||||
return { success: false, errorMessage: err.message };
|
||||
});
|
||||
}
|
||||
|
||||
public async GetMediaFileByToken({
|
||||
mediaFileToken,
|
||||
}: {
|
||||
mediaFileToken: string;
|
||||
}): Promise<ApiResponse<MediaFile>> {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/media_files/file/${mediaFileToken}`;
|
||||
return await this.get<{
|
||||
success: boolean;
|
||||
media_file: MediaFile;
|
||||
}>({ endpoint })
|
||||
.then((response) => ({
|
||||
success: response.success,
|
||||
data: response.media_file,
|
||||
}))
|
||||
.catch((err) => {
|
||||
return {
|
||||
success: false,
|
||||
errorMessage: err.message,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public async ListMediaFiles(
|
||||
query: ListMediaQuery,
|
||||
): Promise<ApiResponse<MediaFile[], PaginationInfinite>> {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/media_files/list`;
|
||||
const queryWithStrings = {
|
||||
...query,
|
||||
filter_media_classes: query.filter_media_classes
|
||||
? query.filter_media_classes.join(",")
|
||||
: undefined,
|
||||
filter_media_type: query.filter_media_type
|
||||
? query.filter_media_type.join(",")
|
||||
: undefined,
|
||||
filter_engine_categories: query.filter_engine_categories
|
||||
? query.filter_engine_categories.join(",")
|
||||
: undefined,
|
||||
};
|
||||
return await this.get<{
|
||||
success: boolean;
|
||||
results: MediaFile[];
|
||||
pagination?: PaginationInfinite;
|
||||
}>({ endpoint, query: queryWithStrings })
|
||||
.then((response) => ({
|
||||
success: response.success,
|
||||
data: response.results ?? [],
|
||||
pagination: response.pagination,
|
||||
}))
|
||||
.catch((err) => {
|
||||
return {
|
||||
success: false,
|
||||
errorMessage: err.message,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public async ListFeaturedMediaFiles(
|
||||
query: ListMediaQuery,
|
||||
): Promise<ApiResponse<MediaFile[], PaginationInfinite>> {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/media_files/list_featured`;
|
||||
const queryWithStrings = {
|
||||
...query,
|
||||
filter_media_classes: query.filter_media_classes
|
||||
? query.filter_media_classes.join(",")
|
||||
: undefined,
|
||||
filter_media_type: query.filter_media_type
|
||||
? query.filter_media_type.join(",")
|
||||
: undefined,
|
||||
filter_engine_categories: query.filter_engine_categories
|
||||
? query.filter_engine_categories.join(",")
|
||||
: undefined,
|
||||
};
|
||||
return await this.get<{
|
||||
success: boolean;
|
||||
results: MediaFile[];
|
||||
pagination: PaginationInfinite;
|
||||
}>({ endpoint, query: queryWithStrings })
|
||||
.then((response) => ({
|
||||
success: true,
|
||||
data: response.results,
|
||||
pagination: response.pagination,
|
||||
}))
|
||||
.catch((err) => {
|
||||
return {
|
||||
success: false,
|
||||
errorMessage: err.message,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public async ListUserMediaFiles(
|
||||
query: ListUserMediaQuery,
|
||||
): Promise<ApiResponse<MediaFile[], Pagination>> {
|
||||
const userName = query.username;
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/media_files/list/user/${userName}`;
|
||||
const queryWithStrings = {
|
||||
...query,
|
||||
include_user_uploads: true,
|
||||
filter_media_classes: query.filter_media_classes
|
||||
? query.filter_media_classes.join(",")
|
||||
: undefined,
|
||||
filter_media_type: query.filter_media_type
|
||||
? query.filter_media_type.join(",")
|
||||
: undefined,
|
||||
filter_engine_categories: query.filter_engine_categories
|
||||
? query.filter_engine_categories.join(",")
|
||||
: undefined,
|
||||
};
|
||||
return await this.get<{
|
||||
success: boolean;
|
||||
results: MediaFile[];
|
||||
pagination?: Pagination;
|
||||
}>({ endpoint, query: queryWithStrings })
|
||||
.then((response) => ({
|
||||
success: response.success,
|
||||
data: response.results ?? [],
|
||||
pagination: response.pagination,
|
||||
}))
|
||||
.catch((err) => {
|
||||
return {
|
||||
success: false,
|
||||
errorMessage: err.message,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public async SearchFeaturedMediaFiles(
|
||||
query: SearchFeaturedMediaQuery,
|
||||
): Promise<ApiResponse<MediaFile[], Pagination>> {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/media_files/search_featured`;
|
||||
const queryWithStrings = {
|
||||
search_term: query.search_term,
|
||||
filter_media_classes: query.filter_media_classes
|
||||
? query.filter_media_classes.join(",")
|
||||
: undefined,
|
||||
filter_media_type: query.filter_media_type
|
||||
? query.filter_media_type.join(",")
|
||||
: undefined,
|
||||
filter_engine_categories: query.filter_engine_categories
|
||||
? query.filter_engine_categories.join(",")
|
||||
: undefined,
|
||||
};
|
||||
return await this.get<{
|
||||
success: boolean;
|
||||
results: MediaFile[];
|
||||
pagination: Pagination;
|
||||
}>({ endpoint, query: queryWithStrings })
|
||||
.then((response) => ({
|
||||
success: true,
|
||||
data: response.results,
|
||||
pagination: response.pagination,
|
||||
}))
|
||||
.catch((err) => ({
|
||||
success: false,
|
||||
errorMessage: err.message,
|
||||
}));
|
||||
}
|
||||
|
||||
public async SearchUserMediaFiles(
|
||||
query: SearchFeaturedMediaQuery,
|
||||
): Promise<ApiResponse<MediaFile[], Pagination>> {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/media_files/search_session`;
|
||||
const queryWithStrings = {
|
||||
search_term: query.search_term,
|
||||
filter_media_classes: query.filter_media_classes
|
||||
? query.filter_media_classes.join(",")
|
||||
: undefined,
|
||||
filter_media_type: query.filter_media_type
|
||||
? query.filter_media_type.join(",")
|
||||
: undefined,
|
||||
filter_engine_categories: query.filter_engine_categories
|
||||
? query.filter_engine_categories.join(",")
|
||||
: undefined,
|
||||
};
|
||||
return await this.get<{
|
||||
success: boolean;
|
||||
results: MediaFile[];
|
||||
pagination: Pagination;
|
||||
}>({ endpoint, query: queryWithStrings })
|
||||
.then((response) => ({
|
||||
success: true,
|
||||
data: response.results,
|
||||
pagination: response.pagination,
|
||||
}))
|
||||
.catch((err) => ({
|
||||
success: false,
|
||||
errorMessage: err.message,
|
||||
}));
|
||||
}
|
||||
|
||||
public async RenameMediaFileByToken({
|
||||
mediaToken,
|
||||
name,
|
||||
}: {
|
||||
mediaToken: string;
|
||||
name: string;
|
||||
}): Promise<ApiResponse<undefined>> {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/media_files/rename/${mediaToken}`;
|
||||
const body = { name };
|
||||
|
||||
return await this.post<
|
||||
{ name: string },
|
||||
{
|
||||
success?: boolean;
|
||||
BadInput?: string;
|
||||
}
|
||||
>({ endpoint, body })
|
||||
.then((response) => ({
|
||||
success: response.success ?? false,
|
||||
errorMessage: response.BadInput,
|
||||
}))
|
||||
.catch((err) => {
|
||||
return { success: false, errorMessage: err.message };
|
||||
});
|
||||
}
|
||||
|
||||
public async UpdateCoverImage({
|
||||
mediaFileToken,
|
||||
imageToken,
|
||||
}: {
|
||||
mediaFileToken: string;
|
||||
imageToken: string;
|
||||
}): Promise<ApiResponse<undefined>> {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/media_files/cover_image/${mediaFileToken}`;
|
||||
return await this.post<
|
||||
{ cover_image_media_file_token: string },
|
||||
{
|
||||
success?: boolean;
|
||||
BadInput?: string;
|
||||
}
|
||||
>({ endpoint, body: { cover_image_media_file_token: imageToken } })
|
||||
.then((response) => ({
|
||||
success: response.success ?? false,
|
||||
errorMessage: response.BadInput,
|
||||
}))
|
||||
.catch((err) => {
|
||||
return {
|
||||
success: false,
|
||||
errorMessage: err.message,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public async UpdateVisibility({
|
||||
mediaFileToken,
|
||||
visibility,
|
||||
}: {
|
||||
mediaFileToken: string;
|
||||
visibility: Visibility;
|
||||
}): Promise<ApiResponse<undefined>> {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/media_files/visibility/${mediaFileToken}`;
|
||||
return await this.post<
|
||||
{ creator_set_visibility: string },
|
||||
{
|
||||
success?: boolean;
|
||||
BadInput?: string;
|
||||
}
|
||||
>({ endpoint, body: { creator_set_visibility: visibility } })
|
||||
.then((response) => ({
|
||||
success: response.success ?? false,
|
||||
errorMessage: response.BadInput,
|
||||
}))
|
||||
.catch((err) => {
|
||||
return {
|
||||
success: false,
|
||||
errorMessage: err.message,
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
+5
-10
@@ -1,9 +1,9 @@
|
||||
|
||||
import { ApiManager, ApiResponse } from "../apis/ApiManager";
|
||||
import { FilterEngineCategories } from "../enums/QueryFilters";
|
||||
import { Visibility } from "../enums/Visibility";
|
||||
import { ApiManager, ApiResponse } from "./ApiManager.js";
|
||||
import { FilterEngineCategories } from "./enums/QueryFilters.js";
|
||||
import { Visibility } from "./enums/Visibility.js";
|
||||
import { EIntermediateFile } from "./enums/EIntermediateFile.js";
|
||||
export class MediaUploadApi extends ApiManager {
|
||||
private sessionToken: string = "";
|
||||
private sessionToken = "";
|
||||
|
||||
private async getSessionTokenForUploadStudioShot() {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/session_token`;
|
||||
@@ -336,11 +336,6 @@ export class MediaUploadApi extends ApiManager {
|
||||
const fileName = `${maybe_title}-${uuid}`;
|
||||
return this.Upload({ endpoint, blob, fileName, uuid, options }); // token comes back and send it VST
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { ApiManager, ApiResponse } from "../apis/ApiManager";
|
||||
import { StatusAlert } from "../models/StatusAlert";
|
||||
import { ApiManager, ApiResponse } from "./ApiManager.js";
|
||||
import { StatusAlert } from "./models/StatusAlert.js";
|
||||
|
||||
export class MiscApi extends ApiManager {
|
||||
public GetStatusAlertCheck(): Promise<ApiResponse<StatusAlert>> {
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { ApiManager, ApiResponse } from "../apis/ApiManager";
|
||||
import { Prompts } from "../models/Prompts";
|
||||
import { ApiManager, ApiResponse } from "./ApiManager.js";
|
||||
import { Prompts } from "./models/Prompts.js";
|
||||
|
||||
export class PromptsApi extends ApiManager {
|
||||
public GetPromptsByToken({
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { ApiManager } from "../apis/ApiManager";
|
||||
import { ApiManager } from "./ApiManager.js";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
export interface Coordinates {
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
import { ApiManager, ApiResponse } from "../apis/ApiManager";
|
||||
import { GenerateTtsAudioErrorType } from "../enums/Tts";
|
||||
import { Visibility } from "../enums/Visibility";
|
||||
import { ApiManager, ApiResponse } from "./ApiManager.js";
|
||||
import { GenerateTtsAudioErrorType } from "./enums/Tts.js";
|
||||
import { Visibility } from "./enums/Visibility.js";
|
||||
|
||||
export interface GenerateTtsAudioRequest {
|
||||
creator_set_visibility?: Visibility;
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
import { ApiManager, ApiResponse } from "../apis/ApiManager";
|
||||
import { ApiManager, ApiResponse } from "./ApiManager.js";
|
||||
import {
|
||||
UserBookmarkBatch,
|
||||
UserBookmarkByEntity,
|
||||
UserBookmarkByUser,
|
||||
} from "../models/UserBookmark";
|
||||
import { Pagination } from "../models/Pagination";
|
||||
} from "./models/UserBookmark.js";
|
||||
import { Pagination } from "./models/Pagination.js";
|
||||
|
||||
export enum ScopedEntityTypes {
|
||||
USER = "user",
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { ApiManager, ApiResponse } from "../apis/ApiManager";
|
||||
import { ApiManager, ApiResponse } from "./ApiManager.js";
|
||||
|
||||
export interface UserRating {
|
||||
entity_token: string;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { ApiManager, ApiResponse } from "../apis/ApiManager";
|
||||
import { UserInfo } from "../models/Users";
|
||||
import { ApiManager, ApiResponse } from "./ApiManager.js";
|
||||
import { UserInfo } from "./models/Users.js";
|
||||
|
||||
export class UsersApi extends ApiManager {
|
||||
public GetSession(): Promise<
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { ApiManager, ApiResponse } from "../apis/ApiManager";
|
||||
import { Visibility } from "../enums/Visibility";
|
||||
import { ApiManager, ApiResponse } from "./ApiManager.js";
|
||||
import { Visibility } from "./enums/Visibility.js";
|
||||
|
||||
interface GenerateVideoStyleTransferRequest {
|
||||
creator_set_visibility: string;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { ApiManager, ApiResponse } from "./ApiManager";
|
||||
import { ApiManager, ApiResponse } from "./ApiManager.js";
|
||||
|
||||
interface VoiceConversionParams {
|
||||
autoPredictF0?: boolean;
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
import { ApiManager, ApiResponse } from "./ApiManager";
|
||||
import { Pagination } from "../models/Pagination";
|
||||
import { ZsDataset } from "../models/Dataset";
|
||||
import { ApiManager, ApiResponse } from "./ApiManager.js";
|
||||
import { Pagination } from "./models/Pagination.js";
|
||||
import { ZsDataset } from "./models/Dataset.js";
|
||||
|
||||
interface VoiceDesignerParams {
|
||||
text: string;
|
||||
+5
-5
@@ -1,12 +1,12 @@
|
||||
import { ApiManager, ApiResponse } from "./ApiManager";
|
||||
import { Weight } from "../models/Weight";
|
||||
import { Pagination, PaginationInfinite } from "../models/Pagination";
|
||||
import { ApiManager, ApiResponse } from "./ApiManager.js";
|
||||
import { Weight } from "./models/Weight.js";
|
||||
import { Pagination, PaginationInfinite } from "./models/Pagination.js";
|
||||
import {
|
||||
FilterEngineCategories,
|
||||
FilterMediaClasses,
|
||||
FilterMediaType,
|
||||
} from "../enums/QueryFilters";
|
||||
import { Visibility } from "../enums/Visibility";
|
||||
} from "./enums/QueryFilters.js";
|
||||
import { Visibility } from "./enums/Visibility.js";
|
||||
|
||||
export enum ScopedWeightType {
|
||||
HIFIGAN_TT2 = "hifigan_tt2",
|
||||
@@ -0,0 +1,4 @@
|
||||
export enum EIntermediateFile {
|
||||
"true",
|
||||
"false"
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@ import {
|
||||
LoyaltyProgram,
|
||||
SubscriptionNamespace,
|
||||
SubscriptionProduct,
|
||||
} from "../enums/Billing";
|
||||
} from "../enums/Billing.js";
|
||||
|
||||
export interface ActiveSubscriptions {
|
||||
// user's list of subscriptions
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { JobStatus } from "../enums/Job";
|
||||
import { JobStatus } from "../enums/Job.js";
|
||||
|
||||
export interface Job {
|
||||
created_at: string;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { USER_FEATURE_FLAGS } from "../enums/UserFeatures";
|
||||
import { USER_FEATURE_FLAGS } from "../../libs/api/src/lib/enums/UserFeatures";
|
||||
|
||||
export interface CoreInfo {
|
||||
default_avatar: {
|
||||
@@ -1,167 +0,0 @@
|
||||
import { ApiManager, ApiResponse } from "../apis/ApiManager";
|
||||
import { BetaKey } from "../models/BetaKeys";
|
||||
import { Pagination } from "../models/Pagination";
|
||||
|
||||
export class BetaKeysApi extends ApiManager {
|
||||
public CreateBetaKey({
|
||||
maybeNote,
|
||||
maybeReferrerUsername,
|
||||
numberOfKeys,
|
||||
uuidIdempotencyToken,
|
||||
}: {
|
||||
maybeNote?: string;
|
||||
maybeReferrerUsername?: string;
|
||||
numberOfKeys: number;
|
||||
uuidIdempotencyToken: string;
|
||||
}): Promise<ApiResponse<string[]>> {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/beta_keys/create`;
|
||||
|
||||
const body = {
|
||||
maybe_note: maybeNote,
|
||||
maybe_referrer_username: maybeReferrerUsername,
|
||||
number_of_keys: numberOfKeys,
|
||||
uuid_idempotency_token: uuidIdempotencyToken,
|
||||
};
|
||||
|
||||
return this.post<
|
||||
{
|
||||
maybe_note?: string;
|
||||
maybe_referrer_username?: string;
|
||||
number_of_keys: number;
|
||||
uuid_idempotency_token: string;
|
||||
},
|
||||
{
|
||||
success?: boolean;
|
||||
beta_keys?: string[];
|
||||
BadInput?: string;
|
||||
}
|
||||
>({ endpoint, body })
|
||||
.then((response) => ({
|
||||
success: response.success ?? false,
|
||||
data: response.beta_keys,
|
||||
errorMessage: response.BadInput,
|
||||
}))
|
||||
.catch((err) => {
|
||||
return { success: false, errorMessage: err.message };
|
||||
});
|
||||
}
|
||||
|
||||
public ListBetaKeys({
|
||||
sortAscending,
|
||||
pageSize,
|
||||
pageIndex,
|
||||
maybeReferrerUsername,
|
||||
onlyListRemaining,
|
||||
}: {
|
||||
sortAscending?: boolean;
|
||||
pageSize?: number;
|
||||
pageIndex?: number;
|
||||
maybeReferrerUsername?: string;
|
||||
onlyListRemaining?: boolean;
|
||||
}): Promise<ApiResponse<BetaKey[], Pagination>> {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/beta_keys/list`;
|
||||
|
||||
const query = {
|
||||
sort_ascending: sortAscending,
|
||||
page_size: pageSize,
|
||||
page_index: pageIndex,
|
||||
maybe_referrer_username: maybeReferrerUsername,
|
||||
only_list_remaining: onlyListRemaining,
|
||||
};
|
||||
|
||||
return this.get<{
|
||||
success?: boolean;
|
||||
beta_keys?: BetaKey[];
|
||||
pagination?: Pagination;
|
||||
BadInput?: string;
|
||||
}>({ endpoint, query })
|
||||
.then((response) => ({
|
||||
success: response.success ?? false,
|
||||
data: response.beta_keys,
|
||||
pagination: response.pagination,
|
||||
errorMessage: response.BadInput,
|
||||
}))
|
||||
.catch((err) => {
|
||||
return { success: false, errorMessage: err.message };
|
||||
});
|
||||
}
|
||||
|
||||
public RedeemBetaKey({
|
||||
betaKey,
|
||||
}: {
|
||||
betaKey: string;
|
||||
}): Promise<ApiResponse<undefined>> {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/beta_keys/redeem`;
|
||||
|
||||
return this.post<
|
||||
{
|
||||
beta_key: string;
|
||||
},
|
||||
{
|
||||
success?: boolean;
|
||||
BadInput?: string;
|
||||
}
|
||||
>({ endpoint, body: { beta_key: betaKey } })
|
||||
.then((response) => ({
|
||||
success: response.success ?? false,
|
||||
errorMessage: response.BadInput,
|
||||
}))
|
||||
.catch((err) => {
|
||||
return { success: false, errorMessage: err.message };
|
||||
});
|
||||
}
|
||||
|
||||
public UpdateBetaKeyIsDistributed({
|
||||
betaKey,
|
||||
isDistributed,
|
||||
}: {
|
||||
betaKey: string;
|
||||
isDistributed: boolean;
|
||||
}): Promise<ApiResponse<undefined>> {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/beta_keys/${betaKey}/distributed`;
|
||||
|
||||
return this.post<
|
||||
{
|
||||
is_distributed: boolean;
|
||||
},
|
||||
{
|
||||
success?: boolean;
|
||||
BadInput?: string;
|
||||
}
|
||||
>({ endpoint, body: { is_distributed: isDistributed } })
|
||||
.then((response) => ({
|
||||
success: response.success ?? false,
|
||||
errorMessage: response.BadInput,
|
||||
}))
|
||||
.catch((err) => {
|
||||
return { success: false, errorMessage: err.message };
|
||||
});
|
||||
}
|
||||
|
||||
public UpdateBetaKeyNote({
|
||||
token,
|
||||
note,
|
||||
}: {
|
||||
token: string;
|
||||
note?: string;
|
||||
}): Promise<ApiResponse<undefined>> {
|
||||
const endpoint = `${this.ApiTargets.BaseApi}/v1/beta_keys/${token}/note`;
|
||||
|
||||
return this.post<
|
||||
{
|
||||
note?: string;
|
||||
},
|
||||
{
|
||||
success?: boolean;
|
||||
BadInput?: string;
|
||||
}
|
||||
>({ endpoint, body: { note } })
|
||||
.then((response) => ({
|
||||
success: response.success ?? false,
|
||||
errorMessage: response.BadInput,
|
||||
}))
|
||||
.catch((err) => {
|
||||
return { success: false, errorMessage: err.message };
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,143 +0,0 @@
|
||||
# Recursive Folder Comparison Report: Classes vs Classes
|
||||
|
||||
Generated on: 2025-04-16 13:33:19
|
||||
|
||||
## File Comparison Table
|
||||
|
||||
| File Path | Status | Classes | Classes | Difference |
|
||||
|------------------------------------|----------|--------------------|--------------------|------------------------------|
|
||||
|
||||
| ApiManager/MediaFilesApi.ts | be67aab2:44342e0f | 10.6KB (364 lines) | 10.6KB (369 lines) | +56B (+5 lines) 5% different |
|
||||
|
||||
| ApiManager/VoiceDesignerApi.ts | e4d874c3:3635ba42 | 2.0KB (77 lines) | 2.1KB (78 lines) | +94B (+1 lines) 5% different |
|
||||
| ApiManager/PromptsApi.ts | d73d329a:c4824d2e | 648B (25 lines) | 657B (25 lines) | +9B (0 lines) 4% different |
|
||||
|
||||
## Files Present in One Folder But Missing in the Other
|
||||
|
||||
|
||||
### Files Only in Classes (23 files)
|
||||
- `ApiManager/SegmentationApi.ts` (1.9KB, 84 lines, hash: bb14fbf6)
|
||||
- `ApiManager/enums/Api.ts` (254B, 7 lines, hash: ea867d98)
|
||||
- `ApiManager/enums/Billing.ts` (242B, 11 lines, hash: e47c3eaa)
|
||||
- `ApiManager/enums/Job.ts` (433B, 16 lines, hash: d148fd64)
|
||||
- `ApiManager/enums/MediaFileClass.ts` (524B, 26 lines, hash: c90ce542)
|
||||
- `ApiManager/enums/MediaFileType.ts` (1.7KB, 58 lines, hash: a2374fec)
|
||||
- `ApiManager/enums/QueryFilters.ts` (579B, 29 lines, hash: 6d10a292)
|
||||
- `ApiManager/enums/Tts.ts` (205B, 7 lines, hash: f6393d2e)
|
||||
- `ApiManager/enums/UserFeatures.ts` (167B, 6 lines, hash: 05d49e51)
|
||||
- `ApiManager/enums/Visibility.ts` (92B, 5 lines, hash: 297d031b)
|
||||
- `ApiManager/enums/WeightCategory.ts` (180B, 8 lines, hash: f9be3d32)
|
||||
- `ApiManager/enums/WeightType.ts` (208B, 11 lines, hash: 80436726)
|
||||
- `ApiManager/models/BetaKeys.ts` (502B, 26 lines, hash: 7c718ac6)
|
||||
- `ApiManager/models/Billing.tsx` (416B, 17 lines, hash: 8db6eb3b)
|
||||
- `ApiManager/models/Dataset.ts` (588B, 23 lines, hash: 6af860ff)
|
||||
- `ApiManager/models/Job.ts` (1.8KB, 72 lines, hash: 9d7b385a)
|
||||
- `ApiManager/models/MediaFile.ts` (1.8KB, 59 lines, hash: 41778349)
|
||||
- `ApiManager/models/Pagination.ts` (200B, 9 lines, hash: 837b24d3)
|
||||
- `ApiManager/models/Prompts.ts` (424B, 16 lines, hash: 8ef1f366)
|
||||
- `ApiManager/models/StatusAlert.ts` (175B, 9 lines, hash: fcee4684)
|
||||
- `ApiManager/models/UserBookmark.ts` (1.6KB, 75 lines, hash: 8f70d1b1)
|
||||
- `ApiManager/models/Users.ts` (1.3KB, 50 lines, hash: 5ed82bbd)
|
||||
- `ApiManager/models/Weight.ts` (767B, 40 lines, hash: 3f9cccdb)
|
||||
|
||||
### Files Only in Classes (4 files)
|
||||
- `ApiHelpers.ts` (637B, 17 lines, hash: 9b638c6c)
|
||||
- `ApiManager/StudioGen2Api.ts` (1.6KB, 61 lines, hash: b2707195)
|
||||
- `EnvironmentVariables.ts` (263B, 10 lines, hash: 29c93666)
|
||||
- `GetFrontendEnvironment.ts` (1.9KB, 65 lines, hash: 7ee8b738)
|
||||
|
||||
## Files with Differences (Sorted by Most Different First)
|
||||
|
||||
### `ApiManager/MediaUploadApi.ts` (72% different)
|
||||
- Classes: 10.3KB, 349 lines, hash: 707d2bf2
|
||||
- Classes: 10.0KB, 339 lines, hash: 06a93d8c
|
||||
- Difference: -255 bytes, -10 lines
|
||||
|
||||
### `ApiManager/EngineApi.ts` (69% different)
|
||||
- Classes: 1.0KB, 39 lines, hash: c4850e80
|
||||
- Classes: 5.5KB, 213 lines, hash: 85e20a81
|
||||
- Difference: +4469 bytes, +174 lines
|
||||
|
||||
### `ApiManager/JobsApi.ts` (28% different)
|
||||
- Classes: 2.0KB, 77 lines, hash: f7eb8e22
|
||||
- Classes: 1.9KB, 74 lines, hash: 2aa03349
|
||||
- Difference: -56 bytes, -3 lines
|
||||
|
||||
### `ApiManager/ApiManager.ts` (14% different)
|
||||
- Classes: 5.5KB, 235 lines, hash: 44db0b07
|
||||
- Classes: 5.3KB, 211 lines, hash: 67a3a046
|
||||
- Difference: -200 bytes, -24 lines
|
||||
|
||||
### `ApiManager/BillingApi.ts` (6% different)
|
||||
- Classes: 1.0KB, 33 lines, hash: 20051893
|
||||
- Classes: 1.0KB, 33 lines, hash: f5b7af84
|
||||
- Difference: -8 bytes, +0 lines
|
||||
|
||||
### `ApiManager/VoiceDesignerApi.ts` (5% different)
|
||||
- Classes: 2.0KB, 77 lines, hash: e4d874c3
|
||||
- Classes: 2.1KB, 78 lines, hash: 3635ba42
|
||||
- Difference: +94 bytes, +1 lines
|
||||
|
||||
### `ApiManager/MediaFilesApi.ts` (5% different)
|
||||
- Classes: 10.6KB, 364 lines, hash: be67aab2
|
||||
- Classes: 10.6KB, 369 lines, hash: 44342e0f
|
||||
- Difference: +56 bytes, +5 lines
|
||||
|
||||
### `ApiManager/PromptsApi.ts` (4% different)
|
||||
- Classes: 648B, 25 lines, hash: d73d329a
|
||||
- Classes: 657B, 25 lines, hash: c4824d2e
|
||||
- Difference: +9 bytes, +0 lines
|
||||
|
||||
### `ApiManager/MiscApi.ts` (3% different)
|
||||
- Classes: 799B, 26 lines, hash: 298f5d93
|
||||
- Classes: 799B, 26 lines, hash: 187ad676
|
||||
- Difference: +0 bytes, +0 lines
|
||||
|
||||
### `ApiManager/TtsApi.ts` (3% different)
|
||||
- Classes: 1.7KB, 64 lines, hash: 5feb5cad
|
||||
- Classes: 1.7KB, 64 lines, hash: 6228b278
|
||||
- Difference: +2 bytes, +0 lines
|
||||
|
||||
### `ApiManager/index.ts` (2% different)
|
||||
- Classes: 564B, 18 lines, hash: 55a9094b
|
||||
- Classes: 597B, 19 lines, hash: 1fe59701
|
||||
- Difference: +33 bytes, +1 lines
|
||||
|
||||
### `ApiManager/UserBookmarksApi.ts` (2% different)
|
||||
- Classes: 5.4KB, 201 lines, hash: e3e4cb19
|
||||
- Classes: 5.5KB, 202 lines, hash: fd3afc78
|
||||
- Difference: +56 bytes, +1 lines
|
||||
|
||||
### `ApiManager/WeightsApi.ts` (2% different)
|
||||
- Classes: 7.8KB, 295 lines, hash: c12a98df
|
||||
- Classes: 7.9KB, 296 lines, hash: 8a7dbb68
|
||||
- Difference: +39 bytes, +1 lines
|
||||
|
||||
### `ApiManager/VideoApi.ts` (1% different)
|
||||
- Classes: 1.9KB, 70 lines, hash: a9947328
|
||||
- Classes: 1.9KB, 70 lines, hash: cb947c07
|
||||
- Difference: -11 bytes, +0 lines
|
||||
|
||||
### `ApiManager/BetaKeysApi.ts` (1% different)
|
||||
- Classes: 4.3KB, 167 lines, hash: 8d4ec6f1
|
||||
- Classes: 4.3KB, 167 lines, hash: 33f1e4b3
|
||||
- Difference: -3 bytes, +0 lines
|
||||
|
||||
### `ApiManager/UsersApi.ts` (0% different)
|
||||
- Classes: 3.9KB, 161 lines, hash: 65121217
|
||||
- Classes: 3.9KB, 161 lines, hash: 72db0eae
|
||||
- Difference: -6 bytes, +0 lines
|
||||
|
||||
|
||||
## Summary
|
||||
- **Total Unique Files**: 49
|
||||
- **Files in Classes**: 45
|
||||
- **Files in Classes**: 26
|
||||
- **Identical Files**: 6
|
||||
- **Different Files**: 16
|
||||
- **Files Only in Classes**: 23
|
||||
- **Files Only in Classes**: 4
|
||||
|
||||
## Path Information
|
||||
- Classes: `/Users/michaelchung/storyteller-rust/frontend/apps/editor2d/src/Classes/`
|
||||
- Classes: `/Users/michaelchung/storyteller-rust/frontend/apps/editor3d/app/Classes/`
|
||||
Reference in New Issue
Block a user