node-opcua-file-transfer 2.97.0 → 2.98.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"client_file.js","sourceRoot":"","sources":["../../source/client/client_file.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;GAEG;AACH,mEAAiG;AACjG,iEAAqD;AACrD,yDAA0D;AAG1D,uGAAsF;AACtF,2DAAgE;AAChE,+DAAiD;AAEjD,uDAAgF;AAEhF,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,OAAO,GAAG,IAAA,iCAAc,EAAC,UAAU,CAAC,CAAC;AAE3C,4CAA4C;AAC5C,0CAA4C;AAAnC,yGAAA,YAAY,OAAA;AA4BrB;;;GAGG;AACH,MAAa,UAAU;IAgBnB,YAAY,OAAsB,EAAE,MAAc;QAb3C,eAAU,GAAG,CAAC,CAAC;QAclB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;IAC7B,CAAC;IAEY,IAAI,CAAC,IAAkB;;YAChC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE;gBACrC,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,wBAAY,CAAC,IAAI,CAAC,CAAC,CAAC;aAClE;YACD,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;aACjD;YACD,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAE/B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;gBACnC,cAAc,EAAE,CAAC,EAAE,QAAQ,EAAE,6BAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,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AAC,CAAC,CAAC,OAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;YAClD,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,OAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;YACvD,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,OAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QACtD,CAAC;KAAA;IAEe,iBAAiB;;YAC7B,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;gBACxB,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;aAClC;QACL,CAAC;KAAA;;AA7Pa,0BAAe,GAAG,KAAK,AAAR,CAAS;AAD7B,gCAAU;AAoQvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG"}
@@ -1,3 +1,3 @@
1
- export * from "./client_file";
2
- export * from "./read_file";
3
- export * from "./write_file";
1
+ export * from "./client_file";
2
+ export * from "./read_file";
3
+ export * from "./write_file";
@@ -1,20 +1,20 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./client_file"), exports);
18
- __exportStar(require("./read_file"), exports);
19
- __exportStar(require("./write_file"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client_file"), exports);
18
+ __exportStar(require("./read_file"), exports);
19
+ __exportStar(require("./write_file"), exports);
20
20
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
- /// <reference types="node" />
2
- import { IClientFile } from "./client_file";
3
- export declare function readFile(clientFile: IClientFile, options?: {
4
- chunkSize?: number;
5
- }): Promise<Buffer>;
6
- export declare function readOPCUAFile(clientFile: IClientFile): Promise<Buffer>;
1
+ /// <reference types="node" />
2
+ import { IClientFile } from "./client_file";
3
+ export declare function readFile(clientFile: IClientFile, options?: {
4
+ chunkSize?: number;
5
+ }): Promise<Buffer>;
6
+ export declare function readOPCUAFile(clientFile: IClientFile): Promise<Buffer>;
@@ -1,60 +1,60 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.readOPCUAFile = exports.readFile = void 0;
13
- const node_opcua_basic_types_1 = require("node-opcua-basic-types");
14
- const client_file_1 = require("./client_file");
15
- const read_max_byte_string_length_1 = require("./read_max_byte_string_length");
16
- function getTransportMaxMessageSize(session) {
17
- return session.getTransportSettings ? session.getTransportSettings().maxMessageSize : 0;
18
- }
19
- function readFile(clientFile, options) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- options = options || { chunkSize: yield (0, read_max_byte_string_length_1.readMaxByteStringLength)(clientFile.session) };
22
- let maxBlockSize = options.chunkSize || 1024;
23
- const transportMaxSize = getTransportMaxMessageSize(clientFile.session);
24
- maxBlockSize = transportMaxSize > 0 ? Math.min(maxBlockSize, transportMaxSize) : maxBlockSize;
25
- yield clientFile.open(client_file_1.OpenFileMode.Read);
26
- try {
27
- const fileSize = (0, node_opcua_basic_types_1.coerceInt32)(yield clientFile.size());
28
- /**
29
- * Read file
30
- */
31
- const data = yield clientFile.read(Math.min(fileSize, maxBlockSize));
32
- if (data.length >= fileSize) {
33
- // everything has been read
34
- return data;
35
- }
36
- // wee need to loop to complete the read
37
- const chunks = [data];
38
- let remaining = fileSize - data.length;
39
- while (remaining > 0) {
40
- const buf = yield clientFile.read(Math.min(remaining, maxBlockSize));
41
- if (buf.length === 0)
42
- break;
43
- chunks.push(buf);
44
- remaining -= buf.length;
45
- }
46
- return Buffer.concat(chunks);
47
- }
48
- finally {
49
- yield clientFile.close();
50
- }
51
- });
52
- }
53
- exports.readFile = readFile;
54
- function readOPCUAFile(clientFile) {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- return yield readFile(clientFile);
57
- });
58
- }
59
- exports.readOPCUAFile = readOPCUAFile;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.readOPCUAFile = exports.readFile = void 0;
13
+ const node_opcua_basic_types_1 = require("node-opcua-basic-types");
14
+ const client_file_1 = require("./client_file");
15
+ const read_max_byte_string_length_1 = require("./read_max_byte_string_length");
16
+ function getTransportMaxMessageSize(session) {
17
+ return session.getTransportSettings ? session.getTransportSettings().maxMessageSize : 0;
18
+ }
19
+ function readFile(clientFile, options) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ options = options || { chunkSize: yield (0, read_max_byte_string_length_1.readMaxByteStringLength)(clientFile.session) };
22
+ let maxBlockSize = options.chunkSize || 1024;
23
+ const transportMaxSize = getTransportMaxMessageSize(clientFile.session);
24
+ maxBlockSize = transportMaxSize > 0 ? Math.min(maxBlockSize, transportMaxSize) : maxBlockSize;
25
+ yield clientFile.open(client_file_1.OpenFileMode.Read);
26
+ try {
27
+ const fileSize = (0, node_opcua_basic_types_1.coerceInt32)(yield clientFile.size());
28
+ /**
29
+ * Read file
30
+ */
31
+ const data = yield clientFile.read(Math.min(fileSize, maxBlockSize));
32
+ if (data.length >= fileSize) {
33
+ // everything has been read
34
+ return data;
35
+ }
36
+ // wee need to loop to complete the read
37
+ const chunks = [data];
38
+ let remaining = fileSize - data.length;
39
+ while (remaining > 0) {
40
+ const buf = yield clientFile.read(Math.min(remaining, maxBlockSize));
41
+ if (buf.length === 0)
42
+ break;
43
+ chunks.push(buf);
44
+ remaining -= buf.length;
45
+ }
46
+ return Buffer.concat(chunks);
47
+ }
48
+ finally {
49
+ yield clientFile.close();
50
+ }
51
+ });
52
+ }
53
+ exports.readFile = readFile;
54
+ function readOPCUAFile(clientFile) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ return yield readFile(clientFile);
57
+ });
58
+ }
59
+ exports.readOPCUAFile = readOPCUAFile;
60
60
  //# sourceMappingURL=read_file.js.map
