@mframework/layer-commerce 0.0.4 → 0.0.7

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 (41) hide show
  1. package/app/composables/schema/attributes.ts +10 -0
  2. package/app/composables/schema/blocks.ts +7 -0
  3. package/app/composables/schema/bundleProduts.ts +12 -0
  4. package/app/composables/schema/cart.ts +35 -0
  5. package/app/composables/schema/category.ts +15 -0
  6. package/app/composables/schema/checkout.ts +11 -0
  7. package/app/composables/schema/company.ts +8 -0
  8. package/app/composables/schema/configurableProducts.ts +11 -0
  9. package/app/composables/schema/coupons.ts +10 -0
  10. package/app/composables/schema/credit-memos.ts +50 -0
  11. package/app/composables/schema/digitalProducts.ts +13 -0
  12. package/app/composables/schema/directory.ts +8 -0
  13. package/app/composables/schema/events.ts +30 -0
  14. package/app/composables/schema/gift-registry.ts +9 -0
  15. package/app/composables/schema/guest-cart.ts +6 -0
  16. package/app/composables/schema/inventory.ts +9 -0
  17. package/app/composables/schema/invoices.ts +49 -0
  18. package/app/composables/schema/orders.ts +39 -0
  19. package/app/composables/schema/payments.ts +11 -0
  20. package/app/composables/schema/price.ts +12 -0
  21. package/app/composables/schema/product-types.ts +9 -0
  22. package/app/composables/schema/product.ts +23 -0
  23. package/app/composables/schema/quotes.ts +10 -0
  24. package/app/composables/schema/requisition-lists.ts +7 -0
  25. package/app/composables/schema/returns.ts +11 -0
  26. package/app/composables/schema/reward.ts +8 -0
  27. package/app/composables/schema/rules.ts +8 -0
  28. package/app/composables/schema/shipment.ts +21 -0
  29. package/app/composables/schema/shops.ts +10 -0
  30. package/app/composables/schema/stockItems.ts +8 -0
  31. package/app/composables/schema/store.ts +8 -0
  32. package/app/composables/schema/subscriptons.ts +11 -0
  33. package/app/composables/schema/taxRates.ts +9 -0
  34. package/app/composables/schema/taxRules.ts +8 -0
  35. package/app/composables/schema/teams.ts +7 -0
  36. package/app/composables/schema/transactions.ts +13 -0
  37. package/app/composables/useCustomer/__tests__/useCustomer.spec.ts +1 -1
  38. package/app/composables/useProductReviews/__tests__/useProductReviews.spec.ts +1 -1
  39. package/app/types/index.ts +1 -1
  40. package/app/utils/client.ts +1 -1
  41. package/package.json +2 -3
