@danielarndt0/brutils-cli 1.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/LICENSE +21 -0
- package/README.md +146 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +3346 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +442 -0
- package/dist/index.js +2286 -0
- package/dist/index.js.map +1 -0
- package/package.json +53 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
interface ValidationResult {
|
|
2
|
+
isValid: boolean;
|
|
3
|
+
value: string;
|
|
4
|
+
formatted?: string | undefined;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
type CPFStateCode = "AC" | "AL" | "AM" | "AP" | "BA" | "CE" | "DF" | "ES" | "GO" | "MA" | "MG" | "MS" | "MT" | "PA" | "PB" | "PE" | "PI" | "PR" | "RJ" | "RN" | "RO" | "RR" | "RS" | "SC" | "SE" | "SP" | "TO";
|
|
8
|
+
interface CPFGenerateOptions {
|
|
9
|
+
formatted?: boolean | undefined;
|
|
10
|
+
state?: CPFStateCode | undefined;
|
|
11
|
+
}
|
|
12
|
+
interface CPFGenerateBatchOptions extends CPFGenerateOptions {
|
|
13
|
+
count: number;
|
|
14
|
+
unique?: boolean | undefined;
|
|
15
|
+
}
|
|
16
|
+
interface CPFValidateOptions {
|
|
17
|
+
strict?: boolean | undefined;
|
|
18
|
+
}
|
|
19
|
+
interface CPFValidationResult extends ValidationResult {
|
|
20
|
+
state?: CPFStateCode | undefined;
|
|
21
|
+
}
|
|
22
|
+
interface CPFMaskOptions {
|
|
23
|
+
pattern?: string | undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare function normalizeCPF(value: string): string;
|
|
27
|
+
declare function stripCPF(value: string): string;
|
|
28
|
+
declare function ensureCPFLength(value: string): string;
|
|
29
|
+
declare function calculateCPFCheckDigit(digits: number[]): number;
|
|
30
|
+
declare function resolveCPFRegionDigit(state?: CPFStateCode): number | undefined;
|
|
31
|
+
declare function resolveCPFStateFromDigits(value: string): CPFStateCode | undefined;
|
|
32
|
+
|
|
33
|
+
declare function formatCPFValue(value: string): string;
|
|
34
|
+
|
|
35
|
+
declare function maskCPF(value: string, options?: CPFMaskOptions): string;
|
|
36
|
+
|
|
37
|
+
declare function generateCPF(options?: CPFGenerateOptions): string;
|
|
38
|
+
declare function generateCPFBatch(options: CPFGenerateBatchOptions): string[];
|
|
39
|
+
|
|
40
|
+
declare function validateCPF(value: string, options?: CPFValidateOptions): CPFValidationResult;
|
|
41
|
+
|
|
42
|
+
interface CNPJGenerateOptions {
|
|
43
|
+
formatted?: boolean | undefined;
|
|
44
|
+
branch?: string | undefined;
|
|
45
|
+
}
|
|
46
|
+
interface CNPJGenerateBatchOptions extends CNPJGenerateOptions {
|
|
47
|
+
count: number;
|
|
48
|
+
unique?: boolean | undefined;
|
|
49
|
+
}
|
|
50
|
+
interface CNPJValidateOptions {
|
|
51
|
+
strict?: boolean | undefined;
|
|
52
|
+
}
|
|
53
|
+
interface CNPJValidationResult extends ValidationResult {
|
|
54
|
+
branch?: string | undefined;
|
|
55
|
+
}
|
|
56
|
+
interface CNPJMaskOptions {
|
|
57
|
+
pattern?: string | undefined;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare function normalizeCNPJ(value: string): string;
|
|
61
|
+
declare function stripCNPJ(value: string): string;
|
|
62
|
+
declare function ensureCNPJLength(value: string): string;
|
|
63
|
+
declare function normalizeCNPJBranch(value?: string): string;
|
|
64
|
+
declare function calculateCNPJCheckDigit(digits: number[]): number;
|
|
65
|
+
declare function resolveCNPJBranch(value: string): string | undefined;
|
|
66
|
+
|
|
67
|
+
declare function formatCNPJValue(value: string): string;
|
|
68
|
+
|
|
69
|
+
declare function maskCNPJ(value: string, options?: CNPJMaskOptions): string;
|
|
70
|
+
|
|
71
|
+
declare function generateCNPJ(options?: CNPJGenerateOptions): string;
|
|
72
|
+
declare function generateCNPJBatch(options: CNPJGenerateBatchOptions): string[];
|
|
73
|
+
|
|
74
|
+
declare function validateCNPJ(value: string, options?: CNPJValidateOptions): CNPJValidationResult;
|
|
75
|
+
|
|
76
|
+
type CEPStateCode = "AC" | "AL" | "AM" | "AP" | "BA" | "CE" | "DF" | "ES" | "GO" | "MA" | "MG" | "MS" | "MT" | "PA" | "PB" | "PE" | "PI" | "PR" | "RJ" | "RN" | "RO" | "RR" | "RS" | "SC" | "SE" | "SP" | "TO";
|
|
77
|
+
interface CEPGenerateOptions {
|
|
78
|
+
formatted?: boolean | undefined;
|
|
79
|
+
state?: CEPStateCode | undefined;
|
|
80
|
+
}
|
|
81
|
+
interface CEPGenerateBatchOptions extends CEPGenerateOptions {
|
|
82
|
+
count: number;
|
|
83
|
+
}
|
|
84
|
+
interface CEPValidateOptions {
|
|
85
|
+
strict?: boolean | undefined;
|
|
86
|
+
}
|
|
87
|
+
interface CEPValidationResult extends ValidationResult {
|
|
88
|
+
stateBias?: CEPStateCode | undefined;
|
|
89
|
+
}
|
|
90
|
+
interface CEPMaskOptions {
|
|
91
|
+
pattern?: string | undefined;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare function normalizeCEP(value: string): string;
|
|
95
|
+
declare function stripCEP(value: string): string;
|
|
96
|
+
declare function ensureCEPLength(value: string): string;
|
|
97
|
+
declare function resolveCEPLeadingDigits(state?: CEPStateCode): number[] | undefined;
|
|
98
|
+
|
|
99
|
+
declare function formatCEPValue(value: string): string;
|
|
100
|
+
|
|
101
|
+
declare function maskCEP(value: string, options?: CEPMaskOptions): string;
|
|
102
|
+
|
|
103
|
+
declare function generateCEP(options?: CEPGenerateOptions): string;
|
|
104
|
+
declare function generateCEPBatch(options: CEPGenerateBatchOptions): string[];
|
|
105
|
+
|
|
106
|
+
declare function validateCEP(value: string, options?: CEPValidateOptions): CEPValidationResult;
|
|
107
|
+
|
|
108
|
+
type CreditCardBrand = "visa" | "mastercard" | "amex" | "elo";
|
|
109
|
+
interface CreditCardGenerateOptions {
|
|
110
|
+
brand?: CreditCardBrand;
|
|
111
|
+
formatted?: boolean;
|
|
112
|
+
expiryYearsAhead?: number;
|
|
113
|
+
}
|
|
114
|
+
interface CreditCardData {
|
|
115
|
+
brand: CreditCardBrand;
|
|
116
|
+
number: string;
|
|
117
|
+
expiryMonth: string;
|
|
118
|
+
expiryYear: string;
|
|
119
|
+
expiry: string;
|
|
120
|
+
cvv: string;
|
|
121
|
+
}
|
|
122
|
+
interface CreditCardValidationInput {
|
|
123
|
+
number: string;
|
|
124
|
+
expiryMonth?: string;
|
|
125
|
+
expiryYear?: string;
|
|
126
|
+
expiry?: string;
|
|
127
|
+
cvv?: string;
|
|
128
|
+
}
|
|
129
|
+
interface CreditCardValidationResult {
|
|
130
|
+
isValid: boolean;
|
|
131
|
+
brand: CreditCardBrand | "unknown";
|
|
132
|
+
number: string;
|
|
133
|
+
numberValid: boolean;
|
|
134
|
+
expiryValid: boolean;
|
|
135
|
+
cvvValid: boolean;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
declare const CREDIT_CARD_BRAND_PREFIXES: Record<CreditCardBrand, string[]>;
|
|
139
|
+
declare const CREDIT_CARD_BRAND_LENGTHS: Record<CreditCardBrand, number[]>;
|
|
140
|
+
declare const CREDIT_CARD_BRAND_CVV_LENGTH: Record<CreditCardBrand, number>;
|
|
141
|
+
|
|
142
|
+
declare function detectCreditCardBrand(number: string): CreditCardBrand | "unknown";
|
|
143
|
+
|
|
144
|
+
declare function generateCreditCard(options?: CreditCardGenerateOptions): CreditCardData;
|
|
145
|
+
|
|
146
|
+
declare function validateCreditCard(input: CreditCardValidationInput): CreditCardValidationResult;
|
|
147
|
+
|
|
148
|
+
type RandomNumberOutputFormat = "plain" | "json" | "csv";
|
|
149
|
+
interface RandomBaseOptions {
|
|
150
|
+
seed?: number;
|
|
151
|
+
format?: RandomNumberOutputFormat;
|
|
152
|
+
}
|
|
153
|
+
interface RandomIntegerGenerateOptions extends RandomBaseOptions {
|
|
154
|
+
min?: number;
|
|
155
|
+
max?: number;
|
|
156
|
+
count?: number;
|
|
157
|
+
sorted?: boolean;
|
|
158
|
+
unique?: boolean;
|
|
159
|
+
}
|
|
160
|
+
interface RandomFloatGenerateOptions extends RandomBaseOptions {
|
|
161
|
+
min?: number;
|
|
162
|
+
max?: number;
|
|
163
|
+
count?: number;
|
|
164
|
+
sorted?: boolean;
|
|
165
|
+
precision?: number;
|
|
166
|
+
}
|
|
167
|
+
interface RandomPickOptions extends RandomBaseOptions {
|
|
168
|
+
items: string[];
|
|
169
|
+
count?: number;
|
|
170
|
+
unique?: boolean;
|
|
171
|
+
}
|
|
172
|
+
interface RandomShuffleOptions extends RandomBaseOptions {
|
|
173
|
+
items: string[];
|
|
174
|
+
}
|
|
175
|
+
interface DiceRollOptions extends RandomBaseOptions {
|
|
176
|
+
faces?: number;
|
|
177
|
+
count?: number;
|
|
178
|
+
}
|
|
179
|
+
interface CoinFlipOptions extends RandomBaseOptions {
|
|
180
|
+
seed?: number;
|
|
181
|
+
}
|
|
182
|
+
type RandomNumberGenerateOptions = RandomIntegerGenerateOptions;
|
|
183
|
+
type RandomNumberGenerateResult = number[];
|
|
184
|
+
|
|
185
|
+
declare function generateRandomIntegers(options?: RandomIntegerGenerateOptions): number[];
|
|
186
|
+
declare function generateRandomNumbers(options?: RandomNumberGenerateOptions): number[];
|
|
187
|
+
declare function generateRandomFloats(options?: RandomFloatGenerateOptions): number[];
|
|
188
|
+
declare function pickRandomItems(options: RandomPickOptions): string[];
|
|
189
|
+
declare function shuffleRandomItems(options: RandomShuffleOptions): string[];
|
|
190
|
+
declare function rollDice(options?: DiceRollOptions): number[];
|
|
191
|
+
declare function flipCoin(options?: CoinFlipOptions): "heads" | "tails";
|
|
192
|
+
|
|
193
|
+
interface NumberPickerOptions {
|
|
194
|
+
min?: number;
|
|
195
|
+
max?: number;
|
|
196
|
+
seed?: number;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
declare function pickRandomNumber(options?: NumberPickerOptions): number;
|
|
200
|
+
|
|
201
|
+
interface ZipArchiveEntryInfo {
|
|
202
|
+
path: string;
|
|
203
|
+
type: "file" | "directory";
|
|
204
|
+
compressedSize: number;
|
|
205
|
+
uncompressedSize: number;
|
|
206
|
+
}
|
|
207
|
+
interface ZipTestResult {
|
|
208
|
+
sourcePath: string;
|
|
209
|
+
testedEntries: number;
|
|
210
|
+
ok: boolean;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
interface ZipCommandOptions {
|
|
214
|
+
out?: string;
|
|
215
|
+
level?: number;
|
|
216
|
+
force?: boolean;
|
|
217
|
+
exclude?: string[];
|
|
218
|
+
contentsOnly?: boolean;
|
|
219
|
+
dryRun?: boolean;
|
|
220
|
+
verbose?: boolean;
|
|
221
|
+
quiet?: boolean;
|
|
222
|
+
followSymlinks?: boolean;
|
|
223
|
+
store?: boolean;
|
|
224
|
+
}
|
|
225
|
+
interface ZipExecutionPlan {
|
|
226
|
+
sourcePath: string;
|
|
227
|
+
outputPath: string;
|
|
228
|
+
sourceType: "file" | "directory";
|
|
229
|
+
exclude: string[];
|
|
230
|
+
contentsOnly: boolean;
|
|
231
|
+
level: number;
|
|
232
|
+
followSymlinks: boolean;
|
|
233
|
+
store: boolean;
|
|
234
|
+
}
|
|
235
|
+
interface ZipInputEntry {
|
|
236
|
+
type: "file" | "directory";
|
|
237
|
+
sourcePath: string;
|
|
238
|
+
entryName: string;
|
|
239
|
+
}
|
|
240
|
+
type ZipListResult = ZipArchiveEntryInfo[];
|
|
241
|
+
type ZipTestExecutionResult = ZipTestResult;
|
|
242
|
+
|
|
243
|
+
declare function resolveZipOutputPath(sourcePath: string, explicitOut?: string): string;
|
|
244
|
+
|
|
245
|
+
declare function collectZipInputs(sourcePath: string, outputPath: string, options?: ZipCommandOptions): ZipInputEntry[];
|
|
246
|
+
|
|
247
|
+
declare function createZipExecutionPlan(sourcePath: string, positionalOut?: string, options?: ZipCommandOptions): ZipExecutionPlan;
|
|
248
|
+
declare function createZip(sourcePath: string, positionalOut?: string, options?: ZipCommandOptions): Promise<ZipExecutionPlan>;
|
|
249
|
+
|
|
250
|
+
declare function listZip(sourcePath: string, match?: string): Promise<ZipListResult>;
|
|
251
|
+
|
|
252
|
+
declare function testZip(sourcePath: string, match?: string): Promise<ZipTestExecutionResult>;
|
|
253
|
+
|
|
254
|
+
interface UnzipCommandOptions {
|
|
255
|
+
out?: string;
|
|
256
|
+
force?: boolean;
|
|
257
|
+
dryRun?: boolean;
|
|
258
|
+
verbose?: boolean;
|
|
259
|
+
quiet?: boolean;
|
|
260
|
+
flat?: boolean;
|
|
261
|
+
match?: string;
|
|
262
|
+
}
|
|
263
|
+
interface UnzipExecutionPlan {
|
|
264
|
+
sourcePath: string;
|
|
265
|
+
outputDir: string;
|
|
266
|
+
flat: boolean;
|
|
267
|
+
match?: string;
|
|
268
|
+
}
|
|
269
|
+
type UnzipListResult = ZipArchiveEntryInfo[];
|
|
270
|
+
type UnzipTestResult = ZipTestResult;
|
|
271
|
+
|
|
272
|
+
declare function resolveUnzipOutputPath(sourcePath: string, explicitOut?: string): string;
|
|
273
|
+
|
|
274
|
+
declare function createUnzipExecutionPlan(sourcePath: string, positionalOut?: string, options?: UnzipCommandOptions): UnzipExecutionPlan;
|
|
275
|
+
declare function extractZipFile(sourcePath: string, positionalOut?: string, options?: UnzipCommandOptions): Promise<UnzipExecutionPlan>;
|
|
276
|
+
|
|
277
|
+
declare function listUnzip(sourcePath: string, match?: string): Promise<UnzipListResult>;
|
|
278
|
+
|
|
279
|
+
declare function testUnzip(sourcePath: string, match?: string): Promise<UnzipTestResult>;
|
|
280
|
+
|
|
281
|
+
type StringCaseStyle = "camel" | "snake" | "kebab" | "pascal" | "constant" | "title";
|
|
282
|
+
type StringCodecMode = "encode" | "decode";
|
|
283
|
+
type StringPadSide = "left" | "right" | "both";
|
|
284
|
+
interface TruncateTextOptions {
|
|
285
|
+
max: number;
|
|
286
|
+
suffix?: string;
|
|
287
|
+
}
|
|
288
|
+
interface ReplaceTextOptions {
|
|
289
|
+
from: string;
|
|
290
|
+
with: string;
|
|
291
|
+
regex?: boolean;
|
|
292
|
+
}
|
|
293
|
+
interface PadTextOptions {
|
|
294
|
+
length: number;
|
|
295
|
+
side?: StringPadSide;
|
|
296
|
+
}
|
|
297
|
+
interface ExtractTextOptions {
|
|
298
|
+
regex?: boolean;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
declare function slugifyText(value: string): string;
|
|
302
|
+
declare function convertStringCase(value: string, style: StringCaseStyle): string;
|
|
303
|
+
declare function trimText(value: string): string;
|
|
304
|
+
declare function truncateText(value: string, options: TruncateTextOptions): string;
|
|
305
|
+
declare function replaceText(value: string, options: ReplaceTextOptions): string;
|
|
306
|
+
declare function normalizeText(value: string): string;
|
|
307
|
+
declare function removeAccents(value: string): string;
|
|
308
|
+
declare function padText(value: string, options: PadTextOptions): string;
|
|
309
|
+
declare function extractText(value: string, query: string, options?: ExtractTextOptions): string[];
|
|
310
|
+
declare function transformBase64(value: string, mode?: StringCodecMode): string;
|
|
311
|
+
declare function transformUrlEncoding(value: string, mode?: StringCodecMode): string;
|
|
312
|
+
declare function transformHtmlEntities(value: string, mode?: StringCodecMode): string;
|
|
313
|
+
declare function getLevenshteinDistance(a: string, b: string): number;
|
|
314
|
+
|
|
315
|
+
interface JsonValidationResult {
|
|
316
|
+
isValid: boolean;
|
|
317
|
+
error?: string;
|
|
318
|
+
}
|
|
319
|
+
interface JsonDiffEntry {
|
|
320
|
+
path: string;
|
|
321
|
+
type: "added" | "removed" | "changed";
|
|
322
|
+
left?: unknown;
|
|
323
|
+
right?: unknown;
|
|
324
|
+
}
|
|
325
|
+
interface JsonDiffResult {
|
|
326
|
+
isEqual: boolean;
|
|
327
|
+
changes: JsonDiffEntry[];
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
declare function parseJsonInput(value: string): unknown;
|
|
331
|
+
declare function validateJsonInput(value: string): JsonValidationResult;
|
|
332
|
+
declare function formatJsonValue(value: unknown, indent?: number, sortKeys?: boolean): string;
|
|
333
|
+
declare function minifyJsonValue(value: unknown): string;
|
|
334
|
+
declare function getJsonPathValue(value: unknown, path: string): unknown;
|
|
335
|
+
declare function setJsonPathValue(value: unknown, path: string, newValue: unknown): unknown;
|
|
336
|
+
declare function deleteJsonPathValue(value: unknown, path: string): unknown;
|
|
337
|
+
declare function diffJsonValues(left: unknown, right: unknown): JsonDiffResult;
|
|
338
|
+
declare function mergeJsonValues(values: unknown[]): unknown;
|
|
339
|
+
declare function convertJsonToYaml(value: unknown): string;
|
|
340
|
+
|
|
341
|
+
type FixedHashAlgorithm = "md5" | "sha1" | "sha256" | "sha512";
|
|
342
|
+
interface HashSourceOptions {
|
|
343
|
+
text?: string;
|
|
344
|
+
file?: string;
|
|
345
|
+
}
|
|
346
|
+
interface HmacOptions extends HashSourceOptions {
|
|
347
|
+
algo: string;
|
|
348
|
+
key: string;
|
|
349
|
+
}
|
|
350
|
+
interface ChecksumOptions {
|
|
351
|
+
file: string;
|
|
352
|
+
algo?: string;
|
|
353
|
+
}
|
|
354
|
+
interface CompareHashOptions extends HashSourceOptions {
|
|
355
|
+
algo?: string;
|
|
356
|
+
expected: string;
|
|
357
|
+
}
|
|
358
|
+
interface CompareHashResult {
|
|
359
|
+
algorithm: string;
|
|
360
|
+
actual: string;
|
|
361
|
+
expected: string;
|
|
362
|
+
matches: boolean;
|
|
363
|
+
source: "text" | "file";
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
declare function computeHash(options: HashSourceOptions, algorithm: string): string;
|
|
367
|
+
declare function computeMd5(options: HashSourceOptions): string;
|
|
368
|
+
declare function computeSha1(options: HashSourceOptions): string;
|
|
369
|
+
declare function computeSha256(options: HashSourceOptions): string;
|
|
370
|
+
declare function computeSha512(options: HashSourceOptions): string;
|
|
371
|
+
declare function computeHmac(options: HmacOptions): string;
|
|
372
|
+
declare function computeChecksum(options: ChecksumOptions): string;
|
|
373
|
+
declare function compareHash(options: CompareHashOptions): CompareHashResult;
|
|
374
|
+
declare const FIXED_HASH_ALGORITHMS: FixedHashAlgorithm[];
|
|
375
|
+
|
|
376
|
+
type CharsetName = "alnum" | "alpha" | "numeric" | "hex" | "base64url" | "lower" | "upper";
|
|
377
|
+
interface UuidGenerateOptions {
|
|
378
|
+
count?: number;
|
|
379
|
+
}
|
|
380
|
+
interface TokenGenerateOptions {
|
|
381
|
+
count?: number;
|
|
382
|
+
length?: number;
|
|
383
|
+
charset?: CharsetName;
|
|
384
|
+
}
|
|
385
|
+
interface PasswordGenerateOptions {
|
|
386
|
+
count?: number;
|
|
387
|
+
length?: number;
|
|
388
|
+
charset?: CharsetName;
|
|
389
|
+
noSymbols?: boolean;
|
|
390
|
+
noNumbers?: boolean;
|
|
391
|
+
uppercase?: boolean;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
declare function generateUuidValues(options?: UuidGenerateOptions): string[];
|
|
395
|
+
declare function generateTokenValues(options?: TokenGenerateOptions): string[];
|
|
396
|
+
declare function generatePasswordValues(options?: PasswordGenerateOptions): string[];
|
|
397
|
+
declare const CHARSET_NAMES: CharsetName[];
|
|
398
|
+
|
|
399
|
+
type DateDiffUnit = "seconds" | "minutes" | "hours" | "days";
|
|
400
|
+
interface DateAdjustOptions {
|
|
401
|
+
days?: number;
|
|
402
|
+
hours?: number;
|
|
403
|
+
minutes?: number;
|
|
404
|
+
seconds?: number;
|
|
405
|
+
}
|
|
406
|
+
interface DateSnapshot {
|
|
407
|
+
iso: string;
|
|
408
|
+
unix: number;
|
|
409
|
+
unixMs: number;
|
|
410
|
+
}
|
|
411
|
+
interface ParsedDateResult extends DateSnapshot {
|
|
412
|
+
input: string;
|
|
413
|
+
}
|
|
414
|
+
interface DateDiffResult {
|
|
415
|
+
from: string;
|
|
416
|
+
to: string;
|
|
417
|
+
unit: DateDiffUnit;
|
|
418
|
+
value: number;
|
|
419
|
+
}
|
|
420
|
+
interface UnixConversionResult extends DateSnapshot {
|
|
421
|
+
input: string | number;
|
|
422
|
+
sourceUnit: "seconds" | "milliseconds";
|
|
423
|
+
}
|
|
424
|
+
interface TimeZoneConversionResult {
|
|
425
|
+
input: string;
|
|
426
|
+
timeZone: string;
|
|
427
|
+
formatted: string;
|
|
428
|
+
iso: string;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
declare function currentDateTime(): DateSnapshot;
|
|
432
|
+
declare function formatDateValue(value: string, pattern: string): string;
|
|
433
|
+
declare function parseDateValue(value: string): ParsedDateResult;
|
|
434
|
+
declare function addToDate(value: string, options: DateAdjustOptions): string;
|
|
435
|
+
declare function subtractFromDate(value: string, options: DateAdjustOptions): string;
|
|
436
|
+
declare function diffDates(from: string, to: string, unit?: DateDiffUnit): DateDiffResult;
|
|
437
|
+
declare function convertDateToUnix(value: string): UnixConversionResult;
|
|
438
|
+
declare function convertUnixValue(value: string | number): UnixConversionResult;
|
|
439
|
+
declare function convertDateToTimeZone(value: string, timeZone: string): TimeZoneConversionResult;
|
|
440
|
+
declare const DATE_DIFF_UNITS: DateDiffUnit[];
|
|
441
|
+
|
|
442
|
+
export { type CEPGenerateBatchOptions, type CEPGenerateOptions, type CEPMaskOptions, type CEPStateCode, type CEPValidateOptions, type CEPValidationResult, CHARSET_NAMES, type CNPJGenerateBatchOptions, type CNPJGenerateOptions, type CNPJMaskOptions, type CNPJValidateOptions, type CNPJValidationResult, type CPFGenerateBatchOptions, type CPFGenerateOptions, type CPFMaskOptions, type CPFStateCode, type CPFValidateOptions, type CPFValidationResult, CREDIT_CARD_BRAND_CVV_LENGTH, CREDIT_CARD_BRAND_LENGTHS, CREDIT_CARD_BRAND_PREFIXES, type CharsetName, type ChecksumOptions, type CoinFlipOptions, type CompareHashOptions, type CompareHashResult, type CreditCardBrand, type CreditCardData, type CreditCardGenerateOptions, type CreditCardValidationInput, type CreditCardValidationResult, DATE_DIFF_UNITS, type DateAdjustOptions, type DateDiffResult, type DateDiffUnit, type DateSnapshot, type DiceRollOptions, type ExtractTextOptions, FIXED_HASH_ALGORITHMS, type FixedHashAlgorithm, type HashSourceOptions, type HmacOptions, type JsonDiffEntry, type JsonDiffResult, type JsonValidationResult, type NumberPickerOptions, type PadTextOptions, type ParsedDateResult, type PasswordGenerateOptions, type RandomBaseOptions, type RandomFloatGenerateOptions, type RandomIntegerGenerateOptions, type RandomNumberGenerateOptions, type RandomNumberGenerateResult, type RandomNumberOutputFormat, type RandomPickOptions, type RandomShuffleOptions, type ReplaceTextOptions, type StringCaseStyle, type StringCodecMode, type StringPadSide, type TimeZoneConversionResult, type TokenGenerateOptions, type TruncateTextOptions, type UnixConversionResult, type UnzipCommandOptions, type UnzipExecutionPlan, type UnzipListResult, type UnzipTestResult, type UuidGenerateOptions, type ZipCommandOptions, type ZipExecutionPlan, type ZipInputEntry, type ZipListResult, type ZipTestExecutionResult, addToDate, calculateCNPJCheckDigit, calculateCPFCheckDigit, collectZipInputs, compareHash, computeChecksum, computeHash, computeHmac, computeMd5, computeSha1, computeSha256, computeSha512, convertDateToTimeZone, convertDateToUnix, convertJsonToYaml, convertStringCase, convertUnixValue, createUnzipExecutionPlan, createZip, createZipExecutionPlan, currentDateTime, deleteJsonPathValue, detectCreditCardBrand, diffDates, diffJsonValues, ensureCEPLength, ensureCNPJLength, ensureCPFLength, extractText, extractZipFile, flipCoin, formatCEPValue, formatCNPJValue, formatCPFValue, formatDateValue, formatJsonValue, generateCEP, generateCEPBatch, generateCNPJ, generateCNPJBatch, generateCPF, generateCPFBatch, generateCreditCard, generatePasswordValues, generateRandomFloats, generateRandomIntegers, generateRandomNumbers, generateTokenValues, generateUuidValues, getJsonPathValue, getLevenshteinDistance, listUnzip, listZip, maskCEP, maskCNPJ, maskCPF, mergeJsonValues, minifyJsonValue, normalizeCEP, normalizeCNPJ, normalizeCNPJBranch, normalizeCPF, normalizeText, padText, parseDateValue, parseJsonInput, pickRandomItems, pickRandomNumber, removeAccents, replaceText, resolveCEPLeadingDigits, resolveCNPJBranch, resolveCPFRegionDigit, resolveCPFStateFromDigits, resolveUnzipOutputPath, resolveZipOutputPath, rollDice, setJsonPathValue, shuffleRandomItems, slugifyText, stripCEP, stripCNPJ, stripCPF, subtractFromDate, testUnzip, testZip, transformBase64, transformHtmlEntities, transformUrlEncoding, trimText, truncateText, validateCEP, validateCNPJ, validateCPF, validateCreditCard, validateJsonInput };
|