@@ -1,2 +1,2 @@
1
- import { IBasicSession } from "node-opcua-pseudo-session";
2
- export declare function readMaxByteStringLength(session: IBasicSession): Promise<number>;
1
+ import { IBasicSession } from "node-opcua-pseudo-session";
2
+ export declare function readMaxByteStringLength(session: IBasicSession): Promise<number>;
@@ -1,31 +1,31 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.readMaxByteStringLength = void 0;
13
- const node_opcua_basic_types_1 = require("node-opcua-basic-types");
14
- const node_opcua_binary_stream_1 = require("node-opcua-binary-stream");
15
- const node_opcua_constants_1 = require("node-opcua-constants");
16
- const node_opcua_nodeid_1 = require("node-opcua-nodeid");
17
- const node_opcua_status_code_1 = require("node-opcua-status-code");
18
- function readMaxByteStringLength(session) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- const dataValue = yield session.read({
21
- nodeId: (0, node_opcua_nodeid_1.resolveNodeId)(node_opcua_constants_1.VariableIds.Server_ServerCapabilities_MaxByteStringLength),
22
- attributeId: node_opcua_basic_types_1.AttributeIds.Value
23
- });
24
- if (dataValue.statusCode !== node_opcua_status_code_1.StatusCodes.Good) {
25
- return 1024;
26
- }
27
- return dataValue.value.value || node_opcua_binary_stream_1.BinaryStream.maxByteStringLength;
28
- });
29
- }
30
- exports.readMaxByteStringLength = readMaxByteStringLength;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.readMaxByteStringLength = void 0;
13
+ const node_opcua_basic_types_1 = require("node-opcua-basic-types");
14
+ const node_opcua_binary_stream_1 = require("node-opcua-binary-stream");
15
+ const node_opcua_constants_1 = require("node-opcua-constants");
16
+ const node_opcua_nodeid_1 = require("node-opcua-nodeid");
17
+ const node_opcua_status_code_1 = require("node-opcua-status-code");
18
+ function readMaxByteStringLength(session) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ const dataValue = yield session.read({
21
+ nodeId: (0, node_opcua_nodeid_1.resolveNodeId)(node_opcua_constants_1.VariableIds.Server_ServerCapabilities_MaxByteStringLength),
22
+ attributeId: node_opcua_basic_types_1.AttributeIds.Value
23
+ });
24
+ if (dataValue.statusCode !== node_opcua_status_code_1.StatusCodes.Good) {
25
+ return 1024;
26
+ }
27
+ return dataValue.value.value || node_opcua_binary_stream_1.BinaryStream.maxByteStringLength;
28
+ });
29
+ }
30
+ exports.readMaxByteStringLength = readMaxByteStringLength;
31
31
  //# sourceMappingURL=read_max_byte_string_length.js.map