@@ -0,0 +1,10 @@
1
+ export interface MeeoviAttribute {
2
+ id: number
3
+ default_label?: string | null
4
+ isPublic?: boolean | null
5
+ options?: Record<string, unknown> | null
6
+ attribute_code?: string | null
7
+ // relations omitted: attributes_product_types[], attributes_products[], integrations_attributes[], product_attributes[], products_attributes[], videos[]
8
+ }
9
+
10
+
@@ -0,0 +1,7 @@
1
+ export interface MeeoviBlock {
2
+ id: string
3
+ type: string
4
+ content: string | null
5
+ metadata?: Record<string, unknown>
6
+ }
7
+
@@ -0,0 +1,12 @@
1
+ import { MeeoviProduct } from './product'
2
+
3
+ export interface MeeoviBundleProduct {
4
+ id: string
5
+ title: string
6
+ items: MeeoviProduct[]
7
+ price: number
8
+ currency: string
9
+ stock: number | null
10
+ metadata?: Record<string, unknown>
11
+ }
12
+
@@ -0,0 +1,35 @@
1
+ import { MeeoviProduct } from './product'
2
+
3
+ export interface MeeoviCartItem {
4
+ id: number
5
+ quantity?: number | null
6
+ metadata?: Record<string, unknown> | null
7
+ products?: string | null
8
+ cart?: number | null
9
+ product_id?: string | null
10
+ price?: number | null
11
+ total?: number | null
12
+ variant_id?: string | null
13
+ variant?: string | null
14
+ }
15
+
16
+ export interface MeeoviCart {
17
+ id: number
18
+ date_created?: string | null
19
+ user_updated?: string | null
20
+ date_updated?: string | null
21
+ session_id?: string | null
22
+ total_price?: number | null
23
+ user?: string | null
24
+ status?: string | null
25
+ subtotal?: number | null
26
+ tax_amount?: number | null
27
+ shipping_amount?: number | null
28
+ discount_amount?: number | null
29
+ total?: number | null
30
+ currency?: string | null
31
+ coupon_code?: string | null
32
+ // relations omitted: address_cart[], cart_cart_items[], cart_items[], cart_products[]
33
+ }
34
+
35
+
@@ -0,0 +1,15 @@
1
+ export interface MeeoviCategory {
2
+ id: number
3
+ name?: string | null
4
+ description?: string | null
5
+ content?: string | null
6
+ image?: string | null
7
+ menus?: Record<string, unknown> | null
8
+ uid?: string | null
9
+ color?: string | null
10
+ colortext?: string | null
11
+ slug?: string | null
12
+ // relations omitted: articles_categories[], brands_categories[], ...
13
+ }
14
+
15
+
@@ -0,0 +1,11 @@
1
+ import { MeeoviCart } from './cart'
2
+
3
+ export interface MeeoviCheckout {
4
+ id: string
5
+ cart: MeeoviCart
6
+ total: number
7
+ currency: string
8
+ status: 'pending' | 'completed' | 'failed' | string
9
+ metadata?: Record<string, unknown>
10
+ }
11
+
@@ -0,0 +1,8 @@
1
+ export interface MeeoviCompany {
2
+ id: string
3
+ name: string
4
+ website?: string | null
5
+ description?: string | null
6
+ metadata?: Record<string, unknown>
7
+ }
8
+
@@ -0,0 +1,11 @@
1
+ import { MeeoviProduct } from './product'
2
+
3
+ export interface MeeoviConfigurableProduct {
4
+ id: string
5
+ baseProductId: string
6
+ title?: string | null
7
+ options: { name: string; values: string[] }[]
8
+ variants: MeeoviProduct[]
9
+ metadata?: Record<string, unknown>
10
+ }
11
+
@@ -0,0 +1,10 @@
1
+ export interface MeeoviCoupon {
2
+ id: string
3
+ code: string
4
+ description?: string | null
5
+ discountType: 'percentage' | 'fixed' | string
6
+ amount: number
7
+ expiresAt?: string | null
8
+ metadata?: Record<string, unknown>
9
+ }
10
+
@@ -0,0 +1,50 @@
1
+ export interface MeeoviCreditMemo {
2
+ id: number
3
+ created_at?: string | null
4
+ updated_at?: string | null
5
+ adjustment?: number | null
6
+ adjustment_negative?: number | null
7
+ adjustment_positive?: number | null
8
+ base_adjustment?: number | null
9
+ base_adjustment_negative?: number | null
10
+ base_adjustment_positive?: number | null
11
+ base_currency_code?: string | null
12
+ base_discount_amount?: number | null
13
+ base_grand_total?: number | null
14
+ base_discount_tax_compensation_amount?: number | null
15
+ base_shipping_amount?: number | null
16
+ base_shipping_discount_tax_compensation_amnt?: number | null
17
+ base_shipping_incl_tax?: number | null
18
+ base_shipping_tax_amount?: number | null
19
+ base_subtotal?: number | null
20
+ base_subtotal_incl_tax?: number | null
21
+ base_tax_amount?: number | null
22
+ base_to_global_rate?: number | null
23
+ base_to_order_rate?: number | null
24
+ creditmemo_status?: number | null
25
+ discount_amount?: number | null
26
+ discount_description?: string | null
27
+ email_sent?: number | null
28
+ entity_id?: number | null
29
+ global_currency_code?: string | null
30
+ grand_total?: number | null
31
+ discount_tax_compensation_amount?: number | null
32
+ increment_id?: string | null
33
+ invoice_id?: number | null
34
+ order_currency_code?: string | null
35
+ shipping_amount?: number | null
36
+ shipping_discount_tax_compensation_amount?: number | null
37
+ shipping_incl_tax?: number | null
38
+ shipping_tax_amount?: number | null
39
+ state?: number | null
40
+ store_currency_code?: string | null
41
+ store_id?: number | null
42
+ store_to_base_rate?: number | null
43
+ store_to_order_rate?: number | null
44
+ subtotal?: number | null
45
+ subtotal_incl_tax?: number | null
46
+ tax_amount?: number | null
47
+ user?: string | null
48
+ }
49
+
50
+
@@ -0,0 +1,13 @@
1
+ import { MeeoviProduct } from './product'
2
+
3
+ export interface MeeoviDigitalProduct {
4
+ id: string
5
+ title: string
6
+ downloadUrl?: string | null
7
+ fileId?: string | null
8
+ product?: MeeoviProduct
9
+ price?: number
10
+ currency?: string
11
+ metadata?: Record<string, unknown>
12
+ }
13
+
@@ -0,0 +1,8 @@
1
+ export interface MeeoviDirectoryEntry {
2
+ id: string
3
+ name: string
4
+ type?: string | null
5
+ url?: string | null
6
+ metadata?: Record<string, unknown>
7
+ }
8
+
@@ -0,0 +1,30 @@
1
+ export interface MeeoviEvent {
2
+ id: number
3
+ status?: string | null
4
+ sort?: number | null
5
+ user_created?: string | null
6
+ date_created?: string | null
7
+ user_updated?: string | null
8
+ date_updated?: string | null
9
+ name?: string | null
10
+ description?: string | null
11
+ event_calendar?: string | null
12
+ image?: string | null
13
+ location?: string | null
14
+ start_time?: string | null
15
+ end_time?: string | null
16
+ url?: string | null
17
+ postalcode?: string | null
18
+ type?: string | null
19
+ qr_code?: string | null
20
+ check_in?: string | null
21
+ rsvp_status?: string | null
22
+ rsvp_policies?: Record<string, unknown> | null
23
+ date?: string | null
24
+ slug?: string | null
25
+ tickets_url?: string | null
26
+ address?: string | null
27
+ // relations omitted
28
+ }
29
+
30
+
@@ -0,0 +1,9 @@
1
+ import { MeeoviProduct } from './product'
2
+
3
+ export interface MeeoviGiftRegistry {
4
+ id: string
5
+ ownerId?: string | null
6
+ items: MeeoviProduct[]
7
+ metadata?: Record<string, unknown>
8
+ }
9
+
@@ -0,0 +1,6 @@
1
+ import { MeeoviCart } from './cart'
2
+
3
+ export interface MeeoviGuestCart extends MeeoviCart {
4
+ guestId: string
5
+ }
6
+
@@ -0,0 +1,9 @@
1
+ export interface MeeoviInventoryLot {
2
+ id: number
3
+ location_id?: number | null
4
+ qty?: number | null
5
+ batch?: string | null
6
+ expires_at?: string | null
7
+ created_at?: string | null
8
+ }
9
+
@@ -0,0 +1,49 @@
1
+ export interface MeeoviInvoice {
2
+ id: string
3
+ created_at?: string | null
4
+ updated_at?: string | null
5
+ base_currency_code?: string | null
6
+ base_discount_amount?: number | null
7
+ base_grand_total?: number | null
8
+ base_discount_tax_compensation_amount?: number | null
9
+ base_shipping_amount?: number | null
10
+ base_shipping_discount_tax_compensation_amnt?: number | null
11
+ base_shipping_incl_tax?: number | null
12
+ base_shipping_tax_amount?: number | null
13
+ base_subtotal?: number | null
14
+ base_subtotal_incl_tax?: number | null
15
+ base_tax_amount?: number | null
16
+ base_total_refunded?: number | null
17
+ base_to_global_rate?: number | null
18
+ base_to_order_rate?: number | null
19
+ can_void_flag?: number | null
20
+ discount_amount?: number | null
21
+ discount_description?: string | null
22
+ email_sent?: number | null
23
+ entity_id?: number | null
24
+ global_currency_code?: string | null
25
+ grand_total?: number | null
26
+ discount_tax_compensation_amount?: number | null
27
+ increment_id?: string | null
28
+ is_used_for_refund?: number | null
29
+ order_currency_code?: string | null
30
+ shipping_amount?: number | null
31
+ shipping_discount_tax_compensation_amount?: number | null
32
+ shipping_incl_tax?: number | null
33
+ shipping_tax_amount?: number | null
34
+ state?: number | null
35
+ store_currency_code?: string | null
36
+ store_id?: number | null
37
+ store_to_base_rate?: number | null
38
+ store_to_order_rate?: number | null
39
+ subtotal?: number | null
40
+ subtotal_incl_tax?: number | null
41
+ tax_amount?: number | null
42
+ total_qty?: number | null
43
+ user?: string | null
44
+ plan?: string | null
45
+ service_period?: string | null
46
+ payment_period?: string | null
47
+ }
48
+
49
+
@@ -0,0 +1,39 @@
1
+ import { MeeoviProduct } from './product'
2
+
3
+ export interface MeeoviOrderItem {
4
+ id: number
5
+ quantity?: number | null
6
+ price?: number | null
7
+ }
8
+
9
+ export interface MeeoviOrder {
10
+ id: number
11
+ status?: string | null
12
+ date_created?: string | null
13
+ date_updated?: string | null
14
+ type?: string | null
15
+ adjustment_negative?: number | null
16
+ adjustment_positive?: number | null
17
+ applied_rule_ids?: string | null
18
+ base_adjustment_negative?: number | null
19
+ base_adjustment_positive?: number | null
20
+ base_currency_code?: string | null
21
+ base_discount_amount?: number | null
22
+ base_discount_canceled?: number | null
23
+ base_discount_invoiced?: number | null
24
+ base_discount_refunded?: number | null
25
+ base_grand_total?: number | null
26
+ // many more base_* and other fields omitted for brevity; include as needed
27
+ coupon_code?: string | null
28
+ customer_email?: string | null
29
+ grand_total?: number | null
30
+ order_currency_code?: string | null
31
+ shipping_amount?: number | null
32
+ subtotal?: number | null
33
+ tax_amount?: number | null
34
+ payment_status?: string | null
35
+ user_id?: string | null
36
+ // relations omitted: incentives_orders[], invoices_orders[], order_items_orders[], etc.
37
+ }
38
+
39
+
@@ -0,0 +1,11 @@
1
+ export interface MeeoviPayment {
2
+ id: number
3
+ status?: string | null
4
+ description?: string | null
5
+ gateway?: string | null
6
+ amount?: number | null
7
+ created_at?: string | null
8
+ // relations omitted: payments_countries[], payments_currency[]
9
+ }
10
+
11
+
@@ -0,0 +1,12 @@
1
+ export interface MeeoviCurrency {
2
+ id: number
3
+ sort?: number | null
4
+ date_created?: string | null
5
+ date_updated?: string | null
6
+ name?: string | null
7
+ code?: string | null
8
+ symbol?: string | null
9
+ // relations omitted: countries_currency[], currency_departments[], etc.
10
+ }
11
+
12
+
@@ -0,0 +1,9 @@
1
+ export interface MeeoviProductType {
2
+ id: number
3
+ name?: string | null
4
+ isShippable?: boolean | null
5
+ options?: Record<string, unknown> | null
6
+ // relations omitted: attributes_product_types[], integrations_product_types[], product_types_products[], videos_product_types[]
7
+ }
8
+
9
+
@@ -0,0 +1,23 @@
1
+ export interface MeeoviProduct {
2
+ id: string
3
+ sku?: string | null
4
+ name?: string | null
5
+ tax_class?: string | null
6
+ created_at?: string | null
7
+ content?: string | null
8
+ part_number?: string | null
9
+ file?: string | null
10
+ image?: string | null
11
+ visibility?: boolean | null
12
+ stock?: number | null
13
+ rating?: number | null
14
+ salable_quantity?: string | null
15
+ updated_at?: string | null
16
+ status?: string | null
17
+ price?: number | null
18
+ ratings?: string | null
19
+ uuid?: string | null
20
+ // relations omitted: many relation arrays like Space_products[], brands_products[], variants[], etc.
21
+ }
22
+
23
+
@@ -0,0 +1,10 @@
1
+ export interface MeeoviQuote {
2
+ id: string
3
+ customerId?: string | null
4
+ items: Array<{ productId: string; quantity: number; price: number }>
5
+ total: number
6
+ currency: string
7
+ status?: string | null
8
+ metadata?: Record<string, unknown>
9
+ }
10
+
@@ -0,0 +1,7 @@
1
+ export interface MeeoviRequisitionList {
2
+ id: string
3
+ ownerId?: string | null
4
+ items: Array<{ productId: string; quantity: number }>
5
+ metadata?: Record<string, unknown>
6
+ }
7
+
@@ -0,0 +1,11 @@
1
+ export interface MeeoviReturn {
2
+ id: number
3
+ status?: string | null
4
+ date_created?: string | null
5
+ date_updated?: string | null
6
+ return_number?: string | null
7
+ reason?: string | null
8
+ // relations omitted: returns_orders[], returns_products[]
9
+ }
10
+
11
+
@@ -0,0 +1,8 @@
1
+ export interface MeeoviReward {
2
+ id: string
3
+ userId: string
4
+ points: number
5
+ balance?: number
6
+ metadata?: Record<string, unknown>
7
+ }
8
+
@@ -0,0 +1,8 @@
1
+ export interface MeeoviRule {
2
+ id: string
3
+ name: string
4
+ condition?: string | null
5
+ action?: string | null
6
+ metadata?: Record<string, unknown>
7
+ }
8
+
@@ -0,0 +1,21 @@
1
+ export interface MeeoviShipment {
2
+ id: number
3
+ created_at?: string | null
4
+ updated_at?: string | null
5
+ email_sent?: number | null
6
+ user?: string | null
7
+ order?: number | null
8
+ shipment_status?: string | null
9
+ shipping_label?: string | null
10
+ store_id?: number | null
11
+ total_qty?: number | null
12
+ total_weight?: number | null
13
+ code?: string | null
14
+ cost?: number | null
15
+ delivery_time?: string | null
16
+ delivery_window?: string | null
17
+ carrier_matrix?: Record<string, unknown> | null
18
+ // relations omitted: shipment_address[], shipment_comments[], shipment_products[], shipment_tracking[]
19
+ }
20
+
21
+
@@ -0,0 +1,10 @@
1
+ export interface MeeoviShop {
2
+ id: string
3
+ name: string
4
+ domain?: string | null
5
+ currency?: string | null
6
+ productsCount?: number
7
+ metadata?: Record<string, unknown>
8
+ }
9
+
10
+
@@ -0,0 +1,8 @@
1
+ export interface MeeoviStockItem {
2
+ productId: string
3
+ sku?: string | null
4
+ qty: number
5
+ isInStock: boolean
6
+ metadata?: Record<string, unknown>
7
+ }
8
+
@@ -0,0 +1,8 @@
1
+ export interface MeeoviStore {
2
+ id: string
3
+ name: string
4
+ currency: string
5
+ defaultLocale?: string | null
6
+ metadata?: Record<string, unknown>
7
+ }
8
+
@@ -0,0 +1,11 @@
1
+ export interface MeeoviSubscription {
2
+ id: number
3
+ status?: string | null
4
+ date_created?: string | null
5
+ date_updated?: string | null
6
+ subscription_number?: string | null
7
+ start_date?: string | null
8
+ end_date?: string | null
9
+ // relations omitted: subscriptions_directus_users[], subscriptions_products[]
10
+ }
11
+
@@ -0,0 +1,9 @@
1
+ export interface MeeoviTaxRate {
2
+ id: number
3
+ rate?: number | null
4
+ tax_class?: string | null
5
+ certifications?: Record<string, unknown> | null
6
+ age_gating?: string | null
7
+ // relations omitted: taxes_countries[], taxes_states[]
8
+ }
9
+
@@ -0,0 +1,8 @@
1
+ export interface MeeoviTaxRule {
2
+ id: string
3
+ name: string
4
+ taxRateId?: string | null
5
+ priority?: number
6
+ metadata?: Record<string, unknown>
7
+ }
8
+
@@ -0,0 +1,7 @@
1
+ export interface MeeoviTeam {
2
+ id: string
3
+ name: string
4
+ members?: string[]
5
+ metadata?: Record<string, unknown>
6
+ }
7
+
@@ -0,0 +1,13 @@
1
+ export interface MeeoviTransaction {
2
+ id: string
3
+ status?: string | null
4
+ date_created?: string | null
5
+ date_updated?: string | null
6
+ order?: number | null
7
+ payment_method?: string | null
8
+ transactions_parent_id?: string | null
9
+ type?: string | null
10
+ amount?: number | null
11
+ // relations omitted: transactions_currency[]
12
+ }
13
+
@@ -1,6 +1,6 @@
1
1
  import { useCustomer } from '~/composables/useCustomer/useCustomer';
