@opensourcekd/ng-common-libs 1.2.5 → 1.2.6

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.
@@ -60,5 +60,27 @@ class EventBus {
60
60
  }
61
61
  }
62
62
 
63
+ /**
64
+ * Framework-agnostic Configuration
65
+ * Centralized configuration for all consuming applications
66
+ *
67
+ * This configuration can be used across different frameworks (Angular, React, Vue, etc.)
68
+ * and by various Micro-Frontends (MFEs) and shell applications.
69
+ *
70
+ * Values are statically configured during build time from GitHub repository variables.
71
+ */
72
+ /**
73
+ * Application configuration object
74
+ * Contains all environment-specific variables
75
+ *
76
+ * These values are replaced during build time with actual values from GitHub repository variables.
77
+ */
78
+ const APP_CONFIG = {
79
+ auth0Domain: '',
80
+ auth0ClientId: '',
81
+ apiUrl: '',
82
+ };
83
+
84
+ exports.APP_CONFIG = APP_CONFIG;
63
85
  exports.EventBus = EventBus;
64
86
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../src/core/event-bus.ts"],"sourcesContent":["import { Subject, Observable } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\n/**\n * Event payload interface\n */\nexport interface EventPayload<T = any> {\n type: string;\n data: T;\n timestamp?: number;\n}\n\n/**\n * EventBus - A centralized event bus for application-wide communication\n * Framework-agnostic implementation using only RxJS\n * \n * @example\n * ```typescript\n * // Create an instance\n * const eventBus = new EventBus();\n * \n * // Emit an event\n * eventBus.emit('user:login', { userId: '123', username: 'john' });\n * \n * // Subscribe to an event\n * eventBus.on('user:login').subscribe(data => {\n * console.log('User logged in:', data);\n * });\n * ```\n */\nexport class EventBus {\n private eventSubject = new Subject<EventPayload>();\n\n /**\n * Emit an event with optional data\n * @param eventType - The type/name of the event\n * @param data - Optional data to send with the event\n */\n emit<T = any>(eventType: string, data?: T): void {\n this.eventSubject.next({\n type: eventType,\n data,\n timestamp: Date.now()\n });\n }\n\n /**\n * Subscribe to a specific event type\n * @param eventType - The type/name of the event to listen for\n * @returns Observable that emits the event data\n */\n on<T = any>(eventType: string): Observable<T> {\n return this.eventSubject.asObservable().pipe(\n filter(event => event.type === eventType),\n map(event => event.data as T)\n );\n }\n\n /**\n * Subscribe to multiple event types\n * @param eventTypes - Array of event types to listen for\n * @returns Observable that emits the full event payload\n */\n onMultiple(eventTypes: string[]): Observable<EventPayload> {\n return this.eventSubject.asObservable().pipe(\n filter(event => eventTypes.includes(event.type))\n );\n }\n\n /**\n * Subscribe to all events\n * @returns Observable that emits all event payloads\n */\n onAll(): Observable<EventPayload> {\n return this.eventSubject.asObservable();\n }\n}\n"],"names":["Subject","filter","map"],"mappings":";;;;;AAYA;;;;;;;;;;;;;;;;;AAiBG;MACU,QAAQ,CAAA;AACX,IAAA,YAAY,GAAG,IAAIA,YAAO,EAAgB;AAElD;;;;AAIG;IACH,IAAI,CAAU,SAAiB,EAAE,IAAQ,EAAA;AACvC,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;AACrB,YAAA,IAAI,EAAE,SAAS;YACf,IAAI;AACJ,YAAA,SAAS,EAAE,IAAI,CAAC,GAAG;AACpB,SAAA,CAAC;IACJ;AAEA;;;;AAIG;AACH,IAAA,EAAE,CAAU,SAAiB,EAAA;AAC3B,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,IAAI,CAC1CC,gBAAM,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,EACzCC,aAAG,CAAC,KAAK,IAAI,KAAK,CAAC,IAAS,CAAC,CAC9B;IACH;AAEA;;;;AAIG;AACH,IAAA,UAAU,CAAC,UAAoB,EAAA;QAC7B,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,IAAI,CAC1CD,gBAAM,CAAC,KAAK,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CACjD;IACH;AAEA;;;AAGG;IACH,KAAK,GAAA;AACH,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE;IACzC;AACD;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../src/core/event-bus.ts","../../src/core/config.ts"],"sourcesContent":["import { Subject, Observable } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\n/**\n * Event payload interface\n */\nexport interface EventPayload<T = any> {\n type: string;\n data: T;\n timestamp?: number;\n}\n\n/**\n * EventBus - A centralized event bus for application-wide communication\n * Framework-agnostic implementation using only RxJS\n * \n * @example\n * ```typescript\n * // Create an instance\n * const eventBus = new EventBus();\n * \n * // Emit an event\n * eventBus.emit('user:login', { userId: '123', username: 'john' });\n * \n * // Subscribe to an event\n * eventBus.on('user:login').subscribe(data => {\n * console.log('User logged in:', data);\n * });\n * ```\n */\nexport class EventBus {\n private eventSubject = new Subject<EventPayload>();\n\n /**\n * Emit an event with optional data\n * @param eventType - The type/name of the event\n * @param data - Optional data to send with the event\n */\n emit<T = any>(eventType: string, data?: T): void {\n this.eventSubject.next({\n type: eventType,\n data,\n timestamp: Date.now()\n });\n }\n\n /**\n * Subscribe to a specific event type\n * @param eventType - The type/name of the event to listen for\n * @returns Observable that emits the event data\n */\n on<T = any>(eventType: string): Observable<T> {\n return this.eventSubject.asObservable().pipe(\n filter(event => event.type === eventType),\n map(event => event.data as T)\n );\n }\n\n /**\n * Subscribe to multiple event types\n * @param eventTypes - Array of event types to listen for\n * @returns Observable that emits the full event payload\n */\n onMultiple(eventTypes: string[]): Observable<EventPayload> {\n return this.eventSubject.asObservable().pipe(\n filter(event => eventTypes.includes(event.type))\n );\n }\n\n /**\n * Subscribe to all events\n * @returns Observable that emits all event payloads\n */\n onAll(): Observable<EventPayload> {\n return this.eventSubject.asObservable();\n }\n}\n","/**\n * Framework-agnostic Configuration\n * Centralized configuration for all consuming applications\n * \n * This configuration can be used across different frameworks (Angular, React, Vue, etc.)\n * and by various Micro-Frontends (MFEs) and shell applications.\n * \n * Values are statically configured during build time from GitHub repository variables.\n */\n\n/**\n * Application configuration object\n * Contains all environment-specific variables\n * \n * These values are replaced during build time with actual values from GitHub repository variables.\n */\nexport const APP_CONFIG = {\n auth0Domain: '__AUTH0_DOMAIN__',\n auth0ClientId: '__AUTH0_CLIENT_ID__',\n apiUrl: '__API_URL__',\n};\n"],"names":["Subject","filter","map"],"mappings":";;;;;AAYA;;;;;;;;;;;;;;;;;AAiBG;MACU,QAAQ,CAAA;AACX,IAAA,YAAY,GAAG,IAAIA,YAAO,EAAgB;AAElD;;;;AAIG;IACH,IAAI,CAAU,SAAiB,EAAE,IAAQ,EAAA;AACvC,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;AACrB,YAAA,IAAI,EAAE,SAAS;YACf,IAAI;AACJ,YAAA,SAAS,EAAE,IAAI,CAAC,GAAG;AACpB,SAAA,CAAC;IACJ;AAEA;;;;AAIG;AACH,IAAA,EAAE,CAAU,SAAiB,EAAA;AAC3B,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,IAAI,CAC1CC,gBAAM,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,EACzCC,aAAG,CAAC,KAAK,IAAI,KAAK,CAAC,IAAS,CAAC,CAC9B;IACH;AAEA;;;;AAIG;AACH,IAAA,UAAU,CAAC,UAAoB,EAAA;QAC7B,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,IAAI,CAC1CD,gBAAM,CAAC,KAAK,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CACjD;IACH;AAEA;;;AAGG;IACH,KAAK,GAAA;AACH,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE;IACzC;AACD;;AC5ED;;;;;;;;AAQG;AAEH;;;;;AAKG;AACI,MAAM,UAAU,GAAG;AACxB,IAAA,WAAW,EAAE,EAAkB;AAC/B,IAAA,aAAa,EAAE,EAAqB;AACpC,IAAA,MAAM,EAAE,EAAa;;;;;;"}
@@ -53,5 +53,26 @@ declare class EventBus {
53
53
  onAll(): Observable<EventPayload>;
54
54
  }
