monkey-front-core 0.0.290 → 0.0.292

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.
@@ -69,15 +69,62 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
69
69
  }]
70
70
  }] });
71
71
 
72
+ /* eslint-disable no-unused-vars */
73
+ /* eslint-disable no-shadow */
74
+ var MonkeyEcxQueueEvents;
75
+ (function (MonkeyEcxQueueEvents) {
76
+ MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["OnGoing"] = 0] = "OnGoing";
77
+ MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["Finished"] = 1] = "Finished";
78
+ MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["FinishedWithError"] = 2] = "FinishedWithError";
79
+ })(MonkeyEcxQueueEvents || (MonkeyEcxQueueEvents = {}));
80
+ var MonkeyEcxDownloadEvents;
81
+ (function (MonkeyEcxDownloadEvents) {
82
+ MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["OnGoing"] = 0] = "OnGoing";
83
+ MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["Finished"] = 1] = "Finished";
84
+ MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["FinishedWithError"] = 2] = "FinishedWithError";
85
+ })(MonkeyEcxDownloadEvents || (MonkeyEcxDownloadEvents = {}));
86
+ var MonkeyEcxUploadEvents;
87
+ (function (MonkeyEcxUploadEvents) {
88
+ MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["OnGoing"] = 0] = "OnGoing";
89
+ MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["Finished"] = 1] = "Finished";
90
+ MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["FinishedWithError"] = 2] = "FinishedWithError";
91
+ })(MonkeyEcxUploadEvents || (MonkeyEcxUploadEvents = {}));
92
+ // TODO pegar do json de config
93
+ var ApiEndPointsTokenNotMandatory;
94
+ (function (ApiEndPointsTokenNotMandatory) {
95
+ ApiEndPointsTokenNotMandatory["Assets"] = "assets/";
96
+ ApiEndPointsTokenNotMandatory["MonkeyEcx"] = "/monkeyecx";
97
+ ApiEndPointsTokenNotMandatory["ViaCep"] = "viacep.com.br/";
98
+ })(ApiEndPointsTokenNotMandatory || (ApiEndPointsTokenNotMandatory = {}));
99
+ // TODO pegar do json de config
100
+ var ApiEndPointsHeaderNotMandatory;
101
+ (function (ApiEndPointsHeaderNotMandatory) {
102
+ ApiEndPointsHeaderNotMandatory["Assets"] = "/assets";
103
+ ApiEndPointsHeaderNotMandatory["PayablesUpload"] = "payables-upload";
104
+ ApiEndPointsHeaderNotMandatory["PictureUser"] = "/user-pictures";
105
+ ApiEndPointsHeaderNotMandatory["Documents"] = "documents/";
106
+ ApiEndPointsHeaderNotMandatory["BuyerTaxFile"] = "/buyer-tax-file";
107
+ ApiEndPointsHeaderNotMandatory["ViaCep"] = "viacep.com.br/";
108
+ })(ApiEndPointsHeaderNotMandatory || (ApiEndPointsHeaderNotMandatory = {}));
109
+ var CountryMasks;
110
+ (function (CountryMasks) {
111
+ CountryMasks["CPF"] = "000.000.000-00";
112
+ CountryMasks["CNPJ"] = "00.000.000/0000-00";
113
+ CountryMasks["RUT1"] = "0000000-A";
114
+ CountryMasks["RUT2"] = "00000000-A";
115
+ })(CountryMasks || (CountryMasks = {}));
116
+
117
+ var statics = /*#__PURE__*/Object.freeze({
118
+ __proto__: null,
119
+ get MonkeyEcxQueueEvents () { return MonkeyEcxQueueEvents; },
120
+ get MonkeyEcxDownloadEvents () { return MonkeyEcxDownloadEvents; },
121
+ get MonkeyEcxUploadEvents () { return MonkeyEcxUploadEvents; },
122
+ get ApiEndPointsTokenNotMandatory () { return ApiEndPointsTokenNotMandatory; },
123
+ get ApiEndPointsHeaderNotMandatory () { return ApiEndPointsHeaderNotMandatory; },
124
+ get CountryMasks () { return CountryMasks; }
125
+ });
126
+
72
127
  /* eslint-disable comma-dangle */
73
- /* eslint-disable max-len */
74
- /* eslint-disable no-useless-escape */
75
- /* eslint-disable no-plusplus */
76
- /* eslint-disable no-cond-assign */
77
- /* eslint-disable eqeqeq */
78
- /* eslint-disable no-redeclare */
79
- /* eslint-disable vars-on-top */
80
- /* eslint-disable no-var */
81
128
  /* eslint-disable block-scoped-var */
