monkey-front-core 0.0.291 → 0.0.293

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
+ CPF: CountryMasks.RUT1,
149
+ CNPJ: 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)
@@ -750,53 +806,6 @@ var validateUtils = /*#__PURE__*/Object.freeze({
750
806
  DateRangeValidator: DateRangeValidator
751
807
  });
752
808
 
753
- /* eslint-disable no-unused-vars */
754
- /* eslint-disable no-shadow */
755
- var MonkeyEcxQueueEvents;
756
- (function (MonkeyEcxQueueEvents) {
757
- MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["OnGoing"] = 0] = "OnGoing";
758
- MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["Finished"] = 1] = "Finished";
759
- MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["FinishedWithError"] = 2] = "FinishedWithError";
760
- })(MonkeyEcxQueueEvents || (MonkeyEcxQueueEvents = {}));
761
- var MonkeyEcxDownloadEvents;
762
- (function (MonkeyEcxDownloadEvents) {
763
- MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["OnGoing"] = 0] = "OnGoing";
764
- MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["Finished"] = 1] = "Finished";
765
- MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["FinishedWithError"] = 2] = "FinishedWithError";
766
- })(MonkeyEcxDownloadEvents || (MonkeyEcxDownloadEvents = {}));
767
- var MonkeyEcxUploadEvents;
768
- (function (MonkeyEcxUploadEvents) {
769
- MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["OnGoing"] = 0] = "OnGoing";
770
- MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["Finished"] = 1] = "Finished";
771
- MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["FinishedWithError"] = 2] = "FinishedWithError";
772
- })(MonkeyEcxUploadEvents || (MonkeyEcxUploadEvents = {}));
773
- // TODO pegar do json de config
774
- var ApiEndPointsTokenNotMandatory;
775
- (function (ApiEndPointsTokenNotMandatory) {
776
- ApiEndPointsTokenNotMandatory["Assets"] = "assets/";
777
- ApiEndPointsTokenNotMandatory["MonkeyEcx"] = "/monkeyecx";
778
- ApiEndPointsTokenNotMandatory["ViaCep"] = "viacep.com.br/";
779
- })(ApiEndPointsTokenNotMandatory || (ApiEndPointsTokenNotMandatory = {}));
780
- // TODO pegar do json de config
781
- var ApiEndPointsHeaderNotMandatory;
782
- (function (ApiEndPointsHeaderNotMandatory) {
783
- ApiEndPointsHeaderNotMandatory["Assets"] = "/assets";
784
- ApiEndPointsHeaderNotMandatory["PayablesUpload"] = "payables-upload";
785
- ApiEndPointsHeaderNotMandatory["PictureUser"] = "/user-pictures";
786
- ApiEndPointsHeaderNotMandatory["Documents"] = "documents/";
787
- ApiEndPointsHeaderNotMandatory["BuyerTaxFile"] = "/buyer-tax-file";
788
- ApiEndPointsHeaderNotMandatory["ViaCep"] = "viacep.com.br/";
789
- })(ApiEndPointsHeaderNotMandatory || (ApiEndPointsHeaderNotMandatory = {}));
790
-
791
- var statics = /*#__PURE__*/Object.freeze({
792
- __proto__: null,
793
- get MonkeyEcxQueueEvents () { return MonkeyEcxQueueEvents; },
794
- get MonkeyEcxDownloadEvents () { return MonkeyEcxDownloadEvents; },
795
- get MonkeyEcxUploadEvents () { return MonkeyEcxUploadEvents; },
796
- get ApiEndPointsTokenNotMandatory () { return ApiEndPointsTokenNotMandatory; },
797
- get ApiEndPointsHeaderNotMandatory () { return ApiEndPointsHeaderNotMandatory; }
798
- });
799
-
800
809
  function buildQueuePropertys(queue) {
801
810
  const params = {
802
811
  item: {