@ygracs/xepg-lib-js 0.0.21 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,35 @@
1
+ #### *v0.0.23*
2
+
3
+ Pre-release version.
4
+
5
+ > - update `xepgdoc-lib.md`;
6
+ > - update dependency on `@ygracs/bsfoc-lib-js` module to v0.2.3;
7
+ > - update dependency on `@ygracs/dtf-lib-js` module to v0.0.28;
8
+ > - update dependency on `@ygracs/xobj-lib-js` module to v0.2.2;
9
+ > - updated dependency on `@ygracs/bsfoc-lib-js` module to v0.0.5-b;
10
+ > - add dependency on `@cntwg/file-helper` module;
11
+ > - remove `$module/lib/file-helper.js`;
12
+ > - improve behavior for a getter of a `rating` property of a `TXEpgScheduleItem`-class;
13
+ > - add functions: readAsTagName, `readAsAttrName`, valueToElementID;
14
+ > - other fixes.
15
+
16
+ #### *v0.0.22*
17
+
18
+ Pre-release version.
19
+
20
+ > - update `xepgdoc-lib.md`;
21
+ > - add new `TXEpgScheduleItem` class;
22
+ > - add new `TXEpgChannelContainer` class;
23
+ > - add new `schedule` method to a `TXEpgSchedulesList` class;
24
+ > - add new `channel` method to a `TXEpgHeaderContainer` class;
25
+ > - add new `channel` method to a `TXEpgHeaderContainer` class;
26
+ > - add new `setType` method to a `TXEpgDTSProvider` class;
27
+ > - deprecate a `setChannelInfo` method of a `TXEpgHeaderContainer` class;
28
+ > - change name for a property `Provider` of a `TXEpgHeaderContainer` class into `provider`;
29
+ > - change name for a property `Header` of a `TXEpgContentProvider` class into `header`;
30
+ > - change name for a property `Provider` of a `TXEpgContentProvider` class into `provider`;
31
+ > - other fixes.
32
+
1
33
  #### *v0.0.21*
2
34
 
3
35
  Pre-release version.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- |***rev.*:**|0.0.7|
1
+ |***rev.*:**|0.0.9|
2
2
  |:---|---:|
3
- |***date***:|2025-02-28|
3
+ |***date***:|2025-03-06|
4
4
 
5
5
  ## Introduction
6
6
 
@@ -18,9 +18,11 @@ This module contains the following components:
18
18
 
19
19
  - classes:
20
20
 
21
+ + `TXEpgScheduleItem`;
21
22
  + `TXEpgSchedulesList`;
22
23
  + `TXEpgDTSProvider`;
23
24
  + `TXEpgProviderContainer`;
25
+ + `TXEpgChannelContainer`;
24
26
  + `TXEpgHeaderContainer`;
25
27
  + `TXEpgContentContainer`.
26
28
 
@@ -1,12 +1,12 @@
1
- |***rev.*:**|0.1.18|
1
+ |***rev.*:**|0.1.28|
2
2
  |:---|---:|
3
- |***date***:|2025-02-27|
3
+ |***date***:|2025-04-24|
4
4
 
5
5
  ## Introduction
6
6
 
7
7
  This paper describes a constants and an object classes provided by `xepgdoc-lib.js` module.
8
8
 
9
- ### Base type definitions
9
+ ## Base type definitions
10
10
 
11
11
  This section contains some definitions for a general types of the objects (e.g. options set) that frequently used in a function or a class method descriptions.
12
12
 
@@ -55,16 +55,183 @@ This descriptor is an `object` that describes a content provider.
55
55
 
56
56
  | property name | value type | optional | description |
57
57
  |:---|---|---:|:---|
58
- | `time` | `number` | a schedule start time |
59
- | `title` | `string` | a schedule title |
60
- | `cat` | `string` | a schedule category |
61
- | `pcmark` | `number` | a schedule rating |
62
- | `descr` | `string` | a schedule description |
58
+ | `time` | `number` | no | a schedule start time |
59
+ | `title` | `string` | no | a schedule title |
60
+ | `cat` | `string` | yes | a schedule category |
61
+ | `pcmark` | `number` | yes | a schedule rating |
62
+ | `descr` | `string` | yes | a schedule description |
63
63
 
64
64
  ## Module constants
65
65
 
