@hanivanrizky/nestjs-browser-action 0.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 +279 -0
- package/dist/browser-action.module-definition.d.ts +7 -0
- package/dist/browser-action.module-definition.js +3 -0
- package/dist/browser-action.module-definition.js.map +1 -0
- package/dist/browser-action.module.d.ts +8 -0
- package/dist/browser-action.module.js +93 -0
- package/dist/browser-action.module.js.map +1 -0
- package/dist/constants/browser-action.constants.d.ts +28 -0
- package/dist/constants/browser-action.constants.js +32 -0
- package/dist/constants/browser-action.constants.js.map +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +18 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/decorators/index.d.ts +2 -0
- package/dist/decorators/index.js +19 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/decorators/inject-browser.decorator.d.ts +1 -0
- package/dist/decorators/inject-browser.decorator.js +7 -0
- package/dist/decorators/inject-browser.decorator.js.map +1 -0
- package/dist/decorators/inject-page.decorator.d.ts +1 -0
- package/dist/decorators/inject-page.decorator.js +7 -0
- package/dist/decorators/inject-page.decorator.js.map +1 -0
- package/dist/enums/cleansing-profile.enum.d.ts +7 -0
- package/dist/enums/cleansing-profile.enum.js +12 -0
- package/dist/enums/cleansing-profile.enum.js.map +1 -0
- package/dist/enums/cleansing-type.enum.d.ts +15 -0
- package/dist/enums/cleansing-type.enum.js +20 -0
- package/dist/enums/cleansing-type.enum.js.map +1 -0
- package/dist/enums/index.d.ts +2 -0
- package/dist/enums/index.js +19 -0
- package/dist/enums/index.js.map +1 -0
- package/dist/helpers/action-helpers.service.d.ts +41 -0
- package/dist/helpers/action-helpers.service.js +534 -0
- package/dist/helpers/action-helpers.service.js.map +1 -0
- package/dist/helpers/dom.util.d.ts +4 -0
- package/dist/helpers/dom.util.js +27 -0
- package/dist/helpers/dom.util.js.map +1 -0
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.js +19 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/logger.util.d.ts +10 -0
- package/dist/helpers/logger.util.js +47 -0
- package/dist/helpers/logger.util.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/browser-action-options.d.ts +17 -0
- package/dist/interfaces/browser-action-options.js +3 -0
- package/dist/interfaces/browser-action-options.js.map +1 -0
- package/dist/interfaces/cleansing-options.d.ts +14 -0
- package/dist/interfaces/cleansing-options.js +3 -0
- package/dist/interfaces/cleansing-options.js.map +1 -0
- package/dist/interfaces/cookie-options.d.ts +31 -0
- package/dist/interfaces/cookie-options.js +3 -0
- package/dist/interfaces/cookie-options.js.map +1 -0
- package/dist/interfaces/index.d.ts +6 -0
- package/dist/interfaces/index.js +23 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/pool-options.d.ts +6 -0
- package/dist/interfaces/pool-options.js +3 -0
- package/dist/interfaces/pool-options.js.map +1 -0
- package/dist/interfaces/types.d.ts +31 -0
- package/dist/interfaces/types.js +3 -0
- package/dist/interfaces/types.js.map +1 -0
- package/dist/interfaces/workflow-options.d.ts +50 -0
- package/dist/interfaces/workflow-options.js +3 -0
- package/dist/interfaces/workflow-options.js.map +1 -0
- package/dist/pipes/alt-flag.pipe.d.ts +10 -0
- package/dist/pipes/alt-flag.pipe.js +63 -0
- package/dist/pipes/alt-flag.pipe.js.map +1 -0
- package/dist/pipes/cleansing-pipe.d.ts +7 -0
- package/dist/pipes/cleansing-pipe.js +25 -0
- package/dist/pipes/cleansing-pipe.js.map +1 -0
- package/dist/pipes/date-format.pipe.d.ts +10 -0
- package/dist/pipes/date-format.pipe.js +88 -0
- package/dist/pipes/date-format.pipe.js.map +1 -0
- package/dist/pipes/index.d.ts +15 -0
- package/dist/pipes/index.js +32 -0
- package/dist/pipes/index.js.map +1 -0
- package/dist/pipes/normalize-whitespace.pipe.d.ts +8 -0
- package/dist/pipes/normalize-whitespace.pipe.js +49 -0
- package/dist/pipes/normalize-whitespace.pipe.js.map +1 -0
- package/dist/pipes/profiles/currency.profile.d.ts +2 -0
- package/dist/pipes/profiles/currency.profile.js +19 -0
- package/dist/pipes/profiles/currency.profile.js.map +1 -0
- package/dist/pipes/profiles/date.profile.d.ts +2 -0
- package/dist/pipes/profiles/date.profile.js +14 -0
- package/dist/pipes/profiles/date.profile.js.map +1 -0
- package/dist/pipes/profiles/email.profile.d.ts +2 -0
- package/dist/pipes/profiles/email.profile.js +18 -0
- package/dist/pipes/profiles/email.profile.js.map +1 -0
- package/dist/pipes/profiles/phone.profile.d.ts +2 -0
- package/dist/pipes/profiles/phone.profile.js +18 -0
- package/dist/pipes/profiles/phone.profile.js.map +1 -0
- package/dist/pipes/profiles/price.profile.d.ts +2 -0
- package/dist/pipes/profiles/price.profile.js +19 -0
- package/dist/pipes/profiles/price.profile.js.map +1 -0
- package/dist/pipes/profiles.d.ts +3 -0
- package/dist/pipes/profiles.js +17 -0
- package/dist/pipes/profiles.js.map +1 -0
- package/dist/pipes/regex-extract.pipe.d.ts +7 -0
- package/dist/pipes/regex-extract.pipe.js +73 -0
- package/dist/pipes/regex-extract.pipe.js.map +1 -0
- package/dist/pipes/regex-replace.pipe.d.ts +9 -0
- package/dist/pipes/regex-replace.pipe.js +59 -0
- package/dist/pipes/regex-replace.pipe.js.map +1 -0
- package/dist/pipes/remove-currency-symbol.pipe.d.ts +7 -0
- package/dist/pipes/remove-currency-symbol.pipe.js +65 -0
- package/dist/pipes/remove-currency-symbol.pipe.js.map +1 -0
- package/dist/pipes/remove-line-breaks.pipe.d.ts +7 -0
- package/dist/pipes/remove-line-breaks.pipe.js +42 -0
- package/dist/pipes/remove-line-breaks.pipe.js.map +1 -0
- package/dist/pipes/remove-special-chars.pipe.d.ts +7 -0
- package/dist/pipes/remove-special-chars.pipe.js +44 -0
- package/dist/pipes/remove-special-chars.pipe.js.map +1 -0
- package/dist/pipes/sanitize-text.pipe.d.ts +7 -0
- package/dist/pipes/sanitize-text.pipe.js +86 -0
- package/dist/pipes/sanitize-text.pipe.js.map +1 -0
- package/dist/pipes/to-lower-case.pipe.d.ts +6 -0
- package/dist/pipes/to-lower-case.pipe.js +16 -0
- package/dist/pipes/to-lower-case.pipe.js.map +1 -0
- package/dist/pipes/to-number.pipe.d.ts +9 -0
- package/dist/pipes/to-number.pipe.js +57 -0
- package/dist/pipes/to-number.pipe.js.map +1 -0
- package/dist/pipes/to-upper-case.pipe.d.ts +6 -0
- package/dist/pipes/to-upper-case.pipe.js +16 -0
- package/dist/pipes/to-upper-case.pipe.js.map +1 -0
- package/dist/pipes/trim.pipe.d.ts +8 -0
- package/dist/pipes/trim.pipe.js +44 -0
- package/dist/pipes/trim.pipe.js.map +1 -0
- package/dist/services/browser-manager.service.d.ts +15 -0
- package/dist/services/browser-manager.service.js +47 -0
- package/dist/services/browser-manager.service.js.map +1 -0
- package/dist/services/browser-pool.service.d.ts +26 -0
- package/dist/services/browser-pool.service.js +163 -0
- package/dist/services/browser-pool.service.js.map +1 -0
- package/dist/services/cleansing.service.d.ts +10 -0
- package/dist/services/cleansing.service.js +78 -0
- package/dist/services/cleansing.service.js.map +1 -0
- package/dist/services/cookie.service.d.ts +20 -0
- package/dist/services/cookie.service.js +246 -0
- package/dist/services/cookie.service.js.map +1 -0
- package/dist/services/index.d.ts +4 -0
- package/dist/services/index.js +21 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/page-service.d.ts +16 -0
- package/dist/services/page-service.js +68 -0
- package/dist/services/page-service.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +98 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 アニップ
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
# @hanivanrizky/nestjs-browser-action
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@hanivanrizky/nestjs-browser-action)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
> **⚠️ Status: Experimental**
|
|
7
|
+
>
|
|
8
|
+
> This project is currently in **experimental** stage and intended for **personal use only**. The API is subject to change, and production use is not recommended.
|
|
9
|
+
|
|
10
|
+
A NestJS module that provides Puppeteer-based browser automation with configurable options, connection pooling, and data cleansing capabilities.
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- (・_・) **Browser Automation**: Declarative workflow-based browser automation
|
|
15
|
+
- (☆^O^☆) **Data Scraping**: Single and multi-element scraping with CSS/XPath selectors
|
|
16
|
+
- (>_>) **Connection Pooling**: Efficient browser instance management
|
|
17
|
+
- (♡˙︶˙♡) **Cookie Persistence**: Save/load browser sessions for authentication
|
|
18
|
+
- (。•̀ᴗ-)✧ **Data Cleansing**: 14 built-in transformation pipes
|
|
19
|
+
- (°_°)! **Shadow DOM**: Support for web components
|
|
20
|
+
- (^_^) **Type-Safe**: Full TypeScript support with generics
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
### From npm
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install @hanivanrizky/nestjs-browser-action puppeteer
|
|
28
|
+
# or
|
|
29
|
+
yarn add @hanivanrizky/nestjs-browser-action puppeteer
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### From GitHub
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install https://github.com/Hanivan/nestjs-browser-action.git puppeteer
|
|
36
|
+
# or
|
|
37
|
+
yarn add https://github.com/Hanivan/nestjs-browser-action.git puppeteer
|
|
38
|
+
# or using SSH
|
|
39
|
+
yarn add git@github.com:Hanivan/nestjs-browser-action.git puppeteer
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Quick Start
|
|
43
|
+
|
|
44
|
+
### 1. Configure Module
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
import { Module } from '@nestjs/common';
|
|
48
|
+
import { BrowserActionModule } from '@hanivanrizky/nestjs-browser-action';
|
|
49
|
+
|
|
50
|
+
@Module({
|
|
51
|
+
imports: [
|
|
52
|
+
BrowserActionModule.forRoot({
|
|
53
|
+
pool: { min: 2, max: 10 },
|
|
54
|
+
cookies: { enabled: true },
|
|
55
|
+
}),
|
|
56
|
+
],
|
|
57
|
+
})
|
|
58
|
+
export class AppModule {}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 2. Inject Service
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
import { Injectable } from '@nestjs/common';
|
|
65
|
+
import { ActionHelpersService } from '@hanivanrizky/nestjs-browser-action';
|
|
66
|
+
|
|
67
|
+
@Injectable()
|
|
68
|
+
export class MyService {
|
|
69
|
+
constructor(
|
|
70
|
+
private readonly actionHelpers: ActionHelpersService,
|
|
71
|
+
) {}
|
|
72
|
+
|
|
73
|
+
async scrapeData() {
|
|
74
|
+
const result = await this.actionHelpers.scrape(
|
|
75
|
+
'https://example.com',
|
|
76
|
+
{
|
|
77
|
+
title: 'h1',
|
|
78
|
+
description: 'meta[name="description"]@content',
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
console.log(result.title); // "Example Domain"
|
|
83
|
+
console.log(result.description); // "This domain is for use in..."
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Documentation
|
|
89
|
+
|
|
90
|
+
### (^_^) Method Documentation
|
|
91
|
+
|
|
92
|
+
| Method | Description |
|
|
93
|
+
|--------|-------------|
|
|
94
|
+
| [`scrape()`](./docs/methods/scrape.md) | Extract single elements |
|
|
95
|
+
| [`scrapeAll()`](./docs/methods/scrape-all.md) | Extract multiple elements |
|
|
96
|
+
| [`scrapeWithActions()`](./docs/methods/workflow.md) | Workflow-based automation |
|
|
97
|
+
| [`scrapeAllWithWorkflow()`](./docs/methods/workflow.md) | Workflow with multi-element |
|
|
98
|
+
| [`takeScreenshot()`](./docs/methods/screenshots.md) | Capture screenshots |
|
|
99
|
+
| [`generatePDF()`](./docs/methods/screenshots.md) | Generate PDFs |
|
|
100
|
+
| [Browser & Page Control](./docs/methods/browser-control.md) | Low-level control |
|
|
101
|
+
|
|
102
|
+
### (☆^O^☆) Feature Guides
|
|
103
|
+
|
|
104
|
+
| Feature | Description |
|
|
105
|
+
|---------|-------------|
|
|
106
|
+
| [Cookie Management](./docs/features/cookies.md) | Session persistence |
|
|
107
|
+
| [Pipe System](./docs/features/pipes.md) | Data transformation |
|
|
108
|
+
| [Workflow Actions](./docs/workflow-actions.md) | All action types reference |
|
|
109
|
+
|
|
110
|
+
### (^_^) API Reference
|
|
111
|
+
|
|
112
|
+
- [API Reference](./docs/api-reference.md) - Complete API documentation
|
|
113
|
+
- [Configuration](./docs/api-reference.md#configuration) - All options
|
|
114
|
+
- [Types](./docs/api-reference.md#types) - TypeScript interfaces
|
|
115
|
+
|
|
116
|
+
## Quick Examples
|
|
117
|
+
|
|
118
|
+
### Simple Scraping
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
const data = await this.actionHelpers.scrape('https://example.com', {
|
|
122
|
+
title: 'h1',
|
|
123
|
+
price: '.price',
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Multi-Element Scraping
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
const data = await this.actionHelpers.scrapeAll('https://example.com', {
|
|
131
|
+
titles: '.card h2',
|
|
132
|
+
links: '.card a',
|
|
133
|
+
});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Workflow Automation
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
const workflow = {
|
|
140
|
+
version: '1.0' as const,
|
|
141
|
+
actions: [
|
|
142
|
+
{ action: 'navigate' as const, value: 'https://example.com' },
|
|
143
|
+
{ id: 'title', action: 'extract' as const, target: { type: 'css' as const, value: 'h1' } },
|
|
144
|
+
{ action: 'click' as const, target: { type: 'css' as const, value: '#button' } },
|
|
145
|
+
],
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const result = await this.actionHelpers.scrapeWithActions(workflow);
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### With Data Cleansing
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
import { CleansingType } from '@hanivanrizky/nestjs-browser-action';
|
|
155
|
+
|
|
156
|
+
const data = await this.actionHelpers.scrape('https://example.com', {
|
|
157
|
+
price: '.price',
|
|
158
|
+
}, {
|
|
159
|
+
pipes: {
|
|
160
|
+
price: [
|
|
161
|
+
{ type: CleansingType.REMOVE_CURRENCY_SYMBOL },
|
|
162
|
+
{ type: CleansingType.TO_NUMBER },
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Cookie Persistence
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
const workflow = {
|
|
172
|
+
version: '1.0' as const,
|
|
173
|
+
actions: [
|
|
174
|
+
{ action: 'loadCookies' as const, value: 'user-session', onError: 'skip' as const },
|
|
175
|
+
{ action: 'navigate' as const, value: 'https://example.com/dashboard' },
|
|
176
|
+
{ action: 'saveCookies' as const, value: 'user-session', options: { overwrite: true } },
|
|
177
|
+
],
|
|
178
|
+
};
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Services
|
|
182
|
+
|
|
183
|
+
| Service | Description |
|
|
184
|
+
|---------|-------------|
|
|
185
|
+
| **ActionHelpersService** | High-level automation methods (scrape, screenshot, PDF, workflows) |
|
|
186
|
+
| **BrowserManagerService** | Browser pool management |
|
|
187
|
+
| **PageService** | Page lifecycle and navigation |
|
|
188
|
+
| **CookieService** | Cookie persistence |
|
|
189
|
+
| **CleansingService** | Data cleansing with pipes |
|
|
190
|
+
|
|
191
|
+
## Configuration
|
|
192
|
+
|
|
193
|
+
### Basic Configuration
|
|
194
|
+
|
|
195
|
+
```typescript
|
|
196
|
+
BrowserActionModule.forRoot({
|
|
197
|
+
pool: {
|
|
198
|
+
min: 2,
|
|
199
|
+
max: 10,
|
|
200
|
+
idleTimeoutMs: 30000,
|
|
201
|
+
strategy: 'round-robin',
|
|
202
|
+
},
|
|
203
|
+
cookies: {
|
|
204
|
+
enabled: true,
|
|
205
|
+
cookiesDir: './cookies',
|
|
206
|
+
},
|
|
207
|
+
logLevel: 'log',
|
|
208
|
+
})
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### All Options
|
|
212
|
+
|
|
213
|
+
See [Configuration Reference](./docs/api-reference.md#configuration) for complete options.
|
|
214
|
+
|
|
215
|
+
## Type Safety
|
|
216
|
+
|
|
217
|
+
Full TypeScript support with generics:
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
// Type-safe selectors
|
|
221
|
+
interface ProductSelectors {
|
|
222
|
+
title: string;
|
|
223
|
+
price: number;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const result = await this.actionHelpers.scrape<ProductSelectors>(url, {
|
|
227
|
+
title: 'h1',
|
|
228
|
+
price: '.price',
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
// Type-safe workflow results
|
|
232
|
+
const workflow = await this.actionHelpers.scrapeWithActions<{
|
|
233
|
+
title: string;
|
|
234
|
+
price: number;
|
|
235
|
+
}>(url, workflow);
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## Development
|
|
239
|
+
|
|
240
|
+
### Scripts
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# Build
|
|
244
|
+
yarn build
|
|
245
|
+
|
|
246
|
+
# Run tests
|
|
247
|
+
yarn test
|
|
248
|
+
|
|
249
|
+
# Lint code
|
|
250
|
+
yarn lint
|
|
251
|
+
|
|
252
|
+
# Format code
|
|
253
|
+
yarn format
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### Git Hooks
|
|
257
|
+
|
|
258
|
+
- **Pre-commit**: Runs ESLint
|
|
259
|
+
- **Pre-push**: Runs build and tests
|
|
260
|
+
|
|
261
|
+
## License
|
|
262
|
+
|
|
263
|
+
MIT
|
|
264
|
+
|
|
265
|
+
## Support
|
|
266
|
+
|
|
267
|
+
For issues and questions, please use [GitHub Issues](https://github.com/Hanivan/nestjs-browser-action/issues).
|
|
268
|
+
|
|
269
|
+
## Examples
|
|
270
|
+
|
|
271
|
+
Check out the test project for complete examples: [test-browser-action](https://github.com/Hanivan/test-browser-action)
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
**Documentation:**
|
|
276
|
+
- [Methods](./docs/methods) - Method-specific guides
|
|
277
|
+
- [Features](./docs/features) - Feature guides
|
|
278
|
+
- [API Reference](./docs/api-reference.md) - Complete API
|
|
279
|
+
- [Workflow Actions](./docs/workflow-actions.md) - Action reference
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
2
|
+
import { BrowserActionOptions } from './interfaces';
|
|
3
|
+
export type BrowserActionModuleOptions = BrowserActionOptions;
|
|
4
|
+
export interface BrowserActionAsyncModuleOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
5
|
+
useFactory: (...args: unknown[]) => Promise<BrowserActionModuleOptions> | BrowserActionModuleOptions;
|
|
6
|
+
inject?: Array<Type | string | symbol>;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-action.module-definition.js","sourceRoot":"","sources":["../src/browser-action.module-definition.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DynamicModule } from '@nestjs/common';
|
|
2
|
+
import { BrowserActionModuleOptions, BrowserActionAsyncModuleOptions } from './browser-action.module-definition';
|
|
3
|
+
export declare class BrowserActionModule {
|
|
4
|
+
static register(options: BrowserActionModuleOptions): DynamicModule;
|
|
5
|
+
static forRoot(options: BrowserActionModuleOptions): DynamicModule;
|
|
6
|
+
static forRootAsync(options: BrowserActionAsyncModuleOptions): DynamicModule;
|
|
7
|
+
onModuleDestroy(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
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 BrowserActionModule_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.BrowserActionModule = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const browser_pool_service_1 = require("./services/browser-pool.service");
|
|
13
|
+
const browser_manager_service_1 = require("./services/browser-manager.service");
|
|
14
|
+
const page_service_1 = require("./services/page-service");
|
|
15
|
+
const action_helpers_service_1 = require("./helpers/action-helpers.service");
|
|
16
|
+
const cookie_service_1 = require("./services/cookie.service");
|
|
17
|
+
const cleansing_service_1 = require("./services/cleansing.service");
|
|
18
|
+
const constants_1 = require("./constants");
|
|
19
|
+
let BrowserActionModule = BrowserActionModule_1 = class BrowserActionModule {
|
|
20
|
+
static register(options) {
|
|
21
|
+
const optionsProvider = {
|
|
22
|
+
provide: constants_1.BROWSER_ACTION_OPTIONS,
|
|
23
|
+
useValue: options,
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
module: BrowserActionModule_1,
|
|
27
|
+
providers: [optionsProvider],
|
|
28
|
+
exports: [],
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
static forRoot(options) {
|
|
32
|
+
const optionsProvider = {
|
|
33
|
+
provide: constants_1.BROWSER_ACTION_OPTIONS,
|
|
34
|
+
useValue: options,
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
module: BrowserActionModule_1,
|
|
38
|
+
providers: [
|
|
39
|
+
optionsProvider,
|
|
40
|
+
browser_pool_service_1.BrowserPoolService,
|
|
41
|
+
browser_manager_service_1.BrowserManagerService,
|
|
42
|
+
page_service_1.PageService,
|
|
43
|
+
action_helpers_service_1.ActionHelpersService,
|
|
44
|
+
cookie_service_1.CookieService,
|
|
45
|
+
cleansing_service_1.CleansingService,
|
|
46
|
+
],
|
|
47
|
+
exports: [
|
|
48
|
+
browser_manager_service_1.BrowserManagerService,
|
|
49
|
+
page_service_1.PageService,
|
|
50
|
+
action_helpers_service_1.ActionHelpersService,
|
|
51
|
+
cookie_service_1.CookieService,
|
|
52
|
+
cleansing_service_1.CleansingService,
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
static forRootAsync(options) {
|
|
57
|
+
const asyncOptionsProvider = {
|
|
58
|
+
provide: constants_1.BROWSER_ACTION_OPTIONS,
|
|
59
|
+
useFactory: async (...args) => {
|
|
60
|
+
return await options.useFactory(...args);
|
|
61
|
+
},
|
|
62
|
+
inject: options.inject || [],
|
|
63
|
+
};
|
|
64
|
+
return {
|
|
65
|
+
module: BrowserActionModule_1,
|
|
66
|
+
imports: options.imports || [],
|
|
67
|
+
providers: [
|
|
68
|
+
asyncOptionsProvider,
|
|
69
|
+
browser_pool_service_1.BrowserPoolService,
|
|
70
|
+
browser_manager_service_1.BrowserManagerService,
|
|
71
|
+
page_service_1.PageService,
|
|
72
|
+
action_helpers_service_1.ActionHelpersService,
|
|
73
|
+
cookie_service_1.CookieService,
|
|
74
|
+
cleansing_service_1.CleansingService,
|
|
75
|
+
],
|
|
76
|
+
exports: [
|
|
77
|
+
browser_manager_service_1.BrowserManagerService,
|
|
78
|
+
page_service_1.PageService,
|
|
79
|
+
action_helpers_service_1.ActionHelpersService,
|
|
80
|
+
cookie_service_1.CookieService,
|
|
81
|
+
cleansing_service_1.CleansingService,
|
|
82
|
+
],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
async onModuleDestroy() {
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
exports.BrowserActionModule = BrowserActionModule;
|
|
89
|
+
exports.BrowserActionModule = BrowserActionModule = BrowserActionModule_1 = __decorate([
|
|
90
|
+
(0, common_1.Global)(),
|
|
91
|
+
(0, common_1.Module)({})
|
|
92
|
+
], BrowserActionModule);
|
|
93
|
+
//# sourceMappingURL=browser-action.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-action.module.js","sourceRoot":"","sources":["../src/browser-action.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAyE;AAKzE,0EAAqE;AACrE,gFAA2E;AAC3E,0DAAsD;AACtD,6EAAwE;AACxE,8DAA0D;AAC1D,oEAAgE;AAChE,2CAAqD;AAI9C,IAAM,mBAAmB,2BAAzB,MAAM,mBAAmB;IAC9B,MAAM,CAAC,QAAQ,CAAC,OAAmC;QACjD,MAAM,eAAe,GAAa;YAChC,OAAO,EAAE,kCAAsB;YAC/B,QAAQ,EAAE,OAAO;SAClB,CAAC;QAEF,OAAO;YACL,MAAM,EAAE,qBAAmB;YAC3B,SAAS,EAAE,CAAC,eAAe,CAAC;YAC5B,OAAO,EAAE,EAAE;SACZ,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,OAAmC;QAChD,MAAM,eAAe,GAAa;YAChC,OAAO,EAAE,kCAAsB;YAC/B,QAAQ,EAAE,OAAO;SAClB,CAAC;QAEF,OAAO;YACL,MAAM,EAAE,qBAAmB;YAC3B,SAAS,EAAE;gBACT,eAAe;gBACf,yCAAkB;gBAClB,+CAAqB;gBACrB,0BAAW;gBACX,6CAAoB;gBACpB,8BAAa;gBACb,oCAAgB;aACjB;YACD,OAAO,EAAE;gBACP,+CAAqB;gBACrB,0BAAW;gBACX,6CAAoB;gBACpB,8BAAa;gBACb,oCAAgB;aACjB;SACF,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,OAAwC;QAC1D,MAAM,oBAAoB,GAAa;YACrC,OAAO,EAAE,kCAAsB;YAC/B,UAAU,EAAE,KAAK,EAAE,GAAG,IAAe,EAAE,EAAE;gBACvC,OAAO,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;YAC3C,CAAC;YACD,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;SAC7B,CAAC;QAEF,OAAO;YACL,MAAM,EAAE,qBAAmB;YAC3B,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE;YAC9B,SAAS,EAAE;gBACT,oBAAoB;gBACpB,yCAAkB;gBAClB,+CAAqB;gBACrB,0BAAW;gBACX,6CAAoB;gBACpB,8BAAa;gBACb,oCAAgB;aACjB;YACD,OAAO,EAAE;gBACP,+CAAqB;gBACrB,0BAAW;gBACX,6CAAoB;gBACpB,8BAAa;gBACb,oCAAgB;aACjB;SACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,eAAe;IAErB,CAAC;CACF,CAAA;AA3EY,kDAAmB;8BAAnB,mBAAmB;IAF/B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,mBAAmB,CA2E/B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const BROWSER_ACTION_OPTIONS = "BROWSER_ACTION_OPTIONS";
|
|
2
|
+
export declare const DEFAULT_POOL_OPTIONS: {
|
|
3
|
+
min: number;
|
|
4
|
+
max: number;
|
|
5
|
+
idleTimeoutMs: number;
|
|
6
|
+
strategy: "round-robin";
|
|
7
|
+
};
|
|
8
|
+
export declare const DEFAULT_LAUNCH_OPTIONS: {
|
|
9
|
+
headless: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const DEFAULT_CONTEXT_OPTIONS: {
|
|
12
|
+
viewport: {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare const DEFAULT_ACTION_TIMEOUT = 30000;
|
|
18
|
+
export declare const DEFAULT_NAVIGATION_TIMEOUT = 30000;
|
|
19
|
+
export declare const DEFAULT_SCROLL_DELAY_MS = 100;
|
|
20
|
+
export declare const DEFAULT_SCREENSHOT_FILENAME = "screenshot";
|
|
21
|
+
export declare const DEFAULT_ERROR_SCREENSHOT_FILENAME = "error";
|
|
22
|
+
export declare const DEFAULT_COOKIE_OPTIONS: {
|
|
23
|
+
readonly enabled: true;
|
|
24
|
+
readonly cookiesDir: "./cookies";
|
|
25
|
+
readonly autoSave: false;
|
|
26
|
+
readonly autoLoad: false;
|
|
27
|
+
readonly defaultSessionName: "default";
|
|
28
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_COOKIE_OPTIONS = exports.DEFAULT_ERROR_SCREENSHOT_FILENAME = exports.DEFAULT_SCREENSHOT_FILENAME = exports.DEFAULT_SCROLL_DELAY_MS = exports.DEFAULT_NAVIGATION_TIMEOUT = exports.DEFAULT_ACTION_TIMEOUT = exports.DEFAULT_CONTEXT_OPTIONS = exports.DEFAULT_LAUNCH_OPTIONS = exports.DEFAULT_POOL_OPTIONS = exports.BROWSER_ACTION_OPTIONS = void 0;
|
|
4
|
+
exports.BROWSER_ACTION_OPTIONS = 'BROWSER_ACTION_OPTIONS';
|
|
5
|
+
exports.DEFAULT_POOL_OPTIONS = {
|
|
6
|
+
min: 2,
|
|
7
|
+
max: 10,
|
|
8
|
+
idleTimeoutMs: 30000,
|
|
9
|
+
strategy: 'round-robin',
|
|
10
|
+
};
|
|
11
|
+
exports.DEFAULT_LAUNCH_OPTIONS = {
|
|
12
|
+
headless: true,
|
|
13
|
+
};
|
|
14
|
+
exports.DEFAULT_CONTEXT_OPTIONS = {
|
|
15
|
+
viewport: {
|
|
16
|
+
width: 1920,
|
|
17
|
+
height: 1080,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
exports.DEFAULT_ACTION_TIMEOUT = 30000;
|
|
21
|
+
exports.DEFAULT_NAVIGATION_TIMEOUT = 30000;
|
|
22
|
+
exports.DEFAULT_SCROLL_DELAY_MS = 100;
|
|
23
|
+
exports.DEFAULT_SCREENSHOT_FILENAME = 'screenshot';
|
|
24
|
+
exports.DEFAULT_ERROR_SCREENSHOT_FILENAME = 'error';
|
|
25
|
+
exports.DEFAULT_COOKIE_OPTIONS = {
|
|
26
|
+
enabled: true,
|
|
27
|
+
cookiesDir: './cookies',
|
|
28
|
+
autoSave: false,
|
|
29
|
+
autoLoad: false,
|
|
30
|
+
defaultSessionName: 'default',
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=browser-action.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-action.constants.js","sourceRoot":"","sources":["../../src/constants/browser-action.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAElD,QAAA,oBAAoB,GAAG;IAClC,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,EAAE;IACP,aAAa,EAAE,KAAK;IACpB,QAAQ,EAAE,aAAsB;CACjC,CAAC;AAEW,QAAA,sBAAsB,GAAG;IACpC,QAAQ,EAAE,IAAI;CACf,CAAC;AAEW,QAAA,uBAAuB,GAAG;IACrC,QAAQ,EAAE;QACR,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAC;AAGW,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAC/B,QAAA,0BAA0B,GAAG,KAAK,CAAC;AACnC,QAAA,uBAAuB,GAAG,GAAG,CAAC;AAC9B,QAAA,2BAA2B,GAAG,YAAY,CAAC;AAC3C,QAAA,iCAAiC,GAAG,OAAO,CAAC;AAC5C,QAAA,sBAAsB,GAAG;IACpC,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,WAAW;IACvB,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,KAAK;IACf,kBAAkB,EAAE,SAAS;CACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './browser-action.constants';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./browser-action.constants"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./inject-browser.decorator"), exports);
|
|
18
|
+
__exportStar(require("./inject-page.decorator"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,0DAAwC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const InjectBrowser: () => PropertyDecorator & ParameterDecorator;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InjectBrowser = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const InjectBrowser = () => (0, common_1.Inject)('BROWSER_INSTANCE');
|
|
6
|
+
exports.InjectBrowser = InjectBrowser;
|
|
7
|
+
//# sourceMappingURL=inject-browser.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-browser.decorator.js","sourceRoot":"","sources":["../../src/decorators/inject-browser.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAEjC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAC;AAAjD,QAAA,aAAa,iBAAoC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const InjectPage: () => PropertyDecorator & ParameterDecorator;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InjectPage = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const InjectPage = () => (0, common_1.Inject)('PAGE_INSTANCE');
|
|
6
|
+
exports.InjectPage = InjectPage;
|
|
7
|
+
//# sourceMappingURL=inject-page.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-page.decorator.js","sourceRoot":"","sources":["../../src/decorators/inject-page.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAEjC,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,IAAA,eAAM,EAAC,eAAe,CAAC,CAAC;AAA3C,QAAA,UAAU,cAAiC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CleansingProfile = void 0;
|
|
4
|
+
var CleansingProfile;
|
|
5
|
+
(function (CleansingProfile) {
|
|
6
|
+
CleansingProfile["PRICE"] = "price";
|
|
7
|
+
CleansingProfile["PHONE"] = "phone";
|
|
8
|
+
CleansingProfile["EMAIL"] = "email";
|
|
9
|
+
CleansingProfile["DATE"] = "date";
|
|
10
|
+
CleansingProfile["CURRENCY"] = "currency";
|
|
11
|
+
})(CleansingProfile || (exports.CleansingProfile = CleansingProfile = {}));
|
|
12
|
+
//# sourceMappingURL=cleansing-profile.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleansing-profile.enum.js","sourceRoot":"","sources":["../../src/enums/cleansing-profile.enum.ts"],"names":[],"mappings":";;;AAIA,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,mCAAe,CAAA;IACf,mCAAe,CAAA;IACf,iCAAa,CAAA;IACb,yCAAqB,CAAA;AACvB,CAAC,EANW,gBAAgB,gCAAhB,gBAAgB,QAM3B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum CleansingType {
|
|
2
|
+
TRIM = "trim",
|
|
3
|
+
TO_NUMBER = "to-number",
|
|
4
|
+
TO_LOWER_CASE = "to-lower-case",
|
|
5
|
+
TO_UPPER_CASE = "to-upper-case",
|
|
6
|
+
SANITIZE_TEXT = "sanitize-text",
|
|
7
|
+
DATE_FORMAT = "date-format",
|
|
8
|
+
REGEX_REPLACE = "regex-replace",
|
|
9
|
+
REGEX_EXTRACT = "regex-extract",
|
|
10
|
+
REMOVE_CURRENCY_SYMBOL = "remove-currency-symbol",
|
|
11
|
+
REMOVE_SPECIAL_CHARS = "remove-special-chars",
|
|
12
|
+
NORMALIZE_WHITESPACE = "normalize-whitespace",
|
|
13
|
+
REMOVE_LINE_BREAKS = "remove-line-breaks",
|
|
14
|
+
ALT_FLAG = "alt-flag"
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CleansingType = void 0;
|
|
4
|
+
var CleansingType;
|
|
5
|
+
(function (CleansingType) {
|
|
6
|
+
CleansingType["TRIM"] = "trim";
|
|
7
|
+
CleansingType["TO_NUMBER"] = "to-number";
|
|
8
|
+
CleansingType["TO_LOWER_CASE"] = "to-lower-case";
|
|
9
|
+
CleansingType["TO_UPPER_CASE"] = "to-upper-case";
|
|
10
|
+
CleansingType["SANITIZE_TEXT"] = "sanitize-text";
|
|
11
|
+
CleansingType["DATE_FORMAT"] = "date-format";
|
|
12
|
+
CleansingType["REGEX_REPLACE"] = "regex-replace";
|
|
13
|
+
CleansingType["REGEX_EXTRACT"] = "regex-extract";
|
|
14
|
+
CleansingType["REMOVE_CURRENCY_SYMBOL"] = "remove-currency-symbol";
|
|
15
|
+
CleansingType["REMOVE_SPECIAL_CHARS"] = "remove-special-chars";
|
|
16
|
+
CleansingType["NORMALIZE_WHITESPACE"] = "normalize-whitespace";
|
|
17
|
+
CleansingType["REMOVE_LINE_BREAKS"] = "remove-line-breaks";
|
|
18
|
+
CleansingType["ALT_FLAG"] = "alt-flag";
|
|
19
|
+
})(CleansingType || (exports.CleansingType = CleansingType = {}));
|
|
20
|
+
//# sourceMappingURL=cleansing-type.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleansing-type.enum.js","sourceRoot":"","sources":["../../src/enums/cleansing-type.enum.ts"],"names":[],"mappings":";;;AAIA,IAAY,aAcX;AAdD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,wCAAuB,CAAA;IACvB,gDAA+B,CAAA;IAC/B,gDAA+B,CAAA;IAC/B,gDAA+B,CAAA;IAC/B,4CAA2B,CAAA;IAC3B,gDAA+B,CAAA;IAC/B,gDAA+B,CAAA;IAC/B,kEAAiD,CAAA;IACjD,8DAA6C,CAAA;IAC7C,8DAA6C,CAAA;IAC7C,0DAAyC,CAAA;IACzC,sCAAqB,CAAA;AACvB,CAAC,EAdW,aAAa,6BAAb,aAAa,QAcxB"}
|