feeef 0.0.25 → 0.1.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.
Files changed (60) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +50 -2
  3. package/build/index.d.ts +1 -0
  4. package/build/index.js +632 -0
  5. package/build/index.js.map +1 -0
  6. package/build/src/core/embadded/address.d.ts +13 -0
  7. package/build/src/core/embadded/category.d.ts +7 -0
  8. package/build/src/core/embadded/contact.d.ts +22 -0
  9. package/build/src/core/entities/order.d.ts +76 -0
  10. package/build/src/core/entities/product.d.ts +71 -0
  11. package/build/src/core/entities/shipping_method.d.ts +29 -0
  12. package/build/src/core/entities/store.d.ts +125 -0
  13. package/build/src/core/entities/user.d.ts +28 -0
  14. package/build/src/feeef/feeef.d.ts +66 -0
  15. package/build/src/feeef/repositories/orders.d.ts +21 -0
  16. package/build/src/feeef/repositories/products.d.ts +15 -0
  17. package/build/src/feeef/repositories/repository.d.ts +112 -0
  18. package/build/src/feeef/repositories/stores.d.ts +21 -0
  19. package/build/src/feeef/repositories/users.d.ts +51 -0
  20. package/build/src/feeef/validators/auth.d.ts +76 -0
  21. package/build/src/feeef/validators/custom/datetime.d.ts +1 -0
  22. package/build/src/feeef/validators/helpers.d.ts +148 -0
  23. package/build/src/feeef/validators/order.d.ts +366 -0
  24. package/build/src/feeef/validators/product.d.ts +595 -0
  25. package/build/src/feeef/validators/shipping_method.d.ts +112 -0
  26. package/build/src/feeef/validators/stores.d.ts +590 -0
  27. package/build/src/feeef/validators/user_stores.d.ts +623 -0
  28. package/build/src/feeef/validators/users.d.ts +98 -0
  29. package/build/src/index.d.ts +10 -0
  30. package/package.json +116 -18
  31. package/.eslintrc.cjs +0 -19
  32. package/src/core/core.ts +0 -12
  33. package/src/core/embadded/address.ts +0 -13
  34. package/src/core/embadded/category.ts +0 -7
  35. package/src/core/embadded/contact.ts +0 -25
  36. package/src/core/entities/order.ts +0 -79
  37. package/src/core/entities/product.ts +0 -108
  38. package/src/core/entities/shipping_method.ts +0 -32
  39. package/src/core/entities/store.ts +0 -138
  40. package/src/core/entities/user.ts +0 -30
  41. package/src/feeef/feeef.ts +0 -110
  42. package/src/feeef/repositories/orders.ts +0 -37
  43. package/src/feeef/repositories/products.ts +0 -25
  44. package/src/feeef/repositories/repository.ts +0 -175
  45. package/src/feeef/repositories/stores.ts +0 -39
  46. package/src/feeef/repositories/users.ts +0 -92
  47. package/src/feeef/validators/auth.ts +0 -50
  48. package/src/feeef/validators/custom/datetime.ts +0 -9
  49. package/src/feeef/validators/helpers.ts +0 -69
  50. package/src/feeef/validators/order.ts +0 -89
  51. package/src/feeef/validators/product.ts +0 -95
  52. package/src/feeef/validators/shipping_method.ts +0 -44
  53. package/src/feeef/validators/stores.ts +0 -101
  54. package/src/feeef/validators/user_stores.ts +0 -85
  55. package/src/feeef/validators/users.ts +0 -69
  56. package/src/index.ts +0 -2
  57. package/src/vite-env.d.ts +0 -1
  58. package/tsconfig.json +0 -24
  59. package/tsconfig.node.json +0 -10
  60. package/vite.config.ts +0 -6
