@ygracs/xepg-lib-js 0.0.26-b → 0.0.30
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 +16 -3
- package/README.md +4 -2
- package/doc/xepgdoc-lib.md +67 -55
- package/index.d.ts +27 -21
- package/index.js +13 -3
- package/lib/dts-helper.d.ts +53 -37
- package/lib/dts-helper.js +73 -42
- package/lib/xepg-channel.d.ts +91 -0
- package/lib/xepg-channel.js +308 -0
- package/lib/xepg-defs.d.ts +67 -0
- package/lib/xepg-defs.js +88 -0
- package/lib/xepg-sched.d.ts +231 -0
- package/lib/xepg-sched.js +587 -0
- package/lib/xepgdoc-lib.d.ts +338 -596
- package/lib/xepgdoc-lib.js +306 -1106
- package/lib/xml-base.d.ts +40 -21
- package/lib/xml-base.js +98 -23
- package/package.json +11 -8
- /package/doc/{xepgdoc-example.xepg → xepgdoc-example-s02.xepg} +0 -0
- /package/doc/{xepgdoc-spec.md → xepgdoc-spec-02.md} +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated
|
|
3
|
+
*/
|
|
4
|
+
export type setInfoParam = string;
|
|
5
|
+
export const setInfoParam: setInfoParam;
|
|
6
|
+
/**
|
|
7
|
+
* A channel info descriptor
|
|
8
|
+
*/
|
|
9
|
+
export type IXEpgChnInfoDesc = {
|
|
10
|
+
/**
|
|
11
|
+
* - channel ID
|
|
12
|
+
*/
|
|
13
|
+
chnid: string;
|
|
14
|
+
/**
|
|
15
|
+
* - channel name
|
|
16
|
+
*/
|
|
17
|
+
chname: string;
|
|
18
|
+
/**
|
|
19
|
+
* - channel 'Group ID'
|
|
20
|
+
*/
|
|
21
|
+
chngid?: string;
|
|
22
|
+
/**
|
|
23
|
+
* - EPG-source URL
|
|
24
|
+
*/
|
|
25
|
+
srcurl?: string;
|
|
26
|
+
};
|
|
27
|
+
export const IXEpgChnInfoDesc: IXEpgChnInfoDesc;
|
|
28
|
+
/**
|
|
29
|
+
* An XEPG-element options set (base)
|
|
30
|
+
*/
|
|
31
|
+
export type OPT_epgelsett_bs = {
|
|
32
|
+
/**
|
|
33
|
+
* - parser options
|
|
34
|
+
*/
|
|
35
|
+
parseOptions?: InstanceType<typeof TXmlContentParseOptions>;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* An XEPG-element options set (base)
|
|
39
|
+
*/
|
|
40
|
+
export type XEpgElementConfigBase = {
|
|
41
|
+
/**
|
|
42
|
+
* - parser options
|
|
43
|
+
*/
|
|
44
|
+
parseOptions: InstanceType<typeof TXmlContentParseOptions>;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* This class implements an interface of a channel element
|
|
49
|
+
* @since 0.0.22
|
|
50
|
+
*/
|
|
51
|
+
export class TXEpgChannelContainer {
|
|
52
|
+
/**
|
|
53
|
+
* Creates an instance of the channel element
|
|
54
|
+
*/
|
|
55
|
+
constructor(obj: INode, opt?: OPT_epgelsett_bs);
|
|
56
|
+
/**
|
|
57
|
+
* Contains a channel ID
|
|
58
|
+
*/
|
|
59
|
+
get id(): string;
|
|
60
|
+
/**
|
|
61
|
+
* Contains a channel name
|
|
62
|
+
*/
|
|
63
|
+
get name(): string;
|
|
64
|
+
set name(value: string);
|
|
65
|
+
/**
|
|
66
|
+
* Contains a channel Group ID
|
|
67
|
+
*/
|
|
68
|
+
get gid(): string;
|
|
69
|
+
set gid(value: string);
|
|
70
|
+
/**
|
|
71
|
+
* Contains a channel source URL
|
|
72
|
+
*/
|
|
73
|
+
get url(): string;
|
|
74
|
+
set url(value: string);
|
|
75
|
+
/**
|
|
76
|
+
* Tries to set a channel ID
|
|
77
|
+
*/
|
|
78
|
+
setID(value: string): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Returns a channel info
|
|
81
|
+
*/
|
|
82
|
+
getInfo(): IXEpgChnInfoDesc;
|
|
83
|
+
/**
|
|
84
|
+
* Sets a channel info
|
|
85
|
+
*/
|
|
86
|
+
setInfo(obj: setInfoParam | IXEpgChnInfoDesc): void;
|
|
87
|
+
#private;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
import { TXmlContentParseOptions } from "@ygracs/xobj-lib-js";
|
|
91
|
+
import type { INode } from "@ygracs/xobj-lib-js";
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
// [v0.3.152-20260612]
|
|
2
|
+
|
|
3
|
+
// === module init block ===
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
isObject, isPlainObject,
|
|
7
|
+
} = require('@ygracs/bsfoc-lib-js');
|
|
8
|
+
|
|
9
|
+
const xObj = require('@ygracs/xobj-lib-js');
|
|
10
|
+
const {
|
|
11
|
+
insertXObjElement,
|
|
12
|
+
writeXObjParam,
|
|
13
|
+
//TXmlContentParseOptions,
|
|
14
|
+
//DEF_XML_PARSE_OPTIONS: XML_DEF_PARSE_OPTIONS,
|
|
15
|
+
} = xObj;
|
|
16
|
+
// keep the next line for a type checking work properly :(
|
|
17
|
+
const { TXmlContentParseOptions } = require('@ygracs/xobj-lib-js/lib/xObj-defs');
|
|
18
|
+
// keep the next line for a type checking work properly :(
|
|
19
|
+
const { INode } = require('@ygracs/xobj-lib-js/lib/xObj-lib');
|
|
20
|
+
|
|
21
|
+
const {
|
|
22
|
+
//readAsTagName,
|
|
23
|
+
//readAsAttrName,
|
|
24
|
+
//valueToElementID,
|
|
25
|
+
_getXmlChildElementParam,
|
|
26
|
+
} = require('./xml-base');
|
|
27
|
+
|
|
28
|
+
const {
|
|
29
|
+
XEPG_CONSTANTS, XEPG_DEF_TNAMES,
|
|
30
|
+
defParseOptionsSettings,
|
|
31
|
+
} = require('./xepg-defs');
|
|
32
|
+
|
|
33
|
+
// === module inner block ===
|
|
34
|
+
|
|
35
|
+
const {
|
|
36
|
+
XEPG_DEF_DOCUMENT_SCHEMA,
|
|
37
|
+
} = XEPG_CONSTANTS;
|
|
38
|
+
|
|
39
|
+
const {
|
|
40
|
+
XEPG_CHNID_ETAG_NAME,
|
|
41
|
+
XEPG_CHNNAME_ETAG_NAME,
|
|
42
|
+
XEPG_CHNGID_ETAG_NAME,
|
|
43
|
+
XEPG_CHNURL_ETAG_NAME,
|
|
44
|
+
} = XEPG_DEF_TNAMES;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* An XEPG-element options set (base)
|
|
48
|
+
* @typedef {Object} OPT_epgelsett_bs
|
|
49
|
+
* @property {TXmlContentParseOptions} [parseOptions] - parser options
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* An XEPG-element options set (base)
|
|
54
|
+
* @typedef {Object} XEpgElementConfigBase
|
|
55
|
+
* @property {TXmlContentParseOptions} parseOptions - parser options
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Evaluates an XML-node base settings
|
|
60
|
+
* @function __evalXMLBaseNodeSettings
|
|
61
|
+
* @param {any} value - element settings to evaluate
|
|
62
|
+
* @returns {XEpgElementConfigBase}
|
|
63
|
+
* @inner
|
|
64
|
+
*/
|
|
65
|
+
function __evalXMLBaseNodeSettings(value) {
|
|
66
|
+
/** @type {OPT_epgelsett_bs} */
|
|
67
|
+
let settings = isPlainObject(value) ? value : {};
|
|
68
|
+
if (settings instanceof Map) settings = Object.fromEntries(settings);
|
|
69
|
+
let {
|
|
70
|
+
parseOptions,
|
|
71
|
+
} = settings;
|
|
72
|
+
if (!(parseOptions instanceof TXmlContentParseOptions)) {
|
|
73
|
+
settings.parseOptions = new TXmlContentParseOptions(parseOptions);
|
|
74
|
+
};
|
|
75
|
+
// @ts-expect-error
|
|
76
|
+
return settings;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// === module main block ===
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @typedef {string} setInfoParam
|
|
83
|
+
* @deprecated
|
|
84
|
+
* @todo \[since v0.0.30] deprecated and will be removed
|
|
85
|
+
*/
|
|
86
|
+
/**
|
|
87
|
+
* A virtual constant meant for support jsdoc notation:
|
|
88
|
+
* @type {setInfoParam}
|
|
89
|
+
*/
|
|
90
|
+
module.exports.setInfoParam = '';
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* A channel info descriptor
|
|
94
|
+
* @typedef {Object} IXEpgChnInfoDesc
|
|
95
|
+
* @property {string} chnid - channel ID
|
|
96
|
+
* @property {string} chname - channel name
|
|
97
|
+
* @property {string} [chngid] - channel 'Group ID'
|
|
98
|
+
* @property {string} [srcurl] - EPG-source URL
|
|
99
|
+
*/
|
|
100
|
+
/**
|
|
101
|
+
* A virtual constant meant for support jsdoc notation:
|
|
102
|
+
* @type {IXEpgChnInfoDesc}
|
|
103
|
+
*/
|
|
104
|
+
module.exports.IXEpgChnInfoDesc = { chnid: '', chname: '' };
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @since 0.0.22
|
|
109
|
+
* @classdesc This class implements an interface of a channel element
|
|
110
|
+
*/
|
|
111
|
+
class TXEpgChannelContainer {
|
|
112
|
+
/** @type {INode} */
|
|
113
|
+
#_host;
|
|
114
|
+
/** @type {OPT_epgelsett_bs} */
|
|
115
|
+
#_options;
|
|
116
|
+
/** @type {TXmlContentParseOptions} */
|
|
117
|
+
#_parseOptions;
|
|
118
|
+
/** @type {string} */
|
|
119
|
+
#_xepgSchema;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Creates an instance of the channel element
|
|
123
|
+
* @param {INode} obj - host object
|
|
124
|
+
* @param {OPT_epgelsett_bs} [opt] - options
|
|
125
|
+
*/
|
|
126
|
+
constructor(obj, opt) {
|
|
127
|
+
// load content
|
|
128
|
+
const _host = isPlainObject(obj) ? obj : {};
|
|
129
|
+
// load options
|
|
130
|
+
const _options = __evalXMLBaseNodeSettings(opt);
|
|
131
|
+
let {
|
|
132
|
+
parseOptions,
|
|
133
|
+
} = _options;
|
|
134
|
+
// set document schema version
|
|
135
|
+
this.#_xepgSchema = XEPG_DEF_DOCUMENT_SCHEMA;
|
|
136
|
+
// save options
|
|
137
|
+
this.#_options = _options;
|
|
138
|
+
// save parser options
|
|
139
|
+
this.#_parseOptions = parseOptions;
|
|
140
|
+
// save content source
|
|
141
|
+
this.#_host = _host;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Contains a channel ID
|
|
146
|
+
* @type {string}
|
|
147
|
+
* @readonly
|
|
148
|
+
*/
|
|
149
|
+
get id() {
|
|
150
|
+
return _getXmlChildElementParam(this.#_host, XEPG_CHNID_ETAG_NAME).trim();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Contains a channel name
|
|
155
|
+
* @type {string}
|
|
156
|
+
*/
|
|
157
|
+
get name() {
|
|
158
|
+
return _getXmlChildElementParam(this.#_host, XEPG_CHNNAME_ETAG_NAME).trim();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
set name(value) {
|
|
162
|
+
if (typeof value === 'string' && this.id !== '') {
|
|
163
|
+
const item = insertXObjElement(
|
|
164
|
+
this.#_host,
|
|
165
|
+
XEPG_CHNNAME_ETAG_NAME,
|
|
166
|
+
{ force: true },
|
|
167
|
+
);
|
|
168
|
+
if (item) {
|
|
169
|
+
writeXObjParam(item, value.trim(), defParseOptionsSettings.textKey);
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Contains a channel Group ID
|
|
176
|
+
* @type {string}
|
|
177
|
+
*/
|
|
178
|
+
get gid() {
|
|
179
|
+
return _getXmlChildElementParam(this.#_host, XEPG_CHNGID_ETAG_NAME).trim();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
set gid(value) {
|
|
183
|
+
if (typeof value === 'string' && this.id !== '') {
|
|
184
|
+
const item = insertXObjElement(
|
|
185
|
+
this.#_host,
|
|
186
|
+
XEPG_CHNGID_ETAG_NAME,
|
|
187
|
+
{ force: true },
|
|
188
|
+
);
|
|
189
|
+
if (item) {
|
|
190
|
+
writeXObjParam(item, value.trim(), defParseOptionsSettings.textKey);
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Contains a channel source URL
|
|
197
|
+
* @type {string}
|
|
198
|
+
*/
|
|
199
|
+
get url() {
|
|
200
|
+
return _getXmlChildElementParam(this.#_host, XEPG_CHNURL_ETAG_NAME).trim();
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
set url(value) {
|
|
204
|
+
if (typeof value === 'string' && this.id !== '') {
|
|
205
|
+
const item = insertXObjElement(
|
|
206
|
+
this.#_host,
|
|
207
|
+
XEPG_CHNURL_ETAG_NAME,
|
|
208
|
+
{ force: true },
|
|
209
|
+
);
|
|
210
|
+
if (item) {
|
|
211
|
+
writeXObjParam(item, value.trim(), defParseOptionsSettings.textKey);
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Tries to set a channel ID
|
|
218
|
+
* @param {string} value - channel ID
|
|
219
|
+
* @returns {boolean}
|
|
220
|
+
*/
|
|
221
|
+
setID(value) {
|
|
222
|
+
let isSucceed = false;
|
|
223
|
+
if (typeof value === 'string') {
|
|
224
|
+
const chnid = value.trim();
|
|
225
|
+
const item = insertXObjElement(
|
|
226
|
+
this.#_host,
|
|
227
|
+
XEPG_CHNID_ETAG_NAME,
|
|
228
|
+
{ force: true },
|
|
229
|
+
);
|
|
230
|
+
if (item) {
|
|
231
|
+
isSucceed = writeXObjParam(item, chnid, defParseOptionsSettings.textKey);
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
return isSucceed;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Returns a channel info
|
|
239
|
+
* @returns {IXEpgChnInfoDesc}
|
|
240
|
+
*/
|
|
241
|
+
getInfo() {
|
|
242
|
+
const {
|
|
243
|
+
id: chnid,
|
|
244
|
+
name: chname,
|
|
245
|
+
gid: chngid,
|
|
246
|
+
url: srcurl,
|
|
247
|
+
} = this;
|
|
248
|
+
/** @type {IXEpgChnInfoDesc} */
|
|
249
|
+
return {
|
|
250
|
+
chnid,
|
|
251
|
+
chname,
|
|
252
|
+
chngid,
|
|
253
|
+
srcurl,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Sets a channel info
|
|
259
|
+
* @param {setInfoParam|IXEpgChnInfoDesc} obj - channel info descriptor
|
|
260
|
+
* @returns {void}
|
|
261
|
+
* @todo [since v0.0.30] deprecate use of `obj`-param as string
|
|
262
|
+
*/
|
|
263
|
+
setInfo(obj) {
|
|
264
|
+
let chnid = '';
|
|
265
|
+
let chname = '';
|
|
266
|
+
let chngid = '';
|
|
267
|
+
let srcurl = '';
|
|
268
|
+
if (isObject(obj)) {
|
|
269
|
+
({ chnid } = obj);
|
|
270
|
+
if (typeof chnid === 'string') {
|
|
271
|
+
({ chname, chngid, srcurl } = obj);
|
|
272
|
+
} else {
|
|
273
|
+
// // TODO: [?] deprecate
|
|
274
|
+
chnid = _getXmlChildElementParam(obj, XEPG_CHNID_ETAG_NAME).trim();
|
|
275
|
+
chname = _getXmlChildElementParam(obj, XEPG_CHNNAME_ETAG_NAME).trim();
|
|
276
|
+
chngid = _getXmlChildElementParam(obj, XEPG_CHNGID_ETAG_NAME).trim();
|
|
277
|
+
srcurl = _getXmlChildElementParam(obj, XEPG_CHNURL_ETAG_NAME).trim();
|
|
278
|
+
};
|
|
279
|
+
} else if (typeof obj === 'string') {
|
|
280
|
+
chnid = obj;
|
|
281
|
+
} else {
|
|
282
|
+
return;
|
|
283
|
+
};
|
|
284
|
+
chnid = typeof chnid === 'string' ? chnid.trim() : '';
|
|
285
|
+
if (chnid === '') {
|
|
286
|
+
chname = '';
|
|
287
|
+
chngid = '';
|
|
288
|
+
srcurl = '';
|
|
289
|
+
} else {
|
|
290
|
+
chname = typeof chname === 'string' ? chname.trim() : '';
|
|
291
|
+
chngid = typeof chngid === 'string' ? chngid.trim() : '';
|
|
292
|
+
srcurl = typeof srcurl === 'string' ? srcurl.trim() : '';
|
|
293
|
+
};
|
|
294
|
+
let item = null;
|
|
295
|
+
const _host = this.#_host;
|
|
296
|
+
const text_key = defParseOptionsSettings.textKey;
|
|
297
|
+
item = insertXObjElement(_host, XEPG_CHNID_ETAG_NAME, { force: true });
|
|
298
|
+
if (item) writeXObjParam(item, chnid, text_key);
|
|
299
|
+
item = insertXObjElement(_host, XEPG_CHNNAME_ETAG_NAME, { force: true });
|
|
300
|
+
if (item) writeXObjParam(item, chname, text_key);
|
|
301
|
+
item = insertXObjElement(_host, XEPG_CHNGID_ETAG_NAME, { force: true });
|
|
302
|
+
if (item) writeXObjParam(item, chngid, text_key);
|
|
303
|
+
item = insertXObjElement(_host, XEPG_CHNURL_ETAG_NAME, { force: true });
|
|
304
|
+
if (item) writeXObjParam(item, srcurl, text_key);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
}
|
|
308
|
+
module.exports.TXEpgChannelContainer = TXEpgChannelContainer;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export namespace XEPG_CONSTANTS {
|
|
2
|
+
export { ALLOWED_XEPG_DOCUMENT_SCHEMA };
|
|
3
|
+
export { XEPG_DEF_NS_NAME };
|
|
4
|
+
export { XEPG_DEF_NS_PATH };
|
|
5
|
+
export { XEPG_XML_DOC_VERSION };
|
|
6
|
+
export { XEPG_DEF_ENCODING_VALUE };
|
|
7
|
+
export { XEPG_DEF_DOCUMENT_TYPE };
|
|
8
|
+
export { XEPG_DEF_DOCUMENT_SCHEMA };
|
|
9
|
+
export { XEPG_DEF_PROVIDER_NAME };
|
|
10
|
+
export { XEPG_DEF_PROVIDER_VER };
|
|
11
|
+
}
|
|
12
|
+
export namespace XEPG_DEF_TNAMES {
|
|
13
|
+
export { XEPG_ROOT_ETAG_NAME };
|
|
14
|
+
export { XEPG_HEADER_ETAG_NAME };
|
|
15
|
+
export { XEPG_BODY_ETAG_NAME };
|
|
16
|
+
export { XEPG_SCHED_ETAG_NAME };
|
|
17
|
+
export { XEPG_PRVINFO_ETAG_NAME };
|
|
18
|
+
export { XEPG_DTSINFO_ETAG_NAME };
|
|
19
|
+
export { XEPG_DOCDTO_ETAG_NAME };
|
|
20
|
+
export { XEPG_DOCDTE_ETAG_NAME };
|
|
21
|
+
export { XEPG_DOCTZ_ETAG_NAME };
|
|
22
|
+
export { XEPG_DOCSCH_ETAG_NAME };
|
|
23
|
+
export { XEPG_DOCTYP_ETAG_NAME };
|
|
24
|
+
export { XEPG_CHNID_ETAG_NAME };
|
|
25
|
+
export { XEPG_CHNNAME_ETAG_NAME };
|
|
26
|
+
export { XEPG_CHNGID_ETAG_NAME };
|
|
27
|
+
export { XEPG_CHNURL_ETAG_NAME };
|
|
28
|
+
export { XEPG_SCHEDTIME_ETAG_NAME };
|
|
29
|
+
export { XEPG_SCHEDTITL_ETAG_NAME };
|
|
30
|
+
export { XEPG_SCHEDCAT_ETAG_NAME };
|
|
31
|
+
export { XEPG_SCHEDPMARK_ETAG_NAME };
|
|
32
|
+
export { XEPG_SCHEDDESC_ETAG_NAME };
|
|
33
|
+
}
|
|
34
|
+
export const defParseOptionsSettings: import("@ygracs/xobj-lib-js").OPT_parserOptions;
|
|
35
|
+
/**
|
|
36
|
+
* A list of a document schema version supported by a library
|
|
37
|
+
*/
|
|
38
|
+
declare const ALLOWED_XEPG_DOCUMENT_SCHEMA: string[];
|
|
39
|
+
declare const XEPG_DEF_NS_NAME: "tvp";
|
|
40
|
+
declare const XEPG_DEF_NS_PATH: "urn:e-doc:epg-doc:xepg";
|
|
41
|
+
declare const XEPG_XML_DOC_VERSION: "1.0";
|
|
42
|
+
declare const XEPG_DEF_ENCODING_VALUE: "UTF-8";
|
|
43
|
+
declare const XEPG_DEF_DOCUMENT_TYPE: "xepg";
|
|
44
|
+
declare const XEPG_DEF_DOCUMENT_SCHEMA: string;
|
|
45
|
+
declare const XEPG_DEF_PROVIDER_NAME: "xepg-lib-js";
|
|
46
|
+
declare const XEPG_DEF_PROVIDER_VER: "0.0.30";
|
|
47
|
+
declare const XEPG_ROOT_ETAG_NAME: "epgdoc";
|
|
48
|
+
declare const XEPG_HEADER_ETAG_NAME: "tvp:info";
|
|
49
|
+
declare const XEPG_BODY_ETAG_NAME: "tvp:list";
|
|
50
|
+
declare const XEPG_SCHED_ETAG_NAME: "tvp:item";
|
|
51
|
+
declare const XEPG_PRVINFO_ETAG_NAME: "tvp:provider";
|
|
52
|
+
declare const XEPG_DTSINFO_ETAG_NAME: "tvp:dtstype";
|
|
53
|
+
declare const XEPG_DOCDTO_ETAG_NAME: "tvp:time";
|
|
54
|
+
declare const XEPG_DOCDTE_ETAG_NAME: "tvp:expire";
|
|
55
|
+
declare const XEPG_DOCTZ_ETAG_NAME: "tvp:timezone";
|
|
56
|
+
declare const XEPG_DOCSCH_ETAG_NAME: "tvp:schema";
|
|
57
|
+
declare const XEPG_DOCTYP_ETAG_NAME: "tvp:doctype";
|
|
58
|
+
declare const XEPG_CHNID_ETAG_NAME: "tvp:chnid";
|
|
59
|
+
declare const XEPG_CHNNAME_ETAG_NAME: "tvp:chname";
|
|
60
|
+
declare const XEPG_CHNGID_ETAG_NAME: "tvp:chngid";
|
|
61
|
+
declare const XEPG_CHNURL_ETAG_NAME: "tvp:srcurl";
|
|
62
|
+
declare const XEPG_SCHEDTIME_ETAG_NAME: "tvp:time";
|
|
63
|
+
declare const XEPG_SCHEDTITL_ETAG_NAME: "tvp:title";
|
|
64
|
+
declare const XEPG_SCHEDCAT_ETAG_NAME: "tvp:cat";
|
|
65
|
+
declare const XEPG_SCHEDPMARK_ETAG_NAME: "tvp:pcmark";
|
|
66
|
+
declare const XEPG_SCHEDDESC_ETAG_NAME: "tvp:desc";
|
|
67
|
+
export {};
|
package/lib/xepg-defs.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// [v0.3.149-20260612]
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
TXmlContentParseOptions,
|
|
5
|
+
} = require('@ygracs/xobj-lib-js');
|
|
6
|
+
|
|
7
|
+
// === module init block ===
|
|
8
|
+
|
|
9
|
+
// === module inner block ===
|
|
10
|
+
|
|
11
|
+
// === module main block ===
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A list of a document schema version supported by a library
|
|
15
|
+
*/
|
|
16
|
+
const ALLOWED_XEPG_DOCUMENT_SCHEMA = [ '0.2' ];
|
|
17
|
+
|
|
18
|
+
const XEPG_DEF_NS_NAME = 'tvp';
|
|
19
|
+
const XEPG_DEF_NS_PATH = 'urn:e-doc:epg-doc:xepg';
|
|
20
|
+
const XEPG_XML_DOC_VERSION = '1.0';
|
|
21
|
+
const XEPG_DEF_ENCODING_VALUE = 'UTF-8';
|
|
22
|
+
const XEPG_DEF_DOCUMENT_TYPE = 'xepg';
|
|
23
|
+
const XEPG_DEF_DOCUMENT_SCHEMA = ALLOWED_XEPG_DOCUMENT_SCHEMA[0];
|
|
24
|
+
const XEPG_DEF_PROVIDER_NAME = 'xepg-lib-js';
|
|
25
|
+
const XEPG_DEF_PROVIDER_VER = '0.0.30';
|
|
26
|
+
|
|
27
|
+
const XEPG_CONSTANTS = {
|
|
28
|
+
ALLOWED_XEPG_DOCUMENT_SCHEMA,
|
|
29
|
+
XEPG_DEF_NS_NAME,
|
|
30
|
+
XEPG_DEF_NS_PATH,
|
|
31
|
+
XEPG_XML_DOC_VERSION,
|
|
32
|
+
XEPG_DEF_ENCODING_VALUE,
|
|
33
|
+
XEPG_DEF_DOCUMENT_TYPE,
|
|
34
|
+
XEPG_DEF_DOCUMENT_SCHEMA,
|
|
35
|
+
XEPG_DEF_PROVIDER_NAME,
|
|
36
|
+
XEPG_DEF_PROVIDER_VER,
|
|
37
|
+
};
|
|
38
|
+
module.exports.XEPG_CONSTANTS = XEPG_CONSTANTS;
|
|
39
|
+
|
|
40
|
+
const XEPG_ROOT_ETAG_NAME = 'epgdoc';
|
|
41
|
+
const XEPG_HEADER_ETAG_NAME = `${XEPG_DEF_NS_NAME}:info`;
|
|
42
|
+
const XEPG_BODY_ETAG_NAME = `${XEPG_DEF_NS_NAME}:list`;
|
|
43
|
+
const XEPG_SCHED_ETAG_NAME = `${XEPG_DEF_NS_NAME}:item`;
|
|
44
|
+
const XEPG_PRVINFO_ETAG_NAME = `${XEPG_DEF_NS_NAME}:provider`;
|
|
45
|
+
const XEPG_DTSINFO_ETAG_NAME = `${XEPG_DEF_NS_NAME}:dtstype`;
|
|
46
|
+
const XEPG_DOCDTO_ETAG_NAME = `${XEPG_DEF_NS_NAME}:time`;
|
|
47
|
+
const XEPG_DOCDTE_ETAG_NAME = `${XEPG_DEF_NS_NAME}:expire`;
|
|
48
|
+
const XEPG_DOCTZ_ETAG_NAME = `${XEPG_DEF_NS_NAME}:timezone`;
|
|
49
|
+
const XEPG_DOCSCH_ETAG_NAME = `${XEPG_DEF_NS_NAME}:schema`;
|
|
50
|
+
const XEPG_DOCTYP_ETAG_NAME = `${XEPG_DEF_NS_NAME}:doctype`;
|
|
51
|
+
const XEPG_CHNID_ETAG_NAME = `${XEPG_DEF_NS_NAME}:chnid`;
|
|
52
|
+
const XEPG_CHNNAME_ETAG_NAME = `${XEPG_DEF_NS_NAME}:chname`;
|
|
53
|
+
const XEPG_CHNGID_ETAG_NAME = `${XEPG_DEF_NS_NAME}:chngid`;
|
|
54
|
+
const XEPG_CHNURL_ETAG_NAME = `${XEPG_DEF_NS_NAME}:srcurl`;
|
|
55
|
+
const XEPG_SCHEDTIME_ETAG_NAME = `${XEPG_DEF_NS_NAME}:time`;
|
|
56
|
+
const XEPG_SCHEDTITL_ETAG_NAME = `${XEPG_DEF_NS_NAME}:title`;
|
|
57
|
+
const XEPG_SCHEDCAT_ETAG_NAME = `${XEPG_DEF_NS_NAME}:cat`;
|
|
58
|
+
const XEPG_SCHEDPMARK_ETAG_NAME = `${XEPG_DEF_NS_NAME}:pcmark`;
|
|
59
|
+
const XEPG_SCHEDDESC_ETAG_NAME = `${XEPG_DEF_NS_NAME}:desc`;
|
|
60
|
+
|
|
61
|
+
const XEPG_DEF_TNAMES = {
|
|
62
|
+
XEPG_ROOT_ETAG_NAME,
|
|
63
|
+
XEPG_HEADER_ETAG_NAME,
|
|
64
|
+
XEPG_BODY_ETAG_NAME,
|
|
65
|
+
XEPG_SCHED_ETAG_NAME,
|
|
66
|
+
XEPG_PRVINFO_ETAG_NAME,
|
|
67
|
+
XEPG_DTSINFO_ETAG_NAME,
|
|
68
|
+
XEPG_DOCDTO_ETAG_NAME,
|
|
69
|
+
XEPG_DOCDTE_ETAG_NAME,
|
|
70
|
+
XEPG_DOCTZ_ETAG_NAME,
|
|
71
|
+
XEPG_DOCSCH_ETAG_NAME,
|
|
72
|
+
XEPG_DOCTYP_ETAG_NAME,
|
|
73
|
+
XEPG_CHNID_ETAG_NAME,
|
|
74
|
+
XEPG_CHNNAME_ETAG_NAME,
|
|
75
|
+
XEPG_CHNGID_ETAG_NAME,
|
|
76
|
+
XEPG_CHNURL_ETAG_NAME,
|
|
77
|
+
XEPG_SCHEDTIME_ETAG_NAME,
|
|
78
|
+
XEPG_SCHEDTITL_ETAG_NAME,
|
|
79
|
+
XEPG_SCHEDCAT_ETAG_NAME,
|
|
80
|
+
XEPG_SCHEDPMARK_ETAG_NAME,
|
|
81
|
+
XEPG_SCHEDDESC_ETAG_NAME,
|
|
82
|
+
};
|
|
83
|
+
module.exports.XEPG_DEF_TNAMES = XEPG_DEF_TNAMES;
|
|
84
|
+
|
|
85
|
+
const defParseOptions = new TXmlContentParseOptions();
|
|
86
|
+
const defParseOptionsSettings = defParseOptions.settings;
|
|
87
|
+
//console.log('CHECK: defParseOptions => '+JSON.stringify(defParseOptions, null, 2));
|
|
88
|
+
module.exports.defParseOptionsSettings = defParseOptionsSettings;
|