@squonk/account-server-client 4.4.0 → 4.5.0-trunk.2320444253
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/actions/actions.cjs +1 -1
- package/dist/api/actions/actions.cjs.map +1 -1
- package/dist/api/actions/actions.fetch.cjs +1 -1
- package/dist/api/actions/actions.fetch.cjs.map +1 -1
- package/dist/api/actions/actions.fetch.js +1 -1
- package/dist/api/actions/actions.fetch.js.map +1 -1
- package/dist/api/actions/actions.js +1 -1
- package/dist/api/actions/actions.js.map +1 -1
- package/dist/api/api-schemas/asError.d.cts +1 -1
- package/dist/api/api-schemas/asError.d.ts +1 -1
- package/dist/api/api-schemas/assetDetailScope.cjs.map +1 -1
- package/dist/api/api-schemas/assetDetailScope.d.cts +1 -1
- package/dist/api/api-schemas/assetDetailScope.d.ts +1 -1
- package/dist/api/api-schemas/assetDetailScope.js.map +1 -1
- package/dist/api/api-schemas/assetPatchBodyBody.d.cts +1 -1
- package/dist/api/api-schemas/assetPatchBodyBody.d.ts +1 -1
- package/dist/api/api-schemas/assetPostBodyBodyScope.cjs.map +1 -1
- package/dist/api/api-schemas/assetPostBodyBodyScope.d.cts +1 -1
- package/dist/api/api-schemas/assetPostBodyBodyScope.d.ts +1 -1
- package/dist/api/api-schemas/assetPostBodyBodyScope.js.map +1 -1
- package/dist/api/api-schemas/assetPostResponse.d.cts +1 -1
- package/dist/api/api-schemas/assetPostResponse.d.ts +1 -1
- package/dist/api/api-schemas/chargeAdditionalData.d.cts +1 -1
- package/dist/api/api-schemas/chargeAdditionalData.d.ts +1 -1
- package/dist/api/api-schemas/chargeSummaryType.cjs.map +1 -1
- package/dist/api/api-schemas/chargeSummaryType.d.cts +1 -1
- package/dist/api/api-schemas/chargeSummaryType.d.ts +1 -1
- package/dist/api/api-schemas/chargeSummaryType.js.map +1 -1
- package/dist/api/api-schemas/eventStreamGetPostResponse.d.cts +1 -1
- package/dist/api/api-schemas/eventStreamGetPostResponse.d.ts +1 -1
- package/dist/api/api-schemas/eventStreamPostBodyBodyFormat.cjs.map +1 -1
- package/dist/api/api-schemas/eventStreamPostBodyBodyFormat.d.cts +1 -1
- package/dist/api/api-schemas/eventStreamPostBodyBodyFormat.d.ts +1 -1
- package/dist/api/api-schemas/eventStreamPostBodyBodyFormat.js.map +1 -1
- package/dist/api/api-schemas/eventStreamVersionGetResponseProtocol.cjs.map +1 -1
- package/dist/api/api-schemas/eventStreamVersionGetResponseProtocol.d.cts +1 -1
- package/dist/api/api-schemas/eventStreamVersionGetResponseProtocol.d.ts +1 -1
- package/dist/api/api-schemas/eventStreamVersionGetResponseProtocol.js.map +1 -1
- package/dist/api/api-schemas/merchantDetailKind.cjs.map +1 -1
- package/dist/api/api-schemas/merchantDetailKind.d.cts +1 -1
- package/dist/api/api-schemas/merchantDetailKind.d.ts +1 -1
- package/dist/api/api-schemas/merchantDetailKind.js.map +1 -1
- package/dist/api/api-schemas/merchantSummaryKind.cjs.map +1 -1
- package/dist/api/api-schemas/merchantSummaryKind.d.cts +1 -1
- package/dist/api/api-schemas/merchantSummaryKind.d.ts +1 -1
- package/dist/api/api-schemas/merchantSummaryKind.js.map +1 -1
- package/dist/api/api-schemas/organisationAllDetailDefaultProductPrivacy.cjs.map +1 -1
- package/dist/api/api-schemas/organisationAllDetailDefaultProductPrivacy.d.cts +1 -1
- package/dist/api/api-schemas/organisationAllDetailDefaultProductPrivacy.d.ts +1 -1
- package/dist/api/api-schemas/organisationAllDetailDefaultProductPrivacy.js.map +1 -1
- package/dist/api/api-schemas/organisationDetailDefaultProductPrivacy.cjs.map +1 -1
- package/dist/api/api-schemas/organisationDetailDefaultProductPrivacy.d.cts +1 -1
- package/dist/api/api-schemas/organisationDetailDefaultProductPrivacy.d.ts +1 -1
- package/dist/api/api-schemas/organisationDetailDefaultProductPrivacy.js.map +1 -1
- package/dist/api/api-schemas/organisationGetDefaultResponseDefaultProductPrivacy.cjs.map +1 -1
- package/dist/api/api-schemas/organisationGetDefaultResponseDefaultProductPrivacy.d.cts +1 -1
- package/dist/api/api-schemas/organisationGetDefaultResponseDefaultProductPrivacy.d.ts +1 -1
- package/dist/api/api-schemas/organisationGetDefaultResponseDefaultProductPrivacy.js.map +1 -1
- package/dist/api/api-schemas/organisationPatchBodyBodyDefaultProductPrivacy.cjs.map +1 -1
- package/dist/api/api-schemas/organisationPatchBodyBodyDefaultProductPrivacy.d.cts +1 -1
- package/dist/api/api-schemas/organisationPatchBodyBodyDefaultProductPrivacy.d.ts +1 -1
- package/dist/api/api-schemas/organisationPatchBodyBodyDefaultProductPrivacy.js.map +1 -1
- package/dist/api/api-schemas/organisationPostBodyBodyDefaultProductPrivacy.cjs.map +1 -1
- package/dist/api/api-schemas/organisationPostBodyBodyDefaultProductPrivacy.d.cts +1 -1
- package/dist/api/api-schemas/organisationPostBodyBodyDefaultProductPrivacy.d.ts +1 -1
- package/dist/api/api-schemas/organisationPostBodyBodyDefaultProductPrivacy.js.map +1 -1
- package/dist/api/api-schemas/organisationPostResponse.d.cts +1 -1
- package/dist/api/api-schemas/organisationPostResponse.d.ts +1 -1
- package/dist/api/api-schemas/organisationUnitPostBodyBodyDefaultProductPrivacy.cjs.map +1 -1
- package/dist/api/api-schemas/organisationUnitPostBodyBodyDefaultProductPrivacy.d.cts +1 -1
- package/dist/api/api-schemas/organisationUnitPostBodyBodyDefaultProductPrivacy.d.ts +1 -1
- package/dist/api/api-schemas/organisationUnitPostBodyBodyDefaultProductPrivacy.js.map +1 -1
- package/dist/api/api-schemas/organisationUnitPostResponse.d.cts +1 -1
- package/dist/api/api-schemas/organisationUnitPostResponse.d.ts +1 -1
- package/dist/api/api-schemas/personalUnitPutBodyBody.d.cts +1 -1
- package/dist/api/api-schemas/personalUnitPutBodyBody.d.ts +1 -1
- package/dist/api/api-schemas/personalUnitPutResponse.d.cts +1 -1
- package/dist/api/api-schemas/personalUnitPutResponse.d.ts +1 -1
- package/dist/api/api-schemas/processingChargesMerchantKind.cjs.map +1 -1
- package/dist/api/api-schemas/processingChargesMerchantKind.d.cts +1 -1
- package/dist/api/api-schemas/processingChargesMerchantKind.d.ts +1 -1
- package/dist/api/api-schemas/processingChargesMerchantKind.js.map +1 -1
- package/dist/api/api-schemas/productChargesGetResponseProductType.cjs.map +1 -1
- package/dist/api/api-schemas/productChargesGetResponseProductType.d.cts +1 -1
- package/dist/api/api-schemas/productChargesGetResponseProductType.d.ts +1 -1
- package/dist/api/api-schemas/productChargesGetResponseProductType.js.map +1 -1
- package/dist/api/api-schemas/productClaimDetail.d.cts +1 -1
- package/dist/api/api-schemas/productClaimDetail.d.ts +1 -1
- package/dist/api/api-schemas/productCoinsDetail.d.cts +1 -1
- package/dist/api/api-schemas/productCoinsDetail.d.ts +1 -1
- package/dist/api/api-schemas/productDetailFlavour.cjs.map +1 -1
- package/dist/api/api-schemas/productDetailFlavour.d.cts +1 -1
- package/dist/api/api-schemas/productDetailFlavour.d.ts +1 -1
- package/dist/api/api-schemas/productDetailFlavour.js.map +1 -1
- package/dist/api/api-schemas/productDetailType.cjs.map +1 -1
- package/dist/api/api-schemas/productDetailType.d.cts +1 -1
- package/dist/api/api-schemas/productDetailType.d.ts +1 -1
- package/dist/api/api-schemas/productDetailType.js.map +1 -1
- package/dist/api/api-schemas/productDmStorageDetailCoins.d.cts +1 -1
- package/dist/api/api-schemas/productDmStorageDetailCoins.d.ts +1 -1
- package/dist/api/api-schemas/productDmStorageDetailSize.d.cts +1 -1
- package/dist/api/api-schemas/productDmStorageDetailSize.d.ts +1 -1
- package/dist/api/api-schemas/productInstanceDetailCoins.d.cts +1 -1
- package/dist/api/api-schemas/productInstanceDetailCoins.d.ts +1 -1
- package/dist/api/api-schemas/productPatchBodyBody.d.cts +1 -1
- package/dist/api/api-schemas/productPatchBodyBody.d.ts +1 -1
- package/dist/api/api-schemas/productTypeServiceKind.cjs.map +1 -1
- package/dist/api/api-schemas/productTypeServiceKind.d.cts +1 -1
- package/dist/api/api-schemas/productTypeServiceKind.d.ts +1 -1
- package/dist/api/api-schemas/productTypeServiceKind.js.map +1 -1
- package/dist/api/api-schemas/productsGetDefaultStorageCostDefaultStorageCost.d.cts +1 -1
- package/dist/api/api-schemas/productsGetDefaultStorageCostDefaultStorageCost.d.ts +1 -1
- package/dist/api/api-schemas/qFormatParameter.cjs.map +1 -1
- package/dist/api/api-schemas/qFormatParameter.d.cts +1 -1
- package/dist/api/api-schemas/qFormatParameter.d.ts +1 -1
- package/dist/api/api-schemas/qFormatParameter.js.map +1 -1
- package/dist/api/api-schemas/qFromParameter.d.cts +1 -1
- package/dist/api/api-schemas/qFromParameter.d.ts +1 -1
- package/dist/api/api-schemas/qMIdParameter.d.cts +1 -1
- package/dist/api/api-schemas/qMIdParameter.d.ts +1 -1
- package/dist/api/api-schemas/qNameParameter.d.cts +1 -1
- package/dist/api/api-schemas/qNameParameter.d.ts +1 -1
- package/dist/api/api-schemas/qOrgIdParameter.d.cts +1 -1
- package/dist/api/api-schemas/qOrgIdParameter.d.ts +1 -1
- package/dist/api/api-schemas/qPbpParameter.d.cts +1 -1
- package/dist/api/api-schemas/qPbpParameter.d.ts +1 -1
- package/dist/api/api-schemas/qProductIdParameter.d.cts +1 -1
- package/dist/api/api-schemas/qProductIdParameter.d.ts +1 -1
- package/dist/api/api-schemas/qUnitIdParameter.d.cts +1 -1
- package/dist/api/api-schemas/qUnitIdParameter.d.ts +1 -1
- package/dist/api/api-schemas/qUntilParameter.d.cts +1 -1
- package/dist/api/api-schemas/qUntilParameter.d.ts +1 -1
- package/dist/api/api-schemas/qUserIdParameter.d.cts +1 -1
- package/dist/api/api-schemas/qUserIdParameter.d.ts +1 -1
- package/dist/api/api-schemas/stateGetVersionResponse.d.cts +1 -1
- package/dist/api/api-schemas/stateGetVersionResponse.d.ts +1 -1
- package/dist/api/api-schemas/unitAllDetailDefaultProductPrivacy.cjs.map +1 -1
- package/dist/api/api-schemas/unitAllDetailDefaultProductPrivacy.d.cts +1 -1
- package/dist/api/api-schemas/unitAllDetailDefaultProductPrivacy.d.ts +1 -1
- package/dist/api/api-schemas/unitAllDetailDefaultProductPrivacy.js.map +1 -1
- package/dist/api/api-schemas/unitDetailDefaultProductPrivacy.cjs.map +1 -1
- package/dist/api/api-schemas/unitDetailDefaultProductPrivacy.d.cts +1 -1
- package/dist/api/api-schemas/unitDetailDefaultProductPrivacy.d.ts +1 -1
- package/dist/api/api-schemas/unitDetailDefaultProductPrivacy.js.map +1 -1
- package/dist/api/api-schemas/unitPatchBodyBodyDefaultProductPrivacy.cjs.map +1 -1
- package/dist/api/api-schemas/unitPatchBodyBodyDefaultProductPrivacy.d.cts +1 -1
- package/dist/api/api-schemas/unitPatchBodyBodyDefaultProductPrivacy.d.ts +1 -1
- package/dist/api/api-schemas/unitPatchBodyBodyDefaultProductPrivacy.js.map +1 -1
- package/dist/api/api-schemas/unitProductPostBodyBodyFlavour.cjs.map +1 -1
- package/dist/api/api-schemas/unitProductPostBodyBodyFlavour.d.cts +1 -1
- package/dist/api/api-schemas/unitProductPostBodyBodyFlavour.d.ts +1 -1
- package/dist/api/api-schemas/unitProductPostBodyBodyFlavour.js.map +1 -1
- package/dist/api/api-schemas/unitProductPostBodyBodyType.cjs.map +1 -1
- package/dist/api/api-schemas/unitProductPostBodyBodyType.d.cts +1 -1
- package/dist/api/api-schemas/unitProductPostBodyBodyType.d.ts +1 -1
- package/dist/api/api-schemas/unitProductPostBodyBodyType.js.map +1 -1
- package/dist/api/api-schemas/unitProductPostResponse.d.cts +1 -1
- package/dist/api/api-schemas/unitProductPostResponse.d.ts +1 -1
- package/dist/api/api-schemas/userDetail.d.cts +1 -1
- package/dist/api/api-schemas/userDetail.d.ts +1 -1
- package/dist/api/asset/asset.cjs +1 -1
- package/dist/api/asset/asset.cjs.map +1 -1
- package/dist/api/asset/asset.fetch.cjs +1 -1
- package/dist/api/asset/asset.fetch.cjs.map +1 -1
- package/dist/api/asset/asset.fetch.d.cts.map +1 -1
- package/dist/api/asset/asset.fetch.d.ts.map +1 -1
- package/dist/api/asset/asset.fetch.js +1 -1
- package/dist/api/asset/asset.fetch.js.map +1 -1
- package/dist/api/asset/asset.js +1 -1
- package/dist/api/asset/asset.js.map +1 -1
- package/dist/api/charges/charges.cjs +1 -1
- package/dist/api/charges/charges.cjs.map +1 -1
- package/dist/api/charges/charges.d.ts.map +1 -1
- package/dist/api/charges/charges.fetch.cjs +1 -1
- package/dist/api/charges/charges.fetch.cjs.map +1 -1
- package/dist/api/charges/charges.fetch.d.cts.map +1 -1
- package/dist/api/charges/charges.fetch.d.ts.map +1 -1
- package/dist/api/charges/charges.fetch.js +1 -1
- package/dist/api/charges/charges.fetch.js.map +1 -1
- package/dist/api/charges/charges.js +1 -1
- package/dist/api/charges/charges.js.map +1 -1
- package/dist/api/event-stream/event-stream.cjs +1 -1
- package/dist/api/event-stream/event-stream.cjs.map +1 -1
- package/dist/api/event-stream/event-stream.fetch.cjs +1 -1
- package/dist/api/event-stream/event-stream.fetch.cjs.map +1 -1
- package/dist/api/event-stream/event-stream.fetch.js +1 -1
- package/dist/api/event-stream/event-stream.fetch.js.map +1 -1
- package/dist/api/event-stream/event-stream.js +1 -1
- package/dist/api/event-stream/event-stream.js.map +1 -1
- package/dist/api/merchant/merchant.cjs +1 -1
- package/dist/api/merchant/merchant.cjs.map +1 -1
- package/dist/api/merchant/merchant.fetch.cjs +1 -1
- package/dist/api/merchant/merchant.fetch.cjs.map +1 -1
- package/dist/api/merchant/merchant.fetch.js +1 -1
- package/dist/api/merchant/merchant.fetch.js.map +1 -1
- package/dist/api/merchant/merchant.js +1 -1
- package/dist/api/merchant/merchant.js.map +1 -1
- package/dist/api/organisation/organisation.cjs +1 -1
- package/dist/api/organisation/organisation.cjs.map +1 -1
- package/dist/api/organisation/organisation.fetch.cjs +1 -1
- package/dist/api/organisation/organisation.fetch.cjs.map +1 -1
- package/dist/api/organisation/organisation.fetch.d.ts.map +1 -1
- package/dist/api/organisation/organisation.fetch.js +1 -1
- package/dist/api/organisation/organisation.fetch.js.map +1 -1
- package/dist/api/organisation/organisation.js +1 -1
- package/dist/api/organisation/organisation.js.map +1 -1
- package/dist/api/product/product.cjs +1 -1
- package/dist/api/product/product.cjs.map +1 -1
- package/dist/api/product/product.d.ts.map +1 -1
- package/dist/api/product/product.fetch.cjs +1 -1
- package/dist/api/product/product.fetch.cjs.map +1 -1
- package/dist/api/product/product.fetch.js +1 -1
- package/dist/api/product/product.fetch.js.map +1 -1
- package/dist/api/product/product.js +1 -1
- package/dist/api/product/product.js.map +1 -1
- package/dist/api/state/state.cjs +1 -1
- package/dist/api/state/state.cjs.map +1 -1
- package/dist/api/state/state.fetch.cjs +1 -1
- package/dist/api/state/state.fetch.cjs.map +1 -1
- package/dist/api/state/state.fetch.js +1 -1
- package/dist/api/state/state.fetch.js.map +1 -1
- package/dist/api/state/state.js +1 -1
- package/dist/api/state/state.js.map +1 -1
- package/dist/api/unit/unit.cjs +1 -1
- package/dist/api/unit/unit.cjs.map +1 -1
- package/dist/api/unit/unit.fetch.cjs +1 -1
- package/dist/api/unit/unit.fetch.cjs.map +1 -1
- package/dist/api/unit/unit.fetch.d.cts.map +1 -1
- package/dist/api/unit/unit.fetch.d.ts.map +1 -1
- package/dist/api/unit/unit.fetch.js +1 -1
- package/dist/api/unit/unit.fetch.js.map +1 -1
- package/dist/api/unit/unit.js +1 -1
- package/dist/api/unit/unit.js.map +1 -1
- package/dist/api/user/user.cjs +1 -1
- package/dist/api/user/user.cjs.map +1 -1
- package/dist/api/user/user.fetch.cjs +1 -1
- package/dist/api/user/user.fetch.cjs.map +1 -1
- package/dist/api/user/user.fetch.js +1 -1
- package/dist/api/user/user.fetch.js.map +1 -1
- package/dist/api/user/user.js +1 -1
- package/dist/api/user/user.js.map +1 -1
- package/package.json +1 -1
- package/src/api/actions/actions.fetch.ts +1 -1
- package/src/api/actions/actions.ts +1 -1
- package/src/api/api-schemas/actionDetail.ts +1 -1
- package/src/api/api-schemas/actionGetResponse.ts +1 -1
- package/src/api/api-schemas/asError.ts +1 -1
- package/src/api/api-schemas/assetDetail.ts +1 -1
- package/src/api/api-schemas/assetDetailScope.ts +1 -1
- package/src/api/api-schemas/assetGetByIdResponse.ts +1 -1
- package/src/api/api-schemas/assetGetResponse.ts +1 -1
- package/src/api/api-schemas/assetPatchBodyBody.ts +1 -1
- package/src/api/api-schemas/assetPostBodyBody.ts +1 -1
- package/src/api/api-schemas/assetPostBodyBodyScope.ts +1 -1
- package/src/api/api-schemas/assetPostResponse.ts +1 -1
- package/src/api/api-schemas/attachAssetParams.ts +1 -1
- package/src/api/api-schemas/chargeAdditionalData.ts +1 -1
- package/src/api/api-schemas/chargeSummary.ts +1 -1
- package/src/api/api-schemas/chargeSummaryType.ts +1 -1
- package/src/api/api-schemas/chargesGetResponse.ts +1 -1
- package/src/api/api-schemas/detachAssetParams.ts +1 -1
- package/src/api/api-schemas/eventStreamGetPostResponse.ts +1 -1
- package/src/api/api-schemas/eventStreamPostBodyBody.ts +1 -1
- package/src/api/api-schemas/eventStreamPostBodyBodyFormat.ts +1 -1
- package/src/api/api-schemas/eventStreamVersionGetResponse.ts +1 -1
- package/src/api/api-schemas/eventStreamVersionGetResponseProtocol.ts +1 -1
- package/src/api/api-schemas/getActionsParams.ts +1 -1
- package/src/api/api-schemas/getAssetParams.ts +1 -1
- package/src/api/api-schemas/getChargesParams.ts +1 -1
- package/src/api/api-schemas/getOrganisationChargesParams.ts +1 -1
- package/src/api/api-schemas/getOrganisationsParams.ts +1 -1
- package/src/api/api-schemas/getProductChargesParams.ts +1 -1
- package/src/api/api-schemas/getUnitChargesParams.ts +1 -1
- package/src/api/api-schemas/getUnitsParams.ts +1 -1
- package/src/api/api-schemas/index.ts +1 -1
- package/src/api/api-schemas/merchantDetail.ts +1 -1
- package/src/api/api-schemas/merchantDetailKind.ts +1 -1
- package/src/api/api-schemas/merchantGetResponse.ts +1 -1
- package/src/api/api-schemas/merchantSummary.ts +1 -1
- package/src/api/api-schemas/merchantSummaryKind.ts +1 -1
- package/src/api/api-schemas/merchantsGetResponse.ts +1 -1
- package/src/api/api-schemas/organisationAllDetail.ts +1 -1
- package/src/api/api-schemas/organisationAllDetailDefaultProductPrivacy.ts +1 -1
- package/src/api/api-schemas/organisationChargeSummary.ts +1 -1
- package/src/api/api-schemas/organisationChargesGetResponse.ts +1 -1
- package/src/api/api-schemas/organisationDetail.ts +1 -1
- package/src/api/api-schemas/organisationDetailDefaultProductPrivacy.ts +1 -1
- package/src/api/api-schemas/organisationGetDefaultResponse.ts +1 -1
- package/src/api/api-schemas/organisationGetDefaultResponseDefaultProductPrivacy.ts +1 -1
- package/src/api/api-schemas/organisationGetResponse.ts +1 -1
- package/src/api/api-schemas/organisationPatchBodyBody.ts +1 -1
- package/src/api/api-schemas/organisationPatchBodyBodyDefaultProductPrivacy.ts +1 -1
- package/src/api/api-schemas/organisationPostBodyBody.ts +1 -1
- package/src/api/api-schemas/organisationPostBodyBodyDefaultProductPrivacy.ts +1 -1
- package/src/api/api-schemas/organisationPostResponse.ts +1 -1
- package/src/api/api-schemas/organisationUnitChargeSummary.ts +1 -1
- package/src/api/api-schemas/organisationUnitPostBodyBody.ts +1 -1
- package/src/api/api-schemas/organisationUnitPostBodyBodyDefaultProductPrivacy.ts +1 -1
- package/src/api/api-schemas/organisationUnitPostResponse.ts +1 -1
- package/src/api/api-schemas/organisationUnitsGetResponse.ts +1 -1
- package/src/api/api-schemas/organisationsGetResponse.ts +1 -1
- package/src/api/api-schemas/personalUnitPutBodyBody.ts +1 -1
- package/src/api/api-schemas/personalUnitPutResponse.ts +1 -1
- package/src/api/api-schemas/processingChargeItem.ts +1 -1
- package/src/api/api-schemas/processingCharges.ts +1 -1
- package/src/api/api-schemas/processingChargesMerchantKind.ts +1 -1
- package/src/api/api-schemas/productChargesGetResponse.ts +1 -1
- package/src/api/api-schemas/productChargesGetResponseProductType.ts +1 -1
- package/src/api/api-schemas/productClaimDetail.ts +1 -1
- package/src/api/api-schemas/productCoinsDetail.ts +1 -1
- package/src/api/api-schemas/productDetail.ts +1 -1
- package/src/api/api-schemas/productDetailFlavour.ts +1 -1
- package/src/api/api-schemas/productDetailType.ts +1 -1
- package/src/api/api-schemas/productDmProjectTier.ts +1 -1
- package/src/api/api-schemas/productDmStorage.ts +1 -1
- package/src/api/api-schemas/productDmStorageDetail.ts +1 -1
- package/src/api/api-schemas/productDmStorageDetailCoins.ts +1 -1
- package/src/api/api-schemas/productDmStorageDetailSize.ts +1 -1
- package/src/api/api-schemas/productInstanceDetail.ts +1 -1
- package/src/api/api-schemas/productInstanceDetailCoins.ts +1 -1
- package/src/api/api-schemas/productPatchBodyBody.ts +1 -1
- package/src/api/api-schemas/productType.ts +1 -1
- package/src/api/api-schemas/productTypeServiceKind.ts +1 -1
- package/src/api/api-schemas/productUnitGetResponse.ts +1 -1
- package/src/api/api-schemas/productUnitGetResponseProduct.ts +1 -1
- package/src/api/api-schemas/productsGetDefaultStorageCost.ts +1 -1
- package/src/api/api-schemas/productsGetDefaultStorageCostDefaultStorageCost.ts +1 -1
- package/src/api/api-schemas/productsGetResponse.ts +1 -1
- package/src/api/api-schemas/productsGetResponseProductsItem.ts +1 -1
- package/src/api/api-schemas/productsGetTypesResponse.ts +1 -1
- package/src/api/api-schemas/qFormatParameter.ts +1 -1
- package/src/api/api-schemas/qFromParameter.ts +1 -1
- package/src/api/api-schemas/qMIdParameter.ts +1 -1
- package/src/api/api-schemas/qNameParameter.ts +1 -1
- package/src/api/api-schemas/qOrgIdParameter.ts +1 -1
- package/src/api/api-schemas/qPbpParameter.ts +1 -1
- package/src/api/api-schemas/qProductIdParameter.ts +1 -1
- package/src/api/api-schemas/qUnitIdParameter.ts +1 -1
- package/src/api/api-schemas/qUntilParameter.ts +1 -1
- package/src/api/api-schemas/qUserIdParameter.ts +1 -1
- package/src/api/api-schemas/stateGetVersionResponse.ts +1 -1
- package/src/api/api-schemas/storageChargeItem.ts +1 -1
- package/src/api/api-schemas/storageCharges.ts +1 -1
- package/src/api/api-schemas/unitAllDetail.ts +1 -1
- package/src/api/api-schemas/unitAllDetailDefaultProductPrivacy.ts +1 -1
- package/src/api/api-schemas/unitChargeSummary.ts +1 -1
- package/src/api/api-schemas/unitChargesGetResponse.ts +1 -1
- package/src/api/api-schemas/unitDetail.ts +1 -1
- package/src/api/api-schemas/unitDetailDefaultProductPrivacy.ts +1 -1
- package/src/api/api-schemas/unitGetResponse.ts +1 -1
- package/src/api/api-schemas/unitPatchBodyBody.ts +1 -1
- package/src/api/api-schemas/unitPatchBodyBodyDefaultProductPrivacy.ts +1 -1
- package/src/api/api-schemas/unitProductChargeSummary.ts +1 -1
- package/src/api/api-schemas/unitProductPostBodyBody.ts +1 -1
- package/src/api/api-schemas/unitProductPostBodyBodyFlavour.ts +1 -1
- package/src/api/api-schemas/unitProductPostBodyBodyType.ts +1 -1
- package/src/api/api-schemas/unitProductPostResponse.ts +1 -1
- package/src/api/api-schemas/unitsGetResponse.ts +1 -1
- package/src/api/api-schemas/userAccountDetail.ts +1 -1
- package/src/api/api-schemas/userAccountGetResponse.ts +1 -1
- package/src/api/api-schemas/userDetail.ts +1 -1
- package/src/api/api-schemas/usersGetResponse.ts +1 -1
- package/src/api/asset/asset.fetch.ts +1 -1
- package/src/api/asset/asset.ts +1 -1
- package/src/api/charges/charges.fetch.ts +1 -1
- package/src/api/charges/charges.ts +1 -1
- package/src/api/event-stream/event-stream.fetch.ts +1 -1
- package/src/api/event-stream/event-stream.ts +1 -1
- package/src/api/merchant/merchant.fetch.ts +1 -1
- package/src/api/merchant/merchant.ts +1 -1
- package/src/api/organisation/organisation.fetch.ts +1 -1
- package/src/api/organisation/organisation.ts +1 -1
- package/src/api/product/product.fetch.ts +1 -1
- package/src/api/product/product.ts +1 -1
- package/src/api/state/state.fetch.ts +1 -1
- package/src/api/state/state.ts +1 -1
- package/src/api/unit/unit.fetch.ts +1 -1
- package/src/api/unit/unit.ts +1 -1
- package/src/api/user/user.fetch.ts +1 -1
- package/src/api/user/user.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-stream.js","names":["queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamVersion>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createEventStream>>,\n { data: EventStreamPostBodyBody }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteEventStream>>,\n { eventStreamId: number }\n >"],"sources":["../../../src/api/event-stream/event-stream.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.4\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n InvalidateOptions,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type {\n AsError,\n EventStreamGetPostResponse,\n EventStreamPostBodyBody,\n EventStreamVersionGetResponse,\n} from \".././api-schemas\";\n\nimport { customInstance } from \"../../custom-axios\";\nimport type { ErrorType } from \"../../custom-axios\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets the details of the installed event stream, which includes its **protocol**, and **name**.\n\n * @summary Gets the details of the installed event stream\n */\nexport const getEventStreamVersion = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<EventStreamVersionGetResponse>(\n { url: `/event-stream/version`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetEventStreamVersionQueryKey = () => {\n return [\"account-server\", \"event-stream\", \"version\"] as const;\n};\n\nexport const getGetEventStreamVersionQueryOptions = <\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamVersionQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamVersion>>> = ({ signal }) =>\n getEventStreamVersion(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetEventStreamVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getEventStreamVersion>>\n>;\nexport type GetEventStreamVersionQueryError = ErrorType<void | AsError>;\n\nexport function useGetEventStreamVersion<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n > &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError,\n Awaited<ReturnType<typeof getEventStreamVersion>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStreamVersion<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError,\n Awaited<ReturnType<typeof getEventStreamVersion>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStreamVersion<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets the details of the installed event stream\n */\n\nexport function useGetEventStreamVersion<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetEventStreamVersionQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets the details of the installed event stream\n */\nexport const invalidateGetEventStreamVersion = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetEventStreamVersionQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetEventStreamVersionSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamVersionQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamVersion>>> = ({ signal }) =>\n getEventStreamVersion(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetEventStreamVersionSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getEventStreamVersion>>\n>;\nexport type GetEventStreamVersionSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetEventStreamVersionSuspense<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStreamVersionSuspense<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStreamVersionSuspense<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets the details of the installed event stream\n */\n\nexport function useGetEventStreamVersionSuspense<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetEventStreamVersionSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Gets the details of your event stream, if you have created one. The response includes the event stream **id** and the **location** where events can be accessed.\n\n * @summary Gets the details of your event stream\n */\nexport const getEventStream = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<EventStreamGetPostResponse>(\n { url: `/event-stream`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetEventStreamQueryKey = () => {\n return [\"account-server\", \"event-stream\"] as const;\n};\n\nexport const getGetEventStreamQueryOptions = <\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) =>\n getEventStream(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetEventStreamQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>;\nexport type GetEventStreamQueryError = ErrorType<void | AsError>;\n\nexport function useGetEventStream<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n Awaited<ReturnType<typeof getEventStream>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStream<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n Awaited<ReturnType<typeof getEventStream>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStream<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets the details of your event stream\n */\n\nexport function useGetEventStream<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetEventStreamQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets the details of your event stream\n */\nexport const invalidateGetEventStream = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetEventStreamQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetEventStreamSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) =>\n getEventStream(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetEventStreamSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getEventStream>>\n>;\nexport type GetEventStreamSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetEventStreamSuspense<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStreamSuspense<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStreamSuspense<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets the details of your event stream\n */\n\nexport function useGetEventStreamSuspense<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetEventStreamSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Creates a new event stream for the authenticated user. Event streams deliver near-real-time events to the user, typically through a long-running *Socket*. The protocol is dependent on the Event Stream Service that has been installed. Our **Python FastAPI WebSocket** service is one such service.\n\nEvents are delivered to the client using the a `format` chosen here. Internally, events are **Protocol Buffer** objects that are delivered, by default as a single-line string using `MessageToString`. This is the `PROTOCOL_STRING` format. Clients can choose to receive messages as a JSON string using the format `JSON_STRING`. Using JSON strings will incur a small processing penalty but they are useful if the client does not have access to a library that can decode protocol buffer strings.\n\nThe response will include the event stream **id** and the **location** where events can be accessed.\n\nThe event streaming service is an optional component of the Account Server. If a service is not installed you will receive a corresponding **404** error response.\n\nA user is only permitted one event stream.\n\n * @summary Create a new event stream\n */\nexport const createEventStream = (\n eventStreamPostBodyBody: EventStreamPostBodyBody,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<EventStreamGetPostResponse>(\n {\n url: `/event-stream`,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n data: eventStreamPostBodyBody,\n signal,\n },\n options,\n );\n};\n\nexport const getCreateEventStreamMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n { data: EventStreamPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n { data: EventStreamPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"createEventStream\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createEventStream>>,\n { data: EventStreamPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createEventStream(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateEventStreamMutationResult = NonNullable<\n Awaited<ReturnType<typeof createEventStream>>\n>;\nexport type CreateEventStreamMutationBody = EventStreamPostBodyBody;\nexport type CreateEventStreamMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Create a new event stream\n */\nexport const useCreateEventStream = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n { data: EventStreamPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n { data: EventStreamPostBodyBody },\n TContext\n> => {\n const mutationOptions = getCreateEventStreamMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * You must be the user who created the event stream.\n\n * @summary Deletes an existing event stream (that you created)\n */\nexport const deleteEventStream = (\n eventStreamId: number,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>({ url: `/event-stream/${eventStreamId}`, method: \"DELETE\" }, options);\n};\n\nexport const getDeleteEventStreamMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n { eventStreamId: number },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n { eventStreamId: number },\n TContext\n> => {\n const mutationKey = [\"deleteEventStream\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteEventStream>>,\n { eventStreamId: number }\n > = (props) => {\n const { eventStreamId } = props ?? {};\n\n return deleteEventStream(eventStreamId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteEventStreamMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteEventStream>>\n>;\n\nexport type DeleteEventStreamMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Deletes an existing event stream (that you created)\n */\nexport const useDeleteEventStream = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n { eventStreamId: number },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n { eventStreamId: number },\n TContext\n> => {\n const mutationOptions = getDeleteEventStreamMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8CA,MAAa,yBACX,SACA,WACG;AACH,QAAO,eACL;EAAE,KAAK;EAAyB,QAAQ;EAAO;EAAQ,EACvD,QACD;;AAGH,MAAa,yCAAyC;AACpD,QAAO;EAAC;EAAkB;EAAgB;EAAU;;AAGtD,MAAa,wCAGX,YAKI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,kCAAkC;CAE7E,MAAMA,WAA6E,EAAE,aACnF,sBAAsB,gBAAgB,OAAO;AAE/C,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAoE/C,SAAgB,yBAId,SAMA,aACwE;CACxE,MAAM,eAAe,qCAAqC,QAAQ;CAElE,MAAM,QAAQ,SAAS,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,kCAAkC,OAC7C,aACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,kCAAkC,EAAE,EAAE,QAAQ;AAE9F,QAAO;;AAGT,MAAa,gDAGX,YAKI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,kCAAkC;CAE7E,MAAMA,WAA6E,EAAE,aACnF,sBAAsB,gBAAgB,OAAO;AAE/C,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAoD/C,SAAgB,iCAId,SAMA,aACgF;CAChF,MAAM,eAAe,6CAA6C,QAAQ;CAE1E,MAAM,QAAQ,iBAAiB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;;;AAQT,MAAa,kBACX,SACA,WACG;AACH,QAAO,eACL;EAAE,KAAK;EAAiB,QAAQ;EAAO;EAAQ,EAC/C,QACD;;AAGH,MAAa,kCAAkC;AAC7C,QAAO,CAAC,kBAAkB,eAAe;;AAG3C,MAAa,iCAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,2BAA2B;CAEtE,MAAMC,WAAsE,EAAE,aAC5E,eAAe,gBAAgB,OAAO;AAExC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA4D/C,SAAgB,kBAId,SAIA,aACwE;CACxE,MAAM,eAAe,8BAA8B,QAAQ;CAE3D,MAAM,QAAQ,SAAS,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,2BAA2B,OACtC,aACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,2BAA2B,EAAE,EAAE,QAAQ;AAEvF,QAAO;;AAGT,MAAa,yCAGX,YAKI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,2BAA2B;CAEtE,MAAMA,WAAsE,EAAE,aAC5E,eAAe,gBAAgB,OAAO;AAExC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAoD/C,SAAgB,0BAId,SAMA,aACgF;CAChF,MAAM,eAAe,sCAAsC,QAAQ;CAEnE,MAAM,QAAQ,iBAAiB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;;;;;;;;;;;AAgBT,MAAa,qBACX,yBACA,SACA,WACG;AACH,QAAO,eACL;EACE,KAAK;EACL,QAAQ;EACR,SAAS,EAAE,gBAAgB,oBAAoB;EAC/C,MAAM;EACN;EACD,EACD,QACD;;AAGH,MAAa,uCAGX,YAaG;CACH,MAAM,cAAc,CAAC,oBAAoB;CACzC,MAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,UAC3D,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cACxE,UACA;EAAE,GAAG;EAAS,UAAU;GAAE,GAAG,QAAQ;GAAU;GAAa;EAAE,GAChE;EAAE,UAAU,EAAE,aAAa;EAAE,SAAS;EAAW;CAErD,MAAMC,cAGD,UAAU;EACb,MAAM,EAAE,SAAS,SAAS,EAAE;AAE5B,SAAO,kBAAkB,MAAM,eAAe;;AAGhD,QAAO;EAAE;EAAY,GAAG;EAAiB;;;;;AAY3C,MAAa,wBACX,SASA,gBAMG;AAGH,QAAO,YAFiB,oCAAoC,QAAQ,EAEhC,YAAY;;;;;;;AAOlD,MAAa,qBACX,eACA,YACG;AACH,QAAO,eAAqB;EAAE,KAAK,iBAAiB;EAAiB,QAAQ;EAAU,EAAE,QAAQ;;AAGnG,MAAa,uCAGX,YAaG;CACH,MAAM,cAAc,CAAC,oBAAoB;CACzC,MAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,UAC3D,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cACxE,UACA;EAAE,GAAG;EAAS,UAAU;GAAE,GAAG,QAAQ;GAAU;GAAa;EAAE,GAChE;EAAE,UAAU,EAAE,aAAa;EAAE,SAAS;EAAW;CAErD,MAAMC,cAGD,UAAU;EACb,MAAM,EAAE,kBAAkB,SAAS,EAAE;AAErC,SAAO,kBAAkB,eAAe,eAAe;;AAGzD,QAAO;EAAE;EAAY,GAAG;EAAiB;;;;;AAY3C,MAAa,wBACX,SASA,gBAMG;AAGH,QAAO,YAFiB,oCAAoC,QAAQ,EAEhC,YAAY"}
|
|
1
|
+
{"version":3,"file":"event-stream.js","names":["queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamVersion>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createEventStream>>,\n { data: EventStreamPostBodyBody }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteEventStream>>,\n { eventStreamId: number }\n >"],"sources":["../../../src/api/event-stream/event-stream.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.5\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n InvalidateOptions,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type {\n AsError,\n EventStreamGetPostResponse,\n EventStreamPostBodyBody,\n EventStreamVersionGetResponse,\n} from \".././api-schemas\";\n\nimport { customInstance } from \"../../custom-axios\";\nimport type { ErrorType } from \"../../custom-axios\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets the details of the installed event stream, which includes its **protocol**, and **name**.\n\n * @summary Gets the details of the installed event stream\n */\nexport const getEventStreamVersion = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<EventStreamVersionGetResponse>(\n { url: `/event-stream/version`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetEventStreamVersionQueryKey = () => {\n return [\"account-server\", \"event-stream\", \"version\"] as const;\n};\n\nexport const getGetEventStreamVersionQueryOptions = <\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamVersionQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamVersion>>> = ({ signal }) =>\n getEventStreamVersion(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetEventStreamVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getEventStreamVersion>>\n>;\nexport type GetEventStreamVersionQueryError = ErrorType<void | AsError>;\n\nexport function useGetEventStreamVersion<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n > &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError,\n Awaited<ReturnType<typeof getEventStreamVersion>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStreamVersion<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError,\n Awaited<ReturnType<typeof getEventStreamVersion>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStreamVersion<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets the details of the installed event stream\n */\n\nexport function useGetEventStreamVersion<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetEventStreamVersionQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets the details of the installed event stream\n */\nexport const invalidateGetEventStreamVersion = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetEventStreamVersionQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetEventStreamVersionSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamVersionQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamVersion>>> = ({ signal }) =>\n getEventStreamVersion(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetEventStreamVersionSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getEventStreamVersion>>\n>;\nexport type GetEventStreamVersionSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetEventStreamVersionSuspense<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStreamVersionSuspense<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStreamVersionSuspense<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets the details of the installed event stream\n */\n\nexport function useGetEventStreamVersionSuspense<\n TData = Awaited<ReturnType<typeof getEventStreamVersion>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetEventStreamVersionSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Gets the details of your event stream, if you have created one. The response includes the event stream **id** and the **location** where events can be accessed.\n\n * @summary Gets the details of your event stream\n */\nexport const getEventStream = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<EventStreamGetPostResponse>(\n { url: `/event-stream`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetEventStreamQueryKey = () => {\n return [\"account-server\", \"event-stream\"] as const;\n};\n\nexport const getGetEventStreamQueryOptions = <\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) =>\n getEventStream(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetEventStreamQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>;\nexport type GetEventStreamQueryError = ErrorType<void | AsError>;\n\nexport function useGetEventStream<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n Awaited<ReturnType<typeof getEventStream>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStream<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n Awaited<ReturnType<typeof getEventStream>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStream<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets the details of your event stream\n */\n\nexport function useGetEventStream<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetEventStreamQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets the details of your event stream\n */\nexport const invalidateGetEventStream = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetEventStreamQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetEventStreamSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) =>\n getEventStream(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetEventStreamSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getEventStream>>\n>;\nexport type GetEventStreamSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetEventStreamSuspense<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStreamSuspense<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetEventStreamSuspense<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets the details of your event stream\n */\n\nexport function useGetEventStreamSuspense<\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetEventStreamSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Creates a new event stream for the authenticated user. Event streams deliver near-real-time events to the user, typically through a long-running *Socket*. The protocol is dependent on the Event Stream Service that has been installed. Our **Python FastAPI WebSocket** service is one such service.\n\nEvents are delivered to the client using the a `format` chosen here. Internally, events are **Protocol Buffer** objects that are delivered, by default as a single-line string using `MessageToString`. This is the `PROTOCOL_STRING` format. Clients can choose to receive messages as a JSON string using the format `JSON_STRING`. Using JSON strings will incur a small processing penalty but they are useful if the client does not have access to a library that can decode protocol buffer strings.\n\nThe response will include the event stream **id** and the **location** where events can be accessed.\n\nThe event streaming service is an optional component of the Account Server. If a service is not installed you will receive a corresponding **404** error response.\n\nA user is only permitted one event stream.\n\n * @summary Create a new event stream\n */\nexport const createEventStream = (\n eventStreamPostBodyBody: EventStreamPostBodyBody,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<EventStreamGetPostResponse>(\n {\n url: `/event-stream`,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n data: eventStreamPostBodyBody,\n signal,\n },\n options,\n );\n};\n\nexport const getCreateEventStreamMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n { data: EventStreamPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n { data: EventStreamPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"createEventStream\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createEventStream>>,\n { data: EventStreamPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createEventStream(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateEventStreamMutationResult = NonNullable<\n Awaited<ReturnType<typeof createEventStream>>\n>;\nexport type CreateEventStreamMutationBody = EventStreamPostBodyBody;\nexport type CreateEventStreamMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Create a new event stream\n */\nexport const useCreateEventStream = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n { data: EventStreamPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n { data: EventStreamPostBodyBody },\n TContext\n> => {\n const mutationOptions = getCreateEventStreamMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * You must be the user who created the event stream.\n\n * @summary Deletes an existing event stream (that you created)\n */\nexport const deleteEventStream = (\n eventStreamId: number,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>({ url: `/event-stream/${eventStreamId}`, method: \"DELETE\" }, options);\n};\n\nexport const getDeleteEventStreamMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n { eventStreamId: number },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n { eventStreamId: number },\n TContext\n> => {\n const mutationKey = [\"deleteEventStream\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteEventStream>>,\n { eventStreamId: number }\n > = (props) => {\n const { eventStreamId } = props ?? {};\n\n return deleteEventStream(eventStreamId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteEventStreamMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteEventStream>>\n>;\n\nexport type DeleteEventStreamMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Deletes an existing event stream (that you created)\n */\nexport const useDeleteEventStream = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n { eventStreamId: number },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n { eventStreamId: number },\n TContext\n> => {\n const mutationOptions = getDeleteEventStreamMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8CA,MAAa,yBACX,SACA,WACG;AACH,QAAO,eACL;EAAE,KAAK;EAAyB,QAAQ;EAAO;EAAQ,EACvD,QACD;;AAGH,MAAa,yCAAyC;AACpD,QAAO;EAAC;EAAkB;EAAgB;EAAU;;AAGtD,MAAa,wCAGX,YAKI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,kCAAkC;CAE7E,MAAMA,WAA6E,EAAE,aACnF,sBAAsB,gBAAgB,OAAO;AAE/C,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAoE/C,SAAgB,yBAId,SAMA,aACwE;CACxE,MAAM,eAAe,qCAAqC,QAAQ;CAElE,MAAM,QAAQ,SAAS,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,kCAAkC,OAC7C,aACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,kCAAkC,EAAE,EAAE,QAAQ;AAE9F,QAAO;;AAGT,MAAa,gDAGX,YAKI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,kCAAkC;CAE7E,MAAMA,WAA6E,EAAE,aACnF,sBAAsB,gBAAgB,OAAO;AAE/C,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAoD/C,SAAgB,iCAId,SAMA,aACgF;CAChF,MAAM,eAAe,6CAA6C,QAAQ;CAE1E,MAAM,QAAQ,iBAAiB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;;;AAQT,MAAa,kBACX,SACA,WACG;AACH,QAAO,eACL;EAAE,KAAK;EAAiB,QAAQ;EAAO;EAAQ,EAC/C,QACD;;AAGH,MAAa,kCAAkC;AAC7C,QAAO,CAAC,kBAAkB,eAAe;;AAG3C,MAAa,iCAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,2BAA2B;CAEtE,MAAMC,WAAsE,EAAE,aAC5E,eAAe,gBAAgB,OAAO;AAExC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA4D/C,SAAgB,kBAId,SAIA,aACwE;CACxE,MAAM,eAAe,8BAA8B,QAAQ;CAE3D,MAAM,QAAQ,SAAS,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,2BAA2B,OACtC,aACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,2BAA2B,EAAE,EAAE,QAAQ;AAEvF,QAAO;;AAGT,MAAa,yCAGX,YAKI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,2BAA2B;CAEtE,MAAMA,WAAsE,EAAE,aAC5E,eAAe,gBAAgB,OAAO;AAExC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAoD/C,SAAgB,0BAId,SAMA,aACgF;CAChF,MAAM,eAAe,sCAAsC,QAAQ;CAEnE,MAAM,QAAQ,iBAAiB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;;;;;;;;;;;AAgBT,MAAa,qBACX,yBACA,SACA,WACG;AACH,QAAO,eACL;EACE,KAAK;EACL,QAAQ;EACR,SAAS,EAAE,gBAAgB,oBAAoB;EAC/C,MAAM;EACN;EACD,EACD,QACD;;AAGH,MAAa,uCAGX,YAaG;CACH,MAAM,cAAc,CAAC,oBAAoB;CACzC,MAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,UAC3D,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cACxE,UACA;EAAE,GAAG;EAAS,UAAU;GAAE,GAAG,QAAQ;GAAU;GAAa;EAAE,GAChE;EAAE,UAAU,EAAE,aAAa;EAAE,SAAS;EAAW;CAErD,MAAMC,cAGD,UAAU;EACb,MAAM,EAAE,SAAS,SAAS,EAAE;AAE5B,SAAO,kBAAkB,MAAM,eAAe;;AAGhD,QAAO;EAAE;EAAY,GAAG;EAAiB;;;;;AAY3C,MAAa,wBACX,SASA,gBAMG;AAGH,QAAO,YAFiB,oCAAoC,QAAQ,EAEhC,YAAY;;;;;;;AAOlD,MAAa,qBACX,eACA,YACG;AACH,QAAO,eAAqB;EAAE,KAAK,iBAAiB;EAAiB,QAAQ;EAAU,EAAE,QAAQ;;AAGnG,MAAa,uCAGX,YAaG;CACH,MAAM,cAAc,CAAC,oBAAoB;CACzC,MAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,UAC3D,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cACxE,UACA;EAAE,GAAG;EAAS,UAAU;GAAE,GAAG,QAAQ;GAAU;GAAa;EAAE,GAChE;EAAE,UAAU,EAAE,aAAa;EAAE,SAAS;EAAW;CAErD,MAAMC,cAGD,UAAU;EACb,MAAM,EAAE,kBAAkB,SAAS,EAAE;AAErC,SAAO,kBAAkB,eAAe,eAAe;;AAGzD,QAAO;EAAE;EAAY,GAAG;EAAiB;;;;;AAY3C,MAAa,wBACX,SASA,gBAMG;AAGH,QAAO,YAFiB,oCAAoC,QAAQ,EAEhC,YAAY"}
|
|
@@ -11,7 +11,7 @@ let __tanstack_react_query = require("@tanstack/react-query");
|
|
|
11
11
|
|
|
12
12
|
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
13
13
|
|
|
14
|
-
* OpenAPI spec version: 4.
|
|
14
|
+
* OpenAPI spec version: 4.5
|
|
15
15
|
*/
|
|
16
16
|
/**
|
|
17
17
|
* Gets Merchants known to the Account Server
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merchant.cjs","names":["customInstance","queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>>"],"sources":["../../../src/api/merchant/merchant.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.4\n */\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n InvalidateOptions,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type { AsError, MerchantDetail, MerchantsGetResponse } from \".././api-schemas\";\n\nimport { customInstance } from \"../../custom-axios\";\nimport type { ErrorType } from \"../../custom-axios\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets Merchants known to the Account Server\n\nMerchants are software services (SaaS assets) whose facilities are known to and controlled by the Account Server\n\n * @summary Gets all Merchants\n */\nexport const getMerchants = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<MerchantsGetResponse>({ url: `/merchant`, method: \"GET\", signal }, options);\n};\n\nexport const getGetMerchantsQueryKey = () => {\n return [\"account-server\", \"merchant\"] as const;\n};\n\nexport const getGetMerchantsQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets all Merchants\n */\nexport const invalidateGetMerchants = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetMerchantsQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetMerchantsSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Gets a known Merchant\n\n * @summary Gets a specific Merchant\n */\nexport const getService = (\n mId: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<MerchantDetail>(\n { url: `/merchant/${mId}`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetServiceQueryKey = (mId?: number) => {\n return [\"account-server\", \"merchant\", mId] as const;\n};\n\nexport const getGetServiceQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!mId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceQueryError = ErrorType<AsError | void>;\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceQueryOptions(mId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets a specific Merchant\n */\nexport const invalidateGetService = async (\n queryClient: QueryClient,\n mId: number,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetServiceQueryKey(mId) }, options);\n\n return queryClient;\n};\n\nexport const getGetServiceSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceSuspenseQueryOptions(mId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAa,gBACX,SACA,WACG;AACH,QAAOA,oCAAqC;EAAE,KAAK;EAAa,QAAQ;EAAO;EAAQ,EAAE,QAAQ;;AAGnG,MAAa,gCAAgC;AAC3C,QAAO,CAAC,kBAAkB,WAAW;;AAGvC,MAAa,+BAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMC,WAAoE,EAAE,aAC1E,aAAa,gBAAgB,OAAO;AAEtC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA4D/C,SAAgB,gBAId,SAIA,aACwE;CACxE,MAAM,eAAe,4BAA4B,QAAQ;CAEzD,MAAM,6CAAiB,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,yBAAyB,OACpC,aACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,yBAAyB,EAAE,EAAE,QAAQ;AAErF,QAAO;;AAGT,MAAa,uCAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMA,WAAoE,EAAE,aAC1E,aAAa,gBAAgB,OAAO;AAEtC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAkD/C,SAAgB,wBAId,SAMA,aACgF;CAChF,MAAM,eAAe,oCAAoC,QAAQ;CAEjE,MAAM,qDAAyB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;;;AAQT,MAAa,cACX,KACA,SACA,WACG;AACH,QAAOD,oCACL;EAAE,KAAK,aAAa;EAAO,QAAQ;EAAO;EAAQ,EAClD,QACD;;AAGH,MAAa,yBAAyB,QAAiB;AACrD,QAAO;EAAC;EAAkB;EAAY;EAAI;;AAG5C,MAAa,6BAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAME,WAAkE,EAAE,aACxE,WAAW,KAAK,gBAAgB,OAAO;AAEzC,QAAO;EAAE;EAAU;EAAS,SAAS,CAAC,CAAC;EAAK,GAAG;EAAc;;;;;AA+D/D,SAAgB,cAId,KACA,SAIA,aACwE;CACxE,MAAM,eAAe,0BAA0B,KAAK,QAAQ;CAE5D,MAAM,6CAAiB,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,uBAAuB,OAClC,aACA,KACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,sBAAsB,IAAI,EAAE,EAAE,QAAQ;AAEtF,QAAO;;AAGT,MAAa,qCAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAMA,WAAkE,EAAE,aACxE,WAAW,KAAK,gBAAgB,OAAO;AAEzC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA+C/C,SAAgB,sBAId,KACA,SAIA,aACgF;CAChF,MAAM,eAAe,kCAAkC,KAAK,QAAQ;CAEpE,MAAM,qDAAyB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO"}
|
|
1
|
+
{"version":3,"file":"merchant.cjs","names":["customInstance","queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>>"],"sources":["../../../src/api/merchant/merchant.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.5\n */\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n InvalidateOptions,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type { AsError, MerchantDetail, MerchantsGetResponse } from \".././api-schemas\";\n\nimport { customInstance } from \"../../custom-axios\";\nimport type { ErrorType } from \"../../custom-axios\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets Merchants known to the Account Server\n\nMerchants are software services (SaaS assets) whose facilities are known to and controlled by the Account Server\n\n * @summary Gets all Merchants\n */\nexport const getMerchants = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<MerchantsGetResponse>({ url: `/merchant`, method: \"GET\", signal }, options);\n};\n\nexport const getGetMerchantsQueryKey = () => {\n return [\"account-server\", \"merchant\"] as const;\n};\n\nexport const getGetMerchantsQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets all Merchants\n */\nexport const invalidateGetMerchants = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetMerchantsQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetMerchantsSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Gets a known Merchant\n\n * @summary Gets a specific Merchant\n */\nexport const getService = (\n mId: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<MerchantDetail>(\n { url: `/merchant/${mId}`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetServiceQueryKey = (mId?: number) => {\n return [\"account-server\", \"merchant\", mId] as const;\n};\n\nexport const getGetServiceQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!mId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceQueryError = ErrorType<AsError | void>;\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceQueryOptions(mId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets a specific Merchant\n */\nexport const invalidateGetService = async (\n queryClient: QueryClient,\n mId: number,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetServiceQueryKey(mId) }, options);\n\n return queryClient;\n};\n\nexport const getGetServiceSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceSuspenseQueryOptions(mId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAa,gBACX,SACA,WACG;AACH,QAAOA,oCAAqC;EAAE,KAAK;EAAa,QAAQ;EAAO;EAAQ,EAAE,QAAQ;;AAGnG,MAAa,gCAAgC;AAC3C,QAAO,CAAC,kBAAkB,WAAW;;AAGvC,MAAa,+BAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMC,WAAoE,EAAE,aAC1E,aAAa,gBAAgB,OAAO;AAEtC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA4D/C,SAAgB,gBAId,SAIA,aACwE;CACxE,MAAM,eAAe,4BAA4B,QAAQ;CAEzD,MAAM,6CAAiB,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,yBAAyB,OACpC,aACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,yBAAyB,EAAE,EAAE,QAAQ;AAErF,QAAO;;AAGT,MAAa,uCAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMA,WAAoE,EAAE,aAC1E,aAAa,gBAAgB,OAAO;AAEtC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAkD/C,SAAgB,wBAId,SAMA,aACgF;CAChF,MAAM,eAAe,oCAAoC,QAAQ;CAEjE,MAAM,qDAAyB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;;;AAQT,MAAa,cACX,KACA,SACA,WACG;AACH,QAAOD,oCACL;EAAE,KAAK,aAAa;EAAO,QAAQ;EAAO;EAAQ,EAClD,QACD;;AAGH,MAAa,yBAAyB,QAAiB;AACrD,QAAO;EAAC;EAAkB;EAAY;EAAI;;AAG5C,MAAa,6BAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAME,WAAkE,EAAE,aACxE,WAAW,KAAK,gBAAgB,OAAO;AAEzC,QAAO;EAAE;EAAU;EAAS,SAAS,CAAC,CAAC;EAAK,GAAG;EAAc;;;;;AA+D/D,SAAgB,cAId,KACA,SAIA,aACwE;CACxE,MAAM,eAAe,0BAA0B,KAAK,QAAQ;CAE5D,MAAM,6CAAiB,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,uBAAuB,OAClC,aACA,KACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,sBAAsB,IAAI,EAAE,EAAE,QAAQ;AAEtF,QAAO;;AAGT,MAAa,qCAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAMA,WAAkE,EAAE,aACxE,WAAW,KAAK,gBAAgB,OAAO;AAEzC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA+C/C,SAAgB,sBAId,KACA,SAIA,aACgF;CAChF,MAAM,eAAe,kCAAkC,KAAK,QAAQ;CAEpE,MAAM,qDAAyB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO"}
|
|
@@ -11,7 +11,7 @@ let __tanstack_react_query = require("@tanstack/react-query");
|
|
|
11
11
|
|
|
12
12
|
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
13
13
|
|
|
14
|
-
* OpenAPI spec version: 4.
|
|
14
|
+
* OpenAPI spec version: 4.5
|
|
15
15
|
*/
|
|
16
16
|
const getGetMerchantsUrl = () => {
|
|
17
17
|
return `/merchant`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merchant.fetch.cjs","names":["customFetch","queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>>"],"sources":["../../../src/api/merchant/merchant.fetch.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.4\n */\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n InvalidateOptions,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type { AsError, MerchantDetail, MerchantsGetResponse } from \".././api-schemas\";\n\nimport { customFetch } from \"../../custom-fetch\";\nimport type { ErrorType } from \"../../custom-fetch\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets Merchants known to the Account Server\n\nMerchants are software services (SaaS assets) whose facilities are known to and controlled by the Account Server\n\n * @summary Gets all Merchants\n */\nexport type getMerchantsResponse200 = { data: MerchantsGetResponse; status: 200 };\n\nexport type getMerchantsResponse400 = { data: AsError; status: 400 };\n\nexport type getMerchantsResponse401 = { data: void; status: 401 };\n\nexport type getMerchantsResponse403 = { data: AsError; status: 403 };\n\nexport type getMerchantsResponseSuccess = getMerchantsResponse200 & { headers: Headers };\nexport type getMerchantsResponseError = (\n | getMerchantsResponse400\n | getMerchantsResponse401\n | getMerchantsResponse403\n) & { headers: Headers };\n\nexport type getMerchantsResponse = getMerchantsResponseSuccess | getMerchantsResponseError;\n\nexport const getGetMerchantsUrl = () => {\n return `/merchant`;\n};\n\nexport const getMerchants = async (options?: RequestInit): Promise<getMerchantsResponse> => {\n return customFetch<getMerchantsResponse>(getGetMerchantsUrl(), { ...options, method: \"GET\" });\n};\n\nexport const getGetMerchantsQueryKey = () => {\n return [\"account-server\", \"merchant\"] as const;\n};\n\nexport const getGetMerchantsQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets all Merchants\n */\nexport const invalidateGetMerchants = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetMerchantsQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetMerchantsSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Gets a known Merchant\n\n * @summary Gets a specific Merchant\n */\nexport type getServiceResponse200 = { data: MerchantDetail; status: 200 };\n\nexport type getServiceResponse400 = { data: AsError; status: 400 };\n\nexport type getServiceResponse401 = { data: void; status: 401 };\n\nexport type getServiceResponse403 = { data: AsError; status: 403 };\n\nexport type getServiceResponseSuccess = getServiceResponse200 & { headers: Headers };\nexport type getServiceResponseError = (\n | getServiceResponse400\n | getServiceResponse401\n | getServiceResponse403\n) & { headers: Headers };\n\nexport type getServiceResponse = getServiceResponseSuccess | getServiceResponseError;\n\nexport const getGetServiceUrl = (mId: number) => {\n return `/merchant/${mId}`;\n};\n\nexport const getService = async (\n mId: number,\n options?: RequestInit,\n): Promise<getServiceResponse> => {\n return customFetch<getServiceResponse>(getGetServiceUrl(mId), { ...options, method: \"GET\" });\n};\n\nexport const getGetServiceQueryKey = (mId?: number) => {\n return [\"account-server\", \"merchant\", mId] as const;\n};\n\nexport const getGetServiceQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, enabled: !!mId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceQueryError = ErrorType<AsError | void>;\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceQueryOptions(mId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets a specific Merchant\n */\nexport const invalidateGetService = async (\n queryClient: QueryClient,\n mId: number,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetServiceQueryKey(mId) }, options);\n\n return queryClient;\n};\n\nexport const getGetServiceSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceSuspenseQueryOptions(mId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAyDA,MAAa,2BAA2B;AACtC,QAAO;;AAGT,MAAa,eAAe,OAAO,YAAyD;AAC1F,QAAOA,iCAAkC,oBAAoB,EAAE;EAAE,GAAG;EAAS,QAAQ;EAAO,CAAC;;AAG/F,MAAa,gCAAgC;AAC3C,QAAO,CAAC,kBAAkB,WAAW;;AAGvC,MAAa,+BAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMC,WAAoE,EAAE,aAC1E,aAAa;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAE7C,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA4D/C,SAAgB,gBAId,SAIA,aACwE;CACxE,MAAM,eAAe,4BAA4B,QAAQ;CAEzD,MAAM,6CAAiB,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,yBAAyB,OACpC,aACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,yBAAyB,EAAE,EAAE,QAAQ;AAErF,QAAO;;AAGT,MAAa,uCAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMA,WAAoE,EAAE,aAC1E,aAAa;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAE7C,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAkD/C,SAAgB,wBAId,SAMA,aACgF;CAChF,MAAM,eAAe,oCAAoC,QAAQ;CAEjE,MAAM,qDAAyB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO;;AAyBT,MAAa,oBAAoB,QAAgB;AAC/C,QAAO,aAAa;;AAGtB,MAAa,aAAa,OACxB,KACA,YACgC;AAChC,QAAOD,iCAAgC,iBAAiB,IAAI,EAAE;EAAE,GAAG;EAAS,QAAQ;EAAO,CAAC;;AAG9F,MAAa,yBAAyB,QAAiB;AACrD,QAAO;EAAC;EAAkB;EAAY;EAAI;;AAG5C,MAAa,6BAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAME,WAAkE,EAAE,aACxE,WAAW,KAAK;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAEhD,QAAO;EAAE;EAAU;EAAS,SAAS,CAAC,CAAC;EAAK,GAAG;EAAc;;;;;AA+D/D,SAAgB,cAId,KACA,SAIA,aACwE;CACxE,MAAM,eAAe,0BAA0B,KAAK,QAAQ;CAE5D,MAAM,6CAAiB,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,uBAAuB,OAClC,aACA,KACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,sBAAsB,IAAI,EAAE,EAAE,QAAQ;AAEtF,QAAO;;AAGT,MAAa,qCAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAMA,WAAkE,EAAE,aACxE,WAAW,KAAK;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAEhD,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA+C/C,SAAgB,sBAId,KACA,SAIA,aACgF;CAChF,MAAM,eAAe,kCAAkC,KAAK,QAAQ;CAEpE,MAAM,qDAAyB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO"}
|
|
1
|
+
{"version":3,"file":"merchant.fetch.cjs","names":["customFetch","queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>>"],"sources":["../../../src/api/merchant/merchant.fetch.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.5\n */\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n InvalidateOptions,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type { AsError, MerchantDetail, MerchantsGetResponse } from \".././api-schemas\";\n\nimport { customFetch } from \"../../custom-fetch\";\nimport type { ErrorType } from \"../../custom-fetch\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets Merchants known to the Account Server\n\nMerchants are software services (SaaS assets) whose facilities are known to and controlled by the Account Server\n\n * @summary Gets all Merchants\n */\nexport type getMerchantsResponse200 = { data: MerchantsGetResponse; status: 200 };\n\nexport type getMerchantsResponse400 = { data: AsError; status: 400 };\n\nexport type getMerchantsResponse401 = { data: void; status: 401 };\n\nexport type getMerchantsResponse403 = { data: AsError; status: 403 };\n\nexport type getMerchantsResponseSuccess = getMerchantsResponse200 & { headers: Headers };\nexport type getMerchantsResponseError = (\n | getMerchantsResponse400\n | getMerchantsResponse401\n | getMerchantsResponse403\n) & { headers: Headers };\n\nexport type getMerchantsResponse = getMerchantsResponseSuccess | getMerchantsResponseError;\n\nexport const getGetMerchantsUrl = () => {\n return `/merchant`;\n};\n\nexport const getMerchants = async (options?: RequestInit): Promise<getMerchantsResponse> => {\n return customFetch<getMerchantsResponse>(getGetMerchantsUrl(), { ...options, method: \"GET\" });\n};\n\nexport const getGetMerchantsQueryKey = () => {\n return [\"account-server\", \"merchant\"] as const;\n};\n\nexport const getGetMerchantsQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets all Merchants\n */\nexport const invalidateGetMerchants = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetMerchantsQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetMerchantsSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Gets a known Merchant\n\n * @summary Gets a specific Merchant\n */\nexport type getServiceResponse200 = { data: MerchantDetail; status: 200 };\n\nexport type getServiceResponse400 = { data: AsError; status: 400 };\n\nexport type getServiceResponse401 = { data: void; status: 401 };\n\nexport type getServiceResponse403 = { data: AsError; status: 403 };\n\nexport type getServiceResponseSuccess = getServiceResponse200 & { headers: Headers };\nexport type getServiceResponseError = (\n | getServiceResponse400\n | getServiceResponse401\n | getServiceResponse403\n) & { headers: Headers };\n\nexport type getServiceResponse = getServiceResponseSuccess | getServiceResponseError;\n\nexport const getGetServiceUrl = (mId: number) => {\n return `/merchant/${mId}`;\n};\n\nexport const getService = async (\n mId: number,\n options?: RequestInit,\n): Promise<getServiceResponse> => {\n return customFetch<getServiceResponse>(getGetServiceUrl(mId), { ...options, method: \"GET\" });\n};\n\nexport const getGetServiceQueryKey = (mId?: number) => {\n return [\"account-server\", \"merchant\", mId] as const;\n};\n\nexport const getGetServiceQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, enabled: !!mId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceQueryError = ErrorType<AsError | void>;\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceQueryOptions(mId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets a specific Merchant\n */\nexport const invalidateGetService = async (\n queryClient: QueryClient,\n mId: number,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetServiceQueryKey(mId) }, options);\n\n return queryClient;\n};\n\nexport const getGetServiceSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceSuspenseQueryOptions(mId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAyDA,MAAa,2BAA2B;AACtC,QAAO;;AAGT,MAAa,eAAe,OAAO,YAAyD;AAC1F,QAAOA,iCAAkC,oBAAoB,EAAE;EAAE,GAAG;EAAS,QAAQ;EAAO,CAAC;;AAG/F,MAAa,gCAAgC;AAC3C,QAAO,CAAC,kBAAkB,WAAW;;AAGvC,MAAa,+BAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMC,WAAoE,EAAE,aAC1E,aAAa;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAE7C,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA4D/C,SAAgB,gBAId,SAIA,aACwE;CACxE,MAAM,eAAe,4BAA4B,QAAQ;CAEzD,MAAM,6CAAiB,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,yBAAyB,OACpC,aACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,yBAAyB,EAAE,EAAE,QAAQ;AAErF,QAAO;;AAGT,MAAa,uCAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMA,WAAoE,EAAE,aAC1E,aAAa;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAE7C,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAkD/C,SAAgB,wBAId,SAMA,aACgF;CAChF,MAAM,eAAe,oCAAoC,QAAQ;CAEjE,MAAM,qDAAyB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO;;AAyBT,MAAa,oBAAoB,QAAgB;AAC/C,QAAO,aAAa;;AAGtB,MAAa,aAAa,OACxB,KACA,YACgC;AAChC,QAAOD,iCAAgC,iBAAiB,IAAI,EAAE;EAAE,GAAG;EAAS,QAAQ;EAAO,CAAC;;AAG9F,MAAa,yBAAyB,QAAiB;AACrD,QAAO;EAAC;EAAkB;EAAY;EAAI;;AAG5C,MAAa,6BAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAME,WAAkE,EAAE,aACxE,WAAW,KAAK;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAEhD,QAAO;EAAE;EAAU;EAAS,SAAS,CAAC,CAAC;EAAK,GAAG;EAAc;;;;;AA+D/D,SAAgB,cAId,KACA,SAIA,aACwE;CACxE,MAAM,eAAe,0BAA0B,KAAK,QAAQ;CAE5D,MAAM,6CAAiB,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,uBAAuB,OAClC,aACA,KACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,sBAAsB,IAAI,EAAE,EAAE,QAAQ;AAEtF,QAAO;;AAGT,MAAa,qCAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAMA,WAAkE,EAAE,aACxE,WAAW,KAAK;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAEhD,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA+C/C,SAAgB,sBAId,KACA,SAIA,aACgF;CAChF,MAAM,eAAe,kCAAkC,KAAK,QAAQ;CAEpE,MAAM,qDAAyB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO"}
|
|
@@ -10,7 +10,7 @@ import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
|
10
10
|
|
|
11
11
|
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
12
12
|
|
|
13
|
-
* OpenAPI spec version: 4.
|
|
13
|
+
* OpenAPI spec version: 4.5
|
|
14
14
|
*/
|
|
15
15
|
const getGetMerchantsUrl = () => {
|
|
16
16
|
return `/merchant`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merchant.fetch.js","names":["queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>>"],"sources":["../../../src/api/merchant/merchant.fetch.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.4\n */\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n InvalidateOptions,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type { AsError, MerchantDetail, MerchantsGetResponse } from \".././api-schemas\";\n\nimport { customFetch } from \"../../custom-fetch\";\nimport type { ErrorType } from \"../../custom-fetch\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets Merchants known to the Account Server\n\nMerchants are software services (SaaS assets) whose facilities are known to and controlled by the Account Server\n\n * @summary Gets all Merchants\n */\nexport type getMerchantsResponse200 = { data: MerchantsGetResponse; status: 200 };\n\nexport type getMerchantsResponse400 = { data: AsError; status: 400 };\n\nexport type getMerchantsResponse401 = { data: void; status: 401 };\n\nexport type getMerchantsResponse403 = { data: AsError; status: 403 };\n\nexport type getMerchantsResponseSuccess = getMerchantsResponse200 & { headers: Headers };\nexport type getMerchantsResponseError = (\n | getMerchantsResponse400\n | getMerchantsResponse401\n | getMerchantsResponse403\n) & { headers: Headers };\n\nexport type getMerchantsResponse = getMerchantsResponseSuccess | getMerchantsResponseError;\n\nexport const getGetMerchantsUrl = () => {\n return `/merchant`;\n};\n\nexport const getMerchants = async (options?: RequestInit): Promise<getMerchantsResponse> => {\n return customFetch<getMerchantsResponse>(getGetMerchantsUrl(), { ...options, method: \"GET\" });\n};\n\nexport const getGetMerchantsQueryKey = () => {\n return [\"account-server\", \"merchant\"] as const;\n};\n\nexport const getGetMerchantsQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets all Merchants\n */\nexport const invalidateGetMerchants = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetMerchantsQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetMerchantsSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Gets a known Merchant\n\n * @summary Gets a specific Merchant\n */\nexport type getServiceResponse200 = { data: MerchantDetail; status: 200 };\n\nexport type getServiceResponse400 = { data: AsError; status: 400 };\n\nexport type getServiceResponse401 = { data: void; status: 401 };\n\nexport type getServiceResponse403 = { data: AsError; status: 403 };\n\nexport type getServiceResponseSuccess = getServiceResponse200 & { headers: Headers };\nexport type getServiceResponseError = (\n | getServiceResponse400\n | getServiceResponse401\n | getServiceResponse403\n) & { headers: Headers };\n\nexport type getServiceResponse = getServiceResponseSuccess | getServiceResponseError;\n\nexport const getGetServiceUrl = (mId: number) => {\n return `/merchant/${mId}`;\n};\n\nexport const getService = async (\n mId: number,\n options?: RequestInit,\n): Promise<getServiceResponse> => {\n return customFetch<getServiceResponse>(getGetServiceUrl(mId), { ...options, method: \"GET\" });\n};\n\nexport const getGetServiceQueryKey = (mId?: number) => {\n return [\"account-server\", \"merchant\", mId] as const;\n};\n\nexport const getGetServiceQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, enabled: !!mId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceQueryError = ErrorType<AsError | void>;\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceQueryOptions(mId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets a specific Merchant\n */\nexport const invalidateGetService = async (\n queryClient: QueryClient,\n mId: number,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetServiceQueryKey(mId) }, options);\n\n return queryClient;\n};\n\nexport const getGetServiceSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceSuspenseQueryOptions(mId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n"],"mappings":";;;;;;;;;;;;;;AAyDA,MAAa,2BAA2B;AACtC,QAAO;;AAGT,MAAa,eAAe,OAAO,YAAyD;AAC1F,QAAO,YAAkC,oBAAoB,EAAE;EAAE,GAAG;EAAS,QAAQ;EAAO,CAAC;;AAG/F,MAAa,gCAAgC;AAC3C,QAAO,CAAC,kBAAkB,WAAW;;AAGvC,MAAa,+BAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMA,WAAoE,EAAE,aAC1E,aAAa;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAE7C,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA4D/C,SAAgB,gBAId,SAIA,aACwE;CACxE,MAAM,eAAe,4BAA4B,QAAQ;CAEzD,MAAM,QAAQ,SAAS,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,yBAAyB,OACpC,aACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,yBAAyB,EAAE,EAAE,QAAQ;AAErF,QAAO;;AAGT,MAAa,uCAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMA,WAAoE,EAAE,aAC1E,aAAa;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAE7C,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAkD/C,SAAgB,wBAId,SAMA,aACgF;CAChF,MAAM,eAAe,oCAAoC,QAAQ;CAEjE,MAAM,QAAQ,iBAAiB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO;;AAyBT,MAAa,oBAAoB,QAAgB;AAC/C,QAAO,aAAa;;AAGtB,MAAa,aAAa,OACxB,KACA,YACgC;AAChC,QAAO,YAAgC,iBAAiB,IAAI,EAAE;EAAE,GAAG;EAAS,QAAQ;EAAO,CAAC;;AAG9F,MAAa,yBAAyB,QAAiB;AACrD,QAAO;EAAC;EAAkB;EAAY;EAAI;;AAG5C,MAAa,6BAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAMC,WAAkE,EAAE,aACxE,WAAW,KAAK;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAEhD,QAAO;EAAE;EAAU;EAAS,SAAS,CAAC,CAAC;EAAK,GAAG;EAAc;;;;;AA+D/D,SAAgB,cAId,KACA,SAIA,aACwE;CACxE,MAAM,eAAe,0BAA0B,KAAK,QAAQ;CAE5D,MAAM,QAAQ,SAAS,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,uBAAuB,OAClC,aACA,KACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,sBAAsB,IAAI,EAAE,EAAE,QAAQ;AAEtF,QAAO;;AAGT,MAAa,qCAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAMA,WAAkE,EAAE,aACxE,WAAW,KAAK;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAEhD,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA+C/C,SAAgB,sBAId,KACA,SAIA,aACgF;CAChF,MAAM,eAAe,kCAAkC,KAAK,QAAQ;CAEpE,MAAM,QAAQ,iBAAiB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO"}
|
|
1
|
+
{"version":3,"file":"merchant.fetch.js","names":["queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>>"],"sources":["../../../src/api/merchant/merchant.fetch.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.5\n */\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n InvalidateOptions,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type { AsError, MerchantDetail, MerchantsGetResponse } from \".././api-schemas\";\n\nimport { customFetch } from \"../../custom-fetch\";\nimport type { ErrorType } from \"../../custom-fetch\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets Merchants known to the Account Server\n\nMerchants are software services (SaaS assets) whose facilities are known to and controlled by the Account Server\n\n * @summary Gets all Merchants\n */\nexport type getMerchantsResponse200 = { data: MerchantsGetResponse; status: 200 };\n\nexport type getMerchantsResponse400 = { data: AsError; status: 400 };\n\nexport type getMerchantsResponse401 = { data: void; status: 401 };\n\nexport type getMerchantsResponse403 = { data: AsError; status: 403 };\n\nexport type getMerchantsResponseSuccess = getMerchantsResponse200 & { headers: Headers };\nexport type getMerchantsResponseError = (\n | getMerchantsResponse400\n | getMerchantsResponse401\n | getMerchantsResponse403\n) & { headers: Headers };\n\nexport type getMerchantsResponse = getMerchantsResponseSuccess | getMerchantsResponseError;\n\nexport const getGetMerchantsUrl = () => {\n return `/merchant`;\n};\n\nexport const getMerchants = async (options?: RequestInit): Promise<getMerchantsResponse> => {\n return customFetch<getMerchantsResponse>(getGetMerchantsUrl(), { ...options, method: \"GET\" });\n};\n\nexport const getGetMerchantsQueryKey = () => {\n return [\"account-server\", \"merchant\"] as const;\n};\n\nexport const getGetMerchantsQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets all Merchants\n */\nexport const invalidateGetMerchants = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetMerchantsQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetMerchantsSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Gets a known Merchant\n\n * @summary Gets a specific Merchant\n */\nexport type getServiceResponse200 = { data: MerchantDetail; status: 200 };\n\nexport type getServiceResponse400 = { data: AsError; status: 400 };\n\nexport type getServiceResponse401 = { data: void; status: 401 };\n\nexport type getServiceResponse403 = { data: AsError; status: 403 };\n\nexport type getServiceResponseSuccess = getServiceResponse200 & { headers: Headers };\nexport type getServiceResponseError = (\n | getServiceResponse400\n | getServiceResponse401\n | getServiceResponse403\n) & { headers: Headers };\n\nexport type getServiceResponse = getServiceResponseSuccess | getServiceResponseError;\n\nexport const getGetServiceUrl = (mId: number) => {\n return `/merchant/${mId}`;\n};\n\nexport const getService = async (\n mId: number,\n options?: RequestInit,\n): Promise<getServiceResponse> => {\n return customFetch<getServiceResponse>(getGetServiceUrl(mId), { ...options, method: \"GET\" });\n};\n\nexport const getGetServiceQueryKey = (mId?: number) => {\n return [\"account-server\", \"merchant\", mId] as const;\n};\n\nexport const getGetServiceQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, enabled: !!mId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceQueryError = ErrorType<AsError | void>;\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceQueryOptions(mId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets a specific Merchant\n */\nexport const invalidateGetService = async (\n queryClient: QueryClient,\n mId: number,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetServiceQueryKey(mId) }, options);\n\n return queryClient;\n};\n\nexport const getGetServiceSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceSuspenseQueryOptions(mId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n"],"mappings":";;;;;;;;;;;;;;AAyDA,MAAa,2BAA2B;AACtC,QAAO;;AAGT,MAAa,eAAe,OAAO,YAAyD;AAC1F,QAAO,YAAkC,oBAAoB,EAAE;EAAE,GAAG;EAAS,QAAQ;EAAO,CAAC;;AAG/F,MAAa,gCAAgC;AAC3C,QAAO,CAAC,kBAAkB,WAAW;;AAGvC,MAAa,+BAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMA,WAAoE,EAAE,aAC1E,aAAa;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAE7C,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA4D/C,SAAgB,gBAId,SAIA,aACwE;CACxE,MAAM,eAAe,4BAA4B,QAAQ;CAEzD,MAAM,QAAQ,SAAS,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,yBAAyB,OACpC,aACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,yBAAyB,EAAE,EAAE,QAAQ;AAErF,QAAO;;AAGT,MAAa,uCAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMA,WAAoE,EAAE,aAC1E,aAAa;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAE7C,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAkD/C,SAAgB,wBAId,SAMA,aACgF;CAChF,MAAM,eAAe,oCAAoC,QAAQ;CAEjE,MAAM,QAAQ,iBAAiB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO;;AAyBT,MAAa,oBAAoB,QAAgB;AAC/C,QAAO,aAAa;;AAGtB,MAAa,aAAa,OACxB,KACA,YACgC;AAChC,QAAO,YAAgC,iBAAiB,IAAI,EAAE;EAAE,GAAG;EAAS,QAAQ;EAAO,CAAC;;AAG9F,MAAa,yBAAyB,QAAiB;AACrD,QAAO;EAAC;EAAkB;EAAY;EAAI;;AAG5C,MAAa,6BAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAMC,WAAkE,EAAE,aACxE,WAAW,KAAK;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAEhD,QAAO;EAAE;EAAU;EAAS,SAAS,CAAC,CAAC;EAAK,GAAG;EAAc;;;;;AA+D/D,SAAgB,cAId,KACA,SAIA,aACwE;CACxE,MAAM,eAAe,0BAA0B,KAAK,QAAQ;CAE5D,MAAM,QAAQ,SAAS,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,uBAAuB,OAClC,aACA,KACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,sBAAsB,IAAI,EAAE,EAAE,QAAQ;AAEtF,QAAO;;AAGT,MAAa,qCAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAMA,WAAkE,EAAE,aACxE,WAAW,KAAK;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAEhD,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA+C/C,SAAgB,sBAId,KACA,SAIA,aACgF;CAChF,MAAM,eAAe,kCAAkC,KAAK,QAAQ;CAEpE,MAAM,QAAQ,iBAAiB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO"}
|
|
@@ -10,7 +10,7 @@ import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
|
10
10
|
|
|
11
11
|
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
12
12
|
|
|
13
|
-
* OpenAPI spec version: 4.
|
|
13
|
+
* OpenAPI spec version: 4.5
|
|
14
14
|
*/
|
|
15
15
|
/**
|
|
16
16
|
* Gets Merchants known to the Account Server
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merchant.js","names":["queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>>"],"sources":["../../../src/api/merchant/merchant.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.4\n */\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n InvalidateOptions,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type { AsError, MerchantDetail, MerchantsGetResponse } from \".././api-schemas\";\n\nimport { customInstance } from \"../../custom-axios\";\nimport type { ErrorType } from \"../../custom-axios\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets Merchants known to the Account Server\n\nMerchants are software services (SaaS assets) whose facilities are known to and controlled by the Account Server\n\n * @summary Gets all Merchants\n */\nexport const getMerchants = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<MerchantsGetResponse>({ url: `/merchant`, method: \"GET\", signal }, options);\n};\n\nexport const getGetMerchantsQueryKey = () => {\n return [\"account-server\", \"merchant\"] as const;\n};\n\nexport const getGetMerchantsQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets all Merchants\n */\nexport const invalidateGetMerchants = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetMerchantsQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetMerchantsSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Gets a known Merchant\n\n * @summary Gets a specific Merchant\n */\nexport const getService = (\n mId: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<MerchantDetail>(\n { url: `/merchant/${mId}`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetServiceQueryKey = (mId?: number) => {\n return [\"account-server\", \"merchant\", mId] as const;\n};\n\nexport const getGetServiceQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!mId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceQueryError = ErrorType<AsError | void>;\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceQueryOptions(mId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets a specific Merchant\n */\nexport const invalidateGetService = async (\n queryClient: QueryClient,\n mId: number,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetServiceQueryKey(mId) }, options);\n\n return queryClient;\n};\n\nexport const getGetServiceSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceSuspenseQueryOptions(mId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwCA,MAAa,gBACX,SACA,WACG;AACH,QAAO,eAAqC;EAAE,KAAK;EAAa,QAAQ;EAAO;EAAQ,EAAE,QAAQ;;AAGnG,MAAa,gCAAgC;AAC3C,QAAO,CAAC,kBAAkB,WAAW;;AAGvC,MAAa,+BAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMA,WAAoE,EAAE,aAC1E,aAAa,gBAAgB,OAAO;AAEtC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA4D/C,SAAgB,gBAId,SAIA,aACwE;CACxE,MAAM,eAAe,4BAA4B,QAAQ;CAEzD,MAAM,QAAQ,SAAS,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,yBAAyB,OACpC,aACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,yBAAyB,EAAE,EAAE,QAAQ;AAErF,QAAO;;AAGT,MAAa,uCAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMA,WAAoE,EAAE,aAC1E,aAAa,gBAAgB,OAAO;AAEtC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAkD/C,SAAgB,wBAId,SAMA,aACgF;CAChF,MAAM,eAAe,oCAAoC,QAAQ;CAEjE,MAAM,QAAQ,iBAAiB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;;;AAQT,MAAa,cACX,KACA,SACA,WACG;AACH,QAAO,eACL;EAAE,KAAK,aAAa;EAAO,QAAQ;EAAO;EAAQ,EAClD,QACD;;AAGH,MAAa,yBAAyB,QAAiB;AACrD,QAAO;EAAC;EAAkB;EAAY;EAAI;;AAG5C,MAAa,6BAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAMC,WAAkE,EAAE,aACxE,WAAW,KAAK,gBAAgB,OAAO;AAEzC,QAAO;EAAE;EAAU;EAAS,SAAS,CAAC,CAAC;EAAK,GAAG;EAAc;;;;;AA+D/D,SAAgB,cAId,KACA,SAIA,aACwE;CACxE,MAAM,eAAe,0BAA0B,KAAK,QAAQ;CAE5D,MAAM,QAAQ,SAAS,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,uBAAuB,OAClC,aACA,KACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,sBAAsB,IAAI,EAAE,EAAE,QAAQ;AAEtF,QAAO;;AAGT,MAAa,qCAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAMA,WAAkE,EAAE,aACxE,WAAW,KAAK,gBAAgB,OAAO;AAEzC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA+C/C,SAAgB,sBAId,KACA,SAIA,aACgF;CAChF,MAAM,eAAe,kCAAkC,KAAK,QAAQ;CAEpE,MAAM,QAAQ,iBAAiB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO"}
|
|
1
|
+
{"version":3,"file":"merchant.js","names":["queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>>","queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>>"],"sources":["../../../src/api/merchant/merchant.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.5\n */\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n InvalidateOptions,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type { AsError, MerchantDetail, MerchantsGetResponse } from \".././api-schemas\";\n\nimport { customInstance } from \"../../custom-axios\";\nimport type { ErrorType } from \"../../custom-axios\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets Merchants known to the Account Server\n\nMerchants are software services (SaaS assets) whose facilities are known to and controlled by the Account Server\n\n * @summary Gets all Merchants\n */\nexport const getMerchants = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<MerchantsGetResponse>({ url: `/merchant`, method: \"GET\", signal }, options);\n};\n\nexport const getGetMerchantsQueryKey = () => {\n return [\"account-server\", \"merchant\"] as const;\n};\n\nexport const getGetMerchantsQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n Awaited<ReturnType<typeof getMerchants>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchants<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets all Merchants\n */\nexport const invalidateGetMerchants = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetMerchantsQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetMerchantsSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) =>\n getMerchants(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetMerchantsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;\nexport type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets all Merchants\n */\n\nexport function useGetMerchantsSuspense<\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetMerchantsSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Gets a known Merchant\n\n * @summary Gets a specific Merchant\n */\nexport const getService = (\n mId: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<MerchantDetail>(\n { url: `/merchant/${mId}`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetServiceQueryKey = (mId?: number) => {\n return [\"account-server\", \"merchant\", mId] as const;\n};\n\nexport const getGetServiceQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!mId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceQueryError = ErrorType<AsError | void>;\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n Awaited<ReturnType<typeof getService>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetService<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceQueryOptions(mId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets a specific Merchant\n */\nexport const invalidateGetService = async (\n queryClient: QueryClient,\n mId: number,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetServiceQueryKey(mId) }, options);\n\n return queryClient;\n};\n\nexport const getGetServiceSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) =>\n getService(mId, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetServiceSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;\nexport type GetServiceSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options: {\n query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets a specific Merchant\n */\n\nexport function useGetServiceSuspense<\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>,\n>(\n mId: number,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetServiceSuspenseQueryOptions(mId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwCA,MAAa,gBACX,SACA,WACG;AACH,QAAO,eAAqC;EAAE,KAAK;EAAa,QAAQ;EAAO;EAAQ,EAAE,QAAQ;;AAGnG,MAAa,gCAAgC;AAC3C,QAAO,CAAC,kBAAkB,WAAW;;AAGvC,MAAa,+BAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMA,WAAoE,EAAE,aAC1E,aAAa,gBAAgB,OAAO;AAEtC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA4D/C,SAAgB,gBAId,SAIA,aACwE;CACxE,MAAM,eAAe,4BAA4B,QAAQ;CAEzD,MAAM,QAAQ,SAAS,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,yBAAyB,OACpC,aACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,yBAAyB,EAAE,EAAE,QAAQ;AAErF,QAAO;;AAGT,MAAa,uCAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,yBAAyB;CAEpE,MAAMA,WAAoE,EAAE,aAC1E,aAAa,gBAAgB,OAAO;AAEtC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAkD/C,SAAgB,wBAId,SAMA,aACgF;CAChF,MAAM,eAAe,oCAAoC,QAAQ;CAEjE,MAAM,QAAQ,iBAAiB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;;;AAQT,MAAa,cACX,KACA,SACA,WACG;AACH,QAAO,eACL;EAAE,KAAK,aAAa;EAAO,QAAQ;EAAO;EAAQ,EAClD,QACD;;AAGH,MAAa,yBAAyB,QAAiB;AACrD,QAAO;EAAC;EAAkB;EAAY;EAAI;;AAG5C,MAAa,6BAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAMC,WAAkE,EAAE,aACxE,WAAW,KAAK,gBAAgB,OAAO;AAEzC,QAAO;EAAE;EAAU;EAAS,SAAS,CAAC,CAAC;EAAK,GAAG;EAAc;;;;;AA+D/D,SAAgB,cAId,KACA,SAIA,aACwE;CACxE,MAAM,eAAe,0BAA0B,KAAK,QAAQ;CAE5D,MAAM,QAAQ,SAAS,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,uBAAuB,OAClC,aACA,KACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,sBAAsB,IAAI,EAAE,EAAE,QAAQ;AAEtF,QAAO;;AAGT,MAAa,qCAIX,KACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,sBAAsB,IAAI;CAErE,MAAMA,WAAkE,EAAE,aACxE,WAAW,KAAK,gBAAgB,OAAO;AAEzC,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AA+C/C,SAAgB,sBAId,KACA,SAIA,aACgF;CAChF,MAAM,eAAe,kCAAkC,KAAK,QAAQ;CAEpE,MAAM,QAAQ,iBAAiB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO"}
|
|
@@ -11,7 +11,7 @@ let __tanstack_react_query = require("@tanstack/react-query");
|
|
|
11
11
|
|
|
12
12
|
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
13
13
|
|
|
14
|
-
* OpenAPI spec version: 4.
|
|
14
|
+
* OpenAPI spec version: 4.5
|
|
15
15
|
*/
|
|
16
16
|
/**
|
|
17
17
|
* Gets all the Organisations that you are a member of, or a specific Organisation by name.
|