@@ -1,4 +1,4 @@
1
- import { IClientFile } from "./client_file";
2
- export declare function writeOPCUAFile(clientFile: IClientFile, filePath: string, { chunkSize }: {
3
- chunkSize?: number;
4
- }): Promise<void>;
1
+ import { IClientFile } from "./client_file";
2
+ export declare function writeOPCUAFile(clientFile: IClientFile, filePath: string, { chunkSize }: {
3
+ chunkSize?: number;
4
+ }): Promise<void>;
@@ -1,66 +1,66 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.writeOPCUAFile = void 0;
13
- const fs = require("node:fs");
14
- const node_stream_1 = require("node:stream");
15
- const promises_1 = require("node:stream/promises");
16
- const node_opcua_binary_stream_1 = require("node-opcua-binary-stream");
17
- const node_opcua_debug_1 = require("node-opcua-debug");
18
- const client_file_1 = require("./client_file");
19
- const read_max_byte_string_length_1 = require("./read_max_byte_string_length");
20
- const debugLog = (0, node_opcua_debug_1.make_debugLog)("FileType");
21
- // const errorLog = make_errorLog("FileType");
22
- // const warningLog = make_warningLog("FileType");
23
- const doDebug = (0, node_opcua_debug_1.checkDebugFlag)("FileType");
24
- function getTransportMaxMessageSize(session) {
25
- return session.getTransportSettings ? session.getTransportSettings().maxMessageSize : 0;
26
- }
27
- function writeOPCUAFile(clientFile, filePath, { chunkSize }) {
28
- return __awaiter(this, void 0, void 0, function* () {
29
- const maxMessageSize = getTransportMaxMessageSize(clientFile.session);
30
- chunkSize = chunkSize === undefined ? yield (0, read_max_byte_string_length_1.readMaxByteStringLength)(clientFile.session) : chunkSize;
31
- chunkSize = Math.min(chunkSize, node_opcua_binary_stream_1.BinaryStream.maxByteStringLength);
32
- if (maxMessageSize > 200) {
33
- chunkSize = Math.min(chunkSize, maxMessageSize - 1000);
34
- }
35
- console.log("chunkSize = ", chunkSize, maxMessageSize);
36
- if (!fs.existsSync(filePath)) {
37
- throw new Error(`File ${filePath} does not exist`);
38
- }
39
- const readStream = fs.createReadStream(filePath, { highWaterMark: chunkSize });
40
- yield clientFile.open(client_file_1.OpenFileMode.WriteEraseExisting);
41
- yield clientFile.setPosition(0);
42
- try {
43
- const outStream = new node_stream_1.Writable({
44
- write(chunk, encoding, callback) {
45
- doDebug && debugLog("writing chunk", chunk.length);
46
- clientFile
47
- .write(chunk)
48
- .then(() => callback())
49
- .catch((err) => callback(err));
50
- }
51
- });
52
- // note: pipeline requires NodeJS 15 or above
53
- yield (0, promises_1.pipeline)(readStream, outStream);
54
- }
55
- catch (e) {
56
- debugLog(e.message);
57
- throw e;
58
- }
59
- finally {
60
- doDebug && debugLog("closing the OPCUA File");
61
- yield clientFile.close();
62
- }
63
- });
64
- }
65
- exports.writeOPCUAFile = writeOPCUAFile;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.writeOPCUAFile = void 0;
13
+ const fs = require("node:fs");
14
+ const node_stream_1 = require("node:stream");
15
+ const promises_1 = require("node:stream/promises");
16
+ const node_opcua_binary_stream_1 = require("node-opcua-binary-stream");
17
+ const node_opcua_debug_1 = require("node-opcua-debug");
18
+ const client_file_1 = require("./client_file");
19
+ const read_max_byte_string_length_1 = require("./read_max_byte_string_length");
20
+ const debugLog = (0, node_opcua_debug_1.make_debugLog)("FileType");
21
+ // const errorLog = make_errorLog("FileType");
22
+ // const warningLog = make_warningLog("FileType");
23
+ const doDebug = (0, node_opcua_debug_1.checkDebugFlag)("FileType");
24
+ function getTransportMaxMessageSize(session) {
25
+ return session.getTransportSettings ? session.getTransportSettings().maxMessageSize : 0;
26
+ }
27
+ function writeOPCUAFile(clientFile, filePath, { chunkSize }) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ const maxMessageSize = getTransportMaxMessageSize(clientFile.session);
30
+ chunkSize = chunkSize === undefined ? yield (0, read_max_byte_string_length_1.readMaxByteStringLength)(clientFile.session) : chunkSize;
31
+ chunkSize = Math.min(chunkSize, node_opcua_binary_stream_1.BinaryStream.maxByteStringLength);
32
+ if (maxMessageSize > 200) {
33
+ chunkSize = Math.min(chunkSize, maxMessageSize - 1000);
34
+ }
35
+ console.log("chunkSize = ", chunkSize, maxMessageSize);
36
+ if (!fs.existsSync(filePath)) {
37
+ throw new Error(`File ${filePath} does not exist`);
38
+ }
39
+ const readStream = fs.createReadStream(filePath, { highWaterMark: chunkSize });
40
+ yield clientFile.open(client_file_1.OpenFileMode.WriteEraseExisting);
41
+ yield clientFile.setPosition(0);
42
+ try {
43
+ const outStream = new node_stream_1.Writable({
44
+ write(chunk, encoding, callback) {
45
+ doDebug && debugLog("writing chunk", chunk.length);
46
+ clientFile
47
+ .write(chunk)
48
+ .then(() => callback())
49
+ .catch((err) => callback(err));
50
+ }
51
+ });
52
+ // note: pipeline requires NodeJS 15 or above
53
+ yield (0, promises_1.pipeline)(readStream, outStream);
54
+ }
55
+ catch (e) {
56
+ debugLog(e.message);
57
+ throw e;
58
+ }
59
+ finally {
60
+ doDebug && debugLog("closing the OPCUA File");
61
+ yield clientFile.close();
62
+ }
63
+ });
64
+ }
65
+ exports.writeOPCUAFile = writeOPCUAFile;
66
66
  //# sourceMappingURL=write_file.js.map
