diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d78d2a8..20d31e5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ 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.14.0](https://github.com/aspida/openapi2aspida/compare/v0.13.0...v0.14.0) (2020-11-25) + + +### ⚠ BREAKING CHANGES + +* change reqHeaders to optional + +### Features + +* add nullable ([1ff57a0](https://github.com/aspida/openapi2aspida/commit/1ff57a006b49f98e3fca4b8323a5ba9235db87e2)) +* change reqHeaders to optional ([25c94f3](https://github.com/aspida/openapi2aspida/commit/25c94f3c65731c108592d1a2195fc35dd1def8b3)) + ## [0.13.0](https://github.com/aspida/openapi2aspida/compare/v0.12.0...v0.13.0) (2020-11-14) diff --git a/README.md b/README.md index db40ae6d..aae9a749 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,12 @@

-## Breaking change (2020/11/14) :warning: +## Breaking change :warning: +### 2020/11/26 +Since openapi2aspida >= `0.14.0` , request headers are forced to be optional. + +### 2020/11/14 Since openapi2aspida >= `0.13.0` , optional for aspida only if the 'required' property of OpenAPI is set to `false`. ## Getting Started diff --git a/package.json b/package.json index a4270617..43b9fda8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openapi2aspida", - "version": "0.13.0", + "version": "0.14.0", "description": "Convert OpenAPI 3.0 or Swagger 2.0 definitions into aspida", "author": "Solufa ", "license": "MIT", @@ -88,27 +88,27 @@ "aspida": "^0.22.2", "openapi-types": "^7.0.1", "swagger-parser": "^10.0.2", - "swagger2openapi": "^7.0.3" + "swagger2openapi": "^7.0.4" }, "devDependencies": { "@types/jest": "^26.0.15", "@types/js-yaml": "^3.12.5", "@types/minimist": "^1.2.1", - "@typescript-eslint/eslint-plugin": "^4.7.0", - "@typescript-eslint/parser": "^4.7.0", - "eslint": "^7.13.0", + "@typescript-eslint/eslint-plugin": "^4.8.2", + "@typescript-eslint/parser": "^4.8.2", + "eslint": "^7.14.0", "eslint-config-prettier": "^6.15.0", - "eslint-config-standard": "^16.0.1", + "eslint-config-standard": "^16.0.2", "eslint-plugin-import": "^2.22.1", - "eslint-plugin-jest": "^24.1.0", + "eslint-plugin-jest": "^24.1.3", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^3.1.4", "eslint-plugin-promise": "^4.2.1", - "eslint-plugin-standard": "^4.1.0", + "eslint-plugin-standard": "^5.0.0", "jest": "^26.6.3", - "prettier": "^2.1.2", + "prettier": "^2.2.0", "standard-version": "^9.0.0", "ts-jest": "^26.4.4", - "typescript": "^4.0.5" + "typescript": "^4.1.2" } } diff --git a/samples/freee/@types.ts b/samples/freee/@types.ts index 94e48aaf..2f03e444 100644 --- a/samples/freee/@types.ts +++ b/samples/freee/@types.ts @@ -61,7 +61,7 @@ export type dealUpdateParams = { description?: string vat?: number }[] - receipt_ids?: number[] + receipt_ids?: number[] | null } export type manualJournalCreateParams = { @@ -244,7 +244,7 @@ export type partnerCreateParams = { phone?: string contact_name?: string email?: string - payer_walletable_id?: number + payer_walletable_id?: number | null transfer_fee_handling_side?: 'payer' | 'payee' address_attributes?: { @@ -295,7 +295,7 @@ export type partnerUpdateParams = { phone?: string contact_name?: string email?: string - payer_walletable_id?: number + payer_walletable_id?: number | null transfer_fee_handling_side?: 'payer' | 'payee' address_attributes?: { @@ -375,20 +375,20 @@ export type accountItemsResponse = { account_items: { id: number name: string - shortcut?: string - shortcut_num?: string + shortcut?: string | null + shortcut_num?: string | null default_tax_id?: number default_tax_code: number account_category: string account_category_id: number categories: string[] available: boolean - walletable_id: number - group_name?: string - corresponding_income_name?: string - corresponding_income_id?: number - corresponding_expense_name?: string - corresponding_expense_id?: number + walletable_id: number | null + group_name?: string | null + corresponding_income_name?: string | null + corresponding_income_id?: number | null + corresponding_expense_name?: string | null + corresponding_expense_id?: number | null }[] } @@ -415,12 +415,12 @@ export type accountItemResponse = { name: string }[] available: boolean - walletable_id: number - group_name?: string - corresponding_income_name?: string - corresponding_income_id?: number - corresponding_expense_name?: string - corresponding_expense_id?: number + walletable_id: number | null + group_name?: string | null + corresponding_income_name?: string | null + corresponding_income_id?: number | null + corresponding_expense_name?: string | null + corresponding_expense_id?: number | null } } @@ -429,7 +429,7 @@ export type bankResponse = { id: number name?: string type?: 'bank_account' | 'credit_card' | 'wallet' - name_kana?: string + name_kana?: string | null } } @@ -843,10 +843,10 @@ export type sectionResponse = { section: { id: number name: string - long_name?: string + long_name?: string | null company_id: number - shortcut1?: string - shortcut2?: string + shortcut1?: string | null + shortcut2?: string | null } } @@ -860,7 +860,7 @@ export type dealCreateResponse = { due_amount?: number type?: 'income' | 'expense' partner_id: number - partner_code?: string + partner_code?: string | null ref_number?: string status: 'unsettled' | 'settled' details?: { @@ -868,12 +868,12 @@ export type dealCreateResponse = { account_item_id: number tax_id?: number tax_code: number - item_id?: number - section_id?: number + item_id?: number | null + section_id?: number | null tag_ids?: number[] - segment_1_tag_id?: number - segment_2_tag_id?: number - segment_3_tag_id?: number + segment_1_tag_id?: number | null + segment_2_tag_id?: number | null + segment_3_tag_id?: number | null amount: number vat: number description?: string @@ -899,7 +899,7 @@ export type dealResponse = { due_amount?: number type?: 'income' | 'expense' partner_id: number - partner_code?: string + partner_code?: string | null ref_number?: string status: 'unsettled' | 'settled' details?: { @@ -907,12 +907,12 @@ export type dealResponse = { account_item_id: number tax_id?: number tax_code: number - item_id?: number - section_id?: number + item_id?: number | null + section_id?: number | null tag_ids?: number[] - segment_1_tag_id?: number - segment_2_tag_id?: number - segment_3_tag_id?: number + segment_1_tag_id?: number | null + segment_2_tag_id?: number | null + segment_3_tag_id?: number | null amount: number vat: number description?: string @@ -928,15 +928,15 @@ export type dealResponse = { entry_side: 'credit' | 'debit' account_item_id: number tax_code: number - item_id?: number - section_id?: number + item_id?: number | null + section_id?: number | null tag_ids: number[] - segment_1_tag_id?: number - segment_2_tag_id?: number - segment_3_tag_id?: number + segment_1_tag_id?: number | null + segment_2_tag_id?: number | null + segment_3_tag_id?: number | null amount: number vat: number - description?: string + description?: string | null }[] }[] payments?: { @@ -959,7 +959,7 @@ export type dealResponse = { user: { id: number email: string - display_name?: string + display_name?: string | null } }[] } @@ -1009,8 +1009,8 @@ export type itemResponse = { id: number company_id: number name: string - shortcut1?: string - shortcut2?: string + shortcut1?: string | null + shortcut2?: string | null } } @@ -1020,20 +1020,20 @@ export type manualJournalResponse = { company_id: number issue_date: string adjustment: boolean - txn_number: string + txn_number: string | null details: { id: number entry_side: 'credit' | 'debit' account_item_id: number tax_code: number - partner_id: number - partner_name: string - partner_code?: string - partner_long_name: string - item_id: number - item_name: string - section_id: number - section_name: string + partner_id: number | null + partner_name: string | null + partner_code?: string | null + partner_long_name: string | null + item_id: number | null + item_name: string | null + section_id: number | null + section_name: string | null tag_ids: number[] tag_names: string[] segment_1_tag_id?: number @@ -1060,21 +1060,21 @@ export type tagResponse = { tag: { id: number company_id: number - name: string - shortcut1?: string - shortcut2?: string + name: string | null + shortcut1?: string | null + shortcut2?: string | null } } export type companyUpdateResponse = { company: { id: number - name: string - name_kana: string + name: string | null + name_kana: string | null display_name: string tax_at_source_calc_type: number - contact_name: string - head_count: number + contact_name: string | null + head_count: number | null corporate_number: string txn_number_format: 'not_used' | 'digits' | 'alnum' default_wallet_account_id?: number @@ -1082,8 +1082,8 @@ export type companyUpdateResponse = { minus_format: number role: 'admin' | 'simple_accounting' | 'self_only' | 'read_only' phone1: string - phone2: string - fax: string + phone2: string | null + fax: string | null zipcode: string prefecture_code: number street_name1: string @@ -1112,9 +1112,9 @@ export type companyUpdateResponse = { export type companyIndexResponse = { companies: { id: number - name: string - name_kana: string - display_name: string + name: string | null + name_kana: string | null + display_name: string | null role: 'admin' | 'simple_accounting' | 'self_only' | 'read_only' }[] } @@ -1122,12 +1122,12 @@ export type companyIndexResponse = { export type companyResponse = { company: { id: number - name: string - name_kana: string + name: string | null + name_kana: string | null display_name: string tax_at_source_calc_type: number - contact_name: string - head_count: number + contact_name: string | null + head_count: number | null corporate_number: string txn_number_format: 'not_used' | 'digits' | 'alnum' default_wallet_account_id?: number @@ -1135,8 +1135,8 @@ export type companyResponse = { minus_format: number role: 'admin' | 'simple_accounting' | 'self_only' | 'read_only' phone1: string - phone2: string - fax: string + phone2: string | null + fax: string | null zipcode: string prefecture_code: number street_name1: string @@ -1211,74 +1211,74 @@ export type serviceUnavailableError = { export type partnersResponse = { partners: { id: number - code: string + code: string | null company_id: number name: string - shortcut1?: string - shortcut2?: string - long_name?: string - name_kana?: string - default_title?: string - phone?: string - contact_name?: string - email?: string - payer_walletable_id?: number + shortcut1?: string | null + shortcut2?: string | null + long_name?: string | null + name_kana?: string | null + default_title?: string | null + phone?: string | null + contact_name?: string | null + email?: string | null + payer_walletable_id?: number | null transfer_fee_handling_side?: 'payer' | 'payee' - 'address_attributes[zipcode]'?: string + 'address_attributes[zipcode]'?: string | null 'address_attributes[prefecture_code]'?: number - 'address_attributes[street_name1]'?: string - 'address_attributes[street_name2]'?: string - 'partner_doc_setting_attributes[sending_method]'?: 'mail' | 'posting' | 'main_and_posting' - 'partner_bank_account_attributes[bank_name]'?: string - 'partner_bank_account_attributes[bank_name_kana]'?: string - 'partner_bank_account_attributes[bank_code]'?: string - 'partner_bank_account_attributes[branch_name]'?: string - 'partner_bank_account_attributes[branch_kana]'?: string - 'partner_bank_account_attributes[branch_code]'?: string - 'partner_bank_account_attributes[account_type]'?: 'ordinary' | 'checking' | 'earmarked' | 'savings' | 'other' - 'partner_bank_account_attributes[account_number]'?: string - 'partner_bank_account_attributes[account_name]'?: string - 'partner_bank_account_attributes[long_account_name]'?: string + 'address_attributes[street_name1]'?: string | null + 'address_attributes[street_name2]'?: string | null + 'partner_doc_setting_attributes[sending_method]'?: 'mail' | 'posting' | 'main_and_posting' | null + 'partner_bank_account_attributes[bank_name]'?: string | null + 'partner_bank_account_attributes[bank_name_kana]'?: string | null + 'partner_bank_account_attributes[bank_code]'?: string | null + 'partner_bank_account_attributes[branch_name]'?: string | null + 'partner_bank_account_attributes[branch_kana]'?: string | null + 'partner_bank_account_attributes[branch_code]'?: string | null + 'partner_bank_account_attributes[account_type]'?: 'ordinary' | 'checking' | 'earmarked' | 'savings' | 'other' | null + 'partner_bank_account_attributes[account_number]'?: string | null + 'partner_bank_account_attributes[account_name]'?: string | null + 'partner_bank_account_attributes[long_account_name]'?: string | null }[] } export type partnerResponse = { partner: { id: number - code: string + code: string | null company_id: number name: string - shortcut1?: string - shortcut2?: string - long_name?: string - name_kana?: string - default_title?: string - phone?: string - contact_name?: string - email?: string - payer_walletable_id?: number + shortcut1?: string | null + shortcut2?: string | null + long_name?: string | null + name_kana?: string | null + default_title?: string | null + phone?: string | null + contact_name?: string | null + email?: string | null + payer_walletable_id?: number | null transfer_fee_handling_side?: 'payer' | 'payee' - 'address_attributes[zipcode]'?: string + 'address_attributes[zipcode]'?: string | null 'address_attributes[prefecture_code]'?: number - 'address_attributes[street_name1]'?: string - 'address_attributes[street_name2]'?: string - 'partner_doc_setting_attributes[sending_method]'?: 'email' | 'posting' | 'email_and_posting' - 'partner_bank_account_attributes[bank_name]'?: string - 'partner_bank_account_attributes[bank_name_kana]'?: string - 'partner_bank_account_attributes[bank_code]'?: string - 'partner_bank_account_attributes[branch_name]'?: string - 'partner_bank_account_attributes[branch_kana]'?: string - 'partner_bank_account_attributes[branch_code]'?: string - 'partner_bank_account_attributes[account_type]'?: 'ordinary' | 'checking' | 'earmarked' | 'savings' | 'other' - 'partner_bank_account_attributes[account_number]'?: string - 'partner_bank_account_attributes[account_name]'?: string - 'partner_bank_account_attributes[long_account_name]'?: string - 'payment_term_attributes[cutoff_day]'?: number - 'payment_term_attributes[additional_months]'?: number - 'payment_term_attributes[fixed_day]'?: number - 'invoice_payment_term_attributes[cutoff_day]'?: number - 'invoice_payment_term_attributes[additional_months]'?: number - 'invoice_payment_term_attributes[fixed_day]'?: number + 'address_attributes[street_name1]'?: string | null + 'address_attributes[street_name2]'?: string | null + 'partner_doc_setting_attributes[sending_method]'?: 'email' | 'posting' | 'email_and_posting' | null + 'partner_bank_account_attributes[bank_name]'?: string | null + 'partner_bank_account_attributes[bank_name_kana]'?: string | null + 'partner_bank_account_attributes[bank_code]'?: string | null + 'partner_bank_account_attributes[branch_name]'?: string | null + 'partner_bank_account_attributes[branch_kana]'?: string | null + 'partner_bank_account_attributes[branch_code]'?: string | null + 'partner_bank_account_attributes[account_type]'?: 'ordinary' | 'checking' | 'earmarked' | 'savings' | 'other' | null + 'partner_bank_account_attributes[account_number]'?: string | null + 'partner_bank_account_attributes[account_name]'?: string | null + 'partner_bank_account_attributes[long_account_name]'?: string | null + 'payment_term_attributes[cutoff_day]'?: number | null + 'payment_term_attributes[additional_months]'?: number | null + 'payment_term_attributes[fixed_day]'?: number | null + 'invoice_payment_term_attributes[cutoff_day]'?: number | null + 'invoice_payment_term_attributes[additional_months]'?: number | null + 'invoice_payment_term_attributes[fixed_day]'?: number | null } } @@ -1294,7 +1294,7 @@ export type walletableResponse = { walletable: { id: number name: string - bank_id: number + bank_id: number | null type: 'bank_account' | 'credit_card' | 'wallet' last_balance?: number walletable_balance?: number @@ -1334,9 +1334,9 @@ export type transferResponse = { company_id: number amount: number date: string - from_walletable_type: 'bank_account' | 'wallet' | 'credit_card' + from_walletable_type: 'bank_account' | 'wallet' | 'credit_card' | null from_walletable_id: number - to_walletable_type: 'bank_account' | 'wallet' | 'credit_card' + to_walletable_type: 'bank_account' | 'wallet' | 'credit_card' | null to_walletable_id: number description: string } @@ -1354,11 +1354,11 @@ export type userResponse = { user: { id: number email: string - display_name?: string - first_name?: string - last_name?: string - first_name_kana?: string - last_name_kana?: string + display_name?: string | null + first_name?: string | null + last_name?: string | null + first_name_kana?: string | null + last_name_kana?: string | null } } @@ -1366,11 +1366,11 @@ export type meResponse = { user: { id: number email: string - display_name?: string - first_name?: string - last_name?: string - first_name_kana?: string - last_name_kana?: string + display_name?: string | null + first_name?: string | null + last_name?: string | null + first_name_kana?: string | null + last_name_kana?: string | null companies?: { id: number display_name: string @@ -1401,7 +1401,7 @@ export type receiptResponse = { user: { id: number email: string - display_name?: string + display_name?: string | null } } } @@ -1424,12 +1424,12 @@ export type expenseApplicationResponse = { id: number company_id: number title: string - issue_date: string + issue_date: string | null description?: string editable_on_web: boolean total_amount?: number status: 'draft' | 'in_progress' | 'approved' | 'rejected' | 'feedback' - section_id?: number + section_id?: number | null tag_ids?: number[] expense_application_lines: { id: number @@ -1439,8 +1439,8 @@ export type expenseApplicationResponse = { expense_application_line_template_id?: number receipt_id?: number }[] - deal_id: number - deal_status: 'settled' | 'unsettled' + deal_id: number | null + deal_status: 'settled' | 'unsettled' | null } } @@ -1501,7 +1501,7 @@ export type generalApplicationUpdateParams = { export type generalApplicationActionCreateParams = { company_id: number approval_action: 'approve' | 'force_approve' | 'cancel' | 'reject' | 'feedback' | 'force_feedback' - next_approver_id?: number + next_approver_id?: number | null } export type renewCreateParams = { @@ -1558,7 +1558,7 @@ export type approvalRequestResponse = { application_date: string title: string applicant_id: number - approver_id: number + approver_id: number | null application_number: string status: 'draft' request_items: { @@ -1576,7 +1576,7 @@ export type generalApplicationsIndexResponse = { application_date: string title: string applicant_id: number - approver_id: number + approver_id: number | null application_number: string status: 'draft' | 'in_progress' | 'approved' | 'rejected' | 'feedback' request_items: { @@ -1596,7 +1596,7 @@ export type generalApplicationResponse = { application_date: string title: string applicant_id: number - approver_id: number + approver_id: number | null application_number: string status: 'draft' | 'in_progress' | 'approved' | 'rejected' | 'feedback' request_items: { @@ -1606,8 +1606,8 @@ export type generalApplicationResponse = { }[] form_id: number approval_flow_route_id: number - last_approver_id: number - last_approved_at: string + last_approver_id: number | null + last_approved_at: string | null comments: { comment: string user_id: number @@ -1629,20 +1629,20 @@ export type generalApplicationFormResponse = { description: string status: 'draft' | 'active' | 'deleted' created_date: string - form_order: number + form_order: number | null parts?: { id: number order?: number type?: 'title' | 'single_line' | 'multi_line' | 'select' | 'date' | 'amount' | 'receipt' label?: string - annotation?: string - required?: boolean + annotation?: string | null + required?: boolean | null values?: { name: string order: number - }[] - max_amount?: number - min_amount?: number + }[] | null + max_amount?: number | null + min_amount?: number | null }[] route_setting_count: number } @@ -1653,7 +1653,7 @@ export type approvalFlowRouteResponse = { id: number name?: string description?: string - user_id?: number + user_id?: number | null definition_system?: boolean is_in_progress?: boolean first_step_id?: number @@ -1665,9 +1665,9 @@ export type segmentTagResponse = { segment_tag: { id: number name: string - description: string - shortcut1: string - shortcut2: string + description: string | null + shortcut1: string | null + shortcut2: string | null } } @@ -1684,73 +1684,73 @@ export type invoiceResponse = { id: number company_id: number issue_date: string - partner_id: number - partner_code?: string + partner_id: number | null + partner_code?: string | null invoice_number: string - title?: string - due_date?: string + title?: string | null + due_date?: string | null total_amount: number total_vat?: number sub_total?: number - booking_date?: string - description?: string + booking_date?: string | null + description?: string | null invoice_status: 'draft' | 'applying' | 'remanded' | 'rejected' | 'approved' | 'issued' payment_status?: '' | 'unsettled' | 'settled' - payment_date?: string - web_published_at?: string - web_downloaded_at?: string - web_confirmed_at?: string - mail_sent_at?: string + payment_date?: string | null + web_published_at?: string | null + web_downloaded_at?: string | null + web_confirmed_at?: string | null + mail_sent_at?: string | null posting_status: '' | 'unrequested' | 'preview_registered' | 'preview_failed' | 'ordered' | 'order_failed' | 'printing' | 'canceled' | 'posted' - partner_name?: string - partner_long_name?: string - partner_title?: string - partner_zipcode?: string - partner_prefecture_code?: number - partner_prefecture_name?: string - partner_address1?: string - partner_address2?: string - partner_contact_info?: string + partner_name?: string | null + partner_long_name?: string | null + partner_title?: string | null + partner_zipcode?: string | null + partner_prefecture_code?: number | null + partner_prefecture_name?: string | null + partner_address1?: string | null + partner_address2?: string | null + partner_contact_info?: string | null company_name: string - company_zipcode?: string - company_prefecture_code?: number - company_prefecture_name?: string - company_address1?: string - company_address2?: string - company_contact_info?: string + company_zipcode?: string | null + company_prefecture_code?: number | null + company_prefecture_name?: string | null + company_address1?: string | null + company_address2?: string | null + company_contact_info?: string | null payment_type: '' | 'transfer' | 'direct_debit' - payment_bank_info?: string - message?: string - notes?: string + payment_bank_info?: string | null + message?: string | null + notes?: string | null invoice_layout: 'default_classic' | 'standard_classic' | 'envelope_classic' | 'carried_forward_standard_classic' | 'carried_forward_envelope_classic' | 'default_modern' | 'standard_modern' | 'envelope_modern' tax_entry_method: '' | 'inclusive' | 'exclusive' - deal_id?: number + deal_id?: number | null invoice_contents?: { id: number order: number type: 'normal' | 'discount' | 'text' qty: number - unit: string + unit: string | null unit_price: number amount: number vat: number reduced_vat: boolean - description: string - account_item_id: number - account_item_name: string - tax_code: number - item_id: number - item_name: string - section_id: number - section_name: string + description: string | null + account_item_id: number | null + account_item_name: string | null + tax_code: number | null + item_id: number | null + item_name: string | null + section_id: number | null + section_name: string | null tag_ids: number[] tag_names: string[] - segment_1_tag_id?: number - segment_1_tag_name?: string - segment_2_tag_id?: number - segment_2_tag_name?: string - segment_3_tag_id?: number - segment_3_tag_name?: string + segment_1_tag_id?: number | null + segment_1_tag_name?: string | null + segment_2_tag_id?: number | null + segment_2_tag_name?: string | null + segment_3_tag_id?: number | null + segment_3_tag_name?: string | null }[] total_amount_per_vat_rate: { @@ -1765,21 +1765,21 @@ export type invoiceResponse = { export type invoiceCreateParams = { company_id: number issue_date?: string - partner_id?: number - partner_code?: string + partner_id?: number | null + partner_code?: string | null invoice_number?: string title?: string due_date?: string booking_date?: string description?: string invoice_status?: 'draft' | 'issue' - partner_name?: string - partner_title?: string - partner_contact_info?: string - partner_zipcode?: string - partner_prefecture_code?: number - partner_address1?: string - partner_address2?: string + partner_name?: string | null + partner_title?: string | null + partner_contact_info?: string | null + partner_zipcode?: string | null + partner_prefecture_code?: number | null + partner_address1?: string | null + partner_address2?: string | null company_name?: string company_zipcode?: string company_prefecture_code?: number @@ -1799,7 +1799,7 @@ export type invoiceCreateParams = { qty?: number unit?: string unit_price?: number - vat?: number + vat?: number | null description?: string account_item_id?: number tax_code?: number @@ -1815,21 +1815,21 @@ export type invoiceCreateParams = { export type invoiceUpdateParams = { company_id: number issue_date?: string - partner_id?: number - partner_code?: string + partner_id?: number | null + partner_code?: string | null invoice_number?: string title?: string due_date?: string booking_date?: string description?: string invoice_status?: 'draft' | 'issue' - partner_name?: string - partner_title?: string - partner_contact_info?: string - partner_zipcode?: string - partner_prefecture_code?: number - partner_address1?: string - partner_address2?: string + partner_name?: string | null + partner_title?: string | null + partner_contact_info?: string | null + partner_zipcode?: string | null + partner_prefecture_code?: number | null + partner_address1?: string | null + partner_address2?: string | null company_name?: string company_zipcode?: string company_prefecture_code?: number @@ -1850,7 +1850,7 @@ export type invoiceUpdateParams = { qty?: number unit?: string unit_price?: number - vat?: number + vat?: number | null description?: string account_item_id?: number tax_code?: number @@ -1868,37 +1868,37 @@ export type quotationResponse = { id: number company_id: number issue_date: string - partner_id: number - partner_code?: string + partner_id: number | null + partner_code?: string | null quotation_number: string - title?: string + title?: string | null total_amount: number total_vat?: number sub_total?: number - description?: string + description?: string | null quotation_status: 'unsubmitted' | 'submitted' | 'all' - web_published_at?: string - web_downloaded_at?: string - web_confirmed_at?: string - mail_sent_at?: string - partner_name?: string - partner_display_name?: string - partner_title: '御中' | '様' | '(空白)' - partner_zipcode?: string - partner_prefecture_code?: number - partner_prefecture_name?: string - partner_address1?: string - partner_address2?: string - partner_contact_info?: string + web_published_at?: string | null + web_downloaded_at?: string | null + web_confirmed_at?: string | null + mail_sent_at?: string | null + partner_name?: string | null + partner_display_name?: string | null + partner_title: '御中' | '様' | '(空白)' | null + partner_zipcode?: string | null + partner_prefecture_code?: number | null + partner_prefecture_name?: string | null + partner_address1?: string | null + partner_address2?: string | null + partner_contact_info?: string | null company_name: string - company_zipcode?: string - company_prefecture_code?: number - company_prefecture_name?: string - company_address1?: string - company_address2?: string - company_contact_info?: string - message?: string - notes?: string + company_zipcode?: string | null + company_prefecture_code?: number | null + company_prefecture_name?: string | null + company_address1?: string | null + company_address2?: string | null + company_contact_info?: string | null + message?: string | null + notes?: string | null quotation_layout: 'default_classic' | 'standard_classic' | 'envelope_classic' | 'carried_forward_standard_classic' | 'carried_forward_envelope_classic' | 'default_modern' | 'standard_modern' | 'envelope_modern' tax_entry_method: '' | 'inclusive' | 'exclusive' quotation_contents?: { @@ -1906,27 +1906,27 @@ export type quotationResponse = { order: number type: 'normal' | 'discount' | 'text' qty: number - unit: string + unit: string | null unit_price: number amount: number vat: number reduced_vat: boolean - description: string - account_item_id: number - account_item_name: string - tax_code: number - item_id: number - item_name: string - section_id: number - section_name: string + description: string | null + account_item_id: number | null + account_item_name: string | null + tax_code: number | null + item_id: number | null + item_name: string | null + section_id: number | null + section_name: string | null tag_ids: number[] tag_names: string[] - segment_1_tag_id?: number - segment_1_tag_name?: string - segment_2_tag_id?: number - segment_2_tag_name?: string - segment_3_tag_id?: number - segment_3_tag_name?: string + segment_1_tag_id?: number | null + segment_1_tag_name?: string | null + segment_2_tag_id?: number | null + segment_2_tag_name?: string | null + segment_3_tag_id?: number | null + segment_3_tag_name?: string | null }[] total_amount_per_vat_rate: { @@ -1941,19 +1941,19 @@ export type quotationResponse = { export type quotationCreateParams = { company_id: number issue_date?: string - partner_id?: number - partner_code?: string + partner_id?: number | null + partner_code?: string | null quotation_number?: string title?: string description?: string quotation_status?: 'unsubmitted' | 'submitted' partner_display_name: string partner_title: string - partner_contact_info?: string - partner_zipcode?: string - partner_prefecture_code?: number - partner_address1?: string - partner_address2?: string + partner_contact_info?: string | null + partner_zipcode?: string | null + partner_prefecture_code?: number | null + partner_address1?: string | null + partner_address2?: string | null company_name?: string company_zipcode?: string company_prefecture_code?: number @@ -1970,7 +1970,7 @@ export type quotationCreateParams = { qty?: number unit?: string unit_price?: number - vat?: number + vat?: number | null description?: string account_item_id?: number tax_code?: number @@ -1986,19 +1986,19 @@ export type quotationCreateParams = { export type quotationUpdateParams = { company_id: number issue_date?: string - partner_id?: number - partner_code?: string + partner_id?: number | null + partner_code?: string | null quotation_number?: string title?: string description?: string quotation_status?: 'unsubmitted' | 'submitted' partner_display_name: string partner_title: string - partner_contact_info?: string - partner_zipcode?: string - partner_prefecture_code?: number - partner_address1?: string - partner_address2?: string + partner_contact_info?: string | null + partner_zipcode?: string | null + partner_prefecture_code?: number | null + partner_address1?: string | null + partner_address2?: string | null company_name?: string company_zipcode?: string company_prefecture_code?: number @@ -2016,7 +2016,7 @@ export type quotationUpdateParams = { qty?: number unit?: string unit_price?: number - vat?: number + vat?: number | null description?: string account_item_id?: number tax_code?: number diff --git a/samples/freee/api/1/taxes/companies/_company_id@number/index.ts b/samples/freee/api/1/taxes/companies/_company_id@number/index.ts index 6b35a636..d088c31f 100644 --- a/samples/freee/api/1/taxes/companies/_company_id@number/index.ts +++ b/samples/freee/api/1/taxes/companies/_company_id@number/index.ts @@ -8,7 +8,7 @@ export type Methods = { code: number name: string name_ja: string - display_category: 'tax_5' | 'tax_8' | 'tax_r8' | 'tax_10' + display_category: 'tax_5' | 'tax_8' | 'tax_r8' | 'tax_10' | null available: boolean }[] } diff --git a/samples/openapi/$api.ts b/samples/openapi/$api.ts index 04032079..41f07e0b 100644 --- a/samples/openapi/$api.ts +++ b/samples/openapi/$api.ts @@ -201,9 +201,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { }, v3: { $2fa: { - post: (option: { body: Methods10['post']['reqBody'], headers: Methods10['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods10['post']['reqBody'], headers?: Methods10['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH8, POST, option).json().then(r => r.body), $path: () => `${prefix}${PATH8}` }, @@ -222,9 +222,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const prefix5 = `${prefix4}${PATH11}/${val5}` return { - post: (option: { body: Methods12['post']['reqBody'], headers: Methods12['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods12['post']['reqBody'], headers?: Methods12['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix5, POST, option).json().then(r => r.body), $path: () => `${prefix}${prefix5}` } @@ -234,9 +234,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { } }, news_feed: { - get: (option: { query: Methods13['get']['query'], headers: Methods13['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods13['get']['query'], headers?: Methods13['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix3}${PATH12}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods13['get']['query'] }) => `${prefix}${prefix3}${PATH12}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` @@ -254,111 +254,111 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { items: { audio: { - post: (option: { body: Methods18['post']['reqBody'], headers: Methods18['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods18['post']['reqBody'], headers?: Methods18['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods19['post']['reqBody'], headers?: Methods19['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods20['post']['reqBody'], headers?: Methods20['post']['reqHeaders'], config?: T }) => 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 }) => + get: (option: { query: Methods17['get']['query'], headers?: Methods17['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH11}`, GET, option).json(), - $get: (option: { query: Methods17['get']['query'], headers: Methods17['get']['reqHeaders'], config?: T }) => + $get: (option: { query: Methods17['get']['query'], headers?: Methods17['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH11}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods17['post']['reqBody'], headers: Methods17['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods17['post']['reqBody'], headers?: Methods17['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH11}`, POST, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods17['get']['query'] }) => `${prefix}${prefix7}${PATH11}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, itemslist: { - get: (option: { query: Methods21['get']['query'], headers: Methods21['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods21['get']['query'], headers?: Methods21['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH16}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods21['get']['query'] }) => `${prefix}${prefix7}${PATH16}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, users: { remove: { - post: (option: { body: Methods23['post']['reqBody'], headers: Methods23['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods23['post']['reqBody'], headers?: Methods23['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH18}`, POST, option).send().then(r => r.body), $path: () => `${prefix}${prefix7}${PATH18}` }, - get: (option: { headers: Methods22['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods22['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH17}`, GET, option).json(), - $get: (option: { headers: Methods22['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods22['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH17}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods22['post']['reqBody'], headers: Methods22['post']['reqHeaders'], config?: T }) => + post: (option: { body: Methods22['post']['reqBody'], headers?: Methods22['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH17}`, POST, option).send(), - $post: (option: { body: Methods22['post']['reqBody'], headers: Methods22['post']['reqHeaders'], config?: T }) => + $post: (option: { body: Methods22['post']['reqBody'], headers?: Methods22['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH17}`, POST, option).send().then(r => r.body), - put: (option: { body: Methods22['put']['reqBody'], headers: Methods22['put']['reqHeaders'], config?: T }) => + 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 }) => + $put: (option: { body: Methods22['put']['reqBody'], headers?: Methods22['put']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH17}`, PUT, option).send().then(r => r.body), $path: () => `${prefix}${prefix7}${PATH17}` }, - get: (option: { headers: Methods16['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods16['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, GET, option).json(), - $get: (option: { headers: Methods16['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods16['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, GET, option).json().then(r => r.body), - put: (option: { body: Methods16['put']['reqBody'], headers: Methods16['put']['reqHeaders'], config?: T }) => + put: (option: { body: Methods16['put']['reqBody'], headers?: Methods16['put']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, PUT, option).send(), - $put: (option: { body: Methods16['put']['reqBody'], headers: Methods16['put']['reqHeaders'], config?: T }) => + $put: (option: { body: Methods16['put']['reqBody'], headers?: Methods16['put']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, PUT, option).send().then(r => r.body), - delete: (option: { headers: Methods16['delete']['reqHeaders'], config?: T }) => + delete: (option?: { headers?: Methods16['delete']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, DELETE, option).send(), - $delete: (option: { headers: Methods16['delete']['reqHeaders'], config?: T }) => + $delete: (option?: { headers?: Methods16['delete']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, DELETE, option).send().then(r => r.body), $path: () => `${prefix}${prefix7}` } }, - get: (option: { headers: Methods15['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods15['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix6}${PATH10}`, GET, option).json(), - $get: (option: { headers: Methods15['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods15['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix6}${PATH10}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods15['post']['reqBody'], headers: Methods15['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods15['post']['reqBody'], headers?: Methods15['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $get: (option: { query: Methods24['get']['query'], headers?: Methods24['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix6}${PATH19}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods24['get']['query'] }) => `${prefix}${prefix6}${PATH19}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, - get: (option: { query: Methods14['get']['query'], headers: Methods14['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods14['get']['query'], headers?: Methods14['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix6, GET, option).send().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods14['get']['query'] }) => `${prefix}${prefix6}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` } }, - get: (option: { query: Methods11['get']['query'], headers: Methods11['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods11['get']['query'], headers?: Methods11['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH9, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods11['get']['query'] }) => `${prefix}${PATH9}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` @@ -373,13 +373,13 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const prefix9 = `${prefix8}${PATH11}/${val9}` return { - post: (option: { body: Methods25['post']['reqBody'], headers: Methods25['post']['reqHeaders'], config?: T }) => + post: (option: { body: Methods25['post']['reqBody'], headers?: Methods25['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix9, POST, option).json(), - $post: (option: { body: Methods25['post']['reqBody'], headers: Methods25['post']['reqHeaders'], config?: T }) => + $post: (option: { body: Methods25['post']['reqBody'], headers?: Methods25['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix9, POST, option).json().then(r => r.body), - get: (option: { headers: Methods25['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods25['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix9, GET, option).json(), - $get: (option: { headers: Methods25['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods25['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix9, GET, option).json().then(r => r.body), $path: () => `${prefix}${prefix9}` } @@ -393,33 +393,33 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { items: { audio: { - post: (option: { body: Methods27['post']['reqBody'], headers: Methods27['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods27['post']['reqBody'], headers?: Methods27['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods28['post']['reqBody'], headers?: Methods28['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods29['post']['reqBody'], headers?: Methods29['post']['reqHeaders'], config?: T }) => 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 }) => + get: (option?: { query?: Methods26['get']['query'], headers?: Methods26['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH11}`, GET, option).json(), - $get: (option: { query?: Methods26['get']['query'], headers: Methods26['get']['reqHeaders'], config?: T }) => + $get: (option?: { query?: Methods26['get']['query'], headers?: Methods26['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH11}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods26['post']['reqBody'], headers: Methods26['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods26['post']['reqBody'], headers?: Methods26['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH11}`, POST, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods26['get']['query'] }) => `${prefix}${prefix10}${PATH11}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` @@ -427,32 +427,32 @@ const api = ({ baseURL, fetch }: AspidaClient) => { } }, keys: { - get: (option: { headers: Methods30['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods30['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH21, GET, option).json(), - $get: (option: { headers: Methods30['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods30['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH21, GET, option).json().then(r => r.body), $path: () => `${prefix}${PATH21}` } }, extension: { audio: { - post: (option: { body: Methods31['post']['reqBody'], headers: Methods31['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods31['post']['reqBody'], headers?: Methods31['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods32['post']['reqBody'], headers?: Methods32['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods33['post']['reqBody'], headers?: Methods33['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH24, POST, option).json().then(r => r.body), $path: () => `${prefix}${PATH24}` }, @@ -462,89 +462,89 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { audio: { - post: (option: { body: Methods35['post']['reqBody'], headers: Methods35['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods35['post']['reqBody'], headers?: Methods35['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods36['post']['reqBody'], headers?: Methods36['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods37['post']['reqBody'], headers?: Methods37['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods34['post']['reqBody'], headers?: Methods34['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix11, POST, option, 'FormData').json().then(r => r.body), $path: () => `${prefix}${prefix11}` } } }, video: { - post: (option: { body: Methods38['post']['reqBody'], headers: Methods38['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods38['post']['reqBody'], headers?: Methods38['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods39['post']['reqBody'], headers?: Methods39['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH30, POST, option).send().then(r => r.body), $path: () => `${prefix}${PATH30}` }, info: { - get: (option: { headers: Methods40['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods40['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH31, GET, option).json(), - $get: (option: { headers: Methods40['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods40['get']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods41['post']['reqBody'], headers?: Methods41['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods42['post']['reqBody'], headers?: Methods42['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH33, POST, option).send().then(r => r.body), $path: () => `${prefix}${PATH33}` }, me: { - get: (option: { headers: Methods43['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods43['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH34, GET, option).json(), - $get: (option: { headers: Methods43['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods43['get']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $get: (option: { query: Methods45['get']['query'], headers?: Methods45['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH36, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods45['get']['query'] }) => `${prefix}${PATH36}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, - get: (option: { headers: Methods44['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods44['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH35, GET, option).json(), - $get: (option: { headers: Methods44['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods44['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH35, GET, option).json().then(r => r.body), $path: () => `${prefix}${PATH35}` }, @@ -559,22 +559,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { reaction: { - post: (option: { body: Methods48['post']['reqBody'], headers: Methods48['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods48['post']['reqBody'], headers?: Methods48['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix13}${PATH38}`, POST, option).json().then(r => r.body), $path: () => `${prefix}${prefix13}${PATH38}` }, - get: (option: { headers: Methods47['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods47['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix13, GET, option).json(), - $get: (option: { headers: Methods47['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods47['get']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $get: (option: { query: Methods46['get']['query'], headers?: Methods46['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix12}${PATH11}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods46['get']['query'] }) => `${prefix}${prefix12}${PATH11}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` @@ -587,23 +587,23 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const prefix14 = `${PATH39}/${val14}` return { - get: (option: { headers: Methods50['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods50['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix14, GET, option).json(), - $get: (option: { headers: Methods50['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods50['get']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $put: (option: { body: Methods51['put']['reqBody'], headers?: Methods51['put']['reqHeaders'], config?: T }) => fetch(prefix, PATH40, PUT, option, 'FormData').send().then(r => r.body), $path: () => `${prefix}${PATH40}` }, - get: (option: { headers: Methods49['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods49['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH39, GET, option).json(), - $get: (option: { headers: Methods49['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods49['get']['reqHeaders'], config?: T }) => 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 5bd7d027..bb3e6d15 100644 --- a/samples/openapi/api/$api.ts +++ b/samples/openapi/api/$api.ts @@ -200,9 +200,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { }, v3: { $2fa: { - post: (option: { body: Methods10['post']['reqBody'], headers: Methods10['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods10['post']['reqBody'], headers?: Methods10['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH8, POST, option).json().then(r => r.body), $path: () => `${prefix}${PATH8}` }, @@ -221,9 +221,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const prefix5 = `${prefix4}${PATH11}/${val5}` return { - post: (option: { body: Methods12['post']['reqBody'], headers: Methods12['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods12['post']['reqBody'], headers?: Methods12['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix5, POST, option).json().then(r => r.body), $path: () => `${prefix}${prefix5}` } @@ -233,9 +233,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { } }, news_feed: { - get: (option: { query: Methods13['get']['query'], headers: Methods13['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods13['get']['query'], headers?: Methods13['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix3}${PATH12}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods13['get']['query'] }) => `${prefix}${prefix3}${PATH12}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` @@ -253,111 +253,111 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { items: { audio: { - post: (option: { body: Methods18['post']['reqBody'], headers: Methods18['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods18['post']['reqBody'], headers?: Methods18['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods19['post']['reqBody'], headers?: Methods19['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods20['post']['reqBody'], headers?: Methods20['post']['reqHeaders'], config?: T }) => 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 }) => + get: (option: { query: Methods17['get']['query'], headers?: Methods17['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH11}`, GET, option).json(), - $get: (option: { query: Methods17['get']['query'], headers: Methods17['get']['reqHeaders'], config?: T }) => + $get: (option: { query: Methods17['get']['query'], headers?: Methods17['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH11}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods17['post']['reqBody'], headers: Methods17['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods17['post']['reqBody'], headers?: Methods17['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH11}`, POST, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods17['get']['query'] }) => `${prefix}${prefix7}${PATH11}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, itemslist: { - get: (option: { query: Methods21['get']['query'], headers: Methods21['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods21['get']['query'], headers?: Methods21['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH16}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods21['get']['query'] }) => `${prefix}${prefix7}${PATH16}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, users: { remove: { - post: (option: { body: Methods23['post']['reqBody'], headers: Methods23['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods23['post']['reqBody'], headers?: Methods23['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH18}`, POST, option).send().then(r => r.body), $path: () => `${prefix}${prefix7}${PATH18}` }, - get: (option: { headers: Methods22['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods22['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH17}`, GET, option).json(), - $get: (option: { headers: Methods22['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods22['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH17}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods22['post']['reqBody'], headers: Methods22['post']['reqHeaders'], config?: T }) => + post: (option: { body: Methods22['post']['reqBody'], headers?: Methods22['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH17}`, POST, option).send(), - $post: (option: { body: Methods22['post']['reqBody'], headers: Methods22['post']['reqHeaders'], config?: T }) => + $post: (option: { body: Methods22['post']['reqBody'], headers?: Methods22['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH17}`, POST, option).send().then(r => r.body), - put: (option: { body: Methods22['put']['reqBody'], headers: Methods22['put']['reqHeaders'], config?: T }) => + 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 }) => + $put: (option: { body: Methods22['put']['reqBody'], headers?: Methods22['put']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH17}`, PUT, option).send().then(r => r.body), $path: () => `${prefix}${prefix7}${PATH17}` }, - get: (option: { headers: Methods16['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods16['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, GET, option).json(), - $get: (option: { headers: Methods16['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods16['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, GET, option).json().then(r => r.body), - put: (option: { body: Methods16['put']['reqBody'], headers: Methods16['put']['reqHeaders'], config?: T }) => + put: (option: { body: Methods16['put']['reqBody'], headers?: Methods16['put']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, PUT, option).send(), - $put: (option: { body: Methods16['put']['reqBody'], headers: Methods16['put']['reqHeaders'], config?: T }) => + $put: (option: { body: Methods16['put']['reqBody'], headers?: Methods16['put']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, PUT, option).send().then(r => r.body), - delete: (option: { headers: Methods16['delete']['reqHeaders'], config?: T }) => + delete: (option?: { headers?: Methods16['delete']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, DELETE, option).send(), - $delete: (option: { headers: Methods16['delete']['reqHeaders'], config?: T }) => + $delete: (option?: { headers?: Methods16['delete']['reqHeaders'], config?: T }) => fetch(prefix, prefix7, DELETE, option).send().then(r => r.body), $path: () => `${prefix}${prefix7}` } }, - get: (option: { headers: Methods15['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods15['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix6}${PATH10}`, GET, option).json(), - $get: (option: { headers: Methods15['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods15['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix6}${PATH10}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods15['post']['reqBody'], headers: Methods15['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods15['post']['reqBody'], headers?: Methods15['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $get: (option: { query: Methods24['get']['query'], headers?: Methods24['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix6}${PATH19}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods24['get']['query'] }) => `${prefix}${prefix6}${PATH19}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, - get: (option: { query: Methods14['get']['query'], headers: Methods14['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods14['get']['query'], headers?: Methods14['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix6, GET, option).send().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods14['get']['query'] }) => `${prefix}${prefix6}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` } }, - get: (option: { query: Methods11['get']['query'], headers: Methods11['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods11['get']['query'], headers?: Methods11['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH9, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods11['get']['query'] }) => `${prefix}${PATH9}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` @@ -372,13 +372,13 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const prefix9 = `${prefix8}${PATH11}/${val9}` return { - post: (option: { body: Methods25['post']['reqBody'], headers: Methods25['post']['reqHeaders'], config?: T }) => + post: (option: { body: Methods25['post']['reqBody'], headers?: Methods25['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix9, POST, option).json(), - $post: (option: { body: Methods25['post']['reqBody'], headers: Methods25['post']['reqHeaders'], config?: T }) => + $post: (option: { body: Methods25['post']['reqBody'], headers?: Methods25['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix9, POST, option).json().then(r => r.body), - get: (option: { headers: Methods25['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods25['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix9, GET, option).json(), - $get: (option: { headers: Methods25['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods25['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix9, GET, option).json().then(r => r.body), $path: () => `${prefix}${prefix9}` } @@ -392,33 +392,33 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { items: { audio: { - post: (option: { body: Methods27['post']['reqBody'], headers: Methods27['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods27['post']['reqBody'], headers?: Methods27['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods28['post']['reqBody'], headers?: Methods28['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods29['post']['reqBody'], headers?: Methods29['post']['reqHeaders'], config?: T }) => 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 }) => + get: (option?: { query?: Methods26['get']['query'], headers?: Methods26['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH11}`, GET, option).json(), - $get: (option: { query?: Methods26['get']['query'], headers: Methods26['get']['reqHeaders'], config?: T }) => + $get: (option?: { query?: Methods26['get']['query'], headers?: Methods26['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH11}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods26['post']['reqBody'], headers: Methods26['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods26['post']['reqBody'], headers?: Methods26['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH11}`, POST, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods26['get']['query'] }) => `${prefix}${prefix10}${PATH11}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` @@ -426,32 +426,32 @@ const api = ({ baseURL, fetch }: AspidaClient) => { } }, keys: { - get: (option: { headers: Methods30['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods30['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH21, GET, option).json(), - $get: (option: { headers: Methods30['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods30['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH21, GET, option).json().then(r => r.body), $path: () => `${prefix}${PATH21}` } }, extension: { audio: { - post: (option: { body: Methods31['post']['reqBody'], headers: Methods31['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods31['post']['reqBody'], headers?: Methods31['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods32['post']['reqBody'], headers?: Methods32['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods33['post']['reqBody'], headers?: Methods33['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH24, POST, option).json().then(r => r.body), $path: () => `${prefix}${PATH24}` }, @@ -461,89 +461,89 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { audio: { - post: (option: { body: Methods35['post']['reqBody'], headers: Methods35['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods35['post']['reqBody'], headers?: Methods35['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods36['post']['reqBody'], headers?: Methods36['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods37['post']['reqBody'], headers?: Methods37['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods34['post']['reqBody'], headers?: Methods34['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix11, POST, option, 'FormData').json().then(r => r.body), $path: () => `${prefix}${prefix11}` } } }, video: { - post: (option: { body: Methods38['post']['reqBody'], headers: Methods38['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods38['post']['reqBody'], headers?: Methods38['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods39['post']['reqBody'], headers?: Methods39['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH30, POST, option).send().then(r => r.body), $path: () => `${prefix}${PATH30}` }, info: { - get: (option: { headers: Methods40['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods40['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH31, GET, option).json(), - $get: (option: { headers: Methods40['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods40['get']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods41['post']['reqBody'], headers?: Methods41['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods42['post']['reqBody'], headers?: Methods42['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH33, POST, option).send().then(r => r.body), $path: () => `${prefix}${PATH33}` }, me: { - get: (option: { headers: Methods43['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods43['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH34, GET, option).json(), - $get: (option: { headers: Methods43['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods43['get']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $get: (option: { query: Methods45['get']['query'], headers?: Methods45['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH36, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods45['get']['query'] }) => `${prefix}${PATH36}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, - get: (option: { headers: Methods44['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods44['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH35, GET, option).json(), - $get: (option: { headers: Methods44['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods44['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH35, GET, option).json().then(r => r.body), $path: () => `${prefix}${PATH35}` }, @@ -558,22 +558,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { reaction: { - post: (option: { body: Methods48['post']['reqBody'], headers: Methods48['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods48['post']['reqBody'], headers?: Methods48['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix13}${PATH38}`, POST, option).json().then(r => r.body), $path: () => `${prefix}${prefix13}${PATH38}` }, - get: (option: { headers: Methods47['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods47['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix13, GET, option).json(), - $get: (option: { headers: Methods47['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods47['get']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $get: (option: { query: Methods46['get']['query'], headers?: Methods46['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix12}${PATH11}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods46['get']['query'] }) => `${prefix}${prefix12}${PATH11}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` @@ -586,23 +586,23 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const prefix14 = `${PATH39}/${val14}` return { - get: (option: { headers: Methods50['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods50['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix14, GET, option).json(), - $get: (option: { headers: Methods50['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods50['get']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $put: (option: { body: Methods51['put']['reqBody'], headers?: Methods51['put']['reqHeaders'], config?: T }) => fetch(prefix, PATH40, PUT, option, 'FormData').send().then(r => r.body), $path: () => `${prefix}${PATH40}` }, - get: (option: { headers: Methods49['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods49['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH39, GET, option).json(), - $get: (option: { headers: Methods49['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods49['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH39, GET, option).json().then(r => r.body), $path: () => `${prefix}${PATH39}` } diff --git a/samples/openapi/api/v3/$api.ts b/samples/openapi/api/v3/$api.ts index 9367495d..a5093643 100644 --- a/samples/openapi/api/v3/$api.ts +++ b/samples/openapi/api/v3/$api.ts @@ -85,9 +85,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { $2fa: { - post: (option: { body: Methods0['post']['reqBody'], headers: Methods0['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option).json().then(r => r.body), $path: () => `${prefix}${PATH0}` }, @@ -106,9 +106,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const prefix2 = `${prefix1}${PATH3}/${val2}` return { - post: (option: { body: Methods2['post']['reqBody'], headers: Methods2['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods2['post']['reqBody'], headers?: Methods2['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix2, POST, option).json().then(r => r.body), $path: () => `${prefix}${prefix2}` } @@ -118,9 +118,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { } }, news_feed: { - get: (option: { query: Methods3['get']['query'], headers: Methods3['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods3['get']['query'], headers?: Methods3['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix0}${PATH4}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods3['get']['query'] }) => `${prefix}${prefix0}${PATH4}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` @@ -138,111 +138,111 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { items: { audio: { - post: (option: { body: Methods8['post']['reqBody'], headers: Methods8['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods8['post']['reqBody'], headers?: Methods8['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods9['post']['reqBody'], headers?: Methods9['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods10['post']['reqBody'], headers?: Methods10['post']['reqHeaders'], config?: T }) => 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 }) => + get: (option: { query: Methods7['get']['query'], headers?: Methods7['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH3}`, GET, option).json(), - $get: (option: { query: Methods7['get']['query'], headers: Methods7['get']['reqHeaders'], config?: T }) => + $get: (option: { query: Methods7['get']['query'], headers?: Methods7['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH3}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods7['post']['reqBody'], headers: Methods7['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods7['post']['reqBody'], headers?: Methods7['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH3}`, POST, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods7['get']['query'] }) => `${prefix}${prefix4}${PATH3}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, itemslist: { - get: (option: { query: Methods11['get']['query'], headers: Methods11['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods11['get']['query'], headers?: Methods11['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH8}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods11['get']['query'] }) => `${prefix}${prefix4}${PATH8}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, users: { remove: { - post: (option: { body: Methods13['post']['reqBody'], headers: Methods13['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods13['post']['reqBody'], headers?: Methods13['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH10}`, POST, option).send().then(r => r.body), $path: () => `${prefix}${prefix4}${PATH10}` }, - get: (option: { headers: Methods12['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods12['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH9}`, GET, option).json(), - $get: (option: { headers: Methods12['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods12['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH9}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods12['post']['reqBody'], headers: Methods12['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods12['post']['reqBody'], headers?: Methods12['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH9}`, POST, option).send().then(r => r.body), - put: (option: { body: Methods12['put']['reqBody'], headers: Methods12['put']['reqHeaders'], config?: T }) => + 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 }) => + $put: (option: { body: Methods12['put']['reqBody'], headers?: Methods12['put']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH9}`, PUT, option).send().then(r => r.body), $path: () => `${prefix}${prefix4}${PATH9}` }, - get: (option: { headers: Methods6['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods6['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, GET, option).json(), - $get: (option: { headers: Methods6['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods6['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, GET, option).json().then(r => r.body), - put: (option: { body: Methods6['put']['reqBody'], headers: Methods6['put']['reqHeaders'], config?: T }) => + put: (option: { body: Methods6['put']['reqBody'], headers?: Methods6['put']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, PUT, option).send(), - $put: (option: { body: Methods6['put']['reqBody'], headers: Methods6['put']['reqHeaders'], config?: T }) => + $put: (option: { body: Methods6['put']['reqBody'], headers?: Methods6['put']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, PUT, option).send().then(r => r.body), - delete: (option: { headers: Methods6['delete']['reqHeaders'], config?: T }) => + delete: (option?: { headers?: Methods6['delete']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, DELETE, option).send(), - $delete: (option: { headers: Methods6['delete']['reqHeaders'], config?: T }) => + $delete: (option?: { headers?: Methods6['delete']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, DELETE, option).send().then(r => r.body), $path: () => `${prefix}${prefix4}` } }, - get: (option: { headers: Methods5['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods5['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix3}${PATH2}`, GET, option).json(), - $get: (option: { headers: Methods5['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods5['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix3}${PATH2}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods5['post']['reqBody'], headers: Methods5['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods5['post']['reqBody'], headers?: Methods5['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $get: (option: { query: Methods14['get']['query'], headers?: Methods14['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix3}${PATH11}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods14['get']['query'] }) => `${prefix}${prefix3}${PATH11}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, - get: (option: { query: Methods4['get']['query'], headers: Methods4['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods4['get']['query'], headers?: Methods4['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix3, GET, option).send().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods4['get']['query'] }) => `${prefix}${prefix3}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` } }, - get: (option: { query: Methods1['get']['query'], headers: Methods1['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods1['get']['query'], headers?: Methods1['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH1, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => `${prefix}${PATH1}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` @@ -257,13 +257,13 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const prefix6 = `${prefix5}${PATH3}/${val6}` return { - post: (option: { body: Methods15['post']['reqBody'], headers: Methods15['post']['reqHeaders'], config?: T }) => + post: (option: { body: Methods15['post']['reqBody'], headers?: Methods15['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix6, POST, option).json(), - $post: (option: { body: Methods15['post']['reqBody'], headers: Methods15['post']['reqHeaders'], config?: T }) => + $post: (option: { body: Methods15['post']['reqBody'], headers?: Methods15['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix6, POST, option).json().then(r => r.body), - get: (option: { headers: Methods15['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods15['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix6, GET, option).json(), - $get: (option: { headers: Methods15['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods15['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix6, GET, option).json().then(r => r.body), $path: () => `${prefix}${prefix6}` } @@ -277,33 +277,33 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { items: { audio: { - post: (option: { body: Methods17['post']['reqBody'], headers: Methods17['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods17['post']['reqBody'], headers?: Methods17['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods18['post']['reqBody'], headers?: Methods18['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods19['post']['reqBody'], headers?: Methods19['post']['reqHeaders'], config?: T }) => 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 }) => + get: (option?: { query?: Methods16['get']['query'], headers?: Methods16['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH3}`, GET, option).json(), - $get: (option: { query?: Methods16['get']['query'], headers: Methods16['get']['reqHeaders'], config?: T }) => + $get: (option?: { query?: Methods16['get']['query'], headers?: Methods16['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH3}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods16['post']['reqBody'], headers: Methods16['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods16['post']['reqBody'], headers?: Methods16['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix7}${PATH3}`, POST, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods16['get']['query'] }) => `${prefix}${prefix7}${PATH3}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` @@ -311,32 +311,32 @@ const api = ({ baseURL, fetch }: AspidaClient) => { } }, keys: { - get: (option: { headers: Methods20['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods20['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH13, GET, option).json(), - $get: (option: { headers: Methods20['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods20['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH13, GET, option).json().then(r => r.body), $path: () => `${prefix}${PATH13}` } }, extension: { audio: { - post: (option: { body: Methods21['post']['reqBody'], headers: Methods21['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods21['post']['reqBody'], headers?: Methods21['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods22['post']['reqBody'], headers?: Methods22['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods23['post']['reqBody'], headers?: Methods23['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH16, POST, option).json().then(r => r.body), $path: () => `${prefix}${PATH16}` }, @@ -346,89 +346,89 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { audio: { - post: (option: { body: Methods25['post']['reqBody'], headers: Methods25['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods25['post']['reqBody'], headers?: Methods25['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods26['post']['reqBody'], headers?: Methods26['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods27['post']['reqBody'], headers?: Methods27['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods24['post']['reqBody'], headers?: Methods24['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix8, POST, option, 'FormData').json().then(r => r.body), $path: () => `${prefix}${prefix8}` } } }, video: { - post: (option: { body: Methods28['post']['reqBody'], headers: Methods28['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods28['post']['reqBody'], headers?: Methods28['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods29['post']['reqBody'], headers?: Methods29['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH22, POST, option).send().then(r => r.body), $path: () => `${prefix}${PATH22}` }, info: { - get: (option: { headers: Methods30['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods30['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH23, GET, option).json(), - $get: (option: { headers: Methods30['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods30['get']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods31['post']['reqBody'], headers?: Methods31['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods32['post']['reqBody'], headers?: Methods32['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH25, POST, option).send().then(r => r.body), $path: () => `${prefix}${PATH25}` }, me: { - get: (option: { headers: Methods33['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods33['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH26, GET, option).json(), - $get: (option: { headers: Methods33['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods33['get']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $get: (option: { query: Methods35['get']['query'], headers?: Methods35['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH28, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods35['get']['query'] }) => `${prefix}${PATH28}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, - get: (option: { headers: Methods34['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods34['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH27, GET, option).json(), - $get: (option: { headers: Methods34['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods34['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH27, GET, option).json().then(r => r.body), $path: () => `${prefix}${PATH27}` }, @@ -443,22 +443,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { reaction: { - post: (option: { body: Methods38['post']['reqBody'], headers: Methods38['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods38['post']['reqBody'], headers?: Methods38['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix10}${PATH30}`, POST, option).json().then(r => r.body), $path: () => `${prefix}${prefix10}${PATH30}` }, - get: (option: { headers: Methods37['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods37['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix10, GET, option).json(), - $get: (option: { headers: Methods37['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods37['get']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $get: (option: { query: Methods36['get']['query'], headers?: Methods36['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix9}${PATH3}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods36['get']['query'] }) => `${prefix}${prefix9}${PATH3}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` @@ -471,23 +471,23 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const prefix11 = `${PATH31}/${val11}` return { - get: (option: { headers: Methods40['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods40['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix11, GET, option).json(), - $get: (option: { headers: Methods40['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods40['get']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $put: (option: { body: Methods41['put']['reqBody'], headers?: Methods41['put']['reqHeaders'], config?: T }) => fetch(prefix, PATH32, PUT, option, 'FormData').send().then(r => r.body), $path: () => `${prefix}${PATH32}` }, - get: (option: { headers: Methods39['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods39['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH31, GET, option).json(), - $get: (option: { headers: Methods39['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods39['get']['reqHeaders'], config?: T }) => 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 e209ec68..f495c217 100644 --- a/samples/openapi/api/v3/2fa/$api.ts +++ b/samples/openapi/api/v3/2fa/$api.ts @@ -8,9 +8,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const POST = 'POST' return { - post: (option: { body: Methods0['post']['reqBody'], headers: Methods0['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option).json().then(r => r.body), $path: () => `${prefix}${PATH0}` } diff --git a/samples/openapi/api/v3/2fa/index.ts b/samples/openapi/api/v3/2fa/index.ts index 7fd5886a..20912ff2 100644 --- a/samples/openapi/api/v3/2fa/index.ts +++ b/samples/openapi/api/v3/2fa/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationTokenRequired + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationTokenRequired status: 200 resBody: { diff --git a/samples/openapi/api/v3/channels/$api.ts b/samples/openapi/api/v3/channels/$api.ts index 8c487dc3..cac1dba5 100644 --- a/samples/openapi/api/v3/channels/$api.ts +++ b/samples/openapi/api/v3/channels/$api.ts @@ -48,9 +48,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const prefix2 = `${prefix1}${PATH2}/${val2}` return { - post: (option: { body: Methods1['post']['reqBody'], headers: Methods1['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods1['post']['reqBody'], headers?: Methods1['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix2, POST, option).json().then(r => r.body), $path: () => `${prefix}${prefix2}` } @@ -60,9 +60,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { } }, news_feed: { - get: (option: { query: Methods2['get']['query'], headers: Methods2['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods2['get']['query'], headers?: Methods2['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix0}${PATH3}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods2['get']['query'] }) => `${prefix}${prefix0}${PATH3}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` @@ -80,111 +80,111 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { items: { audio: { - post: (option: { body: Methods7['post']['reqBody'], headers: Methods7['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods7['post']['reqBody'], headers?: Methods7['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods8['post']['reqBody'], headers?: Methods8['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods9['post']['reqBody'], headers?: Methods9['post']['reqHeaders'], config?: T }) => 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 }) => + get: (option: { query: Methods6['get']['query'], headers?: Methods6['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH2}`, GET, option).json(), - $get: (option: { query: Methods6['get']['query'], headers: Methods6['get']['reqHeaders'], config?: T }) => + $get: (option: { query: Methods6['get']['query'], headers?: Methods6['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH2}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods6['post']['reqBody'], headers: Methods6['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods6['post']['reqBody'], headers?: Methods6['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH2}`, POST, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods6['get']['query'] }) => `${prefix}${prefix4}${PATH2}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, itemslist: { - get: (option: { query: Methods10['get']['query'], headers: Methods10['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods10['get']['query'], headers?: Methods10['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH7}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods10['get']['query'] }) => `${prefix}${prefix4}${PATH7}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, users: { remove: { - post: (option: { body: Methods12['post']['reqBody'], headers: Methods12['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods12['post']['reqBody'], headers?: Methods12['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH9}`, POST, option).send().then(r => r.body), $path: () => `${prefix}${prefix4}${PATH9}` }, - get: (option: { headers: Methods11['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods11['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH8}`, GET, option).json(), - $get: (option: { headers: Methods11['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods11['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH8}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods11['post']['reqBody'], headers: Methods11['post']['reqHeaders'], config?: T }) => + post: (option: { body: Methods11['post']['reqBody'], headers?: Methods11['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH8}`, POST, option).send(), - $post: (option: { body: Methods11['post']['reqBody'], headers: Methods11['post']['reqHeaders'], config?: T }) => + $post: (option: { body: Methods11['post']['reqBody'], headers?: Methods11['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH8}`, POST, option).send().then(r => r.body), - put: (option: { body: Methods11['put']['reqBody'], headers: Methods11['put']['reqHeaders'], config?: T }) => + 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 }) => + $put: (option: { body: Methods11['put']['reqBody'], headers?: Methods11['put']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix4}${PATH8}`, PUT, option).send().then(r => r.body), $path: () => `${prefix}${prefix4}${PATH8}` }, - get: (option: { headers: Methods5['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods5['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, GET, option).json(), - $get: (option: { headers: Methods5['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods5['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, GET, option).json().then(r => r.body), - put: (option: { body: Methods5['put']['reqBody'], headers: Methods5['put']['reqHeaders'], config?: T }) => + put: (option: { body: Methods5['put']['reqBody'], headers?: Methods5['put']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, PUT, option).send(), - $put: (option: { body: Methods5['put']['reqBody'], headers: Methods5['put']['reqHeaders'], config?: T }) => + $put: (option: { body: Methods5['put']['reqBody'], headers?: Methods5['put']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, PUT, option).send().then(r => r.body), - delete: (option: { headers: Methods5['delete']['reqHeaders'], config?: T }) => + delete: (option?: { headers?: Methods5['delete']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, DELETE, option).send(), - $delete: (option: { headers: Methods5['delete']['reqHeaders'], config?: T }) => + $delete: (option?: { headers?: Methods5['delete']['reqHeaders'], config?: T }) => fetch(prefix, prefix4, DELETE, option).send().then(r => r.body), $path: () => `${prefix}${prefix4}` } }, - get: (option: { headers: Methods4['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods4['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix3}${PATH1}`, GET, option).json(), - $get: (option: { headers: Methods4['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods4['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix3}${PATH1}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods4['post']['reqBody'], headers: Methods4['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods4['post']['reqBody'], headers?: Methods4['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $get: (option: { query: Methods13['get']['query'], headers?: Methods13['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix3}${PATH10}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods13['get']['query'] }) => `${prefix}${prefix3}${PATH10}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, - get: (option: { query: Methods3['get']['query'], headers: Methods3['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods3['get']['query'], headers?: Methods3['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix3, GET, option).send().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods3['get']['query'] }) => `${prefix}${prefix3}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` } }, - get: (option: { query: Methods0['get']['query'], headers: Methods0['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods0['get']['query'], headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => `${prefix}${PATH0}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` diff --git a/samples/openapi/api/v3/channels/_channelId@number/chats/_chatId@number/items/_itemId@number/index.ts b/samples/openapi/api/v3/channels/_channelId@number/chats/_chatId@number/items/_itemId@number/index.ts index 8f01cd61..465d1054 100644 --- a/samples/openapi/api/v3/channels/_channelId@number/chats/_chatId@number/items/_itemId@number/index.ts +++ b/samples/openapi/api/v3/channels/_channelId@number/chats/_chatId@number/items/_itemId@number/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader status: 200 resBody: { diff --git a/samples/openapi/api/v3/channels/_channelId@number/news-feed/index.ts b/samples/openapi/api/v3/channels/_channelId@number/news-feed/index.ts index f33c1348..4a06eae3 100644 --- a/samples/openapi/api/v3/channels/_channelId@number/news-feed/index.ts +++ b/samples/openapi/api/v3/channels/_channelId@number/news-feed/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader query: { timestamp: number diff --git a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/index.ts b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/index.ts index 87a663bc..425fb75c 100644 --- a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/index.ts +++ b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: { @@ -37,7 +37,7 @@ export type Methods = { } put: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 reqBody: { @@ -51,7 +51,7 @@ export type Methods = { } delete: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 } } diff --git a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/audio/index.ts b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/audio/index.ts index b4b097a7..b49d78f9 100644 --- a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/audio/index.ts +++ b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/audio/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.UserTokenHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.UserTokenHeader & Types.AppOrganisationToken status: 200 resBody: { diff --git a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/image/index.ts b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/image/index.ts index 5681502b..d70d6c30 100644 --- a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/image/index.ts +++ b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/image/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: { diff --git a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/index.ts b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/index.ts index fd692ff6..c0465924 100644 --- a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/index.ts +++ b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader query: { offset: number @@ -18,7 +18,7 @@ export type Methods = { } post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: { diff --git a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/video/index.ts b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/video/index.ts index 5681502b..d70d6c30 100644 --- a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/video/index.ts +++ b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/items/video/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: { diff --git a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/itemslist/index.ts b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/itemslist/index.ts index 31cfd0ca..45605c08 100644 --- a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/itemslist/index.ts +++ b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/itemslist/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken query: { ids: string diff --git a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/users/index.ts b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/users/index.ts index 3ac69c80..e83a204c 100644 --- a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/users/index.ts +++ b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/users/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: { id: number @@ -17,7 +17,7 @@ export type Methods = { } post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 201 reqBody: { @@ -28,7 +28,7 @@ export type Methods = { } put: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 reqBody: { diff --git a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/users/remove/index.ts b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/users/remove/index.ts index fbe97c4b..f99ee60b 100644 --- a/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/users/remove/index.ts +++ b/samples/openapi/api/v3/channels/_channelId@string/chats/_chatId@string/users/remove/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 reqBody: { diff --git a/samples/openapi/api/v3/channels/_channelId@string/chats/index.ts b/samples/openapi/api/v3/channels/_channelId@string/chats/index.ts index 359234de..d75f1317 100644 --- a/samples/openapi/api/v3/channels/_channelId@string/chats/index.ts +++ b/samples/openapi/api/v3/channels/_channelId@string/chats/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserPublicKey & Types.UserSignedChallenge + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserPublicKey & Types.UserSignedChallenge status: 200 resBody: { @@ -45,7 +45,7 @@ export type Methods = { } post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 201 resBody: { diff --git a/samples/openapi/api/v3/channels/_channelId@string/index.ts b/samples/openapi/api/v3/channels/_channelId@string/index.ts index 4b8c3b4c..ba6e4697 100644 --- a/samples/openapi/api/v3/channels/_channelId@string/index.ts +++ b/samples/openapi/api/v3/channels/_channelId@string/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader query: { excludeItems: boolean diff --git a/samples/openapi/api/v3/channels/_channelId@string/notifications/index.ts b/samples/openapi/api/v3/channels/_channelId@string/notifications/index.ts index 914d296c..127d8b15 100644 --- a/samples/openapi/api/v3/channels/_channelId@string/notifications/index.ts +++ b/samples/openapi/api/v3/channels/_channelId@string/notifications/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken query: { published: boolean diff --git a/samples/openapi/api/v3/channels/index.ts b/samples/openapi/api/v3/channels/index.ts index 461125c8..c9842919 100644 --- a/samples/openapi/api/v3/channels/index.ts +++ b/samples/openapi/api/v3/channels/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken query: { unpublished: boolean diff --git a/samples/openapi/api/v3/chats/$api.ts b/samples/openapi/api/v3/chats/$api.ts index ed883c24..aa0086c0 100644 --- a/samples/openapi/api/v3/chats/$api.ts +++ b/samples/openapi/api/v3/chats/$api.ts @@ -28,13 +28,13 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const prefix1 = `${prefix0}${PATH1}/${val1}` return { - post: (option: { body: Methods0['post']['reqBody'], headers: Methods0['post']['reqHeaders'], config?: T }) => + post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix1, POST, option).json(), - $post: (option: { body: Methods0['post']['reqBody'], headers: Methods0['post']['reqHeaders'], config?: T }) => + $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix1, POST, option).json().then(r => r.body), - get: (option: { headers: Methods0['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix1, GET, option).json(), - $get: (option: { headers: Methods0['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix1, GET, option).json().then(r => r.body), $path: () => `${prefix}${prefix1}` } @@ -48,33 +48,33 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { items: { audio: { - post: (option: { body: Methods2['post']['reqBody'], headers: Methods2['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods2['post']['reqBody'], headers?: Methods2['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods3['post']['reqBody'], headers?: Methods3['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods4['post']['reqBody'], headers?: Methods4['post']['reqHeaders'], config?: T }) => 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 }) => + get: (option?: { query?: Methods1['get']['query'], headers?: Methods1['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix2}${PATH1}`, GET, option).json(), - $get: (option: { query?: Methods1['get']['query'], headers: Methods1['get']['reqHeaders'], config?: T }) => + $get: (option?: { query?: Methods1['get']['query'], headers?: Methods1['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix2}${PATH1}`, GET, option).json().then(r => r.body), - post: (option: { body: Methods1['post']['reqBody'], headers: Methods1['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods1['post']['reqBody'], headers?: Methods1['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix2}${PATH1}`, POST, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => `${prefix}${prefix2}${PATH1}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` @@ -82,9 +82,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { } }, keys: { - get: (option: { headers: Methods5['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods5['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH5, GET, option).json(), - $get: (option: { headers: Methods5['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods5['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH5, GET, option).json().then(r => r.body), $path: () => `${prefix}${PATH5}` } diff --git a/samples/openapi/api/v3/chats/_chatId@number/items/_itemId@number/index.ts b/samples/openapi/api/v3/chats/_chatId@number/items/_itemId@number/index.ts index 3580f841..e6392d61 100644 --- a/samples/openapi/api/v3/chats/_chatId@number/items/_itemId@number/index.ts +++ b/samples/openapi/api/v3/chats/_chatId@number/items/_itemId@number/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader status: 200 resBody: { @@ -16,7 +16,7 @@ export type Methods = { } get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader status: 200 resBody: Types.ModelCard } diff --git a/samples/openapi/api/v3/chats/_chatId@string/items/audio/index.ts b/samples/openapi/api/v3/chats/_chatId@string/items/audio/index.ts index 6cb31735..fdeb4642 100644 --- a/samples/openapi/api/v3/chats/_chatId@string/items/audio/index.ts +++ b/samples/openapi/api/v3/chats/_chatId@string/items/audio/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.UserTokenHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.UserTokenHeader & Types.AppOrganisationToken status: 200 resBody: { diff --git a/samples/openapi/api/v3/chats/_chatId@string/items/image/index.ts b/samples/openapi/api/v3/chats/_chatId@string/items/image/index.ts index 755e9ae2..da3bf7d7 100644 --- a/samples/openapi/api/v3/chats/_chatId@string/items/image/index.ts +++ b/samples/openapi/api/v3/chats/_chatId@string/items/image/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: { diff --git a/samples/openapi/api/v3/chats/_chatId@string/items/index.ts b/samples/openapi/api/v3/chats/_chatId@string/items/index.ts index 33401f9a..b586327a 100644 --- a/samples/openapi/api/v3/chats/_chatId@string/items/index.ts +++ b/samples/openapi/api/v3/chats/_chatId@string/items/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader query?: { offset?: number @@ -19,7 +19,7 @@ export type Methods = { } post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: { diff --git a/samples/openapi/api/v3/chats/_chatId@string/items/video/index.ts b/samples/openapi/api/v3/chats/_chatId@string/items/video/index.ts index 755e9ae2..da3bf7d7 100644 --- a/samples/openapi/api/v3/chats/_chatId@string/items/video/index.ts +++ b/samples/openapi/api/v3/chats/_chatId@string/items/video/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: { diff --git a/samples/openapi/api/v3/chats/keys/$api.ts b/samples/openapi/api/v3/chats/keys/$api.ts index 56e42d0d..415faaeb 100644 --- a/samples/openapi/api/v3/chats/keys/$api.ts +++ b/samples/openapi/api/v3/chats/keys/$api.ts @@ -8,9 +8,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const GET = 'GET' return { - get: (option: { headers: Methods0['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), - $get: (option: { headers: Methods0['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json().then(r => r.body), $path: () => `${prefix}${PATH0}` } diff --git a/samples/openapi/api/v3/chats/keys/index.ts b/samples/openapi/api/v3/chats/keys/index.ts index de4b8bb6..13a8f63c 100644 --- a/samples/openapi/api/v3/chats/keys/index.ts +++ b/samples/openapi/api/v3/chats/keys/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserPublicKey & Types.UserSignedChallenge + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserPublicKey & Types.UserSignedChallenge status: 200 resBody: { diff --git a/samples/openapi/api/v3/extension/$api.ts b/samples/openapi/api/v3/extension/$api.ts index 70299f76..87428fb8 100644 --- a/samples/openapi/api/v3/extension/$api.ts +++ b/samples/openapi/api/v3/extension/$api.ts @@ -23,23 +23,23 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { audio: { - post: (option: { body: Methods0['post']['reqBody'], headers: Methods0['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods1['post']['reqBody'], headers?: Methods1['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods2['post']['reqBody'], headers?: Methods2['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH2, POST, option).json().then(r => r.body), $path: () => `${prefix}${PATH2}` }, @@ -49,38 +49,38 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { audio: { - post: (option: { body: Methods4['post']['reqBody'], headers: Methods4['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods4['post']['reqBody'], headers?: Methods4['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods5['post']['reqBody'], headers?: Methods5['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods6['post']['reqBody'], headers?: Methods6['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods3['post']['reqBody'], headers?: Methods3['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix0, POST, option, 'FormData').json().then(r => r.body), $path: () => `${prefix}${prefix0}` } } }, video: { - post: (option: { body: Methods7['post']['reqBody'], headers: Methods7['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods7['post']['reqBody'], headers?: Methods7['post']['reqHeaders'], config?: T }) => 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 40421788..48f52365 100644 --- a/samples/openapi/api/v3/extension/audio/$api.ts +++ b/samples/openapi/api/v3/extension/audio/$api.ts @@ -8,9 +8,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const POST = 'POST' return { - post: (option: { body: Methods0['post']['reqBody'], headers: Methods0['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option, 'FormData').json().then(r => r.body), $path: () => `${prefix}${PATH0}` } diff --git a/samples/openapi/api/v3/extension/audio/index.ts b/samples/openapi/api/v3/extension/audio/index.ts index 6377f743..36fd2d55 100644 --- a/samples/openapi/api/v3/extension/audio/index.ts +++ b/samples/openapi/api/v3/extension/audio/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: { diff --git a/samples/openapi/api/v3/extension/image/$api.ts b/samples/openapi/api/v3/extension/image/$api.ts index c3407f87..7afb5ffc 100644 --- a/samples/openapi/api/v3/extension/image/$api.ts +++ b/samples/openapi/api/v3/extension/image/$api.ts @@ -8,9 +8,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const POST = 'POST' return { - post: (option: { body: Methods0['post']['reqBody'], headers: Methods0['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option, 'FormData').json().then(r => r.body), $path: () => `${prefix}${PATH0}` } diff --git a/samples/openapi/api/v3/extension/image/index.ts b/samples/openapi/api/v3/extension/image/index.ts index 0c433cc2..42784942 100644 --- a/samples/openapi/api/v3/extension/image/index.ts +++ b/samples/openapi/api/v3/extension/image/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: { diff --git a/samples/openapi/api/v3/extension/parse/$api.ts b/samples/openapi/api/v3/extension/parse/$api.ts index 5fd8b508..ecab854b 100644 --- a/samples/openapi/api/v3/extension/parse/$api.ts +++ b/samples/openapi/api/v3/extension/parse/$api.ts @@ -8,9 +8,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const POST = 'POST' return { - post: (option: { body: Methods0['post']['reqBody'], headers: Methods0['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option).json().then(r => r.body), $path: () => `${prefix}${PATH0}` } diff --git a/samples/openapi/api/v3/extension/parse/index.ts b/samples/openapi/api/v3/extension/parse/index.ts index d6a3fbf9..655271e1 100644 --- a/samples/openapi/api/v3/extension/parse/index.ts +++ b/samples/openapi/api/v3/extension/parse/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader status: 200 resBody: { diff --git a/samples/openapi/api/v3/extension/story/$api.ts b/samples/openapi/api/v3/extension/story/$api.ts index 913fbb8c..9f06e6d0 100644 --- a/samples/openapi/api/v3/extension/story/$api.ts +++ b/samples/openapi/api/v3/extension/story/$api.ts @@ -19,29 +19,29 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { audio: { - post: (option: { body: Methods1['post']['reqBody'], headers: Methods1['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods1['post']['reqBody'], headers?: Methods1['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods2['post']['reqBody'], headers?: Methods2['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods3['post']['reqBody'], headers?: Methods3['post']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, prefix0, POST, option, 'FormData').json().then(r => r.body), $path: () => `${prefix}${prefix0}` } diff --git a/samples/openapi/api/v3/extension/story/_storyId@string/audio/index.ts b/samples/openapi/api/v3/extension/story/_storyId@string/audio/index.ts index d6576110..6e1d68cc 100644 --- a/samples/openapi/api/v3/extension/story/_storyId@string/audio/index.ts +++ b/samples/openapi/api/v3/extension/story/_storyId@string/audio/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: { diff --git a/samples/openapi/api/v3/extension/story/_storyId@string/image/index.ts b/samples/openapi/api/v3/extension/story/_storyId@string/image/index.ts index eccaf121..75243108 100644 --- a/samples/openapi/api/v3/extension/story/_storyId@string/image/index.ts +++ b/samples/openapi/api/v3/extension/story/_storyId@string/image/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: { diff --git a/samples/openapi/api/v3/extension/story/_storyId@string/index.ts b/samples/openapi/api/v3/extension/story/_storyId@string/index.ts index 58ba4db9..6f086098 100644 --- a/samples/openapi/api/v3/extension/story/_storyId@string/index.ts +++ b/samples/openapi/api/v3/extension/story/_storyId@string/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: { diff --git a/samples/openapi/api/v3/extension/story/_storyId@string/video/index.ts b/samples/openapi/api/v3/extension/story/_storyId@string/video/index.ts index eccaf121..75243108 100644 --- a/samples/openapi/api/v3/extension/story/_storyId@string/video/index.ts +++ b/samples/openapi/api/v3/extension/story/_storyId@string/video/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: { diff --git a/samples/openapi/api/v3/extension/video/$api.ts b/samples/openapi/api/v3/extension/video/$api.ts index b48e663d..45bc3e70 100644 --- a/samples/openapi/api/v3/extension/video/$api.ts +++ b/samples/openapi/api/v3/extension/video/$api.ts @@ -8,9 +8,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const POST = 'POST' return { - post: (option: { body: Methods0['post']['reqBody'], headers: Methods0['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option, 'FormData').json().then(r => r.body), $path: () => `${prefix}${PATH0}` } diff --git a/samples/openapi/api/v3/extension/video/index.ts b/samples/openapi/api/v3/extension/video/index.ts index 0c433cc2..42784942 100644 --- a/samples/openapi/api/v3/extension/video/index.ts +++ b/samples/openapi/api/v3/extension/video/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: { diff --git a/samples/openapi/api/v3/fcm_token/$api.ts b/samples/openapi/api/v3/fcm_token/$api.ts index 6d9dde32..f99a0c1c 100644 --- a/samples/openapi/api/v3/fcm_token/$api.ts +++ b/samples/openapi/api/v3/fcm_token/$api.ts @@ -8,9 +8,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const POST = 'POST' return { - post: (option: { body: Methods0['post']['reqBody'], headers: Methods0['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option).send().then(r => r.body), $path: () => `${prefix}${PATH0}` } diff --git a/samples/openapi/api/v3/fcm_token/index.ts b/samples/openapi/api/v3/fcm_token/index.ts index 873c71b5..0b81ae38 100644 --- a/samples/openapi/api/v3/fcm_token/index.ts +++ b/samples/openapi/api/v3/fcm_token/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 204 reqBody: { diff --git a/samples/openapi/api/v3/info/$api.ts b/samples/openapi/api/v3/info/$api.ts index c0f570e9..577bd1b1 100644 --- a/samples/openapi/api/v3/info/$api.ts +++ b/samples/openapi/api/v3/info/$api.ts @@ -8,9 +8,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const GET = 'GET' return { - get: (option: { headers: Methods0['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), - $get: (option: { headers: Methods0['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json().then(r => r.body), $path: () => `${prefix}${PATH0}` } diff --git a/samples/openapi/api/v3/info/index.ts b/samples/openapi/api/v3/info/index.ts index 92fcf9bf..cfa3f3e4 100644 --- a/samples/openapi/api/v3/info/index.ts +++ b/samples/openapi/api/v3/info/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader status: 200 resBody: { diff --git a/samples/openapi/api/v3/login/$api.ts b/samples/openapi/api/v3/login/$api.ts index 2e190e93..f5daccd0 100644 --- a/samples/openapi/api/v3/login/$api.ts +++ b/samples/openapi/api/v3/login/$api.ts @@ -8,9 +8,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const POST = 'POST' return { - post: (option: { body: Methods0['post']['reqBody'], headers: Methods0['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option).json().then(r => r.body), $path: () => `${prefix}${PATH0}` } diff --git a/samples/openapi/api/v3/login/index.ts b/samples/openapi/api/v3/login/index.ts index a7afbb9a..83256949 100644 --- a/samples/openapi/api/v3/login/index.ts +++ b/samples/openapi/api/v3/login/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: Types.UserInfo & { diff --git a/samples/openapi/api/v3/logout/$api.ts b/samples/openapi/api/v3/logout/$api.ts index 8e1c8812..49a4d5e1 100644 --- a/samples/openapi/api/v3/logout/$api.ts +++ b/samples/openapi/api/v3/logout/$api.ts @@ -8,9 +8,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const POST = 'POST' return { - post: (option: { body: Methods0['post']['reqBody'], headers: Methods0['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods0['post']['reqBody'], headers?: Methods0['post']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, POST, option).send().then(r => r.body), $path: () => `${prefix}${PATH0}` } diff --git a/samples/openapi/api/v3/logout/index.ts b/samples/openapi/api/v3/logout/index.ts index 9cf5e3be..5b57b89f 100644 --- a/samples/openapi/api/v3/logout/index.ts +++ b/samples/openapi/api/v3/logout/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 204 reqBody: { diff --git a/samples/openapi/api/v3/me/$api.ts b/samples/openapi/api/v3/me/$api.ts index 28eb51fa..058ee247 100644 --- a/samples/openapi/api/v3/me/$api.ts +++ b/samples/openapi/api/v3/me/$api.ts @@ -8,9 +8,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const GET = 'GET' return { - get: (option: { headers: Methods0['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), - $get: (option: { headers: Methods0['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json().then(r => r.body), $path: () => `${prefix}${PATH0}` } diff --git a/samples/openapi/api/v3/me/index.ts b/samples/openapi/api/v3/me/index.ts index f5f97a9c..4496b10b 100644 --- a/samples/openapi/api/v3/me/index.ts +++ b/samples/openapi/api/v3/me/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: Types.UserInfo & { diff --git a/samples/openapi/api/v3/organisation/$api.ts b/samples/openapi/api/v3/organisation/$api.ts index 69cbd6ff..8979ca04 100644 --- a/samples/openapi/api/v3/organisation/$api.ts +++ b/samples/openapi/api/v3/organisation/$api.ts @@ -11,16 +11,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { users: { - get: (option: { query: Methods1['get']['query'], headers: Methods1['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods1['get']['query'], headers?: Methods1['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH1, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods1['get']['query'] }) => `${prefix}${PATH1}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` }, - get: (option: { headers: Methods0['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), - $get: (option: { headers: Methods0['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json().then(r => r.body), $path: () => `${prefix}${PATH0}` } diff --git a/samples/openapi/api/v3/organisation/index.ts b/samples/openapi/api/v3/organisation/index.ts index 40dff429..aa77153b 100644 --- a/samples/openapi/api/v3/organisation/index.ts +++ b/samples/openapi/api/v3/organisation/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationTokenRequired + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationTokenRequired status: 200 resBody: Types.OrganisationModel } diff --git a/samples/openapi/api/v3/organisation/users/$api.ts b/samples/openapi/api/v3/organisation/users/$api.ts index f42a6ff4..c4c485ea 100644 --- a/samples/openapi/api/v3/organisation/users/$api.ts +++ b/samples/openapi/api/v3/organisation/users/$api.ts @@ -8,9 +8,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const GET = 'GET' return { - get: (option: { query: Methods0['get']['query'], headers: Methods0['get']['reqHeaders'], config?: T }) => + 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 }) => + $get: (option: { query: Methods0['get']['query'], headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => `${prefix}${PATH0}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` diff --git a/samples/openapi/api/v3/organisation/users/index.ts b/samples/openapi/api/v3/organisation/users/index.ts index 26eeecf1..0a45923f 100644 --- a/samples/openapi/api/v3/organisation/users/index.ts +++ b/samples/openapi/api/v3/organisation/users/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationTokenRequired + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationTokenRequired query: { search: string diff --git a/samples/openapi/api/v3/stories/$api.ts b/samples/openapi/api/v3/stories/$api.ts index c3b4c519..79a7a6a3 100644 --- a/samples/openapi/api/v3/stories/$api.ts +++ b/samples/openapi/api/v3/stories/$api.ts @@ -23,22 +23,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { reaction: { - post: (option: { body: Methods2['post']['reqBody'], headers: Methods2['post']['reqHeaders'], config?: T }) => + 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 }) => + $post: (option: { body: Methods2['post']['reqBody'], headers?: Methods2['post']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix1}${PATH2}`, POST, option).json().then(r => r.body), $path: () => `${prefix}${prefix1}${PATH2}` }, - get: (option: { headers: Methods1['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods1['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix1, GET, option).json(), - $get: (option: { headers: Methods1['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods1['get']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $get: (option: { query: Methods0['get']['query'], headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, `${prefix0}${PATH1}`, GET, option).json().then(r => r.body), $path: (option?: { method?: 'get'; query: Methods0['get']['query'] }) => `${prefix}${prefix0}${PATH1}${option && option.query ? `?${dataToURLString(option.query)}` : ''}` diff --git a/samples/openapi/api/v3/stories/_storyId@number/items/_itemId@number/index.ts b/samples/openapi/api/v3/stories/_storyId@number/items/_itemId@number/index.ts index 455770a8..fa4b813f 100644 --- a/samples/openapi/api/v3/stories/_storyId@number/items/_itemId@number/index.ts +++ b/samples/openapi/api/v3/stories/_storyId@number/items/_itemId@number/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader status: 200 resBody: Types.ModelCard } diff --git a/samples/openapi/api/v3/stories/_storyId@number/items/_itemId@number/reaction/index.ts b/samples/openapi/api/v3/stories/_storyId@number/items/_itemId@number/reaction/index.ts index 77ae9c05..06f6a0ef 100644 --- a/samples/openapi/api/v3/stories/_storyId@number/items/_itemId@number/reaction/index.ts +++ b/samples/openapi/api/v3/stories/_storyId@number/items/_itemId@number/reaction/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../../../@types' export type Methods = { post: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader status: 200 resBody: { diff --git a/samples/openapi/api/v3/stories/_storyId@number/items/index.ts b/samples/openapi/api/v3/stories/_storyId@number/items/index.ts index e4ad492e..97f28e86 100644 --- a/samples/openapi/api/v3/stories/_storyId@number/items/index.ts +++ b/samples/openapi/api/v3/stories/_storyId@number/items/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken & Types.UserInstanceIdHeader query: { offset: number diff --git a/samples/openapi/api/v3/user/$api.ts b/samples/openapi/api/v3/user/$api.ts index 1031a147..0b357df0 100644 --- a/samples/openapi/api/v3/user/$api.ts +++ b/samples/openapi/api/v3/user/$api.ts @@ -16,23 +16,23 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const prefix0 = `${PATH0}/${val0}` return { - get: (option: { headers: Methods1['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods1['get']['reqHeaders'], config?: T }) => fetch(prefix, prefix0, GET, option).json(), - $get: (option: { headers: Methods1['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods1['get']['reqHeaders'], config?: T }) => 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 }) => + 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 }) => + $put: (option: { body: Methods2['put']['reqBody'], headers?: Methods2['put']['reqHeaders'], config?: T }) => fetch(prefix, PATH1, PUT, option, 'FormData').send().then(r => r.body), $path: () => `${prefix}${PATH1}` }, - get: (option: { headers: Methods0['get']['reqHeaders'], config?: T }) => + get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json(), - $get: (option: { headers: Methods0['get']['reqHeaders'], config?: T }) => + $get: (option?: { headers?: Methods0['get']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, GET, option).json().then(r => r.body), $path: () => `${prefix}${PATH0}` } diff --git a/samples/openapi/api/v3/user/_userId@string/index.ts b/samples/openapi/api/v3/user/_userId@string/index.ts index 73199a93..e0e4d742 100644 --- a/samples/openapi/api/v3/user/_userId@string/index.ts +++ b/samples/openapi/api/v3/user/_userId@string/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: Types.UserInfo } diff --git a/samples/openapi/api/v3/user/index.ts b/samples/openapi/api/v3/user/index.ts index c0e8f0eb..883fc4b0 100644 --- a/samples/openapi/api/v3/user/index.ts +++ b/samples/openapi/api/v3/user/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../@types' export type Methods = { get: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader & Types.AppOrganisationToken status: 200 resBody: Types.UserInfo[] } diff --git a/samples/openapi/api/v3/user/profile/$api.ts b/samples/openapi/api/v3/user/profile/$api.ts index 6fcf5fd6..ade7a11f 100644 --- a/samples/openapi/api/v3/user/profile/$api.ts +++ b/samples/openapi/api/v3/user/profile/$api.ts @@ -8,9 +8,9 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const PUT = 'PUT' return { - put: (option: { body: Methods0['put']['reqBody'], headers: Methods0['put']['reqHeaders'], config?: T }) => + 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 }) => + $put: (option: { body: Methods0['put']['reqBody'], headers?: Methods0['put']['reqHeaders'], config?: T }) => fetch(prefix, PATH0, PUT, option, 'FormData').send().then(r => r.body), $path: () => `${prefix}${PATH0}` } diff --git a/samples/openapi/api/v3/user/profile/index.ts b/samples/openapi/api/v3/user/profile/index.ts index 746d80cd..0d92753f 100644 --- a/samples/openapi/api/v3/user/profile/index.ts +++ b/samples/openapi/api/v3/user/profile/index.ts @@ -3,7 +3,7 @@ import * as Types from '../../../../@types' export type Methods = { put: { - reqHeaders: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader + reqHeaders?: Types.AppIdHeader & Types.AppPlatformHeader & Types.AppVersionHeader status: 204 reqFormat: FormData diff --git a/src/buildV3.ts b/src/buildV3.ts index 3786c72d..3fbec568 100644 --- a/src/buildV3.ts +++ b/src/buildV3.ts @@ -61,19 +61,22 @@ export default (openapi: OpenAPIV3.Document) => { const reqHeaders: Prop[] = [] const refQuery: PropValue[] = [] const query: Prop[] = [] - let headerRequired = true let queryRequired = true ;[...(openapi.paths[path].parameters || []), ...(target.parameters || [])].forEach( p => { if (isRefObject(p)) { const ref = resolveParamsRef(openapi, p.$ref) - const val = { isArray: false, isEnum: false, value: $ref2Type(p.$ref) } + const val = { + isArray: false, + isEnum: false, + nullable: false, + value: $ref2Type(p.$ref) + } switch (ref.in) { case 'header': reqRefHeaders.push(val) - headerRequired = ref.required ?? true break case 'query': refQuery.push(val) @@ -95,7 +98,6 @@ export default (openapi: OpenAPIV3.Document) => { switch (p.in) { case 'header': reqHeaders.push(prop) - headerRequired = p.required ?? true break case 'query': query.push(prop) @@ -111,11 +113,11 @@ export default (openapi: OpenAPIV3.Document) => { if (reqHeaders.length || reqRefHeaders.length) { params.push({ name: 'reqHeaders', - required: headerRequired, + required: false, values: [ ...reqRefHeaders, ...(reqHeaders.length - ? [{ isArray: false, isEnum: false, value: reqHeaders }] + ? [{ isArray: false, isEnum: false, nullable: false, value: reqHeaders }] : []) ] }) @@ -127,7 +129,9 @@ export default (openapi: OpenAPIV3.Document) => { required: queryRequired, values: [ ...refQuery, - ...(query.length ? [{ isArray: false, isEnum: false, value: query }] : []) + ...(query.length + ? [{ isArray: false, isEnum: false, nullable: false, value: query }] + : []) ] }) } @@ -139,7 +143,7 @@ export default (openapi: OpenAPIV3.Document) => { params.push({ name: 'status', required: true, - values: [{ isArray: false, isEnum: false, value: code }] + values: [{ isArray: false, isEnum: false, nullable: false, value: code }] }) const res = target.responses[code] @@ -163,6 +167,7 @@ export default (openapi: OpenAPIV3.Document) => { { isArray: false, isEnum: false, + nullable: false, value: Object.keys(ref.headers) .map(header => { const headerData = ref.headers![header] @@ -208,6 +213,7 @@ export default (openapi: OpenAPIV3.Document) => { reqBody = { isArray: false, isEnum: false, + nullable: false, value: $ref2Type(target.requestBody.$ref) } required = ref.required ?? true @@ -234,7 +240,7 @@ export default (openapi: OpenAPIV3.Document) => { params.push({ name: 'reqFormat', required: true, - values: [{ isArray: false, isEnum: false, value: reqFormat }] + values: [{ isArray: false, isEnum: false, nullable: false, value: reqFormat }] }) } @@ -250,7 +256,7 @@ export default (openapi: OpenAPIV3.Document) => { return { name: method, required: true, - values: [{ isArray: false, isEnum: false, value: params }] + values: [{ isArray: false, isEnum: false, nullable: false, value: params }] } }) .filter((method): method is Prop => !!method) diff --git a/src/builderUtils/converters.ts b/src/builderUtils/converters.ts index cb5e7081..75e5bde8 100644 --- a/src/builderUtils/converters.ts +++ b/src/builderUtils/converters.ts @@ -71,6 +71,7 @@ const object2value = (obj: OpenAPIV3.NonArraySchemaObject): Prop[] => { ? { isArray: false, isEnum: false, + nullable: false, value: 'any' } : schema2value(additionalProps) @@ -93,33 +94,38 @@ export const schema2value = ( let isArray = false let isEnum = false + let nullable = false let hasOf: PropValue['hasOf'] let value: PropValue['value'] | null = null if (isRefObject(schema)) { value = $ref2Type(schema.$ref) - } else if (schema.oneOf || schema.allOf || schema.anyOf) { - hasOf = schema.oneOf ? 'oneOf' : schema.allOf ? 'allOf' : 'anyOf' - value = of2Values(schema) - } else if (schema.enum) { - isEnum = true - value = schema.type === 'string' ? schema.enum.map(e => `'${e}'`) : schema.enum - } else if (isArraySchema(schema)) { - isArray = true - value = schema2value(schema.items) - } else if (schema.properties || schema.additionalProperties) { - value = object2value(schema) - } else if (schema.format === 'binary') { - value = 'Blob' - } else if (schema.type !== 'object') { - value = { - integer: 'number', - number: 'number', - null: 'null', - string: 'string', - boolean: 'boolean' - }[schema.type ?? 'string'] + } else { + nullable = !!schema.nullable + + if (schema.oneOf || schema.allOf || schema.anyOf) { + hasOf = schema.oneOf ? 'oneOf' : schema.allOf ? 'allOf' : 'anyOf' + value = of2Values(schema) + } else if (schema.enum) { + isEnum = true + value = schema.type === 'string' ? schema.enum.map(e => `'${e}'`) : schema.enum + } else if (isArraySchema(schema)) { + isArray = true + value = schema2value(schema.items) + } else if (schema.properties || schema.additionalProperties) { + value = object2value(schema) + } else if (schema.format === 'binary') { + value = 'Blob' + } else if (schema.type !== 'object') { + value = { + integer: 'number', + number: 'number', + null: 'null', + string: 'string', + boolean: 'boolean' + }[schema.type ?? 'string'] + } } - return value ? { isArray, isEnum, hasOf, value } : null + return value ? { isArray, isEnum, nullable, hasOf, value } : null } diff --git a/src/builderUtils/props2String.ts b/src/builderUtils/props2String.ts index 3379b1ba..049f30e1 100644 --- a/src/builderUtils/props2String.ts +++ b/src/builderUtils/props2String.ts @@ -1,6 +1,7 @@ export type PropValue = { isArray: boolean isEnum: boolean + nullable: boolean hasOf?: 'oneOf' | 'allOf' | 'anyOf' // eslint-disable-next-line no-use-before-define value: Prop[] | string | string[] | PropValue | PropValue[] @@ -28,7 +29,7 @@ export const value2String = (v: PropValue, indent: string): string => : Array.isArray(v.value) ? props2String(v.value as Prop[], ` ${indent}`) : v.value - }` + }${v.nullable ? ' | null' : ''}` const values2String = (values: PropValue[], hasOf: PropValue['hasOf'], indent: string) => `${hasOf === 'anyOf' ? 'Partial<' : ''}${values diff --git a/yarn.lock b/yarn.lock index 4a685479..0c9869a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -736,28 +736,28 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^4.7.0": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.7.0.tgz#85c9bbda00c0cb604d3c241f7bc7fb171a2d3479" - integrity sha512-li9aiSVBBd7kU5VlQlT1AqP0uWGDK6JYKUQ9cVDnOg34VNnd9t4jr0Yqc/bKxJr/tDCPDaB4KzoSFN9fgVxe/Q== +"@typescript-eslint/eslint-plugin@^4.8.2": + version "4.8.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.8.2.tgz#cf9102ec800391caa574f589ffe0623cca1d9308" + integrity sha512-gQ06QLV5l1DtvYtqOyFLXD9PdcILYqlrJj2l+CGDlPtmgLUzc1GpqciJFIRvyfvgLALpnxYINFuw+n9AZhPBKQ== dependencies: - "@typescript-eslint/experimental-utils" "4.7.0" - "@typescript-eslint/scope-manager" "4.7.0" + "@typescript-eslint/experimental-utils" "4.8.2" + "@typescript-eslint/scope-manager" "4.8.2" 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@4.7.0": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.7.0.tgz#8d1058c38bec3d3bbd9c898a1c32318d80faf3c5" - integrity sha512-cymzovXAiD4EF+YoHAB5Oh02MpnXjvyaOb+v+BdpY7lsJXZQN34oIETeUwVT2XfV9rSNpXaIcknDLfupO/tUoA== +"@typescript-eslint/experimental-utils@4.8.2": + version "4.8.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.8.2.tgz#8909a5732f19329cf5ef0c39766170476bff5e50" + integrity sha512-hpTw6o6IhBZEsQsjuw/4RWmceRyESfAiEzAEnXHKG1X7S5DXFaZ4IO1JO7CW1aQ604leQBzjZmuMI9QBCAJX8Q== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/scope-manager" "4.7.0" - "@typescript-eslint/types" "4.7.0" - "@typescript-eslint/typescript-estree" "4.7.0" + "@typescript-eslint/scope-manager" "4.8.2" + "@typescript-eslint/types" "4.8.2" + "@typescript-eslint/typescript-estree" "4.8.2" eslint-scope "^5.0.0" eslint-utils "^2.0.0" @@ -773,14 +773,14 @@ eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/parser@^4.7.0": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.7.0.tgz#44bdab0f788b478178368baa65d3365fdc63da1c" - integrity sha512-+meGV8bMP1sJHBI2AFq1GeTwofcGiur8LoIr6v+rEmD9knyCqDlrQcFHR0KDDfldHIFDU/enZ53fla6ReF4wRw== +"@typescript-eslint/parser@^4.8.2": + version "4.8.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.8.2.tgz#78dccbe5124de2b8dea2d4c363dee9f769151ca8" + integrity sha512-u0leyJqmclYr3KcXOqd2fmx6SDGBO0MUNHHAjr0JS4Crbb3C3d8dwAdlazy133PLCcPn+aOUFiHn72wcuc5wYw== dependencies: - "@typescript-eslint/scope-manager" "4.7.0" - "@typescript-eslint/types" "4.7.0" - "@typescript-eslint/typescript-estree" "4.7.0" + "@typescript-eslint/scope-manager" "4.8.2" + "@typescript-eslint/types" "4.8.2" + "@typescript-eslint/typescript-estree" "4.8.2" debug "^4.1.1" "@typescript-eslint/scope-manager@4.6.1": @@ -791,23 +791,23 @@ "@typescript-eslint/types" "4.6.1" "@typescript-eslint/visitor-keys" "4.6.1" -"@typescript-eslint/scope-manager@4.7.0": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.7.0.tgz#2115526085fb72723ccdc1eeae75dec7126220ed" - integrity sha512-ILITvqwDJYbcDCROj6+Ob0oCKNg3SH46iWcNcTIT9B5aiVssoTYkhKjxOMNzR1F7WSJkik4zmuqve5MdnA0DyA== +"@typescript-eslint/scope-manager@4.8.2": + version "4.8.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.8.2.tgz#a18388c63ae9c17adde519384f539392f2c4f0d9" + integrity sha512-qHQ8ODi7mMin4Sq2eh/6eu03uVzsf5TX+J43xRmiq8ujng7ViQSHNPLOHGw/Wr5dFEoxq/ubKhzClIIdQy5q3g== dependencies: - "@typescript-eslint/types" "4.7.0" - "@typescript-eslint/visitor-keys" "4.7.0" + "@typescript-eslint/types" "4.8.2" + "@typescript-eslint/visitor-keys" "4.8.2" "@typescript-eslint/types@4.6.1": version "4.6.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.6.1.tgz#d3ad7478f53f22e7339dc006ab61aac131231552" integrity sha512-k2ZCHhJ96YZyPIsykickez+OMHkz06xppVLfJ+DY90i532/Cx2Z+HiRMH8YZQo7a4zVd/TwNBuRCdXlGK4yo8w== -"@typescript-eslint/types@4.7.0": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.7.0.tgz#5e95ef5c740f43d942542b35811f87b62fccca69" - integrity sha512-uLszFe0wExJc+I7q0Z/+BnP7wao/kzX0hB5vJn4LIgrfrMLgnB2UXoReV19lkJQS1a1mHWGGODSxnBx6JQC3Sg== +"@typescript-eslint/types@4.8.2": + version "4.8.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.8.2.tgz#c862dd0e569d9478eb82d6aee662ea53f5661a36" + integrity sha512-z1/AVcVF8ju5ObaHe2fOpZYEQrwHyZ7PTOlmjd3EoFeX9sv7UekQhfrCmgUO7PruLNfSHrJGQvrW3Q7xQ8EoAw== "@typescript-eslint/typescript-estree@4.6.1": version "4.6.1" @@ -823,13 +823,13 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/typescript-estree@4.7.0": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.7.0.tgz#539531167f05ba20eb0b6785567076679e29d393" - integrity sha512-5XZRQznD1MfUmxu1t8/j2Af4OxbA7EFU2rbo0No7meb46eHgGkSieFdfV6omiC/DGIBhH9H9gXn7okBbVOm8jw== +"@typescript-eslint/typescript-estree@4.8.2": + version "4.8.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.8.2.tgz#eeec34707d8577600fb21661b5287226cc8b3bed" + integrity sha512-HToGNwI6fekH0dOw3XEVESUm71Onfam0AKin6f26S2FtUmO7o3cLlWgrIaT1q3vjB3wCTdww3Dx2iGq5wtUOCg== dependencies: - "@typescript-eslint/types" "4.7.0" - "@typescript-eslint/visitor-keys" "4.7.0" + "@typescript-eslint/types" "4.8.2" + "@typescript-eslint/visitor-keys" "4.8.2" debug "^4.1.1" globby "^11.0.1" is-glob "^4.0.1" @@ -845,12 +845,12 @@ "@typescript-eslint/types" "4.6.1" eslint-visitor-keys "^2.0.0" -"@typescript-eslint/visitor-keys@4.7.0": - version "4.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.7.0.tgz#6783824f22acfc49e754970ed21b88ac03b80e6f" - integrity sha512-aDJDWuCRsf1lXOtignlfiPODkzSxxop7D0rZ91L6ZuMlcMCSh0YyK+gAfo5zN/ih6WxMwhoXgJWC3cWQdaKC+A== +"@typescript-eslint/visitor-keys@4.8.2": + version "4.8.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.8.2.tgz#62cd3fbbbf65f8eccfbe6f159eb1b84a243a3f77" + integrity sha512-Vg+/SJTMZJEKKGHW7YC21QxgKJrSbxoYYd3MEUGtW7zuytHuEcksewq0DUmo4eh/CTNrVJGSdIY9AtRb6riWFw== dependencies: - "@typescript-eslint/types" "4.7.0" + "@typescript-eslint/types" "4.8.2" eslint-visitor-keys "^2.0.0" JSONStream@^1.0.4: @@ -1395,6 +1395,15 @@ cliui@^6.0.0: strip-ansi "^6.0.0" wrap-ansi "^6.2.0" +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -1957,6 +1966,11 @@ es6-promise@^3.2.1: resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" integrity sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM= +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -1986,10 +2000,10 @@ eslint-config-prettier@^6.15.0: dependencies: get-stdin "^6.0.0" -eslint-config-standard@^16.0.1: - version "16.0.1" - resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-16.0.1.tgz#9a385eea27f96b7918cb53f07e01e9d10cc56401" - integrity sha512-WBBiQQZdaPyL+4sPkGWhWrHCDtvJoU195B9j8yXE9uFQnX34gMXI5CeBRm95gx3PMEZPM5OpwET10hH4F4SxCA== +eslint-config-standard@^16.0.2: + version "16.0.2" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-16.0.2.tgz#71e91727ac7a203782d0a5ca4d1c462d14e234f6" + integrity sha512-fx3f1rJDsl9bY7qzyX8SAtP8GBSk6MfXFaTfaGgk12aAYW4gJSyRm7dM790L6cbXv63fvjY4XeSzXnb4WM+SKw== eslint-import-resolver-node@^0.3.4: version "0.3.4" @@ -2034,10 +2048,10 @@ eslint-plugin-import@^2.22.1: resolve "^1.17.0" tsconfig-paths "^3.9.0" -eslint-plugin-jest@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.1.0.tgz#6708037d7602e5288ce877fd0103f329dc978361" - integrity sha512-827YJ+E8B9PvXu/0eiVSNFfxxndbKv+qE/3GSMhdorCaeaOehtqHGX2YDW9B85TEOre9n/zscledkFW/KbnyGg== +eslint-plugin-jest@^24.1.3: + version "24.1.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.1.3.tgz#fa3db864f06c5623ff43485ca6c0e8fc5fe8ba0c" + integrity sha512-dNGGjzuEzCE3d5EPZQ/QGtmlMotqnYWD/QpCZ1UuZlrMAdhG5rldh0N0haCvhGnUkSeuORS5VNROwF9Hrgn3Lg== dependencies: "@typescript-eslint/experimental-utils" "^4.0.1" @@ -2065,10 +2079,10 @@ eslint-plugin-promise@^4.2.1: resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz#845fd8b2260ad8f82564c1222fce44ad71d9418a" integrity sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw== -eslint-plugin-standard@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-4.1.0.tgz#0c3bf3a67e853f8bbbc580fb4945fbf16f41b7c5" - integrity sha512-ZL7+QRixjTR6/528YNGyDotyffm5OQst/sGxKDwGb9Uqs4In5Egi4+jbobhqJoyoCM6/7v/1A5fhQ7ScMtDjaQ== +eslint-plugin-standard@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-5.0.0.tgz#c43f6925d669f177db46f095ea30be95476b1ee4" + integrity sha512-eSIXPc9wBM4BrniMzJRBm2uoVuXz2EPa+NXPk2+itrVt+r5SbKFERx/IgrK/HmfjddyKVz2f+j+7gBRvu19xLg== eslint-scope@^5.0.0: version "5.1.0" @@ -2103,10 +2117,10 @@ eslint-visitor-keys@^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.13.0: - version "7.13.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.13.0.tgz#7f180126c0dcdef327bfb54b211d7802decc08da" - integrity sha512-uCORMuOO8tUzJmsdRtrvcGq5qposf7Rw0LwkTJkoDbOycVQtQjmnhZSuLQnozLE4TmAzlMVV45eCHmQ1OpDKUQ== +eslint@^7.14.0: + version "7.14.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.14.0.tgz#2d2cac1d28174c510a97b377f122a5507958e344" + integrity sha512-5YubdnPXrlrYAFCKybPuHIAH++PINe1pmKNc5wQRB9HSbqIK1ywAnntE3Wwua4giKu0bjligf1gLF6qxMGOYRA== dependencies: "@babel/code-frame" "^7.0.0" "@eslint/eslintrc" "^0.2.1" @@ -2492,7 +2506,7 @@ gensync@^1.0.0-beta.1: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" integrity sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg== -get-caller-file@^2.0.1: +get-caller-file@^2.0.1, get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== @@ -4170,33 +4184,33 @@ oas-linter@^3.2.1: should "^13.2.1" yaml "^1.10.0" -oas-resolver@^2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/oas-resolver/-/oas-resolver-2.5.2.tgz#62d26f8db7a4afd697f27ae9b283e79300dd2366" - integrity sha512-dEuG5nE9IMl0FQNQuROsoriP4/944PajSBKAoZMyp9b2eXfmPv9ZKeHRCKjf5RWLm0GezaPKcdCLbB0/Xiqtdw== +oas-resolver@^2.5.3: + version "2.5.3" + resolved "https://registry.yarnpkg.com/oas-resolver/-/oas-resolver-2.5.3.tgz#1e124aa4dcee6822166e06a3d392b07237f8e01b" + integrity sha512-y4gP5tabqP3YcNVHNAEJAlcqZ40Y9lxemzmXvt54evbrvuGiK5dEhuE33Rf+191TOwzlxMoIgbwMYeuOM7BwjA== dependencies: node-fetch-h2 "^2.3.0" oas-kit-common "^1.0.8" - reftools "^1.1.6" + reftools "^1.1.7" yaml "^1.10.0" - yargs "^15.3.1" + yargs "^16.1.1" oas-schema-walker@^1.1.5: version "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@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/oas-validator/-/oas-validator-5.0.3.tgz#b128d1e0cf7f734e98dbd5fc16037c6907261d93" - integrity sha512-PYhenXnQr/T+MmrzBT+cTnyOcIZ4wVzvjS/gvbZZNexnhl1Gu/UiCg6rsEmBetE9CfthoxG0gfGTUSYPRmUlWA== +oas-validator@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/oas-validator/-/oas-validator-5.0.4.tgz#f3b094192a4637b94ce4a61c66657f4d7b523a3a" + integrity sha512-/v+5BbPXl7JuKf1bYhEGIfbJZR7zBf5QJNM2RAe1e0bsABsp35nAfeptZq0hb+9RMecGSFxmzhuvlOT0/KioiQ== dependencies: call-me-maybe "^1.0.1" oas-kit-common "^1.0.8" oas-linter "^3.2.1" - oas-resolver "^2.5.2" + oas-resolver "^2.5.3" oas-schema-walker "^1.1.5" - reftools "^1.1.6" + reftools "^1.1.7" should "^13.2.1" yaml "^1.10.0" @@ -4548,10 +4562,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5" - integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg== +prettier@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.0.tgz#8a03c7777883b29b37fb2c4348c66a78e980418b" + integrity sha512-yYerpkvseM4iKD/BXLYUkQV5aKt4tQPqaGW6EsZjzyu0r7sVZZNPJW4Y8MyKmicp6t42XUPcBVA+H6sB3gqndw== pretty-format@^25.2.1, pretty-format@^25.5.0: version "25.5.0" @@ -4769,10 +4783,10 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" -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== +reftools@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/reftools/-/reftools-1.1.7.tgz#7cb7d7c448d296717f541e878ffac67bdbd7c4ad" + integrity sha512-I+KZFkQvZjMZqVWxRezTC/kQ2kLhGRZ7C+4ARbgmb5WJbvFUlbrZ/6qlz6mb+cGcPNYib+xqL8kZlxCsSZ7Hew== regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" @@ -5462,22 +5476,22 @@ swagger-parser@^10.0.2: dependencies: "@apidevtools/swagger-parser" "10.0.2" -swagger2openapi@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/swagger2openapi/-/swagger2openapi-7.0.3.tgz#aa16cf00ea368028f6f41fcab3074cff223cfb8a" - integrity sha512-JSFUmXSR7Qx9WwSKCEqaL4oQfhLLCU2r8Zgf30g15FdSkihItZ6fKFnqSsfqQ6MsmnLlcBf8+OhnQHbi1R0ydg== +swagger2openapi@^7.0.4: + version "7.0.4" + resolved "https://registry.yarnpkg.com/swagger2openapi/-/swagger2openapi-7.0.4.tgz#63f20ecc6a57a8dde33c92cc4aeb8dc34671e1b0" + integrity sha512-MGzJU44XSXHKxvtx/NbBnP3z5s1KzN5xhqIBERoZEKfRiZ56lNUo5TGOv0dJ8n7JGeheCeU0CydfvbSOh+DaXg== dependencies: call-me-maybe "^1.0.1" node-fetch "^2.6.1" node-fetch-h2 "^2.3.0" node-readfiles "^0.2.0" oas-kit-common "^1.0.8" - oas-resolver "^2.5.2" + oas-resolver "^2.5.3" oas-schema-walker "^1.1.5" - oas-validator "^5.0.3" - reftools "^1.1.6" + oas-validator "^5.0.4" + reftools "^1.1.7" yaml "^1.10.0" - yargs "^15.3.1" + yargs "^16.1.1" symbol-tree@^3.2.4: version "3.2.4" @@ -5734,10 +5748,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.5.tgz#ae9dddfd1069f1cb5beb3ef3b2170dd7c1332389" - integrity sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ== +typescript@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.2.tgz#6369ef22516fe5e10304aae5a5c4862db55380e9" + integrity sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ== uglify-js@^3.1.4: version "3.9.4" @@ -5922,6 +5936,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -5969,6 +5992,11 @@ 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== +y18n@^5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18" + integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg== + yaml@^1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.0.tgz#3b593add944876077d4d683fee01081bd9fff31e" @@ -5987,6 +6015,11 @@ yargs-parser@^18.1.1, yargs-parser@^18.1.2, yargs-parser@^18.1.3: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^20.2.2: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + yargs@^15.3.1: version "15.3.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.3.1.tgz#9505b472763963e54afe60148ad27a330818e98b" @@ -6021,6 +6054,19 @@ yargs@^15.4.1: y18n "^4.0.0" yargs-parser "^18.1.2" +yargs@^16.1.1: + version "16.1.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.1.1.tgz#5a4a095bd1ca806b0a50d0c03611d38034d219a1" + integrity sha512-hAD1RcFP/wfgfxgMVswPE+z3tlPFtxG8/yWUrG2i17sTWGCGqWnxKcLTF4cUKDUK8fzokwsmO9H0TDkRbMHy8w== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + z-schema@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/z-schema/-/z-schema-4.2.3.tgz#85f7eea7e6d4fe59a483462a98f511bd78fe9882"