@fixefy/fixefy-ui-utils 0.2.72 → 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']);
@@ -250,9 +250,14 @@ declare module '@mui/material/styles' {
250
250
  in_progress: StatusColorOption;
251
251
  in_review: StatusColorOption;
252
252
  no_pricing: StatusColorOption;
253
+ partially_approved: StatusColorOption;
254
+ partially_credited: StatusColorOption;
253
255
  pending: StatusColorOption;
256
+ pending_credit: StatusColorOption;
257
+ pending_resolution: StatusColorOption;
254
258
  pending_review: StatusColorOption;
255
259
  pending_refund: StatusColorOption;
260
+ rejected: StatusColorOption;
256
261
  resolved: StatusColorOption;
257
262
  submitted_for_billing: StatusColorOption;
258
263
  }
@@ -266,11 +271,16 @@ declare module '@mui/material/styles' {
266
271
  in_progress: StatusColorOption;
267
272
  paid: StatusColorOption;
268
273
  paid_and_refunded: StatusColorOption;
274
+ partially_approved: StatusColorOption;
275
+ partially_credited: StatusColorOption;
269
276
  pending: StatusColorOption;
277
+ pending_credit: StatusColorOption;
278
+ pending_resolution: StatusColorOption;
270
279
  pending_review: StatusColorOption;
271
280
  pending_refund: StatusColorOption;
272
281
  closed: StatusColorOption;
273
282
  refunded: StatusColorOption;
283
+ rejected: StatusColorOption;
274
284
  resolved: StatusColorOption;
275
285
  low: StatusColorOption;
276
286
  }
@@ -280,25 +290,37 @@ declare module '@mui/material/styles' {
280
290
  created: StatusColorOption;
281
291
  credited: StatusColorOption;
282
292
  credit_invoices: StatusColorOption;
293
+ declined: StatusColorOption;
283
294
  in_dispute: StatusColorOption;
284
295
  in_progress: StatusColorOption;
285
296
  paid: StatusColorOption;
286
297
  paid_and_refunded: StatusColorOption;
298
+ partially_approved: StatusColorOption;
299
+ partially_credited: StatusColorOption;
287
300
  pending: StatusColorOption;
301
+ pending_credit: StatusColorOption;
302
+ pending_resolution: StatusColorOption;
288
303
  pending_review: StatusColorOption;
289
304
  pending_refund: StatusColorOption;
290
305
  closed: StatusColorOption;
306
+ resolved: StatusColorOption;
291
307
  submitted_for_billing: StatusColorOption;
292
308
  }
293
309
  interface RecosStatesPaletteColorOptions {
294
310
  billed: StatusColorOption;
295
311
  created: StatusColorOption;
312
+ credited: StatusColorOption;
296
313
  in_progress: StatusColorOption;
297
314
  approved: StatusColorOption;
298
315
  declined: StatusColorOption;
316
+ partially_approved: StatusColorOption;
317
+ partially_credited: StatusColorOption;
318
+ pending: StatusColorOption;
319
+ pending_credit: StatusColorOption;
320
+ pending_resolution: StatusColorOption;
299
321
  refunded: StatusColorOption;
322
+ rejected: StatusColorOption;
300
323
  closed: StatusColorOption;
301
- pending: StatusColorOption;
302
324
  resolved: StatusColorOption;
303
325
  submitted_for_billing: StatusColorOption;
304
326
  }
@@ -360,11 +360,27 @@ const palette = {
360
360
  border: '#BBBBBB',
361
361
  background: '#FAFAFA'
362
362
  },
363
+ partially_approved: {
364
+ border: '#88C00D',
365
+ background: '#F6FAEC'
366
+ },
367
+ partially_credited: {
368
+ border: '#EC6AC8',
369
+ background: '#FEF3FB'
370
+ },
363
371
  pending: {
364
372
  border: '#2D9CDB',
365
373
  background: '#F3F9FD',
366
374
  light: '#F1FBFE'
367
375
  },
