@quicktalog/common 1.23.0 → 1.26.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/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.js +2 -0
- package/dist/constants/pricing.d.ts +2 -0
- package/dist/drizzle/index.d.ts +1 -0
- package/dist/drizzle/index.js +1 -0
- package/dist/drizzle/migrations/relations.d.ts +30 -0
- package/dist/drizzle/migrations/relations.js +56 -0
- package/dist/drizzle/migrations/schema.d.ts +1286 -0
- package/dist/drizzle/migrations/schema.js +145 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/types/catalogue.d.ts +112 -0
- package/dist/types/enums.d.ts +10 -0
- package/dist/types/enums.js +1 -0
- package/dist/types/functions.d.ts +3 -0
- package/dist/types/functions.js +1 -0
- package/dist/types/general.d.ts +105 -0
- package/dist/types/general.js +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js +4 -0
- package/package.json +9 -2
- package/dist/pricing.d.ts +0 -2
- package/dist/types.d.ts +0 -150
- /package/dist/{constants.d.ts → constants/general.d.ts} +0 -0
- /package/dist/{constants.js → constants/general.js} +0 -0
- /package/dist/{pricing.js → constants/pricing.js} +0 -0
- /package/dist/{helpers.d.ts → helpers/index.d.ts} +0 -0
- /package/dist/{helpers.js → helpers/index.js} +0 -0
- /package/dist/{types.js → types/catalogue.js} +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { pgTable, foreignKey, uuid, timestamp, text, pgPolicy, jsonb, integer, unique, serial } from "drizzle-orm/pg-core";
|
|
2
|
+
import { sql } from "drizzle-orm";
|
|
3
|
+
export const prompts = pgTable("prompts", {
|
|
4
|
+
id: uuid().defaultRandom().primaryKey().notNull(),
|
|
5
|
+
datetime: timestamp({ withTimezone: true, mode: 'string' }).defaultNow().notNull(),
|
|
6
|
+
userId: text("user_id"),
|
|
7
|
+
catalogue: text().notNull(),
|
|
8
|
+
}, (table) => [
|
|
9
|
+
foreignKey({
|
|
10
|
+
columns: [table.catalogue],
|
|
11
|
+
foreignColumns: [catalogues.name],
|
|
12
|
+
name: "prompts_catalogue_fkey"
|
|
13
|
+
}).onUpdate("cascade").onDelete("cascade"),
|
|
14
|
+
foreignKey({
|
|
15
|
+
columns: [table.userId],
|
|
16
|
+
foreignColumns: [users.id],
|
|
17
|
+
name: "prompts_user_id_fkey"
|
|
18
|
+
}).onUpdate("cascade").onDelete("cascade"),
|
|
19
|
+
]);
|
|
20
|
+
export const users = pgTable("users", {
|
|
21
|
+
id: text().primaryKey().notNull(),
|
|
22
|
+
name: text(),
|
|
23
|
+
createdAt: timestamp("created_at", { withTimezone: true, mode: 'string' }).default(sql `CURRENT_TIMESTAMP`),
|
|
24
|
+
image: text().default('NULL'),
|
|
25
|
+
email: text(),
|
|
26
|
+
planId: text("plan_id"),
|
|
27
|
+
customerId: text("customer_id"),
|
|
28
|
+
cookiePreferences: jsonb("cookie_preferences"),
|
|
29
|
+
consents: jsonb().default({ "refund-policy": true, "privacy-policy": true, "terms-and-conditions": true }).notNull(),
|
|
30
|
+
}, (table) => [
|
|
31
|
+
pgPolicy("Enable read access for authenticated users to users", { as: "permissive", for: "select", to: ["authenticated"], using: sql `true` }),
|
|
32
|
+
]);
|
|
33
|
+
export const newsletter = pgTable("newsletter", {
|
|
34
|
+
id: uuid().defaultRandom().primaryKey().notNull(),
|
|
35
|
+
email: text().notNull(),
|
|
36
|
+
catalogueId: uuid("catalogue_id").notNull(),
|
|
37
|
+
ownerId: text("owner_id").notNull(),
|
|
38
|
+
}, (table) => [
|
|
39
|
+
foreignKey({
|
|
40
|
+
columns: [table.ownerId],
|
|
41
|
+
foreignColumns: [users.id],
|
|
42
|
+
name: "newsletter_owner_id_fkey"
|
|
43
|
+
}).onUpdate("cascade").onDelete("cascade"),
|
|
44
|
+
]);
|
|
45
|
+
export const ocr = pgTable("ocr", {
|
|
46
|
+
id: uuid().defaultRandom().primaryKey().notNull(),
|
|
47
|
+
datetime: timestamp({ withTimezone: true, mode: 'string' }).defaultNow().notNull(),
|
|
48
|
+
userId: text("user_id"),
|
|
49
|
+
catalogue: text().notNull(),
|
|
50
|
+
}, (table) => [
|
|
51
|
+
foreignKey({
|
|
52
|
+
columns: [table.catalogue],
|
|
53
|
+
foreignColumns: [catalogues.name],
|
|
54
|
+
name: "ocr_catalogue_fkey"
|
|
55
|
+
}).onUpdate("cascade").onDelete("cascade"),
|
|
56
|
+
foreignKey({
|
|
57
|
+
columns: [table.userId],
|
|
58
|
+
foreignColumns: [users.id],
|
|
59
|
+
name: "ocr_user_id_fkey"
|
|
60
|
+
}).onUpdate("cascade").onDelete("cascade"),
|
|
61
|
+
]);
|
|
62
|
+
export const subscriptions = pgTable("subscriptions", {
|
|
63
|
+
subscriptionId: text("subscription_id").primaryKey().notNull(),
|
|
64
|
+
subscriptionStatus: text("subscription_status").notNull(),
|
|
65
|
+
priceId: text("price_id"),
|
|
66
|
+
productId: text("product_id"),
|
|
67
|
+
scheduledChange: text("scheduled_change"),
|
|
68
|
+
customerId: text("customer_id").notNull(),
|
|
69
|
+
createdAt: timestamp("created_at", { withTimezone: true, mode: 'string' }).defaultNow().notNull(),
|
|
70
|
+
updatedAt: timestamp("updated_at", { withTimezone: true, mode: 'string' }).defaultNow().notNull(),
|
|
71
|
+
}, (table) => [
|
|
72
|
+
pgPolicy("Enable read access for authenticated users to subscriptions", { as: "permissive", for: "select", to: ["authenticated"], using: sql `true` }),
|
|
73
|
+
]);
|
|
74
|
+
export const productNewsletter = pgTable("product_newsletter", {
|
|
75
|
+
id: uuid().defaultRandom().notNull(),
|
|
76
|
+
email: text().notNull(),
|
|
77
|
+
});
|
|
78
|
+
export const jobLogs = pgTable("job_logs", {
|
|
79
|
+
jobName: text("job_name").notNull(),
|
|
80
|
+
status: text().notNull(),
|
|
81
|
+
executionTimeMs: integer("execution_time_ms"),
|
|
82
|
+
log: text(),
|
|
83
|
+
createdAt: timestamp("created_at", { withTimezone: true, mode: 'string' }).defaultNow(),
|
|
84
|
+
id: uuid().defaultRandom().primaryKey().notNull(),
|
|
85
|
+
});
|
|
86
|
+
export const analytics = pgTable("analytics", {
|
|
87
|
+
date: timestamp({ withTimezone: true, mode: 'string' }).defaultNow().notNull(),
|
|
88
|
+
currentUrl: text("current_url").notNull(),
|
|
89
|
+
pageviewCount: integer("pageview_count").notNull(),
|
|
90
|
+
uniqueVisitors: integer("unique_visitors"),
|
|
91
|
+
createdAt: timestamp("created_at", { withTimezone: true, mode: 'string' }).defaultNow(),
|
|
92
|
+
userId: text("user_id").notNull(),
|
|
93
|
+
id: uuid().defaultRandom().primaryKey().notNull(),
|
|
94
|
+
}, (table) => [
|
|
95
|
+
foreignKey({
|
|
96
|
+
columns: [table.userId],
|
|
97
|
+
foreignColumns: [users.id],
|
|
98
|
+
name: "analytics_user_id_fkey"
|
|
99
|
+
}),
|
|
100
|
+
unique("analytics_unique_entry").on(table.date, table.currentUrl),
|
|
101
|
+
]);
|
|
102
|
+
export const qrConfigs = pgTable("qr_configs", {
|
|
103
|
+
id: serial().primaryKey().notNull(),
|
|
104
|
+
catalogue: text().notNull(),
|
|
105
|
+
config: jsonb().notNull(),
|
|
106
|
+
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow(),
|
|
107
|
+
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow(),
|
|
108
|
+
}, (table) => [
|
|
109
|
+
foreignKey({
|
|
110
|
+
columns: [table.catalogue],
|
|
111
|
+
foreignColumns: [catalogues.name],
|
|
112
|
+
name: "qr_configs_catalogue_fkey"
|
|
113
|
+
}).onUpdate("cascade").onDelete("cascade"),
|
|
114
|
+
unique("qr_configs_catalogue_key").on(table.catalogue),
|
|
115
|
+
]);
|
|
116
|
+
export const catalogues = pgTable("catalogues", {
|
|
117
|
+
id: uuid().defaultRandom().primaryKey().notNull(),
|
|
118
|
+
name: text().notNull(),
|
|
119
|
+
logo: text(),
|
|
120
|
+
heading: text(),
|
|
121
|
+
description: text(),
|
|
122
|
+
status: text().default('draft').notNull(),
|
|
123
|
+
source: text().default('builder').notNull(),
|
|
124
|
+
language: text().default('en').notNull(),
|
|
125
|
+
currency: text().default('EUR').notNull(),
|
|
126
|
+
businessType: text("business_type"),
|
|
127
|
+
tags: text().array().default([""]),
|
|
128
|
+
content: jsonb().default([]).notNull(),
|
|
129
|
+
legal: jsonb().default({}).notNull(),
|
|
130
|
+
appearance: jsonb().default({}).notNull(),
|
|
131
|
+
contact: jsonb().default({}).notNull(),
|
|
132
|
+
header: jsonb().default({}).notNull(),
|
|
133
|
+
footer: jsonb().default({}).notNull(),
|
|
134
|
+
partners: jsonb().default([]).notNull(),
|
|
135
|
+
createdAt: timestamp("created_at", { withTimezone: true, mode: 'string' }).defaultNow().notNull(),
|
|
136
|
+
updatedAt: timestamp("updated_at", { withTimezone: true, mode: 'string' }).defaultNow().notNull(),
|
|
137
|
+
createdBy: text("created_by").notNull(),
|
|
138
|
+
}, (table) => [
|
|
139
|
+
foreignKey({
|
|
140
|
+
columns: [table.createdBy],
|
|
141
|
+
foreignColumns: [users.id],
|
|
142
|
+
name: "catalogues_created_by_fkey"
|
|
143
|
+
}).onUpdate("cascade").onDelete("cascade"),
|
|
144
|
+
unique("catalogues_name_key").on(table.name),
|
|
145
|
+
]);
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { catalogues } from "../drizzle";
|
|
2
|
+
import { type InferSelectModel } from "drizzle-orm";
|
|
3
|
+
import { AnimationLevel, ContentLayout, FontFamily, FontSize, ShadowLevel, Source, Status, ThemeType } from "./enums";
|
|
4
|
+
import { Update } from "./functions";
|
|
5
|
+
type RawCatalogue = InferSelectModel<typeof catalogues>;
|
|
6
|
+
export type Catalogue = Update<RawCatalogue, {
|
|
7
|
+
status: Status;
|
|
8
|
+
source: Source;
|
|
9
|
+
content: ContentBlock[];
|
|
10
|
+
legal: Legal;
|
|
11
|
+
appearance: Appearance;
|
|
12
|
+
contact: Contact;
|
|
13
|
+
header: Header;
|
|
14
|
+
footer: Footer;
|
|
15
|
+
partners: Partner[];
|
|
16
|
+
}>;
|
|
17
|
+
export interface BaseContentBlock {
|
|
18
|
+
id: string;
|
|
19
|
+
order: number;
|
|
20
|
+
}
|
|
21
|
+
export interface CategoryBlock extends BaseContentBlock {
|
|
22
|
+
type: "category";
|
|
23
|
+
name: string;
|
|
24
|
+
layout: ContentLayout;
|
|
25
|
+
items: Item[];
|
|
26
|
+
isExpanded: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface ContainerBlock extends BaseContentBlock {
|
|
29
|
+
type: "container";
|
|
30
|
+
name: string;
|
|
31
|
+
layout: ContentLayout;
|
|
32
|
+
items: Item[];
|
|
33
|
+
}
|
|
34
|
+
export interface IframeBlock extends BaseContentBlock {
|
|
35
|
+
type: "iframe";
|
|
36
|
+
heading?: string;
|
|
37
|
+
src: string;
|
|
38
|
+
}
|
|
39
|
+
export interface CustomCodeBlock extends BaseContentBlock {
|
|
40
|
+
type: "custom_code";
|
|
41
|
+
code: string;
|
|
42
|
+
}
|
|
43
|
+
export interface TextBlock extends BaseContentBlock {
|
|
44
|
+
type: "text";
|
|
45
|
+
content: string;
|
|
46
|
+
}
|
|
47
|
+
export type ContentBlock = CategoryBlock | ContainerBlock | IframeBlock | CustomCodeBlock | TextBlock;
|
|
48
|
+
export interface ItemDiscount {
|
|
49
|
+
isOnDiscount: boolean;
|
|
50
|
+
discountPercentage: number;
|
|
51
|
+
discountedPrice: number;
|
|
52
|
+
}
|
|
53
|
+
export interface Item {
|
|
54
|
+
id: string;
|
|
55
|
+
order: number;
|
|
56
|
+
name: string;
|
|
57
|
+
description: string;
|
|
58
|
+
image: string;
|
|
59
|
+
isFree?: boolean;
|
|
60
|
+
discount?: ItemDiscount;
|
|
61
|
+
price: number;
|
|
62
|
+
denominator?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface Legal {
|
|
65
|
+
legalName: string;
|
|
66
|
+
termsAndConditions: string;
|
|
67
|
+
privacyPolicy: string;
|
|
68
|
+
address: string;
|
|
69
|
+
}
|
|
70
|
+
export interface Appearance {
|
|
71
|
+
theme: {
|
|
72
|
+
type: ThemeType;
|
|
73
|
+
name: string;
|
|
74
|
+
};
|
|
75
|
+
style: {
|
|
76
|
+
contentFontSize: FontSize;
|
|
77
|
+
fontFamily: FontFamily;
|
|
78
|
+
borderRadius: number;
|
|
79
|
+
animation: AnimationLevel;
|
|
80
|
+
shadow: ShadowLevel;
|
|
81
|
+
};
|
|
82
|
+
overlay: {
|
|
83
|
+
isEnabled: boolean;
|
|
84
|
+
icon: string;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
export interface CTAButton {
|
|
88
|
+
isEnabled: boolean;
|
|
89
|
+
label: string;
|
|
90
|
+
url: string;
|
|
91
|
+
}
|
|
92
|
+
export interface Partner {
|
|
93
|
+
name: string;
|
|
94
|
+
url: string;
|
|
95
|
+
description: string;
|
|
96
|
+
}
|
|
97
|
+
export interface Footer {
|
|
98
|
+
cta: CTAButton;
|
|
99
|
+
newsletter: boolean;
|
|
100
|
+
showPartners: boolean;
|
|
101
|
+
}
|
|
102
|
+
export interface Header {
|
|
103
|
+
cta: CTAButton;
|
|
104
|
+
emailCta: boolean;
|
|
105
|
+
phoneCta: boolean;
|
|
106
|
+
}
|
|
107
|
+
export interface Contact {
|
|
108
|
+
phone: string;
|
|
109
|
+
email: string;
|
|
110
|
+
socials: string[];
|
|
111
|
+
}
|
|
112
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type LimitType = "ai" | "ocr" | "catalogue" | "traffic" | "items" | "categories" | "notFound";
|
|
2
|
+
export type Status = "active" | "inactive" | "draft" | "in preparation" | "error";
|
|
3
|
+
export type Source = "builder" | "ocr_import" | "ai_prompt";
|
|
4
|
+
export type ContentBlockType = "category" | "container" | "iframe" | "custom_code" | "text";
|
|
5
|
+
export type ThemeType = "standard" | "custom";
|
|
6
|
+
export type FontSize = "small" | "medium" | "large";
|
|
7
|
+
export type FontFamily = "mono" | "serif" | "arial" | "monospace";
|
|
8
|
+
export type AnimationLevel = "none" | "minimal" | "medium" | "full";
|
|
9
|
+
export type ShadowLevel = "none" | "low" | "medium" | "high";
|
|
10
|
+
export type ContentLayout = "variant_1" | "variant_2" | "variant_3" | "variant_4";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { users } from "../drizzle";
|
|
2
|
+
import { layouts, themes } from "../constants";
|
|
3
|
+
import { InferSelectModel, Update } from "drizzle-orm";
|
|
4
|
+
export type Usage = {
|
|
5
|
+
traffic: {
|
|
6
|
+
pageview_count: number;
|
|
7
|
+
unique_visitors: number;
|
|
8
|
+
};
|
|
9
|
+
ocr: number;
|
|
10
|
+
prompts: number;
|
|
11
|
+
catalogues: number;
|
|
12
|
+
};
|
|
13
|
+
export type UserData = User & {
|
|
14
|
+
usage: Usage;
|
|
15
|
+
currentPlan: PricingPlan;
|
|
16
|
+
nextPlan: PricingPlan;
|
|
17
|
+
};
|
|
18
|
+
export type PricingPlan = {
|
|
19
|
+
id: number;
|
|
20
|
+
name: string;
|
|
21
|
+
type: string;
|
|
22
|
+
priceId: {
|
|
23
|
+
month: string;
|
|
24
|
+
year: string;
|
|
25
|
+
};
|
|
26
|
+
description: string;
|
|
27
|
+
features: {
|
|
28
|
+
support: string;
|
|
29
|
+
catalogues: number;
|
|
30
|
+
newsletter: boolean;
|
|
31
|
+
custom_features: boolean;
|
|
32
|
+
ocr_ai_import: number;
|
|
33
|
+
traffic_limit: number;
|
|
34
|
+
branding: boolean;
|
|
35
|
+
analytics: string;
|
|
36
|
+
ai_prompts: number;
|
|
37
|
+
categories_per_catalogue?: number | "unlimited";
|
|
38
|
+
items_per_catalogue?: number | "unlimited";
|
|
39
|
+
};
|
|
40
|
+
billing_period?: "month" | "year";
|
|
41
|
+
};
|
|
42
|
+
type Item = {
|
|
43
|
+
key: string;
|
|
44
|
+
label: string;
|
|
45
|
+
image: string;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
export type Theme = Item;
|
|
49
|
+
export type Layout = Item;
|
|
50
|
+
export type ThemeVariant = (typeof themes)[number]["key"];
|
|
51
|
+
export type LayoutVariant = (typeof layouts)[number]["key"];
|
|
52
|
+
export type OverallAnalytics = {
|
|
53
|
+
totalPageViews: number;
|
|
54
|
+
totalUniqueVisitors: number;
|
|
55
|
+
totalServiceCatalogues: number;
|
|
56
|
+
totalNewsletterSubscriptions: number;
|
|
57
|
+
};
|
|
58
|
+
export type Analytics = {
|
|
59
|
+
date: string;
|
|
60
|
+
current_url: string;
|
|
61
|
+
pageview_count: number;
|
|
62
|
+
unique_visitors: number;
|
|
63
|
+
};
|
|
64
|
+
export type CookiePreferences = {
|
|
65
|
+
accepted: boolean;
|
|
66
|
+
essential: boolean;
|
|
67
|
+
analytics: boolean;
|
|
68
|
+
marketing: boolean;
|
|
69
|
+
timestamp: string;
|
|
70
|
+
version: string;
|
|
71
|
+
};
|
|
72
|
+
type RawUser = InferSelectModel<typeof users>;
|
|
73
|
+
export type User = Update<RawUser, {
|
|
74
|
+
cookiePreferences: CookiePreferences;
|
|
75
|
+
}>;
|
|
76
|
+
export type OCRImageData = {
|
|
77
|
+
id: string;
|
|
78
|
+
file: File;
|
|
79
|
+
originalUrl: string;
|
|
80
|
+
confidence?: number;
|
|
81
|
+
isProcessed: boolean;
|
|
82
|
+
};
|
|
83
|
+
export interface LanguageOption {
|
|
84
|
+
code: string;
|
|
85
|
+
name: string;
|
|
86
|
+
flag: string;
|
|
87
|
+
}
|
|
88
|
+
export type ContactData = {
|
|
89
|
+
message: string;
|
|
90
|
+
email: string;
|
|
91
|
+
name: string;
|
|
92
|
+
subject: string;
|
|
93
|
+
};
|
|
94
|
+
export type Currency = {
|
|
95
|
+
value: string;
|
|
96
|
+
label: string;
|
|
97
|
+
symbol: string;
|
|
98
|
+
locale: string;
|
|
99
|
+
};
|
|
100
|
+
export type AreLimitesReached = {
|
|
101
|
+
catalogues: boolean;
|
|
102
|
+
ocr: boolean;
|
|
103
|
+
prompts: boolean;
|
|
104
|
+
};
|
|
105
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quicktalog/common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -12,13 +12,20 @@
|
|
|
12
12
|
"prepare": "husky"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
+
"drizzle-kit": "^0.31.8",
|
|
15
16
|
"husky": "^9.1.7",
|
|
17
|
+
"tsx": "^4.21.0",
|
|
16
18
|
"typescript": "^5.1.6"
|
|
17
19
|
},
|
|
18
20
|
"dependencies": {
|
|
19
21
|
"@types/glob": "^8.0.0",
|
|
22
|
+
"@types/pg": "^8.16.0",
|
|
23
|
+
"dotenv": "^17.2.3",
|
|
24
|
+
"drizzle-orm": "^0.45.1",
|
|
20
25
|
"glob": "^8.1.0",
|
|
21
|
-
"minimatch": "^9.0.2"
|
|
26
|
+
"minimatch": "^9.0.2",
|
|
27
|
+
"pg": "^8.16.3",
|
|
28
|
+
"postgres": "^3.4.8"
|
|
22
29
|
},
|
|
23
30
|
"publishConfig": {
|
|
24
31
|
"access": "public",
|
package/dist/pricing.d.ts
DELETED
package/dist/types.d.ts
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { layouts, themes } from "./constants";
|
|
2
|
-
export type Status = "active" | "inactive" | "draft" | "in preparation" | "error";
|
|
3
|
-
export type CookiePreferences = {
|
|
4
|
-
accepted: boolean;
|
|
5
|
-
essential: boolean;
|
|
6
|
-
analytics: boolean;
|
|
7
|
-
marketing: boolean;
|
|
8
|
-
timestamp: string;
|
|
9
|
-
version: string;
|
|
10
|
-
};
|
|
11
|
-
export type CategoryItem = {
|
|
12
|
-
name: string;
|
|
13
|
-
description: string;
|
|
14
|
-
price: string;
|
|
15
|
-
image: string;
|
|
16
|
-
};
|
|
17
|
-
export type Theme = {
|
|
18
|
-
key: string;
|
|
19
|
-
label: string;
|
|
20
|
-
image: string;
|
|
21
|
-
description: string;
|
|
22
|
-
};
|
|
23
|
-
export type Layout = Theme;
|
|
24
|
-
export type ThemeVariant = (typeof themes)[number]["key"];
|
|
25
|
-
export type LayoutVariant = (typeof layouts)[number]["key"];
|
|
26
|
-
export type CatalogueCategory = {
|
|
27
|
-
order: number;
|
|
28
|
-
name: string;
|
|
29
|
-
layout: LayoutVariant;
|
|
30
|
-
items: CategoryItem[];
|
|
31
|
-
};
|
|
32
|
-
export type Catalogue = {
|
|
33
|
-
id?: string;
|
|
34
|
-
name: string;
|
|
35
|
-
status: Status;
|
|
36
|
-
created_by?: string;
|
|
37
|
-
theme: ThemeVariant;
|
|
38
|
-
logo?: string;
|
|
39
|
-
title: string;
|
|
40
|
-
currency: string;
|
|
41
|
-
contact?: ContactInfo[];
|
|
42
|
-
subtitle?: string;
|
|
43
|
-
services: CatalogueCategory[];
|
|
44
|
-
partners?: Partner[];
|
|
45
|
-
legal?: Legal;
|
|
46
|
-
configuration?: Configuration;
|
|
47
|
-
created_at?: string;
|
|
48
|
-
updated_at?: string;
|
|
49
|
-
source?: string;
|
|
50
|
-
};
|
|
51
|
-
export type CatalogueFormData = Omit<Catalogue, "id" | "created_by" | "">;
|
|
52
|
-
export type Legal = {
|
|
53
|
-
name?: string;
|
|
54
|
-
address?: string;
|
|
55
|
-
terms_and_conditions?: string;
|
|
56
|
-
privacy_policy?: string;
|
|
57
|
-
};
|
|
58
|
-
export type Partner = {
|
|
59
|
-
name: string;
|
|
60
|
-
logo: string;
|
|
61
|
-
description: string;
|
|
62
|
-
rating: number;
|
|
63
|
-
url?: string;
|
|
64
|
-
};
|
|
65
|
-
export type Configuration = {
|
|
66
|
-
ctaNavbar?: {
|
|
67
|
-
enabled: boolean;
|
|
68
|
-
label: string;
|
|
69
|
-
url: string;
|
|
70
|
-
};
|
|
71
|
-
ctaFooter?: {
|
|
72
|
-
enabled: boolean;
|
|
73
|
-
label: string;
|
|
74
|
-
url: string;
|
|
75
|
-
};
|
|
76
|
-
newsletter?: {
|
|
77
|
-
enabled: boolean;
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
export type Analytics = {
|
|
81
|
-
date: string;
|
|
82
|
-
current_url: string;
|
|
83
|
-
pageview_count: number;
|
|
84
|
-
unique_visitors: number;
|
|
85
|
-
};
|
|
86
|
-
export type User = {
|
|
87
|
-
id: string;
|
|
88
|
-
email: string | null;
|
|
89
|
-
name: string | null;
|
|
90
|
-
created_at: string;
|
|
91
|
-
image: string | null;
|
|
92
|
-
cookie_preferences?: CookiePreferences | null;
|
|
93
|
-
plan_id: string | null;
|
|
94
|
-
customer_id: string | null;
|
|
95
|
-
};
|
|
96
|
-
export type OCRImageData = {
|
|
97
|
-
id: string;
|
|
98
|
-
file: File;
|
|
99
|
-
originalUrl: string;
|
|
100
|
-
confidence?: number;
|
|
101
|
-
isProcessed: boolean;
|
|
102
|
-
};
|
|
103
|
-
export type ContactInfo = {
|
|
104
|
-
type: string;
|
|
105
|
-
value: string;
|
|
106
|
-
};
|
|
107
|
-
export type Usage = {
|
|
108
|
-
traffic: {
|
|
109
|
-
pageview_count: number;
|
|
110
|
-
unique_visitors: number;
|
|
111
|
-
};
|
|
112
|
-
ocr: number;
|
|
113
|
-
prompts: number;
|
|
114
|
-
catalogues: number;
|
|
115
|
-
};
|
|
116
|
-
export type UserData = User & {
|
|
117
|
-
usage: Usage;
|
|
118
|
-
currentPlan: PricingPlan;
|
|
119
|
-
nextPlan: PricingPlan;
|
|
120
|
-
};
|
|
121
|
-
export type PricingPlan = {
|
|
122
|
-
id: number;
|
|
123
|
-
name: string;
|
|
124
|
-
type: string;
|
|
125
|
-
priceId: {
|
|
126
|
-
month: string;
|
|
127
|
-
year: string;
|
|
128
|
-
};
|
|
129
|
-
description: string;
|
|
130
|
-
features: {
|
|
131
|
-
support: string;
|
|
132
|
-
catalogues: number;
|
|
133
|
-
newsletter: boolean;
|
|
134
|
-
custom_features: boolean;
|
|
135
|
-
ocr_ai_import: number;
|
|
136
|
-
traffic_limit: number;
|
|
137
|
-
branding: boolean;
|
|
138
|
-
analytics: string;
|
|
139
|
-
ai_prompts: number;
|
|
140
|
-
categories_per_catalogue?: number | "unlimited";
|
|
141
|
-
items_per_catalogue?: number | "unlimited";
|
|
142
|
-
};
|
|
143
|
-
billing_period?: "month" | "year";
|
|
144
|
-
};
|
|
145
|
-
export type ContactData = {
|
|
146
|
-
message: string;
|
|
147
|
-
email: string;
|
|
148
|
-
name: string;
|
|
149
|
-
subject: string;
|
|
150
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|