- 🎉 Add
pick
field to choose unique elements from an array
- 🎉 Data creation times have been reduced by 20%
- 🎉 The bundle size has been reduced by 50%
- 🗑️
Video
schema was deleted - 🗑️ The
constants
inImage
schema were removed
- Fix problems with zip exportation in
python
andpostgresql
formats - Fix
Internet.password
schema
- Add export configurations to all formats (
java
|csv
|typescript
|json
|javascript
|yaml
|postgresql
|python
)
- Fix some problems with
sequence
fields configuration - Upgrade error messages
-
Add conditional value function to
possibleNull
configurationconst schema = chaca.schema({ age: schemas.dataType.int({ min: 18, max: 90 }), actual_school_year: { type: schemas.dataType.int({ min: 10, max: 15 }), possibleNull: ({ currentFields, store }) => { if (currentFields.age > 25) { return 90; // If the age is greater than 25 years, there will be a 90% probability that the field will be null } else { return 15; // Will be a 15% probability that the field will be null; } }, }, });
-
Add
probability
field as alternative toenum
field// Simple definition const schema = chaca.schema({ prob: chaca.probability([ { chance: 0.9, value: 10 }, // There is a 90% chance of choosing the value 10 { chance: 0.5, value: 5 }, // There is a 50% chance of choosing the value 5 { chance: 0.1, value: 1 }, // There is a 10% chance of choosing the value 1 ]), }); // Conditional definition const schema = chaca.schema({ test: schemas.dataType.int({ min: 0, max: 10 }), prob: chaca.probability([ { chance: ({ currentFields, store }) => { if (currentFields.test > 5) { return 0.9; } else { return 0.2; } }, value: 10, }, { chance: 0.5, value: 5 }, { chance: 0.1, value: 1 }, ]), });
-
Add export configurations for
json
,java
andcsv
extensionschaca.export(data, { fileName: "Data", localtion: "./data", format: { ext: "json", zip: false, separate: true }, });
-
Add more information of fields routes in exceptions
-
Add new exception
NotExistFieldError
const dataset1 = chaca.schema({ id: chaca.key(schemas.id.uuid()), }); const dataset2 = chaca.schema({ id: chaca.ref("Dataset1.customId"), // not exist that field }); const data = chaca.multiGenerate([ { name: "Dataset1", documents: 30, schema: dataset1 }, { name: "Dataset2", documents: 30, schema: dataset2 }, ]); // throw a NotExistFieldError because 'customId' not exist
- Change
internet.userName
tointernet.username
- Fix
intener.username
andinternet.email
values generator
- Add
browser
,oauthProvider
,locale
,emailProvider
options ininternet
schema - Add more values for the
protocol
option ininternet
schema - Add
transaction
,subscriptionPlan
options infinance
schema - Add more values for
manufacturer
andmodel
options invehicle
schema - Add
language
option inperson
schema
- Allow
possibleNull
config for sequence and sequential fields - Add more results for
internet.userName
-
Add CLI commands for export dataset from schemas configuration file
-
🐍 Add Python code generator
-
Add
loop
configuration inchaca.sequential
field
// Before
const schema = chaca.schema({
favoriteNumber: chaca.sequential([1, 2, 3]),
});
schema.generate(5); // Throws an error because there are only 3 values for 5 documents to create
// Now
const schema = chaca.schema({
favoriteNumbers: chaca.sequential([1, 2, 3], { loop: true }),
});
schema.generate(5);
/*
[
{ favoriteNumber: 1 },
{ favoriteNumber: 2 },
{ favoriteNumber: 3 },
{ favoriteNumber: 1 },
{ favoriteNumber: 2 },
];
*/
- Remove names from
schema field
declaration
// Before
const customField = chaca.schemaField("customField", (args) => {
// return value
});
// Now
const customField = chaca.schemaField((args) => {
// return value
});
- Allow 0 as a possible value for the
isArray
parameter - Interfaces referring to
isArray
andpossibleNull
configurations are now accessible - Change
posibleNull
topossibleNull
in 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
- Fix extra blank space in
PersonSchema.fullName
string generation
- Add
sequence field
- Add
sequential field
- Add
ref field
- Add
key field
- Add
enum field
- Add
ColorSchema
- Delete
numberRow
fromIdSchema
- Add
utils.sumDateRange
to change dates by range
- Add
PostgreSQL
code generator - Add
chaca.multiGenerate
to generate relational schemas data - Add
chaca.exportFromSchemas
to export and generate relational schemas data - Add
schema.generateObject
to generate single object of data schema
- Now you can export any type of data in all extensions
- Fix
utils.camelCase
- Add YAML code generator
- Fix
Internet.email
schema error - Fix
Person.fullName
schema error - Remove
chaca.exportAll
method
- Initial release