@axiom-lattice/gateway 2.1.27 → 2.1.29

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/gateway@2.1.27 build /home/runner/work/agentic/agentic/packages/gateway
2
+ > @axiom-lattice/gateway@2.1.29 build /home/runner/work/agentic/agentic/packages/gateway
3
3
  > tsup src/index.ts --format cjs,esm --dts --clean --sourcemap
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -9,13 +9,17 @@
9
9
  CLI Cleaning output folder
10
10
  CJS Build start
11
11
  ESM Build start
12
- CJS dist/index.js 86.95 KB
13
- CJS dist/index.js.map 201.27 KB
14
- CJS ⚡️ Build success in 201ms
15
- ESM dist/index.mjs 84.32 KB
16
- ESM dist/index.mjs.map 201.30 KB
17
- ESM ⚡️ Build success in 214ms
12
+ CJS dist/index.js 113.02 KB
13
+ CJS dist/index.js.map 249.46 KB
14
+ CJS ⚡️ Build success in 237ms
15
+ ESM dist/index.mjs 106.98 KB
16
+ ESM dist/config-F3FCBSPH.mjs 148.00 B
17
+ ESM dist/chunk-FSASG3SB.mjs 2.46 KB
18
+ ESM dist/index.mjs.map 244.09 KB
19
+ ESM dist/config-F3FCBSPH.mjs.map 71.00 B
20
+ ESM dist/chunk-FSASG3SB.mjs.map 5.33 KB
21
+ ESM ⚡️ Build success in 240ms
18
22
  DTS Build start
19
- DTS ⚡️ Build success in 9143ms
23
+ DTS ⚡️ Build success in 9708ms
20
24
  DTS dist/index.d.ts 3.72 KB
21
25
  DTS dist/index.d.mts 3.72 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @axiom-lattice/gateway
2
2
 
3
+ ## 2.1.29
4
+
5
+ ### Patch Changes
6
+
7
+ - faf1bad: update team and more
8
+ - Updated dependencies [faf1bad]
9
+ - @axiom-lattice/core@2.1.24
10
+ - @axiom-lattice/protocols@2.1.14
11
+ - @axiom-lattice/queue-redis@1.0.13
12
+
13
+ ## 2.1.28
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [8087672]
18
+ - @axiom-lattice/core@2.1.23
19
+
3
20
  ## 2.1.27
4
21
 
5
22
  ### Patch Changes
