@ph-itdev/warehouse-zone-manager 0.2026.629
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 +26 -0
- package/bin/cli.js +72 -0
- package/example/index.html +88 -0
- package/index.d.ts +2 -0
- package/index.js +49 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @ph-itdev/warehouse-zone-manager
|
|
2
|
+
|
|
3
|
+
Manage warehouse zones, bin locations, put-away rules, and zone-based picking strategies for fulfillment automation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @ph-itdev/warehouse-zone-manager
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
const { } = require('@ph-itdev/warehouse-zone-manager');
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## API
|
|
18
|
+
|
|
19
|
+
See source code for full API documentation.
|
|
20
|
+
|
|
21
|
+
## License
|
|
22
|
+
|
|
23
|
+
MIT
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
*Auto-generated by logistics-npm pipeline — 2026-06-29*
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// @ph-itdev/warehouse-zone-manager CLI
|
|
4
|
+
// Usage: npx @ph-itdev/warehouse-zone-manager playground
|
|
5
|
+
|
|
6
|
+
const http = require('http');
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
const { exec } = require('child_process');
|
|
10
|
+
|
|
11
|
+
const args = process.argv.slice(2);
|
|
12
|
+
const command = args[0];
|
|
13
|
+
|
|
14
|
+
if (command === 'playground' || command === 'demo' || command === 'play') {
|
|
15
|
+
startPlayground();
|
|
16
|
+
} else if (command === 'help' || !command) {
|
|
17
|
+
console.log(`
|
|
18
|
+
📦 @ph-itdev/warehouse-zone-manager
|
|
19
|
+
|
|
20
|
+
Commands:
|
|
21
|
+
npx @ph-itdev/warehouse-zone-manager playground Open interactive playground in browser
|
|
22
|
+
npx @ph-itdev/warehouse-zone-manager demo Same as playground
|
|
23
|
+
npx @ph-itdev/warehouse-zone-manager help Show this help
|
|
24
|
+
`);
|
|
25
|
+
} else {
|
|
26
|
+
console.log(`Unknown command: ${command}. Run with "help" for usage.`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function startPlayground() {
|
|
30
|
+
const examplePath = path.join(__dirname, '..', 'example', 'index.html');
|
|
31
|
+
|
|
32
|
+
if (!fs.existsSync(examplePath)) {
|
|
33
|
+
console.error('❌ Example file not found. Try: npm install @ph-itdev/warehouse-zone-manager');
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const html = fs.readFileSync(examplePath, 'utf-8');
|
|
38
|
+
|
|
39
|
+
const server = http.createServer((req, res) => {
|
|
40
|
+
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
|
|
41
|
+
res.end(html);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const PORT = 3456;
|
|
45
|
+
|
|
46
|
+
server.listen(PORT, '127.0.0.1', () => {
|
|
47
|
+
const url = `http://localhost:${PORT}`;
|
|
48
|
+
console.log(`
|
|
49
|
+
📦 @ph-itdev/warehouse-zone-manager — Playground running!
|
|
50
|
+
|
|
51
|
+
🌐 Open: ${url}
|
|
52
|
+
|
|
53
|
+
Press Ctrl+C to stop.
|
|
54
|
+
`);
|
|
55
|
+
const platform = process.platform;
|
|
56
|
+
if (platform === 'darwin') exec(`open ${url}`);
|
|
57
|
+
else if (platform === 'win32') exec(`start ${url}`);
|
|
58
|
+
else exec(`xdg-open ${url} 2>/dev/null || echo "Open ${url} in your browser"`);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
server.on('error', (err) => {
|
|
62
|
+
if (err.code === 'EADDRINUSE') {
|
|
63
|
+
console.log(`⚠️ Port ${PORT} in use. Opening http://localhost:${PORT} instead.`);
|
|
64
|
+
const platform = process.platform;
|
|
65
|
+
if (platform === 'darwin') exec(`open http://localhost:${PORT}`);
|
|
66
|
+
else if (platform === 'win32') exec(`start http://localhost:${PORT}`);
|
|
67
|
+
else exec(`xdg-open http://localhost:${PORT} 2>/dev/null`);
|
|
68
|
+
} else {
|
|
69
|
+
console.error('Server error:', err);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>@ph-itdev/warehouse-zone-manager — Live Playground</title>
|
|
7
|
+
<style>
|
|
8
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
9
|
+
body { font-family: 'JetBrains Mono','Fira Code',monospace; background: #0a0e1a; color: #e0e6f0; min-height: 100vh; }
|
|
10
|
+
.header { background: linear-gradient(135deg, #0c1430 0%, #1a0a2e 100%); border-bottom: 1px solid rgba(0,229,255,0.15); padding: 24px 32px; text-align: center; }
|
|
11
|
+
.header h1 { font-size: 28px; color: #00e5ff; margin-bottom: 6px; letter-spacing: 2px; }
|
|
12
|
+
.header p { color: #7eb8c9; font-size: 13px; opacity: 0.7; }
|
|
13
|
+
.header .badge { display: inline-block; background: rgba(0,229,255,0.1); border: 1px solid rgba(0,229,255,0.3); color: #00e5ff; padding: 4px 12px; border-radius: 4px; font-size: 12px; margin-top: 10px; }
|
|
14
|
+
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
|
|
15
|
+
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
|
|
16
|
+
@media (max-width: 768px) { .grid { grid-template-columns: 1fr; } }
|
|
17
|
+
.panel { background: rgba(12,20,48,0.8); border: 1px solid rgba(0,229,255,0.1); border-radius: 10px; padding: 18px; }
|
|
18
|
+
.panel h2 { font-size: 14px; color: #00e5ff; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px dashed rgba(0,229,255,0.15); }
|
|
19
|
+
label { display: block; font-size: 11px; color: #7eb8c9; margin-bottom: 4px; letter-spacing: 1px; }
|
|
20
|
+
input, select { width: 100%; background: rgba(0,229,255,0.04); border: 1px solid rgba(0,229,255,0.15); color: #e0e6f0; padding: 8px 12px; border-radius: 6px; font-family: inherit; font-size: 13px; margin-bottom: 10px; outline: none; }
|
|
21
|
+
input:focus, select:focus { border-color: rgba(0,229,255,0.5); }
|
|
22
|
+
select option { background: #0c1430; }
|
|
23
|
+
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
|
|
24
|
+
button { background: linear-gradient(135deg, rgba(0,229,255,0.15), rgba(0,229,255,0.05)); border: 1px solid rgba(0,229,255,0.35); color: #00e5ff; padding: 10px 18px; border-radius: 6px; cursor: pointer; font-family: inherit; font-size: 13px; letter-spacing: 1px; transition: all 0.2s; margin-top: 4px; }
|
|
25
|
+
button:hover { background: rgba(0,229,255,0.2); box-shadow: 0 0 12px rgba(0,229,255,0.2); }
|
|
26
|
+
button.danger { border-color: rgba(255,100,100,0.4); color: #ff6464; }
|
|
27
|
+
button.danger:hover { background: rgba(255,100,100,0.15); }
|
|
28
|
+
.output { background: #060a14; border: 1px solid rgba(0,229,255,0.08); border-radius: 8px; padding: 14px; font-size: 12px; line-height: 1.6; max-height: 400px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; }
|
|
29
|
+
.output .log { color: #7eb8c9; } .output .success { color: #28c840; } .output .error { color: #ff6464; } .output .info { color: #00e5ff; } .output .warn { color: #ffb352; }
|
|
30
|
+
.full-width { grid-column: 1 / -1; }
|
|
31
|
+
::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: rgba(0,229,255,0.2); border-radius: 3px; }
|
|
32
|
+
</style>
|
|
33
|
+
</head>
|
|
34
|
+
<body>
|
|
35
|
+
<div class="header">
|
|
36
|
+
<h1>📦 warehouse-zone-manager</h1>
|
|
37
|
+
<p>Manage warehouse zones, bin locations, put-away rules, and zone-based picking strategies for fulfillment automation.</p>
|
|
38
|
+
<span class="badge">npm install @ph-itdev/warehouse-zone-manager</span>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="container">
|
|
41
|
+
<div class="grid">
|
|
42
|
+
<div class="panel">
|
|
43
|
+
<h2>🚀 Try It</h2>
|
|
44
|
+
<p style="font-size:12px;color:#7eb8c9;margin-bottom:12px;">Run in your terminal:</p>
|
|
45
|
+
<div class="output" style="max-height:none;">
|
|
46
|
+
<div class="info"># Install</div>
|
|
47
|
+
<div class="success">npm install @ph-itdev/warehouse-zone-manager</div>
|
|
48
|
+
<br>
|
|
49
|
+
<div class="info"># Open playground</div>
|
|
50
|
+
<div class="success">npx warehouse-zone-manager playground</div>
|
|
51
|
+
<br>
|
|
52
|
+
<div class="info"># Use in code</div>
|
|
53
|
+
<div class="log">const pkg = require('@ph-itdev/warehouse-zone-manager');</div>
|
|
54
|
+
<div class="log">console.log(Object.keys(pkg));</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="panel">
|
|
58
|
+
<h2>📦 Package Info</h2>
|
|
59
|
+
<div class="output" style="max-height:none;">
|
|
60
|
+
<div class="log">Name: @ph-itdev/warehouse-zone-manager</div>
|
|
61
|
+
<div class="log">Version: 1.0.0</div>
|
|
62
|
+
<div class="log">License: MIT</div>
|
|
63
|
+
<div class="log">Author: @ph-itdev</div>
|
|
64
|
+
<div class="log">Registry: npmjs.com</div>
|
|
65
|
+
<div class="log">Repo: github.com/nilskie06/warehouse-zone-manager</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<div class="panel full-width">
|
|
69
|
+
<h2>💻 Console</h2>
|
|
70
|
+
<div id="console" class="output"></div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
<script>
|
|
75
|
+
function log(msg, cls='log') {
|
|
76
|
+
const el = document.getElementById('console');
|
|
77
|
+
const line = document.createElement('div');
|
|
78
|
+
line.className = cls;
|
|
79
|
+
line.textContent = '[' + new Date().toLocaleTimeString() + '] ' + msg;
|
|
80
|
+
el.appendChild(line);
|
|
81
|
+
el.scrollTop = el.scrollHeight;
|
|
82
|
+
}
|
|
83
|
+
log('🚀 Welcome! This is the interactive playground for @ph-itdev/warehouse-zone-manager', 'info');
|
|
84
|
+
log(' Install: npm install @ph-itdev/warehouse-zone-manager', 'info');
|
|
85
|
+
log(' CLI: npx warehouse-zone-manager playground', 'info');
|
|
86
|
+
</script>
|
|
87
|
+
</body>
|
|
88
|
+
</html>
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Warehouse Zone Manager
|
|
2
|
+
// Manage warehouse zones, bin locations, put-away rules, and zone-based picking strategies for fulfillment automation.
|
|
3
|
+
// Auto-generated by @ph-itdev/logistics-pipeline
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class WarehouseZoneManager {
|
|
7
|
+
constructor() { this.zones = new Map(); this.items = new Map(); this.logs = []; }
|
|
8
|
+
createZone(id, name, { capacity = 1000, temperature = 'ambient', hazmat = false } = {}) {
|
|
9
|
+
this.zones.set(id, { id, name, capacity, used: 0, temperature, hazmat, bins: new Map() });
|
|
10
|
+
}
|
|
11
|
+
createBin(zoneId, binId, { x = 0, y = 0, z = 0, maxWeight = 50 } = {}) {
|
|
12
|
+
const zone = this.zones.get(zoneId);
|
|
13
|
+
if (!zone) throw new Error('Zone not found');
|
|
14
|
+
zone.bins.set(binId, { id: binId, zoneId, x, y, z, maxWeight, items: [], currentWeight: 0 });
|
|
15
|
+
}
|
|
16
|
+
putAway(itemId, zoneId, binId, { quantity = 1, weight = 1 } = {}) {
|
|
17
|
+
const zone = this.zones.get(zoneId);
|
|
18
|
+
const bin = zone?.bins.get(binId);
|
|
19
|
+
if (!bin) throw new Error('Bin not found');
|
|
20
|
+
if (bin.currentWeight + weight * quantity > bin.maxWeight) throw new Error('Bin weight exceeded');
|
|
21
|
+
if (zone.used + quantity > zone.capacity) throw new Error('Zone capacity exceeded');
|
|
22
|
+
bin.items.push({ itemId, quantity, weight, ts: Date.now() });
|
|
23
|
+
bin.currentWeight += weight * quantity;
|
|
24
|
+
zone.used += quantity;
|
|
25
|
+
this.items.set(itemId, { zoneId, binId, quantity });
|
|
26
|
+
this.logs.push({ action: 'PUT_AWAY', itemId, zoneId, binId, quantity, ts: Date.now() });
|
|
27
|
+
}
|
|
28
|
+
pick(itemId, quantity = 1) {
|
|
29
|
+
const loc = this.items.get(itemId);
|
|
30
|
+
if (!loc) throw new Error('Item not found');
|
|
31
|
+
const bin = this.zones.get(loc.zoneId).bins.get(loc.binId);
|
|
32
|
+
const entry = bin.items.find(i => i.itemId === itemId);
|
|
33
|
+
if (!entry || entry.quantity < quantity) throw new Error('Insufficient quantity');
|
|
34
|
+
entry.quantity -= quantity;
|
|
35
|
+
if (entry.quantity === 0) bin.items = bin.items.filter(i => i !== entry);
|
|
36
|
+
bin.currentWeight -= entry.weight * quantity;
|
|
37
|
+
this.zones.get(loc.zoneId).used -= quantity;
|
|
38
|
+
this.logs.push({ action: 'PICK', itemId, zoneId: loc.zoneId, binId: loc.binId, quantity, ts: Date.now() });
|
|
39
|
+
}
|
|
40
|
+
findItem(itemId) { return this.items.get(itemId) || null; }
|
|
41
|
+
getZoneUtilization(zoneId) {
|
|
42
|
+
const zone = this.zones.get(zoneId);
|
|
43
|
+
return { zoneId, name: zone.name, used: zone.used, capacity: zone.capacity, pct: +((zone.used / zone.capacity) * 100).toFixed(1) };
|
|
44
|
+
}
|
|
45
|
+
getLogs(filter = {}) { return this.logs.filter(l => filter.action ? l.action === filter.action : true); }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
module.exports = { WarehouseZoneManager };
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ph-itdev/warehouse-zone-manager",
|
|
3
|
+
"version": "0.2026.0629",
|
|
4
|
+
"description": "Manage warehouse zones, bin locations, put-away rules, and zone-based picking strategies for fulfillment automation.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"bin": {
|
|
9
|
+
"warehouse-zone-manager": "bin/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"index.js",
|
|
13
|
+
"index.d.ts",
|
|
14
|
+
"bin/",
|
|
15
|
+
"example/",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "node test.js",
|
|
20
|
+
"lint": "echo 'lint ok'",
|
|
21
|
+
"playground": "node bin/cli.js playground"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"logistics",
|
|
25
|
+
"automation",
|
|
26
|
+
"shipping",
|
|
27
|
+
"supply-chain",
|
|
28
|
+
"warehouse"
|
|
29
|
+
],
|
|
30
|
+
"author": "@ph-itdev",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/nilskie06/warehouse-zone-manager.git"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/nilskie06/warehouse-zone-manager#readme",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/nilskie06/warehouse-zone-manager/issues"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=14.0.0"
|
|
42
|
+
}
|
|
43
|
+
}
|