@infrab4a/connect 5.3.3-beta.0 → 5.3.3
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.
- package/index.cjs.js +8 -27
- package/index.esm.js +9 -28
- package/package.json +2 -1
- package/src/domain/catalog/models/product-base.d.ts +0 -1
package/index.cjs.js
CHANGED
|
@@ -10,6 +10,7 @@ var lodash = require('lodash');
|
|
|
10
10
|
var debug = require('debug');
|
|
11
11
|
var serializeJavascript = require('serialize-javascript');
|
|
12
12
|
var tsCustomError = require('ts-custom-error');
|
|
13
|
+
var dateFnsTz = require('date-fns-tz');
|
|
13
14
|
var axios = require('axios');
|
|
14
15
|
var auth = require('firebase/auth');
|
|
15
16
|
var tsMd5 = require('ts-md5');
|
|
@@ -1813,9 +1814,11 @@ class AntifraudCardService {
|
|
|
1813
1814
|
return true;
|
|
1814
1815
|
}
|
|
1815
1816
|
getTodayDateRange() {
|
|
1816
|
-
const
|
|
1817
|
-
const
|
|
1818
|
-
|
|
1817
|
+
const timeZone = 'America/Sao_Paulo';
|
|
1818
|
+
const today = dateFnsTz.toZonedTime(new Date(), timeZone);
|
|
1819
|
+
const startDay = dateFns.startOfDay(today);
|
|
1820
|
+
const endOfDay = dateFns.endOfDay(today);
|
|
1821
|
+
return { startDay, endOfDay };
|
|
1819
1822
|
}
|
|
1820
1823
|
async getBlockedOrdersByMultipleCriteria(checkout, dateRange) {
|
|
1821
1824
|
const { day, endOfDay } = dateRange;
|
|
@@ -7369,12 +7372,6 @@ const commonFields = [
|
|
|
7369
7372
|
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
7370
7373
|
},
|
|
7371
7374
|
},
|
|
7372
|
-
{
|
|
7373
|
-
imagesCard: {
|
|
7374
|
-
columnName: 'images_card',
|
|
7375
|
-
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
7376
|
-
},
|
|
7377
|
-
},
|
|
7378
7375
|
'name',
|
|
7379
7376
|
{
|
|
7380
7377
|
price: {
|
|
@@ -8246,24 +8243,8 @@ const fieldsConfiguration$1 = [
|
|
|
8246
8243
|
{ tagsCollection: { columnName: 'tags_collection', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8247
8244
|
{ tagsProfile: { columnName: 'tags_profile', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8248
8245
|
{ daysOfUse: { columnName: 'days_of_use' } },
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
columnName: 'images',
|
|
8252
|
-
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
8253
|
-
},
|
|
8254
|
-
},
|
|
8255
|
-
{
|
|
8256
|
-
miniatures: {
|
|
8257
|
-
columnName: 'miniatures',
|
|
8258
|
-
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
8259
|
-
},
|
|
8260
|
-
},
|
|
8261
|
-
{
|
|
8262
|
-
imagesCard: {
|
|
8263
|
-
columnName: 'images_card',
|
|
8264
|
-
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
8265
|
-
},
|
|
8266
|
-
},
|
|
8246
|
+
'images',
|
|
8247
|
+
'miniatures',
|
|
8267
8248
|
];
|
|
8268
8249
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
8269
8250
|
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
package/index.esm.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
2
|
import { __decorate, __metadata } from 'tslib';
|
|
3
3
|
import { plainToInstance, instanceToPlain, Type } from 'class-transformer';
|
|
4
|
-
import { parseISO,
|
|
4
|
+
import { parseISO, startOfDay, endOfDay, subDays, format, addDays } from 'date-fns';
|
|
5
5
|
export { add, addBusinessDays, addDays, addMonths, addYears, endOfDay, format, formatISO9075, parseISO, startOfDay, sub, subDays } from 'date-fns';
|
|
6
6
|
import { compact, get, isNil, isArray, first, last, flatten, isString, omit, each, unset, isObject, isEmpty, isDate, isBoolean, isInteger, isNumber, isNaN as isNaN$1, set, chunk, sortBy } from 'lodash';
|
|
7
7
|
export { chunk, each, get, isBoolean, isDate, isEmpty, isInteger, isNaN, isNil, isNumber, isObject, isString, now, omit, pick, set, sortBy, unset } from 'lodash';
|
|
8
8
|
import { debug } from 'debug';
|
|
9
9
|
import * as serializeJavascript from 'serialize-javascript';
|
|
10
10
|
import { CustomError } from 'ts-custom-error';
|
|
11
|
+
import { toZonedTime } from 'date-fns-tz';
|
|
11
12
|
import axios, { AxiosError } from 'axios';
|
|
12
13
|
import { signInWithEmailAndPassword, signInWithPopup, GoogleAuthProvider, browserPopupRedirectResolver, signInAnonymously, sendPasswordResetEmail, createUserWithEmailAndPassword, sendEmailVerification } from 'firebase/auth';
|
|
13
14
|
import { Md5 } from 'ts-md5';
|
|
@@ -1788,9 +1789,11 @@ class AntifraudCardService {
|
|
|
1788
1789
|
return true;
|
|
1789
1790
|
}
|
|
1790
1791
|
getTodayDateRange() {
|
|
1791
|
-
const
|
|
1792
|
-
const
|
|
1793
|
-
|
|
1792
|
+
const timeZone = 'America/Sao_Paulo';
|
|
1793
|
+
const today = toZonedTime(new Date(), timeZone);
|
|
1794
|
+
const startDay = startOfDay(today);
|
|
1795
|
+
const endOfDay$1 = endOfDay(today);
|
|
1796
|
+
return { startDay, endOfDay: endOfDay$1 };
|
|
1794
1797
|
}
|
|
1795
1798
|
async getBlockedOrdersByMultipleCriteria(checkout, dateRange) {
|
|
1796
1799
|
const { day, endOfDay } = dateRange;
|
|
@@ -7344,12 +7347,6 @@ const commonFields = [
|
|
|
7344
7347
|
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
7345
7348
|
},
|
|
7346
7349
|
},
|
|
7347
|
-
{
|
|
7348
|
-
imagesCard: {
|
|
7349
|
-
columnName: 'images_card',
|
|
7350
|
-
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
7351
|
-
},
|
|
7352
|
-
},
|
|
7353
7350
|
'name',
|
|
7354
7351
|
{
|
|
7355
7352
|
price: {
|
|
@@ -8221,24 +8218,8 @@ const fieldsConfiguration$1 = [
|
|
|
8221
8218
|
{ tagsCollection: { columnName: 'tags_collection', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8222
8219
|
{ tagsProfile: { columnName: 'tags_profile', type: HasuraGraphQLColumnType.Jsonb } },
|
|
8223
8220
|
{ daysOfUse: { columnName: 'days_of_use' } },
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
columnName: 'images',
|
|
8227
|
-
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
8228
|
-
},
|
|
8229
|
-
},
|
|
8230
|
-
{
|
|
8231
|
-
miniatures: {
|
|
8232
|
-
columnName: 'miniatures',
|
|
8233
|
-
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
8234
|
-
},
|
|
8235
|
-
},
|
|
8236
|
-
{
|
|
8237
|
-
imagesCard: {
|
|
8238
|
-
columnName: 'images_card',
|
|
8239
|
-
to: (value) => (value?.length > 0 ? `{"${value?.join?.('","') || ''}"}` : '{}'),
|
|
8240
|
-
},
|
|
8241
|
-
},
|
|
8221
|
+
'images',
|
|
8222
|
+
'miniatures',
|
|
8242
8223
|
];
|
|
8243
8224
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
8244
8225
|
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infrab4a/connect",
|
|
3
|
-
"version": "5.3.3
|
|
3
|
+
"version": "5.3.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org"
|
|
6
6
|
},
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"axios": "^0.27.2",
|
|
13
13
|
"class-transformer": "^0.5.1",
|
|
14
14
|
"date-fns": "^2.28.0",
|
|
15
|
+
"date-fns-tz": "^3.2.0",
|
|
15
16
|
"debug": "^4.3.4",
|
|
16
17
|
"firebase": "^9.22.0",
|
|
17
18
|
"gql-query-builder": "3.7.0",
|