Releases: hgomezrobaina/chaca
Release list
🎉 chaca@2.1.0
🌚 Features
-
All dataset, schema and dataset store operations are now async functions
-
You can define the number of documents to generate as a function that depends on the current state of the dataset.
chaca.dataset([ { name: "User", schema: userSchema, documents: 50, }, { name: "Writer", schema: writerSchema, documents: async ({ store }) => { const users = await store.get("User"); return users.filter((u) => u.role === "writer"); }, }, ]);
🪛 Fix
- Issues with
date.birthdategeneration problems were fixed
🎉 chaca@2.0.0
🌚 Features
Core
-
The
Datasetclass was created to export various schemas in a relational way -
You can now define the
isArrayparameter as a function that is executed when each document is created.const schema = chaca.schema({ image: { type: () => modules.image.people(), isArray: ({ currentFields, store }) => { return 5; // or return { min: 2, max: 10, }; }, }, });
-
Added exception
WrongPossibleNullDefinitionErrorfor errors in the definition of the parameterpossibleNull -
Added exception
WrongArrayDefinitionErrorfor errors in the definition of the parameterisArray -
Added exception
WrongProbabilityFieldDefinitionErrorfor errors in the definition ofprobabilityfields -
🗑️
chaca.multiGeneratewas removed -
🎉 The number of items to select in the
pickfield can be defined as a range of values or a function that returns the number of values to choose from.// range chaca.pick({ values: [1, 2, 3, 4, 5], count: { min: 1, max: 3, }, }); // function chaca.pick({ values: [1, 2, 3, 4, 5], count: ({ store, currentFields }) => { return 2; // or return { min: 1, max: 3, }; }, });
-
Added
nullOnEmptyparameter to avoidNotEnoughValuesForRefErrorexception -
The
reffields can reference the schema they are located in without causing a circular dependency. -
🎉 Added
Dataset.transform,Schema.transformandChaca.transformmethods to serialize data to a specific file format without having to export it -
🎉 Added new CLI commands
jsonpythonjavajsjsonpostgresqltsyaml
Modules
- 🎉 Added
datatype.octal - 🎉 Added
datatype.numeric - 🎉 Added
datatype.bigint - 🎉 Added
datatype.character - 🎉 Added
id.nanoid - 🎉 Added
id.ulid - 🎉 Added
id.cuid - 🎉 Added
image.category - 🎉 Added
color.human - 🎉 Added
date.anytime - 🎉 Added
finance.litecoinAddress - 🎉 Added
internet.ip - 🎉 Added
address.ordinalDirection - 🎉 Added
lorem.word - 🎉 Added
lorem.sentence - 🎉 Added
lorem.paragraph - 🎉 Added
person.zodiacSign - 🎉 Added
system.cron - 🎉 Added
address.longitude - 🎉 Added
address.latitude - The
prefixargument was added to thedatatype.alphaNumericmodule
Utils
- 🎉 Added
utils.pickto select elements from an array without being chosen more than once - 🎉 Added
utils.multipleTo create an array of values from a generator - 🎉 Added
bannedandsymbolsoptions onutils.replaceSymbols - 🗑️ Deleted
utils.capitalCamelCase - 🗑️ Deleted
utils.capitalize - 🗑️ Deleted
utils.capitalizeWord - 🎉 Added
utils.snakeCase - 🎉 Added
utils.dotCase - 🎉 Added
utils.sentenceCase - 🎉 Added
utils.capitalCase - 🎉 Added
utils.pascalCase
🪛 Fix
Core
-
🔄
DatasetStore.getValue->DatasetStore.get -
🔄 The
schemasconcept was changed tomodulesfor predefined functions -
🗑️ The
SchemaFieldclass and thechaca.schemaField()method are removed. The way to use the modules from now on is as follows// get a value modules.id.uuid(); // use on schemas const schema = chaca.schema({ id: () => modules.id.uuid(), });
-
Probability values for the
possibleNullparam must be in the range 0 to 1 now -
🔄
Schema.generate->Schema.array -
🔄
Schema.generateObject->Schema.object -
🔄
FileConfig.fileName->FileConfig.filename -
🔄
DatasetStore.getSchemaDocuments->DatasetStore.currentDocuments -
🔄
NotExistFieldError->NotExistRefFieldError -
🗑️ Removed
exportCLI command
Modules
- 🔄
modules.animal.animalType->modules.animal.type - 🔄
modules.image.animateAvatar->modules.image.animatedAvatar - 🔄
modules.id.mongodbID->modules.id.mongodbId
🎉 chaca@1.9.0
🌚 Features
- 🎉 Add
pickfield to choose unique elements from an array
🪛 Fix
- 🎉 Data creation times have been reduced by 20%
🎉 chaca@1.8.0
🌚 Features
- 🎉 The bundle size has been reduced by 50%
- 🗑️
Videoschema was deleted - 🗑️ The
constantsinImageschema were removed
chaca@1.7.1
🌚 Features
- Add export configurations for all formats (
java|csv|typescript|json|javascript|yaml|postgresql|python)
🎉 chaca@1.7.0
🪛 Fix
- Fix some problems with
sequencefields configuration - Upgrade error messages
🌚 Features
- Add conditional value function to
possibleNullconfiguration - Add
probabilityfield as alternative toenumfield - Add export configurations for
json,javaandcsvextensions
v.1.6.3
chaca@1.6.3
🪛 Fix
- Add more information of fields routes in exceptions
- Add new exception
NotExistFieldError
v.1.6.2
chaca@1.6.2
🪛 Fix
- Change
internet.userNametointernet.username - Fix
intener.usernameandinternet.emailvalues generator
v1.6.1
chaca@1.6.1
🌚 Features
- Add
browser,oauthProvider,locale,emailProvideroptions ininternetschema - Add more values for the
protocoloption ininternetschema - Add
transaction,subscriptionPlanoptions infinanceschema - Add more values for
manufacturerandmodeloptions invehicleschema - Add
languageoption inpersonschema
🪛 Fix
- Allow
possibleNullconfig for sequence and sequential fields - Add more results for
internet.userName
v1.6.0
🌚 Features
- Add CLI commands for export dataset from schemas configuration file
- 🐍 Add Python code generator
- Add
loopconfiguration inchaca.sequentialfield - Remove names from
schema fielddeclaration
🪛 Fix
- Allow 0 as a possible value for the
isArrayparameter - Interfaces referring to
isArrayandpossibleNullconfigurations are now accessible - Change
posibleNulltopossibleNullin schema configuration - The limit of documents to be generated by schema was eliminated
- Fix problems with CSV code generator
- Fix problems with Typescript code generator