Skip to content

Commit

Permalink
feat: lat and long fake (#486)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Heroux <[email protected]>
  • Loading branch information
hxtree authored Nov 1, 2023
1 parent df200ef commit af39fcf
Show file tree
Hide file tree
Showing 24 changed files with 166 additions and 56 deletions.
17 changes: 17 additions & 0 deletions libraries/faker-factory/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
{
"name": "@cats-cradle/faker-factory",
"entries": [
{
"version": "1.2.0",
"tag": "@cats-cradle/faker-factory_v1.2.0",
"date": "Wed, 01 Nov 2023 04:48:36 GMT",
"comments": {
"minor": [
{
"comment": "add support for additional decorator based fakes"
}
],
"dependency": [
{
"comment": "Updating dependency \"@cats-cradle/validation-schemas\" to `0.4.0`"
}
]
}
},
{
"version": "1.1.0",
"tag": "@cats-cradle/faker-factory_v1.1.0",
Expand Down
9 changes: 8 additions & 1 deletion libraries/faker-factory/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - @cats-cradle/faker-factory

This log was last generated on Sat, 28 Oct 2023 21:42:52 GMT and should not be manually modified.
This log was last generated on Wed, 01 Nov 2023 04:48:36 GMT and should not be manually modified.

## 1.2.0
Wed, 01 Nov 2023 04:48:36 GMT

### Minor changes

- add support for additional decorator based fakes

## 1.1.0
Sat, 28 Oct 2023 21:42:52 GMT
Expand Down
2 changes: 1 addition & 1 deletion libraries/faker-factory/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cats-cradle/faker-factory",
"version": "1.1.0",
"version": "1.2.0",
"main": "./dist/index.js",
"repository": {
"type": "git",
Expand Down
25 changes: 23 additions & 2 deletions libraries/faker-factory/src/__tests__/get-json-schemas.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// eslint-disable-next-line max-classes-per-file
import { Type } from 'class-transformer';
import { IsString, ValidateNested } from 'class-validator';
import { IsLongitude, IsString, ValidateNested } from 'class-validator';
import { IsDiceNotation } from '@cats-cradle/validation-schemas';
import { getJsonSchemas } from '../get-json-schemas';

Expand Down Expand Up @@ -39,7 +39,6 @@ describe('getJsonSchemas', () => {
@IsDiceNotation()
public property: string;
}
const testClass = new TestClass();
const schemas = getJsonSchemas();

expect(schemas).toMatchObject({
Expand All @@ -55,4 +54,26 @@ describe('getJsonSchemas', () => {
},
});
});

it('should get accurate pattern for schemas', async () => {
class Place {
@IsLongitude()
public property: string;
}

const schemas = getJsonSchemas();

expect(schemas).toMatchObject({
Place: {
properties: {
property: {
format: 'longitude',
type: 'string',
},
},
type: 'object',
required: ['property'],
},
});
});
});
32 changes: 0 additions & 32 deletions libraries/faker-factory/src/__tests__/get-schemas.test.ts

This file was deleted.

4 changes: 4 additions & 0 deletions libraries/faker-factory/src/__tests__/sample-class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
ValidateNested,
IsOptional,
Type,
IsLongitude,
} from '@cats-cradle/validation-schemas';

export enum SampleEnum {
Expand Down Expand Up @@ -53,6 +54,9 @@ export class SampleClass {
@IsFQDN()
public site: string;

@IsLongitude()
public longitude: string;

@IsString()
@Length(1, 10)
public min: string;
Expand Down
13 changes: 9 additions & 4 deletions libraries/faker-factory/src/get-json-schemas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'reflect-metadata';
import { ValidationTypes } from '@cats-cradle/validation-schemas';
import { validationMetadatasToSchemas } from 'class-validator-jsonschema';
import { defaultMetadataStorage } from 'class-transformer/cjs/storage';
import { SchemasObject } from 'openapi3-ts';
Expand All @@ -14,10 +15,14 @@ export function getJsonSchemas(): SchemasObject {
* {@link} https://www.npmjs.com/package/class-validator-jsonschema
*/
additionalConverters: {
// [ValidationTypes.IS_STRING]: {
// description: 'A string value',
// type: 'string',
// },
isLongitude: {
format: 'longitude',
type: 'string',
},
isLatitude: {
format: 'latitude',
type: 'string',
},
},
});
}
6 changes: 0 additions & 6 deletions libraries/faker-factory/src/get-schemas.ts

This file was deleted.

12 changes: 12 additions & 0 deletions libraries/nestjs-modules/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@cats-cradle/nestjs-modules",
"entries": [
{
"version": "0.2.6",
"tag": "@cats-cradle/nestjs-modules_v0.2.6",
"date": "Wed, 01 Nov 2023 04:48:36 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@cats-cradle/faker-factory\" to `1.2.0`"
}
]
}
},
{
"version": "0.2.5",
"tag": "@cats-cradle/nestjs-modules_v0.2.5",
Expand Down
7 changes: 6 additions & 1 deletion libraries/nestjs-modules/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @cats-cradle/nestjs-modules

This log was last generated on Sat, 28 Oct 2023 21:42:52 GMT and should not be manually modified.
This log was last generated on Wed, 01 Nov 2023 04:48:36 GMT and should not be manually modified.

## 0.2.6
Wed, 01 Nov 2023 04:48:36 GMT

_Version update only_

## 0.2.5
Sat, 28 Oct 2023 21:42:52 GMT
Expand Down
2 changes: 1 addition & 1 deletion libraries/nestjs-modules/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cats-cradle/nestjs-modules",
"version": "0.2.5",
"version": "0.2.6",
"main": "./dist/index.js",
"repository": {
"type": "git",
Expand Down
12 changes: 12 additions & 0 deletions libraries/validation-schemas/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@cats-cradle/validation-schemas",
"entries": [
{
"version": "0.4.0",
"tag": "@cats-cradle/validation-schemas_v0.4.0",
"date": "Wed, 01 Nov 2023 04:48:36 GMT",
"comments": {
"minor": [
{
"comment": "add support for lat and long"
}
]
}
},
{
"version": "0.3.1",
"tag": "@cats-cradle/validation-schemas_v0.3.1",
Expand Down
9 changes: 8 additions & 1 deletion libraries/validation-schemas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - @cats-cradle/validation-schemas

This log was last generated on Sat, 28 Oct 2023 21:42:52 GMT and should not be manually modified.
This log was last generated on Wed, 01 Nov 2023 04:48:36 GMT and should not be manually modified.

## 0.4.0
Wed, 01 Nov 2023 04:48:36 GMT

### Minor changes

- add support for lat and long

## 0.3.1
Sat, 28 Oct 2023 21:42:52 GMT
Expand Down
2 changes: 1 addition & 1 deletion libraries/validation-schemas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cats-cradle/validation-schemas",
"version": "0.3.1",
"version": "0.4.0",
"main": "./dist/index.js",
"license": "MIT",
"repository": {
Expand Down
1 change: 1 addition & 0 deletions libraries/validation-schemas/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export {
IsInstance,
IsLatitude,
IsLongitude,
ValidationTypes,
} from 'class-validator';

// work around for validating nested types
Expand Down
15 changes: 15 additions & 0 deletions services/authentication-service/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
{
"name": "@cats-cradle/authentication-service",
"entries": [
{
"version": "1.0.7",
"tag": "@cats-cradle/authentication-service_v1.0.7",
"date": "Wed, 01 Nov 2023 04:48:36 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@cats-cradle/nestjs-modules\" to `0.2.6`"
},
{
"comment": "Updating dependency \"@cats-cradle/faker-factory\" to `1.2.0`"
}
]
}
},
{
"version": "1.0.6",
"tag": "@cats-cradle/authentication-service_v1.0.6",
Expand Down
7 changes: 6 additions & 1 deletion services/authentication-service/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @cats-cradle/authentication-service

This log was last generated on Sat, 28 Oct 2023 21:42:52 GMT and should not be manually modified.
This log was last generated on Wed, 01 Nov 2023 04:48:36 GMT and should not be manually modified.

## 1.0.7
Wed, 01 Nov 2023 04:48:36 GMT

_Version update only_

## 1.0.6
Sat, 28 Oct 2023 21:42:52 GMT
Expand Down
2 changes: 1 addition & 1 deletion services/authentication-service/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cats-cradle/authentication-service",
"module": "commonjs",
"version": "1.0.6",
"version": "1.0.7",
"scripts": {
"dev": "nest start --debug --watch",
"build": "tsc",
Expand Down
15 changes: 15 additions & 0 deletions services/email-service/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
{
"name": "@cats-cradle/email-service",
"entries": [
{
"version": "0.0.14",
"tag": "@cats-cradle/email-service_v0.0.14",
"date": "Wed, 01 Nov 2023 04:48:36 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@cats-cradle/validation-schemas\" to `0.4.0`"
},
{
"comment": "Updating dependency \"@cats-cradle/faker-factory\" to `1.2.0`"
}
]
}
},
{
"version": "0.0.13",
"tag": "@cats-cradle/email-service_v0.0.13",
Expand Down
7 changes: 6 additions & 1 deletion services/email-service/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @cats-cradle/email-service

This log was last generated on Sat, 28 Oct 2023 21:42:52 GMT and should not be manually modified.
This log was last generated on Wed, 01 Nov 2023 04:48:36 GMT and should not be manually modified.

## 0.0.14
Wed, 01 Nov 2023 04:48:36 GMT

_Version update only_

## 0.0.13
Sat, 28 Oct 2023 21:42:52 GMT
Expand Down
2 changes: 1 addition & 1 deletion services/email-service/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cats-cradle/email-service",
"module": "commonjs",
"version": "0.0.13",
"version": "0.0.14",
"scripts": {
"dev": "nest start --debug --watch",
"build": "tsc",
Expand Down
12 changes: 12 additions & 0 deletions services/html-to-pdf/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@cats-cradle/html-to-pdf",
"entries": [
{
"version": "1.0.8",
"tag": "@cats-cradle/html-to-pdf_v1.0.8",
"date": "Wed, 01 Nov 2023 04:48:36 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@cats-cradle/faker-factory\" to `1.2.0`"
}
]
}
},
{
"version": "1.0.7",
"tag": "@cats-cradle/html-to-pdf_v1.0.7",
Expand Down
7 changes: 6 additions & 1 deletion services/html-to-pdf/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @cats-cradle/html-to-pdf

This log was last generated on Sat, 28 Oct 2023 21:42:52 GMT and should not be manually modified.
This log was last generated on Wed, 01 Nov 2023 04:48:36 GMT and should not be manually modified.

## 1.0.8
Wed, 01 Nov 2023 04:48:36 GMT

_Version update only_

## 1.0.7
Sat, 28 Oct 2023 21:42:52 GMT
Expand Down
2 changes: 1 addition & 1 deletion services/html-to-pdf/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cats-cradle/html-to-pdf",
"module": "commonjs",
"version": "1.0.7",
"version": "1.0.8",
"license": "MIT",
"description": "Your Go-To Solution for PDF Generation from HTML.",
"bugs": {
Expand Down

0 comments on commit af39fcf

Please sign in to comment.