gingersnap 0.22.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/_virtual/_tslib.cjs +102 -0
- package/_virtual/_tslib.mjs +93 -0
- package/data/AtomicValue.d.ts +15 -0
- package/data/bus.cjs +179 -0
- package/data/bus.d.ts +72 -0
- package/data/bus.mjs +177 -0
- package/data/decoders/index.d.ts +4 -0
- package/data/decoders/json.cjs +12 -0
- package/data/decoders/json.d.ts +7 -0
- package/data/decoders/json.mjs +10 -0
- package/data/decoders/msgpack.cjs +14 -0
- package/data/decoders/msgpack.d.ts +7 -0
- package/data/decoders/msgpack.mjs +12 -0
- package/data/decoders/protobuf.d.ts +13 -0
- package/data/decoders/string.cjs +12 -0
- package/data/decoders/string.d.ts +7 -0
- package/data/decoders/string.mjs +10 -0
- package/data/decoders/type.d.ts +7 -0
- package/data/decoders.cjs +11 -0
- package/data/decoders.mjs +3 -0
- package/data/model/credentials.cjs +114 -0
- package/data/model/credentials.d.ts +61 -0
- package/data/model/credentials.mjs +109 -0
- package/data/model/extra.cjs +88 -0
- package/data/model/extra.d.ts +5 -0
- package/data/model/extra.mjs +66 -0
- package/data/model/index.d.ts +6 -0
- package/data/model/model.cjs +541 -0
- package/data/model/model.d.ts +207 -0
- package/data/model/model.mjs +518 -0
- package/data/model/plugin.cjs +96 -0
- package/data/model/plugin.d.ts +38 -0
- package/data/model/plugin.mjs +72 -0
- package/data/model/property.cjs +310 -0
- package/data/model/property.d.ts +83 -0
- package/data/model/property.mjs +278 -0
- package/data/model/types.cjs +32 -0
- package/data/model/types.d.ts +28 -0
- package/data/model/types.mjs +32 -0
- package/data/model.cjs +43 -0
- package/data/model.mjs +6 -0
- package/data/signal.cjs +47 -0
- package/data/signal.d.ts +17 -0
- package/data/signal.mjs +45 -0
- package/data/store/index.d.ts +4 -0
- package/data/store/json.cjs +58 -0
- package/data/store/json.d.ts +18 -0
- package/data/store/json.mjs +56 -0
- package/data/store/manager.cjs +206 -0
- package/data/store/manager.d.ts +44 -0
- package/data/store/manager.mjs +203 -0
- package/data/store/web.cjs +92 -0
- package/data/store/web.d.ts +25 -0
- package/data/store/web.mjs +89 -0
- package/data/value.cjs +66 -0
- package/data/value.mjs +64 -0
- package/data-structures/array/CyclicalList.cjs +57 -0
- package/data-structures/array/CyclicalList.d.ts +12 -0
- package/data-structures/array/CyclicalList.mjs +55 -0
- package/data-structures/array/Pair.cjs +30 -0
- package/data-structures/array/Pair.d.ts +17 -0
- package/data-structures/array/Pair.mjs +27 -0
- package/data-structures/array/Stack.cjs +96 -0
- package/data-structures/array/Stack.d.ts +41 -0
- package/data-structures/array/Stack.mjs +94 -0
- package/data-structures/array/Triple.cjs +34 -0
- package/data-structures/array/Triple.d.ts +19 -0
- package/data-structures/array/Triple.mjs +31 -0
- package/data-structures/array/Tuple.d.ts +8 -0
- package/data-structures/array/index.d.ts +5 -0
- package/data-structures/array.cjs +15 -0
- package/data-structures/array.mjs +4 -0
- package/data-structures/object/BufferQueue.cjs +98 -0
- package/data-structures/object/BufferQueue.d.ts +21 -0
- package/data-structures/object/BufferQueue.mjs +77 -0
- package/data-structures/object/CyclicalObject.cjs +155 -0
- package/data-structures/object/CyclicalObject.d.ts +74 -0
- package/data-structures/object/CyclicalObject.mjs +134 -0
- package/data-structures/object/Queue.cjs +178 -0
- package/data-structures/object/Queue.d.ts +31 -0
- package/data-structures/object/Queue.mjs +176 -0
- package/data-structures/object/SimpleQueue.cjs +53 -0
- package/data-structures/object/SimpleQueue.d.ts +13 -0
- package/data-structures/object/SimpleQueue.mjs +51 -0
- package/data-structures/object/TimeableObject.cjs +73 -0
- package/data-structures/object/TimeableObject.d.ts +30 -0
- package/data-structures/object/TimeableObject.mjs +71 -0
- package/data-structures/object/WaitableObject.cjs +61 -0
- package/data-structures/object/WaitableObject.d.ts +29 -0
- package/data-structures/object/WaitableObject.mjs +59 -0
- package/data-structures/object/WatchableObject.cjs +251 -0
- package/data-structures/object/WatchableObject.d.ts +88 -0
- package/data-structures/object/WatchableObject.mjs +230 -0
- package/data-structures/object/index.d.ts +7 -0
- package/data-structures/object.cjs +23 -0
- package/data-structures/object.mjs +7 -0
- package/errors/AbortError.cjs +9 -0
- package/errors/AbortError.d.ts +5 -0
- package/errors/AbortError.mjs +7 -0
- package/errors/CallExecutionError.cjs +13 -0
- package/errors/CallExecutionError.d.ts +7 -0
- package/errors/CallExecutionError.mjs +11 -0
- package/errors/FutureCancelled.cjs +11 -0
- package/errors/FutureCancelled.d.ts +6 -0
- package/errors/FutureCancelled.mjs +9 -0
- package/errors/FutureError.cjs +11 -0
- package/errors/FutureError.d.ts +6 -0
- package/errors/FutureError.mjs +9 -0
- package/errors/IllegalArgumentsError.cjs +13 -0
- package/errors/IllegalArgumentsError.d.ts +7 -0
- package/errors/IllegalArgumentsError.mjs +11 -0
- package/errors/IllegalOperationError.cjs +6 -0
- package/errors/IllegalOperationError.d.ts +2 -0
- package/errors/IllegalOperationError.mjs +4 -0
- package/errors/InvalidType.cjs +6 -0
- package/errors/InvalidType.d.ts +2 -0
- package/errors/InvalidType.mjs +4 -0
- package/errors/InvalidValue.cjs +11 -0
- package/errors/InvalidValue.d.ts +4 -0
- package/errors/InvalidValue.mjs +9 -0
- package/errors/MissingArgumentsError.cjs +13 -0
- package/errors/MissingArgumentsError.d.ts +7 -0
- package/errors/MissingArgumentsError.mjs +11 -0
- package/errors/NetworkError.cjs +13 -0
- package/errors/NetworkError.d.ts +8 -0
- package/errors/NetworkError.mjs +11 -0
- package/errors/NoSuchElement.cjs +6 -0
- package/errors/NoSuchElement.d.ts +2 -0
- package/errors/NoSuchElement.mjs +4 -0
- package/errors/NotImplemented.cjs +9 -0
- package/errors/NotImplemented.d.ts +5 -0
- package/errors/NotImplemented.mjs +7 -0
- package/errors/ParsingError.cjs +10 -0
- package/errors/ParsingError.d.ts +5 -0
- package/errors/ParsingError.mjs +8 -0
- package/errors/QueueEmptyError.cjs +6 -0
- package/errors/QueueEmptyError.d.ts +2 -0
- package/errors/QueueEmptyError.mjs +4 -0
- package/errors/QueueFullError.cjs +6 -0
- package/errors/QueueFullError.d.ts +2 -0
- package/errors/QueueFullError.mjs +4 -0
- package/errors/StackEmptyError.cjs +6 -0
- package/errors/StackEmptyError.d.ts +2 -0
- package/errors/StackEmptyError.mjs +4 -0
- package/errors/StackFullError.cjs +6 -0
- package/errors/StackFullError.d.ts +2 -0
- package/errors/StackFullError.mjs +4 -0
- package/errors/StreamEnded.cjs +6 -0
- package/errors/StreamEnded.d.ts +2 -0
- package/errors/StreamEnded.mjs +4 -0
- package/errors/TimeoutError.cjs +11 -0
- package/errors/TimeoutError.d.ts +6 -0
- package/errors/TimeoutError.mjs +9 -0
- package/errors/ValueDestroyedError.cjs +6 -0
- package/errors/ValueDestroyedError.d.ts +2 -0
- package/errors/ValueDestroyedError.mjs +4 -0
- package/errors/VerificationError.cjs +9 -0
- package/errors/VerificationError.d.ts +5 -0
- package/errors/VerificationError.mjs +7 -0
- package/errors/index.d.ts +18 -0
- package/errors.cjs +41 -0
- package/errors.mjs +18 -0
- package/files.cjs +201 -0
- package/files.d.ts +31 -0
- package/files.mjs +180 -0
- package/functools/index.d.ts +31 -0
- package/functools.cjs +371 -0
- package/functools.mjs +334 -0
- package/future/future.cjs +570 -0
- package/future/future.d.ts +208 -0
- package/future/future.mjs +548 -0
- package/future/group.cjs +180 -0
- package/future/group.d.ts +82 -0
- package/future/group.mjs +159 -0
- package/future/index.d.ts +3 -0
- package/future/result.cjs +19 -0
- package/future/result.d.ts +18 -0
- package/future/result.mjs +17 -0
- package/future.cjs +11 -0
- package/future.mjs +3 -0
- package/managers/context.d.ts +8 -0
- package/managers/index.d.ts +1 -0
- package/managers.cjs +2 -0
- package/managers.mjs +1 -0
- package/mocks.cjs +301 -0
- package/mocks.d.ts +125 -0
- package/mocks.mjs +293 -0
- package/networking/EventSourceService.cjs +104 -0
- package/networking/EventSourceService.d.ts +11 -0
- package/networking/EventSourceService.mjs +83 -0
- package/networking/NetworkService.cjs +394 -0
- package/networking/NetworkService.d.ts +97 -0
- package/networking/NetworkService.mjs +373 -0
- package/networking/SocketService.cjs +218 -0
- package/networking/SocketService.d.ts +23 -0
- package/networking/SocketService.mjs +197 -0
- package/networking/decorators/index.d.ts +4 -0
- package/networking/decorators/options.cjs +289 -0
- package/networking/decorators/options.d.ts +148 -0
- package/networking/decorators/options.mjs +242 -0
- package/networking/decorators/requests.cjs +80 -0
- package/networking/decorators/requests.d.ts +34 -0
- package/networking/decorators/requests.mjs +52 -0
- package/networking/decorators/socket.cjs +81 -0
- package/networking/decorators/socket.d.ts +13 -0
- package/networking/decorators/socket.mjs +51 -0
- package/networking/http.cjs +69 -0
- package/networking/http.d.ts +66 -0
- package/networking/http.mjs +69 -0
- package/networking/index.d.ts +39 -0
- package/networking/request.cjs +18 -0
- package/networking/request.d.ts +9 -0
- package/networking/request.mjs +16 -0
- package/networking/types.cjs +37 -0
- package/networking/types.d.ts +132 -0
- package/networking/types.mjs +35 -0
- package/networking.cjs +91 -0
- package/networking.mjs +33 -0
- package/package.json +1 -0
- package/reflection/injector.cjs +43 -0
- package/reflection/injector.d.ts +3 -0
- package/reflection/injector.mjs +40 -0
- package/socket.cjs +239 -0
- package/socket.d.ts +65 -0
- package/socket.mjs +237 -0
- package/store.cjs +12 -0
- package/store.mjs +3 -0
- package/stream/call.cjs +157 -0
- package/stream/call.d.ts +66 -0
- package/stream/call.mjs +154 -0
- package/stream/collector.cjs +217 -0
- package/stream/collector.d.ts +14 -0
- package/stream/collector.mjs +215 -0
- package/stream/index.d.ts +257 -0
- package/stream/observable.cjs +110 -0
- package/stream/observable.d.ts +65 -0
- package/stream/observable.mjs +106 -0
- package/stream/state.cjs +10 -0
- package/stream/state.d.ts +5 -0
- package/stream/state.mjs +8 -0
- package/stream.cjs +1153 -0
- package/stream.mjs +1132 -0
- package/synchronize.cjs +106 -0
- package/synchronize.d.ts +54 -0
- package/synchronize.mjs +103 -0
- package/typing/types.d.ts +24 -0
- package/typing.cjs +2 -0
- package/typing.mjs +1 -0
- package/utils/parser.cjs +37 -0
- package/utils/parser.d.ts +7 -0
- package/utils/parser.mjs +16 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { __awaiter, __asyncValues } from '../../_virtual/_tslib.mjs';
|
|
2
|
+
import { WaitableObject } from './WaitableObject.mjs';
|
|
3
|
+
import { Future } from '../../future/future.mjs';
|
|
4
|
+
import * as R from 'ramda';
|
|
5
|
+
import { FutureEvent } from '../../synchronize.mjs';
|
|
6
|
+
import { Stream } from '../../stream.mjs';
|
|
7
|
+
import { ExecutorState } from '../../stream/state.mjs';
|
|
8
|
+
import { SimpleQueue } from './SimpleQueue.mjs';
|
|
9
|
+
|
|
10
|
+
var WatchableObjectOperations;
|
|
11
|
+
(function (WatchableObjectOperations) {
|
|
12
|
+
WatchableObjectOperations[WatchableObjectOperations["DELETE"] = 0] = "DELETE";
|
|
13
|
+
WatchableObjectOperations[WatchableObjectOperations["GET"] = 1] = "GET";
|
|
14
|
+
WatchableObjectOperations[WatchableObjectOperations["SET"] = 2] = "SET";
|
|
15
|
+
WatchableObjectOperations[WatchableObjectOperations["CLEAR"] = 3] = "CLEAR";
|
|
16
|
+
WatchableObjectOperations[WatchableObjectOperations["VALUES"] = 4] = "VALUES";
|
|
17
|
+
})(WatchableObjectOperations || (WatchableObjectOperations = {}));
|
|
18
|
+
class WatchableObject extends WaitableObject {
|
|
19
|
+
constructor(objectMaxSize, expiryPeriod) {
|
|
20
|
+
super(objectMaxSize, expiryPeriod);
|
|
21
|
+
this.getListeners = [];
|
|
22
|
+
this.setListeners = [];
|
|
23
|
+
this.deleteListeners = [];
|
|
24
|
+
this.clearListeners = [];
|
|
25
|
+
this.valuesListeners = [];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Ingest data from the given stream into the queue. The future returned is
|
|
29
|
+
* already scheduled to execute in the background. However, you can cancel
|
|
30
|
+
* ingestion at anytime by cancelling the returned future
|
|
31
|
+
*
|
|
32
|
+
* Important Note:
|
|
33
|
+
* - Cancelling the ingestion does not kill the stream, only stops
|
|
34
|
+
* monitoring the stream for incoming data
|
|
35
|
+
* - If ingestion is cancelled and data had been retrieved at that period, the
|
|
36
|
+
* data will discarded
|
|
37
|
+
* @param stream input data stream
|
|
38
|
+
* @param keyExtractor used to get the key for storing the incoming data
|
|
39
|
+
*/
|
|
40
|
+
ingest(stream, keyExtractor) {
|
|
41
|
+
return this.ingestStream(stream, (data) => this.set(keyExtractor(data), data));
|
|
42
|
+
}
|
|
43
|
+
clone() {
|
|
44
|
+
return super.clone();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Stream of changes made to the object via SET, DELETE or CLEAR commands
|
|
48
|
+
*/
|
|
49
|
+
changeStream() {
|
|
50
|
+
const evt = new FutureEvent();
|
|
51
|
+
const queue = new SimpleQueue();
|
|
52
|
+
const cancelSet = this.onSet((key, oldValue, newValue) => {
|
|
53
|
+
queue.enqueue({
|
|
54
|
+
type: WatchableObjectOperations.SET,
|
|
55
|
+
key,
|
|
56
|
+
oldValue,
|
|
57
|
+
newValue,
|
|
58
|
+
});
|
|
59
|
+
evt.set();
|
|
60
|
+
});
|
|
61
|
+
const cancelDelete = this.onDelete((key, oldValue) => {
|
|
62
|
+
queue.enqueue({
|
|
63
|
+
type: WatchableObjectOperations.DELETE,
|
|
64
|
+
key,
|
|
65
|
+
oldValue,
|
|
66
|
+
});
|
|
67
|
+
evt.set();
|
|
68
|
+
});
|
|
69
|
+
const cancelClear = this.onClear(() => {
|
|
70
|
+
queue.enqueue({
|
|
71
|
+
type: WatchableObjectOperations.CLEAR,
|
|
72
|
+
key: "*",
|
|
73
|
+
});
|
|
74
|
+
evt.set();
|
|
75
|
+
});
|
|
76
|
+
const cleanup = R.once(() => {
|
|
77
|
+
cancelClear();
|
|
78
|
+
cancelSet();
|
|
79
|
+
cancelDelete();
|
|
80
|
+
});
|
|
81
|
+
return new Stream((signal) => __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
signal.onabort = cleanup;
|
|
83
|
+
while (queue.empty && !signal.aborted) {
|
|
84
|
+
yield evt.wait();
|
|
85
|
+
evt.clear();
|
|
86
|
+
}
|
|
87
|
+
if (signal.aborted) {
|
|
88
|
+
return new ExecutorState(true);
|
|
89
|
+
}
|
|
90
|
+
return queue.dequeue();
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Listens whenever a value is retrieved from this object
|
|
95
|
+
* @param listener
|
|
96
|
+
* @returns unsubscribe function
|
|
97
|
+
*/
|
|
98
|
+
onGet(listener) {
|
|
99
|
+
this.getListeners.push(listener);
|
|
100
|
+
return () => {
|
|
101
|
+
this.getListeners = this.getListeners.filter((v) => v !== listener);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Listens whenever a property is added or updated on this object
|
|
106
|
+
* @param listener
|
|
107
|
+
* @returns unsubscribe function
|
|
108
|
+
*/
|
|
109
|
+
onSet(listener) {
|
|
110
|
+
this.setListeners.push(listener);
|
|
111
|
+
return () => {
|
|
112
|
+
this.setListeners = this.setListeners.filter((v) => v !== listener);
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Listens whenever a property is deleted from this object
|
|
117
|
+
* @param listener
|
|
118
|
+
* @returns unsubscribe function
|
|
119
|
+
*/
|
|
120
|
+
onDelete(listener) {
|
|
121
|
+
this.deleteListeners.push(listener);
|
|
122
|
+
return () => {
|
|
123
|
+
this.deleteListeners = this.deleteListeners.filter((v) => v !== listener);
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Listens whenever this object is wiped clean
|
|
128
|
+
* @param listener
|
|
129
|
+
* @returns unsubscribe function
|
|
130
|
+
*/
|
|
131
|
+
onClear(listener) {
|
|
132
|
+
this.clearListeners.push(listener);
|
|
133
|
+
return () => {
|
|
134
|
+
this.clearListeners = this.clearListeners.filter((v) => v !== listener);
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Listens whenever the values() method is invoked on this object
|
|
139
|
+
* @param listener
|
|
140
|
+
* @returns unsubscribe function
|
|
141
|
+
*/
|
|
142
|
+
onValues(listener) {
|
|
143
|
+
this.valuesListeners.push(listener);
|
|
144
|
+
return () => {
|
|
145
|
+
this.valuesListeners = this.valuesListeners.filter((v) => v !== listener);
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
get(key, defaultValue) {
|
|
149
|
+
Future.sleep(1)
|
|
150
|
+
.thenApply(() => this.getListeners.forEach((listener) => listener(key)))
|
|
151
|
+
.run();
|
|
152
|
+
return super.get(key, defaultValue);
|
|
153
|
+
}
|
|
154
|
+
set(key, value, expiryPeriod) {
|
|
155
|
+
const oldValue = this.get(key);
|
|
156
|
+
super.set(key, value, expiryPeriod);
|
|
157
|
+
this.setListeners.forEach((listener) => listener(key, oldValue, value));
|
|
158
|
+
}
|
|
159
|
+
delete(key) {
|
|
160
|
+
const oldValue = this.get(key);
|
|
161
|
+
super.delete(key);
|
|
162
|
+
if (oldValue !== undefined)
|
|
163
|
+
this.deleteListeners.forEach((listener) => listener(key, oldValue));
|
|
164
|
+
}
|
|
165
|
+
clear() {
|
|
166
|
+
super.clear();
|
|
167
|
+
this.clearListeners.forEach((listener) => listener());
|
|
168
|
+
}
|
|
169
|
+
await(key, abort) {
|
|
170
|
+
return super.await(key, abort).thenApply((value) => {
|
|
171
|
+
Future.sleep(1)
|
|
172
|
+
.thenApply(() => this.getListeners.forEach((listener) => listener(key)))
|
|
173
|
+
.run();
|
|
174
|
+
return value.value;
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
on(key, callback, multiCall = true) {
|
|
178
|
+
return super.on(key, (v) => {
|
|
179
|
+
Future.sleep(1)
|
|
180
|
+
.thenApply(() => this.getListeners.forEach((listener) => listener(key)))
|
|
181
|
+
.run();
|
|
182
|
+
callback(v);
|
|
183
|
+
}, multiCall);
|
|
184
|
+
}
|
|
185
|
+
values(copy) {
|
|
186
|
+
Future.sleep(1)
|
|
187
|
+
.thenApply(() => this.valuesListeners.forEach((listener) => listener()))
|
|
188
|
+
.run();
|
|
189
|
+
return super.values(copy);
|
|
190
|
+
}
|
|
191
|
+
ingestStream(stream, handler) {
|
|
192
|
+
return Future.of((_, __, signal) => __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
var _a, e_1, _b, _c;
|
|
194
|
+
try {
|
|
195
|
+
for (var _d = true, stream_1 = __asyncValues(stream), stream_1_1; stream_1_1 = yield stream_1.next(), _a = stream_1_1.done, !_a;) {
|
|
196
|
+
_c = stream_1_1.value;
|
|
197
|
+
_d = false;
|
|
198
|
+
try {
|
|
199
|
+
const data = _c;
|
|
200
|
+
while (!signal.aborted && this.objectMaxSize && this.size() === this.objectMaxSize) {
|
|
201
|
+
yield Future.of((resolve, _, signal) => {
|
|
202
|
+
const cancel = this.onDelete(() => {
|
|
203
|
+
cancel();
|
|
204
|
+
resolve(null);
|
|
205
|
+
});
|
|
206
|
+
signal.onabort = cancel;
|
|
207
|
+
}).registerSignal(signal);
|
|
208
|
+
}
|
|
209
|
+
if (signal.aborted) {
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
handler(data);
|
|
213
|
+
}
|
|
214
|
+
finally {
|
|
215
|
+
_d = true;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
220
|
+
finally {
|
|
221
|
+
try {
|
|
222
|
+
if (!_d && !_a && (_b = stream_1.return)) yield _b.call(stream_1);
|
|
223
|
+
}
|
|
224
|
+
finally { if (e_1) throw e_1.error; }
|
|
225
|
+
}
|
|
226
|
+
})).schedule();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export { WatchableObject, WatchableObjectOperations };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { WatchableObject, WatchableChange, WatchableObjectOperations, Configuration } from "./WatchableObject";
|
|
2
|
+
export { WaitableObject } from "./WaitableObject";
|
|
3
|
+
export { CyclicalObject } from "./CyclicalObject";
|
|
4
|
+
export { TimeableObject } from "./TimeableObject";
|
|
5
|
+
export { Queue } from "./Queue";
|
|
6
|
+
export { BufferQueue } from "./BufferQueue";
|
|
7
|
+
export { SimpleQueue } from "./SimpleQueue";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var WatchableObject = require('./object/WatchableObject.cjs');
|
|
4
|
+
var WaitableObject = require('./object/WaitableObject.cjs');
|
|
5
|
+
var CyclicalObject = require('./object/CyclicalObject.cjs');
|
|
6
|
+
var TimeableObject = require('./object/TimeableObject.cjs');
|
|
7
|
+
var Queue = require('./object/Queue.cjs');
|
|
8
|
+
var BufferQueue = require('./object/BufferQueue.cjs');
|
|
9
|
+
var SimpleQueue = require('./object/SimpleQueue.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.WatchableObject = WatchableObject.WatchableObject;
|
|
14
|
+
Object.defineProperty(exports, 'WatchableObjectOperations', {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return WatchableObject.WatchableObjectOperations; }
|
|
17
|
+
});
|
|
18
|
+
exports.WaitableObject = WaitableObject.WaitableObject;
|
|
19
|
+
exports.CyclicalObject = CyclicalObject.CyclicalObject;
|
|
20
|
+
exports.TimeableObject = TimeableObject.TimeableObject;
|
|
21
|
+
exports.Queue = Queue.Queue;
|
|
22
|
+
exports.BufferQueue = BufferQueue.BufferQueue;
|
|
23
|
+
exports.SimpleQueue = SimpleQueue.SimpleQueue;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { WatchableObject, WatchableObjectOperations } from './object/WatchableObject.mjs';
|
|
2
|
+
export { WaitableObject } from './object/WaitableObject.mjs';
|
|
3
|
+
export { CyclicalObject } from './object/CyclicalObject.mjs';
|
|
4
|
+
export { TimeableObject } from './object/TimeableObject.mjs';
|
|
5
|
+
export { Queue } from './object/Queue.mjs';
|
|
6
|
+
export { BufferQueue } from './object/BufferQueue.mjs';
|
|
7
|
+
export { SimpleQueue } from './object/SimpleQueue.mjs';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Thrown when a network call fails to be executed successfully
|
|
5
|
+
*/
|
|
6
|
+
class CallExecutionError extends Error {
|
|
7
|
+
constructor(message, response) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.response = response;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.CallExecutionError = CallExecutionError;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Thrown to indicate that a method/function has been passed an illegal or inappropriate argument
|
|
5
|
+
*/
|
|
6
|
+
class IllegalArgumentsError extends Error {
|
|
7
|
+
constructor(args) {
|
|
8
|
+
super(`Received invalid arguments of type ${args.map((arg) => typeof arg).join(",")}`);
|
|
9
|
+
this.arguments = args;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.IllegalArgumentsError = IllegalArgumentsError;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown to indicate that a method/function has been passed an illegal or inappropriate argument
|
|
3
|
+
*/
|
|
4
|
+
class IllegalArgumentsError extends Error {
|
|
5
|
+
constructor(args) {
|
|
6
|
+
super(`Received invalid arguments of type ${args.map((arg) => typeof arg).join(",")}`);
|
|
7
|
+
this.arguments = args;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { IllegalArgumentsError };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Thrown to indicate that one or more required arguments of a method/function is missing
|
|
5
|
+
*/
|
|
6
|
+
class MissingArgumentsError extends Error {
|
|
7
|
+
constructor(args) {
|
|
8
|
+
super(`Missing the following arguments: ${args.join(",")}`);
|
|
9
|
+
this.arguments = args;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.MissingArgumentsError = MissingArgumentsError;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown to indicate that one or more required arguments of a method/function is missing
|
|
3
|
+
*/
|
|
4
|
+
class MissingArgumentsError extends Error {
|
|
5
|
+
constructor(args) {
|
|
6
|
+
super(`Missing the following arguments: ${args.join(",")}`);
|
|
7
|
+
this.arguments = args;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { MissingArgumentsError };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*Thrown to indicate some networking issue
|
|
5
|
+
*/
|
|
6
|
+
class NetworkError extends Error {
|
|
7
|
+
constructor(status, body) {
|
|
8
|
+
super(body !== null && body !== void 0 ? body : "");
|
|
9
|
+
this.status = status;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.NetworkError = NetworkError;
|