From c3c9976db1d06fb8b8e7e43fa765073a5d19ed00 Mon Sep 17 00:00:00 2001 From: solufa Date: Thu, 3 Sep 2020 05:32:23 +0900 Subject: [PATCH 1/4] feat: update aspida@0.21.0 --- package.json | 2 +- samples/externals/$api.ts | 48 +-- samples/externals/users/$api.ts | 48 +-- samples/freee/$api.ts | 312 ++++++++++++------ samples/freee/api/$api.ts | 312 ++++++++++++------ samples/freee/api/1/$api.ts | 312 ++++++++++++------ samples/freee/api/1/account_items/$api.ts | 20 +- samples/freee/api/1/banks/$api.ts | 13 +- samples/freee/api/1/companies/$api.ts | 15 +- samples/freee/api/1/deals/$api.ts | 38 ++- .../$api.ts | 20 +- .../freee/api/1/expense_applications/$api.ts | 20 +- samples/freee/api/1/forms/$api.ts | 10 +- samples/freee/api/1/forms/selectables/$api.ts | 10 +- samples/freee/api/1/invoices/$api.ts | 20 +- samples/freee/api/1/items/$api.ts | 20 +- samples/freee/api/1/journals/$api.ts | 24 +- samples/freee/api/1/journals/reports/$api.ts | 18 +- samples/freee/api/1/manual_journals/$api.ts | 20 +- samples/freee/api/1/partners/$api.ts | 25 +- samples/freee/api/1/partners/code/$api.ts | 7 +- samples/freee/api/1/quotations/$api.ts | 20 +- samples/freee/api/1/receipts/$api.ts | 20 +- samples/freee/api/1/reports/$api.ts | 46 ++- samples/freee/api/1/reports/trial_bs/$api.ts | 10 +- .../1/reports/trial_bs_three_years/$api.ts | 10 +- .../api/1/reports/trial_bs_two_years/$api.ts | 10 +- samples/freee/api/1/reports/trial_pl/$api.ts | 10 +- .../api/1/reports/trial_pl_sections/$api.ts | 10 +- .../1/reports/trial_pl_three_years/$api.ts | 10 +- .../api/1/reports/trial_pl_two_years/$api.ts | 10 +- samples/freee/api/1/sections/$api.ts | 20 +- samples/freee/api/1/segments/$api.ts | 22 +- samples/freee/api/1/tags/$api.ts | 20 +- samples/freee/api/1/taxes/$api.ts | 15 +- samples/freee/api/1/taxes/codes/$api.ts | 10 +- samples/freee/api/1/taxes/companies/$api.ts | 7 +- samples/freee/api/1/transfers/$api.ts | 20 +- samples/freee/api/1/users/$api.ts | 24 +- .../freee/api/1/users/capabilities/$api.ts | 10 +- samples/freee/api/1/users/me/$api.ts | 12 +- samples/freee/api/1/wallet_txns/$api.ts | 18 +- samples/freee/api/1/walletables/$api.ts | 20 +- samples/openapi/$api.ts | 259 +++++++++------ samples/openapi/api/$api.ts | 259 +++++++++------ samples/openapi/api/stream/$api.ts | 14 +- samples/openapi/api/stream/v1/$api.ts | 14 +- samples/openapi/api/stream/v1/stories/$api.ts | 14 +- samples/openapi/api/v1/$api.ts | 44 ++- samples/openapi/api/v1/me/$api.ts | 7 +- samples/openapi/api/v1/mixes/$api.ts | 24 +- samples/openapi/api/v1/parse/$api.ts | 12 +- samples/openapi/api/v1/parse/image/$api.ts | 7 +- samples/openapi/api/v1/token/$api.ts | 7 +- samples/openapi/api/v3/$api.ts | 211 +++++++----- samples/openapi/api/v3/2fa/$api.ts | 7 +- samples/openapi/api/v3/channels/$api.ts | 80 +++-- samples/openapi/api/v3/chats/$api.ts | 37 ++- samples/openapi/api/v3/chats/keys/$api.ts | 7 +- samples/openapi/api/v3/extension/$api.ts | 42 ++- .../openapi/api/v3/extension/audio/$api.ts | 7 +- .../openapi/api/v3/extension/image/$api.ts | 7 +- .../openapi/api/v3/extension/parse/$api.ts | 7 +- .../openapi/api/v3/extension/story/$api.ts | 22 +- .../openapi/api/v3/extension/video/$api.ts | 7 +- samples/openapi/api/v3/fcm_token/$api.ts | 7 +- samples/openapi/api/v3/info/$api.ts | 7 +- samples/openapi/api/v3/login/$api.ts | 7 +- samples/openapi/api/v3/logout/$api.ts | 7 +- samples/openapi/api/v3/me/$api.ts | 7 +- samples/openapi/api/v3/organisation/$api.ts | 15 +- .../openapi/api/v3/organisation/users/$api.ts | 10 +- samples/openapi/api/v3/stories/$api.ts | 22 +- samples/openapi/api/v3/user/$api.ts | 17 +- samples/openapi/api/v3/user/profile/$api.ts | 7 +- samples/simple/$api.ts | 54 +-- samples/simple/dummy/$api.ts | 22 +- samples/simple/file/$api.ts | 12 +- samples/simple/user/$api.ts | 26 +- samples/strapi/$api.ts | 117 ++++--- samples/strapi/auth/$api.ts | 41 ++- .../strapi/auth/email-confirmation/$api.ts | 7 +- samples/strapi/auth/forgot-password/$api.ts | 7 +- samples/strapi/auth/local/$api.ts | 12 +- samples/strapi/auth/local/register/$api.ts | 7 +- samples/strapi/auth/reset-password/$api.ts | 7 +- .../auth/send-email-confirmation/$api.ts | 7 +- samples/strapi/connect/$api.ts | 7 +- samples/strapi/email/$api.ts | 7 +- samples/strapi/upload/$api.ts | 29 +- samples/strapi/upload/files/$api.ts | 17 +- samples/strapi/upload/files/count/$api.ts | 7 +- samples/strapi/upload/search/$api.ts | 7 +- samples/strapi/users-permissions/$api.ts | 33 +- samples/strapi/users-permissions/init/$api.ts | 7 +- .../strapi/users-permissions/roles/$api.ts | 22 +- .../strapi/users-permissions/search/$api.ts | 10 +- samples/strapi/users/$api.ts | 22 +- samples/strapi/users/me/$api.ts | 7 +- samples/swagger/$api.ts | 66 ++-- samples/swagger/pet/$api.ts | 29 +- samples/swagger/pet/findByStatus/$api.ts | 10 +- samples/swagger/store/$api.ts | 19 +- samples/swagger/store/inventory/$api.ts | 7 +- samples/swagger/store/order/$api.ts | 14 +- samples/swagger/user/$api.ts | 34 +- samples/swagger/user/createWithArray/$api.ts | 7 +- samples/swagger/user/createWithList/$api.ts | 7 +- samples/swagger/user/login/$api.ts | 10 +- samples/swagger/user/logout/$api.ts | 2 + yarn.lock | 8 +- 111 files changed, 2227 insertions(+), 1349 deletions(-) diff --git a/package.json b/package.json index d1fe0d8a..9256e601 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "swagger" ], "dependencies": { - "aspida": "^0.20.3", + "aspida": "^0.21.0", "swagger-parser": "^10.0.1", "swagger2openapi": "^6.2.3" }, diff --git a/samples/externals/$api.ts b/samples/externals/$api.ts index ebcbbc09..4254284a 100644 --- a/samples/externals/$api.ts +++ b/samples/externals/$api.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { AspidaClient } from 'aspida' +import { AspidaClient, dataToURLString } from 'aspida' import { Methods as Methods0 } from './users/_user_id@string/orders' import { Methods as Methods1 } from './users/_user_id@string/orders/_order_id@string' import { Methods as Methods2 } from './users/_user_id@string/orders/purchase/invoice' @@ -10,17 +10,17 @@ import { Methods as Methods6 } from './users/_user_id@string/phone-numbers/_phon import { Methods as Methods7 } from './users/_user_id@string/phone-numbers/_phone_number@string/orders/purchase/invoice' import { Methods as Methods8 } from './users/_user_id@string/phone-numbers/_phone_number@string/orders/purchase/wallet' -const GET = 'GET' -const POST = 'POST' -const PATH0 = '/users' -const PATH1 = '/orders' -const PATH2 = '/orders/purchase/invoice' -const PATH3 = '/orders/purchase/wallet' -const PATH4 = '/orders/unsubscribe' -const PATH5 = '/orders/update/renew' -const PATH6 = '/phone-numbers' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.baikalplatform.com/product-management/v1' : baseURL).replace(/\/$/, '') + const PATH0 = '/users' + const PATH1 = '/orders' + const PATH2 = '/orders/purchase/invoice' + const PATH3 = '/orders/purchase/wallet' + const PATH4 = '/orders/unsubscribe' + const PATH5 = '/orders/update/renew' + const PATH6 = '/phone-numbers' + const GET = 'GET' + const POST = 'POST' return { users: { @@ -36,7 +36,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix1, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix1, GET, option).json().then(r => r.body) + fetch(prefix, prefix1, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix1}` } }, purchase: { @@ -44,33 +45,39 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods2['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix0}${PATH2}`, POST, option).json(), $post: (option: { body: Methods2['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix0}${PATH2}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH2}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH2}` }, wallet: { post: (option: { body: Methods3['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix0}${PATH3}`, POST, option).json(), $post: (option: { body: Methods3['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix0}${PATH3}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH3}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH3}` } }, unsubscribe: { post: (option: { body: Methods4['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix0}${PATH4}`, POST, option).json(), $post: (option: { body: Methods4['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix0}${PATH4}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH4}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH4}` }, update: { renew: { post: (option: { body: Methods5['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix0}${PATH5}`, POST, option).json(), $post: (option: { body: Methods5['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix0}${PATH5}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH5}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH5}` } }, get: (option?: { query?: Methods0['get']['query'], config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, GET, option).json(), $get: (option?: { query?: Methods0['get']['query'], config?: T }) => - fetch(prefix, `${prefix0}${PATH1}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH1}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${prefix0}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, phone_numbers: { _phone_number: (val2: string) => { @@ -83,19 +90,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods7['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix2}${PATH2}`, POST, option).json(), $post: (option: { body: Methods7['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix2}${PATH2}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix2}${PATH2}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH2}` }, wallet: { post: (option: { body: Methods8['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix2}${PATH3}`, POST, option).json(), $post: (option: { body: Methods8['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix2}${PATH3}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix2}${PATH3}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH3}` } }, get: (option?: { config?: T }) => fetch(prefix, `${prefix2}${PATH1}`, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, `${prefix2}${PATH1}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix2}${PATH1}`, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH1}` } } } diff --git a/samples/externals/users/$api.ts b/samples/externals/users/$api.ts index 18389f78..bf788247 100644 --- a/samples/externals/users/$api.ts +++ b/samples/externals/users/$api.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { AspidaClient } from 'aspida' +import { AspidaClient, dataToURLString } from 'aspida' import { Methods as Methods0 } from './_user_id@string/orders' import { Methods as Methods1 } from './_user_id@string/orders/_order_id@string' import { Methods as Methods2 } from './_user_id@string/orders/purchase/invoice' @@ -10,17 +10,17 @@ import { Methods as Methods6 } from './_user_id@string/phone-numbers/_phone_numb import { Methods as Methods7 } from './_user_id@string/phone-numbers/_phone_number@string/orders/purchase/invoice' import { Methods as Methods8 } from './_user_id@string/phone-numbers/_phone_number@string/orders/purchase/wallet' -const GET = 'GET' -const POST = 'POST' -const PATH0 = '/users' -const PATH1 = '/orders' -const PATH2 = '/orders/purchase/invoice' -const PATH3 = '/orders/purchase/wallet' -const PATH4 = '/orders/unsubscribe' -const PATH5 = '/orders/update/renew' -const PATH6 = '/phone-numbers' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.baikalplatform.com/product-management/v1' : baseURL).replace(/\/$/, '') + const PATH0 = '/users' + const PATH1 = '/orders' + const PATH2 = '/orders/purchase/invoice' + const PATH3 = '/orders/purchase/wallet' + const PATH4 = '/orders/unsubscribe' + const PATH5 = '/orders/update/renew' + const PATH6 = '/phone-numbers' + const GET = 'GET' + const POST = 'POST' return { _user_id: (val0: string) => { @@ -35,7 +35,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix1, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix1, GET, option).json().then(r => r.body) + fetch(prefix, prefix1, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix1}` } }, purchase: { @@ -43,33 +44,39 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods2['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix0}${PATH2}`, POST, option).json(), $post: (option: { body: Methods2['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix0}${PATH2}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH2}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH2}` }, wallet: { post: (option: { body: Methods3['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix0}${PATH3}`, POST, option).json(), $post: (option: { body: Methods3['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix0}${PATH3}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH3}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH3}` } }, unsubscribe: { post: (option: { body: Methods4['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix0}${PATH4}`, POST, option).json(), $post: (option: { body: Methods4['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix0}${PATH4}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH4}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH4}` }, update: { renew: { post: (option: { body: Methods5['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix0}${PATH5}`, POST, option).json(), $post: (option: { body: Methods5['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix0}${PATH5}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH5}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH5}` } }, get: (option?: { query?: Methods0['get']['query'], config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, GET, option).json(), $get: (option?: { query?: Methods0['get']['query'], config?: T }) => - fetch(prefix, `${prefix0}${PATH1}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH1}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${prefix0}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, phone_numbers: { _phone_number: (val2: string) => { @@ -82,19 +89,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods7['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix2}${PATH2}`, POST, option).json(), $post: (option: { body: Methods7['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix2}${PATH2}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix2}${PATH2}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH2}` }, wallet: { post: (option: { body: Methods8['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix2}${PATH3}`, POST, option).json(), $post: (option: { body: Methods8['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix2}${PATH3}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix2}${PATH3}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH3}` } }, get: (option?: { config?: T }) => fetch(prefix, `${prefix2}${PATH1}`, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, `${prefix2}${PATH1}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix2}${PATH1}`, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH1}` } } } diff --git a/samples/freee/$api.ts b/samples/freee/$api.ts index be8f4157..c97634c1 100644 --- a/samples/freee/$api.ts +++ b/samples/freee/$api.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './api/1/account_items' import { Methods as Methods1 } from './api/1/account_items/_id@number' import { Methods as Methods2 } from './api/1/banks' @@ -59,51 +59,51 @@ import { Methods as Methods55 } from './api/1/wallet_txns/_id@number' import { Methods as Methods56 } from './api/1/walletables' import { Methods as Methods57 } from './api/1/walletables/_type/_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/account_items' -const PATH1 = '/api/1/banks' -const PATH2 = '/api/1/companies' -const PATH3 = '/api/1/deals' -const PATH4 = '/payments' -const PATH5 = '/renews' -const PATH6 = '/api/1/expense_application_line_templates' -const PATH7 = '/api/1/expense_applications' -const PATH8 = '/api/1/forms/selectables' -const PATH9 = '/api/1/invoices' -const PATH10 = '/api/1/items' -const PATH11 = '/api/1/journals' -const PATH12 = '/api/1/journals/reports' -const PATH13 = '/download' -const PATH14 = '/status' -const PATH15 = '/api/1/manual_journals' -const PATH16 = '/api/1/partners' -const PATH17 = '/api/1/partners/code' -const PATH18 = '/api/1/quotations' -const PATH19 = '/api/1/receipts' -const PATH20 = '/api/1/reports/trial_bs' -const PATH21 = '/api/1/reports/trial_bs_three_years' -const PATH22 = '/api/1/reports/trial_bs_two_years' -const PATH23 = '/api/1/reports/trial_pl' -const PATH24 = '/api/1/reports/trial_pl_sections' -const PATH25 = '/api/1/reports/trial_pl_three_years' -const PATH26 = '/api/1/reports/trial_pl_two_years' -const PATH27 = '/api/1/sections' -const PATH28 = '/api/1/segments' -const PATH29 = '/tags' -const PATH30 = '/api/1/tags' -const PATH31 = '/api/1/taxes/codes' -const PATH32 = '/api/1/taxes/companies' -const PATH33 = '/api/1/transfers' -const PATH34 = '/api/1/users' -const PATH35 = '/api/1/users/capabilities' -const PATH36 = '/api/1/users/me' -const PATH37 = '/api/1/wallet_txns' -const PATH38 = '/api/1/walletables' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/account_items' + const PATH1 = '/api/1/banks' + const PATH2 = '/api/1/companies' + const PATH3 = '/api/1/deals' + const PATH4 = '/payments' + const PATH5 = '/renews' + const PATH6 = '/api/1/expense_application_line_templates' + const PATH7 = '/api/1/expense_applications' + const PATH8 = '/api/1/forms/selectables' + const PATH9 = '/api/1/invoices' + const PATH10 = '/api/1/items' + const PATH11 = '/api/1/journals' + const PATH12 = '/api/1/journals/reports' + const PATH13 = '/download' + const PATH14 = '/status' + const PATH15 = '/api/1/manual_journals' + const PATH16 = '/api/1/partners' + const PATH17 = '/api/1/partners/code' + const PATH18 = '/api/1/quotations' + const PATH19 = '/api/1/receipts' + const PATH20 = '/api/1/reports/trial_bs' + const PATH21 = '/api/1/reports/trial_bs_three_years' + const PATH22 = '/api/1/reports/trial_bs_two_years' + const PATH23 = '/api/1/reports/trial_pl' + const PATH24 = '/api/1/reports/trial_pl_sections' + const PATH25 = '/api/1/reports/trial_pl_three_years' + const PATH26 = '/api/1/reports/trial_pl_two_years' + const PATH27 = '/api/1/sections' + const PATH28 = '/api/1/segments' + const PATH29 = '/tags' + const PATH30 = '/api/1/tags' + const PATH31 = '/api/1/taxes/codes' + const PATH32 = '/api/1/taxes/companies' + const PATH33 = '/api/1/transfers' + const PATH34 = '/api/1/users' + const PATH35 = '/api/1/users/capabilities' + const PATH36 = '/api/1/users/me' + const PATH37 = '/api/1/wallet_txns' + const PATH38 = '/api/1/walletables' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { api: { @@ -124,7 +124,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -134,7 +136,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, banks: { _id: (val1: number) => { @@ -144,13 +148,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix1, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix1, GET, option).json().then(r => r.body) + fetch(prefix, prefix1, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix1}` } }, get: (option?: { query?: Methods2['get']['query'], config?: T }) => fetch(prefix, PATH1, GET, option).json(), $get: (option?: { query?: Methods2['get']['query'], config?: T }) => - fetch(prefix, PATH1, GET, option).json().then(r => r.body) + fetch(prefix, PATH1, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods2['get']['query'] }) => + `${prefix}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, companies: { _id: (val2: number) => { @@ -164,13 +171,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { body?: Methods5['put']['reqBody'], config?: T }) => fetch(prefix, prefix2, PUT, option, 'URLSearchParams').json(), $put: (option?: { body?: Methods5['put']['reqBody'], config?: T }) => - fetch(prefix, prefix2, PUT, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, prefix2, PUT, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods5['get']['query'] }) => + `${prefix}${prefix2}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option?: { config?: T }) => fetch(prefix, PATH2, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH2, GET, option).json().then(r => r.body) + fetch(prefix, PATH2, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH2}` }, deals: { _id: (val3: number) => { @@ -189,13 +199,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods9['delete']['query'], config?: T }) => fetch(prefix, prefix4, DELETE, option).send(), $delete: (option: { query: Methods9['delete']['query'], config?: T }) => - fetch(prefix, prefix4, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix4, DELETE, option).send().then(r => r.body), + $path: (option?: { method: 'delete'; query: Methods9['delete']['query'] }) => + `${prefix}${prefix4}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, post: (option: { body: Methods8['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix3}${PATH4}`, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods8['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix3}${PATH4}`, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, `${prefix3}${PATH4}`, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: () => `${prefix}${prefix3}${PATH4}` }, renews: { _renew_id: (val5: number) => { @@ -209,13 +222,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods11['delete']['query'], config?: T }) => fetch(prefix, prefix5, DELETE, option).json(), $delete: (option: { query: Methods11['delete']['query'], config?: T }) => - fetch(prefix, prefix5, DELETE, option).json().then(r => r.body) + fetch(prefix, prefix5, DELETE, option).json().then(r => r.body), + $path: (option?: { method: 'delete'; query: Methods11['delete']['query'] }) => + `${prefix}${prefix5}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, post: (option: { body: Methods10['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix3}${PATH5}`, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods10['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix3}${PATH5}`, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, `${prefix3}${PATH5}`, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: () => `${prefix}${prefix3}${PATH5}` }, get: (option: { query: Methods7['get']['query'], config?: T }) => fetch(prefix, prefix3, GET, option).json(), @@ -228,7 +244,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods7['delete']['query'], config?: T }) => fetch(prefix, prefix3, DELETE, option).send(), $delete: (option: { query: Methods7['delete']['query'], config?: T }) => - fetch(prefix, prefix3, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix3, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods7['get']['query'] } | { method: 'delete'; query: Methods7['delete']['query'] }) => + `${prefix}${prefix3}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods6['get']['query'], config?: T }) => @@ -238,7 +256,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods6['post']['reqBody'], config?: T }) => fetch(prefix, PATH3, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods6['post']['reqBody'], config?: T }) => - fetch(prefix, PATH3, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH3, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods6['get']['query'] }) => + `${prefix}${PATH3}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, expense_application_line_templates: { _id: (val6: number) => { @@ -256,7 +276,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods13['delete']['query'], config?: T }) => fetch(prefix, prefix6, DELETE, option).send(), $delete: (option: { query: Methods13['delete']['query'], config?: T }) => - fetch(prefix, prefix6, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix6, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods13['get']['query'] } | { method: 'delete'; query: Methods13['delete']['query'] }) => + `${prefix}${prefix6}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods12['get']['query'], config?: T }) => @@ -266,7 +288,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods12['post']['reqBody'], config?: T }) => fetch(prefix, PATH6, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods12['post']['reqBody'], config?: T }) => - fetch(prefix, PATH6, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH6, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods12['get']['query'] }) => + `${prefix}${PATH6}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, expense_applications: { _id: (val7: number) => { @@ -284,7 +308,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods15['delete']['query'], config?: T }) => fetch(prefix, prefix7, DELETE, option).send(), $delete: (option: { query: Methods15['delete']['query'], config?: T }) => - fetch(prefix, prefix7, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix7, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods15['get']['query'] } | { method: 'delete'; query: Methods15['delete']['query'] }) => + `${prefix}${prefix7}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods14['get']['query'], config?: T }) => @@ -294,14 +320,18 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods14['post']['reqBody'], config?: T }) => fetch(prefix, PATH7, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods14['post']['reqBody'], config?: T }) => - fetch(prefix, PATH7, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH7, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods14['get']['query'] }) => + `${prefix}${PATH7}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, forms: { selectables: { get: (option: { query: Methods16['get']['query'], config?: T }) => fetch(prefix, PATH8, GET, option).json(), $get: (option: { query: Methods16['get']['query'], config?: T }) => - fetch(prefix, PATH8, GET, option).json().then(r => r.body) + fetch(prefix, PATH8, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods16['get']['query'] }) => + `${prefix}${PATH8}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, invoices: { @@ -320,7 +350,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods18['delete']['query'], config?: T }) => fetch(prefix, prefix8, DELETE, option).send(), $delete: (option: { query: Methods18['delete']['query'], config?: T }) => - fetch(prefix, prefix8, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix8, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods18['get']['query'] } | { method: 'delete'; query: Methods18['delete']['query'] }) => + `${prefix}${prefix8}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods17['get']['query'], config?: T }) => @@ -330,7 +362,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods17['post']['reqBody'], config?: T }) => fetch(prefix, PATH9, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods17['post']['reqBody'], config?: T }) => - fetch(prefix, PATH9, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH9, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods17['get']['query'] }) => + `${prefix}${PATH9}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, items: { _id: (val9: number) => { @@ -348,7 +382,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods20['delete']['query'], config?: T }) => fetch(prefix, prefix9, DELETE, option).send(), $delete: (option: { query: Methods20['delete']['query'], config?: T }) => - fetch(prefix, prefix9, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix9, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods20['get']['query'] } | { method: 'delete'; query: Methods20['delete']['query'] }) => + `${prefix}${prefix9}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods19['get']['query'], config?: T }) => @@ -358,7 +394,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods19['post']['reqBody'], config?: T }) => fetch(prefix, PATH10, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods19['post']['reqBody'], config?: T }) => - fetch(prefix, PATH10, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH10, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods19['get']['query'] }) => + `${prefix}${PATH10}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, journals: { reports: { @@ -370,13 +408,17 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option: { query: Methods22['get']['query'], config?: T }) => fetch(prefix, `${prefix10}${PATH13}`, GET, option).send(), $get: (option: { query: Methods22['get']['query'], config?: T }) => - fetch(prefix, `${prefix10}${PATH13}`, GET, option).send().then(r => r.body) + fetch(prefix, `${prefix10}${PATH13}`, GET, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods22['get']['query'] }) => + `${prefix}${prefix10}${PATH13}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, status: { get: (option: { query: Methods23['get']['query'], config?: T }) => fetch(prefix, `${prefix10}${PATH14}`, GET, option).json(), $get: (option: { query: Methods23['get']['query'], config?: T }) => - fetch(prefix, `${prefix10}${PATH14}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix10}${PATH14}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods23['get']['query'] }) => + `${prefix}${prefix10}${PATH14}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } @@ -384,7 +426,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option: { query: Methods21['get']['query'], config?: T }) => fetch(prefix, PATH11, GET, option).json(), $get: (option: { query: Methods21['get']['query'], config?: T }) => - fetch(prefix, PATH11, GET, option).json().then(r => r.body) + fetch(prefix, PATH11, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods21['get']['query'] }) => + `${prefix}${PATH11}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, manual_journals: { _id: (val11: number) => { @@ -402,7 +446,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods25['delete']['query'], config?: T }) => fetch(prefix, prefix11, DELETE, option).send(), $delete: (option: { query: Methods25['delete']['query'], config?: T }) => - fetch(prefix, prefix11, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix11, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods25['get']['query'] } | { method: 'delete'; query: Methods25['delete']['query'] }) => + `${prefix}${prefix11}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods24['get']['query'], config?: T }) => @@ -412,7 +458,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods24['post']['reqBody'], config?: T }) => fetch(prefix, PATH15, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods24['post']['reqBody'], config?: T }) => - fetch(prefix, PATH15, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH15, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods24['get']['query'] }) => + `${prefix}${PATH15}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, partners: { _id: (val12: number) => { @@ -430,7 +478,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods27['delete']['query'], config?: T }) => fetch(prefix, prefix12, DELETE, option).send(), $delete: (option: { query: Methods27['delete']['query'], config?: T }) => - fetch(prefix, prefix12, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix12, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods27['get']['query'] } | { method: 'delete'; query: Methods27['delete']['query'] }) => + `${prefix}${prefix12}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, code: { @@ -441,7 +491,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option: { body: Methods28['put']['reqBody'], config?: T }) => fetch(prefix, prefix13, PUT, option, 'URLSearchParams').json(), $put: (option: { body: Methods28['put']['reqBody'], config?: T }) => - fetch(prefix, prefix13, PUT, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, prefix13, PUT, option, 'URLSearchParams').json().then(r => r.body), + $path: () => `${prefix}${prefix13}` } } }, @@ -452,7 +503,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods26['post']['reqBody'], config?: T }) => fetch(prefix, PATH16, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods26['post']['reqBody'], config?: T }) => - fetch(prefix, PATH16, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH16, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods26['get']['query'] }) => + `${prefix}${PATH16}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, quotations: { _id: (val14: number) => { @@ -470,7 +523,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods30['delete']['query'], config?: T }) => fetch(prefix, prefix14, DELETE, option).send(), $delete: (option: { query: Methods30['delete']['query'], config?: T }) => - fetch(prefix, prefix14, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix14, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods30['get']['query'] } | { method: 'delete'; query: Methods30['delete']['query'] }) => + `${prefix}${prefix14}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods29['get']['query'], config?: T }) => @@ -480,7 +535,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods29['post']['reqBody'], config?: T }) => fetch(prefix, PATH18, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods29['post']['reqBody'], config?: T }) => - fetch(prefix, PATH18, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH18, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods29['get']['query'] }) => + `${prefix}${PATH18}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, receipts: { _id: (val15: number) => { @@ -498,7 +555,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods32['delete']['query'], config?: T }) => fetch(prefix, prefix15, DELETE, option).send(), $delete: (option: { query: Methods32['delete']['query'], config?: T }) => - fetch(prefix, prefix15, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix15, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods32['get']['query'] } | { method: 'delete'; query: Methods32['delete']['query'] }) => + `${prefix}${prefix15}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods31['get']['query'], config?: T }) => @@ -508,50 +567,66 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods31['post']['reqBody'], config?: T }) => fetch(prefix, PATH19, POST, option, 'FormData').json(), $post: (option: { body: Methods31['post']['reqBody'], config?: T }) => - fetch(prefix, PATH19, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH19, POST, option, 'FormData').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods31['get']['query'] }) => + `${prefix}${PATH19}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, reports: { trial_bs: { get: (option: { query: Methods33['get']['query'], config?: T }) => fetch(prefix, PATH20, GET, option).json(), $get: (option: { query: Methods33['get']['query'], config?: T }) => - fetch(prefix, PATH20, GET, option).json().then(r => r.body) + fetch(prefix, PATH20, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods33['get']['query'] }) => + `${prefix}${PATH20}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_bs_three_years: { get: (option: { query: Methods34['get']['query'], config?: T }) => fetch(prefix, PATH21, GET, option).json(), $get: (option: { query: Methods34['get']['query'], config?: T }) => - fetch(prefix, PATH21, GET, option).json().then(r => r.body) + fetch(prefix, PATH21, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods34['get']['query'] }) => + `${prefix}${PATH21}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_bs_two_years: { get: (option: { query: Methods35['get']['query'], config?: T }) => fetch(prefix, PATH22, GET, option).json(), $get: (option: { query: Methods35['get']['query'], config?: T }) => - fetch(prefix, PATH22, GET, option).json().then(r => r.body) + fetch(prefix, PATH22, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods35['get']['query'] }) => + `${prefix}${PATH22}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl: { get: (option: { query: Methods36['get']['query'], config?: T }) => fetch(prefix, PATH23, GET, option).json(), $get: (option: { query: Methods36['get']['query'], config?: T }) => - fetch(prefix, PATH23, GET, option).json().then(r => r.body) + fetch(prefix, PATH23, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods36['get']['query'] }) => + `${prefix}${PATH23}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl_sections: { get: (option: { query: Methods37['get']['query'], config?: T }) => fetch(prefix, PATH24, GET, option).json(), $get: (option: { query: Methods37['get']['query'], config?: T }) => - fetch(prefix, PATH24, GET, option).json().then(r => r.body) + fetch(prefix, PATH24, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods37['get']['query'] }) => + `${prefix}${PATH24}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl_three_years: { get: (option: { query: Methods38['get']['query'], config?: T }) => fetch(prefix, PATH25, GET, option).json(), $get: (option: { query: Methods38['get']['query'], config?: T }) => - fetch(prefix, PATH25, GET, option).json().then(r => r.body) + fetch(prefix, PATH25, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods38['get']['query'] }) => + `${prefix}${PATH25}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl_two_years: { get: (option: { query: Methods39['get']['query'], config?: T }) => fetch(prefix, PATH26, GET, option).json(), $get: (option: { query: Methods39['get']['query'], config?: T }) => - fetch(prefix, PATH26, GET, option).json().then(r => r.body) + fetch(prefix, PATH26, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods39['get']['query'] }) => + `${prefix}${PATH26}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, sections: { @@ -570,7 +645,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods41['delete']['query'], config?: T }) => fetch(prefix, prefix16, DELETE, option).send(), $delete: (option: { query: Methods41['delete']['query'], config?: T }) => - fetch(prefix, prefix16, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix16, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods41['get']['query'] } | { method: 'delete'; query: Methods41['delete']['query'] }) => + `${prefix}${prefix16}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods40['get']['query'], config?: T }) => @@ -580,7 +657,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods40['post']['reqBody'], config?: T }) => fetch(prefix, PATH27, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods40['post']['reqBody'], config?: T }) => - fetch(prefix, PATH27, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH27, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods40['get']['query'] }) => + `${prefix}${PATH27}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, segments: { _segment_id: (val17: number) => { @@ -599,7 +678,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods43['delete']['query'], config?: T }) => fetch(prefix, prefix18, DELETE, option).send(), $delete: (option: { query: Methods43['delete']['query'], config?: T }) => - fetch(prefix, prefix18, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix18, DELETE, option).send().then(r => r.body), + $path: (option?: { method: 'delete'; query: Methods43['delete']['query'] }) => + `${prefix}${prefix18}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods42['get']['query'], config?: T }) => @@ -609,7 +690,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods42['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix17}${PATH29}`, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods42['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix17}${PATH29}`, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, `${prefix17}${PATH29}`, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods42['get']['query'] }) => + `${prefix}${prefix17}${PATH29}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } @@ -630,7 +713,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods45['delete']['query'], config?: T }) => fetch(prefix, prefix19, DELETE, option).send(), $delete: (option: { query: Methods45['delete']['query'], config?: T }) => - fetch(prefix, prefix19, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix19, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods45['get']['query'] } | { method: 'delete'; query: Methods45['delete']['query'] }) => + `${prefix}${prefix19}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods44['get']['query'], config?: T }) => @@ -640,7 +725,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods44['post']['reqBody'], config?: T }) => fetch(prefix, PATH30, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods44['post']['reqBody'], config?: T }) => - fetch(prefix, PATH30, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH30, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods44['get']['query'] }) => + `${prefix}${PATH30}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, taxes: { codes: { @@ -651,13 +738,15 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix20, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix20, GET, option).json().then(r => r.body) + fetch(prefix, prefix20, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix20}` } }, get: (option?: { config?: T }) => fetch(prefix, PATH31, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH31, GET, option).json().then(r => r.body) + fetch(prefix, PATH31, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH31}` }, companies: { _company_id: (val21: number) => { @@ -667,7 +756,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix21, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix21, GET, option).json().then(r => r.body) + fetch(prefix, prefix21, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix21}` } } } @@ -688,7 +778,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods50['delete']['query'], config?: T }) => fetch(prefix, prefix22, DELETE, option).send(), $delete: (option: { query: Methods50['delete']['query'], config?: T }) => - fetch(prefix, prefix22, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix22, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods50['get']['query'] } | { method: 'delete'; query: Methods50['delete']['query'] }) => + `${prefix}${prefix22}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods49['get']['query'], config?: T }) => @@ -698,14 +790,18 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods49['post']['reqBody'], config?: T }) => fetch(prefix, PATH33, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods49['post']['reqBody'], config?: T }) => - fetch(prefix, PATH33, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH33, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods49['get']['query'] }) => + `${prefix}${PATH33}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, users: { capabilities: { get: (option: { query: Methods52['get']['query'], config?: T }) => fetch(prefix, PATH35, GET, option).json(), $get: (option: { query: Methods52['get']['query'], config?: T }) => - fetch(prefix, PATH35, GET, option).json().then(r => r.body) + fetch(prefix, PATH35, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods52['get']['query'] }) => + `${prefix}${PATH35}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, me: { get: (option?: { query?: Methods53['get']['query'], config?: T }) => @@ -715,12 +811,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { body?: Methods53['put']['reqBody'], config?: T }) => fetch(prefix, PATH36, PUT, option, 'URLSearchParams').json(), $put: (option?: { body?: Methods53['put']['reqBody'], config?: T }) => - fetch(prefix, PATH36, PUT, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH36, PUT, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods53['get']['query'] }) => + `${prefix}${PATH36}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, get: (option: { query: Methods51['get']['query'], config?: T }) => fetch(prefix, PATH34, GET, option).json(), $get: (option: { query: Methods51['get']['query'], config?: T }) => - fetch(prefix, PATH34, GET, option).json().then(r => r.body) + fetch(prefix, PATH34, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods51['get']['query'] }) => + `${prefix}${PATH34}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, wallet_txns: { _id: (val23: number) => { @@ -734,7 +834,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods55['delete']['query'], config?: T }) => fetch(prefix, prefix23, DELETE, option).send(), $delete: (option: { query: Methods55['delete']['query'], config?: T }) => - fetch(prefix, prefix23, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix23, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods55['get']['query'] } | { method: 'delete'; query: Methods55['delete']['query'] }) => + `${prefix}${prefix23}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods54['get']['query'], config?: T }) => @@ -744,7 +846,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods54['post']['reqBody'], config?: T }) => fetch(prefix, PATH37, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods54['post']['reqBody'], config?: T }) => - fetch(prefix, PATH37, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH37, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods54['get']['query'] }) => + `${prefix}${PATH37}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, walletables: { _type: (val24: number | string) => { @@ -766,7 +870,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods57['delete']['query'], config?: T }) => fetch(prefix, prefix25, DELETE, option).send(), $delete: (option: { query: Methods57['delete']['query'], config?: T }) => - fetch(prefix, prefix25, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix25, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods57['get']['query'] } | { method: 'put'; query: Methods57['put']['query'] } | { method: 'delete'; query: Methods57['delete']['query'] }) => + `${prefix}${prefix25}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } @@ -778,7 +884,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods56['post']['reqBody'], config?: T }) => fetch(prefix, PATH38, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods56['post']['reqBody'], config?: T }) => - fetch(prefix, PATH38, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH38, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods56['get']['query'] }) => + `${prefix}${PATH38}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } diff --git a/samples/freee/api/$api.ts b/samples/freee/api/$api.ts index 7743413f..70da0417 100644 --- a/samples/freee/api/$api.ts +++ b/samples/freee/api/$api.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './1/account_items' import { Methods as Methods1 } from './1/account_items/_id@number' import { Methods as Methods2 } from './1/banks' @@ -59,51 +59,51 @@ import { Methods as Methods55 } from './1/wallet_txns/_id@number' import { Methods as Methods56 } from './1/walletables' import { Methods as Methods57 } from './1/walletables/_type/_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/account_items' -const PATH1 = '/api/1/banks' -const PATH2 = '/api/1/companies' -const PATH3 = '/api/1/deals' -const PATH4 = '/payments' -const PATH5 = '/renews' -const PATH6 = '/api/1/expense_application_line_templates' -const PATH7 = '/api/1/expense_applications' -const PATH8 = '/api/1/forms/selectables' -const PATH9 = '/api/1/invoices' -const PATH10 = '/api/1/items' -const PATH11 = '/api/1/journals' -const PATH12 = '/api/1/journals/reports' -const PATH13 = '/download' -const PATH14 = '/status' -const PATH15 = '/api/1/manual_journals' -const PATH16 = '/api/1/partners' -const PATH17 = '/api/1/partners/code' -const PATH18 = '/api/1/quotations' -const PATH19 = '/api/1/receipts' -const PATH20 = '/api/1/reports/trial_bs' -const PATH21 = '/api/1/reports/trial_bs_three_years' -const PATH22 = '/api/1/reports/trial_bs_two_years' -const PATH23 = '/api/1/reports/trial_pl' -const PATH24 = '/api/1/reports/trial_pl_sections' -const PATH25 = '/api/1/reports/trial_pl_three_years' -const PATH26 = '/api/1/reports/trial_pl_two_years' -const PATH27 = '/api/1/sections' -const PATH28 = '/api/1/segments' -const PATH29 = '/tags' -const PATH30 = '/api/1/tags' -const PATH31 = '/api/1/taxes/codes' -const PATH32 = '/api/1/taxes/companies' -const PATH33 = '/api/1/transfers' -const PATH34 = '/api/1/users' -const PATH35 = '/api/1/users/capabilities' -const PATH36 = '/api/1/users/me' -const PATH37 = '/api/1/wallet_txns' -const PATH38 = '/api/1/walletables' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/account_items' + const PATH1 = '/api/1/banks' + const PATH2 = '/api/1/companies' + const PATH3 = '/api/1/deals' + const PATH4 = '/payments' + const PATH5 = '/renews' + const PATH6 = '/api/1/expense_application_line_templates' + const PATH7 = '/api/1/expense_applications' + const PATH8 = '/api/1/forms/selectables' + const PATH9 = '/api/1/invoices' + const PATH10 = '/api/1/items' + const PATH11 = '/api/1/journals' + const PATH12 = '/api/1/journals/reports' + const PATH13 = '/download' + const PATH14 = '/status' + const PATH15 = '/api/1/manual_journals' + const PATH16 = '/api/1/partners' + const PATH17 = '/api/1/partners/code' + const PATH18 = '/api/1/quotations' + const PATH19 = '/api/1/receipts' + const PATH20 = '/api/1/reports/trial_bs' + const PATH21 = '/api/1/reports/trial_bs_three_years' + const PATH22 = '/api/1/reports/trial_bs_two_years' + const PATH23 = '/api/1/reports/trial_pl' + const PATH24 = '/api/1/reports/trial_pl_sections' + const PATH25 = '/api/1/reports/trial_pl_three_years' + const PATH26 = '/api/1/reports/trial_pl_two_years' + const PATH27 = '/api/1/sections' + const PATH28 = '/api/1/segments' + const PATH29 = '/tags' + const PATH30 = '/api/1/tags' + const PATH31 = '/api/1/taxes/codes' + const PATH32 = '/api/1/taxes/companies' + const PATH33 = '/api/1/transfers' + const PATH34 = '/api/1/users' + const PATH35 = '/api/1/users/capabilities' + const PATH36 = '/api/1/users/me' + const PATH37 = '/api/1/wallet_txns' + const PATH38 = '/api/1/walletables' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { $1: { @@ -123,7 +123,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -133,7 +135,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, banks: { _id: (val1: number) => { @@ -143,13 +147,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix1, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix1, GET, option).json().then(r => r.body) + fetch(prefix, prefix1, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix1}` } }, get: (option?: { query?: Methods2['get']['query'], config?: T }) => fetch(prefix, PATH1, GET, option).json(), $get: (option?: { query?: Methods2['get']['query'], config?: T }) => - fetch(prefix, PATH1, GET, option).json().then(r => r.body) + fetch(prefix, PATH1, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods2['get']['query'] }) => + `${prefix}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, companies: { _id: (val2: number) => { @@ -163,13 +170,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { body?: Methods5['put']['reqBody'], config?: T }) => fetch(prefix, prefix2, PUT, option, 'URLSearchParams').json(), $put: (option?: { body?: Methods5['put']['reqBody'], config?: T }) => - fetch(prefix, prefix2, PUT, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, prefix2, PUT, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods5['get']['query'] }) => + `${prefix}${prefix2}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option?: { config?: T }) => fetch(prefix, PATH2, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH2, GET, option).json().then(r => r.body) + fetch(prefix, PATH2, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH2}` }, deals: { _id: (val3: number) => { @@ -188,13 +198,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods9['delete']['query'], config?: T }) => fetch(prefix, prefix4, DELETE, option).send(), $delete: (option: { query: Methods9['delete']['query'], config?: T }) => - fetch(prefix, prefix4, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix4, DELETE, option).send().then(r => r.body), + $path: (option?: { method: 'delete'; query: Methods9['delete']['query'] }) => + `${prefix}${prefix4}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, post: (option: { body: Methods8['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix3}${PATH4}`, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods8['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix3}${PATH4}`, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, `${prefix3}${PATH4}`, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: () => `${prefix}${prefix3}${PATH4}` }, renews: { _renew_id: (val5: number) => { @@ -208,13 +221,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods11['delete']['query'], config?: T }) => fetch(prefix, prefix5, DELETE, option).json(), $delete: (option: { query: Methods11['delete']['query'], config?: T }) => - fetch(prefix, prefix5, DELETE, option).json().then(r => r.body) + fetch(prefix, prefix5, DELETE, option).json().then(r => r.body), + $path: (option?: { method: 'delete'; query: Methods11['delete']['query'] }) => + `${prefix}${prefix5}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, post: (option: { body: Methods10['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix3}${PATH5}`, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods10['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix3}${PATH5}`, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, `${prefix3}${PATH5}`, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: () => `${prefix}${prefix3}${PATH5}` }, get: (option: { query: Methods7['get']['query'], config?: T }) => fetch(prefix, prefix3, GET, option).json(), @@ -227,7 +243,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods7['delete']['query'], config?: T }) => fetch(prefix, prefix3, DELETE, option).send(), $delete: (option: { query: Methods7['delete']['query'], config?: T }) => - fetch(prefix, prefix3, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix3, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods7['get']['query'] } | { method: 'delete'; query: Methods7['delete']['query'] }) => + `${prefix}${prefix3}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods6['get']['query'], config?: T }) => @@ -237,7 +255,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods6['post']['reqBody'], config?: T }) => fetch(prefix, PATH3, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods6['post']['reqBody'], config?: T }) => - fetch(prefix, PATH3, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH3, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods6['get']['query'] }) => + `${prefix}${PATH3}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, expense_application_line_templates: { _id: (val6: number) => { @@ -255,7 +275,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods13['delete']['query'], config?: T }) => fetch(prefix, prefix6, DELETE, option).send(), $delete: (option: { query: Methods13['delete']['query'], config?: T }) => - fetch(prefix, prefix6, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix6, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods13['get']['query'] } | { method: 'delete'; query: Methods13['delete']['query'] }) => + `${prefix}${prefix6}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods12['get']['query'], config?: T }) => @@ -265,7 +287,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods12['post']['reqBody'], config?: T }) => fetch(prefix, PATH6, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods12['post']['reqBody'], config?: T }) => - fetch(prefix, PATH6, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH6, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods12['get']['query'] }) => + `${prefix}${PATH6}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, expense_applications: { _id: (val7: number) => { @@ -283,7 +307,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods15['delete']['query'], config?: T }) => fetch(prefix, prefix7, DELETE, option).send(), $delete: (option: { query: Methods15['delete']['query'], config?: T }) => - fetch(prefix, prefix7, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix7, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods15['get']['query'] } | { method: 'delete'; query: Methods15['delete']['query'] }) => + `${prefix}${prefix7}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods14['get']['query'], config?: T }) => @@ -293,14 +319,18 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods14['post']['reqBody'], config?: T }) => fetch(prefix, PATH7, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods14['post']['reqBody'], config?: T }) => - fetch(prefix, PATH7, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH7, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods14['get']['query'] }) => + `${prefix}${PATH7}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, forms: { selectables: { get: (option: { query: Methods16['get']['query'], config?: T }) => fetch(prefix, PATH8, GET, option).json(), $get: (option: { query: Methods16['get']['query'], config?: T }) => - fetch(prefix, PATH8, GET, option).json().then(r => r.body) + fetch(prefix, PATH8, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods16['get']['query'] }) => + `${prefix}${PATH8}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, invoices: { @@ -319,7 +349,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods18['delete']['query'], config?: T }) => fetch(prefix, prefix8, DELETE, option).send(), $delete: (option: { query: Methods18['delete']['query'], config?: T }) => - fetch(prefix, prefix8, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix8, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods18['get']['query'] } | { method: 'delete'; query: Methods18['delete']['query'] }) => + `${prefix}${prefix8}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods17['get']['query'], config?: T }) => @@ -329,7 +361,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods17['post']['reqBody'], config?: T }) => fetch(prefix, PATH9, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods17['post']['reqBody'], config?: T }) => - fetch(prefix, PATH9, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH9, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods17['get']['query'] }) => + `${prefix}${PATH9}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, items: { _id: (val9: number) => { @@ -347,7 +381,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods20['delete']['query'], config?: T }) => fetch(prefix, prefix9, DELETE, option).send(), $delete: (option: { query: Methods20['delete']['query'], config?: T }) => - fetch(prefix, prefix9, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix9, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods20['get']['query'] } | { method: 'delete'; query: Methods20['delete']['query'] }) => + `${prefix}${prefix9}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods19['get']['query'], config?: T }) => @@ -357,7 +393,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods19['post']['reqBody'], config?: T }) => fetch(prefix, PATH10, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods19['post']['reqBody'], config?: T }) => - fetch(prefix, PATH10, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH10, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods19['get']['query'] }) => + `${prefix}${PATH10}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, journals: { reports: { @@ -369,13 +407,17 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option: { query: Methods22['get']['query'], config?: T }) => fetch(prefix, `${prefix10}${PATH13}`, GET, option).send(), $get: (option: { query: Methods22['get']['query'], config?: T }) => - fetch(prefix, `${prefix10}${PATH13}`, GET, option).send().then(r => r.body) + fetch(prefix, `${prefix10}${PATH13}`, GET, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods22['get']['query'] }) => + `${prefix}${prefix10}${PATH13}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, status: { get: (option: { query: Methods23['get']['query'], config?: T }) => fetch(prefix, `${prefix10}${PATH14}`, GET, option).json(), $get: (option: { query: Methods23['get']['query'], config?: T }) => - fetch(prefix, `${prefix10}${PATH14}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix10}${PATH14}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods23['get']['query'] }) => + `${prefix}${prefix10}${PATH14}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } @@ -383,7 +425,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option: { query: Methods21['get']['query'], config?: T }) => fetch(prefix, PATH11, GET, option).json(), $get: (option: { query: Methods21['get']['query'], config?: T }) => - fetch(prefix, PATH11, GET, option).json().then(r => r.body) + fetch(prefix, PATH11, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods21['get']['query'] }) => + `${prefix}${PATH11}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, manual_journals: { _id: (val11: number) => { @@ -401,7 +445,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods25['delete']['query'], config?: T }) => fetch(prefix, prefix11, DELETE, option).send(), $delete: (option: { query: Methods25['delete']['query'], config?: T }) => - fetch(prefix, prefix11, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix11, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods25['get']['query'] } | { method: 'delete'; query: Methods25['delete']['query'] }) => + `${prefix}${prefix11}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods24['get']['query'], config?: T }) => @@ -411,7 +457,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods24['post']['reqBody'], config?: T }) => fetch(prefix, PATH15, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods24['post']['reqBody'], config?: T }) => - fetch(prefix, PATH15, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH15, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods24['get']['query'] }) => + `${prefix}${PATH15}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, partners: { _id: (val12: number) => { @@ -429,7 +477,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods27['delete']['query'], config?: T }) => fetch(prefix, prefix12, DELETE, option).send(), $delete: (option: { query: Methods27['delete']['query'], config?: T }) => - fetch(prefix, prefix12, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix12, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods27['get']['query'] } | { method: 'delete'; query: Methods27['delete']['query'] }) => + `${prefix}${prefix12}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, code: { @@ -440,7 +490,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option: { body: Methods28['put']['reqBody'], config?: T }) => fetch(prefix, prefix13, PUT, option, 'URLSearchParams').json(), $put: (option: { body: Methods28['put']['reqBody'], config?: T }) => - fetch(prefix, prefix13, PUT, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, prefix13, PUT, option, 'URLSearchParams').json().then(r => r.body), + $path: () => `${prefix}${prefix13}` } } }, @@ -451,7 +502,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods26['post']['reqBody'], config?: T }) => fetch(prefix, PATH16, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods26['post']['reqBody'], config?: T }) => - fetch(prefix, PATH16, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH16, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods26['get']['query'] }) => + `${prefix}${PATH16}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, quotations: { _id: (val14: number) => { @@ -469,7 +522,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods30['delete']['query'], config?: T }) => fetch(prefix, prefix14, DELETE, option).send(), $delete: (option: { query: Methods30['delete']['query'], config?: T }) => - fetch(prefix, prefix14, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix14, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods30['get']['query'] } | { method: 'delete'; query: Methods30['delete']['query'] }) => + `${prefix}${prefix14}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods29['get']['query'], config?: T }) => @@ -479,7 +534,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods29['post']['reqBody'], config?: T }) => fetch(prefix, PATH18, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods29['post']['reqBody'], config?: T }) => - fetch(prefix, PATH18, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH18, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods29['get']['query'] }) => + `${prefix}${PATH18}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, receipts: { _id: (val15: number) => { @@ -497,7 +554,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods32['delete']['query'], config?: T }) => fetch(prefix, prefix15, DELETE, option).send(), $delete: (option: { query: Methods32['delete']['query'], config?: T }) => - fetch(prefix, prefix15, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix15, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods32['get']['query'] } | { method: 'delete'; query: Methods32['delete']['query'] }) => + `${prefix}${prefix15}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods31['get']['query'], config?: T }) => @@ -507,50 +566,66 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods31['post']['reqBody'], config?: T }) => fetch(prefix, PATH19, POST, option, 'FormData').json(), $post: (option: { body: Methods31['post']['reqBody'], config?: T }) => - fetch(prefix, PATH19, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH19, POST, option, 'FormData').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods31['get']['query'] }) => + `${prefix}${PATH19}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, reports: { trial_bs: { get: (option: { query: Methods33['get']['query'], config?: T }) => fetch(prefix, PATH20, GET, option).json(), $get: (option: { query: Methods33['get']['query'], config?: T }) => - fetch(prefix, PATH20, GET, option).json().then(r => r.body) + fetch(prefix, PATH20, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods33['get']['query'] }) => + `${prefix}${PATH20}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_bs_three_years: { get: (option: { query: Methods34['get']['query'], config?: T }) => fetch(prefix, PATH21, GET, option).json(), $get: (option: { query: Methods34['get']['query'], config?: T }) => - fetch(prefix, PATH21, GET, option).json().then(r => r.body) + fetch(prefix, PATH21, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods34['get']['query'] }) => + `${prefix}${PATH21}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_bs_two_years: { get: (option: { query: Methods35['get']['query'], config?: T }) => fetch(prefix, PATH22, GET, option).json(), $get: (option: { query: Methods35['get']['query'], config?: T }) => - fetch(prefix, PATH22, GET, option).json().then(r => r.body) + fetch(prefix, PATH22, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods35['get']['query'] }) => + `${prefix}${PATH22}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl: { get: (option: { query: Methods36['get']['query'], config?: T }) => fetch(prefix, PATH23, GET, option).json(), $get: (option: { query: Methods36['get']['query'], config?: T }) => - fetch(prefix, PATH23, GET, option).json().then(r => r.body) + fetch(prefix, PATH23, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods36['get']['query'] }) => + `${prefix}${PATH23}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl_sections: { get: (option: { query: Methods37['get']['query'], config?: T }) => fetch(prefix, PATH24, GET, option).json(), $get: (option: { query: Methods37['get']['query'], config?: T }) => - fetch(prefix, PATH24, GET, option).json().then(r => r.body) + fetch(prefix, PATH24, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods37['get']['query'] }) => + `${prefix}${PATH24}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl_three_years: { get: (option: { query: Methods38['get']['query'], config?: T }) => fetch(prefix, PATH25, GET, option).json(), $get: (option: { query: Methods38['get']['query'], config?: T }) => - fetch(prefix, PATH25, GET, option).json().then(r => r.body) + fetch(prefix, PATH25, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods38['get']['query'] }) => + `${prefix}${PATH25}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl_two_years: { get: (option: { query: Methods39['get']['query'], config?: T }) => fetch(prefix, PATH26, GET, option).json(), $get: (option: { query: Methods39['get']['query'], config?: T }) => - fetch(prefix, PATH26, GET, option).json().then(r => r.body) + fetch(prefix, PATH26, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods39['get']['query'] }) => + `${prefix}${PATH26}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, sections: { @@ -569,7 +644,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods41['delete']['query'], config?: T }) => fetch(prefix, prefix16, DELETE, option).send(), $delete: (option: { query: Methods41['delete']['query'], config?: T }) => - fetch(prefix, prefix16, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix16, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods41['get']['query'] } | { method: 'delete'; query: Methods41['delete']['query'] }) => + `${prefix}${prefix16}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods40['get']['query'], config?: T }) => @@ -579,7 +656,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods40['post']['reqBody'], config?: T }) => fetch(prefix, PATH27, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods40['post']['reqBody'], config?: T }) => - fetch(prefix, PATH27, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH27, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods40['get']['query'] }) => + `${prefix}${PATH27}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, segments: { _segment_id: (val17: number) => { @@ -598,7 +677,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods43['delete']['query'], config?: T }) => fetch(prefix, prefix18, DELETE, option).send(), $delete: (option: { query: Methods43['delete']['query'], config?: T }) => - fetch(prefix, prefix18, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix18, DELETE, option).send().then(r => r.body), + $path: (option?: { method: 'delete'; query: Methods43['delete']['query'] }) => + `${prefix}${prefix18}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods42['get']['query'], config?: T }) => @@ -608,7 +689,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods42['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix17}${PATH29}`, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods42['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix17}${PATH29}`, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, `${prefix17}${PATH29}`, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods42['get']['query'] }) => + `${prefix}${prefix17}${PATH29}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } @@ -629,7 +712,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods45['delete']['query'], config?: T }) => fetch(prefix, prefix19, DELETE, option).send(), $delete: (option: { query: Methods45['delete']['query'], config?: T }) => - fetch(prefix, prefix19, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix19, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods45['get']['query'] } | { method: 'delete'; query: Methods45['delete']['query'] }) => + `${prefix}${prefix19}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods44['get']['query'], config?: T }) => @@ -639,7 +724,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods44['post']['reqBody'], config?: T }) => fetch(prefix, PATH30, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods44['post']['reqBody'], config?: T }) => - fetch(prefix, PATH30, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH30, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods44['get']['query'] }) => + `${prefix}${PATH30}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, taxes: { codes: { @@ -650,13 +737,15 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix20, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix20, GET, option).json().then(r => r.body) + fetch(prefix, prefix20, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix20}` } }, get: (option?: { config?: T }) => fetch(prefix, PATH31, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH31, GET, option).json().then(r => r.body) + fetch(prefix, PATH31, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH31}` }, companies: { _company_id: (val21: number) => { @@ -666,7 +755,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix21, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix21, GET, option).json().then(r => r.body) + fetch(prefix, prefix21, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix21}` } } } @@ -687,7 +777,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods50['delete']['query'], config?: T }) => fetch(prefix, prefix22, DELETE, option).send(), $delete: (option: { query: Methods50['delete']['query'], config?: T }) => - fetch(prefix, prefix22, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix22, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods50['get']['query'] } | { method: 'delete'; query: Methods50['delete']['query'] }) => + `${prefix}${prefix22}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods49['get']['query'], config?: T }) => @@ -697,14 +789,18 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods49['post']['reqBody'], config?: T }) => fetch(prefix, PATH33, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods49['post']['reqBody'], config?: T }) => - fetch(prefix, PATH33, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH33, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods49['get']['query'] }) => + `${prefix}${PATH33}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, users: { capabilities: { get: (option: { query: Methods52['get']['query'], config?: T }) => fetch(prefix, PATH35, GET, option).json(), $get: (option: { query: Methods52['get']['query'], config?: T }) => - fetch(prefix, PATH35, GET, option).json().then(r => r.body) + fetch(prefix, PATH35, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods52['get']['query'] }) => + `${prefix}${PATH35}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, me: { get: (option?: { query?: Methods53['get']['query'], config?: T }) => @@ -714,12 +810,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { body?: Methods53['put']['reqBody'], config?: T }) => fetch(prefix, PATH36, PUT, option, 'URLSearchParams').json(), $put: (option?: { body?: Methods53['put']['reqBody'], config?: T }) => - fetch(prefix, PATH36, PUT, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH36, PUT, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods53['get']['query'] }) => + `${prefix}${PATH36}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, get: (option: { query: Methods51['get']['query'], config?: T }) => fetch(prefix, PATH34, GET, option).json(), $get: (option: { query: Methods51['get']['query'], config?: T }) => - fetch(prefix, PATH34, GET, option).json().then(r => r.body) + fetch(prefix, PATH34, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods51['get']['query'] }) => + `${prefix}${PATH34}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, wallet_txns: { _id: (val23: number) => { @@ -733,7 +833,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods55['delete']['query'], config?: T }) => fetch(prefix, prefix23, DELETE, option).send(), $delete: (option: { query: Methods55['delete']['query'], config?: T }) => - fetch(prefix, prefix23, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix23, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods55['get']['query'] } | { method: 'delete'; query: Methods55['delete']['query'] }) => + `${prefix}${prefix23}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods54['get']['query'], config?: T }) => @@ -743,7 +845,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods54['post']['reqBody'], config?: T }) => fetch(prefix, PATH37, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods54['post']['reqBody'], config?: T }) => - fetch(prefix, PATH37, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH37, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods54['get']['query'] }) => + `${prefix}${PATH37}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, walletables: { _type: (val24: number | string) => { @@ -765,7 +869,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods57['delete']['query'], config?: T }) => fetch(prefix, prefix25, DELETE, option).send(), $delete: (option: { query: Methods57['delete']['query'], config?: T }) => - fetch(prefix, prefix25, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix25, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods57['get']['query'] } | { method: 'put'; query: Methods57['put']['query'] } | { method: 'delete'; query: Methods57['delete']['query'] }) => + `${prefix}${prefix25}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } @@ -777,7 +883,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods56['post']['reqBody'], config?: T }) => fetch(prefix, PATH38, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods56['post']['reqBody'], config?: T }) => - fetch(prefix, PATH38, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH38, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods56['get']['query'] }) => + `${prefix}${PATH38}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } diff --git a/samples/freee/api/1/$api.ts b/samples/freee/api/1/$api.ts index a2700710..8e9009ee 100644 --- a/samples/freee/api/1/$api.ts +++ b/samples/freee/api/1/$api.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './account_items' import { Methods as Methods1 } from './account_items/_id@number' import { Methods as Methods2 } from './banks' @@ -59,51 +59,51 @@ import { Methods as Methods55 } from './wallet_txns/_id@number' import { Methods as Methods56 } from './walletables' import { Methods as Methods57 } from './walletables/_type/_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/account_items' -const PATH1 = '/api/1/banks' -const PATH2 = '/api/1/companies' -const PATH3 = '/api/1/deals' -const PATH4 = '/payments' -const PATH5 = '/renews' -const PATH6 = '/api/1/expense_application_line_templates' -const PATH7 = '/api/1/expense_applications' -const PATH8 = '/api/1/forms/selectables' -const PATH9 = '/api/1/invoices' -const PATH10 = '/api/1/items' -const PATH11 = '/api/1/journals' -const PATH12 = '/api/1/journals/reports' -const PATH13 = '/download' -const PATH14 = '/status' -const PATH15 = '/api/1/manual_journals' -const PATH16 = '/api/1/partners' -const PATH17 = '/api/1/partners/code' -const PATH18 = '/api/1/quotations' -const PATH19 = '/api/1/receipts' -const PATH20 = '/api/1/reports/trial_bs' -const PATH21 = '/api/1/reports/trial_bs_three_years' -const PATH22 = '/api/1/reports/trial_bs_two_years' -const PATH23 = '/api/1/reports/trial_pl' -const PATH24 = '/api/1/reports/trial_pl_sections' -const PATH25 = '/api/1/reports/trial_pl_three_years' -const PATH26 = '/api/1/reports/trial_pl_two_years' -const PATH27 = '/api/1/sections' -const PATH28 = '/api/1/segments' -const PATH29 = '/tags' -const PATH30 = '/api/1/tags' -const PATH31 = '/api/1/taxes/codes' -const PATH32 = '/api/1/taxes/companies' -const PATH33 = '/api/1/transfers' -const PATH34 = '/api/1/users' -const PATH35 = '/api/1/users/capabilities' -const PATH36 = '/api/1/users/me' -const PATH37 = '/api/1/wallet_txns' -const PATH38 = '/api/1/walletables' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/account_items' + const PATH1 = '/api/1/banks' + const PATH2 = '/api/1/companies' + const PATH3 = '/api/1/deals' + const PATH4 = '/payments' + const PATH5 = '/renews' + const PATH6 = '/api/1/expense_application_line_templates' + const PATH7 = '/api/1/expense_applications' + const PATH8 = '/api/1/forms/selectables' + const PATH9 = '/api/1/invoices' + const PATH10 = '/api/1/items' + const PATH11 = '/api/1/journals' + const PATH12 = '/api/1/journals/reports' + const PATH13 = '/download' + const PATH14 = '/status' + const PATH15 = '/api/1/manual_journals' + const PATH16 = '/api/1/partners' + const PATH17 = '/api/1/partners/code' + const PATH18 = '/api/1/quotations' + const PATH19 = '/api/1/receipts' + const PATH20 = '/api/1/reports/trial_bs' + const PATH21 = '/api/1/reports/trial_bs_three_years' + const PATH22 = '/api/1/reports/trial_bs_two_years' + const PATH23 = '/api/1/reports/trial_pl' + const PATH24 = '/api/1/reports/trial_pl_sections' + const PATH25 = '/api/1/reports/trial_pl_three_years' + const PATH26 = '/api/1/reports/trial_pl_two_years' + const PATH27 = '/api/1/sections' + const PATH28 = '/api/1/segments' + const PATH29 = '/tags' + const PATH30 = '/api/1/tags' + const PATH31 = '/api/1/taxes/codes' + const PATH32 = '/api/1/taxes/companies' + const PATH33 = '/api/1/transfers' + const PATH34 = '/api/1/users' + const PATH35 = '/api/1/users/capabilities' + const PATH36 = '/api/1/users/me' + const PATH37 = '/api/1/wallet_txns' + const PATH38 = '/api/1/walletables' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { account_items: { @@ -122,7 +122,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -132,7 +134,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, banks: { _id: (val1: number) => { @@ -142,13 +146,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix1, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix1, GET, option).json().then(r => r.body) + fetch(prefix, prefix1, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix1}` } }, get: (option?: { query?: Methods2['get']['query'], config?: T }) => fetch(prefix, PATH1, GET, option).json(), $get: (option?: { query?: Methods2['get']['query'], config?: T }) => - fetch(prefix, PATH1, GET, option).json().then(r => r.body) + fetch(prefix, PATH1, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods2['get']['query'] }) => + `${prefix}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, companies: { _id: (val2: number) => { @@ -162,13 +169,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { body?: Methods5['put']['reqBody'], config?: T }) => fetch(prefix, prefix2, PUT, option, 'URLSearchParams').json(), $put: (option?: { body?: Methods5['put']['reqBody'], config?: T }) => - fetch(prefix, prefix2, PUT, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, prefix2, PUT, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods5['get']['query'] }) => + `${prefix}${prefix2}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option?: { config?: T }) => fetch(prefix, PATH2, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH2, GET, option).json().then(r => r.body) + fetch(prefix, PATH2, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH2}` }, deals: { _id: (val3: number) => { @@ -187,13 +197,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods9['delete']['query'], config?: T }) => fetch(prefix, prefix4, DELETE, option).send(), $delete: (option: { query: Methods9['delete']['query'], config?: T }) => - fetch(prefix, prefix4, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix4, DELETE, option).send().then(r => r.body), + $path: (option?: { method: 'delete'; query: Methods9['delete']['query'] }) => + `${prefix}${prefix4}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, post: (option: { body: Methods8['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix3}${PATH4}`, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods8['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix3}${PATH4}`, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, `${prefix3}${PATH4}`, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: () => `${prefix}${prefix3}${PATH4}` }, renews: { _renew_id: (val5: number) => { @@ -207,13 +220,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods11['delete']['query'], config?: T }) => fetch(prefix, prefix5, DELETE, option).json(), $delete: (option: { query: Methods11['delete']['query'], config?: T }) => - fetch(prefix, prefix5, DELETE, option).json().then(r => r.body) + fetch(prefix, prefix5, DELETE, option).json().then(r => r.body), + $path: (option?: { method: 'delete'; query: Methods11['delete']['query'] }) => + `${prefix}${prefix5}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, post: (option: { body: Methods10['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix3}${PATH5}`, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods10['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix3}${PATH5}`, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, `${prefix3}${PATH5}`, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: () => `${prefix}${prefix3}${PATH5}` }, get: (option: { query: Methods7['get']['query'], config?: T }) => fetch(prefix, prefix3, GET, option).json(), @@ -226,7 +242,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods7['delete']['query'], config?: T }) => fetch(prefix, prefix3, DELETE, option).send(), $delete: (option: { query: Methods7['delete']['query'], config?: T }) => - fetch(prefix, prefix3, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix3, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods7['get']['query'] } | { method: 'delete'; query: Methods7['delete']['query'] }) => + `${prefix}${prefix3}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods6['get']['query'], config?: T }) => @@ -236,7 +254,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods6['post']['reqBody'], config?: T }) => fetch(prefix, PATH3, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods6['post']['reqBody'], config?: T }) => - fetch(prefix, PATH3, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH3, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods6['get']['query'] }) => + `${prefix}${PATH3}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, expense_application_line_templates: { _id: (val6: number) => { @@ -254,7 +274,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods13['delete']['query'], config?: T }) => fetch(prefix, prefix6, DELETE, option).send(), $delete: (option: { query: Methods13['delete']['query'], config?: T }) => - fetch(prefix, prefix6, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix6, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods13['get']['query'] } | { method: 'delete'; query: Methods13['delete']['query'] }) => + `${prefix}${prefix6}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods12['get']['query'], config?: T }) => @@ -264,7 +286,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods12['post']['reqBody'], config?: T }) => fetch(prefix, PATH6, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods12['post']['reqBody'], config?: T }) => - fetch(prefix, PATH6, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH6, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods12['get']['query'] }) => + `${prefix}${PATH6}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, expense_applications: { _id: (val7: number) => { @@ -282,7 +306,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods15['delete']['query'], config?: T }) => fetch(prefix, prefix7, DELETE, option).send(), $delete: (option: { query: Methods15['delete']['query'], config?: T }) => - fetch(prefix, prefix7, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix7, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods15['get']['query'] } | { method: 'delete'; query: Methods15['delete']['query'] }) => + `${prefix}${prefix7}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods14['get']['query'], config?: T }) => @@ -292,14 +318,18 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods14['post']['reqBody'], config?: T }) => fetch(prefix, PATH7, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods14['post']['reqBody'], config?: T }) => - fetch(prefix, PATH7, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH7, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods14['get']['query'] }) => + `${prefix}${PATH7}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, forms: { selectables: { get: (option: { query: Methods16['get']['query'], config?: T }) => fetch(prefix, PATH8, GET, option).json(), $get: (option: { query: Methods16['get']['query'], config?: T }) => - fetch(prefix, PATH8, GET, option).json().then(r => r.body) + fetch(prefix, PATH8, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods16['get']['query'] }) => + `${prefix}${PATH8}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, invoices: { @@ -318,7 +348,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods18['delete']['query'], config?: T }) => fetch(prefix, prefix8, DELETE, option).send(), $delete: (option: { query: Methods18['delete']['query'], config?: T }) => - fetch(prefix, prefix8, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix8, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods18['get']['query'] } | { method: 'delete'; query: Methods18['delete']['query'] }) => + `${prefix}${prefix8}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods17['get']['query'], config?: T }) => @@ -328,7 +360,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods17['post']['reqBody'], config?: T }) => fetch(prefix, PATH9, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods17['post']['reqBody'], config?: T }) => - fetch(prefix, PATH9, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH9, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods17['get']['query'] }) => + `${prefix}${PATH9}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, items: { _id: (val9: number) => { @@ -346,7 +380,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods20['delete']['query'], config?: T }) => fetch(prefix, prefix9, DELETE, option).send(), $delete: (option: { query: Methods20['delete']['query'], config?: T }) => - fetch(prefix, prefix9, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix9, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods20['get']['query'] } | { method: 'delete'; query: Methods20['delete']['query'] }) => + `${prefix}${prefix9}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods19['get']['query'], config?: T }) => @@ -356,7 +392,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods19['post']['reqBody'], config?: T }) => fetch(prefix, PATH10, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods19['post']['reqBody'], config?: T }) => - fetch(prefix, PATH10, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH10, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods19['get']['query'] }) => + `${prefix}${PATH10}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, journals: { reports: { @@ -368,13 +406,17 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option: { query: Methods22['get']['query'], config?: T }) => fetch(prefix, `${prefix10}${PATH13}`, GET, option).send(), $get: (option: { query: Methods22['get']['query'], config?: T }) => - fetch(prefix, `${prefix10}${PATH13}`, GET, option).send().then(r => r.body) + fetch(prefix, `${prefix10}${PATH13}`, GET, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods22['get']['query'] }) => + `${prefix}${prefix10}${PATH13}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, status: { get: (option: { query: Methods23['get']['query'], config?: T }) => fetch(prefix, `${prefix10}${PATH14}`, GET, option).json(), $get: (option: { query: Methods23['get']['query'], config?: T }) => - fetch(prefix, `${prefix10}${PATH14}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix10}${PATH14}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods23['get']['query'] }) => + `${prefix}${prefix10}${PATH14}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } @@ -382,7 +424,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option: { query: Methods21['get']['query'], config?: T }) => fetch(prefix, PATH11, GET, option).json(), $get: (option: { query: Methods21['get']['query'], config?: T }) => - fetch(prefix, PATH11, GET, option).json().then(r => r.body) + fetch(prefix, PATH11, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods21['get']['query'] }) => + `${prefix}${PATH11}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, manual_journals: { _id: (val11: number) => { @@ -400,7 +444,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods25['delete']['query'], config?: T }) => fetch(prefix, prefix11, DELETE, option).send(), $delete: (option: { query: Methods25['delete']['query'], config?: T }) => - fetch(prefix, prefix11, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix11, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods25['get']['query'] } | { method: 'delete'; query: Methods25['delete']['query'] }) => + `${prefix}${prefix11}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods24['get']['query'], config?: T }) => @@ -410,7 +456,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods24['post']['reqBody'], config?: T }) => fetch(prefix, PATH15, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods24['post']['reqBody'], config?: T }) => - fetch(prefix, PATH15, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH15, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods24['get']['query'] }) => + `${prefix}${PATH15}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, partners: { _id: (val12: number) => { @@ -428,7 +476,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods27['delete']['query'], config?: T }) => fetch(prefix, prefix12, DELETE, option).send(), $delete: (option: { query: Methods27['delete']['query'], config?: T }) => - fetch(prefix, prefix12, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix12, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods27['get']['query'] } | { method: 'delete'; query: Methods27['delete']['query'] }) => + `${prefix}${prefix12}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, code: { @@ -439,7 +489,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option: { body: Methods28['put']['reqBody'], config?: T }) => fetch(prefix, prefix13, PUT, option, 'URLSearchParams').json(), $put: (option: { body: Methods28['put']['reqBody'], config?: T }) => - fetch(prefix, prefix13, PUT, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, prefix13, PUT, option, 'URLSearchParams').json().then(r => r.body), + $path: () => `${prefix}${prefix13}` } } }, @@ -450,7 +501,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods26['post']['reqBody'], config?: T }) => fetch(prefix, PATH16, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods26['post']['reqBody'], config?: T }) => - fetch(prefix, PATH16, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH16, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods26['get']['query'] }) => + `${prefix}${PATH16}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, quotations: { _id: (val14: number) => { @@ -468,7 +521,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods30['delete']['query'], config?: T }) => fetch(prefix, prefix14, DELETE, option).send(), $delete: (option: { query: Methods30['delete']['query'], config?: T }) => - fetch(prefix, prefix14, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix14, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods30['get']['query'] } | { method: 'delete'; query: Methods30['delete']['query'] }) => + `${prefix}${prefix14}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods29['get']['query'], config?: T }) => @@ -478,7 +533,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods29['post']['reqBody'], config?: T }) => fetch(prefix, PATH18, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods29['post']['reqBody'], config?: T }) => - fetch(prefix, PATH18, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH18, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods29['get']['query'] }) => + `${prefix}${PATH18}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, receipts: { _id: (val15: number) => { @@ -496,7 +553,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods32['delete']['query'], config?: T }) => fetch(prefix, prefix15, DELETE, option).send(), $delete: (option: { query: Methods32['delete']['query'], config?: T }) => - fetch(prefix, prefix15, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix15, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods32['get']['query'] } | { method: 'delete'; query: Methods32['delete']['query'] }) => + `${prefix}${prefix15}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods31['get']['query'], config?: T }) => @@ -506,50 +565,66 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods31['post']['reqBody'], config?: T }) => fetch(prefix, PATH19, POST, option, 'FormData').json(), $post: (option: { body: Methods31['post']['reqBody'], config?: T }) => - fetch(prefix, PATH19, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH19, POST, option, 'FormData').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods31['get']['query'] }) => + `${prefix}${PATH19}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, reports: { trial_bs: { get: (option: { query: Methods33['get']['query'], config?: T }) => fetch(prefix, PATH20, GET, option).json(), $get: (option: { query: Methods33['get']['query'], config?: T }) => - fetch(prefix, PATH20, GET, option).json().then(r => r.body) + fetch(prefix, PATH20, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods33['get']['query'] }) => + `${prefix}${PATH20}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_bs_three_years: { get: (option: { query: Methods34['get']['query'], config?: T }) => fetch(prefix, PATH21, GET, option).json(), $get: (option: { query: Methods34['get']['query'], config?: T }) => - fetch(prefix, PATH21, GET, option).json().then(r => r.body) + fetch(prefix, PATH21, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods34['get']['query'] }) => + `${prefix}${PATH21}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_bs_two_years: { get: (option: { query: Methods35['get']['query'], config?: T }) => fetch(prefix, PATH22, GET, option).json(), $get: (option: { query: Methods35['get']['query'], config?: T }) => - fetch(prefix, PATH22, GET, option).json().then(r => r.body) + fetch(prefix, PATH22, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods35['get']['query'] }) => + `${prefix}${PATH22}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl: { get: (option: { query: Methods36['get']['query'], config?: T }) => fetch(prefix, PATH23, GET, option).json(), $get: (option: { query: Methods36['get']['query'], config?: T }) => - fetch(prefix, PATH23, GET, option).json().then(r => r.body) + fetch(prefix, PATH23, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods36['get']['query'] }) => + `${prefix}${PATH23}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl_sections: { get: (option: { query: Methods37['get']['query'], config?: T }) => fetch(prefix, PATH24, GET, option).json(), $get: (option: { query: Methods37['get']['query'], config?: T }) => - fetch(prefix, PATH24, GET, option).json().then(r => r.body) + fetch(prefix, PATH24, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods37['get']['query'] }) => + `${prefix}${PATH24}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl_three_years: { get: (option: { query: Methods38['get']['query'], config?: T }) => fetch(prefix, PATH25, GET, option).json(), $get: (option: { query: Methods38['get']['query'], config?: T }) => - fetch(prefix, PATH25, GET, option).json().then(r => r.body) + fetch(prefix, PATH25, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods38['get']['query'] }) => + `${prefix}${PATH25}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl_two_years: { get: (option: { query: Methods39['get']['query'], config?: T }) => fetch(prefix, PATH26, GET, option).json(), $get: (option: { query: Methods39['get']['query'], config?: T }) => - fetch(prefix, PATH26, GET, option).json().then(r => r.body) + fetch(prefix, PATH26, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods39['get']['query'] }) => + `${prefix}${PATH26}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, sections: { @@ -568,7 +643,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods41['delete']['query'], config?: T }) => fetch(prefix, prefix16, DELETE, option).send(), $delete: (option: { query: Methods41['delete']['query'], config?: T }) => - fetch(prefix, prefix16, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix16, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods41['get']['query'] } | { method: 'delete'; query: Methods41['delete']['query'] }) => + `${prefix}${prefix16}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods40['get']['query'], config?: T }) => @@ -578,7 +655,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods40['post']['reqBody'], config?: T }) => fetch(prefix, PATH27, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods40['post']['reqBody'], config?: T }) => - fetch(prefix, PATH27, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH27, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods40['get']['query'] }) => + `${prefix}${PATH27}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, segments: { _segment_id: (val17: number) => { @@ -597,7 +676,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods43['delete']['query'], config?: T }) => fetch(prefix, prefix18, DELETE, option).send(), $delete: (option: { query: Methods43['delete']['query'], config?: T }) => - fetch(prefix, prefix18, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix18, DELETE, option).send().then(r => r.body), + $path: (option?: { method: 'delete'; query: Methods43['delete']['query'] }) => + `${prefix}${prefix18}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods42['get']['query'], config?: T }) => @@ -607,7 +688,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods42['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix17}${PATH29}`, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods42['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix17}${PATH29}`, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, `${prefix17}${PATH29}`, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods42['get']['query'] }) => + `${prefix}${prefix17}${PATH29}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } @@ -628,7 +711,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods45['delete']['query'], config?: T }) => fetch(prefix, prefix19, DELETE, option).send(), $delete: (option: { query: Methods45['delete']['query'], config?: T }) => - fetch(prefix, prefix19, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix19, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods45['get']['query'] } | { method: 'delete'; query: Methods45['delete']['query'] }) => + `${prefix}${prefix19}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods44['get']['query'], config?: T }) => @@ -638,7 +723,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods44['post']['reqBody'], config?: T }) => fetch(prefix, PATH30, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods44['post']['reqBody'], config?: T }) => - fetch(prefix, PATH30, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH30, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods44['get']['query'] }) => + `${prefix}${PATH30}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, taxes: { codes: { @@ -649,13 +736,15 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix20, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix20, GET, option).json().then(r => r.body) + fetch(prefix, prefix20, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix20}` } }, get: (option?: { config?: T }) => fetch(prefix, PATH31, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH31, GET, option).json().then(r => r.body) + fetch(prefix, PATH31, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH31}` }, companies: { _company_id: (val21: number) => { @@ -665,7 +754,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix21, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix21, GET, option).json().then(r => r.body) + fetch(prefix, prefix21, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix21}` } } } @@ -686,7 +776,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods50['delete']['query'], config?: T }) => fetch(prefix, prefix22, DELETE, option).send(), $delete: (option: { query: Methods50['delete']['query'], config?: T }) => - fetch(prefix, prefix22, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix22, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods50['get']['query'] } | { method: 'delete'; query: Methods50['delete']['query'] }) => + `${prefix}${prefix22}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods49['get']['query'], config?: T }) => @@ -696,14 +788,18 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods49['post']['reqBody'], config?: T }) => fetch(prefix, PATH33, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods49['post']['reqBody'], config?: T }) => - fetch(prefix, PATH33, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH33, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods49['get']['query'] }) => + `${prefix}${PATH33}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, users: { capabilities: { get: (option: { query: Methods52['get']['query'], config?: T }) => fetch(prefix, PATH35, GET, option).json(), $get: (option: { query: Methods52['get']['query'], config?: T }) => - fetch(prefix, PATH35, GET, option).json().then(r => r.body) + fetch(prefix, PATH35, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods52['get']['query'] }) => + `${prefix}${PATH35}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, me: { get: (option?: { query?: Methods53['get']['query'], config?: T }) => @@ -713,12 +809,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { body?: Methods53['put']['reqBody'], config?: T }) => fetch(prefix, PATH36, PUT, option, 'URLSearchParams').json(), $put: (option?: { body?: Methods53['put']['reqBody'], config?: T }) => - fetch(prefix, PATH36, PUT, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH36, PUT, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods53['get']['query'] }) => + `${prefix}${PATH36}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, get: (option: { query: Methods51['get']['query'], config?: T }) => fetch(prefix, PATH34, GET, option).json(), $get: (option: { query: Methods51['get']['query'], config?: T }) => - fetch(prefix, PATH34, GET, option).json().then(r => r.body) + fetch(prefix, PATH34, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods51['get']['query'] }) => + `${prefix}${PATH34}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, wallet_txns: { _id: (val23: number) => { @@ -732,7 +832,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods55['delete']['query'], config?: T }) => fetch(prefix, prefix23, DELETE, option).send(), $delete: (option: { query: Methods55['delete']['query'], config?: T }) => - fetch(prefix, prefix23, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix23, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods55['get']['query'] } | { method: 'delete'; query: Methods55['delete']['query'] }) => + `${prefix}${prefix23}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods54['get']['query'], config?: T }) => @@ -742,7 +844,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods54['post']['reqBody'], config?: T }) => fetch(prefix, PATH37, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods54['post']['reqBody'], config?: T }) => - fetch(prefix, PATH37, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH37, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods54['get']['query'] }) => + `${prefix}${PATH37}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, walletables: { _type: (val24: number | string) => { @@ -764,7 +868,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods57['delete']['query'], config?: T }) => fetch(prefix, prefix25, DELETE, option).send(), $delete: (option: { query: Methods57['delete']['query'], config?: T }) => - fetch(prefix, prefix25, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix25, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods57['get']['query'] } | { method: 'put'; query: Methods57['put']['query'] } | { method: 'delete'; query: Methods57['delete']['query'] }) => + `${prefix}${prefix25}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } @@ -776,7 +882,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods56['post']['reqBody'], config?: T }) => fetch(prefix, PATH38, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods56['post']['reqBody'], config?: T }) => - fetch(prefix, PATH38, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH38, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods56['get']['query'] }) => + `${prefix}${PATH38}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } diff --git a/samples/freee/api/1/account_items/$api.ts b/samples/freee/api/1/account_items/$api.ts index d16d98f1..1d859d8e 100644 --- a/samples/freee/api/1/account_items/$api.ts +++ b/samples/freee/api/1/account_items/$api.ts @@ -1,15 +1,15 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/account_items' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/account_items' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _id: (val0: number) => { @@ -27,7 +27,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -37,7 +39,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/banks/$api.ts b/samples/freee/api/1/banks/$api.ts index 65918f36..9426b1cd 100644 --- a/samples/freee/api/1/banks/$api.ts +++ b/samples/freee/api/1/banks/$api.ts @@ -1,12 +1,12 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' -const GET = 'GET' -const PATH0 = '/api/1/banks' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/banks' + const GET = 'GET' return { _id: (val0: number) => { @@ -16,13 +16,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix0, GET, option).json().then(r => r.body) + fetch(prefix, prefix0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, get: (option?: { query?: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { query?: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/companies/$api.ts b/samples/freee/api/1/companies/$api.ts index 9b45cfb1..8e970348 100644 --- a/samples/freee/api/1/companies/$api.ts +++ b/samples/freee/api/1/companies/$api.ts @@ -1,13 +1,13 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' -const GET = 'GET' -const PUT = 'PUT' -const PATH0 = '/api/1/companies' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/companies' + const GET = 'GET' + const PUT = 'PUT' return { _id: (val0: number) => { @@ -21,13 +21,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { body?: Methods1['put']['reqBody'], config?: T }) => fetch(prefix, prefix0, PUT, option, 'URLSearchParams').json(), $put: (option?: { body?: Methods1['put']['reqBody'], config?: T }) => - fetch(prefix, prefix0, PUT, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, prefix0, PUT, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option?: { config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/freee/api/1/deals/$api.ts b/samples/freee/api/1/deals/$api.ts index fe0cc567..7804f90c 100644 --- a/samples/freee/api/1/deals/$api.ts +++ b/samples/freee/api/1/deals/$api.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' import { Methods as Methods2 } from './_id@number/payments' @@ -7,15 +7,15 @@ import { Methods as Methods3 } from './_id@number/payments/_payment_id@number' import { Methods as Methods4 } from './_id@number/renews' import { Methods as Methods5 } from './_id@number/renews/_renew_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/deals' -const PATH1 = '/payments' -const PATH2 = '/renews' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/deals' + const PATH1 = '/payments' + const PATH2 = '/renews' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _id: (val0: number) => { @@ -34,13 +34,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods3['delete']['query'], config?: T }) => fetch(prefix, prefix1, DELETE, option).send(), $delete: (option: { query: Methods3['delete']['query'], config?: T }) => - fetch(prefix, prefix1, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix1, DELETE, option).send().then(r => r.body), + $path: (option?: { method: 'delete'; query: Methods3['delete']['query'] }) => + `${prefix}${prefix1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, post: (option: { body: Methods2['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods2['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH1}` }, renews: { _renew_id: (val2: number) => { @@ -54,13 +57,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods5['delete']['query'], config?: T }) => fetch(prefix, prefix2, DELETE, option).json(), $delete: (option: { query: Methods5['delete']['query'], config?: T }) => - fetch(prefix, prefix2, DELETE, option).json().then(r => r.body) + fetch(prefix, prefix2, DELETE, option).json().then(r => r.body), + $path: (option?: { method: 'delete'; query: Methods5['delete']['query'] }) => + `${prefix}${prefix2}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, post: (option: { body: Methods4['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix0}${PATH2}`, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods4['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix0}${PATH2}`, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH2}`, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH2}` }, get: (option: { query: Methods1['get']['query'], config?: T }) => fetch(prefix, prefix0, GET, option).json(), @@ -73,7 +79,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -83,7 +91,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/expense_application_line_templates/$api.ts b/samples/freee/api/1/expense_application_line_templates/$api.ts index 7623c1b6..56a87236 100644 --- a/samples/freee/api/1/expense_application_line_templates/$api.ts +++ b/samples/freee/api/1/expense_application_line_templates/$api.ts @@ -1,15 +1,15 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/expense_application_line_templates' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/expense_application_line_templates' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _id: (val0: number) => { @@ -27,7 +27,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -37,7 +39,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/expense_applications/$api.ts b/samples/freee/api/1/expense_applications/$api.ts index 950e9d2a..9a281185 100644 --- a/samples/freee/api/1/expense_applications/$api.ts +++ b/samples/freee/api/1/expense_applications/$api.ts @@ -1,15 +1,15 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/expense_applications' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/expense_applications' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _id: (val0: number) => { @@ -27,7 +27,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -37,7 +39,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/forms/$api.ts b/samples/freee/api/1/forms/$api.ts index 1bb26bb6..a5219e0f 100644 --- a/samples/freee/api/1/forms/$api.ts +++ b/samples/freee/api/1/forms/$api.ts @@ -1,18 +1,20 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './selectables' -const GET = 'GET' -const PATH0 = '/api/1/forms/selectables' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/forms/selectables' + const GET = 'GET' return { selectables: { get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } diff --git a/samples/freee/api/1/forms/selectables/$api.ts b/samples/freee/api/1/forms/selectables/$api.ts index 714694a8..88b19901 100644 --- a/samples/freee/api/1/forms/selectables/$api.ts +++ b/samples/freee/api/1/forms/selectables/$api.ts @@ -1,17 +1,19 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/api/1/forms/selectables' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/forms/selectables' + const GET = 'GET' return { get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/invoices/$api.ts b/samples/freee/api/1/invoices/$api.ts index 3a80ab87..aaca0dde 100644 --- a/samples/freee/api/1/invoices/$api.ts +++ b/samples/freee/api/1/invoices/$api.ts @@ -1,15 +1,15 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/invoices' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/invoices' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _id: (val0: number) => { @@ -27,7 +27,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -37,7 +39,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/items/$api.ts b/samples/freee/api/1/items/$api.ts index b712fe9f..3639db3f 100644 --- a/samples/freee/api/1/items/$api.ts +++ b/samples/freee/api/1/items/$api.ts @@ -1,15 +1,15 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/items' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/items' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _id: (val0: number) => { @@ -27,7 +27,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -37,7 +39,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/journals/$api.ts b/samples/freee/api/1/journals/$api.ts index 24a414c1..2c1a747c 100644 --- a/samples/freee/api/1/journals/$api.ts +++ b/samples/freee/api/1/journals/$api.ts @@ -1,16 +1,16 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './reports/_id@number/download' import { Methods as Methods2 } from './reports/_id@number/status' -const GET = 'GET' -const PATH0 = '/api/1/journals' -const PATH1 = '/api/1/journals/reports' -const PATH2 = '/download' -const PATH3 = '/status' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/journals' + const PATH1 = '/api/1/journals/reports' + const PATH2 = '/download' + const PATH3 = '/status' + const GET = 'GET' return { reports: { @@ -22,13 +22,17 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option: { query: Methods1['get']['query'], config?: T }) => fetch(prefix, `${prefix0}${PATH2}`, GET, option).send(), $get: (option: { query: Methods1['get']['query'], config?: T }) => - fetch(prefix, `${prefix0}${PATH2}`, GET, option).send().then(r => r.body) + fetch(prefix, `${prefix0}${PATH2}`, GET, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => + `${prefix}${prefix0}${PATH2}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, status: { get: (option: { query: Methods2['get']['query'], config?: T }) => fetch(prefix, `${prefix0}${PATH3}`, GET, option).json(), $get: (option: { query: Methods2['get']['query'], config?: T }) => - fetch(prefix, `${prefix0}${PATH3}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH3}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods2['get']['query'] }) => + `${prefix}${prefix0}${PATH3}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } @@ -36,7 +40,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/journals/reports/$api.ts b/samples/freee/api/1/journals/reports/$api.ts index 3a282c82..44b53930 100644 --- a/samples/freee/api/1/journals/reports/$api.ts +++ b/samples/freee/api/1/journals/reports/$api.ts @@ -1,14 +1,14 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './_id@number/download' import { Methods as Methods1 } from './_id@number/status' -const GET = 'GET' -const PATH0 = '/api/1/journals/reports' -const PATH1 = '/download' -const PATH2 = '/status' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/journals/reports' + const PATH1 = '/download' + const PATH2 = '/status' + const GET = 'GET' return { _id: (val0: number) => { @@ -19,13 +19,17 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, GET, option).send(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, `${prefix0}${PATH1}`, GET, option).send().then(r => r.body) + fetch(prefix, `${prefix0}${PATH1}`, GET, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${prefix0}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, status: { get: (option: { query: Methods1['get']['query'], config?: T }) => fetch(prefix, `${prefix0}${PATH2}`, GET, option).json(), $get: (option: { query: Methods1['get']['query'], config?: T }) => - fetch(prefix, `${prefix0}${PATH2}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH2}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => + `${prefix}${prefix0}${PATH2}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } diff --git a/samples/freee/api/1/manual_journals/$api.ts b/samples/freee/api/1/manual_journals/$api.ts index eb166ee2..80d94117 100644 --- a/samples/freee/api/1/manual_journals/$api.ts +++ b/samples/freee/api/1/manual_journals/$api.ts @@ -1,15 +1,15 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/manual_journals' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/manual_journals' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _id: (val0: number) => { @@ -27,7 +27,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -37,7 +39,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/partners/$api.ts b/samples/freee/api/1/partners/$api.ts index 5760b737..57482f7f 100644 --- a/samples/freee/api/1/partners/$api.ts +++ b/samples/freee/api/1/partners/$api.ts @@ -1,17 +1,17 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' import { Methods as Methods2 } from './code/_code@string' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/partners' -const PATH1 = '/api/1/partners/code' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/partners' + const PATH1 = '/api/1/partners/code' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _id: (val0: number) => { @@ -29,7 +29,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, code: { @@ -40,7 +42,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option: { body: Methods2['put']['reqBody'], config?: T }) => fetch(prefix, prefix1, PUT, option, 'URLSearchParams').json(), $put: (option: { body: Methods2['put']['reqBody'], config?: T }) => - fetch(prefix, prefix1, PUT, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, prefix1, PUT, option, 'URLSearchParams').json().then(r => r.body), + $path: () => `${prefix}${prefix1}` } } }, @@ -51,7 +54,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/partners/code/$api.ts b/samples/freee/api/1/partners/code/$api.ts index b334361a..8965224c 100644 --- a/samples/freee/api/1/partners/code/$api.ts +++ b/samples/freee/api/1/partners/code/$api.ts @@ -2,10 +2,10 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from './_code@string' -const PUT = 'PUT' -const PATH0 = '/api/1/partners/code' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/partners/code' + const PUT = 'PUT' return { _code: (val0: string) => { @@ -15,7 +15,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option: { body: Methods0['put']['reqBody'], config?: T }) => fetch(prefix, prefix0, PUT, option, 'URLSearchParams').json(), $put: (option: { body: Methods0['put']['reqBody'], config?: T }) => - fetch(prefix, prefix0, PUT, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, prefix0, PUT, option, 'URLSearchParams').json().then(r => r.body), + $path: () => `${prefix}${prefix0}` } } } diff --git a/samples/freee/api/1/quotations/$api.ts b/samples/freee/api/1/quotations/$api.ts index aed5c76a..5b17a6d0 100644 --- a/samples/freee/api/1/quotations/$api.ts +++ b/samples/freee/api/1/quotations/$api.ts @@ -1,15 +1,15 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/quotations' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/quotations' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _id: (val0: number) => { @@ -27,7 +27,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -37,7 +39,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/receipts/$api.ts b/samples/freee/api/1/receipts/$api.ts index 25dcfbbd..4e1fa3e2 100644 --- a/samples/freee/api/1/receipts/$api.ts +++ b/samples/freee/api/1/receipts/$api.ts @@ -1,15 +1,15 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/receipts' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/receipts' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _id: (val0: number) => { @@ -27,7 +27,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -37,7 +39,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'FormData').json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'FormData').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/reports/$api.ts b/samples/freee/api/1/reports/$api.ts index 37266b89..19d32d34 100644 --- a/samples/freee/api/1/reports/$api.ts +++ b/samples/freee/api/1/reports/$api.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './trial_bs' import { Methods as Methods1 } from './trial_bs_three_years' import { Methods as Methods2 } from './trial_bs_two_years' @@ -8,59 +8,73 @@ import { Methods as Methods4 } from './trial_pl_sections' import { Methods as Methods5 } from './trial_pl_three_years' import { Methods as Methods6 } from './trial_pl_two_years' -const GET = 'GET' -const PATH0 = '/api/1/reports/trial_bs' -const PATH1 = '/api/1/reports/trial_bs_three_years' -const PATH2 = '/api/1/reports/trial_bs_two_years' -const PATH3 = '/api/1/reports/trial_pl' -const PATH4 = '/api/1/reports/trial_pl_sections' -const PATH5 = '/api/1/reports/trial_pl_three_years' -const PATH6 = '/api/1/reports/trial_pl_two_years' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/reports/trial_bs' + const PATH1 = '/api/1/reports/trial_bs_three_years' + const PATH2 = '/api/1/reports/trial_bs_two_years' + const PATH3 = '/api/1/reports/trial_pl' + const PATH4 = '/api/1/reports/trial_pl_sections' + const PATH5 = '/api/1/reports/trial_pl_three_years' + const PATH6 = '/api/1/reports/trial_pl_two_years' + const GET = 'GET' return { trial_bs: { get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_bs_three_years: { get: (option: { query: Methods1['get']['query'], config?: T }) => fetch(prefix, PATH1, GET, option).json(), $get: (option: { query: Methods1['get']['query'], config?: T }) => - fetch(prefix, PATH1, GET, option).json().then(r => r.body) + fetch(prefix, PATH1, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => + `${prefix}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_bs_two_years: { get: (option: { query: Methods2['get']['query'], config?: T }) => fetch(prefix, PATH2, GET, option).json(), $get: (option: { query: Methods2['get']['query'], config?: T }) => - fetch(prefix, PATH2, GET, option).json().then(r => r.body) + fetch(prefix, PATH2, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods2['get']['query'] }) => + `${prefix}${PATH2}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl: { get: (option: { query: Methods3['get']['query'], config?: T }) => fetch(prefix, PATH3, GET, option).json(), $get: (option: { query: Methods3['get']['query'], config?: T }) => - fetch(prefix, PATH3, GET, option).json().then(r => r.body) + fetch(prefix, PATH3, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods3['get']['query'] }) => + `${prefix}${PATH3}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl_sections: { get: (option: { query: Methods4['get']['query'], config?: T }) => fetch(prefix, PATH4, GET, option).json(), $get: (option: { query: Methods4['get']['query'], config?: T }) => - fetch(prefix, PATH4, GET, option).json().then(r => r.body) + fetch(prefix, PATH4, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods4['get']['query'] }) => + `${prefix}${PATH4}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl_three_years: { get: (option: { query: Methods5['get']['query'], config?: T }) => fetch(prefix, PATH5, GET, option).json(), $get: (option: { query: Methods5['get']['query'], config?: T }) => - fetch(prefix, PATH5, GET, option).json().then(r => r.body) + fetch(prefix, PATH5, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods5['get']['query'] }) => + `${prefix}${PATH5}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, trial_pl_two_years: { get: (option: { query: Methods6['get']['query'], config?: T }) => fetch(prefix, PATH6, GET, option).json(), $get: (option: { query: Methods6['get']['query'], config?: T }) => - fetch(prefix, PATH6, GET, option).json().then(r => r.body) + fetch(prefix, PATH6, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods6['get']['query'] }) => + `${prefix}${PATH6}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } diff --git a/samples/freee/api/1/reports/trial_bs/$api.ts b/samples/freee/api/1/reports/trial_bs/$api.ts index d74cfd1e..e5451d71 100644 --- a/samples/freee/api/1/reports/trial_bs/$api.ts +++ b/samples/freee/api/1/reports/trial_bs/$api.ts @@ -1,17 +1,19 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/api/1/reports/trial_bs' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/reports/trial_bs' + const GET = 'GET' return { get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/reports/trial_bs_three_years/$api.ts b/samples/freee/api/1/reports/trial_bs_three_years/$api.ts index 785bd186..23a9e892 100644 --- a/samples/freee/api/1/reports/trial_bs_three_years/$api.ts +++ b/samples/freee/api/1/reports/trial_bs_three_years/$api.ts @@ -1,17 +1,19 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/api/1/reports/trial_bs_three_years' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/reports/trial_bs_three_years' + const GET = 'GET' return { get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/reports/trial_bs_two_years/$api.ts b/samples/freee/api/1/reports/trial_bs_two_years/$api.ts index 9f1a7318..10f77986 100644 --- a/samples/freee/api/1/reports/trial_bs_two_years/$api.ts +++ b/samples/freee/api/1/reports/trial_bs_two_years/$api.ts @@ -1,17 +1,19 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/api/1/reports/trial_bs_two_years' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/reports/trial_bs_two_years' + const GET = 'GET' return { get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/reports/trial_pl/$api.ts b/samples/freee/api/1/reports/trial_pl/$api.ts index b505d903..2805f4ef 100644 --- a/samples/freee/api/1/reports/trial_pl/$api.ts +++ b/samples/freee/api/1/reports/trial_pl/$api.ts @@ -1,17 +1,19 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/api/1/reports/trial_pl' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/reports/trial_pl' + const GET = 'GET' return { get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/reports/trial_pl_sections/$api.ts b/samples/freee/api/1/reports/trial_pl_sections/$api.ts index e0d7a429..5205492c 100644 --- a/samples/freee/api/1/reports/trial_pl_sections/$api.ts +++ b/samples/freee/api/1/reports/trial_pl_sections/$api.ts @@ -1,17 +1,19 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/api/1/reports/trial_pl_sections' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/reports/trial_pl_sections' + const GET = 'GET' return { get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/reports/trial_pl_three_years/$api.ts b/samples/freee/api/1/reports/trial_pl_three_years/$api.ts index bbe11982..208d50c4 100644 --- a/samples/freee/api/1/reports/trial_pl_three_years/$api.ts +++ b/samples/freee/api/1/reports/trial_pl_three_years/$api.ts @@ -1,17 +1,19 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/api/1/reports/trial_pl_three_years' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/reports/trial_pl_three_years' + const GET = 'GET' return { get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/reports/trial_pl_two_years/$api.ts b/samples/freee/api/1/reports/trial_pl_two_years/$api.ts index 8c93a29f..e7923012 100644 --- a/samples/freee/api/1/reports/trial_pl_two_years/$api.ts +++ b/samples/freee/api/1/reports/trial_pl_two_years/$api.ts @@ -1,17 +1,19 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/api/1/reports/trial_pl_two_years' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/reports/trial_pl_two_years' + const GET = 'GET' return { get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/sections/$api.ts b/samples/freee/api/1/sections/$api.ts index 054a3fe1..3a711259 100644 --- a/samples/freee/api/1/sections/$api.ts +++ b/samples/freee/api/1/sections/$api.ts @@ -1,15 +1,15 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/sections' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/sections' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _id: (val0: number) => { @@ -27,7 +27,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -37,7 +39,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/segments/$api.ts b/samples/freee/api/1/segments/$api.ts index 18af6529..f03b194b 100644 --- a/samples/freee/api/1/segments/$api.ts +++ b/samples/freee/api/1/segments/$api.ts @@ -1,16 +1,16 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './_segment_id@number/tags' import { Methods as Methods1 } from './_segment_id@number/tags/_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/segments' -const PATH1 = '/tags' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/segments' + const PATH1 = '/tags' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _segment_id: (val0: number) => { @@ -29,7 +29,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix1, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix1, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix1, DELETE, option).send().then(r => r.body), + $path: (option?: { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -39,7 +41,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${prefix0}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } diff --git a/samples/freee/api/1/tags/$api.ts b/samples/freee/api/1/tags/$api.ts index 13a55bed..b58bf403 100644 --- a/samples/freee/api/1/tags/$api.ts +++ b/samples/freee/api/1/tags/$api.ts @@ -1,15 +1,15 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/tags' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/tags' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _id: (val0: number) => { @@ -27,7 +27,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -37,7 +39,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/taxes/$api.ts b/samples/freee/api/1/taxes/$api.ts index 7e69e84d..c200eadb 100644 --- a/samples/freee/api/1/taxes/$api.ts +++ b/samples/freee/api/1/taxes/$api.ts @@ -4,11 +4,11 @@ import { Methods as Methods0 } from './codes' import { Methods as Methods1 } from './codes/_code@number' import { Methods as Methods2 } from './companies/_company_id@number' -const GET = 'GET' -const PATH0 = '/api/1/taxes/codes' -const PATH1 = '/api/1/taxes/companies' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/taxes/codes' + const PATH1 = '/api/1/taxes/companies' + const GET = 'GET' return { codes: { @@ -19,13 +19,15 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix0, GET, option).json().then(r => r.body) + fetch(prefix, prefix0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, get: (option?: { config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` }, companies: { _company_id: (val1: number) => { @@ -35,7 +37,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix1, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix1, GET, option).json().then(r => r.body) + fetch(prefix, prefix1, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix1}` } } } diff --git a/samples/freee/api/1/taxes/codes/$api.ts b/samples/freee/api/1/taxes/codes/$api.ts index 97471d54..64fea3f2 100644 --- a/samples/freee/api/1/taxes/codes/$api.ts +++ b/samples/freee/api/1/taxes/codes/$api.ts @@ -3,10 +3,10 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_code@number' -const GET = 'GET' -const PATH0 = '/api/1/taxes/codes' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/taxes/codes' + const GET = 'GET' return { _code: (val0: number) => { @@ -16,13 +16,15 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix0, GET, option).json().then(r => r.body) + fetch(prefix, prefix0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, get: (option?: { config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/freee/api/1/taxes/companies/$api.ts b/samples/freee/api/1/taxes/companies/$api.ts index 1e0e161d..526f4e4e 100644 --- a/samples/freee/api/1/taxes/companies/$api.ts +++ b/samples/freee/api/1/taxes/companies/$api.ts @@ -2,10 +2,10 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from './_company_id@number' -const GET = 'GET' -const PATH0 = '/api/1/taxes/companies' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/taxes/companies' + const GET = 'GET' return { _company_id: (val0: number) => { @@ -15,7 +15,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix0, GET, option).json().then(r => r.body) + fetch(prefix, prefix0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}` } } } diff --git a/samples/freee/api/1/transfers/$api.ts b/samples/freee/api/1/transfers/$api.ts index 64229b64..cd9cdac6 100644 --- a/samples/freee/api/1/transfers/$api.ts +++ b/samples/freee/api/1/transfers/$api.ts @@ -1,15 +1,15 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/transfers' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/transfers' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _id: (val0: number) => { @@ -27,7 +27,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -37,7 +39,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/users/$api.ts b/samples/freee/api/1/users/$api.ts index 3ee0422b..31c21181 100644 --- a/samples/freee/api/1/users/$api.ts +++ b/samples/freee/api/1/users/$api.ts @@ -1,23 +1,25 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './capabilities' import { Methods as Methods2 } from './me' -const GET = 'GET' -const PUT = 'PUT' -const PATH0 = '/api/1/users' -const PATH1 = '/api/1/users/capabilities' -const PATH2 = '/api/1/users/me' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/users' + const PATH1 = '/api/1/users/capabilities' + const PATH2 = '/api/1/users/me' + const GET = 'GET' + const PUT = 'PUT' return { capabilities: { get: (option: { query: Methods1['get']['query'], config?: T }) => fetch(prefix, PATH1, GET, option).json(), $get: (option: { query: Methods1['get']['query'], config?: T }) => - fetch(prefix, PATH1, GET, option).json().then(r => r.body) + fetch(prefix, PATH1, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => + `${prefix}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, me: { get: (option?: { query?: Methods2['get']['query'], config?: T }) => @@ -27,12 +29,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { body?: Methods2['put']['reqBody'], config?: T }) => fetch(prefix, PATH2, PUT, option, 'URLSearchParams').json(), $put: (option?: { body?: Methods2['put']['reqBody'], config?: T }) => - fetch(prefix, PATH2, PUT, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH2, PUT, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods2['get']['query'] }) => + `${prefix}${PATH2}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/users/capabilities/$api.ts b/samples/freee/api/1/users/capabilities/$api.ts index 7fa4d4f1..8fc073cd 100644 --- a/samples/freee/api/1/users/capabilities/$api.ts +++ b/samples/freee/api/1/users/capabilities/$api.ts @@ -1,17 +1,19 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/api/1/users/capabilities' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/users/capabilities' + const GET = 'GET' return { get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/users/me/$api.ts b/samples/freee/api/1/users/me/$api.ts index 0db97748..dbd14da7 100644 --- a/samples/freee/api/1/users/me/$api.ts +++ b/samples/freee/api/1/users/me/$api.ts @@ -1,12 +1,12 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PUT = 'PUT' -const PATH0 = '/api/1/users/me' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/users/me' + const GET = 'GET' + const PUT = 'PUT' return { get: (option?: { query?: Methods0['get']['query'], config?: T }) => @@ -16,7 +16,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { body?: Methods0['put']['reqBody'], config?: T }) => fetch(prefix, PATH0, PUT, option, 'URLSearchParams').json(), $put: (option?: { body?: Methods0['put']['reqBody'], config?: T }) => - fetch(prefix, PATH0, PUT, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, PUT, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/wallet_txns/$api.ts b/samples/freee/api/1/wallet_txns/$api.ts index f7fdfbfc..8f46fa4b 100644 --- a/samples/freee/api/1/wallet_txns/$api.ts +++ b/samples/freee/api/1/wallet_txns/$api.ts @@ -1,14 +1,14 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@number' -const GET = 'GET' -const POST = 'POST' -const DELETE = 'DELETE' -const PATH0 = '/api/1/wallet_txns' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/wallet_txns' + const GET = 'GET' + const POST = 'POST' + const DELETE = 'DELETE' return { _id: (val0: number) => { @@ -22,7 +22,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => @@ -32,7 +34,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/freee/api/1/walletables/$api.ts b/samples/freee/api/1/walletables/$api.ts index f718e47c..79b996f7 100644 --- a/samples/freee/api/1/walletables/$api.ts +++ b/samples/freee/api/1/walletables/$api.ts @@ -1,15 +1,15 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_type/_id@number' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/1/walletables' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://api.freee.co.jp' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/1/walletables' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _type: (val0: number | string) => { @@ -31,7 +31,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option: { query: Methods1['delete']['query'], config?: T }) => fetch(prefix, prefix1, DELETE, option).send(), $delete: (option: { query: Methods1['delete']['query'], config?: T }) => - fetch(prefix, prefix1, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix1, DELETE, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] } | { method: 'put'; query: Methods1['put']['query'] } | { method: 'delete'; query: Methods1['delete']['query'] }) => + `${prefix}${prefix1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } @@ -43,7 +45,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'URLSearchParams').json(), $post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'URLSearchParams').json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/openapi/$api.ts b/samples/openapi/$api.ts index 86a30b34..69e06304 100644 --- a/samples/openapi/$api.ts +++ b/samples/openapi/$api.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './api/stream/v1/stories' import { Methods as Methods1 } from './api/stream/v1/stories/_storyId@number' import { Methods as Methods2 } from './api/v1/me' @@ -53,53 +53,53 @@ import { Methods as Methods49 } from './api/v3/user' import { Methods as Methods50 } from './api/v3/user/_userId@string' import { Methods as Methods51 } from './api/v3/user/profile' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/stream/v1/stories' -const PATH1 = '/api/v1/me' -const PATH2 = '/api/v1/mixes' -const PATH3 = '/cards' -const PATH4 = '/url' -const PATH5 = '/api/v1/parse' -const PATH6 = '/api/v1/parse/image' -const PATH7 = '/api/v1/token' -const PATH8 = '/api/v3/2fa' -const PATH9 = '/api/v3/channels' -const PATH10 = '/chats' -const PATH11 = '/items' -const PATH12 = '/news-feed' -const PATH13 = '/items/audio' -const PATH14 = '/items/image' -const PATH15 = '/items/video' -const PATH16 = '/itemslist' -const PATH17 = '/users' -const PATH18 = '/users/remove' -const PATH19 = '/notifications' -const PATH20 = '/api/v3/chats' -const PATH21 = '/api/v3/chats/keys' -const PATH22 = '/api/v3/extension/audio' -const PATH23 = '/api/v3/extension/image' -const PATH24 = '/api/v3/extension/parse' -const PATH25 = '/api/v3/extension/story' -const PATH26 = '/audio' -const PATH27 = '/image' -const PATH28 = '/video' -const PATH29 = '/api/v3/extension/video' -const PATH30 = '/api/v3/fcm_token' -const PATH31 = '/api/v3/info' -const PATH32 = '/api/v3/login' -const PATH33 = '/api/v3/logout' -const PATH34 = '/api/v3/me' -const PATH35 = '/api/v3/organisation' -const PATH36 = '/api/v3/organisation/users' -const PATH37 = '/api/v3/stories' -const PATH38 = '/reaction' -const PATH39 = '/api/v3/user' -const PATH40 = '/api/v3/user/profile' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/stream/v1/stories' + const PATH1 = '/api/v1/me' + const PATH2 = '/api/v1/mixes' + const PATH3 = '/cards' + const PATH4 = '/url' + const PATH5 = '/api/v1/parse' + const PATH6 = '/api/v1/parse/image' + const PATH7 = '/api/v1/token' + const PATH8 = '/api/v3/2fa' + const PATH9 = '/api/v3/channels' + const PATH10 = '/chats' + const PATH11 = '/items' + const PATH12 = '/news-feed' + const PATH13 = '/items/audio' + const PATH14 = '/items/image' + const PATH15 = '/items/video' + const PATH16 = '/itemslist' + const PATH17 = '/users' + const PATH18 = '/users/remove' + const PATH19 = '/notifications' + const PATH20 = '/api/v3/chats' + const PATH21 = '/api/v3/chats/keys' + const PATH22 = '/api/v3/extension/audio' + const PATH23 = '/api/v3/extension/image' + const PATH24 = '/api/v3/extension/parse' + const PATH25 = '/api/v3/extension/story' + const PATH26 = '/audio' + const PATH27 = '/image' + const PATH28 = '/video' + const PATH29 = '/api/v3/extension/video' + const PATH30 = '/api/v3/fcm_token' + const PATH31 = '/api/v3/info' + const PATH32 = '/api/v3/login' + const PATH33 = '/api/v3/logout' + const PATH34 = '/api/v3/me' + const PATH35 = '/api/v3/organisation' + const PATH36 = '/api/v3/organisation/users' + const PATH37 = '/api/v3/stories' + const PATH38 = '/reaction' + const PATH39 = '/api/v3/user' + const PATH40 = '/api/v3/user/profile' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { api: { @@ -113,13 +113,17 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option: { query: Methods1['get']['query'], config?: T }) => fetch(prefix, prefix0, GET, option).json(), $get: (option: { query: Methods1['get']['query'], config?: T }) => - fetch(prefix, prefix0, GET, option).json().then(r => r.body) + fetch(prefix, prefix0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } }, @@ -128,7 +132,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, PATH1, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH1, GET, option).json().then(r => r.body) + fetch(prefix, PATH1, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH1}` }, mixes: { _id: (val1: string) => { @@ -138,7 +143,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { body?: Methods4['put']['reqBody'], config?: T }) => fetch(prefix, prefix1, PUT, option).send(), $put: (option?: { body?: Methods4['put']['reqBody'], config?: T }) => - fetch(prefix, prefix1, PUT, option).send().then(r => r.body) + fetch(prefix, prefix1, PUT, option).send().then(r => r.body), + $path: () => `${prefix}${prefix1}` } }, _mixId: (val2: string) => { @@ -149,13 +155,15 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods5['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix2}${PATH3}`, POST, option).send(), $post: (option?: { body?: Methods5['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix2}${PATH3}`, POST, option).send().then(r => r.body) + fetch(prefix, `${prefix2}${PATH3}`, POST, option).send().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH3}` }, url: { post: (option?: { body?: Methods6['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix2}${PATH4}`, POST, option).send(), $post: (option?: { body?: Methods6['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix2}${PATH4}`, POST, option).send().then(r => r.body) + fetch(prefix, `${prefix2}${PATH4}`, POST, option).send().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH4}` } } }, @@ -166,25 +174,29 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods3['post']['reqBody'], config?: T }) => fetch(prefix, PATH2, POST, option).json(), $post: (option?: { body?: Methods3['post']['reqBody'], config?: T }) => - fetch(prefix, PATH2, POST, option).json().then(r => r.body) + fetch(prefix, PATH2, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH2}` }, parse: { image: { post: (option?: { body?: Methods8['post']['reqBody'], config?: T }) => fetch(prefix, PATH6, POST, option, 'FormData').json(), $post: (option?: { body?: Methods8['post']['reqBody'], config?: T }) => - fetch(prefix, PATH6, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH6, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH6}` }, post: (option?: { body?: Methods7['post']['reqBody'], config?: T }) => fetch(prefix, PATH5, POST, option).json(), $post: (option?: { body?: Methods7['post']['reqBody'], config?: T }) => - fetch(prefix, PATH5, POST, option).json().then(r => r.body) + fetch(prefix, PATH5, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH5}` }, token: { post: (option?: { body?: Methods9['post']['reqBody'], config?: T }) => fetch(prefix, PATH7, POST, option).json(), $post: (option?: { body?: Methods9['post']['reqBody'], config?: T }) => - fetch(prefix, PATH7, POST, option).json().then(r => r.body) + fetch(prefix, PATH7, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH7}` } }, v3: { @@ -192,7 +204,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods10['post']['reqBody'], headers?: Methods10['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH8, POST, option).json(), $post: (option: { body: Methods10['post']['reqBody'], headers?: Methods10['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH8, POST, option).json().then(r => r.body) + fetch(prefix, PATH8, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH8}` }, channels: { _channelId_0: (val3: number) => { @@ -212,7 +225,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods12['post']['reqBody'], headers?: Methods12['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix5, POST, option).json(), $post: (option?: { body?: Methods12['post']['reqBody'], headers?: Methods12['post']['reqHeaders'], config?: T }) => - fetch(prefix, prefix5, POST, option).json().then(r => r.body) + fetch(prefix, prefix5, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix5}` } } } @@ -223,7 +237,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { query?: Methods13['get']['query'], headers?: Methods13['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix3}${PATH12}`, GET, option).json(), $get: (option?: { query?: Methods13['get']['query'], headers?: Methods13['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix3}${PATH12}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix3}${PATH12}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods13['get']['query'] }) => + `${prefix}${prefix3}${PATH12}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } }, @@ -241,19 +257,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods18['post']['reqBody'], headers?: Methods18['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH13}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods18['post']['reqBody'], headers?: Methods18['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH13}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix7}${PATH13}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix7}${PATH13}` }, image: { post: (option?: { body?: Methods19['post']['reqBody'], headers?: Methods19['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH14}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods19['post']['reqBody'], headers?: Methods19['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH14}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix7}${PATH14}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix7}${PATH14}` }, video: { post: (option?: { body?: Methods20['post']['reqBody'], headers?: Methods20['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH15}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods20['post']['reqBody'], headers?: Methods20['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH15}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix7}${PATH15}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix7}${PATH15}` }, get: (option?: { query?: Methods17['get']['query'], headers?: Methods17['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH11}`, GET, option).json(), @@ -262,20 +281,25 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods17['post']['reqBody'], headers?: Methods17['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH11}`, POST, option).json(), $post: (option: { body: Methods17['post']['reqBody'], headers?: Methods17['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH11}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix7}${PATH11}`, POST, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods17['get']['query'] }) => + `${prefix}${prefix7}${PATH11}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, itemslist: { get: (option: { query: Methods21['get']['query'], headers?: Methods21['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH16}`, GET, option).json(), $get: (option: { query: Methods21['get']['query'], headers?: Methods21['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH16}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix7}${PATH16}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods21['get']['query'] }) => + `${prefix}${prefix7}${PATH16}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, users: { remove: { post: (option: { body: Methods23['post']['reqBody'], headers?: Methods23['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH18}`, POST, option).send(), $post: (option: { body: Methods23['post']['reqBody'], headers?: Methods23['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH18}`, POST, option).send().then(r => r.body) + fetch(prefix, `${prefix7}${PATH18}`, POST, option).send().then(r => r.body), + $path: () => `${prefix}${prefix7}${PATH18}` }, get: (option?: { headers?: Methods22['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH17}`, GET, option).json(), @@ -288,7 +312,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option: { body: Methods22['put']['reqBody'], headers?: Methods22['put']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH17}`, PUT, option).send(), $put: (option: { body: Methods22['put']['reqBody'], headers?: Methods22['put']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH17}`, PUT, option).send().then(r => r.body) + fetch(prefix, `${prefix7}${PATH17}`, PUT, option).send().then(r => r.body), + $path: () => `${prefix}${prefix7}${PATH17}` }, get: (option?: { headers?: Methods16['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, GET, option).json(), @@ -301,7 +326,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { headers?: Methods16['delete']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, DELETE, option).send(), $delete: (option?: { headers?: Methods16['delete']['reqHeaders'], config?: T }) => - fetch(prefix, prefix7, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix7, DELETE, option).send().then(r => r.body), + $path: () => `${prefix}${prefix7}` } }, get: (option?: { headers?: Methods15['get']['reqHeaders'], config?: T }) => @@ -311,24 +337,31 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods15['post']['reqBody'], headers?: Methods15['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix6}${PATH10}`, POST, option).json(), $post: (option: { body: Methods15['post']['reqBody'], headers?: Methods15['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix6}${PATH10}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix6}${PATH10}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix6}${PATH10}` }, notifications: { get: (option?: { query?: Methods24['get']['query'], headers?: Methods24['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix6}${PATH19}`, GET, option).json(), $get: (option?: { query?: Methods24['get']['query'], headers?: Methods24['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix6}${PATH19}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix6}${PATH19}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods24['get']['query'] }) => + `${prefix}${prefix6}${PATH19}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, get: (option?: { query?: Methods14['get']['query'], headers?: Methods14['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix6, GET, option).send(), $get: (option?: { query?: Methods14['get']['query'], headers?: Methods14['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix6, GET, option).send().then(r => r.body) + fetch(prefix, prefix6, GET, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods14['get']['query'] }) => + `${prefix}${prefix6}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option?: { query?: Methods11['get']['query'], headers?: Methods11['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH9, GET, option).json(), $get: (option?: { query?: Methods11['get']['query'], headers?: Methods11['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH9, GET, option).json().then(r => r.body) + fetch(prefix, PATH9, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods11['get']['query'] }) => + `${prefix}${PATH9}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, chats: { _chatId_0: (val8: number) => { @@ -347,7 +380,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { headers?: Methods25['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix9, GET, option).json(), $get: (option?: { headers?: Methods25['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix9, GET, option).json().then(r => r.body) + fetch(prefix, prefix9, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix9}` } } } @@ -362,19 +396,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods27['post']['reqBody'], headers?: Methods27['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH13}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods27['post']['reqBody'], headers?: Methods27['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix10}${PATH13}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix10}${PATH13}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix10}${PATH13}` }, image: { post: (option?: { body?: Methods28['post']['reqBody'], headers?: Methods28['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH14}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods28['post']['reqBody'], headers?: Methods28['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix10}${PATH14}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix10}${PATH14}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix10}${PATH14}` }, video: { post: (option?: { body?: Methods29['post']['reqBody'], headers?: Methods29['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH15}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods29['post']['reqBody'], headers?: Methods29['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix10}${PATH15}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix10}${PATH15}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix10}${PATH15}` }, get: (option?: { query?: Methods26['get']['query'], headers?: Methods26['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH11}`, GET, option).json(), @@ -383,7 +420,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods26['post']['reqBody'], headers?: Methods26['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH11}`, POST, option).json(), $post: (option: { body: Methods26['post']['reqBody'], headers?: Methods26['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix10}${PATH11}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix10}${PATH11}`, POST, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods26['get']['query'] }) => + `${prefix}${prefix10}${PATH11}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } }, @@ -391,7 +430,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { headers?: Methods30['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH21, GET, option).json(), $get: (option?: { headers?: Methods30['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH21, GET, option).json().then(r => r.body) + fetch(prefix, PATH21, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH21}` } }, extension: { @@ -399,19 +439,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods31['post']['reqBody'], headers?: Methods31['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH22, POST, option, 'FormData').json(), $post: (option?: { body?: Methods31['post']['reqBody'], headers?: Methods31['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH22, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH22, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH22}` }, image: { post: (option?: { body?: Methods32['post']['reqBody'], headers?: Methods32['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH23, POST, option, 'FormData').json(), $post: (option?: { body?: Methods32['post']['reqBody'], headers?: Methods32['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH23, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH23, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH23}` }, parse: { post: (option: { body: Methods33['post']['reqBody'], headers?: Methods33['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH24, POST, option).json(), $post: (option: { body: Methods33['post']['reqBody'], headers?: Methods33['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH24, POST, option).json().then(r => r.body) + fetch(prefix, PATH24, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH24}` }, story: { _storyId: (val11: string) => { @@ -422,24 +465,28 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods35['post']['reqBody'], headers?: Methods35['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix11}${PATH26}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods35['post']['reqBody'], headers?: Methods35['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix11}${PATH26}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix11}${PATH26}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix11}${PATH26}` }, image: { post: (option?: { body?: Methods36['post']['reqBody'], headers?: Methods36['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix11}${PATH27}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods36['post']['reqBody'], headers?: Methods36['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix11}${PATH27}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix11}${PATH27}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix11}${PATH27}` }, video: { post: (option?: { body?: Methods37['post']['reqBody'], headers?: Methods37['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix11}${PATH28}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods37['post']['reqBody'], headers?: Methods37['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix11}${PATH28}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix11}${PATH28}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix11}${PATH28}` }, post: (option: { body: Methods34['post']['reqBody'], headers?: Methods34['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix11, POST, option, 'FormData').json(), $post: (option: { body: Methods34['post']['reqBody'], headers?: Methods34['post']['reqHeaders'], config?: T }) => - fetch(prefix, prefix11, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, prefix11, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix11}` } } }, @@ -447,50 +494,59 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods38['post']['reqBody'], headers?: Methods38['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH29, POST, option, 'FormData').json(), $post: (option?: { body?: Methods38['post']['reqBody'], headers?: Methods38['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH29, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH29, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH29}` } }, fcm_token: { post: (option: { body: Methods39['post']['reqBody'], headers?: Methods39['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH30, POST, option).send(), $post: (option: { body: Methods39['post']['reqBody'], headers?: Methods39['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH30, POST, option).send().then(r => r.body) + fetch(prefix, PATH30, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH30}` }, info: { get: (option?: { headers?: Methods40['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH31, GET, option).json(), $get: (option?: { headers?: Methods40['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH31, GET, option).json().then(r => r.body) + fetch(prefix, PATH31, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH31}` }, login: { post: (option: { body: Methods41['post']['reqBody'], headers?: Methods41['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH32, POST, option).json(), $post: (option: { body: Methods41['post']['reqBody'], headers?: Methods41['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH32, POST, option).json().then(r => r.body) + fetch(prefix, PATH32, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH32}` }, logout: { post: (option: { body: Methods42['post']['reqBody'], headers?: Methods42['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH33, POST, option).send(), $post: (option: { body: Methods42['post']['reqBody'], headers?: Methods42['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH33, POST, option).send().then(r => r.body) + fetch(prefix, PATH33, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH33}` }, me: { get: (option?: { headers?: Methods43['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH34, GET, option).json(), $get: (option?: { headers?: Methods43['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH34, GET, option).json().then(r => r.body) + fetch(prefix, PATH34, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH34}` }, organisation: { users: { get: (option: { query: Methods45['get']['query'], headers?: Methods45['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH36, GET, option).json(), $get: (option: { query: Methods45['get']['query'], headers?: Methods45['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH36, GET, option).json().then(r => r.body) + fetch(prefix, PATH36, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods45['get']['query'] }) => + `${prefix}${PATH36}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, get: (option?: { headers?: Methods44['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH35, GET, option).json(), $get: (option?: { headers?: Methods44['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH35, GET, option).json().then(r => r.body) + fetch(prefix, PATH35, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH35}` }, stories: { _storyId: (val12: number) => { @@ -506,18 +562,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods48['post']['reqBody'], headers?: Methods48['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix13}${PATH38}`, POST, option).json(), $post: (option: { body: Methods48['post']['reqBody'], headers?: Methods48['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix13}${PATH38}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix13}${PATH38}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix13}${PATH38}` }, get: (option?: { headers?: Methods47['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix13, GET, option).json(), $get: (option?: { headers?: Methods47['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix13, GET, option).json().then(r => r.body) + fetch(prefix, prefix13, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix13}` } }, get: (option?: { query?: Methods46['get']['query'], headers?: Methods46['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix12}${PATH11}`, GET, option).json(), $get: (option?: { query?: Methods46['get']['query'], headers?: Methods46['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix12}${PATH11}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix12}${PATH11}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods46['get']['query'] }) => + `${prefix}${prefix12}${PATH11}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } @@ -530,19 +590,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { headers?: Methods50['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix14, GET, option).json(), $get: (option?: { headers?: Methods50['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix14, GET, option).json().then(r => r.body) + fetch(prefix, prefix14, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix14}` } }, profile: { put: (option?: { body?: Methods51['put']['reqBody'], headers?: Methods51['put']['reqHeaders'], config?: T }) => fetch(prefix, PATH40, PUT, option, 'FormData').send(), $put: (option?: { body?: Methods51['put']['reqBody'], headers?: Methods51['put']['reqHeaders'], config?: T }) => - fetch(prefix, PATH40, PUT, option, 'FormData').send().then(r => r.body) + fetch(prefix, PATH40, PUT, option, 'FormData').send().then(r => r.body), + $path: () => `${prefix}${PATH40}` }, get: (option?: { headers?: Methods49['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH39, GET, option).json(), $get: (option?: { headers?: Methods49['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH39, GET, option).json().then(r => r.body) + fetch(prefix, PATH39, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH39}` } } } diff --git a/samples/openapi/api/$api.ts b/samples/openapi/api/$api.ts index 2bf68bfd..52fca011 100644 --- a/samples/openapi/api/$api.ts +++ b/samples/openapi/api/$api.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './stream/v1/stories' import { Methods as Methods1 } from './stream/v1/stories/_storyId@number' import { Methods as Methods2 } from './v1/me' @@ -53,53 +53,53 @@ import { Methods as Methods49 } from './v3/user' import { Methods as Methods50 } from './v3/user/_userId@string' import { Methods as Methods51 } from './v3/user/profile' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/stream/v1/stories' -const PATH1 = '/api/v1/me' -const PATH2 = '/api/v1/mixes' -const PATH3 = '/cards' -const PATH4 = '/url' -const PATH5 = '/api/v1/parse' -const PATH6 = '/api/v1/parse/image' -const PATH7 = '/api/v1/token' -const PATH8 = '/api/v3/2fa' -const PATH9 = '/api/v3/channels' -const PATH10 = '/chats' -const PATH11 = '/items' -const PATH12 = '/news-feed' -const PATH13 = '/items/audio' -const PATH14 = '/items/image' -const PATH15 = '/items/video' -const PATH16 = '/itemslist' -const PATH17 = '/users' -const PATH18 = '/users/remove' -const PATH19 = '/notifications' -const PATH20 = '/api/v3/chats' -const PATH21 = '/api/v3/chats/keys' -const PATH22 = '/api/v3/extension/audio' -const PATH23 = '/api/v3/extension/image' -const PATH24 = '/api/v3/extension/parse' -const PATH25 = '/api/v3/extension/story' -const PATH26 = '/audio' -const PATH27 = '/image' -const PATH28 = '/video' -const PATH29 = '/api/v3/extension/video' -const PATH30 = '/api/v3/fcm_token' -const PATH31 = '/api/v3/info' -const PATH32 = '/api/v3/login' -const PATH33 = '/api/v3/logout' -const PATH34 = '/api/v3/me' -const PATH35 = '/api/v3/organisation' -const PATH36 = '/api/v3/organisation/users' -const PATH37 = '/api/v3/stories' -const PATH38 = '/reaction' -const PATH39 = '/api/v3/user' -const PATH40 = '/api/v3/user/profile' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/stream/v1/stories' + const PATH1 = '/api/v1/me' + const PATH2 = '/api/v1/mixes' + const PATH3 = '/cards' + const PATH4 = '/url' + const PATH5 = '/api/v1/parse' + const PATH6 = '/api/v1/parse/image' + const PATH7 = '/api/v1/token' + const PATH8 = '/api/v3/2fa' + const PATH9 = '/api/v3/channels' + const PATH10 = '/chats' + const PATH11 = '/items' + const PATH12 = '/news-feed' + const PATH13 = '/items/audio' + const PATH14 = '/items/image' + const PATH15 = '/items/video' + const PATH16 = '/itemslist' + const PATH17 = '/users' + const PATH18 = '/users/remove' + const PATH19 = '/notifications' + const PATH20 = '/api/v3/chats' + const PATH21 = '/api/v3/chats/keys' + const PATH22 = '/api/v3/extension/audio' + const PATH23 = '/api/v3/extension/image' + const PATH24 = '/api/v3/extension/parse' + const PATH25 = '/api/v3/extension/story' + const PATH26 = '/audio' + const PATH27 = '/image' + const PATH28 = '/video' + const PATH29 = '/api/v3/extension/video' + const PATH30 = '/api/v3/fcm_token' + const PATH31 = '/api/v3/info' + const PATH32 = '/api/v3/login' + const PATH33 = '/api/v3/logout' + const PATH34 = '/api/v3/me' + const PATH35 = '/api/v3/organisation' + const PATH36 = '/api/v3/organisation/users' + const PATH37 = '/api/v3/stories' + const PATH38 = '/reaction' + const PATH39 = '/api/v3/user' + const PATH40 = '/api/v3/user/profile' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { stream: { @@ -112,13 +112,17 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option: { query: Methods1['get']['query'], config?: T }) => fetch(prefix, prefix0, GET, option).json(), $get: (option: { query: Methods1['get']['query'], config?: T }) => - fetch(prefix, prefix0, GET, option).json().then(r => r.body) + fetch(prefix, prefix0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } }, @@ -127,7 +131,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, PATH1, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH1, GET, option).json().then(r => r.body) + fetch(prefix, PATH1, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH1}` }, mixes: { _id: (val1: string) => { @@ -137,7 +142,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { body?: Methods4['put']['reqBody'], config?: T }) => fetch(prefix, prefix1, PUT, option).send(), $put: (option?: { body?: Methods4['put']['reqBody'], config?: T }) => - fetch(prefix, prefix1, PUT, option).send().then(r => r.body) + fetch(prefix, prefix1, PUT, option).send().then(r => r.body), + $path: () => `${prefix}${prefix1}` } }, _mixId: (val2: string) => { @@ -148,13 +154,15 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods5['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix2}${PATH3}`, POST, option).send(), $post: (option?: { body?: Methods5['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix2}${PATH3}`, POST, option).send().then(r => r.body) + fetch(prefix, `${prefix2}${PATH3}`, POST, option).send().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH3}` }, url: { post: (option?: { body?: Methods6['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix2}${PATH4}`, POST, option).send(), $post: (option?: { body?: Methods6['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix2}${PATH4}`, POST, option).send().then(r => r.body) + fetch(prefix, `${prefix2}${PATH4}`, POST, option).send().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH4}` } } }, @@ -165,25 +173,29 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods3['post']['reqBody'], config?: T }) => fetch(prefix, PATH2, POST, option).json(), $post: (option?: { body?: Methods3['post']['reqBody'], config?: T }) => - fetch(prefix, PATH2, POST, option).json().then(r => r.body) + fetch(prefix, PATH2, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH2}` }, parse: { image: { post: (option?: { body?: Methods8['post']['reqBody'], config?: T }) => fetch(prefix, PATH6, POST, option, 'FormData').json(), $post: (option?: { body?: Methods8['post']['reqBody'], config?: T }) => - fetch(prefix, PATH6, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH6, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH6}` }, post: (option?: { body?: Methods7['post']['reqBody'], config?: T }) => fetch(prefix, PATH5, POST, option).json(), $post: (option?: { body?: Methods7['post']['reqBody'], config?: T }) => - fetch(prefix, PATH5, POST, option).json().then(r => r.body) + fetch(prefix, PATH5, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH5}` }, token: { post: (option?: { body?: Methods9['post']['reqBody'], config?: T }) => fetch(prefix, PATH7, POST, option).json(), $post: (option?: { body?: Methods9['post']['reqBody'], config?: T }) => - fetch(prefix, PATH7, POST, option).json().then(r => r.body) + fetch(prefix, PATH7, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH7}` } }, v3: { @@ -191,7 +203,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods10['post']['reqBody'], headers?: Methods10['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH8, POST, option).json(), $post: (option: { body: Methods10['post']['reqBody'], headers?: Methods10['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH8, POST, option).json().then(r => r.body) + fetch(prefix, PATH8, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH8}` }, channels: { _channelId_0: (val3: number) => { @@ -211,7 +224,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods12['post']['reqBody'], headers?: Methods12['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix5, POST, option).json(), $post: (option?: { body?: Methods12['post']['reqBody'], headers?: Methods12['post']['reqHeaders'], config?: T }) => - fetch(prefix, prefix5, POST, option).json().then(r => r.body) + fetch(prefix, prefix5, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix5}` } } } @@ -222,7 +236,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { query?: Methods13['get']['query'], headers?: Methods13['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix3}${PATH12}`, GET, option).json(), $get: (option?: { query?: Methods13['get']['query'], headers?: Methods13['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix3}${PATH12}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix3}${PATH12}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods13['get']['query'] }) => + `${prefix}${prefix3}${PATH12}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } }, @@ -240,19 +256,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods18['post']['reqBody'], headers?: Methods18['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH13}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods18['post']['reqBody'], headers?: Methods18['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH13}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix7}${PATH13}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix7}${PATH13}` }, image: { post: (option?: { body?: Methods19['post']['reqBody'], headers?: Methods19['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH14}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods19['post']['reqBody'], headers?: Methods19['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH14}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix7}${PATH14}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix7}${PATH14}` }, video: { post: (option?: { body?: Methods20['post']['reqBody'], headers?: Methods20['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH15}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods20['post']['reqBody'], headers?: Methods20['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH15}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix7}${PATH15}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix7}${PATH15}` }, get: (option?: { query?: Methods17['get']['query'], headers?: Methods17['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH11}`, GET, option).json(), @@ -261,20 +280,25 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods17['post']['reqBody'], headers?: Methods17['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH11}`, POST, option).json(), $post: (option: { body: Methods17['post']['reqBody'], headers?: Methods17['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH11}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix7}${PATH11}`, POST, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods17['get']['query'] }) => + `${prefix}${prefix7}${PATH11}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, itemslist: { get: (option: { query: Methods21['get']['query'], headers?: Methods21['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH16}`, GET, option).json(), $get: (option: { query: Methods21['get']['query'], headers?: Methods21['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH16}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix7}${PATH16}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods21['get']['query'] }) => + `${prefix}${prefix7}${PATH16}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, users: { remove: { post: (option: { body: Methods23['post']['reqBody'], headers?: Methods23['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH18}`, POST, option).send(), $post: (option: { body: Methods23['post']['reqBody'], headers?: Methods23['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH18}`, POST, option).send().then(r => r.body) + fetch(prefix, `${prefix7}${PATH18}`, POST, option).send().then(r => r.body), + $path: () => `${prefix}${prefix7}${PATH18}` }, get: (option?: { headers?: Methods22['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH17}`, GET, option).json(), @@ -287,7 +311,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option: { body: Methods22['put']['reqBody'], headers?: Methods22['put']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH17}`, PUT, option).send(), $put: (option: { body: Methods22['put']['reqBody'], headers?: Methods22['put']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH17}`, PUT, option).send().then(r => r.body) + fetch(prefix, `${prefix7}${PATH17}`, PUT, option).send().then(r => r.body), + $path: () => `${prefix}${prefix7}${PATH17}` }, get: (option?: { headers?: Methods16['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, GET, option).json(), @@ -300,7 +325,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { headers?: Methods16['delete']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, DELETE, option).send(), $delete: (option?: { headers?: Methods16['delete']['reqHeaders'], config?: T }) => - fetch(prefix, prefix7, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix7, DELETE, option).send().then(r => r.body), + $path: () => `${prefix}${prefix7}` } }, get: (option?: { headers?: Methods15['get']['reqHeaders'], config?: T }) => @@ -310,24 +336,31 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods15['post']['reqBody'], headers?: Methods15['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix6}${PATH10}`, POST, option).json(), $post: (option: { body: Methods15['post']['reqBody'], headers?: Methods15['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix6}${PATH10}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix6}${PATH10}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix6}${PATH10}` }, notifications: { get: (option?: { query?: Methods24['get']['query'], headers?: Methods24['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix6}${PATH19}`, GET, option).json(), $get: (option?: { query?: Methods24['get']['query'], headers?: Methods24['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix6}${PATH19}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix6}${PATH19}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods24['get']['query'] }) => + `${prefix}${prefix6}${PATH19}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, get: (option?: { query?: Methods14['get']['query'], headers?: Methods14['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix6, GET, option).send(), $get: (option?: { query?: Methods14['get']['query'], headers?: Methods14['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix6, GET, option).send().then(r => r.body) + fetch(prefix, prefix6, GET, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods14['get']['query'] }) => + `${prefix}${prefix6}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option?: { query?: Methods11['get']['query'], headers?: Methods11['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH9, GET, option).json(), $get: (option?: { query?: Methods11['get']['query'], headers?: Methods11['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH9, GET, option).json().then(r => r.body) + fetch(prefix, PATH9, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods11['get']['query'] }) => + `${prefix}${PATH9}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, chats: { _chatId_0: (val8: number) => { @@ -346,7 +379,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { headers?: Methods25['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix9, GET, option).json(), $get: (option?: { headers?: Methods25['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix9, GET, option).json().then(r => r.body) + fetch(prefix, prefix9, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix9}` } } } @@ -361,19 +395,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods27['post']['reqBody'], headers?: Methods27['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH13}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods27['post']['reqBody'], headers?: Methods27['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix10}${PATH13}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix10}${PATH13}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix10}${PATH13}` }, image: { post: (option?: { body?: Methods28['post']['reqBody'], headers?: Methods28['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH14}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods28['post']['reqBody'], headers?: Methods28['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix10}${PATH14}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix10}${PATH14}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix10}${PATH14}` }, video: { post: (option?: { body?: Methods29['post']['reqBody'], headers?: Methods29['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH15}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods29['post']['reqBody'], headers?: Methods29['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix10}${PATH15}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix10}${PATH15}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix10}${PATH15}` }, get: (option?: { query?: Methods26['get']['query'], headers?: Methods26['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH11}`, GET, option).json(), @@ -382,7 +419,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods26['post']['reqBody'], headers?: Methods26['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH11}`, POST, option).json(), $post: (option: { body: Methods26['post']['reqBody'], headers?: Methods26['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix10}${PATH11}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix10}${PATH11}`, POST, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods26['get']['query'] }) => + `${prefix}${prefix10}${PATH11}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } }, @@ -390,7 +429,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { headers?: Methods30['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH21, GET, option).json(), $get: (option?: { headers?: Methods30['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH21, GET, option).json().then(r => r.body) + fetch(prefix, PATH21, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH21}` } }, extension: { @@ -398,19 +438,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods31['post']['reqBody'], headers?: Methods31['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH22, POST, option, 'FormData').json(), $post: (option?: { body?: Methods31['post']['reqBody'], headers?: Methods31['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH22, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH22, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH22}` }, image: { post: (option?: { body?: Methods32['post']['reqBody'], headers?: Methods32['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH23, POST, option, 'FormData').json(), $post: (option?: { body?: Methods32['post']['reqBody'], headers?: Methods32['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH23, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH23, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH23}` }, parse: { post: (option: { body: Methods33['post']['reqBody'], headers?: Methods33['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH24, POST, option).json(), $post: (option: { body: Methods33['post']['reqBody'], headers?: Methods33['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH24, POST, option).json().then(r => r.body) + fetch(prefix, PATH24, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH24}` }, story: { _storyId: (val11: string) => { @@ -421,24 +464,28 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods35['post']['reqBody'], headers?: Methods35['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix11}${PATH26}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods35['post']['reqBody'], headers?: Methods35['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix11}${PATH26}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix11}${PATH26}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix11}${PATH26}` }, image: { post: (option?: { body?: Methods36['post']['reqBody'], headers?: Methods36['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix11}${PATH27}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods36['post']['reqBody'], headers?: Methods36['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix11}${PATH27}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix11}${PATH27}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix11}${PATH27}` }, video: { post: (option?: { body?: Methods37['post']['reqBody'], headers?: Methods37['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix11}${PATH28}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods37['post']['reqBody'], headers?: Methods37['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix11}${PATH28}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix11}${PATH28}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix11}${PATH28}` }, post: (option: { body: Methods34['post']['reqBody'], headers?: Methods34['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix11, POST, option, 'FormData').json(), $post: (option: { body: Methods34['post']['reqBody'], headers?: Methods34['post']['reqHeaders'], config?: T }) => - fetch(prefix, prefix11, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, prefix11, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix11}` } } }, @@ -446,50 +493,59 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods38['post']['reqBody'], headers?: Methods38['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH29, POST, option, 'FormData').json(), $post: (option?: { body?: Methods38['post']['reqBody'], headers?: Methods38['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH29, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH29, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH29}` } }, fcm_token: { post: (option: { body: Methods39['post']['reqBody'], headers?: Methods39['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH30, POST, option).send(), $post: (option: { body: Methods39['post']['reqBody'], headers?: Methods39['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH30, POST, option).send().then(r => r.body) + fetch(prefix, PATH30, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH30}` }, info: { get: (option?: { headers?: Methods40['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH31, GET, option).json(), $get: (option?: { headers?: Methods40['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH31, GET, option).json().then(r => r.body) + fetch(prefix, PATH31, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH31}` }, login: { post: (option: { body: Methods41['post']['reqBody'], headers?: Methods41['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH32, POST, option).json(), $post: (option: { body: Methods41['post']['reqBody'], headers?: Methods41['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH32, POST, option).json().then(r => r.body) + fetch(prefix, PATH32, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH32}` }, logout: { post: (option: { body: Methods42['post']['reqBody'], headers?: Methods42['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH33, POST, option).send(), $post: (option: { body: Methods42['post']['reqBody'], headers?: Methods42['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH33, POST, option).send().then(r => r.body) + fetch(prefix, PATH33, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH33}` }, me: { get: (option?: { headers?: Methods43['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH34, GET, option).json(), $get: (option?: { headers?: Methods43['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH34, GET, option).json().then(r => r.body) + fetch(prefix, PATH34, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH34}` }, organisation: { users: { get: (option: { query: Methods45['get']['query'], headers?: Methods45['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH36, GET, option).json(), $get: (option: { query: Methods45['get']['query'], headers?: Methods45['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH36, GET, option).json().then(r => r.body) + fetch(prefix, PATH36, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods45['get']['query'] }) => + `${prefix}${PATH36}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, get: (option?: { headers?: Methods44['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH35, GET, option).json(), $get: (option?: { headers?: Methods44['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH35, GET, option).json().then(r => r.body) + fetch(prefix, PATH35, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH35}` }, stories: { _storyId: (val12: number) => { @@ -505,18 +561,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods48['post']['reqBody'], headers?: Methods48['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix13}${PATH38}`, POST, option).json(), $post: (option: { body: Methods48['post']['reqBody'], headers?: Methods48['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix13}${PATH38}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix13}${PATH38}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix13}${PATH38}` }, get: (option?: { headers?: Methods47['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix13, GET, option).json(), $get: (option?: { headers?: Methods47['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix13, GET, option).json().then(r => r.body) + fetch(prefix, prefix13, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix13}` } }, get: (option?: { query?: Methods46['get']['query'], headers?: Methods46['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix12}${PATH11}`, GET, option).json(), $get: (option?: { query?: Methods46['get']['query'], headers?: Methods46['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix12}${PATH11}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix12}${PATH11}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods46['get']['query'] }) => + `${prefix}${prefix12}${PATH11}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } @@ -529,19 +589,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { headers?: Methods50['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix14, GET, option).json(), $get: (option?: { headers?: Methods50['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix14, GET, option).json().then(r => r.body) + fetch(prefix, prefix14, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix14}` } }, profile: { put: (option?: { body?: Methods51['put']['reqBody'], headers?: Methods51['put']['reqHeaders'], config?: T }) => fetch(prefix, PATH40, PUT, option, 'FormData').send(), $put: (option?: { body?: Methods51['put']['reqBody'], headers?: Methods51['put']['reqHeaders'], config?: T }) => - fetch(prefix, PATH40, PUT, option, 'FormData').send().then(r => r.body) + fetch(prefix, PATH40, PUT, option, 'FormData').send().then(r => r.body), + $path: () => `${prefix}${PATH40}` }, get: (option?: { headers?: Methods49['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH39, GET, option).json(), $get: (option?: { headers?: Methods49['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH39, GET, option).json().then(r => r.body) + fetch(prefix, PATH39, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH39}` } } } diff --git a/samples/openapi/api/stream/$api.ts b/samples/openapi/api/stream/$api.ts index 1b28a67a..7bfbe8ff 100644 --- a/samples/openapi/api/stream/$api.ts +++ b/samples/openapi/api/stream/$api.ts @@ -1,12 +1,12 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './v1/stories' import { Methods as Methods1 } from './v1/stories/_storyId@number' -const GET = 'GET' -const PATH0 = '/api/stream/v1/stories' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/stream/v1/stories' + const GET = 'GET' return { v1: { @@ -18,13 +18,17 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option: { query: Methods1['get']['query'], config?: T }) => fetch(prefix, prefix0, GET, option).json(), $get: (option: { query: Methods1['get']['query'], config?: T }) => - fetch(prefix, prefix0, GET, option).json().then(r => r.body) + fetch(prefix, prefix0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } diff --git a/samples/openapi/api/stream/v1/$api.ts b/samples/openapi/api/stream/v1/$api.ts index 3351f64a..13766fdb 100644 --- a/samples/openapi/api/stream/v1/$api.ts +++ b/samples/openapi/api/stream/v1/$api.ts @@ -1,12 +1,12 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './stories' import { Methods as Methods1 } from './stories/_storyId@number' -const GET = 'GET' -const PATH0 = '/api/stream/v1/stories' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/stream/v1/stories' + const GET = 'GET' return { stories: { @@ -17,13 +17,17 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option: { query: Methods1['get']['query'], config?: T }) => fetch(prefix, prefix0, GET, option).json(), $get: (option: { query: Methods1['get']['query'], config?: T }) => - fetch(prefix, prefix0, GET, option).json().then(r => r.body) + fetch(prefix, prefix0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } diff --git a/samples/openapi/api/stream/v1/stories/$api.ts b/samples/openapi/api/stream/v1/stories/$api.ts index e1fd0e87..5980b4d2 100644 --- a/samples/openapi/api/stream/v1/stories/$api.ts +++ b/samples/openapi/api/stream/v1/stories/$api.ts @@ -1,12 +1,12 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_storyId@number' -const GET = 'GET' -const PATH0 = '/api/stream/v1/stories' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/stream/v1/stories' + const GET = 'GET' return { _storyId: (val0: number) => { @@ -16,13 +16,17 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option: { query: Methods1['get']['query'], config?: T }) => fetch(prefix, prefix0, GET, option).json(), $get: (option: { query: Methods1['get']['query'], config?: T }) => - fetch(prefix, prefix0, GET, option).json().then(r => r.body) + fetch(prefix, prefix0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/openapi/api/v1/$api.ts b/samples/openapi/api/v1/$api.ts index 432a037d..bf160393 100644 --- a/samples/openapi/api/v1/$api.ts +++ b/samples/openapi/api/v1/$api.ts @@ -9,25 +9,26 @@ import { Methods as Methods5 } from './parse' import { Methods as Methods6 } from './parse/image' import { Methods as Methods7 } from './token' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const PATH0 = '/api/v1/me' -const PATH1 = '/api/v1/mixes' -const PATH2 = '/cards' -const PATH3 = '/url' -const PATH4 = '/api/v1/parse' -const PATH5 = '/api/v1/parse/image' -const PATH6 = '/api/v1/token' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v1/me' + const PATH1 = '/api/v1/mixes' + const PATH2 = '/cards' + const PATH3 = '/url' + const PATH4 = '/api/v1/parse' + const PATH5 = '/api/v1/parse/image' + const PATH6 = '/api/v1/token' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' return { me: { get: (option?: { config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` }, mixes: { _id: (val0: string) => { @@ -37,7 +38,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { body?: Methods2['put']['reqBody'], config?: T }) => fetch(prefix, prefix0, PUT, option).send(), $put: (option?: { body?: Methods2['put']['reqBody'], config?: T }) => - fetch(prefix, prefix0, PUT, option).send().then(r => r.body) + fetch(prefix, prefix0, PUT, option).send().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, _mixId: (val1: string) => { @@ -48,13 +50,15 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods3['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix1}${PATH2}`, POST, option).send(), $post: (option?: { body?: Methods3['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix1}${PATH2}`, POST, option).send().then(r => r.body) + fetch(prefix, `${prefix1}${PATH2}`, POST, option).send().then(r => r.body), + $path: () => `${prefix}${prefix1}${PATH2}` }, url: { post: (option?: { body?: Methods4['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix1}${PATH3}`, POST, option).send(), $post: (option?: { body?: Methods4['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix1}${PATH3}`, POST, option).send().then(r => r.body) + fetch(prefix, `${prefix1}${PATH3}`, POST, option).send().then(r => r.body), + $path: () => `${prefix}${prefix1}${PATH3}` } } }, @@ -65,25 +69,29 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods1['post']['reqBody'], config?: T }) => fetch(prefix, PATH1, POST, option).json(), $post: (option?: { body?: Methods1['post']['reqBody'], config?: T }) => - fetch(prefix, PATH1, POST, option).json().then(r => r.body) + fetch(prefix, PATH1, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH1}` }, parse: { image: { post: (option?: { body?: Methods6['post']['reqBody'], config?: T }) => fetch(prefix, PATH5, POST, option, 'FormData').json(), $post: (option?: { body?: Methods6['post']['reqBody'], config?: T }) => - fetch(prefix, PATH5, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH5, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH5}` }, post: (option?: { body?: Methods5['post']['reqBody'], config?: T }) => fetch(prefix, PATH4, POST, option).json(), $post: (option?: { body?: Methods5['post']['reqBody'], config?: T }) => - fetch(prefix, PATH4, POST, option).json().then(r => r.body) + fetch(prefix, PATH4, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH4}` }, token: { post: (option?: { body?: Methods7['post']['reqBody'], config?: T }) => fetch(prefix, PATH6, POST, option).json(), $post: (option?: { body?: Methods7['post']['reqBody'], config?: T }) => - fetch(prefix, PATH6, POST, option).json().then(r => r.body) + fetch(prefix, PATH6, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH6}` } } } diff --git a/samples/openapi/api/v1/me/$api.ts b/samples/openapi/api/v1/me/$api.ts index 382c47b1..b2a64005 100644 --- a/samples/openapi/api/v1/me/$api.ts +++ b/samples/openapi/api/v1/me/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/api/v1/me' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v1/me' + const GET = 'GET' return { get: (option?: { config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v1/mixes/$api.ts b/samples/openapi/api/v1/mixes/$api.ts index 655b2663..a2522961 100644 --- a/samples/openapi/api/v1/mixes/$api.ts +++ b/samples/openapi/api/v1/mixes/$api.ts @@ -5,14 +5,14 @@ import { Methods as Methods1 } from './_id@string' import { Methods as Methods2 } from './_mixId@string/cards' import { Methods as Methods3 } from './_mixId@string/url' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const PATH0 = '/api/v1/mixes' -const PATH1 = '/cards' -const PATH2 = '/url' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v1/mixes' + const PATH1 = '/cards' + const PATH2 = '/url' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' return { _id: (val0: string) => { @@ -22,7 +22,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { body?: Methods1['put']['reqBody'], config?: T }) => fetch(prefix, prefix0, PUT, option).send(), $put: (option?: { body?: Methods1['put']['reqBody'], config?: T }) => - fetch(prefix, prefix0, PUT, option).send().then(r => r.body) + fetch(prefix, prefix0, PUT, option).send().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, _mixId: (val1: string) => { @@ -33,13 +34,15 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods2['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix1}${PATH1}`, POST, option).send(), $post: (option?: { body?: Methods2['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix1}${PATH1}`, POST, option).send().then(r => r.body) + fetch(prefix, `${prefix1}${PATH1}`, POST, option).send().then(r => r.body), + $path: () => `${prefix}${prefix1}${PATH1}` }, url: { post: (option?: { body?: Methods3['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix1}${PATH2}`, POST, option).send(), $post: (option?: { body?: Methods3['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix1}${PATH2}`, POST, option).send().then(r => r.body) + fetch(prefix, `${prefix1}${PATH2}`, POST, option).send().then(r => r.body), + $path: () => `${prefix}${prefix1}${PATH2}` } } }, @@ -50,7 +53,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v1/parse/$api.ts b/samples/openapi/api/v1/parse/$api.ts index e1163dbd..53bc276d 100644 --- a/samples/openapi/api/v1/parse/$api.ts +++ b/samples/openapi/api/v1/parse/$api.ts @@ -3,23 +3,25 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './image' -const POST = 'POST' -const PATH0 = '/api/v1/parse' -const PATH1 = '/api/v1/parse/image' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v1/parse' + const PATH1 = '/api/v1/parse/image' + const POST = 'POST' return { image: { post: (option?: { body?: Methods1['post']['reqBody'], config?: T }) => fetch(prefix, PATH1, POST, option, 'FormData').json(), $post: (option?: { body?: Methods1['post']['reqBody'], config?: T }) => - fetch(prefix, PATH1, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH1, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH1}` }, post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v1/parse/image/$api.ts b/samples/openapi/api/v1/parse/image/$api.ts index 1cd08bbb..40f9107c 100644 --- a/samples/openapi/api/v1/parse/image/$api.ts +++ b/samples/openapi/api/v1/parse/image/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/api/v1/parse/image' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v1/parse/image' + const POST = 'POST' return { post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option, 'FormData').json(), $post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v1/token/$api.ts b/samples/openapi/api/v1/token/$api.ts index 57289b68..689b2d11 100644 --- a/samples/openapi/api/v1/token/$api.ts +++ b/samples/openapi/api/v1/token/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/api/v1/token' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v1/token' + const POST = 'POST' return { post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option?: { body?: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v3/$api.ts b/samples/openapi/api/v3/$api.ts index b3d61755..e7c721c5 100644 --- a/samples/openapi/api/v3/$api.ts +++ b/samples/openapi/api/v3/$api.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './2fa' import { Methods as Methods1 } from './channels' import { Methods as Methods2 } from './channels/_channelId@number/chats/_chatId@number/items/_itemId@number' @@ -43,52 +43,53 @@ import { Methods as Methods39 } from './user' import { Methods as Methods40 } from './user/_userId@string' import { Methods as Methods41 } from './user/profile' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/v3/2fa' -const PATH1 = '/api/v3/channels' -const PATH2 = '/chats' -const PATH3 = '/items' -const PATH4 = '/news-feed' -const PATH5 = '/items/audio' -const PATH6 = '/items/image' -const PATH7 = '/items/video' -const PATH8 = '/itemslist' -const PATH9 = '/users' -const PATH10 = '/users/remove' -const PATH11 = '/notifications' -const PATH12 = '/api/v3/chats' -const PATH13 = '/api/v3/chats/keys' -const PATH14 = '/api/v3/extension/audio' -const PATH15 = '/api/v3/extension/image' -const PATH16 = '/api/v3/extension/parse' -const PATH17 = '/api/v3/extension/story' -const PATH18 = '/audio' -const PATH19 = '/image' -const PATH20 = '/video' -const PATH21 = '/api/v3/extension/video' -const PATH22 = '/api/v3/fcm_token' -const PATH23 = '/api/v3/info' -const PATH24 = '/api/v3/login' -const PATH25 = '/api/v3/logout' -const PATH26 = '/api/v3/me' -const PATH27 = '/api/v3/organisation' -const PATH28 = '/api/v3/organisation/users' -const PATH29 = '/api/v3/stories' -const PATH30 = '/reaction' -const PATH31 = '/api/v3/user' -const PATH32 = '/api/v3/user/profile' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/2fa' + const PATH1 = '/api/v3/channels' + const PATH2 = '/chats' + const PATH3 = '/items' + const PATH4 = '/news-feed' + const PATH5 = '/items/audio' + const PATH6 = '/items/image' + const PATH7 = '/items/video' + const PATH8 = '/itemslist' + const PATH9 = '/users' + const PATH10 = '/users/remove' + const PATH11 = '/notifications' + const PATH12 = '/api/v3/chats' + const PATH13 = '/api/v3/chats/keys' + const PATH14 = '/api/v3/extension/audio' + const PATH15 = '/api/v3/extension/image' + const PATH16 = '/api/v3/extension/parse' + const PATH17 = '/api/v3/extension/story' + const PATH18 = '/audio' + const PATH19 = '/image' + const PATH20 = '/video' + const PATH21 = '/api/v3/extension/video' + const PATH22 = '/api/v3/fcm_token' + const PATH23 = '/api/v3/info' + const PATH24 = '/api/v3/login' + const PATH25 = '/api/v3/logout' + const PATH26 = '/api/v3/me' + const PATH27 = '/api/v3/organisation' + const PATH28 = '/api/v3/organisation/users' + const PATH29 = '/api/v3/stories' + const PATH30 = '/reaction' + const PATH31 = '/api/v3/user' + const PATH32 = '/api/v3/user/profile' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { $2fa: { post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` }, channels: { _channelId_0: (val0: number) => { @@ -108,7 +109,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods2['post']['reqBody'], headers?: Methods2['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix2, POST, option).json(), $post: (option?: { body?: Methods2['post']['reqBody'], headers?: Methods2['post']['reqHeaders'], config?: T }) => - fetch(prefix, prefix2, POST, option).json().then(r => r.body) + fetch(prefix, prefix2, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}` } } } @@ -119,7 +121,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { query?: Methods3['get']['query'], headers?: Methods3['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix0}${PATH4}`, GET, option).json(), $get: (option?: { query?: Methods3['get']['query'], headers?: Methods3['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix0}${PATH4}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH4}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods3['get']['query'] }) => + `${prefix}${prefix0}${PATH4}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } }, @@ -137,19 +141,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods8['post']['reqBody'], headers?: Methods8['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH5}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods8['post']['reqBody'], headers?: Methods8['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix4}${PATH5}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix4}${PATH5}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix4}${PATH5}` }, image: { post: (option?: { body?: Methods9['post']['reqBody'], headers?: Methods9['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH6}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods9['post']['reqBody'], headers?: Methods9['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix4}${PATH6}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix4}${PATH6}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix4}${PATH6}` }, video: { post: (option?: { body?: Methods10['post']['reqBody'], headers?: Methods10['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH7}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods10['post']['reqBody'], headers?: Methods10['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix4}${PATH7}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix4}${PATH7}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix4}${PATH7}` }, get: (option?: { query?: Methods7['get']['query'], headers?: Methods7['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH3}`, GET, option).json(), @@ -158,20 +165,25 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods7['post']['reqBody'], headers?: Methods7['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH3}`, POST, option).json(), $post: (option: { body: Methods7['post']['reqBody'], headers?: Methods7['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix4}${PATH3}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix4}${PATH3}`, POST, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods7['get']['query'] }) => + `${prefix}${prefix4}${PATH3}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, itemslist: { get: (option: { query: Methods11['get']['query'], headers?: Methods11['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH8}`, GET, option).json(), $get: (option: { query: Methods11['get']['query'], headers?: Methods11['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix4}${PATH8}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix4}${PATH8}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods11['get']['query'] }) => + `${prefix}${prefix4}${PATH8}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, users: { remove: { post: (option: { body: Methods13['post']['reqBody'], headers?: Methods13['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH10}`, POST, option).send(), $post: (option: { body: Methods13['post']['reqBody'], headers?: Methods13['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix4}${PATH10}`, POST, option).send().then(r => r.body) + fetch(prefix, `${prefix4}${PATH10}`, POST, option).send().then(r => r.body), + $path: () => `${prefix}${prefix4}${PATH10}` }, get: (option?: { headers?: Methods12['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH9}`, GET, option).json(), @@ -184,7 +196,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option: { body: Methods12['put']['reqBody'], headers?: Methods12['put']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH9}`, PUT, option).send(), $put: (option: { body: Methods12['put']['reqBody'], headers?: Methods12['put']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix4}${PATH9}`, PUT, option).send().then(r => r.body) + fetch(prefix, `${prefix4}${PATH9}`, PUT, option).send().then(r => r.body), + $path: () => `${prefix}${prefix4}${PATH9}` }, get: (option?: { headers?: Methods6['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, GET, option).json(), @@ -197,7 +210,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { headers?: Methods6['delete']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, DELETE, option).send(), $delete: (option?: { headers?: Methods6['delete']['reqHeaders'], config?: T }) => - fetch(prefix, prefix4, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix4, DELETE, option).send().then(r => r.body), + $path: () => `${prefix}${prefix4}` } }, get: (option?: { headers?: Methods5['get']['reqHeaders'], config?: T }) => @@ -207,24 +221,31 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods5['post']['reqBody'], headers?: Methods5['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix3}${PATH2}`, POST, option).json(), $post: (option: { body: Methods5['post']['reqBody'], headers?: Methods5['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix3}${PATH2}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix3}${PATH2}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix3}${PATH2}` }, notifications: { get: (option?: { query?: Methods14['get']['query'], headers?: Methods14['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix3}${PATH11}`, GET, option).json(), $get: (option?: { query?: Methods14['get']['query'], headers?: Methods14['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix3}${PATH11}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix3}${PATH11}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods14['get']['query'] }) => + `${prefix}${prefix3}${PATH11}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, get: (option?: { query?: Methods4['get']['query'], headers?: Methods4['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix3, GET, option).send(), $get: (option?: { query?: Methods4['get']['query'], headers?: Methods4['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix3, GET, option).send().then(r => r.body) + fetch(prefix, prefix3, GET, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods4['get']['query'] }) => + `${prefix}${prefix3}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option?: { query?: Methods1['get']['query'], headers?: Methods1['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH1, GET, option).json(), $get: (option?: { query?: Methods1['get']['query'], headers?: Methods1['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH1, GET, option).json().then(r => r.body) + fetch(prefix, PATH1, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => + `${prefix}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, chats: { _chatId_0: (val5: number) => { @@ -243,7 +264,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { headers?: Methods15['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix6, GET, option).json(), $get: (option?: { headers?: Methods15['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix6, GET, option).json().then(r => r.body) + fetch(prefix, prefix6, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix6}` } } } @@ -258,19 +280,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods17['post']['reqBody'], headers?: Methods17['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH5}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods17['post']['reqBody'], headers?: Methods17['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH5}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix7}${PATH5}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix7}${PATH5}` }, image: { post: (option?: { body?: Methods18['post']['reqBody'], headers?: Methods18['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH6}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods18['post']['reqBody'], headers?: Methods18['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH6}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix7}${PATH6}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix7}${PATH6}` }, video: { post: (option?: { body?: Methods19['post']['reqBody'], headers?: Methods19['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH7}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods19['post']['reqBody'], headers?: Methods19['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH7}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix7}${PATH7}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix7}${PATH7}` }, get: (option?: { query?: Methods16['get']['query'], headers?: Methods16['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH3}`, GET, option).json(), @@ -279,7 +304,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods16['post']['reqBody'], headers?: Methods16['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH3}`, POST, option).json(), $post: (option: { body: Methods16['post']['reqBody'], headers?: Methods16['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix7}${PATH3}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix7}${PATH3}`, POST, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods16['get']['query'] }) => + `${prefix}${prefix7}${PATH3}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } }, @@ -287,7 +314,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { headers?: Methods20['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH13, GET, option).json(), $get: (option?: { headers?: Methods20['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH13, GET, option).json().then(r => r.body) + fetch(prefix, PATH13, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH13}` } }, extension: { @@ -295,19 +323,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods21['post']['reqBody'], headers?: Methods21['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH14, POST, option, 'FormData').json(), $post: (option?: { body?: Methods21['post']['reqBody'], headers?: Methods21['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH14, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH14, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH14}` }, image: { post: (option?: { body?: Methods22['post']['reqBody'], headers?: Methods22['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH15, POST, option, 'FormData').json(), $post: (option?: { body?: Methods22['post']['reqBody'], headers?: Methods22['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH15, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH15, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH15}` }, parse: { post: (option: { body: Methods23['post']['reqBody'], headers?: Methods23['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH16, POST, option).json(), $post: (option: { body: Methods23['post']['reqBody'], headers?: Methods23['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH16, POST, option).json().then(r => r.body) + fetch(prefix, PATH16, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH16}` }, story: { _storyId: (val8: string) => { @@ -318,24 +349,28 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods25['post']['reqBody'], headers?: Methods25['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix8}${PATH18}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods25['post']['reqBody'], headers?: Methods25['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix8}${PATH18}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix8}${PATH18}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix8}${PATH18}` }, image: { post: (option?: { body?: Methods26['post']['reqBody'], headers?: Methods26['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix8}${PATH19}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods26['post']['reqBody'], headers?: Methods26['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix8}${PATH19}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix8}${PATH19}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix8}${PATH19}` }, video: { post: (option?: { body?: Methods27['post']['reqBody'], headers?: Methods27['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix8}${PATH20}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods27['post']['reqBody'], headers?: Methods27['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix8}${PATH20}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix8}${PATH20}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix8}${PATH20}` }, post: (option: { body: Methods24['post']['reqBody'], headers?: Methods24['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix8, POST, option, 'FormData').json(), $post: (option: { body: Methods24['post']['reqBody'], headers?: Methods24['post']['reqHeaders'], config?: T }) => - fetch(prefix, prefix8, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, prefix8, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix8}` } } }, @@ -343,50 +378,59 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods28['post']['reqBody'], headers?: Methods28['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH21, POST, option, 'FormData').json(), $post: (option?: { body?: Methods28['post']['reqBody'], headers?: Methods28['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH21, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH21, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH21}` } }, fcm_token: { post: (option: { body: Methods29['post']['reqBody'], headers?: Methods29['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH22, POST, option).send(), $post: (option: { body: Methods29['post']['reqBody'], headers?: Methods29['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH22, POST, option).send().then(r => r.body) + fetch(prefix, PATH22, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH22}` }, info: { get: (option?: { headers?: Methods30['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH23, GET, option).json(), $get: (option?: { headers?: Methods30['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH23, GET, option).json().then(r => r.body) + fetch(prefix, PATH23, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH23}` }, login: { post: (option: { body: Methods31['post']['reqBody'], headers?: Methods31['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH24, POST, option).json(), $post: (option: { body: Methods31['post']['reqBody'], headers?: Methods31['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH24, POST, option).json().then(r => r.body) + fetch(prefix, PATH24, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH24}` }, logout: { post: (option: { body: Methods32['post']['reqBody'], headers?: Methods32['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH25, POST, option).send(), $post: (option: { body: Methods32['post']['reqBody'], headers?: Methods32['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH25, POST, option).send().then(r => r.body) + fetch(prefix, PATH25, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH25}` }, me: { get: (option?: { headers?: Methods33['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH26, GET, option).json(), $get: (option?: { headers?: Methods33['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH26, GET, option).json().then(r => r.body) + fetch(prefix, PATH26, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH26}` }, organisation: { users: { get: (option: { query: Methods35['get']['query'], headers?: Methods35['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH28, GET, option).json(), $get: (option: { query: Methods35['get']['query'], headers?: Methods35['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH28, GET, option).json().then(r => r.body) + fetch(prefix, PATH28, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods35['get']['query'] }) => + `${prefix}${PATH28}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, get: (option?: { headers?: Methods34['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH27, GET, option).json(), $get: (option?: { headers?: Methods34['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH27, GET, option).json().then(r => r.body) + fetch(prefix, PATH27, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH27}` }, stories: { _storyId: (val9: number) => { @@ -402,18 +446,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods38['post']['reqBody'], headers?: Methods38['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH30}`, POST, option).json(), $post: (option: { body: Methods38['post']['reqBody'], headers?: Methods38['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix10}${PATH30}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix10}${PATH30}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix10}${PATH30}` }, get: (option?: { headers?: Methods37['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix10, GET, option).json(), $get: (option?: { headers?: Methods37['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix10, GET, option).json().then(r => r.body) + fetch(prefix, prefix10, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix10}` } }, get: (option?: { query?: Methods36['get']['query'], headers?: Methods36['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix9}${PATH3}`, GET, option).json(), $get: (option?: { query?: Methods36['get']['query'], headers?: Methods36['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix9}${PATH3}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix9}${PATH3}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods36['get']['query'] }) => + `${prefix}${prefix9}${PATH3}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } @@ -426,19 +474,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { headers?: Methods40['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix11, GET, option).json(), $get: (option?: { headers?: Methods40['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix11, GET, option).json().then(r => r.body) + fetch(prefix, prefix11, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix11}` } }, profile: { put: (option?: { body?: Methods41['put']['reqBody'], headers?: Methods41['put']['reqHeaders'], config?: T }) => fetch(prefix, PATH32, PUT, option, 'FormData').send(), $put: (option?: { body?: Methods41['put']['reqBody'], headers?: Methods41['put']['reqHeaders'], config?: T }) => - fetch(prefix, PATH32, PUT, option, 'FormData').send().then(r => r.body) + fetch(prefix, PATH32, PUT, option, 'FormData').send().then(r => r.body), + $path: () => `${prefix}${PATH32}` }, get: (option?: { headers?: Methods39['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH31, GET, option).json(), $get: (option?: { headers?: Methods39['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH31, GET, option).json().then(r => r.body) + fetch(prefix, PATH31, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH31}` } } } diff --git a/samples/openapi/api/v3/2fa/$api.ts b/samples/openapi/api/v3/2fa/$api.ts index e22166e2..f495c217 100644 --- a/samples/openapi/api/v3/2fa/$api.ts +++ b/samples/openapi/api/v3/2fa/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/api/v3/2fa' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/2fa' + const POST = 'POST' return { post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v3/channels/$api.ts b/samples/openapi/api/v3/channels/$api.ts index ba64b17c..c2dfe4ee 100644 --- a/samples/openapi/api/v3/channels/$api.ts +++ b/samples/openapi/api/v3/channels/$api.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_channelId@number/chats/_chatId@number/items/_itemId@number' import { Methods as Methods2 } from './_channelId@number/news-feed' @@ -15,23 +15,23 @@ import { Methods as Methods11 } from './_channelId@string/chats/_chatId@string/u import { Methods as Methods12 } from './_channelId@string/chats/_chatId@string/users/remove' import { Methods as Methods13 } from './_channelId@string/notifications' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/api/v3/channels' -const PATH1 = '/chats' -const PATH2 = '/items' -const PATH3 = '/news-feed' -const PATH4 = '/items/audio' -const PATH5 = '/items/image' -const PATH6 = '/items/video' -const PATH7 = '/itemslist' -const PATH8 = '/users' -const PATH9 = '/users/remove' -const PATH10 = '/notifications' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/channels' + const PATH1 = '/chats' + const PATH2 = '/items' + const PATH3 = '/news-feed' + const PATH4 = '/items/audio' + const PATH5 = '/items/image' + const PATH6 = '/items/video' + const PATH7 = '/itemslist' + const PATH8 = '/users' + const PATH9 = '/users/remove' + const PATH10 = '/notifications' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _channelId_0: (val0: number) => { @@ -51,7 +51,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods1['post']['reqBody'], headers?: Methods1['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix2, POST, option).json(), $post: (option?: { body?: Methods1['post']['reqBody'], headers?: Methods1['post']['reqHeaders'], config?: T }) => - fetch(prefix, prefix2, POST, option).json().then(r => r.body) + fetch(prefix, prefix2, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}` } } } @@ -62,7 +63,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { query?: Methods2['get']['query'], headers?: Methods2['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix0}${PATH3}`, GET, option).json(), $get: (option?: { query?: Methods2['get']['query'], headers?: Methods2['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix0}${PATH3}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH3}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods2['get']['query'] }) => + `${prefix}${prefix0}${PATH3}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } }, @@ -80,19 +83,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods7['post']['reqBody'], headers?: Methods7['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH4}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods7['post']['reqBody'], headers?: Methods7['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix4}${PATH4}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix4}${PATH4}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix4}${PATH4}` }, image: { post: (option?: { body?: Methods8['post']['reqBody'], headers?: Methods8['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH5}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods8['post']['reqBody'], headers?: Methods8['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix4}${PATH5}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix4}${PATH5}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix4}${PATH5}` }, video: { post: (option?: { body?: Methods9['post']['reqBody'], headers?: Methods9['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH6}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods9['post']['reqBody'], headers?: Methods9['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix4}${PATH6}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix4}${PATH6}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix4}${PATH6}` }, get: (option?: { query?: Methods6['get']['query'], headers?: Methods6['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH2}`, GET, option).json(), @@ -101,20 +107,25 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods6['post']['reqBody'], headers?: Methods6['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH2}`, POST, option).json(), $post: (option: { body: Methods6['post']['reqBody'], headers?: Methods6['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix4}${PATH2}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix4}${PATH2}`, POST, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods6['get']['query'] }) => + `${prefix}${prefix4}${PATH2}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, itemslist: { get: (option: { query: Methods10['get']['query'], headers?: Methods10['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH7}`, GET, option).json(), $get: (option: { query: Methods10['get']['query'], headers?: Methods10['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix4}${PATH7}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix4}${PATH7}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods10['get']['query'] }) => + `${prefix}${prefix4}${PATH7}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, users: { remove: { post: (option: { body: Methods12['post']['reqBody'], headers?: Methods12['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH9}`, POST, option).send(), $post: (option: { body: Methods12['post']['reqBody'], headers?: Methods12['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix4}${PATH9}`, POST, option).send().then(r => r.body) + fetch(prefix, `${prefix4}${PATH9}`, POST, option).send().then(r => r.body), + $path: () => `${prefix}${prefix4}${PATH9}` }, get: (option?: { headers?: Methods11['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH8}`, GET, option).json(), @@ -127,7 +138,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option: { body: Methods11['put']['reqBody'], headers?: Methods11['put']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH8}`, PUT, option).send(), $put: (option: { body: Methods11['put']['reqBody'], headers?: Methods11['put']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix4}${PATH8}`, PUT, option).send().then(r => r.body) + fetch(prefix, `${prefix4}${PATH8}`, PUT, option).send().then(r => r.body), + $path: () => `${prefix}${prefix4}${PATH8}` }, get: (option?: { headers?: Methods5['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, GET, option).json(), @@ -140,7 +152,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { headers?: Methods5['delete']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, DELETE, option).send(), $delete: (option?: { headers?: Methods5['delete']['reqHeaders'], config?: T }) => - fetch(prefix, prefix4, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix4, DELETE, option).send().then(r => r.body), + $path: () => `${prefix}${prefix4}` } }, get: (option?: { headers?: Methods4['get']['reqHeaders'], config?: T }) => @@ -150,24 +163,31 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods4['post']['reqBody'], headers?: Methods4['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix3}${PATH1}`, POST, option).json(), $post: (option: { body: Methods4['post']['reqBody'], headers?: Methods4['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix3}${PATH1}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix3}${PATH1}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix3}${PATH1}` }, notifications: { get: (option?: { query?: Methods13['get']['query'], headers?: Methods13['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix3}${PATH10}`, GET, option).json(), $get: (option?: { query?: Methods13['get']['query'], headers?: Methods13['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix3}${PATH10}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix3}${PATH10}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods13['get']['query'] }) => + `${prefix}${prefix3}${PATH10}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, get: (option?: { query?: Methods3['get']['query'], headers?: Methods3['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix3, GET, option).send(), $get: (option?: { query?: Methods3['get']['query'], headers?: Methods3['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix3, GET, option).send().then(r => r.body) + fetch(prefix, prefix3, GET, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods3['get']['query'] }) => + `${prefix}${prefix3}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } }, get: (option?: { query?: Methods0['get']['query'], headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { query?: Methods0['get']['query'], headers?: Methods0['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/openapi/api/v3/chats/$api.ts b/samples/openapi/api/v3/chats/$api.ts index 58553e8a..8a4d1295 100644 --- a/samples/openapi/api/v3/chats/$api.ts +++ b/samples/openapi/api/v3/chats/$api.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './_chatId@number/items/_itemId@number' import { Methods as Methods1 } from './_chatId@string/items' import { Methods as Methods2 } from './_chatId@string/items/audio' @@ -7,16 +7,16 @@ import { Methods as Methods3 } from './_chatId@string/items/image' import { Methods as Methods4 } from './_chatId@string/items/video' import { Methods as Methods5 } from './keys' -const GET = 'GET' -const POST = 'POST' -const PATH0 = '/api/v3/chats' -const PATH1 = '/items' -const PATH2 = '/items/audio' -const PATH3 = '/items/image' -const PATH4 = '/items/video' -const PATH5 = '/api/v3/chats/keys' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/chats' + const PATH1 = '/items' + const PATH2 = '/items/audio' + const PATH3 = '/items/image' + const PATH4 = '/items/video' + const PATH5 = '/api/v3/chats/keys' + const GET = 'GET' + const POST = 'POST' return { _chatId_0: (val0: number) => { @@ -35,7 +35,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix1, GET, option).json(), $get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix1, GET, option).json().then(r => r.body) + fetch(prefix, prefix1, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix1}` } } } @@ -50,19 +51,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods2['post']['reqBody'], headers?: Methods2['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix2}${PATH2}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods2['post']['reqBody'], headers?: Methods2['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix2}${PATH2}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix2}${PATH2}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH2}` }, image: { post: (option?: { body?: Methods3['post']['reqBody'], headers?: Methods3['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix2}${PATH3}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods3['post']['reqBody'], headers?: Methods3['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix2}${PATH3}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix2}${PATH3}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH3}` }, video: { post: (option?: { body?: Methods4['post']['reqBody'], headers?: Methods4['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix2}${PATH4}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods4['post']['reqBody'], headers?: Methods4['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix2}${PATH4}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix2}${PATH4}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH4}` }, get: (option?: { query?: Methods1['get']['query'], headers?: Methods1['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix2}${PATH1}`, GET, option).json(), @@ -71,7 +75,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods1['post']['reqBody'], headers?: Methods1['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix2}${PATH1}`, POST, option).json(), $post: (option: { body: Methods1['post']['reqBody'], headers?: Methods1['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix2}${PATH1}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix2}${PATH1}`, POST, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => + `${prefix}${prefix2}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } }, @@ -79,7 +85,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { headers?: Methods5['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH5, GET, option).json(), $get: (option?: { headers?: Methods5['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH5, GET, option).json().then(r => r.body) + fetch(prefix, PATH5, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH5}` } } } diff --git a/samples/openapi/api/v3/chats/keys/$api.ts b/samples/openapi/api/v3/chats/keys/$api.ts index eefd2b0f..415faaeb 100644 --- a/samples/openapi/api/v3/chats/keys/$api.ts +++ b/samples/openapi/api/v3/chats/keys/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/api/v3/chats/keys' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/chats/keys' + const GET = 'GET' return { get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v3/extension/$api.ts b/samples/openapi/api/v3/extension/$api.ts index d79170f8..2eb4ebaa 100644 --- a/samples/openapi/api/v3/extension/$api.ts +++ b/samples/openapi/api/v3/extension/$api.ts @@ -9,36 +9,39 @@ import { Methods as Methods5 } from './story/_storyId@string/image' import { Methods as Methods6 } from './story/_storyId@string/video' import { Methods as Methods7 } from './video' -const POST = 'POST' -const PATH0 = '/api/v3/extension/audio' -const PATH1 = '/api/v3/extension/image' -const PATH2 = '/api/v3/extension/parse' -const PATH3 = '/api/v3/extension/story' -const PATH4 = '/audio' -const PATH5 = '/image' -const PATH6 = '/video' -const PATH7 = '/api/v3/extension/video' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/extension/audio' + const PATH1 = '/api/v3/extension/image' + const PATH2 = '/api/v3/extension/parse' + const PATH3 = '/api/v3/extension/story' + const PATH4 = '/audio' + const PATH5 = '/image' + const PATH6 = '/video' + const PATH7 = '/api/v3/extension/video' + const POST = 'POST' return { audio: { post: (option?: { body?: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option, 'FormData').json(), $post: (option?: { body?: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH0}` }, image: { post: (option?: { body?: Methods1['post']['reqBody'], headers?: Methods1['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH1, POST, option, 'FormData').json(), $post: (option?: { body?: Methods1['post']['reqBody'], headers?: Methods1['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH1, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH1, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH1}` }, parse: { post: (option: { body: Methods2['post']['reqBody'], headers?: Methods2['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH2, POST, option).json(), $post: (option: { body: Methods2['post']['reqBody'], headers?: Methods2['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH2, POST, option).json().then(r => r.body) + fetch(prefix, PATH2, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH2}` }, story: { _storyId: (val0: string) => { @@ -49,24 +52,28 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods4['post']['reqBody'], headers?: Methods4['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix0}${PATH4}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods4['post']['reqBody'], headers?: Methods4['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix0}${PATH4}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH4}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH4}` }, image: { post: (option?: { body?: Methods5['post']['reqBody'], headers?: Methods5['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix0}${PATH5}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods5['post']['reqBody'], headers?: Methods5['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix0}${PATH5}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH5}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH5}` }, video: { post: (option?: { body?: Methods6['post']['reqBody'], headers?: Methods6['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix0}${PATH6}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods6['post']['reqBody'], headers?: Methods6['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix0}${PATH6}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH6}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH6}` }, post: (option: { body: Methods3['post']['reqBody'], headers?: Methods3['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix0, POST, option, 'FormData').json(), $post: (option: { body: Methods3['post']['reqBody'], headers?: Methods3['post']['reqHeaders'], config?: T }) => - fetch(prefix, prefix0, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, prefix0, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix0}` } } }, @@ -74,7 +81,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods7['post']['reqBody'], headers?: Methods7['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH7, POST, option, 'FormData').json(), $post: (option?: { body?: Methods7['post']['reqBody'], headers?: Methods7['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH7, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH7, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH7}` } } } diff --git a/samples/openapi/api/v3/extension/audio/$api.ts b/samples/openapi/api/v3/extension/audio/$api.ts index 7c3e4eda..c81fcb22 100644 --- a/samples/openapi/api/v3/extension/audio/$api.ts +++ b/samples/openapi/api/v3/extension/audio/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/api/v3/extension/audio' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/extension/audio' + const POST = 'POST' return { post: (option?: { body?: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option, 'FormData').json(), $post: (option?: { body?: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v3/extension/image/$api.ts b/samples/openapi/api/v3/extension/image/$api.ts index d49f9695..0b7233d3 100644 --- a/samples/openapi/api/v3/extension/image/$api.ts +++ b/samples/openapi/api/v3/extension/image/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/api/v3/extension/image' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/extension/image' + const POST = 'POST' return { post: (option?: { body?: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option, 'FormData').json(), $post: (option?: { body?: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v3/extension/parse/$api.ts b/samples/openapi/api/v3/extension/parse/$api.ts index 51416c43..ecab854b 100644 --- a/samples/openapi/api/v3/extension/parse/$api.ts +++ b/samples/openapi/api/v3/extension/parse/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/api/v3/extension/parse' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/extension/parse' + const POST = 'POST' return { post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v3/extension/story/$api.ts b/samples/openapi/api/v3/extension/story/$api.ts index 7a8e3879..3c83ec08 100644 --- a/samples/openapi/api/v3/extension/story/$api.ts +++ b/samples/openapi/api/v3/extension/story/$api.ts @@ -5,13 +5,13 @@ import { Methods as Methods1 } from './_storyId@string/audio' import { Methods as Methods2 } from './_storyId@string/image' import { Methods as Methods3 } from './_storyId@string/video' -const POST = 'POST' -const PATH0 = '/api/v3/extension/story' -const PATH1 = '/audio' -const PATH2 = '/image' -const PATH3 = '/video' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/extension/story' + const PATH1 = '/audio' + const PATH2 = '/image' + const PATH3 = '/video' + const POST = 'POST' return { _storyId: (val0: string) => { @@ -22,24 +22,28 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods1['post']['reqBody'], headers?: Methods1['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods1['post']['reqBody'], headers?: Methods1['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH1}` }, image: { post: (option?: { body?: Methods2['post']['reqBody'], headers?: Methods2['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix0}${PATH2}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods2['post']['reqBody'], headers?: Methods2['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix0}${PATH2}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH2}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH2}` }, video: { post: (option?: { body?: Methods3['post']['reqBody'], headers?: Methods3['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix0}${PATH3}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods3['post']['reqBody'], headers?: Methods3['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix0}${PATH3}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH3}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH3}` }, post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix0, POST, option, 'FormData').json(), $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => - fetch(prefix, prefix0, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, prefix0, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix0}` } } } diff --git a/samples/openapi/api/v3/extension/video/$api.ts b/samples/openapi/api/v3/extension/video/$api.ts index 957efe2d..4275c2e8 100644 --- a/samples/openapi/api/v3/extension/video/$api.ts +++ b/samples/openapi/api/v3/extension/video/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/api/v3/extension/video' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/extension/video' + const POST = 'POST' return { post: (option?: { body?: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option, 'FormData').json(), $post: (option?: { body?: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, PATH0, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v3/fcm_token/$api.ts b/samples/openapi/api/v3/fcm_token/$api.ts index fc311e2f..f99a0c1c 100644 --- a/samples/openapi/api/v3/fcm_token/$api.ts +++ b/samples/openapi/api/v3/fcm_token/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/api/v3/fcm_token' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/fcm_token' + const POST = 'POST' return { post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option).send(), $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, POST, option).send().then(r => r.body) + fetch(prefix, PATH0, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v3/info/$api.ts b/samples/openapi/api/v3/info/$api.ts index da49d561..577bd1b1 100644 --- a/samples/openapi/api/v3/info/$api.ts +++ b/samples/openapi/api/v3/info/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/api/v3/info' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/info' + const GET = 'GET' return { get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v3/login/$api.ts b/samples/openapi/api/v3/login/$api.ts index 434f35ec..f5daccd0 100644 --- a/samples/openapi/api/v3/login/$api.ts +++ b/samples/openapi/api/v3/login/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/api/v3/login' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/login' + const POST = 'POST' return { post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v3/logout/$api.ts b/samples/openapi/api/v3/logout/$api.ts index 8ba98dbe..49a4d5e1 100644 --- a/samples/openapi/api/v3/logout/$api.ts +++ b/samples/openapi/api/v3/logout/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/api/v3/logout' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/logout' + const POST = 'POST' return { post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option).send(), $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, POST, option).send().then(r => r.body) + fetch(prefix, PATH0, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v3/me/$api.ts b/samples/openapi/api/v3/me/$api.ts index 644da8ab..058ee247 100644 --- a/samples/openapi/api/v3/me/$api.ts +++ b/samples/openapi/api/v3/me/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/api/v3/me' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/me' + const GET = 'GET' return { get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v3/organisation/$api.ts b/samples/openapi/api/v3/organisation/$api.ts index aa614701..3c3e0251 100644 --- a/samples/openapi/api/v3/organisation/$api.ts +++ b/samples/openapi/api/v3/organisation/$api.ts @@ -1,25 +1,28 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './users' -const GET = 'GET' -const PATH0 = '/api/v3/organisation' -const PATH1 = '/api/v3/organisation/users' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/organisation' + const PATH1 = '/api/v3/organisation/users' + const GET = 'GET' return { users: { get: (option: { query: Methods1['get']['query'], headers?: Methods1['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH1, GET, option).json(), $get: (option: { query: Methods1['get']['query'], headers?: Methods1['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH1, GET, option).json().then(r => r.body) + fetch(prefix, PATH1, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => + `${prefix}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v3/organisation/users/$api.ts b/samples/openapi/api/v3/organisation/users/$api.ts index a7cab38d..bdf90328 100644 --- a/samples/openapi/api/v3/organisation/users/$api.ts +++ b/samples/openapi/api/v3/organisation/users/$api.ts @@ -1,17 +1,19 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/api/v3/organisation/users' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/organisation/users' + const GET = 'GET' return { get: (option: { query: Methods0['get']['query'], headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], headers?: Methods0['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/openapi/api/v3/stories/$api.ts b/samples/openapi/api/v3/stories/$api.ts index 528683e9..ad6e2cbc 100644 --- a/samples/openapi/api/v3/stories/$api.ts +++ b/samples/openapi/api/v3/stories/$api.ts @@ -1,16 +1,16 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './_storyId@number/items' import { Methods as Methods1 } from './_storyId@number/items/_itemId@number' import { Methods as Methods2 } from './_storyId@number/items/_itemId@number/reaction' -const GET = 'GET' -const POST = 'POST' -const PATH0 = '/api/v3/stories' -const PATH1 = '/items' -const PATH2 = '/reaction' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/stories' + const PATH1 = '/items' + const PATH2 = '/reaction' + const GET = 'GET' + const POST = 'POST' return { _storyId: (val0: number) => { @@ -26,18 +26,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods2['post']['reqBody'], headers?: Methods2['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix1}${PATH2}`, POST, option).json(), $post: (option: { body: Methods2['post']['reqBody'], headers?: Methods2['post']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix1}${PATH2}`, POST, option).json().then(r => r.body) + fetch(prefix, `${prefix1}${PATH2}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix1}${PATH2}` }, get: (option?: { headers?: Methods1['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix1, GET, option).json(), $get: (option?: { headers?: Methods1['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix1, GET, option).json().then(r => r.body) + fetch(prefix, prefix1, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix1}` } }, get: (option?: { query?: Methods0['get']['query'], headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, GET, option).json(), $get: (option?: { query?: Methods0['get']['query'], headers?: Methods0['get']['reqHeaders'], config?: T }) => - fetch(prefix, `${prefix0}${PATH1}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH1}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${prefix0}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } diff --git a/samples/openapi/api/v3/user/$api.ts b/samples/openapi/api/v3/user/$api.ts index 1e4194b9..0d7eec57 100644 --- a/samples/openapi/api/v3/user/$api.ts +++ b/samples/openapi/api/v3/user/$api.ts @@ -4,12 +4,12 @@ import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_userId@string' import { Methods as Methods2 } from './profile' -const GET = 'GET' -const PUT = 'PUT' -const PATH0 = '/api/v3/user' -const PATH1 = '/api/v3/user/profile' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/user' + const PATH1 = '/api/v3/user/profile' + const GET = 'GET' + const PUT = 'PUT' return { _userId: (val0: string) => { @@ -19,19 +19,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { headers?: Methods1['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix0, GET, option).json(), $get: (option?: { headers?: Methods1['get']['reqHeaders'], config?: T }) => - fetch(prefix, prefix0, GET, option).json().then(r => r.body) + fetch(prefix, prefix0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, profile: { put: (option?: { body?: Methods2['put']['reqBody'], headers?: Methods2['put']['reqHeaders'], config?: T }) => fetch(prefix, PATH1, PUT, option, 'FormData').send(), $put: (option?: { body?: Methods2['put']['reqBody'], headers?: Methods2['put']['reqHeaders'], config?: T }) => - fetch(prefix, PATH1, PUT, option, 'FormData').send().then(r => r.body) + fetch(prefix, PATH1, PUT, option, 'FormData').send().then(r => r.body), + $path: () => `${prefix}${PATH1}` }, get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/openapi/api/v3/user/profile/$api.ts b/samples/openapi/api/v3/user/profile/$api.ts index cc7085b2..f63e1b26 100644 --- a/samples/openapi/api/v3/user/profile/$api.ts +++ b/samples/openapi/api/v3/user/profile/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const PUT = 'PUT' -const PATH0 = '/api/v3/user/profile' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/api/v3/user/profile' + const PUT = 'PUT' return { put: (option?: { body?: Methods0['put']['reqBody'], headers?: Methods0['put']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, PUT, option, 'FormData').send(), $put: (option?: { body?: Methods0['put']['reqBody'], headers?: Methods0['put']['reqHeaders'], config?: T }) => - fetch(prefix, PATH0, PUT, option, 'FormData').send().then(r => r.body) + fetch(prefix, PATH0, PUT, option, 'FormData').send().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/simple/$api.ts b/samples/simple/$api.ts index a8f3efe6..74396743 100644 --- a/samples/simple/$api.ts +++ b/samples/simple/$api.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './dummy/_id@number/content' import { Methods as Methods1 } from './dummy/_id@number/query' import { Methods as Methods2 } from './dummy/_id@number/simple' @@ -8,22 +8,22 @@ import { Methods as Methods4 } from './user/_id@number' import { Methods as Methods5 } from './user/_id@number/abc' import { Methods as Methods6 } from './user/_id@number/xyz' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATCH = 'PATCH' -const PATH0 = '/dummy' -const PATH1 = '/content' -const PATH2 = '/query' -const PATH3 = '/simple' -const PATH4 = '/file' -const PATH5 = '/upload' -const PATH6 = '/user' -const PATH7 = '/abc' -const PATH8 = '/xyz' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/dummy' + const PATH1 = '/content' + const PATH2 = '/query' + const PATH3 = '/simple' + const PATH4 = '/file' + const PATH5 = '/upload' + const PATH6 = '/user' + const PATH7 = '/abc' + const PATH8 = '/xyz' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' + const PATCH = 'PATCH' return { dummy: { @@ -35,19 +35,23 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, PUT, option).text(), $put: (option?: { config?: T }) => - fetch(prefix, `${prefix0}${PATH1}`, PUT, option).text().then(r => r.body) + fetch(prefix, `${prefix0}${PATH1}`, PUT, option).text().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH1}` }, query: { put: (option?: { query?: Methods1['put']['query'], config?: T }) => fetch(prefix, `${prefix0}${PATH2}`, PUT, option).send(), $put: (option?: { query?: Methods1['put']['query'], config?: T }) => - fetch(prefix, `${prefix0}${PATH2}`, PUT, option).send().then(r => r.body) + fetch(prefix, `${prefix0}${PATH2}`, PUT, option).send().then(r => r.body), + $path: (option?: { method: 'put'; query: Methods1['put']['query'] }) => + `${prefix}${prefix0}${PATH2}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, simple: { put: (option?: { config?: T }) => fetch(prefix, `${prefix0}${PATH3}`, PUT, option).send(), $put: (option?: { config?: T }) => - fetch(prefix, `${prefix0}${PATH3}`, PUT, option).send().then(r => r.body) + fetch(prefix, `${prefix0}${PATH3}`, PUT, option).send().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH3}` } } } @@ -61,7 +65,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods3['post']['reqBody'], query?: Methods3['post']['query'], config?: T }) => fetch(prefix, `${prefix1}${PATH5}`, POST, option, 'Blob').send(), $post: (option?: { body?: Methods3['post']['reqBody'], query?: Methods3['post']['query'], config?: T }) => - fetch(prefix, `${prefix1}${PATH5}`, POST, option, 'Blob').send().then(r => r.body) + fetch(prefix, `${prefix1}${PATH5}`, POST, option, 'Blob').send().then(r => r.body), + $path: (option?: { method: 'post'; query: Methods3['post']['query'] }) => + `${prefix}${prefix1}${PATH5}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } @@ -75,7 +81,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { query?: Methods5['get']['query'], config?: T }) => fetch(prefix, `${prefix2}${PATH7}`, GET, option).send(), $get: (option?: { query?: Methods5['get']['query'], config?: T }) => - fetch(prefix, `${prefix2}${PATH7}`, GET, option).send().then(r => r.body) + fetch(prefix, `${prefix2}${PATH7}`, GET, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods5['get']['query'] }) => + `${prefix}${prefix2}${PATH7}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, xyz: { get: (option?: { config?: T }) => @@ -85,7 +93,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { config?: T }) => fetch(prefix, `${prefix2}${PATH8}`, PUT, option).send(), $put: (option?: { config?: T }) => - fetch(prefix, `${prefix2}${PATH8}`, PUT, option).send().then(r => r.body) + fetch(prefix, `${prefix2}${PATH8}`, PUT, option).send().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH8}` }, get: (option?: { config?: T }) => fetch(prefix, prefix2, GET, option).send(), @@ -98,7 +107,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { config?: T }) => fetch(prefix, prefix2, DELETE, option).send(), $delete: (option?: { config?: T }) => - fetch(prefix, prefix2, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix2, DELETE, option).send().then(r => r.body), + $path: () => `${prefix}${prefix2}` } } } diff --git a/samples/simple/dummy/$api.ts b/samples/simple/dummy/$api.ts index 75b4a1d8..3bf25f12 100644 --- a/samples/simple/dummy/$api.ts +++ b/samples/simple/dummy/$api.ts @@ -1,16 +1,16 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './_id@number/content' import { Methods as Methods1 } from './_id@number/query' import { Methods as Methods2 } from './_id@number/simple' -const PUT = 'PUT' -const PATH0 = '/dummy' -const PATH1 = '/content' -const PATH2 = '/query' -const PATH3 = '/simple' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/dummy' + const PATH1 = '/content' + const PATH2 = '/query' + const PATH3 = '/simple' + const PUT = 'PUT' return { _id: (val0: number) => { @@ -21,19 +21,23 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, PUT, option).text(), $put: (option?: { config?: T }) => - fetch(prefix, `${prefix0}${PATH1}`, PUT, option).text().then(r => r.body) + fetch(prefix, `${prefix0}${PATH1}`, PUT, option).text().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH1}` }, query: { put: (option?: { query?: Methods1['put']['query'], config?: T }) => fetch(prefix, `${prefix0}${PATH2}`, PUT, option).send(), $put: (option?: { query?: Methods1['put']['query'], config?: T }) => - fetch(prefix, `${prefix0}${PATH2}`, PUT, option).send().then(r => r.body) + fetch(prefix, `${prefix0}${PATH2}`, PUT, option).send().then(r => r.body), + $path: (option?: { method: 'put'; query: Methods1['put']['query'] }) => + `${prefix}${prefix0}${PATH2}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, simple: { put: (option?: { config?: T }) => fetch(prefix, `${prefix0}${PATH3}`, PUT, option).send(), $put: (option?: { config?: T }) => - fetch(prefix, `${prefix0}${PATH3}`, PUT, option).send().then(r => r.body) + fetch(prefix, `${prefix0}${PATH3}`, PUT, option).send().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH3}` } } } diff --git a/samples/simple/file/$api.ts b/samples/simple/file/$api.ts index 09e15ece..3ec4c3de 100644 --- a/samples/simple/file/$api.ts +++ b/samples/simple/file/$api.ts @@ -1,12 +1,12 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './_id@number/upload' -const POST = 'POST' -const PATH0 = '/file' -const PATH1 = '/upload' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/file' + const PATH1 = '/upload' + const POST = 'POST' return { _id: (val0: number) => { @@ -17,7 +17,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods0['post']['reqBody'], query?: Methods0['post']['query'], config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'Blob').send(), $post: (option?: { body?: Methods0['post']['reqBody'], query?: Methods0['post']['query'], config?: T }) => - fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'Blob').send().then(r => r.body) + fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'Blob').send().then(r => r.body), + $path: (option?: { method: 'post'; query: Methods0['post']['query'] }) => + `${prefix}${prefix0}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } diff --git a/samples/simple/user/$api.ts b/samples/simple/user/$api.ts index 5801af5d..4e94056f 100644 --- a/samples/simple/user/$api.ts +++ b/samples/simple/user/$api.ts @@ -1,18 +1,18 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './_id@number' import { Methods as Methods1 } from './_id@number/abc' import { Methods as Methods2 } from './_id@number/xyz' -const GET = 'GET' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATCH = 'PATCH' -const PATH0 = '/user' -const PATH1 = '/abc' -const PATH2 = '/xyz' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') + const PATH0 = '/user' + const PATH1 = '/abc' + const PATH2 = '/xyz' + const GET = 'GET' + const PUT = 'PUT' + const DELETE = 'DELETE' + const PATCH = 'PATCH' return { _id: (val0: number) => { @@ -23,7 +23,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { query?: Methods1['get']['query'], config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, GET, option).send(), $get: (option?: { query?: Methods1['get']['query'], config?: T }) => - fetch(prefix, `${prefix0}${PATH1}`, GET, option).send().then(r => r.body) + fetch(prefix, `${prefix0}${PATH1}`, GET, option).send().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => + `${prefix}${prefix0}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, xyz: { get: (option?: { config?: T }) => @@ -33,7 +35,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option?: { config?: T }) => fetch(prefix, `${prefix0}${PATH2}`, PUT, option).send(), $put: (option?: { config?: T }) => - fetch(prefix, `${prefix0}${PATH2}`, PUT, option).send().then(r => r.body) + fetch(prefix, `${prefix0}${PATH2}`, PUT, option).send().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH2}` }, get: (option?: { config?: T }) => fetch(prefix, prefix0, GET, option).send(), @@ -46,7 +49,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option?: { config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: () => `${prefix}${prefix0}` } } } diff --git a/samples/strapi/$api.ts b/samples/strapi/$api.ts index c4e0f53e..db11c29f 100644 --- a/samples/strapi/$api.ts +++ b/samples/strapi/$api.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './auth/_provider@string/callback' import { Methods as Methods1 } from './auth/email-confirmation' import { Methods as Methods2 } from './auth/forgot-password' @@ -23,31 +23,31 @@ import { Methods as Methods19 } from './users-permissions/roles/_id@string' import { Methods as Methods20 } from './users-permissions/roles/_role@string' import { Methods as Methods21 } from './users-permissions/search/_id@string' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/auth' -const PATH1 = '/callback' -const PATH2 = '/auth/email-confirmation' -const PATH3 = '/auth/forgot-password' -const PATH4 = '/auth/local' -const PATH5 = '/auth/local/register' -const PATH6 = '/auth/reset-password' -const PATH7 = '/auth/send-email-confirmation' -const PATH8 = '/connect' -const PATH9 = '/email' -const PATH10 = '/upload' -const PATH11 = '/upload/files' -const PATH12 = '/upload/files/count' -const PATH13 = '/upload/search' -const PATH14 = '/users' -const PATH15 = '/users/me' -const PATH16 = '/users-permissions/init' -const PATH17 = '/users-permissions/roles' -const PATH18 = '/users-permissions/search' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/auth' + const PATH1 = '/callback' + const PATH2 = '/auth/email-confirmation' + const PATH3 = '/auth/forgot-password' + const PATH4 = '/auth/local' + const PATH5 = '/auth/local/register' + const PATH6 = '/auth/reset-password' + const PATH7 = '/auth/send-email-confirmation' + const PATH8 = '/connect' + const PATH9 = '/email' + const PATH10 = '/upload' + const PATH11 = '/upload/files' + const PATH12 = '/upload/files/count' + const PATH13 = '/upload/search' + const PATH14 = '/users' + const PATH15 = '/users/me' + const PATH16 = '/users-permissions/init' + const PATH17 = '/users-permissions/roles' + const PATH18 = '/users-permissions/search' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { auth: { @@ -59,7 +59,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, `${prefix0}${PATH1}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH1}`, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH1}` } } }, @@ -67,37 +68,43 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, PATH2, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH2, GET, option).json().then(r => r.body) + fetch(prefix, PATH2, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH2}` }, forgot_password: { post: (option: { body: Methods2['post']['reqBody'], config?: T }) => fetch(prefix, PATH3, POST, option).json(), $post: (option: { body: Methods2['post']['reqBody'], config?: T }) => - fetch(prefix, PATH3, POST, option).json().then(r => r.body) + fetch(prefix, PATH3, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH3}` }, local: { register: { post: (option: { body: Methods4['post']['reqBody'], config?: T }) => fetch(prefix, PATH5, POST, option).json(), $post: (option: { body: Methods4['post']['reqBody'], config?: T }) => - fetch(prefix, PATH5, POST, option).json().then(r => r.body) + fetch(prefix, PATH5, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH5}` }, post: (option: { body: Methods3['post']['reqBody'], config?: T }) => fetch(prefix, PATH4, POST, option).json(), $post: (option: { body: Methods3['post']['reqBody'], config?: T }) => - fetch(prefix, PATH4, POST, option).json().then(r => r.body) + fetch(prefix, PATH4, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH4}` }, reset_password: { post: (option: { body: Methods5['post']['reqBody'], config?: T }) => fetch(prefix, PATH6, POST, option).json(), $post: (option: { body: Methods5['post']['reqBody'], config?: T }) => - fetch(prefix, PATH6, POST, option).json().then(r => r.body) + fetch(prefix, PATH6, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH6}` }, send_email_confirmation: { post: (option: { body: Methods6['post']['reqBody'], config?: T }) => fetch(prefix, PATH7, POST, option).json(), $post: (option: { body: Methods6['post']['reqBody'], config?: T }) => - fetch(prefix, PATH7, POST, option).json().then(r => r.body) + fetch(prefix, PATH7, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH7}` } }, connect: { @@ -108,7 +115,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix1, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix1, GET, option).json().then(r => r.body) + fetch(prefix, prefix1, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix1}` } } }, @@ -116,7 +124,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods8['post']['reqBody'], config?: T }) => fetch(prefix, PATH9, POST, option).json(), $post: (option: { body: Methods8['post']['reqBody'], config?: T }) => - fetch(prefix, PATH9, POST, option).json().then(r => r.body) + fetch(prefix, PATH9, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH9}` }, upload: { files: { @@ -131,19 +140,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { config?: T }) => fetch(prefix, prefix2, DELETE, option).json(), $delete: (option?: { config?: T }) => - fetch(prefix, prefix2, DELETE, option).json().then(r => r.body) + fetch(prefix, prefix2, DELETE, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}` } }, count: { get: (option?: { config?: T }) => fetch(prefix, PATH12, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH12, GET, option).json().then(r => r.body) + fetch(prefix, PATH12, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH12}` }, get: (option?: { config?: T }) => fetch(prefix, PATH11, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH11, GET, option).json().then(r => r.body) + fetch(prefix, PATH11, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH11}` }, search: { _id: (val3: string) => { @@ -153,14 +165,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix3, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix3, GET, option).json().then(r => r.body) + fetch(prefix, prefix3, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix3}` } } }, post: (option: { body: Methods9['post']['reqBody'], config?: T }) => fetch(prefix, PATH10, POST, option).json(), $post: (option: { body: Methods9['post']['reqBody'], config?: T }) => - fetch(prefix, PATH10, POST, option).json().then(r => r.body) + fetch(prefix, PATH10, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH10}` }, users: { _id: (val4: string) => { @@ -178,26 +192,31 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { config?: T }) => fetch(prefix, prefix4, DELETE, option).json(), $delete: (option?: { config?: T }) => - fetch(prefix, prefix4, DELETE, option).json().then(r => r.body) + fetch(prefix, prefix4, DELETE, option).json().then(r => r.body), + $path: () => `${prefix}${prefix4}` } }, me: { get: (option?: { config?: T }) => fetch(prefix, PATH15, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH15, GET, option).json().then(r => r.body) + fetch(prefix, PATH15, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH15}` }, get: (option?: { query?: Methods14['get']['query'], config?: T }) => fetch(prefix, PATH14, GET, option).json(), $get: (option?: { query?: Methods14['get']['query'], config?: T }) => - fetch(prefix, PATH14, GET, option).json().then(r => r.body) + fetch(prefix, PATH14, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods14['get']['query'] }) => + `${prefix}${PATH14}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, users_permissions: { init: { get: (option?: { config?: T }) => fetch(prefix, PATH16, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH16, GET, option).json().then(r => r.body) + fetch(prefix, PATH16, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH16}` }, roles: { _id: (val5: string) => { @@ -207,7 +226,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix5, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix5, GET, option).json().then(r => r.body) + fetch(prefix, prefix5, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix5}` } }, _role: (val6: string) => { @@ -221,7 +241,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { config?: T }) => fetch(prefix, prefix6, DELETE, option).json(), $delete: (option?: { config?: T }) => - fetch(prefix, prefix6, DELETE, option).json().then(r => r.body) + fetch(prefix, prefix6, DELETE, option).json().then(r => r.body), + $path: () => `${prefix}${prefix6}` } }, get: (option?: { query?: Methods18['get']['query'], config?: T }) => @@ -231,7 +252,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods18['post']['reqBody'], config?: T }) => fetch(prefix, PATH17, POST, option).json(), $post: (option: { body: Methods18['post']['reqBody'], config?: T }) => - fetch(prefix, PATH17, POST, option).json().then(r => r.body) + fetch(prefix, PATH17, POST, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods18['get']['query'] }) => + `${prefix}${PATH17}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, search: { _id: (val7: string) => { @@ -241,7 +264,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { query?: Methods21['get']['query'], config?: T }) => fetch(prefix, prefix7, GET, option).json(), $get: (option?: { query?: Methods21['get']['query'], config?: T }) => - fetch(prefix, prefix7, GET, option).json().then(r => r.body) + fetch(prefix, prefix7, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods21['get']['query'] }) => + `${prefix}${prefix7}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } diff --git a/samples/strapi/auth/$api.ts b/samples/strapi/auth/$api.ts index c03d5770..8ee16679 100644 --- a/samples/strapi/auth/$api.ts +++ b/samples/strapi/auth/$api.ts @@ -8,18 +8,18 @@ import { Methods as Methods4 } from './local/register' import { Methods as Methods5 } from './reset-password' import { Methods as Methods6 } from './send-email-confirmation' -const GET = 'GET' -const POST = 'POST' -const PATH0 = '/auth' -const PATH1 = '/callback' -const PATH2 = '/auth/email-confirmation' -const PATH3 = '/auth/forgot-password' -const PATH4 = '/auth/local' -const PATH5 = '/auth/local/register' -const PATH6 = '/auth/reset-password' -const PATH7 = '/auth/send-email-confirmation' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/auth' + const PATH1 = '/callback' + const PATH2 = '/auth/email-confirmation' + const PATH3 = '/auth/forgot-password' + const PATH4 = '/auth/local' + const PATH5 = '/auth/local/register' + const PATH6 = '/auth/reset-password' + const PATH7 = '/auth/send-email-confirmation' + const GET = 'GET' + const POST = 'POST' return { _provider: (val0: string) => { @@ -30,7 +30,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, `${prefix0}${PATH1}`, GET, option).json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH1}`, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH1}` } } }, @@ -38,37 +39,43 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, PATH2, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH2, GET, option).json().then(r => r.body) + fetch(prefix, PATH2, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH2}` }, forgot_password: { post: (option: { body: Methods2['post']['reqBody'], config?: T }) => fetch(prefix, PATH3, POST, option).json(), $post: (option: { body: Methods2['post']['reqBody'], config?: T }) => - fetch(prefix, PATH3, POST, option).json().then(r => r.body) + fetch(prefix, PATH3, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH3}` }, local: { register: { post: (option: { body: Methods4['post']['reqBody'], config?: T }) => fetch(prefix, PATH5, POST, option).json(), $post: (option: { body: Methods4['post']['reqBody'], config?: T }) => - fetch(prefix, PATH5, POST, option).json().then(r => r.body) + fetch(prefix, PATH5, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH5}` }, post: (option: { body: Methods3['post']['reqBody'], config?: T }) => fetch(prefix, PATH4, POST, option).json(), $post: (option: { body: Methods3['post']['reqBody'], config?: T }) => - fetch(prefix, PATH4, POST, option).json().then(r => r.body) + fetch(prefix, PATH4, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH4}` }, reset_password: { post: (option: { body: Methods5['post']['reqBody'], config?: T }) => fetch(prefix, PATH6, POST, option).json(), $post: (option: { body: Methods5['post']['reqBody'], config?: T }) => - fetch(prefix, PATH6, POST, option).json().then(r => r.body) + fetch(prefix, PATH6, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH6}` }, send_email_confirmation: { post: (option: { body: Methods6['post']['reqBody'], config?: T }) => fetch(prefix, PATH7, POST, option).json(), $post: (option: { body: Methods6['post']['reqBody'], config?: T }) => - fetch(prefix, PATH7, POST, option).json().then(r => r.body) + fetch(prefix, PATH7, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH7}` } } } diff --git a/samples/strapi/auth/email-confirmation/$api.ts b/samples/strapi/auth/email-confirmation/$api.ts index 53771fe1..a1f06501 100644 --- a/samples/strapi/auth/email-confirmation/$api.ts +++ b/samples/strapi/auth/email-confirmation/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/auth/email-confirmation' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/auth/email-confirmation' + const GET = 'GET' return { get: (option?: { config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/strapi/auth/forgot-password/$api.ts b/samples/strapi/auth/forgot-password/$api.ts index 04e4db63..04e9bd9a 100644 --- a/samples/strapi/auth/forgot-password/$api.ts +++ b/samples/strapi/auth/forgot-password/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/auth/forgot-password' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/auth/forgot-password' + const POST = 'POST' return { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/strapi/auth/local/$api.ts b/samples/strapi/auth/local/$api.ts index 8f728402..e0d98d95 100644 --- a/samples/strapi/auth/local/$api.ts +++ b/samples/strapi/auth/local/$api.ts @@ -3,23 +3,25 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './register' -const POST = 'POST' -const PATH0 = '/auth/local' -const PATH1 = '/auth/local/register' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/auth/local' + const PATH1 = '/auth/local/register' + const POST = 'POST' return { register: { post: (option: { body: Methods1['post']['reqBody'], config?: T }) => fetch(prefix, PATH1, POST, option).json(), $post: (option: { body: Methods1['post']['reqBody'], config?: T }) => - fetch(prefix, PATH1, POST, option).json().then(r => r.body) + fetch(prefix, PATH1, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH1}` }, post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/strapi/auth/local/register/$api.ts b/samples/strapi/auth/local/register/$api.ts index 750757f1..5967f9ad 100644 --- a/samples/strapi/auth/local/register/$api.ts +++ b/samples/strapi/auth/local/register/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/auth/local/register' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/auth/local/register' + const POST = 'POST' return { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/strapi/auth/reset-password/$api.ts b/samples/strapi/auth/reset-password/$api.ts index 2dc23f41..e4184d70 100644 --- a/samples/strapi/auth/reset-password/$api.ts +++ b/samples/strapi/auth/reset-password/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/auth/reset-password' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/auth/reset-password' + const POST = 'POST' return { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/strapi/auth/send-email-confirmation/$api.ts b/samples/strapi/auth/send-email-confirmation/$api.ts index fe55dce4..7651bd4d 100644 --- a/samples/strapi/auth/send-email-confirmation/$api.ts +++ b/samples/strapi/auth/send-email-confirmation/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/auth/send-email-confirmation' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/auth/send-email-confirmation' + const POST = 'POST' return { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/strapi/connect/$api.ts b/samples/strapi/connect/$api.ts index f39ab691..76bb1b41 100644 --- a/samples/strapi/connect/$api.ts +++ b/samples/strapi/connect/$api.ts @@ -2,10 +2,10 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from './_any' -const GET = 'GET' -const PATH0 = '/connect' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/connect' + const GET = 'GET' return { _any: (val0: number | string) => { @@ -15,7 +15,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix0, GET, option).json().then(r => r.body) + fetch(prefix, prefix0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}` } } } diff --git a/samples/strapi/email/$api.ts b/samples/strapi/email/$api.ts index 6279d2e3..9c78bd72 100644 --- a/samples/strapi/email/$api.ts +++ b/samples/strapi/email/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/email' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/email' + const POST = 'POST' return { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/strapi/upload/$api.ts b/samples/strapi/upload/$api.ts index 9d5f9618..9d631866 100644 --- a/samples/strapi/upload/$api.ts +++ b/samples/strapi/upload/$api.ts @@ -6,15 +6,15 @@ import { Methods as Methods2 } from './files/_id@string' import { Methods as Methods3 } from './files/count' import { Methods as Methods4 } from './search/_id@string' -const GET = 'GET' -const POST = 'POST' -const DELETE = 'DELETE' -const PATH0 = '/upload' -const PATH1 = '/upload/files' -const PATH2 = '/upload/files/count' -const PATH3 = '/upload/search' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/upload' + const PATH1 = '/upload/files' + const PATH2 = '/upload/files/count' + const PATH3 = '/upload/search' + const GET = 'GET' + const POST = 'POST' + const DELETE = 'DELETE' return { files: { @@ -29,19 +29,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { config?: T }) => fetch(prefix, prefix0, DELETE, option).json(), $delete: (option?: { config?: T }) => - fetch(prefix, prefix0, DELETE, option).json().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, count: { get: (option?: { config?: T }) => fetch(prefix, PATH2, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH2, GET, option).json().then(r => r.body) + fetch(prefix, PATH2, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH2}` }, get: (option?: { config?: T }) => fetch(prefix, PATH1, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH1, GET, option).json().then(r => r.body) + fetch(prefix, PATH1, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH1}` }, search: { _id: (val1: string) => { @@ -51,14 +54,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix1, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix1, GET, option).json().then(r => r.body) + fetch(prefix, prefix1, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix1}` } } }, post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/strapi/upload/files/$api.ts b/samples/strapi/upload/files/$api.ts index a5b45217..59c9397d 100644 --- a/samples/strapi/upload/files/$api.ts +++ b/samples/strapi/upload/files/$api.ts @@ -4,12 +4,12 @@ import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@string' import { Methods as Methods2 } from './count' -const GET = 'GET' -const DELETE = 'DELETE' -const PATH0 = '/upload/files' -const PATH1 = '/upload/files/count' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/upload/files' + const PATH1 = '/upload/files/count' + const GET = 'GET' + const DELETE = 'DELETE' return { _id: (val0: string) => { @@ -23,19 +23,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { config?: T }) => fetch(prefix, prefix0, DELETE, option).json(), $delete: (option?: { config?: T }) => - fetch(prefix, prefix0, DELETE, option).json().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, count: { get: (option?: { config?: T }) => fetch(prefix, PATH1, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH1, GET, option).json().then(r => r.body) + fetch(prefix, PATH1, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH1}` }, get: (option?: { config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/strapi/upload/files/count/$api.ts b/samples/strapi/upload/files/count/$api.ts index 209d5802..ca8c086a 100644 --- a/samples/strapi/upload/files/count/$api.ts +++ b/samples/strapi/upload/files/count/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/upload/files/count' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/upload/files/count' + const GET = 'GET' return { get: (option?: { config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/strapi/upload/search/$api.ts b/samples/strapi/upload/search/$api.ts index 85433cdf..f1692602 100644 --- a/samples/strapi/upload/search/$api.ts +++ b/samples/strapi/upload/search/$api.ts @@ -2,10 +2,10 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from './_id@string' -const GET = 'GET' -const PATH0 = '/upload/search' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/upload/search' + const GET = 'GET' return { _id: (val0: string) => { @@ -15,7 +15,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix0, GET, option).json().then(r => r.body) + fetch(prefix, prefix0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}` } } } diff --git a/samples/strapi/users-permissions/$api.ts b/samples/strapi/users-permissions/$api.ts index 4d30d534..4895e7e9 100644 --- a/samples/strapi/users-permissions/$api.ts +++ b/samples/strapi/users-permissions/$api.ts @@ -1,27 +1,28 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './init' import { Methods as Methods1 } from './roles' import { Methods as Methods2 } from './roles/_id@string' import { Methods as Methods3 } from './roles/_role@string' import { Methods as Methods4 } from './search/_id@string' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/users-permissions/init' -const PATH1 = '/users-permissions/roles' -const PATH2 = '/users-permissions/search' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/users-permissions/init' + const PATH1 = '/users-permissions/roles' + const PATH2 = '/users-permissions/search' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { init: { get: (option?: { config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` }, roles: { _id: (val0: string) => { @@ -31,7 +32,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix0, GET, option).json().then(r => r.body) + fetch(prefix, prefix0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, _role: (val1: string) => { @@ -45,7 +47,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { config?: T }) => fetch(prefix, prefix1, DELETE, option).json(), $delete: (option?: { config?: T }) => - fetch(prefix, prefix1, DELETE, option).json().then(r => r.body) + fetch(prefix, prefix1, DELETE, option).json().then(r => r.body), + $path: () => `${prefix}${prefix1}` } }, get: (option?: { query?: Methods1['get']['query'], config?: T }) => @@ -55,7 +58,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods1['post']['reqBody'], config?: T }) => fetch(prefix, PATH1, POST, option).json(), $post: (option: { body: Methods1['post']['reqBody'], config?: T }) => - fetch(prefix, PATH1, POST, option).json().then(r => r.body) + fetch(prefix, PATH1, POST, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => + `${prefix}${PATH1}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, search: { _id: (val2: string) => { @@ -65,7 +70,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { query?: Methods4['get']['query'], config?: T }) => fetch(prefix, prefix2, GET, option).json(), $get: (option?: { query?: Methods4['get']['query'], config?: T }) => - fetch(prefix, prefix2, GET, option).json().then(r => r.body) + fetch(prefix, prefix2, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods4['get']['query'] }) => + `${prefix}${prefix2}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } diff --git a/samples/strapi/users-permissions/init/$api.ts b/samples/strapi/users-permissions/init/$api.ts index 9b00973e..a1c38f9f 100644 --- a/samples/strapi/users-permissions/init/$api.ts +++ b/samples/strapi/users-permissions/init/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/users-permissions/init' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/users-permissions/init' + const GET = 'GET' return { get: (option?: { config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/strapi/users-permissions/roles/$api.ts b/samples/strapi/users-permissions/roles/$api.ts index 681671ae..57a8d5f3 100644 --- a/samples/strapi/users-permissions/roles/$api.ts +++ b/samples/strapi/users-permissions/roles/$api.ts @@ -1,16 +1,16 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@string' import { Methods as Methods2 } from './_role@string' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/users-permissions/roles' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/users-permissions/roles' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _id: (val0: string) => { @@ -20,7 +20,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { config?: T }) => fetch(prefix, prefix0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, prefix0, GET, option).json().then(r => r.body) + fetch(prefix, prefix0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, _role: (val1: string) => { @@ -34,7 +35,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { config?: T }) => fetch(prefix, prefix1, DELETE, option).json(), $delete: (option?: { config?: T }) => - fetch(prefix, prefix1, DELETE, option).json().then(r => r.body) + fetch(prefix, prefix1, DELETE, option).json().then(r => r.body), + $path: () => `${prefix}${prefix1}` } }, get: (option?: { query?: Methods0['get']['query'], config?: T }) => @@ -44,7 +46,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/strapi/users-permissions/search/$api.ts b/samples/strapi/users-permissions/search/$api.ts index 6244138e..3a96a416 100644 --- a/samples/strapi/users-permissions/search/$api.ts +++ b/samples/strapi/users-permissions/search/$api.ts @@ -1,11 +1,11 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './_id@string' -const GET = 'GET' -const PATH0 = '/users-permissions/search' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/users-permissions/search' + const GET = 'GET' return { _id: (val0: string) => { @@ -15,7 +15,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { get: (option?: { query?: Methods0['get']['query'], config?: T }) => fetch(prefix, prefix0, GET, option).json(), $get: (option?: { query?: Methods0['get']['query'], config?: T }) => - fetch(prefix, prefix0, GET, option).json().then(r => r.body) + fetch(prefix, prefix0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${prefix0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } } diff --git a/samples/strapi/users/$api.ts b/samples/strapi/users/$api.ts index 12ecfda9..cdd58837 100644 --- a/samples/strapi/users/$api.ts +++ b/samples/strapi/users/$api.ts @@ -1,16 +1,16 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_id@string' import { Methods as Methods2 } from './me' -const GET = 'GET' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/users' -const PATH1 = '/users/me' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/users' + const PATH1 = '/users/me' + const GET = 'GET' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _id: (val0: string) => { @@ -28,19 +28,23 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { config?: T }) => fetch(prefix, prefix0, DELETE, option).json(), $delete: (option?: { config?: T }) => - fetch(prefix, prefix0, DELETE, option).json().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).json().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, me: { get: (option?: { config?: T }) => fetch(prefix, PATH1, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH1, GET, option).json().then(r => r.body) + fetch(prefix, PATH1, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH1}` }, get: (option?: { query?: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { query?: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/strapi/users/me/$api.ts b/samples/strapi/users/me/$api.ts index aca372a2..1919acf2 100644 --- a/samples/strapi/users/me/$api.ts +++ b/samples/strapi/users/me/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/users/me' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'http://localhost:1337' : baseURL).replace(/\/$/, '') + const PATH0 = '/users/me' + const GET = 'GET' return { get: (option?: { config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/swagger/$api.ts b/samples/swagger/$api.ts index b0f244d5..5d22ae9d 100644 --- a/samples/swagger/$api.ts +++ b/samples/swagger/$api.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from './pet' import { Methods as Methods1 } from './pet/_petId@number' import { Methods as Methods2 } from './pet/_petId@number/uploadImage' @@ -13,21 +13,21 @@ import { Methods as Methods9 } from './user/createWithArray' import { Methods as Methods10 } from './user/createWithList' import { Methods as Methods11 } from './user/login' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/pet' -const PATH1 = '/uploadImage' -const PATH2 = '/pet/findByStatus' -const PATH3 = '/store/inventory' -const PATH4 = '/store/order' -const PATH5 = '/user' -const PATH6 = '/user/createWithArray' -const PATH7 = '/user/createWithList' -const PATH8 = '/user/login' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://petstore.swagger.io/v2' : baseURL).replace(/\/$/, '') + const PATH0 = '/pet' + const PATH1 = '/uploadImage' + const PATH2 = '/pet/findByStatus' + const PATH3 = '/store/inventory' + const PATH4 = '/store/order' + const PATH5 = '/user' + const PATH6 = '/user/createWithArray' + const PATH7 = '/user/createWithList' + const PATH8 = '/user/login' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { pet: { @@ -39,7 +39,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods2['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods2['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH1}` }, get: (option?: { config?: T }) => fetch(prefix, prefix0, GET, option).json(), @@ -52,14 +53,17 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { headers?: Methods1['delete']['reqHeaders'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option?: { headers?: Methods1['delete']['reqHeaders'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, findByStatus: { get: (option: { query: Methods3['get']['query'], config?: T }) => fetch(prefix, PATH2, GET, option).json(), $get: (option: { query: Methods3['get']['query'], config?: T }) => - fetch(prefix, PATH2, GET, option).json().then(r => r.body) + fetch(prefix, PATH2, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods3['get']['query'] }) => + `${prefix}${PATH2}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).send(), @@ -68,14 +72,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option: { body: Methods0['put']['reqBody'], config?: T }) => fetch(prefix, PATH0, PUT, option).send(), $put: (option: { body: Methods0['put']['reqBody'], config?: T }) => - fetch(prefix, PATH0, PUT, option).send().then(r => r.body) + fetch(prefix, PATH0, PUT, option).send().then(r => r.body), + $path: () => `${prefix}${PATH0}` }, store: { inventory: { get: (option?: { config?: T }) => fetch(prefix, PATH3, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH3, GET, option).json().then(r => r.body) + fetch(prefix, PATH3, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH3}` }, order: { _orderId: (val1: number) => { @@ -89,13 +95,15 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { config?: T }) => fetch(prefix, prefix1, DELETE, option).send(), $delete: (option?: { config?: T }) => - fetch(prefix, prefix1, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix1, DELETE, option).send().then(r => r.body), + $path: () => `${prefix}${prefix1}` } }, post: (option: { body: Methods5['post']['reqBody'], config?: T }) => fetch(prefix, PATH4, POST, option).json(), $post: (option: { body: Methods5['post']['reqBody'], config?: T }) => - fetch(prefix, PATH4, POST, option).json().then(r => r.body) + fetch(prefix, PATH4, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH4}` } }, user: { @@ -114,31 +122,37 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { config?: T }) => fetch(prefix, prefix2, DELETE, option).send(), $delete: (option?: { config?: T }) => - fetch(prefix, prefix2, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix2, DELETE, option).send().then(r => r.body), + $path: () => `${prefix}${prefix2}` } }, createWithArray: { post: (option: { body: Methods9['post']['reqBody'], config?: T }) => fetch(prefix, PATH6, POST, option).send(), $post: (option: { body: Methods9['post']['reqBody'], config?: T }) => - fetch(prefix, PATH6, POST, option).send().then(r => r.body) + fetch(prefix, PATH6, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH6}` }, createWithList: { post: (option: { body: Methods10['post']['reqBody'], config?: T }) => fetch(prefix, PATH7, POST, option).send(), $post: (option: { body: Methods10['post']['reqBody'], config?: T }) => - fetch(prefix, PATH7, POST, option).send().then(r => r.body) + fetch(prefix, PATH7, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH7}` }, login: { get: (option: { query: Methods11['get']['query'], config?: T }) => fetch(prefix, PATH8, GET, option).text(), $get: (option: { query: Methods11['get']['query'], config?: T }) => - fetch(prefix, PATH8, GET, option).text().then(r => r.body) + fetch(prefix, PATH8, GET, option).text().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods11['get']['query'] }) => + `${prefix}${PATH8}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, post: (option: { body: Methods7['post']['reqBody'], config?: T }) => fetch(prefix, PATH5, POST, option).send(), $post: (option: { body: Methods7['post']['reqBody'], config?: T }) => - fetch(prefix, PATH5, POST, option).send().then(r => r.body) + fetch(prefix, PATH5, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH5}` } } } diff --git a/samples/swagger/pet/$api.ts b/samples/swagger/pet/$api.ts index 97a2f645..226398b3 100644 --- a/samples/swagger/pet/$api.ts +++ b/samples/swagger/pet/$api.ts @@ -1,19 +1,19 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_petId@number' import { Methods as Methods2 } from './_petId@number/uploadImage' import { Methods as Methods3 } from './findByStatus' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/pet' -const PATH1 = '/uploadImage' -const PATH2 = '/pet/findByStatus' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://petstore.swagger.io/v2' : baseURL).replace(/\/$/, '') + const PATH0 = '/pet' + const PATH1 = '/uploadImage' + const PATH2 = '/pet/findByStatus' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _petId: (val0: number) => { @@ -24,7 +24,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { post: (option?: { body?: Methods2['post']['reqBody'], config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'FormData').json(), $post: (option?: { body?: Methods2['post']['reqBody'], config?: T }) => - fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'FormData').json().then(r => r.body) + fetch(prefix, `${prefix0}${PATH1}`, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${prefix0}${PATH1}` }, get: (option?: { config?: T }) => fetch(prefix, prefix0, GET, option).json(), @@ -37,14 +38,17 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { headers?: Methods1['delete']['reqHeaders'], config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option?: { headers?: Methods1['delete']['reqHeaders'], config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, findByStatus: { get: (option: { query: Methods3['get']['query'], config?: T }) => fetch(prefix, PATH2, GET, option).json(), $get: (option: { query: Methods3['get']['query'], config?: T }) => - fetch(prefix, PATH2, GET, option).json().then(r => r.body) + fetch(prefix, PATH2, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods3['get']['query'] }) => + `${prefix}${PATH2}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).send(), @@ -53,7 +57,8 @@ const api = ({ baseURL, fetch }: AspidaClient) => { put: (option: { body: Methods0['put']['reqBody'], config?: T }) => fetch(prefix, PATH0, PUT, option).send(), $put: (option: { body: Methods0['put']['reqBody'], config?: T }) => - fetch(prefix, PATH0, PUT, option).send().then(r => r.body) + fetch(prefix, PATH0, PUT, option).send().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/swagger/pet/findByStatus/$api.ts b/samples/swagger/pet/findByStatus/$api.ts index 0560e1fa..e645bbfe 100644 --- a/samples/swagger/pet/findByStatus/$api.ts +++ b/samples/swagger/pet/findByStatus/$api.ts @@ -1,17 +1,19 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/pet/findByStatus' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://petstore.swagger.io/v2' : baseURL).replace(/\/$/, '') + const PATH0 = '/pet/findByStatus' + const GET = 'GET' return { get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/swagger/store/$api.ts b/samples/swagger/store/$api.ts index e6cf286d..a888f82b 100644 --- a/samples/swagger/store/$api.ts +++ b/samples/swagger/store/$api.ts @@ -4,20 +4,21 @@ import { Methods as Methods0 } from './inventory' import { Methods as Methods1 } from './order' import { Methods as Methods2 } from './order/_orderId@number' -const GET = 'GET' -const POST = 'POST' -const DELETE = 'DELETE' -const PATH0 = '/store/inventory' -const PATH1 = '/store/order' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://petstore.swagger.io/v2' : baseURL).replace(/\/$/, '') + const PATH0 = '/store/inventory' + const PATH1 = '/store/order' + const GET = 'GET' + const POST = 'POST' + const DELETE = 'DELETE' return { inventory: { get: (option?: { config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` }, order: { _orderId: (val0: number) => { @@ -31,13 +32,15 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option?: { config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, post: (option: { body: Methods1['post']['reqBody'], config?: T }) => fetch(prefix, PATH1, POST, option).json(), $post: (option: { body: Methods1['post']['reqBody'], config?: T }) => - fetch(prefix, PATH1, POST, option).json().then(r => r.body) + fetch(prefix, PATH1, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH1}` } } } diff --git a/samples/swagger/store/inventory/$api.ts b/samples/swagger/store/inventory/$api.ts index 5241d3b5..78917569 100644 --- a/samples/swagger/store/inventory/$api.ts +++ b/samples/swagger/store/inventory/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/store/inventory' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://petstore.swagger.io/v2' : baseURL).replace(/\/$/, '') + const PATH0 = '/store/inventory' + const GET = 'GET' return { get: (option?: { config?: T }) => fetch(prefix, PATH0, GET, option).json(), $get: (option?: { config?: T }) => - fetch(prefix, PATH0, GET, option).json().then(r => r.body) + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/swagger/store/order/$api.ts b/samples/swagger/store/order/$api.ts index d025e321..e95d9c5e 100644 --- a/samples/swagger/store/order/$api.ts +++ b/samples/swagger/store/order/$api.ts @@ -3,12 +3,12 @@ import { AspidaClient, BasicHeaders } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_orderId@number' -const GET = 'GET' -const POST = 'POST' -const DELETE = 'DELETE' -const PATH0 = '/store/order' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://petstore.swagger.io/v2' : baseURL).replace(/\/$/, '') + const PATH0 = '/store/order' + const GET = 'GET' + const POST = 'POST' + const DELETE = 'DELETE' return { _orderId: (val0: number) => { @@ -22,13 +22,15 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option?: { config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).json(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option).json().then(r => r.body) + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/swagger/user/$api.ts b/samples/swagger/user/$api.ts index 3d0f8e7e..2fd20ab8 100644 --- a/samples/swagger/user/$api.ts +++ b/samples/swagger/user/$api.ts @@ -1,21 +1,21 @@ /* eslint-disable */ -import { AspidaClient, BasicHeaders } from 'aspida' +import { AspidaClient, BasicHeaders, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' import { Methods as Methods1 } from './_username@string' import { Methods as Methods2 } from './createWithArray' import { Methods as Methods3 } from './createWithList' import { Methods as Methods4 } from './login' -const GET = 'GET' -const POST = 'POST' -const PUT = 'PUT' -const DELETE = 'DELETE' -const PATH0 = '/user' -const PATH1 = '/user/createWithArray' -const PATH2 = '/user/createWithList' -const PATH3 = '/user/login' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://petstore.swagger.io/v2' : baseURL).replace(/\/$/, '') + const PATH0 = '/user' + const PATH1 = '/user/createWithArray' + const PATH2 = '/user/createWithList' + const PATH3 = '/user/login' + const GET = 'GET' + const POST = 'POST' + const PUT = 'PUT' + const DELETE = 'DELETE' return { _username: (val0: string) => { @@ -33,31 +33,37 @@ const api = ({ baseURL, fetch }: AspidaClient) => { delete: (option?: { config?: T }) => fetch(prefix, prefix0, DELETE, option).send(), $delete: (option?: { config?: T }) => - fetch(prefix, prefix0, DELETE, option).send().then(r => r.body) + fetch(prefix, prefix0, DELETE, option).send().then(r => r.body), + $path: () => `${prefix}${prefix0}` } }, createWithArray: { post: (option: { body: Methods2['post']['reqBody'], config?: T }) => fetch(prefix, PATH1, POST, option).send(), $post: (option: { body: Methods2['post']['reqBody'], config?: T }) => - fetch(prefix, PATH1, POST, option).send().then(r => r.body) + fetch(prefix, PATH1, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH1}` }, createWithList: { post: (option: { body: Methods3['post']['reqBody'], config?: T }) => fetch(prefix, PATH2, POST, option).send(), $post: (option: { body: Methods3['post']['reqBody'], config?: T }) => - fetch(prefix, PATH2, POST, option).send().then(r => r.body) + fetch(prefix, PATH2, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH2}` }, login: { get: (option: { query: Methods4['get']['query'], config?: T }) => fetch(prefix, PATH3, GET, option).text(), $get: (option: { query: Methods4['get']['query'], config?: T }) => - fetch(prefix, PATH3, GET, option).text().then(r => r.body) + fetch(prefix, PATH3, GET, option).text().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods4['get']['query'] }) => + `${prefix}${PATH3}${option?.query ? `?${dataToURLString(option.query)}` : ''}` }, post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).send(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option).send().then(r => r.body) + fetch(prefix, PATH0, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/swagger/user/createWithArray/$api.ts b/samples/swagger/user/createWithArray/$api.ts index c7857ac7..28604e0d 100644 --- a/samples/swagger/user/createWithArray/$api.ts +++ b/samples/swagger/user/createWithArray/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/user/createWithArray' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://petstore.swagger.io/v2' : baseURL).replace(/\/$/, '') + const PATH0 = '/user/createWithArray' + const POST = 'POST' return { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).send(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option).send().then(r => r.body) + fetch(prefix, PATH0, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/swagger/user/createWithList/$api.ts b/samples/swagger/user/createWithList/$api.ts index 66f63316..008188e1 100644 --- a/samples/swagger/user/createWithList/$api.ts +++ b/samples/swagger/user/createWithList/$api.ts @@ -2,16 +2,17 @@ import { AspidaClient } from 'aspida' import { Methods as Methods0 } from '.' -const POST = 'POST' -const PATH0 = '/user/createWithList' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://petstore.swagger.io/v2' : baseURL).replace(/\/$/, '') + const PATH0 = '/user/createWithList' + const POST = 'POST' return { post: (option: { body: Methods0['post']['reqBody'], config?: T }) => fetch(prefix, PATH0, POST, option).send(), $post: (option: { body: Methods0['post']['reqBody'], config?: T }) => - fetch(prefix, PATH0, POST, option).send().then(r => r.body) + fetch(prefix, PATH0, POST, option).send().then(r => r.body), + $path: () => `${prefix}${PATH0}` } } diff --git a/samples/swagger/user/login/$api.ts b/samples/swagger/user/login/$api.ts index 7e7054fd..07b79a9b 100644 --- a/samples/swagger/user/login/$api.ts +++ b/samples/swagger/user/login/$api.ts @@ -1,17 +1,19 @@ /* eslint-disable */ -import { AspidaClient } from 'aspida' +import { AspidaClient, dataToURLString } from 'aspida' import { Methods as Methods0 } from '.' -const GET = 'GET' -const PATH0 = '/user/login' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://petstore.swagger.io/v2' : baseURL).replace(/\/$/, '') + const PATH0 = '/user/login' + const GET = 'GET' return { get: (option: { query: Methods0['get']['query'], config?: T }) => fetch(prefix, PATH0, GET, option).text(), $get: (option: { query: Methods0['get']['query'], config?: T }) => - fetch(prefix, PATH0, GET, option).text().then(r => r.body) + fetch(prefix, PATH0, GET, option).text().then(r => r.body), + $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => + `${prefix}${PATH0}${option?.query ? `?${dataToURLString(option.query)}` : ''}` } } diff --git a/samples/swagger/user/logout/$api.ts b/samples/swagger/user/logout/$api.ts index f9e0e2cf..25a34f25 100644 --- a/samples/swagger/user/logout/$api.ts +++ b/samples/swagger/user/logout/$api.ts @@ -5,6 +5,8 @@ import { AspidaClient } from 'aspida' const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? 'https://petstore.swagger.io/v2' : baseURL).replace(/\/$/, '') + + return { } diff --git a/yarn.lock b/yarn.lock index fdf0e048..35b57eb3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -963,10 +963,10 @@ asn1@~0.2.3: dependencies: safer-buffer "~2.1.0" -aspida@^0.20.3: - version "0.20.3" - resolved "https://registry.yarnpkg.com/aspida/-/aspida-0.20.3.tgz#86c8d88e38fa92973f1bddedb913508476dfe660" - integrity sha512-XOt8Udd86BE33ku/bVGLNxmVFhDN+IlV4i8tK1WIhaWtGdBalP0dC5c4PBDhuWraKPgjUzNNw+utwF9HLV0mgg== +aspida@^0.21.0: + version "0.21.0" + resolved "https://registry.yarnpkg.com/aspida/-/aspida-0.21.0.tgz#1e957a06fc654d76c35c6499e32e1fc241387fd3" + integrity sha512-kzEytM0Ye/b523WWB5ajGtIJNis5XiA/3K5J0B7w0o7r5GcyhiKdtpcM7l/KYuojS8UUVPtJ5o909etLxfiFAw== dependencies: "@types/minimist" "^1.2.0" chokidar "^3.4.2" From 9d5c4836efbb7fae80d2a3a2e58dc5d1256cf8d3 Mon Sep 17 00:00:00 2001 From: solufa Date: Thu, 3 Sep 2020 05:35:33 +0900 Subject: [PATCH 2/4] chore: update modules --- package.json | 10 +- yarn.lock | 400 +++++++++++++++++++++++++++++---------------------- 2 files changed, 237 insertions(+), 173 deletions(-) diff --git a/package.json b/package.json index 9256e601..a386938d 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "dependencies": { "aspida": "^0.21.0", "swagger-parser": "^10.0.1", - "swagger2openapi": "^6.2.3" + "swagger2openapi": "^7.0.0" }, "eslintConfig": { "env": { @@ -90,12 +90,12 @@ ] }, "devDependencies": { - "@types/jest": "^26.0.10", + "@types/jest": "^26.0.13", "@types/js-yaml": "^3.12.5", "@types/minimist": "^1.2.0", - "@typescript-eslint/eslint-plugin": "^3.10.1", - "@typescript-eslint/parser": "^3.10.1", - "eslint": "^7.7.0", + "@typescript-eslint/eslint-plugin": "^4.0.1", + "@typescript-eslint/parser": "^4.0.1", + "eslint": "^7.8.1", "eslint-config-prettier": "^6.11.0", "eslint-config-standard": "^14.1.1", "eslint-plugin-import": "^2.22.0", diff --git a/yarn.lock b/yarn.lock index 35b57eb3..0b6b39ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -263,13 +263,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/runtime@^7.0.0": - version "7.10.1" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.10.1.tgz#b6eb75cac279588d3100baecd1b9894ea2840822" - integrity sha512-nQbbCbQc9u/rpg1XCxoMYQTbSMVZjCDxErQ1ClCn9Pvcmv1lGads19ep0a2VsEiIJeHqjZley6EQGEC3Yo1xMA== - dependencies: - regenerator-runtime "^0.13.4" - "@babel/template@^7.10.1", "@babel/template@^7.3.3": version "7.10.1" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.1.tgz#e167154a94cb5f14b28dc58f5356d2162f539811" @@ -316,6 +309,27 @@ exec-sh "^0.3.2" minimist "^1.2.0" +"@eslint/eslintrc@^0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.1.3.tgz#7d1a2b2358552cc04834c0979bd4275362e37085" + integrity sha512-4YVwPkANLeNtRjMekzux1ci8hIaH5eGKktGqR0d3LWsKNn5B2X/1Z6Trxy7jQXl9EBGE6Yj02O+t09FMeRllaA== + dependencies: + ajv "^6.12.4" + debug "^4.1.1" + espree "^7.3.0" + globals "^12.1.0" + ignore "^4.0.6" + import-fresh "^3.2.1" + js-yaml "^3.13.1" + lodash "^4.17.19" + minimatch "^3.0.4" + strip-json-comments "^3.1.1" + +"@exodus/schemasafe@^1.0.0-rc.2": + version "1.0.0-rc.2" + resolved "https://registry.yarnpkg.com/@exodus/schemasafe/-/schemasafe-1.0.0-rc.2.tgz#3a0214ce90709f4d4c19d526890ed2e42b286a66" + integrity sha512-W98NvvOe/Med3o66xTO03pd7a2omZebH79PV64gSE+ceDdU8uxQhFTa7ISiD1kseyqyOrMyW5/MNdsGEU02i3Q== + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -528,6 +542,27 @@ resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== +"@nodelib/fs.scandir@2.1.3": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b" + integrity sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw== + dependencies: + "@nodelib/fs.stat" "2.0.3" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.3", "@nodelib/fs.stat@^2.0.2": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz#34dc5f4cabbc720f4e60f75a747e7ecd6c175bd3" + integrity sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz#011b9202a70a6366e436ca5c065844528ab04976" + integrity sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ== + dependencies: + "@nodelib/fs.scandir" "2.1.3" + fastq "^1.6.0" + "@sinonjs/commons@^1.7.0": version "1.8.0" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.0.tgz#c8d68821a854c555bba172f3b06959a0039b236d" @@ -591,11 +626,6 @@ resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== -"@types/eslint-visitor-keys@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" - integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== - "@types/graceful-fs@^4.1.2": version "4.1.3" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.3.tgz#039af35fe26bec35003e8d86d2ee9c586354348f" @@ -630,7 +660,7 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@26.x", "@types/jest@^26.0.10": +"@types/jest@26.x": version "26.0.10" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.10.tgz#8faf7e9756c033c39014ae76a7329efea00ea607" integrity sha512-i2m0oyh8w/Lum7wWK/YOZJakYF8Mx08UaKA1CtbmFeDquVhAEdA7znacsVSf2hJ1OQ/OfVMGN90pw/AtzF8s/Q== @@ -638,6 +668,14 @@ jest-diff "^25.2.1" pretty-format "^25.2.1" +"@types/jest@^26.0.13": + version "26.0.13" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.13.tgz#5a7b9d5312f5dd521a38329c38ee9d3802a0b85e" + integrity sha512-sCzjKow4z9LILc6DhBvn5AkIfmQzDZkgtVVKmGwVrs5tuid38ws281D4l+7x1kP487+FlKDh5kfMZ8WSPAdmdA== + dependencies: + jest-diff "^25.2.1" + pretty-format "^25.2.1" + "@types/js-yaml@^3.12.5": version "3.12.5" resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.12.5.tgz#136d5e6a57a931e1cce6f9d8126aa98a9c92a6bb" @@ -690,26 +728,28 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.10.1.tgz#7e061338a1383f59edc204c605899f93dc2e2c8f" - integrity sha512-PQg0emRtzZFWq6PxBcdxRH3QIQiyFO3WCVpRL3fgj5oQS3CDs3AeAKfv4DxNhzn8ITdNJGJ4D3Qw8eAJf3lXeQ== +"@typescript-eslint/eslint-plugin@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.0.1.tgz#88bde9239e29d688315718552cf80a3490491017" + integrity sha512-pQZtXupCn11O4AwpYVUX4PDFfmIJl90ZgrEBg0CEcqlwvPiG0uY81fimr1oMFblZnpKAq6prrT9a59pj1x58rw== dependencies: - "@typescript-eslint/experimental-utils" "3.10.1" + "@typescript-eslint/experimental-utils" "4.0.1" + "@typescript-eslint/scope-manager" "4.0.1" debug "^4.1.1" functional-red-black-tree "^1.0.1" regexpp "^3.0.0" semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.1.tgz#e179ffc81a80ebcae2ea04e0332f8b251345a686" - integrity sha512-DewqIgscDzmAfd5nOGe4zm6Bl7PKtMG2Ad0KG8CUZAHlXfAKTF9Ol5PXhiMh39yRL2ChRH1cuuUGOcVyyrhQIw== +"@typescript-eslint/experimental-utils@4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.0.1.tgz#7d9a3ab6821ad5274dad2186c1aa0d93afd696eb" + integrity sha512-gAqOjLiHoED79iYTt3F4uSHrYmg/GPz/zGezdB0jAdr6S6gwNiR/j7cTZ8nREKVzMVKLd9G3xbg1sV9GClW3sw== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/types" "3.10.1" - "@typescript-eslint/typescript-estree" "3.10.1" + "@typescript-eslint/scope-manager" "4.0.1" + "@typescript-eslint/types" "4.0.1" + "@typescript-eslint/typescript-estree" "4.0.1" eslint-scope "^5.0.0" eslint-utils "^2.0.0" @@ -723,21 +763,28 @@ eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/parser@^3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.10.1.tgz#1883858e83e8b442627e1ac6f408925211155467" - integrity sha512-Ug1RcWcrJP02hmtaXVS3axPPTTPnZjupqhgj+NnZ6BCkwSImWk/283347+x9wN+lqOdK9Eo3vsyiyDHgsmiEJw== +"@typescript-eslint/parser@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.0.1.tgz#73772080db7a7a4534a35d719e006f503e664dc3" + integrity sha512-1+qLmXHNAWSQ7RB6fdSQszAiA7JTwzakj5cNYjBTUmpH2cqilxMZEIV+DRKjVZs8NzP3ALmKexB0w/ExjcK9Iw== dependencies: - "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "3.10.1" - "@typescript-eslint/types" "3.10.1" - "@typescript-eslint/typescript-estree" "3.10.1" - eslint-visitor-keys "^1.1.0" + "@typescript-eslint/scope-manager" "4.0.1" + "@typescript-eslint/types" "4.0.1" + "@typescript-eslint/typescript-estree" "4.0.1" + debug "^4.1.1" -"@typescript-eslint/types@3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.10.1.tgz#1d7463fa7c32d8a23ab508a803ca2fe26e758727" - integrity sha512-+3+FCUJIahE9q0lDi1WleYzjCwJs5hIsbugIgnbB+dSCYUxl8L6PwmsyOPFZde2hc1DlTo/xnkOgiTLSyAbHiQ== +"@typescript-eslint/scope-manager@4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.0.1.tgz#24d93c3000bdfcc5a157dc4d32b742405a8631b5" + integrity sha512-u3YEXVJ8jsj7QCJk3om0Y457fy2euEOkkzxIB/LKU3MdyI+FJ2gI0M4aKEaXzwCSfNDiZ13a3lDo5DVozc+XLQ== + dependencies: + "@typescript-eslint/types" "4.0.1" + "@typescript-eslint/visitor-keys" "4.0.1" + +"@typescript-eslint/types@4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.0.1.tgz#1cf72582f764931f085cb8230ff215980fe467b2" + integrity sha512-S+gD3fgbkZYW2rnbjugNMqibm9HpEjqZBZkTiI3PwbbNGWmAcxolWIUwZ0SKeG4Dy2ktpKKaI/6+HGYVH8Qrlg== "@typescript-eslint/typescript-estree@2.34.0": version "2.34.0" @@ -752,26 +799,27 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/typescript-estree@3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.1.tgz#fd0061cc38add4fad45136d654408569f365b853" - integrity sha512-QbcXOuq6WYvnB3XPsZpIwztBoquEYLXh2MtwVU+kO8jgYCiv4G5xrSP/1wg4tkvrEE+esZVquIPX/dxPlePk1w== +"@typescript-eslint/typescript-estree@4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.0.1.tgz#29a43c7060641ec51c902d9f50ac7c5866ec479f" + integrity sha512-zGzleORFXrRWRJAMLTB2iJD1IZbCPkg4hsI8mGdpYlKaqzvKYSEWVAYh14eauaR+qIoZVWrXgYSXqLtTlxotiw== dependencies: - "@typescript-eslint/types" "3.10.1" - "@typescript-eslint/visitor-keys" "3.10.1" + "@typescript-eslint/types" "4.0.1" + "@typescript-eslint/visitor-keys" "4.0.1" debug "^4.1.1" - glob "^7.1.6" + globby "^11.0.1" is-glob "^4.0.1" lodash "^4.17.15" semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/visitor-keys@3.10.1": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.10.1.tgz#cd4274773e3eb63b2e870ac602274487ecd1e931" - integrity sha512-9JgC82AaQeglebjZMgYR5wgmfUdUc+EitGUUMW8u2nDckaeimzW+VsoLV6FoimPv2id3VQzfjwBxEMVz08ameQ== +"@typescript-eslint/visitor-keys@4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.0.1.tgz#d4e8de62775f2a6db71c7e8539633680039fdd6c" + integrity sha512-yBSqd6FjnTzbg5RUy9J+9kJEyQjTI34JdGMJz+9ttlJzLCnGkBikxw+N5n2VDcc3CesbIEJ0MnZc5uRYnrEnCw== dependencies: - eslint-visitor-keys "^1.1.0" + "@typescript-eslint/types" "4.0.1" + eslint-visitor-keys "^2.0.0" JSONStream@^1.0.4: version "1.3.5" @@ -809,26 +857,16 @@ acorn@^7.1.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.2.0.tgz#17ea7e40d7c8640ff54a694c889c26f31704effe" integrity sha512-apwXVmYVpQ34m/i71vrApRrRKCWQnZZF1+npOD0WV5xZFfwWOmKGQ2RWlfdy9vWITsenisM8M0Qeq8agcFHNiQ== -acorn@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.3.1.tgz#85010754db53c3fbaf3b9ea3e083aa5c5d147ffd" - integrity sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA== +acorn@^7.4.0: + version "7.4.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.0.tgz#e1ad486e6c54501634c6c397c5c121daa383607c" + integrity sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w== add-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" integrity sha1-anmQQ3ynNtXhKI25K9MmbV9csqo= -ajv@^5.5.2: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: version "6.12.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.2.tgz#c629c5eced17baf314437918d2da88c99d5958cd" @@ -839,6 +877,16 @@ ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^6.12.4: + version "6.12.4" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.4.tgz#0614facc4522127fa713445c6bfd3ebd376e2234" + integrity sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + ansi-colors@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -933,6 +981,11 @@ array-includes@^3.1.1: es-abstract "^1.17.0" is-string "^1.0.5" +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" @@ -1092,19 +1145,6 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -better-ajv-errors@^0.6.1, better-ajv-errors@^0.6.7: - version "0.6.7" - resolved "https://registry.yarnpkg.com/better-ajv-errors/-/better-ajv-errors-0.6.7.tgz#b5344af1ce10f434fe02fc4390a5a9c811e470d1" - integrity sha512-PYgt/sCzR4aGpyNy5+ViSQ77ognMnWq7745zM+/flYO4/Yisdtp9wDQW2IKCyVYPUxQt3E/b5GBSwfhd1LPdlg== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/runtime" "^7.0.0" - chalk "^2.4.1" - core-js "^3.2.1" - json-to-ast "^2.0.3" - jsonpointer "^4.0.1" - leven "^3.1.0" - binary-extensions@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.0.0.tgz#23c0df14f6a88077f5f986c0d167ec03c3d5537c" @@ -1248,7 +1288,7 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chalk@^2.0.0, chalk@^2.4.1, chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1322,11 +1362,6 @@ co@^4.6.0: resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= -code-error-fragment@0.0.230: - version "0.0.230" - resolved "https://registry.yarnpkg.com/code-error-fragment/-/code-error-fragment-0.0.230.tgz#d736d75c832445342eca1d1fedbf17d9618b14d7" - integrity sha512-cadkfKp6932H8UkhzE/gcUqhRMNf8jHzkAN7+5Myabswaghu4xABTgPHDCjW+dBAJxj/SpkTYokpzDqY4pCzQw== - collect-v8-coverage@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" @@ -1587,11 +1622,6 @@ copy-descriptor@^0.1.0: resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= -core-js@^3.2.1: - version "3.6.5" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.5.tgz#7395dc273af37fb2e50e9bd3d9fe841285231d1a" - integrity sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA== - core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -1770,6 +1800,13 @@ diff-sequences@^26.3.0: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.3.0.tgz#62a59b1b29ab7fd27cef2a33ae52abe73042d0a2" integrity sha512-5j5vdRcw3CNctePNYN0Wy2e/JbWT6cAYnXv5OuqPhDpyCGc0uLu2TK0zOCJWNB9kOIfYMSpIulRaDgIi4HJ6Ig== +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + doctrine@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" @@ -2015,12 +2052,18 @@ eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== -eslint@^7.7.0: - version "7.7.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.7.0.tgz#18beba51411927c4b64da0a8ceadefe4030d6073" - integrity sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg== +eslint-visitor-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" + integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== + +eslint@^7.8.1: + version "7.8.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.8.1.tgz#e59de3573fb6a5be8ff526c791571646d124a8fa" + integrity sha512-/2rX2pfhyUG0y+A123d0ccXtMm7DV7sH1m3lk9nk2DZ2LReq39FXHueR9xZwshE5MdfSf0xunSaMWRqyIA6M1w== dependencies: "@babel/code-frame" "^7.0.0" + "@eslint/eslintrc" "^0.1.3" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -2030,7 +2073,7 @@ eslint@^7.7.0: eslint-scope "^5.1.0" eslint-utils "^2.1.0" eslint-visitor-keys "^1.3.0" - espree "^7.2.0" + espree "^7.3.0" esquery "^1.2.0" esutils "^2.0.2" file-entry-cache "^5.0.1" @@ -2057,12 +2100,12 @@ eslint@^7.7.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.2.0.tgz#1c263d5b513dbad0ac30c4991b93ac354e948d69" - integrity sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g== +espree@^7.3.0: + version "7.3.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.0.tgz#dc30437cf67947cf576121ebd780f15eeac72348" + integrity sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw== dependencies: - acorn "^7.3.1" + acorn "^7.4.0" acorn-jsx "^5.2.0" eslint-visitor-keys "^1.3.0" @@ -2207,11 +2250,6 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= - fast-deep-equal@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" @@ -2222,6 +2260,18 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== +fast-glob@^3.1.1: + version "3.2.4" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.4.tgz#d20aefbf99579383e7f3cc66529158c9b98554d3" + integrity sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.0" + merge2 "^1.3.0" + micromatch "^4.0.2" + picomatch "^2.2.1" + fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -2237,6 +2287,13 @@ fast-safe-stringify@^2.0.7: resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz#124aa885899261f68aedb42a7c080de9da608743" integrity sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA== +fastq@^1.6.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.8.0.tgz#550e1f9f59bbc65fe185cb6a9b4d95357107f481" + integrity sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q== + dependencies: + reusify "^1.0.4" + fb-watchman@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" @@ -2476,7 +2533,7 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" -glob-parent@^5.0.0, glob-parent@~5.1.0: +glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0: version "5.1.1" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== @@ -2507,16 +2564,23 @@ globals@^12.1.0: dependencies: type-fest "^0.8.1" +globby@^11.0.1: + version "11.0.1" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.1.tgz#9a2bf107a068f3ffeabc49ad702c79ede8cfd357" + integrity sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.1.1" + ignore "^5.1.4" + merge2 "^1.3.0" + slash "^3.0.0" + graceful-fs@^4.1.2, graceful-fs@^4.2.4: version "4.2.4" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== -grapheme-splitter@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" - integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== - growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" @@ -2658,7 +2722,12 @@ ignore@^5.1.1: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.6.tgz#643194ad4bf2712f37852e386b6998eff0db2106" integrity sha512-cgXgkypZBcCnOgSihyeqbo6gjIaIyDqPQB7Ra4vhE9m6kigdGoQDMHjviFhRZo3IMlRy6yElosoviMs5YxZXUA== -import-fresh@^3.0.0: +ignore@^5.1.4: + version "5.1.8" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" + integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== + +import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66" integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== @@ -3469,11 +3538,6 @@ json-parse-better-errors@^1.0.1: resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A= - json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -3494,14 +3558,6 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -json-to-ast@^2.0.3: - version "2.1.0" - resolved "https://registry.yarnpkg.com/json-to-ast/-/json-to-ast-2.1.0.tgz#041a9fcd03c0845036acb670d29f425cea4faaf9" - integrity sha512-W9Lq347r8tA1DfMvAGn9QNcgYm4Wm7Yc+k8e6vezpMnRT+NHbtlxgNBXRVjXe9YM6eTn6+p/MKOlV/aABJcSnQ== - dependencies: - code-error-fragment "0.0.230" - grapheme-splitter "^1.0.4" - json5@2.x, json5@^2.1.2: version "2.1.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.3.tgz#c9b0f7fa9233bfe5807fe66fcf3a5617ed597d43" @@ -3521,11 +3577,6 @@ jsonparse@^1.2.0: resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= -jsonpointer@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - integrity sha1-T9kss04OnbPInIYi7PUfm5eMbLk= - jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" @@ -3804,6 +3855,11 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== +merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -4043,23 +4099,24 @@ oas-kit-common@^1.0.8: dependencies: fast-safe-stringify "^2.0.7" -oas-linter@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/oas-linter/-/oas-linter-3.1.3.tgz#1526b3da32a1bbf124d720f27fd4eb9971cebfff" - integrity sha512-jFWBHjSoqODGo7cKA/VWqqWSLbHNtnyCEpa2nMMS64SzCUbZDk63Oe7LqQZ2qJA0K2VRreYLt6cVkYy6MqNRDg== +oas-linter@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/oas-linter/-/oas-linter-3.2.0.tgz#82d2e586da00adc24c44e44de4b31a6f6ba5cc7e" + integrity sha512-LP5F1dhjULEJV5oGRg6ROztH2FddzttrrUEwq5J2GB2Zy938mg0vwt1+Rthn/qqDHtj4Qgq21duNGHh+Ew1wUg== dependencies: + "@exodus/schemasafe" "^1.0.0-rc.2" should "^13.2.1" - yaml "^1.8.3" + yaml "^1.10.0" -oas-resolver@^2.4.3: - version "2.4.3" - resolved "https://registry.yarnpkg.com/oas-resolver/-/oas-resolver-2.4.3.tgz#a4a2b599bbf2810c1cfab6a301950573a64a6e84" - integrity sha512-+66lGk5GewIXoIkqxfeWp89M/SgQT67oITiuG6qNIUuq1gczIIy68ZrMiE+gyDZY2IAdVxY9k73o9nHBnKwHPA== +oas-resolver@^2.4.4: + version "2.4.4" + resolved "https://registry.yarnpkg.com/oas-resolver/-/oas-resolver-2.4.4.tgz#d4161f0826a4ea77976608b68843d1cf8eca657b" + integrity sha512-670+SM5CXYrjI547cgUeQTdB1wJb2gyrJ7bnGywQMrmciKXhXj/EFbE/8c8wed+j1WmGAh7xS+QdQxiuIlNqlw== dependencies: node-fetch-h2 "^2.3.0" oas-kit-common "^1.0.8" - reftools "^1.1.5" - yaml "^1.8.3" + reftools "^1.1.6" + yaml "^1.10.0" yargs "^15.3.1" oas-schema-walker@^1.1.5: @@ -4067,21 +4124,19 @@ oas-schema-walker@^1.1.5: resolved "https://registry.yarnpkg.com/oas-schema-walker/-/oas-schema-walker-1.1.5.tgz#74c3cd47b70ff8e0b19adada14455b5d3ac38a22" integrity sha512-2yucenq1a9YPmeNExoUa9Qwrt9RFkjqaMAA1X+U7sbb0AqBeTIdMHky9SQQ6iN94bO5NW0W4TRYXerG+BdAvAQ== -oas-validator@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/oas-validator/-/oas-validator-4.0.8.tgz#4f1a4d6bd9e030ad07db03fd7a7bc3a91aabcc7d" - integrity sha512-bIt8erTyclF7bkaySTtQ9sppqyVc+mAlPi7vPzCLVHJsL9nrivQjc/jHLX/o+eGbxHd6a6YBwuY/Vxa6wGsiuw== +oas-validator@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/oas-validator/-/oas-validator-5.0.0.tgz#0998a16b8e56952908418325040f77f77d19f7dc" + integrity sha512-eg09qYTb5xBNlQv4k+nICaMc7/RHZ9McOUma/zIBj/hzSDFCIFkKjJpJpVQw6wF4Z69AXl8fHShpAZY2rTe5kw== dependencies: - ajv "^5.5.2" - better-ajv-errors "^0.6.7" call-me-maybe "^1.0.1" oas-kit-common "^1.0.8" - oas-linter "^3.1.3" - oas-resolver "^2.4.3" + oas-linter "^3.2.0" + oas-resolver "^2.4.4" oas-schema-walker "^1.1.5" - reftools "^1.1.5" + reftools "^1.1.6" should "^13.2.1" - yaml "^1.8.3" + yaml "^1.10.0" oauth-sign@~0.9.0: version "0.9.0" @@ -4351,6 +4406,11 @@ path-type@^3.0.0: dependencies: pify "^3.0.0" +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -4642,15 +4702,10 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" -reftools@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/reftools/-/reftools-1.1.5.tgz#7f71a8860096e9e28c49b7e16f020790c703ec15" - integrity sha512-o7RX5wMzITYj+8P8oaccFH2xYu5nQ63TH0d73Ce5YgpiY9NyFytaQfeg1p1Z5T4yfjKSj0sYuUscBqZgkLsooQ== - -regenerator-runtime@^0.13.4: - version "0.13.5" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697" - integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA== +reftools@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/reftools/-/reftools-1.1.6.tgz#841b1ac241259632d63167bf708eccfbfbbba5b5" + integrity sha512-rQfJ025lvPjw9qyQuNPqE+cRs5qVs7BMrZwgRJnmuMcX/8r/eJE8f5/RCunJWViXKHmN5K2DFafYzglLOHE/tw== regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" @@ -4773,6 +4828,11 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + rimraf@2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" @@ -4792,6 +4852,11 @@ rsvp@^4.8.4: resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== +run-parallel@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.9.tgz#c9dd3a7cf9f4b2c4b6244e173a6ed866e61dd679" + integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== + safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -5288,7 +5353,7 @@ strip-indent@^3.0.0: dependencies: min-indent "^1.0.0" -strip-json-comments@^3.1.0: +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -5322,21 +5387,20 @@ swagger-parser@^10.0.1: dependencies: "@apidevtools/swagger-parser" "10.0.1" -swagger2openapi@^6.2.3: - version "6.2.3" - resolved "https://registry.yarnpkg.com/swagger2openapi/-/swagger2openapi-6.2.3.tgz#4a8059f89d851aee4c9ab178f9b7190debd904e2" - integrity sha512-cUUktzLpK69UwpMbcTzjMw2ns9RZChfxh56AHv6+hTx3StPOX2foZjPgds3HlJcINbxosYYBn/D3cG8nwcCWwQ== +swagger2openapi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/swagger2openapi/-/swagger2openapi-7.0.0.tgz#c1eb73348d8b6c7d9f09ebe69d7d7c5819783018" + integrity sha512-1sG0pl5mRRq5mld+m5Ja5R67pJAR383ExXP3h9Qu/elpadgU0vgAQhr+DvqlV6l63YF7fRCtHvrCVsHn5huQQw== dependencies: - better-ajv-errors "^0.6.1" call-me-maybe "^1.0.1" node-fetch-h2 "^2.3.0" node-readfiles "^0.2.0" oas-kit-common "^1.0.8" - oas-resolver "^2.4.3" + oas-resolver "^2.4.4" oas-schema-walker "^1.1.5" - oas-validator "^4.0.8" - reftools "^1.1.5" - yaml "^1.8.3" + oas-validator "^5.0.0" + reftools "^1.1.6" + yaml "^1.10.0" yargs "^15.3.1" symbol-tree@^3.2.4: @@ -5829,7 +5893,7 @@ y18n@^4.0.0: resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== -yaml@^1.8.3: +yaml@^1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.0.tgz#3b593add944876077d4d683fee01081bd9fff31e" integrity sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg== From abc92addb9b79f5effd73fa5387cb98aedca8894 Mon Sep 17 00:00:00 2001 From: solufa Date: Thu, 3 Sep 2020 05:39:21 +0900 Subject: [PATCH 3/4] chore: fix lint --- src/builderUtils/converters.ts | 1 - src/builderUtils/props2String.ts | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/builderUtils/converters.ts b/src/builderUtils/converters.ts index 79d8636b..a7f60080 100644 --- a/src/builderUtils/converters.ts +++ b/src/builderUtils/converters.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-use-before-define */ import { OpenAPIV3 } from 'openapi-types' import { Prop, PropValue } from './props2String' diff --git a/src/builderUtils/props2String.ts b/src/builderUtils/props2String.ts index be3c2645..cc789982 100644 --- a/src/builderUtils/props2String.ts +++ b/src/builderUtils/props2String.ts @@ -2,6 +2,7 @@ export type PropValue = { isArray: boolean isEnum: boolean isOneOf?: boolean + // eslint-disable-next-line no-use-before-define value: Prop[] | string | string[] | PropValue | PropValue[] } @@ -15,22 +16,19 @@ export type Prop = { const array2String = (val: PropValue, indent: string) => { const hasMulti = (val.isEnum || typeof val.isOneOf === 'boolean') && Array.isArray(val.value) && val.value.length - // eslint-disable-next-line @typescript-eslint/no-use-before-define return `${hasMulti ? '(' : ''}${value2String(val, indent)}${hasMulti ? ')' : ''}[]` } export const value2String = (v: PropValue, indent: string): string => `${ typeof v.isOneOf === 'boolean' - ? // eslint-disable-next-line @typescript-eslint/no-use-before-define - values2String(v.value as PropValue[], v.isOneOf, indent) + ? values2String(v.value as PropValue[], v.isOneOf, indent) : v.isArray ? array2String(v.value as PropValue, indent) : v.isEnum ? (v.value as string[]).join(' | ') : Array.isArray(v.value) - ? // eslint-disable-next-line @typescript-eslint/no-use-before-define - props2String(v.value as Prop[], ` ${indent}`) + ? props2String(v.value as Prop[], ` ${indent}`) : v.value }` From 029d9cac7caf40fa456fff9d2ae86c36f97becac Mon Sep 17 00:00:00 2001 From: solufa Date: Thu, 3 Sep 2020 05:46:09 +0900 Subject: [PATCH 4/4] chore(release): 0.11.0 --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f7f9b3a..87098f19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [0.11.0](https://github.com/aspida/openapi2aspida/compare/v0.10.1...v0.11.0) (2020-09-02) + + +### Features + +* update aspida@0.21.0 ([c3c9976](https://github.com/aspida/openapi2aspida/commit/c3c9976db1d06fb8b8e7e43fa765073a5d19ed00)) + ### [0.10.1](https://github.com/aspida/openapi2aspida/compare/v0.10.0...v0.10.1) (2020-08-27) diff --git a/package.json b/package.json index a386938d..188ef40f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openapi2aspida", - "version": "0.10.1", + "version": "0.11.0", "description": "Convert OpenAPI 3.0 or Swagger 2.0 definitions into aspida", "author": "Solufa ", "license": "MIT",