{"id":16003142,"url":"https://github.com/mauriciolauffer/cap-js-mockdata","last_synced_at":"2025-03-18T01:31:46.836Z","repository":{"id":232812602,"uuid":"750191355","full_name":"mauriciolauffer/cap-js-mockdata","owner":"mauriciolauffer","description":"SAP CAP plugin to generate mock data.","archived":false,"fork":false,"pushed_at":"2024-07-01T07:25:13.000Z","size":136,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-26T20:02:36.555Z","etag":null,"topics":["cap","cap-js","cds-plugin","data","faker","mock","mockdata","nodejs","plugin","sap","sap-cap"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mauriciolauffer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"mauriciolauffer"}},"created_at":"2024-01-30T06:50:31.000Z","updated_at":"2025-01-20T12:56:35.000Z","dependencies_parsed_at":"2024-04-11T16:25:24.377Z","dependency_job_id":"ec2cee4d-f0cf-45c7-b53e-af6db68c11d9","html_url":"https://github.com/mauriciolauffer/cap-js-mockdata","commit_stats":null,"previous_names":["mauriciolauffer/cap-js-mockdata"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauriciolauffer%2Fcap-js-mockdata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauriciolauffer%2Fcap-js-mockdata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauriciolauffer%2Fcap-js-mockdata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauriciolauffer%2Fcap-js-mockdata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mauriciolauffer","download_url":"https://codeload.github.com/mauriciolauffer/cap-js-mockdata/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243894467,"owners_count":20365036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cap","cap-js","cds-plugin","data","faker","mock","mockdata","nodejs","plugin","sap","sap-cap"],"created_at":"2024-10-08T10:06:28.255Z","updated_at":"2025-03-18T01:31:46.586Z","avatar_url":"https://github.com/mauriciolauffer.png","language":"JavaScript","funding_links":["https://github.com/sponsors/mauriciolauffer"],"categories":["Libraries, Extensions, Plugins"],"sub_categories":[],"readme":"# SAP CAP Mockdata Plugin\n\n[![npm](https://img.shields.io/npm/v/cap-js-mockdata)](https://www.npmjs.com/package/cap-js-mockdata) [![test](https://github.com/mauriciolauffer/cap-js-mockdata/actions/workflows/test.yml/badge.svg)](https://github.com/mauriciolauffer/cap-js-mockdata/actions/workflows/test.yml)\n\nA [SAP CAP plugin](https://cap.cloud.sap/docs/node.js/cds-plugins) to generate CSV files populated with mock data for testing.\n\nThis plugin uses [Faker](https://fakerjs.dev/) to generate meaningful mock data both automatically and through annotations.\n\n## Setup\n\nAll you need to do is to install the plugin and add the `@Mockdata` annotations to your entities.\n\n### Installation\n\nInstall the plugin as an npm module:\n\n```shell\nnpm i -D cap-js-mockdata\n```\n\n### Annotation\n\nThe annotation tag is `@Mockdata`. You can add and combine all valid [Faker module APIs](https://fakerjs.dev/api/).\n\n```js\n// db/schema.cds\n\nentity Customers : cuid, managed {\n  name       String  @Mockdata: {person: 'fullName'};\n  sex        String  @Mockdata: {person: 'sex'};\n  creditCard String  @Mockdata: {finance: 'creditCardNumber'};\n  phone      String  @Mockdata: {phone: 'number'};\n  ipAddress  String  @Mockdata: {internet: 'ipv4'};\n  email      String  @Mockdata: {internet: 'email'};\n  street     String  @Mockdata: {location: 'streetAddress'};\n  country    String  @Mockdata: {location: 'countryCode'};\n};\n```\n\n### Using\n\nOnce you have installed the plugin and added the annotations, or not, you can execute the following command in a terminal:\n\n```shell\ncds add mockdata\n```\n\nThe `cds add mockdata` command will create CSV files for every supported CDS Entity. The CSV files will be created into the `db/data` folder, the filenames will be something like `namespace-entityName.csv` and their content will look like:\n\n|ID                                  |createdAt                                                 |createdBy      |modifiedAt                                                |modifiedBy             |name              |sex   |creditCard              |phone              |ipAddress      |email                        |street             |country                |\n|------------------------------------|----------------------------------------------------------|---------------|----------------------------------------------------------|-----------------------|------------------|------|------------------------|-------------------|---------------|-----------------------------|-------------------|-----------------------|\n|bef3c7b8-1232-4860-bded-efd51443e508|Sun Oct 06 2024 15:55:24 GMT-0300 (Brasilia Standard Time)|Julius_Hintz48 |Sun Nov 03 2024 14:38:56 GMT-0300 (Brasilia Standard Time)|Brain_Mosciski         |Edgar Langosh     |female|3564-4519-0923-7387     |801.226.6645 x01258|214.155.102.159|Marcellus.Fritsch@hotmail.com|640 Bramley Close  |Austria                |\n|96ac7211-691a-4c2a-8fc0-0ae509693193|Thu Mar 28 2024 20:32:35 GMT-0300 (Brasilia Standard Time)|Clotilde_DAmore|Thu Nov 23 2023 10:49:44 GMT-0300 (Brasilia Standard Time)|Brendan.Corwin-Schinner|Erica McDermott   |male  |6567-6280-8822-5389-0611|(240) 938-1223     |37.230.118.100 |Shayne78@gmail.com           |1803 Feeney Park   |Cocos (Keeling) Islands|\n|4fc525bc-e22b-4c55-a447-0e4c9fef1ffd|Fri Feb 09 2024 15:21:45 GMT-0300 (Brasilia Standard Time)|Lance78        |Fri Feb 14 2025 05:25:29 GMT-0300 (Brasilia Standard Time)|Donny_Blanda           |Joseph Lehner     |male  |4686210527760           |312-939-7109       |14.207.231.127 |Daija_Oberbrunner94@gmail.com|79422 Collin Divide|Portugal               |\n|872b47a8-0bb1-47af-bc02-ef7290cff633|Sat Feb 22 2025 01:34:16 GMT-0300 (Brasilia Standard Time)|Mateo22        |Sun Sep 15 2024 18:42:41 GMT-0300 (Brasilia Standard Time)|Myrtle52               |Leigh Wintheiser I|male  |6759-2563-9161-5976     |553.277.9724 x231  |10.88.166.234  |Elyssa.Adams79@gmail.com     |139 Park Drive     |Macao                  |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauriciolauffer%2Fcap-js-mockdata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmauriciolauffer%2Fcap-js-mockdata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauriciolauffer%2Fcap-js-mockdata/lists"}