@hanivanrizky/nestjs-browser-action 0.15.0 → 0.16.1
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/README.md +230 -286
- package/dist/interfaces/browser-action-options.d.ts +2 -2
- package/dist/interfaces/cleansing-options.d.ts +3 -8
- package/dist/interfaces/types.d.ts +32 -1
- package/dist/interfaces/workflow-options.d.ts +2 -2
- package/dist/pipes/alt-flag.pipe.d.ts +1 -1
- package/dist/pipes/alt-flag.pipe.js.map +1 -1
- package/dist/pipes/clean-html.pipe.d.ts +5 -0
- package/dist/pipes/clean-html.pipe.js +52 -0
- package/dist/pipes/clean-html.pipe.js.map +1 -0
- package/dist/pipes/cleansing-pipe.d.ts +4 -3
- package/dist/pipes/cleansing-pipe.js +3 -17
- package/dist/pipes/cleansing-pipe.js.map +1 -1
- package/dist/pipes/date-format-special.pipe.d.ts +6 -0
- package/dist/pipes/date-format-special.pipe.js +24 -0
- package/dist/pipes/date-format-special.pipe.js.map +1 -0
- package/dist/pipes/date-format.pipe.d.ts +1 -1
- package/dist/pipes/date-format.pipe.js.map +1 -1
- package/dist/pipes/extract-email.pipe.d.ts +6 -0
- package/dist/pipes/extract-email.pipe.js +19 -0
- package/dist/pipes/extract-email.pipe.js.map +1 -0
- package/dist/pipes/extract-url-params.pipe.d.ts +10 -0
- package/dist/pipes/extract-url-params.pipe.js +57 -0
- package/dist/pipes/extract-url-params.pipe.js.map +1 -0
- package/dist/pipes/index.d.ts +16 -0
- package/dist/pipes/index.js +16 -0
- package/dist/pipes/index.js.map +1 -1
- package/dist/pipes/json-path.pipe.d.ts +8 -0
- package/dist/pipes/json-path.pipe.js +40 -0
- package/dist/pipes/json-path.pipe.js.map +1 -0
- package/dist/pipes/media-filter.pipe.d.ts +7 -0
- package/dist/pipes/media-filter.pipe.js +21 -0
- package/dist/pipes/media-filter.pipe.js.map +1 -0
- package/dist/pipes/normalize-whitespace.pipe.d.ts +1 -1
- package/dist/pipes/normalize-whitespace.pipe.js.map +1 -1
- package/dist/pipes/number-normalize.pipe.d.ts +6 -0
- package/dist/pipes/number-normalize.pipe.js +38 -0
- package/dist/pipes/number-normalize.pipe.js.map +1 -0
- package/dist/pipes/parse-as-url.pipe.d.ts +7 -0
- package/dist/pipes/parse-as-url.pipe.js +45 -0
- package/dist/pipes/parse-as-url.pipe.js.map +1 -0
- package/dist/pipes/pipe-engine.d.ts +20 -0
- package/dist/pipes/pipe-engine.js +81 -0
- package/dist/pipes/pipe-engine.js.map +1 -0
- package/dist/pipes/pipe-registry.d.ts +3 -0
- package/dist/pipes/pipe-registry.js +89 -0
- package/dist/pipes/pipe-registry.js.map +1 -0
- package/dist/pipes/profiles/currency.profile.js +11 -12
- package/dist/pipes/profiles/currency.profile.js.map +1 -1
- package/dist/pipes/profiles/date.profile.js +10 -7
- package/dist/pipes/profiles/date.profile.js.map +1 -1
- package/dist/pipes/profiles/email.profile.js +9 -9
- package/dist/pipes/profiles/email.profile.js.map +1 -1
- package/dist/pipes/profiles/phone.profile.js +11 -11
- package/dist/pipes/profiles/phone.profile.js.map +1 -1
- package/dist/pipes/profiles/price.profile.js +11 -12
- package/dist/pipes/profiles/price.profile.js.map +1 -1
- package/dist/pipes/profiles.d.ts +2 -2
- package/dist/pipes/profiles.js +5 -5
- package/dist/pipes/profiles.js.map +1 -1
- package/dist/pipes/query-append.pipe.d.ts +9 -0
- package/dist/pipes/query-append.pipe.js +47 -0
- package/dist/pipes/query-append.pipe.js.map +1 -0
- package/dist/pipes/query-remover.pipe.d.ts +22 -0
- package/dist/pipes/query-remover.pipe.js +83 -0
- package/dist/pipes/query-remover.pipe.js.map +1 -0
- package/dist/pipes/regex-extract.pipe.d.ts +1 -1
- package/dist/pipes/regex-extract.pipe.js.map +1 -1
- package/dist/pipes/regex-extraction.pipe.d.ts +25 -0
- package/dist/pipes/regex-extraction.pipe.js +90 -0
- package/dist/pipes/regex-extraction.pipe.js.map +1 -0
- package/dist/pipes/regex-replace-x.pipe.d.ts +28 -0
- package/dist/pipes/regex-replace-x.pipe.js +104 -0
- package/dist/pipes/regex-replace-x.pipe.js.map +1 -0
- package/dist/pipes/regex-replace.pipe.d.ts +1 -1
- package/dist/pipes/regex-replace.pipe.js.map +1 -1
- package/dist/pipes/regex.pipe.d.ts +12 -0
- package/dist/pipes/regex.pipe.js +42 -0
- package/dist/pipes/regex.pipe.js.map +1 -0
- package/dist/pipes/remove-currency-symbol.pipe.d.ts +1 -1
- package/dist/pipes/remove-currency-symbol.pipe.js.map +1 -1
- package/dist/pipes/remove-line-breaks.pipe.d.ts +1 -1
- package/dist/pipes/remove-line-breaks.pipe.js.map +1 -1
- package/dist/pipes/remove-special-chars.pipe.d.ts +1 -1
- package/dist/pipes/remove-special-chars.pipe.js.map +1 -1
- package/dist/pipes/sanitize-text.pipe.d.ts +1 -1
- package/dist/pipes/sanitize-text.pipe.js.map +1 -1
- package/dist/pipes/to-lower-case.pipe.d.ts +1 -1
- package/dist/pipes/to-lower-case.pipe.js.map +1 -1
- package/dist/pipes/to-number.pipe.d.ts +1 -1
- package/dist/pipes/to-number.pipe.js.map +1 -1
- package/dist/pipes/to-upper-case.pipe.d.ts +1 -1
- package/dist/pipes/to-upper-case.pipe.js.map +1 -1
- package/dist/pipes/trim.pipe.d.ts +1 -1
- package/dist/pipes/trim.pipe.js.map +1 -1
- package/dist/pipes/url-resolve.pipe.d.ts +7 -0
- package/dist/pipes/url-resolve.pipe.js +52 -0
- package/dist/pipes/url-resolve.pipe.js.map +1 -0
- package/dist/services/browser-action.service.d.ts +3 -3
- package/dist/services/browser-action.service.js +54 -27
- package/dist/services/browser-action.service.js.map +1 -1
- package/dist/services/browser-pool.service.js +3 -1
- package/dist/services/browser-pool.service.js.map +1 -1
- package/dist/services/cleansing.service.d.ts +2 -4
- package/dist/services/cleansing.service.js +24 -81
- package/dist/services/cleansing.service.js.map +1 -1
- package/dist/services/cookie.service.js +3 -1
- package/dist/services/cookie.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/validators/workflow.validator.js +2 -2
- package/dist/validators/workflow.validator.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ParseAsURLPipe = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const cleansing_pipe_1 = require("./cleansing-pipe");
|
|
15
|
+
class ParseAsURLPipe extends cleansing_pipe_1.CleansingPipe {
|
|
16
|
+
type = 'parse-as-url';
|
|
17
|
+
baseUrl;
|
|
18
|
+
exec(value) {
|
|
19
|
+
if (!value || typeof value !== 'string') {
|
|
20
|
+
return '';
|
|
21
|
+
}
|
|
22
|
+
if (value.startsWith('http://') || value.startsWith('https://')) {
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
if (!this.baseUrl) {
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
return new URL(value, this.baseUrl).toString();
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
reverse(value) {
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.ParseAsURLPipe = ParseAsURLPipe;
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsOptional)(),
|
|
42
|
+
(0, class_validator_1.IsString)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], ParseAsURLPipe.prototype, "baseUrl", void 0);
|
|
45
|
+
//# sourceMappingURL=parse-as-url.pipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-as-url.pipe.js","sourceRoot":"","sources":["../../src/pipes/parse-as-url.pipe.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AACvD,qDAAiD;AAEjD,MAAa,cAAe,SAAQ,8BAA6B;IACtD,IAAI,GAAG,cAAuB,CAAC;IAIxC,OAAO,CAAU;IAEjB,IAAI,CAAC,KAAa;QAChB,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACxC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAI,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAChE,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,CAAC;YACH,OAAO,IAAI,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;QACjD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,CAAC,KAAa;QACnB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA9BD,wCA8BC;AAzBC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+CACM"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CleansingPipe } from './cleansing-pipe';
|
|
2
|
+
export interface CleanerRule {
|
|
3
|
+
from: string;
|
|
4
|
+
to: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CleanerStepRules {
|
|
7
|
+
trim?: boolean;
|
|
8
|
+
toLowerCase?: boolean;
|
|
9
|
+
toUpperCase?: boolean;
|
|
10
|
+
replace?: CleanerRule[];
|
|
11
|
+
decode?: boolean;
|
|
12
|
+
merge?: boolean | 'with space' | 'with comma';
|
|
13
|
+
custom?: Array<Record<string, unknown>>;
|
|
14
|
+
}
|
|
15
|
+
export declare class PipeEngine {
|
|
16
|
+
private readonly logger;
|
|
17
|
+
apply(value: string, pipes?: CleanerStepRules, url?: string): string;
|
|
18
|
+
private instantiate;
|
|
19
|
+
register(type: string, PipeClass: new () => CleansingPipe): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PipeEngine = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const html_entities_1 = require("html-entities");
|
|
6
|
+
const class_transformer_1 = require("class-transformer");
|
|
7
|
+
const pipe_registry_1 = require("./pipe-registry");
|
|
8
|
+
class PipeEngine {
|
|
9
|
+
logger = new common_1.Logger(PipeEngine.name);
|
|
10
|
+
apply(value, pipes, url) {
|
|
11
|
+
if (!pipes || !value) {
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
let result = value;
|
|
15
|
+
if (pipes.decode) {
|
|
16
|
+
result = (0, html_entities_1.decode)(result);
|
|
17
|
+
}
|
|
18
|
+
if (pipes.toLowerCase) {
|
|
19
|
+
result = result.toLowerCase();
|
|
20
|
+
}
|
|
21
|
+
if (pipes.toUpperCase) {
|
|
22
|
+
result = result.toUpperCase();
|
|
23
|
+
}
|
|
24
|
+
if (pipes.trim) {
|
|
25
|
+
result = result.trim();
|
|
26
|
+
}
|
|
27
|
+
if (pipes.replace) {
|
|
28
|
+
for (const replacement of pipes.replace) {
|
|
29
|
+
result = result.replace(new RegExp(replacement.from, 'g'), replacement.to);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (pipes.custom && pipes.custom.length > 0) {
|
|
33
|
+
const customPipes = this.instantiate(pipes.custom, url);
|
|
34
|
+
for (const customPipe of customPipes) {
|
|
35
|
+
if (typeof customPipe.exec === 'function') {
|
|
36
|
+
try {
|
|
37
|
+
const transformed = customPipe.exec(result);
|
|
38
|
+
result =
|
|
39
|
+
typeof transformed === 'string'
|
|
40
|
+
? transformed
|
|
41
|
+
: String(transformed);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
this.logger.error(`Custom pipe execution failed:`, error);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
result = result.replace(/\s+/g, ' ').trim();
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
instantiate(pipeConfigs, url) {
|
|
53
|
+
const pipes = [];
|
|
54
|
+
for (const config of pipeConfigs) {
|
|
55
|
+
const pipeType = config.type;
|
|
56
|
+
if (!pipeType) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const PipeClass = pipe_registry_1.PIPE_REGISTRY[pipeType];
|
|
60
|
+
if (!PipeClass) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
const pipe = (0, class_transformer_1.plainToClass)(PipeClass, config);
|
|
65
|
+
if (url && 'baseUrl' in pipe) {
|
|
66
|
+
pipe.baseUrl = url;
|
|
67
|
+
}
|
|
68
|
+
pipes.push(pipe);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return pipes;
|
|
75
|
+
}
|
|
76
|
+
register(type, PipeClass) {
|
|
77
|
+
pipe_registry_1.PIPE_REGISTRY[type] = PipeClass;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.PipeEngine = PipeEngine;
|
|
81
|
+
//# sourceMappingURL=pipe-engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipe-engine.js","sourceRoot":"","sources":["../../src/pipes/pipe-engine.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PIPE_REGISTRY = void 0;
|
|
4
|
+
exports.instantiatePipes = instantiatePipes;
|
|
5
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
|
+
const trim_pipe_1 = require("./trim.pipe");
|
|
7
|
+
const to_number_pipe_1 = require("./to-number.pipe");
|
|
8
|
+
const to_lower_case_pipe_1 = require("./to-lower-case.pipe");
|
|
9
|
+
const to_upper_case_pipe_1 = require("./to-upper-case.pipe");
|
|
10
|
+
const sanitize_text_pipe_1 = require("./sanitize-text.pipe");
|
|
11
|
+
const normalize_whitespace_pipe_1 = require("./normalize-whitespace.pipe");
|
|
12
|
+
const remove_line_breaks_pipe_1 = require("./remove-line-breaks.pipe");
|
|
13
|
+
const date_format_pipe_1 = require("./date-format.pipe");
|
|
14
|
+
const regex_replace_pipe_1 = require("./regex-replace.pipe");
|
|
15
|
+
const regex_extract_pipe_1 = require("./regex-extract.pipe");
|
|
16
|
+
const remove_currency_symbol_pipe_1 = require("./remove-currency-symbol.pipe");
|
|
17
|
+
const remove_special_chars_pipe_1 = require("./remove-special-chars.pipe");
|
|
18
|
+
const alt_flag_pipe_1 = require("./alt-flag.pipe");
|
|
19
|
+
const number_normalize_pipe_1 = require("./number-normalize.pipe");
|
|
20
|
+
const url_resolve_pipe_1 = require("./url-resolve.pipe");
|
|
21
|
+
const extract_email_pipe_1 = require("./extract-email.pipe");
|
|
22
|
+
const regex_pipe_1 = require("./regex.pipe");
|
|
23
|
+
const parse_as_url_pipe_1 = require("./parse-as-url.pipe");
|
|
24
|
+
const clean_html_pipe_1 = require("./clean-html.pipe");
|
|
25
|
+
const regex_extraction_pipe_1 = require("./regex-extraction.pipe");
|
|
26
|
+
const regex_replace_x_pipe_1 = require("./regex-replace-x.pipe");
|
|
27
|
+
const extract_url_params_pipe_1 = require("./extract-url-params.pipe");
|
|
28
|
+
const media_filter_pipe_1 = require("./media-filter.pipe");
|
|
29
|
+
const query_append_pipe_1 = require("./query-append.pipe");
|
|
30
|
+
const json_path_pipe_1 = require("./json-path.pipe");
|
|
31
|
+
const query_remover_pipe_1 = require("./query-remover.pipe");
|
|
32
|
+
const date_format_special_pipe_1 = require("./date-format-special.pipe");
|
|
33
|
+
const cleansing_type_enum_1 = require("../enums/cleansing-type.enum");
|
|
34
|
+
exports.PIPE_REGISTRY = {
|
|
35
|
+
[cleansing_type_enum_1.CleansingType.TRIM]: trim_pipe_1.TrimPipe,
|
|
36
|
+
[cleansing_type_enum_1.CleansingType.TO_NUMBER]: to_number_pipe_1.ToNumberPipe,
|
|
37
|
+
[cleansing_type_enum_1.CleansingType.TO_LOWER_CASE]: to_lower_case_pipe_1.ToLowerCasePipe,
|
|
38
|
+
[cleansing_type_enum_1.CleansingType.TO_UPPER_CASE]: to_upper_case_pipe_1.ToUpperCasePipe,
|
|
39
|
+
[cleansing_type_enum_1.CleansingType.SANITIZE_TEXT]: sanitize_text_pipe_1.SanitizeTextPipe,
|
|
40
|
+
[cleansing_type_enum_1.CleansingType.NORMALIZE_WHITESPACE]: normalize_whitespace_pipe_1.NormalizeWhitespacePipe,
|
|
41
|
+
[cleansing_type_enum_1.CleansingType.REMOVE_LINE_BREAKS]: remove_line_breaks_pipe_1.RemoveLineBreaksPipe,
|
|
42
|
+
[cleansing_type_enum_1.CleansingType.DATE_FORMAT]: date_format_pipe_1.DateFormatPipe,
|
|
43
|
+
[cleansing_type_enum_1.CleansingType.REGEX_REPLACE]: regex_replace_pipe_1.RegexReplacePipe,
|
|
44
|
+
[cleansing_type_enum_1.CleansingType.REGEX_EXTRACT]: regex_extract_pipe_1.RegexExtractPipe,
|
|
45
|
+
[cleansing_type_enum_1.CleansingType.REMOVE_CURRENCY_SYMBOL]: remove_currency_symbol_pipe_1.RemoveCurrencySymbolPipe,
|
|
46
|
+
[cleansing_type_enum_1.CleansingType.REMOVE_SPECIAL_CHARS]: remove_special_chars_pipe_1.RemoveSpecialCharsPipe,
|
|
47
|
+
[cleansing_type_enum_1.CleansingType.ALT_FLAG]: alt_flag_pipe_1.AltFlagPipe,
|
|
48
|
+
'num-normalize': number_normalize_pipe_1.NumberNormalizePipe,
|
|
49
|
+
'url-resolve': url_resolve_pipe_1.UrlResolvePipe,
|
|
50
|
+
'extract-email': extract_email_pipe_1.ExtractEmailPipe,
|
|
51
|
+
regex: regex_pipe_1.RegexPipe,
|
|
52
|
+
'parse-as-url': parse_as_url_pipe_1.ParseAsURLPipe,
|
|
53
|
+
'clean-html': clean_html_pipe_1.CleanHtmlPipe,
|
|
54
|
+
'regex-extraction': regex_extraction_pipe_1.RegexExtractionPipe,
|
|
55
|
+
'regex-extraction--page': regex_extraction_pipe_1.PageRegexExtractionPipe,
|
|
56
|
+
'regex-extraction--url': regex_extraction_pipe_1.URLRegexExtractionPipe,
|
|
57
|
+
'regex-replace-x': regex_replace_x_pipe_1.RegexReplaceXPipe,
|
|
58
|
+
'regex-replace--page': regex_replace_x_pipe_1.PageRegexReplacePipe,
|
|
59
|
+
'regex-replace--url': regex_replace_x_pipe_1.URLRegexReplacePipe,
|
|
60
|
+
'extract-url-params': extract_url_params_pipe_1.ExtractUrlParamsPipe,
|
|
61
|
+
'media-filter': media_filter_pipe_1.MediaFilterPipe,
|
|
62
|
+
'query-append': query_append_pipe_1.QueryAppendPipe,
|
|
63
|
+
'json-path': json_path_pipe_1.JsonPathPipe,
|
|
64
|
+
'query-remover': query_remover_pipe_1.QueryRemoverPipe,
|
|
65
|
+
'query-remover--page': query_remover_pipe_1.PageQueryRemoverPipe,
|
|
66
|
+
'query-remover--url': query_remover_pipe_1.URLQueryRemoverPipe,
|
|
67
|
+
'date-format-special': date_format_special_pipe_1.DateFormatSpecialPipe,
|
|
68
|
+
};
|
|
69
|
+
function instantiatePipes(pipeConfigs) {
|
|
70
|
+
const pipes = [];
|
|
71
|
+
for (const config of pipeConfigs) {
|
|
72
|
+
const pipeType = config.type;
|
|
73
|
+
if (!pipeType) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
const PipeClass = exports.PIPE_REGISTRY[pipeType];
|
|
77
|
+
if (!PipeClass) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
pipes.push((0, class_transformer_1.plainToClass)(PipeClass, config));
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return pipes;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=pipe-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipe-registry.js","sourceRoot":"","sources":["../../src/pipes/pipe-registry.ts"],"names":[],"mappings":";;;AAuGA,4CA0BC;AAjID,yDAAiD;AACjD,2CAAuC;AACvC,qDAAgD;AAChD,6DAAuD;AACvD,6DAAuD;AACvD,6DAAwD;AACxD,2EAAsE;AACtE,uEAAiE;AACjE,yDAAoD;AACpD,6DAAwD;AACxD,6DAAwD;AACxD,+EAAyE;AACzE,2EAAqE;AACrE,mDAA8C;AAC9C,mEAA8D;AAC9D,yDAAoD;AACpD,6DAAwD;AACxD,6CAAyC;AACzC,2DAAqD;AACrD,uDAAkD;AAClD,mEAIiC;AACjC,iEAIgC;AAChC,uEAAiE;AACjE,2DAAsD;AACtD,2DAAsD;AACtD,qDAAgD;AAChD,6DAI8B;AAC9B,yEAAmE;AACnE,sEAA6D;AAgBhD,QAAA,aAAa,GAGtB;IAEF,CAAC,mCAAa,CAAC,IAAI,CAAC,EAAE,oBAAQ;IAC9B,CAAC,mCAAa,CAAC,SAAS,CAAC,EAAE,6BAAY;IACvC,CAAC,mCAAa,CAAC,aAAa,CAAC,EAAE,oCAAe;IAC9C,CAAC,mCAAa,CAAC,aAAa,CAAC,EAAE,oCAAe;IAC9C,CAAC,mCAAa,CAAC,aAAa,CAAC,EAAE,qCAAgB;IAC/C,CAAC,mCAAa,CAAC,oBAAoB,CAAC,EAAE,mDAAuB;IAC7D,CAAC,mCAAa,CAAC,kBAAkB,CAAC,EAAE,8CAAoB;IACxD,CAAC,mCAAa,CAAC,WAAW,CAAC,EAAE,iCAAc;IAC3C,CAAC,mCAAa,CAAC,aAAa,CAAC,EAAE,qCAAgB;IAC/C,CAAC,mCAAa,CAAC,aAAa,CAAC,EAAE,qCAAgB;IAC/C,CAAC,mCAAa,CAAC,sBAAsB,CAAC,EAAE,sDAAwB;IAChE,CAAC,mCAAa,CAAC,oBAAoB,CAAC,EAAE,kDAAsB;IAC5D,CAAC,mCAAa,CAAC,QAAQ,CAAC,EAAE,2BAAW;IAErC,eAAe,EAAE,2CAAmB;IACpC,aAAa,EAAE,iCAAc;IAC7B,eAAe,EAAE,qCAAgB;IACjC,KAAK,EAAE,sBAAS;IAChB,cAAc,EAAE,kCAAc;IAC9B,YAAY,EAAE,+BAAa;IAC3B,kBAAkB,EAAE,2CAAmB;IACvC,wBAAwB,EAAE,+CAAuB;IACjD,uBAAuB,EAAE,8CAAsB;IAC/C,iBAAiB,EAAE,wCAAiB;IACpC,qBAAqB,EAAE,2CAAoB;IAC3C,oBAAoB,EAAE,0CAAmB;IACzC,oBAAoB,EAAE,8CAAoB;IAC1C,cAAc,EAAE,mCAAe;IAC/B,cAAc,EAAE,mCAAe;IAC/B,WAAW,EAAE,6BAAY;IACzB,eAAe,EAAE,qCAAgB;IACjC,qBAAqB,EAAE,yCAAoB;IAC3C,oBAAoB,EAAE,wCAAmB;IACzC,qBAAqB,EAAE,gDAAqB;CAC7C,CAAC;AAQF,SAAgB,gBAAgB,CAC9B,WAA2C;IAE3C,MAAM,KAAK,GAAoB,EAAE,CAAC;IAElC,KAAK,MAAM,MAAM,IAAI,WAAW,EAAE,CAAC;QACjC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAc,CAAC;QAEvC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,SAAS;QACX,CAAC;QAED,MAAM,SAAS,GAAG,qBAAa,CAAC,QAAQ,CAAC,CAAC;QAE1C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,SAAS;QACX,CAAC;QAED,IAAI,CAAC;YACH,KAAK,CAAC,IAAI,CAAC,IAAA,gCAAY,EAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -3,17 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CURRENCY_PROFILE = void 0;
|
|
4
4
|
const cleansing_type_enum_1 = require("../../enums/cleansing-type.enum");
|
|
5
5
|
exports.CURRENCY_PROFILE = {
|
|
6
|
-
pipes:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type: cleansing_type_enum_1.CleansingType.REMOVE_SPECIAL_CHARS,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
],
|
|
6
|
+
pipes: {
|
|
7
|
+
trim: true,
|
|
8
|
+
custom: [
|
|
9
|
+
{
|
|
10
|
+
type: cleansing_type_enum_1.CleansingType.REMOVE_CURRENCY_SYMBOL,
|
|
11
|
+
symbols: ['$', '€', '£', '¥', '₹'],
|
|
12
|
+
},
|
|
13
|
+
{ type: cleansing_type_enum_1.CleansingType.REMOVE_SPECIAL_CHARS, pattern: '[^0-9.]' },
|
|
14
|
+
{ type: cleansing_type_enum_1.CleansingType.TO_NUMBER, decimals: 2 },
|
|
15
|
+
],
|
|
16
|
+
},
|
|
18
17
|
};
|
|
19
18
|
//# sourceMappingURL=currency.profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currency.profile.js","sourceRoot":"","sources":["../../../src/pipes/profiles/currency.profile.ts"],"names":[],"mappings":";;;AAAA,yEAAgE;
|
|
1
|
+
{"version":3,"file":"currency.profile.js","sourceRoot":"","sources":["../../../src/pipes/profiles/currency.profile.ts"],"names":[],"mappings":";;;AAAA,yEAAgE;AAGnD,QAAA,gBAAgB,GAAqB;IAChD,KAAK,EAAE;QACL,IAAI,EAAE,IAAI;QACV,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,mCAAa,CAAC,sBAAsB;gBAC1C,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;aACnC;YACD,EAAE,IAAI,EAAE,mCAAa,CAAC,oBAAoB,EAAE,OAAO,EAAE,SAAS,EAAE;YAChE,EAAE,IAAI,EAAE,mCAAa,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC,EAAE;SAC/C;KACF;CACF,CAAC"}
|
|
@@ -3,12 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DATE_PROFILE = void 0;
|
|
4
4
|
const cleansing_type_enum_1 = require("../../enums/cleansing-type.enum");
|
|
5
5
|
exports.DATE_PROFILE = {
|
|
6
|
-
pipes:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
pipes: {
|
|
7
|
+
trim: true,
|
|
8
|
+
custom: [
|
|
9
|
+
{
|
|
10
|
+
type: cleansing_type_enum_1.CleansingType.DATE_FORMAT,
|
|
11
|
+
format: 'YYYY-MM-DD',
|
|
12
|
+
timezone: 'UTC',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
},
|
|
13
16
|
};
|
|
14
17
|
//# sourceMappingURL=date.profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.profile.js","sourceRoot":"","sources":["../../../src/pipes/profiles/date.profile.ts"],"names":[],"mappings":";;;AAAA,yEAAgE;
|
|
1
|
+
{"version":3,"file":"date.profile.js","sourceRoot":"","sources":["../../../src/pipes/profiles/date.profile.ts"],"names":[],"mappings":";;;AAAA,yEAAgE;AAGnD,QAAA,YAAY,GAAqB;IAC5C,KAAK,EAAE;QACL,IAAI,EAAE,IAAI;QACV,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,mCAAa,CAAC,WAAW;gBAC/B,MAAM,EAAE,YAAY;gBACpB,QAAQ,EAAE,KAAK;aAChB;SACF;KACF;CACF,CAAC"}
|
|
@@ -3,16 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.EMAIL_PROFILE = void 0;
|
|
4
4
|
const cleansing_type_enum_1 = require("../../enums/cleansing-type.enum");
|
|
5
5
|
exports.EMAIL_PROFILE = {
|
|
6
|
-
pipes:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
pipes: {
|
|
7
|
+
trim: true,
|
|
8
|
+
toLowerCase: true,
|
|
9
|
+
custom: [
|
|
10
|
+
{
|
|
11
|
+
type: cleansing_type_enum_1.CleansingType.REGEX_EXTRACT,
|
|
12
12
|
regex: '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}',
|
|
13
|
-
|
|
13
|
+
flag: 'i',
|
|
14
14
|
},
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=email.profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.profile.js","sourceRoot":"","sources":["../../../src/pipes/profiles/email.profile.ts"],"names":[],"mappings":";;;AAAA,yEAAgE;
|
|
1
|
+
{"version":3,"file":"email.profile.js","sourceRoot":"","sources":["../../../src/pipes/profiles/email.profile.ts"],"names":[],"mappings":";;;AAAA,yEAAgE;AAGnD,QAAA,aAAa,GAAqB;IAC7C,KAAK,EAAE;QACL,IAAI,EAAE,IAAI;QACV,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,mCAAa,CAAC,aAAa;gBACjC,KAAK,EAAE,iDAAiD;gBACxD,IAAI,EAAE,GAAG;aACV;SACF;KACF;CACF,CAAC"}
|
|
@@ -3,16 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PHONE_PROFILE = void 0;
|
|
4
4
|
const cleansing_type_enum_1 = require("../../enums/cleansing-type.enum");
|
|
5
5
|
exports.PHONE_PROFILE = {
|
|
6
|
-
pipes:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type: cleansing_type_enum_1.CleansingType.REMOVE_SPECIAL_CHARS,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
pipes: {
|
|
7
|
+
trim: true,
|
|
8
|
+
custom: [
|
|
9
|
+
{ type: cleansing_type_enum_1.CleansingType.REMOVE_SPECIAL_CHARS, pattern: '[^0-9+]' },
|
|
10
|
+
{
|
|
11
|
+
type: cleansing_type_enum_1.CleansingType.REGEX_EXTRACT,
|
|
12
|
+
regex: '\\+?[0-9]{10,15}',
|
|
13
|
+
flag: 'g',
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=phone.profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone.profile.js","sourceRoot":"","sources":["../../../src/pipes/profiles/phone.profile.ts"],"names":[],"mappings":";;;AAAA,yEAAgE;
|
|
1
|
+
{"version":3,"file":"phone.profile.js","sourceRoot":"","sources":["../../../src/pipes/profiles/phone.profile.ts"],"names":[],"mappings":";;;AAAA,yEAAgE;AAGnD,QAAA,aAAa,GAAqB;IAC7C,KAAK,EAAE;QACL,IAAI,EAAE,IAAI;QACV,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,mCAAa,CAAC,oBAAoB,EAAE,OAAO,EAAE,SAAS,EAAE;YAChE;gBACE,IAAI,EAAE,mCAAa,CAAC,aAAa;gBACjC,KAAK,EAAE,kBAAkB;gBACzB,IAAI,EAAE,GAAG;aACV;SACF;KACF;CACF,CAAC"}
|
|
@@ -3,17 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PRICE_PROFILE = void 0;
|
|
4
4
|
const cleansing_type_enum_1 = require("../../enums/cleansing-type.enum");
|
|
5
5
|
exports.PRICE_PROFILE = {
|
|
6
|
-
pipes:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type: cleansing_type_enum_1.CleansingType.REMOVE_SPECIAL_CHARS,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
],
|
|
6
|
+
pipes: {
|
|
7
|
+
trim: true,
|
|
8
|
+
custom: [
|
|
9
|
+
{
|
|
10
|
+
type: cleansing_type_enum_1.CleansingType.REMOVE_CURRENCY_SYMBOL,
|
|
11
|
+
symbols: ['$', '€', '£', '¥'],
|
|
12
|
+
},
|
|
13
|
+
{ type: cleansing_type_enum_1.CleansingType.REMOVE_SPECIAL_CHARS, pattern: '[^0-9.]' },
|
|
14
|
+
{ type: cleansing_type_enum_1.CleansingType.TO_NUMBER, decimals: 2 },
|
|
15
|
+
],
|
|
16
|
+
},
|
|
18
17
|
};
|
|
19
18
|
//# sourceMappingURL=price.profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"price.profile.js","sourceRoot":"","sources":["../../../src/pipes/profiles/price.profile.ts"],"names":[],"mappings":";;;AAAA,yEAAgE;
|
|
1
|
+
{"version":3,"file":"price.profile.js","sourceRoot":"","sources":["../../../src/pipes/profiles/price.profile.ts"],"names":[],"mappings":";;;AAAA,yEAAgE;AAGnD,QAAA,aAAa,GAAqB;IAC7C,KAAK,EAAE;QACL,IAAI,EAAE,IAAI;QACV,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,mCAAa,CAAC,sBAAsB;gBAC1C,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;aAC9B;YACD,EAAE,IAAI,EAAE,mCAAa,CAAC,oBAAoB,EAAE,OAAO,EAAE,SAAS,EAAE;YAChE,EAAE,IAAI,EAAE,mCAAa,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC,EAAE;SAC/C;KACF;CACF,CAAC"}
|
package/dist/pipes/profiles.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CleansingProfile } from '../enums/cleansing-profile.enum';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const CLEANSING_PROFILES: Record<CleansingProfile,
|
|
2
|
+
import type { CleanerStepRules } from './pipe-engine';
|
|
3
|
+
export declare const CLEANSING_PROFILES: Record<CleansingProfile, CleanerStepRules>;
|
package/dist/pipes/profiles.js
CHANGED
|
@@ -8,10 +8,10 @@ const email_profile_1 = require("./profiles/email.profile");
|
|
|
8
8
|
const date_profile_1 = require("./profiles/date.profile");
|
|
9
9
|
const currency_profile_1 = require("./profiles/currency.profile");
|
|
10
10
|
exports.CLEANSING_PROFILES = {
|
|
11
|
-
[cleansing_profile_enum_1.CleansingProfile.PRICE]: price_profile_1.PRICE_PROFILE.pipes ||
|
|
12
|
-
[cleansing_profile_enum_1.CleansingProfile.PHONE]: phone_profile_1.PHONE_PROFILE.pipes ||
|
|
13
|
-
[cleansing_profile_enum_1.CleansingProfile.EMAIL]: email_profile_1.EMAIL_PROFILE.pipes ||
|
|
14
|
-
[cleansing_profile_enum_1.CleansingProfile.DATE]: date_profile_1.DATE_PROFILE.pipes ||
|
|
15
|
-
[cleansing_profile_enum_1.CleansingProfile.CURRENCY]: currency_profile_1.CURRENCY_PROFILE.pipes ||
|
|
11
|
+
[cleansing_profile_enum_1.CleansingProfile.PRICE]: price_profile_1.PRICE_PROFILE.pipes || {},
|
|
12
|
+
[cleansing_profile_enum_1.CleansingProfile.PHONE]: phone_profile_1.PHONE_PROFILE.pipes || {},
|
|
13
|
+
[cleansing_profile_enum_1.CleansingProfile.EMAIL]: email_profile_1.EMAIL_PROFILE.pipes || {},
|
|
14
|
+
[cleansing_profile_enum_1.CleansingProfile.DATE]: date_profile_1.DATE_PROFILE.pipes || {},
|
|
15
|
+
[cleansing_profile_enum_1.CleansingProfile.CURRENCY]: currency_profile_1.CURRENCY_PROFILE.pipes || {},
|
|
16
16
|
};
|
|
17
17
|
//# sourceMappingURL=profiles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/pipes/profiles.ts"],"names":[],"mappings":";;;AAAA,4EAAmE;AACnE,4DAAyD;AACzD,4DAAyD;AACzD,4DAAyD;AACzD,0DAAuD;AACvD,kEAA+D;AAGlD,QAAA,kBAAkB,
|
|
1
|
+
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/pipes/profiles.ts"],"names":[],"mappings":";;;AAAA,4EAAmE;AACnE,4DAAyD;AACzD,4DAAyD;AACzD,4DAAyD;AACzD,0DAAuD;AACvD,kEAA+D;AAGlD,QAAA,kBAAkB,GAA+C;IAC5E,CAAC,yCAAgB,CAAC,KAAK,CAAC,EAAE,6BAAa,CAAC,KAAK,IAAI,EAAE;IACnD,CAAC,yCAAgB,CAAC,KAAK,CAAC,EAAE,6BAAa,CAAC,KAAK,IAAI,EAAE;IACnD,CAAC,yCAAgB,CAAC,KAAK,CAAC,EAAE,6BAAa,CAAC,KAAK,IAAI,EAAE;IACnD,CAAC,yCAAgB,CAAC,IAAI,CAAC,EAAE,2BAAY,CAAC,KAAK,IAAI,EAAE;IACjD,CAAC,yCAAgB,CAAC,QAAQ,CAAC,EAAE,mCAAgB,CAAC,KAAK,IAAI,EAAE;CAC1D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CleansingPipe } from './cleansing-pipe';
|
|
2
|
+
export declare class QueryAppendPipe extends CleansingPipe<string, string> {
|
|
3
|
+
readonly type: "query-append";
|
|
4
|
+
paramKey: string;
|
|
5
|
+
paramValue: string;
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
exec(val: string): string;
|
|
8
|
+
reverse(val: string): string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.QueryAppendPipe = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const cleansing_pipe_1 = require("./cleansing-pipe");
|
|
15
|
+
class QueryAppendPipe extends cleansing_pipe_1.CleansingPipe {
|
|
16
|
+
type = 'query-append';
|
|
17
|
+
paramKey;
|
|
18
|
+
paramValue;
|
|
19
|
+
baseUrl;
|
|
20
|
+
exec(val) {
|
|
21
|
+
if (typeof val !== 'string')
|
|
22
|
+
return val;
|
|
23
|
+
try {
|
|
24
|
+
const url = new URL(val);
|
|
25
|
+
url.searchParams.append(this.paramKey, this.paramValue);
|
|
26
|
+
return url.toString();
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return val;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
reverse(val) {
|
|
33
|
+
return val;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.QueryAppendPipe = QueryAppendPipe;
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsString)(),
|
|
39
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], QueryAppendPipe.prototype, "paramKey", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsString)(),
|
|
44
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], QueryAppendPipe.prototype, "paramValue", void 0);
|
|
47
|
+
//# sourceMappingURL=query-append.pipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-append.pipe.js","sourceRoot":"","sources":["../../src/pipes/query-append.pipe.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AACvD,qDAAiD;AAEjD,MAAa,eAAgB,SAAQ,8BAA6B;IACvD,IAAI,GAAG,cAAuB,CAAC;IAIxC,QAAQ,CAAU;IAIlB,UAAU,CAAU;IAEpB,OAAO,CAAU;IAEjB,IAAI,CAAC,GAAW;QACd,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,OAAO,GAAG,CAAC;QACxC,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;YACzB,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YACxD,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,GAAG,CAAC;QACb,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAW;QACjB,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AA3BD,0CA2BC;AAtBC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;iDACK;AAIlB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;mDACO"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CleansingPipe } from './cleansing-pipe';
|
|
2
|
+
export declare class QueryRemoverPipe extends CleansingPipe<string, string> {
|
|
3
|
+
readonly type: "query-remover";
|
|
4
|
+
removed: string | string[];
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
exec(val: string): string;
|
|
7
|
+
reverse(val: string): string;
|
|
8
|
+
}
|
|
9
|
+
export declare class PageQueryRemoverPipe extends CleansingPipe<string, string> {
|
|
10
|
+
readonly type: "query-remover--page";
|
|
11
|
+
removed: string | string[];
|
|
12
|
+
baseUrl?: string;
|
|
13
|
+
exec(val: string): string;
|
|
14
|
+
reverse(val: string): string;
|
|
15
|
+
}
|
|
16
|
+
export declare class URLQueryRemoverPipe extends CleansingPipe<string, string> {
|
|
17
|
+
readonly type: "query-remover--url";
|
|
18
|
+
removed: string | string[];
|
|
19
|
+
baseUrl?: string;
|
|
20
|
+
exec(val: string): string;
|
|
21
|
+
reverse(val: string): string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.URLQueryRemoverPipe = exports.PageQueryRemoverPipe = exports.QueryRemoverPipe = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const cleansing_pipe_1 = require("./cleansing-pipe");
|
|
15
|
+
function execQueryRemover(pipe, val) {
|
|
16
|
+
if (typeof val !== 'string')
|
|
17
|
+
return val;
|
|
18
|
+
const removed = Array.isArray(pipe.removed)
|
|
19
|
+
? pipe.removed
|
|
20
|
+
: typeof pipe.removed === 'string'
|
|
21
|
+
? pipe.removed.split(',')
|
|
22
|
+
: [];
|
|
23
|
+
try {
|
|
24
|
+
const url = new URL(val, pipe.baseUrl);
|
|
25
|
+
removed.forEach((k) => url.searchParams.delete(k));
|
|
26
|
+
return url.toString();
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return val;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
class QueryRemoverPipe extends cleansing_pipe_1.CleansingPipe {
|
|
33
|
+
type = 'query-remover';
|
|
34
|
+
removed;
|
|
35
|
+
baseUrl;
|
|
36
|
+
exec(val) {
|
|
37
|
+
return execQueryRemover(this, val);
|
|
38
|
+
}
|
|
39
|
+
reverse(val) {
|
|
40
|
+
return val;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.QueryRemoverPipe = QueryRemoverPipe;
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_validator_1.IsArray)(),
|
|
46
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], QueryRemoverPipe.prototype, "removed", void 0);
|
|
49
|
+
class PageQueryRemoverPipe extends cleansing_pipe_1.CleansingPipe {
|
|
50
|
+
type = 'query-remover--page';
|
|
51
|
+
removed;
|
|
52
|
+
baseUrl;
|
|
53
|
+
exec(val) {
|
|
54
|
+
return execQueryRemover(this, val);
|
|
55
|
+
}
|
|
56
|
+
reverse(val) {
|
|
57
|
+
return val;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.PageQueryRemoverPipe = PageQueryRemoverPipe;
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, class_validator_1.IsArray)(),
|
|
63
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
64
|
+
__metadata("design:type", Object)
|
|
65
|
+
], PageQueryRemoverPipe.prototype, "removed", void 0);
|
|
66
|
+
class URLQueryRemoverPipe extends cleansing_pipe_1.CleansingPipe {
|
|
67
|
+
type = 'query-remover--url';
|
|
68
|
+
removed;
|
|
69
|
+
baseUrl;
|
|
70
|
+
exec(val) {
|
|
71
|
+
return execQueryRemover(this, val);
|
|
72
|
+
}
|
|
73
|
+
reverse(val) {
|
|
74
|
+
return val;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.URLQueryRemoverPipe = URLQueryRemoverPipe;
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, class_validator_1.IsArray)(),
|
|
80
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
81
|
+
__metadata("design:type", Object)
|
|
82
|
+
], URLQueryRemoverPipe.prototype, "removed", void 0);
|
|
83
|
+
//# sourceMappingURL=query-remover.pipe.js.map
|