From dfc621854f9517aef19372094effad1729d7671f Mon Sep 17 00:00:00 2001 From: thanhtr Date: Fri, 16 Apr 2021 14:55:13 +0300 Subject: [PATCH 1/4] Add travel pass schemas --- maas-schemas-ts/package.json | 2 +- .../customers/travel-pass/create/request.ts | 119 +++++++++++++++++ .../customers/travel-pass/create/response.ts | 122 ++++++++++++++++++ .../customers/travel-pass/remove/request.ts | 107 +++++++++++++++ .../customers/travel-pass/sync-log/request.ts | 115 +++++++++++++++++ .../travel-pass/sync-log/response.ts | 122 ++++++++++++++++++ maas-schemas-ts/translation.log | 20 +++ maas-schemas/package.json | 2 +- .../customers/travel-pass/create/request.json | 29 +++++ .../travel-pass/create/response.json | 31 +++++ .../customers/travel-pass/remove/request.json | 21 +++ .../travel-pass/sync-log/request.json | 27 ++++ .../travel-pass/sync-log/response.json | 34 +++++ 13 files changed, 749 insertions(+), 2 deletions(-) create mode 100644 maas-schemas-ts/src/maas-backend/customers/travel-pass/create/request.ts create mode 100644 maas-schemas-ts/src/maas-backend/customers/travel-pass/create/response.ts create mode 100644 maas-schemas-ts/src/maas-backend/customers/travel-pass/remove/request.ts create mode 100644 maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/request.ts create mode 100644 maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/response.ts create mode 100644 maas-schemas/schemas/maas-backend/customers/travel-pass/create/request.json create mode 100644 maas-schemas/schemas/maas-backend/customers/travel-pass/create/response.json create mode 100644 maas-schemas/schemas/maas-backend/customers/travel-pass/remove/request.json create mode 100644 maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/request.json create mode 100644 maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json diff --git a/maas-schemas-ts/package.json b/maas-schemas-ts/package.json index eadcd0485..bdf947195 100644 --- a/maas-schemas-ts/package.json +++ b/maas-schemas-ts/package.json @@ -1,6 +1,6 @@ { "name": "maas-schemas-ts", - "version": "14.21.0", + "version": "14.22.0", "description": "TypeScript types and io-ts validators for maas-schemas", "main": "index.js", "files": [ diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/create/request.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/create/request.ts new file mode 100644 index 000000000..dcf25119c --- /dev/null +++ b/maas-schemas-ts/src/maas-backend/customers/travel-pass/create/request.ts @@ -0,0 +1,119 @@ +/* + +undefined +Insert a new travel pass + +!!! AUTO GENERATED BY IOTSFJS REFRAIN FROM MANUAL EDITING !!! +See https://www.npmjs.com/package/io-ts-from-json-schema + +*/ + +import * as t from 'io-ts'; +import * as Units_ from '../../../../core/components/units'; +import * as ApiCommon_ from '../../../../core/components/api-common'; + +export type Defined = {} | null; +export class DefinedType extends t.Type { + readonly _tag: 'DefinedType' = 'DefinedType'; + constructor() { + super( + 'defined', + (u): u is Defined => typeof u !== 'undefined', + (u, c) => (this.is(u) ? t.success(u) : t.failure(u, c)), + t.identity, + ); + } +} +export interface DefinedC extends DefinedType {} +export const Defined: DefinedC = new DefinedType(); + +export const schemaId = + 'http://maasglobal.com/maas-backend/customers/travel-pass/create/request.json'; + +// Request +// The default export. More information at the top. +export type Request = t.Branded< + { + identityId?: Units_.IdentityId; + customerId?: Units_.IdentityId; + payload?: { + type?: string; + number?: string; + }; + headers?: ApiCommon_.Headers; + } & { + identityId: Defined; + customerId: Defined; + payload: Defined; + headers: Defined; + }, + RequestBrand +>; +export type RequestC = t.BrandC< + t.IntersectionC< + [ + t.PartialC<{ + identityId: typeof Units_.IdentityId; + customerId: typeof Units_.IdentityId; + payload: t.PartialC<{ + type: t.StringC; + number: t.StringC; + }>; + headers: typeof ApiCommon_.Headers; + }>, + t.TypeC<{ + identityId: typeof Defined; + customerId: typeof Defined; + payload: typeof Defined; + headers: typeof Defined; + }>, + ] + >, + RequestBrand +>; +export const Request: RequestC = t.brand( + t.intersection([ + t.partial({ + identityId: Units_.IdentityId, + customerId: Units_.IdentityId, + payload: t.partial({ + type: t.string, + number: t.string, + }), + headers: ApiCommon_.Headers, + }), + t.type({ + identityId: Defined, + customerId: Defined, + payload: Defined, + headers: Defined, + }), + ]), + ( + x, + ): x is t.Branded< + { + identityId?: Units_.IdentityId; + customerId?: Units_.IdentityId; + payload?: { + type?: string; + number?: string; + }; + headers?: ApiCommon_.Headers; + } & { + identityId: Defined; + customerId: Defined; + payload: Defined; + headers: Defined; + }, + RequestBrand + > => true, + 'Request', +); +export interface RequestBrand { + readonly Request: unique symbol; +} + +export default Request; + +// Success diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/create/response.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/create/response.ts new file mode 100644 index 000000000..03ede1f6e --- /dev/null +++ b/maas-schemas-ts/src/maas-backend/customers/travel-pass/create/response.ts @@ -0,0 +1,122 @@ +/* + +undefined +Insert travel pass response + +!!! AUTO GENERATED BY IOTSFJS REFRAIN FROM MANUAL EDITING !!! +See https://www.npmjs.com/package/io-ts-from-json-schema + +*/ + +import * as t from 'io-ts'; +import * as Units_ from '../../../../core/components/units'; + +export type Defined = {} | null; +export class DefinedType extends t.Type { + readonly _tag: 'DefinedType' = 'DefinedType'; + constructor() { + super( + 'defined', + (u): u is Defined => typeof u !== 'undefined', + (u, c) => (this.is(u) ? t.success(u) : t.failure(u, c)), + t.identity, + ); + } +} +export interface DefinedC extends DefinedType {} +export const Defined: DefinedC = new DefinedType(); + +export const schemaId = + 'http://maasglobal.com/maas-backend/customers/travel-pass/create/response.json'; + +// Response +// The default export. More information at the top. +export type Response = t.Branded< + { + travelPass?: { + id?: Units_.Uuid; + identityId?: Units_.IdentityId; + type?: string; + number?: string; + created?: Units_.Time; + modified?: Units_.Time; + }; + } & { + id: Defined; + identityId: Defined; + type: Defined; + number: Defined; + }, + ResponseBrand +>; +export type ResponseC = t.BrandC< + t.IntersectionC< + [ + t.PartialC<{ + travelPass: t.PartialC<{ + id: typeof Units_.Uuid; + identityId: typeof Units_.IdentityId; + type: t.StringC; + number: t.StringC; + created: typeof Units_.Time; + modified: typeof Units_.Time; + }>; + }>, + t.TypeC<{ + id: typeof Defined; + identityId: typeof Defined; + type: typeof Defined; + number: typeof Defined; + }>, + ] + >, + ResponseBrand +>; +export const Response: ResponseC = t.brand( + t.intersection([ + t.partial({ + travelPass: t.partial({ + id: Units_.Uuid, + identityId: Units_.IdentityId, + type: t.string, + number: t.string, + created: Units_.Time, + modified: Units_.Time, + }), + }), + t.type({ + id: Defined, + identityId: Defined, + type: Defined, + number: Defined, + }), + ]), + ( + x, + ): x is t.Branded< + { + travelPass?: { + id?: Units_.Uuid; + identityId?: Units_.IdentityId; + type?: string; + number?: string; + created?: Units_.Time; + modified?: Units_.Time; + }; + } & { + id: Defined; + identityId: Defined; + type: Defined; + number: Defined; + }, + ResponseBrand + > => true, + 'Response', +); +export interface ResponseBrand { + readonly Response: unique symbol; +} + +export default Response; + +// Success diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/remove/request.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/remove/request.ts new file mode 100644 index 000000000..f41bf6bf0 --- /dev/null +++ b/maas-schemas-ts/src/maas-backend/customers/travel-pass/remove/request.ts @@ -0,0 +1,107 @@ +/* + +undefined +Remove a travel pass + +!!! AUTO GENERATED BY IOTSFJS REFRAIN FROM MANUAL EDITING !!! +See https://www.npmjs.com/package/io-ts-from-json-schema + +*/ + +import * as t from 'io-ts'; +import * as Units_ from '../../../../core/components/units'; +import * as ApiCommon_ from '../../../../core/components/api-common'; + +export type Defined = {} | null; +export class DefinedType extends t.Type { + readonly _tag: 'DefinedType' = 'DefinedType'; + constructor() { + super( + 'defined', + (u): u is Defined => typeof u !== 'undefined', + (u, c) => (this.is(u) ? t.success(u) : t.failure(u, c)), + t.identity, + ); + } +} +export interface DefinedC extends DefinedType {} +export const Defined: DefinedC = new DefinedType(); + +export const schemaId = + 'http://maasglobal.com/maas-backend/customers/travel-pass/remove/request.json'; + +// Request +// The default export. More information at the top. +export type Request = t.Branded< + { + identityId?: Units_.IdentityId; + customerId?: Units_.IdentityId; + passId?: Units_.Uuid; + headers?: ApiCommon_.Headers; + } & { + identityId: Defined; + customerId: Defined; + passId: Defined; + headers: Defined; + }, + RequestBrand +>; +export type RequestC = t.BrandC< + t.IntersectionC< + [ + t.PartialC<{ + identityId: typeof Units_.IdentityId; + customerId: typeof Units_.IdentityId; + passId: typeof Units_.Uuid; + headers: typeof ApiCommon_.Headers; + }>, + t.TypeC<{ + identityId: typeof Defined; + customerId: typeof Defined; + passId: typeof Defined; + headers: typeof Defined; + }>, + ] + >, + RequestBrand +>; +export const Request: RequestC = t.brand( + t.intersection([ + t.partial({ + identityId: Units_.IdentityId, + customerId: Units_.IdentityId, + passId: Units_.Uuid, + headers: ApiCommon_.Headers, + }), + t.type({ + identityId: Defined, + customerId: Defined, + passId: Defined, + headers: Defined, + }), + ]), + ( + x, + ): x is t.Branded< + { + identityId?: Units_.IdentityId; + customerId?: Units_.IdentityId; + passId?: Units_.Uuid; + headers?: ApiCommon_.Headers; + } & { + identityId: Defined; + customerId: Defined; + passId: Defined; + headers: Defined; + }, + RequestBrand + > => true, + 'Request', +); +export interface RequestBrand { + readonly Request: unique symbol; +} + +export default Request; + +// Success diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/request.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/request.ts new file mode 100644 index 000000000..060f278c9 --- /dev/null +++ b/maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/request.ts @@ -0,0 +1,115 @@ +/* + +undefined +Insert travel pass logs + +!!! AUTO GENERATED BY IOTSFJS REFRAIN FROM MANUAL EDITING !!! +See https://www.npmjs.com/package/io-ts-from-json-schema + +*/ + +import * as t from 'io-ts'; +import * as Units_ from '../../../../core/components/units'; +import * as ApiCommon_ from '../../../../core/components/api-common'; + +export type Defined = {} | null; +export class DefinedType extends t.Type { + readonly _tag: 'DefinedType' = 'DefinedType'; + constructor() { + super( + 'defined', + (u): u is Defined => typeof u !== 'undefined', + (u, c) => (this.is(u) ? t.success(u) : t.failure(u, c)), + t.identity, + ); + } +} +export interface DefinedC extends DefinedType {} +export const Defined: DefinedC = new DefinedType(); + +export const schemaId = + 'http://maasglobal.com/maas-backend/customers/travel-pass/sync-log/request.json'; + +// Request +// The default export. More information at the top. +export type Request = t.Branded< + { + identityId?: Units_.IdentityId; + customerId?: Units_.IdentityId; + passId?: Units_.Uuid; + payload?: Array>; + headers?: ApiCommon_.Headers; + } & { + identityId: Defined; + customerId: Defined; + passId: Defined; + payload: Defined; + headers: Defined; + }, + RequestBrand +>; +export type RequestC = t.BrandC< + t.IntersectionC< + [ + t.PartialC<{ + identityId: typeof Units_.IdentityId; + customerId: typeof Units_.IdentityId; + passId: typeof Units_.Uuid; + payload: t.ArrayC; + headers: typeof ApiCommon_.Headers; + }>, + t.TypeC<{ + identityId: typeof Defined; + customerId: typeof Defined; + passId: typeof Defined; + payload: typeof Defined; + headers: typeof Defined; + }>, + ] + >, + RequestBrand +>; +export const Request: RequestC = t.brand( + t.intersection([ + t.partial({ + identityId: Units_.IdentityId, + customerId: Units_.IdentityId, + passId: Units_.Uuid, + payload: t.array(t.UnknownRecord), + headers: ApiCommon_.Headers, + }), + t.type({ + identityId: Defined, + customerId: Defined, + passId: Defined, + payload: Defined, + headers: Defined, + }), + ]), + ( + x, + ): x is t.Branded< + { + identityId?: Units_.IdentityId; + customerId?: Units_.IdentityId; + passId?: Units_.Uuid; + payload?: Array>; + headers?: ApiCommon_.Headers; + } & { + identityId: Defined; + customerId: Defined; + passId: Defined; + payload: Defined; + headers: Defined; + }, + RequestBrand + > => true, + 'Request', +); +export interface RequestBrand { + readonly Request: unique symbol; +} + +export default Request; + +// Success diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/response.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/response.ts new file mode 100644 index 000000000..a00e3c992 --- /dev/null +++ b/maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/response.ts @@ -0,0 +1,122 @@ +/* + +undefined +Insert travel pass logs response + +!!! AUTO GENERATED BY IOTSFJS REFRAIN FROM MANUAL EDITING !!! +See https://www.npmjs.com/package/io-ts-from-json-schema + +*/ + +import * as t from 'io-ts'; +import * as Units_ from '../../../../core/components/units'; + +export type Defined = {} | null; +export class DefinedType extends t.Type { + readonly _tag: 'DefinedType' = 'DefinedType'; + constructor() { + super( + 'defined', + (u): u is Defined => typeof u !== 'undefined', + (u, c) => (this.is(u) ? t.success(u) : t.failure(u, c)), + t.identity, + ); + } +} +export interface DefinedC extends DefinedType {} +export const Defined: DefinedC = new DefinedType(); + +export const schemaId = + 'http://maasglobal.com/maas-backend/customers/travel-pass/sync-log/response.json'; + +// Response +// The default export. More information at the top. +export type Response = t.Branded< + { + travelPassLogs?: Array< + { + id?: Units_.Uuid; + passId?: Units_.Uuid; + detail?: Record; + number?: string; + created?: Units_.Time; + modified?: Units_.Time; + } & { + id: Defined; + passId: Defined; + } + >; + }, + ResponseBrand +>; +export type ResponseC = t.BrandC< + t.PartialC<{ + travelPassLogs: t.ArrayC< + t.IntersectionC< + [ + t.PartialC<{ + id: typeof Units_.Uuid; + passId: typeof Units_.Uuid; + detail: t.UnknownRecordC; + number: t.StringC; + created: typeof Units_.Time; + modified: typeof Units_.Time; + }>, + t.TypeC<{ + id: typeof Defined; + passId: typeof Defined; + }>, + ] + > + >; + }>, + ResponseBrand +>; +export const Response: ResponseC = t.brand( + t.partial({ + travelPassLogs: t.array( + t.intersection([ + t.partial({ + id: Units_.Uuid, + passId: Units_.Uuid, + detail: t.UnknownRecord, + number: t.string, + created: Units_.Time, + modified: Units_.Time, + }), + t.type({ + id: Defined, + passId: Defined, + }), + ]), + ), + }), + ( + x, + ): x is t.Branded< + { + travelPassLogs?: Array< + { + id?: Units_.Uuid; + passId?: Units_.Uuid; + detail?: Record; + number?: string; + created?: Units_.Time; + modified?: Units_.Time; + } & { + id: Defined; + passId: Defined; + } + >; + }, + ResponseBrand + > => true, + 'Response', +); +export interface ResponseBrand { + readonly Response: unique symbol; +} + +export default Response; + +// Success diff --git a/maas-schemas-ts/translation.log b/maas-schemas-ts/translation.log index b763c1702..e8c8379b3 100644 --- a/maas-schemas-ts/translation.log +++ b/maas-schemas-ts/translation.log @@ -1628,6 +1628,26 @@ INFO: primitive type "integer" used outside top-level definitions in ../maas-schemas/schemas/maas-backend/customers/stats/response.json WARNING: minimum field not supported outside top-level definitions in ../maas-schemas/schemas/maas-backend/customers/stats/response.json +WARNING: missing $schema declaration + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create/request.json +INFO: primitive type "string" used outside top-level definitions + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create/request.json +INFO: primitive type "string" used outside top-level definitions + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create/request.json +WARNING: missing $schema declaration + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create/response.json +INFO: primitive type "string" used outside top-level definitions + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create/response.json +INFO: primitive type "string" used outside top-level definitions + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create/response.json +WARNING: missing $schema declaration + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/remove/request.json +WARNING: missing $schema declaration + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/request.json +WARNING: missing $schema declaration + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json +INFO: primitive type "string" used outside top-level definitions + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json WARNING: missing $schema declaration in ../maas-schemas/schemas/maas-backend/customers/update/request.json WARNING: missing $schema declaration diff --git a/maas-schemas/package.json b/maas-schemas/package.json index 9c754b079..aa0235aa5 100644 --- a/maas-schemas/package.json +++ b/maas-schemas/package.json @@ -1,6 +1,6 @@ { "name": "maas-schemas", - "version": "14.21.0", + "version": "14.22.0", "description": "Schemas for MaaS infrastructure", "main": "index.js", "engine": { diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/create/request.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/create/request.json new file mode 100644 index 000000000..bbd6cd565 --- /dev/null +++ b/maas-schemas/schemas/maas-backend/customers/travel-pass/create/request.json @@ -0,0 +1,29 @@ +{ + "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/create/request.json", + "description": "Insert a new travel pass", + "type": "object", + "additionalProperties": false, + "required": ["identityId", "customerId", "payload", "headers"], + "properties": { + "identityId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/identityId" + }, + "customerId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/identityId" + }, + "payload": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "number": { + "type": "string" + } + } + }, + "headers": { + "$ref": "http://maasglobal.com/core/components/api-common.json#/definitions/headers" + } + } +} diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/create/response.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/create/response.json new file mode 100644 index 000000000..ee23a2fdc --- /dev/null +++ b/maas-schemas/schemas/maas-backend/customers/travel-pass/create/response.json @@ -0,0 +1,31 @@ +{ + "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/create/response.json", + "description": "Insert travel pass response", + "type": "object", + "properties": { + "travelPass": { + "type": "object", + "properties": { + "id": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/uuid" + }, + "identityId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/identityId" + }, + "type": { + "type": "string" + }, + "number": { + "type": "string" + }, + "created": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/time" + }, + "modified": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/time" + } + } + } + }, + "required": ["id", "identityId", "type", "number"] +} diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/remove/request.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/remove/request.json new file mode 100644 index 000000000..1f2d2e756 --- /dev/null +++ b/maas-schemas/schemas/maas-backend/customers/travel-pass/remove/request.json @@ -0,0 +1,21 @@ +{ + "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/remove/request.json", + "description": "Remove a travel pass", + "type": "object", + "additionalProperties": false, + "required": ["identityId", "customerId", "passId", "headers"], + "properties": { + "identityId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/identityId" + }, + "customerId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/identityId" + }, + "passId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/uuid" + }, + "headers": { + "$ref": "http://maasglobal.com/core/components/api-common.json#/definitions/headers" + } + } +} diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/request.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/request.json new file mode 100644 index 000000000..7c86ed1bf --- /dev/null +++ b/maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/request.json @@ -0,0 +1,27 @@ +{ + "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/sync-log/request.json", + "description": "Insert travel pass logs", + "type": "object", + "additionalProperties": false, + "required": ["identityId", "customerId", "passId", "payload", "headers"], + "properties": { + "identityId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/identityId" + }, + "customerId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/identityId" + }, + "passId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/uuid" + }, + "payload": { + "type": "array", + "items": { + "type": "object" + } + }, + "headers": { + "$ref": "http://maasglobal.com/core/components/api-common.json#/definitions/headers" + } + } +} diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json new file mode 100644 index 000000000..c66acde16 --- /dev/null +++ b/maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json @@ -0,0 +1,34 @@ +{ + "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/sync-log/response.json", + "description": "Insert travel pass logs response", + "type": "object", + "properties": { + "travelPassLogs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/uuid" + }, + "passId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/uuid" + }, + "detail": { + "type": "object" + }, + "number": { + "type": "string" + }, + "created": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/time" + }, + "modified": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/time" + } + }, + "required": ["id", "passId"] + } + } + } +} From b94bd343d11bc06dd09f45f6f14512a7ee317252 Mon Sep 17 00:00:00 2001 From: thanhtr Date: Fri, 16 Apr 2021 16:03:17 +0300 Subject: [PATCH 2/4] No need modified, because it shouldnt be modified --- .../maas-backend/customers/travel-pass/sync-log/response.ts | 4 ---- .../maas-backend/customers/travel-pass/sync-log/response.json | 3 --- 2 files changed, 7 deletions(-) diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/response.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/response.ts index a00e3c992..b816cab0f 100644 --- a/maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/response.ts +++ b/maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/response.ts @@ -40,7 +40,6 @@ export type Response = t.Branded< detail?: Record; number?: string; created?: Units_.Time; - modified?: Units_.Time; } & { id: Defined; passId: Defined; @@ -60,7 +59,6 @@ export type ResponseC = t.BrandC< detail: t.UnknownRecordC; number: t.StringC; created: typeof Units_.Time; - modified: typeof Units_.Time; }>, t.TypeC<{ id: typeof Defined; @@ -82,7 +80,6 @@ export const Response: ResponseC = t.brand( detail: t.UnknownRecord, number: t.string, created: Units_.Time, - modified: Units_.Time, }), t.type({ id: Defined, @@ -102,7 +99,6 @@ export const Response: ResponseC = t.brand( detail?: Record; number?: string; created?: Units_.Time; - modified?: Units_.Time; } & { id: Defined; passId: Defined; diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json index c66acde16..c8fcac790 100644 --- a/maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json +++ b/maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json @@ -22,9 +22,6 @@ }, "created": { "$ref": "http://maasglobal.com/core/components/units.json#/definitions/time" - }, - "modified": { - "$ref": "http://maasglobal.com/core/components/units.json#/definitions/time" } }, "required": ["id", "passId"] From fe0384e4c08ac6f9f215ac10c9de90695fdca98d Mon Sep 17 00:00:00 2001 From: thanhtr Date: Mon, 19 Apr 2021 10:07:05 +0300 Subject: [PATCH 3/4] Add retrieve log requests responses --- .../src/maas-backend/core/travel-pass-log.ts | 97 ++++++++++++++ .../src/maas-backend/core/travel-pass.ts | 113 +++++++++++++++++ .../{sync-log => create-log}/request.ts | 2 +- .../travel-pass/create-log/response.ts | 51 ++++++++ .../customers/travel-pass/create/response.ts | 89 ++----------- .../travel-pass/retrieve-log/request.ts | 107 ++++++++++++++++ .../travel-pass/retrieve-log/response.ts | 51 ++++++++ .../travel-pass/sync-log/response.ts | 118 ------------------ maas-schemas-ts/translation.log | 22 ++-- .../schemas/core/travel-pass-log.json | 20 +++ maas-schemas/schemas/core/travel-pass.json | 26 ++++ .../{sync-log => create-log}/request.json | 2 +- .../travel-pass/create-log/response.json | 13 ++ .../travel-pass/create/response.json | 25 +--- .../travel-pass/retrieve-log/request.json | 21 ++++ .../travel-pass/retrieve-log/response.json | 13 ++ .../travel-pass/sync-log/response.json | 31 ----- 17 files changed, 539 insertions(+), 262 deletions(-) create mode 100644 maas-schemas-ts/src/maas-backend/core/travel-pass-log.ts create mode 100644 maas-schemas-ts/src/maas-backend/core/travel-pass.ts rename maas-schemas-ts/src/maas-backend/customers/travel-pass/{sync-log => create-log}/request.ts (96%) create mode 100644 maas-schemas-ts/src/maas-backend/customers/travel-pass/create-log/response.ts create mode 100644 maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-log/request.ts create mode 100644 maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-log/response.ts delete mode 100644 maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/response.ts create mode 100644 maas-schemas/schemas/core/travel-pass-log.json create mode 100644 maas-schemas/schemas/core/travel-pass.json rename maas-schemas/schemas/maas-backend/customers/travel-pass/{sync-log => create-log}/request.json (96%) create mode 100644 maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/response.json create mode 100644 maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/request.json create mode 100644 maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/response.json delete mode 100644 maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json diff --git a/maas-schemas-ts/src/maas-backend/core/travel-pass-log.ts b/maas-schemas-ts/src/maas-backend/core/travel-pass-log.ts new file mode 100644 index 000000000..0a20f03a5 --- /dev/null +++ b/maas-schemas-ts/src/maas-backend/core/travel-pass-log.ts @@ -0,0 +1,97 @@ +/* + +undefined +Travel pass log component + +!!! AUTO GENERATED BY IOTSFJS REFRAIN FROM MANUAL EDITING !!! +See https://www.npmjs.com/package/io-ts-from-json-schema + +*/ + +import * as t from 'io-ts'; +import * as Units_ from '../../core/components/units'; + +export type Defined = {} | null; +export class DefinedType extends t.Type { + readonly _tag: 'DefinedType' = 'DefinedType'; + constructor() { + super( + 'defined', + (u): u is Defined => typeof u !== 'undefined', + (u, c) => (this.is(u) ? t.success(u) : t.failure(u, c)), + t.identity, + ); + } +} +export interface DefinedC extends DefinedType {} +export const Defined: DefinedC = new DefinedType(); + +export const schemaId = 'http://maasglobal.com/maas-backend/core/travel-pass-log.json'; + +// TravelPassLog +// The default export. More information at the top. +export type TravelPassLog = t.Branded< + { + id?: Units_.Uuid; + passId?: Units_.Uuid; + detail?: Record; + created?: Units_.Time; + } & { + id: Defined; + passId: Defined; + }, + TravelPassLogBrand +>; +export type TravelPassLogC = t.BrandC< + t.IntersectionC< + [ + t.PartialC<{ + id: typeof Units_.Uuid; + passId: typeof Units_.Uuid; + detail: t.UnknownRecordC; + created: typeof Units_.Time; + }>, + t.TypeC<{ + id: typeof Defined; + passId: typeof Defined; + }>, + ] + >, + TravelPassLogBrand +>; +export const TravelPassLog: TravelPassLogC = t.brand( + t.intersection([ + t.partial({ + id: Units_.Uuid, + passId: Units_.Uuid, + detail: t.UnknownRecord, + created: Units_.Time, + }), + t.type({ + id: Defined, + passId: Defined, + }), + ]), + ( + x, + ): x is t.Branded< + { + id?: Units_.Uuid; + passId?: Units_.Uuid; + detail?: Record; + created?: Units_.Time; + } & { + id: Defined; + passId: Defined; + }, + TravelPassLogBrand + > => true, + 'TravelPassLog', +); +export interface TravelPassLogBrand { + readonly TravelPassLog: unique symbol; +} + +export default TravelPassLog; + +// Success diff --git a/maas-schemas-ts/src/maas-backend/core/travel-pass.ts b/maas-schemas-ts/src/maas-backend/core/travel-pass.ts new file mode 100644 index 000000000..063b8b84f --- /dev/null +++ b/maas-schemas-ts/src/maas-backend/core/travel-pass.ts @@ -0,0 +1,113 @@ +/* + +undefined +Travel pass component + +!!! AUTO GENERATED BY IOTSFJS REFRAIN FROM MANUAL EDITING !!! +See https://www.npmjs.com/package/io-ts-from-json-schema + +*/ + +import * as t from 'io-ts'; +import * as Units_ from '../../core/components/units'; + +export type Defined = {} | null; +export class DefinedType extends t.Type { + readonly _tag: 'DefinedType' = 'DefinedType'; + constructor() { + super( + 'defined', + (u): u is Defined => typeof u !== 'undefined', + (u, c) => (this.is(u) ? t.success(u) : t.failure(u, c)), + t.identity, + ); + } +} +export interface DefinedC extends DefinedType {} +export const Defined: DefinedC = new DefinedType(); + +export const schemaId = 'http://maasglobal.com/maas-backend/core/travel-pass.json'; + +// TravelPass +// The default export. More information at the top. +export type TravelPass = t.Branded< + { + id?: Units_.Uuid; + identityId?: Units_.IdentityId; + type?: string; + number?: string; + created?: Units_.Time; + modified?: Units_.Time; + } & { + id: Defined; + identityId: Defined; + type: Defined; + number: Defined; + }, + TravelPassBrand +>; +export type TravelPassC = t.BrandC< + t.IntersectionC< + [ + t.PartialC<{ + id: typeof Units_.Uuid; + identityId: typeof Units_.IdentityId; + type: t.StringC; + number: t.StringC; + created: typeof Units_.Time; + modified: typeof Units_.Time; + }>, + t.TypeC<{ + id: typeof Defined; + identityId: typeof Defined; + type: typeof Defined; + number: typeof Defined; + }>, + ] + >, + TravelPassBrand +>; +export const TravelPass: TravelPassC = t.brand( + t.intersection([ + t.partial({ + id: Units_.Uuid, + identityId: Units_.IdentityId, + type: t.string, + number: t.string, + created: Units_.Time, + modified: Units_.Time, + }), + t.type({ + id: Defined, + identityId: Defined, + type: Defined, + number: Defined, + }), + ]), + ( + x, + ): x is t.Branded< + { + id?: Units_.Uuid; + identityId?: Units_.IdentityId; + type?: string; + number?: string; + created?: Units_.Time; + modified?: Units_.Time; + } & { + id: Defined; + identityId: Defined; + type: Defined; + number: Defined; + }, + TravelPassBrand + > => true, + 'TravelPass', +); +export interface TravelPassBrand { + readonly TravelPass: unique symbol; +} + +export default TravelPass; + +// Success diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/request.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/create-log/request.ts similarity index 96% rename from maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/request.ts rename to maas-schemas-ts/src/maas-backend/customers/travel-pass/create-log/request.ts index 060f278c9..ca9a7ff64 100644 --- a/maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/request.ts +++ b/maas-schemas-ts/src/maas-backend/customers/travel-pass/create-log/request.ts @@ -28,7 +28,7 @@ export interface DefinedC extends DefinedType {} export const Defined: DefinedC = new DefinedType(); export const schemaId = - 'http://maasglobal.com/maas-backend/customers/travel-pass/sync-log/request.json'; + 'http://maasglobal.com/maas-backend/customers/travel-pass/create-log/request.json'; // Request // The default export. More information at the top. diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/create-log/response.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/create-log/response.ts new file mode 100644 index 000000000..486bf6265 --- /dev/null +++ b/maas-schemas-ts/src/maas-backend/customers/travel-pass/create-log/response.ts @@ -0,0 +1,51 @@ +/* + +undefined +Insert travel pass logs response + +!!! AUTO GENERATED BY IOTSFJS REFRAIN FROM MANUAL EDITING !!! +See https://www.npmjs.com/package/io-ts-from-json-schema + +*/ + +import * as t from 'io-ts'; +import * as TravelPassLog_ from '../../../core/travel-pass-log'; + +export const schemaId = + 'http://maasglobal.com/maas-backend/customers/travel-pass/create-log/response.json'; + +// Response +// The default export. More information at the top. +export type Response = t.Branded< + { + travelPassLogs?: Array; + }, + ResponseBrand +>; +export type ResponseC = t.BrandC< + t.PartialC<{ + travelPassLogs: t.ArrayC; + }>, + ResponseBrand +>; +export const Response: ResponseC = t.brand( + t.partial({ + travelPassLogs: t.array(TravelPassLog_.TravelPassLog), + }), + ( + x, + ): x is t.Branded< + { + travelPassLogs?: Array; + }, + ResponseBrand + > => true, + 'Response', +); +export interface ResponseBrand { + readonly Response: unique symbol; +} + +export default Response; + +// Success diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/create/response.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/create/response.ts index 03ede1f6e..de397cab3 100644 --- a/maas-schemas-ts/src/maas-backend/customers/travel-pass/create/response.ts +++ b/maas-schemas-ts/src/maas-backend/customers/travel-pass/create/response.ts @@ -9,22 +9,7 @@ See https://www.npmjs.com/package/io-ts-from-json-schema */ import * as t from 'io-ts'; -import * as Units_ from '../../../../core/components/units'; - -export type Defined = {} | null; -export class DefinedType extends t.Type { - readonly _tag: 'DefinedType' = 'DefinedType'; - constructor() { - super( - 'defined', - (u): u is Defined => typeof u !== 'undefined', - (u, c) => (this.is(u) ? t.success(u) : t.failure(u, c)), - t.identity, - ); - } -} -export interface DefinedC extends DefinedType {} -export const Defined: DefinedC = new DefinedType(); +import * as TravelPass_ from '../../../core/travel-pass'; export const schemaId = 'http://maasglobal.com/maas-backend/customers/travel-pass/create/response.json'; @@ -33,81 +18,25 @@ export const schemaId = // The default export. More information at the top. export type Response = t.Branded< { - travelPass?: { - id?: Units_.Uuid; - identityId?: Units_.IdentityId; - type?: string; - number?: string; - created?: Units_.Time; - modified?: Units_.Time; - }; - } & { - id: Defined; - identityId: Defined; - type: Defined; - number: Defined; + travelPass?: TravelPass_.TravelPass; }, ResponseBrand >; export type ResponseC = t.BrandC< - t.IntersectionC< - [ - t.PartialC<{ - travelPass: t.PartialC<{ - id: typeof Units_.Uuid; - identityId: typeof Units_.IdentityId; - type: t.StringC; - number: t.StringC; - created: typeof Units_.Time; - modified: typeof Units_.Time; - }>; - }>, - t.TypeC<{ - id: typeof Defined; - identityId: typeof Defined; - type: typeof Defined; - number: typeof Defined; - }>, - ] - >, + t.PartialC<{ + travelPass: typeof TravelPass_.TravelPass; + }>, ResponseBrand >; export const Response: ResponseC = t.brand( - t.intersection([ - t.partial({ - travelPass: t.partial({ - id: Units_.Uuid, - identityId: Units_.IdentityId, - type: t.string, - number: t.string, - created: Units_.Time, - modified: Units_.Time, - }), - }), - t.type({ - id: Defined, - identityId: Defined, - type: Defined, - number: Defined, - }), - ]), + t.partial({ + travelPass: TravelPass_.TravelPass, + }), ( x, ): x is t.Branded< { - travelPass?: { - id?: Units_.Uuid; - identityId?: Units_.IdentityId; - type?: string; - number?: string; - created?: Units_.Time; - modified?: Units_.Time; - }; - } & { - id: Defined; - identityId: Defined; - type: Defined; - number: Defined; + travelPass?: TravelPass_.TravelPass; }, ResponseBrand > => true, diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-log/request.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-log/request.ts new file mode 100644 index 000000000..abc88e635 --- /dev/null +++ b/maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-log/request.ts @@ -0,0 +1,107 @@ +/* + +undefined +Request to retrieve logs of a travel pass + +!!! AUTO GENERATED BY IOTSFJS REFRAIN FROM MANUAL EDITING !!! +See https://www.npmjs.com/package/io-ts-from-json-schema + +*/ + +import * as t from 'io-ts'; +import * as Units_ from '../../../../core/components/units'; +import * as ApiCommon_ from '../../../../core/components/api-common'; + +export type Defined = {} | null; +export class DefinedType extends t.Type { + readonly _tag: 'DefinedType' = 'DefinedType'; + constructor() { + super( + 'defined', + (u): u is Defined => typeof u !== 'undefined', + (u, c) => (this.is(u) ? t.success(u) : t.failure(u, c)), + t.identity, + ); + } +} +export interface DefinedC extends DefinedType {} +export const Defined: DefinedC = new DefinedType(); + +export const schemaId = + 'http://maasglobal.com/maas-backend/customers/travel-pass/retrieve-log/request.json'; + +// Request +// The default export. More information at the top. +export type Request = t.Branded< + { + identityId?: Units_.IdentityId; + customerId?: Units_.IdentityId; + passId?: Units_.Uuid; + headers?: ApiCommon_.Headers; + } & { + identityId: Defined; + customerId: Defined; + passId: Defined; + headers: Defined; + }, + RequestBrand +>; +export type RequestC = t.BrandC< + t.IntersectionC< + [ + t.PartialC<{ + identityId: typeof Units_.IdentityId; + customerId: typeof Units_.IdentityId; + passId: typeof Units_.Uuid; + headers: typeof ApiCommon_.Headers; + }>, + t.TypeC<{ + identityId: typeof Defined; + customerId: typeof Defined; + passId: typeof Defined; + headers: typeof Defined; + }>, + ] + >, + RequestBrand +>; +export const Request: RequestC = t.brand( + t.intersection([ + t.partial({ + identityId: Units_.IdentityId, + customerId: Units_.IdentityId, + passId: Units_.Uuid, + headers: ApiCommon_.Headers, + }), + t.type({ + identityId: Defined, + customerId: Defined, + passId: Defined, + headers: Defined, + }), + ]), + ( + x, + ): x is t.Branded< + { + identityId?: Units_.IdentityId; + customerId?: Units_.IdentityId; + passId?: Units_.Uuid; + headers?: ApiCommon_.Headers; + } & { + identityId: Defined; + customerId: Defined; + passId: Defined; + headers: Defined; + }, + RequestBrand + > => true, + 'Request', +); +export interface RequestBrand { + readonly Request: unique symbol; +} + +export default Request; + +// Success diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-log/response.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-log/response.ts new file mode 100644 index 000000000..f80ecf7fc --- /dev/null +++ b/maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-log/response.ts @@ -0,0 +1,51 @@ +/* + +undefined +Retrieve logs response + +!!! AUTO GENERATED BY IOTSFJS REFRAIN FROM MANUAL EDITING !!! +See https://www.npmjs.com/package/io-ts-from-json-schema + +*/ + +import * as t from 'io-ts'; +import * as TravelPassLog_ from '../../../core/travel-pass-log'; + +export const schemaId = + 'http://maasglobal.com/maas-backend/customers/travel-pass/retrieve-log/response.json'; + +// Response +// The default export. More information at the top. +export type Response = t.Branded< + { + travelPassLogs?: Array; + }, + ResponseBrand +>; +export type ResponseC = t.BrandC< + t.PartialC<{ + travelPassLogs: t.ArrayC; + }>, + ResponseBrand +>; +export const Response: ResponseC = t.brand( + t.partial({ + travelPassLogs: t.array(TravelPassLog_.TravelPassLog), + }), + ( + x, + ): x is t.Branded< + { + travelPassLogs?: Array; + }, + ResponseBrand + > => true, + 'Response', +); +export interface ResponseBrand { + readonly Response: unique symbol; +} + +export default Response; + +// Success diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/response.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/response.ts deleted file mode 100644 index b816cab0f..000000000 --- a/maas-schemas-ts/src/maas-backend/customers/travel-pass/sync-log/response.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* - -undefined -Insert travel pass logs response - -!!! AUTO GENERATED BY IOTSFJS REFRAIN FROM MANUAL EDITING !!! -See https://www.npmjs.com/package/io-ts-from-json-schema - -*/ - -import * as t from 'io-ts'; -import * as Units_ from '../../../../core/components/units'; - -export type Defined = {} | null; -export class DefinedType extends t.Type { - readonly _tag: 'DefinedType' = 'DefinedType'; - constructor() { - super( - 'defined', - (u): u is Defined => typeof u !== 'undefined', - (u, c) => (this.is(u) ? t.success(u) : t.failure(u, c)), - t.identity, - ); - } -} -export interface DefinedC extends DefinedType {} -export const Defined: DefinedC = new DefinedType(); - -export const schemaId = - 'http://maasglobal.com/maas-backend/customers/travel-pass/sync-log/response.json'; - -// Response -// The default export. More information at the top. -export type Response = t.Branded< - { - travelPassLogs?: Array< - { - id?: Units_.Uuid; - passId?: Units_.Uuid; - detail?: Record; - number?: string; - created?: Units_.Time; - } & { - id: Defined; - passId: Defined; - } - >; - }, - ResponseBrand ->; -export type ResponseC = t.BrandC< - t.PartialC<{ - travelPassLogs: t.ArrayC< - t.IntersectionC< - [ - t.PartialC<{ - id: typeof Units_.Uuid; - passId: typeof Units_.Uuid; - detail: t.UnknownRecordC; - number: t.StringC; - created: typeof Units_.Time; - }>, - t.TypeC<{ - id: typeof Defined; - passId: typeof Defined; - }>, - ] - > - >; - }>, - ResponseBrand ->; -export const Response: ResponseC = t.brand( - t.partial({ - travelPassLogs: t.array( - t.intersection([ - t.partial({ - id: Units_.Uuid, - passId: Units_.Uuid, - detail: t.UnknownRecord, - number: t.string, - created: Units_.Time, - }), - t.type({ - id: Defined, - passId: Defined, - }), - ]), - ), - }), - ( - x, - ): x is t.Branded< - { - travelPassLogs?: Array< - { - id?: Units_.Uuid; - passId?: Units_.Uuid; - detail?: Record; - number?: string; - created?: Units_.Time; - } & { - id: Defined; - passId: Defined; - } - >; - }, - ResponseBrand - > => true, - 'Response', -); -export interface ResponseBrand { - readonly Response: unique symbol; -} - -export default Response; - -// Success diff --git a/maas-schemas-ts/translation.log b/maas-schemas-ts/translation.log index e8c8379b3..7239599e1 100644 --- a/maas-schemas-ts/translation.log +++ b/maas-schemas-ts/translation.log @@ -1240,6 +1240,14 @@ INFO: missing description in ../maas-schemas/schemas/core/region.json WARNING: missing $schema declaration in ../maas-schemas/schemas/core/stop.json +WARNING: missing $schema declaration + in ../maas-schemas/schemas/core/travel-pass-log.json +WARNING: missing $schema declaration + in ../maas-schemas/schemas/core/travel-pass.json +INFO: primitive type "string" used outside top-level definitions + in ../maas-schemas/schemas/core/travel-pass.json +INFO: primitive type "string" used outside top-level definitions + in ../maas-schemas/schemas/core/travel-pass.json WARNING: patternProperty support has limitations in ../maas-schemas/schemas/environments/accounts.json WARNING: missing $schema declaration @@ -1628,6 +1636,10 @@ INFO: primitive type "integer" used outside top-level definitions in ../maas-schemas/schemas/maas-backend/customers/stats/response.json WARNING: minimum field not supported outside top-level definitions in ../maas-schemas/schemas/maas-backend/customers/stats/response.json +WARNING: missing $schema declaration + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/request.json +WARNING: missing $schema declaration + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/response.json WARNING: missing $schema declaration in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create/request.json INFO: primitive type "string" used outside top-level definitions @@ -1636,18 +1648,12 @@ INFO: primitive type "string" used outside top-level definitions in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create/request.json WARNING: missing $schema declaration in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create/response.json -INFO: primitive type "string" used outside top-level definitions - in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create/response.json -INFO: primitive type "string" used outside top-level definitions - in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create/response.json WARNING: missing $schema declaration in ../maas-schemas/schemas/maas-backend/customers/travel-pass/remove/request.json WARNING: missing $schema declaration - in ../maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/request.json + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/request.json WARNING: missing $schema declaration - in ../maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json -INFO: primitive type "string" used outside top-level definitions - in ../maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/response.json WARNING: missing $schema declaration in ../maas-schemas/schemas/maas-backend/customers/update/request.json WARNING: missing $schema declaration diff --git a/maas-schemas/schemas/core/travel-pass-log.json b/maas-schemas/schemas/core/travel-pass-log.json new file mode 100644 index 000000000..d6da7781a --- /dev/null +++ b/maas-schemas/schemas/core/travel-pass-log.json @@ -0,0 +1,20 @@ +{ + "$id": "http://maasglobal.com/maas-backend/core/travel-pass-log.json", + "description": "Travel pass log component", + "type": "object", + "properties": { + "id": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/uuid" + }, + "passId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/uuid" + }, + "detail": { + "type": "object" + }, + "created": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/time" + } + }, + "required": ["id", "passId"] +} diff --git a/maas-schemas/schemas/core/travel-pass.json b/maas-schemas/schemas/core/travel-pass.json new file mode 100644 index 000000000..1082ab581 --- /dev/null +++ b/maas-schemas/schemas/core/travel-pass.json @@ -0,0 +1,26 @@ +{ + "$id": "http://maasglobal.com/maas-backend/core/travel-pass.json", + "description": "Travel pass component", + "type": "object", + "properties": { + "id": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/uuid" + }, + "identityId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/identityId" + }, + "type": { + "type": "string" + }, + "number": { + "type": "string" + }, + "created": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/time" + }, + "modified": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/time" + } + }, + "required": ["id", "identityId", "type", "number"] +} diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/request.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/request.json similarity index 96% rename from maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/request.json rename to maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/request.json index 7c86ed1bf..47b3d9361 100644 --- a/maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/request.json +++ b/maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/request.json @@ -1,5 +1,5 @@ { - "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/sync-log/request.json", + "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/create-log/request.json", "description": "Insert travel pass logs", "type": "object", "additionalProperties": false, diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/response.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/response.json new file mode 100644 index 000000000..ce8aae886 --- /dev/null +++ b/maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/response.json @@ -0,0 +1,13 @@ +{ + "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/create-log/response.json", + "description": "Insert travel pass logs response", + "type": "object", + "properties": { + "travelPassLogs": { + "type": "array", + "items": { + "$ref": "http://maasglobal.com/maas-backend/core/travel-pass-log.json" + } + } + } +} diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/create/response.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/create/response.json index ee23a2fdc..a253bca1f 100644 --- a/maas-schemas/schemas/maas-backend/customers/travel-pass/create/response.json +++ b/maas-schemas/schemas/maas-backend/customers/travel-pass/create/response.json @@ -4,28 +4,7 @@ "type": "object", "properties": { "travelPass": { - "type": "object", - "properties": { - "id": { - "$ref": "http://maasglobal.com/core/components/units.json#/definitions/uuid" - }, - "identityId": { - "$ref": "http://maasglobal.com/core/components/units.json#/definitions/identityId" - }, - "type": { - "type": "string" - }, - "number": { - "type": "string" - }, - "created": { - "$ref": "http://maasglobal.com/core/components/units.json#/definitions/time" - }, - "modified": { - "$ref": "http://maasglobal.com/core/components/units.json#/definitions/time" - } - } + "$ref": "http://maasglobal.com/maas-backend/core/travel-pass.json" } - }, - "required": ["id", "identityId", "type", "number"] + } } diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/request.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/request.json new file mode 100644 index 000000000..3576b3b56 --- /dev/null +++ b/maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/request.json @@ -0,0 +1,21 @@ +{ + "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/retrieve-log/request.json", + "description": "Request to retrieve logs of a travel pass", + "type": "object", + "additionalProperties": false, + "required": ["identityId", "customerId", "passId", "headers"], + "properties": { + "identityId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/identityId" + }, + "customerId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/identityId" + }, + "passId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/uuid" + }, + "headers": { + "$ref": "http://maasglobal.com/core/components/api-common.json#/definitions/headers" + } + } +} diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/response.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/response.json new file mode 100644 index 000000000..630b6fcd4 --- /dev/null +++ b/maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/response.json @@ -0,0 +1,13 @@ +{ + "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/retrieve-log/response.json", + "description": "Retrieve logs response", + "type": "object", + "properties": { + "travelPassLogs": { + "type": "array", + "items": { + "$ref": "http://maasglobal.com/maas-backend/core/travel-pass-log.json" + } + } + } +} diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json deleted file mode 100644 index c8fcac790..000000000 --- a/maas-schemas/schemas/maas-backend/customers/travel-pass/sync-log/response.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/sync-log/response.json", - "description": "Insert travel pass logs response", - "type": "object", - "properties": { - "travelPassLogs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "$ref": "http://maasglobal.com/core/components/units.json#/definitions/uuid" - }, - "passId": { - "$ref": "http://maasglobal.com/core/components/units.json#/definitions/uuid" - }, - "detail": { - "type": "object" - }, - "number": { - "type": "string" - }, - "created": { - "$ref": "http://maasglobal.com/core/components/units.json#/definitions/time" - } - }, - "required": ["id", "passId"] - } - } - } -} From e2bade97cd3a78c927af9eecdb26c03742896d79 Mon Sep 17 00:00:00 2001 From: thanhtr Date: Mon, 19 Apr 2021 10:12:04 +0300 Subject: [PATCH 4/4] Tweaks --- .../{create-log => insert-logs}/request.ts | 2 +- .../{create-log => insert-logs}/response.ts | 2 +- .../{retrieve-log => retrieve-logs}/request.ts | 2 +- .../{retrieve-log => retrieve-logs}/response.ts | 2 +- maas-schemas-ts/translation.log | 12 ++++++------ .../{create-log => insert-logs}/request.json | 2 +- .../{create-log => insert-logs}/response.json | 2 +- .../{retrieve-log => retrieve-logs}/request.json | 2 +- .../{retrieve-log => retrieve-logs}/response.json | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) rename maas-schemas-ts/src/maas-backend/customers/travel-pass/{create-log => insert-logs}/request.ts (96%) rename maas-schemas-ts/src/maas-backend/customers/travel-pass/{create-log => insert-logs}/response.ts (91%) rename maas-schemas-ts/src/maas-backend/customers/travel-pass/{retrieve-log => retrieve-logs}/request.ts (98%) rename maas-schemas-ts/src/maas-backend/customers/travel-pass/{retrieve-log => retrieve-logs}/response.ts (97%) rename maas-schemas/schemas/maas-backend/customers/travel-pass/{create-log => insert-logs}/request.json (96%) rename maas-schemas/schemas/maas-backend/customers/travel-pass/{create-log => insert-logs}/response.json (91%) rename maas-schemas/schemas/maas-backend/customers/travel-pass/{retrieve-log => retrieve-logs}/request.json (95%) rename maas-schemas/schemas/maas-backend/customers/travel-pass/{retrieve-log => retrieve-logs}/response.json (90%) diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/create-log/request.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/insert-logs/request.ts similarity index 96% rename from maas-schemas-ts/src/maas-backend/customers/travel-pass/create-log/request.ts rename to maas-schemas-ts/src/maas-backend/customers/travel-pass/insert-logs/request.ts index ca9a7ff64..d6eb342c2 100644 --- a/maas-schemas-ts/src/maas-backend/customers/travel-pass/create-log/request.ts +++ b/maas-schemas-ts/src/maas-backend/customers/travel-pass/insert-logs/request.ts @@ -28,7 +28,7 @@ export interface DefinedC extends DefinedType {} export const Defined: DefinedC = new DefinedType(); export const schemaId = - 'http://maasglobal.com/maas-backend/customers/travel-pass/create-log/request.json'; + 'http://maasglobal.com/maas-backend/customers/travel-pass/insert-logs/request.json'; // Request // The default export. More information at the top. diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/create-log/response.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/insert-logs/response.ts similarity index 91% rename from maas-schemas-ts/src/maas-backend/customers/travel-pass/create-log/response.ts rename to maas-schemas-ts/src/maas-backend/customers/travel-pass/insert-logs/response.ts index 486bf6265..0fa93b2b4 100644 --- a/maas-schemas-ts/src/maas-backend/customers/travel-pass/create-log/response.ts +++ b/maas-schemas-ts/src/maas-backend/customers/travel-pass/insert-logs/response.ts @@ -12,7 +12,7 @@ import * as t from 'io-ts'; import * as TravelPassLog_ from '../../../core/travel-pass-log'; export const schemaId = - 'http://maasglobal.com/maas-backend/customers/travel-pass/create-log/response.json'; + 'http://maasglobal.com/maas-backend/customers/travel-pass/insert-logs/response.json'; // Response // The default export. More information at the top. diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-log/request.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-logs/request.ts similarity index 98% rename from maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-log/request.ts rename to maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-logs/request.ts index abc88e635..16028e0d4 100644 --- a/maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-log/request.ts +++ b/maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-logs/request.ts @@ -28,7 +28,7 @@ export interface DefinedC extends DefinedType {} export const Defined: DefinedC = new DefinedType(); export const schemaId = - 'http://maasglobal.com/maas-backend/customers/travel-pass/retrieve-log/request.json'; + 'http://maasglobal.com/maas-backend/customers/travel-pass/retrieve-logs/request.json'; // Request // The default export. More information at the top. diff --git a/maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-log/response.ts b/maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-logs/response.ts similarity index 97% rename from maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-log/response.ts rename to maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-logs/response.ts index f80ecf7fc..1f559a80c 100644 --- a/maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-log/response.ts +++ b/maas-schemas-ts/src/maas-backend/customers/travel-pass/retrieve-logs/response.ts @@ -12,7 +12,7 @@ import * as t from 'io-ts'; import * as TravelPassLog_ from '../../../core/travel-pass-log'; export const schemaId = - 'http://maasglobal.com/maas-backend/customers/travel-pass/retrieve-log/response.json'; + 'http://maasglobal.com/maas-backend/customers/travel-pass/retrieve-logs/response.json'; // Response // The default export. More information at the top. diff --git a/maas-schemas-ts/translation.log b/maas-schemas-ts/translation.log index 7239599e1..03b9fd213 100644 --- a/maas-schemas-ts/translation.log +++ b/maas-schemas-ts/translation.log @@ -1636,10 +1636,6 @@ INFO: primitive type "integer" used outside top-level definitions in ../maas-schemas/schemas/maas-backend/customers/stats/response.json WARNING: minimum field not supported outside top-level definitions in ../maas-schemas/schemas/maas-backend/customers/stats/response.json -WARNING: missing $schema declaration - in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/request.json -WARNING: missing $schema declaration - in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/response.json WARNING: missing $schema declaration in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create/request.json INFO: primitive type "string" used outside top-level definitions @@ -1648,12 +1644,16 @@ INFO: primitive type "string" used outside top-level definitions in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create/request.json WARNING: missing $schema declaration in ../maas-schemas/schemas/maas-backend/customers/travel-pass/create/response.json +WARNING: missing $schema declaration + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/insert-logs/request.json +WARNING: missing $schema declaration + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/insert-logs/response.json WARNING: missing $schema declaration in ../maas-schemas/schemas/maas-backend/customers/travel-pass/remove/request.json WARNING: missing $schema declaration - in ../maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/request.json + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-logs/request.json WARNING: missing $schema declaration - in ../maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/response.json + in ../maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-logs/response.json WARNING: missing $schema declaration in ../maas-schemas/schemas/maas-backend/customers/update/request.json WARNING: missing $schema declaration diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/request.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/insert-logs/request.json similarity index 96% rename from maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/request.json rename to maas-schemas/schemas/maas-backend/customers/travel-pass/insert-logs/request.json index 47b3d9361..ca08d3b80 100644 --- a/maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/request.json +++ b/maas-schemas/schemas/maas-backend/customers/travel-pass/insert-logs/request.json @@ -1,5 +1,5 @@ { - "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/create-log/request.json", + "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/insert-logs/request.json", "description": "Insert travel pass logs", "type": "object", "additionalProperties": false, diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/response.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/insert-logs/response.json similarity index 91% rename from maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/response.json rename to maas-schemas/schemas/maas-backend/customers/travel-pass/insert-logs/response.json index ce8aae886..e4c6210bb 100644 --- a/maas-schemas/schemas/maas-backend/customers/travel-pass/create-log/response.json +++ b/maas-schemas/schemas/maas-backend/customers/travel-pass/insert-logs/response.json @@ -1,5 +1,5 @@ { - "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/create-log/response.json", + "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/insert-logs/response.json", "description": "Insert travel pass logs response", "type": "object", "properties": { diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/request.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-logs/request.json similarity index 95% rename from maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/request.json rename to maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-logs/request.json index 3576b3b56..2e5023a9e 100644 --- a/maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/request.json +++ b/maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-logs/request.json @@ -1,5 +1,5 @@ { - "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/retrieve-log/request.json", + "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/retrieve-logs/request.json", "description": "Request to retrieve logs of a travel pass", "type": "object", "additionalProperties": false, diff --git a/maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/response.json b/maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-logs/response.json similarity index 90% rename from maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/response.json rename to maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-logs/response.json index 630b6fcd4..f0eb6855c 100644 --- a/maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-log/response.json +++ b/maas-schemas/schemas/maas-backend/customers/travel-pass/retrieve-logs/response.json @@ -1,5 +1,5 @@ { - "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/retrieve-log/response.json", + "$id": "http://maasglobal.com/maas-backend/customers/travel-pass/retrieve-logs/response.json", "description": "Retrieve logs response", "type": "object", "properties": {