@things-factory/integration-accounting 5.0.7 → 6.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/controllers/accounting-api/decorators.js +2 -4
- package/dist-server/controllers/accounting-api/decorators.js.map +1 -1
- package/dist-server/controllers/accounting-api/index.js +55 -63
- package/dist-server/controllers/accounting-api/index.js.map +1 -1
- package/dist-server/controllers/index.js +2 -15
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/controllers/xero/apis/contact/get-contact.js.map +1 -1
- package/dist-server/controllers/xero/apis/contact/get-contacts.js.map +1 -1
- package/dist-server/controllers/xero/apis/contact/index.js +3 -16
- package/dist-server/controllers/xero/apis/contact/index.js.map +1 -1
- package/dist-server/controllers/xero/apis/index.js +5 -18
- package/dist-server/controllers/xero/apis/index.js.map +1 -1
- package/dist-server/controllers/xero/apis/invoice/create-invoice.js.map +1 -1
- package/dist-server/controllers/xero/apis/invoice/get-invoice.js.map +1 -1
- package/dist-server/controllers/xero/apis/invoice/get-invoices.js.map +1 -1
- package/dist-server/controllers/xero/apis/invoice/index.js +5 -18
- package/dist-server/controllers/xero/apis/invoice/index.js.map +1 -1
- package/dist-server/controllers/xero/apis/invoice/update-invoice.js.map +1 -1
- package/dist-server/controllers/xero/apis/item/create-item.js.map +1 -1
- package/dist-server/controllers/xero/apis/item/delete-item.js.map +1 -1
- package/dist-server/controllers/xero/apis/item/get-item.js.map +1 -1
- package/dist-server/controllers/xero/apis/item/get-items.js.map +1 -1
- package/dist-server/controllers/xero/apis/item/index.js +7 -20
- package/dist-server/controllers/xero/apis/item/index.js.map +1 -1
- package/dist-server/controllers/xero/apis/item/update-item.js.map +1 -1
- package/dist-server/controllers/xero/apis/item/update-items.js.map +1 -1
- package/dist-server/controllers/xero/apis/purchase-order/get-purchase-orders.js.map +1 -1
- package/dist-server/controllers/xero/apis/purchase-order/index.js +2 -15
- package/dist-server/controllers/xero/apis/purchase-order/index.js.map +1 -1
- package/dist-server/controllers/xero/index.js +3 -28
- package/dist-server/controllers/xero/index.js.map +1 -1
- package/dist-server/controllers/xero/platform-action.js.map +1 -1
- package/dist-server/controllers/xero/xero.js +4 -6
- package/dist-server/controllers/xero/xero.js.map +1 -1
- package/dist-server/engine/connector/accounting-connector.js.map +1 -1
- package/dist-server/engine/connector/index.js.map +1 -1
- package/dist-server/engine/index.js.map +1 -1
- package/dist-server/engine/task/accounting-api.js +3 -3
- package/dist-server/engine/task/accounting-api.js.map +1 -1
- package/dist-server/engine/task/index.js.map +1 -1
- package/dist-server/entities/account.js +40 -49
- package/dist-server/entities/account.js.map +1 -1
- package/dist-server/entities/index.js.map +1 -1
- package/dist-server/graphql/index.js +3 -25
- package/dist-server/graphql/index.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting/account.js +4 -4
- package/dist-server/graphql/resolvers/accounting/account.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting/accounts.js +1 -2
- package/dist-server/graphql/resolvers/accounting/accounts.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting/create-account.js +4 -3
- package/dist-server/graphql/resolvers/accounting/create-account.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting/delete-account.js +5 -5
- package/dist-server/graphql/resolvers/accounting/delete-account.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting/delete-accounts.js +5 -4
- package/dist-server/graphql/resolvers/accounting/delete-accounts.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting/index.js +2 -24
- package/dist-server/graphql/resolvers/accounting/index.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting/update-account.js +3 -3
- package/dist-server/graphql/resolvers/accounting/update-account.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting/update-multiple-accounts.js +3 -3
- package/dist-server/graphql/resolvers/accounting/update-multiple-accounts.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting/xero/deactivate-xero-account.js +6 -8
- package/dist-server/graphql/resolvers/accounting/xero/deactivate-xero-account.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting/xero/get-xero-auth-url.js +5 -7
- package/dist-server/graphql/resolvers/accounting/xero/get-xero-auth-url.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting/xero/index.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting/xero/refresh-xero-access-token.js +7 -9
- package/dist-server/graphql/resolvers/accounting/xero/refresh-xero-access-token.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting-api/accounting-invoice.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting-api/accounting-item.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting-api/accounting-purchase-order.js.map +1 -1
- package/dist-server/graphql/resolvers/accounting-api/index.js.map +1 -1
- package/dist-server/graphql/resolvers/index.js +2 -24
- package/dist-server/graphql/resolvers/index.js.map +1 -1
- package/dist-server/graphql/types/accounting/account-list.js +2 -4
- package/dist-server/graphql/types/accounting/account-list.js.map +1 -1
- package/dist-server/graphql/types/accounting/account-patch.js +2 -4
- package/dist-server/graphql/types/accounting/account-patch.js.map +1 -1
- package/dist-server/graphql/types/accounting/account.js +2 -4
- package/dist-server/graphql/types/accounting/account.js.map +1 -1
- package/dist-server/graphql/types/accounting/index.js.map +1 -1
- package/dist-server/graphql/types/accounting/new-account.js +2 -4
- package/dist-server/graphql/types/accounting/new-account.js.map +1 -1
- package/dist-server/graphql/types/accounting-api/invoice.js +2 -4
- package/dist-server/graphql/types/accounting-api/invoice.js.map +1 -1
- package/dist-server/graphql/types/accounting-api/item.js +2 -4
- package/dist-server/graphql/types/accounting-api/item.js.map +1 -1
- package/dist-server/graphql/types/accounting-api/purchase-order.js +2 -4
- package/dist-server/graphql/types/accounting-api/purchase-order.js.map +1 -1
- package/dist-server/graphql/types/index.js +5 -27
- package/dist-server/graphql/types/index.js.map +1 -1
- package/dist-server/index.js +5 -18
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/routers/xero-private-router.js +2 -4
- package/dist-server/routers/xero-private-router.js.map +1 -1
- package/dist-server/routers/xero-router.js +6 -9
- package/dist-server/routers/xero-router.js.map +1 -1
- package/dist-server/routes.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +16 -16
- package/server/controllers/accounting-api/index.ts +1 -1
- package/server/controllers/xero/xero.ts +1 -1
- package/server/engine/task/accounting-api.ts +3 -2
- package/server/graphql/resolvers/accounting/account.ts +4 -3
- package/server/graphql/resolvers/accounting/accounts.ts +2 -4
- package/server/graphql/resolvers/accounting/create-account.ts +9 -6
- package/server/graphql/resolvers/accounting/delete-account.ts +5 -4
- package/server/graphql/resolvers/accounting/delete-accounts.ts +7 -4
- package/server/graphql/resolvers/accounting/update-account.ts +4 -3
- package/server/graphql/resolvers/accounting/update-multiple-accounts.ts +4 -3
- package/server/graphql/resolvers/accounting/xero/deactivate-xero-account.ts +6 -4
- package/server/graphql/resolvers/accounting/xero/get-xero-auth-url.ts +6 -4
- package/server/graphql/resolvers/accounting/xero/refresh-xero-access-token.ts +7 -5
- package/server/graphql/resolvers/accounting-api/accounting-invoice.ts +9 -9
- package/server/graphql/resolvers/accounting-api/accounting-item.ts +11 -12
- package/server/graphql/resolvers/accounting-api/accounting-purchase-order.ts +1 -1
- package/server/routers/xero-router.ts +2 -3
|
@@ -1,19 +1,17 @@
|
|
|
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
|
|
8
|
-
const
|
|
9
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
6
|
+
const shell_1 = require("@things-factory/shell");
|
|
10
7
|
const controllers_1 = require("../../../../controllers");
|
|
8
|
+
const entities_1 = require("../../../../entities");
|
|
11
9
|
const debug = require('debug')('things-factory:integration-accounting:deactivate-xero-account');
|
|
12
10
|
exports.deactivateXeroAccount = {
|
|
13
11
|
async deactivateXeroAccount(_, { id }, context) {
|
|
14
|
-
const repository = (0,
|
|
12
|
+
const repository = (0, shell_1.getRepository)(entities_1.Account);
|
|
15
13
|
const account = await repository.findOne({
|
|
16
|
-
where: { domain: context.state.domain, id }
|
|
14
|
+
where: { domain: { id: context.state.domain.id }, id }
|
|
17
15
|
});
|
|
18
16
|
try {
|
|
19
17
|
const connection = JSON.parse(account.accountInfo);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deactivate-xero-account.js","sourceRoot":"","sources":["../../../../../server/graphql/resolvers/accounting/xero/deactivate-xero-account.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deactivate-xero-account.js","sourceRoot":"","sources":["../../../../../server/graphql/resolvers/accounting/xero/deactivate-xero-account.ts"],"names":[],"mappings":";;;;AAAA,oEAA8B;AAE9B,iDAAqD;AAErD,yDAA2D;AAC3D,mDAA8C;AAE9C,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,OAAwB;QAClE,MAAM,UAAU,GAAG,IAAA,qBAAa,EAAC,kBAAO,CAAC,CAAA;QACzC,MAAM,OAAO,GAAQ,MAAM,UAAU,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACvD,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'\n\nimport { getRepository } from '@things-factory/shell'\n\nimport { ACCOUNTING_STATUS } from '../../../../controllers'\nimport { Account } from '../../../../entities'\n\nconst debug = require('debug')('things-factory:integration-accounting:deactivate-xero-account')\n\nexport const deactivateXeroAccount = {\n async deactivateXeroAccount(_: any, { id }, context: ResolverContext) {\n const repository = getRepository(Account)\n const account: any = await repository.findOne({\n where: { domain: { id: context.state.domain.id }, 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;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const crypto_1 = tslib_1.__importDefault(require("crypto"));
|
|
9
6
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
7
|
+
const env_1 = require("@things-factory/env");
|
|
8
|
+
const shell_1 = require("@things-factory/shell");
|
|
10
9
|
const xero_1 = require("../../../../controllers/xero");
|
|
11
10
|
const xeroConfig = env_1.config.get('accountingIntegrationXero', {});
|
|
12
11
|
const { apiKey, apiSecret, callback } = xeroConfig;
|
|
13
|
-
const crypto_1 = __importDefault(require("crypto"));
|
|
14
12
|
function makeVerificationTokenForNonce() {
|
|
15
13
|
return crypto_1.default.randomBytes(16).toString('hex');
|
|
16
14
|
}
|
|
@@ -21,7 +19,7 @@ exports.getXeroAuthURL = {
|
|
|
21
19
|
const xero = new xero_1.Xero({ apiKey, apiSecret, callback });
|
|
22
20
|
/* generate verification-token as a nonce */
|
|
23
21
|
const nonce = makeVerificationTokenForNonce();
|
|
24
|
-
await (0,
|
|
22
|
+
await (0, shell_1.getRepository)(auth_base_1.VerificationToken).save({
|
|
25
23
|
userId: user.id,
|
|
26
24
|
token: nonce,
|
|
27
25
|
type: auth_base_1.VerificationTokenType.REQUEST_ACCESS_TOKEN,
|
|
@@ -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":"
|
|
1
|
+
{"version":3,"file":"get-xero-auth-url.js","sourceRoot":"","sources":["../../../../../server/graphql/resolvers/accounting/xero/get-xero-auth-url.ts"],"names":[],"mappings":";;;;AAAA,4DAA2B;AAE3B,yDAAoF;AACpF,6CAA4C;AAC5C,iDAAqD;AAErD,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;AAElD,SAAgB,6BAA6B;IAC3C,OAAO,gBAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC/C,CAAC;AAFD,sEAEC;AAEY,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,cAAc,CAAC,CAAM,EAAE,EAAE,UAAU,EAAE,EAAE,OAAwB;QACnE,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,qBAAa,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 crypto from 'crypto'\n\nimport { VerificationToken, VerificationTokenType } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { getRepository } from '@things-factory/shell'\n\nimport { Xero } from '../../../../controllers/xero'\n\nconst xeroConfig = config.get('accountingIntegrationXero', {})\nconst { apiKey, apiSecret, callback } = xeroConfig\n\nexport function makeVerificationTokenForNonce() {\n return crypto.randomBytes(16).toString('hex')\n}\n\nexport const getXeroAuthURL = {\n async getXeroAuthURL(_: any, { accounting }, context: ResolverContext) {\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,22 +1,20 @@
|
|
|
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
|
|
8
|
-
const
|
|
9
|
-
const entities_1 = require("../../../../entities");
|
|
10
|
-
const utils_1 = require("@things-factory/utils");
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
11
6
|
const env_1 = require("@things-factory/env");
|
|
7
|
+
const shell_1 = require("@things-factory/shell");
|
|
8
|
+
const utils_1 = require("@things-factory/utils");
|
|
9
|
+
const entities_1 = require("../../../../entities");
|
|
12
10
|
const xeroConfig = env_1.config.get('accountingIntegrationXero', {});
|
|
13
11
|
const { apiKey, apiSecret } = xeroConfig;
|
|
14
12
|
const debug = require('debug')('things-factory:integration-accounting:refresh-xero-access-token');
|
|
15
13
|
exports.refreshXeroAccessToken = {
|
|
16
14
|
async refreshXeroAccessToken(_, { id }, context) {
|
|
17
|
-
const repository = (0,
|
|
15
|
+
const repository = (0, shell_1.getRepository)(entities_1.Account);
|
|
18
16
|
const account = await repository.findOne({
|
|
19
|
-
where: { domain: context.state.domain, id }
|
|
17
|
+
where: { domain: { id: context.state.domain.id }, id }
|
|
20
18
|
});
|
|
21
19
|
const refreshRequestData = {
|
|
22
20
|
grant_type: 'refresh_token',
|
|
@@ -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":"
|
|
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;AAE9B,6CAA4C;AAC5C,iDAAqD;AACrD,iDAAgD;AAEhD,mDAA8C;AAE9C,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,OAAwB;QACnE,MAAM,UAAU,GAAG,IAAA,qBAAa,EAAC,kBAAO,CAAC,CAAA;QACzC,MAAM,OAAO,GAAQ,MAAM,UAAU,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACvD,CAAC,CAAA;QAEF,MAAM,kBAAkB,GAAG;YACzB,UAAU,EAAE,eAAe;YAC3B,aAAa,EAAE,OAAO,CAAC,YAAY;SACpC,CAAA;QAED,MAAM,eAAe,GAAG,MAAM,IAAA,oBAAK,EAAC,yCAAyC,EAAE;YAC7E,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,GAAG,SAAS,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;gBAClF,cAAc,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,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'\n\nimport { config } from '@things-factory/env'\nimport { getRepository } from '@things-factory/shell'\nimport { parseJwt } from '@things-factory/utils'\n\nimport { Account } from '../../../../entities'\n\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: ResolverContext) {\n const repository = getRepository(Account)\n const account: any = await repository.findOne({\n where: { domain: { id: context.state.domain.id }, 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,
|
|
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,EAAE,EAAE,OAAwB;QAC/F,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,OAAwB;QACtF,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,OAAwB;QAC1F,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,OAAwB;QACrF,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: ResolverContext) {\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: ResolverContext) {\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: ResolverContext) {\n var accounting = await AccountingAPI.getAccounting(accountingId)\n\n return await AccountingAPI.createInvoice(accounting, newInvoice)\n },\n\n async updateAccountingInvoice(_: any, { accountingId, patch }, context: ResolverContext) {\n var accounting = await AccountingAPI.getAccounting(accountingId)\n\n return await AccountingAPI.updateInvoice(accounting, patch)\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounting-item.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting-api/accounting-item.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"accounting-item.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/accounting-api/accounting-item.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AAEtD,QAAA,mBAAmB,GAAG;IACjC,KAAK,CAAC,kBAAkB,CAAC,CAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,OAAwB;QAC5F,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,OAAwB;QAChF,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,OAAwB;QACpF,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,OAAwB;QAClF,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,OAAwB;QACnF,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","sourcesContent":["import { AccountingAPI } from '../../../controllers/accounting-api'\n\nexport const queryAccountingItem = {\n async getAccountingItems(_: any, { accountingId, params: ListParam }, context: ResolverContext) {\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: ResolverContext) {\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: ResolverContext) {\n var accounting = await AccountingAPI.getAccounting(accountingId)\n\n return await AccountingAPI.createItem(accounting, newItem)\n },\n\n async updateAccountingItem(_: any, { accountingId, patch }, context: ResolverContext) {\n var accounting = await AccountingAPI.getAccounting(accountingId)\n\n return await AccountingAPI.updateItem(accounting, patch)\n },\n\n async deleteAccountingItem(_: any, { accountingId, itemId }, context: ResolverContext) {\n var accounting = await AccountingAPI.getAccounting(accountingId)\n\n return await AccountingAPI.deleteItem(accounting, itemId)\n }\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,
|
|
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,OAAwB;QACrG,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: ResolverContext) {\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
|
|
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":"
|
|
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"]}
|
|
@@ -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.AccountList = void 0;
|
|
7
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
8
6
|
exports.AccountList = (0, graphql_tag_1.default) `
|
|
9
7
|
type AccountList {
|
|
10
8
|
items: [Account]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-list.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting/account-list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"account-list.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting/account-list.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAEhB,QAAA,WAAW,GAAG,IAAA,qBAAG,EAAA;;;;;CAK7B,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nexport const AccountList = gql`\n type AccountList {\n items: [Account]\n total: Int\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.AccountPatch = void 0;
|
|
7
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
8
6
|
exports.AccountPatch = (0, graphql_tag_1.default) `
|
|
9
7
|
input AccountPatch {
|
|
10
8
|
id: String
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-patch.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting/account-patch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"account-patch.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting/account-patch.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAEhB,QAAA,YAAY,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;CAW9B,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nexport const AccountPatch = gql`\n input AccountPatch {\n id: String\n name: String\n description: String\n platform: String\n accountId: String\n countryCode: String\n trackedInventory: Boolean\n cuFlag: String\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.Account = void 0;
|
|
7
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
8
6
|
exports.Account = (0, graphql_tag_1.default) `
|
|
9
7
|
type Account {
|
|
10
8
|
id: String
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting/account.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting/account.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAEhB,QAAA,OAAO,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;CAsBzB,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nexport const Account = gql`\n type Account {\n id: String\n name: String\n domain: Domain\n description: String\n platform: String\n accountId: String\n countryCode: String\n status: String\n accessInfo: String\n accessToken: String\n refreshToken: String\n trackedInventory: Boolean\n expiresIn: String\n tokenType: String\n accountInfo: String\n updater: User\n creator: User\n updatedAt: String\n createdAt: String\n }\n`\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AACnC,+CAA0C;AAC1C,mDAA8C;AAC9C,iDAA4C;AAE/B,QAAA,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BvB,CAAA;AAEY,QAAA,KAAK,GAAG;;;;;CAKpB,CAAA;AAEY,QAAA,KAAK,GAAG,CAAC,iBAAO,EAAE,wBAAU,EAAE,4BAAY,EAAE,0BAAW,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AACnC,+CAA0C;AAC1C,mDAA8C;AAC9C,iDAA4C;AAE/B,QAAA,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BvB,CAAA;AAEY,QAAA,KAAK,GAAG;;;;;CAKpB,CAAA;AAEY,QAAA,KAAK,GAAG,CAAC,iBAAO,EAAE,wBAAU,EAAE,4BAAY,EAAE,0BAAW,CAAC,CAAA","sourcesContent":["import { Account } from './account'\nimport { NewAccount } from './new-account'\nimport { AccountPatch } from './account-patch'\nimport { AccountList } from './account-list'\n\nexport const Mutation = `\n createAccount (\n account: NewAccount!\n ): Account\n\n updateAccount (\n id: String!\n patch: AccountPatch!\n ): Account\n\n updateMultipleAccount (\n patches: [AccountPatch]!\n ): [Account]\n\n deleteAccount (\n id: String!\n ): Boolean\n\n deleteAccounts (\n ids: [String]!\n ): Boolean\n\n refreshXeroAccessToken (\n id: String!\n ): Account\n\n deactivateXeroAccount (\n id: String!\n ): Account\n`\n\nexport const Query = `\n accounts(filters: [Filter], pagination: Pagination, sortings: [Sorting]): AccountList\n account(id: String!): Account\n \n getXeroAuthURL(accounting: String!): String\n`\n\nexport const Types = [Account, NewAccount, AccountPatch, AccountList]\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.NewAccount = void 0;
|
|
7
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
8
6
|
exports.NewAccount = (0, graphql_tag_1.default) `
|
|
9
7
|
input NewAccount {
|
|
10
8
|
name: String!
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-account.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting/new-account.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"new-account.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting/new-account.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAEhB,QAAA,UAAU,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;CAS5B,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nexport const NewAccount = gql`\n input NewAccount {\n name: String!\n description: String\n platform: String!\n accountId: String\n trackedInventory: Boolean\n countryCode: String\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.Types = exports.Query = exports.Mutation = void 0;
|
|
7
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
8
6
|
const NewAccountInvoice = (0, graphql_tag_1.default) `
|
|
9
7
|
input NewAccountInvoice {
|
|
10
8
|
name: String!
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting-api/invoice.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"invoice.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting-api/invoice.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAE7B,MAAM,iBAAiB,GAAG,IAAA,qBAAG,EAAA;;;;;CAK5B,CAAA;AAED,MAAM,kBAAkB,GAAG,IAAA,qBAAG,EAAA;;;;;CAK7B,CAAA;AAED,MAAM,mBAAmB,GAAG,IAAA,qBAAG,EAAA;;;;;;;CAO9B,CAAA;AAED,MAAM,cAAc,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;CAWzB,CAAA;AAEY,QAAA,QAAQ,GAAG;;;;;;;;;;CAUvB,CAAA;AAEY,QAAA,KAAK,GAAG;;;;;;;;;;;;CAYpB,CAAA;AAEY,QAAA,KAAK,GAAG,CAAC,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,kBAAkB,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nconst NewAccountInvoice = gql`\n input NewAccountInvoice {\n name: String!\n description: String\n }\n`\n\nconst AccountInvoiceList = gql`\n type AccountInvoiceList {\n items: [AccountInvoice]\n total: Int\n }\n`\n\nconst AccountInvoicePatch = gql`\n input AccountInvoicePatch {\n id: String!\n name: String\n description: String\n cuFlag: String\n }\n`\n\nconst AccountInvoice = gql`\n type AccountInvoice {\n id: String\n name: String\n domain: Domain\n description: String\n updater: User\n creator: User\n updatedAt: String\n createdAt: String\n }\n`\n\nexport const Mutation = `\n createAccountInvoice(\n accountingId: String!\n invoice: NewAccountInvoice!\n ): AccountInvoice\n\n updateAccountInvoice(\n accountingId: String!\n patch: AccountInvoicePatch!\n ): AccountInvoice\n`\n\nexport const Query = `\n getAccountInvoices(\n accountingId: String!\n filters: [Filter]\n pagination: Pagination\n sortings: [Sorting] \n ): AccountInvoiceList\n \n getAccountInvoice(\n accountingId: String!\n invoiceNo: String!\n ): AccountInvoice\n`\n\nexport const Types = [AccountInvoice, NewAccountInvoice, AccountInvoicePatch, AccountInvoiceList]\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.Types = exports.Query = exports.Mutation = void 0;
|
|
7
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
8
6
|
const NewAccountItem = (0, graphql_tag_1.default) `
|
|
9
7
|
input NewAccountItem {
|
|
10
8
|
name: String!
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting-api/item.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"item.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting-api/item.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAE7B,MAAM,cAAc,GAAG,IAAA,qBAAG,EAAA;;;;;CAKzB,CAAA;AAED,MAAM,eAAe,GAAG,IAAA,qBAAG,EAAA;;;;;CAK1B,CAAA;AAED,MAAM,gBAAgB,GAAG,IAAA,qBAAG,EAAA;;;;;;;CAO3B,CAAA;AAED,MAAM,WAAW,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;CAWtB,CAAA;AACY,QAAA,QAAQ,GAAG;;;;;;;;;;CAUvB,CAAA;AAEY,QAAA,KAAK,GAAG;;;;;;;;;;;;CAYpB,CAAA;AAEY,QAAA,KAAK,GAAG,CAAC,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nconst NewAccountItem = gql`\n input NewAccountItem {\n name: String!\n description: String\n }\n`\n\nconst AccountItemList = gql`\n type AccountItemList {\n items: [AccountItem]\n total: Int\n }\n`\n\nconst AccountItemPatch = gql`\n input AccountItemPatch {\n id: String\n name: String\n description: String\n cuFlag: String\n }\n`\n\nconst AccountItem = gql`\n type AccountItem {\n id: String\n name: String\n domain: Domain\n description: String\n updater: User\n creator: User\n updatedAt: String\n createdAt: String\n }\n`\nexport const Mutation = `\n createAccountItem(\n accountingId: String!\n item: NewAccountItem!\n ): AccountItem\n\n updateAccountItem(\n accountingId: String!\n patch: AccountItemPatch!\n ): AccountItem\n`\n\nexport const Query = `\n getAccountItems(\n accountingId: String!\n filters: [Filter]\n pagination: Pagination\n sortings: [Sorting] \n ): AccountItemList\n \n getAccountItem(\n accountingId: String!\n itemId: String!\n ): AccountItem\n`\n\nexport const Types = [AccountItem, NewAccountItem, AccountItemPatch, AccountItemList]\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.Types = exports.Query = void 0;
|
|
7
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
8
6
|
const AccountPurchaseOrderList = (0, graphql_tag_1.default) `
|
|
9
7
|
type AccountPurchaseOrderList {
|
|
10
8
|
items: [AccountPurchaseOrder]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purchase-order.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting-api/purchase-order.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"purchase-order.js","sourceRoot":"","sources":["../../../../server/graphql/types/accounting-api/purchase-order.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAE7B,MAAM,wBAAwB,GAAG,IAAA,qBAAG,EAAA;;;;;CAKnC,CAAA;AACD,MAAM,oBAAoB,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;CAW/B,CAAA;AACY,QAAA,KAAK,GAAG;;;;;;;;CAQpB,CAAA;AACY,QAAA,KAAK,GAAG,CAAC,oBAAoB,EAAE,wBAAwB,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nconst AccountPurchaseOrderList = gql`\n type AccountPurchaseOrderList {\n items: [AccountPurchaseOrder]\n total: Int\n }\n`\nconst AccountPurchaseOrder = gql`\n type AccountPurchaseOrder {\n id: String\n name: String\n domain: Domain\n description: String\n updater: User\n creator: User\n updatedAt: String\n createdAt: String\n }\n`\nexport const Query = `\n getAccountPurchaseOrders(\n accountingId: String!\n filters: [Filter]\n pagination: Pagination\n sortings: [Sorting] \n ): AccountPurchaseOrderList\n \n`\nexport const Types = [AccountPurchaseOrder, AccountPurchaseOrderList]\n"]}
|
|
@@ -1,33 +1,11 @@
|
|
|
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.types = exports.mutations = exports.queries = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const Accounting = tslib_1.__importStar(require("./accounting"));
|
|
6
|
+
const Invoice = tslib_1.__importStar(require("./accounting-api/invoice"));
|
|
7
|
+
const Item = tslib_1.__importStar(require("./accounting-api/item"));
|
|
8
|
+
const PurchaseOrder = tslib_1.__importStar(require("./accounting-api/purchase-order"));
|
|
31
9
|
exports.queries = [Accounting.Query, Invoice.Query, Item.Query, PurchaseOrder.Query];
|
|
32
10
|
exports.mutations = [Accounting.Mutation, Invoice.Mutation, Item.Mutation];
|
|
33
11
|
exports.types = [...Accounting.Types, ...Invoice.Types, ...Item.Types, ...PurchaseOrder.Types];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/graphql/types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/graphql/types/index.ts"],"names":[],"mappings":";;;;AAAA,iEAA0C;AAC1C,0EAAmD;AACnD,oEAA6C;AAC7C,uFAAgE;AAEnD,QAAA,OAAO,GAAG,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAA;AAE5E,QAAA,SAAS,GAAG,CAAC,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;AAElE,QAAA,KAAK,GAAG,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAA","sourcesContent":["import * as Accounting from './accounting'\nimport * as Invoice from './accounting-api/invoice'\nimport * as Item from './accounting-api/item'\nimport * as PurchaseOrder from './accounting-api/purchase-order'\n\nexport const queries = [Accounting.Query, Invoice.Query, Item.Query, PurchaseOrder.Query]\n\nexport const mutations = [Accounting.Mutation, Invoice.Mutation, Item.Mutation]\n\nexport const types = [...Accounting.Types, ...Invoice.Types, ...Item.Types, ...PurchaseOrder.Types]\n"]}
|
package/dist-server/index.js
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
20
|
-
__exportStar(require("./
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./entities"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./migrations"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./graphql"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./controllers"), exports);
|
|
21
8
|
require("./routes");
|
|
22
9
|
require("./engine");
|
|
23
10
|
process.on('bootstrap-module-start', async ({ app, config, client }) => { });
|
package/dist-server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B;AAC1B,uDAA4B;AAC5B,oDAAyB;AACzB,wDAA6B;AAE7B,oBAAiB;AACjB,oBAAiB;AAEjB,OAAO,CAAC,EAAE,CAAC,wBAA+B,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAO,EAAE,EAAE,GAAE,CAAC,CAAC,CAAA","sourcesContent":["export * from './entities'\nexport * from './migrations'\nexport * from './graphql'\nexport * from './controllers'\n\nimport './routes'\nimport './engine'\n\nprocess.on('bootstrap-module-start' as any, async ({ app, config, client }: any) => {})\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/migrations/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEjB,QAAA,UAAU,GAAG,EAAE,CAAA;AAE1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;IACzE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAAE,OAAM;IAC3C,kBAAU,GAAG,kBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAClF,CAAC,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/migrations/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEjB,QAAA,UAAU,GAAG,EAAE,CAAA;AAE1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;IACzE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAAE,OAAM;IAC3C,kBAAU,GAAG,kBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAClF,CAAC,CAAC,CAAA","sourcesContent":["const glob = require('glob')\nconst path = require('path')\n\nexport var migrations = []\n\nglob.sync(path.resolve(__dirname, '.', '**', '*.js')).forEach(function(file) {\n if (file.indexOf('index.js') !== -1) return\n migrations = migrations.concat(Object.values(require(path.resolve(file))) || [])\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.xeroPrivateRouter = void 0;
|
|
7
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const koa_router_1 = tslib_1.__importDefault(require("koa-router"));
|
|
8
6
|
const env_1 = require("@things-factory/env");
|
|
9
7
|
const shell_1 = require("@things-factory/shell");
|
|
10
8
|
const isPathBaseDomain = !env_1.config.get('subdomain') && !env_1.config.get('useVirtualHostBasedDomain');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xero-private-router.js","sourceRoot":"","sources":["../../server/routers/xero-private-router.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"xero-private-router.js","sourceRoot":"","sources":["../../server/routers/xero-private-router.ts"],"names":[],"mappings":";;;;AAAA,oEAA+B;AAE/B,6CAA4C;AAC5C,iDAAgE;AAEhE,MAAM,gBAAgB,GAAG,CAAC,YAAM,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,YAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAA;AAE7F,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,mDAAmD,CAAC,CAAA;AAEtE,QAAA,iBAAiB,GAAG,IAAI,oBAAM,EAAE,CAAA;AAE7C,yBAAiB,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,wBAAwB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAClH,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAEhC,MAAM,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;IACpE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAA;IAEjE,OAAO,CAAC,QAAQ,CACd,GAAG,IAAA,gCAAwB,EACzB,OAAO,EACP,MAAM,CAAC,SAAS,CACjB,gBAAgB,EAAE,4BAA4B,MAAM,YAAY,OAAO,EAAE,CAC3E,CAAA;AACH,CAAC,CAAC,CAAA","sourcesContent":["import Router from 'koa-router'\n\nimport { config } from '@things-factory/env'\nimport { getRedirectSubdomainPath } from '@things-factory/shell'\n\nconst isPathBaseDomain = !config.get('subdomain') && !config.get('useVirtualHostBasedDomain')\n\nconst debug = require('debug')('things-factory:integration-accounting:xero-router')\n\nexport const xeroPrivateRouter = new Router()\n\nxeroPrivateRouter.get(`${isPathBaseDomain ? '/domain/:domain' : ''}/callback-private-xero`, async (context, next) => {\n const { domain } = context.state\n\n const xeroAccountingCookies = context.cookies.get('xero-accounting')\n const { id, status, message } = JSON.parse(xeroAccountingCookies)\n\n context.redirect(\n `${getRedirectSubdomainPath(\n context,\n domain.subdomain\n )}account-xero/${id}/connect-callback?status=${status}&message=${message}`\n )\n})\n"]}
|
|
@@ -1,12 +1,9 @@
|
|
|
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.xeroRouter = void 0;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const koa_router_1 = tslib_1.__importDefault(require("koa-router"));
|
|
6
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
10
7
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
11
8
|
const env_1 = require("@things-factory/env");
|
|
12
9
|
const shell_1 = require("@things-factory/shell");
|
|
@@ -19,7 +16,7 @@ exports.xeroRouter = new koa_router_1.default();
|
|
|
19
16
|
exports.xeroRouter.get('/callback-xero', async (context, next) => {
|
|
20
17
|
try {
|
|
21
18
|
const { code, state: nonce } = context.query;
|
|
22
|
-
const verificationTokenRepository = (0,
|
|
19
|
+
const verificationTokenRepository = (0, shell_1.getRepository)(auth_base_1.VerificationToken);
|
|
23
20
|
var verification = await verificationTokenRepository.findOne({
|
|
24
21
|
where: {
|
|
25
22
|
token: nonce,
|
|
@@ -87,8 +84,8 @@ exports.xeroRouter.get('/callback-xero', async (context, next) => {
|
|
|
87
84
|
tokenType,
|
|
88
85
|
expiresIn: new Date(exp * 1000)
|
|
89
86
|
};
|
|
90
|
-
var user = await (0,
|
|
91
|
-
account = await (0,
|
|
87
|
+
var user = await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: userId });
|
|
88
|
+
account = await (0, shell_1.getRepository)(entities_1.Account).save(Object.assign(Object.assign(Object.assign({}, account), patch), { updater: user }));
|
|
92
89
|
context.cookies.set('xero-accounting', JSON.stringify(Object.assign(Object.assign({}, account), { message: 'success to activate' })), {
|
|
93
90
|
httpOnly: true
|
|
94
91
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xero-router.js","sourceRoot":"","sources":["../../server/routers/xero-router.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"xero-router.js","sourceRoot":"","sources":["../../server/routers/xero-router.ts"],"names":[],"mappings":"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","sourcesContent":["import Router from 'koa-router'\nimport fetch from 'node-fetch'\n\nimport { User, VerificationToken, VerificationTokenType } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { getRepository, getUrlFromContext } from '@things-factory/shell'\nimport { parseJwt } from '@things-factory/utils'\n\nimport { ACCOUNTING_STATUS, AccountingAPI } from '../controllers/accounting-api'\nimport { Account } from '../entities'\n\nconst { apiKey, apiSecret, hostname, callback: redirect_uri } = config.get('accountingIntegrationXero', {})\n\nconst debug = require('debug')('things-factory:integration-accounting:xero-router')\n\nexport const xeroRouter = new Router()\n\nxeroRouter.get('/callback-xero', async (context, next) => {\n try {\n const { code, state: nonce } = context.query\n\n const verificationTokenRepository = getRepository(VerificationToken)\n\n var verification: VerificationToken = await verificationTokenRepository.findOne({\n where: {\n token: nonce,\n type: VerificationTokenType.REQUEST_ACCESS_TOKEN\n }\n })\n\n const { userId, suppliment: accountId } = verification\n\n await verificationTokenRepository.delete({\n userId,\n token: nonce,\n type: VerificationTokenType.REQUEST_ACCESS_TOKEN\n })\n\n var account = await AccountingAPI.getAccounting(accountId)\n const connectRequestData = {\n grant_type: 'authorization_code',\n code,\n redirect_uri\n }\n\n const connectResponse = 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(connectRequestData)\n .map(([key, value]) => encodeURIComponent(key) + '=' + encodeURIComponent(value))\n .join('&')\n })\n\n if (!connectResponse.ok) {\n throw new Error(`get account information failed: ${await connectResponse.text()}`)\n }\n\n const body = await connectResponse.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 /* decode access_token to get auth-event-id */\n const accessInfo = parseJwt(access_token)\n const { authentication_event_id, exp } = accessInfo\n\n /* get connections through the authentication_event_id */\n const connectionsResponse = await fetch(`https://api.xero.com/connections?authEventId=${authentication_event_id}`, {\n method: 'get',\n headers: {\n Authorization: `Bearer ${access_token}`,\n 'Content-Type': 'application/json'\n }\n })\n\n if (!connectionsResponse.ok) {\n context.throw(connectionsResponse.status, `get connection list failed: ${await connectionsResponse.text()}`)\n }\n\n const connections = await connectionsResponse.json()\n debug('connections', connections)\n\n var connection = connections[0]\n if (!connection) {\n context.throw(400, 'connection not found for this access token')\n }\n\n var patch = {\n name: connection.tenantName,\n accessToken: access_token,\n refreshToken: refresh_token,\n accessInfo: JSON.stringify(accessInfo, null, 2),\n accountInfo: JSON.stringify(connection, null, 2),\n accountId: connection.tenantId,\n status: ACCOUNTING_STATUS.ACTIVE,\n tokenType,\n expiresIn: new Date(exp * 1000)\n }\n\n var user = await getRepository(User).findOneBy({ id: userId })\n\n account = await getRepository(Account).save({\n ...account,\n ...patch,\n updater: user\n })\n\n context.cookies.set(\n 'xero-accounting',\n JSON.stringify({\n ...account,\n message: 'success to activate'\n }),\n {\n httpOnly: true\n }\n )\n\n context.redirect(getUrlFromContext(context, '/callback-private-xero'))\n } catch (err) {\n var message: string = err.message\n\n if (account) {\n context.cookies.set(\n 'xero-accounting',\n JSON.stringify({\n ...account,\n message\n }),\n {\n httpOnly: true\n }\n )\n\n context.redirect(getUrlFromContext(context, '/callback-private-xero'))\n return\n }\n\n throw err\n }\n})\n\nxeroRouter.post('/webhook-xero', async (context, next) => {\n context.status = 200\n})\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../server/routes.ts"],"names":[],"mappings":";;AAAA,uEAAiE;AACjE,uDAAkD;AAElD,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF,kBAAkB,CAAC,GAAG,CAAC,wBAAU,CAAC,MAAM,EAAE,EAAE,wBAAU,CAAC,cAAc,EAAE,CAAC,CAAA;AAC1E,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE;IACtF,mBAAmB,CAAC,GAAG,CAAC,uCAAiB,CAAC,MAAM,EAAE,EAAE,uCAAiB,CAAC,cAAc,EAAE,CAAC,CAAA;AACzF,CAAC,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../server/routes.ts"],"names":[],"mappings":";;AAAA,uEAAiE;AACjE,uDAAkD;AAElD,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF,kBAAkB,CAAC,GAAG,CAAC,wBAAU,CAAC,MAAM,EAAE,EAAE,wBAAU,CAAC,cAAc,EAAE,CAAC,CAAA;AAC1E,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE;IACtF,mBAAmB,CAAC,GAAG,CAAC,uCAAiB,CAAC,MAAM,EAAE,EAAE,uCAAiB,CAAC,cAAc,EAAE,CAAC,CAAA;AACzF,CAAC,CAAC,CAAA","sourcesContent":["import { xeroPrivateRouter } from './routers/xero-private-router'\nimport { xeroRouter } from './routers/xero-router'\n\nprocess.on('bootstrap-module-global-public-route' as any, (app, globalPublicRouter) => {\n globalPublicRouter.use(xeroRouter.routes(), xeroRouter.allowedMethods())\n})\n\nprocess.on('bootstrap-module-domain-private-route' as any, (app, domainPrivateRouter) => {\n domainPrivateRouter.use(xeroPrivateRouter.routes(), xeroPrivateRouter.allowedMethods())\n})\n"]}
|