@@ -1,19 +1,19 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- /// <reference types="node" />
4
- import { Stats, PathLike, OpenMode, NoParamCallback, WriteFileOptions } from "fs";
5
- export interface ReadStreamOptions {
6
- }
7
- export interface AbstractFs {
8
- stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
9
- open(path: PathLike, flags: OpenMode, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
10
- write<TBuffer extends NodeJS.ArrayBufferView>(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffer: TBuffer) => void): void;
11
- read<TBuffer extends NodeJS.ArrayBufferView>(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void): void;
12
- close(fd: number, callback: NoParamCallback): void;
13
- writeFile(path: PathLike | number, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void;
14
- readFile(path: PathLike | number, options: {
15
- encoding: BufferEncoding;
16
- flag?: string;
17
- } | string, callback: (err: NodeJS.ErrnoException | null, data: string) => void): void;
18
- existsSync(filename: string): boolean;
19
- }
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
4
+ import { Stats, PathLike, OpenMode, NoParamCallback, WriteFileOptions } from "fs";
5
+ export interface ReadStreamOptions {
6
+ }
7
+ export interface AbstractFs {
8
+ stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
9
+ open(path: PathLike, flags: OpenMode, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
10
+ write<TBuffer extends NodeJS.ArrayBufferView>(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffer: TBuffer) => void): void;
11
+ read<TBuffer extends NodeJS.ArrayBufferView>(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void): void;
12
+ close(fd: number, callback: NoParamCallback): void;
13
+ writeFile(path: PathLike | number, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void;
14
+ readFile(path: PathLike | number, options: {
15
+ encoding: BufferEncoding;
16
+ flag?: string;
17
+ } | string, callback: (err: NodeJS.ErrnoException | null, data: string) => void): void;
18
+ existsSync(filename: string): boolean;
19
+ }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=abstract_fs.js.map
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- /**
2
- * @module node-opcua-file-transfer
3
- */
4
- export * from "./client";
5
- export * from "./server/file_type_helpers";
6
- export * from "./common/abstract_fs";
1
+ /**
2
+ * @module node-opcua-file-transfer
3
+ */
4
+ export * from "./client";
5
+ export * from "./server/file_type_helpers";
6
+ export * from "./common/abstract_fs";
package/dist/index.js CHANGED
@@ -1,23 +1,23 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- /**
18
- * @module node-opcua-file-transfer
19
- */
20
- __exportStar(require("./client"), exports);
21
- __exportStar(require("./server/file_type_helpers"), exports);
22
- __exportStar(require("./common/abstract_fs"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * @module node-opcua-file-transfer
19
+ */
20
+ __exportStar(require("./client"), exports);
21
+ __exportStar(require("./server/file_type_helpers"), exports);
22
+ __exportStar(require("./common/abstract_fs"), exports);
23
23
  //# sourceMappingURL=index.js.map
@@ -1,39 +1,39 @@
1
- /**
2
- * @module node-opcua-file-transfer-server
3
- */
4
- export declare enum OpenFileModeMask {
5
- ReadBit = 1,
6
- WriteBit = 2,
7
- EraseExistingBit = 4,
8
- AppendBit = 8
9
- }
10
- export declare enum OpenFileMode {
11
- /**
12
- * Read bit 0 The file is opened for reading. If this bit is not
13
- * set the Read Method cannot be executed.
14
- */
15
- Read = 1,
16
- /**
17
- * Write bit 1 The file is opened for writing. If this bit is not
18
- * set the Write Method cannot be executed.
19
- *
20
- */
21
- Write = 2,
22
- ReadWrite = 3,
23
- /**
24
- *
25
- * WriteEraseExisting
26
- * EraseExisting 2 This bit can only be set if the file is opened for writing
27
- * (Write bit is set). The existing content of the file is
28
- * erased and an empty file is provided.
29
- */
30
- WriteEraseExisting = 6,
31
- ReadWriteEraseExisting = 7,
32
- /**
33
- * Append 3 When the Append bit is set the file is opened at end
34
- * of the file, otherwise at begin of the file.
35
- * The SetPosition Method can be used to change the position.
36
- */
37
- WriteAppend = 10,
38
- ReadWriteAppend = 11
39
- }
1
+ /**
2
+ * @module node-opcua-file-transfer-server
3
+ */
4
+ export declare enum OpenFileModeMask {
5
+ ReadBit = 1,
6
+ WriteBit = 2,
7
+ EraseExistingBit = 4,
8
+ AppendBit = 8
9
+ }
10
+ export declare enum OpenFileMode {
11
+ /**
12
+ * Read bit 0 The file is opened for reading. If this bit is not
13
+ * set the Read Method cannot be executed.
14
+ */
15
+ Read = 1,
16
+ /**
17
+ * Write bit 1 The file is opened for writing. If this bit is not
18
+ * set the Write Method cannot be executed.
19
+ *
20
+ */
21
+ Write = 2,
22
+ ReadWrite = 3,
23
+ /**
24
+ *
25
+ * WriteEraseExisting
26
+ * EraseExisting 2 This bit can only be set if the file is opened for writing
27
+ * (Write bit is set). The existing content of the file is
28
+ * erased and an empty file is provided.
29
+ */
30
+ WriteEraseExisting = 6,
31
+ ReadWriteEraseExisting = 7,
32
+ /**
33
+ * Append 3 When the Append bit is set the file is opened at end
34
+ * of the file, otherwise at begin of the file.
35
+ * The SetPosition Method can be used to change the position.
36
+ */
37
+ WriteAppend = 10,
38
+ ReadWriteAppend = 11
39
+ }