66
+ ## Module functions
67
+
68
+ ### Experimental functions
69
+
70
+ > Note: Purpose of those functions will be discussed and some may be deprecate and make obsolete or functionality may be altered. So use it with cautions in mind.
71
+
72
+ <a name="readAsTagName"></a>
73
+ #### **readAsTagName(value)** => `string`
74
+
75
+ > since: \[`v0.0.23`]
76
+
77
+ This function tries to convert a given `value` to the value of type which is suitable for an XML-element's tag name. If failed an empty string is returned.
78
+
79
+ | parameter name | value type | default value | description |
80
+ |:---|---|---:|:---|
81
+ | `value` | `any` | --- | some value to read |
82
+
83
+ <a name="readAsAttrName"></a>
84
+ #### **readAsAttrName(value)** => `string`
85
+
86
+ > since: \[`v0.0.23`]
87
+
88
+ This function tries to convert a given `value` to the value of type which is suitable for an XML-element's attribute name. If failed an empty string is returned.
89
+
90
+ | parameter name | value type | default value | description |
91
+ |:---|---|---:|:---|
92
+ | `value` | `any` | --- | some value to read |
93
+
94
+ <a name="valueToElementID"></a>
95
+ #### **valueToElementID(value)**
96
+
97
+ > since: \[`v0.0.23`]
98
+
99
+ This function tries to convert a given `value` to the value of a valid identifier which is suitable for an XML-element's ID-attribute. If failed an empty string is returned.
100
+
101
+ | parameter name | value type | default value | description |
102
+ |:---|---|---:|:---|
103
+ | `value` | `any` | --- | some value to read |
104
+
66
105
  ## Module classes
67
106
 
107
+ <a name="TXEpgScheduleItem"></a>
108
+ ### **TXEpgScheduleItem**
109
+
110
+ > since: `v0.0.22`
111
+
112
+ This class provides a functionality for handle an EPG-schedule element.
113
+
114
+ #### class constructor
115
+
116
+ The class constructor creates a new instance of the class.
117
+
118
+ ##### constructor parameters
119
+
120
+ The class constructor receives arguments listed below:
121
+
122
+ | parameter name | value type | default value | description |
123
+ |:---|---|---:|:---|
124
+ |`object`|`object`|---|a host object|
125
+ |`options`|`object`|---|an options settings|
126
+
127
+ #### class properties
128
+
129
+ <a name="TXEpgScheduleItem+time"></a>
130
+ ##### **time**
131
+
132
+ | property type | read only | description |
133
+ |---|---|:---|
134
+ | `number` | yes | contains a schedule start time value as a timestamp |
135
+
136
+ <a name="TXEpgScheduleItem+title"></a>
137
+ ##### **title**
138
+
139
+ | property type | read only | description |
140
+ |---|---|:---|
141
+ | `string` | yes | contains a schedule title |
142
+
143
+ <a name="TXEpgScheduleItem+category"></a>
144
+ ##### **category**
145
+
146
+ | property type | read only | description |
147
+ |---|---|:---|
148
+ | `string` | yes | contains a schedule category |
149
+
150
+ <a name="TXEpgScheduleItem+rating"></a>
151
+ ##### **rating**
152
+
153
+ | property type | read only | description |
154
+ |---|---|:---|
155
+ | `number` | yes | contains a schedule rating value (*aka pcmark*) |
156
+
157
+ <a name="TXEpgScheduleItem+descr"></a>
158
+ ##### **descr**
159
+
160
+ | property type | read only | description |
161
+ |---|---|:---|
162
+ | `string` | yes | contains a schedule description |
163
+
164
+ <a name="TXEpgScheduleItem+dtstype"></a>
165
+ ##### **dtstype**
166
+
167
+ | property type | read only | description |
168
+ |---|---|:---|
169
+ | `number` | yes | contains a "dtstype"-value |
170
+
171
+ <a name="TXEpgScheduleItem+curDocTZ"></a>
172
+ ##### **curDocTZ**
173
+
174
+ | property type | read only | description |
175
+ |---|---|:---|
176
+ | `number` | yes | contains a current TimeZone |
177
+
178
+ #### class methods
179
+
180
+ <a name="TXEpgScheduleItem+getInfo"></a>
181
+ ##### **getInfo()** => `xepgShedInfoDesc`
182
+
183
+ This method returns an object that contains a schedule information.
184
+
185
+ <a name="TXEpgScheduleItem+setTime"></a>
186
+ ##### **setTime(value)** => `boolean`
187
+
188
+ This method tries to set a schedule start time. If succeed `true` returned.
189
+
190
+ | parameter name | value type | default value | description |
191
+ |:---|---|---:|:---|
192
+ | `value` | `number`, `string`, `Date` | --- | some value |
193
+
194
+ <a name="TXEpgScheduleItem+setTitle"></a>
195
+ ##### **setTitle(value)** => `boolean`
196
+
197
+ This method tries to set a schedule title. If succeed `true` returned.
198
+
199
+ | parameter name | value type | default value | description |
200
+ |:---|---|---:|:---|
201
+ | `value` | `string` | --- | some value |
202
+
203
+ <a name="TXEpgScheduleItem+setCategory"></a>
204
+ ##### **setCategory(value)** => `boolean`
205
+
206
+ This method tries to set a schedule category. If succeed `true` returned.
207
+
208
+ | parameter name | value type | default value | description |
209
+ |:---|---|---:|:---|
210
+ | `value` | `string` | --- | some value |
211
+
212
+ <a name="TXEpgScheduleItem+setRating"></a>
213
+ ##### **setRating(value)** => `boolean`
214
+
215
+ This method tries to set a schedule rating. If succeed `true` returned.
216
+
217
+ | parameter name | value type | default value | description |
218
+ |:---|---|---:|:---|
219
+ | `value` | `number`, `string` | --- | some rating value |
220
+
221
+ <a name="TXEpgScheduleItem+setDescr"></a>
222
+ ##### **setDescr(value)** => `boolean`
223
+
224
+ This method tries to set a schedule description. If succeed `true` returned.
225
+
226
+ | parameter name | value type | default value | description |
227
+ |:---|---|---:|:---|
228
+ | `value` | `string` | --- | some value |
229
+
230
+ <a name="TXEpgScheduleItem+saveToXMLString"></a>
231
+ ##### **saveToXMLString()** => `string`
232
+
233
+ This method saves an element content to a string in an XML-format.
234
+
68
235
  <a name="TXEpgSchedulesList"></a>
