-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove lock * change scope * rename package * change lock * readme * remove logs * compose * new
- Loading branch information
Showing
78 changed files
with
1,149 additions
and
2,362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
"@datazar-cli/knex-processor": patch | ||
"@datazar-cli/anonymizers": patch | ||
"@datazar-cli/postgres": patch | ||
"@datazar-cli/mariadb": patch | ||
"@datazar-cli/sqlite": patch | ||
"@datazar-cli/processor": patch | ||
"@datazar-cli/mongo": patch | ||
"@datazar-cli/mssql": patch | ||
"datazar": patch | ||
"@datazar-cli/common": patch | ||
"@datazar-cli/csv": patch | ||
"@datazar-cli/cli": patch | ||
--- | ||
|
||
release new packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
@databye:registry=https://registry.npmjs.org | ||
@datazar-cli:registry=https://registry.npmjs.org | ||
//registry.npmjs.org/:_authToken=${NPM_TOKEN} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# @databye/anonymizers | ||
# @datazar-cli/anonymizers | ||
|
||
Part of [DataBye](https://www.npmjs.com/package/databye) package | ||
Part of [DataZar](https://www.npmjs.com/package/datazar) package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 38 additions & 38 deletions
76
packages/anonymizers/src/providers/base/base-anonymizer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
import { Anonymizer, ColumnType, ProviderType } from '@databye/common'; | ||
import { Anonymizer, ColumnType, ProviderType } from "@datazar-cli/common"; | ||
|
||
export abstract class BaseAnonymizer implements Anonymizer { | ||
abstract name: ProviderType; | ||
|
||
anonymizeString?(value: string): string; | ||
anonymizeNumber?(value: number): number; | ||
anonymizeBoolean?(value: boolean): boolean; | ||
|
||
anonymize(value: any, columnType?: ColumnType): any { | ||
switch (columnType) { | ||
case ColumnType.String: { | ||
if (this.anonymizeString) { | ||
return this.anonymizeString(value as string); | ||
} | ||
|
||
break; | ||
} | ||
|
||
case ColumnType.Number: { | ||
if (this.anonymizeNumber) { | ||
return this.anonymizeNumber(value as number); | ||
} | ||
|
||
break; | ||
} | ||
|
||
case ColumnType.Boolean: { | ||
if (this.anonymizeBoolean) { | ||
return this.anonymizeBoolean(value as boolean); | ||
} | ||
|
||
break; | ||
} | ||
|
||
default: { | ||
throw new Error('could not detect column type'); | ||
} | ||
} | ||
} | ||
abstract name: ProviderType; | ||
|
||
anonymizeString?(value: string): string; | ||
anonymizeNumber?(value: number): number; | ||
anonymizeBoolean?(value: boolean): boolean; | ||
|
||
anonymize(value: any, columnType?: ColumnType): any { | ||
switch (columnType) { | ||
case ColumnType.String: { | ||
if (this.anonymizeString) { | ||
return this.anonymizeString(value as string); | ||
} | ||
|
||
break; | ||
} | ||
|
||
case ColumnType.Number: { | ||
if (this.anonymizeNumber) { | ||
return this.anonymizeNumber(value as number); | ||
} | ||
|
||
break; | ||
} | ||
|
||
case ColumnType.Boolean: { | ||
if (this.anonymizeBoolean) { | ||
return this.anonymizeBoolean(value as boolean); | ||
} | ||
|
||
break; | ||
} | ||
|
||
default: { | ||
throw new Error("could not detect column type"); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
import { Anonymizer, ProviderType } from '@databye/common'; | ||
import { type FakeOptions } from '../fake/fake-options.js'; | ||
import { type MaskOptions } from '../mask/mask-options.js'; | ||
|
||
|
||
import { Anonymizer, ProviderType } from "@datazar-cli/common"; | ||
import { type FakeOptions } from "../fake/fake-options.js"; | ||
import { type MaskOptions } from "../mask/mask-options.js"; | ||
|
||
export type BaseProvider = { | ||
type: ProviderType; | ||
type: ProviderType; | ||
}; | ||
|
||
export type FakeProvider = { | ||
type: ProviderType.Fake; | ||
options?: FakeOptions; | ||
type: ProviderType.Fake; | ||
options?: FakeOptions; | ||
} & Anonymizer; | ||
|
||
export type MaskProvider = { | ||
type: ProviderType.Mask; | ||
options?: MaskOptions; | ||
type: ProviderType.Mask; | ||
options?: MaskOptions; | ||
} & Anonymizer; | ||
|
||
export type ScrambleProvider = { | ||
type: ProviderType.Scramble; | ||
options: undefined; | ||
type: ProviderType.Scramble; | ||
options: undefined; | ||
} & Anonymizer; | ||
|
||
export type Provider = FakeProvider | MaskProvider | ScrambleProvider; |
Oops, something went wrong.