@atlantjs/arch 14.0.4 → 15.1.0
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/@tool-box/utils/validators/is-schedule.d.ts +1 -1
- package/@tool-box/utils/validators/is-schedule.js +2 -2
- package/index.d.ts +2 -3
- package/index.js +5 -8
- package/objects/{schedule/schedule.edge.d.ts → scheduling/scheduling.edge.d.ts} +34 -83
- package/objects/{schedule/schedule.edge.failure.d.ts → scheduling/scheduling.edge.failure.d.ts} +1 -1
- package/objects/{schedule/schedule.edge.failure.js → scheduling/scheduling.edge.failure.js} +4 -4
- package/objects/{schedule/schedule.edge.js → scheduling/scheduling.edge.js} +94 -139
- package/objects/time/time.edge.d.ts +2 -0
- package/objects/time/time.edge.js +21 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/objects/@common/edges/cron-expression.edge.d.ts +0 -34
- package/objects/@common/edges/cron-expression.edge.js +0 -96
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ValidationOptions } from "class-validator";
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function IsScheduling(validationOptions?: ValidationOptions): (object: Object, propertyName: string) => void;
|
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.IsScheduling = IsScheduling;
|
|
10
10
|
const class_validator_1 = require("class-validator");
|
|
11
11
|
function isValidScheduleFormat(value) {
|
|
12
12
|
const cron5Regex = /^(\*|([0-5]?\d)(\/\d+)?|([0-5]?\d)-([0-5]?\d)(\/\d+)?)(,(\*|([0-5]?\d)(\/\d+)?|([0-5]?\d)-([0-5]?\d)(\/\d+)?))*\s+(\*|([01]?\d|2[0-3])(\/\d+)?|([01]?\d|2[0-3])-([01]?\d|2[0-3])(\/\d+)?)(,(\*|([01]?\d|2[0-3])(\/\d+)?|([01]?\d|2[0-3])-([01]?\d|2[0-3])(\/\d+)?))*\s+(\*|([1-9]|[12]\d|3[01])(\/\d+)?|([1-9]|[12]\d|3[01])-([1-9]|[12]\d|3[01])(\/\d+)?)(,(\*|([1-9]|[12]\d|3[01])(\/\d+)?|([1-9]|[12]\d|3[01])-([1-9]|[12]\d|3[01])(\/\d+)?))*\s+(\*|(1[0-2]|[1-9])(\/\d+)?|(1[0-2]|[1-9])-(1[0-2]|[1-9])(\/\d+)?)(,(\*|(1[0-2]|[1-9])(\/\d+)?|(1[0-2]|[1-2]|[1-9])-(1[0-2]|[1-9])(\/\d+)?))*\s+(\*|([0-7])(\/\d+)?|([0-7])-([0-7])(\/\d+)?)(,(\*|([0-7])(\/\d+)?|([0-7])-([0-7])(\/\d+)?))*$/;
|
|
@@ -30,7 +30,7 @@ let IsScheduleConstraint = class IsScheduleConstraint {
|
|
|
30
30
|
IsScheduleConstraint = __decorate([
|
|
31
31
|
(0, class_validator_1.ValidatorConstraint)({ name: "isSchedule", async: false })
|
|
32
32
|
], IsScheduleConstraint);
|
|
33
|
-
function
|
|
33
|
+
function IsScheduling(validationOptions) {
|
|
34
34
|
return (object, propertyName) => {
|
|
35
35
|
(0, class_validator_1.registerDecorator)({
|
|
36
36
|
target: object.constructor,
|
package/index.d.ts
CHANGED
|
@@ -5,8 +5,7 @@ export { IsPasswordPolicy } from "./@tool-box/utils/validators/is-password-polic
|
|
|
5
5
|
export { c } from "./@tool-box/utils/logger";
|
|
6
6
|
export { HttpProvider } from "./@tool-box/utils/http-provider/http-provider";
|
|
7
7
|
export { InstanceOf, Plainify } from "./@tool-box/utils/datatypes/plainify";
|
|
8
|
-
export {
|
|
9
|
-
export { CronExpressionEdge } from "./objects/@common/edges/cron-expression.edge";
|
|
8
|
+
export { IsScheduling } from "./@tool-box/utils/validators/is-schedule";
|
|
10
9
|
export { StringEdgeSketch } from "./objects/primitives/string.edge.sketch";
|
|
11
10
|
export { NumberEdgeSketch } from "./objects/primitives/number.edge.sketch";
|
|
12
11
|
export { DatetimeEdgeSketch } from "./objects/primitives/datetime.edge.sketch";
|
|
@@ -43,7 +42,7 @@ export { Return, Success, Failure } from "./@tool-box/utils/ducts/return-type";
|
|
|
43
42
|
export { MonthMapper } from "./@tool-box/utils/datetime/mappers/month.mapper";
|
|
44
43
|
export { MonthAbbreviationEnum } from "./@tool-box/utils/datetime/mappers/points/month-abbreviation.enum";
|
|
45
44
|
export { MonthNumberEnum } from "./@tool-box/utils/datetime/mappers/points/month-number.enum";
|
|
46
|
-
export {
|
|
45
|
+
export { SchedulingEdge } from "./objects/scheduling/scheduling.edge";
|
|
47
46
|
export { EdgeAbstract } from "./objects-interface/edges/edge.abstract";
|
|
48
47
|
export { MetadataEdge } from "./objects-interface/edges/metadata.edge";
|
|
49
48
|
export { MetadataPolygon } from "./objects-interface/edges/metadata.polygon";
|
package/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UvAbstract = exports.SolidAbstract = exports.FaceAbstract = exports.MetadataUv = exports.MetadataEdge = exports.EdgeAbstract = exports.
|
|
4
|
-
exports.IsULID = exports.IsTimeString = exports.IsUv = exports.registerDecorator = exports.IsNotEmptyObject = exports.IsObject = exports.IsArray = exports.IsString = exports.IsInt = exports.IsEnum = exports.IsNumber = exports.IsDate = exports.IsBoolean = exports.IsNumberString = exports.IsUrl = exports.IsUUID = exports.IsJWT = exports.IsJSON = exports.IsPort = exports.IsIP = exports.IsCurrency = exports.IsEmail = exports.IsBase64 = exports.IsDecimal = exports.MaxDate = exports.MinDate = exports.Min = exports.Max = exports.IsNegative = exports.IsPositive = exports.IsNotEmpty = exports.IsEmpty = exports.IsLongitude = exports.IsLatitude = exports.IsLatLong = exports.ValidateInner = exports.IsOptional = exports.ObjectUnitPoint = exports.ConvertUnit = exports.AmountUv = exports.WeekDayPoint = exports.VolumeUnitPoint = exports.MonthNamePoint = exports.MassUnitPoint = exports.LengthUnitPoint = exports.EnergyUnitPoint = exports.DurationUnitPoint = exports.AmountEdge = exports.TimeEdge =
|
|
5
|
-
exports.IsDateString = void 0;
|
|
3
|
+
exports.VertexAbstract = exports.UvAbstract = exports.SolidAbstract = exports.FaceAbstract = exports.MetadataUv = exports.MetadataEdge = exports.EdgeAbstract = exports.SchedulingEdge = exports.MonthNumberEnum = exports.MonthAbbreviationEnum = exports.MonthMapper = exports.Failure = exports.Success = exports.Return = exports.faker = exports.CreateFakeCommand = exports.UsernameEdgeBuilder = exports.EmailEdgeBuilder = exports.FailureEdgeBuilder = exports.BuilderAbstract = exports.IsCronExpression = exports.MapAbstract = exports.Optional = exports.Nothing = exports.Random = exports._ = exports.ResponseAbstract = exports.PayloadAbstract = exports.UuidSketchEdge = exports.UlidSketchEdge = exports.UsernameEdge = exports.UrlEdge = exports.EmailEdge = exports.EnvironmentPoint = exports.HttpStatusCodes = exports.HeaderTokenNamePoint = exports.WeekDayEnum = exports.MonthNameEnum = exports.DatetimeEdge = exports.FailureAbstract = exports.PasswordEdge = exports.BooleanEdgeSketch = exports.DatetimeEdgeSketch = exports.NumberEdgeSketch = exports.StringEdgeSketch = exports.IsScheduling = exports.HttpProvider = exports.c = exports.IsPasswordPolicy = exports.IsPasswordsMatch = void 0;
|
|
4
|
+
exports.IsDateString = exports.IsULID = exports.IsTimeString = exports.IsUv = exports.registerDecorator = exports.IsNotEmptyObject = exports.IsObject = exports.IsArray = exports.IsString = exports.IsInt = exports.IsEnum = exports.IsNumber = exports.IsDate = exports.IsBoolean = exports.IsNumberString = exports.IsUrl = exports.IsUUID = exports.IsJWT = exports.IsJSON = exports.IsPort = exports.IsIP = exports.IsCurrency = exports.IsEmail = exports.IsBase64 = exports.IsDecimal = exports.MaxDate = exports.MinDate = exports.Min = exports.Max = exports.IsNegative = exports.IsPositive = exports.IsNotEmpty = exports.IsEmpty = exports.IsLongitude = exports.IsLatitude = exports.IsLatLong = exports.ValidateInner = exports.IsOptional = exports.ObjectUnitPoint = exports.ConvertUnit = exports.AmountUv = exports.WeekDayPoint = exports.VolumeUnitPoint = exports.MonthNamePoint = exports.MassUnitPoint = exports.LengthUnitPoint = exports.EnergyUnitPoint = exports.DurationUnitPoint = exports.AmountEdge = exports.TimeEdge = void 0;
|
|
6
5
|
require("./@tool-box/utils/datatypes/string-utils");
|
|
7
6
|
require("./@tool-box/utils/datatypes/boolean-utils");
|
|
8
7
|
var is_password_match_1 = require("./@tool-box/utils/validators/is-password-match");
|
|
@@ -14,9 +13,7 @@ Object.defineProperty(exports, "c", { enumerable: true, get: function () { retur
|
|
|
14
13
|
var http_provider_1 = require("./@tool-box/utils/http-provider/http-provider");
|
|
15
14
|
Object.defineProperty(exports, "HttpProvider", { enumerable: true, get: function () { return http_provider_1.HttpProvider; } });
|
|
16
15
|
var is_schedule_1 = require("./@tool-box/utils/validators/is-schedule");
|
|
17
|
-
Object.defineProperty(exports, "
|
|
18
|
-
var cron_expression_edge_1 = require("./objects/@common/edges/cron-expression.edge");
|
|
19
|
-
Object.defineProperty(exports, "CronExpressionEdge", { enumerable: true, get: function () { return cron_expression_edge_1.CronExpressionEdge; } });
|
|
16
|
+
Object.defineProperty(exports, "IsScheduling", { enumerable: true, get: function () { return is_schedule_1.IsScheduling; } });
|
|
20
17
|
var string_edge_sketch_1 = require("./objects/primitives/string.edge.sketch");
|
|
21
18
|
Object.defineProperty(exports, "StringEdgeSketch", { enumerable: true, get: function () { return string_edge_sketch_1.StringEdgeSketch; } });
|
|
22
19
|
var number_edge_sketch_1 = require("./objects/primitives/number.edge.sketch");
|
|
@@ -88,8 +85,8 @@ var month_abbreviation_enum_1 = require("./@tool-box/utils/datetime/mappers/poin
|
|
|
88
85
|
Object.defineProperty(exports, "MonthAbbreviationEnum", { enumerable: true, get: function () { return month_abbreviation_enum_1.MonthAbbreviationEnum; } });
|
|
89
86
|
var month_number_enum_1 = require("./@tool-box/utils/datetime/mappers/points/month-number.enum");
|
|
90
87
|
Object.defineProperty(exports, "MonthNumberEnum", { enumerable: true, get: function () { return month_number_enum_1.MonthNumberEnum; } });
|
|
91
|
-
var
|
|
92
|
-
Object.defineProperty(exports, "
|
|
88
|
+
var scheduling_edge_1 = require("./objects/scheduling/scheduling.edge");
|
|
89
|
+
Object.defineProperty(exports, "SchedulingEdge", { enumerable: true, get: function () { return scheduling_edge_1.SchedulingEdge; } });
|
|
93
90
|
var edge_abstract_1 = require("./objects-interface/edges/edge.abstract");
|
|
94
91
|
Object.defineProperty(exports, "EdgeAbstract", { enumerable: true, get: function () { return edge_abstract_1.EdgeAbstract; } });
|
|
95
92
|
var metadata_edge_1 = require("./objects-interface/edges/metadata.edge");
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { Optional } from "../../@tool-box/utils/ducts/optional-type";
|
|
1
2
|
import { Return } from "../../@tool-box/utils/ducts/return-type";
|
|
2
|
-
import { CronExpressionEdge } from "../@common/edges/cron-expression.edge";
|
|
3
3
|
import { DatetimeEdge } from "../datetime/edges/datetime.edge";
|
|
4
4
|
import { FailureAbstract } from "../failure/edges/failure.abstract";
|
|
5
|
+
import { StringEdgeSketch } from "../primitives/string.edge.sketch";
|
|
5
6
|
import { TimeEdge } from "../time/time.edge";
|
|
6
|
-
export declare class
|
|
7
|
-
protected
|
|
8
|
-
|
|
7
|
+
export declare class SchedulingEdge extends StringEdgeSketch {
|
|
8
|
+
protected _cronExpression: string;
|
|
9
|
+
expiresInPacked: Optional<DatetimeEdge>;
|
|
10
|
+
constructor(_cronExpression: string);
|
|
11
|
+
protected validateCronExpression(): void;
|
|
9
12
|
/**
|
|
10
13
|
* Verifica se o agendamento é recorrente (baseado em expressão cron).
|
|
11
14
|
* @returns true se o agendamento é recorrente, false se é um datetime fixo
|
|
@@ -15,39 +18,10 @@ export declare class ScheduleEdge {
|
|
|
15
18
|
*/
|
|
16
19
|
isRecurrent(): boolean;
|
|
17
20
|
/**
|
|
18
|
-
* Verifica se o agendamento é um evento único (baseado
|
|
21
|
+
* Verifica se o agendamento é um evento único (baseado no momento de expiracao).
|
|
19
22
|
* @returns true se o agendamento é um evento único, false se é recorrente
|
|
20
|
-
* @example
|
|
21
|
-
* new ScheduleEdge(new DatetimeEdge(new Date())).isOneTime() // true
|
|
22
|
-
* new ScheduleEdge(new CronExpressionEdge("0 8 * * *")).isOneTime() // false
|
|
23
23
|
*/
|
|
24
24
|
isOneTime(): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Verifica se o agendamento já passou em relação à data/hora atual.
|
|
27
|
-
* Para agendamentos recorrentes, sempre retorna false.
|
|
28
|
-
* @returns true se a data do agendamento é anterior ao momento atual
|
|
29
|
-
* @example
|
|
30
|
-
* new ScheduleEdge(new DatetimeEdge(new Date("2020-01-01"))).isPast() // true
|
|
31
|
-
* new ScheduleEdge(new DatetimeEdge(new Date("2099-01-01"))).isPast() // false
|
|
32
|
-
*/
|
|
33
|
-
isPast(): boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Verifica se o agendamento ainda está no futuro em relação à data/hora atual.
|
|
36
|
-
* Para agendamentos recorrentes, sempre retorna true.
|
|
37
|
-
* @returns true se a data do agendamento é posterior ao momento atual
|
|
38
|
-
* @example
|
|
39
|
-
* new ScheduleEdge(new DatetimeEdge(new Date("2099-01-01"))).isFuture() // true
|
|
40
|
-
* new ScheduleEdge(new DatetimeEdge(new Date("2020-01-01"))).isFuture() // false
|
|
41
|
-
*/
|
|
42
|
-
isFuture(): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Verifica se o agendamento ocorre hoje.
|
|
45
|
-
* Para agendamentos recorrentes, verifica se há uma ocorrência hoje.
|
|
46
|
-
* @returns true se há uma ocorrência hoje, false caso contrário
|
|
47
|
-
* @example
|
|
48
|
-
* new ScheduleEdge(new DatetimeEdge(new Date())).isToday() // true
|
|
49
|
-
*/
|
|
50
|
-
isToday(): boolean;
|
|
51
25
|
/**
|
|
52
26
|
* Retorna a próxima ocorrência de um agendamento recorrente.
|
|
53
27
|
* @returns Success com a próxima ocorrência ou Failure se o agendamento não for recorrente
|
|
@@ -112,29 +86,33 @@ export declare class ScheduleEdge {
|
|
|
112
86
|
*/
|
|
113
87
|
getTime(): TimeEdge;
|
|
114
88
|
/**
|
|
115
|
-
* Retorna
|
|
116
|
-
* @returns Instância de CronExpressionEdge ou DatetimeEdge
|
|
117
|
-
* @example
|
|
118
|
-
* new ScheduleEdge(new CronExpressionEdge("0 8 * * *")).getMoment()
|
|
119
|
-
* // CronExpressionEdge("0 8 * * *")
|
|
89
|
+
* Retorna os campos da expressão cron.
|
|
120
90
|
*/
|
|
121
|
-
|
|
91
|
+
getFields(): string[];
|
|
122
92
|
/**
|
|
123
|
-
* Retorna
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
*
|
|
93
|
+
* Retorna a próxima execução a partir de uma data base.
|
|
94
|
+
*/
|
|
95
|
+
nextDate(fromDate?: Date): Date;
|
|
96
|
+
/**
|
|
97
|
+
* Retorna a execução anterior a partir de uma data base.
|
|
128
98
|
*/
|
|
129
|
-
|
|
99
|
+
previousDate(fromDate?: Date): Date;
|
|
100
|
+
/**
|
|
101
|
+
* Retorna as próximas N execuções.
|
|
102
|
+
*/
|
|
103
|
+
nextDates(count: number, fromDate?: Date): Date[];
|
|
104
|
+
/**
|
|
105
|
+
* Valida expressão cron sem lançar exceção.
|
|
106
|
+
*/
|
|
107
|
+
static isValid(expression: string): boolean;
|
|
130
108
|
/**
|
|
131
109
|
* Retorna a CronExpressionEdge do agendamento se for recorrente.
|
|
132
110
|
* @returns Success com a CronExpressionEdge ou Failure se for evento único
|
|
133
111
|
* @example
|
|
134
112
|
* const cron = new CronExpressionEdge("0 8 * * *");
|
|
135
|
-
* new ScheduleEdge(cron).getCronExpression() //
|
|
113
|
+
* new ScheduleEdge(cron).getCronExpression() // CronExpressionEdge("0 8 * * *")
|
|
136
114
|
*/
|
|
137
|
-
getCronExpression():
|
|
115
|
+
getCronExpression(): string;
|
|
138
116
|
/**
|
|
139
117
|
* Cria uma cópia independente desta instância de ScheduleEdge.
|
|
140
118
|
* @returns Nova instância com o mesmo momento interno
|
|
@@ -142,43 +120,16 @@ export declare class ScheduleEdge {
|
|
|
142
120
|
* const schedule = new ScheduleEdge(new CronExpressionEdge("0 8 * * *"));
|
|
143
121
|
* const clone = schedule.clone(); // instância independente
|
|
144
122
|
*/
|
|
145
|
-
clone():
|
|
146
|
-
/**
|
|
147
|
-
* Retorna uma nova instância com o momento alterado.
|
|
148
|
-
* @param moment - Novo momento (CronExpressionEdge ou DatetimeEdge)
|
|
149
|
-
* @returns Nova instância com o momento alterado
|
|
150
|
-
* @example
|
|
151
|
-
* const schedule = new ScheduleEdge(new CronExpressionEdge("0 8 * * *"));
|
|
152
|
-
* const updated = schedule.withMoment(new CronExpressionEdge("0 10 * * *"));
|
|
153
|
-
*/
|
|
154
|
-
withMoment(moment: CronExpressionEdge | DatetimeEdge): ScheduleEdge;
|
|
155
|
-
/**
|
|
156
|
-
* Retorna a representação em string do momento do agendamento.
|
|
157
|
-
* Para cron, retorna a expressão cron. Para datetime, retorna a ISO string.
|
|
158
|
-
* @returns String representando o agendamento
|
|
159
|
-
* @example
|
|
160
|
-
* new ScheduleEdge(new CronExpressionEdge("0 8 * * *")).toString() // "0 8 * * *"
|
|
161
|
-
* new ScheduleEdge(new DatetimeEdge(new Date())).toString() // "2026-03-12T14:00:00.000Z"
|
|
162
|
-
*/
|
|
163
|
-
toString(): string;
|
|
164
|
-
/**
|
|
165
|
-
* Cria um ScheduleEdge recorrente a partir de uma expressão cron.
|
|
166
|
-
* @param expression - Expressão cron válida
|
|
167
|
-
* @returns Nova instância de ScheduleEdge recorrente
|
|
168
|
-
* @example
|
|
169
|
-
* ScheduleEdge.fromCron("0 8 * * *") // agendamento diário às 8h
|
|
170
|
-
* ScheduleEdge.fromCron("0 8 * * 1-5") // agendamento de segunda a sexta às 8h
|
|
171
|
-
*/
|
|
172
|
-
static fromCron(expression: string): ScheduleEdge;
|
|
123
|
+
clone(): SchedulingEdge;
|
|
173
124
|
/**
|
|
174
|
-
* Cria um ScheduleEdge de evento único a partir de um objeto
|
|
175
|
-
* @param
|
|
125
|
+
* Cria um ScheduleEdge de evento único a partir de um objeto Datetime.
|
|
126
|
+
* @param datetime - Data e hora do evento único
|
|
176
127
|
* @returns Nova instância de ScheduleEdge para evento único
|
|
177
128
|
* @example
|
|
178
|
-
* ScheduleEdge.
|
|
129
|
+
* ScheduleEdge.fromDatetime(new Datetime("2026-12-25T08:00:00"))
|
|
179
130
|
* // agendamento para o Natal de 2026 às 8h
|
|
180
131
|
*/
|
|
181
|
-
static
|
|
132
|
+
static fromDatetime(datetime: DatetimeEdge): SchedulingEdge;
|
|
182
133
|
/**
|
|
183
134
|
* Cria um ScheduleEdge para agendamentos diários em um horário específico.
|
|
184
135
|
* @param time - Horário do agendamento no formato TimeEdge
|
|
@@ -186,7 +137,7 @@ export declare class ScheduleEdge {
|
|
|
186
137
|
* @example
|
|
187
138
|
* ScheduleEdge.daily(new TimeEdge("08:00")) // todos os dias às 8h -> "0 8 * * *"
|
|
188
139
|
*/
|
|
189
|
-
static daily(time: TimeEdge):
|
|
140
|
+
static daily(time: TimeEdge): SchedulingEdge;
|
|
190
141
|
/**
|
|
191
142
|
* Cria um ScheduleEdge para agendamentos semanais em um dia e horário específico.
|
|
192
143
|
* @param dayOfWeek - Dia da semana (0=domingo, 1=segunda, ..., 6=sábado)
|
|
@@ -196,7 +147,7 @@ export declare class ScheduleEdge {
|
|
|
196
147
|
* ScheduleEdge.weekly(1, new TimeEdge("08:00"))
|
|
197
148
|
* // toda segunda-feira às 8h -> "0 8 * * 1"
|
|
198
149
|
*/
|
|
199
|
-
static weekly(dayOfWeek: number, time: TimeEdge):
|
|
150
|
+
static weekly(dayOfWeek: number, time: TimeEdge): SchedulingEdge;
|
|
200
151
|
/**
|
|
201
152
|
* Cria um ScheduleEdge para agendamentos mensais em um dia e horário específico.
|
|
202
153
|
* @param dayOfMonth - Dia do mês (1-31)
|
|
@@ -206,5 +157,5 @@ export declare class ScheduleEdge {
|
|
|
206
157
|
* ScheduleEdge.monthly(15, new TimeEdge("08:00"))
|
|
207
158
|
* // todo dia 15 de cada mês às 8h -> "0 8 15 * *"
|
|
208
159
|
*/
|
|
209
|
-
static monthly(dayOfMonth: number, time: TimeEdge):
|
|
160
|
+
static monthly(dayOfMonth: number, time: TimeEdge): SchedulingEdge;
|
|
210
161
|
}
|
package/objects/{schedule/schedule.edge.failure.d.ts → scheduling/scheduling.edge.failure.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { FailureAbstract } from "../failure/edges/failure.abstract";
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class RecurringSchedulingEdgeFailure extends FailureAbstract {
|
|
3
3
|
constructor(schedule: string, error?: any);
|
|
4
4
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.RecurringSchedulingEdgeFailure = void 0;
|
|
4
4
|
const failure_abstract_1 = require("../failure/edges/failure.abstract");
|
|
5
|
-
class
|
|
5
|
+
class RecurringSchedulingEdgeFailure extends failure_abstract_1.FailureAbstract {
|
|
6
6
|
constructor(schedule, error) {
|
|
7
7
|
super({
|
|
8
|
-
failureClass:
|
|
8
|
+
failureClass: RecurringSchedulingEdgeFailure,
|
|
9
9
|
message: `${schedule} is not a recurring schedule`,
|
|
10
10
|
stackTrace: error,
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
exports.
|
|
14
|
+
exports.RecurringSchedulingEdgeFailure = RecurringSchedulingEdgeFailure;
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SchedulingEdge = void 0;
|
|
4
4
|
const cron_parser_1 = require("cron-parser");
|
|
5
|
+
const optional_type_1 = require("../../@tool-box/utils/ducts/optional-type");
|
|
5
6
|
const return_type_1 = require("../../@tool-box/utils/ducts/return-type");
|
|
6
|
-
const cron_expression_edge_1 = require("../@common/edges/cron-expression.edge");
|
|
7
7
|
const datetime_edge_1 = require("../datetime/edges/datetime.edge");
|
|
8
|
-
const
|
|
8
|
+
const string_edge_sketch_1 = require("../primitives/string.edge.sketch");
|
|
9
9
|
const time_edge_1 = require("../time/time.edge");
|
|
10
|
-
class
|
|
11
|
-
constructor(
|
|
12
|
-
|
|
10
|
+
class SchedulingEdge extends string_edge_sketch_1.StringEdgeSketch {
|
|
11
|
+
constructor(_cronExpression) {
|
|
12
|
+
// normaliza espaços múltiplos para evitar inconsistência de validação
|
|
13
|
+
super(_cronExpression.replace(/\s+/g, " "));
|
|
14
|
+
this._cronExpression = _cronExpression;
|
|
15
|
+
this.expiresInPacked = optional_type_1.Nothing;
|
|
16
|
+
this.validateCronExpression();
|
|
17
|
+
}
|
|
18
|
+
validateCronExpression() {
|
|
19
|
+
try {
|
|
20
|
+
cron_parser_1.CronExpressionParser.parse(this.toString());
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
throw new Error(`${this.toString()} should be a valid Cron Expression.`);
|
|
24
|
+
}
|
|
13
25
|
}
|
|
14
26
|
// ==================== Verificações ====================
|
|
15
27
|
/**
|
|
@@ -20,58 +32,14 @@ class ScheduleEdge {
|
|
|
20
32
|
* new ScheduleEdge(new DatetimeEdge(new Date())).isRecurrent() // false
|
|
21
33
|
*/
|
|
22
34
|
isRecurrent() {
|
|
23
|
-
return this.
|
|
35
|
+
return this.expiresInPacked.hasSomething();
|
|
24
36
|
}
|
|
25
37
|
/**
|
|
26
|
-
* Verifica se o agendamento é um evento único (baseado
|
|
38
|
+
* Verifica se o agendamento é um evento único (baseado no momento de expiracao).
|
|
27
39
|
* @returns true se o agendamento é um evento único, false se é recorrente
|
|
28
|
-
* @example
|
|
29
|
-
* new ScheduleEdge(new DatetimeEdge(new Date())).isOneTime() // true
|
|
30
|
-
* new ScheduleEdge(new CronExpressionEdge("0 8 * * *")).isOneTime() // false
|
|
31
40
|
*/
|
|
32
41
|
isOneTime() {
|
|
33
|
-
return this.
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Verifica se o agendamento já passou em relação à data/hora atual.
|
|
37
|
-
* Para agendamentos recorrentes, sempre retorna false.
|
|
38
|
-
* @returns true se a data do agendamento é anterior ao momento atual
|
|
39
|
-
* @example
|
|
40
|
-
* new ScheduleEdge(new DatetimeEdge(new Date("2020-01-01"))).isPast() // true
|
|
41
|
-
* new ScheduleEdge(new DatetimeEdge(new Date("2099-01-01"))).isPast() // false
|
|
42
|
-
*/
|
|
43
|
-
isPast() {
|
|
44
|
-
if (this._moment instanceof cron_expression_edge_1.CronExpressionEdge)
|
|
45
|
-
return false;
|
|
46
|
-
return this._moment.isBefore(new datetime_edge_1.DatetimeEdge(new Date()));
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Verifica se o agendamento ainda está no futuro em relação à data/hora atual.
|
|
50
|
-
* Para agendamentos recorrentes, sempre retorna true.
|
|
51
|
-
* @returns true se a data do agendamento é posterior ao momento atual
|
|
52
|
-
* @example
|
|
53
|
-
* new ScheduleEdge(new DatetimeEdge(new Date("2099-01-01"))).isFuture() // true
|
|
54
|
-
* new ScheduleEdge(new DatetimeEdge(new Date("2020-01-01"))).isFuture() // false
|
|
55
|
-
*/
|
|
56
|
-
isFuture() {
|
|
57
|
-
if (this._moment instanceof cron_expression_edge_1.CronExpressionEdge)
|
|
58
|
-
return true;
|
|
59
|
-
return this._moment.isAfter(new datetime_edge_1.DatetimeEdge(new Date()));
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Verifica se o agendamento ocorre hoje.
|
|
63
|
-
* Para agendamentos recorrentes, verifica se há uma ocorrência hoje.
|
|
64
|
-
* @returns true se há uma ocorrência hoje, false caso contrário
|
|
65
|
-
* @example
|
|
66
|
-
* new ScheduleEdge(new DatetimeEdge(new Date())).isToday() // true
|
|
67
|
-
*/
|
|
68
|
-
isToday() {
|
|
69
|
-
if (this._moment instanceof datetime_edge_1.DatetimeEdge) {
|
|
70
|
-
return this._moment.isToday();
|
|
71
|
-
}
|
|
72
|
-
const next = cron_parser_1.CronExpressionParser.parse(this._moment.toString()).next();
|
|
73
|
-
const nextDatetime = new datetime_edge_1.DatetimeEdge(next.toDate());
|
|
74
|
-
return nextDatetime.isToday();
|
|
42
|
+
return this.expiresInPacked.hasNothing();
|
|
75
43
|
}
|
|
76
44
|
// ==================== Ocorrências ====================
|
|
77
45
|
/**
|
|
@@ -82,10 +50,7 @@ class ScheduleEdge {
|
|
|
82
50
|
* schedule.nextOccurrence() // Success(DatetimeEdge com a próxima ocorrência às 8h)
|
|
83
51
|
*/
|
|
84
52
|
nextOccurrence() {
|
|
85
|
-
|
|
86
|
-
return (0, return_type_1.Failure)(new schedule_edge_failure_1.RecurringScheduleEdgeFailure(this._moment.toISOString()));
|
|
87
|
-
}
|
|
88
|
-
const cronDate = cron_parser_1.CronExpressionParser.parse(this._moment.toString()).next();
|
|
53
|
+
const cronDate = cron_parser_1.CronExpressionParser.parse(this._cronExpression.toString()).next();
|
|
89
54
|
return (0, return_type_1.Success)(new datetime_edge_1.DatetimeEdge(cronDate.toDate()));
|
|
90
55
|
}
|
|
91
56
|
/**
|
|
@@ -97,10 +62,7 @@ class ScheduleEdge {
|
|
|
97
62
|
* schedule.nextOccurrences(3) // Success([DatetimeEdge, DatetimeEdge, DatetimeEdge])
|
|
98
63
|
*/
|
|
99
64
|
nextOccurrences(quantity) {
|
|
100
|
-
|
|
101
|
-
return (0, return_type_1.Failure)(new schedule_edge_failure_1.RecurringScheduleEdgeFailure(this._moment.toISOString()));
|
|
102
|
-
}
|
|
103
|
-
const cronDates = cron_parser_1.CronExpressionParser.parse(this._moment.toString()).take(quantity);
|
|
65
|
+
const cronDates = cron_parser_1.CronExpressionParser.parse(this._cronExpression.toString()).take(quantity);
|
|
104
66
|
return (0, return_type_1.Success)(cronDates.map((cronDate) => new datetime_edge_1.DatetimeEdge(cronDate.toDate())));
|
|
105
67
|
}
|
|
106
68
|
/**
|
|
@@ -111,10 +73,7 @@ class ScheduleEdge {
|
|
|
111
73
|
* schedule.previousOccurrence() // Success(DatetimeEdge com a última ocorrência às 8h)
|
|
112
74
|
*/
|
|
113
75
|
previousOccurrence() {
|
|
114
|
-
|
|
115
|
-
return (0, return_type_1.Failure)(new schedule_edge_failure_1.RecurringScheduleEdgeFailure(this._moment.toISOString()));
|
|
116
|
-
}
|
|
117
|
-
const cronDate = cron_parser_1.CronExpressionParser.parse(this._moment.toString()).prev();
|
|
76
|
+
const cronDate = cron_parser_1.CronExpressionParser.parse(this._cronExpression.toString()).prev();
|
|
118
77
|
return (0, return_type_1.Success)(new datetime_edge_1.DatetimeEdge(cronDate.toDate()));
|
|
119
78
|
}
|
|
120
79
|
/**
|
|
@@ -126,10 +85,7 @@ class ScheduleEdge {
|
|
|
126
85
|
* schedule.previousOccurrences(3) // Success([DatetimeEdge, DatetimeEdge, DatetimeEdge])
|
|
127
86
|
*/
|
|
128
87
|
previousOccurrences(quantity) {
|
|
129
|
-
|
|
130
|
-
return (0, return_type_1.Failure)(new schedule_edge_failure_1.RecurringScheduleEdgeFailure(this._moment.toISOString()));
|
|
131
|
-
}
|
|
132
|
-
const cronDates = cron_parser_1.CronExpressionParser.parse(this._moment.toString()).take(-quantity);
|
|
88
|
+
const cronDates = cron_parser_1.CronExpressionParser.parse(this._cronExpression.toString()).take(-quantity);
|
|
133
89
|
return (0, return_type_1.Success)(cronDates.map((cronDate) => new datetime_edge_1.DatetimeEdge(cronDate.toDate())));
|
|
134
90
|
}
|
|
135
91
|
/**
|
|
@@ -143,10 +99,7 @@ class ScheduleEdge {
|
|
|
143
99
|
* // Success([DatetimeEdge, DatetimeEdge, ...])
|
|
144
100
|
*/
|
|
145
101
|
occurrencesBetween(start, end) {
|
|
146
|
-
|
|
147
|
-
return (0, return_type_1.Failure)(new schedule_edge_failure_1.RecurringScheduleEdgeFailure(this._moment.toISOString()));
|
|
148
|
-
}
|
|
149
|
-
const interval = cron_parser_1.CronExpressionParser.parse(this._moment.toString(), {
|
|
102
|
+
const interval = cron_parser_1.CronExpressionParser.parse(this._cronExpression.toString(), {
|
|
150
103
|
currentDate: start.toDate(),
|
|
151
104
|
endDate: end.toDate(),
|
|
152
105
|
});
|
|
@@ -186,46 +139,73 @@ class ScheduleEdge {
|
|
|
186
139
|
* // TimeEdge("08:00")
|
|
187
140
|
*/
|
|
188
141
|
getTime() {
|
|
189
|
-
const interval = cron_parser_1.CronExpressionParser.parse(this.
|
|
142
|
+
const interval = cron_parser_1.CronExpressionParser.parse(this._cronExpression.toString()).fields;
|
|
190
143
|
const hour = String(interval.hour.values.toString()).padStart(2, "0");
|
|
191
144
|
const minute = String(interval.minute.values.toString()).padStart(2, "0");
|
|
192
145
|
return new time_edge_1.TimeEdge(`${hour}:${minute}`);
|
|
193
146
|
}
|
|
194
147
|
/**
|
|
195
|
-
* Retorna
|
|
196
|
-
* @returns Instância de CronExpressionEdge ou DatetimeEdge
|
|
197
|
-
* @example
|
|
198
|
-
* new ScheduleEdge(new CronExpressionEdge("0 8 * * *")).getMoment()
|
|
199
|
-
* // CronExpressionEdge("0 8 * * *")
|
|
148
|
+
* Retorna os campos da expressão cron.
|
|
200
149
|
*/
|
|
201
|
-
|
|
202
|
-
return this.
|
|
150
|
+
getFields() {
|
|
151
|
+
return this.toString().split(/\s+/);
|
|
203
152
|
}
|
|
153
|
+
// ==================== Cálculo de Execução ====================
|
|
204
154
|
/**
|
|
205
|
-
* Retorna
|
|
206
|
-
* @returns Success com o DatetimeEdge ou Failure se o agendamento for recorrente
|
|
207
|
-
* @example
|
|
208
|
-
* const date = new DatetimeEdge(new Date());
|
|
209
|
-
* new ScheduleEdge(date).getDatetime() // Success(DatetimeEdge)
|
|
155
|
+
* Retorna a próxima execução a partir de uma data base.
|
|
210
156
|
*/
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
157
|
+
nextDate(fromDate = new Date()) {
|
|
158
|
+
const interval = cron_parser_1.CronExpressionParser.parse(this.toString(), {
|
|
159
|
+
currentDate: fromDate,
|
|
160
|
+
});
|
|
161
|
+
return interval.next().toDate();
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Retorna a execução anterior a partir de uma data base.
|
|
165
|
+
*/
|
|
166
|
+
previousDate(fromDate = new Date()) {
|
|
167
|
+
const interval = cron_parser_1.CronExpressionParser.parse(this.toString(), {
|
|
168
|
+
currentDate: fromDate,
|
|
169
|
+
});
|
|
170
|
+
return interval.prev().toDate();
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Retorna as próximas N execuções.
|
|
174
|
+
*/
|
|
175
|
+
nextDates(count, fromDate = new Date()) {
|
|
176
|
+
if (count <= 0)
|
|
177
|
+
return [];
|
|
178
|
+
const interval = cron_parser_1.CronExpressionParser.parse(this.toString(), {
|
|
179
|
+
currentDate: fromDate,
|
|
180
|
+
});
|
|
181
|
+
const dates = [];
|
|
182
|
+
for (let i = 0; i < count; i++) {
|
|
183
|
+
dates.push(interval.next().toDate());
|
|
184
|
+
}
|
|
185
|
+
return dates;
|
|
186
|
+
}
|
|
187
|
+
// ==================== Métodos Estáticos ====================
|
|
188
|
+
/**
|
|
189
|
+
* Valida expressão cron sem lançar exceção.
|
|
190
|
+
*/
|
|
191
|
+
static isValid(expression) {
|
|
192
|
+
try {
|
|
193
|
+
cron_parser_1.CronExpressionParser.parse(expression.trim().replace(/\s+/g, " "));
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
return false;
|
|
214
198
|
}
|
|
215
|
-
return (0, return_type_1.Success)(this._moment);
|
|
216
199
|
}
|
|
217
200
|
/**
|
|
218
201
|
* Retorna a CronExpressionEdge do agendamento se for recorrente.
|
|
219
202
|
* @returns Success com a CronExpressionEdge ou Failure se for evento único
|
|
220
203
|
* @example
|
|
221
204
|
* const cron = new CronExpressionEdge("0 8 * * *");
|
|
222
|
-
* new ScheduleEdge(cron).getCronExpression() //
|
|
205
|
+
* new ScheduleEdge(cron).getCronExpression() // CronExpressionEdge("0 8 * * *")
|
|
223
206
|
*/
|
|
224
207
|
getCronExpression() {
|
|
225
|
-
|
|
226
|
-
return (0, return_type_1.Failure)(new schedule_edge_failure_1.RecurringScheduleEdgeFailure(this._moment.toISOString()));
|
|
227
|
-
}
|
|
228
|
-
return (0, return_type_1.Success)(this._moment);
|
|
208
|
+
return this._cronExpression;
|
|
229
209
|
}
|
|
230
210
|
// ==================== Clonagem e Imutabilidade ====================
|
|
231
211
|
/**
|
|
@@ -236,53 +216,28 @@ class ScheduleEdge {
|
|
|
236
216
|
* const clone = schedule.clone(); // instância independente
|
|
237
217
|
*/
|
|
238
218
|
clone() {
|
|
239
|
-
return new
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Retorna uma nova instância com o momento alterado.
|
|
243
|
-
* @param moment - Novo momento (CronExpressionEdge ou DatetimeEdge)
|
|
244
|
-
* @returns Nova instância com o momento alterado
|
|
245
|
-
* @example
|
|
246
|
-
* const schedule = new ScheduleEdge(new CronExpressionEdge("0 8 * * *"));
|
|
247
|
-
* const updated = schedule.withMoment(new CronExpressionEdge("0 10 * * *"));
|
|
248
|
-
*/
|
|
249
|
-
withMoment(moment) {
|
|
250
|
-
return new ScheduleEdge(moment);
|
|
251
|
-
}
|
|
252
|
-
// ==================== Formatação ====================
|
|
253
|
-
/**
|
|
254
|
-
* Retorna a representação em string do momento do agendamento.
|
|
255
|
-
* Para cron, retorna a expressão cron. Para datetime, retorna a ISO string.
|
|
256
|
-
* @returns String representando o agendamento
|
|
257
|
-
* @example
|
|
258
|
-
* new ScheduleEdge(new CronExpressionEdge("0 8 * * *")).toString() // "0 8 * * *"
|
|
259
|
-
* new ScheduleEdge(new DatetimeEdge(new Date())).toString() // "2026-03-12T14:00:00.000Z"
|
|
260
|
-
*/
|
|
261
|
-
toString() {
|
|
262
|
-
return this._moment.toString();
|
|
219
|
+
return new SchedulingEdge(this._cronExpression);
|
|
263
220
|
}
|
|
264
221
|
// ==================== Métodos Estáticos ====================
|
|
265
222
|
/**
|
|
266
|
-
* Cria um ScheduleEdge
|
|
267
|
-
* @param
|
|
268
|
-
* @returns Nova instância de ScheduleEdge recorrente
|
|
269
|
-
* @example
|
|
270
|
-
* ScheduleEdge.fromCron("0 8 * * *") // agendamento diário às 8h
|
|
271
|
-
* ScheduleEdge.fromCron("0 8 * * 1-5") // agendamento de segunda a sexta às 8h
|
|
272
|
-
*/
|
|
273
|
-
static fromCron(expression) {
|
|
274
|
-
return new ScheduleEdge(new cron_expression_edge_1.CronExpressionEdge(expression));
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* Cria um ScheduleEdge de evento único a partir de um objeto Date.
|
|
278
|
-
* @param date - Data e hora do evento único
|
|
223
|
+
* Cria um ScheduleEdge de evento único a partir de um objeto Datetime.
|
|
224
|
+
* @param datetime - Data e hora do evento único
|
|
279
225
|
* @returns Nova instância de ScheduleEdge para evento único
|
|
280
226
|
* @example
|
|
281
|
-
* ScheduleEdge.
|
|
227
|
+
* ScheduleEdge.fromDatetime(new Datetime("2026-12-25T08:00:00"))
|
|
282
228
|
* // agendamento para o Natal de 2026 às 8h
|
|
283
229
|
*/
|
|
284
|
-
static
|
|
285
|
-
|
|
230
|
+
static fromDatetime(datetime) {
|
|
231
|
+
const date = datetime.toDate();
|
|
232
|
+
const minute = date.getMinutes();
|
|
233
|
+
const hour = date.getHours();
|
|
234
|
+
const day = date.getDate();
|
|
235
|
+
const month = date.getMonth() + 1;
|
|
236
|
+
const dayOfWeek = date.getDay();
|
|
237
|
+
const cron = `${minute} ${hour} ${day} ${month} ${dayOfWeek}`;
|
|
238
|
+
const scheduledFor = new SchedulingEdge(cron);
|
|
239
|
+
scheduledFor.expiresInPacked = (0, optional_type_1.Optional)(datetime);
|
|
240
|
+
return scheduledFor;
|
|
286
241
|
}
|
|
287
242
|
/**
|
|
288
243
|
* Cria um ScheduleEdge para agendamentos diários em um horário específico.
|
|
@@ -293,7 +248,7 @@ class ScheduleEdge {
|
|
|
293
248
|
*/
|
|
294
249
|
static daily(time) {
|
|
295
250
|
const expression = `${time.getMinutes()} ${time.getHours()} * * *`;
|
|
296
|
-
return
|
|
251
|
+
return new SchedulingEdge(expression);
|
|
297
252
|
}
|
|
298
253
|
/**
|
|
299
254
|
* Cria um ScheduleEdge para agendamentos semanais em um dia e horário específico.
|
|
@@ -306,7 +261,7 @@ class ScheduleEdge {
|
|
|
306
261
|
*/
|
|
307
262
|
static weekly(dayOfWeek, time) {
|
|
308
263
|
const expression = `${time.getMinutes()} ${time.getHours()} * * ${dayOfWeek}`;
|
|
309
|
-
return
|
|
264
|
+
return new SchedulingEdge(expression);
|
|
310
265
|
}
|
|
311
266
|
/**
|
|
312
267
|
* Cria um ScheduleEdge para agendamentos mensais em um dia e horário específico.
|
|
@@ -319,7 +274,7 @@ class ScheduleEdge {
|
|
|
319
274
|
*/
|
|
320
275
|
static monthly(dayOfMonth, time) {
|
|
321
276
|
const expression = `${time.getMinutes()} ${time.getHours()} ${dayOfMonth} * *`;
|
|
322
|
-
return
|
|
277
|
+
return new SchedulingEdge(expression);
|
|
323
278
|
}
|
|
324
279
|
}
|
|
325
|
-
exports.
|
|
280
|
+
exports.SchedulingEdge = SchedulingEdge;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SchedulingEdge } from "../scheduling/scheduling.edge";
|
|
1
2
|
export declare class TimeEdge {
|
|
2
3
|
private readonly value;
|
|
3
4
|
constructor(value: string);
|
|
@@ -25,6 +26,7 @@ export declare class TimeEdge {
|
|
|
25
26
|
* new TimeEdge("02:00").toTotalMinutes() // 120
|
|
26
27
|
*/
|
|
27
28
|
toTotalMinutes(): number;
|
|
29
|
+
fromScheduling(date?: Date): SchedulingEdge;
|
|
28
30
|
/**
|
|
29
31
|
* Retorna o tempo total convertido em segundos.
|
|
30
32
|
* @returns Total de segundos representados pelo tempo
|