@things-factory/integration-accounting 5.0.2 → 5.0.14

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.
Files changed (93) hide show
  1. package/dist-server/controllers/accounting-api/decorators.js +2 -4
  2. package/dist-server/controllers/accounting-api/decorators.js.map +1 -1
  3. package/dist-server/controllers/accounting-api/index.js +53 -61
  4. package/dist-server/controllers/accounting-api/index.js.map +1 -1
  5. package/dist-server/controllers/index.js +2 -15
  6. package/dist-server/controllers/index.js.map +1 -1
  7. package/dist-server/controllers/xero/apis/contact/get-contact.js.map +1 -1
  8. package/dist-server/controllers/xero/apis/contact/get-contacts.js.map +1 -1
  9. package/dist-server/controllers/xero/apis/contact/index.js +3 -16
  10. package/dist-server/controllers/xero/apis/contact/index.js.map +1 -1
  11. package/dist-server/controllers/xero/apis/index.js +5 -18
  12. package/dist-server/controllers/xero/apis/index.js.map +1 -1
  13. package/dist-server/controllers/xero/apis/invoice/create-invoice.js.map +1 -1
  14. package/dist-server/controllers/xero/apis/invoice/get-invoice.js.map +1 -1
  15. package/dist-server/controllers/xero/apis/invoice/get-invoices.js.map +1 -1
  16. package/dist-server/controllers/xero/apis/invoice/index.js +5 -18
  17. package/dist-server/controllers/xero/apis/invoice/index.js.map +1 -1
  18. package/dist-server/controllers/xero/apis/invoice/update-invoice.js.map +1 -1
  19. package/dist-server/controllers/xero/apis/item/create-item.js.map +1 -1
  20. package/dist-server/controllers/xero/apis/item/delete-item.js.map +1 -1
  21. package/dist-server/controllers/xero/apis/item/get-item.js.map +1 -1
  22. package/dist-server/controllers/xero/apis/item/get-items.js.map +1 -1
  23. package/dist-server/controllers/xero/apis/item/index.js +7 -20
  24. package/dist-server/controllers/xero/apis/item/index.js.map +1 -1
  25. package/dist-server/controllers/xero/apis/item/update-item.js.map +1 -1
  26. package/dist-server/controllers/xero/apis/item/update-items.js.map +1 -1
  27. package/dist-server/controllers/xero/apis/purchase-order/get-purchase-orders.js.map +1 -1
  28. package/dist-server/controllers/xero/apis/purchase-order/index.js +2 -15
  29. package/dist-server/controllers/xero/apis/purchase-order/index.js.map +1 -1
  30. package/dist-server/controllers/xero/index.js +3 -28
  31. package/dist-server/controllers/xero/index.js.map +1 -1
  32. package/dist-server/controllers/xero/platform-action.js.map +1 -1
  33. package/dist-server/controllers/xero/xero.js +2 -4
  34. package/dist-server/controllers/xero/xero.js.map +1 -1
  35. package/dist-server/engine/connector/accounting-connector.js.map +1 -1
  36. package/dist-server/engine/connector/index.js.map +1 -1
  37. package/dist-server/engine/index.js.map +1 -1
  38. package/dist-server/engine/task/accounting-api.js.map +1 -1
  39. package/dist-server/engine/task/index.js.map +1 -1
  40. package/dist-server/entities/account.js +40 -48
  41. package/dist-server/entities/account.js.map +1 -1
  42. package/dist-server/entities/index.js.map +1 -1
  43. package/dist-server/graphql/index.js +3 -25
  44. package/dist-server/graphql/index.js.map +1 -1
  45. package/dist-server/graphql/resolvers/accounting/account.js.map +1 -1
  46. package/dist-server/graphql/resolvers/accounting/accounts.js.map +1 -1
  47. package/dist-server/graphql/resolvers/accounting/create-account.js.map +1 -1
  48. package/dist-server/graphql/resolvers/accounting/delete-account.js.map +1 -1
  49. package/dist-server/graphql/resolvers/accounting/delete-accounts.js.map +1 -1
  50. package/dist-server/graphql/resolvers/accounting/index.js +2 -24
  51. package/dist-server/graphql/resolvers/accounting/index.js.map +1 -1
  52. package/dist-server/graphql/resolvers/accounting/update-account.js.map +1 -1
  53. package/dist-server/graphql/resolvers/accounting/update-multiple-accounts.js.map +1 -1
  54. package/dist-server/graphql/resolvers/accounting/xero/deactivate-xero-account.js +2 -4
  55. package/dist-server/graphql/resolvers/accounting/xero/deactivate-xero-account.js.map +1 -1
  56. package/dist-server/graphql/resolvers/accounting/xero/get-xero-auth-url.js +2 -4
  57. package/dist-server/graphql/resolvers/accounting/xero/get-xero-auth-url.js.map +1 -1
  58. package/dist-server/graphql/resolvers/accounting/xero/index.js.map +1 -1
  59. package/dist-server/graphql/resolvers/accounting/xero/refresh-xero-access-token.js +2 -4
  60. package/dist-server/graphql/resolvers/accounting/xero/refresh-xero-access-token.js.map +1 -1
  61. package/dist-server/graphql/resolvers/accounting-api/accounting-invoice.js.map +1 -1
  62. package/dist-server/graphql/resolvers/accounting-api/accounting-item.js.map +1 -1
  63. package/dist-server/graphql/resolvers/accounting-api/accounting-purchase-order.js.map +1 -1
  64. package/dist-server/graphql/resolvers/accounting-api/index.js.map +1 -1
  65. package/dist-server/graphql/resolvers/index.js +2 -24
  66. package/dist-server/graphql/resolvers/index.js.map +1 -1
  67. package/dist-server/graphql/types/accounting/account-list.js +2 -4
  68. package/dist-server/graphql/types/accounting/account-list.js.map +1 -1
  69. package/dist-server/graphql/types/accounting/account-patch.js +2 -4
  70. package/dist-server/graphql/types/accounting/account-patch.js.map +1 -1
  71. package/dist-server/graphql/types/accounting/account.js +2 -4
  72. package/dist-server/graphql/types/accounting/account.js.map +1 -1
  73. package/dist-server/graphql/types/accounting/index.js.map +1 -1
  74. package/dist-server/graphql/types/accounting/new-account.js +2 -4
  75. package/dist-server/graphql/types/accounting/new-account.js.map +1 -1
  76. package/dist-server/graphql/types/accounting-api/invoice.js +2 -4
  77. package/dist-server/graphql/types/accounting-api/invoice.js.map +1 -1
  78. package/dist-server/graphql/types/accounting-api/item.js +2 -4
  79. package/dist-server/graphql/types/accounting-api/item.js.map +1 -1
  80. package/dist-server/graphql/types/accounting-api/purchase-order.js +2 -4
  81. package/dist-server/graphql/types/accounting-api/purchase-order.js.map +1 -1
  82. package/dist-server/graphql/types/index.js +5 -27
  83. package/dist-server/graphql/types/index.js.map +1 -1
  84. package/dist-server/index.js +5 -18
  85. package/dist-server/index.js.map +1 -1
  86. package/dist-server/migrations/index.js.map +1 -1
  87. package/dist-server/routers/xero-private-router.js +2 -4
  88. package/dist-server/routers/xero-private-router.js.map +1 -1
  89. package/dist-server/routers/xero-router.js +3 -5
  90. package/dist-server/routers/xero-router.js.map +1 -1
  91. package/dist-server/routes.js.map +1 -1
  92. package/dist-server/tsconfig.tsbuildinfo +1 -0
  93. package/package.json +15 -15