@@ -0,0 +1,112 @@
1
+ import { AxiosInstance } from 'axios';
2
+ /**
3
+ * Represents a generic model repository.
4
+ * @template T - The type of the model.
5
+ * @template C - The type of the create options.
6
+ * @template U - The type of the update options.
7
+ */
8
+ export declare abstract class ModelRepository<T, C, U> {
9
+ resource: string;
10
+ client: AxiosInstance;
11
+ /**
12
+ * Constructs a new instance of the ModelRepository class.
13
+ * @param resource - The resource name.
14
+ * @param client - The Axios instance used for making HTTP requests.
15
+ */
16
+ constructor(resource: string, client: AxiosInstance);
17
+ /**
18
+ * Finds a model by its ID or other criteria.
19
+ * @param options - The options for finding the model.
20
+ * @returns A promise that resolves to the found model.
21
+ */
22
+ find(options: ModelFindOptions): Promise<T>;
23
+ /**
24
+ * Lists models with optional pagination and filtering.
25
+ * @param options - The options for listing the models.
26
+ * @returns A promise that resolves to a list of models.
27
+ */
28
+ list(options?: ModelListOptions): Promise<ListResponse<T>>;
29
+ /**
30
+ * Creates a new model.
31
+ * @param options - The options for creating the model.
32
+ * @returns A promise that resolves to the created model.
33
+ */
34
+ create(options: ModelCreateOptions<C>): Promise<T>;
35
+ /**
36
+ * Updates an existing model.
37
+ * @param options - The options for updating the model.
38
+ * @returns A promise that resolves to the updated model.
39
+ */
40
+ update(options: ModelUpdateOptions<U>): Promise<T>;
41
+ /**
42
+ * Deletes a model by its ID or other criteria.
43
+ * @param options - The options for deleting the model.
44
+ * @returns A promise that resolves when the model is deleted.
45
+ */
46
+ delete(options: ModelFindOptions): Promise<void>;
47
+ }
48
+ /**
49
+ * Represents a list response containing an array of data of type T.
50
+ */
51
+ export interface ListResponse<T> {
52
+ data: T[];
53
+ total?: number;
54
+ page?: number;
55
+ limit?: number;
56
+ }
57
+ /**
58
+ * Represents the options for making a request.
59
+ */
60
+ interface RequestOptions {
61
+ params?: Record<string, any>;
62
+ }
63
+ export interface ModelFindOptions extends RequestOptions {
64
+ /**
65
+ * The ID of the model to find or the value to find by.
66
+ */
67
+ id: string;
68
+ /**
69
+ * The field to find by.
70
+ * @default "id" - The ID field.
71
+ */
72
+ by?: string;
73
+ }
74
+ /**
75
+ * Options for listing models.
76
+ */
77
+ export interface ModelListOptions extends RequestOptions {
78
+ /**
79
+ * The page number to retrieve.
80
+ */
81
+ page?: number;
82
+ /**
83
+ * The offset from the beginning of the list.
84
+ */
85
+ offset?: number;
86
+ /**
87
+ * The maximum number of models to retrieve per page.
88
+ */
89
+ limit?: number;
90
+ }
91
+ /**
92
+ * Represents the options for creating a model.
93
+ * @template T - The type of data being created.
94
+ */
95
+ export interface ModelCreateOptions<T> extends RequestOptions {
96
+ data: T;
97
+ }
98
+ /**
99
+ * Represents the options for updating a model.
100
+ * @template T - The type of the data being updated.
101
+ */
102
+ export interface ModelUpdateOptions<T> extends RequestOptions {
103
+ /**
104
+ * The ID of the model to update.
105
+ */
106
+ id: string;
107
+ /**
108
+ * The data to update the model with.
109
+ */
110
+ data: T;
111
+ }
112
+ export {};
@@ -0,0 +1,21 @@
1
+ import { InferInput } from '@vinejs/vine/types';
2
+ import { AxiosInstance } from 'axios';
3
+ import { CreateUserStoreSchema, UpdateUserStoreSchema } from '../validators/user_stores.js';
4
+ import { ModelRepository, ModelCreateOptions } from './repository.js';
5
+ import { StoreEntity } from '../../core/entities/store.js';
6
+ /**
7
+ * Repository for managing Store entities.
8
+ */
9
+ export declare class StoreRepository extends ModelRepository<StoreEntity, InferInput<typeof CreateUserStoreSchema>, InferInput<typeof UpdateUserStoreSchema>> {
10
+ /**
11
+ * Constructs a new StoreRepository instance.
12
+ * @param client The AxiosInstance used for making HTTP requests.
13
+ */
14
+ constructor(client: AxiosInstance);
15
+ /**
16
+ * Creates a new Store entity.
17
+ * @param options The options for creating the Store entity.
18
+ * @returns A Promise that resolves to the created Store entity.
19
+ */
20
+ create(options: ModelCreateOptions<InferInput<typeof CreateUserStoreSchema>>): Promise<StoreEntity>;
21
+ }
@@ -0,0 +1,51 @@
1
+ import { InferInput } from '@vinejs/vine/types';
2
+ import { AxiosInstance } from 'axios';
3
+ import { SigninSchema, AuthUpdateUserSchema } from '../validators/auth.js';
4
+ import { CreateUserSchema, UpdateUserSchema } from '../validators/users.js';
5
+ import { ModelRepository } from './repository.js';
6
+ import { AuthToken, UserEntity } from '../../core/entities/user.js';
7
+ /**
8
+ * Represents the response returned by the authentication process.
9
+ */
10
+ export interface AuthResponse {
11
+ token: AuthToken;
12
+ user: UserEntity;
13
+ }
14
+ /**
15
+ * Represents a repository for managing user data.
16
+ * Extends the ModelRepository class.
17
+ */
18
+ export declare class UserRepository extends ModelRepository<UserEntity, InferInput<typeof CreateUserSchema>, InferInput<typeof UpdateUserSchema>> {
19
+ /**
20
+ * Represents the authentication response.
21
+ */
22
+ auth: AuthResponse | null;
23
+ /**
24
+ * Constructs a new UserRepository instance.
25
+ * @param client - The AxiosInstance used for making HTTP requests.
26
+ */
27
+ constructor(client: AxiosInstance);
28
+ /**
29
+ * Signs in a user with the provided credentials.
30
+ * @param credentials - The user credentials.
31
+ * @returns A promise that resolves to the authentication response.
32
+ */
33
+ signin(credentials: InferInput<typeof SigninSchema>): Promise<AuthResponse>;
34
+ /**
35
+ * Signs up a new user with the provided credentials.
36
+ * @param credentials - The user credentials.
37
+ * @returns A promise that resolves to the authentication response.
38
+ */
39
+ signup(credentials: InferInput<typeof CreateUserSchema>): Promise<AuthResponse>;
40
+ /**
41
+ * Signs out the currently authenticated user.
42
+ * @returns A promise that resolves when the user is signed out.
43
+ */
44
+ signout(): Promise<void>;
45
+ /**
46
+ * Updates the authenticated user's data.
47
+ * @param data - The updated user data.
48
+ * @returns A promise that resolves to the updated user entity.
49
+ */
50
+ updateMe(data: InferInput<typeof AuthUpdateUserSchema>): Promise<UserEntity>;
51
+ }
@@ -0,0 +1,76 @@
1
+ export declare const PhoneShema: import("@vinejs/vine").VineString;
2
+ export declare const SignupSchema: import("@vinejs/vine").VineObject<{
3
+ name: import("@vinejs/vine").VineString;
4
+ email: import("@vinejs/vine").VineString;
5
+ phone: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
6
+ photoFile: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineAny>;
7
+ photoUrl: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
8
+ password: import("@vinejs/vine").VineString;
9
+ }, {
10
+ name: string;
11
+ email: string;
12
+ phone: string | null | undefined;
13
+ photoFile: any;
14
+ photoUrl: string | null | undefined;
15
+ password: string;
16
+ }, {
17
+ name: string;
18
+ email: string;
19
+ phone: string | undefined;
20
+ photoFile: any;
21
+ photoUrl: string | undefined;
22
+ password: string;
23
+ }, {
24
+ name: string;
25
+ email: string;
26
+ phone: string | undefined;
27
+ photoFile: any;
28
+ photoUrl: string | undefined;
29
+ password: string;
30
+ }>;
31
+ export declare const SigninSchema: import("@vinejs/vine").VineObject<{
32
+ email: import("@vinejs/vine").VineString;
33
+ password: import("@vinejs/vine").VineString;
34
+ }, {
35
+ email: string;
36
+ password: string;
37
+ }, {
38
+ email: string;
39
+ password: string;
40
+ }, {
41
+ email: string;
42
+ password: string;
43
+ }>;
44
+ export declare const AuthUpdateUserSchema: import("@vinejs/vine").VineObject<{
45
+ name: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
46
+ email: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
47
+ phone: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
48
+ photoFile: import("@vinejs/vine").VineAny;
49
+ photoUrl: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
50
+ oldPassword: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
51
+ newPassword: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
52
+ }, {
53
+ name: string | null | undefined;
54
+ email: string | null | undefined;
55
+ phone: string | null | undefined;
56
+ photoFile: any;
57
+ photoUrl: string | null | undefined;
58
+ oldPassword: string | null | undefined;
59
+ newPassword: string | null | undefined;
60
+ }, {
61
+ name: string | undefined;
62
+ email: string | undefined;
63
+ phone: string | undefined;
64
+ photoFile: any;
65
+ photoUrl: string | undefined;
66
+ oldPassword: string | undefined;
67
+ newPassword: string | undefined;
68
+ }, {
69
+ name: string | undefined;
70
+ email: string | undefined;
71
+ phone: string | undefined;
72
+ photoFile: any;
73
+ photoUrl: string | undefined;
74
+ oldPassword: string | undefined;
75
+ newPassword: string | undefined;
76
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,148 @@
1
+ export declare const AvatarFileSchema: import("@vinejs/vine").VineAny;
2
+ export declare const ImageFileSchema: import("@vinejs/vine").VineAny;
3
+ export declare const DomainSchema: import("@vinejs/vine").VineObject<{
4
+ name: import("@vinejs/vine").VineString;
5
+ verifiedAt: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineDate>;
6
+ metadata: import("@vinejs/vine/schema/base/main").OptionalModifier<import("@vinejs/vine").VineObject<{}, {}, {}, {}>>;
7
+ }, {
8
+ name: string;
9
+ verifiedAt: string | number | null | undefined;
10
+ metadata: {} | null | undefined;
11
+ }, {
12
+ name: string;
13
+ verifiedAt: Date | undefined;
14
+ metadata: {} | undefined;
15
+ }, {
16
+ name: string;
17
+ verifiedAt: Date | undefined;
18
+ metadata: {} | undefined;
19
+ }>;
20
+ export declare const StoreDecorationSchema: import("@vinejs/vine").VineObject<{
21
+ primary: import("@vinejs/vine").VineNumber;
22
+ onPrimary: import("@vinejs/vine").VineNumber;
23
+ showStoreLogoInHeader: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineBoolean>;
24
+ logoFullHeight: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineBoolean>;
25
+ showStoreNameInHeader: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineBoolean>;
26
+ metadata: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineAny>;
27
+ }, {
28
+ primary: string | number;
29
+ onPrimary: string | number;
30
+ showStoreLogoInHeader: string | number | boolean | null | undefined;
31
+ logoFullHeight: string | number | boolean | null | undefined;
32
+ showStoreNameInHeader: string | number | boolean | null | undefined;
33
+ metadata: any;
34
+ }, {
35
+ primary: number;
36
+ onPrimary: number;
37
+ showStoreLogoInHeader: boolean | undefined;
38
+ logoFullHeight: boolean | undefined;
39
+ showStoreNameInHeader: boolean | undefined;
40
+ metadata: any;
41
+ }, {
42
+ primary: number;
43
+ onPrimary: number;
44
+ showStoreLogoInHeader: boolean | undefined;
45
+ logoFullHeight: boolean | undefined;
46
+ showStoreNameInHeader: boolean | undefined;
47
+ metadata: any;
48
+ }>;
49
+ export declare const EmbaddedCategorySchema: import("@vinejs/vine").VineObject<{
50
+ name: import("@vinejs/vine").VineString;
51
+ description: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
52
+ photoUrl: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
53
+ ondarkPhotoUrl: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
54
+ photoFile: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineAny>;
55
+ ondarkPhotoFile: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineAny>;
56
+ metadata: import("@vinejs/vine/schema/base/main").OptionalModifier<import("@vinejs/vine").VineObject<{}, {}, {}, {}>>;
57
+ }, {
58
+ name: string;
59
+ description: string | null | undefined;
60
+ photoUrl: string | null | undefined;
61
+ ondarkPhotoUrl: string | null | undefined;
62
+ photoFile: any;
63
+ ondarkPhotoFile: any;
64
+ metadata: {} | null | undefined;
65
+ }, {
66
+ name: string;
67
+ description: string | undefined;
68
+ photoUrl: string | undefined;
69
+ ondarkPhotoUrl: string | undefined;
70
+ photoFile: any;
71
+ ondarkPhotoFile: any;
72
+ metadata: {} | undefined;
73
+ }, {
74
+ name: string;
75
+ description: string | undefined;
76
+ photoUrl: string | undefined;
77
+ ondarkPhotoUrl: string | undefined;
78
+ photoFile: any;
79
+ ondarkPhotoFile: any;
80
+ metadata: {} | undefined;
81
+ }>;
82
+ export declare const EmbaddedAddressSchema: import("@vinejs/vine").VineObject<{
83
+ country: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
84
+ state: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
85
+ city: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
86
+ street: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
87
+ zip: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
88
+ metadata: import("@vinejs/vine/schema/base/main").OptionalModifier<import("@vinejs/vine/schema/base/main").OptionalModifier<import("@vinejs/vine").VineObject<{}, {}, {}, {}>>>;
89
+ }, {
90
+ country: string | null | undefined;
91
+ state: string | null | undefined;
92
+ city: string | null | undefined;
93
+ street: string | null | undefined;
94
+ zip: string | null | undefined;
95
+ metadata: {} | null | undefined;
96
+ }, {
97
+ country: string | undefined;
98
+ state: string | undefined;
99
+ city: string | undefined;
100
+ street: string | undefined;
101
+ zip: string | undefined;
102
+ metadata: {} | undefined;
103
+ }, {
104
+ country: string | undefined;
105
+ state: string | undefined;
106
+ city: string | undefined;
107
+ street: string | undefined;
108
+ zip: string | undefined;
109
+ metadata: {} | undefined;
110
+ }>;
111
+ export declare const EmbaddedContactSchema: import("@vinejs/vine").VineObject<{
112
+ type: import("@vinejs/vine").VineString;
113
+ value: import("@vinejs/vine").VineString;
114
+ metadata: import("@vinejs/vine/schema/base/main").OptionalModifier<import("@vinejs/vine").VineObject<{}, {}, {}, {}>>;
115
+ }, {
116
+ type: string;
117
+ value: string;
118
+ metadata: {} | null | undefined;
119
+ }, {
120
+ type: string;
121
+ value: string;
122
+ metadata: {} | undefined;
123
+ }, {
124
+ type: string;
125
+ value: string;
126
+ metadata: {} | undefined;
127
+ }>;
128
+ export declare const StoreBunner: import("@vinejs/vine").VineObject<{
129
+ url: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
130
+ title: import("@vinejs/vine").VineString;
131
+ enabled: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineBoolean>;
132
+ metadata: import("@vinejs/vine/schema/base/main").OptionalModifier<import("@vinejs/vine").VineObject<{}, {}, {}, {}>>;
133
+ }, {
134
+ url: string | null | undefined;
135
+ title: string;
136
+ enabled: string | number | boolean | null | undefined;
137
+ metadata: {} | null | undefined;
138
+ }, {
139
+ url: string | undefined;
140
+ title: string;
141
+ enabled: boolean | undefined;
142
+ metadata: {} | undefined;
143
+ }, {
144
+ url: string | undefined;
145
+ title: string;
146
+ enabled: boolean | undefined;
147
+ metadata: {} | undefined;
148
+ }>;