69
236
  ### **TXEpgSchedulesList**
70
237
 
@@ -85,8 +252,6 @@ The class constructor receives arguments listed below:
85
252
 
86
253
  #### class properties
87
254
 
88
- The table below describes a properties of a `TXEpgSchedulesList` class:
89
-
90
255
  <a name="TXEpgSchedulesList+schedQty"></a>
91
256
  ##### **schedQty**
92
257
 
@@ -135,6 +300,17 @@ This method checks if a given `value` represents a valid schedule index and if s
135
300
  |:---|---|---:|:---|
136
301
  | `value` | `number`, `string` | --- | a value to be verified |
137
302
 
303
+ <a name="TXEpgSchedulesList+schedule"></a>
304
+ ##### **schedule(index)** => `TXEpgScheduleItem`
305
+
306
+ > since: `v0.0.22`
307
+
308
+ This method returns an object that contains a schedule element.
309
+
310
+ | parameter name | value type | default value | description |
311
+ |:---|---|---:|:---|
312
+ | `index` | `number`, `string` | --- | an element index |
313
+
138
314
  <a name="TXEpgSchedulesList+getScheduleInfo"></a>
139
315
  ##### **getScheduleInfo(index)** => `xepgShedInfoDesc`
140
316
 
@@ -250,9 +426,86 @@ This method saves an element content to a string.
250
426
 
251
427
  ##### **init()**
252
428
 
