feeef 0.0.27 → 0.1.1

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 +647 -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 +35 -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 +114 -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 -155
  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,98 @@
1
+ export declare const CreateUserSchema: import("@vinejs/vine").VineObject<{
2
+ name: import("@vinejs/vine").VineString;
3
+ email: import("@vinejs/vine").VineString;
4
+ phone: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
5
+ password: import("@vinejs/vine").VineString;
6
+ photoFile: import("@vinejs/vine").VineAny;
7
+ photoUrl: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
8
+ metadata: import("@vinejs/vine/schema/base/main").OptionalModifier<import("@vinejs/vine").VineObject<{}, {}, {}, {}>>;
9
+ emailVerifiedAt: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineDate>;
10
+ phoneVerifiedAt: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineDate>;
11
+ verifiedAt: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineDate>;
12
+ blockedAt: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineDate>;
13
+ }, {
14
+ name: string;
15
+ email: string;
16
+ phone: string | null | undefined;
17
+ password: string;
18
+ photoFile: any;
19
+ photoUrl: string | null | undefined;
20
+ metadata: {} | null | undefined;
21
+ emailVerifiedAt: string | number | null | undefined;
22
+ phoneVerifiedAt: string | number | null | undefined;
23
+ verifiedAt: string | number | null | undefined;
24
+ blockedAt: string | number | null | undefined;
25
+ }, {
26
+ name: string;
27
+ email: string;
28
+ phone: string | undefined;
29
+ password: string;
30
+ photoFile: any;
31
+ photoUrl: string | undefined;
32
+ metadata: {} | undefined;
33
+ emailVerifiedAt: Date | undefined;
34
+ phoneVerifiedAt: Date | undefined;
35
+ verifiedAt: Date | undefined;
36
+ blockedAt: Date | undefined;
37
+ }, {
38
+ name: string;
39
+ email: string;
40
+ phone: string | undefined;
41
+ password: string;
42
+ photoFile: any;
43
+ photoUrl: string | undefined;
44
+ metadata: {} | undefined;
45
+ emailVerifiedAt: Date | undefined;
46
+ phoneVerifiedAt: Date | undefined;
47
+ verifiedAt: Date | undefined;
48
+ blockedAt: Date | undefined;
49
+ }>;
50
+ export declare const UpdateUserSchema: import("@vinejs/vine").VineObject<{
51
+ name: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
52
+ email: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
53
+ phone: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
54
+ password: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
55
+ photoFile: import("@vinejs/vine").VineAny;
56
+ photoUrl: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
57
+ metadata: import("@vinejs/vine/schema/base/main").OptionalModifier<import("@vinejs/vine").VineObject<{}, {}, {}, {}>>;
58
+ emailVerifiedAt: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineDate>;
59
+ phoneVerifiedAt: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineDate>;
60
+ verifiedAt: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
61
+ blockedAt: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineDate>;
62
+ }, {
63
+ name: string | null | undefined;
64
+ email: string | null | undefined;
65
+ phone: string | null | undefined;
66
+ password: string | null | undefined;
67
+ photoFile: any;
68
+ photoUrl: string | null | undefined;
69
+ metadata: {} | null | undefined;
70
+ emailVerifiedAt: string | number | null | undefined;
71
+ phoneVerifiedAt: string | number | null | undefined;
72
+ verifiedAt: string | null | undefined;
73
+ blockedAt: string | number | null | undefined;
74
+ }, {
75
+ name: string | undefined;
76
+ email: string | undefined;
77
+ phone: string | undefined;
78
+ password: string | undefined;
79
+ photoFile: any;
80
+ photoUrl: string | undefined;
81
+ metadata: {} | undefined;
82
+ emailVerifiedAt: Date | undefined;
83
+ phoneVerifiedAt: Date | undefined;
84
+ verifiedAt: string | undefined;
85
+ blockedAt: Date | undefined;
86
+ }, {
87
+ name: string | undefined;
88
+ email: string | undefined;
89
+ phone: string | undefined;
90
+ password: string | undefined;
91
+ photoFile: any;
92
+ photoUrl: string | undefined;
93
+ metadata: {} | undefined;
94
+ emailVerifiedAt: Date | undefined;
95
+ phoneVerifiedAt: Date | undefined;
96
+ verifiedAt: string | undefined;
97
+ blockedAt: Date | undefined;
98
+ }>;
@@ -0,0 +1,10 @@
1
+ export * from './feeef/feeef.js';
2
+ export * from './core/entities/order.js';
3
+ export * from './core/entities/store.js';
4
+ export * from './core/entities/product.js';
5
+ export * from './core/entities/user.js';
6
+ export * from './core/entities/shipping_method.js';
7
+ export * from './core/embadded/address.js';
8
+ export * from './core/embadded/category.js';
9
+ export * from './core/embadded/contact.js';
10
+ export type { StoreIntegrations } from './core/entities/store.js';
package/package.json CHANGED
@@ -1,15 +1,62 @@
1
1
  {
2
2
  "name": "feeef",
3
- "description": "feeef sdk for the web",
4
- "main": "src/index.ts",
5
- "private": false,
6
- "version": "0.0.27",
3
+ "description": "feeef sdk for javascript",
4
+ "version": "0.1.1",
5
+ "engines": {
6
+ "node": ">=18.16.0"
7
+ },
8
+ "main": "build/index.js",
7
9
  "type": "module",
10
+ "files": [
11
+ "build",
12
+ "!build/tests"
13
+ ],
14
+ "exports": {
15
+ ".": "./build/index.js"
16
+ },
8
17
  "scripts": {
9
- "dev": "vite --host",
10
- "build": "tsc && vite build",
11
- "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
12
- "preview": "vite preview"
18
+ "pretest": "npm run lint",
19
+ "test": "c8 npm run quick:test",
20
+ "quick:test": "node --loader=ts-node/esm --enable-source-maps bin/test.ts",
21
+ "clean": "del-cli build",
22
+ "typecheck": "tsc --noEmit",
23
+ "precompile": "npm run lint && npm run clean",
24
+ "compile": "tsup-node && tsc --emitDeclarationOnly --declaration",
25
+ "build": "npm run compile",
26
+ "release": "npx release-it",
27
+ "version": "npm run build",
28
+ "prepublishOnly": "npm run build",
29
+ "lint": "eslint . --ext=.ts",
30
+ "format": "prettier --write .",
31
+ "sync-labels": "github-label-sync --labels .github/labels.json vinejs/vine"
32
+ },
33
+ "devDependencies": {
34
+ "@adonisjs/eslint-config": "^1.3.0",
35
+ "@adonisjs/prettier-config": "^1.3.0",
36
+ "@adonisjs/tsconfig": "^1.3.0",
37
+ "@commitlint/cli": "^19.3.0",
38
+ "@commitlint/config-conventional": "^19.2.2",
39
+ "@japa/assert": "^3.0.0",
40
+ "@japa/expect-type": "^2.0.2",
41
+ "@japa/runner": "^3.1.4",
42
+ "@japa/snapshot": "^2.0.5",
43
+ "@swc/core": "^1.5.3",
44
+ "@types/dlv": "^1.1.4",
45
+ "@types/node": "^20.12.10",
46
+ "ajv": "^8.13.0",
47
+ "benchmark": "^2.1.4",
48
+ "c8": "^9.1.0",
49
+ "del-cli": "^5.1.0",
50
+ "eslint": "^8.57.0",
51
+ "github-label-sync": "^2.3.1",
52
+ "husky": "^9.0.11",
53
+ "joi": "^17.13.1",
54
+ "prettier": "^3.2.5",
55
+ "release-it": "^17.2.1",
56
+ "ts-node": "^10.9.2",
57
+ "tsup": "^8.0.2",
58
+ "typescript": "^5.4.5",
59
+ "@types/luxon": "^3.4.2"
13
60
  },
14
61
  "dependencies": {
15
62
  "@vinejs/vine": "^2.0.0",
@@ -17,15 +64,64 @@
17
64
  "axios-cache-interceptor": "^1.5.1",
18
65
  "luxon": "^3.5.0"
19
66
  },
20
- "devDependencies": {
21
- "@types/luxon": "^3.4.2",
22
- "@typescript-eslint/eslint-plugin": "^6.0.0",
23
- "@typescript-eslint/parser": "^6.0.0",
24
- "@vitejs/plugin-react-swc": "^3.3.2",
25
- "eslint": "^8.45.0",
26
- "eslint-plugin-react-hooks": "^4.6.0",
27
- "eslint-plugin-react-refresh": "^0.4.3",
28
- "typescript": "^5.0.2",
29
- "vite": "^4.4.5"
67
+ "author": "mohamadlounnas,feeefnet",
68
+ "license": "MIT",
69
+ "homepage": "https://github.com/feeefnet/feeef.js#readme",
70
+ "repository": {
71
+ "type": "git",
72
+ "url": "git+https://github.com/feeefnet/feeef.js.git"
73
+ },
74
+ "bugs": {
75
+ "url": "https://github.com/feeefnet/feeef.js/issues"
76
+ },
77
+ "keywords": [],
78
+ "types": "./build/index.d.ts",
79
+ "eslintConfig": {
80
+ "extends": "@adonisjs/eslint-config/package"
81
+ },
82
+ "prettier": "@adonisjs/prettier-config",
83
+ "commitlint": {
84
+ "extends": [
85
+ "@commitlint/config-conventional"
86
+ ]
87
+ },
88
+ "publishConfig": {
89
+ "access": "public",
90
+ "tag": "latest"
91
+ },
92
+ "release-it": {
93
+ "git": {
94
+ "commitMessage": "chore(release): ${version}",
95
+ "tagAnnotation": "v${version}",
96
+ "tagName": "v${version}"
97
+ },
98
+ "github": {
99
+ "release": true,
100
+ "releaseName": "v${version}",
101
+ "web": true
102
+ }
103
+ },
104
+ "c8": {
105
+ "reporter": [
106
+ "text",
107
+ "html"
108
+ ],
109
+ "exclude": [
110
+ "tests/**"
111
+ ]
112
+ },
113
+ "directories": {
114
+ "test": "tests"
115
+ },
116
+ "tsup": {
117
+ "entry": [
118
+ "./index.ts"
119
+ ],
120
+ "outDir": "./build",
121
+ "clean": true,
122
+ "format": "esm",
123
+ "dts": false,
124
+ "sourcemap": true,
125
+ "target": "esnext"
30
126
  }
31
127
  }
package/.eslintrc.cjs DELETED
@@ -1,19 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- env: { browser: true, es2020: true },
4
- extends: [
5
- "eslint:recommended",
6
- "plugin:@typescript-eslint/recommended",
7
- "plugin:react-hooks/recommended",
8
- ],
9
- ignorePatterns: ["dist", ".eslintrc.cjs"],
10
- parser: "@typescript-eslint/parser",
11
- plugins: ["react-refresh"],
12
- rules: {
13
- "react-refresh/only-export-components": [
14
- "warn",
15
- { allowConstantExport: true },
16
- ],
17
- "@typescript-eslint/no-explicit-any": "off",
18
- },
19
- };
package/src/core/core.ts DELETED
@@ -1,12 +0,0 @@
1
- // entities
2
- export * from "./entities/order.js";
3
- export * from "./entities/store.js";
4
- export * from "./entities/product.js";
5
- export * from "./entities/user.js";
6
- export * from "./entities/shipping_method.js";
7
- // embaddeds
8
- export * from "./embadded/address.js";
9
- export * from "./embadded/category.js";
10
- export * from "./embadded/contact.js";
11
-
12
- export type { StoreIntegrations } from "./entities/store.js"; // or wherever StoreIntegrations is defined
@@ -1,13 +0,0 @@
1
- export interface EmbaddedAddress {
2
- city: string
3
- state: string
4
- country?: string
5
- street?: string
6
- zip?: string
7
- location?: {
8
- geohash?: string
9
- lat: number
10
- long: number
11
- }
12
- metadata?: Record<string, any>
13
- }
@@ -1,7 +0,0 @@
1
- export interface EmbaddedCategory {
2
- name: string
3
- description: string | null
4
- photoUrl: string | null
5
- ondarkPhotoUrl?: string | null
6
- metadata?: Record<string, any>
7
- }
@@ -1,25 +0,0 @@
1
- export enum EmbaddedContactType {
2
- phone = 'phone',
3
- email = 'email',
4
- facebook = 'facebook',
5
- twitter = 'twitter',
6
- instagram = 'instagram',
7
- linkedin = 'linkedin',
8
- website = 'website',
9
- whatsapp = 'whatsapp',
10
- telegram = 'telegram',
11
- signal = 'signal',
12
- viber = 'viber',
13
- skype = 'skype',
14
- zoom = 'zoom',
15
- other = 'other',
16
- }
17
-
18
- // EmbaddedContactType is not enum but can only be: "phone" | "email" | "facebook" | "twitter" | "instagram" | "linkedin" | "website" | "whatsapp" | "telegram" | "signal" | "viber" | "skype" | "zoom" | "other
19
-
20
- export interface EmbaddedContact {
21
- type: EmbaddedContactType
22
- value: string
23
- name?: string
24
- metadata?: Record<string, any>
25
- }
@@ -1,79 +0,0 @@
1
- export enum OrderStatus {
2
- draft = 'draft',
3
- pending = 'pending',
4
- accepted = 'accepted',
5
- processing = 'processing',
6
- completed = 'completed',
7
- cancelled = 'cancelled',
8
- }
9
-
10
- // PaymentStatus
11
- export enum PaymentStatus {
12
- unpaid = 'unpaid',
13
- paid = 'paid',
14
- received = 'received',
15
- }
16
- export enum DeliveryStatus {
17
- pending = 'pending',
18
- delivering = 'delivering',
19
- delivered = 'delivered',
20
- returned = 'returned',
21
- }
22
-
23
- export interface OrderEntity {
24
- id: string
25
- customerName?: string | null
26
- customerPhone: string
27
- customerIp?: string | null
28
- shippingAddress?: string | null
29
- shippingCity?: string | null
30
- shippingState?: string | null
31
- shippingMethodId?: string | null
32
- paymentMethodId?: string | null
33
- items: OrderItem[]
34
- subtotal: number
35
- shippingPrice: number
36
- total: number
37
- discount: number
38
- coupon?: string | null
39
- storeId: string
40
- metadata: any
41
- status: OrderStatus
42
- paymentStatus: PaymentStatus
43
- deliveryStatus: DeliveryStatus
44
- createdAt: any
45
- updatedAt: any
46
- }
47
- export interface OrderItem {
48
- productId: string
49
- productName: string
50
- variantPath?: string
51
- quantity: number
52
- price: number
53
- }
54
-
55
- // order track entity
56
- export interface OrderTrackEntity {
57
- id: string
58
- customerName?: string | null
59
- customerPhone: string
60
- customerIp?: string | null
61
- shippingAddress?: string | null
62
- shippingCity?: string | null
63
- shippingState?: string | null
64
- shippingMethodId?: string | null
65
- paymentMethodId?: string | null
66
- items: OrderItem[]
67
- subtotal: number
68
- shippingPrice: number
69
- total: number
70
- discount: number
71
- coupon?: string | null
72
- storeId: string
73
- metadata: any
74
- status: OrderStatus
75
- paymentStatus: PaymentStatus
76
- deliveryStatus: DeliveryStatus
77
- createdAt: any
78
- updatedAt: any
79
- }
@@ -1,108 +0,0 @@
1
- import { EmbaddedCategory } from "../embadded/category.js";
2
- import { ShippingMethodEntity } from "./shipping_method.js";
3
- import { StoreEntity } from "./store.js";
4
-
5
- export interface ProductEntity {
6
- id: string;
7
-
8
- slug: string;
9
-
10
- decoration: ProductDecoration | null;
11
-
12
- name: string | null;
13
-
14
- photoUrl: string | null;
15
-
16
- media: string[];
17
-
18
- storeId: string;
19
-
20
- shippingMethodId?: string | null;
21
-
22
- category: EmbaddedCategory;
23
-
24
- title: string | null;
25
-
26
- description: string | null;
27
-
28
- body: string | null;
29
-
30
- // sku
31
- sku: string | null;
32
-
33
- price: number;
34
-
35
- discount: number | null;
36
-
37
- stock: number;
38
-
39
- sold: number;
40
-
41
- views: number;
42
-
43
- likes: number;
44
-
45
- dislikes: number;
46
-
47
- variant?: ProductVariant | null;
48
-
49
- metadata: Record<string, any>;
50
-
51
- status: ProductStatus;
52
-
53
- type: ProductType;
54
-
55
- verifiedAt: any | null;
56
-
57
- blockedAt: any | null;
58
-
59
- createdAt: any;
60
-
61
- updatedAt: any;
62
-
63
- // relations
64
- store?: StoreEntity;
65
- shippingMethod?: ShippingMethodEntity;
66
- }
67
-
68
- export enum ProductStatus {
69
- draft = "draft",
70
- published = "published",
71
- archived = "archived",
72
- deleted = "deleted",
73
- }
74
-
75
- export interface ProductDecoration {
76
- metadata: Record<string, any>;
77
- }
78
-
79
- export interface ProductVariant {
80
- name: string;
81
- options: ProductVariantOption[];
82
- }
83
-
84
- export interface ProductVariantOption {
85
- name: string;
86
- sku?: string | null;
87
- price?: number | null;
88
- discount?: number | null;
89
- stock?: number | null;
90
- sold?: number | null;
91
- type?: VariantOptionType;
92
- child?: ProductVariant | null;
93
- mediaIndex?: number | null;
94
- hint?: string | null;
95
- value?: any;
96
- }
97
-
98
- export enum VariantOptionType {
99
- color = "color",
100
- image = "image",
101
- text = "text",
102
- }
103
-
104
- export enum ProductType {
105
- physical = "physical",
106
- digital = "digital",
107
- service = "service",
108
- }
@@ -1,32 +0,0 @@
1
- import { OrderEntity } from './order.js'
2
-
3
- export interface ShippingMethodEntity {
4
- id: string
5
- name: string
6
- description: string | null
7
- logoUrl: string | null
8
- ondarkLogoUrl: string | null
9
- price: number
10
- forks: number
11
- sourceId: string
12
- storeId: string
13
- rates: (number | null)[][] | null
14
- status: ShippingMethodStatus
15
- policy: ShippingMethodPolicy
16
- verifiedAt: any
17
- createdAt: any
18
- updatedAt: any
19
- orders: OrderEntity[]
20
- source: ShippingMethodEntity | null
21
- }
22
-
23
- export enum ShippingMethodStatus {
24
- draft = 'draft',
25
- published = 'published',
26
- archived = 'archived',
27
- }
28
-
29
- export enum ShippingMethodPolicy {
30
- private = 'private',
31
- public = 'public',
32
- }