feeef 0.7.4 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +393 -4
- package/build/index.js.map +1 -1
- package/build/src/core/entities/attachment.d.ts +31 -0
- package/build/src/core/entities/image_generation.d.ts +71 -0
- package/build/src/core/entities/image_prompt_template.d.ts +41 -0
- package/build/src/feeef/feeef.d.ts +10 -0
- package/build/src/feeef/repositories/image_generations.d.ts +26 -0
- package/build/src/feeef/repositories/image_prompt_templates.d.ts +38 -0
- package/build/src/index.d.ts +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared AI attachment contract used by image prompt templates and image generations.
|
|
3
|
+
*/
|
|
4
|
+
export declare const ATTACHMENT_TYPES: readonly ["image", "url", "audio", "product", "store"];
|
|
5
|
+
export type AttachmentType = (typeof ATTACHMENT_TYPES)[number];
|
|
6
|
+
export interface AttachmentBase {
|
|
7
|
+
value: string;
|
|
8
|
+
label?: string | null;
|
|
9
|
+
prompt?: string | null;
|
|
10
|
+
}
|
|
11
|
+
export interface ImageAttachmentPayload extends AttachmentBase {
|
|
12
|
+
type: 'image';
|
|
13
|
+
}
|
|
14
|
+
export interface UrlAttachmentPayload extends AttachmentBase {
|
|
15
|
+
type: 'url';
|
|
16
|
+
}
|
|
17
|
+
export interface AudioAttachmentPayload extends AttachmentBase {
|
|
18
|
+
type: 'audio';
|
|
19
|
+
}
|
|
20
|
+
export interface ProductAttachmentPayload extends AttachmentBase {
|
|
21
|
+
type: 'product';
|
|
22
|
+
}
|
|
23
|
+
export interface StoreAttachmentPayload extends AttachmentBase {
|
|
24
|
+
type: 'store';
|
|
25
|
+
}
|
|
26
|
+
export type AttachmentPayload = ImageAttachmentPayload | UrlAttachmentPayload | AudioAttachmentPayload | ProductAttachmentPayload | StoreAttachmentPayload;
|
|
27
|
+
export declare function isAttachmentType(value: unknown): value is AttachmentType;
|
|
28
|
+
export declare function normalizeAttachmentPayload(value: unknown): AttachmentPayload | null;
|
|
29
|
+
export declare function normalizeAttachmentPayloads(value: unknown): AttachmentPayload[];
|
|
30
|
+
export declare function serializeAttachmentPayload(payload: AttachmentPayload): Record<string, unknown>;
|
|
31
|
+
export declare function serializeAttachmentPayloads(attachments: AttachmentPayload[] | null | undefined): Record<string, unknown>[];
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { AttachmentPayload } from './attachment.js';
|
|
2
|
+
export type ImageGenerationStatus = 'pending' | 'processing' | 'completed' | 'published' | 'failed';
|
|
3
|
+
export type ImageGenerationResolution = 'MEDIA_RESOLUTION_LOW' | 'MEDIA_RESOLUTION_MEDIUM' | 'MEDIA_RESOLUTION_HIGH';
|
|
4
|
+
export type ImageGenerationAspectRatio = '1:1' | '16:9' | '9:16' | '4:3' | '3:4' | '4:5' | '9:32' | '1:8' | '8:1' | '1:4' | '4:1';
|
|
5
|
+
export interface ImageGenerationHistoryItem {
|
|
6
|
+
id: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
generatedImageUrl: string | null;
|
|
9
|
+
configs: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export interface ImageGenerationUserSummary {
|
|
12
|
+
id: string;
|
|
13
|
+
name?: string | null;
|
|
14
|
+
photoUrl?: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface ImageGeneration {
|
|
17
|
+
id: string;
|
|
18
|
+
userId: string | null;
|
|
19
|
+
storeId: string | null;
|
|
20
|
+
title: string | null;
|
|
21
|
+
generatedImageUrl: string | null;
|
|
22
|
+
configs: Record<string, unknown>;
|
|
23
|
+
generations: ImageGenerationHistoryItem[];
|
|
24
|
+
status: ImageGenerationStatus;
|
|
25
|
+
tags: string[];
|
|
26
|
+
createdAt: string;
|
|
27
|
+
updatedAt: string | null;
|
|
28
|
+
deletedAt: string | null;
|
|
29
|
+
user?: ImageGenerationUserSummary | null;
|
|
30
|
+
}
|
|
31
|
+
export interface PaginatedResourceResponse<T> {
|
|
32
|
+
data: T[];
|
|
33
|
+
meta: Record<string, unknown>;
|
|
34
|
+
hasMore: boolean;
|
|
35
|
+
total?: number;
|
|
36
|
+
page?: number;
|
|
37
|
+
limit?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface ImageGenerationListOptions {
|
|
40
|
+
page?: number;
|
|
41
|
+
limit?: number;
|
|
42
|
+
storeId?: string;
|
|
43
|
+
tags?: string[];
|
|
44
|
+
params?: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
export interface ImageGenerationGalleryOptions {
|
|
47
|
+
page?: number;
|
|
48
|
+
limit?: number;
|
|
49
|
+
params?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
export interface ImageGenerationGenerateInput {
|
|
52
|
+
id?: string | null;
|
|
53
|
+
storeId?: string | null;
|
|
54
|
+
title?: string | null;
|
|
55
|
+
prompt?: string | null;
|
|
56
|
+
imageFile?: File | Blob | Uint8Array | ArrayBuffer | null;
|
|
57
|
+
aspectRatio?: ImageGenerationAspectRatio;
|
|
58
|
+
resolution?: ImageGenerationResolution;
|
|
59
|
+
systemInstructions?: string | null;
|
|
60
|
+
attachments?: AttachmentPayload[];
|
|
61
|
+
model?: string | null;
|
|
62
|
+
googleSearch?: boolean;
|
|
63
|
+
imageSearch?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface ImageGenerationPublishInput {
|
|
66
|
+
id: string;
|
|
67
|
+
isPublished: boolean;
|
|
68
|
+
}
|
|
69
|
+
export declare function normalizeImageGeneration(value: unknown): ImageGeneration;
|
|
70
|
+
export declare function normalizePaginatedResponse<T>(value: unknown, mapper: (item: unknown) => T): PaginatedResourceResponse<T>;
|
|
71
|
+
export declare function createImageGenerationFormData(input: ImageGenerationGenerateInput): FormData;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AttachmentPayload } from './attachment.js';
|
|
2
|
+
/**
|
|
3
|
+
* Image prompt template entity used by merchant AI product-image flows.
|
|
4
|
+
*/
|
|
5
|
+
export interface ImagePromptTemplate {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string | null;
|
|
9
|
+
prompt: string;
|
|
10
|
+
tags: string[];
|
|
11
|
+
attachments: AttachmentPayload[];
|
|
12
|
+
previewImageUrl: string | null;
|
|
13
|
+
propsSchema: Record<string, unknown>;
|
|
14
|
+
props: Record<string, unknown>;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
updatedAt: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface ImagePromptTemplateCreate {
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string | null;
|
|
21
|
+
prompt: string;
|
|
22
|
+
tags?: string[];
|
|
23
|
+
attachments?: AttachmentPayload[];
|
|
24
|
+
previewImageUrl?: string | null;
|
|
25
|
+
propsSchema?: Record<string, unknown>;
|
|
26
|
+
props?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
export interface ImagePromptTemplateUpdate {
|
|
29
|
+
name?: string;
|
|
30
|
+
description?: string | null;
|
|
31
|
+
prompt?: string;
|
|
32
|
+
tags?: string[];
|
|
33
|
+
attachments?: AttachmentPayload[];
|
|
34
|
+
previewImageUrl?: string | null;
|
|
35
|
+
propsSchema?: Record<string, unknown>;
|
|
36
|
+
props?: Record<string, unknown>;
|
|
37
|
+
setToNull?: string[];
|
|
38
|
+
}
|
|
39
|
+
export declare function normalizeImagePromptTemplate(value: unknown): ImagePromptTemplate;
|
|
40
|
+
export declare function serializeImagePromptTemplateCreate(value: ImagePromptTemplateCreate): Record<string, unknown>;
|
|
41
|
+
export declare function serializeImagePromptTemplateUpdate(value: ImagePromptTemplateUpdate): Record<string, unknown>;
|
|
@@ -15,6 +15,8 @@ import { ShippingMethodRepository } from './repositories/shipping_methods.js';
|
|
|
15
15
|
import { FeedbackRepository } from './repositories/feedbacks.js';
|
|
16
16
|
import { ProductLandingPageTemplatesRepository } from './repositories/product_landing_page_templates.js';
|
|
17
17
|
import { ProductLandingPagesRepository } from './repositories/product_landing_pages.js';
|
|
18
|
+
import { ImagePromptTemplatesRepository } from './repositories/image_prompt_templates.js';
|
|
19
|
+
import { ImageGenerationsRepository } from './repositories/image_generations.js';
|
|
18
20
|
import { CartService } from './services/cart.js';
|
|
19
21
|
import { ActionsService } from './services/actions.js';
|
|
20
22
|
import { NotificationsService } from './services/notifications.js';
|
|
@@ -72,6 +74,14 @@ export declare class FeeeF {
|
|
|
72
74
|
* The repository for managing product landing page templates.
|
|
73
75
|
*/
|
|
74
76
|
productLandingPageTemplates: ProductLandingPageTemplatesRepository;
|
|
77
|
+
/**
|
|
78
|
+
* The repository for managing image prompt templates.
|
|
79
|
+
*/
|
|
80
|
+
imagePromptTemplates: ImagePromptTemplatesRepository;
|
|
81
|
+
/**
|
|
82
|
+
* The repository for managing async image generations.
|
|
83
|
+
*/
|
|
84
|
+
imageGenerations: ImageGenerationsRepository;
|
|
75
85
|
/**
|
|
76
86
|
* The repository for managing users.
|
|
77
87
|
*/
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { ImageGeneration, ImageGenerationGalleryOptions, ImageGenerationGenerateInput, ImageGenerationListOptions, ImageGenerationPublishInput, PaginatedResourceResponse } from '../../core/entities/image_generation.js';
|
|
3
|
+
/**
|
|
4
|
+
* Repository for async image-generation flows.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ImageGenerationsRepository {
|
|
7
|
+
client: AxiosInstance;
|
|
8
|
+
resource: string;
|
|
9
|
+
constructor(client: AxiosInstance);
|
|
10
|
+
list(options?: ImageGenerationListOptions): Promise<PaginatedResourceResponse<ImageGeneration>>;
|
|
11
|
+
gallery(options?: ImageGenerationGalleryOptions): Promise<PaginatedResourceResponse<ImageGeneration>>;
|
|
12
|
+
find(id: string): Promise<ImageGeneration>;
|
|
13
|
+
createImageGeneration(input: ImageGenerationGenerateInput & {
|
|
14
|
+
storeId: string;
|
|
15
|
+
}): Promise<ImageGeneration>;
|
|
16
|
+
generateImageGeneration(input: ImageGenerationGenerateInput): Promise<ImageGeneration>;
|
|
17
|
+
rerunGeneration(id: string, input?: Omit<ImageGenerationGenerateInput, 'id'>): Promise<ImageGeneration>;
|
|
18
|
+
setPublished(input: ImageGenerationPublishInput): Promise<ImageGeneration>;
|
|
19
|
+
delete(id: string): Promise<{
|
|
20
|
+
success: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Backward-compatible alias with the Dart naming.
|
|
25
|
+
*/
|
|
26
|
+
export type AiRepository = ImageGenerationsRepository;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { ListResponse, ModelRepository } from './repository.js';
|
|
3
|
+
import { ImagePromptTemplate, ImagePromptTemplateCreate, ImagePromptTemplateUpdate } from '../../core/entities/image_prompt_template.js';
|
|
4
|
+
export interface ImagePromptTemplateListOptions {
|
|
5
|
+
page?: number;
|
|
6
|
+
offset?: number;
|
|
7
|
+
limit?: number;
|
|
8
|
+
id?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
nameLike?: string;
|
|
11
|
+
q?: string;
|
|
12
|
+
search?: string;
|
|
13
|
+
tags?: string[];
|
|
14
|
+
hasPreview?: boolean;
|
|
15
|
+
orderBy?: 'created_at' | 'updated_at' | 'name';
|
|
16
|
+
params?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Repository for image prompt template CRUD.
|
|
20
|
+
*/
|
|
21
|
+
export declare class ImagePromptTemplatesRepository extends ModelRepository<ImagePromptTemplate, ImagePromptTemplateCreate, ImagePromptTemplateUpdate> {
|
|
22
|
+
constructor(client: AxiosInstance);
|
|
23
|
+
find(options: {
|
|
24
|
+
id: string;
|
|
25
|
+
by?: string;
|
|
26
|
+
params?: Record<string, unknown>;
|
|
27
|
+
}): Promise<ImagePromptTemplate>;
|
|
28
|
+
list(options?: ImagePromptTemplateListOptions): Promise<ListResponse<ImagePromptTemplate>>;
|
|
29
|
+
create(dataOrOptions: ImagePromptTemplateCreate | {
|
|
30
|
+
data: ImagePromptTemplateCreate;
|
|
31
|
+
params?: Record<string, unknown>;
|
|
32
|
+
}, params?: Record<string, unknown>): Promise<ImagePromptTemplate>;
|
|
33
|
+
update(options: {
|
|
34
|
+
id: string;
|
|
35
|
+
data: ImagePromptTemplateUpdate;
|
|
36
|
+
params?: Record<string, unknown>;
|
|
37
|
+
}): Promise<ImagePromptTemplate>;
|
|
38
|
+
}
|
package/build/src/index.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ export * from './core/entities/store.js';
|
|
|
4
4
|
export * from './core/entities/product.js';
|
|
5
5
|
export * from './core/entities/product_landing_page.js';
|
|
6
6
|
export * from './core/entities/product_landing_page_template.js';
|
|
7
|
+
export * from './core/entities/attachment.js';
|
|
8
|
+
export * from './core/entities/image_prompt_template.js';
|
|
9
|
+
export * from './core/entities/image_generation.js';
|
|
7
10
|
export * from './core/entities/user.js';
|
|
8
11
|
export * from './core/entities/shipping_method.js';
|
|
9
12
|
export * from './core/entities/shipping_price.js';
|
|
@@ -22,6 +25,8 @@ export * from './feeef/repositories/users.js';
|
|
|
22
25
|
export * from './feeef/repositories/stores.js';
|
|
23
26
|
export * from './feeef/repositories/products.js';
|
|
24
27
|
export * from './feeef/repositories/orders.js';
|
|
28
|
+
export * from './feeef/repositories/image_prompt_templates.js';
|
|
29
|
+
export * from './feeef/repositories/image_generations.js';
|
|
25
30
|
export * from './feeef/repositories/categories.js';
|
|
26
31
|
export * from './feeef/repositories/feedbacks.js';
|
|
27
32
|
export * from './feeef/repositories/countries.js';
|