@tonytang99/integration-phases 1.0.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/README.md +9 -0
- package/dist/extract/bigcommerce-product.d.ts +13 -0
- package/dist/extract/bigcommerce-product.d.ts.map +1 -0
- package/dist/extract/bigcommerce-product.js +31 -0
- package/dist/extract/bigcommerce-product.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/package.json +26 -0
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BasePhase, PipelineContext, SlotKey } from '@tonytang99/integration-core';
|
|
2
|
+
export declare const Slots: {
|
|
3
|
+
PRODUCT_ID: SlotKey;
|
|
4
|
+
SOURCE_RAW: SlotKey;
|
|
5
|
+
};
|
|
6
|
+
export declare class ExtractBigCommerceProductPhase extends BasePhase {
|
|
7
|
+
readonly name = "extract:bc:product";
|
|
8
|
+
readonly description = "Fetches product from BigCommerce (simulated)";
|
|
9
|
+
readonly requires: SlotKey[];
|
|
10
|
+
readonly produces: SlotKey[];
|
|
11
|
+
execute(ctx: PipelineContext): Promise<PipelineContext>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=bigcommerce-product.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bigcommerce-product.d.ts","sourceRoot":"","sources":["../../src/extract/bigcommerce-product.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAiB,MAAM,8BAA8B,CAAC;AAElG,eAAO,MAAM,KAAK;;;CAGjB,CAAC;AAEF,qBAAa,8BAA+B,SAAQ,SAAS;IAC3D,QAAQ,CAAC,IAAI,wBAAwB;IACrC,QAAQ,CAAC,WAAW,kDAAkD;IACtE,QAAQ,CAAC,QAAQ,YAAsB;IACvC,QAAQ,CAAC,QAAQ,YAAsB;IAEjC,OAAO,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;CAoB9D"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExtractBigCommerceProductPhase = exports.Slots = void 0;
|
|
4
|
+
const integration_core_1 = require("@tonytang99/integration-core");
|
|
5
|
+
exports.Slots = {
|
|
6
|
+
PRODUCT_ID: (0, integration_core_1.createSlotKey)('input.productId'),
|
|
7
|
+
SOURCE_RAW: (0, integration_core_1.createSlotKey)('source.raw'),
|
|
8
|
+
};
|
|
9
|
+
class ExtractBigCommerceProductPhase extends integration_core_1.BasePhase {
|
|
10
|
+
name = 'extract:bc:product';
|
|
11
|
+
description = 'Fetches product from BigCommerce (simulated)';
|
|
12
|
+
requires = [exports.Slots.PRODUCT_ID];
|
|
13
|
+
produces = [exports.Slots.SOURCE_RAW];
|
|
14
|
+
async execute(ctx) {
|
|
15
|
+
const productId = ctx.require(exports.Slots.PRODUCT_ID);
|
|
16
|
+
console.log(` → Fetching BC product ${productId}...`);
|
|
17
|
+
// Simulate API call with delay
|
|
18
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
19
|
+
const product = {
|
|
20
|
+
id: productId,
|
|
21
|
+
sku: 'WGT-ABC-123',
|
|
22
|
+
name: 'Test Widget',
|
|
23
|
+
price: 99.99,
|
|
24
|
+
inventory_level: 50,
|
|
25
|
+
};
|
|
26
|
+
console.log(` ✓ Fetched product: ${product.name}`);
|
|
27
|
+
return ctx.set(exports.Slots.SOURCE_RAW, product);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.ExtractBigCommerceProductPhase = ExtractBigCommerceProductPhase;
|
|
31
|
+
//# sourceMappingURL=bigcommerce-product.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bigcommerce-product.js","sourceRoot":"","sources":["../../src/extract/bigcommerce-product.ts"],"names":[],"mappings":";;;AAAA,mEAAkG;AAErF,QAAA,KAAK,GAAG;IACnB,UAAU,EAAE,IAAA,gCAAa,EAAS,iBAAiB,CAAC;IACpD,UAAU,EAAE,IAAA,gCAAa,EAAM,YAAY,CAAC;CAC7C,CAAC;AAEF,MAAa,8BAA+B,SAAQ,4BAAS;IAClD,IAAI,GAAG,oBAAoB,CAAC;IAC5B,WAAW,GAAG,8CAA8C,CAAC;IAC7D,QAAQ,GAAG,CAAC,aAAK,CAAC,UAAU,CAAC,CAAC;IAC9B,QAAQ,GAAG,CAAC,aAAK,CAAC,UAAU,CAAC,CAAC;IAEvC,KAAK,CAAC,OAAO,CAAC,GAAoB;QAChC,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAS,aAAK,CAAC,UAAU,CAAC,CAAC;QAExD,OAAO,CAAC,GAAG,CAAC,2BAA2B,SAAS,KAAK,CAAC,CAAC;QAEvD,+BAA+B;QAC/B,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;QAEvD,MAAM,OAAO,GAAG;YACd,EAAE,EAAE,SAAS;YACb,GAAG,EAAE,aAAa;YAClB,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,KAAK;YACZ,eAAe,EAAE,EAAE;SACpB,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,wBAAwB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAEpD,OAAO,GAAG,CAAC,GAAG,CAAC,aAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;CACF;AA1BD,wEA0BC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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("./extract/bigcommerce-product"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C"}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tonytang99/integration-phases",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Pre-built phases for common integration patterns",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": ["dist"],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"clean": "rm -rf dist",
|
|
11
|
+
"prepublishOnly": "npm run build"
|
|
12
|
+
},
|
|
13
|
+
"keywords": ["integration", "phases", "etl"],
|
|
14
|
+
"author": "tonytang99",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@tonytang99/integration-core": "^1.0.0",
|
|
18
|
+
"@tonytang99/integration-canonical": "^1.0.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"typescript": "^5.2.0"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
}
|
|
26
|
+
}
|