@questwork/q-utilities 0.1.36 → 0.1.37
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/q-utilities.cjs +12 -5199
- package/dist/q-utilities.d.ts +99 -27
- package/dist/q-utilities.esm.js +2694 -3864
- package/dist/q-utilities.iife.js +12 -5201
- package/dist/q-utilities.umd.js +11 -5202
- package/package.json +3 -3
package/dist/q-utilities.d.ts
CHANGED
|
@@ -140,12 +140,12 @@ declare interface CheckResultConfig {
|
|
|
140
140
|
|
|
141
141
|
declare interface CheckResultOptions {
|
|
142
142
|
dataSets: DataSet[] | undefined;
|
|
143
|
-
getDataSetByName(name: string)
|
|
144
|
-
getSummary()
|
|
145
|
-
getIgnoredDetails()
|
|
146
|
-
getInvalidDetails()
|
|
147
|
-
getDuplicatedDetails()
|
|
148
|
-
getValidDetails()
|
|
143
|
+
getDataSetByName: (name: string) => DataSet | undefined;
|
|
144
|
+
getSummary: () => DataSetSummaryItem[];
|
|
145
|
+
getIgnoredDetails: () => DetailsResultItem[];
|
|
146
|
+
getInvalidDetails: () => DetailsResultItem[];
|
|
147
|
+
getDuplicatedDetails: () => DetailsResultItem[];
|
|
148
|
+
getValidDetails: () => Record<string, DataWrapper[]>;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
export declare function concatStringByArray(arrTemplate: any, data: any): any;
|
|
@@ -302,6 +302,7 @@ declare const _default: {
|
|
|
302
302
|
makeApiResponse: typeof models.makeApiResponse;
|
|
303
303
|
AwsStsS3Client: typeof models.AwsStsS3Client;
|
|
304
304
|
KeyValueObject: typeof models.KeyValueObject;
|
|
305
|
+
MediaFile: typeof models.MediaFile;
|
|
305
306
|
Metadata: typeof models.Metadata;
|
|
306
307
|
PushEnvelope: typeof models.PushEnvelope;
|
|
307
308
|
ConsoleLog: typeof models.ConsoleLog;
|
|
@@ -364,7 +365,6 @@ declare const _default: {
|
|
|
364
365
|
TrackedEntity: typeof models.TrackedEntity;
|
|
365
366
|
UniqueKeyGenerator: typeof models.UniqueKeyGenerator;
|
|
366
367
|
WebAppRequest: typeof models.WebAppRequest;
|
|
367
|
-
ErrorDetail: typeof models.ErrorDetail;
|
|
368
368
|
ERROR_CODES: {
|
|
369
369
|
readonly EXCUTE_EVENT_ERROR: "EXCUTE_EVENT_ERROR";
|
|
370
370
|
readonly NOT_FOUND: "NOT_FOUND";
|
|
@@ -373,6 +373,7 @@ declare const _default: {
|
|
|
373
373
|
readonly UNAUTHORIZED: "UNAUTHORIZED";
|
|
374
374
|
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
375
375
|
};
|
|
376
|
+
ErrorDetail: typeof models.ErrorDetail;
|
|
376
377
|
WebAppResponse: typeof models.WebAppResponse;
|
|
377
378
|
authorize({ allowCoordinator, allowOwner, query, required, user }: {
|
|
378
379
|
allowCoordinator: any;
|
|
@@ -391,13 +392,14 @@ declare const _default: {
|
|
|
391
392
|
convertTimestampToString(timestamp: any, dateFormat: any): any;
|
|
392
393
|
detectControlCharacters(input: string, options?: {
|
|
393
394
|
preserveBasicWhitespace?: boolean;
|
|
394
|
-
}):
|
|
395
|
+
}): object;
|
|
395
396
|
printControlCharReport(report: any): void;
|
|
396
397
|
displayName(user: any, options: any): any;
|
|
397
398
|
downloadFileByUrl: typeof helpers.downloadFileByUrl;
|
|
399
|
+
escapeHtml: typeof helpers.escapeHtml;
|
|
398
400
|
escapeRegex(string: any): string;
|
|
399
|
-
ExcelImportHelper: typeof helpers.ExcelImportHelper;
|
|
400
401
|
CheckResult: typeof helpers.CheckResult;
|
|
402
|
+
ExcelImportHelper: typeof helpers.ExcelImportHelper;
|
|
401
403
|
LOG_TYPE: {
|
|
402
404
|
readonly IGNORE: "IGNORE";
|
|
403
405
|
readonly DUPLICATED: "DUPLICATED";
|
|
@@ -422,6 +424,8 @@ declare const _default: {
|
|
|
422
424
|
};
|
|
423
425
|
extractEmails(dirtyArray: any[]): any[];
|
|
424
426
|
formatDate: typeof helpers.formatDate;
|
|
427
|
+
formatDateMoment(date: any, format: any): any;
|
|
428
|
+
fromNotify: typeof helpers.fromNotify;
|
|
425
429
|
generalPost: typeof helpers.generalPost;
|
|
426
430
|
getObjectByArr: typeof helpers.getObjectByArr;
|
|
427
431
|
getValidation: typeof helpers.getValidation;
|
|
@@ -457,9 +461,11 @@ declare const _default: {
|
|
|
457
461
|
pMapSkip: typeof helpers.pMapSkip;
|
|
458
462
|
pReduce: typeof helpers.pReduce;
|
|
459
463
|
renderByTemplate: typeof helpers.renderByTemplate;
|
|
460
|
-
replacePlaceholders({ content, mapping }: {
|
|
464
|
+
replacePlaceholders({ content, mapping, optionSets, module }: {
|
|
461
465
|
content: any;
|
|
462
466
|
mapping: any;
|
|
467
|
+
optionSets: any;
|
|
468
|
+
module: any;
|
|
463
469
|
}): any;
|
|
464
470
|
sanitizeText(input: string, options?: {
|
|
465
471
|
normalizeWhitespace?: boolean;
|
|
@@ -472,6 +478,7 @@ declare const _default: {
|
|
|
472
478
|
stringFormatter: typeof helpers.stringFormatter;
|
|
473
479
|
stringHelper: {
|
|
474
480
|
getCssClass: (str: any) => any;
|
|
481
|
+
hasAsianCharacters: (str: any) => boolean;
|
|
475
482
|
isSame: (str1: any, str2: any) => boolean;
|
|
476
483
|
punctuationless: (str: any) => any;
|
|
477
484
|
safeToUpperCase: (input: any) => any;
|
|
@@ -481,6 +488,7 @@ declare const _default: {
|
|
|
481
488
|
toScreamingSnakeCase: (str: any) => any;
|
|
482
489
|
};
|
|
483
490
|
tenantPlugin(schema: any, options: any): void;
|
|
491
|
+
toTimestampInTimezone(date: any, time: any, ianaTimezone?: string): number;
|
|
484
492
|
trackingPlugin(schema: any, options: any): void;
|
|
485
493
|
};
|
|
486
494
|
export default _default;
|
|
@@ -494,13 +502,13 @@ declare interface DetailsResultItem {
|
|
|
494
502
|
/**
|
|
495
503
|
* Detects and reports hidden/control characters in a string without modifying it.
|
|
496
504
|
* @param {string} input - The string to analyze.
|
|
497
|
-
* @param {
|
|
498
|
-
* @param {boolean} [options.preserveBasicWhitespace
|
|
499
|
-
* @returns {
|
|
505
|
+
* @param {object} [options] - Configuration options.
|
|
506
|
+
* @param {boolean} [options.preserveBasicWhitespace] - Whether to consider basic whitespace as valid.
|
|
507
|
+
* @returns {object} Report object with detection results.
|
|
500
508
|
*/
|
|
501
509
|
export declare function detectControlCharacters(input: string, options?: {
|
|
502
510
|
preserveBasicWhitespace?: boolean;
|
|
503
|
-
}):
|
|
511
|
+
}): object;
|
|
504
512
|
|
|
505
513
|
export declare function displayName(user: any, options: any): any;
|
|
506
514
|
|
|
@@ -536,6 +544,8 @@ export declare interface ErrorDetailOptions {
|
|
|
536
544
|
timestamp?: number | null;
|
|
537
545
|
}
|
|
538
546
|
|
|
547
|
+
export declare function escapeHtml(value: any): string;
|
|
548
|
+
|
|
539
549
|
export declare function escapeRegex(string: any): string;
|
|
540
550
|
|
|
541
551
|
declare interface ExcelDataItem {
|
|
@@ -597,6 +607,16 @@ declare function findOneResult({ responseHelper, service }: {
|
|
|
597
607
|
|
|
598
608
|
export declare function formatDate(date: any, format: any): any;
|
|
599
609
|
|
|
610
|
+
export declare function formatDateMoment(date: any, format: any): any;
|
|
611
|
+
|
|
612
|
+
export declare function fromNotify(data: any): {
|
|
613
|
+
type: string;
|
|
614
|
+
attachments: {
|
|
615
|
+
contentType: string;
|
|
616
|
+
content: any;
|
|
617
|
+
}[];
|
|
618
|
+
};
|
|
619
|
+
|
|
600
620
|
export declare function generalPost({ body, GeneralModel, UniqueKeyGenerator, resourceInfo }: {
|
|
601
621
|
body?: {};
|
|
602
622
|
GeneralModel: any;
|
|
@@ -634,13 +654,16 @@ declare namespace helpers {
|
|
|
634
654
|
printControlCharReport,
|
|
635
655
|
displayName,
|
|
636
656
|
downloadFileByUrl,
|
|
657
|
+
escapeHtml,
|
|
637
658
|
escapeRegex,
|
|
638
|
-
ExcelImportHelper,
|
|
639
659
|
CheckResult,
|
|
660
|
+
ExcelImportHelper,
|
|
640
661
|
LOG_TYPE,
|
|
641
662
|
expressHelper,
|
|
642
663
|
extractEmails,
|
|
643
664
|
formatDate,
|
|
665
|
+
formatDateMoment,
|
|
666
|
+
fromNotify,
|
|
644
667
|
generalPost,
|
|
645
668
|
getObjectByArr,
|
|
646
669
|
getValidation,
|
|
@@ -665,6 +688,7 @@ declare namespace helpers {
|
|
|
665
688
|
stringFormatter,
|
|
666
689
|
stringHelper,
|
|
667
690
|
tenantPlugin,
|
|
691
|
+
toTimestampInTimezone,
|
|
668
692
|
trackingPlugin
|
|
669
693
|
}
|
|
670
694
|
}
|
|
@@ -700,6 +724,10 @@ export declare class KeyValueObject {
|
|
|
700
724
|
static appendValueArray(arr: any[], key: any, value: any): any[];
|
|
701
725
|
static foundByKey(arr: any[], key: any): any;
|
|
702
726
|
static foundValueByKey(arr: any[], key: any): any;
|
|
727
|
+
static mapValueByKey(arr: any[], key: any, ifNull?: {}): any;
|
|
728
|
+
static ownerByPath(root?: {}, ownerPath?: string): any;
|
|
729
|
+
static valueByKeyFromPaths(root: {}, ownerPaths: any[], key: any, options?: {}): any;
|
|
730
|
+
static mapValueByKeyFromPaths(root: {}, ownerPaths: any[], key: any, options?: {}): any;
|
|
703
731
|
static fromObject(options?: {}): any[];
|
|
704
732
|
static getValueByKey(arr: any[], key: any): any;
|
|
705
733
|
static getMetadataValueByKeyAsArray(arr: any[], key: any): any;
|
|
@@ -764,9 +792,17 @@ export declare class LogRecord {
|
|
|
764
792
|
stackTrace: any;
|
|
765
793
|
name: any;
|
|
766
794
|
zone: any;
|
|
795
|
+
callerFile: any;
|
|
796
|
+
callerLine: any;
|
|
767
797
|
toString(): string;
|
|
768
798
|
logName(): string;
|
|
769
799
|
serialize(): any;
|
|
800
|
+
toJson(): {
|
|
801
|
+
timestamp: any;
|
|
802
|
+
level: any;
|
|
803
|
+
name: any;
|
|
804
|
+
msg: any;
|
|
805
|
+
};
|
|
770
806
|
}
|
|
771
807
|
|
|
772
808
|
declare type LogType = typeof LOG_TYPE[keyof typeof LOG_TYPE];
|
|
@@ -784,6 +820,39 @@ export declare function makeServiceBulkWrite({ repo }: {
|
|
|
784
820
|
repo: any;
|
|
785
821
|
}): ServiceBulkWrite;
|
|
786
822
|
|
|
823
|
+
export declare class MediaFile {
|
|
824
|
+
static dummyData(): {
|
|
825
|
+
category: string;
|
|
826
|
+
code: string;
|
|
827
|
+
mediaMeta: {
|
|
828
|
+
mimeType: string;
|
|
829
|
+
size: number;
|
|
830
|
+
};
|
|
831
|
+
meta: {
|
|
832
|
+
active: boolean;
|
|
833
|
+
deleted: boolean;
|
|
834
|
+
created: number;
|
|
835
|
+
creator: string;
|
|
836
|
+
modified: number;
|
|
837
|
+
owner: string;
|
|
838
|
+
};
|
|
839
|
+
url: string;
|
|
840
|
+
};
|
|
841
|
+
static get _classname(): string;
|
|
842
|
+
static get _superclass(): string;
|
|
843
|
+
static init(options?: {}): any;
|
|
844
|
+
static initFromArray(arr?: any[]): any[];
|
|
845
|
+
static initOnlyValidFromArray(arr?: any[]): any[];
|
|
846
|
+
constructor(options?: {});
|
|
847
|
+
category: any;
|
|
848
|
+
code: any;
|
|
849
|
+
mediaMeta: any;
|
|
850
|
+
meta: any;
|
|
851
|
+
url: any;
|
|
852
|
+
get __valid(): {};
|
|
853
|
+
get isValid(): boolean;
|
|
854
|
+
}
|
|
855
|
+
|
|
787
856
|
export declare function mergeArraysByKey(arr1: any, arr2: any): {
|
|
788
857
|
key: any;
|
|
789
858
|
value: any;
|
|
@@ -798,6 +867,7 @@ declare namespace models {
|
|
|
798
867
|
makeApiResponse,
|
|
799
868
|
AwsStsS3Client,
|
|
800
869
|
KeyValueObject,
|
|
870
|
+
MediaFile,
|
|
801
871
|
Metadata,
|
|
802
872
|
PushEnvelope,
|
|
803
873
|
ConsoleLog,
|
|
@@ -820,11 +890,11 @@ declare namespace models {
|
|
|
820
890
|
TrackedEntity,
|
|
821
891
|
UniqueKeyGenerator,
|
|
822
892
|
WebAppRequest,
|
|
823
|
-
ErrorDetail,
|
|
824
893
|
ERROR_CODES,
|
|
825
|
-
|
|
894
|
+
ErrorCode,
|
|
895
|
+
ErrorDetail,
|
|
826
896
|
ErrorDetailOptions,
|
|
827
|
-
|
|
897
|
+
WebAppResponse
|
|
828
898
|
}
|
|
829
899
|
}
|
|
830
900
|
|
|
@@ -891,9 +961,13 @@ export declare class PushEnvelope extends TrackedEntity {
|
|
|
891
961
|
}
|
|
892
962
|
|
|
893
963
|
export declare class QLog {
|
|
964
|
+
static get _classname(): string;
|
|
965
|
+
static get _superclass(): string;
|
|
894
966
|
static getInstance(options: any): any;
|
|
967
|
+
static resetInstance(): void;
|
|
895
968
|
constructor(options?: {});
|
|
896
969
|
_level: any;
|
|
970
|
+
_captureCaller: any;
|
|
897
971
|
_handlers: Map<any, any>;
|
|
898
972
|
setLevel(level: any): this;
|
|
899
973
|
addHandler(handler: any): this;
|
|
@@ -987,9 +1061,11 @@ export declare class QMeta {
|
|
|
987
1061
|
|
|
988
1062
|
export declare function renderByTemplate({ engine, template, value }?: {}): any;
|
|
989
1063
|
|
|
990
|
-
export declare function replacePlaceholders({ content, mapping }: {
|
|
1064
|
+
export declare function replacePlaceholders({ content, mapping, optionSets, module }: {
|
|
991
1065
|
content: any;
|
|
992
1066
|
mapping: any;
|
|
1067
|
+
optionSets: any;
|
|
1068
|
+
module: any;
|
|
993
1069
|
}): any;
|
|
994
1070
|
|
|
995
1071
|
export declare class Repo {
|
|
@@ -1297,6 +1373,7 @@ export declare function stringFormatter(str: any, delimiter?: string): any;
|
|
|
1297
1373
|
|
|
1298
1374
|
export declare namespace stringHelper {
|
|
1299
1375
|
export { getCssClass };
|
|
1376
|
+
export { hasAsianCharacters };
|
|
1300
1377
|
export { isSame };
|
|
1301
1378
|
export { punctuationless };
|
|
1302
1379
|
export { safeToUpperCase };
|
|
@@ -1374,6 +1451,8 @@ export declare class TenantAwareEntity extends TrackedEntity {
|
|
|
1374
1451
|
|
|
1375
1452
|
export declare function tenantPlugin(schema: any, options: any): void;
|
|
1376
1453
|
|
|
1454
|
+
export declare function toTimestampInTimezone(date: any, time: any, ianaTimezone?: string): number;
|
|
1455
|
+
|
|
1377
1456
|
export declare class TrackedEntity {
|
|
1378
1457
|
static dummyData(): {
|
|
1379
1458
|
meta: {
|
|
@@ -1394,14 +1473,7 @@ export declare class TrackedEntity {
|
|
|
1394
1473
|
constructor(options?: {});
|
|
1395
1474
|
id: any;
|
|
1396
1475
|
_type: any;
|
|
1397
|
-
meta:
|
|
1398
|
-
active: any;
|
|
1399
|
-
created: any;
|
|
1400
|
-
creator: any;
|
|
1401
|
-
deleted: any;
|
|
1402
|
-
modified: any;
|
|
1403
|
-
owner: any;
|
|
1404
|
-
};
|
|
1476
|
+
meta: any;
|
|
1405
1477
|
get __valid(): {};
|
|
1406
1478
|
get isValid(): boolean;
|
|
1407
1479
|
get active(): any;
|