@ygracs/xepg-lib-js 0.0.19 → 0.0.21
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 +26 -76
- package/LICENSE +1 -1
- package/README.md +10 -8
- package/doc/xepgdoc-lib.md +332 -83
- package/doc/xepgdoc-spec-draft.dtd +65 -0
- package/index.js +5 -2
- package/lib/dts-helper.js +81 -32
- package/lib/file-helper.js +278 -0
- package/lib/xepgdoc-lib.js +580 -301
- package/package.json +7 -5
package/doc/xepgdoc-lib.md
CHANGED
|
@@ -1,57 +1,151 @@
|
|
|
1
|
-
|***rev.*:**|0.
|
|
1
|
+
|***rev.*:**|0.1.18|
|
|
2
2
|
|:---|---:|
|
|
3
|
-
|***date***:|
|
|
3
|
+
|***date***:|2025-02-27|
|
|
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
|
|
10
|
+
|
|
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
|
+
|
|
13
|
+
<a name="typedef+fsoDescr"></a>
|
|
14
|
+
#### `fsoDescr` - descriptor
|
|
15
|
+
|
|
16
|
+
This descriptor is an `object` that describes a status for an operation with some FS-object (*e.g. object such as a file*).
|
|
17
|
+
|
|
18
|
+
| property name | value type | optional | description |
|
|
19
|
+
|:---|---|---:|:---|
|
|
20
|
+
| `isERR` | `boolean` | no | a flag which indicates whether an error was happen |
|
|
21
|
+
| `errCode` | `number` | yes | an error code |
|
|
22
|
+
| `errEvent` | `string` | no | an error event identifier |
|
|
23
|
+
| `errMsg` | `string` | no | an error message |
|
|
24
|
+
| `source` | `string` | no | path to a file |
|
|
25
|
+
| `content` | `any` | no | content |
|
|
26
|
+
|
|
27
|
+
<a name="typedef+xepgProvInfoDesc"></a>
|
|
28
|
+
#### `xepgProvInfoDesc` - descriptor
|
|
29
|
+
|
|
30
|
+
This descriptor is an `object` that describes a content provider.
|
|
31
|
+
|
|
32
|
+
| property name | value type | optional | description |
|
|
33
|
+
|:---|---|---:|:---|
|
|
34
|
+
| `name` | `string` | yes | a provider name |
|
|
35
|
+
| `version` | `string` | yes | a provider version |
|
|
36
|
+
| `schema` | `string` | no | a document schema version |
|
|
37
|
+
| `doctype` | `string` | no | a document type |
|
|
38
|
+
|
|
39
|
+
<a name="typedef+xepgChnInfoDesc"></a>
|
|
40
|
+
#### `xepgChnInfoDesc` - descriptor
|
|
41
|
+
|
|
42
|
+
This descriptor is an `object` that describes a channel info.
|
|
43
|
+
|
|
44
|
+
| property name | value type | optional | description |
|
|
45
|
+
|:---|---|---:|:---|
|
|
46
|
+
| `chnid` | `srting` | no | a channel ID |
|
|
47
|
+
| `chname` | `string` | no | a name of the channel |
|
|
48
|
+
| `chngid` | `string` | yes | a channel 'Group ID' |
|
|
49
|
+
| `srcurl` | `string` | yes | a link to source |
|
|
50
|
+
|
|
51
|
+
<a name="typedef+xepgShedInfoDesc"></a>
|
|
52
|
+
#### `xepgShedInfoDesc` - descriptor
|
|
53
|
+
|
|
54
|
+
This descriptor is an `object` that describes a content provider.
|
|
55
|
+
|
|
56
|
+
| property name | value type | optional | description |
|
|
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 |
|
|
63
|
+
|
|
9
64
|
## Module constants
|
|
10
65
|
|
|
11
66
|
## Module classes
|
|
12
67
|
|
|
68
|
+
<a name="TXEpgSchedulesList"></a>
|
|
13
69
|
### **TXEpgSchedulesList**
|
|
14
70
|
|
|
15
71
|
This class provides a functionality for handle an EPG-schedules list.
|
|
16
72
|
|
|
17
73
|
#### class constructor
|
|
18
74
|
|
|
19
|
-
The class constructor creates a new instance of the class.
|
|
75
|
+
The class constructor creates a new instance of the class.
|
|
20
76
|
|
|
21
|
-
|
|
77
|
+
##### constructor parameters
|
|
78
|
+
|
|
79
|
+
The class constructor receives arguments listed below:
|
|
80
|
+
|
|
81
|
+
| parameter name | value type | default value | description |
|
|
22
82
|
|:---|---|---:|:---|
|
|
23
|
-
|`object
|
|
83
|
+
|`object`|`array`|---|a host object|
|
|
24
84
|
|`options`|`object`|---|an options settings|
|
|
25
85
|
|
|
26
86
|
#### class properties
|
|
27
87
|
|
|
28
88
|
The table below describes a properties of a `TXEpgSchedulesList` class:
|
|
29
89
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
90
|
+
<a name="TXEpgSchedulesList+schedQty"></a>
|
|
91
|
+
##### **schedQty**
|
|
92
|
+
|
|
93
|
+
| property type | read only | description |
|
|
94
|
+
|---|---|:---|
|
|
95
|
+
| `number` | yes | contains a quantity of the elements the container holds |
|
|
96
|
+
|
|
97
|
+
<a name="TXEpgSchedulesList+dtstype"></a>
|
|
98
|
+
##### **dtstype**
|
|
99
|
+
|
|
100
|
+
| property type | read only | description |
|
|
101
|
+
|---|---|:---|
|
|
102
|
+
| `number` | yes | contains a "dtstype"-value |
|
|
103
|
+
|
|
104
|
+
<a name="TXEpgSchedulesList+curDocTZ"></a>
|
|
105
|
+
##### **curDocTZ**
|
|
106
|
+
|
|
107
|
+
| property type | read only | description |
|
|
108
|
+
|---|---|:---|
|
|
109
|
+
| `number` | yes | contains a current TimeZone |
|
|
35
110
|
|
|
36
111
|
#### class methods
|
|
37
112
|
|
|
38
|
-
|
|
113
|
+
<a name="TXEpgSchedulesList+hasNoSchedules"></a>
|
|
114
|
+
##### **hasNoSchedules()** => `boolean`
|
|
39
115
|
|
|
40
116
|
This method returns `true` if a document contains no schedules.
|
|
41
117
|
|
|
42
|
-
|
|
118
|
+
<a name="TXEpgSchedulesList+hasSchedules"></a>
|
|
119
|
+
##### **hasSchedules()** => `boolean`
|
|
43
120
|
|
|
44
121
|
This method returns `true` if a document contains at least one schedule.
|
|
45
122
|
|
|
46
|
-
##### **chkScheduleIndex(value)**
|
|
123
|
+
##### **chkScheduleIndex(value)** => `boolean`
|
|
124
|
+
|
|
125
|
+
> WARNING: This method deprecated (*since `v0.0.20`*). Use `chkIndex` instead.
|
|
126
|
+
|
|
127
|
+
<a name="TXEpgSchedulesList+chkIndex"></a>
|
|
128
|
+
##### **chkIndex(value)** => `boolean`
|
|
129
|
+
|
|
130
|
+
> since: `v0.0.20`
|
|
47
131
|
|
|
48
132
|
This method checks if a given `value` represents a valid schedule index and if so returns `true`.
|
|
49
133
|
|
|
50
|
-
|
|
134
|
+
| parameter name | value type | default value | description |
|
|
135
|
+
|:---|---|---:|:---|
|
|
136
|
+
| `value` | `number`, `string` | --- | a value to be verified |
|
|
137
|
+
|
|
138
|
+
<a name="TXEpgSchedulesList+getScheduleInfo"></a>
|
|
139
|
+
##### **getScheduleInfo(index)** => `xepgShedInfoDesc`
|
|
51
140
|
|
|
52
141
|
This method returns an object that contains a schedule information.
|
|
53
142
|
|
|
54
|
-
|
|
143
|
+
| parameter name | value type | default value | description |
|
|
144
|
+
|:---|---|---:|:---|
|
|
145
|
+
| `index` | `number`, `string` | --- | an element index |
|
|
146
|
+
|
|
147
|
+
<a name="TXEpgSchedulesList+getAllSchedulesInfo"></a>
|
|
148
|
+
##### **getAllSchedulesInfo()** => `xepgShedInfoDesc[]`
|
|
55
149
|
|
|
56
150
|
This method returns an array that contains an information for all available schedules.
|
|
57
151
|
|
|
@@ -59,18 +153,23 @@ This method returns an array that contains an information for all available sche
|
|
|
59
153
|
|
|
60
154
|
##### **asJSON()**
|
|
61
155
|
|
|
156
|
+
<a name="TXEpgProviderContainer"></a>
|
|
62
157
|
### **TXEpgProviderContainer**
|
|
63
158
|
|
|
64
159
|
This class implements a structure that holds an information about a program provider within which the content of the document was written.
|
|
65
160
|
|
|
66
161
|
#### class constructor
|
|
67
162
|
|
|
68
|
-
The class constructor creates a new instance of the class.
|
|
163
|
+
The class constructor creates a new instance of the class.
|
|
164
|
+
|
|
165
|
+
##### constructor parameters
|
|
166
|
+
|
|
167
|
+
The class constructor receives arguments listed below:
|
|
69
168
|
|
|
70
169
|
|name|type|default value|description|
|
|
71
170
|
|:---|---|---:|:---|
|
|
72
|
-
|`object
|
|
73
|
-
|`options
|
|
171
|
+
|`object`|`object`|---|a host object|
|
|
172
|
+
|`options`|`object`|---|an option settings|
|
|
74
173
|
|
|
75
174
|
The `options` structure is listed below:
|
|
76
175
|
|
|
@@ -80,38 +179,87 @@ The `options` structure is listed below:
|
|
|
80
179
|
|
|
81
180
|
#### class properties
|
|
82
181
|
|
|
83
|
-
|
|
182
|
+
<a name="TXEpgProviderContainer+name"></a>
|
|
183
|
+
##### **name**
|
|
184
|
+
|
|
185
|
+
| property type | read only | description |
|
|
186
|
+
|---|---|:---|
|
|
187
|
+
| `string` | no | contains a provider name |
|
|
188
|
+
|
|
189
|
+
<a name="TXEpgProviderContainer+version"></a>
|
|
190
|
+
##### **version**
|
|
191
|
+
|
|
192
|
+
| property type | read only | description |
|
|
193
|
+
|---|---|:---|
|
|
194
|
+
| `string` | no | contains a provider version string |
|
|
195
|
+
|
|
196
|
+
<a name="TXEpgProviderContainer+schema"></a>
|
|
197
|
+
##### **schema**
|
|
198
|
+
|
|
199
|
+
| property type | read only | description |
|
|
200
|
+
|---|---|:---|
|
|
201
|
+
| `string` | no | contains a document schema version |
|
|
84
202
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
203
|
+
<a name="TXEpgProviderContainer+doctype"></a>
|
|
204
|
+
##### **doctype**
|
|
205
|
+
|
|
206
|
+
| property type | read only | description |
|
|
207
|
+
|---|---|:---|
|
|
208
|
+
| `string` | no | contains a document type |
|
|
91
209
|
|
|
92
210
|
#### class methods
|
|
93
211
|
|
|
94
|
-
|
|
212
|
+
<a name="TXEpgProviderContainer+setName"></a>
|
|
213
|
+
##### **setName(value)** => `boolean`
|
|
95
214
|
|
|
96
215
|
This method sets a name of a provider to a given `value`.
|
|
97
216
|
|
|
98
|
-
|
|
217
|
+
| parameter name | value type | default value | description |
|
|
218
|
+
|:---|---|---:|:---|
|
|
219
|
+
| `value` | `string` | --- | provider name |
|
|
220
|
+
|
|
221
|
+
<a name="TXEpgProviderContainer+getInfo"></a>
|
|
222
|
+
##### **getInfo()** => `xepgProvInfoDesc`
|
|
99
223
|
|
|
100
|
-
This method returns an `object` that contains information about content provider.
|
|
224
|
+
This method returns an `object` that contains information about content provider. An object contains a field listed in the table below:
|
|
101
225
|
|
|
102
|
-
|
|
226
|
+
|property name|value type|description|
|
|
227
|
+
|:---|---|:---|
|
|
228
|
+
|`name`|`string`|a provider name|
|
|
229
|
+
|`version`|`string`|a provider version|
|
|
230
|
+
|`schema`|`string`|a document schema version|
|
|
231
|
+
|`doctype`|`string`|a document type|
|
|
232
|
+
|
|
233
|
+
<a name="TXEpgProviderContainer+setInfo"></a>
|
|
234
|
+
##### **setInfo(obj)** => `void`
|
|
103
235
|
|
|
104
236
|
This method loads information about content provider.
|
|
105
237
|
|
|
238
|
+
| parameter name | value type | default value | description |
|
|
239
|
+
|:---|---|---:|:---|
|
|
240
|
+
| `obj` | `xepgProvInfoDesc` | --- | provider info descriptor |
|
|
241
|
+
|
|
242
|
+
<a name="TXEpgProviderContainer+saveToXMLString"></a>
|
|
243
|
+
##### **saveToXMLString()** => `string`
|
|
244
|
+
|
|
245
|
+
> since: `v0.0.20`
|
|
246
|
+
|
|
247
|
+
This method saves an element content to a string.
|
|
248
|
+
|
|
106
249
|
#### class methods (*special*)
|
|
107
250
|
|
|
108
251
|
##### **init()**
|
|
109
252
|
|
|
253
|
+
<a name="TXEpgDTSProvider"></a>
|
|
110
254
|
### **TXEpgDTSProvider**
|
|
111
255
|
|
|
112
256
|
#### class constructor
|
|
113
257
|
|
|
114
|
-
The class constructor creates a new instance of the class.
|
|
258
|
+
The class constructor creates a new instance of the class.
|
|
259
|
+
|
|
260
|
+
##### constructor parameters
|
|
261
|
+
|
|
262
|
+
The class constructor receives arguments listed below:
|
|
115
263
|
|
|
116
264
|
|name|type|default value|description|
|
|
117
265
|
|:---|---|---:|:---|
|
|
@@ -126,18 +274,30 @@ The `options` structure is listed below:
|
|
|
126
274
|
|
|
127
275
|
#### class properties
|
|
128
276
|
|
|
129
|
-
|
|
277
|
+
<a name="TXEpgDTSProvider+dtstype"></a>
|
|
278
|
+
##### **dtstype**
|
|
130
279
|
|
|
131
|
-
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|`curDocTZ`|`number`|no|defines a current TimeZone|
|
|
280
|
+
| property type | read only | description |
|
|
281
|
+
|---|---|:---|
|
|
282
|
+
| `number` | no | defines a "dtstype"-value |
|
|
135
283
|
|
|
284
|
+
<a name="TXEpgDTSProvider+curDocTZ"></a>
|
|
285
|
+
##### **curDocTZ**
|
|
286
|
+
|
|
287
|
+
| property type | read only | description |
|
|
288
|
+
|---|---|:---|
|
|
289
|
+
| `number` | no | defines a current TimeZone |
|
|
290
|
+
|
|
291
|
+
<a name="TXEpgHeaderContainer"></a>
|
|
136
292
|
### **TXEpgHeaderContainer**
|
|
137
293
|
|
|
138
294
|
#### class constructor
|
|
139
295
|
|
|
140
|
-
The class constructor creates a new instance of the class.
|
|
296
|
+
The class constructor creates a new instance of the class.
|
|
297
|
+
|
|
298
|
+
##### constructor parameters
|
|
299
|
+
|
|
300
|
+
The class constructor receives arguments listed below:
|
|
141
301
|
|
|
142
302
|
|name|type|default value|description|
|
|
143
303
|
|:---|---|---:|:---|
|
|
@@ -152,50 +312,85 @@ The `options` structure is listed below:
|
|
|
152
312
|
|
|
153
313
|
#### class properties
|
|
154
314
|
|
|
155
|
-
|
|
315
|
+
<a name="TXEpgHeaderContainer+dts"></a>
|
|
316
|
+
##### **dts**
|
|
156
317
|
|
|
157
|
-
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
318
|
+
| property type | read only | description |
|
|
319
|
+
|---|---|:---|
|
|
320
|
+
| `TXEpgDTSProvider` | yes | returns a `TXEpgDTSProvider` |
|
|
321
|
+
|
|
322
|
+
<a name="TXEpgHeaderContainer+dtstype"></a>
|
|
323
|
+
##### **dtstype**
|
|
324
|
+
|
|
325
|
+
| property type | read only | description |
|
|
326
|
+
|---|---|:---|
|
|
327
|
+
| `number` | no | defines a "dtstype"-value |
|
|
328
|
+
|
|
329
|
+
<a name="TXEpgHeaderContainer+curDocTZ"></a>
|
|
330
|
+
##### **curDocTZ**
|
|
331
|
+
|
|
332
|
+
| property type | read only | description |
|
|
333
|
+
|---|---|:---|
|
|
334
|
+
| `number` | no | defines a current TimeZone |
|
|
335
|
+
|
|
336
|
+
<a name="TXEpgHeaderContainer+Provider"></a>
|
|
337
|
+
##### **Provider**
|
|
338
|
+
|
|
339
|
+
| property type | read only | description |
|
|
340
|
+
|---|---|:---|
|
|
341
|
+
| `TXEpgProviderContainer` | yes | returns a `TXEpgProviderContainer` |
|
|
163
342
|
|
|
164
343
|
#### class methods
|
|
165
344
|
|
|
166
|
-
|
|
345
|
+
<a name="TXEpgHeaderContainer+getDocumentDT"></a>
|
|
346
|
+
##### **getDocumentDT()** => `number`
|
|
167
347
|
|
|
168
|
-
This method returns a time value of a document creation.
|
|
348
|
+
This method returns a time value of a document creation as a timestamp.
|
|
169
349
|
|
|
170
|
-
|
|
350
|
+
<a name="TXEpgHeaderContainer+setDocumentDT"></a>
|
|
351
|
+
##### **setDocumentDT()** => `void`
|
|
171
352
|
|
|
172
353
|
This method sets a time value of a document creation.
|
|
173
354
|
|
|
174
|
-
|
|
355
|
+
<a name="TXEpgHeaderContainer+getDocumentEDT"></a>
|
|
356
|
+
##### **getDocumentEDT()** => `number`
|
|
175
357
|
|
|
176
|
-
This method returns a time value from which a document is expired.
|
|
358
|
+
This method returns a time value from which a document is expired as a timestamp.
|
|
177
359
|
|
|
178
|
-
|
|
360
|
+
<a name="TXEpgHeaderContainer+setDocumentEDT"></a>
|
|
361
|
+
##### **setDocumentEDT(value)** => `void`
|
|
179
362
|
|
|
180
363
|
This method sets a time value at which a document will be expired.
|
|
181
364
|
|
|
182
|
-
|
|
365
|
+
| parameter name | value type | default value | description |
|
|
366
|
+
|:---|---|---:|:---|
|
|
367
|
+
| `value` | `number`, `string`, `Date` | --- | document expire time |
|
|
368
|
+
|
|
369
|
+
<a name="TXEpgHeaderContainer+getChannelInfo"></a>
|
|
370
|
+
##### **getChannelInfo()** => `xepgChnInfoDesc`
|
|
183
371
|
|
|
184
|
-
This method returns an object which contains a channel information.
|
|
372
|
+
This method returns an `object` which contains a channel information.
|
|
185
373
|
|
|
186
374
|
An object contains the following fields:
|
|
187
375
|
|
|
188
376
|
|field name|field type|description|
|
|
189
377
|
|:---|---|:---|
|
|
190
|
-
|`chnid`|`
|
|
378
|
+
|`chnid`|`srting`|a channel ID|
|
|
379
|
+
|`chngid`|`string`|a channel 'Group ID'|
|
|
191
380
|
|`chname`|`string`|a name of the channel|
|
|
192
|
-
|`chngid`|`ID_STRING`|a channel group|
|
|
193
381
|
|`srcurl`|`string`|a link to source|
|
|
194
382
|
|
|
195
|
-
|
|
383
|
+
<a name="TXEpgHeaderContainer+setChannelInfo"></a>
|
|
384
|
+
##### **setChannelInfo(obj)** => `void`
|
|
196
385
|
|
|
197
386
|
This method fills a channel information with a given data.
|
|
198
387
|
|
|
388
|
+
| parameter name | value type | default value | description |
|
|
389
|
+
|:---|---|---:|:---|
|
|
390
|
+
| `obj` | `xepgChnInfoDesc` | --- | channel info descriptor |
|
|
391
|
+
|
|
392
|
+
> \[!] NOTE: `[since v0.0.21]` a use of a `string` or `array` types a as values of an `obj` are deprecated and will be dropped soon.
|
|
393
|
+
|
|
199
394
|
The `obj` parameter can be a string or an array or an object.
|
|
200
395
|
|
|
201
396
|
If a string is given it mean to contains the `chnid` value.
|
|
@@ -208,22 +403,35 @@ If an object is given it contains the following fields:
|
|
|
208
403
|
|
|
209
404
|
|field name|field type|description|
|
|
210
405
|
|:---|---|:---|
|
|
211
|
-
|`chnid`|`
|
|
406
|
+
|`chnid`|`string`|a channel ID|
|
|
212
407
|
|`chname`|`string`|a name of the channel|
|
|
213
|
-
|`chngid`|`
|
|
408
|
+
|`chngid`|`string`|a channel group|
|
|
214
409
|
|`srcurl`|`string`|a link to source|
|
|
215
410
|
|
|
216
|
-
|
|
411
|
+
<a name="TXEpgHeaderContainer+getProviderInfo"></a>
|
|
412
|
+
##### **getProviderInfo()** => `xepgProvInfoDesc`
|
|
217
413
|
|
|
218
414
|
This method returns an object which contains an information about document provider.
|
|
219
415
|
|
|
220
416
|
##### **setProviderInfo(obj)**
|
|
221
417
|
|
|
418
|
+
<a name="TXEpgHeaderContainer+saveToXMLString"></a>
|
|
419
|
+
##### **saveToXMLString()** => `string`
|
|
420
|
+
|
|
421
|
+
> since: `v0.0.20`
|
|
422
|
+
|
|
423
|
+
This method saves an element content to a string.
|
|
424
|
+
|
|
425
|
+
<a name="TXEpgContentProvider"></a>
|
|
222
426
|
### **TXEpgContentProvider**
|
|
223
427
|
|
|
224
428
|
#### class constructor
|
|
225
429
|
|
|
226
|
-
The class constructor creates a new instance of the class.
|
|
430
|
+
The class constructor creates a new instance of the class.
|
|
431
|
+
|
|
432
|
+
##### constructor parameters
|
|
433
|
+
|
|
434
|
+
The class constructor receives arguments listed below:
|
|
227
435
|
|
|
228
436
|
|name|type|default value|description|
|
|
229
437
|
|:---|---|---:|:---|
|
|
@@ -238,52 +446,93 @@ The `options` structure is listed below:
|
|
|
238
446
|
|
|
239
447
|
#### class properties
|
|
240
448
|
|
|
241
|
-
|
|
449
|
+
<a name="TXEpgContentProvider+Header"></a>
|
|
450
|
+
##### **Header**
|
|
451
|
+
|
|
452
|
+
| property type | read only | description |
|
|
453
|
+
|---|---|:---|
|
|
454
|
+
| `TXEpgHeaderContainer` | yes | returns a `TXEpgHeaderContainer` |
|
|
455
|
+
|
|
456
|
+
<a name="TXEpgContentProvider+Provider"></a>
|
|
457
|
+
##### **Provider**
|
|
458
|
+
|
|
459
|
+
| property type | read only | description |
|
|
460
|
+
|---|---|:---|
|
|
461
|
+
| `TXEpgProviderContainer` | yes | returns a `TXEpgProviderContainer` |
|
|
242
462
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
463
|
+
<a name="TXEpgContentProvider+dts"></a>
|
|
464
|
+
##### **dts**
|
|
465
|
+
|
|
466
|
+
| property type | read only | description |
|
|
467
|
+
|---|---|:---|
|
|
468
|
+
| `TXEpgDTSProvider` | yes | returns a `TXEpgDTSProvider` |
|
|
469
|
+
|
|
470
|
+
<a name="TXEpgContentProvider+SchedulesList"></a>
|
|
471
|
+
##### **SchedulesList**
|
|
472
|
+
|
|
473
|
+
| property type | read only | description |
|
|
474
|
+
|---|---|:---|
|
|
475
|
+
| `TXEpgSchedulesList` | yes | returns a `TXEpgSchedulesList` |
|
|
249
476
|
|
|
250
477
|
#### class methods
|
|
251
478
|
|
|
252
|
-
|
|
479
|
+
<a name="TXEpgContentProvider+saveToXMLString"></a>
|
|
480
|
+
##### **saveToXMLString()** => `string`
|
|
253
481
|
|
|
254
|
-
|
|
482
|
+
This method saves a document content to a string.
|
|
255
483
|
|
|
256
|
-
|
|
484
|
+
<a name="TXEpgContentProvider+saveToFileSync"></a>
|
|
485
|
+
##### **saveToFileSync(src)** => `fsoDescr`
|
|
257
486
|
|
|
258
|
-
|
|
487
|
+
This method saves a document content into a file addressed by `src`.
|
|
259
488
|
|
|
260
|
-
|
|
489
|
+
| parameter name | value type | default value | description |
|
|
490
|
+
|:---|---|---:|:---|
|
|
491
|
+
| `src` | `string` | --- | path to a file |
|
|
492
|
+
|
|
493
|
+
##### **loadFromString(xmlString, options)** => `boolean`
|
|
261
494
|
|
|
262
|
-
|
|
495
|
+
> WARNING: This method deprecated (*since `v0.0.18`*). Use `loadFromXMLString` instead.
|
|
263
496
|
|
|
264
|
-
|
|
497
|
+
<a name="TXEpgContentProvider+loadFromXMLString"></a>
|
|
498
|
+
##### **loadFromXMLString(str)** => `boolean`
|
|
265
499
|
|
|
266
|
-
|
|
500
|
+
> since: `v0.0.18`
|
|
267
501
|
|
|
268
|
-
This method loads a document content from a
|
|
502
|
+
This method loads a document content from a string given by `str`.
|
|
269
503
|
|
|
270
|
-
|
|
504
|
+
| parameter name | value type | default value | description |
|
|
505
|
+
|:---|---|---:|:---|
|
|
506
|
+
| `str` | `string` | --- | some content |
|
|
271
507
|
|
|
272
|
-
|
|
508
|
+
<a name="TXEpgContentProvider+loadFromFileSync"></a>
|
|
509
|
+
##### **loadFromFileSync(src)** => `fsoDescr`
|
|
273
510
|
|
|
274
|
-
|
|
511
|
+
This method loads a document content from a file addressed by `src`.
|
|
275
512
|
|
|
276
|
-
|
|
513
|
+
| parameter name | value type | default value | description |
|
|
514
|
+
|:---|---|---:|:---|
|
|
515
|
+
| `src` | `string` | --- | path to a file |
|
|
277
516
|
|
|
278
|
-
|
|
517
|
+
#### class methods (*async*)
|
|
279
518
|
|
|
280
|
-
|
|
519
|
+
<a name="TXEpgContentProvider+saveToFile"></a>
|
|
520
|
+
##### **saveToFile(src)** => `Promise<fsoDescr, Error>`
|
|
281
521
|
|
|
282
|
-
|
|
522
|
+
This method saves a document content into a file addressed by `src`.
|
|
283
523
|
|
|
284
|
-
|
|
524
|
+
| parameter name | value type | default value | description |
|
|
525
|
+
|:---|---|---:|:---|
|
|
526
|
+
| `src` | `string` | --- | path to a file |
|
|
285
527
|
|
|
286
|
-
>
|
|
528
|
+
<a name="TXEpgContentProvider+loadFromFile"></a>
|
|
529
|
+
##### **loadFromFile(src)** => `Promise<fsoDescr, Error>`
|
|
530
|
+
|
|
531
|
+
This method loads a document content from a file addressed by `src`.
|
|
532
|
+
|
|
533
|
+
| parameter name | value type | default value | description |
|
|
534
|
+
|:---|---|---:|:---|
|
|
535
|
+
| `src` | `string` | --- | path to a file |
|
|
287
536
|
|
|
288
537
|
#### class methods (*special*)
|
|
289
538
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<!-- DTD for TV-listings
|
|
2
|
+
======================
|
|
3
|
+
* [rev.0.2.002-20241016]
|
|
4
|
+
* [schema 0.2] -->
|
|
5
|
+
|
|
6
|
+
<!ELEMENT epgdoc (tvp:info, tvp:list)>
|
|
7
|
+
<!ATTLIST epgdoc xmlns:tvp CDATA #REQUIRED >
|
|
8
|
+
|
|
9
|
+
<!ELEMENT tvp:info (tvp:provider,
|
|
10
|
+
(tvp:channel?|(tvp:chnid, tvp:chngid?, tvp:chname)),
|
|
11
|
+
tvp:srcurl?,
|
|
12
|
+
tvp:time?, tvp:expire?, tvp:timezone, tvp:dtstype)>
|
|
13
|
+
|
|
14
|
+
<!ELEMENT tvp:provider (name, version?, tvp:schema, tvp:doctype)>
|
|
15
|
+
|
|
16
|
+
<!ELEMENT name (#PCDATA)>
|
|
17
|
+
<!ATTLIST name lang CDATA #IMPLIED >
|
|
18
|
+
|
|
19
|
+
<!ELEMENT version (#PCDATA)>
|
|
20
|
+
|
|
21
|
+
<!ELEMENT tvp:schema (#PCDATA)>
|
|
22
|
+
|
|
23
|
+
<!ELEMENT tvp:doctype (#PCDATA)>
|
|
24
|
+
|
|
25
|
+
<!-- NOTE: tag <tvp:channel> reserved for schema 0.3+ -->
|
|
26
|
+
<!ELEMENT tvp:channel (tvp:chnid, tvp:chngid?, tvp:chname*)>
|
|
27
|
+
|
|
28
|
+
<!ELEMENT tvp:chnid (#PCDATA)>
|
|
29
|
+
|
|
30
|
+
<!ELEMENT tvp:chngid (#PCDATA)>
|
|
31
|
+
|
|
32
|
+
<!ELEMENT tvp:chname (#PCDATA)>
|
|
33
|
+
<!ATTLIST tvp:chname lang CDATA #IMPLIED >
|
|
34
|
+
|
|
35
|
+
<!ELEMENT tvp:srcurl (#PCDATA)>
|
|
36
|
+
|
|
37
|
+
<!ELEMENT tvp:time (#PCDATA)>
|
|
38
|
+
|
|
39
|
+
<!ELEMENT tvp:expire (#PCDATA)>
|
|
40
|
+
|
|
41
|
+
<!ELEMENT tvp:timezone (#PCDATA)>
|
|
42
|
+
|
|
43
|
+
<!ELEMENT tvp:dtstype (value, name)>
|
|
44
|
+
|
|
45
|
+
<!ELEMENT value (#PCDATA)>
|
|
46
|
+
|
|
47
|
+
<!ELEMENT tvp:list ((tvp:item|tvp:schedule)*)>
|
|
48
|
+
|
|
49
|
+
<!ELEMENT tvp:item (tvp:time, tvp:title+, tvp:pcmark?, tvp:cat*, tvp:desc*)>
|
|
50
|
+
|
|
51
|
+
<!ELEMENT tvp:title (#PCDATA)>
|
|
52
|
+
<!ATTLIST tvp:chname lang CDATA #IMPLIED >
|
|
53
|
+
|
|
54
|
+
<!ELEMENT tvp:pcmark (#PCDATA)>
|
|
55
|
+
|
|
56
|
+
<!ELEMENT tvp:cat (#PCDATA)>
|
|
57
|
+
<!ATTLIST tvp:cat lang CDATA #IMPLIED >
|
|
58
|
+
|
|
59
|
+
<!ELEMENT tvp:desc (#PCDATA)>
|
|
60
|
+
<!ATTLIST tvp:desc lang CDATA #IMPLIED >
|
|
61
|
+
|
|
62
|
+
<!-- NOTE: tag <tvp:channel> reserved for schema 0.3+ -->
|
|
63
|
+
<!ELEMENT tvp:schedule (tvp:title+, tvp:pcmark?, tvp:cat*, tvp:desc*)>
|
|
64
|
+
<!ATTLIST tvp:schedule start CDATA #REQUIRED
|
|
65
|
+
stop CDATA #IMPLIED >
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// [v0.0.
|
|
1
|
+
// [v0.0.009-20250225]
|
|
2
2
|
|
|
3
3
|
// === module init block ===
|
|
4
4
|
|
|
@@ -15,9 +15,12 @@ const xObj = require('@ygracs/xobj-lib-js');
|
|
|
15
15
|
/**/// v1 branch
|
|
16
16
|
exports.TXEpgContentProvider = xepg_doc.TXEpgContentProvider;
|
|
17
17
|
exports.TXEpgSchedulesList = xepg_doc.TXEpgSchedulesList;
|
|
18
|
-
exports.
|
|
18
|
+
exports.TXEpgDTSProvider = xepg_doc.TXEpgDTSProvider;
|
|
19
19
|
exports.TXEpgProviderContainer = xepg_doc.TXEpgProviderContainer;
|
|
20
20
|
exports.TXEpgHeaderContainer = xepg_doc.TXEpgHeaderContainer;
|
|
21
21
|
|
|
22
22
|
// re-export stuff from `@ygracs/xobj-lib-js` module
|
|
23
23
|
exports.TXmlContentParseOptions = xObj.TXmlContentParseOptions;
|
|
24
|
+
|
|
25
|
+
/**/// will deprecate
|
|
26
|
+
exports.TXepgDTSProvider = xepg_doc.TXepgDTSProvider;
|