2
2
 
3
- vi.mock('@mframework/sdk', () => ({
3
+ vi.mock('@mframework/core', () => ({
4
4
  sdk: {
5
5
  commerce: {
6
6
  getCustomer: vi.fn(() => ({
@@ -2,7 +2,7 @@ import { vi } from 'vitest';
2
2
  import { useProductReviews } from '~/composables/useProductReviews';
3
3
  import { mockProductReviews } from './productReviews.mock';
4
4
 
5
- vi.mock('@mframework/sdk', () => ({
5
+ vi.mock('@mframework/core', () => ({
6
6
  sdk: {
7
7
  commerce: {
8
8
  getProductReviews: vi.fn(() => mockProductReviews),
@@ -8,7 +8,7 @@ declare global {
8
8
  }
9
9
  }
10
10
 
11
- import { sdk } from '@mframework/sdk'
11
+ import { sdk } from '@mframework/core'
12
12
 
13
13
  export function createClient(provider?: string, config?: any) {
14
14
  // Prefer provider-specific client creation if available on the SDK.
@@ -1,5 +1,5 @@
1
1
  import * as CommercePkg from '~/types';
2
- import { sdk } from '@mframework/sdk';
2
+ import { sdk } from '@mframework/core';
3
3
  import imports from '../types';
4
4
  import { normalizeProductsQueryOutput, normalizeProduct } from '../normalizers/ProductList.type';
5
5
  import { normalizeProductsResponse } from '../normalizers/ProductList.query';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mframework/layer-commerce",
3
- "version": "0.0.4",
3
+ "version": "0.0.7",
4
4
  "description": "Commerce Layer for the M Framework",
5
5
  "keywords": [
6
6
  "commerce",
@@ -23,8 +23,7 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@better-auth/stripe": "^1.4.15",
26
- "@mframework/core": "^0.0.1",
27
- "@mframework/sdk": "^0.0.2",
26
+ "@mframework/core": "^0.0.4",
28
27
  "@polar-sh/sdk": "^0.42.2",
29
28
  "@storefront-ui/nuxt": "^3.1.1",
30
29
  "@tilework/opus": "^0.0.12",