@lasterp/shared 1.0.0-beta.11 → 1.0.0-beta.13

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.d.cts CHANGED
@@ -1,28 +1,41 @@
1
1
  interface Item {
2
+ name: string;
2
3
  item_code: string;
3
- area: string;
4
- model: string;
5
- region: string;
6
- grade: string;
7
- grade_issuer: string;
8
- color: string;
9
- storage: string;
10
- memory: string;
11
- connectivity: string;
12
- carrier_compatibility: string;
4
+ item_name: string;
5
+ item_group: string;
6
+ brand: string;
7
+ os: string;
8
+ release_year: string;
9
+ description: string;
10
+ attributes: string[];
11
+ storages: string[];
12
+ memories: string[];
13
+ colors: Colour[];
14
+ screens: ScreenSpec[];
15
+ images: Image[];
16
+ height: number;
17
+ width: number;
18
+ weight: number;
13
19
  }
14
- interface ItemVariant extends Item {
15
- item_variant: string;
20
+ interface Colour {
21
+ color: string;
22
+ hex: string;
23
+ color_system: string;
16
24
  }
17
25
  interface Model {
18
26
  model_number: string;
19
27
  sim_card_type: string;
20
28
  connectivity: string;
21
29
  }
22
- interface Colour {
30
+ interface ScreenSpec {
31
+ screen: string;
32
+ height: number;
33
+ width: number;
34
+ weight: number;
35
+ }
36
+ interface Image {
37
+ image: string;
23
38
  color: string;
24
- hex: string;
25
- color_system: string;
26
39
  }
27
40
  interface Globals {
28
41
  header: Header;
@@ -140,6 +153,22 @@ interface TokenParams {
140
153
  /** Type of token to be used for authentication */
141
154
  type: "Bearer" | "token";
142
155
  }
156
+ interface FrappeMeta {
157
+ fields: FrappeMetaField[];
158
+ permissions: {
159
+ can_select: boolean;
160
+ can_read: boolean;
161
+ can_write: boolean;
162
+ can_create: boolean;
163
+ can_delete: boolean;
164
+ };
165
+ }
166
+ interface FrappeMetaField {
167
+ label: string;
168
+ fieldname: string;
169
+ read_only: boolean;
170
+ set_only_once: boolean;
171
+ }
143
172
  import { PropsWithChildren } from "react";
144
173
  type FrappeProviderProps = PropsWithChildren<{
145
174
  /** URL of the Frappe server
@@ -595,23 +624,7 @@ declare const useFrappeUpdateDoc: <T = any>() => {
595
624
  isCompleted: boolean;
596
625
  reset: () => void;
597
626
  };
598
- interface FrappeMeta {
599
- fields: FrappeMetaField[];
600
- permissions: {
601
- can_select: boolean;
602
- can_read: boolean;
603
- can_write: boolean;
604
- can_create: boolean;
605
- can_delete: boolean;
606
- };
607
- }
608
- interface FrappeMetaField {
609
- label: string;
610
- fieldname: string;
611
- read_only: boolean;
612
- set_only_once: boolean;
613
- }
614
- declare const useFrappeGetMeta: <FrappeMeta>(doctype: string, options?: {
627
+ declare const useFrappeGetMeta: (doctype: string, options?: {
615
628
  staleTime?: number;
616
629
  retry?: boolean | number;
617
630
  }) => {
@@ -668,7 +681,7 @@ interface Product {
668
681
  item_code: string;
669
682
  description: string;
670
683
  }
671
- interface ProductVariant extends ItemVariant {
684
+ interface ProductVariant {
672
685
  name: string;
673
686
  currency: string;
674
687
  rate: number;
@@ -692,4 +705,4 @@ interface ProductContext {
692
705
  }
693
706
  import { camelize, decamelize, camelizeKeys, decamelizeKeys } from "humps";
694
707
  declare function equalsIgnoreCase(str1: string, str2: string): boolean;
695
- export { useVariantSelector, useSearch, useLocale, useFrappeUpdateDoc, useFrappePutCall, useFrappePrefetchDoc, useFrappePostCall, useFrappeGetMeta, useFrappeGetDocList, useFrappeGetDocCount, useFrappeGetDoc, useFrappeGetCall, useFrappeFileUpload, useFrappeEventListener, useFrappeDocumentEventListener, useFrappeDocTypeEventListener, useFrappeDeleteDoc, useFrappeDeleteCall, useFrappeCreateDoc, useFrappeAuth, equalsIgnoreCase, decamelizeKeys, decamelize, camelizeKeys, camelize, WorkspaceSidebarItem, WorkspaceSidebar, ViewerEventData, VariantSelectorResult, VariantSelectorProps, VariantSelectorOption, UseFrappeFileUploadReturnType, TopbarItem, Topbar, TokenParams, ShopContext, SearchResult, ProductVariant, ProductContext, Product, Page, NavbarSubItemGroup, NavbarSubItem, NavbarItem, Model, LocaleProvider, ItemVariant, Item, Hero, Header, Globals, FrappeProviderProps, FrappeProvider, FrappeMutationResult, FrappeMetaField, FrappeMeta, FrappeFileUploadResponse, FrappeError, FrappeContext, FrappeConfig, FooterItemGroup, FooterItem, Footer, DocumentUpdateEventData, DocTypeListUpdateEventData, Colour, Category, Brand, Block };
708
+ export { useVariantSelector, useSearch, useLocale, useFrappeUpdateDoc, useFrappePutCall, useFrappePrefetchDoc, useFrappePostCall, useFrappeGetMeta, useFrappeGetDocList, useFrappeGetDocCount, useFrappeGetDoc, useFrappeGetCall, useFrappeFileUpload, useFrappeEventListener, useFrappeDocumentEventListener, useFrappeDocTypeEventListener, useFrappeDeleteDoc, useFrappeDeleteCall, useFrappeCreateDoc, useFrappeAuth, equalsIgnoreCase, decamelizeKeys, decamelize, camelizeKeys, camelize, WorkspaceSidebarItem, WorkspaceSidebar, ViewerEventData, VariantSelectorResult, VariantSelectorProps, VariantSelectorOption, UseFrappeFileUploadReturnType, TopbarItem, Topbar, TokenParams, ShopContext, SearchResult, ScreenSpec, ProductVariant, ProductContext, Product, Page, NavbarSubItemGroup, NavbarSubItem, NavbarItem, Model, LocaleProvider, Item, Image, Hero, Header, Globals, FrappeProviderProps, FrappeProvider, FrappeMutationResult, FrappeMetaField, FrappeMeta, FrappeFileUploadResponse, FrappeError, FrappeContext, FrappeConfig, FooterItemGroup, FooterItem, Footer, DocumentUpdateEventData, DocTypeListUpdateEventData, Colour, Category, Brand, Block };
package/dist/index.d.ts CHANGED
@@ -1,28 +1,41 @@
1
1
  interface Item {
2
+ name: string;
2
3
  item_code: string;
3
- area: string;
4
- model: string;
5
- region: string;
6
- grade: string;
7
- grade_issuer: string;
8
- color: string;
9
- storage: string;
10
- memory: string;
11
- connectivity: string;
12
- carrier_compatibility: string;
4
+ item_name: string;
5
+ item_group: string;
6
+ brand: string;
7
+ os: string;
8
+ release_year: string;
9
+ description: string;
10
+ attributes: string[];
11
+ storages: string[];
12
+ memories: string[];
13
+ colors: Colour[];
14
+ screens: ScreenSpec[];
15
+ images: Image[];
16
+ height: number;
17
+ width: number;
18
+ weight: number;
13
19
  }
14
- interface ItemVariant extends Item {
15
- item_variant: string;
20
+ interface Colour {
21
+ color: string;
22
+ hex: string;
23
+ color_system: string;
16
24
  }
17
25
  interface Model {
18
26
  model_number: string;
19
27
  sim_card_type: string;
20
28
  connectivity: string;
21
29
  }
22
- interface Colour {
30
+ interface ScreenSpec {
31
+ screen: string;
32
+ height: number;
33
+ width: number;
34
+ weight: number;
35
+ }
36
+ interface Image {
37
+ image: string;
23
38
  color: string;
24
- hex: string;
25
- color_system: string;
26
39
  }
27
40
  interface Globals {
28
41
  header: Header;
@@ -140,6 +153,22 @@ interface TokenParams {
140
153
  /** Type of token to be used for authentication */
141
154
  type: "Bearer" | "token";
142
155
  }
156
+ interface FrappeMeta {
157
+ fields: FrappeMetaField[];
158
+ permissions: {
159
+ can_select: boolean;
160
+ can_read: boolean;
161
+ can_write: boolean;
162
+ can_create: boolean;
163
+ can_delete: boolean;
164
+ };
165
+ }
166
+ interface FrappeMetaField {
167
+ label: string;
168
+ fieldname: string;
169
+ read_only: boolean;
170
+ set_only_once: boolean;
171
+ }
143
172
  import { PropsWithChildren } from "react";
144
173
  type FrappeProviderProps = PropsWithChildren<{
145
174
  /** URL of the Frappe server
@@ -595,23 +624,7 @@ declare const useFrappeUpdateDoc: <T = any>() => {
595
624
  isCompleted: boolean;
596
625
  reset: () => void;
597
626
  };
598
- interface FrappeMeta {
599
- fields: FrappeMetaField[];
600
- permissions: {
601
- can_select: boolean;
602
- can_read: boolean;
603
- can_write: boolean;
604
- can_create: boolean;
605
- can_delete: boolean;
606
- };
607
- }
608
- interface FrappeMetaField {
609
- label: string;
610
- fieldname: string;
611
- read_only: boolean;
612
- set_only_once: boolean;
613
- }
614
- declare const useFrappeGetMeta: <FrappeMeta>(doctype: string, options?: {
627
+ declare const useFrappeGetMeta: (doctype: string, options?: {
615
628
  staleTime?: number;
616
629
  retry?: boolean | number;
617
630
  }) => {
@@ -668,7 +681,7 @@ interface Product {
668
681
  item_code: string;
669
682
  description: string;
670
683
  }
671
- interface ProductVariant extends ItemVariant {
684
+ interface ProductVariant {
672
685
  name: string;
673
686
  currency: string;
674
687
  rate: number;
@@ -692,4 +705,4 @@ interface ProductContext {
692
705
  }
693
706
  import { camelize, decamelize, camelizeKeys, decamelizeKeys } from "humps";
694
707
  declare function equalsIgnoreCase(str1: string, str2: string): boolean;
695
- export { useVariantSelector, useSearch, useLocale, useFrappeUpdateDoc, useFrappePutCall, useFrappePrefetchDoc, useFrappePostCall, useFrappeGetMeta, useFrappeGetDocList, useFrappeGetDocCount, useFrappeGetDoc, useFrappeGetCall, useFrappeFileUpload, useFrappeEventListener, useFrappeDocumentEventListener, useFrappeDocTypeEventListener, useFrappeDeleteDoc, useFrappeDeleteCall, useFrappeCreateDoc, useFrappeAuth, equalsIgnoreCase, decamelizeKeys, decamelize, camelizeKeys, camelize, WorkspaceSidebarItem, WorkspaceSidebar, ViewerEventData, VariantSelectorResult, VariantSelectorProps, VariantSelectorOption, UseFrappeFileUploadReturnType, TopbarItem, Topbar, TokenParams, ShopContext, SearchResult, ProductVariant, ProductContext, Product, Page, NavbarSubItemGroup, NavbarSubItem, NavbarItem, Model, LocaleProvider, ItemVariant, Item, Hero, Header, Globals, FrappeProviderProps, FrappeProvider, FrappeMutationResult, FrappeMetaField, FrappeMeta, FrappeFileUploadResponse, FrappeError, FrappeContext, FrappeConfig, FooterItemGroup, FooterItem, Footer, DocumentUpdateEventData, DocTypeListUpdateEventData, Colour, Category, Brand, Block };
708
+ export { useVariantSelector, useSearch, useLocale, useFrappeUpdateDoc, useFrappePutCall, useFrappePrefetchDoc, useFrappePostCall, useFrappeGetMeta, useFrappeGetDocList, useFrappeGetDocCount, useFrappeGetDoc, useFrappeGetCall, useFrappeFileUpload, useFrappeEventListener, useFrappeDocumentEventListener, useFrappeDocTypeEventListener, useFrappeDeleteDoc, useFrappeDeleteCall, useFrappeCreateDoc, useFrappeAuth, equalsIgnoreCase, decamelizeKeys, decamelize, camelizeKeys, camelize, WorkspaceSidebarItem, WorkspaceSidebar, ViewerEventData, VariantSelectorResult, VariantSelectorProps, VariantSelectorOption, UseFrappeFileUploadReturnType, TopbarItem, Topbar, TokenParams, ShopContext, SearchResult, ScreenSpec, ProductVariant, ProductContext, Product, Page, NavbarSubItemGroup, NavbarSubItem, NavbarItem, Model, LocaleProvider, Item, Image, Hero, Header, Globals, FrappeProviderProps, FrappeProvider, FrappeMutationResult, FrappeMetaField, FrappeMeta, FrappeFileUploadResponse, FrappeError, FrappeContext, FrappeConfig, FooterItemGroup, FooterItem, Footer, DocumentUpdateEventData, DocTypeListUpdateEventData, Colour, Category, Brand, Block };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lasterp/shared",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.13",
4
4
  "description": "Shared repo for webapp and native app",
5
5
  "license": "MIT",
6
6
  "files": [