429
+ <a name="TXEpgChannelContainer"></a>
430
+ ### **TXEpgChannelContainer**
431
+
432
+ > since: `v0.0.22`
433
+
434
+ This class provides a functionality for handle an EPG-channel element.
435
+
436
+ #### class constructor
437
+
438
+ The class constructor creates a new instance of the class.
439
+
440
+ ##### constructor parameters
441
+
442
+ The class constructor receives arguments listed below:
443
+
444
+ | parameter name | value type | default value | description |
445
+ |:---|---|---:|:---|
446
+ |`object`|`object`|---|a host object|
447
+ |`options`|`object`|---|an options settings|
448
+
449
+ #### class properties
450
+
451
+ <a name="TXEpgChannelContainer+id"></a>
452
+ ##### **id**
453
+
454
+ | property type | read only | description |
455
+ |---|---|:---|
456
+ | `string` | yes | contains a channel ID |
457
+
458
+ <a name="TXEpgChannelContainer+name"></a>
459
+ ##### **name**
460
+
461
+ | property type | read only | description |
462
+ |---|---|:---|
463
+ | `string` | no | contains a channel name |
464
+
465
+ <a name="TXEpgChannelContainer+gid"></a>
466
+ ##### **gid**
467
+
468
+ | property type | read only | description |
469
+ |---|---|:---|
470
+ | `string` | no | contains a channel group ID |
471
+
472
+ <a name="TXEpgChannelContainer+url"></a>
473
+ ##### **url**
474
+
475
+ | property type | read only | description |
476
+ |---|---|:---|
477
+ | `string` | no | contains a channel URL |
478
+
479
+ #### class methods
480
+
481
+ <a name="TXEpgChannelContainer+setID"></a>
482
+ ##### **setID(value)** => `boolean`
483
+
484
+ This method tries to set a channel ID. If succeed `true` returned.
485
+
486
+ | parameter name | value type | default value | description |
487
+ |:---|---|---:|:---|
488
+ | `value` | `string` | --- | some value |
489
+
490
+ <a name="TXEpgChannelContainer+getInfo"></a>
491
+ ##### **getInfo()** => `xepgChnInfoDesc`
492
+
493
+ This method returns a channel info descriptor.
494
+
495
+ <a name="TXEpgChannelContainer+setInfo"></a>
496
+ ##### **setInfo(value)** => `void`
497
+
498
+ This method tries to load a channel info.
499
+
500
+ | parameter name | value type | default value | description |
501
+ |:---|---|---:|:---|
502
+ | `value` | `string`, `xepgChnInfoDesc` | --- | some value |
503
+
253
504
  <a name="TXEpgDTSProvider"></a>
254
505
  ### **TXEpgDTSProvider**
255
506
 
507
+ This class provides a functionality for handle a DTS-provider element.
508
+
256
509
  #### class constructor
257
510
 
258
511
  The class constructor creates a new instance of the class.
@@ -288,9 +541,24 @@ The `options` structure is listed below:
288
541
  |---|---|:---|
289
542
  | `number` | no | defines a current TimeZone |
290
543
 
544
+ #### class methods
545
+
546
+ <a name="TXEpgDTSProvider+setType"></a>
547
+ ##### **setType(value)** => `boolean`
548
+
549
+ > since: `v0.0.22`
550
+
551
+ This method tries to set a provider type.
552
+
553
+ | parameter name | value type | default value | description |
554
+ |:---|---|---:|:---|
555
+ | `value` | `number`, `string` | --- | a "dtstype"-value |
556
+
291
557
  <a name="TXEpgHeaderContainer"></a>
292
558
  ### **TXEpgHeaderContainer**
293
559
 
560
+ This class provides a functionality for handle a EPG-header element.
561
+
294
562
  #### class constructor
295
563
 
296
564
  The class constructor creates a new instance of the class.
@@ -336,9 +604,25 @@ The `options` structure is listed below:
336
604
  <a name="TXEpgHeaderContainer+Provider"></a>
337
605
  ##### **Provider**
338
606
 