55
55
 
56
- export { EventBus };
56
+ /**
57
+ * Framework-agnostic Configuration
58
+ * Centralized configuration for all consuming applications
59
+ *
60
+ * This configuration can be used across different frameworks (Angular, React, Vue, etc.)
61
+ * and by various Micro-Frontends (MFEs) and shell applications.
62
+ *
63
+ * Values are statically configured during build time from GitHub repository variables.
64
+ */
65
+ /**
66
+ * Application configuration object
67
+ * Contains all environment-specific variables
68
+ *
69
+ * These values are replaced during build time with actual values from GitHub repository variables.
70
+ */
71
+ declare const APP_CONFIG: {
72
+ auth0Domain: string;
73
+ auth0ClientId: string;
74
+ apiUrl: string;
75
+ };
76
+
77
+ export { APP_CONFIG, EventBus };
57
78
  export type { EventPayload };
@@ -58,5 +58,26 @@ class EventBus {
58
58
  }
59
59
  }
60
60
 
61
- export { EventBus };
61
+ /**
62
+ * Framework-agnostic Configuration
63
+ * Centralized configuration for all consuming applications
64
+ *
65
+ * This configuration can be used across different frameworks (Angular, React, Vue, etc.)
66
+ * and by various Micro-Frontends (MFEs) and shell applications.
67
+ *
68
+ * Values are statically configured during build time from GitHub repository variables.
69
+ */
70
+ /**
71
+ * Application configuration object
72
+ * Contains all environment-specific variables
73
+ *
74
+ * These values are replaced during build time with actual values from GitHub repository variables.
75
+ */
76
+ const APP_CONFIG = {
77
+ auth0Domain: '',
78
+ auth0ClientId: '',
79
+ apiUrl: '',
80
+ };
81
+
82
+ export { APP_CONFIG, EventBus };
62
83
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/core/event-bus.ts"],"sourcesContent":["import { Subject, Observable } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\n/**\n * Event payload interface\n */\nexport interface EventPayload<T = any> {\n type: string;\n data: T;\n timestamp?: number;\n}\n\n/**\n * EventBus - A centralized event bus for application-wide communication\n * Framework-agnostic implementation using only RxJS\n * \n * @example\n * ```typescript\n * // Create an instance\n * const eventBus = new EventBus();\n * \n * // Emit an event\n * eventBus.emit('user:login', { userId: '123', username: 'john' });\n * \n * // Subscribe to an event\n * eventBus.on('user:login').subscribe(data => {\n * console.log('User logged in:', data);\n * });\n * ```\n */\nexport class EventBus {\n private eventSubject = new Subject<EventPayload>();\n\n /**\n * Emit an event with optional data\n * @param eventType - The type/name of the event\n * @param data - Optional data to send with the event\n */\n emit<T = any>(eventType: string, data?: T): void {\n this.eventSubject.next({\n type: eventType,\n data,\n timestamp: Date.now()\n });\n }\n\n /**\n * Subscribe to a specific event type\n * @param eventType - The type/name of the event to listen for\n * @returns Observable that emits the event data\n */\n on<T = any>(eventType: string): Observable<T> {\n return this.eventSubject.asObservable().pipe(\n filter(event => event.type === eventType),\n map(event => event.data as T)\n );\n }\n\n /**\n * Subscribe to multiple event types\n * @param eventTypes - Array of event types to listen for\n * @returns Observable that emits the full event payload\n */\n onMultiple(eventTypes: string[]): Observable<EventPayload> {\n return this.eventSubject.asObservable().pipe(\n filter(event => eventTypes.includes(event.type))\n );\n }\n\n /**\n * Subscribe to all events\n * @returns Observable that emits all event payloads\n */\n onAll(): Observable<EventPayload> {\n return this.eventSubject.asObservable();\n }\n}\n"],"names":[],"mappings":";;;AAYA;;;;;;;;;;;;;;;;;AAiBG;MACU,QAAQ,CAAA;AACX,IAAA,YAAY,GAAG,IAAI,OAAO,EAAgB;AAElD;;;;AAIG;IACH,IAAI,CAAU,SAAiB,EAAE,IAAQ,EAAA;AACvC,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;AACrB,YAAA,IAAI,EAAE,SAAS;YACf,IAAI;AACJ,YAAA,SAAS,EAAE,IAAI,CAAC,GAAG;AACpB,SAAA,CAAC;IACJ;AAEA;;;;AAIG;AACH,IAAA,EAAE,CAAU,SAAiB,EAAA;AAC3B,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,IAAI,CAC1C,MAAM,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,EACzC,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,IAAS,CAAC,CAC9B;IACH;AAEA;;;;AAIG;AACH,IAAA,UAAU,CAAC,UAAoB,EAAA;QAC7B,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,IAAI,CAC1C,MAAM,CAAC,KAAK,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CACjD;IACH;AAEA;;;AAGG;IACH,KAAK,GAAA;AACH,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE;IACzC;AACD;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/core/event-bus.ts","../../src/core/config.ts"],"sourcesContent":["import { Subject, Observable } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\n/**\n * Event payload interface\n */\nexport interface EventPayload<T = any> {\n type: string;\n data: T;\n timestamp?: number;\n}\n\n/**\n * EventBus - A centralized event bus for application-wide communication\n * Framework-agnostic implementation using only RxJS\n * \n * @example\n * ```typescript\n * // Create an instance\n * const eventBus = new EventBus();\n * \n * // Emit an event\n * eventBus.emit('user:login', { userId: '123', username: 'john' });\n * \n * // Subscribe to an event\n * eventBus.on('user:login').subscribe(data => {\n * console.log('User logged in:', data);\n * });\n * ```\n */\nexport class EventBus {\n private eventSubject = new Subject<EventPayload>();\n\n /**\n * Emit an event with optional data\n * @param eventType - The type/name of the event\n * @param data - Optional data to send with the event\n */\n emit<T = any>(eventType: string, data?: T): void {\n this.eventSubject.next({\n type: eventType,\n data,\n timestamp: Date.now()\n });\n }\n\n /**\n * Subscribe to a specific event type\n * @param eventType - The type/name of the event to listen for\n * @returns Observable that emits the event data\n */\n on<T = any>(eventType: string): Observable<T> {\n return this.eventSubject.asObservable().pipe(\n filter(event => event.type === eventType),\n map(event => event.data as T)\n );\n }\n\n /**\n * Subscribe to multiple event types\n * @param eventTypes - Array of event types to listen for\n * @returns Observable that emits the full event payload\n */\n onMultiple(eventTypes: string[]): Observable<EventPayload> {\n return this.eventSubject.asObservable().pipe(\n filter(event => eventTypes.includes(event.type))\n );\n }\n\n /**\n * Subscribe to all events\n * @returns Observable that emits all event payloads\n */\n onAll(): Observable<EventPayload> {\n return this.eventSubject.asObservable();\n }\n}\n","/**\n * Framework-agnostic Configuration\n * Centralized configuration for all consuming applications\n * \n * This configuration can be used across different frameworks (Angular, React, Vue, etc.)\n * and by various Micro-Frontends (MFEs) and shell applications.\n * \n * Values are statically configured during build time from GitHub repository variables.\n */\n\n/**\n * Application configuration object\n * Contains all environment-specific variables\n * \n * These values are replaced during build time with actual values from GitHub repository variables.\n */\nexport const APP_CONFIG = {\n auth0Domain: '__AUTH0_DOMAIN__',\n auth0ClientId: '__AUTH0_CLIENT_ID__',\n apiUrl: '__API_URL__',\n};\n"],"names":[],"mappings":";;;AAYA;;;;;;;;;;;;;;;;;AAiBG;MACU,QAAQ,CAAA;AACX,IAAA,YAAY,GAAG,IAAI,OAAO,EAAgB;AAElD;;;;AAIG;IACH,IAAI,CAAU,SAAiB,EAAE,IAAQ,EAAA;AACvC,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;AACrB,YAAA,IAAI,EAAE,SAAS;YACf,IAAI;AACJ,YAAA,SAAS,EAAE,IAAI,CAAC,GAAG;AACpB,SAAA,CAAC;IACJ;AAEA;;;;AAIG;AACH,IAAA,EAAE,CAAU,SAAiB,EAAA;AAC3B,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,IAAI,CAC1C,MAAM,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,EACzC,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,IAAS,CAAC,CAC9B;IACH;AAEA;;;;AAIG;AACH,IAAA,UAAU,CAAC,UAAoB,EAAA;QAC7B,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,IAAI,CAC1C,MAAM,CAAC,KAAK,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CACjD;IACH;AAEA;;;AAGG;IACH,KAAK,GAAA;AACH,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE;IACzC;AACD;;AC5ED;;;;;;;;AAQG;AAEH;;;;;AAKG;AACI,MAAM,UAAU,GAAG;AACxB,IAAA,WAAW,EAAE,EAAkB;AAC/B,IAAA,aAAa,EAAE,EAAqB;AACpC,IAAA,MAAM,EAAE,EAAa;;;;;"}