@tak-ps/node-cot 12.36.0 → 13.0.0
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/.github/workflows/doc.yml +1 -1
- package/.github/workflows/release.yml +3 -3
- package/.github/workflows/test.yml +4 -1
- package/CHANGELOG.md +9 -0
- package/README.md +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/cot.js +7 -715
- package/dist/lib/cot.js.map +1 -1
- package/dist/lib/data-package.js +3 -2
- package/dist/lib/data-package.js.map +1 -1
- package/dist/lib/parser.js +742 -0
- package/dist/lib/parser.js.map +1 -0
- package/dist/lib/types/feature.js +4 -0
- package/dist/lib/types/feature.js.map +1 -1
- package/dist/lib/types/types.js +37 -17
- package/dist/lib/types/types.js.map +1 -1
- package/dist/lib/utils/util.js +5 -5
- package/dist/lib/utils/util.js.map +1 -1
- package/dist/package.json +4 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/index.ts +1 -0
- package/lib/cot.ts +17 -848
- package/lib/data-package.ts +3 -2
- package/lib/parser.ts +906 -0
- package/lib/types/feature.ts +5 -0
- package/lib/types/types.ts +42 -17
- package/lib/utils/util.ts +5 -5
- package/package.json +4 -5
- package/tsconfig.json +0 -3
package/lib/data-package.ts
CHANGED
|
@@ -9,6 +9,7 @@ import StreamZip from 'node-stream-zip'
|
|
|
9
9
|
import { Readable } from 'node:stream';
|
|
10
10
|
import { randomUUID } from 'node:crypto';
|
|
11
11
|
import CoT from './cot.js';
|
|
12
|
+
import { CoTParser } from './parser.js';
|
|
12
13
|
import xmljs from 'xml-js';
|
|
13
14
|
import os from 'node:os';
|
|
14
15
|
import fs from 'node:fs';
|
|
@@ -332,7 +333,7 @@ export class DataPackage {
|
|
|
332
333
|
if (path.parse(content._attributes.zipEntry).ext !== '.cot') continue;
|
|
333
334
|
if (opts.respectIgnore && content._attributes.ignore) continue;
|
|
334
335
|
|
|
335
|
-
const cot =
|
|
336
|
+
const cot = CoTParser.from_xml(await fsp.readFile(this.path + '/raw/' + content._attributes.zipEntry));
|
|
336
337
|
|
|
337
338
|
cotsMap.set(cot.uid(), cot);
|
|
338
339
|
|
|
@@ -517,7 +518,7 @@ export class DataPackage {
|
|
|
517
518
|
|
|
518
519
|
this.#addContent(`${cot.raw.event._attributes.uid}/${cot.raw.event._attributes.uid}.cot`, cot.raw.event._attributes.uid, name, opts.ignore);
|
|
519
520
|
await fsp.mkdir(`${this.path}/raw/${cot.raw.event._attributes.uid}/`, { recursive: true });
|
|
520
|
-
await fsp.writeFile(`${this.path}/raw/${cot.raw.event._attributes.uid}/${cot.raw.event._attributes.uid}.cot`,
|
|
521
|
+
await fsp.writeFile(`${this.path}/raw/${cot.raw.event._attributes.uid}/${cot.raw.event._attributes.uid}.cot`, CoTParser.to_xml(cot))
|
|
521
522
|
}
|
|
522
523
|
|
|
523
524
|
/**
|