607
+ > \[!] NOTE: `[since v0.0.22]` deprecated. Use [`provider` property](#TXEpgHeaderContainer+provider) instead.
608
+
609
+ <a name="TXEpgHeaderContainer+provider"></a>
610
+ ##### **provider**
611
+
612
+ > since: `v0.0.22`
613
+
339
614
  | property type | read only | description |
340
615
  |---|---|:---|
341
- | `TXEpgProviderContainer` | yes | returns a `TXEpgProviderContainer` |
616
+ | `TXEpgProviderContainer` | yes | returns a `TXEpgProviderContainer` instance |
617
+
618
+ <a name="TXEpgHeaderContainer+channel"></a>
619
+ ##### **channel**
620
+
621
+ > since: `v0.0.22`
622
+
623
+ | property type | read only | description |
624
+ |---|---|:---|
625
+ | `TXEpgChannelContainer` | yes | returns a `TXEpgChannelContainer` instance |
342
626
 
343
627
  #### class methods
344
628
 
@@ -383,6 +667,8 @@ An object contains the following fields:
383
667
  <a name="TXEpgHeaderContainer+setChannelInfo"></a>
384
668
  ##### **setChannelInfo(obj)** => `void`
385
669
 
670
+ > \[!] WARNING: `[since v0.0.22]` deprecated.
671
+
386
672
  This method fills a channel information with a given data.
387
673
 
388
674
  | parameter name | value type | default value | description |
@@ -449,30 +735,44 @@ The `options` structure is listed below:
449
735
  <a name="TXEpgContentProvider+Header"></a>
450
736
  ##### **Header**
451
737
 
738
+ > \[!] NOTE: `[since v0.0.22]` deprecated. Use [`header` property](#TXEpgContentProvider+header) instead.
739
+
740
+ <a name="TXEpgContentProvider+header"></a>
741
+ ##### **header**
742
+
743
+ > since: `v0.0.22`
744
+
452
745
  | property type | read only | description |
453
746
  |---|---|:---|
454
- | `TXEpgHeaderContainer` | yes | returns a `TXEpgHeaderContainer` |
747
+ | `TXEpgHeaderContainer` | yes | returns a `TXEpgHeaderContainer` instance |
455
748
 
456
749
  <a name="TXEpgContentProvider+Provider"></a>
457
750
  ##### **Provider**
458
751
 
752
+ > \[!] NOTE: `[since v0.0.22]` deprecated. Use [`provider` property](#TXEpgContentProvider+provider) instead.
753
+
754
+ <a name="TXEpgContentProvider+provider"></a>
755
+ ##### **provider**
756
+
757
+ > since: `v0.0.22`
758
+
459
759
  | property type | read only | description |
460
760
  |---|---|:---|
461
- | `TXEpgProviderContainer` | yes | returns a `TXEpgProviderContainer` |
761
+ | `TXEpgProviderContainer` | yes | returns a `TXEpgProviderContainer` instance |
462
762
 
463
763
  <a name="TXEpgContentProvider+dts"></a>
464
764
  ##### **dts**
465
765
 
466
766
  | property type | read only | description |
467
767
  |---|---|:---|
468
- | `TXEpgDTSProvider` | yes | returns a `TXEpgDTSProvider` |
768
+ | `TXEpgDTSProvider` | yes | returns a `TXEpgDTSProvider` instance |
469
769
 
470
770
  <a name="TXEpgContentProvider+SchedulesList"></a>
471
771
  ##### **SchedulesList**
472
772
 
473
773
  | property type | read only | description |
474
774
  |---|---|:---|
475
- | `TXEpgSchedulesList` | yes | returns a `TXEpgSchedulesList` |
775
+ | `TXEpgSchedulesList` | yes | returns a `TXEpgSchedulesList` instance |
476
776
 
477
777
  #### class methods
478
778
 
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
- // [v0.0.009-20250225]
1
+ // [v0.0.010-20250228]
2
2
 
3
3
  // === module init block ===
4
4
 
5
- const xepg_doc = require('./lib/xepgdoc-lib.js');
5
+ const xepgdoc = require('./lib/xepgdoc-lib.js');
6
6
 
7
7
  const xObj = require('@ygracs/xobj-lib-js');
8
8
 
@@ -13,14 +13,15 @@ const xObj = require('@ygracs/xobj-lib-js');
13
13
  // === module exports block ===
14
14
 
15
15
  /**/// v1 branch
16
- exports.TXEpgContentProvider = xepg_doc.TXEpgContentProvider;
17
- exports.TXEpgSchedulesList = xepg_doc.TXEpgSchedulesList;
18
- exports.TXEpgDTSProvider = xepg_doc.TXEpgDTSProvider;
19
- exports.TXEpgProviderContainer = xepg_doc.TXEpgProviderContainer;
20
- exports.TXEpgHeaderContainer = xepg_doc.TXEpgHeaderContainer;
16
+ module.exports.TXEpgContentProvider = xepgdoc.TXEpgContentProvider;
17
+ module.exports.TXEpgScheduleItem = xepgdoc.TXEpgScheduleItem;
18
+ module.exports.TXEpgSchedulesList = xepgdoc.TXEpgSchedulesList;
19
+ module.exports.TXEpgDTSProvider = xepgdoc.TXEpgDTSProvider;
20
+ module.exports.TXEpgProviderContainer = xepgdoc.TXEpgProviderContainer;
21
+ module.exports.TXEpgHeaderContainer = xepgdoc.TXEpgHeaderContainer;
21
22
 
22
23
  // re-export stuff from `@ygracs/xobj-lib-js` module
23
- exports.TXmlContentParseOptions = xObj.TXmlContentParseOptions;
24
+ module.exports.TXmlContentParseOptions = xObj.TXmlContentParseOptions;
24
25
 
25
26
  /**/// will deprecate
26
- exports.TXepgDTSProvider = xepg_doc.TXepgDTSProvider;
27
+ module.exports.TXepgDTSProvider = xepgdoc.TXepgDTSProvider;