@sixbell-telco/sdk 1.5.0 → 2.0.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.
Files changed (131) hide show
  1. package/CHANGELOG.md +223 -710
  2. package/README.md +307 -282
  3. package/_index.css +29 -3
  4. package/components/audio-player/audio-timeline/audio-timeline.component.d.ts +1 -1
  5. package/components/audio-player/services/audio.service.d.ts +14 -14
  6. package/components/countdown/src/countdown.component.d.ts +1 -1
  7. package/components/dropdown/dropdown-chevron/dropdown-chevron.component.d.ts +6 -1
  8. package/components/dropdown/dropdown-content/dropdown-content.component.d.ts +1 -1
  9. package/components/dropdown/dropdown-item/dropdown-item.component.d.ts +6 -1
  10. package/components/dropdown/dropdown-item-checkbox/dropdown-item-checkbox.component.d.ts +7 -1
  11. package/components/dropdown/dropdown-item-radio/dropdown-item-radio.component.d.ts +7 -1
  12. package/components/dropdown/dropdown-trigger/dropdown-trigger.component.d.ts +30 -0
  13. package/components/dropdown/public-api.d.ts +0 -1
  14. package/components/dropdown/src/dropdown.component.d.ts +31 -7
  15. package/components/dropdown-menu/src/dropdown-menu-content/dropdown-menu-content.component.d.ts +2 -3
  16. package/components/dual-list/src/dual-list.component.d.ts +2 -1
  17. package/components/file-upload/file-dropzone/file-dropzone.component.d.ts +7 -7
  18. package/components/file-upload/file-uploader/file-uploader.component.d.ts +7 -7
  19. package/components/forms/combobox/src/combobox.component.d.ts +24 -0
  20. package/components/forms/input/src/input.component.d.ts +11 -1
  21. package/components/forms/select/src/select.component.d.ts +24 -0
  22. package/components/forms/textarea/src/textarea.component.d.ts +10 -10
  23. package/components/link/src/link.component.d.ts +0 -3
  24. package/components/tab/directives/tab-content/tab-content.directive.d.ts +3 -3
  25. package/components/tab/directives/tab-header/tab-header.directive.d.ts +2 -2
  26. package/components/wizard/services/wizard.service.d.ts +5 -5
  27. package/directives/auto-focus/public-api.d.ts +1 -1
  28. package/directives/auto-focus/src/{autofocus.directive.d.ts → auto-focus.directive.d.ts} +5 -7
  29. package/directives/only-numbers/public-api.d.ts +6 -1
  30. package/directives/only-numbers/src/only-numbers.directive.d.ts +37 -0
  31. package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +7 -5
  32. package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
  33. package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +1 -1
  34. package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
  35. package/fesm2022/sixbell-telco-sdk-components-badge.mjs +2 -2
  36. package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
  37. package/fesm2022/sixbell-telco-sdk-components-countdown.mjs.map +1 -1
  38. package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +2 -2
  39. package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
  40. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +0 -4
  41. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
  42. package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +472 -341
  43. package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
  44. package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +8 -7
  45. package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
  46. package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +6 -4
  47. package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
  48. package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +58 -2
  49. package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
  50. package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +2 -0
  51. package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
  52. package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +15 -5
  53. package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
  54. package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +54 -4
  55. package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
  56. package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +19 -8
  57. package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
  58. package/fesm2022/sixbell-telco-sdk-components-link.mjs +2 -7
  59. package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -1
  60. package/fesm2022/sixbell-telco-sdk-components-overlay.mjs +2 -2
  61. package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -1
  62. package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
  63. package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
  64. package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs +14 -31
  65. package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs.map +1 -1
  66. package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs +42 -8
  67. package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs.map +1 -1
  68. package/fesm2022/sixbell-telco-sdk-utils-date.mjs +1 -1
  69. package/fesm2022/sixbell-telco-sdk-utils-date.mjs.map +1 -1
  70. package/fesm2022/sixbell-telco-sdk-utils-pipes-to-bytes-extesion.mjs +1 -1
  71. package/fesm2022/sixbell-telco-sdk-utils-pipes-to-bytes-extesion.mjs.map +1 -1
  72. package/fesm2022/sixbell-telco-sdk-utils-runtime-config.mjs +339 -0
  73. package/fesm2022/sixbell-telco-sdk-utils-runtime-config.mjs.map +1 -0
  74. package/fesm2022/sixbell-telco-sdk-utils-sync.mjs +1 -1
  75. package/fesm2022/sixbell-telco-sdk-utils-sync.mjs.map +1 -1
  76. package/fesm2022/sixbell-telco-sdk-utils-theme.mjs +1053 -716
  77. package/fesm2022/sixbell-telco-sdk-utils-theme.mjs.map +1 -1
  78. package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +345 -257
  79. package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
  80. package/package.json +73 -72
  81. package/utils/runtime-config/README.md +235 -0
  82. package/utils/{resource-loader → runtime-config}/index.d.ts +1 -1
  83. package/utils/runtime-config/public-api.d.ts +5 -0
  84. package/utils/runtime-config/src/http-client.d.ts +11 -0
  85. package/utils/runtime-config/src/runtime-config-loader.d.ts +23 -0
  86. package/utils/runtime-config/src/runtime-config-store.d.ts +11 -0
  87. package/utils/runtime-config/src/runtime-update-adapter.d.ts +15 -0
  88. package/utils/runtime-config/src/types.d.ts +66 -0
  89. package/utils/theme/README.md +324 -986
  90. package/utils/theme/public-api.d.ts +4 -4
  91. package/utils/theme/src/constants.d.ts +6 -12
  92. package/utils/theme/src/models/theme.d.ts +46 -173
  93. package/utils/theme/src/providers/theme.provider.d.ts +0 -10
  94. package/utils/theme/src/providers/theme.provider.types.d.ts +16 -15
  95. package/utils/theme/src/theme-assets/theme-assets.service.d.ts +16 -12
  96. package/utils/theme/src/theme-dom/theme-dom.service.d.ts +8 -0
  97. package/utils/theme/src/theme.service.d.ts +24 -27
  98. package/utils/theme/src/utils/utils.d.ts +2 -10
  99. package/utils/translation/README.md +170 -1390
  100. package/utils/translation/public-api.d.ts +3 -3
  101. package/utils/translation/src/constants.d.ts +7 -9
  102. package/utils/translation/src/models/translation.d.ts +9 -10
  103. package/utils/translation/src/providers/translation.provider.d.ts +17 -28
  104. package/utils/translation/src/providers/translation.provider.types.d.ts +13 -6
  105. package/utils/translation/src/translation.service.d.ts +37 -9
  106. package/components/dropdown/src/services/dropdown.service.d.ts +0 -22
  107. package/directives/only-numbers/src/just-numbers.directive.d.ts +0 -9
  108. package/fesm2022/sixbell-telco-sdk-utils-resource-loader.mjs +0 -1222
  109. package/fesm2022/sixbell-telco-sdk-utils-resource-loader.mjs.map +0 -1
  110. package/utils/resource-loader/README.md +0 -460
  111. package/utils/resource-loader/public-api.d.ts +0 -1
  112. package/utils/resource-loader/src/cache/index.d.ts +0 -2
  113. package/utils/resource-loader/src/cache/layers/factory.d.ts +0 -38
  114. package/utils/resource-loader/src/cache/layers/index.d.ts +0 -3
  115. package/utils/resource-loader/src/cache/layers/indexed-db-cache.d.ts +0 -118
  116. package/utils/resource-loader/src/cache/layers/local-storage-cache.d.ts +0 -86
  117. package/utils/resource-loader/src/cache/layers/memory-cache.d.ts +0 -76
  118. package/utils/resource-loader/src/cache/types.d.ts +0 -107
  119. package/utils/resource-loader/src/config/index.d.ts +0 -1
  120. package/utils/resource-loader/src/config/load-config.d.ts +0 -32
  121. package/utils/resource-loader/src/constants.d.ts +0 -38
  122. package/utils/resource-loader/src/http/index.d.ts +0 -1
  123. package/utils/resource-loader/src/http/retryable-client.d.ts +0 -43
  124. package/utils/resource-loader/src/index.d.ts +0 -1
  125. package/utils/resource-loader/src/resource-loader.d.ts +0 -67
  126. package/utils/resource-loader/src/types.d.ts +0 -152
  127. package/utils/resource-loader/src/utils/cache-validator.d.ts +0 -72
  128. package/utils/resource-loader/src/utils/helpers.d.ts +0 -15
  129. package/utils/resource-loader/src/utils/index.d.ts +0 -2
  130. package/utils/theme/src/providers/constants.d.ts +0 -7
  131. package/utils/translation/src/providers/constants.d.ts +0 -11
@@ -60,7 +60,7 @@ class DateUtils {
60
60
  }
61
61
  /** Infer time format from a time string (returns seconds precision if length is 8) */
62
62
  static inferTimeFormat(time) {
63
- return time && time.length === 8 ? TIME_SECONDS_FORMAT : TIME_MINUTES_FORMAT;
63
+ return time?.length === 8 ? TIME_SECONDS_FORMAT : TIME_MINUTES_FORMAT;
64
64
  }
65
65
  /** Current time formatted per the provided time format */
