@tehw0lf/wordlist-generator 0.14.3 → 0.17.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/esm2022/index.mjs +2 -0
- package/esm2022/lib/wordlist-generator.component.mjs +178 -0
- package/{esm2020 → esm2022}/lib/wordlist-generator.service.mjs +5 -5
- package/fesm2022/tehw0lf-wordlist-generator.mjs +222 -0
- package/fesm2022/tehw0lf-wordlist-generator.mjs.map +1 -0
- package/index.d.ts +0 -1
- package/lib/wordlist-generator.component.d.ts +1 -1
- package/package.json +14 -25
- package/esm2020/index.mjs +0 -3
- package/esm2020/lib/wordlist-generator.component.mjs +0 -161
- package/esm2020/lib/wordlist-generator.module.mjs +0 -62
- package/fesm2015/tehw0lf-wordlist-generator.mjs +0 -262
- package/fesm2015/tehw0lf-wordlist-generator.mjs.map +0 -1
- package/fesm2020/tehw0lf-wordlist-generator.mjs +0 -261
- package/fesm2020/tehw0lf-wordlist-generator.mjs.map +0 -1
- package/lib/wordlist-generator.module.d.ts +0 -18
- package/schematics/collection.json +0 -16
- package/schematics/ng-add/index.d.ts +0 -3
- package/schematics/ng-add/index.js +0 -46
- package/schematics/ng-add/index.js.map +0 -1
- package/schematics/ng-add/index.spec.d.ts +0 -1
- package/schematics/ng-add/index.spec.js +0 -102
- package/schematics/ng-add/index.spec.js.map +0 -1
- package/schematics/ng-add/package-config.d.ts +0 -12
- package/schematics/ng-add/package-config.js +0 -48
- package/schematics/ng-add/package-config.js.map +0 -1
- package/schematics/ng-add/schema.d.ts +0 -3
- package/schematics/ng-add/schema.js +0 -3
- package/schematics/ng-add/schema.js.map +0 -1
- package/schematics/ng-add/schema.json +0 -16
- package/schematics/ng-add/setup.d.ts +0 -3
- package/schematics/ng-add/setup.js +0 -50
- package/schematics/ng-add/setup.js.map +0 -1
- package/schematics/testing/file-content.d.ts +0 -10
- package/schematics/testing/file-content.js +0 -13
- package/schematics/testing/file-content.js.map +0 -1
- package/schematics/testing/test-app.d.ts +0 -12
- package/schematics/testing/test-app.js +0 -44
- package/schematics/testing/test-app.js.map +0 -1
- package/schematics/testing/test-library.d.ts +0 -11
- package/schematics/testing/test-library.js +0 -21
- package/schematics/testing/test-library.js.map +0 -1
- package/schematics/testing/test-project.d.ts +0 -11
- package/schematics/testing/test-project.js +0 -36
- package/schematics/testing/test-project.js.map +0 -1
- /package/{esm2020 → esm2022}/lib/filetypes.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/parsers.mjs +0 -0
- /package/{esm2020 → esm2022}/tehw0lf-wordlist-generator.mjs +0 -0
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import * as i4 from '@angular/cdk/drag-drop';
|
|
2
|
-
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injectable, Component, ViewEncapsulation, Input, NgModule } from '@angular/core';
|
|
5
|
-
import * as i1 from '@angular/forms';
|
|
6
|
-
import { Validators, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
-
import { from, Subject } from 'rxjs';
|
|
8
|
-
import { map, tap, reduce, takeUntil } from 'rxjs/operators';
|
|
9
|
-
import { product } from 'cartesian-product-generator';
|
|
10
|
-
import * as i3 from '@angular/common';
|
|
11
|
-
import { CommonModule } from '@angular/common';
|
|
12
|
-
import * as i5 from '@angular/material/form-field';
|
|
13
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
14
|
-
import * as i6 from '@angular/material/icon';
|
|
15
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
16
|
-
import * as i7 from '@angular/material/input';
|
|
17
|
-
import { MatInputModule } from '@angular/material/input';
|
|
18
|
-
import * as i8 from '@angular/material/menu';
|
|
19
|
-
import { MatMenuModule } from '@angular/material/menu';
|
|
20
|
-
import * as i9 from '@angular/material/button';
|
|
21
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
22
|
-
import { ClipboardModule } from '@angular/cdk/clipboard';
|
|
23
|
-
import { BrowserModule } from '@angular/platform-browser';
|
|
24
|
-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
25
|
-
|
|
26
|
-
/* eslint-disable no-shadow */
|
|
27
|
-
var FileType;
|
|
28
|
-
(function (FileType) {
|
|
29
|
-
FileType["plaintext"] = "txt";
|
|
30
|
-
FileType["xml"] = "xml";
|
|
31
|
-
})(FileType || (FileType = {}));
|
|
32
|
-
|
|
33
|
-
const toPlaintext = (wordlist) => ({
|
|
34
|
-
wordlist,
|
|
35
|
-
contentType: 'text/plain'
|
|
36
|
-
});
|
|
37
|
-
const toXML = (wordlist) => {
|
|
38
|
-
const head = '<wordlist><word>';
|
|
39
|
-
const glue = '</word><word>';
|
|
40
|
-
const tail = '</word></wordlist>';
|
|
41
|
-
return {
|
|
42
|
-
wordlist: head + wordlist.replace(/\n/g, glue) + tail,
|
|
43
|
-
contentType: 'text/xml'
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
class WordlistGeneratorService {
|
|
48
|
-
constructor() {
|
|
49
|
-
//
|
|
50
|
-
}
|
|
51
|
-
generateWordlist(...charsets) {
|
|
52
|
-
return from(product(...charsets)).pipe(map((word) => {
|
|
53
|
-
return word.join('');
|
|
54
|
-
}));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
WordlistGeneratorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: WordlistGeneratorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
58
|
-
WordlistGeneratorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: WordlistGeneratorService, providedIn: 'root' });
|
|
59
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: WordlistGeneratorService, decorators: [{
|
|
60
|
-
type: Injectable,
|
|
61
|
-
args: [{
|
|
62
|
-
providedIn: 'root'
|
|
63
|
-
}]
|
|
64
|
-
}], ctorParameters: function () { return []; } });
|
|
65
|
-
|
|
66
|
-
/* eslint-disable @angular-eslint/component-selector */
|
|
67
|
-
class WordlistGeneratorComponent {
|
|
68
|
-
constructor(formBuilder, wordlistGenerator) {
|
|
69
|
-
this.formBuilder = formBuilder;
|
|
70
|
-
this.wordlistGenerator = wordlistGenerator;
|
|
71
|
-
this.buttonStyle = {
|
|
72
|
-
'background-color': '#333333',
|
|
73
|
-
color: '#cc7832'
|
|
74
|
-
};
|
|
75
|
-
this.dragStyle = { color: '#cc7832' };
|
|
76
|
-
this.textStyle = { color: '#cc7832' };
|
|
77
|
-
this.displayWordlist = false;
|
|
78
|
-
this.fileType = FileType.plaintext;
|
|
79
|
-
this.fileTypes = Object.values(FileType);
|
|
80
|
-
this.filteredCharset = [];
|
|
81
|
-
this.prefix = '';
|
|
82
|
-
this.suffix = '';
|
|
83
|
-
this.unsubscribe$ = new Subject();
|
|
84
|
-
this.removeDuplicates = (unfiltered) => [...new Set(unfiltered)].join('');
|
|
85
|
-
}
|
|
86
|
-
ngOnInit() {
|
|
87
|
-
this.generateForm();
|
|
88
|
-
}
|
|
89
|
-
ngOnDestroy() {
|
|
90
|
-
this.unsubscribe$.next();
|
|
91
|
-
this.unsubscribe$.complete();
|
|
92
|
-
}
|
|
93
|
-
get charsets() {
|
|
94
|
-
if (this.charsetForm) {
|
|
95
|
-
return this.charsetForm.get('charsets');
|
|
96
|
-
}
|
|
97
|
-
return undefined;
|
|
98
|
-
}
|
|
99
|
-
addCharset() {
|
|
100
|
-
if (this.charsets) {
|
|
101
|
-
this.charsets.push(this.formBuilder.control('', Validators.required));
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
cloneCharset(index) {
|
|
105
|
-
if (this.charsets) {
|
|
106
|
-
const charset = this.charsets.value[index];
|
|
107
|
-
this.charsets.insert(index, this.formBuilder.control(charset, Validators.required));
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
downloadWordlist() {
|
|
111
|
-
if (this.charsets) {
|
|
112
|
-
if (this.filteredCharset !== this.filterCharset(this.charsets.value)) {
|
|
113
|
-
this.generateWordlist();
|
|
114
|
-
}
|
|
115
|
-
const filename = `wordlist_${this.wordsGenerated}_words_${this.charsets.length}_positions.${this.fileType}`;
|
|
116
|
-
this.getWordlist()
|
|
117
|
-
.pipe(tap((wordlist) => {
|
|
118
|
-
if (wordlist.length > 0) {
|
|
119
|
-
const parsed = this.parseWordlist(wordlist);
|
|
120
|
-
const file = new Blob([parsed.wordlist], {
|
|
121
|
-
type: parsed.contentType
|
|
122
|
-
});
|
|
123
|
-
if (window.navigator.msSaveOrOpenBlob) {
|
|
124
|
-
window.navigator.msSaveOrOpenBlob(file, filename);
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
const a = document.createElement('a');
|
|
128
|
-
const url = URL.createObjectURL(file);
|
|
129
|
-
a.href = url;
|
|
130
|
-
a.download = filename;
|
|
131
|
-
document.body.appendChild(a);
|
|
132
|
-
a.click();
|
|
133
|
-
setTimeout(() => {
|
|
134
|
-
document.body.removeChild(a);
|
|
135
|
-
window.URL.revokeObjectURL(url);
|
|
136
|
-
}, 0);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}))
|
|
140
|
-
.subscribe();
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
drop(event) {
|
|
144
|
-
if (this.charsets) {
|
|
145
|
-
moveItemInArray(this.charsets.controls, event.previousIndex, event.currentIndex);
|
|
146
|
-
this.charsets.updateValueAndValidity();
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
generateForm() {
|
|
150
|
-
this.charsetForm = this.formBuilder.group({
|
|
151
|
-
charsets: this.formBuilder.array([
|
|
152
|
-
this.formBuilder.control('', Validators.required)
|
|
153
|
-
]),
|
|
154
|
-
prefix: this.formBuilder.control(''),
|
|
155
|
-
suffix: this.formBuilder.control('')
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
generateWordlist() {
|
|
159
|
-
if (this.charsetForm && this.charsets && this.charsets.valid) {
|
|
160
|
-
this.filteredCharset = this.filterCharset(this.charsets.value);
|
|
161
|
-
this.prefix = this.charsetForm.get('prefix')?.value
|
|
162
|
-
? this.charsetForm.get('prefix')?.value
|
|
163
|
-
: '';
|
|
164
|
-
this.suffix = this.charsetForm.get('suffix')?.value
|
|
165
|
-
? this.charsetForm.get('suffix')?.value
|
|
166
|
-
: '';
|
|
167
|
-
this.wordsGenerated = this.filteredCharset
|
|
168
|
-
.map((charset) => charset.length)
|
|
169
|
-
.reduce((previousLength, currentLength) => previousLength * currentLength);
|
|
170
|
-
this.displayWordlist = this.wordsGenerated <= 100;
|
|
171
|
-
this.wordlist$ = this.getWordlist();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
getWordlist() {
|
|
175
|
-
return this.wordlistGenerator
|
|
176
|
-
.generateWordlist(...this.filteredCharset)
|
|
177
|
-
.pipe(reduce((wordlist, word) => `${wordlist}${this.prefix}${word}${this.suffix}\n`, ''), takeUntil(this.unsubscribe$));
|
|
178
|
-
}
|
|
179
|
-
filterCharset(charsets) {
|
|
180
|
-
return charsets.map((charset) => this.removeDuplicates(charset));
|
|
181
|
-
}
|
|
182
|
-
parseWordlist(wordlist) {
|
|
183
|
-
switch (this.fileType) {
|
|
184
|
-
case FileType.plaintext:
|
|
185
|
-
return toPlaintext(wordlist);
|
|
186
|
-
case FileType.xml:
|
|
187
|
-
return toXML(wordlist);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
removeCharset(i) {
|
|
191
|
-
if (this.charsets && this.charsets.length > 1) {
|
|
192
|
-
this.charsets.removeAt(i);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
WordlistGeneratorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: WordlistGeneratorComponent, deps: [{ token: i1.UntypedFormBuilder }, { token: WordlistGeneratorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
197
|
-
WordlistGeneratorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: WordlistGeneratorComponent, selector: "wordlist-generator", inputs: { buttonStyle: "buttonStyle", dragStyle: "dragStyle", textStyle: "textStyle" }, ngImport: i0, template: "<div class=\"meta-container\" fxLayout=\"row wrap\">\n <div class=\"form-container\" fxLayout=\"column\" fxFlex>\n <div fxLayout=\"row wrap\">\n <button\n class=\"generate-wordlist\"\n [ngStyle]=\"buttonStyle\"\n mat-raised-button\n (click)=\"generateWordlist()\"\n >\n Generate wordlist\n </button>\n <button\n class=\"choose-format\"\n [ngStyle]=\"buttonStyle\"\n mat-raised-button\n [matMenuTriggerFor]=\"menu\"\n *ngIf=\"wordlist$\"\n >\n Choose format\n </button>\n <mat-menu #menu=\"matMenu\">\n <button\n [ngStyle]=\"buttonStyle\"\n mat-menu-item\n *ngFor=\"let type of fileTypes\"\n (click)=\"fileType = type\"\n >\n {{ type }}\n </button>\n </mat-menu>\n <button\n class=\"download-wordlist\"\n [ngStyle]=\"buttonStyle\"\n mat-raised-button\n *ngIf=\"wordlist$\"\n (click)=\"downloadWordlist()\"\n >\n Download as\n <ng-container *ngIf=\"this.fileType\">{{ this.fileType }}</ng-container>\n </button>\n </div>\n <form *ngIf=\"charsetForm\" [formGroup]=\"charsetForm\">\n <mat-form-field class=\"fixed-width\" appearance=\"outline\">\n <mat-label [ngStyle]=\"textStyle\">prefix (optional)</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n type=\"text\"\n id=\"prefix\"\n formControlName=\"prefix\"\n (keydown.enter)=\"$event.preventDefault()\"\n />\n </mat-form-field>\n <div formArrayName=\"charsets\">\n <div class=\"charset\"></div>\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <div\n class=\"charset-container\"\n cdkDrag\n *ngFor=\"let charset of charsets?.controls; let i = index\"\n >\n <mat-icon class=\"drag-indicator\" [ngStyle]=\"dragStyle\"\n >drag_indicator</mat-icon\n >\n <mat-form-field class=\"charset\" appearance=\"outline\">\n <mat-label [ngStyle]=\"textStyle\">\n character set for string position {{ i }}\n </mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n type=\"text\"\n id=\"position-{{ i }}\"\n [formControlName]=\"i\"\n (keydown.enter)=\"$event.preventDefault()\"\n required\n />\n </mat-form-field>\n <button\n mat-raised-button\n class=\"clone-charset\"\n [ngStyle]=\"buttonStyle\"\n (click)=\"cloneCharset(i)\"\n >\n <mat-icon>content_copy</mat-icon>\n </button>\n <button\n mat-raised-button\n class=\"remove-charset\"\n [ngStyle]=\"buttonStyle\"\n (click)=\"removeCharset(i)\"\n [disabled]=\"this.charsets?.value.length === 1\"\n >\n <mat-icon>remove</mat-icon>\n </button>\n <button\n mat-raised-button\n [ngStyle]=\"buttonStyle\"\n (click)=\"addCharset()\"\n >\n <mat-icon>add</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <mat-form-field class=\"fixed-width\" appearance=\"outline\">\n <mat-label [ngStyle]=\"textStyle\">suffix (optional)</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n type=\"text\"\n id=\"suffix\"\n formControlName=\"suffix\"\n (keydown.enter)=\"$event.preventDefault()\"\n />\n </mat-form-field>\n </form>\n </div>\n <div class=\"wordlist-container\" *ngIf=\"wordlist$\" fxLayout=\"column\" fxFlex>\n <ng-container *ngIf=\"displayWordlist; else wordlistTooLarge\">\n <h3 class=\"wordlist-header\">Generated wordlist:</h3>\n <code class=\"wordlist\">\n {{ wordlist$ | async }}\n </code></ng-container\n >\n <ng-template #wordlistTooLarge>\n The generated wordlist is too large to be displayed. You can still\n download it.\n </ng-template>\n </div>\n</div>\n", styles: [".meta-container{max-width:100vw}.meta-container .form-container{float:left}.meta-container .form-container .charset-container .drag-indicator{margin-right:10px}.meta-container .form-container .charset-container .clone-charset{margin:0 10px}.meta-container .form-container .charset-container .remove-charset{margin-right:10px}.meta-container .form-container .charset{width:18.875em}.meta-container .form-container .charset-container:not(:last-child) .add-charset{display:none}.meta-container .form-container .choose-format{margin:0 34px 10px;width:150px}.meta-container .form-container .generate-wordlist,.meta-container .form-container .download-wordlist{margin:0 0 10px;width:150px}.meta-container .wordlist-container{max-height:80vh}.meta-container .wordlist-container .wordlist-header{margin-top:0}.meta-container .wordlist-container .wordlist{margin-left:1em;overflow-wrap:normal;width:1%}.mat-menu-panel{width:150px}.mat-form-field-appearance-outline .mat-form-field-infix{border:0;padding:1em 0 .5em}.mat-form-field-appearance-outline .mat-form-field-wrapper{padding-bottom:.25em}.mat-form-field-label{transition:none!important}.mat-form-field-should-float .mat-form-field-label-wrapper{top:-.1em;padding-top:.1em}.mat-form-field-should-float .mat-form-field-label{transition:none!important}.fixed-width{width:21em}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i4.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i4.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i8.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i8.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i9.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], encapsulation: i0.ViewEncapsulation.None });
|
|
198
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: WordlistGeneratorComponent, decorators: [{
|
|
199
|
-
type: Component,
|
|
200
|
-
args: [{ selector: 'wordlist-generator', encapsulation: ViewEncapsulation.None, template: "<div class=\"meta-container\" fxLayout=\"row wrap\">\n <div class=\"form-container\" fxLayout=\"column\" fxFlex>\n <div fxLayout=\"row wrap\">\n <button\n class=\"generate-wordlist\"\n [ngStyle]=\"buttonStyle\"\n mat-raised-button\n (click)=\"generateWordlist()\"\n >\n Generate wordlist\n </button>\n <button\n class=\"choose-format\"\n [ngStyle]=\"buttonStyle\"\n mat-raised-button\n [matMenuTriggerFor]=\"menu\"\n *ngIf=\"wordlist$\"\n >\n Choose format\n </button>\n <mat-menu #menu=\"matMenu\">\n <button\n [ngStyle]=\"buttonStyle\"\n mat-menu-item\n *ngFor=\"let type of fileTypes\"\n (click)=\"fileType = type\"\n >\n {{ type }}\n </button>\n </mat-menu>\n <button\n class=\"download-wordlist\"\n [ngStyle]=\"buttonStyle\"\n mat-raised-button\n *ngIf=\"wordlist$\"\n (click)=\"downloadWordlist()\"\n >\n Download as\n <ng-container *ngIf=\"this.fileType\">{{ this.fileType }}</ng-container>\n </button>\n </div>\n <form *ngIf=\"charsetForm\" [formGroup]=\"charsetForm\">\n <mat-form-field class=\"fixed-width\" appearance=\"outline\">\n <mat-label [ngStyle]=\"textStyle\">prefix (optional)</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n type=\"text\"\n id=\"prefix\"\n formControlName=\"prefix\"\n (keydown.enter)=\"$event.preventDefault()\"\n />\n </mat-form-field>\n <div formArrayName=\"charsets\">\n <div class=\"charset\"></div>\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <div\n class=\"charset-container\"\n cdkDrag\n *ngFor=\"let charset of charsets?.controls; let i = index\"\n >\n <mat-icon class=\"drag-indicator\" [ngStyle]=\"dragStyle\"\n >drag_indicator</mat-icon\n >\n <mat-form-field class=\"charset\" appearance=\"outline\">\n <mat-label [ngStyle]=\"textStyle\">\n character set for string position {{ i }}\n </mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n type=\"text\"\n id=\"position-{{ i }}\"\n [formControlName]=\"i\"\n (keydown.enter)=\"$event.preventDefault()\"\n required\n />\n </mat-form-field>\n <button\n mat-raised-button\n class=\"clone-charset\"\n [ngStyle]=\"buttonStyle\"\n (click)=\"cloneCharset(i)\"\n >\n <mat-icon>content_copy</mat-icon>\n </button>\n <button\n mat-raised-button\n class=\"remove-charset\"\n [ngStyle]=\"buttonStyle\"\n (click)=\"removeCharset(i)\"\n [disabled]=\"this.charsets?.value.length === 1\"\n >\n <mat-icon>remove</mat-icon>\n </button>\n <button\n mat-raised-button\n [ngStyle]=\"buttonStyle\"\n (click)=\"addCharset()\"\n >\n <mat-icon>add</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <mat-form-field class=\"fixed-width\" appearance=\"outline\">\n <mat-label [ngStyle]=\"textStyle\">suffix (optional)</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n type=\"text\"\n id=\"suffix\"\n formControlName=\"suffix\"\n (keydown.enter)=\"$event.preventDefault()\"\n />\n </mat-form-field>\n </form>\n </div>\n <div class=\"wordlist-container\" *ngIf=\"wordlist$\" fxLayout=\"column\" fxFlex>\n <ng-container *ngIf=\"displayWordlist; else wordlistTooLarge\">\n <h3 class=\"wordlist-header\">Generated wordlist:</h3>\n <code class=\"wordlist\">\n {{ wordlist$ | async }}\n </code></ng-container\n >\n <ng-template #wordlistTooLarge>\n The generated wordlist is too large to be displayed. You can still\n download it.\n </ng-template>\n </div>\n</div>\n", styles: [".meta-container{max-width:100vw}.meta-container .form-container{float:left}.meta-container .form-container .charset-container .drag-indicator{margin-right:10px}.meta-container .form-container .charset-container .clone-charset{margin:0 10px}.meta-container .form-container .charset-container .remove-charset{margin-right:10px}.meta-container .form-container .charset{width:18.875em}.meta-container .form-container .charset-container:not(:last-child) .add-charset{display:none}.meta-container .form-container .choose-format{margin:0 34px 10px;width:150px}.meta-container .form-container .generate-wordlist,.meta-container .form-container .download-wordlist{margin:0 0 10px;width:150px}.meta-container .wordlist-container{max-height:80vh}.meta-container .wordlist-container .wordlist-header{margin-top:0}.meta-container .wordlist-container .wordlist{margin-left:1em;overflow-wrap:normal;width:1%}.mat-menu-panel{width:150px}.mat-form-field-appearance-outline .mat-form-field-infix{border:0;padding:1em 0 .5em}.mat-form-field-appearance-outline .mat-form-field-wrapper{padding-bottom:.25em}.mat-form-field-label{transition:none!important}.mat-form-field-should-float .mat-form-field-label-wrapper{top:-.1em;padding-top:.1em}.mat-form-field-should-float .mat-form-field-label{transition:none!important}.fixed-width{width:21em}\n"] }]
|
|
201
|
-
}], ctorParameters: function () { return [{ type: i1.UntypedFormBuilder }, { type: WordlistGeneratorService }]; }, propDecorators: { buttonStyle: [{
|
|
202
|
-
type: Input
|
|
203
|
-
}], dragStyle: [{
|
|
204
|
-
type: Input
|
|
205
|
-
}], textStyle: [{
|
|
206
|
-
type: Input
|
|
207
|
-
}] } });
|
|
208
|
-
|
|
209
|
-
class WordlistGeneratorModule {
|
|
210
|
-
}
|
|
211
|
-
WordlistGeneratorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: WordlistGeneratorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
212
|
-
WordlistGeneratorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: WordlistGeneratorModule, declarations: [WordlistGeneratorComponent], imports: [CommonModule,
|
|
213
|
-
BrowserModule,
|
|
214
|
-
BrowserAnimationsModule,
|
|
215
|
-
DragDropModule,
|
|
216
|
-
ReactiveFormsModule,
|
|
217
|
-
ClipboardModule,
|
|
218
|
-
MatFormFieldModule,
|
|
219
|
-
MatIconModule,
|
|
220
|
-
MatInputModule,
|
|
221
|
-
MatMenuModule,
|
|
222
|
-
MatButtonModule], exports: [WordlistGeneratorComponent] });
|
|
223
|
-
WordlistGeneratorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: WordlistGeneratorModule, providers: [WordlistGeneratorService], imports: [CommonModule,
|
|
224
|
-
BrowserModule,
|
|
225
|
-
BrowserAnimationsModule,
|
|
226
|
-
DragDropModule,
|
|
227
|
-
ReactiveFormsModule,
|
|
228
|
-
ClipboardModule,
|
|
229
|
-
MatFormFieldModule,
|
|
230
|
-
MatIconModule,
|
|
231
|
-
MatInputModule,
|
|
232
|
-
MatMenuModule,
|
|
233
|
-
MatButtonModule] });
|
|
234
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: WordlistGeneratorModule, decorators: [{
|
|
235
|
-
type: NgModule,
|
|
236
|
-
args: [{
|
|
237
|
-
declarations: [WordlistGeneratorComponent],
|
|
238
|
-
imports: [
|
|
239
|
-
CommonModule,
|
|
240
|
-
BrowserModule,
|
|
241
|
-
BrowserAnimationsModule,
|
|
242
|
-
DragDropModule,
|
|
243
|
-
ReactiveFormsModule,
|
|
244
|
-
ClipboardModule,
|
|
245
|
-
MatFormFieldModule,
|
|
246
|
-
MatIconModule,
|
|
247
|
-
MatInputModule,
|
|
248
|
-
MatMenuModule,
|
|
249
|
-
MatButtonModule
|
|
250
|
-
],
|
|
251
|
-
exports: [WordlistGeneratorComponent],
|
|
252
|
-
providers: [WordlistGeneratorService]
|
|
253
|
-
}]
|
|
254
|
-
}] });
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Generated bundle index. Do not edit.
|
|
258
|
-
*/
|
|
259
|
-
|
|
260
|
-
export { WordlistGeneratorComponent, WordlistGeneratorModule };
|
|
261
|
-
//# sourceMappingURL=tehw0lf-wordlist-generator.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tehw0lf-wordlist-generator.mjs","sources":["../../../../libs/wordlist-generator/src/lib/filetypes.ts","../../../../libs/wordlist-generator/src/lib/parsers.ts","../../../../libs/wordlist-generator/src/lib/wordlist-generator.service.ts","../../../../libs/wordlist-generator/src/lib/wordlist-generator.component.ts","../../../../libs/wordlist-generator/src/lib/wordlist-generator.component.html","../../../../libs/wordlist-generator/src/lib/wordlist-generator.module.ts","../../../../libs/wordlist-generator/src/tehw0lf-wordlist-generator.ts"],"sourcesContent":["/* eslint-disable no-shadow */\nexport enum FileType {\n plaintext = 'txt',\n xml = 'xml'\n}\n","export const toPlaintext = (\n wordlist: string\n): { wordlist: string; contentType: string } => ({\n wordlist,\n contentType: 'text/plain'\n});\n\nexport const toXML = (\n wordlist: string\n): { wordlist: string; contentType: string } => {\n const head = '<wordlist><word>';\n const glue = '</word><word>';\n const tail = '</word></wordlist>';\n return {\n wordlist: head + wordlist.replace(/\\n/g, glue) + tail,\n contentType: 'text/xml'\n };\n};\n","import { Injectable } from '@angular/core';\nimport { product } from 'cartesian-product-generator';\nimport { from, Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class WordlistGeneratorService {\n constructor() {\n //\n }\n\n generateWordlist(...charsets: string[]): Observable<string> {\n return from(product(...charsets)).pipe(\n map((word: string[]) => {\n return word.join('');\n })\n );\n }\n}\n","import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';\nimport { Component, Input, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';\nimport { UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';\nimport { Observable, Subject } from 'rxjs';\nimport { reduce, takeUntil, tap } from 'rxjs/operators';\n\nimport { FileType } from './filetypes';\nimport { toPlaintext, toXML } from './parsers';\nimport { WordlistGeneratorService } from './wordlist-generator.service';\n\n/* eslint-disable @angular-eslint/component-selector */\n@Component({\n selector: 'wordlist-generator',\n templateUrl: './wordlist-generator.component.html',\n styleUrls: ['./wordlist-generator.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class WordlistGeneratorComponent implements OnInit, OnDestroy {\n @Input() buttonStyle = {\n 'background-color': '#333333',\n color: '#cc7832'\n };\n\n @Input() dragStyle = { color: '#cc7832' };\n @Input() textStyle = { color: '#cc7832' };\n\n charsetForm: UntypedFormGroup | undefined;\n wordsGenerated: number | undefined;\n wordlist$: Observable<string> | undefined;\n\n displayWordlist = false;\n fileType = FileType.plaintext;\n fileTypes = Object.values(FileType);\n filteredCharset: string[] = [];\n prefix = '';\n suffix = '';\n\n private unsubscribe$ = new Subject<void>();\n\n constructor(\n private formBuilder: UntypedFormBuilder,\n private wordlistGenerator: WordlistGeneratorService\n ) {}\n\n ngOnInit(): void {\n this.generateForm();\n }\n\n ngOnDestroy(): void {\n this.unsubscribe$.next();\n this.unsubscribe$.complete();\n }\n\n get charsets(): UntypedFormArray | undefined {\n if (this.charsetForm) {\n return this.charsetForm.get('charsets') as UntypedFormArray;\n }\n return undefined;\n }\n\n addCharset(): void {\n if (this.charsets) {\n this.charsets.push(this.formBuilder.control('', Validators.required));\n }\n }\n\n cloneCharset(index: number): void {\n if (this.charsets) {\n const charset = this.charsets.value[index];\n this.charsets.insert(\n index,\n this.formBuilder.control(charset, Validators.required)\n );\n }\n }\n\n downloadWordlist(): void {\n if (this.charsets) {\n if (this.filteredCharset !== this.filterCharset(this.charsets.value)) {\n this.generateWordlist();\n }\n const filename = `wordlist_${this.wordsGenerated}_words_${this.charsets.length}_positions.${this.fileType}`;\n this.getWordlist()\n .pipe(\n tap((wordlist: string) => {\n if (wordlist.length > 0) {\n const parsed = this.parseWordlist(wordlist);\n const file = new Blob([parsed.wordlist], {\n type: parsed.contentType\n });\n if ((window.navigator as any).msSaveOrOpenBlob) {\n (window.navigator as any).msSaveOrOpenBlob(file, filename);\n } else {\n const a = document.createElement('a');\n const url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(() => {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n }\n }\n })\n )\n .subscribe();\n }\n }\n\n drop(event: CdkDragDrop<string[]>): void {\n if (this.charsets) {\n moveItemInArray(\n this.charsets.controls,\n event.previousIndex,\n event.currentIndex\n );\n this.charsets.updateValueAndValidity();\n }\n }\n\n generateForm(): void {\n this.charsetForm = this.formBuilder.group({\n charsets: this.formBuilder.array([\n this.formBuilder.control('', Validators.required)\n ]),\n prefix: this.formBuilder.control(''),\n suffix: this.formBuilder.control('')\n });\n }\n\n generateWordlist(): void {\n if (this.charsetForm && this.charsets && this.charsets.valid) {\n this.filteredCharset = this.filterCharset(this.charsets.value);\n this.prefix = this.charsetForm.get('prefix')?.value\n ? this.charsetForm.get('prefix')?.value\n : '';\n this.suffix = this.charsetForm.get('suffix')?.value\n ? this.charsetForm.get('suffix')?.value\n : '';\n\n this.wordsGenerated = this.filteredCharset\n .map((charset: string) => charset.length)\n .reduce(\n (previousLength: number, currentLength: number) =>\n previousLength * currentLength\n );\n this.displayWordlist = this.wordsGenerated <= 100;\n this.wordlist$ = this.getWordlist();\n }\n }\n\n getWordlist(): Observable<string> {\n return this.wordlistGenerator\n .generateWordlist(...this.filteredCharset)\n .pipe(\n reduce(\n (wordlist: string, word: string) =>\n `${wordlist}${this.prefix}${word}${this.suffix}\\n`,\n ''\n ),\n takeUntil(this.unsubscribe$)\n );\n }\n\n filterCharset(charsets: string[]): string[] {\n return charsets.map((charset: string) => this.removeDuplicates(charset));\n }\n\n parseWordlist(wordlist: string): { wordlist: string; contentType: string } {\n switch (this.fileType) {\n case FileType.plaintext:\n return toPlaintext(wordlist);\n case FileType.xml:\n return toXML(wordlist);\n }\n }\n\n removeCharset(i: number): void {\n if (this.charsets && this.charsets.length > 1) {\n this.charsets.removeAt(i);\n }\n }\n\n removeDuplicates = (unfiltered: string): string =>\n [...new Set(unfiltered)].join('');\n}\n","<div class=\"meta-container\" fxLayout=\"row wrap\">\n <div class=\"form-container\" fxLayout=\"column\" fxFlex>\n <div fxLayout=\"row wrap\">\n <button\n class=\"generate-wordlist\"\n [ngStyle]=\"buttonStyle\"\n mat-raised-button\n (click)=\"generateWordlist()\"\n >\n Generate wordlist\n </button>\n <button\n class=\"choose-format\"\n [ngStyle]=\"buttonStyle\"\n mat-raised-button\n [matMenuTriggerFor]=\"menu\"\n *ngIf=\"wordlist$\"\n >\n Choose format\n </button>\n <mat-menu #menu=\"matMenu\">\n <button\n [ngStyle]=\"buttonStyle\"\n mat-menu-item\n *ngFor=\"let type of fileTypes\"\n (click)=\"fileType = type\"\n >\n {{ type }}\n </button>\n </mat-menu>\n <button\n class=\"download-wordlist\"\n [ngStyle]=\"buttonStyle\"\n mat-raised-button\n *ngIf=\"wordlist$\"\n (click)=\"downloadWordlist()\"\n >\n Download as\n <ng-container *ngIf=\"this.fileType\">{{ this.fileType }}</ng-container>\n </button>\n </div>\n <form *ngIf=\"charsetForm\" [formGroup]=\"charsetForm\">\n <mat-form-field class=\"fixed-width\" appearance=\"outline\">\n <mat-label [ngStyle]=\"textStyle\">prefix (optional)</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n type=\"text\"\n id=\"prefix\"\n formControlName=\"prefix\"\n (keydown.enter)=\"$event.preventDefault()\"\n />\n </mat-form-field>\n <div formArrayName=\"charsets\">\n <div class=\"charset\"></div>\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <div\n class=\"charset-container\"\n cdkDrag\n *ngFor=\"let charset of charsets?.controls; let i = index\"\n >\n <mat-icon class=\"drag-indicator\" [ngStyle]=\"dragStyle\"\n >drag_indicator</mat-icon\n >\n <mat-form-field class=\"charset\" appearance=\"outline\">\n <mat-label [ngStyle]=\"textStyle\">\n character set for string position {{ i }}\n </mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n type=\"text\"\n id=\"position-{{ i }}\"\n [formControlName]=\"i\"\n (keydown.enter)=\"$event.preventDefault()\"\n required\n />\n </mat-form-field>\n <button\n mat-raised-button\n class=\"clone-charset\"\n [ngStyle]=\"buttonStyle\"\n (click)=\"cloneCharset(i)\"\n >\n <mat-icon>content_copy</mat-icon>\n </button>\n <button\n mat-raised-button\n class=\"remove-charset\"\n [ngStyle]=\"buttonStyle\"\n (click)=\"removeCharset(i)\"\n [disabled]=\"this.charsets?.value.length === 1\"\n >\n <mat-icon>remove</mat-icon>\n </button>\n <button\n mat-raised-button\n [ngStyle]=\"buttonStyle\"\n (click)=\"addCharset()\"\n >\n <mat-icon>add</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <mat-form-field class=\"fixed-width\" appearance=\"outline\">\n <mat-label [ngStyle]=\"textStyle\">suffix (optional)</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n type=\"text\"\n id=\"suffix\"\n formControlName=\"suffix\"\n (keydown.enter)=\"$event.preventDefault()\"\n />\n </mat-form-field>\n </form>\n </div>\n <div class=\"wordlist-container\" *ngIf=\"wordlist$\" fxLayout=\"column\" fxFlex>\n <ng-container *ngIf=\"displayWordlist; else wordlistTooLarge\">\n <h3 class=\"wordlist-header\">Generated wordlist:</h3>\n <code class=\"wordlist\">\n {{ wordlist$ | async }}\n </code></ng-container\n >\n <ng-template #wordlistTooLarge>\n The generated wordlist is too large to be displayed. You can still\n download it.\n </ng-template>\n </div>\n</div>\n","import { ClipboardModule } from '@angular/cdk/clipboard';\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\n\nimport { WordlistGeneratorComponent } from './wordlist-generator.component';\nimport { WordlistGeneratorService } from './wordlist-generator.service';\n\n@NgModule({\n declarations: [WordlistGeneratorComponent],\n imports: [\n CommonModule,\n BrowserModule,\n BrowserAnimationsModule,\n DragDropModule,\n ReactiveFormsModule,\n ClipboardModule,\n MatFormFieldModule,\n MatIconModule,\n MatInputModule,\n MatMenuModule,\n MatButtonModule\n ],\n exports: [WordlistGeneratorComponent],\n providers: [WordlistGeneratorService]\n})\nexport class WordlistGeneratorModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2.WordlistGeneratorService"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA,IAAY,QAGX,CAAA;AAHD,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,WAAA,CAAA,GAAA,KAAiB,CAAA;AACjB,IAAA,QAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACb,CAAC,EAHW,QAAQ,KAAR,QAAQ,GAGnB,EAAA,CAAA,CAAA;;ACJM,MAAM,WAAW,GAAG,CACzB,QAAgB,MAC+B;IAC/C,QAAQ;AACR,IAAA,WAAW,EAAE,YAAY;AAC1B,CAAA,CAAC,CAAC;AAEI,MAAM,KAAK,GAAG,CACnB,QAAgB,KAC6B;IAC7C,MAAM,IAAI,GAAG,kBAAkB,CAAC;IAChC,MAAM,IAAI,GAAG,eAAe,CAAC;IAC7B,MAAM,IAAI,GAAG,oBAAoB,CAAC;IAClC,OAAO;AACL,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,0BAA0B,CAAC;AAC1C,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,aAAa;wBACb,uBAAuB;wBACvB,cAAc;wBACd,mBAAmB;wBACnB,eAAe;wBACf,kBAAkB;wBAClB,aAAa;wBACb,cAAc;wBACd,aAAa;wBACb,eAAe;AAChB,qBAAA;oBACD,OAAO,EAAE,CAAC,0BAA0B,CAAC;oBACrC,SAAS,EAAE,CAAC,wBAAwB,CAAC;AACtC,iBAAA,CAAA;;;ACjCD;;AAEG;;;;"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./wordlist-generator.component";
|
|
3
|
-
import * as i2 from "@angular/common";
|
|
4
|
-
import * as i3 from "@angular/platform-browser";
|
|
5
|
-
import * as i4 from "@angular/platform-browser/animations";
|
|
6
|
-
import * as i5 from "@angular/cdk/drag-drop";
|
|
7
|
-
import * as i6 from "@angular/forms";
|
|
8
|
-
import * as i7 from "@angular/cdk/clipboard";
|
|
9
|
-
import * as i8 from "@angular/material/form-field";
|
|
10
|
-
import * as i9 from "@angular/material/icon";
|
|
11
|
-
import * as i10 from "@angular/material/input";
|
|
12
|
-
import * as i11 from "@angular/material/menu";
|
|
13
|
-
import * as i12 from "@angular/material/button";
|
|
14
|
-
export declare class WordlistGeneratorModule {
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<WordlistGeneratorModule, never>;
|
|
16
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<WordlistGeneratorModule, [typeof i1.WordlistGeneratorComponent], [typeof i2.CommonModule, typeof i3.BrowserModule, typeof i4.BrowserAnimationsModule, typeof i5.DragDropModule, typeof i6.ReactiveFormsModule, typeof i7.ClipboardModule, typeof i8.MatFormFieldModule, typeof i9.MatIconModule, typeof i10.MatInputModule, typeof i11.MatMenuModule, typeof i12.MatButtonModule], [typeof i1.WordlistGeneratorComponent]>;
|
|
17
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<WordlistGeneratorModule>;
|
|
18
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
|
-
"schematics": {
|
|
4
|
-
"ng-add": {
|
|
5
|
-
"description": "Add wordlist-generator library to the project if material is installed.",
|
|
6
|
-
"factory": "./ng-add/index",
|
|
7
|
-
"schema": "./ng-add/schema.json"
|
|
8
|
-
},
|
|
9
|
-
"ng-add-setup": {
|
|
10
|
-
"description": "Install dependencies and add the library to the project",
|
|
11
|
-
"private": true,
|
|
12
|
-
"factory": "./ng-add/setup",
|
|
13
|
-
"schema": "./ng-add/schema.json"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
13
|
-
const schematics_1 = require("@angular/cdk/schematics");
|
|
14
|
-
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
|
15
|
-
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
16
|
-
const workspace_models_1 = require("@schematics/angular/utility/workspace-models");
|
|
17
|
-
const package_config_1 = require("./package-config");
|
|
18
|
-
function default_1(options) {
|
|
19
|
-
return (host, context) => __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
const materialVersion = (0, package_config_1.getPackageVersionFromPackageJson)(host, '@angular/material');
|
|
21
|
-
const workspace = yield (0, workspace_1.getWorkspace)(host);
|
|
22
|
-
const project = (0, schematics_1.getProjectFromWorkspace)(workspace, options.project);
|
|
23
|
-
if (!project) {
|
|
24
|
-
(0, dependencies_1.removePackageJsonDependency)(host, '@tehw0lf/wordlist-generator');
|
|
25
|
-
context.logger.error(`No project specified and can not find default project ${project}`);
|
|
26
|
-
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
if (project.extensions.projectType !== workspace_models_1.ProjectType.Application) {
|
|
30
|
-
(0, dependencies_1.removePackageJsonDependency)(host, '@tehw0lf/wordlist-generator');
|
|
31
|
-
context.logger.error('This library needs to be added to an application project');
|
|
32
|
-
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (!materialVersion) {
|
|
36
|
-
(0, dependencies_1.removePackageJsonDependency)(host, '@tehw0lf/wordlist-generator');
|
|
37
|
-
context.logger.error(`@angular/material not found.
|
|
38
|
-
Please run 'ng add @angular/material' first`);
|
|
39
|
-
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
context.addTask(new tasks_1.RunSchematicTask('ng-add-setup', options));
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
exports.default = default_1;
|
|
46
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/wordlist-generator/schematics/ng-add/index.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,4DAA4F;AAC5F,wDAAkE;AAClE,2EAAuF;AACvF,qEAAqE;AACrE,mFAA2E;AAE3E,qDAAoE;AAGpE,mBAAyB,OAA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0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const testing_1 = require("@angular-devkit/schematics/testing");
|
|
13
|
-
const file_content_1 = require("../testing/file-content");
|
|
14
|
-
const test_app_1 = require("../testing/test-app");
|
|
15
|
-
const test_library_1 = require("../testing/test-library");
|
|
16
|
-
const testProjectName = 'test-project';
|
|
17
|
-
describe('ng-add-setup schematic with material present', () => {
|
|
18
|
-
let runner;
|
|
19
|
-
let appTree;
|
|
20
|
-
let errorOutput;
|
|
21
|
-
let warnOutput;
|
|
22
|
-
beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
runner = new testing_1.SchematicTestRunner('schematics', require.resolve('../collection.json'));
|
|
24
|
-
appTree = yield (0, test_app_1.createTestAppWithMaterial)(runner);
|
|
25
|
-
errorOutput = [];
|
|
26
|
-
warnOutput = [];
|
|
27
|
-
runner.logger.subscribe((e) => {
|
|
28
|
-
if (e.level === 'error') {
|
|
29
|
-
errorOutput.push(e.message);
|
|
30
|
-
}
|
|
31
|
-
else if (e.level === 'warn') {
|
|
32
|
-
warnOutput.push(e.message);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}));
|
|
36
|
-
it('should add the WordlistGeneratorModule to the project module', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
-
const tree = yield runner
|
|
38
|
-
.runSchematicAsync('ng-add-setup', { project: testProjectName }, appTree)
|
|
39
|
-
.toPromise();
|
|
40
|
-
const fileContent = (0, file_content_1.getFileContent)(tree, `/projects/${testProjectName}/src/app/app.module.ts`);
|
|
41
|
-
expect(fileContent).toContain('WordlistGeneratorModule');
|
|
42
|
-
}));
|
|
43
|
-
});
|
|
44
|
-
describe('ng-add schematic without material present', () => {
|
|
45
|
-
let runner;
|
|
46
|
-
let appTree;
|
|
47
|
-
let errorOutput;
|
|
48
|
-
let warnOutput;
|
|
49
|
-
beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
50
|
-
runner = new testing_1.SchematicTestRunner('schematics', require.resolve('../collection.json'));
|
|
51
|
-
appTree = yield (0, test_app_1.createTestApp)(runner);
|
|
52
|
-
errorOutput = [];
|
|
53
|
-
warnOutput = [];
|
|
54
|
-
runner.logger.subscribe((e) => {
|
|
55
|
-
if (e.level === 'error') {
|
|
56
|
-
errorOutput.push(e.message);
|
|
57
|
-
}
|
|
58
|
-
else if (e.level === 'warn') {
|
|
59
|
-
warnOutput.push(e.message);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}));
|
|
63
|
-
it('should fail to add module if material is missing', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
-
const tree = yield runner
|
|
65
|
-
.runSchematicAsync('ng-add', { project: testProjectName }, appTree)
|
|
66
|
-
.toPromise();
|
|
67
|
-
const fileContent = (0, file_content_1.getFileContent)(tree, `/projects/${testProjectName}/src/app/app.module.ts`);
|
|
68
|
-
expect(fileContent).not.toContain('WordlistGeneratorModule');
|
|
69
|
-
expect(errorOutput.length).toBe(1);
|
|
70
|
-
expect(warnOutput.length).toBe(0);
|
|
71
|
-
expect(errorOutput[0]).toMatch(`@angular/material not found.
|
|
72
|
-
Please run 'ng add @angular/material' first`);
|
|
73
|
-
}));
|
|
74
|
-
});
|
|
75
|
-
describe('ng-add schematic - library project', () => {
|
|
76
|
-
let runner;
|
|
77
|
-
let libraryTree;
|
|
78
|
-
let errorOutput;
|
|
79
|
-
let warnOutput;
|
|
80
|
-
beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
|
-
runner = new testing_1.SchematicTestRunner('schematics', require.resolve('../collection.json'));
|
|
82
|
-
libraryTree = yield (0, test_library_1.createTestLibrary)(runner);
|
|
83
|
-
errorOutput = [];
|
|
84
|
-
warnOutput = [];
|
|
85
|
-
runner.logger.subscribe((e) => {
|
|
86
|
-
if (e.level === 'error') {
|
|
87
|
-
errorOutput.push(e.message);
|
|
88
|
-
}
|
|
89
|
-
else if (e.level === 'warn') {
|
|
90
|
-
warnOutput.push(e.message);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
}));
|
|
94
|
-
it('should do nothing if a library project is targeted', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
95
|
-
yield runner
|
|
96
|
-
.runSchematicAsync('ng-add', { project: testProjectName }, libraryTree)
|
|
97
|
-
.toPromise();
|
|
98
|
-
expect(errorOutput.length).toBe(1);
|
|
99
|
-
expect(errorOutput[0]).toMatch('This library needs to be added to an application project');
|
|
100
|
-
}));
|
|
101
|
-
});
|
|
102
|
-
//# sourceMappingURL=index.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../../../libs/wordlist-generator/schematics/ng-add/index.spec.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,gEAAyE;AAEzE,0DAAyD;AACzD,kDAA+E;AAC/E,0DAA4D;AAE5D,MAAM,eAAe,GAAG,cAAc,CAAC;AAEvC,QAAQ,CAAC,8CAA8C,EAAE,GAAG,EAAE;IAC5D,IAAI,MAA2B,CAAC;IAChC,IAAI,OAAa,CAAC;IAClB,IAAI,WAAqB,CAAC;IAC1B,IAAI,UAAoB,CAAC;IAEzB,UAAU,CAAC,GAAS,EAAE;QACpB,MAAM,GAAG,IAAI,6BAAmB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B,CAAC;IAC1B,IAAI,UAAoB,CAAC;IAEzB,UAAU,CAAC,GAAS,EAAE;QACpB,MAAM,GAAG,IAAI,6BAAmB,CAC9B,YAAY,EACZ,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CACtC,CAAC;QACF,WAAW,GAAG,MAAM,IAAA,gCAAiB,EAAC,MAAM,CAAC,CAAC;QAE9C,WAAW,GAAG,EAAE,CAAC;QACjB,UAAU,GAAG,EAAE,CAAC;QAChB,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;YAC5B,IAAI,CAAC,CAAC,KAAK,KAAK,OAAO,EAAE;gBACvB,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;aAC7B;iBAAM,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,EAAE;gBAC7B,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;aAC5B;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAA,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,GAAS,EAAE;QAClE,MAAM,MAAM;aACT,iBAAiB,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE,WAAW,CAAC;aACtE,SAAS,EAAE,CAAC;QAEf,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAC5B,0DAA0D,CAC3D,CAAC;IACJ,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { Tree } from '@angular-devkit/schematics';
|
|
9
|
-
/** Adds a package to the package.json in the given host tree. */
|
|
10
|
-
export declare function addPackageToPackageJson(host: Tree, pkg: string, version: string): Tree;
|
|
11
|
-
/** Gets the version of the specified package by looking at the package.json in the given tree. */
|
|
12
|
-
export declare function getPackageVersionFromPackageJson(tree: Tree, name: string): string | null;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPackageVersionFromPackageJson = exports.addPackageToPackageJson = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Sorts the keys of the given object.
|
|
6
|
-
* @returns A new object instance with sorted keys
|
|
7
|
-
*/
|
|
8
|
-
function sortObjectByKeys(obj) {
|
|
9
|
-
return Object.keys(obj)
|
|
10
|
-
.sort()
|
|
11
|
-
.reduce((result, key) => {
|
|
12
|
-
result[key] = obj[key];
|
|
13
|
-
return result;
|
|
14
|
-
}, {});
|
|
15
|
-
}
|
|
16
|
-
/** Adds a package to the package.json in the given host tree. */
|
|
17
|
-
function addPackageToPackageJson(host, pkg, version) {
|
|
18
|
-
if (host.exists('package.json')) {
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
20
|
-
const sourceText = host.read('package.json').toString('utf-8');
|
|
21
|
-
const json = JSON.parse(sourceText);
|
|
22
|
-
if (!json.dependencies) {
|
|
23
|
-
json.dependencies = {};
|
|
24
|
-
}
|
|
25
|
-
if (!json.dependencies[pkg]) {
|
|
26
|
-
json.dependencies[pkg] = version;
|
|
27
|
-
json.dependencies = sortObjectByKeys(json.dependencies);
|
|
28
|
-
}
|
|
29
|
-
host.overwrite('package.json', JSON.stringify(json, null, 2));
|
|
30
|
-
}
|
|
31
|
-
return host;
|
|
32
|
-
}
|
|
33
|
-
exports.addPackageToPackageJson = addPackageToPackageJson;
|
|
34
|
-
/** Gets the version of the specified package by looking at the package.json in the given tree. */
|
|
35
|
-
function getPackageVersionFromPackageJson(tree, name) {
|
|
36
|
-
if (!tree.exists('package.json')) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
const packageJson = JSON.parse(
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
41
|
-
tree.read('package.json').toString('utf8'));
|
|
42
|
-
if (packageJson.dependencies && packageJson.dependencies[name]) {
|
|
43
|
-
return packageJson.dependencies[name];
|
|
44
|
-
}
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
exports.getPackageVersionFromPackageJson = getPackageVersionFromPackageJson;
|
|
48
|
-
//# sourceMappingURL=package-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-config.js","sourceRoot":"","sources":["../../../../../libs/wordlist-generator/schematics/ng-add/package-config.ts"],"names":[],"mappings":";;;AAaA;;;GAGG;AACH,SAAS,gBAAgB,CAAC,GAA2B;IACnD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;SACpB,IAAI,EAAE;SACN,MAAM,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;QACtB,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,EAA4B,CAAC,CAAC;AACrC,CAAC;AAED,iEAAiE;AACjE,SAAgB,uBAAuB,CACrC,IAAU,EACV,GAAW,EACX,OAAe;IAEf,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;QAC/B,oEAAoE;QACpE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAgB,CAAC;QAEnD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACtB,IAAI,CAAC,YAAY,GAAG,EAAE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