@things-factory/integration-accounting 4.3.656 → 4.3.671
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/package.json +15 -15
- package/dist-server/constants/account.js +0 -14
- package/dist-server/constants/account.js.map +0 -1
- package/dist-server/constants/index.js +0 -18
- package/dist-server/constants/index.js.map +0 -1
- package/dist-server/controllers/accounting-api/decorators.js +0 -35
- package/dist-server/controllers/accounting-api/decorators.js.map +0 -1
- package/dist-server/controllers/accounting-api/index.js +0 -237
- package/dist-server/controllers/accounting-api/index.js.map +0 -1
- package/dist-server/controllers/index.js +0 -21
- package/dist-server/controllers/index.js.map +0 -1
- package/dist-server/controllers/xero/apis/contact/get-contact.js +0 -33
- package/dist-server/controllers/xero/apis/contact/get-contact.js.map +0 -1
- package/dist-server/controllers/xero/apis/contact/get-contacts.js +0 -19
- package/dist-server/controllers/xero/apis/contact/get-contacts.js.map +0 -1
- package/dist-server/controllers/xero/apis/contact/index.js +0 -19
- package/dist-server/controllers/xero/apis/contact/index.js.map +0 -1
- package/dist-server/controllers/xero/apis/index.js +0 -21
- package/dist-server/controllers/xero/apis/index.js.map +0 -1
- package/dist-server/controllers/xero/apis/invoice/create-invoice.js +0 -17
- package/dist-server/controllers/xero/apis/invoice/create-invoice.js.map +0 -1
- package/dist-server/controllers/xero/apis/invoice/get-invoice.js +0 -19
- package/dist-server/controllers/xero/apis/invoice/get-invoice.js.map +0 -1
- package/dist-server/controllers/xero/apis/invoice/get-invoices.js +0 -60
- package/dist-server/controllers/xero/apis/invoice/get-invoices.js.map +0 -1
- package/dist-server/controllers/xero/apis/invoice/index.js +0 -21
- package/dist-server/controllers/xero/apis/invoice/index.js.map +0 -1
- package/dist-server/controllers/xero/apis/invoice/update-invoice.js +0 -17
- package/dist-server/controllers/xero/apis/invoice/update-invoice.js.map +0 -1
- package/dist-server/controllers/xero/apis/item/create-item.js +0 -33
- package/dist-server/controllers/xero/apis/item/create-item.js.map +0 -1
- package/dist-server/controllers/xero/apis/item/delete-item.js +0 -22
- package/dist-server/controllers/xero/apis/item/delete-item.js.map +0 -1
- package/dist-server/controllers/xero/apis/item/get-item.js +0 -35
- package/dist-server/controllers/xero/apis/item/get-item.js.map +0 -1
- package/dist-server/controllers/xero/apis/item/get-items.js +0 -33
- package/dist-server/controllers/xero/apis/item/get-items.js.map +0 -1
- package/dist-server/controllers/xero/apis/item/index.js +0 -23
- package/dist-server/controllers/xero/apis/item/index.js.map +0 -1
- package/dist-server/controllers/xero/apis/item/update-item.js +0 -31
- package/dist-server/controllers/xero/apis/item/update-item.js.map +0 -1
- package/dist-server/controllers/xero/apis/item/update-items.js +0 -37
- package/dist-server/controllers/xero/apis/item/update-items.js.map +0 -1
- package/dist-server/controllers/xero/apis/purchase-order/get-purchase-orders.js +0 -57
- package/dist-server/controllers/xero/apis/purchase-order/get-purchase-orders.js.map +0 -1
- package/dist-server/controllers/xero/apis/purchase-order/index.js +0 -18
- package/dist-server/controllers/xero/apis/purchase-order/index.js.map +0 -1
- package/dist-server/controllers/xero/index.js +0 -34
- package/dist-server/controllers/xero/index.js.map +0 -1
- package/dist-server/controllers/xero/platform-action.js +0 -49
- package/dist-server/controllers/xero/platform-action.js.map +0 -1
- package/dist-server/controllers/xero/xero.js +0 -157
- package/dist-server/controllers/xero/xero.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/goods-received/create-goods-received-note.js +0 -50
- package/dist-server/controllers/xilnex/apis/goods-received/create-goods-received-note.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/goods-received/index.js +0 -18
- package/dist-server/controllers/xilnex/apis/goods-received/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/index.js +0 -26
- package/dist-server/controllers/xilnex/apis/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/purchase-order/cancel-purchase-order.js +0 -22
- package/dist-server/controllers/xilnex/apis/purchase-order/cancel-purchase-order.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/purchase-order/create-purchase-receive.js +0 -45
- package/dist-server/controllers/xilnex/apis/purchase-order/create-purchase-receive.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/purchase-order/get-purchase-order.js +0 -47
- package/dist-server/controllers/xilnex/apis/purchase-order/get-purchase-order.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/purchase-order/index.js +0 -20
- package/dist-server/controllers/xilnex/apis/purchase-order/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/sales/get-sale.js +0 -18
- package/dist-server/controllers/xilnex/apis/sales/get-sale.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/sales/index.js +0 -18
- package/dist-server/controllers/xilnex/apis/sales/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/sales-order/create-sales-order.js +0 -89
- package/dist-server/controllers/xilnex/apis/sales-order/create-sales-order.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/sales-order/get-sales-order-invoice-histories.js +0 -18
- package/dist-server/controllers/xilnex/apis/sales-order/get-sales-order-invoice-histories.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/sales-order/index.js +0 -20
- package/dist-server/controllers/xilnex/apis/sales-order/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/sales-order/post-sales-order-to-sales-invoice.js +0 -24
- package/dist-server/controllers/xilnex/apis/sales-order/post-sales-order-to-sales-invoice.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/sales-return/create-sales-return.js +0 -49
- package/dist-server/controllers/xilnex/apis/sales-return/create-sales-return.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/sales-return/index.js +0 -18
- package/dist-server/controllers/xilnex/apis/sales-return/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/shipment/create-shipment.js +0 -33
- package/dist-server/controllers/xilnex/apis/shipment/create-shipment.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/shipment/index.js +0 -18
- package/dist-server/controllers/xilnex/apis/shipment/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/stock-request/get-stock-request.js +0 -51
- package/dist-server/controllers/xilnex/apis/stock-request/get-stock-request.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/stock-request/index.js +0 -18
- package/dist-server/controllers/xilnex/apis/stock-request/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/stocks/create-stock-adjust-record.js +0 -41
- package/dist-server/controllers/xilnex/apis/stocks/create-stock-adjust-record.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/stocks/index.js +0 -18
- package/dist-server/controllers/xilnex/apis/stocks/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/transfer-note/create-transfer-note.js +0 -43
- package/dist-server/controllers/xilnex/apis/transfer-note/create-transfer-note.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/transfer-note/delivery-transfer-note.js +0 -24
- package/dist-server/controllers/xilnex/apis/transfer-note/delivery-transfer-note.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/transfer-note/get-transfer-note.js +0 -49
- package/dist-server/controllers/xilnex/apis/transfer-note/get-transfer-note.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/transfer-note/index.js +0 -20
- package/dist-server/controllers/xilnex/apis/transfer-note/index.js.map +0 -1
- package/dist-server/controllers/xilnex/index.js +0 -34
- package/dist-server/controllers/xilnex/index.js.map +0 -1
- package/dist-server/controllers/xilnex/platform-action.js +0 -42
- package/dist-server/controllers/xilnex/platform-action.js.map +0 -1
- package/dist-server/controllers/xilnex/xilnex.js +0 -105
- package/dist-server/controllers/xilnex/xilnex.js.map +0 -1
- package/dist-server/engine/connector/accounting-connector.js +0 -28
- package/dist-server/engine/connector/accounting-connector.js.map +0 -1
- package/dist-server/engine/connector/index.js +0 -4
- package/dist-server/engine/connector/index.js.map +0 -1
- package/dist-server/engine/index.js +0 -5
- package/dist-server/engine/index.js.map +0 -1
- package/dist-server/engine/task/accounting-api.js +0 -54
- package/dist-server/engine/task/accounting-api.js.map +0 -1
- package/dist-server/engine/task/index.js +0 -4
- package/dist-server/engine/task/index.js.map +0 -1
- package/dist-server/entities/account-webhook-order.js +0 -76
- package/dist-server/entities/account-webhook-order.js.map +0 -1
- package/dist-server/entities/account.js +0 -137
- package/dist-server/entities/account.js.map +0 -1
- package/dist-server/entities/index.js +0 -9
- package/dist-server/entities/index.js.map +0 -1
- package/dist-server/graphql/index.js +0 -33
- package/dist-server/graphql/index.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/account-webhook-order.js +0 -15
- package/dist-server/graphql/resolvers/account-webhook-order/account-webhook-order.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/account-webhook-orders.js +0 -14
- package/dist-server/graphql/resolvers/account-webhook-order/account-webhook-orders.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/create-account-webhook-order.js +0 -12
- package/dist-server/graphql/resolvers/account-webhook-order/create-account-webhook-order.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/delete-account-webhook-order.js +0 -16
- package/dist-server/graphql/resolvers/account-webhook-order/delete-account-webhook-order.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/delete-account-webhook-orders.js +0 -19
- package/dist-server/graphql/resolvers/account-webhook-order/delete-account-webhook-orders.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/index.js +0 -13
- package/dist-server/graphql/resolvers/account-webhook-order/index.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/update-account-webhook-order.js +0 -15
- package/dist-server/graphql/resolvers/account-webhook-order/update-account-webhook-order.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/update-multiple-account-webhook-orders.js +0 -30
- package/dist-server/graphql/resolvers/account-webhook-order/update-multiple-account-webhook-orders.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting/account.js +0 -15
- package/dist-server/graphql/resolvers/accounting/account.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting/accounts.js +0 -14
- package/dist-server/graphql/resolvers/accounting/accounts.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting/create-account.js +0 -12
- package/dist-server/graphql/resolvers/accounting/create-account.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting/delete-account.js +0 -16
- package/dist-server/graphql/resolvers/accounting/delete-account.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting/delete-accounts.js +0 -19
- package/dist-server/graphql/resolvers/accounting/delete-accounts.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting/index.js +0 -37
- package/dist-server/graphql/resolvers/accounting/index.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting/update-account.js +0 -15
- package/dist-server/graphql/resolvers/accounting/update-account.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting/update-multiple-accounts.js +0 -30
- package/dist-server/graphql/resolvers/accounting/update-multiple-accounts.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting/xero/deactivate-xero-account.js +0 -53
- package/dist-server/graphql/resolvers/accounting/xero/deactivate-xero-account.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting/xero/get-xero-auth-url.js +0 -33
- package/dist-server/graphql/resolvers/accounting/xero/get-xero-auth-url.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting/xero/index.js +0 -9
- package/dist-server/graphql/resolvers/accounting/xero/index.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting/xero/refresh-xero-access-token.js +0 -53
- package/dist-server/graphql/resolvers/accounting/xero/refresh-xero-access-token.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting-api/accounting-invoice.js +0 -32
- package/dist-server/graphql/resolvers/accounting-api/accounting-invoice.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting-api/accounting-item.js +0 -36
- package/dist-server/graphql/resolvers/accounting-api/accounting-item.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting-api/accounting-purchase-order.js +0 -16
- package/dist-server/graphql/resolvers/accounting-api/accounting-purchase-order.js.map +0 -1
- package/dist-server/graphql/resolvers/accounting-api/index.js +0 -9
- package/dist-server/graphql/resolvers/accounting-api/index.js.map +0 -1
- package/dist-server/graphql/resolvers/index.js +0 -31
- package/dist-server/graphql/resolvers/index.js.map +0 -1
- package/dist-server/graphql/types/account-webhook-order/account-webhook-order-list.js +0 -14
- package/dist-server/graphql/types/account-webhook-order/account-webhook-order-list.js.map +0 -1
- package/dist-server/graphql/types/account-webhook-order/account-webhook-order-patch.js +0 -18
- package/dist-server/graphql/types/account-webhook-order/account-webhook-order-patch.js.map +0 -1
- package/dist-server/graphql/types/account-webhook-order/account-webhook-order.js +0 -22
- package/dist-server/graphql/types/account-webhook-order/account-webhook-order.js.map +0 -1
- package/dist-server/graphql/types/account-webhook-order/index.js +0 -35
- package/dist-server/graphql/types/account-webhook-order/index.js.map +0 -1
- package/dist-server/graphql/types/account-webhook-order/new-account-webhook-order.js +0 -16
- package/dist-server/graphql/types/account-webhook-order/new-account-webhook-order.js.map +0 -1
- package/dist-server/graphql/types/accounting/account-list.js +0 -14
- package/dist-server/graphql/types/accounting/account-list.js.map +0 -1
- package/dist-server/graphql/types/accounting/account-patch.js +0 -21
- package/dist-server/graphql/types/accounting/account-patch.js.map +0 -1
- package/dist-server/graphql/types/accounting/account.js +0 -32
- package/dist-server/graphql/types/accounting/account.js.map +0 -1
- package/dist-server/graphql/types/accounting/index.js +0 -45
- package/dist-server/graphql/types/accounting/index.js.map +0 -1
- package/dist-server/graphql/types/accounting/new-account.js +0 -19
- package/dist-server/graphql/types/accounting/new-account.js.map +0 -1
- package/dist-server/graphql/types/accounting-api/invoice.js +0 -65
- package/dist-server/graphql/types/accounting-api/invoice.js.map +0 -1
- package/dist-server/graphql/types/accounting-api/item.js +0 -65
- package/dist-server/graphql/types/accounting-api/item.js.map +0 -1
- package/dist-server/graphql/types/accounting-api/purchase-order.js +0 -36
- package/dist-server/graphql/types/accounting-api/purchase-order.js.map +0 -1
- package/dist-server/graphql/types/index.js +0 -41
- package/dist-server/graphql/types/index.js.map +0 -1
- package/dist-server/index.js +0 -25
- package/dist-server/index.js.map +0 -1
- package/dist-server/migrations/index.js +0 -12
- package/dist-server/migrations/index.js.map +0 -1
- package/dist-server/routers/xero-private-router.js +0 -19
- package/dist-server/routers/xero-private-router.js.map +0 -1
- package/dist-server/routers/xero-router.js +0 -112
- package/dist-server/routers/xero-router.js.map +0 -1
- package/dist-server/routes.js +0 -11
- package/dist-server/routes.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/integration-accounting",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.671",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
"test": "DEBUG=things-factory:* NODE_ENV=development npx mocha -r ts-node/register ./test/**/*spec.ts"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@things-factory/apptool-ui": "^4.3.
|
|
28
|
-
"@things-factory/auth-ui": "^4.3.
|
|
29
|
-
"@things-factory/biz-base": "^4.3.
|
|
30
|
-
"@things-factory/code-ui": "^4.3.
|
|
31
|
-
"@things-factory/context-ui": "^4.3.
|
|
32
|
-
"@things-factory/grist-ui": "^4.3.
|
|
33
|
-
"@things-factory/i18n-base": "^4.3.
|
|
34
|
-
"@things-factory/integration-ui": "^4.3.
|
|
35
|
-
"@things-factory/more-ui": "^4.3.
|
|
36
|
-
"@things-factory/product-base": "^4.3.
|
|
37
|
-
"@things-factory/resource-ui": "^4.3.
|
|
38
|
-
"@things-factory/setting-ui": "^4.3.
|
|
39
|
-
"@things-factory/system-ui": "^4.3.
|
|
27
|
+
"@things-factory/apptool-ui": "^4.3.671",
|
|
28
|
+
"@things-factory/auth-ui": "^4.3.671",
|
|
29
|
+
"@things-factory/biz-base": "^4.3.671",
|
|
30
|
+
"@things-factory/code-ui": "^4.3.671",
|
|
31
|
+
"@things-factory/context-ui": "^4.3.671",
|
|
32
|
+
"@things-factory/grist-ui": "^4.3.671",
|
|
33
|
+
"@things-factory/i18n-base": "^4.3.671",
|
|
34
|
+
"@things-factory/integration-ui": "^4.3.671",
|
|
35
|
+
"@things-factory/more-ui": "^4.3.671",
|
|
36
|
+
"@things-factory/product-base": "^4.3.671",
|
|
37
|
+
"@things-factory/resource-ui": "^4.3.671",
|
|
38
|
+
"@things-factory/setting-ui": "^4.3.671",
|
|
39
|
+
"@things-factory/system-ui": "^4.3.671",
|
|
40
40
|
"debug": "^4.1.1",
|
|
41
41
|
"node-fetch": "^2.6.0"
|
|
42
42
|
},
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"nock": "^13.0.2",
|
|
51
51
|
"should": "^13.2.3"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "ef524cb207378186ec71917d9a8546363d4300b2"
|
|
54
54
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ACCOUNT_SYNC_STATUS = exports.ACCOUNT_PLATFORM = void 0;
|
|
4
|
-
exports.ACCOUNT_PLATFORM = {
|
|
5
|
-
XILNEX: 'XILNEX',
|
|
6
|
-
XERO: 'XERO',
|
|
7
|
-
VERSA_FLEET: 'VERSA_FLEET',
|
|
8
|
-
OTHERS: 'OTHERS'
|
|
9
|
-
};
|
|
10
|
-
exports.ACCOUNT_SYNC_STATUS = {
|
|
11
|
-
SUCCESS: 'SUCCESS',
|
|
12
|
-
FAILED: 'FAILED'
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=account.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../server/constants/account.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG;IAC9B,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,QAAQ;CACjB,CAAA;AAEY,QAAA,mBAAmB,GAAG;IACjC,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACjB,CAAA"}
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./account"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.api = void 0;
|
|
7
|
-
const debug_1 = __importDefault(require("debug"));
|
|
8
|
-
const debug = (0, debug_1.default)('things-factory:integration-accounting:accounting-api-decorator');
|
|
9
|
-
const NOOP = v => v;
|
|
10
|
-
const api = (target, property, descriptor) => {
|
|
11
|
-
const method = descriptor.value;
|
|
12
|
-
descriptor.value = async function (accounting, request) {
|
|
13
|
-
const AccountingAPI = this;
|
|
14
|
-
var { platform } = accounting;
|
|
15
|
-
var { action: platformAction, apis } = AccountingAPI.getPlatform(platform);
|
|
16
|
-
var m = apis[method.name];
|
|
17
|
-
if (!m) {
|
|
18
|
-
throw Error(`Accounting Platform '${platform}' doesn't have API ${method.name}`);
|
|
19
|
-
}
|
|
20
|
-
var { path, method: httpMethod = 'post', denormalize = NOOP, normalize = NOOP, action = platformAction } = m.apply(this, [request]);
|
|
21
|
-
var denormalized = await denormalize(request || {}, { accounting });
|
|
22
|
-
debug('request', denormalized);
|
|
23
|
-
var response = await action.apply(this, [
|
|
24
|
-
{ accounting, method: httpMethod, path, request: denormalized, platformAction }
|
|
25
|
-
]);
|
|
26
|
-
debug('response', response);
|
|
27
|
-
if (!response.ok) {
|
|
28
|
-
throw response;
|
|
29
|
-
}
|
|
30
|
-
return await normalize(response, { accounting });
|
|
31
|
-
};
|
|
32
|
-
return descriptor;
|
|
33
|
-
};
|
|
34
|
-
exports.api = api;
|
|
35
|
-
//# sourceMappingURL=decorators.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../server/controllers/accounting-api/decorators.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,gEAAgE,CAAC,CAAA;AAIrF,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAEZ,MAAM,GAAG,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAE,UAAwC,EAAO,EAAE;IACrG,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAA;IAE/B,UAAU,CAAC,KAAK,GAAG,KAAK,WAAW,UAAmB,EAAE,OAAO;QAC7D,MAAM,aAAa,GAAG,IAAI,CAAA;QAE1B,IAAI,EAAE,QAAQ,EAAE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
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AccountingAPI = exports.ACCOUNTING_STATUS = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const entities_1 = require("../../entities");
|
|
15
|
-
const decorators_1 = require("./decorators");
|
|
16
|
-
exports.ACCOUNTING_STATUS = {
|
|
17
|
-
ACTIVE: 'active',
|
|
18
|
-
INACTIVE: 'inactive',
|
|
19
|
-
TERMINATED: 'terminated'
|
|
20
|
-
};
|
|
21
|
-
class AccountingAPI {
|
|
22
|
-
static registerPlatform(name, action, apis) {
|
|
23
|
-
AccountingAPI.platforms[name] = {
|
|
24
|
-
action,
|
|
25
|
-
apis
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
static getPlatform(name) {
|
|
29
|
-
return AccountingAPI.platforms[name];
|
|
30
|
-
}
|
|
31
|
-
static async getAccounting(id) {
|
|
32
|
-
const repository = (0, typeorm_1.getRepository)(entities_1.Account);
|
|
33
|
-
return await repository.findOne({
|
|
34
|
-
where: { id },
|
|
35
|
-
relations: ['domain']
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
static getInvoice(accounting, req) { }
|
|
39
|
-
static getInvoices(accounting, req) { }
|
|
40
|
-
static createInvoice(accounting, req) { }
|
|
41
|
-
static updateInvoice(accounting, req) { }
|
|
42
|
-
static getPurchaseOrders(accounting, req) { }
|
|
43
|
-
static getContact(accounting, req) { }
|
|
44
|
-
static getContacts(accounting, req) { }
|
|
45
|
-
static getItem(accounting, req) { }
|
|
46
|
-
static getItems(accounting, req) { }
|
|
47
|
-
static createItem(accounting, req) { }
|
|
48
|
-
static updateItem(accounting, req) { }
|
|
49
|
-
static updateItems(accounting, req) { }
|
|
50
|
-
static deleteItem(accounting, req) { }
|
|
51
|
-
static createGoodsReceivedNote(accounting, req) { }
|
|
52
|
-
static createPurchaseReceive(accounting, req) { }
|
|
53
|
-
static cancelPurchaseOrder(accounting, req) { }
|
|
54
|
-
static createTransferNote(accounting, req) { }
|
|
55
|
-
static createSalesOrder(accounting, req) { }
|
|
56
|
-
static postSalesOrderToSalesInvoice(accounting, req) { }
|
|
57
|
-
static createSalesReturn(accounting, req) { }
|
|
58
|
-
static createShipment(accounting, req) { }
|
|
59
|
-
static createStockAdjustRecord(accounting, req) { }
|
|
60
|
-
static deliveryTransferNote(accounting, req) { }
|
|
61
|
-
static getPurchaseOrder(accounting, req) { }
|
|
62
|
-
static getStockRequest(accounting, req) { }
|
|
63
|
-
static getTransferNote(accounting, req) { }
|
|
64
|
-
static getSale(accounting, req) { }
|
|
65
|
-
static getSalesOrderInvoiceHistories(accounting, req) { }
|
|
66
|
-
}
|
|
67
|
-
AccountingAPI.platforms = {};
|
|
68
|
-
__decorate([
|
|
69
|
-
decorators_1.api,
|
|
70
|
-
__metadata("design:type", Function),
|
|
71
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
72
|
-
__metadata("design:returntype", Object)
|
|
73
|
-
], AccountingAPI, "getInvoice", null);
|
|
74
|
-
__decorate([
|
|
75
|
-
decorators_1.api,
|
|
76
|
-
__metadata("design:type", Function),
|
|
77
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
78
|
-
__metadata("design:returntype", Object)
|
|
79
|
-
], AccountingAPI, "getInvoices", null);
|
|
80
|
-
__decorate([
|
|
81
|
-
decorators_1.api,
|
|
82
|
-
__metadata("design:type", Function),
|
|
83
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
84
|
-
__metadata("design:returntype", Object)
|
|
85
|
-
], AccountingAPI, "createInvoice", null);
|
|
86
|
-
__decorate([
|
|
87
|
-
decorators_1.api,
|
|
88
|
-
__metadata("design:type", Function),
|
|
89
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
90
|
-
__metadata("design:returntype", Object)
|
|
91
|
-
], AccountingAPI, "updateInvoice", null);
|
|
92
|
-
__decorate([
|
|
93
|
-
decorators_1.api,
|
|
94
|
-
__metadata("design:type", Function),
|
|
95
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
96
|
-
__metadata("design:returntype", Object)
|
|
97
|
-
], AccountingAPI, "getPurchaseOrders", null);
|
|
98
|
-
__decorate([
|
|
99
|
-
decorators_1.api,
|
|
100
|
-
__metadata("design:type", Function),
|
|
101
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
102
|
-
__metadata("design:returntype", Object)
|
|
103
|
-
], AccountingAPI, "getContact", null);
|
|
104
|
-
__decorate([
|
|
105
|
-
decorators_1.api,
|
|
106
|
-
__metadata("design:type", Function),
|
|
107
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
108
|
-
__metadata("design:returntype", Object)
|
|
109
|
-
], AccountingAPI, "getContacts", null);
|
|
110
|
-
__decorate([
|
|
111
|
-
decorators_1.api,
|
|
112
|
-
__metadata("design:type", Function),
|
|
113
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
114
|
-
__metadata("design:returntype", Object)
|
|
115
|
-
], AccountingAPI, "getItem", null);
|
|
116
|
-
__decorate([
|
|
117
|
-
decorators_1.api,
|
|
118
|
-
__metadata("design:type", Function),
|
|
119
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
120
|
-
__metadata("design:returntype", Object)
|
|
121
|
-
], AccountingAPI, "getItems", null);
|
|
122
|
-
__decorate([
|
|
123
|
-
decorators_1.api,
|
|
124
|
-
__metadata("design:type", Function),
|
|
125
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
126
|
-
__metadata("design:returntype", Object)
|
|
127
|
-
], AccountingAPI, "createItem", null);
|
|
128
|
-
__decorate([
|
|
129
|
-
decorators_1.api,
|
|
130
|
-
__metadata("design:type", Function),
|
|
131
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
132
|
-
__metadata("design:returntype", Object)
|
|
133
|
-
], AccountingAPI, "updateItem", null);
|
|
134
|
-
__decorate([
|
|
135
|
-
decorators_1.api,
|
|
136
|
-
__metadata("design:type", Function),
|
|
137
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
138
|
-
__metadata("design:returntype", Object)
|
|
139
|
-
], AccountingAPI, "updateItems", null);
|
|
140
|
-
__decorate([
|
|
141
|
-
decorators_1.api,
|
|
142
|
-
__metadata("design:type", Function),
|
|
143
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
144
|
-
__metadata("design:returntype", Object)
|
|
145
|
-
], AccountingAPI, "deleteItem", null);
|
|
146
|
-
__decorate([
|
|
147
|
-
decorators_1.api,
|
|
148
|
-
__metadata("design:type", Function),
|
|
149
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
150
|
-
__metadata("design:returntype", Object)
|
|
151
|
-
], AccountingAPI, "createGoodsReceivedNote", null);
|
|
152
|
-
__decorate([
|
|
153
|
-
decorators_1.api,
|
|
154
|
-
__metadata("design:type", Function),
|
|
155
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
156
|
-
__metadata("design:returntype", Object)
|
|
157
|
-
], AccountingAPI, "createPurchaseReceive", null);
|
|
158
|
-
__decorate([
|
|
159
|
-
decorators_1.api,
|
|
160
|
-
__metadata("design:type", Function),
|
|
161
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
162
|
-
__metadata("design:returntype", Object)
|
|
163
|
-
], AccountingAPI, "cancelPurchaseOrder", null);
|
|
164
|
-
__decorate([
|
|
165
|
-
decorators_1.api,
|
|
166
|
-
__metadata("design:type", Function),
|
|
167
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
168
|
-
__metadata("design:returntype", Object)
|
|
169
|
-
], AccountingAPI, "createTransferNote", null);
|
|
170
|
-
__decorate([
|
|
171
|
-
decorators_1.api,
|
|
172
|
-
__metadata("design:type", Function),
|
|
173
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
174
|
-
__metadata("design:returntype", Object)
|
|
175
|
-
], AccountingAPI, "createSalesOrder", null);
|
|
176
|
-
__decorate([
|
|
177
|
-
decorators_1.api,
|
|
178
|
-
__metadata("design:type", Function),
|
|
179
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
180
|
-
__metadata("design:returntype", Object)
|
|
181
|
-
], AccountingAPI, "postSalesOrderToSalesInvoice", null);
|
|
182
|
-
__decorate([
|
|
183
|
-
decorators_1.api,
|
|
184
|
-
__metadata("design:type", Function),
|
|
185
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
186
|
-
__metadata("design:returntype", Object)
|
|
187
|
-
], AccountingAPI, "createSalesReturn", null);
|
|
188
|
-
__decorate([
|
|
189
|
-
decorators_1.api,
|
|
190
|
-
__metadata("design:type", Function),
|
|
191
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
192
|
-
__metadata("design:returntype", Object)
|
|
193
|
-
], AccountingAPI, "createShipment", null);
|
|
194
|
-
__decorate([
|
|
195
|
-
decorators_1.api,
|
|
196
|
-
__metadata("design:type", Function),
|
|
197
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
198
|
-
__metadata("design:returntype", Object)
|
|
199
|
-
], AccountingAPI, "createStockAdjustRecord", null);
|
|
200
|
-
__decorate([
|
|
201
|
-
decorators_1.api,
|
|
202
|
-
__metadata("design:type", Function),
|
|
203
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
204
|
-
__metadata("design:returntype", Object)
|
|
205
|
-
], AccountingAPI, "deliveryTransferNote", null);
|
|
206
|
-
__decorate([
|
|
207
|
-
decorators_1.api,
|
|
208
|
-
__metadata("design:type", Function),
|
|
209
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
210
|
-
__metadata("design:returntype", Object)
|
|
211
|
-
], AccountingAPI, "getPurchaseOrder", null);
|
|
212
|
-
__decorate([
|
|
213
|
-
decorators_1.api,
|
|
214
|
-
__metadata("design:type", Function),
|
|
215
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
216
|
-
__metadata("design:returntype", Object)
|
|
217
|
-
], AccountingAPI, "getStockRequest", null);
|
|
218
|
-
__decorate([
|
|
219
|
-
decorators_1.api,
|
|
220
|
-
__metadata("design:type", Function),
|
|
221
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
222
|
-
__metadata("design:returntype", Object)
|
|
223
|
-
], AccountingAPI, "getTransferNote", null);
|
|
224
|
-
__decorate([
|
|
225
|
-
decorators_1.api,
|
|
226
|
-
__metadata("design:type", Function),
|
|
227
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
228
|
-
__metadata("design:returntype", Object)
|
|
229
|
-
], AccountingAPI, "getSale", null);
|
|
230
|
-
__decorate([
|
|
231
|
-
decorators_1.api,
|
|
232
|
-
__metadata("design:type", Function),
|
|
233
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
234
|
-
__metadata("design:returntype", Object)
|
|
235
|
-
], AccountingAPI, "getSalesOrderInvoiceHistories", null);
|
|
236
|
-
exports.AccountingAPI = AccountingAPI;
|
|
237
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/controllers/accounting-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuC;AAEvC,6CAAwC;AACxC,6CAAkC;AAErB,QAAA,iBAAiB,GAAG;IAC/B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,YAAY;CACzB,CAAA;AAED,MAAa,aAA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C;;AAvGtD,uBAAS,GAAG,EAAE,CAAA;AAsBd;IADN,gBAAG;;;;qCACsC;AAGnC;IADN,gBAAG;;;;sCACuC;AAGpC;IADN,gBAAG;;;;wCACyC;AAGtC;IADN,gBAAG;;;;wCACyC;AAGtC;IADN,gBAAG;;;;4CAC6C;AAG1C;IADN,gBAAG;;;;qCACsC;AAGnC;IADN,gBAAG;;;;sCACuC;AAGpC;IADN,gBAAG;;;;kCACmC;AAGhC;IADN,gBAAG;;;;mCACoC;AAGjC;IADN,gBAAG;;;;qCACsC;AAGnC;IADN,gBAAG;;;;qCACsC;AAGnC;IADN,gBAAG;;;;sCACuC;AAGpC;IADN,gBAAG;;;;qCACsC;AAGnC;IADN,gBAAG;;;;kDACmD;AAGhD;IADN,gBAAG;;;;gDACiD;AAG9C;IADN,gBAAG;;;;8CAC+C;AAG5C;IADN,gBAAG;;;;6CAC8C;AAG3C;IADN,gBAAG;;;;2CAC4C;AAGzC;IADN,gBAAG;;;;uDACwD;AAGrD;IADN,gBAAG;;;;4CAC6C;AAG1C;IADN,gBAAG;;;;yCAC0C;AAGvC;IADN,gBAAG;;;;kDACmD;AAGhD;IADN,gBAAG;;;;+CACgD;AAG7C;IADN,gBAAG;;;;2CAC4C;AAGzC;IADN,gBAAG;;;;0CAC2C;AAGxC;IADN,gBAAG;;;;0CAC2C;AAGxC;IADN,gBAAG;;;;kCACmC;AAGhC;IADN,gBAAG;;;;wDACyD;AAxG/D,sCAyGC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
require("./xero");
|
|
18
|
-
require("./xilnex");
|
|
19
|
-
__exportStar(require("./accounting-api"), exports);
|
|
20
|
-
__exportStar(require("./xilnex"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kBAAe;AACf,oBAAiB;AAEjB,mDAAgC;AAChC,2CAAwB"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getContact = void 0;
|
|
4
|
-
function getContact() {
|
|
5
|
-
return {
|
|
6
|
-
method: 'get',
|
|
7
|
-
path: '/Contacts/{contactId}',
|
|
8
|
-
denormalize(req) {
|
|
9
|
-
const { ContactID: contactId } = req;
|
|
10
|
-
return {
|
|
11
|
-
resource: { contactId }
|
|
12
|
-
};
|
|
13
|
-
},
|
|
14
|
-
normalize(res) {
|
|
15
|
-
const { Contacts: contacts } = res;
|
|
16
|
-
const { Name: attentionCompany, FirstName, LastName, EmailAddress: email, Addresses, Phones } = contacts[0];
|
|
17
|
-
const { AddressLine1, AddressLine2, AddressLine3, AddressLine4, City: city, PostalCode: postalCode, Country: country } = Addresses[0];
|
|
18
|
-
const mergedAddressLine = `${AddressLine1}, ${AddressLine2}, ${AddressLine3} ${AddressLine4}`;
|
|
19
|
-
return {
|
|
20
|
-
attentionCompany,
|
|
21
|
-
attentionTo: FirstName ? `${FirstName} ${LastName}` : null,
|
|
22
|
-
email,
|
|
23
|
-
deliveryAddress1: AddressLine1 ? mergedAddressLine : null,
|
|
24
|
-
billingAddress: AddressLine1 ? mergedAddressLine : null,
|
|
25
|
-
city: city ? city : null,
|
|
26
|
-
postalCode: postalCode ? postalCode : null,
|
|
27
|
-
country: country ? country : null
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
exports.getContact = getContact;
|
|
33
|
-
//# sourceMappingURL=get-contact.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-contact.js","sourceRoot":"","sources":["../../../../../server/controllers/xero/apis/contact/get-contact.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU;IACxB,OAAO;QACL,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,uBAAuB;QAC7B,WAAW,CAAC,GAAG;YACb,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,GAAG,CAAA;YACpC,OAAO;gBACL,QAAQ,EAAE,EAAE,SAAS,EAAE;aACxB,CAAA;QACH,CAAC;QACD,SAAS,CAAC,GAAG;YACX,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAA;YAClC,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;YAE3G,MAAM,EACJ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EACjB,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;YAChB,MAAM,iBAAiB,GAAW,GAAG,YAAY,KAAK,YAAY,KAAK,YAAY,IAAI,YAAY,EAAE,CAAA;YAErG,OAAO;gBACL,gBAAgB;gBAChB,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI;gBAC1D,KAAK;gBACL,gBAAgB,EAAE,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI;gBACzD,cAAc,EAAE,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI;gBACvD,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;gBACxB,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI;gBAC1C,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;aAClC,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC;AArCD,gCAqCC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getContacts = void 0;
|
|
4
|
-
function getContacts() {
|
|
5
|
-
return {
|
|
6
|
-
method: 'get',
|
|
7
|
-
path: '/Contacts',
|
|
8
|
-
denormalize(req) {
|
|
9
|
-
return {
|
|
10
|
-
payload: Object.assign({}, req)
|
|
11
|
-
};
|
|
12
|
-
},
|
|
13
|
-
normalize(res) {
|
|
14
|
-
return res;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
exports.getContacts = getContacts;
|
|
19
|
-
//# sourceMappingURL=get-contacts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-contacts.js","sourceRoot":"","sources":["../../../../../server/controllers/xero/apis/contact/get-contacts.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW;IACzB,OAAO;QACL,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,WAAW;QACjB,WAAW,CAAC,GAAG;YACb,OAAO;gBACL,OAAO,oBACF,GAAG,CACP;aACF,CAAA;QACH,CAAC;QACD,SAAS,CAAC,GAAG;YACX,OAAO,GAAG,CAAA;QACZ,CAAC;KACF,CAAA;AACH,CAAC;AAfD,kCAeC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./get-contacts"), exports);
|
|
18
|
-
__exportStar(require("./get-contact"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../server/controllers/xero/apis/contact/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,gDAA6B"}
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./invoice"), exports);
|
|
18
|
-
__exportStar(require("./item"), exports);
|
|
19
|
-
__exportStar(require("./purchase-order"), exports);
|
|
20
|
-
__exportStar(require("./contact"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/controllers/xero/apis/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,yCAAsB;AACtB,mDAAgC;AAChC,4CAAyB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createInvoice = void 0;
|
|
4
|
-
function createInvoice() {
|
|
5
|
-
return {
|
|
6
|
-
method: 'post',
|
|
7
|
-
path: '/Invoices/{invoiceNo}',
|
|
8
|
-
denormalize(req) {
|
|
9
|
-
return req;
|
|
10
|
-
},
|
|
11
|
-
normalize(res) {
|
|
12
|
-
return res;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
exports.createInvoice = createInvoice;
|
|
17
|
-
//# sourceMappingURL=create-invoice.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-invoice.js","sourceRoot":"","sources":["../../../../../server/controllers/xero/apis/invoice/create-invoice.ts"],"names":[],"mappings":";;;AAAA,SAAgB,aAAa;IAC3B,OAAO;QACL,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,uBAAuB;QAC7B,WAAW,CAAC,GAAG;YACb,OAAO,GAAG,CAAA;QACZ,CAAC;QACD,SAAS,CAAC,GAAG;YACX,OAAO,GAAG,CAAA;QACZ,CAAC;KACF,CAAA;AACH,CAAC;AAXD,sCAWC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInvoice = void 0;
|
|
4
|
-
function getInvoice() {
|
|
5
|
-
return {
|
|
6
|
-
method: 'get',
|
|
7
|
-
path: '/Invoices/{invoiceId}',
|
|
8
|
-
denormalize(req) {
|
|
9
|
-
return {
|
|
10
|
-
resource: { invoiceId: req.invoiceId }
|
|
11
|
-
};
|
|
12
|
-
},
|
|
13
|
-
normalize(res) {
|
|
14
|
-
return res;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
exports.getInvoice = getInvoice;
|
|
19
|
-
//# sourceMappingURL=get-invoice.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-invoice.js","sourceRoot":"","sources":["../../../../../server/controllers/xero/apis/invoice/get-invoice.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU;IACxB,OAAO;QACL,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,uBAAuB;QAC7B,WAAW,CAAC,GAAG;YACb,OAAO;gBACL,QAAQ,EAAE,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE;aACvC,CAAA;QACH,CAAC;QACD,SAAS,CAAC,GAAG;YACX,OAAO,GAAG,CAAA;QACZ,CAAC;KACF,CAAA;AACH,CAAC;AAbD,gCAaC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInvoices = void 0;
|
|
4
|
-
const accounting_api_1 = require("../../../accounting-api");
|
|
5
|
-
function getInvoices() {
|
|
6
|
-
return {
|
|
7
|
-
method: 'get',
|
|
8
|
-
path: '/Invoices',
|
|
9
|
-
denormalize(req) {
|
|
10
|
-
return {
|
|
11
|
-
payload: Object.assign({}, req)
|
|
12
|
-
};
|
|
13
|
-
},
|
|
14
|
-
async normalize(res, { accounting }) {
|
|
15
|
-
var { Invoices } = res;
|
|
16
|
-
let results = [];
|
|
17
|
-
results = await Promise.all(Invoices.filter(invoice => invoice.Type === 'ACCREC').map(async (invoice) => {
|
|
18
|
-
var { InvoiceID } = invoice;
|
|
19
|
-
var { Invoices } = await accounting_api_1.AccountingAPI.getInvoice(accounting, { invoiceId: InvoiceID });
|
|
20
|
-
var { InvoiceNumber: refNo, Reference: refNo2, DateString, Contact, LineItems } = Invoices[0];
|
|
21
|
-
var releaseDate = String(DateString.split('T')[0]);
|
|
22
|
-
var { ContactID } = Contact;
|
|
23
|
-
const { attentionCompany, attentionTo, email, deliveryAddress1, billingAddress, city, postalCode, country } = await accounting_api_1.AccountingAPI.getContact(accounting, {
|
|
24
|
-
ContactID
|
|
25
|
-
});
|
|
26
|
-
var products = LineItems.length
|
|
27
|
-
? LineItems.map(item => {
|
|
28
|
-
var { ItemCode: sku, Quantity: releaseQty } = item;
|
|
29
|
-
return { product: { sku }, releaseQty };
|
|
30
|
-
})
|
|
31
|
-
: ['undefined'];
|
|
32
|
-
return {
|
|
33
|
-
refNo,
|
|
34
|
-
refNo2,
|
|
35
|
-
releaseDate,
|
|
36
|
-
type: 'b2b',
|
|
37
|
-
exportOption: false,
|
|
38
|
-
ownTransport: true,
|
|
39
|
-
packingOption: false,
|
|
40
|
-
deliverTo: {
|
|
41
|
-
attentionTo,
|
|
42
|
-
attentionCompany,
|
|
43
|
-
email,
|
|
44
|
-
deliveryAddress1,
|
|
45
|
-
city,
|
|
46
|
-
postalCode,
|
|
47
|
-
country
|
|
48
|
-
},
|
|
49
|
-
billTo: {
|
|
50
|
-
billingAddress
|
|
51
|
-
},
|
|
52
|
-
orderInventories: products
|
|
53
|
-
};
|
|
54
|
-
}));
|
|
55
|
-
return results;
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
exports.getInvoices = getInvoices;
|
|
60
|
-
//# sourceMappingURL=get-invoices.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-invoices.js","sourceRoot":"","sources":["../../../../../server/controllers/xero/apis/invoice/get-invoices.ts"],"names":[],"mappings":";;;AAAA,4DAAuD;AAEvD,SAAgB,WAAW;IACzB,OAAO;QACL,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,WAAW;QACjB,WAAW,CAAC,GAAG;YACb,OAAO;gBACL,OAAO,oBACF,GAAG,CACP;aACF,CAAA;QACH,CAAC;QACD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE;YACjC,IAAI,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAA;YAEtB,IAAI,OAAO,GAAU,EAAE,CAAA;YAEvB,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CACzB,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,GAAG,CAAC,KAAK,EAAC,OAAO,EAAC,EAAE;gBACxE,IAAI,EAAE,SAAS,EAAE,GAAG,OAAO,CAAA;gBAC3B,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,8BAAa,CAAC,UAAU,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAA;gBAEvF,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,G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