@lasterp/shared 1.0.0-beta.21 → 1.0.0-beta.23
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/index.cjs +44 -22
- package/dist/index.d.cts +37 -26
- package/dist/index.d.ts +37 -26
- package/dist/index.js +14 -13
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -5,38 +5,59 @@ var __defProp = Object.defineProperty;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
function __accessProp(key) {
|
|
9
|
+
return this[key];
|
|
10
|
+
}
|
|
11
|
+
var __toESMCache_node;
|
|
12
|
+
var __toESMCache_esm;
|
|
8
13
|
var __toESM = (mod, isNodeMode, target) => {
|
|
14
|
+
var canCache = mod != null && typeof mod === "object";
|
|
15
|
+
if (canCache) {
|
|
16
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
17
|
+
var cached = cache.get(mod);
|
|
18
|
+
if (cached)
|
|
19
|
+
return cached;
|
|
20
|
+
}
|
|
9
21
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
22
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
23
|
for (let key of __getOwnPropNames(mod))
|
|
12
24
|
if (!__hasOwnProp.call(to, key))
|
|
13
25
|
__defProp(to, key, {
|
|
14
|
-
get: (
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
15
27
|
enumerable: true
|
|
16
28
|
});
|
|
29
|
+
if (canCache)
|
|
30
|
+
cache.set(mod, to);
|
|
17
31
|
return to;
|
|
18
32
|
};
|
|
19
|
-
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
20
33
|
var __toCommonJS = (from) => {
|
|
21
|
-
var entry = __moduleCache.get(from), desc;
|
|
34
|
+
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
22
35
|
if (entry)
|
|
23
36
|
return entry;
|
|
24
37
|
entry = __defProp({}, "__esModule", { value: true });
|
|
25
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
39
|
+
for (var key of __getOwnPropNames(from))
|
|
40
|
+
if (!__hasOwnProp.call(entry, key))
|
|
41
|
+
__defProp(entry, key, {
|
|
42
|
+
get: __accessProp.bind(from, key),
|
|
43
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
44
|
+
});
|
|
45
|
+
}
|
|
30
46
|
__moduleCache.set(from, entry);
|
|
31
47
|
return entry;
|
|
32
48
|
};
|
|
49
|
+
var __moduleCache;
|
|
50
|
+
var __returnValue = (v) => v;
|
|
51
|
+
function __exportSetter(name, newValue) {
|
|
52
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
53
|
+
}
|
|
33
54
|
var __export = (target, all) => {
|
|
34
55
|
for (var name in all)
|
|
35
56
|
__defProp(target, name, {
|
|
36
57
|
get: all[name],
|
|
37
58
|
enumerable: true,
|
|
38
59
|
configurable: true,
|
|
39
|
-
set: (
|
|
60
|
+
set: __exportSetter.bind(all, name)
|
|
40
61
|
});
|
|
41
62
|
};
|
|
42
63
|
|
|
@@ -73,23 +94,23 @@ __export(exports_src, {
|
|
|
73
94
|
camelizeKeys: () => import_humps.camelizeKeys,
|
|
74
95
|
camelize: () => import_humps.camelize,
|
|
75
96
|
LocaleProvider: () => LocaleProvider,
|
|
97
|
+
ItemAttrs: () => ItemAttrs,
|
|
76
98
|
FrappeProvider: () => FrappeProvider,
|
|
77
|
-
FrappeContext: () => FrappeContext
|
|
78
|
-
ATTRIBUTES: () => ATTRIBUTES
|
|
99
|
+
FrappeContext: () => FrappeContext
|
|
79
100
|
});
|
|
80
101
|
module.exports = __toCommonJS(exports_src);
|
|
81
102
|
// src/catalog/schema.ts
|
|
82
103
|
var import_zod = require("zod");
|
|
83
|
-
var
|
|
104
|
+
var ItemAttrs = ["Colour", "Storage", "Memory", "Screen"];
|
|
84
105
|
var colourFormSchema = import_zod.z.object({
|
|
85
106
|
color: import_zod.z.string().min(1, "Color is required"),
|
|
86
107
|
color_hex: import_zod.z.string().optional(),
|
|
87
108
|
color_system: import_zod.z.string().optional(),
|
|
88
109
|
color_system_hex: import_zod.z.string().optional(),
|
|
89
|
-
images: import_zod.z.array(import_zod.z.string()).default([])
|
|
110
|
+
images: import_zod.z.array(import_zod.z.string()).default([]).optional()
|
|
90
111
|
});
|
|
91
112
|
var screenFormSchema = import_zod.z.object({
|
|
92
|
-
screen: import_zod.z.
|
|
113
|
+
screen: import_zod.z.number().positive("Screen is required"),
|
|
93
114
|
height: import_zod.z.number().positive().optional(),
|
|
94
115
|
width: import_zod.z.number().positive().optional(),
|
|
95
116
|
weight: import_zod.z.number().positive().optional()
|
|
@@ -97,20 +118,21 @@ var screenFormSchema = import_zod.z.object({
|
|
|
97
118
|
var modelFormSchema = import_zod.z.object({
|
|
98
119
|
model: import_zod.z.string().min(1, "Model is required"),
|
|
99
120
|
sim_card_type: import_zod.z.string().optional(),
|
|
100
|
-
connectivity: import_zod.z.
|
|
121
|
+
connectivity: import_zod.z.string().optional()
|
|
101
122
|
});
|
|
102
123
|
var itemFormSchema = import_zod.z.object({
|
|
124
|
+
image: import_zod.z.string().optional(),
|
|
103
125
|
item_code: import_zod.z.string().min(1, "Item is required"),
|
|
104
126
|
item_group: import_zod.z.string().optional(),
|
|
105
127
|
brand: import_zod.z.string().optional(),
|
|
106
128
|
os: import_zod.z.string().optional(),
|
|
107
|
-
release_year: import_zod.z.
|
|
108
|
-
attributes: import_zod.z.array(import_zod.z.enum(
|
|
109
|
-
|
|
110
|
-
storages: import_zod.z.array(import_zod.z.string()),
|
|
111
|
-
memories: import_zod.z.array(import_zod.z.string()),
|
|
112
|
-
screens: import_zod.z.array(screenFormSchema),
|
|
113
|
-
models: import_zod.z.array(modelFormSchema),
|
|
129
|
+
release_year: import_zod.z.string().optional(),
|
|
130
|
+
attributes: import_zod.z.array(import_zod.z.enum(ItemAttrs)).default([]).optional(),
|
|
131
|
+
colors: import_zod.z.array(colourFormSchema).default([]).optional(),
|
|
132
|
+
storages: import_zod.z.array(import_zod.z.string()).default([]).optional(),
|
|
133
|
+
memories: import_zod.z.array(import_zod.z.string()).default([]).optional(),
|
|
134
|
+
screens: import_zod.z.array(screenFormSchema).default([]).optional(),
|
|
135
|
+
models: import_zod.z.array(modelFormSchema).default([]).optional(),
|
|
114
136
|
width: import_zod.z.number().positive().optional(),
|
|
115
137
|
height: import_zod.z.number().positive().optional(),
|
|
116
138
|
weight: import_zod.z.number().positive().optional()
|
package/dist/index.d.cts
CHANGED
|
@@ -7,24 +7,34 @@ interface Item {
|
|
|
7
7
|
brand: string;
|
|
8
8
|
os: string;
|
|
9
9
|
release_year: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
memories: string[];
|
|
10
|
+
attributes: Attribute[];
|
|
11
|
+
storages: Storage[];
|
|
12
|
+
memories: Memory2[];
|
|
14
13
|
colors: Colour2[];
|
|
15
14
|
screens: ScreenSpec[];
|
|
15
|
+
models: Model[];
|
|
16
16
|
images: Image[];
|
|
17
17
|
height: number;
|
|
18
18
|
width: number;
|
|
19
19
|
weight: number;
|
|
20
20
|
}
|
|
21
|
+
interface Attribute {
|
|
22
|
+
attribute: string;
|
|
23
|
+
}
|
|
24
|
+
interface Storgae {
|
|
25
|
+
storage: string;
|
|
26
|
+
}
|
|
27
|
+
interface Memory2 {
|
|
28
|
+
memory: string;
|
|
29
|
+
}
|
|
21
30
|
interface Colour2 {
|
|
22
31
|
color: string;
|
|
23
|
-
|
|
32
|
+
color_hex: string;
|
|
24
33
|
color_system: string;
|
|
34
|
+
color_system_hex: string;
|
|
25
35
|
}
|
|
26
36
|
interface Model {
|
|
27
|
-
|
|
37
|
+
model: string;
|
|
28
38
|
sim_card_type: string;
|
|
29
39
|
connectivity: string;
|
|
30
40
|
}
|
|
@@ -39,16 +49,16 @@ interface Image {
|
|
|
39
49
|
color: string;
|
|
40
50
|
}
|
|
41
51
|
import { z } from "zod";
|
|
42
|
-
declare const
|
|
52
|
+
declare const ItemAttrs: readonly ["Colour", "Storage", "Memory", "Screen"];
|
|
43
53
|
declare const colourFormSchema: z.ZodObject<{
|
|
44
54
|
color: z.ZodString;
|
|
45
55
|
color_hex: z.ZodOptional<z.ZodString>;
|
|
46
56
|
color_system: z.ZodOptional<z.ZodString>;
|
|
47
57
|
color_system_hex: z.ZodOptional<z.ZodString>;
|
|
48
|
-
images: z.ZodDefault<z.ZodArray<z.ZodString
|
|
49
|
-
}
|
|
58
|
+
images: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
59
|
+
}>;
|
|
50
60
|
declare const screenFormSchema: z.ZodObject<{
|
|
51
|
-
screen: z.
|
|
61
|
+
screen: z.ZodNumber;
|
|
52
62
|
height: z.ZodOptional<z.ZodNumber>;
|
|
53
63
|
width: z.ZodOptional<z.ZodNumber>;
|
|
54
64
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
@@ -56,40 +66,41 @@ declare const screenFormSchema: z.ZodObject<{
|
|
|
56
66
|
declare const modelFormSchema: z.ZodObject<{
|
|
57
67
|
model: z.ZodString;
|
|
58
68
|
sim_card_type: z.ZodOptional<z.ZodString>;
|
|
59
|
-
connectivity: z.
|
|
69
|
+
connectivity: z.ZodOptional<z.ZodString>;
|
|
60
70
|
}>;
|
|
61
71
|
declare const itemFormSchema: z.ZodObject<{
|
|
72
|
+
image: z.ZodOptional<z.ZodString>;
|
|
62
73
|
item_code: z.ZodString;
|
|
63
74
|
item_group: z.ZodOptional<z.ZodString>;
|
|
64
75
|
brand: z.ZodOptional<z.ZodString>;
|
|
65
76
|
os: z.ZodOptional<z.ZodString>;
|
|
66
|
-
release_year: z.ZodOptional<z.
|
|
67
|
-
attributes: z.ZodArray<z.ZodEnum<{
|
|
77
|
+
release_year: z.ZodOptional<z.ZodString>;
|
|
78
|
+
attributes: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
68
79
|
Colour: "Colour";
|
|
69
80
|
Storage: "Storage";
|
|
70
81
|
Memory: "Memory";
|
|
71
82
|
Screen: "Screen";
|
|
72
|
-
}
|
|
73
|
-
|
|
83
|
+
}>>>>;
|
|
84
|
+
colors: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
74
85
|
color: z.ZodString;
|
|
75
86
|
color_hex: z.ZodOptional<z.ZodString>;
|
|
76
87
|
color_system: z.ZodOptional<z.ZodString>;
|
|
77
88
|
color_system_hex: z.ZodOptional<z.ZodString>;
|
|
78
|
-
images: z.ZodDefault<z.ZodArray<z.ZodString
|
|
79
|
-
}, z.core.$strip
|
|
80
|
-
storages: z.ZodArray<z.ZodString
|
|
81
|
-
memories: z.ZodArray<z.ZodString
|
|
82
|
-
screens: z.ZodArray<z.ZodObject<{
|
|
83
|
-
screen: z.
|
|
89
|
+
images: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
90
|
+
}, z.core.$strip>>>>;
|
|
91
|
+
storages: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
92
|
+
memories: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
93
|
+
screens: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
94
|
+
screen: z.ZodNumber;
|
|
84
95
|
height: z.ZodOptional<z.ZodNumber>;
|
|
85
96
|
width: z.ZodOptional<z.ZodNumber>;
|
|
86
97
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
87
|
-
}, z.core.$strip
|
|
88
|
-
models: z.ZodArray<z.ZodObject<{
|
|
98
|
+
}, z.core.$strip>>>>;
|
|
99
|
+
models: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
89
100
|
model: z.ZodString;
|
|
90
101
|
sim_card_type: z.ZodOptional<z.ZodString>;
|
|
91
|
-
connectivity: z.
|
|
92
|
-
}, z.core.$strip
|
|
102
|
+
connectivity: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, z.core.$strip>>>>;
|
|
93
104
|
width: z.ZodOptional<z.ZodNumber>;
|
|
94
105
|
height: z.ZodOptional<z.ZodNumber>;
|
|
95
106
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
@@ -771,4 +782,4 @@ interface ProductContext {
|
|
|
771
782
|
}
|
|
772
783
|
import { camelize, decamelize, camelizeKeys, decamelizeKeys } from "humps";
|
|
773
784
|
declare function equalsIgnoreCase(str1: string, str2: string): boolean;
|
|
774
|
-
export { useVariantSelector, useSearch, useLocale, useFrappeUpdateDoc, useFrappePutCall, useFrappePrefetchDoc, useFrappePostCall, useFrappeGetMeta, useFrappeGetDocList, useFrappeGetDocCount, useFrappeGetDoc, useFrappeGetCall, useFrappeFileUpload, useFrappeEventListener, useFrappeDocumentEventListener, useFrappeDocTypeEventListener, useFrappeDeleteDoc, useFrappeDeleteCall, useFrappeCreateDoc, useFrappeAuth, screenFormSchema, modelFormSchema, itemFormSchema, equalsIgnoreCase, decamelizeKeys, decamelize, colourFormSchema, camelizeKeys, camelize, WorkspaceSidebarItem, WorkspaceSidebar, ViewerEventData, VariantSelectorResult, VariantSelectorProps, VariantSelectorOption, UseFrappeFileUploadReturnType, TopbarItem, Topbar, TokenParams, ShopContext, SearchResult, ScreenSpec, ScreenForm, ProductVariant, ProductContext, Product, Page, NavbarSubItemGroup, NavbarSubItem, NavbarItem, ModelForm, Model, LocaleProvider, ItemForm, Item, Image, Hero, Header, Globals, FrappeResult, FrappeProviderProps, FrappeProvider, FrappeMutationResult, FrappeMetaField, FrappeMeta, FrappeFileUploadResponse, FrappeError, FrappeContext, FrappeConfig, FooterItemGroup, FooterItem, Footer, DocumentUpdateEventData, DocTypeListUpdateEventData, ColourForm, Colour2 as Colour, Category, Brand, Block,
|
|
785
|
+
export { useVariantSelector, useSearch, useLocale, useFrappeUpdateDoc, useFrappePutCall, useFrappePrefetchDoc, useFrappePostCall, useFrappeGetMeta, useFrappeGetDocList, useFrappeGetDocCount, useFrappeGetDoc, useFrappeGetCall, useFrappeFileUpload, useFrappeEventListener, useFrappeDocumentEventListener, useFrappeDocTypeEventListener, useFrappeDeleteDoc, useFrappeDeleteCall, useFrappeCreateDoc, useFrappeAuth, screenFormSchema, modelFormSchema, itemFormSchema, equalsIgnoreCase, decamelizeKeys, decamelize, colourFormSchema, camelizeKeys, camelize, WorkspaceSidebarItem, WorkspaceSidebar, ViewerEventData, VariantSelectorResult, VariantSelectorProps, VariantSelectorOption, UseFrappeFileUploadReturnType, TopbarItem, Topbar, TokenParams, Storgae, ShopContext, SearchResult, ScreenSpec, ScreenForm, ProductVariant, ProductContext, Product, Page, NavbarSubItemGroup, NavbarSubItem, NavbarItem, ModelForm, Model, Memory2 as Memory, LocaleProvider, ItemForm, ItemAttrs, Item, Image, Hero, Header, Globals, FrappeResult, FrappeProviderProps, FrappeProvider, FrappeMutationResult, FrappeMetaField, FrappeMeta, FrappeFileUploadResponse, FrappeError, FrappeContext, FrappeConfig, FooterItemGroup, FooterItem, Footer, DocumentUpdateEventData, DocTypeListUpdateEventData, ColourForm, Colour2 as Colour, Category, Brand, Block, Attribute };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,24 +7,34 @@ interface Item {
|
|
|
7
7
|
brand: string;
|
|
8
8
|
os: string;
|
|
9
9
|
release_year: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
memories: string[];
|
|
10
|
+
attributes: Attribute[];
|
|
11
|
+
storages: Storage[];
|
|
12
|
+
memories: Memory2[];
|
|
14
13
|
colors: Colour2[];
|
|
15
14
|
screens: ScreenSpec[];
|
|
15
|
+
models: Model[];
|
|
16
16
|
images: Image[];
|
|
17
17
|
height: number;
|
|
18
18
|
width: number;
|
|
19
19
|
weight: number;
|
|
20
20
|
}
|
|
21
|
+
interface Attribute {
|
|
22
|
+
attribute: string;
|
|
23
|
+
}
|
|
24
|
+
interface Storgae {
|
|
25
|
+
storage: string;
|
|
26
|
+
}
|
|
27
|
+
interface Memory2 {
|
|
28
|
+
memory: string;
|
|
29
|
+
}
|
|
21
30
|
interface Colour2 {
|
|
22
31
|
color: string;
|
|
23
|
-
|
|
32
|
+
color_hex: string;
|
|
24
33
|
color_system: string;
|
|
34
|
+
color_system_hex: string;
|
|
25
35
|
}
|
|
26
36
|
interface Model {
|
|
27
|
-
|
|
37
|
+
model: string;
|
|
28
38
|
sim_card_type: string;
|
|
29
39
|
connectivity: string;
|
|
30
40
|
}
|
|
@@ -39,16 +49,16 @@ interface Image {
|
|
|
39
49
|
color: string;
|
|
40
50
|
}
|
|
41
51
|
import { z } from "zod";
|
|
42
|
-
declare const
|
|
52
|
+
declare const ItemAttrs: readonly ["Colour", "Storage", "Memory", "Screen"];
|
|
43
53
|
declare const colourFormSchema: z.ZodObject<{
|
|
44
54
|
color: z.ZodString;
|
|
45
55
|
color_hex: z.ZodOptional<z.ZodString>;
|
|
46
56
|
color_system: z.ZodOptional<z.ZodString>;
|
|
47
57
|
color_system_hex: z.ZodOptional<z.ZodString>;
|
|
48
|
-
images: z.ZodDefault<z.ZodArray<z.ZodString
|
|
49
|
-
}
|
|
58
|
+
images: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
59
|
+
}>;
|
|
50
60
|
declare const screenFormSchema: z.ZodObject<{
|
|
51
|
-
screen: z.
|
|
61
|
+
screen: z.ZodNumber;
|
|
52
62
|
height: z.ZodOptional<z.ZodNumber>;
|
|
53
63
|
width: z.ZodOptional<z.ZodNumber>;
|
|
54
64
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
@@ -56,40 +66,41 @@ declare const screenFormSchema: z.ZodObject<{
|
|
|
56
66
|
declare const modelFormSchema: z.ZodObject<{
|
|
57
67
|
model: z.ZodString;
|
|
58
68
|
sim_card_type: z.ZodOptional<z.ZodString>;
|
|
59
|
-
connectivity: z.
|
|
69
|
+
connectivity: z.ZodOptional<z.ZodString>;
|
|
60
70
|
}>;
|
|
61
71
|
declare const itemFormSchema: z.ZodObject<{
|
|
72
|
+
image: z.ZodOptional<z.ZodString>;
|
|
62
73
|
item_code: z.ZodString;
|
|
63
74
|
item_group: z.ZodOptional<z.ZodString>;
|
|
64
75
|
brand: z.ZodOptional<z.ZodString>;
|
|
65
76
|
os: z.ZodOptional<z.ZodString>;
|
|
66
|
-
release_year: z.ZodOptional<z.
|
|
67
|
-
attributes: z.ZodArray<z.ZodEnum<{
|
|
77
|
+
release_year: z.ZodOptional<z.ZodString>;
|
|
78
|
+
attributes: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
68
79
|
Colour: "Colour";
|
|
69
80
|
Storage: "Storage";
|
|
70
81
|
Memory: "Memory";
|
|
71
82
|
Screen: "Screen";
|
|
72
|
-
}
|
|
73
|
-
|
|
83
|
+
}>>>>;
|
|
84
|
+
colors: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
74
85
|
color: z.ZodString;
|
|
75
86
|
color_hex: z.ZodOptional<z.ZodString>;
|
|
76
87
|
color_system: z.ZodOptional<z.ZodString>;
|
|
77
88
|
color_system_hex: z.ZodOptional<z.ZodString>;
|
|
78
|
-
images: z.ZodDefault<z.ZodArray<z.ZodString
|
|
79
|
-
}, z.core.$strip
|
|
80
|
-
storages: z.ZodArray<z.ZodString
|
|
81
|
-
memories: z.ZodArray<z.ZodString
|
|
82
|
-
screens: z.ZodArray<z.ZodObject<{
|
|
83
|
-
screen: z.
|
|
89
|
+
images: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
90
|
+
}, z.core.$strip>>>>;
|
|
91
|
+
storages: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
92
|
+
memories: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
93
|
+
screens: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
94
|
+
screen: z.ZodNumber;
|
|
84
95
|
height: z.ZodOptional<z.ZodNumber>;
|
|
85
96
|
width: z.ZodOptional<z.ZodNumber>;
|
|
86
97
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
87
|
-
}, z.core.$strip
|
|
88
|
-
models: z.ZodArray<z.ZodObject<{
|
|
98
|
+
}, z.core.$strip>>>>;
|
|
99
|
+
models: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
89
100
|
model: z.ZodString;
|
|
90
101
|
sim_card_type: z.ZodOptional<z.ZodString>;
|
|
91
|
-
connectivity: z.
|
|
92
|
-
}, z.core.$strip
|
|
102
|
+
connectivity: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, z.core.$strip>>>>;
|
|
93
104
|
width: z.ZodOptional<z.ZodNumber>;
|
|
94
105
|
height: z.ZodOptional<z.ZodNumber>;
|
|
95
106
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
@@ -771,4 +782,4 @@ interface ProductContext {
|
|
|
771
782
|
}
|
|
772
783
|
import { camelize, decamelize, camelizeKeys, decamelizeKeys } from "humps";
|
|
773
784
|
declare function equalsIgnoreCase(str1: string, str2: string): boolean;
|
|
774
|
-
export { useVariantSelector, useSearch, useLocale, useFrappeUpdateDoc, useFrappePutCall, useFrappePrefetchDoc, useFrappePostCall, useFrappeGetMeta, useFrappeGetDocList, useFrappeGetDocCount, useFrappeGetDoc, useFrappeGetCall, useFrappeFileUpload, useFrappeEventListener, useFrappeDocumentEventListener, useFrappeDocTypeEventListener, useFrappeDeleteDoc, useFrappeDeleteCall, useFrappeCreateDoc, useFrappeAuth, screenFormSchema, modelFormSchema, itemFormSchema, equalsIgnoreCase, decamelizeKeys, decamelize, colourFormSchema, camelizeKeys, camelize, WorkspaceSidebarItem, WorkspaceSidebar, ViewerEventData, VariantSelectorResult, VariantSelectorProps, VariantSelectorOption, UseFrappeFileUploadReturnType, TopbarItem, Topbar, TokenParams, ShopContext, SearchResult, ScreenSpec, ScreenForm, ProductVariant, ProductContext, Product, Page, NavbarSubItemGroup, NavbarSubItem, NavbarItem, ModelForm, Model, LocaleProvider, ItemForm, Item, Image, Hero, Header, Globals, FrappeResult, FrappeProviderProps, FrappeProvider, FrappeMutationResult, FrappeMetaField, FrappeMeta, FrappeFileUploadResponse, FrappeError, FrappeContext, FrappeConfig, FooterItemGroup, FooterItem, Footer, DocumentUpdateEventData, DocTypeListUpdateEventData, ColourForm, Colour2 as Colour, Category, Brand, Block,
|
|
785
|
+
export { useVariantSelector, useSearch, useLocale, useFrappeUpdateDoc, useFrappePutCall, useFrappePrefetchDoc, useFrappePostCall, useFrappeGetMeta, useFrappeGetDocList, useFrappeGetDocCount, useFrappeGetDoc, useFrappeGetCall, useFrappeFileUpload, useFrappeEventListener, useFrappeDocumentEventListener, useFrappeDocTypeEventListener, useFrappeDeleteDoc, useFrappeDeleteCall, useFrappeCreateDoc, useFrappeAuth, screenFormSchema, modelFormSchema, itemFormSchema, equalsIgnoreCase, decamelizeKeys, decamelize, colourFormSchema, camelizeKeys, camelize, WorkspaceSidebarItem, WorkspaceSidebar, ViewerEventData, VariantSelectorResult, VariantSelectorProps, VariantSelectorOption, UseFrappeFileUploadReturnType, TopbarItem, Topbar, TokenParams, Storgae, ShopContext, SearchResult, ScreenSpec, ScreenForm, ProductVariant, ProductContext, Product, Page, NavbarSubItemGroup, NavbarSubItem, NavbarItem, ModelForm, Model, Memory2 as Memory, LocaleProvider, ItemForm, ItemAttrs, Item, Image, Hero, Header, Globals, FrappeResult, FrappeProviderProps, FrappeProvider, FrappeMutationResult, FrappeMetaField, FrappeMeta, FrappeFileUploadResponse, FrappeError, FrappeContext, FrappeConfig, FooterItemGroup, FooterItem, Footer, DocumentUpdateEventData, DocTypeListUpdateEventData, ColourForm, Colour2 as Colour, Category, Brand, Block, Attribute };
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
// src/catalog/schema.ts
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
var
|
|
4
|
+
var ItemAttrs = ["Colour", "Storage", "Memory", "Screen"];
|
|
5
5
|
var colourFormSchema = z.object({
|
|
6
6
|
color: z.string().min(1, "Color is required"),
|
|
7
7
|
color_hex: z.string().optional(),
|
|
8
8
|
color_system: z.string().optional(),
|
|
9
9
|
color_system_hex: z.string().optional(),
|
|
10
|
-
images: z.array(z.string()).default([])
|
|
10
|
+
images: z.array(z.string()).default([]).optional()
|
|
11
11
|
});
|
|
12
12
|
var screenFormSchema = z.object({
|
|
13
|
-
screen: z.
|
|
13
|
+
screen: z.number().positive("Screen is required"),
|
|
14
14
|
height: z.number().positive().optional(),
|
|
15
15
|
width: z.number().positive().optional(),
|
|
16
16
|
weight: z.number().positive().optional()
|
|
@@ -18,20 +18,21 @@ var screenFormSchema = z.object({
|
|
|
18
18
|
var modelFormSchema = z.object({
|
|
19
19
|
model: z.string().min(1, "Model is required"),
|
|
20
20
|
sim_card_type: z.string().optional(),
|
|
21
|
-
connectivity: z.
|
|
21
|
+
connectivity: z.string().optional()
|
|
22
22
|
});
|
|
23
23
|
var itemFormSchema = z.object({
|
|
24
|
+
image: z.string().optional(),
|
|
24
25
|
item_code: z.string().min(1, "Item is required"),
|
|
25
26
|
item_group: z.string().optional(),
|
|
26
27
|
brand: z.string().optional(),
|
|
27
28
|
os: z.string().optional(),
|
|
28
|
-
release_year: z.
|
|
29
|
-
attributes: z.array(z.enum(
|
|
30
|
-
|
|
31
|
-
storages: z.array(z.string()),
|
|
32
|
-
memories: z.array(z.string()),
|
|
33
|
-
screens: z.array(screenFormSchema),
|
|
34
|
-
models: z.array(modelFormSchema),
|
|
29
|
+
release_year: z.string().optional(),
|
|
30
|
+
attributes: z.array(z.enum(ItemAttrs)).default([]).optional(),
|
|
31
|
+
colors: z.array(colourFormSchema).default([]).optional(),
|
|
32
|
+
storages: z.array(z.string()).default([]).optional(),
|
|
33
|
+
memories: z.array(z.string()).default([]).optional(),
|
|
34
|
+
screens: z.array(screenFormSchema).default([]).optional(),
|
|
35
|
+
models: z.array(modelFormSchema).default([]).optional(),
|
|
35
36
|
width: z.number().positive().optional(),
|
|
36
37
|
height: z.number().positive().optional(),
|
|
37
38
|
weight: z.number().positive().optional()
|
|
@@ -726,7 +727,7 @@ export {
|
|
|
726
727
|
camelizeKeys,
|
|
727
728
|
camelize,
|
|
728
729
|
LocaleProvider,
|
|
730
|
+
ItemAttrs,
|
|
729
731
|
FrappeProvider,
|
|
730
|
-
FrappeContext
|
|
731
|
-
ATTRIBUTES
|
|
732
|
+
FrappeContext
|
|
732
733
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lasterp/shared",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.23",
|
|
4
4
|
"description": "Shared repo for webapp and native app",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"@tanstack/react-query": "^5.90.21",
|
|
24
24
|
"react": ">=18.0.0",
|
|
25
25
|
"react-dom": ">=18.0.0",
|
|
26
|
-
"typescript": ">=4.5.0"
|
|
26
|
+
"typescript": ">=4.5.0",
|
|
27
|
+
"zod": "^4.3.6"
|
|
27
28
|
},
|
|
28
29
|
"peerDependenciesMeta": {
|
|
29
30
|
"typescript": {
|