@tonytang99/integration-phases 1.0.0 → 1.2.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/extract/bigcommerce/extract-bc-customer.d.ts +28 -0
- package/dist/extract/bigcommerce/extract-bc-customer.d.ts.map +1 -0
- package/dist/extract/bigcommerce/extract-bc-customer.js +54 -0
- package/dist/extract/bigcommerce/extract-bc-customer.js.map +1 -0
- package/dist/extract/bigcommerce/extract-bc-order.d.ts +20 -0
- package/dist/extract/bigcommerce/extract-bc-order.d.ts.map +1 -0
- package/dist/extract/bigcommerce/extract-bc-order.js +47 -0
- package/dist/extract/bigcommerce/extract-bc-order.js.map +1 -0
- package/dist/extract/bigcommerce/extract-bc-transactions.d.ts +17 -0
- package/dist/extract/bigcommerce/extract-bc-transactions.d.ts.map +1 -0
- package/dist/extract/bigcommerce/extract-bc-transactions.js +36 -0
- package/dist/extract/bigcommerce/extract-bc-transactions.js.map +1 -0
- package/dist/extract/bigcommerce/index.d.ts +4 -0
- package/dist/extract/bigcommerce/index.d.ts.map +1 -0
- package/dist/extract/bigcommerce/index.js +15 -0
- package/dist/extract/bigcommerce/index.js.map +1 -0
- package/dist/extract/bigcommerce-product.d.ts +4 -4
- package/dist/extract/bigcommerce-product.d.ts.map +1 -1
- package/dist/extract/index.d.ts +3 -0
- package/dist/extract/index.d.ts.map +1 -0
- package/dist/extract/index.js +25 -0
- package/dist/extract/index.js.map +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -1
- package/dist/load/index.d.ts +2 -0
- package/dist/load/index.d.ts.map +1 -0
- package/dist/load/index.js +19 -0
- package/dist/load/index.js.map +1 -0
- package/dist/load/myob/index.d.ts +4 -0
- package/dist/load/myob/index.d.ts.map +1 -0
- package/dist/load/myob/index.js +14 -0
- package/dist/load/myob/index.js.map +1 -0
- package/dist/load/myob/load-myob-customer.d.ts +18 -0
- package/dist/load/myob/load-myob-customer.d.ts.map +1 -0
- package/dist/load/myob/load-myob-customer.js +53 -0
- package/dist/load/myob/load-myob-customer.js.map +1 -0
- package/dist/load/myob/load-myob-payment.d.ts +18 -0
- package/dist/load/myob/load-myob-payment.d.ts.map +1 -0
- package/dist/load/myob/load-myob-payment.js +47 -0
- package/dist/load/myob/load-myob-payment.js.map +1 -0
- package/dist/load/myob/load-myob-sales-order.d.ts +18 -0
- package/dist/load/myob/load-myob-sales-order.d.ts.map +1 -0
- package/dist/load/myob/load-myob-sales-order.js +53 -0
- package/dist/load/myob/load-myob-sales-order.js.map +1 -0
- package/dist/slots/bigcommerce-slots.d.ts +16 -0
- package/dist/slots/bigcommerce-slots.d.ts.map +1 -0
- package/dist/slots/bigcommerce-slots.js +29 -0
- package/dist/slots/bigcommerce-slots.js.map +1 -0
- package/dist/slots/index.d.ts +4 -0
- package/dist/slots/index.d.ts.map +1 -0
- package/dist/slots/index.js +11 -0
- package/dist/slots/index.js.map +1 -0
- package/dist/slots/myob-slots.d.ts +24 -0
- package/dist/slots/myob-slots.d.ts.map +1 -0
- package/dist/slots/myob-slots.js +41 -0
- package/dist/slots/myob-slots.js.map +1 -0
- package/dist/slots/processing-slots.d.ts +35 -0
- package/dist/slots/processing-slots.d.ts.map +1 -0
- package/dist/slots/processing-slots.js +39 -0
- package/dist/slots/processing-slots.js.map +1 -0
- package/dist/transform/index.d.ts +4 -0
- package/dist/transform/index.d.ts.map +1 -0
- package/dist/transform/index.js +14 -0
- package/dist/transform/index.js.map +1 -0
- package/dist/transform/transform-bc-customer.d.ts +25 -0
- package/dist/transform/transform-bc-customer.d.ts.map +1 -0
- package/dist/transform/transform-bc-customer.js +66 -0
- package/dist/transform/transform-bc-customer.js.map +1 -0
- package/dist/transform/transform-bc-order.d.ts +13 -0
- package/dist/transform/transform-bc-order.d.ts.map +1 -0
- package/dist/transform/transform-bc-order.js +30 -0
- package/dist/transform/transform-bc-order.js.map +1 -0
- package/dist/transform/transform-to-myob.d.ts +37 -0
- package/dist/transform/transform-to-myob.d.ts.map +1 -0
- package/dist/transform/transform-to-myob.js +79 -0
- package/dist/transform/transform-to-myob.js.map +1 -0
- package/dist/utility/index.d.ts +5 -0
- package/dist/utility/index.d.ts.map +1 -0
- package/dist/utility/index.js +12 -0
- package/dist/utility/index.js.map +1 -0
- package/dist/utility/parse-api-gateway-input.d.ts +27 -0
- package/dist/utility/parse-api-gateway-input.d.ts.map +1 -0
- package/dist/utility/parse-api-gateway-input.js +85 -0
- package/dist/utility/parse-api-gateway-input.js.map +1 -0
- package/dist/utility/wait-phase.d.ts +45 -0
- package/dist/utility/wait-phase.d.ts.map +1 -0
- package/dist/utility/wait-phase.js +76 -0
- package/dist/utility/wait-phase.js.map +1 -0
- package/dist/validate/check-customer-exists.d.ts +25 -0
- package/dist/validate/check-customer-exists.d.ts.map +1 -0
- package/dist/validate/check-customer-exists.js +67 -0
- package/dist/validate/check-customer-exists.js.map +1 -0
- package/dist/validate/index.d.ts +5 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/dist/validate/index.js +11 -0
- package/dist/validate/index.js.map +1 -0
- package/dist/validate/verify-new-order.d.ts +27 -0
- package/dist/validate/verify-new-order.d.ts.map +1 -0
- package/dist/validate/verify-new-order.js +55 -0
- package/dist/validate/verify-new-order.js.map +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BasePhase, PipelineContext, SlotKey, PipelineError } from '@tonytang99/integration-core';
|
|
2
|
+
import { MYOBSalesOrderAdapter } from '@tonytang99/integration-adapters';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a sales order in MYOB
|
|
5
|
+
*/
|
|
6
|
+
export declare class LoadMYOBSalesOrderPhase extends BasePhase {
|
|
7
|
+
private adapter;
|
|
8
|
+
readonly name = "load:myob:sales-order";
|
|
9
|
+
readonly description = "Creates sales order in MYOB";
|
|
10
|
+
readonly tags: string[];
|
|
11
|
+
readonly requires: SlotKey<unknown>[];
|
|
12
|
+
readonly produces: SlotKey<unknown>[];
|
|
13
|
+
constructor(adapter: MYOBSalesOrderAdapter);
|
|
14
|
+
execute(ctx: PipelineContext): Promise<PipelineContext>;
|
|
15
|
+
rollback(ctx: PipelineContext, _error: PipelineError): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export declare function createLoadMYOBSalesOrderPhase(adapter: MYOBSalesOrderAdapter): LoadMYOBSalesOrderPhase;
|
|
18
|
+
//# sourceMappingURL=load-myob-sales-order.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-myob-sales-order.d.ts","sourceRoot":"","sources":["../../../src/load/myob/load-myob-sales-order.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,SAAS;IAWxC,OAAO,CAAC,OAAO;IAV3B,QAAQ,CAAC,IAAI,2BAA2B;IACxC,QAAQ,CAAC,WAAW,iCAAiC;IACrD,QAAQ,CAAC,IAAI,WAA6B;IAE1C,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAmC;IACxE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAGnC;gBAEkB,OAAO,EAAE,qBAAqB;IAI5C,OAAO,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAoBvD,QAAQ,CAAC,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CAW3E;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,qBAAqB,GAC7B,uBAAuB,CAEzB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoadMYOBSalesOrderPhase = void 0;
|
|
4
|
+
exports.createLoadMYOBSalesOrderPhase = createLoadMYOBSalesOrderPhase;
|
|
5
|
+
// packages/phases/src/load/myob/load-myob-sales-order.ts
|
|
6
|
+
const integration_core_1 = require("@tonytang99/integration-core");
|
|
7
|
+
const myob_slots_1 = require("../../slots/myob-slots");
|
|
8
|
+
/**
|
|
9
|
+
* Creates a sales order in MYOB
|
|
10
|
+
*/
|
|
11
|
+
class LoadMYOBSalesOrderPhase extends integration_core_1.BasePhase {
|
|
12
|
+
adapter;
|
|
13
|
+
name = 'load:myob:sales-order';
|
|
14
|
+
description = 'Creates sales order in MYOB';
|
|
15
|
+
tags = ['load', 'myob', 'order'];
|
|
16
|
+
requires = [myob_slots_1.MYOBSlots.SALES_ORDER_PAYLOAD];
|
|
17
|
+
produces = [
|
|
18
|
+
myob_slots_1.MYOBSlots.SALES_ORDER_RESPONSE,
|
|
19
|
+
myob_slots_1.MYOBSlots.SALES_ORDER_UID,
|
|
20
|
+
];
|
|
21
|
+
constructor(adapter) {
|
|
22
|
+
super();
|
|
23
|
+
this.adapter = adapter;
|
|
24
|
+
}
|
|
25
|
+
async execute(ctx) {
|
|
26
|
+
const orderPayload = ctx.require(myob_slots_1.MYOBSlots.SALES_ORDER_PAYLOAD);
|
|
27
|
+
const result = await this.adapter.createSalesOrder(orderPayload);
|
|
28
|
+
if (!result.success) {
|
|
29
|
+
this.fail(result.error?.code ?? 'CREATE_ERROR', result.error?.message ?? 'Failed to create sales order in MYOB', result.error?.retryable ?? false);
|
|
30
|
+
}
|
|
31
|
+
const order = result.data;
|
|
32
|
+
return ctx
|
|
33
|
+
.set(myob_slots_1.MYOBSlots.SALES_ORDER_RESPONSE, order)
|
|
34
|
+
.set(myob_slots_1.MYOBSlots.SALES_ORDER_UID, order.UID);
|
|
35
|
+
}
|
|
36
|
+
async rollback(ctx, _error) {
|
|
37
|
+
// If we created an order, try to delete it
|
|
38
|
+
const orderUid = ctx.get(myob_slots_1.MYOBSlots.SALES_ORDER_UID);
|
|
39
|
+
if (orderUid) {
|
|
40
|
+
try {
|
|
41
|
+
await this.adapter.deleteSalesOrder(orderUid);
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// Best effort rollback
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.LoadMYOBSalesOrderPhase = LoadMYOBSalesOrderPhase;
|
|
50
|
+
function createLoadMYOBSalesOrderPhase(adapter) {
|
|
51
|
+
return new LoadMYOBSalesOrderPhase(adapter);
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=load-myob-sales-order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-myob-sales-order.js","sourceRoot":"","sources":["../../../src/load/myob/load-myob-sales-order.ts"],"names":[],"mappings":";;;AAwDA,sEAIC;AA5DD,yDAAyD;AACzD,mEAAkG;AAElG,uDAAmD;AAEnD;;GAEG;AACH,MAAa,uBAAwB,SAAQ,4BAAS;IAWhC;IAVX,IAAI,GAAG,uBAAuB,CAAC;IAC/B,WAAW,GAAG,6BAA6B,CAAC;IAC5C,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC,QAAQ,GAAuB,CAAC,sBAAS,CAAC,mBAAmB,CAAC,CAAC;IAC/D,QAAQ,GAAuB;QACtC,sBAAS,CAAC,oBAAoB;QAC9B,sBAAS,CAAC,eAAe;KAC1B,CAAC;IAEF,YAAoB,OAA8B;QAChD,KAAK,EAAE,CAAC;QADU,YAAO,GAAP,OAAO,CAAuB;IAElD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,GAAoB;QAChC,MAAM,YAAY,GAAG,GAAG,CAAC,OAAO,CAAC,sBAAS,CAAC,mBAAmB,CAAC,CAAC;QAEhE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAEjE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,IAAI,CAAC,IAAI,CACP,MAAM,CAAC,KAAK,EAAE,IAAI,IAAI,cAAc,EACpC,MAAM,CAAC,KAAK,EAAE,OAAO,IAAI,sCAAsC,EAC/D,MAAM,CAAC,KAAK,EAAE,SAAS,IAAI,KAAK,CACjC,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,IAAK,CAAC;QAE3B,OAAO,GAAG;aACP,GAAG,CAAC,sBAAS,CAAC,oBAAoB,EAAE,KAAK,CAAC;aAC1C,GAAG,CAAC,sBAAS,CAAC,eAAe,EAAE,KAAK,CAAC,GAAI,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,GAAoB,EAAE,MAAqB;QACxD,2CAA2C;QAC3C,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAS,sBAAS,CAAC,eAAe,CAAC,CAAC;QAC5D,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;YAChD,CAAC;YAAC,MAAM,CAAC;gBACP,uBAAuB;YACzB,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA9CD,0DA8CC;AAED,SAAgB,6BAA6B,CAC3C,OAA8B;IAE9B,OAAO,IAAI,uBAAuB,CAAC,OAAO,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BCOrder, BCOrderProduct, BCOrderShippingAddress, BCCustomer, BCTransaction, MappedBCOrder, MappedBCCustomer } from '@tonytang99/integration-adapters';
|
|
2
|
+
/**
|
|
3
|
+
* Slot keys for BigCommerce data in the pipeline
|
|
4
|
+
*/
|
|
5
|
+
export declare const BigCommerceSlots: {
|
|
6
|
+
readonly ORDER_ID: import("@tonytang99/integration-core").SlotKey<number>;
|
|
7
|
+
readonly CUSTOMER_ID: import("@tonytang99/integration-core").SlotKey<number>;
|
|
8
|
+
readonly RAW_ORDER: import("@tonytang99/integration-core").SlotKey<BCOrder>;
|
|
9
|
+
readonly RAW_ORDER_PRODUCTS: import("@tonytang99/integration-core").SlotKey<BCOrderProduct[]>;
|
|
10
|
+
readonly RAW_ORDER_SHIPPING: import("@tonytang99/integration-core").SlotKey<BCOrderShippingAddress[]>;
|
|
11
|
+
readonly RAW_CUSTOMER: import("@tonytang99/integration-core").SlotKey<BCCustomer>;
|
|
12
|
+
readonly RAW_TRANSACTIONS: import("@tonytang99/integration-core").SlotKey<BCTransaction[]>;
|
|
13
|
+
readonly MAPPED_ORDER: import("@tonytang99/integration-core").SlotKey<MappedBCOrder>;
|
|
14
|
+
readonly MAPPED_CUSTOMER: import("@tonytang99/integration-core").SlotKey<MappedBCCustomer>;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=bigcommerce-slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bigcommerce-slots.d.ts","sourceRoot":"","sources":["../../src/slots/bigcommerce-slots.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,sBAAsB,EACtB,UAAU,EACV,aAAa,EACb,aAAa,EACb,gBAAgB,EACjB,MAAM,kCAAkC,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;CAqBnB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BigCommerceSlots = void 0;
|
|
4
|
+
// packages/phases/src/slots/bigcommerce-slots.ts
|
|
5
|
+
const integration_core_1 = require("@tonytang99/integration-core");
|
|
6
|
+
/**
|
|
7
|
+
* Slot keys for BigCommerce data in the pipeline
|
|
8
|
+
*/
|
|
9
|
+
exports.BigCommerceSlots = {
|
|
10
|
+
// ─────────────────────────────────────
|
|
11
|
+
// INPUT IDENTIFIERS
|
|
12
|
+
// ─────────────────────────────────────
|
|
13
|
+
ORDER_ID: (0, integration_core_1.createSlotKey)('bc.input.orderId'),
|
|
14
|
+
CUSTOMER_ID: (0, integration_core_1.createSlotKey)('bc.input.customerId'),
|
|
15
|
+
// ─────────────────────────────────────
|
|
16
|
+
// RAW API RESPONSES
|
|
17
|
+
// ─────────────────────────────────────
|
|
18
|
+
RAW_ORDER: (0, integration_core_1.createSlotKey)('bc.raw.order'),
|
|
19
|
+
RAW_ORDER_PRODUCTS: (0, integration_core_1.createSlotKey)('bc.raw.orderProducts'),
|
|
20
|
+
RAW_ORDER_SHIPPING: (0, integration_core_1.createSlotKey)('bc.raw.orderShipping'),
|
|
21
|
+
RAW_CUSTOMER: (0, integration_core_1.createSlotKey)('bc.raw.customer'),
|
|
22
|
+
RAW_TRANSACTIONS: (0, integration_core_1.createSlotKey)('bc.raw.transactions'),
|
|
23
|
+
// ─────────────────────────────────────
|
|
24
|
+
// MAPPED/TRANSFORMED DATA
|
|
25
|
+
// ─────────────────────────────────────
|
|
26
|
+
MAPPED_ORDER: (0, integration_core_1.createSlotKey)('bc.mapped.order'),
|
|
27
|
+
MAPPED_CUSTOMER: (0, integration_core_1.createSlotKey)('bc.mapped.customer'),
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=bigcommerce-slots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bigcommerce-slots.js","sourceRoot":"","sources":["../../src/slots/bigcommerce-slots.ts"],"names":[],"mappings":";;;AAAA,iDAAiD;AACjD,mEAA6D;AAW7D;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC9B,wCAAwC;IACxC,oBAAoB;IACpB,wCAAwC;IACxC,QAAQ,EAAE,IAAA,gCAAa,EAAS,kBAAkB,CAAC;IACnD,WAAW,EAAE,IAAA,gCAAa,EAAS,qBAAqB,CAAC;IAEzD,wCAAwC;IACxC,oBAAoB;IACpB,wCAAwC;IACxC,SAAS,EAAE,IAAA,gCAAa,EAAU,cAAc,CAAC;IACjD,kBAAkB,EAAE,IAAA,gCAAa,EAAmB,sBAAsB,CAAC;IAC3E,kBAAkB,EAAE,IAAA,gCAAa,EAA2B,sBAAsB,CAAC;IACnF,YAAY,EAAE,IAAA,gCAAa,EAAa,iBAAiB,CAAC;IAC1D,gBAAgB,EAAE,IAAA,gCAAa,EAAkB,qBAAqB,CAAC;IAEvE,wCAAwC;IACxC,0BAA0B;IAC1B,wCAAwC;IACxC,YAAY,EAAE,IAAA,gCAAa,EAAgB,iBAAiB,CAAC;IAC7D,eAAe,EAAE,IAAA,gCAAa,EAAmB,oBAAoB,CAAC;CAC9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slots/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/phases/src/slots/index.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ProcessingSlots = exports.MYOBSlots = exports.BigCommerceSlots = void 0;
|
|
5
|
+
var bigcommerce_slots_1 = require("./bigcommerce-slots");
|
|
6
|
+
Object.defineProperty(exports, "BigCommerceSlots", { enumerable: true, get: function () { return bigcommerce_slots_1.BigCommerceSlots; } });
|
|
7
|
+
var myob_slots_1 = require("./myob-slots");
|
|
8
|
+
Object.defineProperty(exports, "MYOBSlots", { enumerable: true, get: function () { return myob_slots_1.MYOBSlots; } });
|
|
9
|
+
var processing_slots_1 = require("./processing-slots");
|
|
10
|
+
Object.defineProperty(exports, "ProcessingSlots", { enumerable: true, get: function () { return processing_slots_1.ProcessingSlots; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/slots/index.ts"],"names":[],"mappings":";AAAA,qCAAqC;;;AAErC,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,uDAA2E;AAAlE,mHAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MYOBContact, MYOBSaleOrder, MYOBCustomerPayment, MappedMYOBCustomer, MappedMYOBOrder } from '@tonytang99/integration-adapters';
|
|
2
|
+
/**
|
|
3
|
+
* Slot keys for MYOB data in the pipeline
|
|
4
|
+
*/
|
|
5
|
+
export declare const MYOBSlots: {
|
|
6
|
+
readonly CUSTOMER_UID: import("@tonytang99/integration-core").SlotKey<string>;
|
|
7
|
+
readonly CUSTOMER_EXISTS: import("@tonytang99/integration-core").SlotKey<boolean>;
|
|
8
|
+
readonly CUSTOMER_PAYLOAD: import("@tonytang99/integration-core").SlotKey<Omit<MYOBContact, "UID">>;
|
|
9
|
+
readonly CUSTOMER_RESPONSE: import("@tonytang99/integration-core").SlotKey<MYOBContact>;
|
|
10
|
+
readonly MAPPED_CUSTOMER: import("@tonytang99/integration-core").SlotKey<MappedMYOBCustomer>;
|
|
11
|
+
readonly SALES_ORDER_UID: import("@tonytang99/integration-core").SlotKey<string>;
|
|
12
|
+
readonly SALES_ORDER_EXISTS: import("@tonytang99/integration-core").SlotKey<boolean>;
|
|
13
|
+
readonly SALES_ORDER_PAYLOAD: import("@tonytang99/integration-core").SlotKey<Omit<MYOBSaleOrder, "UID">>;
|
|
14
|
+
readonly SALES_ORDER_RESPONSE: import("@tonytang99/integration-core").SlotKey<MYOBSaleOrder>;
|
|
15
|
+
readonly MAPPED_ORDER: import("@tonytang99/integration-core").SlotKey<MappedMYOBOrder>;
|
|
16
|
+
readonly PAYMENTS_PAYLOAD: import("@tonytang99/integration-core").SlotKey<Omit<MYOBCustomerPayment, "UID">[]>;
|
|
17
|
+
readonly PAYMENTS_RESPONSES: import("@tonytang99/integration-core").SlotKey<MYOBCustomerPayment[]>;
|
|
18
|
+
readonly CURRENT_PAYMENT: import("@tonytang99/integration-core").SlotKey<Omit<MYOBCustomerPayment, "UID">>;
|
|
19
|
+
readonly CURRENT_PAYMENT_RESPONSE: import("@tonytang99/integration-core").SlotKey<MYOBCustomerPayment>;
|
|
20
|
+
readonly TAX_CODE_UID: import("@tonytang99/integration-core").SlotKey<string>;
|
|
21
|
+
readonly DEPOSIT_ACCOUNT_UID: import("@tonytang99/integration-core").SlotKey<string>;
|
|
22
|
+
readonly ITEM_ACCOUNT_UID: import("@tonytang99/integration-core").SlotKey<string>;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=myob-slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"myob-slots.d.ts","sourceRoot":"","sources":["../../src/slots/myob-slots.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;CAmCZ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MYOBSlots = void 0;
|
|
4
|
+
// packages/phases/src/slots/myob-slots.ts
|
|
5
|
+
const integration_core_1 = require("@tonytang99/integration-core");
|
|
6
|
+
/**
|
|
7
|
+
* Slot keys for MYOB data in the pipeline
|
|
8
|
+
*/
|
|
9
|
+
exports.MYOBSlots = {
|
|
10
|
+
// ─────────────────────────────────────
|
|
11
|
+
// CUSTOMER DATA
|
|
12
|
+
// ─────────────────────────────────────
|
|
13
|
+
CUSTOMER_UID: (0, integration_core_1.createSlotKey)('myob.customer.uid'),
|
|
14
|
+
CUSTOMER_EXISTS: (0, integration_core_1.createSlotKey)('myob.customer.exists'),
|
|
15
|
+
CUSTOMER_PAYLOAD: (0, integration_core_1.createSlotKey)('myob.customer.payload'),
|
|
16
|
+
CUSTOMER_RESPONSE: (0, integration_core_1.createSlotKey)('myob.customer.response'),
|
|
17
|
+
MAPPED_CUSTOMER: (0, integration_core_1.createSlotKey)('myob.mapped.customer'),
|
|
18
|
+
// ─────────────────────────────────────
|
|
19
|
+
// SALES ORDER DATA
|
|
20
|
+
// ─────────────────────────────────────
|
|
21
|
+
SALES_ORDER_UID: (0, integration_core_1.createSlotKey)('myob.salesOrder.uid'),
|
|
22
|
+
SALES_ORDER_EXISTS: (0, integration_core_1.createSlotKey)('myob.salesOrder.exists'),
|
|
23
|
+
SALES_ORDER_PAYLOAD: (0, integration_core_1.createSlotKey)('myob.salesOrder.payload'),
|
|
24
|
+
SALES_ORDER_RESPONSE: (0, integration_core_1.createSlotKey)('myob.salesOrder.response'),
|
|
25
|
+
MAPPED_ORDER: (0, integration_core_1.createSlotKey)('myob.mapped.order'),
|
|
26
|
+
// ─────────────────────────────────────
|
|
27
|
+
// PAYMENT DATA
|
|
28
|
+
// ─────────────────────────────────────
|
|
29
|
+
PAYMENTS_PAYLOAD: (0, integration_core_1.createSlotKey)('myob.payments.payload'),
|
|
30
|
+
PAYMENTS_RESPONSES: (0, integration_core_1.createSlotKey)('myob.payments.responses'),
|
|
31
|
+
// For iteration
|
|
32
|
+
CURRENT_PAYMENT: (0, integration_core_1.createSlotKey)('myob.payments.current'),
|
|
33
|
+
CURRENT_PAYMENT_RESPONSE: (0, integration_core_1.createSlotKey)('myob.payments.currentResponse'),
|
|
34
|
+
// ─────────────────────────────────────
|
|
35
|
+
// CONFIGURATION
|
|
36
|
+
// ─────────────────────────────────────
|
|
37
|
+
TAX_CODE_UID: (0, integration_core_1.createSlotKey)('myob.config.taxCodeUid'),
|
|
38
|
+
DEPOSIT_ACCOUNT_UID: (0, integration_core_1.createSlotKey)('myob.config.depositAccountUid'),
|
|
39
|
+
ITEM_ACCOUNT_UID: (0, integration_core_1.createSlotKey)('myob.config.itemAccountUid'),
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=myob-slots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"myob-slots.js","sourceRoot":"","sources":["../../src/slots/myob-slots.ts"],"names":[],"mappings":";;;AAAA,0CAA0C;AAC1C,mEAA6D;AAS7D;;GAEG;AACU,QAAA,SAAS,GAAG;IACvB,wCAAwC;IACxC,gBAAgB;IAChB,wCAAwC;IACxC,YAAY,EAAE,IAAA,gCAAa,EAAS,mBAAmB,CAAC;IACxD,eAAe,EAAE,IAAA,gCAAa,EAAU,sBAAsB,CAAC;IAC/D,gBAAgB,EAAE,IAAA,gCAAa,EAA2B,uBAAuB,CAAC;IAClF,iBAAiB,EAAE,IAAA,gCAAa,EAAc,wBAAwB,CAAC;IACvE,eAAe,EAAE,IAAA,gCAAa,EAAqB,sBAAsB,CAAC;IAE1E,wCAAwC;IACxC,mBAAmB;IACnB,wCAAwC;IACxC,eAAe,EAAE,IAAA,gCAAa,EAAS,qBAAqB,CAAC;IAC7D,kBAAkB,EAAE,IAAA,gCAAa,EAAU,wBAAwB,CAAC;IACpE,mBAAmB,EAAE,IAAA,gCAAa,EAA6B,yBAAyB,CAAC;IACzF,oBAAoB,EAAE,IAAA,gCAAa,EAAgB,0BAA0B,CAAC;IAC9E,YAAY,EAAE,IAAA,gCAAa,EAAkB,mBAAmB,CAAC;IAEjE,wCAAwC;IACxC,eAAe;IACf,wCAAwC;IACxC,gBAAgB,EAAE,IAAA,gCAAa,EAAqC,uBAAuB,CAAC;IAC5F,kBAAkB,EAAE,IAAA,gCAAa,EAAwB,yBAAyB,CAAC;IAEnF,gBAAgB;IAChB,eAAe,EAAE,IAAA,gCAAa,EAAmC,uBAAuB,CAAC;IACzF,wBAAwB,EAAE,IAAA,gCAAa,EAAsB,+BAA+B,CAAC;IAE7F,wCAAwC;IACxC,gBAAgB;IAChB,wCAAwC;IACxC,YAAY,EAAE,IAAA,gCAAa,EAAS,wBAAwB,CAAC;IAC7D,mBAAmB,EAAE,IAAA,gCAAa,EAAS,+BAA+B,CAAC;IAC3E,gBAAgB,EAAE,IAAA,gCAAa,EAAS,4BAA4B,CAAC;CAC7D,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Gateway event structure (simplified)
|
|
3
|
+
*/
|
|
4
|
+
export interface APIGatewayEvent {
|
|
5
|
+
body?: string;
|
|
6
|
+
pathParameters?: Record<string, string>;
|
|
7
|
+
queryStringParameters?: Record<string, string>;
|
|
8
|
+
headers?: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Slot keys for intermediate processing data
|
|
12
|
+
*/
|
|
13
|
+
export declare const ProcessingSlots: {
|
|
14
|
+
readonly RAW_EVENT: import("@tonytang99/integration-core").SlotKey<APIGatewayEvent>;
|
|
15
|
+
readonly RAW_WEBHOOK_PAYLOAD: import("@tonytang99/integration-core").SlotKey<unknown>;
|
|
16
|
+
readonly IS_NEW_ORDER: import("@tonytang99/integration-core").SlotKey<boolean>;
|
|
17
|
+
readonly IS_VALID_ORDER: import("@tonytang99/integration-core").SlotKey<boolean>;
|
|
18
|
+
readonly SHOULD_CREATE_CUSTOMER: import("@tonytang99/integration-core").SlotKey<boolean>;
|
|
19
|
+
readonly SHOULD_PROCESS: import("@tonytang99/integration-core").SlotKey<boolean>;
|
|
20
|
+
readonly ORDER_CREATED_DATE: import("@tonytang99/integration-core").SlotKey<Date>;
|
|
21
|
+
readonly IS_WITHIN_DATE_RANGE: import("@tonytang99/integration-core").SlotKey<boolean>;
|
|
22
|
+
readonly PARTIAL_ERRORS: import("@tonytang99/integration-core").SlotKey<{
|
|
23
|
+
phase: string;
|
|
24
|
+
message: string;
|
|
25
|
+
}[]>;
|
|
26
|
+
readonly LAST_ERROR: import("@tonytang99/integration-core").SlotKey<{
|
|
27
|
+
phase: string;
|
|
28
|
+
message: string;
|
|
29
|
+
code: string;
|
|
30
|
+
}>;
|
|
31
|
+
readonly SYNC_STARTED_AT: import("@tonytang99/integration-core").SlotKey<Date>;
|
|
32
|
+
readonly SYNC_COMPLETED_AT: import("@tonytang99/integration-core").SlotKey<Date>;
|
|
33
|
+
readonly SYNC_RESULT: import("@tonytang99/integration-core").SlotKey<"success" | "partial" | "failed">;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=processing-slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processing-slots.d.ts","sourceRoot":"","sources":["../../src/slots/processing-slots.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;eAwBmB,MAAM;iBAAW,MAAM;;;eACjC,MAAM;iBAAW,MAAM;cAAQ,MAAM;;;;;CAQhE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProcessingSlots = void 0;
|
|
4
|
+
// packages/phases/src/slots/processing-slots.ts
|
|
5
|
+
const integration_core_1 = require("@tonytang99/integration-core");
|
|
6
|
+
/**
|
|
7
|
+
* Slot keys for intermediate processing data
|
|
8
|
+
*/
|
|
9
|
+
exports.ProcessingSlots = {
|
|
10
|
+
// ─────────────────────────────────────
|
|
11
|
+
// INPUT
|
|
12
|
+
// ─────────────────────────────────────
|
|
13
|
+
RAW_EVENT: (0, integration_core_1.createSlotKey)('processing.input.rawEvent'),
|
|
14
|
+
RAW_WEBHOOK_PAYLOAD: (0, integration_core_1.createSlotKey)('processing.input.webhookPayload'),
|
|
15
|
+
// ─────────────────────────────────────
|
|
16
|
+
// DECISION FLAGS
|
|
17
|
+
// ─────────────────────────────────────
|
|
18
|
+
IS_NEW_ORDER: (0, integration_core_1.createSlotKey)('processing.decision.isNewOrder'),
|
|
19
|
+
IS_VALID_ORDER: (0, integration_core_1.createSlotKey)('processing.decision.isValidOrder'),
|
|
20
|
+
SHOULD_CREATE_CUSTOMER: (0, integration_core_1.createSlotKey)('processing.decision.shouldCreateCustomer'),
|
|
21
|
+
SHOULD_PROCESS: (0, integration_core_1.createSlotKey)('processing.decision.shouldProcess'),
|
|
22
|
+
// ─────────────────────────────────────
|
|
23
|
+
// ORDER DATE CHECK
|
|
24
|
+
// ─────────────────────────────────────
|
|
25
|
+
ORDER_CREATED_DATE: (0, integration_core_1.createSlotKey)('processing.order.createdDate'),
|
|
26
|
+
IS_WITHIN_DATE_RANGE: (0, integration_core_1.createSlotKey)('processing.order.isWithinDateRange'),
|
|
27
|
+
// ─────────────────────────────────────
|
|
28
|
+
// ERROR TRACKING
|
|
29
|
+
// ─────────────────────────────────────
|
|
30
|
+
PARTIAL_ERRORS: (0, integration_core_1.createSlotKey)('processing.errors.partial'),
|
|
31
|
+
LAST_ERROR: (0, integration_core_1.createSlotKey)('processing.errors.last'),
|
|
32
|
+
// ─────────────────────────────────────
|
|
33
|
+
// SYNC STATUS
|
|
34
|
+
// ─────────────────────────────────────
|
|
35
|
+
SYNC_STARTED_AT: (0, integration_core_1.createSlotKey)('processing.sync.startedAt'),
|
|
36
|
+
SYNC_COMPLETED_AT: (0, integration_core_1.createSlotKey)('processing.sync.completedAt'),
|
|
37
|
+
SYNC_RESULT: (0, integration_core_1.createSlotKey)('processing.sync.result'),
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=processing-slots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processing-slots.js","sourceRoot":"","sources":["../../src/slots/processing-slots.ts"],"names":[],"mappings":";;;AAAA,gDAAgD;AAChD,mEAA6D;AAY7D;;GAEG;AACU,QAAA,eAAe,GAAG;IAC7B,wCAAwC;IACxC,QAAQ;IACR,wCAAwC;IACxC,SAAS,EAAE,IAAA,gCAAa,EAAkB,2BAA2B,CAAC;IACtE,mBAAmB,EAAE,IAAA,gCAAa,EAAU,iCAAiC,CAAC;IAE9E,wCAAwC;IACxC,iBAAiB;IACjB,wCAAwC;IACxC,YAAY,EAAE,IAAA,gCAAa,EAAU,gCAAgC,CAAC;IACtE,cAAc,EAAE,IAAA,gCAAa,EAAU,kCAAkC,CAAC;IAC1E,sBAAsB,EAAE,IAAA,gCAAa,EAAU,0CAA0C,CAAC;IAC1F,cAAc,EAAE,IAAA,gCAAa,EAAU,mCAAmC,CAAC;IAE3E,wCAAwC;IACxC,mBAAmB;IACnB,wCAAwC;IACxC,kBAAkB,EAAE,IAAA,gCAAa,EAAO,8BAA8B,CAAC;IACvE,oBAAoB,EAAE,IAAA,gCAAa,EAAU,oCAAoC,CAAC;IAElF,wCAAwC;IACxC,iBAAiB;IACjB,wCAAwC;IACxC,cAAc,EAAE,IAAA,gCAAa,EAA4C,2BAA2B,CAAC;IACrG,UAAU,EAAE,IAAA,gCAAa,EAAmD,wBAAwB,CAAC;IAErG,wCAAwC;IACxC,cAAc;IACd,wCAAwC;IACxC,eAAe,EAAE,IAAA,gCAAa,EAAO,2BAA2B,CAAC;IACjE,iBAAiB,EAAE,IAAA,gCAAa,EAAO,6BAA6B,CAAC;IACrE,WAAW,EAAE,IAAA,gCAAa,EAAmC,wBAAwB,CAAC;CAC9E,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { TransformBCOrderPhase } from './transform-bc-order';
|
|
2
|
+
export { TransformBCCustomerPhase, ExtractCustomerFromOrderPhase } from './transform-bc-customer';
|
|
3
|
+
export { TransformCustomerToMYOBPhase, TransformOrderToMYOBPhase, ConstructPaymentsPhase, } from './transform-to-myob';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transform/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/phases/src/transform/index.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ConstructPaymentsPhase = exports.TransformOrderToMYOBPhase = exports.TransformCustomerToMYOBPhase = exports.ExtractCustomerFromOrderPhase = exports.TransformBCCustomerPhase = exports.TransformBCOrderPhase = void 0;
|
|
5
|
+
var transform_bc_order_1 = require("./transform-bc-order");
|
|
6
|
+
Object.defineProperty(exports, "TransformBCOrderPhase", { enumerable: true, get: function () { return transform_bc_order_1.TransformBCOrderPhase; } });
|
|
7
|
+
var transform_bc_customer_1 = require("./transform-bc-customer");
|
|
8
|
+
Object.defineProperty(exports, "TransformBCCustomerPhase", { enumerable: true, get: function () { return transform_bc_customer_1.TransformBCCustomerPhase; } });
|
|
9
|
+
Object.defineProperty(exports, "ExtractCustomerFromOrderPhase", { enumerable: true, get: function () { return transform_bc_customer_1.ExtractCustomerFromOrderPhase; } });
|
|
10
|
+
var transform_to_myob_1 = require("./transform-to-myob");
|
|
11
|
+
Object.defineProperty(exports, "TransformCustomerToMYOBPhase", { enumerable: true, get: function () { return transform_to_myob_1.TransformCustomerToMYOBPhase; } });
|
|
12
|
+
Object.defineProperty(exports, "TransformOrderToMYOBPhase", { enumerable: true, get: function () { return transform_to_myob_1.TransformOrderToMYOBPhase; } });
|
|
13
|
+
Object.defineProperty(exports, "ConstructPaymentsPhase", { enumerable: true, get: function () { return transform_to_myob_1.ConstructPaymentsPhase; } });
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transform/index.ts"],"names":[],"mappings":";AAAA,yCAAyC;;;AAEzC,2DAA6D;AAApD,2HAAA,qBAAqB,OAAA;AAC9B,iEAAkG;AAAzF,iIAAA,wBAAwB,OAAA;AAAE,sIAAA,6BAA6B,OAAA;AAChE,yDAI6B;AAH3B,iIAAA,4BAA4B,OAAA;AAC5B,8HAAA,yBAAyB,OAAA;AACzB,2HAAA,sBAAsB,OAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BasePhase, PipelineContext, SlotKey } from '@tonytang99/integration-core';
|
|
2
|
+
/**
|
|
3
|
+
* Transforms raw BigCommerce customer data to mapped format
|
|
4
|
+
*/
|
|
5
|
+
export declare class TransformBCCustomerPhase extends BasePhase {
|
|
6
|
+
readonly name = "transform:bc-customer";
|
|
7
|
+
readonly description = "Transforms BigCommerce customer to mapped format";
|
|
8
|
+
readonly tags: string[];
|
|
9
|
+
readonly requires: SlotKey<unknown>[];
|
|
10
|
+
readonly produces: SlotKey<unknown>[];
|
|
11
|
+
execute(ctx: PipelineContext): Promise<PipelineContext>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Extracts customer data from order for guest checkout scenarios
|
|
15
|
+
* Creates a minimal customer record from billing address
|
|
16
|
+
*/
|
|
17
|
+
export declare class ExtractCustomerFromOrderPhase extends BasePhase {
|
|
18
|
+
readonly name = "transform:extract-customer-from-order";
|
|
19
|
+
readonly description = "Extracts customer data from order billing address";
|
|
20
|
+
readonly tags: string[];
|
|
21
|
+
readonly requires: SlotKey<unknown>[];
|
|
22
|
+
readonly produces: SlotKey<unknown>[];
|
|
23
|
+
execute(ctx: PipelineContext): Promise<PipelineContext>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=transform-bc-customer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-bc-customer.d.ts","sourceRoot":"","sources":["../../src/transform/transform-bc-customer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAInF;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,SAAS;IACrD,QAAQ,CAAC,IAAI,2BAA2B;IACxC,QAAQ,CAAC,WAAW,sDAAsD;IAC1E,QAAQ,CAAC,IAAI,WAA4C;IAEzD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAmC;IACxE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAsC;IAErE,OAAO,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;CAM9D;AAED;;;GAGG;AACH,qBAAa,6BAA8B,SAAQ,SAAS;IAC1D,QAAQ,CAAC,IAAI,2CAA2C;IACxD,QAAQ,CAAC,WAAW,uDAAuD;IAC3E,QAAQ,CAAC,IAAI,WAA4C;IAEzD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAgC;IACrE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAsC;IAErE,OAAO,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;CAgC9D"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExtractCustomerFromOrderPhase = exports.TransformBCCustomerPhase = void 0;
|
|
4
|
+
// packages/phases/src/transform/transform-bc-customer.ts
|
|
5
|
+
const integration_core_1 = require("@tonytang99/integration-core");
|
|
6
|
+
const integration_adapters_1 = require("@tonytang99/integration-adapters");
|
|
7
|
+
const bigcommerce_slots_1 = require("../slots/bigcommerce-slots");
|
|
8
|
+
/**
|
|
9
|
+
* Transforms raw BigCommerce customer data to mapped format
|
|
10
|
+
*/
|
|
11
|
+
class TransformBCCustomerPhase extends integration_core_1.BasePhase {
|
|
12
|
+
name = 'transform:bc-customer';
|
|
13
|
+
description = 'Transforms BigCommerce customer to mapped format';
|
|
14
|
+
tags = ['transform', 'bigcommerce', 'customer'];
|
|
15
|
+
requires = [bigcommerce_slots_1.BigCommerceSlots.RAW_CUSTOMER];
|
|
16
|
+
produces = [bigcommerce_slots_1.BigCommerceSlots.MAPPED_CUSTOMER];
|
|
17
|
+
async execute(ctx) {
|
|
18
|
+
const customer = ctx.require(bigcommerce_slots_1.BigCommerceSlots.RAW_CUSTOMER);
|
|
19
|
+
const mappedCustomer = (0, integration_adapters_1.mapBCCustomerToCanonical)(customer);
|
|
20
|
+
return ctx.set(bigcommerce_slots_1.BigCommerceSlots.MAPPED_CUSTOMER, mappedCustomer);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.TransformBCCustomerPhase = TransformBCCustomerPhase;
|
|
24
|
+
/**
|
|
25
|
+
* Extracts customer data from order for guest checkout scenarios
|
|
26
|
+
* Creates a minimal customer record from billing address
|
|
27
|
+
*/
|
|
28
|
+
class ExtractCustomerFromOrderPhase extends integration_core_1.BasePhase {
|
|
29
|
+
name = 'transform:extract-customer-from-order';
|
|
30
|
+
description = 'Extracts customer data from order billing address';
|
|
31
|
+
tags = ['transform', 'bigcommerce', 'customer'];
|
|
32
|
+
requires = [bigcommerce_slots_1.BigCommerceSlots.RAW_ORDER];
|
|
33
|
+
produces = [bigcommerce_slots_1.BigCommerceSlots.MAPPED_CUSTOMER];
|
|
34
|
+
async execute(ctx) {
|
|
35
|
+
const order = ctx.require(bigcommerce_slots_1.BigCommerceSlots.RAW_ORDER);
|
|
36
|
+
const extracted = (0, integration_adapters_1.extractCustomerFromBCOrder)(order);
|
|
37
|
+
// Create a minimal mapped customer from order data
|
|
38
|
+
const mappedCustomer = {
|
|
39
|
+
id: extracted.customerId ? String(extracted.customerId) : `guest-${order.id}`,
|
|
40
|
+
email: extracted.email,
|
|
41
|
+
firstName: extracted.firstName,
|
|
42
|
+
lastName: extracted.lastName,
|
|
43
|
+
company: extracted.company,
|
|
44
|
+
phone: extracted.phone,
|
|
45
|
+
addresses: order.billing_address ? [{
|
|
46
|
+
street1: order.billing_address.street_1,
|
|
47
|
+
street2: order.billing_address.street_2 || undefined,
|
|
48
|
+
city: order.billing_address.city,
|
|
49
|
+
state: order.billing_address.state,
|
|
50
|
+
postalCode: order.billing_address.zip,
|
|
51
|
+
countryCode: order.billing_address.country_iso2,
|
|
52
|
+
firstName: order.billing_address.first_name,
|
|
53
|
+
lastName: order.billing_address.last_name,
|
|
54
|
+
company: order.billing_address.company || undefined,
|
|
55
|
+
phone: order.billing_address.phone || undefined,
|
|
56
|
+
}] : [],
|
|
57
|
+
createdAt: order.date_created,
|
|
58
|
+
updatedAt: order.date_modified,
|
|
59
|
+
source: 'bigcommerce',
|
|
60
|
+
sourceId: extracted.customerId ? String(extracted.customerId) : `guest-${order.id}`,
|
|
61
|
+
};
|
|
62
|
+
return ctx.set(bigcommerce_slots_1.BigCommerceSlots.MAPPED_CUSTOMER, mappedCustomer);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.ExtractCustomerFromOrderPhase = ExtractCustomerFromOrderPhase;
|
|
66
|
+
//# sourceMappingURL=transform-bc-customer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-bc-customer.js","sourceRoot":"","sources":["../../src/transform/transform-bc-customer.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BasePhase, PipelineContext, SlotKey } from '@tonytang99/integration-core';
|
|
2
|
+
/**
|
|
3
|
+
* Transforms raw BigCommerce order data to mapped format
|
|
4
|
+
*/
|
|
5
|
+
export declare class TransformBCOrderPhase extends BasePhase {
|
|
6
|
+
readonly name = "transform:bc-order";
|
|
7
|
+
readonly description = "Transforms BigCommerce order to mapped format";
|
|
8
|
+
readonly tags: string[];
|
|
9
|
+
readonly requires: SlotKey<unknown>[];
|
|
10
|
+
readonly produces: SlotKey<unknown>[];
|
|
11
|
+
execute(ctx: PipelineContext): Promise<PipelineContext>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=transform-bc-order.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-bc-order.d.ts","sourceRoot":"","sources":["../../src/transform/transform-bc-order.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAInF;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,SAAS;IAClD,QAAQ,CAAC,IAAI,wBAAwB;IACrC,QAAQ,CAAC,WAAW,mDAAmD;IACvE,QAAQ,CAAC,IAAI,WAAyC;IAEtD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAInC;IACF,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAmC;IAElE,OAAO,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;CAS9D"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransformBCOrderPhase = void 0;
|
|
4
|
+
// packages/phases/src/transform/transform-bc-order.ts
|
|
5
|
+
const integration_core_1 = require("@tonytang99/integration-core");
|
|
6
|
+
const integration_adapters_1 = require("@tonytang99/integration-adapters");
|
|
7
|
+
const bigcommerce_slots_1 = require("../slots/bigcommerce-slots");
|
|
8
|
+
/**
|
|
9
|
+
* Transforms raw BigCommerce order data to mapped format
|
|
10
|
+
*/
|
|
11
|
+
class TransformBCOrderPhase extends integration_core_1.BasePhase {
|
|
12
|
+
name = 'transform:bc-order';
|
|
13
|
+
description = 'Transforms BigCommerce order to mapped format';
|
|
14
|
+
tags = ['transform', 'bigcommerce', 'order'];
|
|
15
|
+
requires = [
|
|
16
|
+
bigcommerce_slots_1.BigCommerceSlots.RAW_ORDER,
|
|
17
|
+
bigcommerce_slots_1.BigCommerceSlots.RAW_ORDER_PRODUCTS,
|
|
18
|
+
bigcommerce_slots_1.BigCommerceSlots.RAW_ORDER_SHIPPING,
|
|
19
|
+
];
|
|
20
|
+
produces = [bigcommerce_slots_1.BigCommerceSlots.MAPPED_ORDER];
|
|
21
|
+
async execute(ctx) {
|
|
22
|
+
const order = ctx.require(bigcommerce_slots_1.BigCommerceSlots.RAW_ORDER);
|
|
23
|
+
const products = ctx.require(bigcommerce_slots_1.BigCommerceSlots.RAW_ORDER_PRODUCTS);
|
|
24
|
+
const shippingAddresses = ctx.require(bigcommerce_slots_1.BigCommerceSlots.RAW_ORDER_SHIPPING);
|
|
25
|
+
const mappedOrder = (0, integration_adapters_1.mapBCOrderToCanonical)(order, products, shippingAddresses);
|
|
26
|
+
return ctx.set(bigcommerce_slots_1.BigCommerceSlots.MAPPED_ORDER, mappedOrder);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.TransformBCOrderPhase = TransformBCOrderPhase;
|
|
30
|
+
//# sourceMappingURL=transform-bc-order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-bc-order.js","sourceRoot":"","sources":["../../src/transform/transform-bc-order.ts"],"names":[],"mappings":";;;AAAA,sDAAsD;AACtD,mEAAmF;AACnF,2EAAyE;AACzE,kEAA8D;AAE9D;;GAEG;AACH,MAAa,qBAAsB,SAAQ,4BAAS;IACzC,IAAI,GAAG,oBAAoB,CAAC;IAC5B,WAAW,GAAG,+CAA+C,CAAC;IAC9D,IAAI,GAAG,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;IAE7C,QAAQ,GAAuB;QACtC,oCAAgB,CAAC,SAAS;QAC1B,oCAAgB,CAAC,kBAAkB;QACnC,oCAAgB,CAAC,kBAAkB;KACpC,CAAC;IACO,QAAQ,GAAuB,CAAC,oCAAgB,CAAC,YAAY,CAAC,CAAC;IAExE,KAAK,CAAC,OAAO,CAAC,GAAoB;QAChC,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,oCAAgB,CAAC,SAAS,CAAC,CAAC;QACtD,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,oCAAgB,CAAC,kBAAkB,CAAC,CAAC;QAClE,MAAM,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAAC,oCAAgB,CAAC,kBAAkB,CAAC,CAAC;QAE3E,MAAM,WAAW,GAAG,IAAA,4CAAqB,EAAC,KAAK,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAE9E,OAAO,GAAG,CAAC,GAAG,CAAC,oCAAgB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAC7D,CAAC;CACF;AArBD,sDAqBC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BasePhase, PipelineContext, SlotKey } from '@tonytang99/integration-core';
|
|
2
|
+
/**
|
|
3
|
+
* Transforms mapped customer data to MYOB Contact format
|
|
4
|
+
*/
|
|
5
|
+
export declare class TransformCustomerToMYOBPhase extends BasePhase {
|
|
6
|
+
readonly name = "transform:customer-to-myob";
|
|
7
|
+
readonly description = "Transforms customer to MYOB Contact format";
|
|
8
|
+
readonly tags: string[];
|
|
9
|
+
readonly requires: SlotKey<unknown>[];
|
|
10
|
+
readonly produces: SlotKey<unknown>[];
|
|
11
|
+
execute(ctx: PipelineContext): Promise<PipelineContext>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Transforms mapped order data to MYOB Sale Order format
|
|
15
|
+
*/
|
|
16
|
+
export declare class TransformOrderToMYOBPhase extends BasePhase {
|
|
17
|
+
readonly name = "transform:order-to-myob";
|
|
18
|
+
readonly description = "Transforms order to MYOB Sale Order format";
|
|
19
|
+
readonly tags: string[];
|
|
20
|
+
readonly requires: SlotKey<unknown>[];
|
|
21
|
+
readonly produces: SlotKey<unknown>[];
|
|
22
|
+
readonly optionalReads: SlotKey<unknown>[];
|
|
23
|
+
execute(ctx: PipelineContext): Promise<PipelineContext>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Constructs MYOB payment records from BC transactions
|
|
27
|
+
*/
|
|
28
|
+
export declare class ConstructPaymentsPhase extends BasePhase {
|
|
29
|
+
readonly name = "transform:construct-payments";
|
|
30
|
+
readonly description = "Constructs MYOB payments from BC transactions";
|
|
31
|
+
readonly tags: string[];
|
|
32
|
+
readonly requires: SlotKey<unknown>[];
|
|
33
|
+
readonly produces: SlotKey<unknown>[];
|
|
34
|
+
readonly optionalReads: SlotKey<unknown>[];
|
|
35
|
+
execute(ctx: PipelineContext): Promise<PipelineContext>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=transform-to-myob.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-to-myob.d.ts","sourceRoot":"","sources":["../../src/transform/transform-to-myob.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AASnF;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,SAAS;IACzD,QAAQ,CAAC,IAAI,gCAAgC;IAC7C,QAAQ,CAAC,WAAW,gDAAgD;IACpE,QAAQ,CAAC,IAAI,WAAqC;IAElD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAsC;IAC3E,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAgC;IAE/D,OAAO,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;CAM9D;AAED;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,SAAS;IACtD,QAAQ,CAAC,IAAI,6BAA6B;IAC1C,QAAQ,CAAC,WAAW,gDAAgD;IACpE,QAAQ,CAAC,IAAI,WAAkC;IAE/C,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAGnC;IACF,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAmC;IACxE,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAGxC;IAEI,OAAO,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;CAe9D;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,SAAS;IACnD,QAAQ,CAAC,IAAI,kCAAkC;IAC/C,QAAQ,CAAC,WAAW,mDAAmD;IACvE,QAAQ,CAAC,IAAI,WAAqC;IAElD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAInC;IACF,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAgC;IACrE,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAmC;IAEvE,OAAO,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;CAe9D"}
|