@ygracs/xepg-lib-js 0.0.30 → 0.0.31

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,13 @@
1
+ #### *v0.0.31*
2
+
3
+ Pre-release version.
4
+
5
+ > - update dependency on `@ygracs/xml-js6` module to v0.0.10;
6
+ > - update dependency on `@ygracs/bsfoc-lib-js` module to v0.4.0;
7
+ > - update dependency on `@ygracs/dtf-lib-js` module to v0.1.0;
8
+ > - update dependency on `@ygracs/xobj-lib-js` module to v0.4.1;
9
+ > - some fixes.
10
+
1
11
  #### *v0.0.30*
2
12
 
3
13
  Pre-release version.
package/lib/dts-helper.js CHANGED
@@ -1,4 +1,4 @@
1
- // [v0.1.053-20260531]
1
+ // [v0.1.054-20260913]
2
2
 
3
3
  // === module init block ===
4
4
 
@@ -10,7 +10,9 @@ const {
10
10
  const {
11
11
  isDateObject,
12
12
  convDTValueToISO8601,
13
- convDTValueToXMLTV, convXMLTVToDTValue,
13
+ convDTValueToXMLTV,
14
+ convXMLTVToDTValue,
15
+ convXMLTVToTimestamp,
14
16
  convDTValueToDateString,
15
17
  tryDTValue,
16
18
  } = require('@ygracs/dtf-lib-js');
@@ -164,8 +166,8 @@ function convStringToDTValue(value, dts_id = 0, tz) {
164
166
  case 'xmltv': {
165
167
  // TODO: check TZ
166
168
  //console.log('convStringToDTValue => dtstype:[xmltv]');
167
- const dt = convXMLTVToDTValue(value, true);
168
- if (dt !== null) result = isDateObject(dt) ? dt.getTime() : dt;
169
+ const dt = convXMLTVToTimestamp(value);
170
+ if (dt !== null) result = dt;
169
171
  //console.log('convStringToDTValue => value:['+value+']');
170
172
  //console.log('convStringToDTValue => result:['+result+']');
171
173
  break;
@@ -1,67 +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 {};
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/xml-base.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  *
3
3
  * @inner
4
4
  */
5
- export function _getXmlChildElementParam(obj: object | null, name: string, parseOptions?: object): string;
5
+ export function _getXmlChildElementParam(obj: INode | null, name: string, parseOptions?: object): string;
6
6
  /**
7
7
  * Tries to convert a given value to a valid tag name of an XML-element.
8
8
  * @since v0.0.23
@@ -29,7 +29,7 @@ export function valueToElementID(value: any): string;
29
29
  * @since v0.0.24
30
30
  * @inner
31
31
  */
32
- export function serializeXObjToXMLString(node: object, opt: object, tagName: string): string;
32
+ export function serializeXObjToXMLString(node: INode, opt: object, tagName: string): string;
33
33
  /**
34
34
  * Loads an object content from an XML-string.
35
35
  * @since v0.0.24
@@ -37,4 +37,5 @@ export function serializeXObjToXMLString(node: object, opt: object, tagName: str
37
37
  * @inner
38
38
  * @experimental
39
39
  */
40
- export function deserializeXObjFromXMLString(node: object, opt: object, text: string, tagName: string): boolean;
40
+ export function deserializeXObjFromXMLString(node: INode, opt: object, text: string, tagName: string): boolean;
41
+ import { INode } from "@ygracs/xobj-lib-js";
package/lib/xml-base.js CHANGED
@@ -12,6 +12,8 @@ const xmlParser = require('@ygracs/xml-js6');
12
12
  const {
13
13
  getXObjElement,
14
14
  readXObjParam,
15
+ // * import types definitions *
16
+ INode,
15
17
  } = require('@ygracs/xobj-lib-js');
16
18
 
17
19
  const {
@@ -21,7 +23,7 @@ const {
21
23
  // === module inner block ===
22
24
 
23
25
  /**
24
- * @param {?object} obj - element
26
+ * @param {?INode} obj - element
25
27
  * @param {string} name - child element name
26
28
  * @param {object} [parseOptions] - parser options
27
29
  * @returns {string}
@@ -147,7 +149,7 @@ module.exports.valueToElementID = valueToElementID;
147
149
  * Returns an object as a string in an XML-format.
148
150
  * @since v0.0.24
149
151
  * @function serializeXObjToXMLString
150
- * @param {object} node - some element
152
+ * @param {INode} node - some element
151
153
  * @param {object} opt - parser options
152
154
  * @param {string} tagName - element tag name
153
155
  * @returns {string}
@@ -170,7 +172,7 @@ module.exports.serializeXObjToXMLString = serializeXObjToXMLString;
170
172
  * Loads an object content from an XML-string.
171
173
  * @since v0.0.24
172
174
  * @function deserializeXObjFromXMLString
173
- * @param {object} node - some element
175
+ * @param {INode} node - some element
174
176
  * @param {object} opt - parser options
175
177
  * @param {string} text - some content
176
178
  * @param {string} tagName - element tag name
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ygracs/xepg-lib-js",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "A library for handling an EPG-sources based on an XEPG-format",
5
5
  "author": "ygracs <cs70th-om@rambler.ru>",
6
6
  "license": "MIT",
@@ -41,15 +41,15 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@cntwg/file-helper": "~0.0.4",
44
- "@ygracs/bsfoc-lib-js": "~0.3.4",
45
- "@ygracs/dtf-lib-js": "~0.1.0-beta.2",
46
- "@ygracs/xml-js6": "~0.0.9-b",
47
- "@ygracs/xobj-lib-js": "~0.3.3"
44
+ "@ygracs/bsfoc-lib-js": "~0.4.0",
45
+ "@ygracs/dtf-lib-js": "~0.1.0",
46
+ "@ygracs/xml-js6": "~0.0.10",
47
+ "@ygracs/xobj-lib-js": "~0.4.1"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@ygracs/test-helper": "~0.0.2-b",
51
51
  "cross-env": "^10.1.0",
52
- "jest": "^30.4.2",
52
+ "jest": "^30.5.1",
53
53
  "jsdoc-to-markdown": "^9.1.3",
54
54
  "minimist": "^1.2.8",
55
55
  "typescript": "~5.9.3"