66
66
  static timeNow(format = TIME_SECONDS_FORMAT) {
@@ -1 +1 @@
1
- {"version":3,"file":"sixbell-telco-sdk-utils-date.mjs","sources":["../../../projects/sdk/utils/date/src/date-utils.ts","../../../projects/sdk/utils/date/sixbell-telco-sdk-utils-date.ts"],"sourcesContent":["import dayjs from 'dayjs';\n\n/**\n * Supported display / parsing formats for date utilities.\n * Internally all calculations use ISO `YYYY-MM-DD` and convert to the chosen format for display.\n */\nexport const SUPPORTED_DATE_FORMATS = [\n\t'DD/MM/YYYY', // Day/Month/Year (European)\n\t'MM/DD/YYYY', // Month/Day/Year (US)\n\t'YYYY-MM-DD', // Year-Month-Day (ISO)\n\t'DD-MM-YYYY', // Day-Month-Year (European with dashes)\n\t'MM-DD-YYYY', // Month-Day-Year (US with dashes)\n\t'YYYY/MM/DD', // Year/Month/Day (ISO with slashes)\n\t'DD.MM.YYYY', // Day.Month.Year (German style)\n\t'MM.DD.YYYY', // Month.Day.Year (US with dots)\n\t'YYYY.MM.DD', // Year.Month.Day (ISO with dots)\n] as const;\n\n/** Union type of all supported format strings. */\nexport type SupportedDateFormat = (typeof SUPPORTED_DATE_FORMATS)[number];\n\n/**\n * Supported time-only formats\n */\nexport const SUPPORTED_TIME_FORMATS = ['HH:mm', 'HH:mm:ss'] as const;\nexport type SupportedTimeFormat = (typeof SUPPORTED_TIME_FORMATS)[number];\n\n// Commonly used format constants\nexport const ISO_DATE_FORMAT: SupportedDateFormat = 'YYYY-MM-DD';\nexport const TIME_MINUTES_FORMAT: SupportedTimeFormat = 'HH:mm';\nexport const TIME_SECONDS_FORMAT: SupportedTimeFormat = 'HH:mm:ss';\n\n// 12-hour time format constants\nexport const TIME_12H_MINUTES_FORMAT = 'h:mm A';\nexport const TIME_12H_SECONDS_FORMAT = 'h:mm:ss A';\n\n// Application-wide default UI date display format\n\n/**\n * Quick action types for range picker\n */\nexport type QuickRangePreset = 'last7Days' | 'last30Days' | 'last6Months' | 'lastYear';\n\n/**\n * Date range representation\n */\nexport interface DateRange {\n\tstart: string;\n\tend: string;\n}\n\n/**\n * Reusable date utility service for date operations across the SDK.\n * Provides consistent date handling, formatting, and range operations.\n */\nexport class DateUtils {\n\t/**\n\t * Convert a date string to ISO format (YYYY-MM-DD)\n\t */\n\tstatic toISODate(date: string, format?: SupportedDateFormat): string {\n\t\tif (!date) return '';\n\t\t// If already ISO, return as-is to avoid misparsing when a display format is provided\n\t\tif (/^\\d{4}-\\d{2}-\\d{2}$/.test(date)) return date;\n\t\tif (format && format !== 'YYYY-MM-DD') {\n\t\t\tconst parsed = dayjs(date, format, true);\n\t\t\treturn parsed.isValid() ? parsed.format('YYYY-MM-DD') : dayjs(date).format('YYYY-MM-DD');\n\t\t}\n\t\treturn dayjs(date).format('YYYY-MM-DD');\n\t}\n\n\t/**\n\t * Convert ISO date to display format\n\t */\n\tstatic toDisplayDate(isoDate: string, format: SupportedDateFormat): string {\n\t\tif (!isoDate) return '';\n\t\treturn dayjs(isoDate).format(format);\n\t}\n\n\t/** Build a combined date-time format string, e.g. `YYYY-MM-DD HH:mm:ss` */\n\tstatic buildDateTimeFormat(dateFmt: SupportedDateFormat, timeFmt: SupportedTimeFormat): string {\n\t\treturn `${dateFmt} ${timeFmt}`;\n\t}\n\n\t/** Infer time format from a time string (returns seconds precision if length is 8) */\n\tstatic inferTimeFormat(time: string | null | undefined): SupportedTimeFormat {\n\t\treturn time && time.length === 8 ? TIME_SECONDS_FORMAT : TIME_MINUTES_FORMAT;\n\t}\n\n\t/** Current time formatted per the provided time format */\n\tstatic timeNow(format: SupportedTimeFormat = TIME_SECONDS_FORMAT): string {\n\t\treturn dayjs().format(format);\n\t}\n\n\t/** Milliseconds since epoch for now */\n\tstatic nowMillis(): number {\n\t\treturn dayjs().valueOf();\n\t}\n\n\t/** Convert ISO date + time string into epoch milliseconds using provided time format */\n\tstatic toMillis(isoDate: string, time: string, timeFmt: SupportedTimeFormat): number | null {\n\t\tif (!isoDate || !time) return null;\n\t\tconst fmt = this.buildDateTimeFormat(ISO_DATE_FORMAT, timeFmt);\n\t\tconst dt = dayjs(`${isoDate} ${time}`, fmt);\n\t\treturn dt.isValid() ? dt.valueOf() : null;\n\t}\n\n\t/** Whether a given ISO date equals today (local) */\n\tstatic isTodayISO(isoDate: string): boolean {\n\t\treturn !!isoDate && isoDate === this.today();\n\t}\n\n\t/** End-of-day string for the given time format */\n\tstatic endOfDay(format: SupportedTimeFormat): string {\n\t\treturn format === TIME_SECONDS_FORMAT ? '23:59:59' : '23:59';\n\t}\n\n\t/** Start-of-day string for the given time format */\n\tstatic startOfDay(format: SupportedTimeFormat): string {\n\t\treturn format === TIME_SECONDS_FORMAT ? '00:00:00' : '00:00';\n\t}\n\n\t/** Checks if the provided time string represents end-of-day */\n\tstatic isEndOfDay(time: string | null | undefined): boolean {\n\t\treturn time === '23:59' || time === '23:59:59';\n\t}\n\n\t/**\n\t * Convert 24-hour time format to 12-hour format with AM/PM\n\t * @param time24h Time in HH:mm or HH:mm:ss format\n\t * @param includeSeconds Whether to include seconds in the output\n\t * @returns Time in 12-hour format (h:mm A or h:mm:ss A)\n\t */\n\tstatic to12HourFormat(time24h: string, includeSeconds: boolean = false): string {\n\t\tif (!time24h) return '';\n\n\t\t// Parse the time using dayjs\n\t\tconst timeFormat = includeSeconds ? TIME_SECONDS_FORMAT : TIME_MINUTES_FORMAT;\n\t\tconst timeObj = dayjs(`2000-01-01 ${time24h}`, `YYYY-MM-DD ${timeFormat}`);\n\n\t\tif (!timeObj.isValid()) return time24h;\n\n\t\tconst outputFormat = includeSeconds ? TIME_12H_SECONDS_FORMAT : TIME_12H_MINUTES_FORMAT;\n\t\treturn timeObj.format(outputFormat);\n\t}\n\n\t/**\n\t * Generate range value string for calendar components (ISO/ISO format)\n\t */\n\tstatic toRangeValue(range: DateRange | null): string {\n\t\tif (!range?.start || !range?.end) return '';\n\t\treturn `${range.start}/${range.end}`;\n\t}\n\n\t/**\n\t * Parse range value string from calendar components (ISO/ISO format)\n\t */\n\tstatic parseRangeValue(value: string): DateRange | null {\n\t\tif (!value?.includes('/')) return null;\n\t\tconst [start, end] = value.split('/');\n\t\tif (!start || !end) return null;\n\t\treturn { start, end };\n\t}\n\n\t/**\n\t * Generate quick range based on preset\n\t */\n\tstatic generateQuickRange(preset: QuickRangePreset): DateRange {\n\t\tconst today = dayjs();\n\t\tlet startDate: dayjs.Dayjs;\n\n\t\tswitch (preset) {\n\t\t\tcase 'last7Days':\n\t\t\t\tstartDate = today.subtract(6, 'day'); // inclusive of today => 7 days\n\t\t\t\tbreak;\n\t\t\tcase 'last30Days':\n\t\t\t\tstartDate = today.subtract(29, 'day');\n\t\t\t\tbreak;\n\t\t\tcase 'last6Months':\n\t\t\t\tstartDate = today.subtract(6, 'month');\n\t\t\t\tbreak;\n\t\t\tcase 'lastYear':\n\t\t\t\tstartDate = today.subtract(1, 'year');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unknown preset: ${preset}`);\n\t\t}\n\n\t\treturn {\n\t\t\tstart: startDate.format('YYYY-MM-DD'),\n\t\t\tend: today.format('YYYY-MM-DD'),\n\t\t};\n\t}\n\n\t/**\n\t * Generate a range representing the last N hours relative to now, including times.\n\t * Returns ISO date range plus HH:mm:ss start/end time strings.\n\t */\n\tstatic generateLastHoursRange(hours: number): { range: DateRange; startTime: string; endTime: string } {\n\t\tconst now = dayjs();\n\t\tconst start = now.subtract(hours, 'hour');\n\t\treturn {\n\t\t\trange: {\n\t\t\t\tstart: start.format('YYYY-MM-DD'),\n\t\t\t\tend: now.format('YYYY-MM-DD'),\n\t\t\t},\n\t\t\tstartTime: start.format('HH:mm:ss'),\n\t\t\tendTime: now.format('HH:mm:ss'),\n\t\t};\n\t}\n\n\t/**\n\t * Validate date range\n\t */\n\tstatic isValidRange(range: DateRange | null): boolean {\n\t\tif (!range?.start || !range?.end) return false;\n\t\treturn dayjs(range.start).isValid() && dayjs(range.end).isValid();\n\t}\n\n\t/**\n\t * Check if a date is valid\n\t */\n\tstatic isValidDate(date: string): boolean {\n\t\treturn dayjs(date).isValid();\n\t}\n\n\t/**\n\t * Get today's date in ISO format\n\t */\n\tstatic today(): string {\n\t\treturn dayjs().format('YYYY-MM-DD');\n\t}\n\n\t/**\n\t * Get yesterday's date in ISO format\n\t */\n\tstatic yesterday(): string {\n\t\treturn dayjs().subtract(1, 'day').format('YYYY-MM-DD');\n\t}\n\n\t/**\n\t * Get tomorrow's date in ISO format\n\t */\n\tstatic tomorrow(): string {\n\t\treturn dayjs().add(1, 'day').format('YYYY-MM-DD');\n\t}\n\n\t/**\n\t * Add/subtract time from a date\n\t */\n\tstatic addTime(date: string, amount: number, unit: dayjs.ManipulateType): string {\n\t\treturn dayjs(date).add(amount, unit).format('YYYY-MM-DD');\n\t}\n\n\t/**\n\t * Get difference between two dates\n\t */\n\tstatic diff(date1: string, date2: string, unit: dayjs.QUnitType = 'day'): number {\n\t\treturn dayjs(date1).diff(dayjs(date2), unit);\n\t}\n\n\t/**\n\t * Check if date is between two dates (inclusive)\n\t */\n\tstatic isBetween(date: string, start: string, end: string): boolean {\n\t\tconst dateObj = dayjs(date);\n\t\tconst startObj = dayjs(start);\n\t\tconst endObj = dayjs(end);\n\t\treturn (dateObj.isAfter(startObj) || dateObj.isSame(startObj)) && (dateObj.isBefore(endObj) || dateObj.isSame(endObj));\n\t}\n\n\t/**\n\t * Format date with custom pattern\n\t */\n\tstatic format(date: string, pattern: string): string {\n\t\treturn dayjs(date).format(pattern);\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACU,MAAA,sBAAsB,GAAG;AACrC,IAAA,YAAY;AACZ,IAAA,YAAY;AACZ,IAAA,YAAY;AACZ,IAAA,YAAY;AACZ,IAAA,YAAY;AACZ,IAAA,YAAY;AACZ,IAAA,YAAY;AACZ,IAAA,YAAY;AACZ,IAAA,YAAY;;AAMb;;AAEG;MACU,sBAAsB,GAAG,CAAC,OAAO,EAAE,UAAU;AAG1D;AACO,MAAM,eAAe,GAAwB;AAC7C,MAAM,mBAAmB,GAAwB;AACjD,MAAM,mBAAmB,GAAwB;AAExD;AACO,MAAM,uBAAuB,GAAG;AAChC,MAAM,uBAAuB,GAAG;AAiBvC;;;AAGG;MACU,SAAS,CAAA;AACrB;;AAEG;AACH,IAAA,OAAO,SAAS,CAAC,IAAY,EAAE,MAA4B,EAAA;AAC1D,QAAA,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GAAA;AACd,QAAA,OAAO,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;;AAGlD;;AAEG;AACH,IAAA,OAAO,OAAO,CAAC,IAAY,EAAE,MAAc,EAAE,IAA0B,EAAA;AACtE,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;;AAG1D;;AAEG;IACH,OAAO,IAAI,CAAC,KAAa,EAAE,KAAa,EAAE,OAAwB,KAAK,EAAA;AACtE,QAAA,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC;;AAG7C;;AAEG;AACH,IAAA,OAAO,SAAS,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW,EAAA;AACxD,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC;AAC3B,QAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC;AAC7B,QAAA,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC;AACzB,QAAA,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;;AAGvH;;AAEG;AACH,IAAA,OAAO,MAAM,CAAC,IAAY,EAAE,OAAe,EAAA;QAC1C,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;;AAEnC;;ACpRD;;AAEG;;;;"}
1
+ {"version":3,"file":"sixbell-telco-sdk-utils-date.mjs","sources":["../../../projects/sdk/utils/date/src/date-utils.ts","../../../projects/sdk/utils/date/sixbell-telco-sdk-utils-date.ts"],"sourcesContent":["import dayjs from 'dayjs';\n\n/**\n * Supported display / parsing formats for date utilities.\n * Internally all calculations use ISO `YYYY-MM-DD` and convert to the chosen format for display.\n */\nexport const SUPPORTED_DATE_FORMATS = [\n\t'DD/MM/YYYY', // Day/Month/Year (European)\n\t'MM/DD/YYYY', // Month/Day/Year (US)\n\t'YYYY-MM-DD', // Year-Month-Day (ISO)\n\t'DD-MM-YYYY', // Day-Month-Year (European with dashes)\n\t'MM-DD-YYYY', // Month-Day-Year (US with dashes)\n\t'YYYY/MM/DD', // Year/Month/Day (ISO with slashes)\n\t'DD.MM.YYYY', // Day.Month.Year (German style)\n\t'MM.DD.YYYY', // Month.Day.Year (US with dots)\n\t'YYYY.MM.DD', // Year.Month.Day (ISO with dots)\n] as const;\n\n/** Union type of all supported format strings. */\nexport type SupportedDateFormat = (typeof SUPPORTED_DATE_FORMATS)[number];\n\n/**\n * Supported time-only formats\n */\nexport const SUPPORTED_TIME_FORMATS = ['HH:mm', 'HH:mm:ss'] as const;\nexport type SupportedTimeFormat = (typeof SUPPORTED_TIME_FORMATS)[number];\n\n// Commonly used format constants\nexport const ISO_DATE_FORMAT: SupportedDateFormat = 'YYYY-MM-DD';\nexport const TIME_MINUTES_FORMAT: SupportedTimeFormat = 'HH:mm';\nexport const TIME_SECONDS_FORMAT: SupportedTimeFormat = 'HH:mm:ss';\n\n// 12-hour time format constants\nexport const TIME_12H_MINUTES_FORMAT = 'h:mm A';\nexport const TIME_12H_SECONDS_FORMAT = 'h:mm:ss A';\n\n// Application-wide default UI date display format\n\n/**\n * Quick action types for range picker\n */\nexport type QuickRangePreset = 'last7Days' | 'last30Days' | 'last6Months' | 'lastYear';\n\n/**\n * Date range representation\n */\nexport interface DateRange {\n\tstart: string;\n\tend: string;\n}\n\n/**\n * Reusable date utility service for date operations across the SDK.\n * Provides consistent date handling, formatting, and range operations.\n */\nexport class DateUtils {\n\t/**\n\t * Convert a date string to ISO format (YYYY-MM-DD)\n\t */\n\tstatic toISODate(date: string, format?: SupportedDateFormat): string {\n\t\tif (!date) return '';\n\t\t// If already ISO, return as-is to avoid misparsing when a display format is provided\n\t\tif (/^\\d{4}-\\d{2}-\\d{2}$/.test(date)) return date;\n\t\tif (format && format !== 'YYYY-MM-DD') {\n\t\t\tconst parsed = dayjs(date, format, true);\n\t\t\treturn parsed.isValid() ? parsed.format('YYYY-MM-DD') : dayjs(date).format('YYYY-MM-DD');\n\t\t}\n\t\treturn dayjs(date).format('YYYY-MM-DD');\n\t}\n\n\t/**\n\t * Convert ISO date to display format\n\t */\n\tstatic toDisplayDate(isoDate: string, format: SupportedDateFormat): string {\n\t\tif (!isoDate) return '';\n\t\treturn dayjs(isoDate).format(format);\n\t}\n\n\t/** Build a combined date-time format string, e.g. `YYYY-MM-DD HH:mm:ss` */\n\tstatic buildDateTimeFormat(dateFmt: SupportedDateFormat, timeFmt: SupportedTimeFormat): string {\n\t\treturn `${dateFmt} ${timeFmt}`;\n\t}\n\n\t/** Infer time format from a time string (returns seconds precision if length is 8) */\n\tstatic inferTimeFormat(time: string | null | undefined): SupportedTimeFormat {\n\t\treturn time?.length === 8 ? TIME_SECONDS_FORMAT : TIME_MINUTES_FORMAT;\n\t}\n\n\t/** Current time formatted per the provided time format */\n\tstatic timeNow(format: SupportedTimeFormat = TIME_SECONDS_FORMAT): string {\n\t\treturn dayjs().format(format);\n\t}\n\n\t/** Milliseconds since epoch for now */\n\tstatic nowMillis(): number {\n\t\treturn dayjs().valueOf();\n\t}\n\n\t/** Convert ISO date + time string into epoch milliseconds using provided time format */\n\tstatic toMillis(isoDate: string, time: string, timeFmt: SupportedTimeFormat): number | null {\n\t\tif (!isoDate || !time) return null;\n\t\tconst fmt = this.buildDateTimeFormat(ISO_DATE_FORMAT, timeFmt);\n\t\tconst dt = dayjs(`${isoDate} ${time}`, fmt);\n\t\treturn dt.isValid() ? dt.valueOf() : null;\n\t}\n\n\t/** Whether a given ISO date equals today (local) */\n\tstatic isTodayISO(isoDate: string): boolean {\n\t\treturn !!isoDate && isoDate === this.today();\n\t}\n\n\t/** End-of-day string for the given time format */\n\tstatic endOfDay(format: SupportedTimeFormat): string {\n\t\treturn format === TIME_SECONDS_FORMAT ? '23:59:59' : '23:59';\n\t}\n\n\t/** Start-of-day string for the given time format */\n\tstatic startOfDay(format: SupportedTimeFormat): string {\n\t\treturn format === TIME_SECONDS_FORMAT ? '00:00:00' : '00:00';\n\t}\n\n\t/** Checks if the provided time string represents end-of-day */\n\tstatic isEndOfDay(time: string | null | undefined): boolean {\n\t\treturn time === '23:59' || time === '23:59:59';\n\t}\n\n\t/**\n\t * Convert 24-hour time format to 12-hour format with AM/PM\n\t * @param time24h Time in HH:mm or HH:mm:ss format\n\t * @param includeSeconds Whether to include seconds in the output\n\t * @returns Time in 12-hour format (h:mm A or h:mm:ss A)\n\t */\n\tstatic to12HourFormat(time24h: string, includeSeconds: boolean = false): string {\n\t\tif (!time24h) return '';\n\n\t\t// Parse the time using dayjs\n\t\tconst timeFormat = includeSeconds ? TIME_SECONDS_FORMAT : TIME_MINUTES_FORMAT;\n\t\tconst timeObj = dayjs(`2000-01-01 ${time24h}`, `YYYY-MM-DD ${timeFormat}`);\n\n\t\tif (!timeObj.isValid()) return time24h;\n\n\t\tconst outputFormat = includeSeconds ? TIME_12H_SECONDS_FORMAT : TIME_12H_MINUTES_FORMAT;\n\t\treturn timeObj.format(outputFormat);\n\t}\n\n\t/**\n\t * Generate range value string for calendar components (ISO/ISO format)\n\t */\n\tstatic toRangeValue(range: DateRange | null): string {\n\t\tif (!range?.start || !range?.end) return '';\n\t\treturn `${range.start}/${range.end}`;\n\t}\n\n\t/**\n\t * Parse range value string from calendar components (ISO/ISO format)\n\t */\n\tstatic parseRangeValue(value: string): DateRange | null {\n\t\tif (!value?.includes('/')) return null;\n\t\tconst [start, end] = value.split('/');\n\t\tif (!start || !end) return null;\n\t\treturn { start, end };\n\t}\n\n\t/**\n\t * Generate quick range based on preset\n\t */\n\tstatic generateQuickRange(preset: QuickRangePreset): DateRange {\n\t\tconst today = dayjs();\n\t\tlet startDate: dayjs.Dayjs;\n\n\t\tswitch (preset) {\n\t\t\tcase 'last7Days':\n\t\t\t\tstartDate = today.subtract(6, 'day'); // inclusive of today => 7 days\n\t\t\t\tbreak;\n\t\t\tcase 'last30Days':\n\t\t\t\tstartDate = today.subtract(29, 'day');\n\t\t\t\tbreak;\n\t\t\tcase 'last6Months':\n\t\t\t\tstartDate = today.subtract(6, 'month');\n\t\t\t\tbreak;\n\t\t\tcase 'lastYear':\n\t\t\t\tstartDate = today.subtract(1, 'year');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unknown preset: ${preset}`);\n\t\t}\n\n\t\treturn {\n\t\t\tstart: startDate.format('YYYY-MM-DD'),\n\t\t\tend: today.format('YYYY-MM-DD'),\n\t\t};\n\t}\n\n\t/**\n\t * Generate a range representing the last N hours relative to now, including times.\n\t * Returns ISO date range plus HH:mm:ss start/end time strings.\n\t */\n\tstatic generateLastHoursRange(hours: number): { range: DateRange; startTime: string; endTime: string } {\n\t\tconst now = dayjs();\n\t\tconst start = now.subtract(hours, 'hour');\n\t\treturn {\n\t\t\trange: {\n\t\t\t\tstart: start.format('YYYY-MM-DD'),\n\t\t\t\tend: now.format('YYYY-MM-DD'),\n\t\t\t},\n\t\t\tstartTime: start.format('HH:mm:ss'),\n\t\t\tendTime: now.format('HH:mm:ss'),\n\t\t};\n\t}\n\n\t/**\n\t * Validate date range\n\t */\n\tstatic isValidRange(range: DateRange | null): boolean {\n\t\tif (!range?.start || !range?.end) return false;\n\t\treturn dayjs(range.start).isValid() && dayjs(range.end).isValid();\n\t}\n\n\t/**\n\t * Check if a date is valid\n\t */\n\tstatic isValidDate(date: string): boolean {\n\t\treturn dayjs(date).isValid();\n\t}\n\n\t/**\n\t * Get today's date in ISO format\n\t */\n\tstatic today(): string {\n\t\treturn dayjs().format('YYYY-MM-DD');\n\t}\n\n\t/**\n\t * Get yesterday's date in ISO format\n\t */\n\tstatic yesterday(): string {\n\t\treturn dayjs().subtract(1, 'day').format('YYYY-MM-DD');\n\t}\n\n\t/**\n\t * Get tomorrow's date in ISO format\n\t */\n\tstatic tomorrow(): string {\n\t\treturn dayjs().add(1, 'day').format('YYYY-MM-DD');\n\t}\n\n\t/**\n\t * Add/subtract time from a date\n\t */\n\tstatic addTime(date: string, amount: number, unit: dayjs.ManipulateType): string {\n\t\treturn dayjs(date).add(amount, unit).format('YYYY-MM-DD');\n\t}\n\n\t/**\n\t * Get difference between two dates\n\t */\n\tstatic diff(date1: string, date2: string, unit: dayjs.QUnitType = 'day'): number {\n\t\treturn dayjs(date1).diff(dayjs(date2), unit);\n\t}\n\n\t/**\n\t * Check if date is between two dates (inclusive)\n\t */\n\tstatic isBetween(date: string, start: string, end: string): boolean {\n\t\tconst dateObj = dayjs(date);\n\t\tconst startObj = dayjs(start);\n\t\tconst endObj = dayjs(end);\n\t\treturn (dateObj.isAfter(startObj) || dateObj.isSame(startObj)) && (dateObj.isBefore(endObj) || dateObj.isSame(endObj));\n\t}\n\n\t/**\n\t * Format date with custom pattern\n\t */\n\tstatic format(date: string, pattern: string): string {\n\t\treturn dayjs(date).format(pattern);\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACU,MAAA,sBAAsB,GAAG;AACrC,IAAA,YAAY;AACZ,IAAA,YAAY;AACZ,IAAA,YAAY;AACZ,IAAA,YAAY;AACZ,IAAA,YAAY;AACZ,IAAA,YAAY;AACZ,IAAA,YAAY;AACZ,IAAA,YAAY;AACZ,IAAA,YAAY;;AAMb;;AAEG;MACU,sBAAsB,GAAG,CAAC,OAAO,EAAE,UAAU;AAG1D;AACO,MAAM,eAAe,GAAwB;AAC7C,MAAM,mBAAmB,GAAwB;AACjD,MAAM,mBAAmB,GAAwB;AAExD;AACO,MAAM,uBAAuB,GAAG;AAChC,MAAM,uBAAuB,GAAG;AAiBvC;;;AAGG;MACU,SAAS,CAAA;AAC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
11
  const k = 1024;
12
- const dm = decimals < 0 ? 0 : decimals;
12
+ const dm = Math.max(decimals, 0);
13
13
  const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
14
14
  const i = Math.floor(Math.log(bytes) / Math.log(k));
15
15
  // Format with the required number of decimals
@@ -1 +1 @@
1
- {"version":3,"file":"sixbell-telco-sdk-utils-pipes-to-bytes-extesion.mjs","sources":["../../../projects/sdk/utils/pipes/to-bytes-extesion/src/to-bytes.pipe.ts","../../../projects/sdk/utils/pipes/to-bytes-extesion/sixbell-telco-sdk-utils-pipes-to-bytes-extesion.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n\tname: 'toBytes',\n\tstandalone: true,\n})\nexport class ToBytesPipe implements PipeTransform {\n\ttransform(bytes: number, decimals: number = 0): string {\n\t\treturn this.formatBytes(bytes, decimals);\n\t}\n\n\tprivate formatBytes(bytes: number, decimals: number = 0): string {\n\t\tif (bytes === 0) return '0 Bytes';\n\n\t\tconst k = 1024;\n\t\tconst dm = decimals < 0 ? 0 : decimals;\n\t\tconst sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n\n\t\tconst i = Math.floor(Math.log(bytes) / Math.log(k));\n\n\t\t// Format with the required number of decimals\n\t\tconst formattedNumber = (bytes / Math.pow(k, i)).toFixed(dm);\n\n\t\t// Remove space between the number and the unit\n\t\treturn formattedNumber + sizes[i];\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,WAAW,CAAA;AACvB,IAAA,SAAS,CAAC,KAAa,EAAE,QAAA,GAAmB,CAAC,EAAA;QAC5C,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC;;AAGjC,IAAA,WAAW,CAAC,KAAa,EAAE,QAAA,GAAmB,CAAC,EAAA;QACtD,IAAI,KAAK,KAAK,CAAC;AAAE,YAAA,OAAO,SAAS;QAEjC,MAAM,CAAC,GAAG,IAAI;AACd,QAAA,MAAM,EAAE,GAAG,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,QAAQ;QACtC,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;QAEvE,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;;AAGnD,QAAA,MAAM,eAAe,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC;;AAG5D,QAAA,OAAO,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC;;uGAlBtB,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA;;2FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBAJvB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACL,oBAAA,IAAI,EAAE,SAAS;AACf,oBAAA,UAAU,EAAE,IAAI;AAChB,iBAAA;;;ACLD;;AAEG;;;;"}
1
+ {"version":3,"file":"sixbell-telco-sdk-utils-pipes-to-bytes-extesion.mjs","sources":["../../../projects/sdk/utils/pipes/to-bytes-extesion/src/to-bytes.pipe.ts","../../../projects/sdk/utils/pipes/to-bytes-extesion/sixbell-telco-sdk-utils-pipes-to-bytes-extesion.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n\tname: 'toBytes',\n\tstandalone: true,\n})\nexport class ToBytesPipe implements PipeTransform {\n\ttransform(bytes: number, decimals: number = 0): string {\n\t\treturn this.formatBytes(bytes, decimals);\n\t}\n\n\tprivate formatBytes(bytes: number, decimals: number = 0): string {\n\t\tif (bytes === 0) return '0 Bytes';\n\n\t\tconst k = 1024;\n\t\tconst dm = Math.max(decimals, 0);\n\t\tconst sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n\n\t\tconst i = Math.floor(Math.log(bytes) / Math.log(k));\n\n\t\t// Format with the required number of decimals\n\t\tconst formattedNumber = (bytes / Math.pow(k, i)).toFixed(dm);\n\n\t\t// Remove space between the number and the unit\n\t\treturn formattedNumber + sizes[i];\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,WAAW,CAAA;AACvB,IAAA,SAAS,CAAC,KAAa,EAAE,QAAA,GAAmB,CAAC,EAAA;QAC5C,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC;;AAGjC,IAAA,WAAW,CAAC,KAAa,EAAE,QAAA,GAAmB,CAAC,EAAA;QACtD,IAAI,KAAK,KAAK,CAAC;AAAE,YAAA,OAAO,SAAS;QAEjC,MAAM,CAAC,GAAG,IAAI;QACd,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;QAChC,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;QAEvE,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;;AAGnD,QAAA,MAAM,eAAe,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC;;AAG5D,QAAA,OAAO,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC;;uGAlBtB,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA;;2FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBAJvB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACL,oBAAA,IAAI,EAAE,SAAS;AACf,oBAAA,UAAU,EAAE,IAAI;AAChB,iBAAA;;;ACLD;;AAEG;;;;"}
@@ -0,0 +1,339 @@
1
+ import Dexie from 'dexie';
2
+
3
+ class RuntimeHttpClient {
4
+ options;
5
+ constructor(options = {}) {
6
+ this.options = options;
7
+ }
8
+ async fetch(url, init) {
9
+ const retries = this.options.retries ?? 0;
10
+ const retryDelayMs = this.options.retryDelayMs ?? 0;
11
+ const timeoutMs = this.options.timeoutMs ?? 0;
12
+ let lastError = null;
13
+ for (let attempt = 0; attempt <= retries; attempt += 1) {
14
+ try {
15
+ return await this.attemptFetch(url, init, timeoutMs);
16
+ }
17
+ catch (error) {
18
+ lastError = error instanceof Error ? error : new Error(String(error));
19
+ if (attempt < retries && retryDelayMs > 0) {
20
+ await new Promise((resolve) => setTimeout(resolve, retryDelayMs));
21
+ }
22
+ }
23
+ }
24
+ throw lastError ?? new Error('Failed to fetch');
25
+ }
26
+ async attemptFetch(url, init, timeoutMs) {
27
+ if (!timeoutMs || timeoutMs <= 0) {
28
+ const response = await fetch(url, init);
29
+ if (!response.ok) {
30
+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);
31
+ }
32
+ return response;
33
+ }
34
+ const controller = new AbortController();
35
+ const timeoutHandle = setTimeout(() => controller.abort(), timeoutMs);
36
+ try {
37
+ const response = await fetch(url, {
38
+ ...init,
39
+ signal: controller.signal,
40
+ });
41
+ if (!response.ok) {
42
+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);
43
+ }
44
+ return response;
45
+ }
46
+ finally {
47
+ clearTimeout(timeoutHandle);
48
+ }
49
+ }
50
+ }
51
+
52
+ const DEFAULT_RETRIES = 2;
53
+ const DEFAULT_RETRY_DELAY_MS = 400;
54
+ const DEFAULT_TIMEOUT_MS = 8000;
55
+ class RuntimeConfigLoader {
56
+ configPath;
57
+ options;
58
+ retries;
59
+ retryDelayMs;
60
+ timeoutMs;
61
+ httpClient;
62
+ parser;
63
+ cacheKey;
64
+ constructor(configPath, options, retries = DEFAULT_RETRIES, retryDelayMs = DEFAULT_RETRY_DELAY_MS, timeoutMs = DEFAULT_TIMEOUT_MS) {
65
+ this.configPath = configPath;
66
+ this.options = options;
67
+ this.retries = retries;
68
+ this.retryDelayMs = retryDelayMs;
69
+ this.timeoutMs = timeoutMs;
70
+ this.httpClient = new RuntimeHttpClient({
71
+ retries: this.retries,
72
+ retryDelayMs: this.retryDelayMs,
73
+ timeoutMs: this.timeoutMs,
74
+ });
75
+ this.parser = options.parser ?? (async (response) => (await response.json()));
76
+ this.cacheKey = this.buildCacheKey();
77
+ }
78
+ async loadLatest() {
79
+ const logger = this.options.logger;
80
+ const cached = await this.loadFromStore();
81
+ if (cached) {
82
+ logger?.debug('Runtime config loaded from cache', {
83
+ component: 'RuntimeConfigLoader',
84
+ action: 'loadLatest',
85
+ resource: this.options.resource,
86
+ configPath: this.configPath,
87
+ meta: cached.meta,
88
+ });
89
+ return { ...cached, source: 'cache' };
90
+ }
91
+ try {
92
+ const response = await this.fetchNoStore();
93
+ const data = await this.parser(response);
94
+ const meta = this.extractMeta(data);
95
+ const hash = await this.resolveHash(data, meta);
96
+ const result = { data, meta, source: 'network', hash };
97
+ await this.storeResult(result);
98
+ logger?.debug('Runtime config loaded', {
99
+ component: 'RuntimeConfigLoader',
100
+ action: 'loadLatest',
101
+ resource: this.options.resource,
102
+ configPath: this.configPath,
103
+ meta,
104
+ });
105
+ return result;
106
+ }
107
+ catch (error) {
108
+ logger?.warn('Runtime config load failed, falling back', {
109
+ component: 'RuntimeConfigLoader',
110
+ action: 'loadLatest',
111
+ resource: this.options.resource,
112
+ configPath: this.configPath,
113
+ error: error instanceof Error ? error.message : String(error),
114
+ });
115
+ const fallback = this.options.fallbackData;
116
+ try {
117
+ const meta = this.extractMeta(fallback);
118
+ const hash = await this.resolveHash(fallback, meta);
119
+ return { data: fallback, meta, source: 'fallback', hash };
120
+ }
121
+ catch {
122
+ return { data: fallback, meta: {}, source: 'fallback', hash: '' };
123
+ }
124
+ }
125
+ }
126
+ async checkForUpdates(currentHash) {
127
+ try {
128
+ const response = await this.fetchNoStore();
129
+ const data = await this.parser(response);
130
+ const meta = this.extractMeta(data);
131
+ const hash = await this.resolveHash(data, meta);
132
+ return { updated: hash !== currentHash, meta, hash };
133
+ }
134
+ catch {
135
+ return { updated: false, meta: {}, hash: currentHash };
136
+ }
137
+ }
138
+ async refresh() {
139
+ const response = await this.fetchNoStore();
140
+ const data = await this.parser(response);
141
+ const meta = this.extractMeta(data);
142
+ const hash = await this.resolveHash(data, meta);
143
+ const result = { data, meta, source: 'network', hash };
144
+ await this.storeResult(result);
145
+ return result;
146
+ }
147
+ async loadFromStore() {
148
+ if (!this.options.store) {
149
+ return null;
150
+ }
151
+ const cached = await this.options.store.get(this.cacheKey);
152
+ if (!cached) {
153
+ return null;
154
+ }
155
+ if (this.options.schemaVersion) {
156
+ const cachedSchema = cached.meta.schemaVersion;
157
+ if (cachedSchema !== this.options.schemaVersion) {
158
+ await this.options.store.remove(this.cacheKey);
159
+ return null;
160
+ }
161
+ }
162
+ return cached;
163
+ }
164
+ async storeResult(result) {
165
+ if (!this.options.store) {
166
+ return;
167
+ }
168
+ await this.options.store.set(this.cacheKey, result);
169
+ }
170
+ extractMeta(data) {
171
+ const meta = data.meta;
172
+ if (!meta?.hash) {
173
+ throw new Error('Runtime config missing required meta.hash');
174
+ }
175
+ return meta;
176
+ }
177
+ async resolveHash(data, meta) {
178
+ return meta.hash ?? this.hashValue(data);
179
+ }
180
+ async hashValue(data) {
181
+ const value = JSON.stringify(data);
182
+ if (typeof crypto?.subtle?.digest === 'function') {
183
+ const encoded = new TextEncoder().encode(value);
184
+ const buffer = await crypto.subtle.digest('SHA-256', encoded);
185
+ return this.bufferToHex(buffer);
186
+ }
187
+ let hash = 0;
188
+ for (let i = 0; i < value.length; i += 1) {
189
+ hash = (hash * 31 + value.charCodeAt(i)) >>> 0;
190
+ }
191
+ return `fallback-${hash.toString(16)}`;
192
+ }
193
+ bufferToHex(buffer) {
194
+ const bytes = new Uint8Array(buffer);
195
+ let hex = '';
196
+ for (const byte of bytes) {
197
+ hex += byte.toString(16).padStart(2, '0');
198
+ }
199
+ return hex;
200
+ }
201
+ buildCacheKey() {
202
+ const prefix = this.options.appId ? `${this.options.appId}:` : '';
203
+ const schema = this.options.schemaVersion ? `:schema:${this.options.schemaVersion}` : '';
204
+ return `${prefix}${this.options.resource}:${this.configPath}${schema}`;
205
+ }
206
+ async fetchNoStore() {
207
+ return this.httpClient.fetch(this.configPath, { cache: 'no-store' });
208
+ }
209
+ }
210
+
211
+ const DEFAULT_DB_NAME = 'sixbell-runtime-config';
212
+ class RuntimeConfigDexie extends Dexie {
213
+ configs;
214
+ constructor(dbName) {
215
+ super(dbName);
216
+ this.version(1).stores({
217
+ configs: 'key,updatedAt',
218
+ });
219
+ }
220
+ }
221
+ class RuntimeConfigStore {
222
+ cacheName;
223
+ db;
224
+ fallbackStore = new Map();
225
+ constructor(cacheName, appId, indexedDbName = DEFAULT_DB_NAME) {
226
+ this.cacheName = cacheName;
227
+ const resolvedDbName = appId ? `${DEFAULT_DB_NAME}:${appId}` : indexedDbName;
228
+ if (typeof indexedDB === 'undefined') {
229
+ this.db = undefined;
230
+ return;
231
+ }
232
+ this.db = new RuntimeConfigDexie(resolvedDbName);
233
+ }
234
+ async get(key) {
235
+ if (!this.db) {
236
+ return this.fallbackStore.get(key) ?? null;
237
+ }
238
+ const entry = await this.db.configs.get(this.buildKey(key));
239
+ return entry?.payload ?? null;
240
+ }
241
+ async set(key, value) {
242
+ if (!this.db) {
243
+ this.fallbackStore.set(key, value);
244
+ return;
245
+ }
246
+ await this.db.configs.put({
247
+ key: this.buildKey(key),
248
+ payload: value,
249
+ updatedAt: Date.now(),
250
+ });
251
+ }
252
+ async remove(key) {
253
+ if (!this.db) {
254
+ this.fallbackStore.delete(key);
255
+ return;
256
+ }
257
+ await this.db.configs.delete(this.buildKey(key));
258
+ }
259
+ buildKey(key) {
260
+ return `${this.cacheName}:${key}`;
261
+ }
262
+ }
263
+
264
+ class RuntimeUpdateAdapter {
265
+ handler;
266
+ eventSource;
267
+ streamSubscription;
268
+ constructor(handler) {
269
+ this.handler = handler;
270
+ }
271
+ connectSse(url, options) {
272
+ this.disconnectSse();
273
+ this.eventSource = new EventSource(url, { withCredentials: options.withCredentials });
274
+ const eventType = options.eventType ?? 'message';
275
+ this.eventSource.addEventListener(eventType, (event) => {
276
+ const message = event;
277
+ const parsed = this.parseMessage(message, options);
278
+ if (parsed) {
279
+ this.handler(parsed, 'sse');
280
+ }
281
+ });
282
+ if (this.eventSource) {
283
+ this.eventSource.onerror = null;
284
+ }
285
+ this.eventSource.addEventListener('error', () => {
286
+ options.logger?.debug('Runtime update stream disconnected', {
287
+ component: 'RuntimeUpdateAdapter',
288
+ action: 'connectSse',
289
+ url,
290
+ });
291
+ });
292
+ }
293
+ connectStream(stream) {
294
+ this.disconnectStream();
295
+ this.streamSubscription = stream.subscribe((event) => {
296
+ this.handler(event, 'stream');
297
+ });
298
+ }
299
+ disconnect() {
300
+ this.disconnectSse();
301
+ this.disconnectStream();
302
+ }
303
+ disconnectSse() {
304
+ if (this.eventSource) {
305
+ this.eventSource.close();
306
+ this.eventSource = undefined;
307
+ }
308
+ }
309
+ disconnectStream() {
310
+ this.streamSubscription?.unsubscribe();
311
+ this.streamSubscription = undefined;
312
+ }
313
+ parseMessage(event, options) {
314
+ if (options.transform) {
315
+ return options.transform(event);
316
+ }
317
+ if (!event.data) {
318
+ return { resource: options.resource };
319
+ }
320
+ try {
321
+ const parsed = JSON.parse(event.data);
322
+ return parsed;
323
+ }
324
+ catch {
325
+ options.logger?.warn('Failed to parse runtime update event', {
326
+ component: 'RuntimeUpdateAdapter',
327
+ action: 'parseMessage',
328
+ });
329
+ return { resource: options.resource };
330
+ }
331
+ }
332
+ }
333
+
334
+ /**
335
+ * Generated bundle index. Do not edit.
336
+ */
337
+
338
+ export { RuntimeConfigLoader, RuntimeConfigStore, RuntimeHttpClient, RuntimeUpdateAdapter };
339
+ //# sourceMappingURL=sixbell-telco-sdk-utils-runtime-config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sixbell-telco-sdk-utils-runtime-config.mjs","sources":["../../../projects/sdk/utils/runtime-config/src/http-client.ts","../../../projects/sdk/utils/runtime-config/src/runtime-config-loader.ts","../../../projects/sdk/utils/runtime-config/src/runtime-config-store.ts","../../../projects/sdk/utils/runtime-config/src/runtime-update-adapter.ts","../../../projects/sdk/utils/runtime-config/sixbell-telco-sdk-utils-runtime-config.ts"],"sourcesContent":["export interface HttpClientOptions {\n\tretries?: number;\n\tretryDelayMs?: number;\n\ttimeoutMs?: number;\n}\n\nexport class RuntimeHttpClient {\n\tconstructor(private readonly options: HttpClientOptions = {}) {}\n\n\tasync fetch(url: string, init?: RequestInit): Promise<Response> {\n\t\tconst retries = this.options.retries ?? 0;\n\t\tconst retryDelayMs = this.options.retryDelayMs ?? 0;\n\t\tconst timeoutMs = this.options.timeoutMs ?? 0;\n\t\tlet lastError: Error | null = null;\n\n\t\tfor (let attempt = 0; attempt <= retries; attempt += 1) {\n\t\t\ttry {\n\t\t\t\treturn await this.attemptFetch(url, init, timeoutMs);\n\t\t\t} catch (error) {\n\t\t\t\tlastError = error instanceof Error ? error : new Error(String(error));\n\t\t\t\tif (attempt < retries && retryDelayMs > 0) {\n\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, retryDelayMs));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthrow lastError ?? new Error('Failed to fetch');\n\t}\n\n\tprivate async attemptFetch(url: string, init: RequestInit | undefined, timeoutMs: number): Promise<Response> {\n\t\tif (!timeoutMs || timeoutMs <= 0) {\n\t\t\tconst response = await fetch(url, init);\n\t\t\tif (!response.ok) {\n\t\t\t\tthrow new Error(`HTTP ${response.status}: ${response.statusText}`);\n\t\t\t}\n\t\t\treturn response;\n\t\t}\n\n\t\tconst controller = new AbortController();\n\t\tconst timeoutHandle = setTimeout(() => controller.abort(), timeoutMs);\n\t\ttry {\n\t\t\tconst response = await fetch(url, {\n\t\t\t\t...init,\n\t\t\t\tsignal: controller.signal,\n\t\t\t});\n\t\t\tif (!response.ok) {\n\t\t\t\tthrow new Error(`HTTP ${response.status}: ${response.statusText}`);\n\t\t\t}\n\t\t\treturn response;\n\t\t} finally {\n\t\t\tclearTimeout(timeoutHandle);\n\t\t}\n\t}\n}\n","import { RuntimeHttpClient } from './http-client';\nimport type { RuntimeConfigCheckResult, RuntimeConfigLoadResult, RuntimeConfigLoaderOptions, RuntimeConfigMeta } from './types';\n\nconst DEFAULT_RETRIES = 2;\nconst DEFAULT_RETRY_DELAY_MS = 400;\nconst DEFAULT_TIMEOUT_MS = 8000;\n\nexport class RuntimeConfigLoader<T> {\n\tprivate readonly httpClient: RuntimeHttpClient;\n\tprivate readonly parser: (response: Response) => Promise<T>;\n\tprivate readonly cacheKey: string;\n\n\tconstructor(\n\t\tprivate readonly configPath: string,\n\t\tprivate readonly options: RuntimeConfigLoaderOptions<T>,\n\t\tprivate readonly retries = DEFAULT_RETRIES,\n\t\tprivate readonly retryDelayMs = DEFAULT_RETRY_DELAY_MS,\n\t\tprivate readonly timeoutMs = DEFAULT_TIMEOUT_MS,\n\t) {\n\t\tthis.httpClient = new RuntimeHttpClient({\n\t\t\tretries: this.retries,\n\t\t\tretryDelayMs: this.retryDelayMs,\n\t\t\ttimeoutMs: this.timeoutMs,\n\t\t});\n\t\tthis.parser = options.parser ?? (async (response: Response) => (await response.json()) as T);\n\t\tthis.cacheKey = this.buildCacheKey();\n\t}\n\n\tasync loadLatest(): Promise<RuntimeConfigLoadResult<T>> {\n\t\tconst logger = this.options.logger;\n\t\tconst cached = await this.loadFromStore();\n\t\tif (cached) {\n\t\t\tlogger?.debug('Runtime config loaded from cache', {\n\t\t\t\tcomponent: 'RuntimeConfigLoader',\n\t\t\t\taction: 'loadLatest',\n\t\t\t\tresource: this.options.resource,\n\t\t\t\tconfigPath: this.configPath,\n\t\t\t\tmeta: cached.meta,\n\t\t\t});\n\t\t\treturn { ...cached, source: 'cache' };\n\t\t}\n\t\ttry {\n\t\t\tconst response = await this.fetchNoStore();\n\t\t\tconst data = await this.parser(response);\n\t\t\tconst meta = this.extractMeta(data);\n\t\t\tconst hash = await this.resolveHash(data, meta);\n\t\t\tconst result: RuntimeConfigLoadResult<T> = { data, meta, source: 'network', hash };\n\t\t\tawait this.storeResult(result);\n\t\t\tlogger?.debug('Runtime config loaded', {\n\t\t\t\tcomponent: 'RuntimeConfigLoader',\n\t\t\t\taction: 'loadLatest',\n\t\t\t\tresource: this.options.resource,\n\t\t\t\tconfigPath: this.configPath,\n\t\t\t\tmeta,\n\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tlogger?.warn('Runtime config load failed, falling back', {\n\t\t\t\tcomponent: 'RuntimeConfigLoader',\n\t\t\t\taction: 'loadLatest',\n\t\t\t\tresource: this.options.resource,\n\t\t\t\tconfigPath: this.configPath,\n\t\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\t});\n\t\t\tconst fallback = this.options.fallbackData;\n\t\t\ttry {\n\t\t\t\tconst meta = this.extractMeta(fallback);\n\t\t\t\tconst hash = await this.resolveHash(fallback, meta);\n\t\t\t\treturn { data: fallback, meta, source: 'fallback', hash };\n\t\t\t} catch {\n\t\t\t\treturn { data: fallback, meta: {}, source: 'fallback', hash: '' };\n\t\t\t}\n\t\t}\n\t}\n\n\tasync checkForUpdates(currentHash: string): Promise<RuntimeConfigCheckResult> {\n\t\ttry {\n\t\t\tconst response = await this.fetchNoStore();\n\t\t\tconst data = await this.parser(response);\n\t\t\tconst meta = this.extractMeta(data);\n\t\t\tconst hash = await this.resolveHash(data, meta);\n\t\t\treturn { updated: hash !== currentHash, meta, hash };\n\t\t} catch {\n\t\t\treturn { updated: false, meta: {}, hash: currentHash };\n\t\t}\n\t}\n\n\tasync refresh(): Promise<RuntimeConfigLoadResult<T>> {\n\t\tconst response = await this.fetchNoStore();\n\t\tconst data = await this.parser(response);\n\t\tconst meta = this.extractMeta(data);\n\t\tconst hash = await this.resolveHash(data, meta);\n\t\tconst result: RuntimeConfigLoadResult<T> = { data, meta, source: 'network', hash };\n\t\tawait this.storeResult(result);\n\t\treturn result;\n\t}\n\n\tprivate async loadFromStore(): Promise<RuntimeConfigLoadResult<T> | null> {\n\t\tif (!this.options.store) {\n\t\t\treturn null;\n\t\t}\n\t\tconst cached = await this.options.store.get(this.cacheKey);\n\t\tif (!cached) {\n\t\t\treturn null;\n\t\t}\n\t\tif (this.options.schemaVersion) {\n\t\t\tconst cachedSchema = cached.meta.schemaVersion;\n\t\t\tif (cachedSchema !== this.options.schemaVersion) {\n\t\t\t\tawait this.options.store.remove(this.cacheKey);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\treturn cached;\n\t}\n\n\tprivate async storeResult(result: RuntimeConfigLoadResult<T>): Promise<void> {\n\t\tif (!this.options.store) {\n\t\t\treturn;\n\t\t}\n\t\tawait this.options.store.set(this.cacheKey, result);\n\t}\n\n\tprivate extractMeta(data: T): RuntimeConfigMeta {\n\t\tconst meta = (data as { meta?: RuntimeConfigMeta }).meta;\n\t\tif (!meta?.hash) {\n\t\t\tthrow new Error('Runtime config missing required meta.hash');\n\t\t}\n\t\treturn meta;\n\t}\n\n\tprivate async resolveHash(data: T, meta: RuntimeConfigMeta): Promise<string> {\n\t\treturn meta.hash ?? this.hashValue(data);\n\t}\n\n\tprivate async hashValue(data: T): Promise<string> {\n\t\tconst value = JSON.stringify(data);\n\t\tif (typeof crypto?.subtle?.digest === 'function') {\n\t\t\tconst encoded = new TextEncoder().encode(value);\n\t\t\tconst buffer = await crypto.subtle.digest('SHA-256', encoded);\n\t\t\treturn this.bufferToHex(buffer);\n\t\t}\n\t\tlet hash = 0;\n\t\tfor (let i = 0; i < value.length; i += 1) {\n\t\t\thash = (hash * 31 + value.charCodeAt(i)) >>> 0;\n\t\t}\n\t\treturn `fallback-${hash.toString(16)}`;\n\t}\n\n\tprivate bufferToHex(buffer: ArrayBuffer): string {\n\t\tconst bytes = new Uint8Array(buffer);\n\t\tlet hex = '';\n\t\tfor (const byte of bytes) {\n\t\t\thex += byte.toString(16).padStart(2, '0');\n\t\t}\n\t\treturn hex;\n\t}\n\n\tprivate buildCacheKey(): string {\n\t\tconst prefix = this.options.appId ? `${this.options.appId}:` : '';\n\t\tconst schema = this.options.schemaVersion ? `:schema:${this.options.schemaVersion}` : '';\n\t\treturn `${prefix}${this.options.resource}:${this.configPath}${schema}`;\n\t}\n\n\tprivate async fetchNoStore(): Promise<Response> {\n\t\treturn this.httpClient.fetch(this.configPath, { cache: 'no-store' });\n\t}\n}\n","import Dexie, { Table } from 'dexie';\nimport type { RuntimeConfigLoadResult, RuntimeConfigStoreContract } from './types';\n\nconst DEFAULT_DB_NAME = 'sixbell-runtime-config';\n\ninterface RuntimeConfigRecord<T> {\n\tkey: string;\n\tpayload: RuntimeConfigLoadResult<T>;\n\tupdatedAt: number;\n}\n\nclass RuntimeConfigDexie<T> extends Dexie {\n\tconfigs!: Table<RuntimeConfigRecord<T>, string>;\n\n\tconstructor(dbName: string) {\n\t\tsuper(dbName);\n\t\tthis.version(1).stores({\n\t\t\tconfigs: 'key,updatedAt',\n\t\t});\n\t}\n}\n\nexport class RuntimeConfigStore<T> implements RuntimeConfigStoreContract<T> {\n\tprivate readonly db?: RuntimeConfigDexie<T>;\n\tprivate readonly fallbackStore = new Map<string, RuntimeConfigLoadResult<T>>();\n\n\tconstructor(\n\t\tprivate readonly cacheName: string,\n\t\tappId?: string,\n\t\tindexedDbName: string = DEFAULT_DB_NAME,\n\t) {\n\t\tconst resolvedDbName = appId ? `${DEFAULT_DB_NAME}:${appId}` : indexedDbName;\n\t\tif (typeof indexedDB === 'undefined') {\n\t\t\tthis.db = undefined;\n\t\t\treturn;\n\t\t}\n\t\tthis.db = new RuntimeConfigDexie<T>(resolvedDbName);\n\t}\n\n\tasync get(key: string): Promise<RuntimeConfigLoadResult<T> | null> {\n\t\tif (!this.db) {\n\t\t\treturn this.fallbackStore.get(key) ?? null;\n\t\t}\n\t\tconst entry = await this.db.configs.get(this.buildKey(key));\n\t\treturn entry?.payload ?? null;\n\t}\n\n\tasync set(key: string, value: RuntimeConfigLoadResult<T>): Promise<void> {\n\t\tif (!this.db) {\n\t\t\tthis.fallbackStore.set(key, value);\n\t\t\treturn;\n\t\t}\n\t\tawait this.db.configs.put({\n\t\t\tkey: this.buildKey(key),\n\t\t\tpayload: value,\n\t\t\tupdatedAt: Date.now(),\n\t\t});\n\t}\n\n\tasync remove(key: string): Promise<void> {\n\t\tif (!this.db) {\n\t\t\tthis.fallbackStore.delete(key);\n\t\t\treturn;\n\t\t}\n\t\tawait this.db.configs.delete(this.buildKey(key));\n\t}\n\n\tprivate buildKey(key: string): string {\n\t\treturn `${this.cacheName}:${key}`;\n\t}\n}\n","import type { Observable, Subscription } from 'rxjs';\nimport type { RuntimeUpdateAdapterOptions, RuntimeUpdateEvent, RuntimeUpdateSource } from './types';\n\nexport type RuntimeUpdateHandler = (event: RuntimeUpdateEvent, source: RuntimeUpdateSource) => void;\n\nexport class RuntimeUpdateAdapter {\n\tprivate eventSource?: EventSource;\n\tprivate streamSubscription?: Subscription;\n\n\tconstructor(private readonly handler: RuntimeUpdateHandler) {}\n\n\tconnectSse(url: string, options: RuntimeUpdateAdapterOptions): void {\n\t\tthis.disconnectSse();\n\t\tthis.eventSource = new EventSource(url, { withCredentials: options.withCredentials });\n\t\tconst eventType = options.eventType ?? 'message';\n\t\tthis.eventSource.addEventListener(eventType, (event) => {\n\t\t\tconst message = event as MessageEvent;\n\t\t\tconst parsed = this.parseMessage(message, options);\n\t\t\tif (parsed) {\n\t\t\t\tthis.handler(parsed, 'sse');\n\t\t\t}\n\t\t});\n\t\tif (this.eventSource) {\n\t\t\tthis.eventSource.onerror = null;\n\t\t}\n\t\tthis.eventSource.addEventListener('error', () => {\n\t\t\toptions.logger?.debug('Runtime update stream disconnected', {\n\t\t\t\tcomponent: 'RuntimeUpdateAdapter',\n\t\t\t\taction: 'connectSse',\n\t\t\t\turl,\n\t\t\t});\n\t\t});\n\t}\n\n\tconnectStream(stream: Observable<RuntimeUpdateEvent>): void {\n\t\tthis.disconnectStream();\n\t\tthis.streamSubscription = stream.subscribe((event) => {\n\t\t\tthis.handler(event, 'stream');\n\t\t});\n\t}\n\n\tdisconnect(): void {\n\t\tthis.disconnectSse();\n\t\tthis.disconnectStream();\n\t}\n\n\tprivate disconnectSse(): void {\n\t\tif (this.eventSource) {\n\t\t\tthis.eventSource.close();\n\t\t\tthis.eventSource = undefined;\n\t\t}\n\t}\n\n\tprivate disconnectStream(): void {\n\t\tthis.streamSubscription?.unsubscribe();\n\t\tthis.streamSubscription = undefined;\n\t}\n\n\tprivate parseMessage(event: MessageEvent, options: RuntimeUpdateAdapterOptions): RuntimeUpdateEvent | null {\n\t\tif (options.transform) {\n\t\t\treturn options.transform(event);\n\t\t}\n\t\tif (!event.data) {\n\t\t\treturn { resource: options.resource } as RuntimeUpdateEvent;\n\t\t}\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(event.data as string) as RuntimeUpdateEvent;\n\t\t\treturn parsed;\n\t\t} catch {\n\t\t\toptions.logger?.warn('Failed to parse runtime update event', {\n\t\t\t\tcomponent: 'RuntimeUpdateAdapter',\n\t\t\t\taction: 'parseMessage',\n\t\t\t});\n\t\t\treturn { resource: options.resource } as RuntimeUpdateEvent;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AC,KAAK,CAAC,IAAI,EAAE;AAChB,YAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAwB;;AAE5D,QAAA,IAAI;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAc,CAAuB;AACrE,YAAA,OAAO,MAAM;;AACZ,QAAA,MAAM;AACP,YAAA,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,sCAAsC,EAAE;AAC5D,gBAAA,SAAS,EAAE,sBAAsB;AACjC,gBAAA,MAAM,EAAE,cAAc;AACtB,aAAA,CAAC;AACF,YAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAwB;;;AAG7D;;AC5ED;;AAEG;;;;"}
@@ -57,7 +57,7 @@ class SyncUtils {
57
57
  let timeout;
58
58
  return (...args) => {
59
59
  clearTimeout(timeout);
60
- timeout = window.setTimeout(() => func(...args), wait);
60
+ timeout = globalThis.setTimeout(() => func(...args), wait);
61
61
  };
62
62
  }
63
63
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sixbell-telco-sdk-utils-sync.mjs","sources":["../../../projects/sdk/utils/sync/src/sync.ts","../../../projects/sdk/utils/sync/sixbell-telco-sdk-utils-sync.ts"],"sourcesContent":["/**\n * Async utility helpers for reliable DOM synchronization and timing control.\n * These utilities provide browser-native timing mechanisms that are more reliable\n * than hardcoded setTimeout values across different environments and platforms.\n */\nexport class SyncUtils {\n\t/**\n\t * Wait for next microtask (more reliable than setTimeout(0))\n\t * Useful for ensuring state updates are processed before DOM operations\n\t */\n\tstatic nextTick(): Promise<void> {\n\t\treturn new Promise((resolve) => queueMicrotask(resolve));\n\t}\n\n\t/**\n\t * Wait for next animation frame (better for DOM updates)\n\t * Ideal for synchronizing with browser rendering cycles\n\t */\n\tstatic nextFrame(): Promise<void> {\n\t\treturn new Promise((resolve) => requestAnimationFrame(() => resolve()));\n\t}\n\n\t/**\n\t * Wait for DOM element to be available\n\t * Useful for web components or dynamically created elements\n\t */\n\tstatic async waitForElement(selector: string, maxAttempts = 10): Promise<HTMLElement | null> {\n\t\tfor (let i = 0; i < maxAttempts; i++) {\n\t\t\tconst element = document.querySelector(selector) as HTMLElement;\n\t\t\tif (element) return element;\n\t\t\tawait this.nextFrame();\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Wait for a condition to be met with timeout\n\t * Generic utility for polling-based waiting\n\t */\n\tstatic async waitForCondition(\n\t\tcondition: () => boolean | Promise<boolean>,\n\t\tmaxAttempts = 20,\n\t\tdelayStrategy: 'tick' | 'frame' = 'tick',\n\t): Promise<boolean> {\n\t\tfor (let i = 0; i < maxAttempts; i++) {\n\t\t\tconst result = await condition();\n\t\t\tif (result) return true;\n\n\t\t\tif (delayStrategy === 'frame') {\n\t\t\t\tawait this.nextFrame();\n\t\t\t} else {\n\t\t\t\tawait this.nextTick();\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Debounce utility for preventing rapid successive calls\n\t * Returns a debounced version of the provided function\n\t */\n\tstatic debounce<T extends (...args: unknown[]) => unknown>(func: T, wait: number): (...args: Parameters<T>) => void {\n\t\tlet timeout: number | undefined;\n\t\treturn (...args: Parameters<T>): void => {\n\t\t\tclearTimeout(timeout);\n\t\t\ttimeout = window.setTimeout(() => func(...args), wait);\n\t\t};\n\t}\n\n\t/**\n\t * Throttle utility for limiting function execution frequency\n\t * Returns a throttled version of the provided function\n\t */\n\tstatic throttle<T extends (...args: unknown[]) => unknown>(func: T, limit: number): (...args: Parameters<T>) => void {\n\t\tlet inThrottle = false;\n\t\treturn (...args: Parameters<T>): void => {\n\t\t\tif (!inThrottle) {\n\t\t\t\tfunc(...args);\n\t\t\t\tinThrottle = true;\n\t\t\t\tsetTimeout(() => (inThrottle = false), limit);\n\t\t\t}\n\t\t};\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;;;AAIG;MACU,SAAS,CA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AAU;YACvC,YAAY,CAAC,OAAO,CAAC;AACrB,YAAA,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC;AACvD,SAAC;;AAGF;;;AAGG;AACH,IAAA,OAAO,QAAQ,CAA4C,IAAO,EAAE,KAAa,EAAA;QAChF,IAAI,UAAU,GAAG,KAAK;AACtB,QAAA,OAAO,CAAC,GAAG,IAAmB,KAAU;YACvC,IAAI,CAAC,UAAU,EAAE;AAChB,gBAAA,IAAI,CAAC,GAAG,IAAI,CAAC;gBACb,UAAU,GAAG,IAAI;AACjB,gBAAA,UAAU,CAAC,OAAO,UAAU,GAAG,KAAK,CAAC,EAAE,KAAK,CAAC;;AAE/C,SAAC;;AAEF;;ACnFD;;AAEG;;;;"}
1
+ {"version":3,"file":"sixbell-telco-sdk-utils-sync.mjs","sources":["../../../projects/sdk/utils/sync/src/sync.ts","../../../projects/sdk/utils/sync/sixbell-telco-sdk-utils-sync.ts"],"sourcesContent":["/**\n * Async utility helpers for reliable DOM synchronization and timing control.\n * These utilities provide browser-native timing mechanisms that are more reliable\n * than hardcoded setTimeout values across different environments and platforms.\n */\nexport class SyncUtils {\n\t/**\n\t * Wait for next microtask (more reliable than setTimeout(0))\n\t * Useful for ensuring state updates are processed before DOM operations\n\t */\n\tstatic nextTick(): Promise<void> {\n\t\treturn new Promise((resolve) => queueMicrotask(resolve));\n\t}\n\n\t/**\n\t * Wait for next animation frame (better for DOM updates)\n\t * Ideal for synchronizing with browser rendering cycles\n\t */\n\tstatic nextFrame(): Promise<void> {\n\t\treturn new Promise((resolve) => requestAnimationFrame(() => resolve()));\n\t}\n\n\t/**\n\t * Wait for DOM element to be available\n\t * Useful for web components or dynamically created elements\n\t */\n\tstatic async waitForElement(selector: string, maxAttempts = 10): Promise<HTMLElement | null> {\n\t\tfor (let i = 0; i < maxAttempts; i++) {\n\t\t\tconst element = document.querySelector(selector) as HTMLElement;\n\t\t\tif (element) return element;\n\t\t\tawait this.nextFrame();\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Wait for a condition to be met with timeout\n\t * Generic utility for polling-based waiting\n\t */\n\tstatic async waitForCondition(\n\t\tcondition: () => boolean | Promise<boolean>,\n\t\tmaxAttempts = 20,\n\t\tdelayStrategy: 'tick' | 'frame' = 'tick',\n\t): Promise<boolean> {\n\t\tfor (let i = 0; i < maxAttempts; i++) {\n\t\t\tconst result = await condition();\n\t\t\tif (result) return true;\n\n\t\t\tif (delayStrategy === 'frame') {\n\t\t\t\tawait this.nextFrame();\n\t\t\t} else {\n\t\t\t\tawait this.nextTick();\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Debounce utility for preventing rapid successive calls\n\t * Returns a debounced version of the provided function\n\t */\n\tstatic debounce<T extends (...args: unknown[]) => unknown>(func: T, wait: number): (...args: Parameters<T>) => void {\n\t\tlet timeout: ReturnType<typeof setTimeout> | undefined;\n\t\treturn (...args: Parameters<T>): void => {\n\t\t\tclearTimeout(timeout);\n\t\t\ttimeout = globalThis.setTimeout(() => func(...args), wait);\n\t\t};\n\t}\n\n\t/**\n\t * Throttle utility for limiting function execution frequency\n\t * Returns a throttled version of the provided function\n\t */\n\tstatic throttle<T extends (...args: unknown[]) => unknown>(func: T, limit: number): (...args: Parameters<T>) => void {\n\t\tlet inThrottle = false;\n\t\treturn (...args: Parameters<T>): void => {\n\t\t\tif (!inThrottle) {\n\t\t\t\tfunc(...args);\n\t\t\t\tinThrottle = true;\n\t\t\t\tsetTimeout(() => (inThrottle = false), limit);\n\t\t\t}\n\t\t};\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;;;AAIG;MACU,SAAS,CAAA;AACrB;;;AAGG;AACH,IAAA,OAAO,QAAQ,GAAA;AACd,QAAA,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,cAAc,CAAC,OAAO,CAAC,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