@fixefy/fixefy-ui-utils 0.2.73 → 0.2.74

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,2 +1,2 @@
1
1
  export declare const attachAuth: (ctx: any, headers: any) => any;
2
- export declare const getToken: (ctx: any) => string;
2
+ export declare const getToken: (ctx: any) => string | undefined;
@@ -16,7 +16,7 @@ _export(exports, {
16
16
  return getToken;
17
17
  }
18
18
  });
19
- const _nookies = require("nookies");
19
+ const _fixefycookies = require("@fixefy/fixefy-cookies");
20
20
  function _define_property(obj, key, value) {
21
21
  if (key in obj) {
22
22
  Object.defineProperty(obj, key, {
@@ -76,5 +76,5 @@ const attachAuth = (ctx, headers)=>{
76
76
  });
77
77
  };
78
78
  const getToken = (ctx)=>{
79
- return (0, _nookies.parseCookies)(ctx)['token'];
79
+ return _fixefycookies.CookieHelper.get(ctx, 'token');
80
80
  };
@@ -2,7 +2,7 @@ import { Currency } from '../constants';
2
2
  export declare const defaultHeaders: any;
3
3
  export declare const getHeaders: (ctx: any) => any;
4
4
  export declare const setHeaders: (ctx: any, _headers: any) => void;
5
- export declare const getWorkspace: (ctx: any) => string;
5
+ export declare const getWorkspace: (ctx: any) => any;
6
6
  export declare const setWorkspace: (ctx: any, ws: string) => void;
7
7
  export declare const flushWorkspace: (ctx: any) => void;
8
8
  export declare const flushAll: (ctx: any) => void;
@@ -37,7 +37,7 @@ _export(exports, {
37
37
  return setWorkspace;
38
38
  }
39
39
  });
40
- const _nookies = require("nookies");
40
+ const _fixefycookies = require("@fixefy/fixefy-cookies");
41
41
  function _define_property(obj, key, value) {
42
42
  if (key in obj) {
43
43
  Object.defineProperty(obj, key, {
@@ -104,7 +104,7 @@ const defaultHeaders = {
104
104
  'last-activity': 0
105
105
  };
106
106
  const getHeaders = (ctx)=>{
107
- let _headers = (0, _nookies.parseCookies)(ctx)['fixefy:headers'];
107
+ let _headers = _fixefycookies.CookieHelper.get(ctx, 'fixefy:headers');
108
108
  _headers = _headers && typeof _headers === 'string' ? JSON.parse(_headers) : typeof _headers === 'object' ? _headers : {};
109
109
  const headers = _object_spread_props(_object_spread({}, _headers, defaultHeaders), {
110
110
  ws: getWorkspace(ctx),
@@ -114,30 +114,19 @@ const getHeaders = (ctx)=>{
114
114
  return headers;
115
115
  };
116
116
  const setHeaders = (ctx, _headers)=>{
117
- if (typeof _headers == 'string') (0, _nookies.setCookie)(ctx, 'fixefy:headers', _object_spread({}, JSON.parse(_headers)), {
118
- maxAge: 7 * 24 * 60 * 60,
119
- path: '/'
120
- });
121
- else (0, _nookies.setCookie)(ctx, 'fixefy:headers', _object_spread({}, _headers), {
122
- maxAge: 7 * 24 * 60 * 60,
123
- path: '/'
124
- });
117
+ if (typeof _headers == 'string') _fixefycookies.CookieHelper.set(ctx, 'fixefy:headers', JSON.stringify(_object_spread({}, JSON.parse(_headers))));
118
+ else _fixefycookies.CookieHelper.set(ctx, 'fixefy:headers', JSON.stringify(_object_spread({}, _headers)));
125
119
  };
126
120
  const getWorkspace = (ctx)=>{
127
- var _parseCookies_ws;
128
- const rv = (_parseCookies_ws = (0, _nookies.parseCookies)(ctx)['ws']) !== null && _parseCookies_ws !== void 0 ? _parseCookies_ws : defaultHeaders['ws'];
121
+ var _CookieHelper_get;
122
+ const rv = (_CookieHelper_get = _fixefycookies.CookieHelper.get(ctx, 'ws')) !== null && _CookieHelper_get !== void 0 ? _CookieHelper_get : defaultHeaders['ws'];
129
123
  return rv;
130
124
  };
131
125
  const setWorkspace = (ctx, ws)=>{
132
- (0, _nookies.setCookie)(ctx, 'ws', ws, {
133
- maxAge: 7 * 24 * 60 * 60,
134
- path: '/'
135
- });
126
+ _fixefycookies.CookieHelper.set(ctx, 'ws', ws);
136
127
  };
137
128
  const flushWorkspace = (ctx)=>{
138
- (0, _nookies.destroyCookie)(ctx, 'ws', {
139
- path: '/'
140
- });
129
+ _fixefycookies.CookieHelper.delete(ctx, 'ws');
141
130
  };
142
131
  const flushAll = (ctx)=>{
143
132
  // flushLastActivity(ctx)
@@ -145,14 +134,11 @@ const flushAll = (ctx)=>{
145
134
  flushWorkspace(ctx);
146
135
  };
147
136
  const setCurrency = (ctx, currency)=>{
148
- (0, _nookies.setCookie)(ctx, 'cur', JSON.stringify(currency), {
149
- maxAge: 7 * 24 * 60 * 60,
150
- path: '/'
151
- });
137
+ _fixefycookies.CookieHelper.set(ctx, 'cur', JSON.stringify(currency));
152
138
  };
153
139
  const getCurrency = (ctx)=>{
154
- var _parseCookies_cur;
155
- const cur = (_parseCookies_cur = (0, _nookies.parseCookies)(ctx)['cur']) !== null && _parseCookies_cur !== void 0 ? _parseCookies_cur : defaultHeaders['cur'];
140
+ var _CookieHelper_get;
141
+ const cur = (_CookieHelper_get = _fixefycookies.CookieHelper.get(ctx, 'cur')) !== null && _CookieHelper_get !== void 0 ? _CookieHelper_get : defaultHeaders['cur'];
156
142
  if (cur) {
157
143
  if (cur === 'usd' || cur === 'eur') {
158
144
  setCurrency(ctx, defaultHeaders['cur']);
@@ -498,7 +498,7 @@ const palette = {
498
498
  approved: {
499
499
  border: '#27AE60',
500
500
  background: '#27AE60',
501
- light: '#D4EFDF'
501
+ light: '#EEF9F2'
502
502
  },
503
503
  created: {
504
504
  border: '#87ACB6',
@@ -508,7 +508,7 @@ const palette = {
508
508
  credited: {
509
509
  border: '#EC6AC8',
510
510
  background: '#EC6AC8',
511
- light: '#FBF6FD'
511
+ light: '#FDF0F9'
512
512
  },
513
513
  credit_invoices: {
514
514
  border: '#6D60E8',
@@ -516,14 +516,14 @@ const palette = {
516
516
  light: '#F0EFFD'
517
517
  },
518
518
  declined: {
519
- border: '#EB5757',
520
- background: '#EB5757',
519
+ border: '#C42A20',
520
+ background: '#C42A20',
521
521
  light: '#FEF6F6'
522
522
  },
523
523
  in_dispute: {
524
524
  border: '#EB5757',
525
525
  background: '#EB5757',
526
- light: '#FCEBDB'
526
+ light: '#FEF6F6'
527
527
  },
528
528
  in_progress: {
529
529
  border: '#56CCF2',
@@ -541,34 +541,34 @@ const palette = {
541
541
  light: '#FBF6FD'
542
542
  },
543
543
  partially_approved: {
544
- border: '#88C00D',
545
- background: '#88C00D',
546
- light: '#F6FAEC'
544
+ border: '#E93A2E',
545
+ background: '#E93A2E',
546
+ light: '#FEF6F6'
547
547
  },
548
548
  partially_credited: {
549
- border: '#EC6AC8',
550
- background: '#EC6AC8',
551
- light: '#FEF3FB'
549
+ border: '#AE5395',
550
+ background: '#AE5395',
551
+ light: '#FBF6FD'
552
552
  },
553
553
  pending: {
554
554
  border: '#2D9CDB',
555
555
  background: '#2D9CDB',
556
- light: '#F1FBFE'
556
+ light: '#F3F9FD'
557
557
  },
558
558
  pending_credit: {
559
- border: '#ef8ed4',
560
- background: '#ef8ed4',
559
+ border: '#EF8ED4',
560
+ background: '#EF8ED4',
561
561
  light: '#FEF3FB'
562
562
  },
563
563
  pending_resolution: {
564
- border: '#F2994A',
565
- background: '#F2994A',
564
+ border: '#EC7A30',
565
+ background: '#EC7A30',
566
566
  light: '#FEF7F1'
567
567
  },
568
568
  pending_review: {
569
- border: '#2D9CDB',
570
- background: '#2D9CDB',
571
- light: '#F1FBFE'
569
+ border: '#568793',
570
+ background: '#568793',
571
+ light: '#F3F9FD'
572
572
  },
573
573
  pending_refund: {
574
574
  border: '#88C00D',
@@ -583,7 +583,7 @@ const palette = {
583
583
  resolved: {
584
584
  border: '#6FCF97',
585
585
  background: '#6FCF97',
586
- light: '#F0FAF4'
586
+ light: '#EEF9F2'
587
587
  },
588
588
  submitted_for_billing: {
589
589
  border: '#88C00D',
@@ -604,7 +604,7 @@ const palette = {
604
604
  credited: {
605
605
  border: '#EC6AC8',
606
606
  background: '#EC6AC8',
607
- light: '#FBF6FD'
607
+ light: '#FDF0F9'
608
608
  },
609
609
  in_progress: {
610
610
  border: '#EE6868',
@@ -617,19 +617,19 @@ const palette = {
617
617
  light: '#F3F9FD'
618
618
  },
619
619
  pending_credit: {
620
- border: '#ef8ed4',
621
- background: '#ef8ed4',
620
+ border: '#EF8ED4',
621
+ background: '#EF8ED4',
622
622
  light: '#FEF3FB'
623
623
  },
624
624
  pending_resolution: {
625
- border: '#F2994A',
626
- background: '#F2994A',
625
+ border: '#EC7A30',
626
+ background: '#EC7A30',
627
627
  light: '#FEF7F1'
628
628
  },
629
629
  approved: {
630
- border: '#88C00D',
631
- background: '#88C00D',
632
- light: '#F6FAEC'
630
+ border: '#F08989',
631
+ background: '#F08989',
632
+ light: '#FEF6F6'
633
633
  },
634
634
  declined: {
635
635
  border: '#F2994A',
@@ -637,14 +637,14 @@ const palette = {
637
637
  light: '#FEF7F1'
638
638
  },
639
639
  partially_approved: {
640
- border: '#88C00D',
641
- background: '#88C00D',
642
- light: '#F6FAEC'
640
+ border: '#E93A2E',
641
+ background: '#E93A2E',
642
+ light: '#FEF6F6'
643
643
  },
644
644
  partially_credited: {
645
- border: '#EC6AC8',
646
- background: '#EC6AC8',
647
- light: '#FEF3FB'
645
+ border: '#AE5395',
646
+ background: '#AE5395',
647
+ light: '#FBF6FD'
648
648
  },
649
649
  refunded: {
650
650
  border: '#EC6AC8',
@@ -652,8 +652,8 @@ const palette = {
652
652
  light: '#FBF6FD'
653
653
  },
654
654
  rejected: {
655
- border: '#EB5757',
656
- background: '#EB5757',
655
+ border: '#C42A20',
656
+ background: '#C42A20',
657
657
  light: '#FEF6F6'
658
658
  },
659
659
  closed: {
@@ -663,7 +663,7 @@ const palette = {
663
663
  resolved: {
664
664
  border: '#6FCF97',
665
665
  background: '#6FCF97',
666
- light: '#F0FAF4'
666
+ light: '#EEF9F2'
667
667
  },
668
668
  submitted_for_billing: {
669
669
  border: '#88C00D',
@@ -32,6 +32,7 @@ export type InvoiceStateType = {
32
32
  pending: string;
33
33
  pending_credit: string;
34
34
  pending_resolution: string;
35
+ pending_review: string;
35
36
  resolved: string;
36
37
  };
37
38
  export type RecoStateType = {
package/package.json CHANGED
@@ -4,6 +4,7 @@
4
4
  "fs": false
5
5
  },
6
6
  "peerDependencies": {
7
+ "@fixefy/fixefy-cookies": ">=0.1.0",
7
8
  "@fixefy/fixefy-entities": ">=0.1.20",
8
9
  "@fixefy/fixefy-numeric": ">=0.1.3",
9
10
  "@fixefy/fixefy-validate": ">=0.1.25",
@@ -15,7 +16,6 @@
15
16
  "graphql-tag": ">=2.12.6",
16
17
  "jss": ">=10.10.0",
17
18
  "next": ">=14.2.26",
18
- "nookies": ">=2.5.2",
19
19
  "pluralize": ">=8.0.0",
20
20
  "react": ">=18.3.1",
21
21
  "react-dom": ">=18.3.1",
@@ -59,7 +59,6 @@
59
59
  "files": [
60
60
  "dist/**/*"
61
61
  ],
62
- "private": false,
63
62
  "main": "./dist/index.js",
64
63
  "module": "./dist/index.js",
65
64
  "exports": {
@@ -68,5 +67,5 @@
68
67
  "require": "./dist/index.js"
69
68
  }
70
69
  },
71
- "version": "0.2.73"
70
+ "version": "0.2.74"
72
71
  }