From 26381ded98d2a6b73b40b3c299637708bab7dcae Mon Sep 17 00:00:00 2001 From: Apoorva Srinivas Appadoo Date: Mon, 23 Sep 2024 19:35:32 +0200 Subject: [PATCH 01/10] feat: add clients for backend --- .openapi-generator-ignore | 26 + apps/sample-nestjs/src/app/app.service.ts | 7 +- apps/sample-react/src/app/app.tsx | 23 +- apps/sample-react/src/main.tsx | 5 + libs/clients/dining/.eslintrc.json | 25 + libs/clients/dining/README.md | 7 + libs/clients/dining/openapi.yaml | 533 ++++++++++++++++ libs/clients/dining/package.json | 12 + libs/clients/dining/project.json | 35 ++ libs/clients/dining/src/.npmignore | 1 + .../dining/src/.openapi-generator-ignore | 23 + .../dining/src/.openapi-generator/FILES | 28 + .../dining/src/.openapi-generator/VERSION | 1 + libs/clients/dining/src/api.ts | 20 + libs/clients/dining/src/api/health-api.ts | 122 ++++ .../dining/src/api/table-orders-api.ts | 545 +++++++++++++++++ libs/clients/dining/src/api/tables-api.ts | 286 +++++++++ libs/clients/dining/src/base.ts | 86 +++ libs/clients/dining/src/common.ts | 150 +++++ libs/clients/dining/src/configuration.ts | 110 ++++ libs/clients/dining/src/index.ts | 18 + .../dining/src/models/add-menu-item-dto.ts | 42 ++ .../dining/src/models/add-table-dto.ts | 30 + ...controller-check200-response-info-value.ts | 32 + .../health-controller-check200-response.ts | 51 ++ .../health-controller-check503-response.ts | 51 ++ libs/clients/dining/src/models/index.ts | 17 + .../dining/src/models/ordering-item.ts | 36 ++ .../dining/src/models/ordering-line.ts | 45 ++ .../dining/src/models/preparation-dto.ts | 45 ++ .../dining/src/models/prepared-item-dto.ts | 36 ++ .../dining/src/models/start-ordering-dto.ts | 36 ++ .../models/table-already-exists-exception.ts | 36 ++ .../models/table-already-taken-exception.ts | 36 ++ .../table-number-not-found-exception.ts | 36 ++ .../table-order-already-billed-exception.ts | 36 ++ .../table-order-id-not-found-exception.ts | 36 ++ libs/clients/dining/src/models/table-order.ts | 72 +++ .../dining/src/models/table-with-order-dto.ts | 48 ++ libs/clients/dining/tsconfig.json | 19 + libs/clients/dining/tsconfig.lib.json | 10 + libs/clients/kitchen/.eslintrc.json | 25 + libs/clients/kitchen/README.md | 7 + libs/clients/kitchen/openapi.yaml | 577 ++++++++++++++++++ libs/clients/kitchen/package.json | 12 + libs/clients/kitchen/project.json | 35 ++ libs/clients/kitchen/src/.npmignore | 1 + .../kitchen/src/.openapi-generator-ignore | 23 + .../kitchen/src/.openapi-generator/FILES | 28 + .../kitchen/src/.openapi-generator/VERSION | 1 + libs/clients/kitchen/src/api.ts | 20 + libs/clients/kitchen/src/api/health-api.ts | 122 ++++ .../kitchen/src/api/preparations-api.ts | 418 +++++++++++++ .../kitchen/src/api/prepared-items-api.ts | 479 +++++++++++++++ libs/clients/kitchen/src/base.ts | 86 +++ libs/clients/kitchen/src/common.ts | 150 +++++ libs/clients/kitchen/src/configuration.ts | 110 ++++ libs/clients/kitchen/src/index.ts | 18 + ...-to-be-cooked-sent-in-kitchen-exception.ts | 36 ++ ...controller-check200-response-info-value.ts | 32 + .../health-controller-check200-response.ts | 51 ++ .../health-controller-check503-response.ts | 51 ++ libs/clients/kitchen/src/models/index.ts | 17 + ...-already-started-to-be-cooked-exception.ts | 36 ++ ...item-not-started-to-be-cooked-exception.ts | 36 ++ .../src/models/item-to-be-cooked-dto.ts | 36 ++ .../kitchen/src/models/preparation-dto.ts | 63 ++ .../preparation-id-not-found-exception.ts | 36 ++ ...paration-not-ready-in-kitchen-exception.ts | 36 ++ .../src/models/preparation-request-dto.ts | 39 ++ .../kitchen/src/models/prepared-item-dto.ts | 54 ++ .../prepared-item-id-not-found-exception.ts | 36 ++ .../kitchen/src/models/prepared-item.ts | 63 ++ libs/clients/kitchen/src/models/recipe.ts | 63 ++ .../table-number-not-found-exception.ts | 36 ++ .../models/wrong-query-parameter-exception.ts | 36 ++ libs/clients/kitchen/tsconfig.json | 19 + libs/clients/kitchen/tsconfig.lib.json | 10 + libs/clients/menu/.eslintrc.json | 25 + libs/clients/menu/README.md | 7 + libs/clients/menu/openapi.yaml | 259 ++++++++ libs/clients/menu/package.json | 12 + libs/clients/menu/project.json | 35 ++ libs/clients/menu/src/.npmignore | 1 + .../menu/src/.openapi-generator-ignore | 23 + .../clients/menu/src/.openapi-generator/FILES | 17 + .../menu/src/.openapi-generator/VERSION | 1 + libs/clients/menu/src/api.ts | 19 + libs/clients/menu/src/api/health-api.ts | 122 ++++ libs/clients/menu/src/api/menus-api.ts | 286 +++++++++ libs/clients/menu/src/base.ts | 86 +++ libs/clients/menu/src/common.ts | 150 +++++ libs/clients/menu/src/configuration.ts | 110 ++++ libs/clients/menu/src/index.ts | 18 + .../menu/src/models/add-menu-item-dto.ts | 64 ++ ...controller-check200-response-info-value.ts | 32 + .../health-controller-check200-response.ts | 51 ++ .../health-controller-check503-response.ts | 51 ++ libs/clients/menu/src/models/index.ts | 7 + .../menu-item-id-not-found-exception.ts | 36 ++ ...tem-short-name-already-exists-exception.ts | 36 ++ libs/clients/menu/src/models/menu-item.ts | 70 +++ libs/clients/menu/tsconfig.json | 19 + libs/clients/menu/tsconfig.lib.json | 10 + nx.json | 20 +- openapitools.json | 7 + package-lock.json | 493 ++++++++++++++- package.json | 2 + tsconfig.base.json | 3 + 109 files changed, 7745 insertions(+), 38 deletions(-) create mode 100644 .openapi-generator-ignore create mode 100644 libs/clients/dining/.eslintrc.json create mode 100644 libs/clients/dining/README.md create mode 100644 libs/clients/dining/openapi.yaml create mode 100644 libs/clients/dining/package.json create mode 100644 libs/clients/dining/project.json create mode 100644 libs/clients/dining/src/.npmignore create mode 100644 libs/clients/dining/src/.openapi-generator-ignore create mode 100644 libs/clients/dining/src/.openapi-generator/FILES create mode 100644 libs/clients/dining/src/.openapi-generator/VERSION create mode 100644 libs/clients/dining/src/api.ts create mode 100644 libs/clients/dining/src/api/health-api.ts create mode 100644 libs/clients/dining/src/api/table-orders-api.ts create mode 100644 libs/clients/dining/src/api/tables-api.ts create mode 100644 libs/clients/dining/src/base.ts create mode 100644 libs/clients/dining/src/common.ts create mode 100644 libs/clients/dining/src/configuration.ts create mode 100644 libs/clients/dining/src/index.ts create mode 100644 libs/clients/dining/src/models/add-menu-item-dto.ts create mode 100644 libs/clients/dining/src/models/add-table-dto.ts create mode 100644 libs/clients/dining/src/models/health-controller-check200-response-info-value.ts create mode 100644 libs/clients/dining/src/models/health-controller-check200-response.ts create mode 100644 libs/clients/dining/src/models/health-controller-check503-response.ts create mode 100644 libs/clients/dining/src/models/index.ts create mode 100644 libs/clients/dining/src/models/ordering-item.ts create mode 100644 libs/clients/dining/src/models/ordering-line.ts create mode 100644 libs/clients/dining/src/models/preparation-dto.ts create mode 100644 libs/clients/dining/src/models/prepared-item-dto.ts create mode 100644 libs/clients/dining/src/models/start-ordering-dto.ts create mode 100644 libs/clients/dining/src/models/table-already-exists-exception.ts create mode 100644 libs/clients/dining/src/models/table-already-taken-exception.ts create mode 100644 libs/clients/dining/src/models/table-number-not-found-exception.ts create mode 100644 libs/clients/dining/src/models/table-order-already-billed-exception.ts create mode 100644 libs/clients/dining/src/models/table-order-id-not-found-exception.ts create mode 100644 libs/clients/dining/src/models/table-order.ts create mode 100644 libs/clients/dining/src/models/table-with-order-dto.ts create mode 100644 libs/clients/dining/tsconfig.json create mode 100644 libs/clients/dining/tsconfig.lib.json create mode 100644 libs/clients/kitchen/.eslintrc.json create mode 100644 libs/clients/kitchen/README.md create mode 100644 libs/clients/kitchen/openapi.yaml create mode 100644 libs/clients/kitchen/package.json create mode 100644 libs/clients/kitchen/project.json create mode 100644 libs/clients/kitchen/src/.npmignore create mode 100644 libs/clients/kitchen/src/.openapi-generator-ignore create mode 100644 libs/clients/kitchen/src/.openapi-generator/FILES create mode 100644 libs/clients/kitchen/src/.openapi-generator/VERSION create mode 100644 libs/clients/kitchen/src/api.ts create mode 100644 libs/clients/kitchen/src/api/health-api.ts create mode 100644 libs/clients/kitchen/src/api/preparations-api.ts create mode 100644 libs/clients/kitchen/src/api/prepared-items-api.ts create mode 100644 libs/clients/kitchen/src/base.ts create mode 100644 libs/clients/kitchen/src/common.ts create mode 100644 libs/clients/kitchen/src/configuration.ts create mode 100644 libs/clients/kitchen/src/index.ts create mode 100644 libs/clients/kitchen/src/models/empty-items-to-be-cooked-sent-in-kitchen-exception.ts create mode 100644 libs/clients/kitchen/src/models/health-controller-check200-response-info-value.ts create mode 100644 libs/clients/kitchen/src/models/health-controller-check200-response.ts create mode 100644 libs/clients/kitchen/src/models/health-controller-check503-response.ts create mode 100644 libs/clients/kitchen/src/models/index.ts create mode 100644 libs/clients/kitchen/src/models/item-already-started-to-be-cooked-exception.ts create mode 100644 libs/clients/kitchen/src/models/item-not-started-to-be-cooked-exception.ts create mode 100644 libs/clients/kitchen/src/models/item-to-be-cooked-dto.ts create mode 100644 libs/clients/kitchen/src/models/preparation-dto.ts create mode 100644 libs/clients/kitchen/src/models/preparation-id-not-found-exception.ts create mode 100644 libs/clients/kitchen/src/models/preparation-not-ready-in-kitchen-exception.ts create mode 100644 libs/clients/kitchen/src/models/preparation-request-dto.ts create mode 100644 libs/clients/kitchen/src/models/prepared-item-dto.ts create mode 100644 libs/clients/kitchen/src/models/prepared-item-id-not-found-exception.ts create mode 100644 libs/clients/kitchen/src/models/prepared-item.ts create mode 100644 libs/clients/kitchen/src/models/recipe.ts create mode 100644 libs/clients/kitchen/src/models/table-number-not-found-exception.ts create mode 100644 libs/clients/kitchen/src/models/wrong-query-parameter-exception.ts create mode 100644 libs/clients/kitchen/tsconfig.json create mode 100644 libs/clients/kitchen/tsconfig.lib.json create mode 100644 libs/clients/menu/.eslintrc.json create mode 100644 libs/clients/menu/README.md create mode 100644 libs/clients/menu/openapi.yaml create mode 100644 libs/clients/menu/package.json create mode 100644 libs/clients/menu/project.json create mode 100644 libs/clients/menu/src/.npmignore create mode 100644 libs/clients/menu/src/.openapi-generator-ignore create mode 100644 libs/clients/menu/src/.openapi-generator/FILES create mode 100644 libs/clients/menu/src/.openapi-generator/VERSION create mode 100644 libs/clients/menu/src/api.ts create mode 100644 libs/clients/menu/src/api/health-api.ts create mode 100644 libs/clients/menu/src/api/menus-api.ts create mode 100644 libs/clients/menu/src/base.ts create mode 100644 libs/clients/menu/src/common.ts create mode 100644 libs/clients/menu/src/configuration.ts create mode 100644 libs/clients/menu/src/index.ts create mode 100644 libs/clients/menu/src/models/add-menu-item-dto.ts create mode 100644 libs/clients/menu/src/models/health-controller-check200-response-info-value.ts create mode 100644 libs/clients/menu/src/models/health-controller-check200-response.ts create mode 100644 libs/clients/menu/src/models/health-controller-check503-response.ts create mode 100644 libs/clients/menu/src/models/index.ts create mode 100644 libs/clients/menu/src/models/menu-item-id-not-found-exception.ts create mode 100644 libs/clients/menu/src/models/menu-item-short-name-already-exists-exception.ts create mode 100644 libs/clients/menu/src/models/menu-item.ts create mode 100644 libs/clients/menu/tsconfig.json create mode 100644 libs/clients/menu/tsconfig.lib.json create mode 100644 openapitools.json diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..7c88d93 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +**/**/.gitignore +**/**/git_push.sh diff --git a/apps/sample-nestjs/src/app/app.service.ts b/apps/sample-nestjs/src/app/app.service.ts index cd8cede..355aaa8 100644 --- a/apps/sample-nestjs/src/app/app.service.ts +++ b/apps/sample-nestjs/src/app/app.service.ts @@ -1,8 +1,11 @@ import { Injectable } from '@nestjs/common'; +import {TablesApi, TableWithOrderDto} from "@spos/clients/dining"; +import axios from "axios"; @Injectable() export class AppService { - getData(): { message: string } { - return { message: 'Hello API' }; + tableApi = new TablesApi(); + async getData() { + return (await this.tableApi.tablesControllerListAllTables()).data; } } diff --git a/apps/sample-react/src/app/app.tsx b/apps/sample-react/src/app/app.tsx index 5319be6..587c2a6 100644 --- a/apps/sample-react/src/app/app.tsx +++ b/apps/sample-react/src/app/app.tsx @@ -1,9 +1,28 @@ -import NxWelcome from './nx-welcome'; +import {useQuery} from "@tanstack/react-query"; +import {MenusApi} from "@spos/clients/menu"; + +const menusApi = new MenusApi( +) export function App() { + const query = useQuery({ + queryKey: ['menus'], queryFn: () => { + return menusApi.menusControllerGetFullMenu() + } + }) + if (query.isLoading) { + return
Loading...
+ } + if (query.isError) { + return
Error: {query.error}
+ } + if (!query.data) { + return
No data
+ } + return (
- +
{JSON.stringify(query.data, null, 2)}
); } diff --git a/apps/sample-react/src/main.tsx b/apps/sample-react/src/main.tsx index 5b0ece9..8c28b20 100644 --- a/apps/sample-react/src/main.tsx +++ b/apps/sample-react/src/main.tsx @@ -2,12 +2,17 @@ import { StrictMode } from 'react'; import * as ReactDOM from 'react-dom/client'; import App from './app/app'; +import {QueryClient, QueryClientProvider} from "@tanstack/react-query"; + +const queryClient = new QueryClient() const root = ReactDOM.createRoot( document.getElementById('root') as HTMLElement ); root.render( + + ); diff --git a/libs/clients/dining/.eslintrc.json b/libs/clients/dining/.eslintrc.json new file mode 100644 index 0000000..3230caf --- /dev/null +++ b/libs/clients/dining/.eslintrc.json @@ -0,0 +1,25 @@ +{ + "extends": ["../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.json"], + "parser": "jsonc-eslint-parser", + "rules": { + "@nx/dependency-checks": "error" + } + } + ] +} diff --git a/libs/clients/dining/README.md b/libs/clients/dining/README.md new file mode 100644 index 0000000..6ce7b6f --- /dev/null +++ b/libs/clients/dining/README.md @@ -0,0 +1,7 @@ +# clients-dining + +This library was generated with [Nx](https://nx.dev). + +## Building + +Run `nx build clients-dining` to build the library. diff --git a/libs/clients/dining/openapi.yaml b/libs/clients/dining/openapi.yaml new file mode 100644 index 0000000..787613f --- /dev/null +++ b/libs/clients/dining/openapi.yaml @@ -0,0 +1,533 @@ +openapi: 3.0.0 +paths: + /health: + get: + operationId: HealthController_check + parameters: [] + responses: + '200': + description: The Health Check is successful + content: + application/json: + schema: + type: object + properties: + status: + type: string + example: ok + info: + type: object + example: + database: + status: up + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + error: + type: object + example: {} + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + details: + type: object + example: + database: + status: up + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + '503': + description: The Health Check is not successful + content: + application/json: + schema: + type: object + properties: + status: + type: string + example: error + info: + type: object + example: + database: + status: up + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + error: + type: object + example: + redis: + status: down + message: Could not connect + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + details: + type: object + example: + database: + status: up + redis: + status: down + message: Could not connect + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + tags: + - health + /tables: + get: + operationId: TablesController_listAllTables + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TableWithOrderDto' + tags: + - tables + post: + operationId: TablesController_addTable + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AddTableDto' + responses: + '201': + description: The table has been successfully added. + content: + application/json: + schema: + $ref: '#/components/schemas/TableWithOrderDto' + '409': + description: Table already exists + content: + application/json: + schema: + $ref: '#/components/schemas/TableAlreadyExistsException' + tags: + - tables + /tables/{tableNumber}: + get: + operationId: TablesController_getTableByNumber + parameters: + - name: tableNumber + required: true + in: path + schema: + type: number + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/TableWithOrderDto' + '404': + description: Table not found + content: + application/json: + schema: + $ref: '#/components/schemas/TableNumberNotFoundException' + tags: + - tables + /tableOrders: + get: + operationId: TableOrdersController_listAllTableOrders + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TableOrder' + tags: + - tableOrders + post: + operationId: TableOrdersController_openTable + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StartOrderingDto' + responses: + '201': + description: The table has been successfully opened. + content: + application/json: + schema: + $ref: '#/components/schemas/TableOrder' + '404': + description: Table not found + content: + application/json: + schema: + $ref: '#/components/schemas/TableNumberNotFoundException' + '422': + description: Table is already taken + content: + application/json: + schema: + $ref: '#/components/schemas/TableAlreadyTakenException' + tags: + - tableOrders + /tableOrders/{tableOrderId}: + get: + operationId: TableOrdersController_getTableOrderById + parameters: + - name: tableOrderId + required: true + in: path + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/TableOrder' + '404': + description: Table order not found + content: + application/json: + schema: + $ref: '#/components/schemas/TableOrderIdNotFoundException' + tags: + - tableOrders + post: + operationId: TableOrdersController_addMenuItemToTableOrder + parameters: + - name: tableOrderId + required: true + in: path + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AddMenuItemDto' + responses: + '201': + description: The menu item has been successfully added to the table order. + content: + application/json: + schema: + $ref: '#/components/schemas/TableOrder' + '404': + description: Table order not found + content: + application/json: + schema: + $ref: '#/components/schemas/TableOrderIdNotFoundException' + '422': + description: TableOrder is already billed + content: + application/json: + schema: + $ref: '#/components/schemas/TableOrderAlreadyBilledException' + tags: + - tableOrders + /tableOrders/{tableOrderId}/prepare: + post: + operationId: TableOrdersController_prepareTableOrder + parameters: + - name: tableOrderId + required: true + in: path + schema: + type: string + responses: + '201': + description: The menu items have been successfully sent for preparation. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PreparationDto' + '404': + description: Table order not found + content: + application/json: + schema: + $ref: '#/components/schemas/TableOrderIdNotFoundException' + '422': + description: TableOrder is already billed + content: + application/json: + schema: + $ref: '#/components/schemas/TableOrderAlreadyBilledException' + tags: + - tableOrders + /tableOrders/{tableOrderId}/bill: + post: + operationId: TableOrdersController_billTableOrder + parameters: + - name: tableOrderId + required: true + in: path + schema: + type: string + responses: + '200': + description: The table has been successfully billed. + content: + application/json: + schema: + $ref: '#/components/schemas/TableOrder' + '404': + description: Table order not found + content: + application/json: + schema: + $ref: '#/components/schemas/TableOrderIdNotFoundException' + '422': + description: TableOrder is already billed + content: + application/json: + schema: + $ref: '#/components/schemas/TableOrderAlreadyBilledException' + tags: + - tableOrders +info: + title: 'Micro-Service Restaurant: Dining Service' + description: Dining Service Open API definition + contact: {} + version: 0.0.0 +tags: [] +servers: + - url: https://dining-backend.spos.polytech.apoorva64.com/ + description: Prod +components: + schemas: + TableWithOrderDto: + type: object + properties: + _id: + type: string + number: + type: number + minimum: 1 + taken: + type: boolean + tableOrderId: + type: string + required: + - _id + - number + - taken + - tableOrderId + TableNumberNotFoundException: + type: object + properties: + error: + type: string + details: + type: string + required: + - error + - details + AddTableDto: + type: object + properties: + number: + type: number + minimum: 1 + required: + - number + TableAlreadyExistsException: + type: object + properties: + error: + type: string + details: + type: string + required: + - error + - details + OrderingItem: + type: object + properties: + _id: + type: string + shortName: + type: string + required: + - _id + - shortName + OrderingLine: + type: object + properties: + item: + $ref: '#/components/schemas/OrderingItem' + howMany: + type: number + sentForPreparation: + type: boolean + required: + - item + - howMany + - sentForPreparation + PreparedItemDto: + type: object + properties: + _id: + type: string + shortName: + type: string + required: + - _id + - shortName + PreparationDto: + type: object + properties: + _id: + type: string + shouldBeReadyAt: + type: string + preparedItems: + type: array + items: + $ref: '#/components/schemas/PreparedItemDto' + required: + - _id + - shouldBeReadyAt + - preparedItems + TableOrder: + type: object + properties: + _id: + type: string + tableNumber: + type: number + customersCount: + type: number + opened: + format: date-time + type: string + lines: + type: array + items: + $ref: '#/components/schemas/OrderingLine' + preparations: + type: array + items: + $ref: '#/components/schemas/PreparationDto' + billed: + format: date-time + type: string + required: + - _id + - tableNumber + - customersCount + - opened + - lines + - preparations + - billed + StartOrderingDto: + type: object + properties: + tableNumber: + type: number + minimum: 1 + customersCount: + type: number + minimum: 1 + required: + - tableNumber + - customersCount + TableAlreadyTakenException: + type: object + properties: + error: + type: string + details: + type: string + required: + - error + - details + TableOrderIdNotFoundException: + type: object + properties: + error: + type: string + details: + type: string + required: + - error + - details + AddMenuItemDto: + type: object + properties: + menuItemId: + type: string + menuItemShortName: + type: string + howMany: + type: number + minimum: 1 + required: + - menuItemId + - menuItemShortName + - howMany + TableOrderAlreadyBilledException: + type: object + properties: + error: + type: string + details: + type: string + required: + - error + - details diff --git a/libs/clients/dining/package.json b/libs/clients/dining/package.json new file mode 100644 index 0000000..0d768c0 --- /dev/null +++ b/libs/clients/dining/package.json @@ -0,0 +1,12 @@ +{ + "name": "@spos/clients/dining", + "version": "0.0.1", + "dependencies": { + "tslib": "^2.3.0", + "axios": "^1.7.7" + }, + "type": "commonjs", + "main": "./src/index.js", + "typings": "./src/index.d.ts", + "private": true +} diff --git a/libs/clients/dining/project.json b/libs/clients/dining/project.json new file mode 100644 index 0000000..c8231eb --- /dev/null +++ b/libs/clients/dining/project.json @@ -0,0 +1,35 @@ +{ + "name": "clients-dining", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/clients/dining/src", + "projectType": "library", + "tags": [], + "targets": { + "build": { + "executor": "@nx/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/libs/clients/dining", + "main": "libs/clients/dining/src/index.ts", + "tsConfig": "libs/clients/dining/tsconfig.lib.json", + "assets": ["libs/clients/dining/*.md"] + } + }, + "generate": { + "executor": "nx:run-commands", + "options": { + "parallel": false, + "commands": [ + { + "command": "npx rimraf libs/clients/dining/src", + "description": "Clean up generated API client" + }, + { + "command": "npx openapi-generator-cli generate -i libs/clients/dining/openapi.yaml -g typescript-axios -o libs/clients/dining/src --ignore-file-override=.openapi-generator-ignore --additional-properties=useSingleRequestParameter=true,withSeparateModelsAndApi=true,apiPackage=api,modelPackage=models", + "description": "Generate API client from OpenAPI spec" + } + ] + } + } + } +} diff --git a/libs/clients/dining/src/.npmignore b/libs/clients/dining/src/.npmignore new file mode 100644 index 0000000..999d88d --- /dev/null +++ b/libs/clients/dining/src/.npmignore @@ -0,0 +1 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm \ No newline at end of file diff --git a/libs/clients/dining/src/.openapi-generator-ignore b/libs/clients/dining/src/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/libs/clients/dining/src/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/libs/clients/dining/src/.openapi-generator/FILES b/libs/clients/dining/src/.openapi-generator/FILES new file mode 100644 index 0000000..f6a35f4 --- /dev/null +++ b/libs/clients/dining/src/.openapi-generator/FILES @@ -0,0 +1,28 @@ +.npmignore +.openapi-generator-ignore +api.ts +api/health-api.ts +api/table-orders-api.ts +api/tables-api.ts +base.ts +common.ts +configuration.ts +index.ts +models/add-menu-item-dto.ts +models/add-table-dto.ts +models/health-controller-check200-response-info-value.ts +models/health-controller-check200-response.ts +models/health-controller-check503-response.ts +models/index.ts +models/ordering-item.ts +models/ordering-line.ts +models/preparation-dto.ts +models/prepared-item-dto.ts +models/start-ordering-dto.ts +models/table-already-exists-exception.ts +models/table-already-taken-exception.ts +models/table-number-not-found-exception.ts +models/table-order-already-billed-exception.ts +models/table-order-id-not-found-exception.ts +models/table-order.ts +models/table-with-order-dto.ts diff --git a/libs/clients/dining/src/.openapi-generator/VERSION b/libs/clients/dining/src/.openapi-generator/VERSION new file mode 100644 index 0000000..09a6d30 --- /dev/null +++ b/libs/clients/dining/src/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0 diff --git a/libs/clients/dining/src/api.ts b/libs/clients/dining/src/api.ts new file mode 100644 index 0000000..110d14e --- /dev/null +++ b/libs/clients/dining/src/api.ts @@ -0,0 +1,20 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +export * from './api/health-api'; +export * from './api/table-orders-api'; +export * from './api/tables-api'; + diff --git a/libs/clients/dining/src/api/health-api.ts b/libs/clients/dining/src/api/health-api.ts new file mode 100644 index 0000000..2b00d02 --- /dev/null +++ b/libs/clients/dining/src/api/health-api.ts @@ -0,0 +1,122 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { HealthControllerCheck200Response } from '../models'; +// @ts-ignore +import type { HealthControllerCheck503Response } from '../models'; +/** + * HealthApi - axios parameter creator + * @export + */ +export const HealthApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + healthControllerCheck: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/health`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * HealthApi - functional programming interface + * @export + */ +export const HealthApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = HealthApiAxiosParamCreator(configuration) + return { + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async healthControllerCheck(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.healthControllerCheck(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['HealthApi.healthControllerCheck']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * HealthApi - factory interface + * @export + */ +export const HealthApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = HealthApiFp(configuration) + return { + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + healthControllerCheck(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.healthControllerCheck(options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * HealthApi - object-oriented interface + * @export + * @class HealthApi + * @extends {BaseAPI} + */ +export class HealthApi extends BaseAPI { + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof HealthApi + */ + public healthControllerCheck(options?: RawAxiosRequestConfig) { + return HealthApiFp(this.configuration).healthControllerCheck(options).then((request) => request(this.axios, this.basePath)); + } +} + diff --git a/libs/clients/dining/src/api/table-orders-api.ts b/libs/clients/dining/src/api/table-orders-api.ts new file mode 100644 index 0000000..46fc438 --- /dev/null +++ b/libs/clients/dining/src/api/table-orders-api.ts @@ -0,0 +1,545 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { AddMenuItemDto } from '../models'; +// @ts-ignore +import type { PreparationDto } from '../models'; +// @ts-ignore +import type { StartOrderingDto } from '../models'; +// @ts-ignore +import type { TableAlreadyTakenException } from '../models'; +// @ts-ignore +import type { TableNumberNotFoundException } from '../models'; +// @ts-ignore +import type { TableOrder } from '../models'; +// @ts-ignore +import type { TableOrderAlreadyBilledException } from '../models'; +// @ts-ignore +import type { TableOrderIdNotFoundException } from '../models'; +/** + * TableOrdersApi - axios parameter creator + * @export + */ +export const TableOrdersApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @param {string} tableOrderId + * @param {AddMenuItemDto} addMenuItemDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tableOrdersControllerAddMenuItemToTableOrder: async (tableOrderId: string, addMenuItemDto: AddMenuItemDto, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'tableOrderId' is not null or undefined + assertParamExists('tableOrdersControllerAddMenuItemToTableOrder', 'tableOrderId', tableOrderId) + // verify required parameter 'addMenuItemDto' is not null or undefined + assertParamExists('tableOrdersControllerAddMenuItemToTableOrder', 'addMenuItemDto', addMenuItemDto) + const localVarPath = `/tableOrders/{tableOrderId}` + .replace(`{${"tableOrderId"}}`, encodeURIComponent(String(tableOrderId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(addMenuItemDto, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} tableOrderId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tableOrdersControllerBillTableOrder: async (tableOrderId: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'tableOrderId' is not null or undefined + assertParamExists('tableOrdersControllerBillTableOrder', 'tableOrderId', tableOrderId) + const localVarPath = `/tableOrders/{tableOrderId}/bill` + .replace(`{${"tableOrderId"}}`, encodeURIComponent(String(tableOrderId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} tableOrderId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tableOrdersControllerGetTableOrderById: async (tableOrderId: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'tableOrderId' is not null or undefined + assertParamExists('tableOrdersControllerGetTableOrderById', 'tableOrderId', tableOrderId) + const localVarPath = `/tableOrders/{tableOrderId}` + .replace(`{${"tableOrderId"}}`, encodeURIComponent(String(tableOrderId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tableOrdersControllerListAllTableOrders: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/tableOrders`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {StartOrderingDto} startOrderingDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tableOrdersControllerOpenTable: async (startOrderingDto: StartOrderingDto, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'startOrderingDto' is not null or undefined + assertParamExists('tableOrdersControllerOpenTable', 'startOrderingDto', startOrderingDto) + const localVarPath = `/tableOrders`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(startOrderingDto, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} tableOrderId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tableOrdersControllerPrepareTableOrder: async (tableOrderId: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'tableOrderId' is not null or undefined + assertParamExists('tableOrdersControllerPrepareTableOrder', 'tableOrderId', tableOrderId) + const localVarPath = `/tableOrders/{tableOrderId}/prepare` + .replace(`{${"tableOrderId"}}`, encodeURIComponent(String(tableOrderId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * TableOrdersApi - functional programming interface + * @export + */ +export const TableOrdersApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = TableOrdersApiAxiosParamCreator(configuration) + return { + /** + * + * @param {string} tableOrderId + * @param {AddMenuItemDto} addMenuItemDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async tableOrdersControllerAddMenuItemToTableOrder(tableOrderId: string, addMenuItemDto: AddMenuItemDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.tableOrdersControllerAddMenuItemToTableOrder(tableOrderId, addMenuItemDto, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['TableOrdersApi.tableOrdersControllerAddMenuItemToTableOrder']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {string} tableOrderId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async tableOrdersControllerBillTableOrder(tableOrderId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.tableOrdersControllerBillTableOrder(tableOrderId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['TableOrdersApi.tableOrdersControllerBillTableOrder']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {string} tableOrderId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async tableOrdersControllerGetTableOrderById(tableOrderId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.tableOrdersControllerGetTableOrderById(tableOrderId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['TableOrdersApi.tableOrdersControllerGetTableOrderById']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async tableOrdersControllerListAllTableOrders(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.tableOrdersControllerListAllTableOrders(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['TableOrdersApi.tableOrdersControllerListAllTableOrders']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {StartOrderingDto} startOrderingDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async tableOrdersControllerOpenTable(startOrderingDto: StartOrderingDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.tableOrdersControllerOpenTable(startOrderingDto, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['TableOrdersApi.tableOrdersControllerOpenTable']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {string} tableOrderId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async tableOrdersControllerPrepareTableOrder(tableOrderId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.tableOrdersControllerPrepareTableOrder(tableOrderId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['TableOrdersApi.tableOrdersControllerPrepareTableOrder']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * TableOrdersApi - factory interface + * @export + */ +export const TableOrdersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = TableOrdersApiFp(configuration) + return { + /** + * + * @param {TableOrdersApiTableOrdersControllerAddMenuItemToTableOrderRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tableOrdersControllerAddMenuItemToTableOrder(requestParameters: TableOrdersApiTableOrdersControllerAddMenuItemToTableOrderRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.tableOrdersControllerAddMenuItemToTableOrder(requestParameters.tableOrderId, requestParameters.addMenuItemDto, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {TableOrdersApiTableOrdersControllerBillTableOrderRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tableOrdersControllerBillTableOrder(requestParameters: TableOrdersApiTableOrdersControllerBillTableOrderRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.tableOrdersControllerBillTableOrder(requestParameters.tableOrderId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {TableOrdersApiTableOrdersControllerGetTableOrderByIdRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tableOrdersControllerGetTableOrderById(requestParameters: TableOrdersApiTableOrdersControllerGetTableOrderByIdRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.tableOrdersControllerGetTableOrderById(requestParameters.tableOrderId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tableOrdersControllerListAllTableOrders(options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.tableOrdersControllerListAllTableOrders(options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {TableOrdersApiTableOrdersControllerOpenTableRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tableOrdersControllerOpenTable(requestParameters: TableOrdersApiTableOrdersControllerOpenTableRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.tableOrdersControllerOpenTable(requestParameters.startOrderingDto, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {TableOrdersApiTableOrdersControllerPrepareTableOrderRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tableOrdersControllerPrepareTableOrder(requestParameters: TableOrdersApiTableOrdersControllerPrepareTableOrderRequest, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.tableOrdersControllerPrepareTableOrder(requestParameters.tableOrderId, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for tableOrdersControllerAddMenuItemToTableOrder operation in TableOrdersApi. + * @export + * @interface TableOrdersApiTableOrdersControllerAddMenuItemToTableOrderRequest + */ +export interface TableOrdersApiTableOrdersControllerAddMenuItemToTableOrderRequest { + /** + * + * @type {string} + * @memberof TableOrdersApiTableOrdersControllerAddMenuItemToTableOrder + */ + readonly tableOrderId: string + + /** + * + * @type {AddMenuItemDto} + * @memberof TableOrdersApiTableOrdersControllerAddMenuItemToTableOrder + */ + readonly addMenuItemDto: AddMenuItemDto +} + +/** + * Request parameters for tableOrdersControllerBillTableOrder operation in TableOrdersApi. + * @export + * @interface TableOrdersApiTableOrdersControllerBillTableOrderRequest + */ +export interface TableOrdersApiTableOrdersControllerBillTableOrderRequest { + /** + * + * @type {string} + * @memberof TableOrdersApiTableOrdersControllerBillTableOrder + */ + readonly tableOrderId: string +} + +/** + * Request parameters for tableOrdersControllerGetTableOrderById operation in TableOrdersApi. + * @export + * @interface TableOrdersApiTableOrdersControllerGetTableOrderByIdRequest + */ +export interface TableOrdersApiTableOrdersControllerGetTableOrderByIdRequest { + /** + * + * @type {string} + * @memberof TableOrdersApiTableOrdersControllerGetTableOrderById + */ + readonly tableOrderId: string +} + +/** + * Request parameters for tableOrdersControllerOpenTable operation in TableOrdersApi. + * @export + * @interface TableOrdersApiTableOrdersControllerOpenTableRequest + */ +export interface TableOrdersApiTableOrdersControllerOpenTableRequest { + /** + * + * @type {StartOrderingDto} + * @memberof TableOrdersApiTableOrdersControllerOpenTable + */ + readonly startOrderingDto: StartOrderingDto +} + +/** + * Request parameters for tableOrdersControllerPrepareTableOrder operation in TableOrdersApi. + * @export + * @interface TableOrdersApiTableOrdersControllerPrepareTableOrderRequest + */ +export interface TableOrdersApiTableOrdersControllerPrepareTableOrderRequest { + /** + * + * @type {string} + * @memberof TableOrdersApiTableOrdersControllerPrepareTableOrder + */ + readonly tableOrderId: string +} + +/** + * TableOrdersApi - object-oriented interface + * @export + * @class TableOrdersApi + * @extends {BaseAPI} + */ +export class TableOrdersApi extends BaseAPI { + /** + * + * @param {TableOrdersApiTableOrdersControllerAddMenuItemToTableOrderRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TableOrdersApi + */ + public tableOrdersControllerAddMenuItemToTableOrder(requestParameters: TableOrdersApiTableOrdersControllerAddMenuItemToTableOrderRequest, options?: RawAxiosRequestConfig) { + return TableOrdersApiFp(this.configuration).tableOrdersControllerAddMenuItemToTableOrder(requestParameters.tableOrderId, requestParameters.addMenuItemDto, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {TableOrdersApiTableOrdersControllerBillTableOrderRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TableOrdersApi + */ + public tableOrdersControllerBillTableOrder(requestParameters: TableOrdersApiTableOrdersControllerBillTableOrderRequest, options?: RawAxiosRequestConfig) { + return TableOrdersApiFp(this.configuration).tableOrdersControllerBillTableOrder(requestParameters.tableOrderId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {TableOrdersApiTableOrdersControllerGetTableOrderByIdRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TableOrdersApi + */ + public tableOrdersControllerGetTableOrderById(requestParameters: TableOrdersApiTableOrdersControllerGetTableOrderByIdRequest, options?: RawAxiosRequestConfig) { + return TableOrdersApiFp(this.configuration).tableOrdersControllerGetTableOrderById(requestParameters.tableOrderId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TableOrdersApi + */ + public tableOrdersControllerListAllTableOrders(options?: RawAxiosRequestConfig) { + return TableOrdersApiFp(this.configuration).tableOrdersControllerListAllTableOrders(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {TableOrdersApiTableOrdersControllerOpenTableRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TableOrdersApi + */ + public tableOrdersControllerOpenTable(requestParameters: TableOrdersApiTableOrdersControllerOpenTableRequest, options?: RawAxiosRequestConfig) { + return TableOrdersApiFp(this.configuration).tableOrdersControllerOpenTable(requestParameters.startOrderingDto, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {TableOrdersApiTableOrdersControllerPrepareTableOrderRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TableOrdersApi + */ + public tableOrdersControllerPrepareTableOrder(requestParameters: TableOrdersApiTableOrdersControllerPrepareTableOrderRequest, options?: RawAxiosRequestConfig) { + return TableOrdersApiFp(this.configuration).tableOrdersControllerPrepareTableOrder(requestParameters.tableOrderId, options).then((request) => request(this.axios, this.basePath)); + } +} + diff --git a/libs/clients/dining/src/api/tables-api.ts b/libs/clients/dining/src/api/tables-api.ts new file mode 100644 index 0000000..207f590 --- /dev/null +++ b/libs/clients/dining/src/api/tables-api.ts @@ -0,0 +1,286 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { AddTableDto } from '../models'; +// @ts-ignore +import type { TableAlreadyExistsException } from '../models'; +// @ts-ignore +import type { TableNumberNotFoundException } from '../models'; +// @ts-ignore +import type { TableWithOrderDto } from '../models'; +/** + * TablesApi - axios parameter creator + * @export + */ +export const TablesApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @param {AddTableDto} addTableDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tablesControllerAddTable: async (addTableDto: AddTableDto, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'addTableDto' is not null or undefined + assertParamExists('tablesControllerAddTable', 'addTableDto', addTableDto) + const localVarPath = `/tables`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(addTableDto, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {number} tableNumber + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tablesControllerGetTableByNumber: async (tableNumber: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'tableNumber' is not null or undefined + assertParamExists('tablesControllerGetTableByNumber', 'tableNumber', tableNumber) + const localVarPath = `/tables/{tableNumber}` + .replace(`{${"tableNumber"}}`, encodeURIComponent(String(tableNumber))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tablesControllerListAllTables: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/tables`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * TablesApi - functional programming interface + * @export + */ +export const TablesApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = TablesApiAxiosParamCreator(configuration) + return { + /** + * + * @param {AddTableDto} addTableDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async tablesControllerAddTable(addTableDto: AddTableDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.tablesControllerAddTable(addTableDto, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['TablesApi.tablesControllerAddTable']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {number} tableNumber + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async tablesControllerGetTableByNumber(tableNumber: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.tablesControllerGetTableByNumber(tableNumber, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['TablesApi.tablesControllerGetTableByNumber']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async tablesControllerListAllTables(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.tablesControllerListAllTables(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['TablesApi.tablesControllerListAllTables']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * TablesApi - factory interface + * @export + */ +export const TablesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = TablesApiFp(configuration) + return { + /** + * + * @param {TablesApiTablesControllerAddTableRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tablesControllerAddTable(requestParameters: TablesApiTablesControllerAddTableRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.tablesControllerAddTable(requestParameters.addTableDto, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {TablesApiTablesControllerGetTableByNumberRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tablesControllerGetTableByNumber(requestParameters: TablesApiTablesControllerGetTableByNumberRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.tablesControllerGetTableByNumber(requestParameters.tableNumber, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + tablesControllerListAllTables(options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.tablesControllerListAllTables(options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for tablesControllerAddTable operation in TablesApi. + * @export + * @interface TablesApiTablesControllerAddTableRequest + */ +export interface TablesApiTablesControllerAddTableRequest { + /** + * + * @type {AddTableDto} + * @memberof TablesApiTablesControllerAddTable + */ + readonly addTableDto: AddTableDto +} + +/** + * Request parameters for tablesControllerGetTableByNumber operation in TablesApi. + * @export + * @interface TablesApiTablesControllerGetTableByNumberRequest + */ +export interface TablesApiTablesControllerGetTableByNumberRequest { + /** + * + * @type {number} + * @memberof TablesApiTablesControllerGetTableByNumber + */ + readonly tableNumber: number +} + +/** + * TablesApi - object-oriented interface + * @export + * @class TablesApi + * @extends {BaseAPI} + */ +export class TablesApi extends BaseAPI { + /** + * + * @param {TablesApiTablesControllerAddTableRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TablesApi + */ + public tablesControllerAddTable(requestParameters: TablesApiTablesControllerAddTableRequest, options?: RawAxiosRequestConfig) { + return TablesApiFp(this.configuration).tablesControllerAddTable(requestParameters.addTableDto, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {TablesApiTablesControllerGetTableByNumberRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TablesApi + */ + public tablesControllerGetTableByNumber(requestParameters: TablesApiTablesControllerGetTableByNumberRequest, options?: RawAxiosRequestConfig) { + return TablesApiFp(this.configuration).tablesControllerGetTableByNumber(requestParameters.tableNumber, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TablesApi + */ + public tablesControllerListAllTables(options?: RawAxiosRequestConfig) { + return TablesApiFp(this.configuration).tablesControllerListAllTables(options).then((request) => request(this.axios, this.basePath)); + } +} + diff --git a/libs/clients/dining/src/base.ts b/libs/clients/dining/src/base.ts new file mode 100644 index 0000000..7f68f39 --- /dev/null +++ b/libs/clients/dining/src/base.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from './configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; + +export const BASE_PATH = "https://dining-backend.spos.polytech.apoorva64.com".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: RawAxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath ?? basePath; + } + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + constructor(public field: string, msg?: string) { + super(msg); + this.name = "RequiredError" + } +} + +interface ServerMap { + [key: string]: { + url: string, + description: string, + }[]; +} + +/** + * + * @export + */ +export const operationServerMap: ServerMap = { +} diff --git a/libs/clients/dining/src/common.ts b/libs/clients/dining/src/common.ts new file mode 100644 index 0000000..b57f21e --- /dev/null +++ b/libs/clients/dining/src/common.ts @@ -0,0 +1,150 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/libs/clients/dining/src/configuration.ts b/libs/clients/dining/src/configuration.ts new file mode 100644 index 0000000..330b445 --- /dev/null +++ b/libs/clients/dining/src/configuration.ts @@ -0,0 +1,110 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ConfigurationParameters { + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + serverIndex?: number; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.serverIndex = param.serverIndex; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/libs/clients/dining/src/index.ts b/libs/clients/dining/src/index.ts new file mode 100644 index 0000000..00352c9 --- /dev/null +++ b/libs/clients/dining/src/index.ts @@ -0,0 +1,18 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; +export * from "./models"; diff --git a/libs/clients/dining/src/models/add-menu-item-dto.ts b/libs/clients/dining/src/models/add-menu-item-dto.ts new file mode 100644 index 0000000..c51f8ba --- /dev/null +++ b/libs/clients/dining/src/models/add-menu-item-dto.ts @@ -0,0 +1,42 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface AddMenuItemDto + */ +export interface AddMenuItemDto { + /** + * + * @type {string} + * @memberof AddMenuItemDto + */ + 'menuItemId': string; + /** + * + * @type {string} + * @memberof AddMenuItemDto + */ + 'menuItemShortName': string; + /** + * + * @type {number} + * @memberof AddMenuItemDto + */ + 'howMany': number; +} + diff --git a/libs/clients/dining/src/models/add-table-dto.ts b/libs/clients/dining/src/models/add-table-dto.ts new file mode 100644 index 0000000..5cb617d --- /dev/null +++ b/libs/clients/dining/src/models/add-table-dto.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface AddTableDto + */ +export interface AddTableDto { + /** + * + * @type {number} + * @memberof AddTableDto + */ + 'number': number; +} + diff --git a/libs/clients/dining/src/models/health-controller-check200-response-info-value.ts b/libs/clients/dining/src/models/health-controller-check200-response-info-value.ts new file mode 100644 index 0000000..63464ad --- /dev/null +++ b/libs/clients/dining/src/models/health-controller-check200-response-info-value.ts @@ -0,0 +1,32 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface HealthControllerCheck200ResponseInfoValue + */ +export interface HealthControllerCheck200ResponseInfoValue { + [key: string]: any; + + /** + * + * @type {string} + * @memberof HealthControllerCheck200ResponseInfoValue + */ + 'status': string; +} + diff --git a/libs/clients/dining/src/models/health-controller-check200-response.ts b/libs/clients/dining/src/models/health-controller-check200-response.ts new file mode 100644 index 0000000..933600a --- /dev/null +++ b/libs/clients/dining/src/models/health-controller-check200-response.ts @@ -0,0 +1,51 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { HealthControllerCheck200ResponseInfoValue } from './health-controller-check200-response-info-value'; + +/** + * + * @export + * @interface HealthControllerCheck200Response + */ +export interface HealthControllerCheck200Response { + /** + * + * @type {string} + * @memberof HealthControllerCheck200Response + */ + 'status'?: string; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck200Response + */ + 'info'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; } | null; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck200Response + */ + 'error'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; } | null; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck200Response + */ + 'details'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; }; +} + diff --git a/libs/clients/dining/src/models/health-controller-check503-response.ts b/libs/clients/dining/src/models/health-controller-check503-response.ts new file mode 100644 index 0000000..eb9355a --- /dev/null +++ b/libs/clients/dining/src/models/health-controller-check503-response.ts @@ -0,0 +1,51 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { HealthControllerCheck200ResponseInfoValue } from './health-controller-check200-response-info-value'; + +/** + * + * @export + * @interface HealthControllerCheck503Response + */ +export interface HealthControllerCheck503Response { + /** + * + * @type {string} + * @memberof HealthControllerCheck503Response + */ + 'status'?: string; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck503Response + */ + 'info'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; } | null; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck503Response + */ + 'error'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; } | null; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck503Response + */ + 'details'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; }; +} + diff --git a/libs/clients/dining/src/models/index.ts b/libs/clients/dining/src/models/index.ts new file mode 100644 index 0000000..f035bc7 --- /dev/null +++ b/libs/clients/dining/src/models/index.ts @@ -0,0 +1,17 @@ +export * from './add-menu-item-dto'; +export * from './add-table-dto'; +export * from './health-controller-check200-response'; +export * from './health-controller-check200-response-info-value'; +export * from './health-controller-check503-response'; +export * from './ordering-item'; +export * from './ordering-line'; +export * from './preparation-dto'; +export * from './prepared-item-dto'; +export * from './start-ordering-dto'; +export * from './table-already-exists-exception'; +export * from './table-already-taken-exception'; +export * from './table-number-not-found-exception'; +export * from './table-order'; +export * from './table-order-already-billed-exception'; +export * from './table-order-id-not-found-exception'; +export * from './table-with-order-dto'; diff --git a/libs/clients/dining/src/models/ordering-item.ts b/libs/clients/dining/src/models/ordering-item.ts new file mode 100644 index 0000000..e57ff25 --- /dev/null +++ b/libs/clients/dining/src/models/ordering-item.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface OrderingItem + */ +export interface OrderingItem { + /** + * + * @type {string} + * @memberof OrderingItem + */ + '_id': string; + /** + * + * @type {string} + * @memberof OrderingItem + */ + 'shortName': string; +} + diff --git a/libs/clients/dining/src/models/ordering-line.ts b/libs/clients/dining/src/models/ordering-line.ts new file mode 100644 index 0000000..8219d77 --- /dev/null +++ b/libs/clients/dining/src/models/ordering-line.ts @@ -0,0 +1,45 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { OrderingItem } from './ordering-item'; + +/** + * + * @export + * @interface OrderingLine + */ +export interface OrderingLine { + /** + * + * @type {OrderingItem} + * @memberof OrderingLine + */ + 'item': OrderingItem; + /** + * + * @type {number} + * @memberof OrderingLine + */ + 'howMany': number; + /** + * + * @type {boolean} + * @memberof OrderingLine + */ + 'sentForPreparation': boolean; +} + diff --git a/libs/clients/dining/src/models/preparation-dto.ts b/libs/clients/dining/src/models/preparation-dto.ts new file mode 100644 index 0000000..79953fc --- /dev/null +++ b/libs/clients/dining/src/models/preparation-dto.ts @@ -0,0 +1,45 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { PreparedItemDto } from './prepared-item-dto'; + +/** + * + * @export + * @interface PreparationDto + */ +export interface PreparationDto { + /** + * + * @type {string} + * @memberof PreparationDto + */ + '_id': string; + /** + * + * @type {string} + * @memberof PreparationDto + */ + 'shouldBeReadyAt': string; + /** + * + * @type {Array} + * @memberof PreparationDto + */ + 'preparedItems': Array; +} + diff --git a/libs/clients/dining/src/models/prepared-item-dto.ts b/libs/clients/dining/src/models/prepared-item-dto.ts new file mode 100644 index 0000000..ce8bca3 --- /dev/null +++ b/libs/clients/dining/src/models/prepared-item-dto.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface PreparedItemDto + */ +export interface PreparedItemDto { + /** + * + * @type {string} + * @memberof PreparedItemDto + */ + '_id': string; + /** + * + * @type {string} + * @memberof PreparedItemDto + */ + 'shortName': string; +} + diff --git a/libs/clients/dining/src/models/start-ordering-dto.ts b/libs/clients/dining/src/models/start-ordering-dto.ts new file mode 100644 index 0000000..6871199 --- /dev/null +++ b/libs/clients/dining/src/models/start-ordering-dto.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface StartOrderingDto + */ +export interface StartOrderingDto { + /** + * + * @type {number} + * @memberof StartOrderingDto + */ + 'tableNumber': number; + /** + * + * @type {number} + * @memberof StartOrderingDto + */ + 'customersCount': number; +} + diff --git a/libs/clients/dining/src/models/table-already-exists-exception.ts b/libs/clients/dining/src/models/table-already-exists-exception.ts new file mode 100644 index 0000000..b5504ff --- /dev/null +++ b/libs/clients/dining/src/models/table-already-exists-exception.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface TableAlreadyExistsException + */ +export interface TableAlreadyExistsException { + /** + * + * @type {string} + * @memberof TableAlreadyExistsException + */ + 'error': string; + /** + * + * @type {string} + * @memberof TableAlreadyExistsException + */ + 'details': string; +} + diff --git a/libs/clients/dining/src/models/table-already-taken-exception.ts b/libs/clients/dining/src/models/table-already-taken-exception.ts new file mode 100644 index 0000000..1c58dfe --- /dev/null +++ b/libs/clients/dining/src/models/table-already-taken-exception.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface TableAlreadyTakenException + */ +export interface TableAlreadyTakenException { + /** + * + * @type {string} + * @memberof TableAlreadyTakenException + */ + 'error': string; + /** + * + * @type {string} + * @memberof TableAlreadyTakenException + */ + 'details': string; +} + diff --git a/libs/clients/dining/src/models/table-number-not-found-exception.ts b/libs/clients/dining/src/models/table-number-not-found-exception.ts new file mode 100644 index 0000000..674e475 --- /dev/null +++ b/libs/clients/dining/src/models/table-number-not-found-exception.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface TableNumberNotFoundException + */ +export interface TableNumberNotFoundException { + /** + * + * @type {string} + * @memberof TableNumberNotFoundException + */ + 'error': string; + /** + * + * @type {string} + * @memberof TableNumberNotFoundException + */ + 'details': string; +} + diff --git a/libs/clients/dining/src/models/table-order-already-billed-exception.ts b/libs/clients/dining/src/models/table-order-already-billed-exception.ts new file mode 100644 index 0000000..81c38bc --- /dev/null +++ b/libs/clients/dining/src/models/table-order-already-billed-exception.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface TableOrderAlreadyBilledException + */ +export interface TableOrderAlreadyBilledException { + /** + * + * @type {string} + * @memberof TableOrderAlreadyBilledException + */ + 'error': string; + /** + * + * @type {string} + * @memberof TableOrderAlreadyBilledException + */ + 'details': string; +} + diff --git a/libs/clients/dining/src/models/table-order-id-not-found-exception.ts b/libs/clients/dining/src/models/table-order-id-not-found-exception.ts new file mode 100644 index 0000000..9c9f61b --- /dev/null +++ b/libs/clients/dining/src/models/table-order-id-not-found-exception.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface TableOrderIdNotFoundException + */ +export interface TableOrderIdNotFoundException { + /** + * + * @type {string} + * @memberof TableOrderIdNotFoundException + */ + 'error': string; + /** + * + * @type {string} + * @memberof TableOrderIdNotFoundException + */ + 'details': string; +} + diff --git a/libs/clients/dining/src/models/table-order.ts b/libs/clients/dining/src/models/table-order.ts new file mode 100644 index 0000000..bb35755 --- /dev/null +++ b/libs/clients/dining/src/models/table-order.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { OrderingLine } from './ordering-line'; +// May contain unused imports in some cases +// @ts-ignore +import type { PreparationDto } from './preparation-dto'; + +/** + * + * @export + * @interface TableOrder + */ +export interface TableOrder { + /** + * + * @type {string} + * @memberof TableOrder + */ + '_id': string; + /** + * + * @type {number} + * @memberof TableOrder + */ + 'tableNumber': number; + /** + * + * @type {number} + * @memberof TableOrder + */ + 'customersCount': number; + /** + * + * @type {string} + * @memberof TableOrder + */ + 'opened': string; + /** + * + * @type {Array} + * @memberof TableOrder + */ + 'lines': Array; + /** + * + * @type {Array} + * @memberof TableOrder + */ + 'preparations': Array; + /** + * + * @type {string} + * @memberof TableOrder + */ + 'billed': string; +} + diff --git a/libs/clients/dining/src/models/table-with-order-dto.ts b/libs/clients/dining/src/models/table-with-order-dto.ts new file mode 100644 index 0000000..d5de05c --- /dev/null +++ b/libs/clients/dining/src/models/table-with-order-dto.ts @@ -0,0 +1,48 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Dining Service + * Dining Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface TableWithOrderDto + */ +export interface TableWithOrderDto { + /** + * + * @type {string} + * @memberof TableWithOrderDto + */ + '_id': string; + /** + * + * @type {number} + * @memberof TableWithOrderDto + */ + 'number': number; + /** + * + * @type {boolean} + * @memberof TableWithOrderDto + */ + 'taken': boolean; + /** + * + * @type {string} + * @memberof TableWithOrderDto + */ + 'tableOrderId': string; +} + diff --git a/libs/clients/dining/tsconfig.json b/libs/clients/dining/tsconfig.json new file mode 100644 index 0000000..f2400ab --- /dev/null +++ b/libs/clients/dining/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + } + ] +} diff --git a/libs/clients/dining/tsconfig.lib.json b/libs/clients/dining/tsconfig.lib.json new file mode 100644 index 0000000..8f9c818 --- /dev/null +++ b/libs/clients/dining/tsconfig.lib.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "include": ["src/**/*.ts"], + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] +} diff --git a/libs/clients/kitchen/.eslintrc.json b/libs/clients/kitchen/.eslintrc.json new file mode 100644 index 0000000..3230caf --- /dev/null +++ b/libs/clients/kitchen/.eslintrc.json @@ -0,0 +1,25 @@ +{ + "extends": ["../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.json"], + "parser": "jsonc-eslint-parser", + "rules": { + "@nx/dependency-checks": "error" + } + } + ] +} diff --git a/libs/clients/kitchen/README.md b/libs/clients/kitchen/README.md new file mode 100644 index 0000000..a66a785 --- /dev/null +++ b/libs/clients/kitchen/README.md @@ -0,0 +1,7 @@ +# clients-kitchen + +This library was generated with [Nx](https://nx.dev). + +## Building + +Run `nx build clients-kitchen` to build the library. diff --git a/libs/clients/kitchen/openapi.yaml b/libs/clients/kitchen/openapi.yaml new file mode 100644 index 0000000..33498eb --- /dev/null +++ b/libs/clients/kitchen/openapi.yaml @@ -0,0 +1,577 @@ +openapi: 3.0.0 +paths: + /health: + get: + operationId: HealthController_check + parameters: [] + responses: + '200': + description: The Health Check is successful + content: + application/json: + schema: + type: object + properties: + status: + type: string + example: ok + info: + type: object + example: + database: + status: up + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + error: + type: object + example: {} + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + details: + type: object + example: + database: + status: up + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + '503': + description: The Health Check is not successful + content: + application/json: + schema: + type: object + properties: + status: + type: string + example: error + info: + type: object + example: + database: + status: up + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + error: + type: object + example: + redis: + status: down + message: Could not connect + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + details: + type: object + example: + database: + status: up + redis: + status: down + message: Could not connect + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + tags: + - health + /preparations: + get: + operationId: PreparationsController_getAllPreparationsByStateAndTableNumber + parameters: + - name: tableNumber + required: false + in: query + schema: {} + - name: state + required: true + in: query + schema: + enum: + - readyToBeServed + - preparationStarted + type: string + responses: + '200': + description: The preparations filtered by state and/or table number. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PreparationDto' + '400': + description: State in params is not a valid preparation state. + content: + application/json: + schema: + $ref: '#/components/schemas/WrongQueryParameterException' + '404': + description: Table number in params is not a valid table number. + content: + application/json: + schema: + $ref: '#/components/schemas/TableNumberNotFoundException' + tags: + - Preparations + post: + operationId: PreparationsController_requestNewPreparation + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PreparationRequestDto' + responses: + '201': + description: The new preparations corresponding to items sent to cook. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PreparationDto' + '404': + description: Table number in params is not a valid table number. + content: + application/json: + schema: + $ref: '#/components/schemas/TableNumberNotFoundException' + '422': + description: Empty item list sent to the kitchen + content: + application/json: + schema: + $ref: '#/components/schemas/EmptyItemsToBeCookedSentInKitchenException' + tags: + - Preparations + /preparations/{preparationId}: + get: + operationId: PreparationsController_retrievePreparation + parameters: + - name: preparationId + required: true + in: path + schema: + type: string + responses: + '200': + description: The searched preparation. + content: + application/json: + schema: + $ref: '#/components/schemas/PreparationDto' + '404': + description: Preparation Id not found. + content: + application/json: + schema: + $ref: '#/components/schemas/PreparationIdNotFoundException' + tags: + - Preparations + /preparations/{preparationId}/takenToTable: + post: + operationId: PreparationsController_preparationIsServed + parameters: + - name: preparationId + required: true + in: path + schema: + type: string + responses: + '200': + description: The preparation has been successfully declared as brought to the table. + content: + application/json: + schema: + $ref: '#/components/schemas/PreparationDto' + '404': + description: Preparation Id not found. + content: + application/json: + schema: + $ref: '#/components/schemas/PreparationIdNotFoundException' + '422': + description: Preparation not yet ready in the kitchen + content: + application/json: + schema: + $ref: '#/components/schemas/PreparationNotReadyInKitchenException' + tags: + - Preparations + /preparedItems/{preparedItemId}: + get: + operationId: PreparedItemsController_retrievePreparedItem + parameters: + - name: preparedItemId + required: true + in: path + schema: + type: string + responses: + '200': + description: The searched prepared item. + content: + application/json: + schema: + $ref: '#/components/schemas/PreparedItem' + '404': + description: Prepared Item Id not found. + content: + application/json: + schema: + $ref: '#/components/schemas/PreparedItemIdNotFoundException' + tags: + - Prepared Items + /preparedItems/{preparedItemId}/recipe: + get: + operationId: PreparedItemsController_retrievePreparedItemRecipe + parameters: + - name: preparedItemId + required: true + in: path + schema: + type: string + responses: + '200': + description: The searched prepared item's recipe. + content: + application/json: + schema: + $ref: '#/components/schemas/Recipe' + '404': + description: Prepared Item Id not found. + content: + application/json: + schema: + $ref: '#/components/schemas/PreparedItemIdNotFoundException' + tags: + - Prepared Items + /preparedItems: + get: + operationId: PreparedItemsController_getPreparatedItemsToStartByPost + parameters: + - name: post + required: true + in: query + schema: + enum: + - BAR + - COLD_DISH + - HOT_DISH + type: string + responses: + '200': + description: All items to start cooking now for the requested post. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PreparedItem' + tags: + - Prepared Items + /preparedItems/{preparedItemId}/start: + post: + operationId: PreparedItemsController_startToPrepareItemOnPost + parameters: + - name: preparedItemId + required: true + in: path + schema: + type: string + responses: + '200': + description: The started prepared item. + content: + application/json: + schema: + $ref: '#/components/schemas/PreparedItem' + '404': + description: Prepared Item Id not found. + content: + application/json: + schema: + $ref: '#/components/schemas/PreparedItemIdNotFoundException' + '422': + description: Item already started cooking inside the kitchen + content: + application/json: + schema: + $ref: '#/components/schemas/ItemAlreadyStartedToBeCookedException' + tags: + - Prepared Items + /preparedItems/{preparedItemId}/finish: + post: + operationId: PreparedItemsController_finishToPrepareItemOnPost + parameters: + - name: preparedItemId + required: true + in: path + schema: + type: string + responses: + '200': + description: The finished prepared item. + content: + application/json: + schema: + $ref: '#/components/schemas/PreparedItemDto' + '404': + description: Prepared Item Id not found. + content: + application/json: + schema: + $ref: '#/components/schemas/PreparedItemIdNotFoundException' + '422': + description: Item not started to be cooked inside the kitchen + content: + application/json: + schema: + $ref: '#/components/schemas/ItemNotStartedToBeCookedException' + tags: + - Prepared Items +info: + title: 'Micro-Service Restaurant: Kitchen Service' + description: Kitchen Service Open API definition + contact: {} + version: 0.0.0 +tags: [] +servers: + - url: https://kitchen-backend.spos.polytech.apoorva64.com/ + description: Prod +components: + schemas: + PreparedItemDto: + type: object + properties: + _id: + type: string + shortName: + type: string + shouldStartAt: + type: string + startedAt: + type: string + finishedAt: + type: string + required: + - _id + - shortName + - shouldStartAt + - startedAt + - finishedAt + PreparationDto: + type: object + properties: + _id: + type: string + tableNumber: + type: number + shouldBeReadyAt: + type: string + completedAt: + type: string + takenForServiceAt: + type: string + preparedItems: + type: array + items: + $ref: '#/components/schemas/PreparedItemDto' + required: + - _id + - tableNumber + - shouldBeReadyAt + - completedAt + - takenForServiceAt + - preparedItems + WrongQueryParameterException: + type: object + properties: + error: + type: string + details: + type: string + required: + - error + - details + TableNumberNotFoundException: + type: object + properties: + error: + type: string + details: + type: string + required: + - error + - details + ItemToBeCookedDto: + type: object + properties: + menuItemShortName: + type: string + howMany: + type: number + minimum: 1 + required: + - menuItemShortName + - howMany + PreparationRequestDto: + type: object + properties: + tableNumber: + type: number + itemsToBeCooked: + type: array + items: + $ref: '#/components/schemas/ItemToBeCookedDto' + required: + - tableNumber + - itemsToBeCooked + EmptyItemsToBeCookedSentInKitchenException: + type: object + properties: + error: + type: string + details: + type: string + required: + - error + - details + PreparationIdNotFoundException: + type: object + properties: + error: + type: string + details: + type: string + required: + - error + - details + PreparationNotReadyInKitchenException: + type: object + properties: + error: + type: string + details: + type: string + required: + - error + - details + Recipe: + type: object + properties: + _id: + type: string + shortName: + type: string + post: + enum: + - BAR + - COLD_DISH + - HOT_DISH + type: string + cookingSteps: + type: array + items: + type: string + meanCookingTimeInSec: + type: number + required: + - _id + - shortName + - post + - cookingSteps + - meanCookingTimeInSec + PreparedItem: + type: object + properties: + _id: + type: string + shortName: + type: string + recipe: + $ref: '#/components/schemas/Recipe' + shouldStartAt: + format: date-time + type: string + startedAt: + format: date-time + type: string + finishedAt: + format: date-time + type: string + required: + - _id + - shortName + - recipe + - shouldStartAt + - startedAt + - finishedAt + PreparedItemIdNotFoundException: + type: object + properties: + error: + type: string + details: + type: string + required: + - error + - details + ItemAlreadyStartedToBeCookedException: + type: object + properties: + error: + type: string + details: + type: string + required: + - error + - details + ItemNotStartedToBeCookedException: + type: object + properties: + error: + type: string + details: + type: string + required: + - error + - details diff --git a/libs/clients/kitchen/package.json b/libs/clients/kitchen/package.json new file mode 100644 index 0000000..2e77b37 --- /dev/null +++ b/libs/clients/kitchen/package.json @@ -0,0 +1,12 @@ +{ + "name": "@spos/clients/kitchen", + "version": "0.0.1", + "dependencies": { + "tslib": "^2.3.0", + "axios": "^1.7.7" + }, + "type": "commonjs", + "main": "./src/index.js", + "typings": "./src/index.d.ts", + "private": true +} diff --git a/libs/clients/kitchen/project.json b/libs/clients/kitchen/project.json new file mode 100644 index 0000000..2f787e7 --- /dev/null +++ b/libs/clients/kitchen/project.json @@ -0,0 +1,35 @@ +{ + "name": "clients-kitchen", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/clients/kitchen/src", + "projectType": "library", + "tags": [], + "targets": { + "build": { + "executor": "@nx/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/libs/clients/kitchen", + "main": "libs/clients/kitchen/src/index.ts", + "tsConfig": "libs/clients/kitchen/tsconfig.lib.json", + "assets": ["libs/clients/kitchen/*.md"] + } + }, + "generate": { + "executor": "nx:run-commands", + "options": { + "parallel": false, + "commands": [ + { + "command": "npx rimraf libs/clients/kitchen/src", + "description": "Clean up generated API client" + }, + { + "command": "npx openapi-generator-cli generate -i libs/clients/kitchen/openapi.yaml -g typescript-axios -o libs/clients/kitchen/src --ignore-file-override=.openapi-generator-ignore --additional-properties=useSingleRequestParameter=true,withSeparateModelsAndApi=true,apiPackage=api,modelPackage=models", + "description": "Generate API client from OpenAPI spec" + } + ] + } + } + } +} diff --git a/libs/clients/kitchen/src/.npmignore b/libs/clients/kitchen/src/.npmignore new file mode 100644 index 0000000..999d88d --- /dev/null +++ b/libs/clients/kitchen/src/.npmignore @@ -0,0 +1 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm \ No newline at end of file diff --git a/libs/clients/kitchen/src/.openapi-generator-ignore b/libs/clients/kitchen/src/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/libs/clients/kitchen/src/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/libs/clients/kitchen/src/.openapi-generator/FILES b/libs/clients/kitchen/src/.openapi-generator/FILES new file mode 100644 index 0000000..a975e3a --- /dev/null +++ b/libs/clients/kitchen/src/.openapi-generator/FILES @@ -0,0 +1,28 @@ +.npmignore +.openapi-generator-ignore +api.ts +api/health-api.ts +api/preparations-api.ts +api/prepared-items-api.ts +base.ts +common.ts +configuration.ts +index.ts +models/empty-items-to-be-cooked-sent-in-kitchen-exception.ts +models/health-controller-check200-response-info-value.ts +models/health-controller-check200-response.ts +models/health-controller-check503-response.ts +models/index.ts +models/item-already-started-to-be-cooked-exception.ts +models/item-not-started-to-be-cooked-exception.ts +models/item-to-be-cooked-dto.ts +models/preparation-dto.ts +models/preparation-id-not-found-exception.ts +models/preparation-not-ready-in-kitchen-exception.ts +models/preparation-request-dto.ts +models/prepared-item-dto.ts +models/prepared-item-id-not-found-exception.ts +models/prepared-item.ts +models/recipe.ts +models/table-number-not-found-exception.ts +models/wrong-query-parameter-exception.ts diff --git a/libs/clients/kitchen/src/.openapi-generator/VERSION b/libs/clients/kitchen/src/.openapi-generator/VERSION new file mode 100644 index 0000000..09a6d30 --- /dev/null +++ b/libs/clients/kitchen/src/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0 diff --git a/libs/clients/kitchen/src/api.ts b/libs/clients/kitchen/src/api.ts new file mode 100644 index 0000000..ab1f930 --- /dev/null +++ b/libs/clients/kitchen/src/api.ts @@ -0,0 +1,20 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +export * from './api/health-api'; +export * from './api/preparations-api'; +export * from './api/prepared-items-api'; + diff --git a/libs/clients/kitchen/src/api/health-api.ts b/libs/clients/kitchen/src/api/health-api.ts new file mode 100644 index 0000000..ca0c341 --- /dev/null +++ b/libs/clients/kitchen/src/api/health-api.ts @@ -0,0 +1,122 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { HealthControllerCheck200Response } from '../models'; +// @ts-ignore +import type { HealthControllerCheck503Response } from '../models'; +/** + * HealthApi - axios parameter creator + * @export + */ +export const HealthApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + healthControllerCheck: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/health`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * HealthApi - functional programming interface + * @export + */ +export const HealthApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = HealthApiAxiosParamCreator(configuration) + return { + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async healthControllerCheck(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.healthControllerCheck(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['HealthApi.healthControllerCheck']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * HealthApi - factory interface + * @export + */ +export const HealthApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = HealthApiFp(configuration) + return { + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + healthControllerCheck(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.healthControllerCheck(options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * HealthApi - object-oriented interface + * @export + * @class HealthApi + * @extends {BaseAPI} + */ +export class HealthApi extends BaseAPI { + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof HealthApi + */ + public healthControllerCheck(options?: RawAxiosRequestConfig) { + return HealthApiFp(this.configuration).healthControllerCheck(options).then((request) => request(this.axios, this.basePath)); + } +} + diff --git a/libs/clients/kitchen/src/api/preparations-api.ts b/libs/clients/kitchen/src/api/preparations-api.ts new file mode 100644 index 0000000..e850613 --- /dev/null +++ b/libs/clients/kitchen/src/api/preparations-api.ts @@ -0,0 +1,418 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { EmptyItemsToBeCookedSentInKitchenException } from '../models'; +// @ts-ignore +import type { PreparationDto } from '../models'; +// @ts-ignore +import type { PreparationIdNotFoundException } from '../models'; +// @ts-ignore +import type { PreparationNotReadyInKitchenException } from '../models'; +// @ts-ignore +import type { PreparationRequestDto } from '../models'; +// @ts-ignore +import type { TableNumberNotFoundException } from '../models'; +// @ts-ignore +import type { WrongQueryParameterException } from '../models'; +/** + * PreparationsApi - axios parameter creator + * @export + */ +export const PreparationsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @param {PreparationsControllerGetAllPreparationsByStateAndTableNumberStateEnum} state + * @param {any} [tableNumber] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparationsControllerGetAllPreparationsByStateAndTableNumber: async (state: PreparationsControllerGetAllPreparationsByStateAndTableNumberStateEnum, tableNumber?: any, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'state' is not null or undefined + assertParamExists('preparationsControllerGetAllPreparationsByStateAndTableNumber', 'state', state) + const localVarPath = `/preparations`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (tableNumber !== undefined) { + for (const [key, value] of Object.entries(tableNumber)) { + localVarQueryParameter[key] = value; + } + } + + if (state !== undefined) { + localVarQueryParameter['state'] = state; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} preparationId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparationsControllerPreparationIsServed: async (preparationId: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'preparationId' is not null or undefined + assertParamExists('preparationsControllerPreparationIsServed', 'preparationId', preparationId) + const localVarPath = `/preparations/{preparationId}/takenToTable` + .replace(`{${"preparationId"}}`, encodeURIComponent(String(preparationId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {PreparationRequestDto} preparationRequestDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparationsControllerRequestNewPreparation: async (preparationRequestDto: PreparationRequestDto, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'preparationRequestDto' is not null or undefined + assertParamExists('preparationsControllerRequestNewPreparation', 'preparationRequestDto', preparationRequestDto) + const localVarPath = `/preparations`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(preparationRequestDto, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} preparationId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparationsControllerRetrievePreparation: async (preparationId: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'preparationId' is not null or undefined + assertParamExists('preparationsControllerRetrievePreparation', 'preparationId', preparationId) + const localVarPath = `/preparations/{preparationId}` + .replace(`{${"preparationId"}}`, encodeURIComponent(String(preparationId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * PreparationsApi - functional programming interface + * @export + */ +export const PreparationsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PreparationsApiAxiosParamCreator(configuration) + return { + /** + * + * @param {PreparationsControllerGetAllPreparationsByStateAndTableNumberStateEnum} state + * @param {any} [tableNumber] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async preparationsControllerGetAllPreparationsByStateAndTableNumber(state: PreparationsControllerGetAllPreparationsByStateAndTableNumberStateEnum, tableNumber?: any, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.preparationsControllerGetAllPreparationsByStateAndTableNumber(state, tableNumber, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PreparationsApi.preparationsControllerGetAllPreparationsByStateAndTableNumber']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {string} preparationId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async preparationsControllerPreparationIsServed(preparationId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.preparationsControllerPreparationIsServed(preparationId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PreparationsApi.preparationsControllerPreparationIsServed']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {PreparationRequestDto} preparationRequestDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async preparationsControllerRequestNewPreparation(preparationRequestDto: PreparationRequestDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.preparationsControllerRequestNewPreparation(preparationRequestDto, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PreparationsApi.preparationsControllerRequestNewPreparation']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {string} preparationId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async preparationsControllerRetrievePreparation(preparationId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.preparationsControllerRetrievePreparation(preparationId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PreparationsApi.preparationsControllerRetrievePreparation']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * PreparationsApi - factory interface + * @export + */ +export const PreparationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PreparationsApiFp(configuration) + return { + /** + * + * @param {PreparationsApiPreparationsControllerGetAllPreparationsByStateAndTableNumberRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparationsControllerGetAllPreparationsByStateAndTableNumber(requestParameters: PreparationsApiPreparationsControllerGetAllPreparationsByStateAndTableNumberRequest, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.preparationsControllerGetAllPreparationsByStateAndTableNumber(requestParameters.state, requestParameters.tableNumber, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {PreparationsApiPreparationsControllerPreparationIsServedRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparationsControllerPreparationIsServed(requestParameters: PreparationsApiPreparationsControllerPreparationIsServedRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.preparationsControllerPreparationIsServed(requestParameters.preparationId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {PreparationsApiPreparationsControllerRequestNewPreparationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparationsControllerRequestNewPreparation(requestParameters: PreparationsApiPreparationsControllerRequestNewPreparationRequest, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.preparationsControllerRequestNewPreparation(requestParameters.preparationRequestDto, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {PreparationsApiPreparationsControllerRetrievePreparationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparationsControllerRetrievePreparation(requestParameters: PreparationsApiPreparationsControllerRetrievePreparationRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.preparationsControllerRetrievePreparation(requestParameters.preparationId, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for preparationsControllerGetAllPreparationsByStateAndTableNumber operation in PreparationsApi. + * @export + * @interface PreparationsApiPreparationsControllerGetAllPreparationsByStateAndTableNumberRequest + */ +export interface PreparationsApiPreparationsControllerGetAllPreparationsByStateAndTableNumberRequest { + /** + * + * @type {'readyToBeServed' | 'preparationStarted'} + * @memberof PreparationsApiPreparationsControllerGetAllPreparationsByStateAndTableNumber + */ + readonly state: PreparationsControllerGetAllPreparationsByStateAndTableNumberStateEnum + + /** + * + * @type {any} + * @memberof PreparationsApiPreparationsControllerGetAllPreparationsByStateAndTableNumber + */ + readonly tableNumber?: any +} + +/** + * Request parameters for preparationsControllerPreparationIsServed operation in PreparationsApi. + * @export + * @interface PreparationsApiPreparationsControllerPreparationIsServedRequest + */ +export interface PreparationsApiPreparationsControllerPreparationIsServedRequest { + /** + * + * @type {string} + * @memberof PreparationsApiPreparationsControllerPreparationIsServed + */ + readonly preparationId: string +} + +/** + * Request parameters for preparationsControllerRequestNewPreparation operation in PreparationsApi. + * @export + * @interface PreparationsApiPreparationsControllerRequestNewPreparationRequest + */ +export interface PreparationsApiPreparationsControllerRequestNewPreparationRequest { + /** + * + * @type {PreparationRequestDto} + * @memberof PreparationsApiPreparationsControllerRequestNewPreparation + */ + readonly preparationRequestDto: PreparationRequestDto +} + +/** + * Request parameters for preparationsControllerRetrievePreparation operation in PreparationsApi. + * @export + * @interface PreparationsApiPreparationsControllerRetrievePreparationRequest + */ +export interface PreparationsApiPreparationsControllerRetrievePreparationRequest { + /** + * + * @type {string} + * @memberof PreparationsApiPreparationsControllerRetrievePreparation + */ + readonly preparationId: string +} + +/** + * PreparationsApi - object-oriented interface + * @export + * @class PreparationsApi + * @extends {BaseAPI} + */ +export class PreparationsApi extends BaseAPI { + /** + * + * @param {PreparationsApiPreparationsControllerGetAllPreparationsByStateAndTableNumberRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PreparationsApi + */ + public preparationsControllerGetAllPreparationsByStateAndTableNumber(requestParameters: PreparationsApiPreparationsControllerGetAllPreparationsByStateAndTableNumberRequest, options?: RawAxiosRequestConfig) { + return PreparationsApiFp(this.configuration).preparationsControllerGetAllPreparationsByStateAndTableNumber(requestParameters.state, requestParameters.tableNumber, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {PreparationsApiPreparationsControllerPreparationIsServedRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PreparationsApi + */ + public preparationsControllerPreparationIsServed(requestParameters: PreparationsApiPreparationsControllerPreparationIsServedRequest, options?: RawAxiosRequestConfig) { + return PreparationsApiFp(this.configuration).preparationsControllerPreparationIsServed(requestParameters.preparationId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {PreparationsApiPreparationsControllerRequestNewPreparationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PreparationsApi + */ + public preparationsControllerRequestNewPreparation(requestParameters: PreparationsApiPreparationsControllerRequestNewPreparationRequest, options?: RawAxiosRequestConfig) { + return PreparationsApiFp(this.configuration).preparationsControllerRequestNewPreparation(requestParameters.preparationRequestDto, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {PreparationsApiPreparationsControllerRetrievePreparationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PreparationsApi + */ + public preparationsControllerRetrievePreparation(requestParameters: PreparationsApiPreparationsControllerRetrievePreparationRequest, options?: RawAxiosRequestConfig) { + return PreparationsApiFp(this.configuration).preparationsControllerRetrievePreparation(requestParameters.preparationId, options).then((request) => request(this.axios, this.basePath)); + } +} + +/** + * @export + */ +export const PreparationsControllerGetAllPreparationsByStateAndTableNumberStateEnum = { + ReadyToBeServed: 'readyToBeServed', + PreparationStarted: 'preparationStarted' +} as const; +export type PreparationsControllerGetAllPreparationsByStateAndTableNumberStateEnum = typeof PreparationsControllerGetAllPreparationsByStateAndTableNumberStateEnum[keyof typeof PreparationsControllerGetAllPreparationsByStateAndTableNumberStateEnum]; diff --git a/libs/clients/kitchen/src/api/prepared-items-api.ts b/libs/clients/kitchen/src/api/prepared-items-api.ts new file mode 100644 index 0000000..0b4957e --- /dev/null +++ b/libs/clients/kitchen/src/api/prepared-items-api.ts @@ -0,0 +1,479 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { ItemAlreadyStartedToBeCookedException } from '../models'; +// @ts-ignore +import type { ItemNotStartedToBeCookedException } from '../models'; +// @ts-ignore +import type { PreparedItem } from '../models'; +// @ts-ignore +import type { PreparedItemDto } from '../models'; +// @ts-ignore +import type { PreparedItemIdNotFoundException } from '../models'; +// @ts-ignore +import type { Recipe } from '../models'; +/** + * PreparedItemsApi - axios parameter creator + * @export + */ +export const PreparedItemsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @param {string} preparedItemId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparedItemsControllerFinishToPrepareItemOnPost: async (preparedItemId: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'preparedItemId' is not null or undefined + assertParamExists('preparedItemsControllerFinishToPrepareItemOnPost', 'preparedItemId', preparedItemId) + const localVarPath = `/preparedItems/{preparedItemId}/finish` + .replace(`{${"preparedItemId"}}`, encodeURIComponent(String(preparedItemId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {PreparedItemsControllerGetPreparatedItemsToStartByPostPostEnum} post + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparedItemsControllerGetPreparatedItemsToStartByPost: async (post: PreparedItemsControllerGetPreparatedItemsToStartByPostPostEnum, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'post' is not null or undefined + assertParamExists('preparedItemsControllerGetPreparatedItemsToStartByPost', 'post', post) + const localVarPath = `/preparedItems`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (post !== undefined) { + localVarQueryParameter['post'] = post; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} preparedItemId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparedItemsControllerRetrievePreparedItem: async (preparedItemId: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'preparedItemId' is not null or undefined + assertParamExists('preparedItemsControllerRetrievePreparedItem', 'preparedItemId', preparedItemId) + const localVarPath = `/preparedItems/{preparedItemId}` + .replace(`{${"preparedItemId"}}`, encodeURIComponent(String(preparedItemId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} preparedItemId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparedItemsControllerRetrievePreparedItemRecipe: async (preparedItemId: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'preparedItemId' is not null or undefined + assertParamExists('preparedItemsControllerRetrievePreparedItemRecipe', 'preparedItemId', preparedItemId) + const localVarPath = `/preparedItems/{preparedItemId}/recipe` + .replace(`{${"preparedItemId"}}`, encodeURIComponent(String(preparedItemId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} preparedItemId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparedItemsControllerStartToPrepareItemOnPost: async (preparedItemId: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'preparedItemId' is not null or undefined + assertParamExists('preparedItemsControllerStartToPrepareItemOnPost', 'preparedItemId', preparedItemId) + const localVarPath = `/preparedItems/{preparedItemId}/start` + .replace(`{${"preparedItemId"}}`, encodeURIComponent(String(preparedItemId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * PreparedItemsApi - functional programming interface + * @export + */ +export const PreparedItemsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PreparedItemsApiAxiosParamCreator(configuration) + return { + /** + * + * @param {string} preparedItemId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async preparedItemsControllerFinishToPrepareItemOnPost(preparedItemId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.preparedItemsControllerFinishToPrepareItemOnPost(preparedItemId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PreparedItemsApi.preparedItemsControllerFinishToPrepareItemOnPost']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {PreparedItemsControllerGetPreparatedItemsToStartByPostPostEnum} post + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async preparedItemsControllerGetPreparatedItemsToStartByPost(post: PreparedItemsControllerGetPreparatedItemsToStartByPostPostEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.preparedItemsControllerGetPreparatedItemsToStartByPost(post, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PreparedItemsApi.preparedItemsControllerGetPreparatedItemsToStartByPost']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {string} preparedItemId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async preparedItemsControllerRetrievePreparedItem(preparedItemId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.preparedItemsControllerRetrievePreparedItem(preparedItemId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PreparedItemsApi.preparedItemsControllerRetrievePreparedItem']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {string} preparedItemId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async preparedItemsControllerRetrievePreparedItemRecipe(preparedItemId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.preparedItemsControllerRetrievePreparedItemRecipe(preparedItemId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PreparedItemsApi.preparedItemsControllerRetrievePreparedItemRecipe']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {string} preparedItemId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async preparedItemsControllerStartToPrepareItemOnPost(preparedItemId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.preparedItemsControllerStartToPrepareItemOnPost(preparedItemId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PreparedItemsApi.preparedItemsControllerStartToPrepareItemOnPost']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * PreparedItemsApi - factory interface + * @export + */ +export const PreparedItemsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PreparedItemsApiFp(configuration) + return { + /** + * + * @param {PreparedItemsApiPreparedItemsControllerFinishToPrepareItemOnPostRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparedItemsControllerFinishToPrepareItemOnPost(requestParameters: PreparedItemsApiPreparedItemsControllerFinishToPrepareItemOnPostRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.preparedItemsControllerFinishToPrepareItemOnPost(requestParameters.preparedItemId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {PreparedItemsApiPreparedItemsControllerGetPreparatedItemsToStartByPostRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparedItemsControllerGetPreparatedItemsToStartByPost(requestParameters: PreparedItemsApiPreparedItemsControllerGetPreparatedItemsToStartByPostRequest, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.preparedItemsControllerGetPreparatedItemsToStartByPost(requestParameters.post, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {PreparedItemsApiPreparedItemsControllerRetrievePreparedItemRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparedItemsControllerRetrievePreparedItem(requestParameters: PreparedItemsApiPreparedItemsControllerRetrievePreparedItemRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.preparedItemsControllerRetrievePreparedItem(requestParameters.preparedItemId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {PreparedItemsApiPreparedItemsControllerRetrievePreparedItemRecipeRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparedItemsControllerRetrievePreparedItemRecipe(requestParameters: PreparedItemsApiPreparedItemsControllerRetrievePreparedItemRecipeRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.preparedItemsControllerRetrievePreparedItemRecipe(requestParameters.preparedItemId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {PreparedItemsApiPreparedItemsControllerStartToPrepareItemOnPostRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + preparedItemsControllerStartToPrepareItemOnPost(requestParameters: PreparedItemsApiPreparedItemsControllerStartToPrepareItemOnPostRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.preparedItemsControllerStartToPrepareItemOnPost(requestParameters.preparedItemId, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for preparedItemsControllerFinishToPrepareItemOnPost operation in PreparedItemsApi. + * @export + * @interface PreparedItemsApiPreparedItemsControllerFinishToPrepareItemOnPostRequest + */ +export interface PreparedItemsApiPreparedItemsControllerFinishToPrepareItemOnPostRequest { + /** + * + * @type {string} + * @memberof PreparedItemsApiPreparedItemsControllerFinishToPrepareItemOnPost + */ + readonly preparedItemId: string +} + +/** + * Request parameters for preparedItemsControllerGetPreparatedItemsToStartByPost operation in PreparedItemsApi. + * @export + * @interface PreparedItemsApiPreparedItemsControllerGetPreparatedItemsToStartByPostRequest + */ +export interface PreparedItemsApiPreparedItemsControllerGetPreparatedItemsToStartByPostRequest { + /** + * + * @type {'BAR' | 'COLD_DISH' | 'HOT_DISH'} + * @memberof PreparedItemsApiPreparedItemsControllerGetPreparatedItemsToStartByPost + */ + readonly post: PreparedItemsControllerGetPreparatedItemsToStartByPostPostEnum +} + +/** + * Request parameters for preparedItemsControllerRetrievePreparedItem operation in PreparedItemsApi. + * @export + * @interface PreparedItemsApiPreparedItemsControllerRetrievePreparedItemRequest + */ +export interface PreparedItemsApiPreparedItemsControllerRetrievePreparedItemRequest { + /** + * + * @type {string} + * @memberof PreparedItemsApiPreparedItemsControllerRetrievePreparedItem + */ + readonly preparedItemId: string +} + +/** + * Request parameters for preparedItemsControllerRetrievePreparedItemRecipe operation in PreparedItemsApi. + * @export + * @interface PreparedItemsApiPreparedItemsControllerRetrievePreparedItemRecipeRequest + */ +export interface PreparedItemsApiPreparedItemsControllerRetrievePreparedItemRecipeRequest { + /** + * + * @type {string} + * @memberof PreparedItemsApiPreparedItemsControllerRetrievePreparedItemRecipe + */ + readonly preparedItemId: string +} + +/** + * Request parameters for preparedItemsControllerStartToPrepareItemOnPost operation in PreparedItemsApi. + * @export + * @interface PreparedItemsApiPreparedItemsControllerStartToPrepareItemOnPostRequest + */ +export interface PreparedItemsApiPreparedItemsControllerStartToPrepareItemOnPostRequest { + /** + * + * @type {string} + * @memberof PreparedItemsApiPreparedItemsControllerStartToPrepareItemOnPost + */ + readonly preparedItemId: string +} + +/** + * PreparedItemsApi - object-oriented interface + * @export + * @class PreparedItemsApi + * @extends {BaseAPI} + */ +export class PreparedItemsApi extends BaseAPI { + /** + * + * @param {PreparedItemsApiPreparedItemsControllerFinishToPrepareItemOnPostRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PreparedItemsApi + */ + public preparedItemsControllerFinishToPrepareItemOnPost(requestParameters: PreparedItemsApiPreparedItemsControllerFinishToPrepareItemOnPostRequest, options?: RawAxiosRequestConfig) { + return PreparedItemsApiFp(this.configuration).preparedItemsControllerFinishToPrepareItemOnPost(requestParameters.preparedItemId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {PreparedItemsApiPreparedItemsControllerGetPreparatedItemsToStartByPostRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PreparedItemsApi + */ + public preparedItemsControllerGetPreparatedItemsToStartByPost(requestParameters: PreparedItemsApiPreparedItemsControllerGetPreparatedItemsToStartByPostRequest, options?: RawAxiosRequestConfig) { + return PreparedItemsApiFp(this.configuration).preparedItemsControllerGetPreparatedItemsToStartByPost(requestParameters.post, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {PreparedItemsApiPreparedItemsControllerRetrievePreparedItemRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PreparedItemsApi + */ + public preparedItemsControllerRetrievePreparedItem(requestParameters: PreparedItemsApiPreparedItemsControllerRetrievePreparedItemRequest, options?: RawAxiosRequestConfig) { + return PreparedItemsApiFp(this.configuration).preparedItemsControllerRetrievePreparedItem(requestParameters.preparedItemId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {PreparedItemsApiPreparedItemsControllerRetrievePreparedItemRecipeRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PreparedItemsApi + */ + public preparedItemsControllerRetrievePreparedItemRecipe(requestParameters: PreparedItemsApiPreparedItemsControllerRetrievePreparedItemRecipeRequest, options?: RawAxiosRequestConfig) { + return PreparedItemsApiFp(this.configuration).preparedItemsControllerRetrievePreparedItemRecipe(requestParameters.preparedItemId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {PreparedItemsApiPreparedItemsControllerStartToPrepareItemOnPostRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PreparedItemsApi + */ + public preparedItemsControllerStartToPrepareItemOnPost(requestParameters: PreparedItemsApiPreparedItemsControllerStartToPrepareItemOnPostRequest, options?: RawAxiosRequestConfig) { + return PreparedItemsApiFp(this.configuration).preparedItemsControllerStartToPrepareItemOnPost(requestParameters.preparedItemId, options).then((request) => request(this.axios, this.basePath)); + } +} + +/** + * @export + */ +export const PreparedItemsControllerGetPreparatedItemsToStartByPostPostEnum = { + Bar: 'BAR', + ColdDish: 'COLD_DISH', + HotDish: 'HOT_DISH' +} as const; +export type PreparedItemsControllerGetPreparatedItemsToStartByPostPostEnum = typeof PreparedItemsControllerGetPreparatedItemsToStartByPostPostEnum[keyof typeof PreparedItemsControllerGetPreparatedItemsToStartByPostPostEnum]; diff --git a/libs/clients/kitchen/src/base.ts b/libs/clients/kitchen/src/base.ts new file mode 100644 index 0000000..a247aaf --- /dev/null +++ b/libs/clients/kitchen/src/base.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from './configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; + +export const BASE_PATH = "https://kitchen-backend.spos.polytech.apoorva64.com".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: RawAxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath ?? basePath; + } + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + constructor(public field: string, msg?: string) { + super(msg); + this.name = "RequiredError" + } +} + +interface ServerMap { + [key: string]: { + url: string, + description: string, + }[]; +} + +/** + * + * @export + */ +export const operationServerMap: ServerMap = { +} diff --git a/libs/clients/kitchen/src/common.ts b/libs/clients/kitchen/src/common.ts new file mode 100644 index 0000000..61568d3 --- /dev/null +++ b/libs/clients/kitchen/src/common.ts @@ -0,0 +1,150 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/libs/clients/kitchen/src/configuration.ts b/libs/clients/kitchen/src/configuration.ts new file mode 100644 index 0000000..abf09bf --- /dev/null +++ b/libs/clients/kitchen/src/configuration.ts @@ -0,0 +1,110 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ConfigurationParameters { + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + serverIndex?: number; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.serverIndex = param.serverIndex; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/libs/clients/kitchen/src/index.ts b/libs/clients/kitchen/src/index.ts new file mode 100644 index 0000000..02d5888 --- /dev/null +++ b/libs/clients/kitchen/src/index.ts @@ -0,0 +1,18 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; +export * from "./models"; diff --git a/libs/clients/kitchen/src/models/empty-items-to-be-cooked-sent-in-kitchen-exception.ts b/libs/clients/kitchen/src/models/empty-items-to-be-cooked-sent-in-kitchen-exception.ts new file mode 100644 index 0000000..fec1753 --- /dev/null +++ b/libs/clients/kitchen/src/models/empty-items-to-be-cooked-sent-in-kitchen-exception.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface EmptyItemsToBeCookedSentInKitchenException + */ +export interface EmptyItemsToBeCookedSentInKitchenException { + /** + * + * @type {string} + * @memberof EmptyItemsToBeCookedSentInKitchenException + */ + 'error': string; + /** + * + * @type {string} + * @memberof EmptyItemsToBeCookedSentInKitchenException + */ + 'details': string; +} + diff --git a/libs/clients/kitchen/src/models/health-controller-check200-response-info-value.ts b/libs/clients/kitchen/src/models/health-controller-check200-response-info-value.ts new file mode 100644 index 0000000..8f1dd4c --- /dev/null +++ b/libs/clients/kitchen/src/models/health-controller-check200-response-info-value.ts @@ -0,0 +1,32 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface HealthControllerCheck200ResponseInfoValue + */ +export interface HealthControllerCheck200ResponseInfoValue { + [key: string]: any; + + /** + * + * @type {string} + * @memberof HealthControllerCheck200ResponseInfoValue + */ + 'status': string; +} + diff --git a/libs/clients/kitchen/src/models/health-controller-check200-response.ts b/libs/clients/kitchen/src/models/health-controller-check200-response.ts new file mode 100644 index 0000000..0d6c675 --- /dev/null +++ b/libs/clients/kitchen/src/models/health-controller-check200-response.ts @@ -0,0 +1,51 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { HealthControllerCheck200ResponseInfoValue } from './health-controller-check200-response-info-value'; + +/** + * + * @export + * @interface HealthControllerCheck200Response + */ +export interface HealthControllerCheck200Response { + /** + * + * @type {string} + * @memberof HealthControllerCheck200Response + */ + 'status'?: string; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck200Response + */ + 'info'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; } | null; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck200Response + */ + 'error'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; } | null; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck200Response + */ + 'details'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; }; +} + diff --git a/libs/clients/kitchen/src/models/health-controller-check503-response.ts b/libs/clients/kitchen/src/models/health-controller-check503-response.ts new file mode 100644 index 0000000..f0ebe6b --- /dev/null +++ b/libs/clients/kitchen/src/models/health-controller-check503-response.ts @@ -0,0 +1,51 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { HealthControllerCheck200ResponseInfoValue } from './health-controller-check200-response-info-value'; + +/** + * + * @export + * @interface HealthControllerCheck503Response + */ +export interface HealthControllerCheck503Response { + /** + * + * @type {string} + * @memberof HealthControllerCheck503Response + */ + 'status'?: string; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck503Response + */ + 'info'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; } | null; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck503Response + */ + 'error'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; } | null; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck503Response + */ + 'details'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; }; +} + diff --git a/libs/clients/kitchen/src/models/index.ts b/libs/clients/kitchen/src/models/index.ts new file mode 100644 index 0000000..0790f73 --- /dev/null +++ b/libs/clients/kitchen/src/models/index.ts @@ -0,0 +1,17 @@ +export * from './empty-items-to-be-cooked-sent-in-kitchen-exception'; +export * from './health-controller-check200-response'; +export * from './health-controller-check200-response-info-value'; +export * from './health-controller-check503-response'; +export * from './item-already-started-to-be-cooked-exception'; +export * from './item-not-started-to-be-cooked-exception'; +export * from './item-to-be-cooked-dto'; +export * from './preparation-dto'; +export * from './preparation-id-not-found-exception'; +export * from './preparation-not-ready-in-kitchen-exception'; +export * from './preparation-request-dto'; +export * from './prepared-item'; +export * from './prepared-item-dto'; +export * from './prepared-item-id-not-found-exception'; +export * from './recipe'; +export * from './table-number-not-found-exception'; +export * from './wrong-query-parameter-exception'; diff --git a/libs/clients/kitchen/src/models/item-already-started-to-be-cooked-exception.ts b/libs/clients/kitchen/src/models/item-already-started-to-be-cooked-exception.ts new file mode 100644 index 0000000..152ec2b --- /dev/null +++ b/libs/clients/kitchen/src/models/item-already-started-to-be-cooked-exception.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface ItemAlreadyStartedToBeCookedException + */ +export interface ItemAlreadyStartedToBeCookedException { + /** + * + * @type {string} + * @memberof ItemAlreadyStartedToBeCookedException + */ + 'error': string; + /** + * + * @type {string} + * @memberof ItemAlreadyStartedToBeCookedException + */ + 'details': string; +} + diff --git a/libs/clients/kitchen/src/models/item-not-started-to-be-cooked-exception.ts b/libs/clients/kitchen/src/models/item-not-started-to-be-cooked-exception.ts new file mode 100644 index 0000000..3139b43 --- /dev/null +++ b/libs/clients/kitchen/src/models/item-not-started-to-be-cooked-exception.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface ItemNotStartedToBeCookedException + */ +export interface ItemNotStartedToBeCookedException { + /** + * + * @type {string} + * @memberof ItemNotStartedToBeCookedException + */ + 'error': string; + /** + * + * @type {string} + * @memberof ItemNotStartedToBeCookedException + */ + 'details': string; +} + diff --git a/libs/clients/kitchen/src/models/item-to-be-cooked-dto.ts b/libs/clients/kitchen/src/models/item-to-be-cooked-dto.ts new file mode 100644 index 0000000..004f814 --- /dev/null +++ b/libs/clients/kitchen/src/models/item-to-be-cooked-dto.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface ItemToBeCookedDto + */ +export interface ItemToBeCookedDto { + /** + * + * @type {string} + * @memberof ItemToBeCookedDto + */ + 'menuItemShortName': string; + /** + * + * @type {number} + * @memberof ItemToBeCookedDto + */ + 'howMany': number; +} + diff --git a/libs/clients/kitchen/src/models/preparation-dto.ts b/libs/clients/kitchen/src/models/preparation-dto.ts new file mode 100644 index 0000000..bd6406c --- /dev/null +++ b/libs/clients/kitchen/src/models/preparation-dto.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { PreparedItemDto } from './prepared-item-dto'; + +/** + * + * @export + * @interface PreparationDto + */ +export interface PreparationDto { + /** + * + * @type {string} + * @memberof PreparationDto + */ + '_id': string; + /** + * + * @type {number} + * @memberof PreparationDto + */ + 'tableNumber': number; + /** + * + * @type {string} + * @memberof PreparationDto + */ + 'shouldBeReadyAt': string; + /** + * + * @type {string} + * @memberof PreparationDto + */ + 'completedAt': string; + /** + * + * @type {string} + * @memberof PreparationDto + */ + 'takenForServiceAt': string; + /** + * + * @type {Array} + * @memberof PreparationDto + */ + 'preparedItems': Array; +} + diff --git a/libs/clients/kitchen/src/models/preparation-id-not-found-exception.ts b/libs/clients/kitchen/src/models/preparation-id-not-found-exception.ts new file mode 100644 index 0000000..fe90082 --- /dev/null +++ b/libs/clients/kitchen/src/models/preparation-id-not-found-exception.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface PreparationIdNotFoundException + */ +export interface PreparationIdNotFoundException { + /** + * + * @type {string} + * @memberof PreparationIdNotFoundException + */ + 'error': string; + /** + * + * @type {string} + * @memberof PreparationIdNotFoundException + */ + 'details': string; +} + diff --git a/libs/clients/kitchen/src/models/preparation-not-ready-in-kitchen-exception.ts b/libs/clients/kitchen/src/models/preparation-not-ready-in-kitchen-exception.ts new file mode 100644 index 0000000..672e787 --- /dev/null +++ b/libs/clients/kitchen/src/models/preparation-not-ready-in-kitchen-exception.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface PreparationNotReadyInKitchenException + */ +export interface PreparationNotReadyInKitchenException { + /** + * + * @type {string} + * @memberof PreparationNotReadyInKitchenException + */ + 'error': string; + /** + * + * @type {string} + * @memberof PreparationNotReadyInKitchenException + */ + 'details': string; +} + diff --git a/libs/clients/kitchen/src/models/preparation-request-dto.ts b/libs/clients/kitchen/src/models/preparation-request-dto.ts new file mode 100644 index 0000000..ba6938f --- /dev/null +++ b/libs/clients/kitchen/src/models/preparation-request-dto.ts @@ -0,0 +1,39 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { ItemToBeCookedDto } from './item-to-be-cooked-dto'; + +/** + * + * @export + * @interface PreparationRequestDto + */ +export interface PreparationRequestDto { + /** + * + * @type {number} + * @memberof PreparationRequestDto + */ + 'tableNumber': number; + /** + * + * @type {Array} + * @memberof PreparationRequestDto + */ + 'itemsToBeCooked': Array; +} + diff --git a/libs/clients/kitchen/src/models/prepared-item-dto.ts b/libs/clients/kitchen/src/models/prepared-item-dto.ts new file mode 100644 index 0000000..2dbc9b5 --- /dev/null +++ b/libs/clients/kitchen/src/models/prepared-item-dto.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface PreparedItemDto + */ +export interface PreparedItemDto { + /** + * + * @type {string} + * @memberof PreparedItemDto + */ + '_id': string; + /** + * + * @type {string} + * @memberof PreparedItemDto + */ + 'shortName': string; + /** + * + * @type {string} + * @memberof PreparedItemDto + */ + 'shouldStartAt': string; + /** + * + * @type {string} + * @memberof PreparedItemDto + */ + 'startedAt': string; + /** + * + * @type {string} + * @memberof PreparedItemDto + */ + 'finishedAt': string; +} + diff --git a/libs/clients/kitchen/src/models/prepared-item-id-not-found-exception.ts b/libs/clients/kitchen/src/models/prepared-item-id-not-found-exception.ts new file mode 100644 index 0000000..eac108e --- /dev/null +++ b/libs/clients/kitchen/src/models/prepared-item-id-not-found-exception.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface PreparedItemIdNotFoundException + */ +export interface PreparedItemIdNotFoundException { + /** + * + * @type {string} + * @memberof PreparedItemIdNotFoundException + */ + 'error': string; + /** + * + * @type {string} + * @memberof PreparedItemIdNotFoundException + */ + 'details': string; +} + diff --git a/libs/clients/kitchen/src/models/prepared-item.ts b/libs/clients/kitchen/src/models/prepared-item.ts new file mode 100644 index 0000000..610a665 --- /dev/null +++ b/libs/clients/kitchen/src/models/prepared-item.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { Recipe } from './recipe'; + +/** + * + * @export + * @interface PreparedItem + */ +export interface PreparedItem { + /** + * + * @type {string} + * @memberof PreparedItem + */ + '_id': string; + /** + * + * @type {string} + * @memberof PreparedItem + */ + 'shortName': string; + /** + * + * @type {Recipe} + * @memberof PreparedItem + */ + 'recipe': Recipe; + /** + * + * @type {string} + * @memberof PreparedItem + */ + 'shouldStartAt': string; + /** + * + * @type {string} + * @memberof PreparedItem + */ + 'startedAt': string; + /** + * + * @type {string} + * @memberof PreparedItem + */ + 'finishedAt': string; +} + diff --git a/libs/clients/kitchen/src/models/recipe.ts b/libs/clients/kitchen/src/models/recipe.ts new file mode 100644 index 0000000..c5b4c49 --- /dev/null +++ b/libs/clients/kitchen/src/models/recipe.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface Recipe + */ +export interface Recipe { + /** + * + * @type {string} + * @memberof Recipe + */ + '_id': string; + /** + * + * @type {string} + * @memberof Recipe + */ + 'shortName': string; + /** + * + * @type {string} + * @memberof Recipe + */ + 'post': RecipePostEnum; + /** + * + * @type {Array} + * @memberof Recipe + */ + 'cookingSteps': Array; + /** + * + * @type {number} + * @memberof Recipe + */ + 'meanCookingTimeInSec': number; +} + +export const RecipePostEnum = { + Bar: 'BAR', + ColdDish: 'COLD_DISH', + HotDish: 'HOT_DISH' +} as const; + +export type RecipePostEnum = typeof RecipePostEnum[keyof typeof RecipePostEnum]; + + diff --git a/libs/clients/kitchen/src/models/table-number-not-found-exception.ts b/libs/clients/kitchen/src/models/table-number-not-found-exception.ts new file mode 100644 index 0000000..9dc2f30 --- /dev/null +++ b/libs/clients/kitchen/src/models/table-number-not-found-exception.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface TableNumberNotFoundException + */ +export interface TableNumberNotFoundException { + /** + * + * @type {string} + * @memberof TableNumberNotFoundException + */ + 'error': string; + /** + * + * @type {string} + * @memberof TableNumberNotFoundException + */ + 'details': string; +} + diff --git a/libs/clients/kitchen/src/models/wrong-query-parameter-exception.ts b/libs/clients/kitchen/src/models/wrong-query-parameter-exception.ts new file mode 100644 index 0000000..aba5f09 --- /dev/null +++ b/libs/clients/kitchen/src/models/wrong-query-parameter-exception.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Kitchen Service + * Kitchen Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface WrongQueryParameterException + */ +export interface WrongQueryParameterException { + /** + * + * @type {string} + * @memberof WrongQueryParameterException + */ + 'error': string; + /** + * + * @type {string} + * @memberof WrongQueryParameterException + */ + 'details': string; +} + diff --git a/libs/clients/kitchen/tsconfig.json b/libs/clients/kitchen/tsconfig.json new file mode 100644 index 0000000..f2400ab --- /dev/null +++ b/libs/clients/kitchen/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + } + ] +} diff --git a/libs/clients/kitchen/tsconfig.lib.json b/libs/clients/kitchen/tsconfig.lib.json new file mode 100644 index 0000000..8f9c818 --- /dev/null +++ b/libs/clients/kitchen/tsconfig.lib.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "include": ["src/**/*.ts"], + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] +} diff --git a/libs/clients/menu/.eslintrc.json b/libs/clients/menu/.eslintrc.json new file mode 100644 index 0000000..3230caf --- /dev/null +++ b/libs/clients/menu/.eslintrc.json @@ -0,0 +1,25 @@ +{ + "extends": ["../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.json"], + "parser": "jsonc-eslint-parser", + "rules": { + "@nx/dependency-checks": "error" + } + } + ] +} diff --git a/libs/clients/menu/README.md b/libs/clients/menu/README.md new file mode 100644 index 0000000..3a674bd --- /dev/null +++ b/libs/clients/menu/README.md @@ -0,0 +1,7 @@ +# clients-menu + +This library was generated with [Nx](https://nx.dev). + +## Building + +Run `nx build clients-menu` to build the library. diff --git a/libs/clients/menu/openapi.yaml b/libs/clients/menu/openapi.yaml new file mode 100644 index 0000000..0c86b9d --- /dev/null +++ b/libs/clients/menu/openapi.yaml @@ -0,0 +1,259 @@ +openapi: 3.0.0 +paths: + /health: + get: + operationId: HealthController_check + parameters: [] + responses: + '200': + description: The Health Check is successful + content: + application/json: + schema: + type: object + properties: + status: + type: string + example: ok + info: + type: object + example: + database: + status: up + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + error: + type: object + example: {} + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + details: + type: object + example: + database: + status: up + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + '503': + description: The Health Check is not successful + content: + application/json: + schema: + type: object + properties: + status: + type: string + example: error + info: + type: object + example: + database: + status: up + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + error: + type: object + example: + redis: + status: down + message: Could not connect + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + details: + type: object + example: + database: + status: up + redis: + status: down + message: Could not connect + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + tags: + - health + /menus: + get: + operationId: MenusController_getFullMenu + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MenuItem' + tags: + - menus + post: + operationId: MenusController_addMenuItem + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AddMenuItemDto' + responses: + '201': + description: The menu item has been successfully added. + content: + application/json: + schema: + $ref: '#/components/schemas/MenuItem' + '409': + description: Menu short name already exists + content: + application/json: + schema: + $ref: '#/components/schemas/MenuItemShortNameAlreadyExistsException' + tags: + - menus + /menus/{menuItemId}: + get: + operationId: MenusController_getMenuItem + parameters: + - name: menuItemId + required: true + in: path + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/MenuItem' + '404': + description: MenuItem not found + content: + application/json: + schema: + $ref: '#/components/schemas/MenuItemIdNotFoundException' + tags: + - menus +info: + title: 'Micro-Service Restaurant: Menu Service' + description: Menu Service Open API definition + contact: {} + version: 0.0.0 +tags: [] +servers: + - url: https://menu-backend.spos.polytech.apoorva64.com/ + description: prod +components: + schemas: + MenuItem: + type: object + properties: + _id: + type: string + fullName: + type: string + shortName: + type: string + price: + type: number + category: + enum: + - STARTER + - MAIN + - DESSERT + - BEVERAGE + type: string + image: + type: string + required: + - _id + - fullName + - shortName + - price + - category + - image + MenuItemIdNotFoundException: + type: object + properties: + error: + type: string + details: + type: string + required: + - error + - details + AddMenuItemDto: + type: object + properties: + fullName: + type: string + shortName: + type: string + price: + type: number + minimum: 1 + category: + type: string + enum: + - STARTER + - MAIN + - DESSERT + - BEVERAGE + image: + type: string + required: + - fullName + - shortName + - price + - category + - image + MenuItemShortNameAlreadyExistsException: + type: object + properties: + error: + type: string + details: + type: string + required: + - error + - details diff --git a/libs/clients/menu/package.json b/libs/clients/menu/package.json new file mode 100644 index 0000000..52a8bc0 --- /dev/null +++ b/libs/clients/menu/package.json @@ -0,0 +1,12 @@ +{ + "name": "@spos/clients/menu", + "version": "0.0.1", + "dependencies": { + "tslib": "^2.3.0", + "axios": "^1.7.7" + }, + "type": "commonjs", + "main": "./src/index.js", + "typings": "./src/index.d.ts", + "private": true +} diff --git a/libs/clients/menu/project.json b/libs/clients/menu/project.json new file mode 100644 index 0000000..7bb6f89 --- /dev/null +++ b/libs/clients/menu/project.json @@ -0,0 +1,35 @@ +{ + "name": "clients-menu", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/clients/menu/src", + "projectType": "library", + "tags": [], + "targets": { + "build": { + "executor": "@nx/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/libs/clients/menu", + "main": "libs/clients/menu/src/index.ts", + "tsConfig": "libs/clients/menu/tsconfig.lib.json", + "assets": ["libs/clients/menu/*.md"] + } + }, + "generate": { + "executor": "nx:run-commands", + "options": { + "parallel": false, + "commands": [ + { + "command": "npx rimraf libs/clients/menu/src", + "description": "Clean up generated API client" + }, + { + "command": "npx openapi-generator-cli generate -i libs/clients/menu/openapi.yaml -g typescript-axios -o libs/clients/menu/src --ignore-file-override=.openapi-generator-ignore --additional-properties=useSingleRequestParameter=true,withSeparateModelsAndApi=true,apiPackage=api,modelPackage=models", + "description": "Generate API client from OpenAPI spec" + } + ] + } + } + } +} diff --git a/libs/clients/menu/src/.npmignore b/libs/clients/menu/src/.npmignore new file mode 100644 index 0000000..999d88d --- /dev/null +++ b/libs/clients/menu/src/.npmignore @@ -0,0 +1 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm \ No newline at end of file diff --git a/libs/clients/menu/src/.openapi-generator-ignore b/libs/clients/menu/src/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/libs/clients/menu/src/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/libs/clients/menu/src/.openapi-generator/FILES b/libs/clients/menu/src/.openapi-generator/FILES new file mode 100644 index 0000000..3b0e0ed --- /dev/null +++ b/libs/clients/menu/src/.openapi-generator/FILES @@ -0,0 +1,17 @@ +.npmignore +.openapi-generator-ignore +api.ts +api/health-api.ts +api/menus-api.ts +base.ts +common.ts +configuration.ts +index.ts +models/add-menu-item-dto.ts +models/health-controller-check200-response-info-value.ts +models/health-controller-check200-response.ts +models/health-controller-check503-response.ts +models/index.ts +models/menu-item-id-not-found-exception.ts +models/menu-item-short-name-already-exists-exception.ts +models/menu-item.ts diff --git a/libs/clients/menu/src/.openapi-generator/VERSION b/libs/clients/menu/src/.openapi-generator/VERSION new file mode 100644 index 0000000..09a6d30 --- /dev/null +++ b/libs/clients/menu/src/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0 diff --git a/libs/clients/menu/src/api.ts b/libs/clients/menu/src/api.ts new file mode 100644 index 0000000..8cde345 --- /dev/null +++ b/libs/clients/menu/src/api.ts @@ -0,0 +1,19 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Menu Service + * Menu Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +export * from './api/health-api'; +export * from './api/menus-api'; + diff --git a/libs/clients/menu/src/api/health-api.ts b/libs/clients/menu/src/api/health-api.ts new file mode 100644 index 0000000..e5d2365 --- /dev/null +++ b/libs/clients/menu/src/api/health-api.ts @@ -0,0 +1,122 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Menu Service + * Menu Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { HealthControllerCheck200Response } from '../models'; +// @ts-ignore +import type { HealthControllerCheck503Response } from '../models'; +/** + * HealthApi - axios parameter creator + * @export + */ +export const HealthApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + healthControllerCheck: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/health`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * HealthApi - functional programming interface + * @export + */ +export const HealthApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = HealthApiAxiosParamCreator(configuration) + return { + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async healthControllerCheck(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.healthControllerCheck(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['HealthApi.healthControllerCheck']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * HealthApi - factory interface + * @export + */ +export const HealthApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = HealthApiFp(configuration) + return { + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + healthControllerCheck(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.healthControllerCheck(options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * HealthApi - object-oriented interface + * @export + * @class HealthApi + * @extends {BaseAPI} + */ +export class HealthApi extends BaseAPI { + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof HealthApi + */ + public healthControllerCheck(options?: RawAxiosRequestConfig) { + return HealthApiFp(this.configuration).healthControllerCheck(options).then((request) => request(this.axios, this.basePath)); + } +} + diff --git a/libs/clients/menu/src/api/menus-api.ts b/libs/clients/menu/src/api/menus-api.ts new file mode 100644 index 0000000..21e411b --- /dev/null +++ b/libs/clients/menu/src/api/menus-api.ts @@ -0,0 +1,286 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Menu Service + * Menu Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { AddMenuItemDto } from '../models'; +// @ts-ignore +import type { MenuItem } from '../models'; +// @ts-ignore +import type { MenuItemIdNotFoundException } from '../models'; +// @ts-ignore +import type { MenuItemShortNameAlreadyExistsException } from '../models'; +/** + * MenusApi - axios parameter creator + * @export + */ +export const MenusApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @param {AddMenuItemDto} addMenuItemDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + menusControllerAddMenuItem: async (addMenuItemDto: AddMenuItemDto, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'addMenuItemDto' is not null or undefined + assertParamExists('menusControllerAddMenuItem', 'addMenuItemDto', addMenuItemDto) + const localVarPath = `/menus`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(addMenuItemDto, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + menusControllerGetFullMenu: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/menus`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} menuItemId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + menusControllerGetMenuItem: async (menuItemId: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'menuItemId' is not null or undefined + assertParamExists('menusControllerGetMenuItem', 'menuItemId', menuItemId) + const localVarPath = `/menus/{menuItemId}` + .replace(`{${"menuItemId"}}`, encodeURIComponent(String(menuItemId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * MenusApi - functional programming interface + * @export + */ +export const MenusApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = MenusApiAxiosParamCreator(configuration) + return { + /** + * + * @param {AddMenuItemDto} addMenuItemDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async menusControllerAddMenuItem(addMenuItemDto: AddMenuItemDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.menusControllerAddMenuItem(addMenuItemDto, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['MenusApi.menusControllerAddMenuItem']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async menusControllerGetFullMenu(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.menusControllerGetFullMenu(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['MenusApi.menusControllerGetFullMenu']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @param {string} menuItemId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async menusControllerGetMenuItem(menuItemId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.menusControllerGetMenuItem(menuItemId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['MenusApi.menusControllerGetMenuItem']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * MenusApi - factory interface + * @export + */ +export const MenusApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = MenusApiFp(configuration) + return { + /** + * + * @param {MenusApiMenusControllerAddMenuItemRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + menusControllerAddMenuItem(requestParameters: MenusApiMenusControllerAddMenuItemRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.menusControllerAddMenuItem(requestParameters.addMenuItemDto, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + menusControllerGetFullMenu(options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.menusControllerGetFullMenu(options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {MenusApiMenusControllerGetMenuItemRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + menusControllerGetMenuItem(requestParameters: MenusApiMenusControllerGetMenuItemRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.menusControllerGetMenuItem(requestParameters.menuItemId, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for menusControllerAddMenuItem operation in MenusApi. + * @export + * @interface MenusApiMenusControllerAddMenuItemRequest + */ +export interface MenusApiMenusControllerAddMenuItemRequest { + /** + * + * @type {AddMenuItemDto} + * @memberof MenusApiMenusControllerAddMenuItem + */ + readonly addMenuItemDto: AddMenuItemDto +} + +/** + * Request parameters for menusControllerGetMenuItem operation in MenusApi. + * @export + * @interface MenusApiMenusControllerGetMenuItemRequest + */ +export interface MenusApiMenusControllerGetMenuItemRequest { + /** + * + * @type {string} + * @memberof MenusApiMenusControllerGetMenuItem + */ + readonly menuItemId: string +} + +/** + * MenusApi - object-oriented interface + * @export + * @class MenusApi + * @extends {BaseAPI} + */ +export class MenusApi extends BaseAPI { + /** + * + * @param {MenusApiMenusControllerAddMenuItemRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MenusApi + */ + public menusControllerAddMenuItem(requestParameters: MenusApiMenusControllerAddMenuItemRequest, options?: RawAxiosRequestConfig) { + return MenusApiFp(this.configuration).menusControllerAddMenuItem(requestParameters.addMenuItemDto, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MenusApi + */ + public menusControllerGetFullMenu(options?: RawAxiosRequestConfig) { + return MenusApiFp(this.configuration).menusControllerGetFullMenu(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {MenusApiMenusControllerGetMenuItemRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MenusApi + */ + public menusControllerGetMenuItem(requestParameters: MenusApiMenusControllerGetMenuItemRequest, options?: RawAxiosRequestConfig) { + return MenusApiFp(this.configuration).menusControllerGetMenuItem(requestParameters.menuItemId, options).then((request) => request(this.axios, this.basePath)); + } +} + diff --git a/libs/clients/menu/src/base.ts b/libs/clients/menu/src/base.ts new file mode 100644 index 0000000..0c7f63a --- /dev/null +++ b/libs/clients/menu/src/base.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Menu Service + * Menu Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from './configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; + +export const BASE_PATH = "https://menu-backend.spos.polytech.apoorva64.com".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: RawAxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath ?? basePath; + } + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + constructor(public field: string, msg?: string) { + super(msg); + this.name = "RequiredError" + } +} + +interface ServerMap { + [key: string]: { + url: string, + description: string, + }[]; +} + +/** + * + * @export + */ +export const operationServerMap: ServerMap = { +} diff --git a/libs/clients/menu/src/common.ts b/libs/clients/menu/src/common.ts new file mode 100644 index 0000000..a4307ed --- /dev/null +++ b/libs/clients/menu/src/common.ts @@ -0,0 +1,150 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Menu Service + * Menu Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/libs/clients/menu/src/configuration.ts b/libs/clients/menu/src/configuration.ts new file mode 100644 index 0000000..436cbda --- /dev/null +++ b/libs/clients/menu/src/configuration.ts @@ -0,0 +1,110 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Menu Service + * Menu Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ConfigurationParameters { + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + serverIndex?: number; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.serverIndex = param.serverIndex; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/libs/clients/menu/src/index.ts b/libs/clients/menu/src/index.ts new file mode 100644 index 0000000..ff15941 --- /dev/null +++ b/libs/clients/menu/src/index.ts @@ -0,0 +1,18 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Menu Service + * Menu Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; +export * from "./models"; diff --git a/libs/clients/menu/src/models/add-menu-item-dto.ts b/libs/clients/menu/src/models/add-menu-item-dto.ts new file mode 100644 index 0000000..3e468f5 --- /dev/null +++ b/libs/clients/menu/src/models/add-menu-item-dto.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Menu Service + * Menu Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface AddMenuItemDto + */ +export interface AddMenuItemDto { + /** + * + * @type {string} + * @memberof AddMenuItemDto + */ + 'fullName': string; + /** + * + * @type {string} + * @memberof AddMenuItemDto + */ + 'shortName': string; + /** + * + * @type {number} + * @memberof AddMenuItemDto + */ + 'price': number; + /** + * + * @type {string} + * @memberof AddMenuItemDto + */ + 'category': AddMenuItemDtoCategoryEnum; + /** + * + * @type {string} + * @memberof AddMenuItemDto + */ + 'image': string; +} + +export const AddMenuItemDtoCategoryEnum = { + Starter: 'STARTER', + Main: 'MAIN', + Dessert: 'DESSERT', + Beverage: 'BEVERAGE' +} as const; + +export type AddMenuItemDtoCategoryEnum = typeof AddMenuItemDtoCategoryEnum[keyof typeof AddMenuItemDtoCategoryEnum]; + + diff --git a/libs/clients/menu/src/models/health-controller-check200-response-info-value.ts b/libs/clients/menu/src/models/health-controller-check200-response-info-value.ts new file mode 100644 index 0000000..3480196 --- /dev/null +++ b/libs/clients/menu/src/models/health-controller-check200-response-info-value.ts @@ -0,0 +1,32 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Menu Service + * Menu Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface HealthControllerCheck200ResponseInfoValue + */ +export interface HealthControllerCheck200ResponseInfoValue { + [key: string]: any; + + /** + * + * @type {string} + * @memberof HealthControllerCheck200ResponseInfoValue + */ + 'status': string; +} + diff --git a/libs/clients/menu/src/models/health-controller-check200-response.ts b/libs/clients/menu/src/models/health-controller-check200-response.ts new file mode 100644 index 0000000..d3b1a53 --- /dev/null +++ b/libs/clients/menu/src/models/health-controller-check200-response.ts @@ -0,0 +1,51 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Menu Service + * Menu Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { HealthControllerCheck200ResponseInfoValue } from './health-controller-check200-response-info-value'; + +/** + * + * @export + * @interface HealthControllerCheck200Response + */ +export interface HealthControllerCheck200Response { + /** + * + * @type {string} + * @memberof HealthControllerCheck200Response + */ + 'status'?: string; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck200Response + */ + 'info'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; } | null; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck200Response + */ + 'error'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; } | null; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck200Response + */ + 'details'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; }; +} + diff --git a/libs/clients/menu/src/models/health-controller-check503-response.ts b/libs/clients/menu/src/models/health-controller-check503-response.ts new file mode 100644 index 0000000..1d13c44 --- /dev/null +++ b/libs/clients/menu/src/models/health-controller-check503-response.ts @@ -0,0 +1,51 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Menu Service + * Menu Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { HealthControllerCheck200ResponseInfoValue } from './health-controller-check200-response-info-value'; + +/** + * + * @export + * @interface HealthControllerCheck503Response + */ +export interface HealthControllerCheck503Response { + /** + * + * @type {string} + * @memberof HealthControllerCheck503Response + */ + 'status'?: string; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck503Response + */ + 'info'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; } | null; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck503Response + */ + 'error'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; } | null; + /** + * + * @type {{ [key: string]: HealthControllerCheck200ResponseInfoValue; }} + * @memberof HealthControllerCheck503Response + */ + 'details'?: { [key: string]: HealthControllerCheck200ResponseInfoValue; }; +} + diff --git a/libs/clients/menu/src/models/index.ts b/libs/clients/menu/src/models/index.ts new file mode 100644 index 0000000..9b8ec0a --- /dev/null +++ b/libs/clients/menu/src/models/index.ts @@ -0,0 +1,7 @@ +export * from './add-menu-item-dto'; +export * from './health-controller-check200-response'; +export * from './health-controller-check200-response-info-value'; +export * from './health-controller-check503-response'; +export * from './menu-item'; +export * from './menu-item-id-not-found-exception'; +export * from './menu-item-short-name-already-exists-exception'; diff --git a/libs/clients/menu/src/models/menu-item-id-not-found-exception.ts b/libs/clients/menu/src/models/menu-item-id-not-found-exception.ts new file mode 100644 index 0000000..d2ecfb5 --- /dev/null +++ b/libs/clients/menu/src/models/menu-item-id-not-found-exception.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Menu Service + * Menu Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface MenuItemIdNotFoundException + */ +export interface MenuItemIdNotFoundException { + /** + * + * @type {string} + * @memberof MenuItemIdNotFoundException + */ + 'error': string; + /** + * + * @type {string} + * @memberof MenuItemIdNotFoundException + */ + 'details': string; +} + diff --git a/libs/clients/menu/src/models/menu-item-short-name-already-exists-exception.ts b/libs/clients/menu/src/models/menu-item-short-name-already-exists-exception.ts new file mode 100644 index 0000000..2a9023e --- /dev/null +++ b/libs/clients/menu/src/models/menu-item-short-name-already-exists-exception.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Menu Service + * Menu Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface MenuItemShortNameAlreadyExistsException + */ +export interface MenuItemShortNameAlreadyExistsException { + /** + * + * @type {string} + * @memberof MenuItemShortNameAlreadyExistsException + */ + 'error': string; + /** + * + * @type {string} + * @memberof MenuItemShortNameAlreadyExistsException + */ + 'details': string; +} + diff --git a/libs/clients/menu/src/models/menu-item.ts b/libs/clients/menu/src/models/menu-item.ts new file mode 100644 index 0000000..b67a13f --- /dev/null +++ b/libs/clients/menu/src/models/menu-item.ts @@ -0,0 +1,70 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Micro-Service Restaurant: Menu Service + * Menu Service Open API definition + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface MenuItem + */ +export interface MenuItem { + /** + * + * @type {string} + * @memberof MenuItem + */ + '_id': string; + /** + * + * @type {string} + * @memberof MenuItem + */ + 'fullName': string; + /** + * + * @type {string} + * @memberof MenuItem + */ + 'shortName': string; + /** + * + * @type {number} + * @memberof MenuItem + */ + 'price': number; + /** + * + * @type {string} + * @memberof MenuItem + */ + 'category': MenuItemCategoryEnum; + /** + * + * @type {string} + * @memberof MenuItem + */ + 'image': string; +} + +export const MenuItemCategoryEnum = { + Starter: 'STARTER', + Main: 'MAIN', + Dessert: 'DESSERT', + Beverage: 'BEVERAGE' +} as const; + +export type MenuItemCategoryEnum = typeof MenuItemCategoryEnum[keyof typeof MenuItemCategoryEnum]; + + diff --git a/libs/clients/menu/tsconfig.json b/libs/clients/menu/tsconfig.json new file mode 100644 index 0000000..f2400ab --- /dev/null +++ b/libs/clients/menu/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + } + ] +} diff --git a/libs/clients/menu/tsconfig.lib.json b/libs/clients/menu/tsconfig.lib.json new file mode 100644 index 0000000..8f9c818 --- /dev/null +++ b/libs/clients/menu/tsconfig.lib.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "include": ["src/**/*.ts"], + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] +} diff --git a/nx.json b/nx.json index ab00a38..6af88ae 100644 --- a/nx.json +++ b/nx.json @@ -2,10 +2,7 @@ "$schema": "./node_modules/nx/schemas/nx-schema.json", "defaultBase": "master", "namedInputs": { - "default": [ - "{projectRoot}/**/*", - "sharedGlobals" - ], + "default": ["{projectRoot}/**/*", "sharedGlobals"], "production": [ "default", "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", @@ -16,9 +13,7 @@ "!{projectRoot}/src/test-setup.[jt]s", "!{projectRoot}/test-setup.[jt]s" ], - "sharedGlobals": [ - "{workspaceRoot}/.github/workflows/ci.yml" - ] + "sharedGlobals": ["{workspaceRoot}/.github/workflows/ci.yml"] }, "neverConnectToCloud": true, "plugins": [ @@ -44,9 +39,7 @@ "options": { "targetName": "test" }, - "exclude": [ - "apps/sample-nestjs-e2e/**/*" - ] + "exclude": ["apps/sample-nestjs-e2e/**/*"] }, { "plugin": "@nx/webpack/plugin", @@ -115,5 +108,12 @@ } } } + }, + "targetDefaults": { + "@nx/js:tsc": { + "cache": true, + "dependsOn": ["^build"], + "inputs": ["production", "^production"] + } } } diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 0000000..2f4612c --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.8.0" + } +} diff --git a/package-lock.json b/package-lock.json index edffcec..4a72187 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@nestjs/common": "^10.0.2", "@nestjs/core": "^10.0.2", "@nestjs/platform-express": "^10.0.2", + "@tanstack/react-query": "^5.56.2", "axios": "^1.6.0", "react": "18.3.1", "react-dom": "18.3.1", @@ -48,6 +49,7 @@ "@nx/web": "19.7.2", "@nx/webpack": "19.7.2", "@nx/workspace": "19.7.2", + "@openapitools/openapi-generator-cli": "^2.13.9", "@swc-node/register": "~1.9.1", "@swc/cli": "~0.3.12", "@swc/core": "~1.5.7", @@ -5338,14 +5340,26 @@ "@tybys/wasm-util": "^0.9.0" } }, + "node_modules/@nestjs/axios": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.3.tgz", + "integrity": "sha512-h6TCn3yJwD6OKqqqfmtRS5Zo4E46Ip2n+gK1sqwzNBC+qxQ9xpCu+ODVRFur6V3alHSCSBxb3nNtt73VEdluyA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0", + "axios": "^1.3.1", + "rxjs": "^6.0.0 || ^7.0.0" + } + }, "node_modules/@nestjs/common": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.4.1.tgz", - "integrity": "sha512-4CkrDx0s4XuWqFjX8WvOFV7Y6RGJd0P2OBblkhZS7nwoctoSuW5pyEa8SWak6YHNGrHRpFb6ymm5Ai4LncwRVA==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.4.3.tgz", + "integrity": "sha512-4hbLd3XIJubHSylYd/1WSi4VQvG68KM/ECYpMDqA3k3J1/T17SAg40sDoq3ZoO5OZgU0xuNyjuISdOTjs11qVg==", "license": "MIT", "dependencies": { "iterare": "1.2.1", - "tslib": "2.6.3", + "tslib": "2.7.0", "uid": "2.0.2" }, "funding": { @@ -5367,24 +5381,18 @@ } } }, - "node_modules/@nestjs/common/node_modules/tslib": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", - "license": "0BSD" - }, "node_modules/@nestjs/core": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.4.1.tgz", - "integrity": "sha512-9I1WdfOBCCHdUm+ClBJupOuZQS6UxzIWHIq6Vp1brAA5ZKl/Wq6BVwSsbnUJGBy3J3PM2XHmR0EQ4fwX3nR7lA==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.4.3.tgz", + "integrity": "sha512-6OQz+5C8mT8yRtfvE5pPCq+p6w5jDot+oQku1KzQ24ABn+lay1KGuJwcKZhdVNuselx+8xhdMxknZTA8wrGLIg==", "hasInstallScript": true, "license": "MIT", "dependencies": { "@nuxtjs/opencollective": "0.3.2", "fast-safe-stringify": "2.1.1", "iterare": "1.2.1", - "path-to-regexp": "3.2.0", - "tslib": "2.6.3", + "path-to-regexp": "3.3.0", + "tslib": "2.7.0", "uid": "2.0.2" }, "funding": { @@ -5412,17 +5420,11 @@ } }, "node_modules/@nestjs/core/node_modules/path-to-regexp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz", - "integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.3.0.tgz", + "integrity": "sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==", "license": "MIT" }, - "node_modules/@nestjs/core/node_modules/tslib": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", - "license": "0BSD" - }, "node_modules/@nestjs/platform-express": { "version": "10.4.1", "resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-10.4.1.tgz", @@ -6839,6 +6841,122 @@ "@octokit/openapi-types": "^22.2.0" } }, + "node_modules/@openapitools/openapi-generator-cli": { + "version": "2.13.9", + "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.13.9.tgz", + "integrity": "sha512-GJaWGcHmLsvj/G1mRDytm9PTDwRGSYUDTf1uA/2FYxQAb5sq4nkZz1tD4Z7qDlZ3xTYSTw4Z8BQUdlsnrA8rcw==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@nestjs/axios": "3.0.3", + "@nestjs/common": "10.4.3", + "@nestjs/core": "10.4.3", + "@nuxtjs/opencollective": "0.3.2", + "axios": "1.7.4", + "chalk": "4.1.2", + "commander": "8.3.0", + "compare-versions": "4.1.4", + "concurrently": "6.5.1", + "console.table": "0.10.0", + "fs-extra": "10.1.0", + "glob": "7.2.3", + "https-proxy-agent": "7.0.4", + "inquirer": "8.2.6", + "lodash": "4.17.21", + "reflect-metadata": "0.1.13", + "rxjs": "7.8.1", + "tslib": "2.6.2" + }, + "bin": { + "openapi-generator-cli": "main.js" + }, + "engines": { + "node": ">=10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/openapi_generator" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/axios": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", + "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/https-proxy-agent": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/reflect-metadata": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true, + "license": "0BSD" + }, "node_modules/@phenomnomnominal/tsquery": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@phenomnomnominal/tsquery/-/tsquery-5.0.1.tgz", @@ -7994,6 +8112,32 @@ "node": ">=10" } }, + "node_modules/@tanstack/query-core": { + "version": "5.56.2", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.56.2.tgz", + "integrity": "sha512-gor0RI3/R5rVV3gXfddh1MM+hgl0Z4G7tj6Xxpq6p2I03NGPaJ8dITY9Gz05zYYb/EJq9vPas/T4wn9EaDPd4Q==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/react-query": { + "version": "5.56.2", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.56.2.tgz", + "integrity": "sha512-SR0GzHVo6yzhN72pnRhkEFRAHMsUo5ZPzAxfTMvUxFIDVS6W9LYUp6nXW3fcHVdg0ZJl8opSH85jqahvm6DSVg==", + "license": "MIT", + "dependencies": { + "@tanstack/query-core": "5.56.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^18 || ^19" + } + }, "node_modules/@testing-library/dom": { "version": "10.4.0", "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.0.tgz", @@ -11068,6 +11212,13 @@ "node": ">=10" } }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true, + "license": "MIT" + }, "node_modules/check-error": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", @@ -11165,6 +11316,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 10" + } + }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -11407,6 +11568,13 @@ "dot-prop": "^5.1.0" } }, + "node_modules/compare-versions": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-4.1.4.tgz", + "integrity": "sha512-FemMreK9xNyL8gQevsdRMrvO4lFCkQP7qbuktn1q8ndcNk1+0mz7lgE7b/sNvbhVgY4w6tMN1FDp6aADjqw2rw==", + "dev": true, + "license": "MIT" + }, "node_modules/comparejs": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/comparejs/-/comparejs-1.0.0.tgz", @@ -11543,6 +11711,106 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/concurrently": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-6.5.1.tgz", + "integrity": "sha512-FlSwNpGjWQfRwPLXvJ/OgysbBxPkWpiVjy1042b0U7on7S7qwwMIILRj7WTN1mTgqa582bG6NFuScOoh6Zgdag==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "date-fns": "^2.16.1", + "lodash": "^4.17.21", + "rxjs": "^6.6.3", + "spawn-command": "^0.0.2-1", + "supports-color": "^8.1.0", + "tree-kill": "^1.2.2", + "yargs": "^16.2.0" + }, + "bin": { + "concurrently": "bin/concurrently.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/concurrently/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/concurrently/node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/concurrently/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true, + "license": "0BSD" + }, + "node_modules/concurrently/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/concurrently/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, "node_modules/confbox": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", @@ -11573,6 +11841,19 @@ "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==", "license": "MIT" }, + "node_modules/console.table": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/console.table/-/console.table-0.10.0.tgz", + "integrity": "sha512-dPyZofqggxuvSf7WXvNjuRfnsOk1YazkVP8FdxH4tcH2c37wc79/Yl6Bhr7Lsu00KMgy2ql/qCMuNu8xctZM8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "easy-table": "1.1.0" + }, + "engines": { + "node": "> 0.10" + } + }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -12468,6 +12749,23 @@ "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", "license": "MIT" }, + "node_modules/date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.21.0" + }, + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, "node_modules/date-format": { "version": "4.0.14", "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz", @@ -13050,6 +13348,16 @@ "dev": true, "license": "MIT" }, + "node_modules/easy-table": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.1.0.tgz", + "integrity": "sha512-oq33hWOSSnl2Hoh00tZWaIPi1ievrD9aFG82/IgjlycAnW9hHx5PkJiXpxPsgEE+H7BsbVQXFVFST8TEXS6/pA==", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "wcwidth": ">=1.0.1" + } + }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", @@ -14371,6 +14679,34 @@ "node": ">=4" } }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/external-editor/node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -16361,6 +16697,72 @@ "dev": true, "license": "ISC" }, + "node_modules/inquirer": { + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", + "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^6.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/inquirer/node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/internal-slot": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", @@ -19315,6 +19717,13 @@ "multicast-dns": "cli.js" } }, + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true, + "license": "ISC" + }, "node_modules/mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", @@ -20028,6 +20437,16 @@ "node": ">=4" } }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/p-cancelable": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", @@ -21996,6 +22415,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -22766,6 +23195,12 @@ "source-map": "^0.6.0" } }, + "node_modules/spawn-command": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz", + "integrity": "sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==", + "dev": true + }, "node_modules/spdx-correct": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", @@ -24456,6 +24891,16 @@ "tslib": "2" } }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, "node_modules/trim-newlines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", diff --git a/package.json b/package.json index 4671b1d..6f425c2 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "@nestjs/common": "^10.0.2", "@nestjs/core": "^10.0.2", "@nestjs/platform-express": "^10.0.2", + "@tanstack/react-query": "^5.56.2", "axios": "^1.6.0", "react": "18.3.1", "react-dom": "18.3.1", @@ -46,6 +47,7 @@ "@nx/web": "19.7.2", "@nx/webpack": "19.7.2", "@nx/workspace": "19.7.2", + "@openapitools/openapi-generator-cli": "^2.13.9", "@swc-node/register": "~1.9.1", "@swc/cli": "~0.3.12", "@swc/core": "~1.5.7", diff --git a/tsconfig.base.json b/tsconfig.base.json index 1ffbea5..8ae0a19 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -15,6 +15,9 @@ "skipDefaultLibCheck": true, "baseUrl": ".", "paths": { + "@spos/clients/dining": ["libs/clients/dining/src/index.ts"], + "@spos/clients/kitchen": ["libs/clients/kitchen/src/index.ts"], + "@spos/clients/menu": ["libs/clients/menu/src/index.ts"], "@spos/ui/common": ["libs/ui/common/src/index.ts"] } }, From 0d4798e100c941d10f03845abaade66689a834aa Mon Sep 17 00:00:00 2001 From: Apoorva Srinivas Appadoo Date: Mon, 23 Sep 2024 19:46:51 +0200 Subject: [PATCH 02/10] ci: use action v3 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9c6bf6..7471c6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: main: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Git From 7a98d765a3de820088547aba6f20a2ec91ffd00c Mon Sep 17 00:00:00 2001 From: Apoorva Srinivas Appadoo Date: Mon, 23 Sep 2024 19:48:29 +0200 Subject: [PATCH 03/10] ci: use action v3 --- .github/workflows/ci.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7471c6d..c3a0c59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,14 +15,6 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Setup Git - run: | - git config user.name "GitHub Bot" - git config user.email "gituser@example.com" - # # This enables task distribution via Nx Cloud - # # Run this command as early as possible, before dependencies are installed - # # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - uses: actions/setup-node@v4 @@ -49,6 +41,10 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: 'Build images' run: INPUT_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=container --parallel=2 --no-cloud + - name: Setup Git + run: | + git config user.name "GitHub Bot" + git config user.email "gituser@example.com" - name: Semantic Release shell: bash run: npx nx release From 19a850400bec4803c73ef336723e961b9df00e86 Mon Sep 17 00:00:00 2001 From: Apoorva Srinivas Appadoo Date: Mon, 23 Sep 2024 19:52:10 +0200 Subject: [PATCH 04/10] ci: use action v3 --- .github/workflows/ci.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3a0c59..57edb5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,9 +12,18 @@ jobs: main: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 50 + + - name: Setup Git + run: | + git config user.name "GitHub Bot" + git config user.email "gituser@example.com" + # # This enables task distribution via Nx Cloud + # # Run this command as early as possible, before dependencies are installed + # # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - uses: actions/setup-node@v4 @@ -41,10 +50,6 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: 'Build images' run: INPUT_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=container --parallel=2 --no-cloud - - name: Setup Git - run: | - git config user.name "GitHub Bot" - git config user.email "gituser@example.com" - name: Semantic Release shell: bash run: npx nx release From c19e2a9bb38ff8488813bbfebf0a9424561c6adb Mon Sep 17 00:00:00 2001 From: Apoorva Srinivas Appadoo Date: Mon, 23 Sep 2024 19:53:48 +0200 Subject: [PATCH 05/10] ci: use action v3 --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57edb5a..c97a164 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 50 + fetch-tags: true - name: Setup Git run: | From dd495b5480cd63d0cefe6f6f80da0a6ddbec95ed Mon Sep 17 00:00:00 2001 From: Apoorva Srinivas Appadoo Date: Mon, 23 Sep 2024 19:54:44 +0200 Subject: [PATCH 06/10] ci: use action v3 --- nx.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx.json b/nx.json index 6af88ae..4dd5182 100644 --- a/nx.json +++ b/nx.json @@ -1,6 +1,6 @@ { "$schema": "./node_modules/nx/schemas/nx-schema.json", - "defaultBase": "master", + "defaultBase": "origin/master", "namedInputs": { "default": ["{projectRoot}/**/*", "sharedGlobals"], "production": [ From 15a85583d33a154fa66efda8b1ce4e941ff4fb83 Mon Sep 17 00:00:00 2001 From: Apoorva Srinivas Appadoo Date: Mon, 23 Sep 2024 19:56:57 +0200 Subject: [PATCH 07/10] ci: use action v3 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c97a164..d61e259 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,9 +12,9 @@ jobs: main: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 with: - fetch-depth: 50 + fetch-depth: 0 fetch-tags: true - name: Setup Git From a42d1925cb81c9b91064e9db639f338bb0acc4e1 Mon Sep 17 00:00:00 2001 From: Apoorva Srinivas Appadoo Date: Mon, 23 Sep 2024 20:01:12 +0200 Subject: [PATCH 08/10] test: remove tests --- .../src/app/app.controller.spec.ts | 22 ------------------- .../sample-nestjs/src/app/app.service.spec.ts | 21 ------------------ apps/sample-react/src/app/app.spec.tsx | 15 ------------- 3 files changed, 58 deletions(-) delete mode 100644 apps/sample-nestjs/src/app/app.controller.spec.ts delete mode 100644 apps/sample-nestjs/src/app/app.service.spec.ts delete mode 100644 apps/sample-react/src/app/app.spec.tsx diff --git a/apps/sample-nestjs/src/app/app.controller.spec.ts b/apps/sample-nestjs/src/app/app.controller.spec.ts deleted file mode 100644 index de8007e..0000000 --- a/apps/sample-nestjs/src/app/app.controller.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Test, TestingModule } from '@nestjs/testing'; - -import { AppController } from './app.controller'; -import { AppService } from './app.service'; - -describe('AppController', () => { - let app: TestingModule; - - beforeAll(async () => { - app = await Test.createTestingModule({ - controllers: [AppController], - providers: [AppService], - }).compile(); - }); - - describe('getData', () => { - it('should return "Hello API"', () => { - const appController = app.get(AppController); - expect(appController.getData()).toEqual({ message: 'Hello API' }); - }); - }); -}); diff --git a/apps/sample-nestjs/src/app/app.service.spec.ts b/apps/sample-nestjs/src/app/app.service.spec.ts deleted file mode 100644 index 42cf0a2..0000000 --- a/apps/sample-nestjs/src/app/app.service.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Test } from '@nestjs/testing'; - -import { AppService } from './app.service'; - -describe('AppService', () => { - let service: AppService; - - beforeAll(async () => { - const app = await Test.createTestingModule({ - providers: [AppService], - }).compile(); - - service = app.get(AppService); - }); - - describe('getData', () => { - it('should return "Hello API"', () => { - expect(service.getData()).toEqual({ message: 'Hello API' }); - }); - }); -}); diff --git a/apps/sample-react/src/app/app.spec.tsx b/apps/sample-react/src/app/app.spec.tsx deleted file mode 100644 index 574a59f..0000000 --- a/apps/sample-react/src/app/app.spec.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { render } from '@testing-library/react'; - -import App from './app'; - -describe('App', () => { - it('should render successfully', () => { - const { baseElement } = render(); - expect(baseElement).toBeTruthy(); - }); - - it('should have a greeting as the title', () => { - const { getByText } = render(); - expect(getByText(/Welcome sample-react/gi)).toBeTruthy(); - }); -}); From 253690e36f8f79da936f91cc7f27f82b4262f087 Mon Sep 17 00:00:00 2001 From: Apoorva Srinivas Appadoo Date: Mon, 23 Sep 2024 20:06:30 +0200 Subject: [PATCH 09/10] test: fix tests --- apps/sample-nestjs/src/app/app.service.spec.ts | 15 +++++++++++++++ apps/sample-react/src/app/app.spec.tsx | 12 ++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 apps/sample-nestjs/src/app/app.service.spec.ts create mode 100644 apps/sample-react/src/app/app.spec.tsx diff --git a/apps/sample-nestjs/src/app/app.service.spec.ts b/apps/sample-nestjs/src/app/app.service.spec.ts new file mode 100644 index 0000000..6191d85 --- /dev/null +++ b/apps/sample-nestjs/src/app/app.service.spec.ts @@ -0,0 +1,15 @@ +import { Test } from '@nestjs/testing'; + +import { AppService } from './app.service'; + +describe('AppService', () => { + let service: AppService; + + beforeAll(async () => { + const app = await Test.createTestingModule({ + providers: [AppService], + }).compile(); + + service = app.get(AppService) as AppService; + }); +}); diff --git a/apps/sample-react/src/app/app.spec.tsx b/apps/sample-react/src/app/app.spec.tsx new file mode 100644 index 0000000..f0d1ea1 --- /dev/null +++ b/apps/sample-react/src/app/app.spec.tsx @@ -0,0 +1,12 @@ +import { render } from '@testing-library/react'; + +import App from './app'; +import {QueryClient, QueryClientProvider} from "@tanstack/react-query"; + +describe('App', () => { + it('should render successfully', () => { + const queryClient = new QueryClient() + const { baseElement } = render(); + expect(baseElement).toBeTruthy(); + }); +}); From 2449b571905927b6c9fc530cf7e626a43e583b57 Mon Sep 17 00:00:00 2001 From: Apoorva Srinivas Appadoo Date: Mon, 23 Sep 2024 22:50:35 +0200 Subject: [PATCH 10/10] test: fix tests --- apps/sample-nestjs/src/app/app.service.spec.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/sample-nestjs/src/app/app.service.spec.ts b/apps/sample-nestjs/src/app/app.service.spec.ts index 6191d85..1f7c70c 100644 --- a/apps/sample-nestjs/src/app/app.service.spec.ts +++ b/apps/sample-nestjs/src/app/app.service.spec.ts @@ -12,4 +12,8 @@ describe('AppService', () => { service = app.get(AppService) as AppService; }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); });