@bayoudhi/moose-lib-serverless 0.1.0 → 0.1.1
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/LICENSE +22 -0
- package/README.md +64 -0
- package/package.json +4 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Tim Delisle, Nicolas Joseph
|
|
4
|
+
Copyright (c) 2026 Hamza MEHRI
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# @bayoudhi/moose-lib-serverless
|
|
2
|
+
|
|
3
|
+
Serverless-compatible subset of [`@514labs/moose-lib`](https://www.npmjs.com/package/@514labs/moose-lib) for **AWS Lambda**, **Edge runtimes**, and other environments where native C++ modules cannot be compiled or loaded.
|
|
4
|
+
|
|
5
|
+
This package re-exports the pure-TypeScript surface of the Moose SDK — OlapTable, Stream, View, Workflow, sql helpers, ClickHouse type annotations, and more — without pulling in `@514labs/kafka-javascript`, `@temporalio/client`, or `redis`.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @bayoudhi/moose-lib-serverless
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
### CommonJS (recommended for Lambda)
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const { OlapTable, Stream, sql } = require("@bayoudhi/moose-lib-serverless");
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### ES Modules
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import { OlapTable, Stream, sql } from "@bayoudhi/moose-lib-serverless";
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
> **Note**: The CJS bundle is recommended for AWS Lambda because ESM top-level imports cannot be lazily deferred. The CJS bundle keeps the Kafka reference inside a lazy `__esm` block that never executes unless you explicitly call `getClickhouseClient()` or `getKafkaProducer()`.
|
|
28
|
+
|
|
29
|
+
## What's Included
|
|
30
|
+
|
|
31
|
+
| Export | Description |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `OlapTable` | Define ClickHouse OLAP tables |
|
|
34
|
+
| `Stream` | Define streaming ingestion points |
|
|
35
|
+
| `View` | Define materialized/live views |
|
|
36
|
+
| `Workflow` | Define workflow steps |
|
|
37
|
+
| `sql` | Tagged template literal for SQL queries |
|
|
38
|
+
| `Key`, `JWT` | Type annotations for data model keys and JWT auth |
|
|
39
|
+
| ClickHouse column types | `Columns.String`, `Columns.Int32`, `Columns.DateTime`, etc. |
|
|
40
|
+
| `ConsumptionUtil`, `ApiUtil` | Utility types for consumption APIs |
|
|
41
|
+
| `registerDataSource` | Register external data source connectors |
|
|
42
|
+
| `getSecrets` | Retrieve secrets from the Moose secrets store |
|
|
43
|
+
| Utility functions | `compilerLog`, `cliLog`, `mapTstoJs`, `getFileName`, etc. |
|
|
44
|
+
|
|
45
|
+
## What's Excluded
|
|
46
|
+
|
|
47
|
+
These native/C++ dependencies are **not** bundled and will never be loaded:
|
|
48
|
+
|
|
49
|
+
| Dependency | Reason |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| `@514labs/kafka-javascript` | Native C++ module (`node-rdkafka`); crashes in Lambda |
|
|
52
|
+
| `@temporalio/client` | Native Rust bridge; not available in serverless |
|
|
53
|
+
| `redis` | TCP connection pooling incompatible with short-lived functions |
|
|
54
|
+
|
|
55
|
+
## Origin
|
|
56
|
+
|
|
57
|
+
This package is derived from [MooseStack](https://github.com/514-labs/moosestack) by [Fiveonefour Labs](https://www.fiveonefour.com/), published under the MIT license.
|
|
58
|
+
|
|
59
|
+
- **Original project**: https://github.com/514-labs/moosestack
|
|
60
|
+
- **Fork**: https://github.com/bayoudhi/moosestack (branch `feature/serverless-compatibility`)
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
MIT — see [LICENSE](./LICENSE) for details.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bayoudhi/moose-lib-serverless",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Serverless-compatible subset of @514labs/moose-lib for AWS Lambda and edge runtimes. Provides OlapTable, Stream, Workflow, View, and other Moose SDK classes without native C++ dependencies (Kafka, Temporal).",
|
|
5
5
|
"main": "./dist/serverless.js",
|
|
6
6
|
"module": "./dist/serverless.mjs",
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
|
-
"dist"
|
|
21
|
+
"dist",
|
|
22
|
+
"LICENSE",
|
|
23
|
+
"README.md"
|
|
22
24
|
],
|
|
23
25
|
"publishConfig": {
|
|
24
26
|
"access": "public"
|