Skip to content

Latest commit

 

History

History
256 lines (182 loc) · 5.74 KB

CHANGELOG.md

File metadata and controls

256 lines (182 loc) · 5.74 KB

chaca@1.9.0

🌚 Features

  • 🎉 Add pick field 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%
  • 🗑️ Video schema was deleted
  • 🗑️ The constants in Image schema were removed

chaca@1.7.2

🪛 Fix

  • Fix problems with zip exportation in python and postgresql formats
  • Fix Internet.password schema

chaca@1.7.1

🌚 Features

  • Add export configurations to all formats (java | csv | typescript | json | javascript | yaml | postgresql | python)

chaca@1.7.0

🪛 Fix

  • Fix some problems with sequence fields configuration
  • Upgrade error messages

🌚 Features

  • Add conditional value function to possibleNull configuration

    const 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 to enum 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 and csv extensions

    chaca.export(data, {
      fileName: "Data",
      localtion: "./data",
      format: { ext: "json", zip: false, separate: true },
    });

chaca@1.6.3

🪛 Fix

  • 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

chaca@1.6.2

🪛 Fix

  • Change internet.userName to internet.username
  • Fix intener.username and internet.email values generator

chaca@1.6.1

🌚 Features

  • Add browser, oauthProvider, locale, emailProvider options in internet schema
  • Add more values for the protocol option in internet schema
  • Add transaction, subscriptionPlan options in finance schema
  • Add more values for manufacturer and model options in vehicle schema
  • Add language option in person schema

🪛 Fix

  • Allow possibleNull config for sequence and sequential fields
  • Add more results for internet.userName

chaca@1.6.0

🌚 Features

  • Add CLI commands for export dataset from schemas configuration file

  • 🐍 Add Python code generator

  • Add loop configuration in chaca.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
});

🪛 Fix

  • Allow 0 as a possible value for the isArray parameter
  • Interfaces referring to isArray and possibleNull configurations are now accessible
  • Change posibleNull to possibleNull 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

chaca@1.5.1

🪛 Fix

  • Fix extra blank space in PersonSchema.fullName string generation

chaca@1.5.0

🌚 Features

Fields

  • Add sequence field
  • Add sequential field
  • Add ref field
  • Add key field
  • Add enum field

Schemas

  • Add ColorSchema
  • Delete numberRow from IdSchema

Utils

  • Add utils.sumDateRange to change dates by range

Generators

  • 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

🪛 Fix

Generators

  • Now you can export any type of data in all extensions

Utils

  • Fix utils.camelCase

chaca@1.1.0

  • Add YAML code generator
  • Fix Internet.email schema error
  • Fix Person.fullName schema error
  • Remove chaca.exportAll method

chaca@1.0.0

  • Initial release