@rocketlink/crm-model 1.0.129 → 1.0.131
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/dist/dtos/csv.request.dto.d.ts +0 -2
- package/dist/dtos/csv.request.dto.d.ts.map +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -9
- package/dist/model/hookOutbox.model.d.ts +0 -2
- package/dist/model/hookOutbox.model.d.ts.map +1 -1
- package/dist/model/recurringSettingConfig.model.d.ts +6 -2
- package/dist/model/recurringSettingConfig.model.d.ts.map +1 -1
- package/dist/model/recurringSettingConfig.model.js +5 -0
- package/dist/model/transaction.model.d.ts +0 -3
- package/dist/model/transaction.model.d.ts.map +1 -1
- package/dist/model/transaction.model.js +1 -2
- package/dist/util/constants.d.ts +0 -2
- package/dist/util/constants.d.ts.map +1 -1
- package/dist/util/constants.js +1 -3
- package/dist/util/{dateUtil.d.ts → dateUtils.d.ts} +5 -17
- package/dist/util/dateUtils.d.ts.map +1 -0
- package/dist/util/{dateUtil.js → dateUtils.js} +2 -79
- package/package.json +1 -1
- package/src/dtos/csv.request.dto.ts +0 -2
- package/src/index.ts +3 -5
- package/src/model/hookOutbox.model.ts +2 -4
- package/src/model/recurringSettingConfig.model.ts +6 -2
- package/src/model/transaction.model.ts +1 -4
- package/src/util/constants.ts +1 -5
- package/src/util/{dateUtil.ts → dateUtils.ts} +6 -110
- package/dist/dtos/job.request.dto.d.ts +0 -5
- package/dist/dtos/job.request.dto.d.ts.map +0 -1
- package/dist/dtos/job.request.dto.js +0 -2
- package/dist/model/job.model.d.ts +0 -6
- package/dist/model/job.model.d.ts.map +0 -1
- package/dist/model/job.model.js +0 -2
- package/dist/util/countryUtil.d.ts +0 -2
- package/dist/util/countryUtil.d.ts.map +0 -1
- package/dist/util/countryUtil.js +0 -7
- package/dist/util/dateUtil.d.ts.map +0 -1
- package/src/dtos/job.request.dto.ts +0 -5
- package/src/model/job.model.ts +0 -5
- package/src/util/countryUtil.ts +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csv.request.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/csv.request.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9D,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACnD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"csv.request.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/csv.request.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9D,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACnD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './util/constants';
|
|
2
|
-
export * from './util/
|
|
3
|
-
export { isDateString, dateToString, stringToDate, getCurrentDateCompacted, FORMATS } from './util/
|
|
2
|
+
export * from './util/dateUtils';
|
|
3
|
+
export { isDateString, dateToString, stringToDate, getCurrentDateCompacted, FORMATS } from './util/dateUtils';
|
|
4
4
|
export * from './util/numberUtils';
|
|
5
5
|
export * from './dtos/common/base.request.dto';
|
|
6
6
|
export * from './dtos/common/paginated.request.dto';
|
|
@@ -16,7 +16,6 @@ export * from './dtos/field.request.dto';
|
|
|
16
16
|
export * from './dtos/hook.request.dto';
|
|
17
17
|
export * from './dtos/hookProfile.request.dto';
|
|
18
18
|
export * from './dtos/hookOutbox.request.dto';
|
|
19
|
-
export * from './dtos/job.request.dto';
|
|
20
19
|
export * from './dtos/lead.request.dto';
|
|
21
20
|
export * from './dtos/mid.request.dto';
|
|
22
21
|
export * from './dtos/adapter.request.dto';
|
|
@@ -36,7 +35,6 @@ export * from './model/field.model';
|
|
|
36
35
|
export * from './model/gateway.model';
|
|
37
36
|
export * from './model/hook.model';
|
|
38
37
|
export * from './model/hookOutbox.model';
|
|
39
|
-
export * from './model/job.model';
|
|
40
38
|
export * from './model/hookProfile.model';
|
|
41
39
|
export * from './model/lead.model';
|
|
42
40
|
export * from './model/mid.model';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC9G,cAAc,oBAAoB,CAAC;AAGnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cA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AC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,iDAAiD,CAAC;AAChE,cAAc,8CAA8C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,13 +17,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.FORMATS = exports.getCurrentDateCompacted = exports.stringToDate = exports.dateToString = exports.isDateString = void 0;
|
|
18
18
|
// Export constants
|
|
19
19
|
__exportStar(require("./util/constants"), exports);
|
|
20
|
-
__exportStar(require("./util/
|
|
21
|
-
var
|
|
22
|
-
Object.defineProperty(exports, "isDateString", { enumerable: true, get: function () { return
|
|
23
|
-
Object.defineProperty(exports, "dateToString", { enumerable: true, get: function () { return
|
|
24
|
-
Object.defineProperty(exports, "stringToDate", { enumerable: true, get: function () { return
|
|
25
|
-
Object.defineProperty(exports, "getCurrentDateCompacted", { enumerable: true, get: function () { return
|
|
26
|
-
Object.defineProperty(exports, "FORMATS", { enumerable: true, get: function () { return
|
|
20
|
+
__exportStar(require("./util/dateUtils"), exports);
|
|
21
|
+
var dateUtils_1 = require("./util/dateUtils");
|
|
22
|
+
Object.defineProperty(exports, "isDateString", { enumerable: true, get: function () { return dateUtils_1.isDateString; } });
|
|
23
|
+
Object.defineProperty(exports, "dateToString", { enumerable: true, get: function () { return dateUtils_1.dateToString; } });
|
|
24
|
+
Object.defineProperty(exports, "stringToDate", { enumerable: true, get: function () { return dateUtils_1.stringToDate; } });
|
|
25
|
+
Object.defineProperty(exports, "getCurrentDateCompacted", { enumerable: true, get: function () { return dateUtils_1.getCurrentDateCompacted; } });
|
|
26
|
+
Object.defineProperty(exports, "FORMATS", { enumerable: true, get: function () { return dateUtils_1.FORMATS; } });
|
|
27
27
|
__exportStar(require("./util/numberUtils"), exports);
|
|
28
28
|
// Export all DTOs
|
|
29
29
|
__exportStar(require("./dtos/common/base.request.dto"), exports);
|
|
@@ -41,7 +41,6 @@ __exportStar(require("./dtos/field.request.dto"), exports);
|
|
|
41
41
|
__exportStar(require("./dtos/hook.request.dto"), exports);
|
|
42
42
|
__exportStar(require("./dtos/hookProfile.request.dto"), exports);
|
|
43
43
|
__exportStar(require("./dtos/hookOutbox.request.dto"), exports);
|
|
44
|
-
__exportStar(require("./dtos/job.request.dto"), exports);
|
|
45
44
|
__exportStar(require("./dtos/lead.request.dto"), exports);
|
|
46
45
|
__exportStar(require("./dtos/mid.request.dto"), exports);
|
|
47
46
|
__exportStar(require("./dtos/adapter.request.dto"), exports);
|
|
@@ -63,7 +62,6 @@ __exportStar(require("./model/field.model"), exports);
|
|
|
63
62
|
__exportStar(require("./model/gateway.model"), exports);
|
|
64
63
|
__exportStar(require("./model/hook.model"), exports);
|
|
65
64
|
__exportStar(require("./model/hookOutbox.model"), exports);
|
|
66
|
-
__exportStar(require("./model/job.model"), exports);
|
|
67
65
|
__exportStar(require("./model/hookProfile.model"), exports);
|
|
68
66
|
__exportStar(require("./model/lead.model"), exports);
|
|
69
67
|
__exportStar(require("./model/mid.model"), exports);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Campaign } from './campaign.model';
|
|
2
1
|
export declare const HOOK_OUTBOX_STATUS: {
|
|
3
2
|
PENDING: string;
|
|
4
3
|
SENT: string;
|
|
@@ -9,7 +8,6 @@ export interface HookOutbox {
|
|
|
9
8
|
id?: number;
|
|
10
9
|
hookId?: number;
|
|
11
10
|
campaignId?: number;
|
|
12
|
-
campaign?: Campaign;
|
|
13
11
|
triggerId?: string;
|
|
14
12
|
hookUrl?: string;
|
|
15
13
|
payloadJson?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hookOutbox.model.d.ts","sourceRoot":"","sources":["../../src/model/hookOutbox.model.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"hookOutbox.model.d.ts","sourceRoot":"","sources":["../../src/model/hookOutbox.model.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;CAI9B,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE9F,MAAM,WAAW,UAAU;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
export declare const INTERVAL_UNIT: {
|
|
2
|
+
readonly DAYS: "DAYS";
|
|
3
|
+
readonly MONTHS: "MONTHS";
|
|
4
|
+
};
|
|
5
|
+
export type INTERVAL_UNIT = (typeof INTERVAL_UNIT)[keyof typeof INTERVAL_UNIT];
|
|
2
6
|
export interface RecurringSettingConfig {
|
|
3
7
|
id?: number;
|
|
4
8
|
name?: string;
|
|
5
|
-
intervalUnit?:
|
|
9
|
+
intervalUnit?: INTERVAL_UNIT;
|
|
6
10
|
intervalPeriod?: number;
|
|
7
11
|
maxTriesAfterFailure?: number;
|
|
8
12
|
maxDelayPeriod?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recurringSettingConfig.model.d.ts","sourceRoot":"","sources":["../../src/model/recurringSettingConfig.model.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"recurringSettingConfig.model.d.ts","sourceRoot":"","sources":["../../src/model/recurringSettingConfig.model.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AACX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE/E,MAAM,WAAW,sBAAsB;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BANKS } from "./gateway.model";
|
|
2
|
-
import { Mid } from "./mid.model";
|
|
3
2
|
export declare const TRANSACTION_STATUS: {
|
|
4
3
|
PENDING_ASYNC: string;
|
|
5
4
|
SUCCESS: string;
|
|
@@ -17,7 +16,6 @@ export declare const PAYMENT_TYPE: {
|
|
|
17
16
|
SDD_SALE: string;
|
|
18
17
|
REFUND: string;
|
|
19
18
|
CHARGEBACK: string;
|
|
20
|
-
DEBIT: string;
|
|
21
19
|
};
|
|
22
20
|
export type PAYMENT_TYPE = (typeof PAYMENT_TYPE)[keyof typeof PAYMENT_TYPE];
|
|
23
21
|
export interface Transaction {
|
|
@@ -26,7 +24,6 @@ export interface Transaction {
|
|
|
26
24
|
amount?: string;
|
|
27
25
|
currency?: string;
|
|
28
26
|
midId?: number;
|
|
29
|
-
mid?: Mid;
|
|
30
27
|
orderId?: number;
|
|
31
28
|
internalPaymentType?: PAYMENT_TYPE;
|
|
32
29
|
internalTransactionType?: APP_TRANSACTION_TYPE;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.model.d.ts","sourceRoot":"","sources":["../../src/model/transaction.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"transaction.model.d.ts","sourceRoot":"","sources":["../../src/model/transaction.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,eAAO,MAAM,kBAAkB;;;;;CAK9B,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE9F,eAAO,MAAM,oBAAoB;;;;CAIhC,CAAC;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAEpG,eAAO,MAAM,YAAY;;;;CAIxB,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE5E,MAAM,WAAW,WAAW;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,mBAAmB,CAAC,EAAE,YAAY,CAAC;IACnC,uBAAuB,CAAC,EAAE,oBAAoB,CAAC;IAC/C,yBAAyB,CAAC,EAAE,kBAAkB,CAAC;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
package/dist/util/constants.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/util/constants.ts"],"names":[],"mappings":"AAAA,eA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C;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC"}
|
package/dist/util/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CURRENCIES = exports.SAFE_WHILE_LIMIT = exports.EVENTS = exports.SUBSCRIPTION_STATUS = exports.ORDER_STATUS_VALUES = exports.ORDER_STATUS = exports.TRANSACTION_TYPE_CODE = exports.TRANSACTION_TYPE_VALUES = exports.ALL = exports.TRANSACTION_TYPE = exports.OFFER_TYPE = exports.REGISTRATION_MODE = exports.CSV_ROW_STATUS = exports.CSV_STATUS = exports.CSV_TYPE_VALUES = exports.CSV_TYPES = exports.MIME_TYPES = exports.YES_NO = void 0;
|
|
4
4
|
exports.YES_NO = {
|
|
5
5
|
YES: "Y",
|
|
6
6
|
NO: "N",
|
|
@@ -85,5 +85,3 @@ exports.CURRENCIES = {
|
|
|
85
85
|
USD: "USD",
|
|
86
86
|
GBP: "GBP",
|
|
87
87
|
};
|
|
88
|
-
exports.MB_1 = 1 * 1024 * 1024;
|
|
89
|
-
exports.MAX_MB_STREAM_SIZE = exports.MB_1 * 5;
|
|
@@ -6,16 +6,10 @@ export declare const FORMATS: {
|
|
|
6
6
|
readonly COMPACT_DATETIME: "yyyyMMddHHmmss";
|
|
7
7
|
readonly COMPACT_DATE: "yyyyMMdd";
|
|
8
8
|
};
|
|
9
|
-
export declare
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export type INTERVAL_UNIT = (typeof INTERVAL_UNIT)[keyof typeof INTERVAL_UNIT];
|
|
14
|
-
export declare function dateToString(date?: Date, formatString?: string): string;
|
|
15
|
-
export declare function dateToYYYYMMDD(date?: Date): string;
|
|
16
|
-
export declare function dateToTZ(date?: Date): string;
|
|
17
|
-
export declare function dateToMinutes(date?: Date): string;
|
|
18
|
-
export declare function dateToMinutesSeconds(date?: Date): string;
|
|
9
|
+
export declare function dateToString(date: Date, formatString?: string): string;
|
|
10
|
+
export declare function dateToYYYYMMDD(date: Date): string;
|
|
11
|
+
export declare function dateToTZ(date: Date): string;
|
|
12
|
+
export declare function dateToMinutes(date: Date): string;
|
|
19
13
|
export declare function getCurrentDateCompacted(): string;
|
|
20
14
|
export declare function isDateString(value: string): boolean;
|
|
21
15
|
export declare function stringToDate(value: string): Date;
|
|
@@ -28,10 +22,4 @@ export declare function addDaysToDate(date: Date, days: number): Date;
|
|
|
28
22
|
export declare function subtractDaysFromDate(date: Date, days: number): Date;
|
|
29
23
|
export declare function addDaysToDateString(value: string, days: number, formatString?: string): string;
|
|
30
24
|
export declare function subtractDaysFromDateString(value: string, days: number, formatString?: string): string;
|
|
31
|
-
|
|
32
|
-
export declare function addPeriodToDate(date: Date, period: number, unit: INTERVAL_UNIT): Date;
|
|
33
|
-
export type FormatDateForUiOptions = {
|
|
34
|
-
includeSeconds?: boolean;
|
|
35
|
-
};
|
|
36
|
-
export declare function formatDateForUi(value: string | Date | null | undefined, options?: FormatDateForUiOptions): string;
|
|
37
|
-
//# sourceMappingURL=dateUtil.d.ts.map
|
|
25
|
+
//# sourceMappingURL=dateUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateUtils.d.ts","sourceRoot":"","sources":["../../src/util/dateUtils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO;;;;;;;CAOV,CAAC;AAIX,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,GAAE,MAAyB,GAAG,MAAM,CAKxF;AACD,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAEjD;AACD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE3C;AACD,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAEhD;AACD,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAGnD;AAID,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAShD;AAID,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,GAAE,MAAyB,GAAG,MAAM,CAM/F;AACD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3D;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAErD;AACD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE1D;AACD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE1D;AAKD,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAK5D;AACD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAKnE;AACD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,GAAE,MAAyB,GAAG,MAAM,CAIhH;AACD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,GAAE,MAAyB,GAAG,MAAM,CAIvH"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.FORMATS = void 0;
|
|
4
4
|
exports.dateToString = dateToString;
|
|
5
5
|
exports.dateToYYYYMMDD = dateToYYYYMMDD;
|
|
6
6
|
exports.dateToTZ = dateToTZ;
|
|
7
7
|
exports.dateToMinutes = dateToMinutes;
|
|
8
|
-
exports.dateToMinutesSeconds = dateToMinutesSeconds;
|
|
9
8
|
exports.getCurrentDateCompacted = getCurrentDateCompacted;
|
|
10
9
|
exports.isDateString = isDateString;
|
|
11
10
|
exports.stringToDate = stringToDate;
|
|
@@ -18,9 +17,6 @@ exports.addDaysToDate = addDaysToDate;
|
|
|
18
17
|
exports.subtractDaysFromDate = subtractDaysFromDate;
|
|
19
18
|
exports.addDaysToDateString = addDaysToDateString;
|
|
20
19
|
exports.subtractDaysFromDateString = subtractDaysFromDateString;
|
|
21
|
-
exports.addMonthsToDate = addMonthsToDate;
|
|
22
|
-
exports.addPeriodToDate = addPeriodToDate;
|
|
23
|
-
exports.formatDateForUi = formatDateForUi;
|
|
24
20
|
const date_fns_1 = require("date-fns");
|
|
25
21
|
exports.FORMATS = {
|
|
26
22
|
ISO_DATE: 'yyyy-MM-dd', // "2026-01-07"
|
|
@@ -30,16 +26,12 @@ exports.FORMATS = {
|
|
|
30
26
|
COMPACT_DATETIME: 'yyyyMMddHHmmss', // "20260107143000"
|
|
31
27
|
COMPACT_DATE: 'yyyyMMdd', // "20260107"
|
|
32
28
|
};
|
|
33
|
-
exports.INTERVAL_UNIT = {
|
|
34
|
-
DAYS: "DAYS",
|
|
35
|
-
MONTHS: "MONTHS",
|
|
36
|
-
};
|
|
37
29
|
// ============================================
|
|
38
30
|
// Date → String formatted conversions
|
|
39
31
|
// ============================================
|
|
40
32
|
function dateToString(date, formatString = exports.FORMATS.ISO_DATE) {
|
|
41
33
|
if (!date || !(0, date_fns_1.isValid)(date)) {
|
|
42
|
-
|
|
34
|
+
throw new Error('Invalid date: ' + date);
|
|
43
35
|
}
|
|
44
36
|
return (0, date_fns_1.format)(date, formatString);
|
|
45
37
|
}
|
|
@@ -52,9 +44,6 @@ function dateToTZ(date) {
|
|
|
52
44
|
function dateToMinutes(date) {
|
|
53
45
|
return dateToString(date, exports.FORMATS.ISO_DATE_TIME_MINUTES);
|
|
54
46
|
}
|
|
55
|
-
function dateToMinutesSeconds(date) {
|
|
56
|
-
return dateToString(date, exports.FORMATS.ISO_DATE_TIME_SECONDS);
|
|
57
|
-
}
|
|
58
47
|
function getCurrentDateCompacted() {
|
|
59
48
|
return dateToYYYYMMDD(new Date()); // "20260107143000"
|
|
60
49
|
}
|
|
@@ -123,69 +112,3 @@ function subtractDaysFromDateString(value, days, formatString = exports.FORMATS.
|
|
|
123
112
|
const newDate = (0, date_fns_1.subDays)(date, days);
|
|
124
113
|
return (0, date_fns_1.format)(newDate, formatString);
|
|
125
114
|
}
|
|
126
|
-
function addMonthsToDate(date, months) {
|
|
127
|
-
if (!date || !(0, date_fns_1.isValid)(date)) {
|
|
128
|
-
throw new Error('Invalid date: ' + date);
|
|
129
|
-
}
|
|
130
|
-
return (0, date_fns_1.addMonths)(date, months);
|
|
131
|
-
}
|
|
132
|
-
function addPeriodToDate(date, period, unit) {
|
|
133
|
-
if (!date || !(0, date_fns_1.isValid)(date)) {
|
|
134
|
-
throw new Error('Invalid date: ' + date);
|
|
135
|
-
}
|
|
136
|
-
if (unit === exports.INTERVAL_UNIT.MONTHS) {
|
|
137
|
-
date = addMonthsToDate(date, period);
|
|
138
|
-
}
|
|
139
|
-
else if (unit === exports.INTERVAL_UNIT.DAYS) {
|
|
140
|
-
date = addDaysToDate(date, period);
|
|
141
|
-
}
|
|
142
|
-
return date;
|
|
143
|
-
}
|
|
144
|
-
function formatDateForUi(value, options) {
|
|
145
|
-
if (!value)
|
|
146
|
-
return '-';
|
|
147
|
-
let date;
|
|
148
|
-
let hasTime = false;
|
|
149
|
-
let hasSeconds = false;
|
|
150
|
-
if (value instanceof Date) {
|
|
151
|
-
if (!(0, date_fns_1.isValid)(value))
|
|
152
|
-
return '-';
|
|
153
|
-
date = value;
|
|
154
|
-
hasSeconds = value.getSeconds() !== 0;
|
|
155
|
-
hasTime =
|
|
156
|
-
value.getHours() !== 0 ||
|
|
157
|
-
value.getMinutes() !== 0 ||
|
|
158
|
-
hasSeconds;
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
const raw = value.trim();
|
|
162
|
-
if (!raw)
|
|
163
|
-
return '-';
|
|
164
|
-
// dd.MM.yy or dd.MM.yyyy
|
|
165
|
-
const dot = raw.match(/^(\d{2})\.(\d{2})\.(\d{2}|\d{4})$/);
|
|
166
|
-
if (dot) {
|
|
167
|
-
const [, dd, mm, yy] = dot;
|
|
168
|
-
const year = yy.length === 2 ? 2000 + Number(yy) : Number(yy);
|
|
169
|
-
date = new Date(year, Number(mm) - 1, Number(dd));
|
|
170
|
-
if (!(0, date_fns_1.isValid)(date))
|
|
171
|
-
return '-';
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
// normalize "YYYY-MM-DD HH:mm[:ss]" → ISO
|
|
175
|
-
const normalized = raw.replace(' ', 'T');
|
|
176
|
-
date = new Date(normalized);
|
|
177
|
-
if (!(0, date_fns_1.isValid)(date))
|
|
178
|
-
return '-';
|
|
179
|
-
hasTime = /\d{1,2}:\d{2}/.test(raw);
|
|
180
|
-
hasSeconds = /\d{1,2}:\d{2}:\d{2}/.test(raw);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
const base = `${(0, date_fns_1.format)(date, 'dd')} ${date.toLocaleString('en-US', {
|
|
184
|
-
month: 'short',
|
|
185
|
-
})} ${(0, date_fns_1.format)(date, 'yyyy')}`;
|
|
186
|
-
if (!hasTime)
|
|
187
|
-
return base;
|
|
188
|
-
const showSeconds = options?.includeSeconds ?? false;
|
|
189
|
-
const time = (0, date_fns_1.format)(date, showSeconds ? 'HH:mm:ss' : 'HH:mm');
|
|
190
|
-
return `${base}, ${time}`;
|
|
191
|
-
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Export constants
|
|
2
2
|
export * from './util/constants';
|
|
3
|
-
export * from './util/
|
|
4
|
-
export { isDateString, dateToString, stringToDate, getCurrentDateCompacted, FORMATS } from './util/
|
|
3
|
+
export * from './util/dateUtils';
|
|
4
|
+
export { isDateString, dateToString, stringToDate, getCurrentDateCompacted, FORMATS } from './util/dateUtils';
|
|
5
5
|
export * from './util/numberUtils';
|
|
6
6
|
|
|
7
7
|
// Export all DTOs
|
|
@@ -20,7 +20,6 @@ export * from './dtos/field.request.dto';
|
|
|
20
20
|
export * from './dtos/hook.request.dto';
|
|
21
21
|
export * from './dtos/hookProfile.request.dto';
|
|
22
22
|
export * from './dtos/hookOutbox.request.dto';
|
|
23
|
-
export * from './dtos/job.request.dto';
|
|
24
23
|
export * from './dtos/lead.request.dto';
|
|
25
24
|
export * from './dtos/mid.request.dto';
|
|
26
25
|
export * from './dtos/adapter.request.dto';
|
|
@@ -43,7 +42,6 @@ export * from './model/field.model';
|
|
|
43
42
|
export * from './model/gateway.model';
|
|
44
43
|
export * from './model/hook.model';
|
|
45
44
|
export * from './model/hookOutbox.model';
|
|
46
|
-
export * from './model/job.model';
|
|
47
45
|
export * from './model/hookProfile.model';
|
|
48
46
|
export * from './model/lead.model';
|
|
49
47
|
export * from './model/mid.model';
|
|
@@ -71,4 +69,4 @@ export * from './gateways/adapters/dtos/transaction-finxp.request.dto';
|
|
|
71
69
|
export * from './gateways/providers/model/genesis.constants';
|
|
72
70
|
export * from './gateways/providers/model/genesis.model';
|
|
73
71
|
export * from './gateways/providers/model/novalNetManual.model';
|
|
74
|
-
export * from './gateways/providers/model/finXpManual.model';
|
|
72
|
+
export * from './gateways/providers/model/finXpManual.model';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export const HOOK_OUTBOX_STATUS = {
|
|
1
|
+
export const HOOK_OUTBOX_STATUS = {
|
|
3
2
|
PENDING: 'PENDING',
|
|
4
3
|
SENT: 'SENT',
|
|
5
4
|
FAILED: 'FAILED'
|
|
@@ -10,9 +9,8 @@ export interface HookOutbox {
|
|
|
10
9
|
id?: number;
|
|
11
10
|
hookId?: number;
|
|
12
11
|
campaignId?: number;
|
|
13
|
-
campaign?: Campaign;
|
|
14
12
|
triggerId?: string;
|
|
15
|
-
hookUrl?: string;
|
|
13
|
+
hookUrl?: string;
|
|
16
14
|
payloadJson?: string;
|
|
17
15
|
status?: HOOK_OUTBOX_STATUS;
|
|
18
16
|
statusDescription?: string;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
export const INTERVAL_UNIT = {
|
|
2
|
+
DAYS: "DAYS",
|
|
3
|
+
MONTHS: "MONTHS",
|
|
4
|
+
} as const;
|
|
5
|
+
export type INTERVAL_UNIT = (typeof INTERVAL_UNIT)[keyof typeof INTERVAL_UNIT];
|
|
2
6
|
|
|
3
7
|
export interface RecurringSettingConfig {
|
|
4
8
|
id?: number;
|
|
5
9
|
name?: string;
|
|
6
|
-
intervalUnit?:
|
|
10
|
+
intervalUnit?: INTERVAL_UNIT;
|
|
7
11
|
intervalPeriod?: number;
|
|
8
12
|
maxTriesAfterFailure?: number;
|
|
9
13
|
maxDelayPeriod?: number;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BANKS } from "./gateway.model";
|
|
2
|
-
import { Mid } from "./mid.model";
|
|
3
2
|
|
|
4
3
|
export const TRANSACTION_STATUS = {
|
|
5
4
|
PENDING_ASYNC: "PENDING_ASYNC",
|
|
@@ -19,8 +18,7 @@ export type APP_TRANSACTION_TYPE = (typeof APP_TRANSACTION_TYPE)[keyof typeof AP
|
|
|
19
18
|
export const PAYMENT_TYPE = {
|
|
20
19
|
SDD_SALE: "SDD_SALE",
|
|
21
20
|
REFUND: "REFUND",
|
|
22
|
-
CHARGEBACK: "CHARGEBACK"
|
|
23
|
-
DEBIT: "DEBIT"
|
|
21
|
+
CHARGEBACK: "CHARGEBACK"
|
|
24
22
|
};
|
|
25
23
|
export type PAYMENT_TYPE = (typeof PAYMENT_TYPE)[keyof typeof PAYMENT_TYPE];
|
|
26
24
|
|
|
@@ -30,7 +28,6 @@ export interface Transaction {
|
|
|
30
28
|
amount?: string;
|
|
31
29
|
currency?: string;
|
|
32
30
|
midId?: number;
|
|
33
|
-
mid?: Mid;
|
|
34
31
|
orderId?: number;
|
|
35
32
|
// internalSubscriptionId?: number;
|
|
36
33
|
internalPaymentType?: PAYMENT_TYPE;
|
package/src/util/constants.ts
CHANGED
|
@@ -110,8 +110,4 @@ export const CURRENCIES = {
|
|
|
110
110
|
USD: "USD",
|
|
111
111
|
GBP: "GBP",
|
|
112
112
|
};
|
|
113
|
-
export type CURRENCIES = (typeof CURRENCIES)[keyof typeof CURRENCIES];
|
|
114
|
-
|
|
115
|
-
export const MB_1 = 1 * 1024 * 1024;
|
|
116
|
-
|
|
117
|
-
export const MAX_MB_STREAM_SIZE = MB_1 * 5;
|
|
113
|
+
export type CURRENCIES = (typeof CURRENCIES)[keyof typeof CURRENCIES];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { format, isValid, parseISO, addDays, subDays } from 'date-fns';
|
|
2
2
|
|
|
3
3
|
export const FORMATS = {
|
|
4
4
|
ISO_DATE: 'yyyy-MM-dd', // "2026-01-07"
|
|
@@ -8,39 +8,24 @@ export const FORMATS = {
|
|
|
8
8
|
COMPACT_DATETIME: 'yyyyMMddHHmmss', // "20260107143000"
|
|
9
9
|
COMPACT_DATE: 'yyyyMMdd', // "20260107"
|
|
10
10
|
} as const;
|
|
11
|
-
|
|
12
|
-
export const INTERVAL_UNIT = {
|
|
13
|
-
DAYS: "DAYS",
|
|
14
|
-
MONTHS: "MONTHS",
|
|
15
|
-
} as const;
|
|
16
|
-
export type INTERVAL_UNIT = (typeof INTERVAL_UNIT)[keyof typeof INTERVAL_UNIT];
|
|
17
|
-
|
|
18
11
|
// ============================================
|
|
19
12
|
// Date → String formatted conversions
|
|
20
13
|
// ============================================
|
|
21
|
-
export function dateToString(date
|
|
14
|
+
export function dateToString(date: Date, formatString: string = FORMATS.ISO_DATE): string {
|
|
22
15
|
if (!date || !isValid(date)) {
|
|
23
|
-
|
|
16
|
+
throw new Error('Invalid date: ' + date);
|
|
24
17
|
}
|
|
25
18
|
return format(date, formatString);
|
|
26
19
|
}
|
|
27
|
-
|
|
28
|
-
export function dateToYYYYMMDD(date?: Date): string {
|
|
20
|
+
export function dateToYYYYMMDD(date: Date): string {
|
|
29
21
|
return dateToString(date, FORMATS.COMPACT_DATETIME);
|
|
30
22
|
}
|
|
31
|
-
|
|
32
|
-
export function dateToTZ(date?: Date): string {
|
|
23
|
+
export function dateToTZ(date: Date): string {
|
|
33
24
|
return dateToString(date, FORMATS.ISO_DATE_TIME_TZ);
|
|
34
25
|
}
|
|
35
|
-
|
|
36
|
-
export function dateToMinutes(date?: Date): string {
|
|
26
|
+
export function dateToMinutes(date: Date): string {
|
|
37
27
|
return dateToString(date, FORMATS.ISO_DATE_TIME_MINUTES);
|
|
38
28
|
}
|
|
39
|
-
|
|
40
|
-
export function dateToMinutesSeconds(date?: Date): string {
|
|
41
|
-
return dateToString(date, FORMATS.ISO_DATE_TIME_SECONDS);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
29
|
export function getCurrentDateCompacted(): string {
|
|
45
30
|
return dateToYYYYMMDD(new Date()); // "20260107143000"
|
|
46
31
|
}
|
|
@@ -50,7 +35,6 @@ export function isDateString(value: string): boolean {
|
|
|
50
35
|
const datePattern = /^\d{4}-\d{2}-\d{2}(T|\s)\d{2}:\d{2}:\d{2}/;
|
|
51
36
|
return datePattern.test(value);
|
|
52
37
|
}
|
|
53
|
-
|
|
54
38
|
// ============================================
|
|
55
39
|
// String → Date conversions
|
|
56
40
|
// ============================================
|
|
@@ -64,7 +48,6 @@ export function stringToDate(value: string): Date {
|
|
|
64
48
|
}
|
|
65
49
|
return date;
|
|
66
50
|
}
|
|
67
|
-
|
|
68
51
|
// ============================================
|
|
69
52
|
// String → String formatted conversions
|
|
70
53
|
// ============================================
|
|
@@ -75,19 +58,15 @@ export function formatDateString(value: string, formatString: string = FORMATS.I
|
|
|
75
58
|
const date = stringToDate(value);
|
|
76
59
|
return format(date, formatString);
|
|
77
60
|
}
|
|
78
|
-
|
|
79
61
|
export function formatDateAs_yyyymmdd(value: string): string {
|
|
80
62
|
return formatDateString(value, FORMATS.ISO_DATE);
|
|
81
63
|
}
|
|
82
|
-
|
|
83
64
|
export function formatDateAs_tz(value: string): string {
|
|
84
65
|
return formatDateString(value, FORMATS.ISO_DATE_TIME_TZ);
|
|
85
66
|
}
|
|
86
|
-
|
|
87
67
|
export function formatDateAs_minutes(value: string): string {
|
|
88
68
|
return formatDateString(value, FORMATS.ISO_DATE_TIME_MINUTES);
|
|
89
69
|
}
|
|
90
|
-
|
|
91
70
|
export function formatDateAs_seconds(value: string): string {
|
|
92
71
|
return formatDateString(value, FORMATS.ISO_DATE_TIME_SECONDS);
|
|
93
72
|
}
|
|
@@ -101,102 +80,19 @@ export function addDaysToDate(date: Date, days: number): Date {
|
|
|
101
80
|
}
|
|
102
81
|
return addDays(date, days);
|
|
103
82
|
}
|
|
104
|
-
|
|
105
83
|
export function subtractDaysFromDate(date: Date, days: number): Date {
|
|
106
84
|
if (!date || !isValid(date)) {
|
|
107
85
|
throw new Error('Invalid date: ' + date);
|
|
108
86
|
}
|
|
109
87
|
return subDays(date, days);
|
|
110
88
|
}
|
|
111
|
-
|
|
112
89
|
export function addDaysToDateString(value: string, days: number, formatString: string = FORMATS.ISO_DATE): string {
|
|
113
90
|
const date = stringToDate(value);
|
|
114
91
|
const newDate = addDays(date, days);
|
|
115
92
|
return format(newDate, formatString);
|
|
116
93
|
}
|
|
117
|
-
|
|
118
94
|
export function subtractDaysFromDateString(value: string, days: number, formatString: string = FORMATS.ISO_DATE): string {
|
|
119
95
|
const date = stringToDate(value);
|
|
120
96
|
const newDate = subDays(date, days);
|
|
121
97
|
return format(newDate, formatString);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export function addMonthsToDate(date: Date, months: number): Date {
|
|
125
|
-
if (!date || !isValid(date)) {
|
|
126
|
-
throw new Error('Invalid date: ' + date);
|
|
127
|
-
}
|
|
128
|
-
return addMonths(date, months);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export function addPeriodToDate(date: Date, period: number, unit: INTERVAL_UNIT): Date {
|
|
132
|
-
if (!date || !isValid(date)) {
|
|
133
|
-
throw new Error('Invalid date: ' + date);
|
|
134
|
-
}
|
|
135
|
-
if (unit === INTERVAL_UNIT.MONTHS) {
|
|
136
|
-
date = addMonthsToDate(date, period);
|
|
137
|
-
} else if (unit === INTERVAL_UNIT.DAYS) {
|
|
138
|
-
date = addDaysToDate(date, period);
|
|
139
|
-
}
|
|
140
|
-
return date;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// ============================================
|
|
144
|
-
// UI-friendly formatting (used by admin-ts)
|
|
145
|
-
// "15 Jan 2024, 10:30:40" or "15 Jan 2024, 10:30" or just "15 Jan 2024".
|
|
146
|
-
// ============================================
|
|
147
|
-
export type FormatDateForUiOptions = {
|
|
148
|
-
includeSeconds?: boolean;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
export function formatDateForUi(
|
|
152
|
-
value: string | Date | null | undefined,
|
|
153
|
-
options?: FormatDateForUiOptions
|
|
154
|
-
): string {
|
|
155
|
-
if (!value) return '-';
|
|
156
|
-
|
|
157
|
-
let date: Date;
|
|
158
|
-
let hasTime = false;
|
|
159
|
-
let hasSeconds = false;
|
|
160
|
-
|
|
161
|
-
if (value instanceof Date) {
|
|
162
|
-
if (!isValid(value)) return '-';
|
|
163
|
-
date = value;
|
|
164
|
-
|
|
165
|
-
hasSeconds = value.getSeconds() !== 0;
|
|
166
|
-
hasTime =
|
|
167
|
-
value.getHours() !== 0 ||
|
|
168
|
-
value.getMinutes() !== 0 ||
|
|
169
|
-
hasSeconds;
|
|
170
|
-
} else {
|
|
171
|
-
const raw = value.trim();
|
|
172
|
-
if (!raw) return '-';
|
|
173
|
-
|
|
174
|
-
// dd.MM.yy or dd.MM.yyyy
|
|
175
|
-
const dot = raw.match(/^(\d{2})\.(\d{2})\.(\d{2}|\d{4})$/);
|
|
176
|
-
if (dot) {
|
|
177
|
-
const [, dd, mm, yy] = dot;
|
|
178
|
-
const year = yy.length === 2 ? 2000 + Number(yy) : Number(yy);
|
|
179
|
-
date = new Date(year, Number(mm) - 1, Number(dd));
|
|
180
|
-
if (!isValid(date)) return '-';
|
|
181
|
-
} else {
|
|
182
|
-
// normalize "YYYY-MM-DD HH:mm[:ss]" → ISO
|
|
183
|
-
const normalized = raw.replace(' ', 'T');
|
|
184
|
-
date = new Date(normalized);
|
|
185
|
-
if (!isValid(date)) return '-';
|
|
186
|
-
|
|
187
|
-
hasTime = /\d{1,2}:\d{2}/.test(raw);
|
|
188
|
-
hasSeconds = /\d{1,2}:\d{2}:\d{2}/.test(raw);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
const base = `${format(date, 'dd')} ${date.toLocaleString('en-US', {
|
|
193
|
-
month: 'short',
|
|
194
|
-
})} ${format(date, 'yyyy')}`;
|
|
195
|
-
|
|
196
|
-
if (!hasTime) return base;
|
|
197
|
-
|
|
198
|
-
const showSeconds = options?.includeSeconds ?? false;
|
|
199
|
-
|
|
200
|
-
const time = format(date, showSeconds ? 'HH:mm:ss' : 'HH:mm');
|
|
201
|
-
return `${base}, ${time}`;
|
|
202
98
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"job.request.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/job.request.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACnD,EAAE,CAAC,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"job.model.d.ts","sourceRoot":"","sources":["../../src/model/job.model.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IAClB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
package/dist/model/job.model.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"countryUtil.d.ts","sourceRoot":"","sources":["../../src/util/countryUtil.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,KAAG,MAEhD,CAAC"}
|
package/dist/util/countryUtil.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dateUtil.d.ts","sourceRoot":"","sources":["../../src/util/dateUtil.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO;;;;;;;CAOV,CAAC;AAEX,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AACX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAK/E,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,YAAY,GAAE,MAAyB,GAAG,MAAM,CAKzF;AAED,wBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAElD;AAED,wBAAgB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAE5C;AAED,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAEjD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAExD;AAED,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAGnD;AAKD,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAShD;AAKD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,GAAE,MAAyB,GAAG,MAAM,CAM/F;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,eAAe,CAAC,KAA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