@accounter/server
Version:
Accounter GraphQL server
1,241 lines • 33.8 kB
JavaScript
import { gql } from '@graphql-mesh/utils';
import { handleImport } from '@graphql-mesh/utils';
import { PubSub } from '@graphql-mesh/utils';
import { DefaultLogger } from '@graphql-mesh/utils';
import { createMeshHTTPHandler } from '@graphql-mesh/http';
import { getMesh } from '@graphql-mesh/runtime';
import { MeshStore, FsStoreStorageAdapter } from '@graphql-mesh/store';
import { path as pathModule } from '@graphql-mesh/cross-helpers';
const baseDir = pathModule.join(typeof __dirname === 'string' ? __dirname : '/', '..');
const importFn = (moduleId) => {
const relativeModuleId = (pathModule.isAbsolute(moduleId) ? pathModule.relative(baseDir, moduleId) : moduleId).split('\\').join('/').replace(baseDir + '/', '');
switch (relativeModuleId) {
case "mesh-artifacts/sources/GreenInvoiceNew/schemaWithAnnotations.js":
return import("./sources/GreenInvoiceNew/schemaWithAnnotations.js");
case "mesh-artifacts/sources/GreenInvoice/schemaWithAnnotations.js":
return import("./sources/GreenInvoice/schemaWithAnnotations.js");
default:
return Promise.reject(new Error(`Cannot find module '${relativeModuleId}'.`));
}
};
const rootStore = new MeshStore('mesh-artifacts', new FsStoreStorageAdapter({
cwd: baseDir,
importFn,
fileType: "js",
}), {
readonly: true,
validate: false
});
export const rawServeConfig = { "browser": false };
export async function getMeshOptions() {
const pubsub = new PubSub();
const sourcesStore = rootStore.child('sources');
const logger = new DefaultLogger("");
const MeshCache = await import("@graphql-mesh/cache-localforage").then(handleImport);
const cache = new MeshCache({
...{},
importFn,
store: rootStore.child('cache'),
pubsub,
logger,
});
const fetchFn = await import('@whatwg-node/fetch').then(m => m?.fetch || m);
const sources = [];
const transforms = [];
const additionalEnvelopPlugins = [];
const greenInvoiceTransforms = [];
const greenInvoiceNewTransforms = [];
const additionalTypeDefs = [];
const GreenInvoiceHandler = await import("@graphql-mesh/json-schema").then(handleImport);
const greenInvoiceHandler = new GreenInvoiceHandler({
name: "GreenInvoice",
config: { "endpoint": "https://api.greeninvoice.co.il/api/v1", "operationHeaders": { "Authorization": "Bearer {context.authToken}", "Content-Type": "application/json" }, "operations": [{ "type": "Query", "field": "getDocument", "path": "/documents/{args.id}", "method": "GET", "argTypeMap": { "id": { "type": "string", "nullable": false } }, "responseSchema": "../json-schemas/greenInvoice.json#/$defs/getDocumentResponse" }, { "type": "Query", "field": "searchDocuments", "path": "/documents/search", "method": "POST", "requestSchema": "../json-schemas/greenInvoice.json#/$defs/searchDocumentsRequest", "responseSchema": "../json-schemas/greenInvoice.json#/$defs/searchDocumentsResponse" }, { "type": "Query", "field": "previewDocument", "path": "/documents/preview", "method": "POST", "requestSchema": "../json-schemas/greenInvoice.json#/$defs/previewDocumentRequest", "responseSchema": "../json-schemas/greenInvoice.json#/$defs/previewDocumentResponse" }, { "type": "Query", "field": "getLinkedDocuments", "path": "/documents/{args.id}/linked", "method": "GET", "argTypeMap": { "id": { "type": "string", "nullable": false } }, "responseSchema": "../json-schemas/greenInvoice.json#/$defs/getLinkedDocumentsResponse" }, { "type": "Query", "field": "getDocumentsDownloadLinks", "path": "/documents/{args.id}/download/links", "method": "GET", "argTypeMap": { "id": { "type": "string", "nullable": false } }, "responseSchema": "../json-schemas/greenInvoice.json#/$defs/getDocumentsDownloadLinksResponse" }, { "type": "Mutation", "field": "addDocument", "path": "/documents", "method": "POST", "requestSchema": "../json-schemas/greenInvoice.json#/$defs/addDocumentRequest", "responseSchema": "../json-schemas/greenInvoice.json#/$defs/addDocumentResponse" }, { "type": "Mutation", "field": "closeDocument", "path": "/documents/{args.id}/close", "method": "POST", "argTypeMap": { "id": { "type": "string", "nullable": false } }, "responseByStatusCode": { "200": { "responseSchema": "../json-schemas/greenInvoice.json#/$defs/closeDocumentResponse" } } }, { "type": "Query", "field": "getExpense", "path": "/expenses/{args.id}", "method": "GET", "argTypeMap": { "id": { "type": "string", "nullable": false } }, "responseSchema": "../json-schemas/greenInvoice.json#/$defs/getExpenseResponse" }, { "type": "Query", "field": "searchExpenses", "path": "/expenses/search", "method": "POST", "requestSchema": "../json-schemas/greenInvoice.json#/$defs/searchExpensesRequest", "responseSchema": "../json-schemas/greenInvoice.json#/$defs/searchExpensesResponse" }, { "type": "Mutation", "field": "addExpense", "path": "/expenses", "method": "POST", "requestSchema": "../json-schemas/greenInvoice.json#/$defs/addExpenseRequest", "responseSchema": "../json-schemas/greenInvoice.json#/$defs/addExpenseResponse" }, { "type": "Mutation", "field": "updateExpense", "path": "/expenses/{args.id}", "method": "PUT", "requestSchema": "../json-schemas/greenInvoice.json#/$defs/updateExpenseRequest", "responseSchema": "../json-schemas/greenInvoice.json#/$defs/updateExpenseResponse" }, { "type": "Query", "field": "searchExpenseDrafts", "path": "/expenses/drafts/search", "method": "POST", "requestSchema": "../json-schemas/greenInvoice.json#/$defs/searchExpenseDraftsRequest", "responseByStatusCode": { "200": { "responseSchema": "../json-schemas/greenInvoice.json#/$defs/searchExpenseDraftsResponse" }, "201": { "responseSchema": "../json-schemas/greenInvoice.json#/$defs/searchExpenseDraftsResponse" }, "404": { "responseSchema": "../json-schemas/greenInvoice.json#/$defs/generalErrorResponse" } } }, { "type": "Mutation", "field": "addExpenseDraftByFile", "path": "/expenses/file", "method": "POST", "requestSchema": "../json-schemas/greenInvoice.json#/$defs/addExpenseDraftByFileRequest", "responseByStatusCode": { "200": { "responseSchema": "../json-schemas/greenInvoice.json#/$defs/addExpenseDraftByFileResponse" }, "201": { "responseSchema": "../json-schemas/greenInvoice.json#/$defs/addExpenseDraftByFileResponse" }, "400": { "responseSchema": "../json-schemas/greenInvoice.json#/$defs/generalErrorResponse" }, "404": { "responseSchema": "../json-schemas/greenInvoice.json#/$defs/generalErrorResponse" }, "405": { "responseSchema": "../json-schemas/greenInvoice.json#/$defs/generalErrorResponse" } } }, { "type": "Query", "field": "getClient", "path": "/clients/{args.id}", "method": "GET", "argTypeMap": { "id": { "type": "string", "nullable": false } }, "responseSchema": "../json-schemas/greenInvoice.json#/$defs/getClientResponse" }, { "type": "Mutation", "field": "addClient", "path": "/clients", "method": "POST", "requestSchema": "../json-schemas/greenInvoice.json#/$defs/addClientRequest", "responseSchema": "../json-schemas/greenInvoice.json#/$defs/addClientResponse" }, { "type": "Mutation", "field": "updateClient", "path": "/clients/{args.id}", "method": "PUT", "argTypeMap": { "id": { "type": "string", "nullable": false } }, "requestSchema": "../json-schemas/greenInvoice.json#/$defs/updateClientRequest", "responseSchema": "../json-schemas/greenInvoice.json#/$defs/updateClientResponse" }, { "type": "Mutation", "field": "deleteClient", "path": "/clients/{args.id}", "method": "DELETE", "argTypeMap": { "id": { "type": "string", "nullable": false } }, "responseSchema": "../json-schemas/greenInvoice.json#/$defs/deleteClientResponse" }] },
baseDir,
cache,
pubsub,
store: sourcesStore.child("GreenInvoice"),
logger: logger.child({ source: "GreenInvoice" }),
importFn,
});
const GreenInvoiceNewHandler = await import("@graphql-mesh/json-schema").then(handleImport);
const greenInvoiceNewHandler = new GreenInvoiceNewHandler({
name: "GreenInvoiceNew",
config: { "endpoint": "https://apigw.greeninvoice.co.il", "operationHeaders": { "Authorization": "Bearer {context.authToken}", "Content-Type": "application/json" }, "operations": [{ "type": "Query", "field": "getFileUploadUrl", "path": "/file-upload/v1/url", "method": "GET", "argTypeMap": { "context": { "type": "string" }, "data": { "type": "object", "properties": { "source": { "type": "integer" }, "id": { "type": "string" }, "state": { "type": "string" } }, "required": ["source"] } }, "queryStringOptions": { "jsonStringify": true }, "queryParamArgMap": { "context": "context", "data": "data" }, "responseSchema": "../json-schemas/greenInvoice.json#/$defs/getFileUploadUrlResponse" }, { "type": "Query", "field": "getBankTransactions", "path": "/open-banking/v2/transactions", "method": "GET", "argTypeMap": { "valueDate": { "type": "object", "properties": { "from": { "type": "string" }, "to": { "type": "string" } }, "required": ["from", "to"] }, "from": { "type": "number" }, "size": { "type": "number" }, "bookingStatus": { "type": "string" } }, "queryStringOptions": { "indices": true, "arrayFormat": "brackets" }, "queryParamArgMap": { "valueDate": "valueDate", "from": "from", "size": "size", "bookingStatus": "bookingStatus" }, "responseSchema": "../json-schemas/greenInvoice.json#/$defs/getBankTransactionsResponse" }] },
baseDir,
cache,
pubsub,
store: sourcesStore.child("GreenInvoiceNew"),
logger: logger.child({ source: "GreenInvoiceNew" }),
importFn,
});
sources[0] = {
name: 'GreenInvoice',
handler: greenInvoiceHandler,
transforms: greenInvoiceTransforms
};
sources[1] = {
name: 'GreenInvoiceNew',
handler: greenInvoiceNewHandler,
transforms: greenInvoiceNewTransforms
};
const additionalResolvers = [];
const Merger = await import("@graphql-mesh/merger-stitching").then(handleImport);
const merger = new Merger({
cache,
pubsub,
logger: logger.child({ merger: "stitching" }),
store: rootStore.child("stitching")
});
return {
sources,
transforms,
additionalTypeDefs,
additionalResolvers,
cache,
pubsub,
merger,
logger,
additionalEnvelopPlugins,
get documents() {
return [];
},
fetchFn,
};
}
export function createBuiltMeshHTTPHandler() {
return createMeshHTTPHandler({
baseDir,
getBuiltMesh: getBuiltMesh,
rawServeConfig: { "browser": false },
});
}
let meshInstance$;
export const pollingInterval = null;
export function getBuiltMesh() {
if (meshInstance$ == null) {
if (pollingInterval) {
setInterval(() => {
getMeshOptions()
.then(meshOptions => getMesh(meshOptions))
.then(newMesh => meshInstance$.then(oldMesh => {
oldMesh.destroy();
meshInstance$ = Promise.resolve(newMesh);
})).catch(err => {
console.error("Mesh polling failed so the existing version will be used:", err);
});
}, pollingInterval);
}
meshInstance$ = getMeshOptions().then(meshOptions => getMesh(meshOptions)).then(mesh => {
const id = mesh.pubsub.subscribe('destroy', () => {
meshInstance$ = undefined;
mesh.pubsub.unsubscribe(id);
});
return mesh;
}).catch((err) => {
meshInstance$ = undefined;
return Promise.reject(err);
});
}
return meshInstance$;
}
export const execute = (...args) => getBuiltMesh().then(({ execute }) => execute(...args));
export const subscribe = (...args) => getBuiltMesh().then(({ subscribe }) => subscribe(...args));
export function getMeshSDK(globalContext) {
const sdkRequester$ = getBuiltMesh().then(({ sdkRequesterFactory }) => sdkRequesterFactory(globalContext));
return getSdk((...args) => sdkRequester$.then(sdkRequester => sdkRequester(...args)));
}
export const getDocument_queryDocument = gql `
query getDocument_query($id: String!) {
getDocument(id: $id) {
amount
amountDueVat
amountDueVatLocal
amountExcludeVat
amountExemptVat
amountLocal
amountOpened
business {
accountantDocsEmailSettings
accountantEmails
accountantReportEmailSettings
accountingType
active
advanceNationalInsuranceRate
advanceTaxRate
bankDisplay
bankDisplayEn
deductionRate
documentsEmailSettings
emailSubjectType
exemption
incomeReportEmailSettings
incomeReportFormatType
reportSendingDay
senderEmailSettings
type
}
calculatedAmountLocal
calculatedAmountOpenedLocal
calculatedIncomeAmountExcludeLocal
calculatedIncomeAmountLocal
calculatedPaymentAmountLocal
cancellable
cancelType
client {
country
emails
id
name
phone
taxId
self
address
city
zip
fax
mobile
add
JSON
}
creationDate
currency
currencyRate
data {
tags
}
description
documentDate
downloaded
footer
id
income {
amount
amountTotal
catalogNum
currency
currencyRate
description
itemId
price
quantity
vat
vatRate
vatType
}
lang
linkedDocuments {
amount
currency
currencyRate
documentDate
id
number
reverseCharge
type
}
number
payment {
currency
currencyRate
date
price
type
subType
bankName
bankBranch
bankAccount
chequeNum
accountId
transactionId
appType
cardType
cardNum
dealType
numPayments
firstPayment
}
ref
remarks
reverseCharge
rounding
signed
skinId
status
taxConfirmationEligible
templateId
type
url {
he
en
origin
}
userName
vat
vatLocal
vatRate
vatType
}
}
`;
export const searchDocuments_queryDocument = gql `
query searchDocuments_query($input: _DOLLAR_defs_searchDocumentsRequest_Input) {
searchDocuments(input: $input) {
total
page
pageSize
pages
from
to
items {
amount
amountDueVat
amountDueVatLocal
amountExcludeVat
amountExemptVat
amountLocal
amountOpened
business {
accountantDocsEmailSettings
accountantEmails
accountantReportEmailSettings
accountingType
active
advanceNationalInsuranceRate
advanceTaxRate
bankDisplay
bankDisplayEn
deductionRate
documentsEmailSettings
emailSubjectType
exemption
incomeReportEmailSettings
incomeReportFormatType
reportSendingDay
senderEmailSettings
type
}
calculatedAmountLocal
calculatedAmountOpenedLocal
calculatedIncomeAmountExcludeLocal
calculatedIncomeAmountLocal
calculatedPaymentAmountLocal
cancellable
cancelType
client {
country
emails
id
name
phone
taxId
self
address
city
zip
fax
mobile
add
JSON
}
creationDate
currency
currencyRate
data {
tags
}
description
documentDate
downloaded
footer
id
income {
amount
amountTotal
catalogNum
currency
currencyRate
description
itemId
price
quantity
vat
vatRate
vatType
}
lang
linkedDocuments {
amount
currency
currencyRate
documentDate
id
number
reverseCharge
type
}
number
payment {
currency
currencyRate
date
price
type
subType
bankName
bankBranch
bankAccount
chequeNum
accountId
transactionId
appType
cardType
cardNum
dealType
numPayments
firstPayment
}
ref
remarks
reverseCharge
rounding
signed
skinId
status
taxConfirmationEligible
templateId
type
url {
he
en
origin
}
userName
vat
vatLocal
vatRate
vatType
}
}
}
`;
export const previewDocument_queryDocument = gql `
query previewDocument_query($input: _DOLLAR_defs_DocumentInputNew_Input) {
previewDocument(input: $input) {
... on query_previewDocument_oneOf_0 {
file
}
... on _DOLLAR_defs_ErrorResponse {
errorCode
errorMessage
}
}
}
`;
export const getLinkedDocuments_queryDocument = gql `
query getLinkedDocuments_query($id: String!) {
getLinkedDocuments(id: $id) {
amount
currency
currencyRate
documentDate
id
number
status
type
}
}
`;
export const getDocumentsDownloadLinks_queryDocument = gql `
query getDocumentsDownloadLinks_query($id: String!) {
getDocumentsDownloadLinks(id: $id) {
he
en
origin
}
}
`;
export const getExpense_queryDocument = gql `
query getExpense_query($id: String!) {
getExpense(id: $id) {
amountExcludeVat
id
businessType
documentType
status
paymentType
currency
currencyRate
vat
amount
date
dueDate
number
active
description
remarks
supplier {
phone
mobile
emails
fax
contactPerson
address
city
zip
country
bankName
bankBranch
bankAccount
id
name
active
taxId
paymentTerms
labels
creationDate
lastUpdateDate
department
accountingKey
remarks
incomeAmount
paymentAmount
balanceAmount
}
thumbnail
url
cancellable
reportingDate
accountingClassification {
id
key
code
title
irsCode
income
type
vat
}
amountLocal
amountAccounting
vatAccounting
creationDate
lastUpdateDate
}
}
`;
export const searchExpenses_queryDocument = gql `
query searchExpenses_query($input: _DOLLAR_defs_searchExpensesRequest_Input) {
searchExpenses(input: $input) {
total
page
pageSize
pages
from
to
items {
amountExcludeVat
id
businessType
documentType
status
paymentType
currency
currencyRate
vat
amount
date
dueDate
number
active
description
remarks
supplier {
phone
mobile
emails
fax
contactPerson
address
city
zip
country
bankName
bankBranch
bankAccount
id
name
active
taxId
paymentTerms
labels
creationDate
lastUpdateDate
department
accountingKey
remarks
incomeAmount
paymentAmount
balanceAmount
}
thumbnail
url
cancellable
reportingDate
accountingClassification {
id
key
code
title
irsCode
income
type
vat
}
amountLocal
amountAccounting
vatAccounting
creationDate
lastUpdateDate
}
}
}
`;
export const searchExpenseDrafts_queryDocument = gql `
query searchExpenseDrafts_query($input: _DOLLAR_defs_searchExpenseDraftsRequest_Input) {
searchExpenseDrafts(input: $input) {
... on searchExpenseDrafts_200_response {
total
page
pageSize
pages
from
to
aggregations {
totalAmount {
value
}
}
items {
id
status
creationDate
lastUpdateDate
reportingPeriod
hasDefaultValues
url
thumbnail
expense {
accountingClassification {
id
key
code
title
irsCode
income
type
vat
}
active
addRecipient
amount
confirmFromEdit
currency
currencyRate
date
description
documentType
fileHash
fileKey
labels
number
paymentType {
... on Boolean_container {
Boolean
}
... on query_searchExpenseDrafts_oneOf_0_allOf_1_items_items_expense_paymentType_oneOf_1_container {
query_searchExpenseDrafts_oneOf_0_allOf_1_items_items_expense_paymentType_oneOf_1
}
}
reportingDate
supplier {
phone
mobile
emails
fax
contactPerson
address
city
zip
country
bankName
bankBranch
bankAccount
id
name
active
taxId
paymentTerms
labels
creationDate
lastUpdateDate
department
accountingKey
remarks
incomeAmount
paymentAmount
balanceAmount
}
tags
texts
vat
}
}
}
... on searchExpenseDrafts_404_response {
errorCode
errorMessage
}
}
}
`;
export const getClient_queryDocument = gql `
query getClient_query($id: String!) {
getClient(id: $id) {
phone
mobile
emails
fax
contactPerson
address
city
zip
country
bankName
bankBranch
bankAccount
id
name
active
taxId
paymentTerms
labels
creationDate
lastUpdateDate
send
department
accountingKey
category
subCategory
remarks
incomeAmount
paymentAmount
balanceAmount
}
}
`;
export const getFileUploadUrl_queryDocument = gql `
query getFileUploadUrl_query($context: String, $data: queryInput_getFileUploadUrl_data_Input) {
getFileUploadUrl(context: $context, data: $data) {
url
fields {
otherField
bucket
key
Policy
x_amz_meta_account_id
x_amz_meta_user_id
x_amz_meta_business_id
x_amz_meta_file_context
x_amz_meta_file_data
X_Amz_Algorithm
X_Amz_Credential
X_Amz_Date
X_Amz_Security_Token
X_Amz_Signature
}
}
}
`;
export const getBankTransactions_queryDocument = gql `
query getBankTransactions_query($valueDate: queryInput_getBankTransactions_valueDate_Input, $from: Float, $size: Float, $bookingStatus: String) {
getBankTransactions(
valueDate: $valueDate
from: $from
size: $size
bookingStatus: $bookingStatus
) {
size
total
pages
page
from
to
aggregations
results {
id
aspspCode
businessId
createdAt
updatedAt
status
classification
bookingStatus
source
amount
resourceId
creditorName
creditorAccount
currency
valueDate
bookingDate
checkId
description
debtorName
debtorAccount
type
name
date
iban
}
}
}
`;
export const addDocument_mutationDocument = gql `
mutation addDocument_mutation($input: _DOLLAR_defs_addDocumentRequest_Input) {
addDocument(input: $input) {
... on _DOLLAR_defs_AddedDocument {
id
lang
number
signed
url {
he
en
origin
}
}
... on _DOLLAR_defs_ErrorResponse {
errorCode
errorMessage
}
}
}
`;
export const closeDocument_mutationDocument = gql `
mutation closeDocument_mutation($id: String!) {
closeDocument(id: $id)
}
`;
export const addExpense_mutationDocument = gql `
mutation addExpense_mutation($input: JSON) {
addExpense(input: $input) {
... on _DOLLAR_defs_Expense {
paymentType {
... on Boolean_container {
Boolean
}
... on mutation_addExpense_oneOf_0_allOf_0_paymentType_oneOf_1_container {
mutation_addExpense_oneOf_0_allOf_0_paymentType_oneOf_1
}
}
currency
currencyRate
vat
amount
date
dueDate
reportingDate
documentType
number
description
remarks
supplier {
phone
mobile
emails
fax
contactPerson
address
city
zip
country
bankName
bankBranch
bankAccount
id
name
active
taxId
paymentTerms
labels
creationDate
lastUpdateDate
department
accountingKey
remarks
incomeAmount
paymentAmount
balanceAmount
}
accountingClassification {
id
key
code
title
irsCode
income
type
vat
}
active
addRecipient
addAccountingClassification
JSON
}
... on _DOLLAR_defs_ErrorResponse {
errorCode
errorMessage
}
}
}
`;
export const updateExpense_mutationDocument = gql `
mutation updateExpense_mutation($id: String, $input: _DOLLAR_defs_updateExpenseRequest_Input) {
updateExpense(id: $id, input: $input) {
... on _DOLLAR_defs_GetExpense {
amountExcludeVat
id
businessType
documentType
status
paymentType
currency
currencyRate
vat
amount
date
dueDate
number
active
description
remarks
supplier {
phone
mobile
emails
fax
contactPerson
address
city
zip
country
bankName
bankBranch
bankAccount
id
name
active
taxId
paymentTerms
labels
creationDate
lastUpdateDate
department
accountingKey
remarks
incomeAmount
paymentAmount
balanceAmount
}
thumbnail
url
cancellable
reportingDate
accountingClassification {
id
key
code
title
irsCode
income
type
vat
}
amountLocal
amountAccounting
vatAccounting
creationDate
lastUpdateDate
}
... on _DOLLAR_defs_ErrorResponse {
errorCode
errorMessage
}
}
}
`;
export const addExpenseDraftByFile_mutationDocument = gql `
mutation addExpenseDraftByFile_mutation($input: _DOLLAR_defs_addExpenseDraftByFileRequest_Input) {
addExpenseDraftByFile(input: $input) {
... on addExpenseDraftByFile_200_response {
id
status
creationDate
lastUpdateDate
expense {
paymentType {
... on Boolean_container {
Boolean
}
... on mutation_addExpense_oneOf_0_allOf_0_paymentType_oneOf_1_container {
mutation_addExpense_oneOf_0_allOf_0_paymentType_oneOf_1
}
}
currency
currencyRate
vat
amount
date
dueDate
reportingDate
documentType
number
description
remarks
supplier {
phone
mobile
emails
fax
contactPerson
address
city
zip
country
bankName
bankBranch
bankAccount
id
name
active
taxId
paymentTerms
labels
creationDate
lastUpdateDate
department
accountingKey
remarks
incomeAmount
paymentAmount
balanceAmount
}
accountingClassification {
id
key
code
title
irsCode
income
type
vat
}
active
addRecipient
addAccountingClassification
}
thumbnail
url
}
... on searchExpenseDrafts_404_response {
errorCode
errorMessage
}
}
}
`;
export const addClient_mutationDocument = gql `
mutation addClient_mutation($input: _DOLLAR_defs_addClientRequest_Input) {
addClient(input: $input) {
... on _DOLLAR_defs_getClientResponse {
phone
mobile
emails
fax
contactPerson
address
city
zip
country
bankName
bankBranch
bankAccount
id
name
active
taxId
paymentTerms
labels
creationDate
lastUpdateDate
send
department
accountingKey
category
subCategory
remarks
incomeAmount
paymentAmount
balanceAmount
}
... on _DOLLAR_defs_ErrorResponse {
errorCode
errorMessage
}
}
}
`;
export const updateClient_mutationDocument = gql `
mutation updateClient_mutation($id: String!, $input: _DOLLAR_defs_updateClientRequest_Input) {
updateClient(id: $id, input: $input) {
... on _DOLLAR_defs_getClientResponse {
phone
mobile
emails
fax
contactPerson
address
city
zip
country
bankName
bankBranch
bankAccount
id
name
active
taxId
paymentTerms
labels
creationDate
lastUpdateDate
send
department
accountingKey
category
subCategory
remarks
incomeAmount
paymentAmount
balanceAmount
}
... on _DOLLAR_defs_ErrorResponse {
errorCode
errorMessage
}
}
}
`;
export const deleteClient_mutationDocument = gql `
mutation deleteClient_mutation($id: String!) {
deleteClient(id: $id) {
... on _DOLLAR_defs_getClientResponse {
phone
mobile
emails
fax
contactPerson
address
city
zip
country
bankName
bankBranch
bankAccount
id
name
active
taxId
paymentTerms
labels
creationDate
lastUpdateDate
send
department
accountingKey
category
subCategory
remarks
incomeAmount
paymentAmount
balanceAmount
}
... on _DOLLAR_defs_ErrorResponse {
errorCode
errorMessage
}
}
}
`;
export function getSdk(requester) {
return {
getDocument_query(variables, options) {
return requester(getDocument_queryDocument, variables, options);
},
searchDocuments_query(variables, options) {
return requester(searchDocuments_queryDocument, variables, options);
},
previewDocument_query(variables, options) {
return requester(previewDocument_queryDocument, variables, options);
},
getLinkedDocuments_query(variables, options) {
return requester(getLinkedDocuments_queryDocument, variables, options);
},
getDocumentsDownloadLinks_query(variables, options) {
return requester(getDocumentsDownloadLinks_queryDocument, variables, options);
},
getExpense_query(variables, options) {
return requester(getExpense_queryDocument, variables, options);
},
searchExpenses_query(variables, options) {
return requester(searchExpenses_queryDocument, variables, options);
},
searchExpenseDrafts_query(variables, options) {
return requester(searchExpenseDrafts_queryDocument, variables, options);
},
getClient_query(variables, options) {
return requester(getClient_queryDocument, variables, options);
},
getFileUploadUrl_query(variables, options) {
return requester(getFileUploadUrl_queryDocument, variables, options);
},
getBankTransactions_query(variables, options) {
return requester(getBankTransactions_queryDocument, variables, options);
},
addDocument_mutation(variables, options) {
return requester(addDocument_mutationDocument, variables, options);
},
closeDocument_mutation(variables, options) {
return requester(closeDocument_mutationDocument, variables, options);
},
addExpense_mutation(variables, options) {
return requester(addExpense_mutationDocument, variables, options);
},
updateExpense_mutation(variables, options) {
return requester(updateExpense_mutationDocument, variables, options);
},
addExpenseDraftByFile_mutation(variables, options) {
return requester(addExpenseDraftByFile_mutationDocument, variables, options);
},
addClient_mutation(variables, options) {
return requester(addClient_mutationDocument, variables, options);
},
updateClient_mutation(variables, options) {
return requester(updateClient_mutationDocument, variables, options);
},
deleteClient_mutation(variables, options) {
return requester(deleteClient_mutationDocument, variables, options);
}
};
}
//# sourceMappingURL=index.js.map