feeef 0.12.1 → 0.12.3
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.
|
@@ -29,10 +29,47 @@ export interface StoreTemplateEntity {
|
|
|
29
29
|
policy: TemplateComponentPolicy;
|
|
30
30
|
parentId: string | null;
|
|
31
31
|
version: number;
|
|
32
|
+
/** Marketplace enrichment (when `storeId` query is sent). */
|
|
33
|
+
owned?: boolean;
|
|
34
|
+
effectivePrice?: number;
|
|
35
|
+
updateAvailable?: boolean;
|
|
36
|
+
installedReleaseId?: string | null;
|
|
37
|
+
latestRelease?: StoreTemplateReleaseEntity | null;
|
|
38
|
+
ratingAvg?: number;
|
|
39
|
+
ratingCount?: number;
|
|
40
|
+
featured?: boolean;
|
|
41
|
+
salesClosed?: boolean;
|
|
42
|
+
moderationStatus?: 'approved' | 'pending' | 'rejected';
|
|
32
43
|
createdAt: any;
|
|
33
44
|
updatedAt: any | null;
|
|
34
45
|
deletedAt: any | null;
|
|
35
46
|
}
|
|
47
|
+
/** Immutable published snapshot (`store_template_releases`). */
|
|
48
|
+
export interface StoreTemplateReleaseEntity {
|
|
49
|
+
id: string;
|
|
50
|
+
storeTemplateId: string;
|
|
51
|
+
version: string;
|
|
52
|
+
versionCode: number;
|
|
53
|
+
changelog: string | null;
|
|
54
|
+
schema?: Record<string, unknown>;
|
|
55
|
+
data?: Record<string, unknown>;
|
|
56
|
+
locales?: Record<string, unknown>;
|
|
57
|
+
publishedAt: any;
|
|
58
|
+
publishedBy?: string | null;
|
|
59
|
+
createdAt?: any;
|
|
60
|
+
updatedAt?: any | null;
|
|
61
|
+
}
|
|
62
|
+
export interface StoreTemplatePurchaseResult {
|
|
63
|
+
license: Record<string, unknown>;
|
|
64
|
+
created: boolean;
|
|
65
|
+
storeTemplate: StoreTemplateEntity;
|
|
66
|
+
}
|
|
67
|
+
export interface StoreTemplateReleaseCreateInput {
|
|
68
|
+
version?: string;
|
|
69
|
+
changelog?: string | null;
|
|
70
|
+
schema?: Record<string, unknown>;
|
|
71
|
+
data?: Record<string, unknown>;
|
|
72
|
+
}
|
|
36
73
|
export interface StoreTemplateCreateInput {
|
|
37
74
|
title: string;
|
|
38
75
|
schema?: Record<string, unknown>;
|
|
@@ -49,6 +86,7 @@ export interface StoreTemplateCreateInput {
|
|
|
49
86
|
discount?: number | null;
|
|
50
87
|
license?: string | null;
|
|
51
88
|
parentId?: string | null;
|
|
89
|
+
salesClosed?: boolean;
|
|
52
90
|
}
|
|
53
91
|
export interface StoreTemplateUpdateInput {
|
|
54
92
|
title?: string;
|
|
@@ -65,6 +103,8 @@ export interface StoreTemplateUpdateInput {
|
|
|
65
103
|
schema?: Record<string, unknown>;
|
|
66
104
|
data?: Record<string, unknown>;
|
|
67
105
|
policy?: TemplateComponentPolicy;
|
|
106
|
+
/** Author can close sales; `featured` / `moderationStatus` remain admin-only. */
|
|
107
|
+
salesClosed?: boolean;
|
|
68
108
|
}
|
|
69
109
|
/** One row in `store_template_locales`. */
|
|
70
110
|
export interface StoreTemplateLocaleEntity {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
2
|
import { ListResponse, ModelRepository } from './repository.js';
|
|
3
|
-
import { StoreTemplateEntity, StoreTemplateCreateInput, StoreTemplateUpdateInput, StoreTemplateLocaleEntity, StoreTemplateLocaleInput, StoreTemplateLocalesBundle } from '../../core/entities/store_template.js';
|
|
3
|
+
import { StoreTemplateEntity, StoreTemplateCreateInput, StoreTemplateUpdateInput, StoreTemplateLocaleEntity, StoreTemplateLocaleInput, StoreTemplateLocalesBundle, StoreTemplateReleaseEntity, StoreTemplatePurchaseResult, StoreTemplateReleaseCreateInput } from '../../core/entities/store_template.js';
|
|
4
4
|
import { TemplateComponentPolicy } from '../../core/entities/template_component.js';
|
|
5
5
|
export interface StoreTemplateListOptions {
|
|
6
6
|
page?: number;
|
|
@@ -26,16 +26,78 @@ export declare class StoreTemplatesRepository extends ModelRepository<StoreTempl
|
|
|
26
26
|
title?: string;
|
|
27
27
|
}): Promise<StoreTemplateEntity>;
|
|
28
28
|
/**
|
|
29
|
-
* Set `stores.template_id`
|
|
30
|
-
*
|
|
31
|
-
* `store_templates` row — use [fork] to duplicate a template into a store.
|
|
29
|
+
* Set `stores.template_id` (+ optional release pin) and copy release/listing
|
|
30
|
+
* `data` into `store.metadata.templateData`. Paid listings require a license.
|
|
32
31
|
*/
|
|
33
32
|
install(options: {
|
|
34
33
|
fromId: string;
|
|
35
34
|
storeId: string;
|
|
35
|
+
releaseId?: string;
|
|
36
36
|
}): Promise<{
|
|
37
37
|
storeTemplate: StoreTemplateEntity;
|
|
38
38
|
store: Record<string, unknown>;
|
|
39
|
+
release?: StoreTemplateReleaseEntity | null;
|
|
40
|
+
license?: Record<string, unknown> | null;
|
|
41
|
+
}>;
|
|
42
|
+
/** One-time wallet purchase → forever store license. */
|
|
43
|
+
purchase(options: {
|
|
44
|
+
fromId: string;
|
|
45
|
+
storeId: string;
|
|
46
|
+
}): Promise<StoreTemplatePurchaseResult>;
|
|
47
|
+
/** List immutable releases (newest first). */
|
|
48
|
+
listReleases(templateId: string, options?: {
|
|
49
|
+
storeId?: string;
|
|
50
|
+
}): Promise<{
|
|
51
|
+
data: StoreTemplateReleaseEntity[];
|
|
52
|
+
}>;
|
|
53
|
+
getRelease(templateId: string, releaseId: string, options?: {
|
|
54
|
+
storeId?: string;
|
|
55
|
+
}): Promise<StoreTemplateReleaseEntity>;
|
|
56
|
+
/** Author publishes a new immutable release. */
|
|
57
|
+
createRelease(templateId: string, input: StoreTemplateReleaseCreateInput): Promise<StoreTemplateReleaseEntity>;
|
|
58
|
+
/** Public render payload for historical / marketing preview (no auth required for public listings). */
|
|
59
|
+
renderRelease(templateId: string, releaseId: string): Promise<{
|
|
60
|
+
storeTemplateId: string;
|
|
61
|
+
releaseId: string;
|
|
62
|
+
version: string;
|
|
63
|
+
changelog: string | null;
|
|
64
|
+
data: Record<string, unknown>;
|
|
65
|
+
schema?: Record<string, unknown>;
|
|
66
|
+
}>;
|
|
67
|
+
listReviews(templateId: string, options?: {
|
|
68
|
+
page?: number;
|
|
69
|
+
limit?: number;
|
|
70
|
+
}): Promise<{
|
|
71
|
+
data: Array<Record<string, unknown>>;
|
|
72
|
+
meta: {
|
|
73
|
+
total: number;
|
|
74
|
+
page: number;
|
|
75
|
+
limit: number;
|
|
76
|
+
};
|
|
77
|
+
ratingAvg: number;
|
|
78
|
+
ratingCount: number;
|
|
79
|
+
}>;
|
|
80
|
+
upsertReview(options: {
|
|
81
|
+
templateId: string;
|
|
82
|
+
storeId: string;
|
|
83
|
+
rating: number;
|
|
84
|
+
body?: string | null;
|
|
85
|
+
}): Promise<{
|
|
86
|
+
review: Record<string, unknown>;
|
|
87
|
+
ratingAvg: number;
|
|
88
|
+
ratingCount: number;
|
|
89
|
+
}>;
|
|
90
|
+
earnings(): Promise<{
|
|
91
|
+
totalSales: number;
|
|
92
|
+
totalAuthorAmount: number;
|
|
93
|
+
totalPlatformAmount: number;
|
|
94
|
+
byTemplate: Array<{
|
|
95
|
+
storeTemplateId: string;
|
|
96
|
+
title: string;
|
|
97
|
+
sales: number;
|
|
98
|
+
authorAmount: number;
|
|
99
|
+
platformAmount: number;
|
|
100
|
+
}>;
|
|
39
101
|
}>;
|
|
40
102
|
/** GET locales bundle (`defaultLocale`, `locales`, `messages`). */
|
|
41
103
|
listLocales(templateId: string): Promise<StoreTemplateLocalesBundle>;
|