@@ -1 +1 @@
1
- {"version":3,"file":"xero.js","sourceRoot":"","sources":["../../../server/controllers/xero/xero.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA8B;AAC9B,qCAAuC;AAEvC,iDAAgD;AAEhD,oDAAgD;AAEhD,MAAM,QAAQ,GAAG,kCAAkC,CAAA;AACnD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,4CAA4C,CAAC,CAAA;AAU5E,MAAa,IAAI;IAGf,YAAY,MAAkB;QAC5B,IAAI,CAAC,MAAM,qBACN,MAAM,CACV,CAAA;IACH,CAAC;IAED,YAAY,CAAC,KAAK;QAChB,MAAM,MAAM,GAAG,qGAAqG,CAAA;QACpH,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAErD,OAAO,kFAAkF,MAAM,UAAU,MAAM,iBAAiB,WAAW,UAAU,KAAK,EAAE,CAAA;IAC9J,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAY,EAAE,IAAS;QAC/B,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE7C,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;aAC5B,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aACxD,IAAI,CAAC,GAAG,CAAC,CAAA;QAEZ,MAAM,QAAQ,GAAG,GAAG,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;QAC1D,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;QAE3B,MAAM,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AAc,EAAE,mCAAmC;aACpD;YACD,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC;iBACrC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;iBAChF,IAAI,CAAC,GAAG,CAAC;SACb,CAAC,CAAA;QAEF,IAAI,CAAC,eAAe,CAAC,EAAE,EAAE;YACvB,MAAM,IAAI,KAAK,CAAC,mCAAmC,MAAM,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;SACnF;QAED,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,IAAI,EAAE,CAAA;QACzC,MAAM,EACJ,YAAY,CAAC,gCAAgC,EAC7C,QAAQ,CAAC,mGAAmG,EAC5G,UAAU,CAAC,sDAAsD,EACjE,UAAU,EAAE,SAAS,CAAC,oBAAoB,EAC1C,aAAa;QACb;WACG;UACJ,GAAG,IAAI,CAAA;QAER,MAAM,EAAE,GAAG,EAAE,GAAG,IAAA,gBAAQ,EAAC,YAAY,CAAC,CAAA;QAEtC,IAAI,KAAK,GAAG;YACV,WAAW,EAAE,YAAY;YACzB,YAAY,EAAE,aAAa;YAC3B,SAAS;YACT,SAAS,EAAE,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;SAChC,CAAA;QAED,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,iBAAO,CAAC,CAAA;QAEzC,OAAO,MAAM,UAAU,CAAC,IAAI,iCACvB,OAAO,GACP,KAAK,EACR,CAAA;IACJ,CAAC;CACF;AApMD,oBAoMC","sourcesContent":["import fetch from 'node-fetch'\nimport { getRepository } from 'typeorm'\n\nimport { parseJwt } from '@things-factory/utils'\n\nimport { Account } from '../../entities/account'\n\nconst ENDPOINT = 'https://api.xero.com/api.xro/2.0'\nconst debug = require('debug')('things-factory:integration-accounting:xero')\n\nexport type XeroConfig = {\n apiKey: string\n apiSecret: string\n accessToken?: string\n tenantId?: string\n callback?: string\n}\n\nexport class Xero {\n private config: XeroConfig\n\n constructor(config: XeroConfig) {\n this.config = {\n ...config\n }\n }\n\n buildAuthURL(nonce) {\n const scopes = 'offline_access openid profile email accounting.transactions accounting.settings accounting.contacts'\n const { apiKey, callback: redirectUrl } = this.config\n\n return `https://login.xero.com/identity/connect/authorize?response_type=code&client_id=${apiKey}&scope=${scopes}&redirect_uri=${redirectUrl}&state=${nonce}`\n }\n\n async get(path: string, data: any) {\n const { accessToken, tenantId } = this.config\n\n const qs = Object.entries(data)\n .map(([k, v]) => `${k}=${encodeURIComponent(String(v))}`)\n .join('&')\n\n const endpoint = `${ENDPOINT}${path}${qs ? '?' + qs : ''}`\n debug('endpoint', endpoint)\n\n const response = await fetch(endpoint, {\n method: 'get',\n headers: {\n accept: 'application/json',\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${accessToken}`,\n 'xero-tenant-id': tenantId\n }\n })\n\n if (!response.ok) {\n throw response\n }\n\n let result = await response.json()\n debug('response result', result)\n result = this.convertStatusCode(result)\n\n return result\n }\n\n async post(path: string, data: any = {}) {\n const { accessToken, tenantId } = this.config\n\n debug('data', data)\n\n const jsondata = JSON.stringify(data)\n\n const endpoint = `${ENDPOINT}${path}`\n debug('endpoint', endpoint)\n\n const response = await fetch(endpoint, {\n method: 'post',\n headers: {\n accept: 'application/json',\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${accessToken}`,\n 'xero-tenant-id': tenantId\n },\n body: jsondata\n })\n\n if (!response.ok) {\n throw response\n }\n\n let result = await response.json()\n debug('response result', result)\n result = this.convertStatusCode(result)\n\n return result\n }\n\n async put(path: string, data: any = {}) {\n const { accessToken, tenantId } = this.config\n\n debug('data', data)\n\n const jsondata = JSON.stringify(data)\n\n const endpoint = `${ENDPOINT}${path}`\n debug('endpoint', endpoint)\n\n const response = await fetch(endpoint, {\n method: 'put',\n headers: {\n accept: 'application/json',\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${accessToken}`,\n 'xero-tenant-id': tenantId\n },\n body: jsondata\n })\n\n if (!response.ok) {\n throw response\n }\n\n let result = await response.json()\n debug('response result', result)\n result = this.convertStatusCode(result)\n\n return result\n }\n\n async delete(path: string, data: any = {}) {\n const { accessToken, tenantId } = this.config\n\n debug('data', data)\n\n const jsondata = JSON.stringify(data)\n\n const endpoint = `${ENDPOINT}${path}`\n debug('endpoint', endpoint)\n\n const response = await fetch(endpoint, {\n method: 'delete',\n headers: {\n accept: 'application/json',\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${accessToken}`,\n 'xero-tenant-id': tenantId\n },\n body: jsondata\n })\n\n if (!response.ok) {\n throw response\n }\n\n let result = await response.json()\n debug('response result', result)\n result = this.convertStatusCode(result)\n\n return result\n }\n\n private convertStatusCode(result: Record<string, any>): Record<string, any> {\n result.ok = result.Status.toLowerCase() === 'ok'\n return result\n }\n\n public static async refreshAccessToken(apiKey, apiSecret, account) {\n const refreshRequestData = {\n grant_type: 'refresh_token',\n refresh_token: account.refreshToken\n }\n\n const refreshResponse = await fetch(`https://identity.xero.com/connect/token`, {\n method: 'post',\n headers: {\n Authorization: `Basic ${Buffer.from(apiKey + ':' + apiSecret).toString('base64')}`,\n 'Content-Type': 'application/x-www-form-urlencoded'\n },\n body: Object.entries(refreshRequestData)\n .map(([key, value]) => encodeURIComponent(key) + '=' + encodeURIComponent(value))\n .join('&')\n })\n\n if (!refreshResponse.ok) {\n throw new Error(`get account information failed: ${await refreshResponse.text()}`)\n }\n\n const body = await refreshResponse.json()\n const {\n access_token /* token used to call the API */,\n id_token /* token containing user identity details (only returned if OpenID Connect scopes are requested) */,\n expires_in /* amount of seconds until the access token expires */,\n token_type: tokenType /* must be Bearer */,\n refresh_token\n /* token used to refresh the access token once it has expired (only returned if the offline_access scope is requested).\n */\n } = body\n\n const { exp } = parseJwt(access_token)\n\n var patch = {\n accessToken: access_token,\n refreshToken: refresh_token,\n tokenType,\n expiresIn: new Date(exp * 1000)\n }\n\n const repository = getRepository(Account)\n\n return await repository.save({\n ...account,\n ...patch\n })\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"accounting-connector.js","sourceRoot":"","sources":["../../../server/engine/connector/accounting-connector.ts"],"names":[],"mappings":";;;AAAA,uEAA+E;AAE/E,MAAa,mBAAmB;IAC9B,KAAK,CAAC,KAAK,CAAC,iBAAiB;QAC3B,MAAM,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;QAEtD,oCAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAA;IAC7E,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,UAAU;QACtB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAA;QAE7C,oCAAiB,CAAC,qBAAqB,CAAC,UAAU,oBAAO,UAAU,EAAG,CAAA;QAEtE,oCAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAmC,IAAI,IAAI,UAAU,CAAC,QAAQ,gBAAgB,CAAC,CAAA;IAC/G,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,UAAU;QACzB,oCAAiB,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAA;QAEtD,oCAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAmC,UAAU,CAAC,IAAI,mBAAmB,CAAC,CAAA;IACtG,CAAC;IAED,IAAI,aAAa;QACf,OAAO,EAAE,CAAA;IACX,CAAC;IAED,IAAI,YAAY;QACd,OAAO,CAAC,YAAY,CAAC,CAAA;IACvB,CAAC;CACF;AA5BD,kDA4BC;AAED,oCAAiB,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,IAAI,mBAAmB,EAAE,CAAC,CAAA"}
1
+ {"version":3,"file":"accounting-connector.js","sourceRoot":"","sources":["../../../server/engine/connector/accounting-connector.ts"],"names":[],"mappings":";;;AAAA,uEAA+E;AAE/E,MAAa,mBAAmB;IAC9B,KAAK,CAAC,KAAK,CAAC,iBAAiB;QAC3B,MAAM,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;QAEtD,oCAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAA;IAC7E,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,UAAU;QACtB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAA;QAE7C,oCAAiB,CAAC,qBAAqB,CAAC,UAAU,oBAAO,UAAU,EAAG,CAAA;QAEtE,oCAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAmC,IAAI,IAAI,UAAU,CAAC,QAAQ,gBAAgB,CAAC,CAAA;IAC/G,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,UAAU;QACzB,oCAAiB,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAA;QAEtD,oCAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAmC,UAAU,CAAC,IAAI,mBAAmB,CAAC,CAAA;IACtG,CAAC;IAED,IAAI,aAAa;QACf,OAAO,EAAE,CAAA;IACX,CAAC;IAED,IAAI,YAAY;QACd,OAAO,CAAC,YAAY,CAAC,CAAA;IACvB,CAAC;CACF;AA5BD,kDA4BC;AAED,oCAAiB,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,IAAI,mBAAmB,EAAE,CAAC,CAAA","sourcesContent":["import { ConnectionManager, Connector } from '@things-factory/integration-base'\n\nexport class AccountingConnector implements Connector {\n async ready(connectionConfigs) {\n await Promise.all(connectionConfigs.map(this.connect))\n\n ConnectionManager.logger.info('accounting-connector connections are ready')\n }\n\n async connect(connection) {\n const { domain, name, endpoint } = connection\n\n ConnectionManager.addConnectionInstance(connection, { ...connection })\n\n ConnectionManager.logger.info(`accounting-connector connection(${name}:${connection.endpoint}) is connected`)\n }\n\n async disconnect(connection) {\n ConnectionManager.removeConnectionInstance(connection)\n\n ConnectionManager.logger.info(`accounting-connector connection(${connection.name}) is disconnected`)\n }\n\n get parameterSpec() {\n return []\n }\n\n get taskPrefixes() {\n return ['accounting']\n }\n}\n\nConnectionManager.registerConnector('accounting-connector', new AccountingConnector())\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/engine/connector/index.ts"],"names":[],"mappings":";;AAAA,kCAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/engine/connector/index.ts"],"names":[],"mappings":";;AAAA,kCAA+B","sourcesContent":["import './accounting-connector'\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/engine/index.ts"],"names":[],"mappings":";;AAAA,uBAAoB;AACpB,kBAAe"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/engine/index.ts"],"names":[],"mappings":";;AAAA,uBAAoB;AACpB,kBAAe","sourcesContent":["import './connector'\nimport './task'\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"accounting-api.js","sourceRoot":"","sources":["../../../server/engine/task/accounting-api.ts"],"names":[],"mappings":";;AAAA,uEAAkF;AAClF,iDAA8C;AAC9C,qCAAuC;AACvC,6CAAwC;AACxC,qEAAuE;AAEvE,KAAK,UAAU,aAAa,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;IACzD,IAAI,EACF,UAAU,EACV,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,EACzC,GAAG,IAAI,CAAA;IAER,IAAI,MAAM,GAAG,oCAAiB,CAAC,2BAA2B,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,CAAA;IACpF,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,IAAI,KAAK,CAAC,mBAAmB,UAAU,EAAE,CAAC,CAAA;KACjD;IAED,IAAI,CAAC,GAAG,EAAE;QACR,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAA;KAClC;IAED,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAA;IACzC,MAAM,OAAO,GAAY,MAAM,UAAU,CAAC,OAAO,CAAC;QAChD,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE;KACnC,CAAC,CAAA;IAEF,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;KACtC;IAED,IAAI,MAAM,GAAG,MAAM,8BAAG,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAA,cAAM,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAE5E,OAAO;QACL,IAAI,EAAE,MAAM;KACb,CAAA;AACH,CAAC;AAED,aAAa,CAAC,aAAa,GAAG;IAC5B;QACE,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE;YACR,SAAS,EAAE,UAAU;YACrB,QAAQ,EAAE,MAAM;SACjB;KACF;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,EAAE,EAAE,uBAAuB,CAAC;SACvC;KACF;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;KAClB;CACF,CAAA;AAED,+BAAY,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAA"}
1
+ {"version":3,"file":"accounting-api.js","sourceRoot":"","sources":["../../../server/engine/task/accounting-api.ts"],"names":[],"mappings":";;AAAA,uEAAkF;AAClF,iDAA8C;AAC9C,qCAAuC;AAC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AI,EAAE,QAAQ;QACd,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,EAAE,EAAE,uBAAuB,CAAC;SACvC;KACF;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;KAClB;CACF,CAAA;AAED,+BAAY,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAA","sourcesContent":["import { ConnectionManager, TaskRegistry } from '@things-factory/integration-base'\nimport { access } from '@things-factory/utils'\nimport { getRepository } from 'typeorm'\nimport { Account } from '../../entities'\nimport { AccountingAPI as API } from '../../controllers/accounting-api'\n\nasync function AccountingAPI(step, { logger, data, domain }) {\n var {\n connection,\n params: { account: name, api, accessor }\n } = step\n\n var client = ConnectionManager.getConnectionInstanceByName(domain, connection) || {}\n if (!client) {\n throw new Error(`no connection : ${connection}`)\n }\n\n if (!api) {\n throw new Error(`no api defined`)\n }\n\n const repository = getRepository(Account)\n const account: Account = await repository.findOne({\n where: { domain: domain.id, name }\n })\n\n if (!account) {\n throw new Error(`no account defined`)\n }\n\n var result = await API[api](account, accessor ? access(accessor, data) : {})\n\n return {\n data: result\n }\n}\n\nAccountingAPI.parameterSpec = [\n {\n type: 'entity-selector',\n name: 'account',\n label: 'account',\n property: {\n queryName: 'accounts',\n valueKey: 'name'\n }\n },\n {\n type: 'select',\n name: 'api',\n label: 'api',\n property: {\n options: ['', 'getAccountingInvoices']\n }\n },\n {\n type: 'string',\n name: 'accessor',\n label: 'accessor'\n }\n]\n\nTaskRegistry.registerTaskHandler('accounting-api', AccountingAPI)\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/engine/task/index.ts"],"names":[],"mappings":";;AAAA,4BAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/engine/task/index.ts"],"names":[],"mappings":";;AAAA,4BAAyB","sourcesContent":["import './accounting-api'\n"]}
@@ -1,120 +1,112 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
2
  var _a, _b, _c;
12
3
  Object.defineProperty(exports, "__esModule", { value: true });
13
4
  exports.Account = void 0;
5
+ const tslib_1 = require("tslib");
14
6
  const auth_base_1 = require("@things-factory/auth-base");
15
7
  const shell_1 = require("@things-factory/shell");
16
8
  const typeorm_1 = require("typeorm");
17
9
  let Account = class Account {
18
10
  };
19
- __decorate([
11
+ tslib_1.__decorate([
20
12
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
21
- __metadata("design:type", String)
13
+ tslib_1.__metadata("design:type", String)
22
14
  ], Account.prototype, "id", void 0);
23
- __decorate([
15
+ tslib_1.__decorate([
24
16
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
25
- __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
17
+ tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
26
18
  ], Account.prototype, "domain", void 0);
27
- __decorate([
19
+ tslib_1.__decorate([
28
20
  (0, typeorm_1.Column)(),
29
- __metadata("design:type", String)
21
+ tslib_1.__metadata("design:type", String)
30
22
  ], Account.prototype, "platform", void 0);
31
- __decorate([
23
+ tslib_1.__decorate([
32
24
  (0, typeorm_1.Column)({
33
25
  nullable: true
34
26
  }),
35
- __metadata("design:type", String)
27
+ tslib_1.__metadata("design:type", String)
36
28
  ], Account.prototype, "accountId", void 0);
37
- __decorate([
29
+ tslib_1.__decorate([
38
30
  (0, typeorm_1.Column)(),
39
- __metadata("design:type", String)
31
+ tslib_1.__metadata("design:type", String)
40
32
  ], Account.prototype, "countryCode", void 0);
41
- __decorate([
33
+ tslib_1.__decorate([
42
34
  (0, typeorm_1.Column)({
43
35
  nullable: true
44
36
  }),
45
- __metadata("design:type", String)
37
+ tslib_1.__metadata("design:type", String)
46
38
  ], Account.prototype, "status", void 0);
47
- __decorate([
39
+ tslib_1.__decorate([
48
40
  (0, typeorm_1.Column)(),
49
- __metadata("design:type", String)
41
+ tslib_1.__metadata("design:type", String)
50
42
  ], Account.prototype, "name", void 0);
51
- __decorate([
43
+ tslib_1.__decorate([
52
44
  (0, typeorm_1.Column)({
53
45
  nullable: true
54
46
  }),
55
- __metadata("design:type", String)
47
+ tslib_1.__metadata("design:type", String)
56
48
  ], Account.prototype, "accessInfo", void 0);
57
- __decorate([
49
+ tslib_1.__decorate([
58
50
  (0, typeorm_1.Column)({
59
51
  nullable: true
60
52
  }),
61
- __metadata("design:type", String)
53
+ tslib_1.__metadata("design:type", String)
62
54
  ], Account.prototype, "accessToken", void 0);
63
- __decorate([
55
+ tslib_1.__decorate([
64
56
  (0, typeorm_1.Column)({ default: false, nullable: true }),
65
- __metadata("design:type", Boolean)
57
+ tslib_1.__metadata("design:type", Boolean)
66
58
  ], Account.prototype, "trackedInventory", void 0);
67
- __decorate([
59
+ tslib_1.__decorate([
68
60
  (0, typeorm_1.Column)({
69
61
  nullable: true
70
62
  }),
71
- __metadata("design:type", String)
63
+ tslib_1.__metadata("design:type", String)
72
64
  ], Account.prototype, "refreshToken", void 0);
73
- __decorate([
65
+ tslib_1.__decorate([
74
66
  (0, typeorm_1.Column)({
75
67
  nullable: true
76
68
  }),
77
- __metadata("design:type", Date)
69
+ tslib_1.__metadata("design:type", Date)
78
70
  ], Account.prototype, "expiresIn", void 0);
79
- __decorate([
71
+ tslib_1.__decorate([
80
72
  (0, typeorm_1.Column)({
81
73
  nullable: true
82
74
  }),
83
- __metadata("design:type", String)
75
+ tslib_1.__metadata("design:type", String)
84
76
  ], Account.prototype, "tokenType", void 0);
85
- __decorate([
77
+ tslib_1.__decorate([
86
78
  (0, typeorm_1.Column)({
87
79
  nullable: true
88
80
  }),
89
- __metadata("design:type", String)
81
+ tslib_1.__metadata("design:type", String)
90
82
  ], Account.prototype, "accountInfo", void 0);
91
- __decorate([
83
+ tslib_1.__decorate([
92
84
  (0, typeorm_1.Column)({
93
85
  nullable: true
94
86
  }),
95
- __metadata("design:type", String)
87
+ tslib_1.__metadata("design:type", String)
96
88
  ], Account.prototype, "description", void 0);
97
- __decorate([
89
+ tslib_1.__decorate([
98
90
  (0, typeorm_1.CreateDateColumn)(),
99
- __metadata("design:type", Date)
91
+ tslib_1.__metadata("design:type", Date)
100
92
  ], Account.prototype, "createdAt", void 0);
101
- __decorate([
93
+ tslib_1.__decorate([
102
94
  (0, typeorm_1.UpdateDateColumn)(),
103
- __metadata("design:type", Date)
95
+ tslib_1.__metadata("design:type", Date)
104
96
  ], Account.prototype, "updatedAt", void 0);
105
- __decorate([
97
+ tslib_1.__decorate([
106
98
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
107
99
  nullable: true
108
100
  }),
109
- __metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
101
+ tslib_1.__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
110
102
  ], Account.prototype, "creator", void 0);
111
- __decorate([
103
+ tslib_1.__decorate([
112
104
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
113
105
  nullable: true
114
106
  }),
115
- __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
107
+ tslib_1.__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
116
108
  ], Account.prototype, "updater", void 0);
117
- Account = __decorate([
109
+ Account = tslib_1.__decorate([
118
110
  (0, typeorm_1.Entity)(),
119
111
  (0, typeorm_1.Index)('ix_account_0', (account) => [account.domain, account.name], { unique: true })
120
112
  ], Account);
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../server/entities/account.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAgD;AAChD,iDAA8C;AAC9C,qCAAsH;AAItH,IAAa,OAAO,GAApB,MAAa,OAAO;CA+EnB,CAAA;AA7EC;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;mCACrB;AAGV;IADC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;kDAClB,cAAM,oBAAN,cAAM;uCAAA;AAGd;IADC,IAAA,gBAAM,GAAE;;yCACO;AAKhB;IAHC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;0CACe;AAGjB;IADC,IAAA,gBAAM,GAAE;;4CACU;AAKnB;IAHC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;uCACY;AAGd;IADC,IAAA,gBAAM,GAAE;;qCACG;AAKZ;IAHC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;2CACgB;AAKlB;IAHC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;4CACiB;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACzB,OAAO;iDAAA;AAKzB;IAHC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;6CACkB;AAKpB;IAHC,IAAA,gBAAM,EAAC;QACN,Q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I;KACf,CAAC;0DACO,gBAAI,oBAAJ,gBAAI;wCAAA;AA9EF,OAAO;IAFnB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,cAAc,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GACjF,OAAO,CA+EnB;AA/EY,0BAAO","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\nimport { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'\n\n@Entity()\n@Index('ix_account_0', (account: Account) => [account.domain, account.name], { unique: true })\nexport class Account {\n @PrimaryGeneratedColumn('uuid')\n id: string\n\n @ManyToOne(type => Domain)\n domain: Domain\n\n @Column()\n platform: string\n\n @Column({\n nullable: true\n })\n accountId: string\n\n @Column()\n countryCode: string\n\n @Column({\n nullable: true\n })\n status: string\n\n @Column()\n name: string\n\n @Column({\n nullable: true\n })\n accessInfo: string\n\n @Column({\n nullable: true\n })\n accessToken: string\n\n @Column({ default: false, nullable: true })\n trackedInventory: Boolean\n\n @Column({\n nullable: true\n })\n refreshToken: string\n\n @Column({\n nullable: true\n })\n expiresIn: Date\n\n @Column({\n nullable: true\n })\n tokenType: string\n\n @Column({\n nullable: true\n })\n accountInfo: string\n\n @Column({\n nullable: true\n })\n description: string\n\n @CreateDateColumn()\n createdAt: Date\n\n @UpdateDateColumn()\n updatedAt: Date\n\n @ManyToOne(type => User, {\n nullable: true\n })\n creator: User\n\n @ManyToOne(type => User, {\n nullable: true\n })\n updater: User\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/entities/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAI1B,wFAJA,iBAAO,OAIA;AAFH,QAAA,QAAQ,GAAG,CAAC,iBAAO,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/entities/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAI1B,wFAJA,iBAAO,OAIA;AAFH,QAAA,QAAQ,GAAG,CAAC,iBAAO,CAAC,CAAA","sourcesContent":["import { Account } from './account'\n\nexport const entities = [Account]\n\nexport { Account }\n"]}
@@ -1,31 +1,9 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.schema = void 0;
27
- const typeDefs = __importStar(require("./types"));
28
- const resolvers = __importStar(require("./resolvers"));
4
+ const tslib_1 = require("tslib");
5
+ const typeDefs = tslib_1.__importStar(require("./types"));
6
+ const resolvers = tslib_1.__importStar(require("./resolvers"));
29
7
  exports.schema = {
30
8
  typeDefs,
31
9
  resolvers
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/graphql/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAmC;AACnC,uDAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,QAAQ;IACR,SAAS;CACV,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/graphql/index.ts"],"names":[],"mappings":";;;;AAAA,0DAAmC;AACnC,+DAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,QAAQ;IACR,SAAS;CACV,CAAA","sourcesContent":["import * as typeDefs from './types'\nimport * as resolvers from './resolvers'\n\nexport const schema = {\n typeDefs,\n resolvers\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting/account.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAA2C;AAE9B,QAAA,eAAe,GAAG;IAC7B,KAAK,CAAC,OAAO,CAAC,CAAM,EAAE,EAAE,EAAE,EAAE,EAAE,OAAY;QACxC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAA;QAEzC,OAAO,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE;YAC3C,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;SAC5C,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting/account.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAA2C;AAE9B,QAAA,eAAe,GAAG;IAC7B,KAAK,CAAC,OAAO,CAAC,CAAM,EAAE,EAAE,EAAE,EAAE,EAAE,OAAY;QACxC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAA;QAEzC,OAAO,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE;YAC3C,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;SAC5C,CAAC,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import { getRepository } from 'typeorm'\nimport { Account } from '../../../entities'\n\nexport const accountResolver = {\n async account(_: any, { id }, context: any) {\n const repository = getRepository(Account)\n\n return await getRepository(Account).findOne({\n where: { domain: context.state.domain, id },\n relations: ['domain', 'creator', 'updater']\n })\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting/accounts.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAEvC,iDAAoE;AAEpE,gDAA2C;AAE9B,QAAA,gBAAgB,GAAG;IAC9B,KAAK,CAAC,QAAQ,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACpD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;QAC7D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,YAAY,iCAC3D,eAAe,KAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,IAC3C,CAAA;QACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting/accounts.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAEvC,iDAAoE;AAEpE,gDAA2C;AAE9B,QAAA,gBAAgB,GAAG;IAC9B,KAAK,CAAC,QAAQ,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACpD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;QAC7D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,YAAY,iCAC3D,eAAe,KAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,IAC3C,CAAA;QACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;CACF,CAAA","sourcesContent":["import { getRepository } from 'typeorm'\n\nimport { convertListParams, ListParam } from '@things-factory/shell'\n\nimport { Account } from '../../../entities'\n\nexport const accountsResolver = {\n async accounts(_: any, params: ListParam, context: any) {\n const { domain } = context.state\n const convertedParams = convertListParams(params, { domain })\n const [items, total] = await getRepository(Account).findAndCount({\n ...convertedParams,\n relations: ['domain', 'creator', 'updater']\n })\n return { items, total }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"create-account.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting/create-account.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAA2C;AAC3C,sDAAwD;AAE3C,QAAA,aAAa,GAAG;IAC3B,KAAK,CAAC,aAAa,CAAC,CAAM,EAAE,EAAE,OAAO,EAAE,EAAE,OAAY;QACnD,OAAO,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,IAAI,+BACtC,MAAM,EAAE,+BAAiB,CAAC,QAAQ,IAC/B,OAAO,KACV,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAC5B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,EAC3B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;IACJ,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"create-account.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting/create-account.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAA2C;AAC3C,sDAAwD;AAE3C,QAAA,aAAa,GAAG;IAC3B,KAAK,CAAC,aAAa,CAAC,CAAM,EAAE,EAAE,OAAO,EAAE,EAAE,OAAY;QACnD,OAAO,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,IAAI,+BACtC,MAAM,EAAE,+BAAiB,CAAC,QAAQ,IAC/B,OAAO,KACV,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAC5B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,EAC3B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import { getRepository } from 'typeorm'\nimport { Account } from '../../../entities'\nimport { ACCOUNTING_STATUS } from '../../../controllers'\n\nexport const createAccount = {\n async createAccount(_: any, { account }, context: any) {\n return await getRepository(Account).save({\n status: ACCOUNTING_STATUS.INACTIVE,\n ...account,\n domain: context.state.domain,\n creator: context.state.user,\n updater: context.state.user\n })\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"delete-account.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting/delete-account.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAA2C;AAC3C,sDAAwD;AAE3C,QAAA,aAAa,GAAG;IAC3B,KAAK,CAAC,aAAa,CAAC,CAAM,EAAE,EAAE,EAAE,EAAE,EAAE,OAAY;QAC9C,MAAM,YAAY,GAAY,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,OAAO,CAAC;YACjE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE;SAC5C,CAAC,CAAA;QAEF,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,IAAI,iCAC5B,YAAY,KACf,MAAM,EAAE,+BAAiB,CAAC,UAAU,EACpC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"delete-account.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting/delete-account.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAA2C;AAC3C,sDAAwD;AAE3C,QAAA,aAAa,GAAG;IAC3B,KAAK,CAAC,aAAa,CAAC,CAAM,EAAE,EAAE,EAAE,EAAE,EAAE,OAAY;QAC9C,MAAM,YAAY,GAAY,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,OAAO,CAAC;YACjE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE;SAC5C,CAAC,CAAA;QAEF,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,IAAI,iCAC5B,YAAY,KACf,MAAM,EAAE,+BAAiB,CAAC,UAAU,EACpC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA","sourcesContent":["import { getRepository } from 'typeorm'\nimport { Account } from '../../../entities'\nimport { ACCOUNTING_STATUS } from '../../../controllers'\n\nexport const deleteAccount = {\n async deleteAccount(_: any, { id }, context: any) {\n const foundAccount: Account = await getRepository(Account).findOne({\n where: { domain: context.state.domain, id }\n })\n\n await getRepository(Account).save({\n ...foundAccount,\n status: ACCOUNTING_STATUS.TERMINATED,\n updater: context.state.user\n })\n\n return true\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"delete-accounts.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting/delete-accounts.ts"],"names":[],"mappings":";;;AAAA,qCAA2C;AAC3C,gDAA2C;AAC3C,sDAAwD;AAE3C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,UAAU,EACpC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC5B;QACH,CAAC,CAAC,CAAA;QAEF,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;QACjD,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA","sourcesContent":["import { getRepository, In } from 'typeorm'\nimport { Account } from '../../../entities'\nimport { ACCOUNTING_STATUS } from '../../../controllers'\n\nexport const deleteAccounts = {\n async deleteAccounts(_: any, { ids }, context: any) {\n let foundAccounts: Account[] = await getRepository(Account).find({\n where: { domain: context.state.domain, id: In(ids) }\n })\n\n const updatedAccount = foundAccounts.map((account: Account) => {\n return {\n ...account,\n status: ACCOUNTING_STATUS.TERMINATED,\n updater: context.state.user\n }\n })\n\n await getRepository(Account).save(updatedAccount)\n return true\n }\n}\n"]}
@@ -1,29 +1,7 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.Mutation = exports.Query = void 0;
4
+ const tslib_1 = require("tslib");
27
5
  const account_1 = require("./account");
28
6
  const accounts_1 = require("./accounts");
29
7
  const update_multiple_accounts_1 = require("./update-multiple-accounts");
@@ -31,7 +9,7 @@ const update_account_1 = require("./update-account");
31
9
  const create_account_1 = require("./create-account");
32
10
  const delete_account_1 = require("./delete-account");
33
11
  const delete_accounts_1 = require("./delete-accounts");
34
- const Xero = __importStar(require("./xero"));
12
+ const Xero = tslib_1.__importStar(require("./xero"));
35
13
  exports.Query = Object.assign(Object.assign(Object.assign({}, accounts_1.accountsResolver), account_1.accountResolver), Xero.Query);
36
14
  exports.Mutation = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, update_account_1.updateAccount), update_multiple_accounts_1.updateMultipleAccount), create_account_1.createAccount), delete_account_1.deleteAccount), delete_accounts_1.deleteAccounts), Xero.Mutation);
37
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA2C;AAC3C,yCAA6C;AAE7C,yEAAkE;AAClE,qDAAgD;AAChD,qDAAgD;AAChD,qDAAgD;AAChD,uDAAkD;AAElD,6CAA8B;AAEjB,QAAA,KAAK,iDACb,2BAAgB,GAChB,yBAAe,GACf,IAAI,CAAC,KAAK,EACd;AAEY,QAAA,QAAQ,2FAChB,8BAAa,GACb,gDAAqB,GACrB,8BAAa,GACb,8BAAa,GACb,gCAAc,GACd,IAAI,CAAC,QAAQ,EACjB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting/index.ts"],"names":[],"mappings":";;;;AAAA,uCAA2C;AAC3C,yCAA6C;AAE7C,yEAAkE;AAClE,qDAAgD;AAChD,qDAAgD;AAChD,qDAAgD;AAChD,uDAAkD;AAElD,qDAA8B;AAEjB,QAAA,KAAK,iDACb,2BAAgB,GAChB,yBAAe,GACf,IAAI,CAAC,KAAK,EACd;AAEY,QAAA,QAAQ,2FAChB,8BAAa,GACb,gDAAqB,GACrB,8BAAa,GACb,8BAAa,GACb,gCAAc,GACd,IAAI,CAAC,QAAQ,EACjB","sourcesContent":["import { accountResolver } from './account'\nimport { accountsResolver } from './accounts'\n\nimport { updateMultipleAccount } from './update-multiple-accounts'\nimport { updateAccount } from './update-account'\nimport { createAccount } from './create-account'\nimport { deleteAccount } from './delete-account'\nimport { deleteAccounts } from './delete-accounts'\n\nimport * as Xero from './xero'\n\nexport const Query = {\n ...accountsResolver,\n ...accountResolver,\n ...Xero.Query\n}\n\nexport const Mutation = {\n ...updateAccount,\n ...updateMultipleAccount,\n ...createAccount,\n ...deleteAccount,\n ...deleteAccounts,\n ...Xero.Mutation\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"update-account.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting/update-account.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAA2C;AAE9B,QAAA,aAAa,GAAG;IAC3B,KAAK,CAAC,aAAa,CAAC,CAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,OAAY;QACvD,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAA;QACzC,MAAM,OAAO,GAAQ,MAAM,UAAU,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE;SAC9C,CAAC,CAAA;QAEF,OAAO,MAAM,UAAU,CAAC,IAAI,+CACvB,OAAO,GACP,KAAK,KACR,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;IACJ,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"update-account.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting/update-account.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAA2C;AAE9B,QAAA,aAAa,GAAG;IAC3B,KAAK,CAAC,aAAa,CAAC,CAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,OAAY;QACvD,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAA;QACzC,MAAM,OAAO,GAAQ,MAAM,UAAU,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE;SAC9C,CAAC,CAAA;QAEF,OAAO,MAAM,UAAU,CAAC,IAAI,+CACvB,OAAO,GACP,KAAK,KACR,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import { getRepository } from 'typeorm'\nimport { Account } from '../../../entities'\n\nexport const updateAccount = {\n async updateAccount(_: any, { name, patch }, context: any) {\n const repository = getRepository(Account)\n const account: any = await repository.findOne({\n where: { domain: context.state.domain, name }\n })\n\n return await repository.save({\n ...account,\n ...patch,\n updater: context.state.user\n })\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"update-multiple-accounts.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting/update-multiple-accounts.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAA2C;AAE9B,QAAA,qBAAqB,GAAG;IACnC,KAAK,CAAC,qBAAqB,CAAC,CAAM,EAAE,EAAE,OAAO,EAAE,EAAE,OAAY;QAC3D,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAA;QACzF,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,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C,CAAC,CAAC,CAAA;gBACnC,MAAM,OAAO,GAAY,MAAM,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;gBAEhE,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,IAAI,+CAChC,OAAO,GACP,SAAS,KACZ,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;gBAEF,OAAO,CAAC,IAAI,iCAAM,MAAM,KAAE,MAAM,EAAE,GAAG,IAAG,CAAA;aACzC;SACF;QAED,OAAO,OAAO,CAAA;IAChB,CAAC;CACF,CAAA","sourcesContent":["import { getRepository } from 'typeorm'\nimport { Account } from '../../../entities'\n\nexport const updateMultipleAccount = {\n async updateMultipleAccount(_: any, { patches }, context: any) {\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const accountRepo = getRepository(Account)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await accountRepo.save({\n ...newRecord,\n domain: context.state.domain,\n creator: context.state.user,\n updater: context.state.user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const account: Account = await accountRepo.findOne(newRecord.id)\n\n const result = await accountRepo.save({\n ...account,\n ...newRecord,\n updater: context.state.user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n}\n"]}
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.deactivateXeroAccount = void 0;
7
- const node_fetch_1 = __importDefault(require("node-fetch"));
4
+ const tslib_1 = require("tslib");
5
+ const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
8
6
  const typeorm_1 = require("typeorm");
9
7
  const entities_1 = require("../../../../entities");
10
8
  const controllers_1 = require("../../../../controllers");
@@ -1 +1 @@
1
- {"version":3,"file":"deactivate-xero-account.js","sourceRoot":"","sources":["../../../../../server/graphql/resolvers/accounting/xero/deactivate-xero-account.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA8B;AAC9B,qCAAuC;AACvC,mDAA8C;AAC9C,yDAA2D;AAE3D,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,+DAA+D,CAAC,CAAA;AAElF,QAAA,qBAAqB,GAAG;IACnC,KAAK,CAAC,qBAAqB,CAAC,CAAM,EAAE,EAAE,EAAE,EAAE,EAAE,OAAY;QACtD,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAA;QACzC,MAAM,OAAO,GAAQ,MAAM,UAAU,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE;SAC5C,CAAC,CAAA;QAEF,IAAI;YACF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;YAElD,IAAI,UAAU,EAAE;gBACd,uCAAuC;gBACvC,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAK,EAAC,oCAAoC,UAAU,CAAC,EAAE,EAAE,EAAE;oBAChF,MAAM,EAAE,QAAQ;oBAChB,OAAO,EAAE;wBACP,aAAa,EAAE,UAAU,OAAO,CAAC,WAAW,EAAE;qBAC/C;iBACF,CAAC,CAAA;gBAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;oBAChB,KAAK,CAAC,0BAA0B,EAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;iBAC1E;aACF;iBAAM;gBACL,KAAK,CAAC,2CAA2C,CAAC,CAAA;aACnD;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,KAAK,CAAC,6CAA6C,CAAC,CAAA;SACrD;QAED,IAAI,KAAK,GAAG;YACV,SAAS,EAAE,EAAE;YACb,WAAW,EAAE,EAAE;YACf,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,EAAE;YACb,WAAW,EAAE,EAAE;YACf,WAAW,EAAE,EAAE;YACf,MAAM,EAAE,+BAAiB,CAAC,QAAQ;SACnC,CAAA;QAED,OAAO,MAAM,UAAU,CAAC,IAAI,+CACvB,OAAO,GACP,KAAK,KACR,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;IACJ,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"deactivate-xero-account.js","sourceRoot":"","sources":["../../../../../server/graphql/resolvers/accounting/xero/deactivate-xero-account.ts"],"names":[],"mappings":";;;;AAAA,oEAA8B;AAC9B,qCAAuC;AACvC,mDAA8C;AAC9C,yDAA2D;AAE3D,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,+DAA+D,CAAC,CAAA;AAElF,QAAA,qBAAqB,GAAG;IACnC,KAAK,CAAC,qBAAqB,CAAC,CAAM,EAAE,EAAE,EAAE,EAAE,EAAE,OAAY;QACtD,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAA;QACzC,MAAM,OAAO,GAAQ,MAAM,UAAU,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE;SAC5C,CAAC,CAAA;QAEF,IAAI;YACF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;YAElD,IAAI,UAAU,EAAE;gBACd,uCAAuC;gBACvC,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAK,EAAC,oCAAoC,UAAU,CAAC,EAAE,EAAE,EAAE;oBAChF,MAAM,EAAE,QAAQ;oBAChB,OAAO,EAAE;wBACP,aAAa,EAAE,UAAU,OAAO,CAAC,WAAW,EAAE;qBAC/C;iBACF,CAAC,CAAA;gBAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;oBAChB,KAAK,CAAC,0BAA0B,EAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;iBAC1E;aACF;iBAAM;gBACL,KAAK,CAAC,2CAA2C,CAAC,CAAA;aACnD;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,KAAK,CAAC,6CAA6C,CAAC,CAAA;SACrD;QAED,IAAI,KAAK,GAAG;YACV,SAAS,EAAE,EAAE;YACb,WAAW,EAAE,EAAE;YACf,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,EAAE;YACb,WAAW,EAAE,EAAE;YACf,WAAW,EAAE,EAAE;YACf,MAAM,EAAE,+BAAiB,CAAC,QAAQ;SACnC,CAAA;QAED,OAAO,MAAM,UAAU,CAAC,IAAI,+CACvB,OAAO,GACP,KAAK,KACR,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import fetch from 'node-fetch'\nimport { getRepository } from 'typeorm'\nimport { Account } from '../../../../entities'\nimport { ACCOUNTING_STATUS } from '../../../../controllers'\n\nconst debug = require('debug')('things-factory:integration-accounting:deactivate-xero-account')\n\nexport const deactivateXeroAccount = {\n async deactivateXeroAccount(_: any, { id }, context: any) {\n const repository = getRepository(Account)\n const account: any = await repository.findOne({\n where: { domain: context.state.domain, id }\n })\n\n try {\n const connection = JSON.parse(account.accountInfo)\n\n if (connection) {\n /* delete connection request to xero */\n const response = await fetch(`https://api.xero.com/connections/${connection.id}`, {\n method: 'delete',\n headers: {\n Authorization: `Bearer ${account.accessToken}`\n }\n })\n\n if (!response.ok) {\n debug('delete connection failed', response.status, await response.text())\n }\n } else {\n debug(`connection info from accountInfo is empty`)\n }\n } catch (err) {\n debug(`get connection info failed from accountInfo`)\n }\n\n var patch = {\n accountId: '',\n accessToken: '',\n refreshToken: '',\n accessInfo: '',\n expiresIn: null,\n tokenType: '',\n accountInfo: '',\n countryCode: '',\n status: ACCOUNTING_STATUS.INACTIVE\n }\n\n return await repository.save({\n ...account,\n ...patch,\n updater: context.state.user\n })\n }\n}\n"]}
@@ -1,16 +1,14 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.getXeroAuthURL = exports.makeVerificationTokenForNonce = void 0;
4
+ const tslib_1 = require("tslib");
7
5
  const typeorm_1 = require("typeorm");
8
6
  const env_1 = require("@things-factory/env");
9
7
  const auth_base_1 = require("@things-factory/auth-base");
10
8
  const xero_1 = require("../../../../controllers/xero");
11
9
  const xeroConfig = env_1.config.get('accountingIntegrationXero', {});
12
10
  const { apiKey, apiSecret, callback } = xeroConfig;
13
- const crypto_1 = __importDefault(require("crypto"));
11
+ const crypto_1 = tslib_1.__importDefault(require("crypto"));
14
12
  function makeVerificationTokenForNonce() {
15
13
  return crypto_1.default.randomBytes(16).toString('hex');
16
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-xero-auth-url.js","sourceRoot":"","sources":["../../../../../server/graphql/resolvers/accounting/xero/get-xero-auth-url.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAuC;AACvC,6CAA4C;AAC5C,yDAAoF;AACpF,uDAAmD;AAEnD,MAAM,UAAU,GAAG,YAAM,CAAC,GAAG,CAAC,2BAA2B,EAAE,EAAE,CAAC,CAAA;AAC9D,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAA;A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AEY,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,cAAc,CAAC,CAAM,EAAE,EAAE,UAAU,EAAE,EAAE,OAAY;QACvD,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAC9B,MAAM,IAAI,GAAG,IAAI,WAAI,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAA;QAEtD,4CAA4C;QAC5C,MAAM,KAAK,GAAG,6BAA6B,EAAE,CAAA;QAC7C,MAAM,IAAA,uBAAa,EAAC,6BAAiB,CAAC,CAAC,IAAI,CAAC;YAC1C,MAAM,EAAE,IAAI,CAAC,EAAE;YACf,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,iCAAqB,CAAC,oBAAoB;YAChD,UAAU,EAAE,UAAU;SACvB,CAAC,CAAA;QAEF,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;IACjC,CAAC;CACF,CAAA","sourcesContent":["import { getRepository } from 'typeorm'\nimport { config } from '@things-factory/env'\nimport { VerificationToken, VerificationTokenType } from '@things-factory/auth-base'\nimport { Xero } from '../../../../controllers/xero'\n\nconst xeroConfig = config.get('accountingIntegrationXero', {})\nconst { apiKey, apiSecret, callback } = xeroConfig\n\nimport crypto from 'crypto'\nexport function makeVerificationTokenForNonce() {\n return crypto.randomBytes(16).toString('hex')\n}\n\nexport const getXeroAuthURL = {\n async getXeroAuthURL(_: any, { accounting }, context: any) {\n const { user } = context.state\n const xero = new Xero({ apiKey, apiSecret, callback })\n\n /* generate verification-token as a nonce */\n const nonce = makeVerificationTokenForNonce()\n await getRepository(VerificationToken).save({\n userId: user.id,\n token: nonce,\n type: VerificationTokenType.REQUEST_ACCESS_TOKEN,\n suppliment: accounting\n })\n\n return xero.buildAuthURL(nonce)\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../server/graphql/resolvers/accounting/xero/index.ts"],"names":[],"mappings":";;;AAAA,2DAAoD;AAEpD,uEAAiE;AACjE,2EAAoE;AAEvD,QAAA,KAAK,qBACb,kCAAc,EAClB;AAEY,QAAA,QAAQ,mCAChB,kDAAsB,GACtB,+CAAqB,EACzB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../server/graphql/resolvers/accounting/xero/index.ts"],"names":[],"mappings":";;;AAAA,2DAAoD;AAEpD,uEAAiE;AACjE,2EAAoE;AAEvD,QAAA,KAAK,qBACb,kCAAc,EAClB;AAEY,QAAA,QAAQ,mCAChB,kDAAsB,GACtB,+CAAqB,EACzB","sourcesContent":["import { getXeroAuthURL } from './get-xero-auth-url'\n\nimport { deactivateXeroAccount } from './deactivate-xero-account'\nimport { refreshXeroAccessToken } from './refresh-xero-access-token'\n\nexport const Query = {\n ...getXeroAuthURL\n}\n\nexport const Mutation = {\n ...refreshXeroAccessToken,\n ...deactivateXeroAccount\n}\n"]}
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.refreshXeroAccessToken = void 0;
7
- const node_fetch_1 = __importDefault(require("node-fetch"));
4
+ const tslib_1 = require("tslib");
5
+ const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
8
6
  const typeorm_1 = require("typeorm");
9
7
  const entities_1 = require("../../../../entities");
10
8
  const utils_1 = require("@things-factory/utils");
@@ -1 +1 @@
1
- {"version":3,"file":"refresh-xero-access-token.js","sourceRoot":"","sources":["../../../../../server/graphql/resolvers/accounting/xero/refresh-xero-access-token.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA8B;AAC9B,qCAAuC;AACvC,mDAA8C;AAE9C,iDAAgD;AAChD,6CAA4C;AAC5C,MAAM,UAAU,GAAG,YAAM,CAAC,GAAG,CAAC,2BAA2B,EAAE,EAAE,CAAC,CAAA;AAC9D,MAAM,EAA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C,IAAI,EAAE,CAAA;QACzC,MAAM,EACJ,YAAY,CAAC,gCAAgC,EAC7C,QAAQ,CAAC,mGAAmG,EAC5G,UAAU,CAAC,sDAAsD,EACjE,UAAU,EAAE,SAAS,CAAC,oBAAoB,EAC1C,aAAa;QACb;WACG;UACJ,GAAG,IAAI,CAAA;QAER,MAAM,EAAE,GAAG,EAAE,GAAG,IAAA,gBAAQ,EAAC,YAAY,CAAC,CAAA;QAEtC,IAAI,KAAK,GAAG;YACV,WAAW,EAAE,YAAY;YACzB,YAAY,EAAE,aAAa;YAC3B,SAAS;YACT,SAAS,EAAE,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;SAChC,CAAA;QAED,OAAO,MAAM,UAAU,CAAC,IAAI,+CACvB,OAAO,GACP,KAAK,KACR,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;IACJ,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"refresh-xero-access-token.js","sourceRoot":"","sources":["../../../../../server/graphql/resolvers/accounting/xero/refresh-xero-access-token.ts"],"names":[],"mappings":";;;;AAAA,oEAA8B;AAC9B,qCAAuC;AACvC,mDAA8C;AAE9C,iDAAgD;AAChD,6CAA4C;AAC5C,MAAM,UAAU,GAAG,YAAM,CAAC,GAAG,CAAC,2BAA2B,EAAE,EAAE,CAAC,CAAA;AAC9D,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,UAAU,CAAA;AAExC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,iEAAiE,CAAC,CAAA;AAEpF,QAAA,sBAAsB,GAAG;IACpC,KAAK,CAAC,sBAAsB,CAAC,CAAM,EAAE,EAAE,EAAE,EAAE,EAAE,OAAY;QACvD,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAA;QACzC,MAAM,OAAO,GAAQ,MAAM,UAAU,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE,EAAE,MAAM,EA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AE,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;SAChC,CAAA;QAED,OAAO,MAAM,UAAU,CAAC,IAAI,+CACvB,OAAO,GACP,KAAK,KACR,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import fetch from 'node-fetch'\nimport { getRepository } from 'typeorm'\nimport { Account } from '../../../../entities'\n\nimport { parseJwt } from '@things-factory/utils'\nimport { config } from '@things-factory/env'\nconst xeroConfig = config.get('accountingIntegrationXero', {})\nconst { apiKey, apiSecret } = xeroConfig\n\nconst debug = require('debug')('things-factory:integration-accounting:refresh-xero-access-token')\n\nexport const refreshXeroAccessToken = {\n async refreshXeroAccessToken(_: any, { id }, context: any) {\n const repository = getRepository(Account)\n const account: any = await repository.findOne({\n where: { domain: context.state.domain, id }\n })\n\n const refreshRequestData = {\n grant_type: 'refresh_token',\n refresh_token: account.refreshToken\n }\n\n const refreshResponse = await fetch(`https://identity.xero.com/connect/token`, {\n method: 'post',\n headers: {\n Authorization: `Basic ${Buffer.from(apiKey + ':' + apiSecret).toString('base64')}`,\n 'Content-Type': 'application/x-www-form-urlencoded'\n },\n body: Object.entries(refreshRequestData)\n .map(([key, value]) => encodeURIComponent(key) + '=' + encodeURIComponent(value))\n .join('&')\n })\n\n if (!refreshResponse.ok) {\n throw new Error(`get account information failed: ${await refreshResponse.text()}`)\n }\n\n const body = await refreshResponse.json()\n const {\n access_token /* token used to call the API */,\n id_token /* token containing user identity details (only returned if OpenID Connect scopes are requested) */,\n expires_in /* amount of seconds until the access token expires */,\n token_type: tokenType /* must be Bearer */,\n refresh_token\n /* token used to refresh the access token once it has expired (only returned if the offline_access scope is requested).\n */\n } = body\n\n const { exp } = parseJwt(access_token)\n\n var patch = {\n accessToken: access_token,\n refreshToken: refresh_token,\n tokenType,\n expiresIn: new Date(exp * 1000)\n }\n\n return await repository.save({\n ...account,\n ...patch,\n updater: context.state.user\n })\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"accounting-invoice.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting-api/accounting-invoice.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AAEtD,QAAA,sBAAsB,GAAG;IACpC,KAAK,CAAC,qBAAqB,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAG,EAAE,OAAY;QACpF,IAAI,UAAU,GAAG,MAAM,8BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;QAEhE,OAAO,MAAM,8BAAa,CAAC,WAAW,CAAC,UAAU,EAAE;YACjD,UAAU,EAAE;gBACV,IAAI,EAAE,CAAC;gBACP,KAAK,EAAE,GAAG;aACX;SACF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,OAAY;QAC1E,IAAI,UAAU,GAAG,MAAM,8BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;QAEhE,OAAO,MAAM,8BAAa,CAAC,UAAU,CAAC,UAAU,EAAE;YAChD,SAAS;SACV,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAEY,QAAA,uBAAuB,GAAG;IACrC,KAAK,CAAC,uBAAuB,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,OAAY;QAC9E,IAAI,UAAU,GAAG,MAAM,8BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;QAEhE,OAAO,MAAM,8BAAa,CAAC,aAAa,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;IAClE,CAAC;IAED,KAAK,CAAC,uBAAuB,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,OAAY;QACzE,IAAI,UAAU,GAAG,MAAM,8BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;QAEhE,OAAO,MAAM,8BAAa,CAAC,aAAa,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;IAC7D,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"accounting-invoice.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting-api/accounting-invoice.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AAEtD,QAAA,sBAAsB,GAAG;IACpC,KAAK,CAAC,qBAAqB,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAG,EAAE,OAAY;QACpF,IAAI,UAAU,GAAG,MAAM,8BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;QAEhE,OAAO,MAAM,8BAAa,CAAC,WAAW,CAAC,UAAU,EAAE;YACjD,UAAU,EAAE;gBACV,IAAI,EAAE,CAAC;gBACP,KAAK,EAAE,GAAG;aACX;SACF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,OAAY;QAC1E,IAAI,UAAU,GAAG,MAAM,8BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;QAEhE,OAAO,MAAM,8BAAa,CAAC,UAAU,CAAC,UAAU,EAAE;YAChD,SAAS;SACV,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAEY,QAAA,uBAAuB,GAAG;IACrC,KAAK,CAAC,uBAAuB,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,OAAY;QAC9E,IAAI,UAAU,GAAG,MAAM,8BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;QAEhE,OAAO,MAAM,8BAAa,CAAC,aAAa,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;IAClE,CAAC;IAED,KAAK,CAAC,uBAAuB,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,OAAY;QACzE,IAAI,UAAU,GAAG,MAAM,8BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;QAEhE,OAAO,MAAM,8BAAa,CAAC,aAAa,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;IAC7D,CAAC;CACF,CAAA","sourcesContent":["import { AccountingAPI } from '../../../controllers/accounting-api'\n\nexport const queryAccountingInvoice = {\n async getAccountingInvoices(_: any, { accountingId, params: ListParam }, context: any) {\n var accounting = await AccountingAPI.getAccounting(accountingId)\n \n return await AccountingAPI.getInvoices(accounting, {\n pagination: {\n page: 0,\n limit: 100\n }\n })\n },\n\n async getAccountingInvoice(_: any, { accountingId, invoiceNo }, context: any) {\n var accounting = await AccountingAPI.getAccounting(accountingId)\n \n return await AccountingAPI.getInvoice(accounting, {\n invoiceNo\n })\n }\n}\n\nexport const mutateAccountingInvoice = {\n async createAccountingInvoice(_: any, { accountingId, newInvoice }, context: any) {\n var accounting = await AccountingAPI.getAccounting(accountingId)\n \n return await AccountingAPI.createInvoice(accounting, newInvoice)\n },\n\n async updateAccountingInvoice(_: any, { accountingId, patch }, context: any) {\n var accounting = await AccountingAPI.getAccounting(accountingId)\n \n return await AccountingAPI.updateInvoice(accounting, patch)\n }\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"accounting-item.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting-api/accounting-item.ts"],"names":[],"mappings":";;;AACA,wEAAmE;AAEtD,QAAA,mBAAmB,GAAG;IACjC,KAAK,CAAC,kBAAkB,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,OAAY;QAChF,IAAI,UAAU,GAAG,MAAM,8BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;QAEhE,OAAO,MAAM,8BAAa,CAAC,QAAQ,CAAC,UAAU,EAAE;YAC9C,UAAU,EAAE;gBACV,IAAI,EAAE,CAAC;gBACP,KAAK,EAAE,GAAG;aACX;SACF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,OAAY;QACpE,IAAI,UAAU,GAAG,MAAM,8BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;QAEhE,OAAO,MAAM,8BAAa,CAAC,OAAO,CAAC,UAAU,EAAE;YAC7C,MAAM;SACP,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAEY,QAAA,oBAAoB,GAAG;IAClC,KAAK,CAAC,oBAAoB,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,OAAY;QACxE,IAAI,UAAU,GAAG,MAAM,8BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;QAEhE,OAAO,MAAM,8BAAa,CAAC,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IAC5D,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,OAAY;QACtE,IAAI,UAAU,GAAG,MAAM,8BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;QAEhE,OAAO,MAAM,8BAAa,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;IAC1D,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,OAAY;QACvE,IAAI,UAAU,GAAG,MAAM,8BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;QAEhE,OAAO,MAAM,8BAAa,CAAC,UAAU,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;IAC3D,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"accounting-item.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting-api/accounting-item.ts"],"names":[],"mappings":";;;AACA,wEAAmE;AAEtD,QAAA,mBAAmB,GAAG;IACjC,KAAK,CAAC,kBAAkB,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,OAAY;QAChF,IA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M,CAAC,CAAA;IAC3D,CAAC;CACF,CAAA","sourcesContent":["import { convertListParams, ListParam } from '@things-factory/shell'\nimport { AccountingAPI } from '../../../controllers/accounting-api'\n\nexport const queryAccountingItem = {\n async getAccountingItems(_: any, { accountingId, params: ListParam }, context: any) {\n var accounting = await AccountingAPI.getAccounting(accountingId)\n \n return await AccountingAPI.getItems(accounting, {\n pagination: {\n page: 0,\n limit: 100\n }\n })\n },\n\n async getAccountingItem(_: any, { accountingId, itemId }, context: any) {\n var accounting = await AccountingAPI.getAccounting(accountingId)\n \n return await AccountingAPI.getItem(accounting, {\n itemId\n })\n }\n}\n\nexport const mutateAccountingItem = {\n async createAccountingItem(_: any, { accountingId, newItem }, context: any) {\n var accounting = await AccountingAPI.getAccounting(accountingId)\n \n return await AccountingAPI.createItem(accounting, newItem)\n },\n\n async updateAccountingItem(_: any, { accountingId, patch }, context: any) {\n var accounting = await AccountingAPI.getAccounting(accountingId)\n \n return await AccountingAPI.updateItem(accounting, patch)\n },\n\n async deleteAccountingItem(_: any, { accountingId, itemId }, context: any) {\n var accounting = await AccountingAPI.getAccounting(accountingId)\n \n return await AccountingAPI.deleteItem(accounting, itemId)\n }\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"accounting-purchase-order.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting-api/accounting-purchase-order.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AAEtD,QAAA,4BAA4B,GAAG;IAC1C,KAAK,CAAC,2BAA2B,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,OAAY;QACzF,IAAI,UAAU,GAAG,MAAM,8BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;QAEhE,OAAO,MAAM,8BAAa,CAAC,iBAAiB,CAAC,UAAU,EAAE;YACvD,UAAU,EAAE;gBACV,IAAI,EAAE,CAAC;gBACP,KAAK,EAAE,GAAG;aACX;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"accounting-purchase-order.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting-api/accounting-purchase-order.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AAEtD,QAAA,4BAA4B,GAAG;IAC1C,KAAK,CAAC,2BAA2B,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,OAAY;QACzF,IAAI,UAAU,GAAG,MAAM,8BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;QAEhE,OAAO,MAAM,8BAAa,CAAC,iBAAiB,CAAC,UAAU,EAAE;YACvD,UAAU,EAAE;gBACV,IAAI,EAAE,CAAC;gBACP,KAAK,EAAE,GAAG;aACX;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import { AccountingAPI } from '../../../controllers/accounting-api'\n\nexport const queryAccountingPurchaseOrder = {\n async getAccountingPurchaseOrders(_: any, { accountingId, params: ListParam }, context: any) {\n var accounting = await AccountingAPI.getAccounting(accountingId)\n\n return await AccountingAPI.getPurchaseOrders(accounting, {\n pagination: {\n page: 0,\n limit: 100\n }\n })\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting-api/index.ts"],"names":[],"mappings":";;;AAAA,6DAAsF;AACtF,uDAA6E;AAC7E,2EAA0E;AAE7D,QAAA,KAAK,iDACb,2CAAsB,GACtB,qCAAmB,GACnB,wDAA4B,EAChC;AAEY,QAAA,QAAQ,mCAChB,4CAAuB,GACvB,sCAAoB,EACxB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting-api/index.ts"],"names":[],"mappings":";;;AAAA,6DAAsF;AACtF,uDAA6E;AAC7E,2EAA0E;AAE7D,QAAA,KAAK,iDACb,2CAAsB,GACtB,qCAAmB,GACnB,wDAA4B,EAChC;AAEY,QAAA,QAAQ,mCAChB,4CAAuB,GACvB,sCAAoB,EACxB","sourcesContent":["import { queryAccountingInvoice, mutateAccountingInvoice } from './accounting-invoice'\nimport { queryAccountingItem, mutateAccountingItem } from './accounting-item'\nimport { queryAccountingPurchaseOrder } from './accounting-purchase-order'\n\nexport const Query = {\n ...queryAccountingInvoice,\n ...queryAccountingItem,\n ...queryAccountingPurchaseOrder\n}\n\nexport const Mutation = {\n ...mutateAccountingInvoice,\n ...mutateAccountingItem\n}\n"]}
@@ -1,30 +1,8 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.mutations = exports.queries = void 0;
27
- const Accounting = __importStar(require("./accounting"));
4
+ const tslib_1 = require("tslib");
5
+ const Accounting = tslib_1.__importStar(require("./accounting"));
28
6
  exports.queries = [Accounting.Query];
29
7
  exports.mutations = [Accounting.Mutation];
30
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/graphql/resolvers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA0C;AAE7B,QAAA,OAAO,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;AAE5B,QAAA,SAAS,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/graphql/resolvers/index.ts"],"names":[],"mappings":";;;;AAAA,iEAA0C;AAE7B,QAAA,OAAO,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;AAE5B,QAAA,SAAS,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA","sourcesContent":["import * as Accounting from './accounting'\n\nexport const queries = [Accounting.Query]\n\nexport const mutations = [Accounting.Mutation]\n"]}