@@ -0,0 +1,94 @@
1
+ // src/config.ts
2
+ var ConfigService = class {
3
+ constructor() {
4
+ this.config = this.loadFromEnv();
5
+ }
6
+ /**
7
+ * Load configuration from environment variables
8
+ */
9
+ loadFromEnv() {
10
+ return {
11
+ port: process.env.PORT ? Number(process.env.PORT) : void 0,
12
+ queueServiceType: process.env.QUEUE_SERVICE_TYPE,
13
+ redisUrl: process.env.REDIS_URL,
14
+ redisPassword: process.env.REDIS_PASSWORD,
15
+ queueName: process.env.QUEUE_NAME
16
+ };
17
+ }
18
+ /**
19
+ * Update configuration from JSON object
20
+ * This will update both the internal config and process.env
21
+ */
22
+ updateConfig(jsonConfig) {
23
+ for (const [key, value] of Object.entries(jsonConfig)) {
24
+ if (value !== null && value !== void 0) {
25
+ if (typeof value === "object" && !Array.isArray(value)) {
26
+ for (const [nestedKey, nestedValue] of Object.entries(value)) {
27
+ const envKey = `${key.toUpperCase()}_${nestedKey.toUpperCase()}`;
28
+ process.env[envKey] = String(nestedValue);
29
+ }
30
+ } else {
31
+ process.env[key.toUpperCase()] = String(value);
32
+ }
33
+ }
34
+ }
35
+ this.config = this.loadFromEnv();
36
+ this.config = this.deepMerge(this.config, jsonConfig);
37
+ }
38
+ /**
39
+ * Deep merge two objects
40
+ */
41
+ deepMerge(target, source) {
42
+ const output = { ...target };
43
+ if (this.isObject(target) && this.isObject(source)) {
44
+ Object.keys(source).forEach((key) => {
45
+ if (this.isObject(source[key])) {
46
+ if (!(key in target)) {
47
+ Object.assign(output, { [key]: source[key] });
48
+ } else {
49
+ output[key] = this.deepMerge(target[key], source[key]);
50
+ }
51
+ } else {
52
+ Object.assign(output, { [key]: source[key] });
53
+ }
54
+ });
55
+ }
56
+ return output;
57
+ }
58
+ /**
59
+ * Check if value is a plain object
60
+ */
61
+ isObject(item) {
62
+ return item && typeof item === "object" && !Array.isArray(item);
63
+ }
64
+ /**
65
+ * Get current configuration
66
+ */
67
+ getConfig() {
68
+ return { ...this.config };
69
+ }
70
+ };
71
+ var configService = new ConfigService();
72
+ var config = {
73
+ get port() {
74
+ return configService.getConfig().port;
75
+ },
76
+ get queueServiceType() {
77
+ return configService.getConfig().queueServiceType;
78
+ },
79
+ get redisUrl() {
80
+ return configService.getConfig().redisUrl;
81
+ },
82
+ get redisPassword() {
83
+ return configService.getConfig().redisPassword;
84
+ },
85
+ get queueName() {
86
+ return configService.getConfig().queueName;
87
+ }
88
+ };
89
+
90
+ export {
91
+ configService,
92
+ config
93
+ };
94
+ //# sourceMappingURL=chunk-FSASG3SB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/config.ts"],"sourcesContent":["/**\n * Configuration service\n * Manages environment variables and supports dynamic updates\n */\n\nexport interface GatewayConfig {\n port?: number;\n queueServiceType?: string;\n redisUrl?: string;\n redisPassword?: string;\n queueName?: string;\n [key: string]: any; // Allow additional config keys\n}\n\n/**\n * Get configuration from environment variables\n * Supports dynamic updates via updateConfig method\n */\nclass ConfigService {\n private config: GatewayConfig;\n\n constructor() {\n this.config = this.loadFromEnv();\n }\n\n /**\n * Load configuration from environment variables\n */\n private loadFromEnv(): GatewayConfig {\n return {\n port: process.env.PORT ? Number(process.env.PORT) : undefined,\n queueServiceType: process.env.QUEUE_SERVICE_TYPE,\n redisUrl: process.env.REDIS_URL,\n redisPassword: process.env.REDIS_PASSWORD,\n queueName: process.env.QUEUE_NAME,\n };\n }\n\n /**\n * Update configuration from JSON object\n * This will update both the internal config and process.env\n */\n updateConfig(jsonConfig: Record<string, any>): void {\n // Update process.env for all provided keys\n for (const [key, value] of Object.entries(jsonConfig)) {\n if (value !== null && value !== undefined) {\n // Convert nested objects to environment variable format\n if (typeof value === \"object\" && !Array.isArray(value)) {\n // Handle nested objects like supabase: { url: \"...\", key: \"...\" }\n for (const [nestedKey, nestedValue] of Object.entries(value)) {\n const envKey = `${key.toUpperCase()}_${nestedKey.toUpperCase()}`;\n process.env[envKey] = String(nestedValue);\n }\n } else {\n // Handle flat keys\n process.env[key.toUpperCase()] = String(value);\n }\n }\n }\n\n // Reload config from updated environment variables\n this.config = this.loadFromEnv();\n\n // Deep merge the JSON config into our config object\n this.config = this.deepMerge(this.config, jsonConfig);\n }\n\n /**\n * Deep merge two objects\n */\n private deepMerge(target: any, source: any): any {\n const output = { ...target };\n if (this.isObject(target) && this.isObject(source)) {\n Object.keys(source).forEach((key) => {\n if (this.isObject(source[key])) {\n if (!(key in target)) {\n Object.assign(output, { [key]: source[key] });\n } else {\n output[key] = this.deepMerge(target[key], source[key]);\n }\n } else {\n Object.assign(output, { [key]: source[key] });\n }\n });\n }\n return output;\n }\n\n /**\n * Check if value is a plain object\n */\n private isObject(item: any): boolean {\n return item && typeof item === \"object\" && !Array.isArray(item);\n }\n\n /**\n * Get current configuration\n */\n getConfig(): GatewayConfig {\n return { ...this.config };\n }\n}\n\n// Export singleton instance\nexport const configService = new ConfigService();\n\n// Export config getter for backward compatibility\nexport const config = {\n get port() {\n return configService.getConfig().port;\n },\n get queueServiceType() {\n return configService.getConfig().queueServiceType;\n },\n get redisUrl() {\n return configService.getConfig().redisUrl;\n },\n get redisPassword() {\n return configService.getConfig().redisPassword;\n },\n get queueName() {\n return configService.getConfig().queueName;\n },\n};\n"],"mappings":";AAkBA,IAAM,gBAAN,MAAoB;AAAA,EAGlB,cAAc;AACZ,SAAK,SAAS,KAAK,YAAY;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA,EAKQ,cAA6B;AACnC,WAAO;AAAA,MACL,MAAM,QAAQ,IAAI,OAAO,OAAO,QAAQ,IAAI,IAAI,IAAI;AAAA,MACpD,kBAAkB,QAAQ,IAAI;AAAA,MAC9B,UAAU,QAAQ,IAAI;AAAA,MACtB,eAAe,QAAQ,IAAI;AAAA,MAC3B,WAAW,QAA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O;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKQ,SAAS,MAAoB;AACnC,WAAO,QAAQ,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI;AAAA,EAChE;AAAA;AAAA;AAAA;AAAA,EAKA,YAA2B;AACzB,WAAO,EAAE,GAAG,KAAK,OAAO;AAAA,EAC1B;AACF;AAGO,IAAM,gBAAgB,IAAI,cAAc;AAGxC,IAAM,SAAS;AAAA,EACpB,IAAI,OAAO;AACT,WAAO,cAAc,UAAU,EAAE;AAAA,EACnC;AAAA,EACA,IAAI,mBAAmB;AACrB,WAAO,cAAc,UAAU,EAAE;AAAA,EACnC;AAAA,EACA,IAAI,WAAW;AACb,WAAO,cAAc,UAAU,EAAE;AAAA,EACnC;AAAA,EACA,IAAI,gBAAgB;AAClB,WAAO,cAAc,UAAU,EAAE;AAAA,EACnC;AAAA,EACA,IAAI,YAAY;AACd,WAAO,cAAc,UAAU,EAAE;AAAA,EACnC;AACF;","names":[]}
@@ -0,0 +1,9 @@
1
+ import {
2
+ config,
3
+ configService
4
+ } from "./chunk-FSASG3SB.mjs";
5
+ export {
6
+ config,
7
+ configService
8
+ };
9
+ //# sourceMappingURL=config-F3FCBSPH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}