82
129
  class MonkeyEcxUtils {
83
130
  static persistNullEmptyUndefined(tp) {
@@ -90,10 +137,19 @@ class MonkeyEcxUtils {
90
137
  return 'RUT';
91
138
  return doc.length <= 11 ? 'CPF' : 'CNPJ';
92
139
  }
93
- static getDocumentMask(type) {
94
- if (type === 'CPF')
95
- return '000.000.000-00';
96
- return '00.000.000/0000-00';
140
+ static getDocumentMask(type, country = '') {
141
+ return {
142
+ BR: {
143
+ CPF: CountryMasks.CPF,
144
+ CNPJ: CountryMasks.CNPJ,
145
+ '': `${CountryMasks.CPF}||${CountryMasks.CNPJ}`
146
+ },
147
+ CL: {
148
+ RUT1: CountryMasks.RUT1,
149
+ RUT2: CountryMasks.RUT2,
150
+ '': `${CountryMasks.RUT1}||${CountryMasks.RUT2}`
151
+ }
152
+ }[country.toUpperCase()]?.[type];
97
153
  }
98
154
  static formatDocumentWithMask(doc, withType, country) {
99
155
  if (!doc)
@@ -289,6 +345,13 @@ class MonkeyEcxUtils {
289
345
  const initialPath = window.location.origin;
290
346
  return (initialPath || '') === frontend;
291
347
  }
348
+ static replaceVariables(data, obj) {
349
+ let handled = data;
350
+ Object.entries(obj).forEach(([key, value]) => {
351
+ handled = handled.replace(new RegExp(`{${key}}`, 'g'), `${value}`);
352
+ });
353
+ return handled;
354
+ }
292
355
  }
293
356
 
294
357
  const moment$5 = moment_;
@@ -743,53 +806,6 @@ var validateUtils = /*#__PURE__*/Object.freeze({
743
806
  DateRangeValidator: DateRangeValidator
744
807
  });
745
808
 
746
- /* eslint-disable no-unused-vars */
747
- /* eslint-disable no-shadow */
748
- var MonkeyEcxQueueEvents;
749
- (function (MonkeyEcxQueueEvents) {
750
- MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["OnGoing"] = 0] = "OnGoing";
751
- MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["Finished"] = 1] = "Finished";
752
- MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["FinishedWithError"] = 2] = "FinishedWithError";
753
- })(MonkeyEcxQueueEvents || (MonkeyEcxQueueEvents = {}));
754
- var MonkeyEcxDownloadEvents;
755
- (function (MonkeyEcxDownloadEvents) {
756
- MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["OnGoing"] = 0] = "OnGoing";
757
- MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["Finished"] = 1] = "Finished";
758
- MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["FinishedWithError"] = 2] = "FinishedWithError";
759
- })(MonkeyEcxDownloadEvents || (MonkeyEcxDownloadEvents = {}));
760
- var MonkeyEcxUploadEvents;
761
- (function (MonkeyEcxUploadEvents) {
762
- MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["OnGoing"] = 0] = "OnGoing";
763
- MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["Finished"] = 1] = "Finished";
764
- MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["FinishedWithError"] = 2] = "FinishedWithError";
765
- })(MonkeyEcxUploadEvents || (MonkeyEcxUploadEvents = {}));
766
- // TODO pegar do json de config
767
- var ApiEndPointsTokenNotMandatory;
768
- (function (ApiEndPointsTokenNotMandatory) {
769
- ApiEndPointsTokenNotMandatory["Assets"] = "assets/";
770
- ApiEndPointsTokenNotMandatory["MonkeyEcx"] = "/monkeyecx";
771
- ApiEndPointsTokenNotMandatory["ViaCep"] = "viacep.com.br/";
772
- })(ApiEndPointsTokenNotMandatory || (ApiEndPointsTokenNotMandatory = {}));
773
- // TODO pegar do json de config
774
- var ApiEndPointsHeaderNotMandatory;
775
- (function (ApiEndPointsHeaderNotMandatory) {
776
- ApiEndPointsHeaderNotMandatory["Assets"] = "/assets";
777
- ApiEndPointsHeaderNotMandatory["PayablesUpload"] = "payables-upload";
778
- ApiEndPointsHeaderNotMandatory["PictureUser"] = "/user-pictures";
779
- ApiEndPointsHeaderNotMandatory["Documents"] = "documents/";
780
- ApiEndPointsHeaderNotMandatory["BuyerTaxFile"] = "/buyer-tax-file";
781
- ApiEndPointsHeaderNotMandatory["ViaCep"] = "viacep.com.br/";
782
- })(ApiEndPointsHeaderNotMandatory || (ApiEndPointsHeaderNotMandatory = {}));
783
-
784
- var statics = /*#__PURE__*/Object.freeze({
785
- __proto__: null,
786
- get MonkeyEcxQueueEvents () { return MonkeyEcxQueueEvents; },
787
- get MonkeyEcxDownloadEvents () { return MonkeyEcxDownloadEvents; },
788
- get MonkeyEcxUploadEvents () { return MonkeyEcxUploadEvents; },
789
- get ApiEndPointsTokenNotMandatory () { return ApiEndPointsTokenNotMandatory; },
790
- get ApiEndPointsHeaderNotMandatory () { return ApiEndPointsHeaderNotMandatory; }
791
- });
792
-
793
809
  function buildQueuePropertys(queue) {
794
810
  const params = {
795
811
  item: {