@trap_stevo/filenet 0.0.48 → 0.0.50
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/SCL-1.0-Universal.md +228 -0
- package/dist/cjs/anchor.js +120 -0
- package/dist/cjs/index.js +107 -105
- package/package.json +6 -6
- package/LICENSE.md +0 -79
- package/dist/cjs/filenet.js +0 -93
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# SCL-1.0-Universal — Steven Compton Universal License v1.0
|
|
2
|
+
(Source-Available, No Redistribution, No Reverse Engineering)
|
|
3
|
+
|
|
4
|
+
**Effective Date:** September 10, 2024
|
|
5
|
+
**Licensor:** Hassan Steven Compton (Steven Compton) (“Licensor”)
|
|
6
|
+
**Package:** @trap_stevo/filenet (“Package”)
|
|
7
|
+
**Licensee:** Any individual or entity installing, using, referencing, or integrating the “Package”
|
|
8
|
+
|
|
9
|
+
**SPDX Identifier:** SCL-1.0-Universal
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 1. Definitions
|
|
14
|
+
|
|
15
|
+
### **1.1 “Package”**
|
|
16
|
+
Refers to the software identified as @trap_stevo/filenet, including its source code, object code, binaries, compiled outputs, metadata, and documentation.
|
|
17
|
+
|
|
18
|
+
### **1.2 “Source Code”**
|
|
19
|
+
Human-readable implementation of the “Package”, whether distributed or not.
|
|
20
|
+
|
|
21
|
+
### **1.3 “Dependent System”**
|
|
22
|
+
Means any system, software, hardware, firmware, service, device, environment, runtime, application, platform, embedded implementation, virtual machine, cloud service, or any other construct that uses, integrates, links to, or depends upon the “Package”, directly or indirectly, without including or exposing the “Package’s” code or internal structure.
|
|
23
|
+
|
|
24
|
+
### **1.4 “Derivative Work”**
|
|
25
|
+
Any software, product, service, system, or implementation based on or derived from the “Package’s” source code, object code, architecture, structure, behavior, or design, in part or in whole.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. Ownership
|
|
30
|
+
|
|
31
|
+
The “Licensor” retains exclusive ownership of all rights, title, and interest in and to the “Package”, including all associated intellectual property.
|
|
32
|
+
|
|
33
|
+
This Agreement transfers no ownership rights to the “Licensee”.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 3. Grant of License
|
|
38
|
+
|
|
39
|
+
Subject to all terms of this Agreement, the “Licensor” grants the “Licensee” a limited, non-exclusive, revocable, non-transferable, and non-sublicensable license to:
|
|
40
|
+
|
|
41
|
+
1. Use the “Package” as a dependency in “Dependent Systems” created by the “Licensee”.
|
|
42
|
+
2. Distribute “Dependent Systems”, provided the “Package” is **never** included, exposed, modified, redistributed, or replicated in any form.
|
|
43
|
+
|
|
44
|
+
Nothing in this Agreement grants the “Licensee” permission to:
|
|
45
|
+
|
|
46
|
+
- modify the “Package”
|
|
47
|
+
- redistribute the “Package”
|
|
48
|
+
- fork the “Package”
|
|
49
|
+
- repackage the “Package”
|
|
50
|
+
- host the “Package”
|
|
51
|
+
- analyze the “Package”
|
|
52
|
+
- expose internal behavior of the “Package”
|
|
53
|
+
- create derivative or competing software based on the “Package”
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 4. Prohibited Uses
|
|
58
|
+
|
|
59
|
+
Without the express written permission of the “Licensor”, the “Licensee” shall not:
|
|
60
|
+
|
|
61
|
+
1. Modify, decompile, reverse-engineer, or disassemble the “Package” in any way.
|
|
62
|
+
2. Include the “Package’s” source code or object code in any distributed software, service, or application.
|
|
63
|
+
3. Use the “Package” to create a competing product or service that replicates the functionality of the “Package”.
|
|
64
|
+
4. Make the “Package” publicly available, including uploading it to public repositories or including it in distributed software bundles.
|
|
65
|
+
5. Attempt to extract or analyze the functionality, structure, or behavior of the “Package” through runtime inspection, instrumentation, reflection, or behavioral analysis.
|
|
66
|
+
6. Privately share, sublicense, or distribute the “Package” or any portion thereof, whether internally within an organization or externally to any third party, without written authorization.
|
|
67
|
+
7. Remove, obscure, obfuscate, or alter any attribution, copyright notices, proprietary labels, or identifiers included in the “Package”.
|
|
68
|
+
8. Re-upload, rename, fork, or redistribute the “Package” or any portion thereof on any registry, platform, or namespace other than that explicitly maintained or authorized by the “Licensor”.
|
|
69
|
+
9. Use the “Package” in any way that violates applicable laws, infringes on third-party rights, or breaches this Agreement.
|
|
70
|
+
|
|
71
|
+
Any attempt to bypass or circumvent these restrictions constitutes a material breach.
|
|
72
|
+
|
|
73
|
+
### 4.A. No Competitive Re-implementation
|
|
74
|
+
|
|
75
|
+
“Licensee” shall not create, develop, train, test, benchmark, or distribute any software, system, service, model, or method that uses, incorporates, is derived from, or is based upon the “Package’s” source code, object code, algorithms, data structures, interfaces, protocols, internal behavior, design, architecture, or execution characteristics for the purpose of creating a product or service that provides substantially similar functionality to the “Package”, competes with the “Package”, or reproduces its core operations.
|
|
76
|
+
|
|
77
|
+
“Licensee” shall not directly or indirectly analyze, observe, measure, study, or evaluate the behavior, performance, outputs, or internal characteristics of the “Package” for the purpose of creating, validating, training, improving, or assisting any competing or functionally similar software, system, service, or model.
|
|
78
|
+
|
|
79
|
+
Any such activity shall constitute creation of an unauthorized derivative work and is strictly prohibited.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 5. Dependent System Requirements
|
|
84
|
+
|
|
85
|
+
The “Licensee” may create and distribute “Dependent Systems” only if all of the following conditions are met:
|
|
86
|
+
|
|
87
|
+
1. The “Dependent System” does **not** include or expose any portion of the “Package’s” source code or object code.
|
|
88
|
+
2. The “Dependent System” identifies the “Package” as a dependency in its documentation.
|
|
89
|
+
3. The “Dependent System” provides substantial original functionality.
|
|
90
|
+
4. The “Dependent System” does not replicate, emulate, reimplement, or mimic any significant part of the “Package’s” behavior or design.
|
|
91
|
+
5. The “Dependent System” complies fully with this Agreement.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 6. Request for Additional Permissions
|
|
96
|
+
|
|
97
|
+
The “Licensee” may request additional rights by contacting:
|
|
98
|
+
|
|
99
|
+
**h.steven.compton13@gmail.com**
|
|
100
|
+
|
|
101
|
+
Requests must:
|
|
102
|
+
|
|
103
|
+
1. Be submitted in writing
|
|
104
|
+
2. Describe purpose, scope, and distribution method
|
|
105
|
+
|
|
106
|
+
The “Licensor” may:
|
|
107
|
+
|
|
108
|
+
- approve or deny at sole discretion
|
|
109
|
+
- impose additional terms
|
|
110
|
+
- revoke previously granted permissions with written notice
|
|
111
|
+
|
|
112
|
+
All permissions must be explicit and in writing.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## 7. Violation of Terms (Termination)
|
|
117
|
+
|
|
118
|
+
1. Any violation of this Agreement results in immediate termination of all licensed rights.
|
|
119
|
+
2. Upon termination, the “Licensee” must:
|
|
120
|
+
- cease all use of the “Package”
|
|
121
|
+
- remove the “Package” from all systems and environments
|
|
122
|
+
- destroy all copies, including caches and build artifacts
|
|
123
|
+
- confirm destruction in writing if requested
|
|
124
|
+
3. The “Licensor” may pursue damages, injunctive relief, or any other legal remedy.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 8. No Warranty
|
|
129
|
+
|
|
130
|
+
The “Package” is provided **“AS IS”**, without any warranty, express or implied, including but not limited to merchantability, fitness for a particular purpose, or non-infringement.
|
|
131
|
+
|
|
132
|
+
The “Licensee” assumes all risk associated with use.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 9. Intellectual Property Limitations
|
|
137
|
+
|
|
138
|
+
Nothing in this Agreement grants the “Licensee” any rights under any patent, whether by implication, estoppel, exhaustion, or otherwise. Any use of the “Package” that would require a patent license must receive separate written permission from the “Licensor”.
|
|
139
|
+
|
|
140
|
+
This Agreement also grants no rights to use the “Licensor’s” trademarks, service marks, branding, logos, product names, or organizational names. Any such use requires separate written permission.
|
|
141
|
+
|
|
142
|
+
No patent rights, trademark rights, or branding rights are provided or implied by this license.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 10. Patent Rights and Restrictions
|
|
147
|
+
|
|
148
|
+
### 10.1 No Implied Patent License
|
|
149
|
+
|
|
150
|
+
Except as expressly stated in this Section, the “Licensor” grants no license, covenant, immunity, or right under any patent or patent application owned, controlled, or licensable by the “Licensor”. All such rights are expressly reserved.
|
|
151
|
+
|
|
152
|
+
### 10.2 Patent Grant for Non-Competitive Use
|
|
153
|
+
|
|
154
|
+
Subject to full compliance with this Agreement, the “Licensor” grants the “Licensee” a limited, non-exclusive, non-transferable, revocable, royalty-free patent license to use any patent claims embodied in the “Package” solely to the extent necessary to use the unmodified “Package” as permitted under Section 3.
|
|
155
|
+
|
|
156
|
+
This grant does not extend to:
|
|
157
|
+
|
|
158
|
+
- derivative works
|
|
159
|
+
|
|
160
|
+
- competing software
|
|
161
|
+
|
|
162
|
+
- re-implementations
|
|
163
|
+
|
|
164
|
+
- architectural replications
|
|
165
|
+
|
|
166
|
+
- alternative implementations of patented methods
|
|
167
|
+
|
|
168
|
+
- any use not directly involving the unmodified “Package”
|
|
169
|
+
|
|
170
|
+
### 10.3 Patent Restriction for Competing Systems
|
|
171
|
+
|
|
172
|
+
No patent license is granted for any software, system, service, or model that:
|
|
173
|
+
|
|
174
|
+
- competes with the “Package”,
|
|
175
|
+
|
|
176
|
+
- provides substantially similar core functionality,
|
|
177
|
+
|
|
178
|
+
- implements any patented algorithm, method, design, architecture, or process used by the Package, or
|
|
179
|
+
|
|
180
|
+
- is a re-implementation or functional substitute of the “Package”.
|
|
181
|
+
|
|
182
|
+
Any such use constitutes patent infringement and is prohibited.
|
|
183
|
+
|
|
184
|
+
### 10.4 Termination of Patent Rights
|
|
185
|
+
|
|
186
|
+
Any violation of this Agreement immediately terminates all patent licenses granted herein. Upon termination, Licensee must cease all uses of the patented subject matter and destroy any implementations utilizing such technology.
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 11. Indemnification
|
|
191
|
+
|
|
192
|
+
The “Licensee” agrees to indemnify and hold harmless the “Licensor” from any claims, damages, liabilities, losses, or expenses arising from:
|
|
193
|
+
|
|
194
|
+
- violation of this Agreement
|
|
195
|
+
- misuse of the “Package”
|
|
196
|
+
- unlawful or infringing use
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## 12. Governing Law & Dispute Resolution
|
|
201
|
+
|
|
202
|
+
This Agreement is governed by the laws of **Georgia, United States**, without regard to conflict-of-law principles.
|
|
203
|
+
|
|
204
|
+
All disputes shall be resolved exclusively through binding arbitration in **Georgia, United States**.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 13. Amendments
|
|
209
|
+
|
|
210
|
+
The “Licensor” may modify this Agreement at any time.
|
|
211
|
+
|
|
212
|
+
Changes take effect 30 days after posting at:
|
|
213
|
+
|
|
214
|
+
**https://www.npmjs.com/package/@trap_stevo/filenet**
|
|
215
|
+
|
|
216
|
+
Continued use of the “Package” constitutes acceptance of the updated terms.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## 14. Applicability to All Versions
|
|
221
|
+
|
|
222
|
+
This Agreement applies to **all versions** of the “Package” downloaded, installed, or used on or after the Effective Date.
|
|
223
|
+
|
|
224
|
+
Use of any version after this date constitutes acceptance of this License unless explicitly overridden by the “Licensor”.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
**SPDX-License-Identifier: SCL-1.0-Universal**
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const FileTideClient = require("@trap_stevo/filetide-client");
|
|
5
|
+
const FileTide = require("@trap_stevo/filetide");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const Anchor = require("../dist/cjs/index.js");
|
|
8
|
+
const args = process.argv.slice(2);
|
|
9
|
+
let configFilePath = null;
|
|
10
|
+
const positionalArgs = [];
|
|
11
|
+
const flags = {};
|
|
12
|
+
let noMessager = false;
|
|
13
|
+
for (let i = 0; i < args.length; i++) {
|
|
14
|
+
const arg = args[i];
|
|
15
|
+
if (arg === "--config" && args[i + 1]) {
|
|
16
|
+
configFilePath = args[i + 1];
|
|
17
|
+
i++;
|
|
18
|
+
} else if (arg === "--no-messager") {
|
|
19
|
+
noMessager = true;
|
|
20
|
+
} else if (arg.startsWith("--")) {
|
|
21
|
+
const flagName = arg.slice(2);
|
|
22
|
+
const flagValue = args[i + 1] && !args[i + 1].startsWith("--") ? args[i + 1] : true;
|
|
23
|
+
flags[flagName] = flagValue;
|
|
24
|
+
if (flagValue !== true) {
|
|
25
|
+
i++;
|
|
26
|
+
}
|
|
27
|
+
} else {
|
|
28
|
+
positionalArgs.push(arg);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const parseJSON = (value, fallback = {}) => {
|
|
32
|
+
if (!value) {
|
|
33
|
+
return fallback;
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
return JSON.parse(value);
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.error(`[FileTide ~ Anchor] ~ Could not parse configuration ~ ${error.message}`);
|
|
39
|
+
return fallback;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
let config = {};
|
|
43
|
+
if (configFilePath) {
|
|
44
|
+
try {
|
|
45
|
+
const fileData = fs.readFileSync(configFilePath, "utf-8");
|
|
46
|
+
config = JSON.parse(fileData);
|
|
47
|
+
console.log("Config file loaded: ", configFilePath);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.error("Could not read or parse config file: ", error.message);
|
|
50
|
+
config = {};
|
|
51
|
+
console.log("Proceeding using default configurations...");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const port = Number(flags.port || positionalArgs[0] || config.port || 8869);
|
|
55
|
+
const serverUrl = flags["server-url"] || positionalArgs[1] || config.serverUrl || `http://localhost:${port}`;
|
|
56
|
+
const room = flags.room || positionalArgs[2] || config.room || "file-room";
|
|
57
|
+
const anchorID = flags["anchor-id"] || flags["client-id"] || positionalArgs[3] || config.anchorID || config.clientID || "FileTideAnchor";
|
|
58
|
+
const anchorOptions = {
|
|
59
|
+
port,
|
|
60
|
+
...config.options,
|
|
61
|
+
...config.anchorOptions,
|
|
62
|
+
...parseJSON(positionalArgs[4])
|
|
63
|
+
};
|
|
64
|
+
const connectionOptions = {
|
|
65
|
+
maxHttpBufferSize: 5e9,
|
|
66
|
+
pingTimeout: 3600000,
|
|
67
|
+
pingInterval: 60000,
|
|
68
|
+
...config.messagerOptions,
|
|
69
|
+
...config.connectionOptions,
|
|
70
|
+
...parseJSON(positionalArgs[5])
|
|
71
|
+
};
|
|
72
|
+
const transportOptions = {
|
|
73
|
+
parallelChunks: 3,
|
|
74
|
+
maxRetries: 3,
|
|
75
|
+
...config.transportOptions,
|
|
76
|
+
...parseJSON(positionalArgs[6])
|
|
77
|
+
};
|
|
78
|
+
const messagerSettings = {
|
|
79
|
+
maxReconnectionAttempts: 15,
|
|
80
|
+
reconnectionAttempts: 15,
|
|
81
|
+
maxReconnectionDelay: 10000,
|
|
82
|
+
...config.messagerSettings,
|
|
83
|
+
...parseJSON(positionalArgs[7])
|
|
84
|
+
};
|
|
85
|
+
const enableTransferBarrier = config.enableTransferBarrier ?? true;
|
|
86
|
+
const debugMode = config.debugMode ?? false;
|
|
87
|
+
const anchor = new Anchor(debugMode);
|
|
88
|
+
anchor.launch(anchorID, anchorOptions, anchorInstance => {
|
|
89
|
+
if (noMessager) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const fileTideClient = new FileTideClient(anchorID, serverUrl, room, true, false, false, debugMode);
|
|
93
|
+
fileTideClient.startClient({}, connectionOptions, transportOptions, messagerSettings, () => {
|
|
94
|
+
FileTide.outputGradient(`[FileTide ~ Anchor] ~ Tider ~ ${anchorID} online in ${room}!`, ["#00C897", "#00E0FF"]);
|
|
95
|
+
}, () => {}, {
|
|
96
|
+
enableTransferBarrier,
|
|
97
|
+
onIncomingTransfer: (transferData, forwardResponse) => {
|
|
98
|
+
FileTide.outputGradient(`${transferData.clientID} wants ${transferData.transferType === "requestSend" ? "you to send:" : "to transfer you:"}\n\n\t${transferData.path}.\n\nDo you accept (Y/n)?`, ["#3c97b0", "#7addeb"]);
|
|
99
|
+
if (config.autoAccept) {
|
|
100
|
+
forwardResponse(true, transferData);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (Array.isArray(config.acceptForClients) && config.acceptForClients.includes(transferData.clientID)) {
|
|
104
|
+
forwardResponse(true, transferData);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (config.autoDeny) {
|
|
108
|
+
forwardResponse(false, transferData);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (Array.isArray(config.denyForClients) && config.denyForClients.includes(transferData.clientID)) {
|
|
112
|
+
forwardResponse(false, transferData);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
onTransferFailure: data => {
|
|
117
|
+
FileTide.outputGradient(`[FileTide ~ Anchor] ~ Transfer failed ~ ${data.fileName}${data.reason ? `\n${data.reason}` : ""}`, ["#F94144", "#F3722C"]);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}, config.onTideAction || null, transportOptions, ...(Array.isArray(config.anchorConfigurations) ? config.anchorConfigurations : []));
|
package/dist/cjs/index.js
CHANGED
|
@@ -6,469 +6,471 @@ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
|
6
6
|
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
7
7
|
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
8
8
|
const FileTide = require("@trap_stevo/filetide");
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
9
|
+
var _onAnchorTideAction = /*#__PURE__*/new WeakMap();
|
|
10
|
+
var _onAnchorLaunch = /*#__PURE__*/new WeakMap();
|
|
11
|
+
var _anchorConfigurations = /*#__PURE__*/new WeakMap();
|
|
12
12
|
var _transportOptions = /*#__PURE__*/new WeakMap();
|
|
13
|
-
var
|
|
14
|
-
class
|
|
13
|
+
var _anchorOptions = /*#__PURE__*/new WeakMap();
|
|
14
|
+
class Anchor {
|
|
15
15
|
constructor(debugMode = true) {
|
|
16
|
-
_classPrivateFieldInitSpec(this,
|
|
17
|
-
_classPrivateFieldInitSpec(this,
|
|
18
|
-
_classPrivateFieldInitSpec(this,
|
|
16
|
+
_classPrivateFieldInitSpec(this, _onAnchorTideAction, null);
|
|
17
|
+
_classPrivateFieldInitSpec(this, _onAnchorLaunch, null);
|
|
18
|
+
_classPrivateFieldInitSpec(this, _anchorConfigurations, []);
|
|
19
19
|
_classPrivateFieldInitSpec(this, _transportOptions, {});
|
|
20
|
-
_classPrivateFieldInitSpec(this,
|
|
21
|
-
this.
|
|
20
|
+
_classPrivateFieldInitSpec(this, _anchorOptions, {});
|
|
21
|
+
this.anchorManager = new FileTide(debugMode);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
// ---
|
|
25
|
+
// --- Anchor Gateway Management ---
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
get anchor() {
|
|
28
|
+
return this.anchorManager.anchor ?? null;
|
|
29
|
+
}
|
|
30
|
+
launch(anchorID, anchorOptions = {}, onLaunch, onTideAction = null, transportOptions = {
|
|
28
31
|
parallelChunks: 3,
|
|
29
32
|
maxRetries: 3
|
|
30
|
-
}, ...
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
_classPrivateFieldSet(
|
|
34
|
-
_classPrivateFieldSet(
|
|
35
|
-
_classPrivateFieldSet(
|
|
33
|
+
}, ...anchorConfigurations) {
|
|
34
|
+
this.anchorManager.launchFileTide(anchorOptions, onLaunch, transportOptions, onTideAction, ...anchorConfigurations);
|
|
35
|
+
this.anchorManager.currentUserID = anchorID;
|
|
36
|
+
_classPrivateFieldSet(_onAnchorTideAction, this, onTideAction);
|
|
37
|
+
_classPrivateFieldSet(_onAnchorLaunch, this, onLaunch);
|
|
38
|
+
_classPrivateFieldSet(_anchorConfigurations, this, anchorConfigurations);
|
|
36
39
|
_classPrivateFieldSet(_transportOptions, this, transportOptions);
|
|
37
|
-
_classPrivateFieldSet(
|
|
40
|
+
_classPrivateFieldSet(_anchorOptions, this, anchorOptions);
|
|
38
41
|
return;
|
|
39
42
|
}
|
|
40
43
|
|
|
41
|
-
// ---
|
|
44
|
+
// --- Anchor TideToken Enforcement Management ---
|
|
42
45
|
|
|
43
46
|
updateTideTokenEnforcementCallbackConfigurations(updatedConfigurations = {}) {
|
|
44
|
-
this.
|
|
47
|
+
this.anchorManager.updateTideTokenEnforcementCallbackConfigurations(updatedConfigurations);
|
|
45
48
|
}
|
|
46
49
|
async registerTideToken(tideToken, meta = {}) {
|
|
47
|
-
return await this.
|
|
50
|
+
return await this.anchorManager.registerTideToken(tideToken, meta);
|
|
48
51
|
}
|
|
49
52
|
async inspectTideToken(tideToken) {
|
|
50
|
-
return await this.
|
|
53
|
+
return await this.anchorManager.inspectTideToken(tideToken);
|
|
51
54
|
}
|
|
52
55
|
getTideTokenEnforcerOverviewMetrics() {
|
|
53
|
-
return this.
|
|
56
|
+
return this.anchorManager.getTideTokenEnforcerOverviewMetrics();
|
|
54
57
|
}
|
|
55
58
|
getTideToken(scope = "default") {
|
|
56
|
-
return this.
|
|
59
|
+
return this.anchorManager.getTideToken(scope);
|
|
57
60
|
}
|
|
58
61
|
|
|
59
|
-
// ---
|
|
62
|
+
// --- Anchor Tidalytics Management ---
|
|
60
63
|
|
|
61
64
|
async getTidalyticsSince(interval = "1d", source = "storage", filter = {}) {
|
|
62
65
|
if (!this.operational()) {
|
|
63
66
|
return null;
|
|
64
67
|
}
|
|
65
|
-
return await this.
|
|
68
|
+
return await this.anchor.getTidalyticsSince(interval, source, filter);
|
|
66
69
|
}
|
|
67
70
|
async getTidalyticsBetween(start, end, source = "both", filter = {}) {
|
|
68
71
|
if (!this.operational()) {
|
|
69
72
|
return null;
|
|
70
73
|
}
|
|
71
|
-
return await this.
|
|
74
|
+
return await this.anchor.getTidalyticsBetween(start, end, source, filter);
|
|
72
75
|
}
|
|
73
76
|
async getStoredTidalytics(filter = {}) {
|
|
74
77
|
if (!this.operational()) {
|
|
75
78
|
return null;
|
|
76
79
|
}
|
|
77
|
-
return await this.
|
|
80
|
+
return await this.anchor.getStoredTidalytics(filter);
|
|
78
81
|
}
|
|
79
82
|
async getTidalyticsFromDomains(domains = [], options = {}) {
|
|
80
83
|
if (!this.operational()) {
|
|
81
84
|
return null;
|
|
82
85
|
}
|
|
83
|
-
return await this.
|
|
86
|
+
return await this.anchor.getTidalyticsFromDomains(domains, options);
|
|
84
87
|
}
|
|
85
88
|
async getTidalyticsInDomain(domain, options = {}) {
|
|
86
89
|
if (!this.operational()) {
|
|
87
90
|
return null;
|
|
88
91
|
}
|
|
89
|
-
return await this.
|
|
92
|
+
return await this.anchor.getTidalyticsInDomain(domain, options);
|
|
90
93
|
}
|
|
91
94
|
getTidalytics(filter = {}) {
|
|
92
95
|
if (!this.operational()) {
|
|
93
96
|
return null;
|
|
94
97
|
}
|
|
95
|
-
return this.
|
|
98
|
+
return this.anchor.getTidalytics(filter);
|
|
96
99
|
}
|
|
97
100
|
getTidalyticByID(id) {
|
|
98
101
|
if (!this.operational()) {
|
|
99
102
|
return null;
|
|
100
103
|
}
|
|
101
|
-
return this.
|
|
104
|
+
return this.anchor.getTidalyticByID(id);
|
|
102
105
|
}
|
|
103
106
|
searchTidalyticByTagValue(key, match) {
|
|
104
107
|
if (!this.operational()) {
|
|
105
108
|
return null;
|
|
106
109
|
}
|
|
107
|
-
return this.
|
|
110
|
+
return this.anchor.searchTidalyticByTagValue(key, match);
|
|
108
111
|
}
|
|
109
112
|
getTidalyticAggregate(name) {
|
|
110
113
|
if (!this.operational()) {
|
|
111
114
|
return null;
|
|
112
115
|
}
|
|
113
|
-
return this.
|
|
116
|
+
return this.anchor.getTidalyticAggregate(name);
|
|
114
117
|
}
|
|
115
118
|
getTidalyticAggregateByType(type) {
|
|
116
119
|
if (!this.operational()) {
|
|
117
120
|
return null;
|
|
118
121
|
}
|
|
119
|
-
return this.
|
|
122
|
+
return this.anchor.getTidalyticAggregateByType(type);
|
|
120
123
|
}
|
|
121
124
|
groupTidalyticByTag(tagKey) {
|
|
122
125
|
if (!this.operational()) {
|
|
123
126
|
return null;
|
|
124
127
|
}
|
|
125
|
-
return this.
|
|
128
|
+
return this.anchor.groupTidalyticByTag(tagKey);
|
|
126
129
|
}
|
|
127
130
|
getTidalyticTimeSeries(name, options = {}) {
|
|
128
131
|
if (!this.operational()) {
|
|
129
132
|
return null;
|
|
130
133
|
}
|
|
131
|
-
return this.
|
|
134
|
+
return this.anchor.getTidalyticTimeSeries(name, options);
|
|
132
135
|
}
|
|
133
136
|
predictTidalytic(name, config = {}) {
|
|
134
137
|
if (!this.operational()) {
|
|
135
138
|
return null;
|
|
136
139
|
}
|
|
137
|
-
return this.
|
|
140
|
+
return this.anchor.predictTidalytic(name, config);
|
|
138
141
|
}
|
|
139
142
|
async clearTidalytics(domain, options = {}) {
|
|
140
143
|
if (!this.operational()) {
|
|
141
144
|
return null;
|
|
142
145
|
}
|
|
143
|
-
return await this.
|
|
146
|
+
return await this.anchor.clearTidalytics(domain, options);
|
|
144
147
|
}
|
|
145
148
|
clearAllTidalytics() {
|
|
146
149
|
if (!this.operational()) {
|
|
147
150
|
return null;
|
|
148
151
|
}
|
|
149
|
-
return this.
|
|
152
|
+
return this.anchor.clearAllTidalytics();
|
|
150
153
|
}
|
|
151
154
|
async getTiderPresenceVisualData(options = {}) {
|
|
152
155
|
if (!this.operational()) {
|
|
153
156
|
return null;
|
|
154
157
|
}
|
|
155
|
-
return await this.
|
|
158
|
+
return await this.anchor.getTiderPresenceVisualData(options);
|
|
156
159
|
}
|
|
157
160
|
async getAlreadyOnlineVisualData(options = {}) {
|
|
158
161
|
if (!this.operational()) {
|
|
159
162
|
return null;
|
|
160
163
|
}
|
|
161
|
-
return await this.
|
|
164
|
+
return await this.anchor.getAlreadyOnlineVisualData(options);
|
|
162
165
|
}
|
|
163
166
|
async getTiderBanVisualData(options = {}) {
|
|
164
167
|
if (!this.operational()) {
|
|
165
168
|
return null;
|
|
166
169
|
}
|
|
167
|
-
return await this.
|
|
170
|
+
return await this.anchor.getTiderBanVisualData(options);
|
|
168
171
|
}
|
|
169
172
|
async getTideFileTransferVisualData(options = {}) {
|
|
170
173
|
if (!this.operational()) {
|
|
171
174
|
return null;
|
|
172
175
|
}
|
|
173
|
-
return await this.
|
|
176
|
+
return await this.anchor.getTideFileTransferVisualData(options);
|
|
174
177
|
}
|
|
175
178
|
async getTideTransferStateVisualData(options = {}) {
|
|
176
179
|
if (!this.operational()) {
|
|
177
180
|
return null;
|
|
178
181
|
}
|
|
179
|
-
return await this.
|
|
182
|
+
return await this.anchor.getTideTransferStateVisualData(options);
|
|
180
183
|
}
|
|
181
184
|
async getFileListActivityVisualData(options = {}) {
|
|
182
185
|
if (!this.operational()) {
|
|
183
186
|
return null;
|
|
184
187
|
}
|
|
185
|
-
return await this.
|
|
188
|
+
return await this.anchor.getFileListActivityVisualData(options);
|
|
186
189
|
}
|
|
187
190
|
async getTideBarrierVisualData(options = {}) {
|
|
188
191
|
if (!this.operational()) {
|
|
189
192
|
return null;
|
|
190
193
|
}
|
|
191
|
-
return await this.
|
|
194
|
+
return await this.anchor.getTideBarrierVisualData(options);
|
|
192
195
|
}
|
|
193
196
|
|
|
194
|
-
// ---
|
|
197
|
+
// --- Anchor Tidalytics Event Management ---
|
|
195
198
|
|
|
196
199
|
attachTiderPresenceVisualStream(options = {}) {
|
|
197
200
|
if (!this.operational()) {
|
|
198
201
|
return null;
|
|
199
202
|
}
|
|
200
|
-
return this.
|
|
203
|
+
return this.anchor.attachTiderPresenceVisualStream(options);
|
|
201
204
|
}
|
|
202
205
|
attachAlreadyOnlineVisualStream(options = {}) {
|
|
203
206
|
if (!this.operational()) {
|
|
204
207
|
return null;
|
|
205
208
|
}
|
|
206
|
-
return this.
|
|
209
|
+
return this.anchor.attachAlreadyOnlineVisualStream(options);
|
|
207
210
|
}
|
|
208
211
|
attachTiderBanVisualStream(options = {}) {
|
|
209
212
|
if (!this.operational()) {
|
|
210
213
|
return null;
|
|
211
214
|
}
|
|
212
|
-
return this.
|
|
215
|
+
return this.anchor.attachTiderBanVisualStream(options);
|
|
213
216
|
}
|
|
214
217
|
attachTideFileTransferVisualStream(options = {}) {
|
|
215
218
|
if (!this.operational()) {
|
|
216
219
|
return null;
|
|
217
220
|
}
|
|
218
|
-
return this.
|
|
221
|
+
return this.anchor.attachTideFileTransferVisualStream(options);
|
|
219
222
|
}
|
|
220
223
|
attachTideTransferStateVisualStream(options = {}) {
|
|
221
224
|
if (!this.operational()) {
|
|
222
225
|
return null;
|
|
223
226
|
}
|
|
224
|
-
return this.
|
|
227
|
+
return this.anchor.attachTideTransferStateVisualStream(options);
|
|
225
228
|
}
|
|
226
229
|
attachFileListVisualStream(options = {}) {
|
|
227
230
|
if (!this.operational()) {
|
|
228
231
|
return null;
|
|
229
232
|
}
|
|
230
|
-
return this.
|
|
233
|
+
return this.anchor.attachFileListVisualStream(options);
|
|
231
234
|
}
|
|
232
235
|
attachTideBarrierVisualStream(options = {}) {
|
|
233
236
|
if (!this.operational()) {
|
|
234
237
|
return null;
|
|
235
238
|
}
|
|
236
|
-
return this.
|
|
239
|
+
return this.anchor.attachTideBarrierVisualStream(options);
|
|
237
240
|
}
|
|
238
241
|
|
|
239
|
-
// ---
|
|
242
|
+
// --- Anchor Tide Actions Management ---
|
|
240
243
|
|
|
241
244
|
async getAllTideActions(options = {}) {
|
|
242
245
|
if (!this.operational()) {
|
|
243
246
|
return null;
|
|
244
247
|
}
|
|
245
|
-
return await this.
|
|
248
|
+
return await this.anchor.getAllTideActions(options);
|
|
246
249
|
}
|
|
247
250
|
async getTideCompletedTransferActions(options = {}) {
|
|
248
251
|
if (!this.operational()) {
|
|
249
252
|
return null;
|
|
250
253
|
}
|
|
251
|
-
return await this.
|
|
254
|
+
return await this.anchor.getTideCompletedTransferActions(options);
|
|
252
255
|
}
|
|
253
256
|
async getTideTransferStateActions(options = {}) {
|
|
254
257
|
if (!this.operational()) {
|
|
255
258
|
return null;
|
|
256
259
|
}
|
|
257
|
-
return await this.
|
|
260
|
+
return await this.anchor.getTideTransferStateActions(options);
|
|
258
261
|
}
|
|
259
262
|
async getTideIncomingFileActions(options = {}) {
|
|
260
263
|
if (!this.operational()) {
|
|
261
264
|
return null;
|
|
262
265
|
}
|
|
263
|
-
return await this.
|
|
266
|
+
return await this.anchor.getTideIncomingFileActions(options);
|
|
264
267
|
}
|
|
265
268
|
async getTideIncomingTransferActions(options = {}) {
|
|
266
269
|
if (!this.operational()) {
|
|
267
270
|
return null;
|
|
268
271
|
}
|
|
269
|
-
return await this.
|
|
272
|
+
return await this.anchor.getTideIncomingTransferActions(options);
|
|
270
273
|
}
|
|
271
274
|
async getTideBarrierAcceptedActions(options = {}) {
|
|
272
275
|
if (!this.operational()) {
|
|
273
276
|
return null;
|
|
274
277
|
}
|
|
275
|
-
return await this.
|
|
278
|
+
return await this.anchor.getTideBarrierAcceptedActions(options);
|
|
276
279
|
}
|
|
277
280
|
async getTideBarrierDeniedActions(options = {}) {
|
|
278
281
|
if (!this.operational()) {
|
|
279
282
|
return null;
|
|
280
283
|
}
|
|
281
|
-
return await this.
|
|
284
|
+
return await this.anchor.getTideBarrierDeniedActions(options);
|
|
282
285
|
}
|
|
283
286
|
async getFileListReceivedActions(options = {}) {
|
|
284
287
|
if (!this.operational()) {
|
|
285
288
|
return null;
|
|
286
289
|
}
|
|
287
|
-
return await this.
|
|
290
|
+
return await this.anchor.getFileListReceivedActions(options);
|
|
288
291
|
}
|
|
289
292
|
async getFileListRequestActions(options = {}) {
|
|
290
293
|
if (!this.operational()) {
|
|
291
294
|
return null;
|
|
292
295
|
}
|
|
293
|
-
return await this.
|
|
296
|
+
return await this.anchor.getFileListRequestActions(options);
|
|
294
297
|
}
|
|
295
298
|
async getTiderBannedActions(options = {}) {
|
|
296
299
|
if (!this.operational()) {
|
|
297
300
|
return null;
|
|
298
301
|
}
|
|
299
|
-
return await this.
|
|
302
|
+
return await this.anchor.getTiderBannedActions(options);
|
|
300
303
|
}
|
|
301
304
|
async getTiderKickedActions(options = {}) {
|
|
302
305
|
if (!this.operational()) {
|
|
303
306
|
return null;
|
|
304
307
|
}
|
|
305
|
-
return await this.
|
|
308
|
+
return await this.anchor.getTiderKickedActions(options);
|
|
306
309
|
}
|
|
307
310
|
async getTiderUnbannedActions(options = {}) {
|
|
308
311
|
if (!this.operational()) {
|
|
309
312
|
return null;
|
|
310
313
|
}
|
|
311
|
-
return await this.
|
|
314
|
+
return await this.anchor.getTiderUnbannedActions(options);
|
|
312
315
|
}
|
|
313
316
|
async getTiderAlreadyOnlineActions(options = {}) {
|
|
314
317
|
if (!this.operational()) {
|
|
315
318
|
return null;
|
|
316
319
|
}
|
|
317
|
-
return await this.
|
|
320
|
+
return await this.anchor.getTiderAlreadyOnlineActions(options);
|
|
318
321
|
}
|
|
319
322
|
async getTiderOnlineActions(options = {}) {
|
|
320
323
|
if (!this.operational()) {
|
|
321
324
|
return null;
|
|
322
325
|
}
|
|
323
|
-
return await this.
|
|
326
|
+
return await this.anchor.getTiderOnlineActions(options);
|
|
324
327
|
}
|
|
325
328
|
async getTiderOfflineActions(options = {}) {
|
|
326
329
|
if (!this.operational()) {
|
|
327
330
|
return null;
|
|
328
331
|
}
|
|
329
|
-
return await this.
|
|
332
|
+
return await this.anchor.getTiderOfflineActions(options);
|
|
330
333
|
}
|
|
331
334
|
|
|
332
|
-
// ---
|
|
335
|
+
// --- Anchor Tide Sentinel Management ---
|
|
333
336
|
|
|
334
337
|
banClient(clientID, options = {}) {
|
|
335
338
|
if (!this.operational()) {
|
|
336
339
|
return null;
|
|
337
340
|
}
|
|
338
|
-
return this.
|
|
341
|
+
return this.anchor.banClient(clientID, options);
|
|
339
342
|
}
|
|
340
343
|
kickClient(clientID, options = {}) {
|
|
341
344
|
if (!this.operational()) {
|
|
342
345
|
return null;
|
|
343
346
|
}
|
|
344
|
-
return this.
|
|
347
|
+
return this.anchor.kickClient(clientID, options);
|
|
345
348
|
}
|
|
346
349
|
unbanClient(clientID) {
|
|
347
350
|
if (!this.operational()) {
|
|
348
351
|
return null;
|
|
349
352
|
}
|
|
350
|
-
return this.
|
|
353
|
+
return this.anchor.unbanClient(clientID);
|
|
351
354
|
}
|
|
352
355
|
clientBanned(clientID) {
|
|
353
356
|
if (!this.operational()) {
|
|
354
357
|
return null;
|
|
355
358
|
}
|
|
356
|
-
return this.
|
|
359
|
+
return this.anchor.clientBanned(clientID);
|
|
357
360
|
}
|
|
358
361
|
getBanEntry(clientID) {
|
|
359
362
|
if (!this.operational()) {
|
|
360
363
|
return null;
|
|
361
364
|
}
|
|
362
|
-
return this.
|
|
365
|
+
return this.anchor.getBanEntry(clientID);
|
|
363
366
|
}
|
|
364
367
|
filterBannedClients(filter = {}) {
|
|
365
368
|
if (!this.operational()) {
|
|
366
369
|
return null;
|
|
367
370
|
}
|
|
368
|
-
return this.
|
|
371
|
+
return this.anchor.filterBannedClients(filter);
|
|
369
372
|
}
|
|
370
373
|
registerTideSentinelExpireHook(list, callback) {
|
|
371
374
|
if (!this.operational()) {
|
|
372
375
|
return null;
|
|
373
376
|
}
|
|
374
|
-
return this.
|
|
377
|
+
return this.anchor.registerTideSentinelExpireHook(list, callback);
|
|
375
378
|
}
|
|
376
379
|
addToTideList(list, key, data) {
|
|
377
380
|
if (!this.operational()) {
|
|
378
381
|
return null;
|
|
379
382
|
}
|
|
380
|
-
return this.
|
|
383
|
+
return this.anchor.addToTideList(list, key, data);
|
|
381
384
|
}
|
|
382
385
|
removeFromTideList(list, key) {
|
|
383
386
|
if (!this.operational()) {
|
|
384
387
|
return null;
|
|
385
388
|
}
|
|
386
|
-
return this.
|
|
389
|
+
return this.anchor.removeFromTideList(list, key);
|
|
387
390
|
}
|
|
388
391
|
inTideList(list, key) {
|
|
389
392
|
if (!this.operational()) {
|
|
390
393
|
return null;
|
|
391
394
|
}
|
|
392
|
-
return this.
|
|
395
|
+
return this.anchor.inTideList(list, key);
|
|
393
396
|
}
|
|
394
397
|
getEntry(list, key) {
|
|
395
398
|
if (!this.operational()) {
|
|
396
399
|
return null;
|
|
397
400
|
}
|
|
398
|
-
return this.
|
|
401
|
+
return this.anchor.getEntry(list, key);
|
|
399
402
|
}
|
|
400
403
|
filterTideList(list, filter = {}) {
|
|
401
404
|
if (!this.operational()) {
|
|
402
405
|
return null;
|
|
403
406
|
}
|
|
404
|
-
return this.
|
|
407
|
+
return this.anchor.filterTideList(list, filter);
|
|
405
408
|
}
|
|
406
409
|
findSimilarKeys(keyword, options = {}) {
|
|
407
410
|
if (!this.operational()) {
|
|
408
411
|
return null;
|
|
409
412
|
}
|
|
410
|
-
return this.
|
|
413
|
+
return this.anchor.findSimilarKeys(keyword, options);
|
|
411
414
|
}
|
|
412
415
|
|
|
413
|
-
// ---
|
|
416
|
+
// --- Anchor Path Management ---
|
|
414
417
|
|
|
415
418
|
async getDirectoryData(directoryPath) {
|
|
416
|
-
return await this.
|
|
419
|
+
return await this.anchorManager.getDirectoryData(directoryPath);
|
|
417
420
|
}
|
|
418
421
|
getFileData(filePath) {
|
|
419
|
-
return this.
|
|
422
|
+
return this.anchorManager.getFileData(filePath);
|
|
420
423
|
}
|
|
421
424
|
async getPathData(inputPath) {
|
|
422
|
-
return await this.
|
|
425
|
+
return await this.anchorManager.getPathData(inputPath);
|
|
423
426
|
}
|
|
424
427
|
getTidePath(inputPath) {
|
|
425
|
-
return this.
|
|
428
|
+
return this.anchorManager.getTidePath(inputPath);
|
|
426
429
|
}
|
|
427
430
|
|
|
428
|
-
// ---
|
|
431
|
+
// --- Anchor Client Management ---
|
|
429
432
|
|
|
430
433
|
getClientFromID(clientID) {
|
|
431
434
|
if (!this.operational()) {
|
|
432
435
|
return null;
|
|
433
436
|
}
|
|
434
|
-
return this.
|
|
437
|
+
return this.anchor.getClientFromID(clientID);
|
|
435
438
|
}
|
|
436
439
|
getConnectedClients() {
|
|
437
440
|
if (!this.operational()) {
|
|
438
441
|
return null;
|
|
439
442
|
}
|
|
440
|
-
return this.
|
|
443
|
+
return this.anchor.onlineClients;
|
|
441
444
|
}
|
|
442
445
|
getOnlineClients() {
|
|
443
446
|
if (!this.operational()) {
|
|
444
447
|
return null;
|
|
445
448
|
}
|
|
446
|
-
return this.
|
|
449
|
+
return this.anchor.getOnlineClients();
|
|
447
450
|
}
|
|
448
451
|
|
|
449
|
-
// ---
|
|
452
|
+
// --- Anchor Transfer Management ---
|
|
450
453
|
|
|
451
454
|
async sendToDevice(userID, filePath, destinationPath, filterContent = [], tideSize = 200, tidalSize = 500, minTideSize = 10, maxTideSize = 2000, transferRequestExpirationTime = 30000, metadata = {}) {
|
|
452
|
-
await this.
|
|
453
|
-
return;
|
|
455
|
+
return await this.anchorManager.sendToDevice(userID, filePath, destinationPath, filterContent, tideSize, tidalSize, minTideSize, maxTideSize, transferRequestExpirationTime, metadata);
|
|
454
456
|
}
|
|
455
457
|
|
|
456
|
-
// ---
|
|
458
|
+
// --- Anchor Operation Management ---
|
|
457
459
|
|
|
458
460
|
operational() {
|
|
459
|
-
return this.
|
|
461
|
+
return this.anchor !== null;
|
|
460
462
|
}
|
|
461
|
-
reboot(
|
|
463
|
+
reboot(anchorID) {
|
|
462
464
|
this.close();
|
|
463
465
|
setTimeout(() => {
|
|
464
|
-
const
|
|
465
|
-
this.launch(
|
|
466
|
+
const currentAnchorID = anchorID ?? this.anchorManager.currentUserID;
|
|
467
|
+
this.launch(currentAnchorID, _classPrivateFieldGet(_anchorOptions, this), _classPrivateFieldGet(_onAnchorLaunch, this), _classPrivateFieldGet(_onAnchorTideAction, this), _classPrivateFieldGet(_transportOptions, this), ..._classPrivateFieldGet(_anchorConfigurations, this));
|
|
466
468
|
}, 169);
|
|
467
469
|
}
|
|
468
470
|
close() {
|
|
469
|
-
this.
|
|
471
|
+
this.anchorManager.stopFileTide();
|
|
470
472
|
return;
|
|
471
473
|
}
|
|
472
474
|
}
|
|
473
475
|
;
|
|
474
|
-
module.exports =
|
|
476
|
+
module.exports = Anchor;
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trap_stevo/filenet",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.50",
|
|
4
4
|
"description": "Provides the groundbreaking solution for real-time, OTA (Over-The-Air) file transfer, streamlining client-to-client sharing with unmatched efficiency and effortless, on-the-fly handling. Whether managing peer-to-peer or client-server transfers, FileNet ensures seamless communication across devices, allowing for file transfers from all over the world, while maintaining fast, secure, and dynamic connectivity. Along with proprietary maximum performance measures, it delivers parallelly synchronized, high-speed transfers, from large data exchanges to instant sharing, setting a new standard in modern file transfer and redefining real-time connectivity.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dist/cjs/index.js"
|
|
8
8
|
},
|
|
9
9
|
"bin": {
|
|
10
|
-
"filenet": "dist/cjs/
|
|
10
|
+
"filenet": "dist/cjs/anchor.js"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "babel src -d dist/cjs --env-name cjs",
|
|
14
|
-
"start-
|
|
14
|
+
"start-anchor-demo": "node ./demos/anchorDemo.js",
|
|
15
15
|
"start": "node dist/cjs/index.js"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"seamless connectivity"
|
|
38
38
|
],
|
|
39
39
|
"author": "Steven Compton",
|
|
40
|
-
"license": "
|
|
40
|
+
"license": "SCL-1.0-Universal",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@trap_stevo/filetide": "^0.0.
|
|
43
|
-
"@trap_stevo/filetide-client": "^0.0.
|
|
42
|
+
"@trap_stevo/filetide": "^0.0.87",
|
|
43
|
+
"@trap_stevo/filetide-client": "^0.0.54",
|
|
44
44
|
"@trap_stevo/iotide": "^0.0.46"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
package/LICENSE.md
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
# License Agreement for @trap_stevo/filenet
|
|
2
|
-
|
|
3
|
-
**Effective Date**: September 10, 2024
|
|
4
|
-
|
|
5
|
-
This License Agreement ("Agreement") is entered into by and between **Hassan Steven Compton**, the owner of the package ("Licensor"), and any individual or entity attempting to use the package ("Licensee"). By attempting to install, use, modify, or distribute the package, Licensee agrees to the following terms and conditions:
|
|
6
|
-
|
|
7
|
-
## 1. **Definitions**
|
|
8
|
-
- **"Package"**: Refers to the software identified as @trap_stevo/filenet, including its source code, object code, binaries, and any related files or documentation.
|
|
9
|
-
- **"Wrapper API"**: Refers to any software, service, or application developed by the Licensee that interacts with the Package as a dependency but does not include, modify, or expose the Package's source code or proprietary components.
|
|
10
|
-
- **"Derivative Work"**: Refers to any software, service, or product that is based on or derived from the Package's source code or object code, either in part or in whole, and includes modified, translated, or adapted versions of the Package.
|
|
11
|
-
|
|
12
|
-
## 2. **Ownership**
|
|
13
|
-
**Hassan Steven Compton** is the sole owner of all rights, title, and interest in and to @trap_stevo/filenet, including all related intellectual property rights.
|
|
14
|
-
|
|
15
|
-
## 3. **Grant of License**
|
|
16
|
-
Subject to the terms of this agreement, the Licensor grants the Licensee a limited, non-exclusive, revocable license to:
|
|
17
|
-
1. Use the Package as a dependency or library within their own projects to create Wrapper APIs, services, or applications.
|
|
18
|
-
2. Distribute Wrapper APIs, services, or applications that rely on the Package, provided the Package's source code is not included, modified, or distributed as part of the Wrapper.
|
|
19
|
-
|
|
20
|
-
Licensee is **NOT** permitted to:
|
|
21
|
-
- Modify, copy, or distribute the Package's source code or object code.
|
|
22
|
-
- Create or distribute any Derivative Work based on the Package.
|
|
23
|
-
- Remove, alter, or obscure any proprietary notices, attributions, or trademarks included in the Package.
|
|
24
|
-
|
|
25
|
-
This license is non-transferable and non-sublicensable without prior express written consent from the Licensor.
|
|
26
|
-
|
|
27
|
-
## 4. **Prohibited Uses**
|
|
28
|
-
Without the express written permission of the Licensor, Licensee shall not:
|
|
29
|
-
1. Modify, decompile, reverse-engineer, or disassemble the Package in any way.
|
|
30
|
-
2. Include the Package's source code or object code in any distributed software, service, or application.
|
|
31
|
-
3. Use the Package to create a competing product or service that replicates the functionality of the Package.
|
|
32
|
-
4. Make the Package publicly available, including uploading it to public repositories or including it in distributed software bundles.
|
|
33
|
-
5. Attempt to extract or analyze the functionality, structure, or behavior of the Package through runtime inspection, instrumentation, reflection, or behavioral analysis.
|
|
34
|
-
6. Privately share, sublicense, or distribute the Package or any portion thereof, whether internally within an organization or externally to any third party, without written authorization.
|
|
35
|
-
7. Remove, obscure, obfuscate, or alter any attribution, copyright notices, proprietary labels, or identifiers included in the Package.
|
|
36
|
-
8. Re-upload, rename, fork, or redistribute the Package or any portion thereof on any registry, platform, or namespace other than that explicitly maintained by or authorized by the Licensor.
|
|
37
|
-
9. Use the Package in any way that violates applicable laws, infringes on third-party rights, or breaches this agreement.
|
|
38
|
-
|
|
39
|
-
## 5. **Wrapper API Creation**
|
|
40
|
-
Licensee is permitted to create and distribute Wrapper APIs, provided that:
|
|
41
|
-
1. The Wrapper API does not expose or include the Package's source code or object code in any form.
|
|
42
|
-
2. The Wrapper API identifies @trap_stevo/filenet as a dependency in its documentation and credits it as required by this license.
|
|
43
|
-
3. The Wrapper API complies with all terms outlined in this agreement, including restrictions on modification and redistribution of the Package.
|
|
44
|
-
4. The Wrapper API adds substantial original functionality and does not merely replicate or repackage the Package's functionality.
|
|
45
|
-
|
|
46
|
-
## 6. **Request for Permission**
|
|
47
|
-
Licensee may request additional permissions to use the Package beyond the scope of this agreement by contacting the Licensor at **h.steven.compton13@gmail.com**. All requests must:
|
|
48
|
-
|
|
49
|
-
1. Be submitted in writing.
|
|
50
|
-
2. Specify the intended use of the Package in detail, including but not limited to the purpose, scope, and distribution method.
|
|
51
|
-
|
|
52
|
-
The Licensor reserves the right to:
|
|
53
|
-
- Approve or deny any request at its sole discretion, with or without providing a reason.
|
|
54
|
-
- Impose additional terms and conditions for any granted permission.
|
|
55
|
-
- Revoke any granted permission at any time, for any reason, with prior written notice to the Licensee.
|
|
56
|
-
|
|
57
|
-
Any permission granted by the Licensor:
|
|
58
|
-
- Must be documented in writing.
|
|
59
|
-
- Does not constitute a waiver of any rights or terms outlined in this agreement unless explicitly stated.
|
|
60
|
-
- Remains non-transferable and non-sublicensable.
|
|
61
|
-
|
|
62
|
-
## 7. **Violation of Terms**
|
|
63
|
-
1. Any violation of this agreement will result in the immediate termination of the Licensee's rights under this license.
|
|
64
|
-
2. Upon termination, the Licensee must cease all use of the Package, destroy all copies in their possession, and confirm compliance with this clause to the Licensor in writing.
|
|
65
|
-
3. The Licensor reserves the right to seek legal remedies, including damages and injunctive relief, for any breach of this agreement.
|
|
66
|
-
|
|
67
|
-
## 8. **No Warranty**
|
|
68
|
-
@trap_stevo/filenet is provided "as is," without any warranty of any kind, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, or non-infringement. Licensee assumes all risks associated with the use of the package, including but not limited to potential damage to systems or data.
|
|
69
|
-
|
|
70
|
-
## 9. **Indemnification**
|
|
71
|
-
Licensee agrees to indemnify and hold harmless the Licensor from any and all claims, damages, liabilities, and expenses arising out of Licensee's use of the package in violation of this Agreement.
|
|
72
|
-
|
|
73
|
-
## 10. **Governing Law and Dispute Resolution**
|
|
74
|
-
This Agreement shall be governed by and construed in accordance with the laws of **the state of Georgia**, without regard to its conflict of law principles. Any disputes arising out of this Agreement shall be resolved through arbitration in **the state of Georgia**.
|
|
75
|
-
|
|
76
|
-
## 11. **Amendments**
|
|
77
|
-
Licensor reserves the right to modify or update this Agreement at any time. Any changes to the Agreement will be effective **30 days** after being posted to **https://www.npmjs.com/package/@trap_stevo/filenet**. The Licensor will notify Licensees of any material changes by **posting a notice in the package’s release notes on NPM**. Continued use of the package after the notice period constitutes acceptance of the modified terms.
|
|
78
|
-
|
|
79
|
-
**This Agreement applies to all versions of @trap_stevo/filenet downloaded, installed, or used on or after the Effective Date of this license, regardless of version number.** Use of any version of the Package after this date shall be deemed acceptance of and agreement to the terms of this license, unless otherwise explicitly stated by the Licensor.
|
package/dist/cjs/filenet.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
const FileTideClient = require("@trap_stevo/filetide-client");
|
|
5
|
-
const FileTide = require("@trap_stevo/filetide");
|
|
6
|
-
const fs = require("fs");
|
|
7
|
-
const args = process.argv.slice(2);
|
|
8
|
-
let configFilePath = null;
|
|
9
|
-
let positionalArgs = [];
|
|
10
|
-
const flags = {};
|
|
11
|
-
let noMessager = false;
|
|
12
|
-
for (let i = 0; i < args.length; i++) {
|
|
13
|
-
const arg = args[i];
|
|
14
|
-
if (arg === "--config" && args[i + 1]) {
|
|
15
|
-
configFilePath = args[i + 1];
|
|
16
|
-
i++;
|
|
17
|
-
} else if (arg === "--no-messager") {
|
|
18
|
-
noMessager = true;
|
|
19
|
-
} else if (arg.startsWith("--")) {
|
|
20
|
-
const flagName = arg.slice(2);
|
|
21
|
-
const flagValue = args[i + 1] && !args[i + 1].startsWith("--") ? args[i + 1] : true;
|
|
22
|
-
flags[flagName] = flagValue;
|
|
23
|
-
if (flagValue !== true) i++;
|
|
24
|
-
} else {
|
|
25
|
-
positionalArgs.push(arg);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
let config = {};
|
|
29
|
-
if (configFilePath) {
|
|
30
|
-
try {
|
|
31
|
-
const fileData = fs.readFileSync(configFilePath, "utf-8");
|
|
32
|
-
config = JSON.parse(fileData);
|
|
33
|
-
console.log("Config file loaded: ", configFilePath);
|
|
34
|
-
} catch (error) {
|
|
35
|
-
console.error("Could not read or parse config file: ", error.message);
|
|
36
|
-
config = {};
|
|
37
|
-
console.log("Proceeding using default configurations...");
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
const port = positionalArgs[0] || config.port || 8869;
|
|
41
|
-
const serverUrl = positionalArgs[1] || config.serverUrl || `http://localhost:${port}`;
|
|
42
|
-
const room = positionalArgs[2] || config.room || "file-room";
|
|
43
|
-
const clientID = positionalArgs[3] || config.clientID || "FileNetServer";
|
|
44
|
-
const options = {
|
|
45
|
-
port: port,
|
|
46
|
-
...config.options,
|
|
47
|
-
...JSON.parse(positionalArgs[4] || "{}")
|
|
48
|
-
};
|
|
49
|
-
const messagerOptions = {
|
|
50
|
-
maxHttpBufferSize: 5e9,
|
|
51
|
-
pingTimeout: 3600000,
|
|
52
|
-
pingInterval: 60000,
|
|
53
|
-
...config.messagerOptions,
|
|
54
|
-
...JSON.parse(positionalArgs[5] || "{}")
|
|
55
|
-
};
|
|
56
|
-
const transportOptions = {
|
|
57
|
-
parallelChunks: 3,
|
|
58
|
-
maxRetries: 3,
|
|
59
|
-
...config.transportOptions,
|
|
60
|
-
...JSON.parse(positionalArgs[6] || "{}")
|
|
61
|
-
};
|
|
62
|
-
const messagerSettings = {
|
|
63
|
-
maxReconnectionAttempts: 15,
|
|
64
|
-
reconnectionAttempts: 15,
|
|
65
|
-
maxReconnectionDelay: 10000,
|
|
66
|
-
...config.messagerSettings,
|
|
67
|
-
...JSON.parse(positionalArgs[7] || "{}")
|
|
68
|
-
};
|
|
69
|
-
const fileT = new FileTide();
|
|
70
|
-
fileT.launchFileTide(options, fileNet => {
|
|
71
|
-
if (!noMessager) {
|
|
72
|
-
const fileTideClient = new FileTideClient(clientID, serverUrl, room);
|
|
73
|
-
fileTideClient.startClient(options, messagerOptions, transportOptions, messagerSettings, fileMessager => {}, () => {}, () => {}, (transferData, forwardResponse) => {
|
|
74
|
-
FileTide.outputGradient(`${transferData.clientID} wants ${transferData.transferType === "requestSend" ? "you to send:" : "to transfer you:"}\n\n\t${transferData.path}.\n\nDo you accept (Y/n)?`, ["#3c97b0", "#7addeb"]);
|
|
75
|
-
if (config.autoAccept) {
|
|
76
|
-
forwardResponse(true, transferData);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
if (config.acceptForClients && config.acceptForClients.includes(transferData.clientID)) {
|
|
80
|
-
forwardResponse(true, transferData);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
if (config.autoDeny) {
|
|
84
|
-
forwardResponse(false, transferData);
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (config.denyForClients && config.denyForClients.includes(transferData.clientID)) {
|
|
88
|
-
forwardResponse(false, transferData);
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
}, () => {}, () => {}, config.enableTransferBarrier || true);
|
|
92
|
-
}
|
|
93
|
-
});
|