@akinon/next 1.15.0 → 1.16.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.
@@ -1,117 +1,117 @@
1
- import { Product } from './product';
2
-
3
- export type Division = {
4
- id: number;
5
- name: string;
6
- division_type: string;
7
- parent: number;
8
- erp_code: string;
9
- country_id: number;
10
- city_id: number;
11
- township_id: number;
12
- district_id: number;
13
- address: string;
14
- phone_number: string;
15
- fax_number: string;
16
- is_active: true;
17
- latitude: null;
18
- longitude: null;
19
- monthly_order_limit: string;
20
- current_balance: string;
21
- current_balance_last_update: null | string;
22
- extra_data: object;
23
- };
24
-
25
- export interface ProductB2b extends Product {
26
- sku: string;
27
- name: string;
28
- price: string;
29
- base_code: string;
30
- asorti: string;
31
- category: string;
32
- currency: string;
33
- variants: {
34
- [key: string]: any;
35
- };
36
- product_image: string;
37
- }
38
-
39
- export type BasketResponse = {
40
- id: number;
41
- total_amount: string;
42
- total_quantity: number;
43
- basket_items: [
44
- {
45
- total_amount: string;
46
- price: string;
47
- quantity: number;
48
- divisions: BasketItemDivision[];
49
- product: ProductB2b;
50
- product_remote_id: number;
51
- }
52
- ];
53
- };
54
-
55
- export interface QuotationErrorType {
56
- data: {
57
- non_field_errors: string[];
58
- };
59
- }
60
-
61
- export interface BasketItemDivision {
62
- id: number;
63
- name: string;
64
- erp_code: string;
65
- quantity: number;
66
- }
67
-
68
- export type BasketItemType = {
69
- total_amount: string;
70
- price: string;
71
- quantity: number;
72
- divisions: BasketItemDivision[];
73
- product: ProductB2b;
74
- product_remote_id: number;
75
- }
76
-
77
- export type BasketParams = {
78
- division: string;
79
- product_remote_id: string;
80
- quantity: string;
81
- };
82
-
83
- export type SaveBasketParams = {
84
- name: string;
85
- };
86
-
87
- export type CreateQuotationParams = {
88
- name: string;
89
- };
90
-
91
- export type UpdateProductParams = {
92
- product_remote_id: number;
93
- division: number;
94
- quantity: number
95
- };
96
-
97
- export type DeleteProductParams = {
98
- product_remote_id: number;
99
- };
100
-
101
- export type LoadBasketParams = {
102
- id: number;
103
- };
104
-
105
- export interface GetResponse<T> {
106
- count: number;
107
- next: null;
108
- previous: null;
109
- results: T[];
110
- }
111
-
112
- export type DraftResponse = {
113
- id: number;
114
- name: string;
115
- total_amount: number;
116
- total_quantity: number;
117
- };
1
+ import { Product } from './product';
2
+
3
+ export type Division = {
4
+ id: number;
5
+ name: string;
6
+ division_type: string;
7
+ parent: number;
8
+ erp_code: string;
9
+ country_id: number;
10
+ city_id: number;
11
+ township_id: number;
12
+ district_id: number;
13
+ address: string;
14
+ phone_number: string;
15
+ fax_number: string;
16
+ is_active: true;
17
+ latitude: null;
18
+ longitude: null;
19
+ monthly_order_limit: string;
20
+ current_balance: string;
21
+ current_balance_last_update: null | string;
22
+ extra_data: object;
23
+ };
24
+
25
+ export interface ProductB2b extends Product {
26
+ sku: string;
27
+ name: string;
28
+ price: string;
29
+ base_code: string;
30
+ asorti: string;
31
+ category: string;
32
+ currency: string;
33
+ variants: {
34
+ [key: string]: any;
35
+ };
36
+ product_image: string;
37
+ }
38
+
39
+ export type BasketResponse = {
40
+ id: number;
41
+ total_amount: string;
42
+ total_quantity: number;
43
+ basket_items: [
44
+ {
45
+ total_amount: string;
46
+ price: string;
47
+ quantity: number;
48
+ divisions: BasketItemDivision[];
49
+ product: ProductB2b;
50
+ product_remote_id: number;
51
+ }
52
+ ];
53
+ };
54
+
55
+ export interface QuotationErrorType {
56
+ data: {
57
+ non_field_errors: string[];
58
+ };
59
+ }
60
+
61
+ export interface BasketItemDivision {
62
+ id: number;
63
+ name: string;
64
+ erp_code: string;
65
+ quantity: number;
66
+ }
67
+
68
+ export type BasketItemType = {
69
+ total_amount: string;
70
+ price: string;
71
+ quantity: number;
72
+ divisions: BasketItemDivision[];
73
+ product: ProductB2b;
74
+ product_remote_id: number;
75
+ }
76
+
77
+ export type BasketParams = {
78
+ division: string;
79
+ product_remote_id: string;
80
+ quantity: string;
81
+ };
82
+
83
+ export type SaveBasketParams = {
84
+ name: string;
85
+ };
86
+
87
+ export type CreateQuotationParams = {
88
+ name: string;
89
+ };
90
+
91
+ export type UpdateProductParams = {
92
+ product_remote_id: number;
93
+ division: number;
94
+ quantity: number
95
+ };
96
+
97
+ export type DeleteProductParams = {
98
+ product_remote_id: number;
99
+ };
100
+
101
+ export type LoadBasketParams = {
102
+ id: number;
103
+ };
104
+
105
+ export interface GetResponse<T> {
106
+ count: number;
107
+ next: null;
108
+ previous: null;
109
+ results: T[];
110
+ }
111
+
112
+ export type DraftResponse = {
113
+ id: number;
114
+ name: string;
115
+ total_amount: number;
116
+ total_quantity: number;
117
+ };
@@ -1,22 +1,22 @@
1
- import logger from './log';
2
-
3
- export const generateCommerceSearchParams = (searchParams?: URLSearchParams) => {
4
- if (!searchParams) {
5
- return null;
6
- }
7
-
8
- const urlSerchParams = new URLSearchParams(searchParams);
9
-
10
- Object.entries(searchParams).forEach(([key, value]) => {
11
- if (typeof value === 'object') {
12
- urlSerchParams.delete(key);
13
- value.forEach((val) => {
14
- urlSerchParams.append(key, val);
15
- });
16
- }
17
- });
18
-
19
- logger.debug(`generateCommerceSearchParams: ${urlSerchParams.toString()}`);
20
-
21
- return `?${urlSerchParams.toString()}`;
22
- };
1
+ import logger from './log';
2
+
3
+ export const generateCommerceSearchParams = (searchParams?: URLSearchParams) => {
4
+ if (!searchParams) {
5
+ return null;
6
+ }
7
+
8
+ const urlSerchParams = new URLSearchParams(searchParams);
9
+
10
+ Object.entries(searchParams).forEach(([key, value]) => {
11
+ if (typeof value === 'object') {
12
+ urlSerchParams.delete(key);
13
+ value.forEach((val) => {
14
+ urlSerchParams.append(key, val);
15
+ });
16
+ }
17
+ });
18
+
19
+ logger.debug(`generateCommerceSearchParams: ${urlSerchParams.toString()}`);
20
+
21
+ return `?${urlSerchParams.toString()}`;
22
+ };
@@ -1,29 +1,29 @@
1
- 'use client'
2
-
3
- import getSymbolFromCurrency from 'currency-symbol-map';
4
-
5
- type GetCurrencyType = {
6
- currencyCode: string;
7
- useCurrencySymbol?: boolean;
8
- useCurrencyAfterPrice?: boolean;
9
- useCurrencySpace?: boolean;
10
- };
11
-
12
- export const getCurrency = (args: GetCurrencyType) => {
13
- const {
14
- currencyCode,
15
- useCurrencySymbol = true,
16
- useCurrencyAfterPrice = true,
17
- useCurrencySpace = true
18
- } = args;
19
-
20
- const currencySpace = useCurrencySpace ? ' ' : '';
21
- const currency = useCurrencySymbol
22
- ? `${getSymbolFromCurrency(currencyCode)}`
23
- : currencyCode;
24
- const currencyAfterPrice = useCurrencyAfterPrice
25
- ? `${currencySpace}${currency}`
26
- : `${currency}${currencySpace}`;
27
-
28
- return currencyAfterPrice;
29
- };
1
+ 'use client'
2
+
3
+ import getSymbolFromCurrency from 'currency-symbol-map';
4
+
5
+ type GetCurrencyType = {
6
+ currencyCode: string;
7
+ useCurrencySymbol?: boolean;
8
+ useCurrencyAfterPrice?: boolean;
9
+ useCurrencySpace?: boolean;
10
+ };
11
+
12
+ export const getCurrency = (args: GetCurrencyType) => {
13
+ const {
14
+ currencyCode,
15
+ useCurrencySymbol = true,
16
+ useCurrencyAfterPrice = true,
17
+ useCurrencySpace = true
18
+ } = args;
19
+
20
+ const currencySpace = useCurrencySpace ? ' ' : '';
21
+ const currency = useCurrencySymbol
22
+ ? `${getSymbolFromCurrency(currencyCode)}`
23
+ : currencyCode;
24
+ const currencyAfterPrice = useCurrencyAfterPrice
25
+ ? `${currencySpace}${currency}`
26
+ : `${currency}${currencySpace}`;
27
+
28
+ return currencyAfterPrice;
29
+ };
package/with-pz-config.js CHANGED
@@ -3,9 +3,9 @@ const deepMerge = require('./utils/deep-merge');
3
3
 
4
4
  /** @type {import('next').NextConfig} */
5
5
  const defaultConfig = {
6
- experimental: { serverActions: true },
6
+ experimental: { serverActions: true, instrumentationHook: true },
7
7
  reactStrictMode: true,
8
- transpilePackages: ['@akinon/next', ...pzPlugins],
8
+ transpilePackages: ['@akinon/next', ...pzPlugins.map((p) => `@akinon/${p}`)],
9
9
  skipTrailingSlashRedirect: true,
10
10
  poweredByHeader: false,
11
11
  env: {
package/.editorconfig DELETED
@@ -1,7 +0,0 @@
1
- [*]
2
- indent_style = space
3
- indent_size = 2
4
- end_of_line = lf
5
- charset = utf-8
6
- trim_trailing_whitespace = true
7
- insert_final_newline = true