376
+ pending_credit: {
377
+ border: '#f9c9eb',
378
+ background: '#FEF3FB'
379
+ },
380
+ pending_resolution: {
381
+ border: '#F7C08F',
382
+ background: '#FEFAF6'
383
+ },
368
384
  pending_review: {
369
385
  border: '#2D9CDB',
370
386
  background: '#F1FBFE'
@@ -374,6 +390,10 @@ const palette = {
374
390
  background: '#F1FBFE',
375
391
  light: '#F1FBFE'
376
392
  },
393
+ rejected: {
394
+ border: '#EB5757',
395
+ background: '#FEF6F6'
396
+ },
377
397
  resolved: {
378
398
  border: '#BB6BD9',
379
399
  background: '#FAF6FE'
@@ -396,6 +416,14 @@ const palette = {
396
416
  border: '#ECC631',
397
417
  background: '#ECC631'
398
418
  },
419
+ pending_credit: {
420
+ border: '#ef8ed4',
421
+ background: '#ef8ed4'
422
+ },
423
+ pending_resolution: {
424
+ border: '#F2994A',
425
+ background: '#F2994A'
426
+ },
399
427
  pending_review: {
400
428
  border: '#2D9CDB',
401
429
  background: '#2D9CDB'
@@ -432,6 +460,14 @@ const palette = {
432
460
  border: '#BB6BD9',
433
461
  background: '#BB6BD9'
434
462
  },
463
+ partially_approved: {
464
+ border: '#88C00D',
465
+ background: '#88C00D'
466
+ },
467
+ partially_credited: {
468
+ border: '#EC6AC8',
469
+ background: '#EC6AC8'
470
+ },
435
471
  pending_refund: {
436
472
  border: '#2D9CDB',
437
473
  background: '#2D9CDB',
@@ -445,6 +481,10 @@ const palette = {
445
481
  border: '#BB6BD9',
446
482
  background: '#BB6BD9'
447
483
  },
484
+ rejected: {
485
+ border: '#EB5757',
486
+ background: '#EB5757'
487
+ },
448
488
  resolved: {
449
489
  border: '#BB6BD9',
450
490
  background: '#BB6BD9'
@@ -458,7 +498,7 @@ const palette = {
458
498
  approved: {
459
499
  border: '#27AE60',
460
500
  background: '#27AE60',
461
- light: '#D4EFDF'
501
+ light: '#EEF9F2'
462
502
  },
463
503
  created: {
464
504
  border: '#87ACB6',
@@ -468,17 +508,22 @@ const palette = {
468
508
  credited: {
469
509
  border: '#EC6AC8',
470
510
  background: '#EC6AC8',
471
- light: '#FBF6FD'
511
+ light: '#FDF0F9'
472
512
  },
473
513
  credit_invoices: {
474
514
  border: '#6D60E8',
475
515
  background: '#6D60E8',
476
516
  light: '#F0EFFD'
477
517
  },
518
+ declined: {
519
+ border: '#C42A20',
520
+ background: '#C42A20',
521
+ light: '#FEF6F6'
522
+ },
478
523
  in_dispute: {
479
524
  border: '#EB5757',
480
525
  background: '#EB5757',
481
- light: '#FCEBDB'
526
+ light: '#FEF6F6'
482
527
  },
483
528
  in_progress: {
484
529
  border: '#56CCF2',
@@ -495,15 +540,35 @@ const palette = {
495
540
  background: '#BB6BD9',
496
541
  light: '#FBF6FD'
497
542
  },
543
+ partially_approved: {
544
+ border: '#E93A2E',
545
+ background: '#E93A2E',
546
+ light: '#FEF6F6'
547
+ },
548
+ partially_credited: {
549
+ border: '#AE5395',
550
+ background: '#AE5395',
551
+ light: '#FBF6FD'
552
+ },
498
553
  pending: {
499
554
  border: '#2D9CDB',
500
555
  background: '#2D9CDB',
501
- light: '#F1FBFE'
556
+ light: '#F3F9FD'
557
+ },
558
+ pending_credit: {
559
+ border: '#EF8ED4',
560
+ background: '#EF8ED4',
561
+ light: '#FEF3FB'
562
+ },
563
+ pending_resolution: {
564
+ border: '#EC7A30',
565
+ background: '#EC7A30',
566
+ light: '#FEF7F1'
502
567
  },
503
568
  pending_review: {
504
- border: '#2D9CDB',
505
- background: '#2D9CDB',
506
- light: '#F1FBFE'
569
+ border: '#568793',
570
+ background: '#568793',
571
+ light: '#F3F9FD'
507
572
  },
508
573
  pending_refund: {
509
574
  border: '#88C00D',
@@ -515,6 +580,11 @@ const palette = {
515
580
  background: '#8B9092',
516
581
  light: '#FBF6FD'
517
582
  },
583
+ resolved: {
584
+ border: '#6FCF97',
585
+ background: '#6FCF97',
586
+ light: '#EEF9F2'
587
+ },
518
588
  submitted_for_billing: {
519
589
  border: '#88C00D',
520
590
  background: '#88C00D',
@@ -531,6 +601,11 @@ const palette = {
531
601
  border: '#87ACB6',
532
602
  background: '#87ACB6'
533
603
  },
604
+ credited: {
605
+ border: '#EC6AC8',
606
+ background: '#EC6AC8',
607
+ light: '#FDF0F9'
608
+ },
534
609
  in_progress: {
535
610
  border: '#EE6868',
536
611
  background: '#EE6868',
@@ -541,21 +616,46 @@ const palette = {
541
616
  background: '#2D9CDB',
542
617
  light: '#F3F9FD'
543
618
  },
619
+ pending_credit: {
620
+ border: '#EF8ED4',
621
+ background: '#EF8ED4',
622
+ light: '#FEF3FB'
623
+ },
624
+ pending_resolution: {
625
+ border: '#EC7A30',
626
+ background: '#EC7A30',
627
+ light: '#FEF7F1'
628
+ },
544
629
  approved: {
545
- border: '#88C00D',
546
- background: '#88C00D',
547
- light: '#F6FAEC'
630
+ border: '#F08989',
631
+ background: '#F08989',
632
+ light: '#FEF6F6'
548
633
  },
549
634
  declined: {
550
635
  border: '#F2994A',
551
636
  background: '#F2994A',
552
637
  light: '#FEF7F1'
553
638
  },
639
+ partially_approved: {
640
+ border: '#E93A2E',
641
+ background: '#E93A2E',
642
+ light: '#FEF6F6'
643
+ },
644
+ partially_credited: {
645
+ border: '#AE5395',
646
+ background: '#AE5395',
647
+ light: '#FBF6FD'
648
+ },
554
649
  refunded: {
555
650
  border: '#EC6AC8',
556
651
  background: '#EC6AC8',
557
652
  light: '#FBF6FD'
558
653
  },
654
+ rejected: {
655
+ border: '#C42A20',
656
+ background: '#C42A20',
657
+ light: '#FEF6F6'
658
+ },
559
659
  closed: {
560
660
  border: '#8B9092',
561
661
  background: '#8B9092'
@@ -563,7 +663,7 @@ const palette = {
563
663
  resolved: {
564
664
  border: '#6FCF97',
565
665
  background: '#6FCF97',
566
- light: '#F0FAF4'
666
+ light: '#EEF9F2'
567
667
  },
568
668
  submitted_for_billing: {
569
669
  border: '#88C00D',
@@ -7,28 +7,49 @@ export type ChargeStateType = {
7
7
  archived: string;
8
8
  challenge: string;
9
9
  closed: string;
10
+ declined: string;
10
11
  discrepancy: string;
11
12
  duplicated: string;
12
13
  in_dispute: string;
13
14
  no_pricing: string;
15
+ partially_approved: string;
14
16
  pending: string;
17
+ pending_credit: string;
18
+ pending_resolution: string;
15
19
  refunded: string;
20
+ rejected: string;
16
21
  };
17
22
  export type InvoiceStateType = {
18
23
  approved: string;
19
24
  created: string;
25
+ credited: string;
20
26
  declined: string;
21
27
  in_dispute: string;
22
28
  in_progress: string;
23
29
  paid: string;
30
+ partially_approved: string;
31
+ partially_credited: string;
32
+ pending: string;
33
+ pending_credit: string;
34
+ pending_resolution: string;
35
+ pending_review: string;
36
+ resolved: string;
24
37
  };
25
38
  export type RecoStateType = {
26
39
  approved: string;
27
40
  closed: string;
28
41
  created: string;
42
+ credited: string;
29
43
  declined: string;
30
44
  in_progress: string;
45
+ partially_approved: string;
46
+ partially_credited: string;
47
+ pending: string;
48
+ pending_credit: string;
49
+ pending_resolution: string;
31
50
  refunded: string;
51
+ rejected: string;
52
+ resolved: string;
32
53
  };
33
54
  export type ScoreType = {
34
55
  excellent: string;
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.72"
70
+ "version": "0.2.74"
72
71
  }