@plyaz/config 1.9.5 → 1.10.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.
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Streaming Configuration Constants
3
+ *
4
+ * Default configuration values for the SSE/WebSocket streaming system.
5
+ * These can be overridden at runtime through configuration objects.
6
+ *
7
+ * @module src/streaming/constants
8
+ */
9
+ import type { StreamChannel } from '@plyaz/types/core';
10
+ /**
11
+ * Server Configuration
12
+ *
13
+ * Default values for StreamServer and transport adapters
14
+ */
15
+ export declare const STREAMING_SERVER_CONFIG: {
16
+ /**
17
+ * Default heartbeat interval in milliseconds
18
+ * Keeps connections alive and detects stale clients
19
+ */
20
+ readonly HEARTBEAT_INTERVAL_MS: 30000;
21
+ /**
22
+ * Maximum number of concurrent connections per server
23
+ */
24
+ readonly MAX_CONNECTIONS: 1000;
25
+ /**
26
+ * Default channels to subscribe new connections to
27
+ */
28
+ readonly DEFAULT_CHANNELS: StreamChannel[];
29
+ };
30
+ /**
31
+ * Client Configuration
32
+ *
33
+ * Default values for client-side streaming hooks
34
+ */
35
+ export declare const STREAMING_CLIENT_CONFIG: {
36
+ /**
37
+ * Delay before attempting to reconnect after disconnect
38
+ */
39
+ readonly RECONNECT_DELAY_MS: 1000;
40
+ /**
41
+ * Maximum reconnection attempts before giving up
42
+ */
43
+ readonly MAX_RECONNECT_ATTEMPTS: 10;
44
+ /**
45
+ * Default SSE endpoint path
46
+ */
47
+ readonly SSE_ENDPOINT: "/api/events/stream";
48
+ };
49
+ /**
50
+ * Buffer Configuration
51
+ *
52
+ * Default values for message buffering
53
+ */
54
+ export declare const STREAMING_BUFFER_CONFIG: {
55
+ /**
56
+ * Default buffer size for queued messages (1KB)
57
+ */
58
+ readonly DEFAULT_BUFFER_SIZE: 1024;
59
+ /**
60
+ * Flush interval for buffered messages
61
+ */
62
+ readonly FLUSH_INTERVAL_MS: 1000;
63
+ /**
64
+ * Maximum buffer size before forced flush (10MB)
65
+ */
66
+ readonly MAX_BUFFER_SIZE: number;
67
+ };
68
+ /**
69
+ * Streaming Package Configuration
70
+ *
71
+ * Aggregated configuration object for streaming system
72
+ */
73
+ export declare const STREAMING_PACKAGE_CONFIG: {
74
+ readonly SERVER: {
75
+ /**
76
+ * Default heartbeat interval in milliseconds
77
+ * Keeps connections alive and detects stale clients
78
+ */
79
+ readonly HEARTBEAT_INTERVAL_MS: 30000;
80
+ /**
81
+ * Maximum number of concurrent connections per server
82
+ */
83
+ readonly MAX_CONNECTIONS: 1000;
84
+ /**
85
+ * Default channels to subscribe new connections to
86
+ */
87
+ readonly DEFAULT_CHANNELS: StreamChannel[];
88
+ };
89
+ readonly CLIENT: {
90
+ /**
91
+ * Delay before attempting to reconnect after disconnect
92
+ */
93
+ readonly RECONNECT_DELAY_MS: 1000;
94
+ /**
95
+ * Maximum reconnection attempts before giving up
96
+ */
97
+ readonly MAX_RECONNECT_ATTEMPTS: 10;
98
+ /**
99
+ * Default SSE endpoint path
100
+ */
101
+ readonly SSE_ENDPOINT: "/api/events/stream";
102
+ };
103
+ readonly BUFFER: {
104
+ /**
105
+ * Default buffer size for queued messages (1KB)
106
+ */
107
+ readonly DEFAULT_BUFFER_SIZE: 1024;
108
+ /**
109
+ * Flush interval for buffered messages
110
+ */
111
+ readonly FLUSH_INTERVAL_MS: 1000;
112
+ /**
113
+ * Maximum buffer size before forced flush (10MB)
114
+ */
115
+ readonly MAX_BUFFER_SIZE: number;
116
+ };
117
+ };
118
+ /**
119
+ * Streaming Defaults (Flat)
120
+ *
121
+ * Flattened defaults for direct import compatibility
122
+ * with existing code using STREAMING_DEFAULTS
123
+ */
124
+ export declare const STREAMING_DEFAULTS: {
125
+ readonly HEARTBEAT_INTERVAL_MS: 30000;
126
+ readonly MAX_CONNECTIONS: 1000;
127
+ readonly DEFAULT_CHANNELS: StreamChannel[];
128
+ readonly RECONNECT_DELAY_MS: 1000;
129
+ readonly MAX_RECONNECT_ATTEMPTS: 10;
130
+ readonly SSE_ENDPOINT: "/api/events/stream";
131
+ };
132
+ /**
133
+ * Type for streaming defaults
134
+ */
135
+ export type StreamingDefaults = typeof STREAMING_DEFAULTS;
136
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/streaming/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;IAClC;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;+BACwC,aAAa,EAAE;CAClD,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;IAClC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEK,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;IAClC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAGK,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;QAnEnC;;;WAGG;;QAGH;;WAEG;;QAGH;;WAEG;mCACwC,aAAa,EAAE;;;QAS1D;;WAEG;;QAGH;;WAEG;;QAGH;;WAEG;;;;QAUH;;WAEG;;QAGH;;WAEG;;QAGH;;WAEG;;;CAcK,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;CAOrB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ 'use strict';// @plyaz package - Built with tsup
2
+ var E={HEARTBEAT_INTERVAL_MS:3e4,MAX_CONNECTIONS:1e3,DEFAULT_CHANNELS:["uploads","system"]},N={RECONNECT_DELAY_MS:1e3,MAX_RECONNECT_ATTEMPTS:10,SSE_ENDPOINT:"/api/events/stream"},T={DEFAULT_BUFFER_SIZE:1024,FLUSH_INTERVAL_MS:1e3,MAX_BUFFER_SIZE:10*1024*1024},_={SERVER:E,CLIENT:N,BUFFER:T},A={HEARTBEAT_INTERVAL_MS:E.HEARTBEAT_INTERVAL_MS,MAX_CONNECTIONS:E.MAX_CONNECTIONS,DEFAULT_CHANNELS:E.DEFAULT_CHANNELS,RECONNECT_DELAY_MS:N.RECONNECT_DELAY_MS,MAX_RECONNECT_ATTEMPTS:N.MAX_RECONNECT_ATTEMPTS,SSE_ENDPOINT:N.SSE_ENDPOINT};exports.STREAMING_BUFFER_CONFIG=T;exports.STREAMING_CLIENT_CONFIG=N;exports.STREAMING_DEFAULTS=A;exports.STREAMING_PACKAGE_CONFIG=_;exports.STREAMING_SERVER_CONFIG=E;//# sourceMappingURL=index.cjs.map
3
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/streaming/constants.ts"],"names":["STREAMING_SERVER_CONFIG","STREAMING_CLIENT_CONFIG","STREAMING_BUFFER_CONFIG","STREAMING_PACKAGE_CONFIG","STREAMING_DEFAULTS"],"mappings":";AAgBO,IAAMA,CAAAA,CAA0B,CAKrC,qBAAA,CAAuB,GAAA,CAKvB,eAAA,CAAiB,GAAA,CAKjB,gBAAA,CAAkB,CAAC,SAAA,CAAW,QAAQ,CACxC,CAAA,CAOaC,CAAAA,CAA0B,CAIrC,kBAAA,CAAoB,GAAA,CAKpB,sBAAA,CAAwB,EAAA,CAKxB,YAAA,CAAc,oBAChB,CAAA,CAOaC,CAAAA,CAA0B,CAIrC,mBAAA,CAAqB,IAAA,CAKrB,iBAAA,CAAmB,GAAA,CAMnB,eAAA,CAAiB,EAAA,CAAK,IAAA,CAAO,IAC/B,CAAA,CAOaC,CAAAA,CAA2B,CACtC,MAAA,CAAQH,CAAAA,CACR,MAAA,CAAQC,CAAAA,CACR,MAAA,CAAQC,CACV,CAAA,CAQaE,CAAAA,CAAqB,CAChC,qBAAA,CAAuBJ,CAAAA,CAAwB,qBAAA,CAC/C,eAAA,CAAiBA,CAAAA,CAAwB,eAAA,CACzC,gBAAA,CAAkBA,CAAAA,CAAwB,gBAAA,CAC1C,kBAAA,CAAoBC,CAAAA,CAAwB,kBAAA,CAC5C,sBAAA,CAAwBA,CAAAA,CAAwB,sBAAA,CAChD,YAAA,CAAcA,CAAAA,CAAwB,YACxC","file":"index.cjs","sourcesContent":["/**\n * Streaming Configuration Constants\n *\n * Default configuration values for the SSE/WebSocket streaming system.\n * These can be overridden at runtime through configuration objects.\n *\n * @module src/streaming/constants\n */\n\nimport type { StreamChannel } from '@plyaz/types/core';\n\n/**\n * Server Configuration\n *\n * Default values for StreamServer and transport adapters\n */\nexport const STREAMING_SERVER_CONFIG = {\n /**\n * Default heartbeat interval in milliseconds\n * Keeps connections alive and detects stale clients\n */\n HEARTBEAT_INTERVAL_MS: 30000,\n\n /**\n * Maximum number of concurrent connections per server\n */\n MAX_CONNECTIONS: 1000,\n\n /**\n * Default channels to subscribe new connections to\n */\n DEFAULT_CHANNELS: ['uploads', 'system'] as StreamChannel[],\n} as const;\n\n/**\n * Client Configuration\n *\n * Default values for client-side streaming hooks\n */\nexport const STREAMING_CLIENT_CONFIG = {\n /**\n * Delay before attempting to reconnect after disconnect\n */\n RECONNECT_DELAY_MS: 1000,\n\n /**\n * Maximum reconnection attempts before giving up\n */\n MAX_RECONNECT_ATTEMPTS: 10,\n\n /**\n * Default SSE endpoint path\n */\n SSE_ENDPOINT: '/api/events/stream',\n} as const;\n\n/**\n * Buffer Configuration\n *\n * Default values for message buffering\n */\nexport const STREAMING_BUFFER_CONFIG = {\n /**\n * Default buffer size for queued messages (1KB)\n */\n DEFAULT_BUFFER_SIZE: 1024,\n\n /**\n * Flush interval for buffered messages\n */\n FLUSH_INTERVAL_MS: 1000,\n\n /**\n * Maximum buffer size before forced flush (10MB)\n */\n // eslint-disable-next-line no-magic-numbers\n MAX_BUFFER_SIZE: 10 * 1024 * 1024,\n} as const;\n\n/**\n * Streaming Package Configuration\n *\n * Aggregated configuration object for streaming system\n */\nexport const STREAMING_PACKAGE_CONFIG = {\n SERVER: STREAMING_SERVER_CONFIG,\n CLIENT: STREAMING_CLIENT_CONFIG,\n BUFFER: STREAMING_BUFFER_CONFIG,\n} as const;\n\n/**\n * Streaming Defaults (Flat)\n *\n * Flattened defaults for direct import compatibility\n * with existing code using STREAMING_DEFAULTS\n */\nexport const STREAMING_DEFAULTS = {\n HEARTBEAT_INTERVAL_MS: STREAMING_SERVER_CONFIG.HEARTBEAT_INTERVAL_MS,\n MAX_CONNECTIONS: STREAMING_SERVER_CONFIG.MAX_CONNECTIONS,\n DEFAULT_CHANNELS: STREAMING_SERVER_CONFIG.DEFAULT_CHANNELS,\n RECONNECT_DELAY_MS: STREAMING_CLIENT_CONFIG.RECONNECT_DELAY_MS,\n MAX_RECONNECT_ATTEMPTS: STREAMING_CLIENT_CONFIG.MAX_RECONNECT_ATTEMPTS,\n SSE_ENDPOINT: STREAMING_CLIENT_CONFIG.SSE_ENDPOINT,\n} as const;\n\n/**\n * Type for streaming defaults\n */\nexport type StreamingDefaults = typeof STREAMING_DEFAULTS;\n"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Streaming Configuration Module
3
+ *
4
+ * Exports all streaming-related configuration constants.
5
+ *
6
+ * @module src/streaming
7
+ */
8
+ export * from './constants';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/streaming/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ // @plyaz package - Built with tsup
2
+ var E={HEARTBEAT_INTERVAL_MS:3e4,MAX_CONNECTIONS:1e3,DEFAULT_CHANNELS:["uploads","system"]},N={RECONNECT_DELAY_MS:1e3,MAX_RECONNECT_ATTEMPTS:10,SSE_ENDPOINT:"/api/events/stream"},T={DEFAULT_BUFFER_SIZE:1024,FLUSH_INTERVAL_MS:1e3,MAX_BUFFER_SIZE:10*1024*1024},_={SERVER:E,CLIENT:N,BUFFER:T},A={HEARTBEAT_INTERVAL_MS:E.HEARTBEAT_INTERVAL_MS,MAX_CONNECTIONS:E.MAX_CONNECTIONS,DEFAULT_CHANNELS:E.DEFAULT_CHANNELS,RECONNECT_DELAY_MS:N.RECONNECT_DELAY_MS,MAX_RECONNECT_ATTEMPTS:N.MAX_RECONNECT_ATTEMPTS,SSE_ENDPOINT:N.SSE_ENDPOINT};export{T as STREAMING_BUFFER_CONFIG,N as STREAMING_CLIENT_CONFIG,A as STREAMING_DEFAULTS,_ as STREAMING_PACKAGE_CONFIG,E as STREAMING_SERVER_CONFIG};//# sourceMappingURL=index.mjs.map
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/streaming/constants.ts"],"names":["STREAMING_SERVER_CONFIG","STREAMING_CLIENT_CONFIG","STREAMING_BUFFER_CONFIG","STREAMING_PACKAGE_CONFIG","STREAMING_DEFAULTS"],"mappings":";AAgBO,IAAMA,CAAAA,CAA0B,CAKrC,qBAAA,CAAuB,GAAA,CAKvB,eAAA,CAAiB,GAAA,CAKjB,gBAAA,CAAkB,CAAC,SAAA,CAAW,QAAQ,CACxC,CAAA,CAOaC,CAAAA,CAA0B,CAIrC,kBAAA,CAAoB,GAAA,CAKpB,sBAAA,CAAwB,EAAA,CAKxB,YAAA,CAAc,oBAChB,CAAA,CAOaC,CAAAA,CAA0B,CAIrC,mBAAA,CAAqB,IAAA,CAKrB,iBAAA,CAAmB,GAAA,CAMnB,eAAA,CAAiB,EAAA,CAAK,IAAA,CAAO,IAC/B,CAAA,CAOaC,CAAAA,CAA2B,CACtC,MAAA,CAAQH,CAAAA,CACR,MAAA,CAAQC,CAAAA,CACR,MAAA,CAAQC,CACV,CAAA,CAQaE,CAAAA,CAAqB,CAChC,qBAAA,CAAuBJ,CAAAA,CAAwB,qBAAA,CAC/C,eAAA,CAAiBA,CAAAA,CAAwB,eAAA,CACzC,gBAAA,CAAkBA,CAAAA,CAAwB,gBAAA,CAC1C,kBAAA,CAAoBC,CAAAA,CAAwB,kBAAA,CAC5C,sBAAA,CAAwBA,CAAAA,CAAwB,sBAAA,CAChD,YAAA,CAAcA,CAAAA,CAAwB,YACxC","file":"index.mjs","sourcesContent":["/**\n * Streaming Configuration Constants\n *\n * Default configuration values for the SSE/WebSocket streaming system.\n * These can be overridden at runtime through configuration objects.\n *\n * @module src/streaming/constants\n */\n\nimport type { StreamChannel } from '@plyaz/types/core';\n\n/**\n * Server Configuration\n *\n * Default values for StreamServer and transport adapters\n */\nexport const STREAMING_SERVER_CONFIG = {\n /**\n * Default heartbeat interval in milliseconds\n * Keeps connections alive and detects stale clients\n */\n HEARTBEAT_INTERVAL_MS: 30000,\n\n /**\n * Maximum number of concurrent connections per server\n */\n MAX_CONNECTIONS: 1000,\n\n /**\n * Default channels to subscribe new connections to\n */\n DEFAULT_CHANNELS: ['uploads', 'system'] as StreamChannel[],\n} as const;\n\n/**\n * Client Configuration\n *\n * Default values for client-side streaming hooks\n */\nexport const STREAMING_CLIENT_CONFIG = {\n /**\n * Delay before attempting to reconnect after disconnect\n */\n RECONNECT_DELAY_MS: 1000,\n\n /**\n * Maximum reconnection attempts before giving up\n */\n MAX_RECONNECT_ATTEMPTS: 10,\n\n /**\n * Default SSE endpoint path\n */\n SSE_ENDPOINT: '/api/events/stream',\n} as const;\n\n/**\n * Buffer Configuration\n *\n * Default values for message buffering\n */\nexport const STREAMING_BUFFER_CONFIG = {\n /**\n * Default buffer size for queued messages (1KB)\n */\n DEFAULT_BUFFER_SIZE: 1024,\n\n /**\n * Flush interval for buffered messages\n */\n FLUSH_INTERVAL_MS: 1000,\n\n /**\n * Maximum buffer size before forced flush (10MB)\n */\n // eslint-disable-next-line no-magic-numbers\n MAX_BUFFER_SIZE: 10 * 1024 * 1024,\n} as const;\n\n/**\n * Streaming Package Configuration\n *\n * Aggregated configuration object for streaming system\n */\nexport const STREAMING_PACKAGE_CONFIG = {\n SERVER: STREAMING_SERVER_CONFIG,\n CLIENT: STREAMING_CLIENT_CONFIG,\n BUFFER: STREAMING_BUFFER_CONFIG,\n} as const;\n\n/**\n * Streaming Defaults (Flat)\n *\n * Flattened defaults for direct import compatibility\n * with existing code using STREAMING_DEFAULTS\n */\nexport const STREAMING_DEFAULTS = {\n HEARTBEAT_INTERVAL_MS: STREAMING_SERVER_CONFIG.HEARTBEAT_INTERVAL_MS,\n MAX_CONNECTIONS: STREAMING_SERVER_CONFIG.MAX_CONNECTIONS,\n DEFAULT_CHANNELS: STREAMING_SERVER_CONFIG.DEFAULT_CHANNELS,\n RECONNECT_DELAY_MS: STREAMING_CLIENT_CONFIG.RECONNECT_DELAY_MS,\n MAX_RECONNECT_ATTEMPTS: STREAMING_CLIENT_CONFIG.MAX_RECONNECT_ATTEMPTS,\n SSE_ENDPOINT: STREAMING_CLIENT_CONFIG.SSE_ENDPOINT,\n} as const;\n\n/**\n * Type for streaming defaults\n */\nexport type StreamingDefaults = typeof STREAMING_DEFAULTS;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plyaz/config",
3
- "version": "1.9.5",
3
+ "version": "1.10.0",
4
4
  "author": "Redeemer Pace",
5
5
  "license": "ISC",
6
6
  "description": "Provides shared configs and constants for @playz ecosystem.",
@@ -126,6 +126,12 @@
126
126
  "./translations": {
127
127
  "types": "./dist/translations/index.d.ts"
128
128
  },
129
+ "./streaming": {
130
+ "types": "./dist/streaming/index.d.ts",
131
+ "import": "./dist/streaming/index.mjs",
132
+ "require": "./dist/streaming/index.cjs",
133
+ "default": "./dist/streaming/index.mjs"
134
+ },
129
135
  "./package.json": "./package.json"
130
136
  },
131
137
  "files": [
@@ -139,7 +145,7 @@
139
145
  "packageManager": "pnpm@10.11.0",
140
146
  "dependencies": {
141
147
  "@plyaz/devtools": "^1.9.4",
142
- "@plyaz/types": "^1.31.1",
148
+ "@plyaz/types": "^1.36.2",
143
149
  "globals": "^16.4.0",
144
150
  "viem": "^2.31.7"
145
151
  },