kiss-for-react 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +555 -0
- package/lib/cjs/ClassPersistor.js +112 -0
- package/lib/cjs/Esserializer/DeserializationOptions.js +4 -0
- package/lib/cjs/Esserializer/SerializeOptions.js +4 -0
- package/lib/cjs/Esserializer/constant.js +131 -0
- package/lib/cjs/Esserializer/deserializer.js +313 -0
- package/lib/cjs/Esserializer/general.js +39 -0
- package/lib/cjs/Esserializer/index.js +43 -0
- package/lib/cjs/Esserializer/serializer.js +133 -0
- package/lib/cjs/Hooks.js +969 -0
- package/lib/cjs/KissAction.js +1268 -0
- package/lib/cjs/Persistor.js +120 -0
- package/lib/cjs/ProcessPersistence.js +262 -0
- package/lib/cjs/Store.js +1534 -0
- package/lib/cjs/StoreException.js +75 -0
- package/lib/cjs/UnmodifiableSetView.js +53 -0
- package/lib/cjs/UserException.js +218 -0
- package/lib/cjs/Wait.js +309 -0
- package/lib/cjs/index.js +42 -0
- package/lib/cjs/types/ClassPersistor.d.ts +113 -0
- package/lib/cjs/types/ClassPersistor.d.ts.map +1 -0
- package/lib/cjs/types/Esserializer/DeserializationOptions.d.ts +7 -0
- package/lib/cjs/types/Esserializer/DeserializationOptions.d.ts.map +1 -0
- package/lib/cjs/types/Esserializer/SerializeOptions.d.ts +6 -0
- package/lib/cjs/types/Esserializer/SerializeOptions.d.ts.map +1 -0
- package/lib/cjs/types/Esserializer/constant.d.ts +50 -0
- package/lib/cjs/types/Esserializer/constant.d.ts.map +1 -0
- package/lib/cjs/types/Esserializer/deserializer.d.ts +18 -0
- package/lib/cjs/types/Esserializer/deserializer.d.ts.map +1 -0
- package/lib/cjs/types/Esserializer/general.d.ts +5 -0
- package/lib/cjs/types/Esserializer/general.d.ts.map +1 -0
- package/lib/cjs/types/Esserializer/index.d.ts +30 -0
- package/lib/cjs/types/Esserializer/index.d.ts.map +1 -0
- package/lib/cjs/types/Esserializer/serializer.d.ts +4 -0
- package/lib/cjs/types/Esserializer/serializer.d.ts.map +1 -0
- package/lib/cjs/types/Hooks.d.ts +838 -0
- package/lib/cjs/types/Hooks.d.ts.map +1 -0
- package/lib/cjs/types/KissAction.d.ts +1324 -0
- package/lib/cjs/types/KissAction.d.ts.map +1 -0
- package/lib/cjs/types/Persistor.d.ts +119 -0
- package/lib/cjs/types/Persistor.d.ts.map +1 -0
- package/lib/cjs/types/ProcessPersistence.d.ts +100 -0
- package/lib/cjs/types/ProcessPersistence.d.ts.map +1 -0
- package/lib/cjs/types/Store.d.ts +1043 -0
- package/lib/cjs/types/Store.d.ts.map +1 -0
- package/lib/cjs/types/StoreException.d.ts +29 -0
- package/lib/cjs/types/StoreException.d.ts.map +1 -0
- package/lib/cjs/types/UnmodifiableSetView.d.ts +24 -0
- package/lib/cjs/types/UnmodifiableSetView.d.ts.map +1 -0
- package/lib/cjs/types/UserException.d.ts +170 -0
- package/lib/cjs/types/UserException.d.ts.map +1 -0
- package/lib/cjs/types/Wait.d.ts +1 -0
- package/lib/cjs/types/Wait.d.ts.map +1 -0
- package/lib/cjs/types/index.d.ts +10 -0
- package/lib/cjs/types/index.d.ts.map +1 -0
- package/lib/cjs/types/utils.d.ts +2 -0
- package/lib/cjs/types/utils.d.ts.map +1 -0
- package/lib/cjs/utils.js +7 -0
- package/lib/esm/ClassPersistor.js +112 -0
- package/lib/esm/Esserializer/DeserializationOptions.js +3 -0
- package/lib/esm/Esserializer/SerializeOptions.js +3 -0
- package/lib/esm/Esserializer/constant.js +81 -0
- package/lib/esm/Esserializer/deserializer.js +307 -0
- package/lib/esm/Esserializer/general.js +34 -0
- package/lib/esm/Esserializer/index.js +39 -0
- package/lib/esm/Esserializer/serializer.js +130 -0
- package/lib/esm/Hooks.js +955 -0
- package/lib/esm/KissAction.js +1368 -0
- package/lib/esm/Persistor.js +113 -0
- package/lib/esm/ProcessPersistence.js +262 -0
- package/lib/esm/Store.js +1606 -0
- package/lib/esm/StoreException.js +69 -0
- package/lib/esm/UnmodifiableSetView.js +50 -0
- package/lib/esm/UserException.js +246 -0
- package/lib/esm/Wait.js +309 -0
- package/lib/esm/index.mjs +9 -0
- package/lib/esm/types/ClassPersistor.d.ts +113 -0
- package/lib/esm/types/ClassPersistor.d.ts.map +1 -0
- package/lib/esm/types/Esserializer/DeserializationOptions.d.ts +7 -0
- package/lib/esm/types/Esserializer/DeserializationOptions.d.ts.map +1 -0
- package/lib/esm/types/Esserializer/SerializeOptions.d.ts +6 -0
- package/lib/esm/types/Esserializer/SerializeOptions.d.ts.map +1 -0
- package/lib/esm/types/Esserializer/constant.d.ts +50 -0
- package/lib/esm/types/Esserializer/constant.d.ts.map +1 -0
- package/lib/esm/types/Esserializer/deserializer.d.ts +18 -0
- package/lib/esm/types/Esserializer/deserializer.d.ts.map +1 -0
- package/lib/esm/types/Esserializer/general.d.ts +5 -0
- package/lib/esm/types/Esserializer/general.d.ts.map +1 -0
- package/lib/esm/types/Esserializer/index.d.ts +30 -0
- package/lib/esm/types/Esserializer/index.d.ts.map +1 -0
- package/lib/esm/types/Esserializer/serializer.d.ts +4 -0
- package/lib/esm/types/Esserializer/serializer.d.ts.map +1 -0
- package/lib/esm/types/Hooks.d.ts +838 -0
- package/lib/esm/types/Hooks.d.ts.map +1 -0
- package/lib/esm/types/KissAction.d.ts +1324 -0
- package/lib/esm/types/KissAction.d.ts.map +1 -0
- package/lib/esm/types/Persistor.d.ts +119 -0
- package/lib/esm/types/Persistor.d.ts.map +1 -0
- package/lib/esm/types/ProcessPersistence.d.ts +100 -0
- package/lib/esm/types/ProcessPersistence.d.ts.map +1 -0
- package/lib/esm/types/Store.d.ts +1043 -0
- package/lib/esm/types/Store.d.ts.map +1 -0
- package/lib/esm/types/StoreException.d.ts +29 -0
- package/lib/esm/types/StoreException.d.ts.map +1 -0
- package/lib/esm/types/UnmodifiableSetView.d.ts +24 -0
- package/lib/esm/types/UnmodifiableSetView.d.ts.map +1 -0
- package/lib/esm/types/UserException.d.ts +170 -0
- package/lib/esm/types/UserException.d.ts.map +1 -0
- package/lib/esm/types/Wait.d.ts +1 -0
- package/lib/esm/types/Wait.d.ts.map +1 -0
- package/lib/esm/types/index.d.ts +10 -0
- package/lib/esm/types/index.d.ts.map +1 -0
- package/lib/esm/types/utils.d.ts +2 -0
- package/lib/esm/types/utils.d.ts.map +1 -0
- package/lib/esm/utils.js +3 -0
- package/package.json +87 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Store.d.ts","sourceRoot":"","sources":["../../../src/Store.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACL,YAAY,EAGZ,UAAU,EAGX,MAAM,cAAc,CAAC;AAKtB,UAAU,iBAAiB,CAAC,EAAE;IAE5B;;OAEG;IACH,YAAY,EAAE,EAAE,CAAC;IAEjB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAExF;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;IAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAE3B;;;;;;;;;;;;;;OAcG;IACH,eAAe,EAAE,OAAO,CAAC;IAEzB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;IAEtC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM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BAAkB,CAAC,EAAE;IAC7B,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB,CAAC,EAAE;IAClC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,YAAY,sCAEvB,CAAC;AAEH,wBAAgB,aAAa,CAAC,EAAE,EAAE,EAAC,KAAK,EAAE,QAAQ,EAAC,EAAE,kBAAkB,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,OAAO,CAOxF;AAED,cAAM,KAAK,CAAC,EAAE;IACZ,OAAO,CAAC,KAAK,CAAkG;IAE/G,GAAG,CAAC,CAAC,SAAS,UAAU,CAAC,EAAE,CAAC,EAC1B,UAAU,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EACrC,YAAY,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IAI3D,MAAM,CAAC,UAAU,EAAE,UAAU,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI;IAIlD,KAAK,IAAI,IAAI;IAIb,GAAG,CAAC,UAAU,EAAE,UAAU,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC,KAAK,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,SAAS;CAG3G;AAED,oBAAY,iBAAiB,GAAG,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
All exceptions thrown by Kiss are of type StoreException.
|
|
3
|
+
*/
|
|
4
|
+
export declare class StoreException extends Error {
|
|
5
|
+
constructor(message: string);
|
|
6
|
+
}
|
|
7
|
+
export declare class TimeoutException extends Error {
|
|
8
|
+
/**
|
|
9
|
+
* The global default timeout for the wait functions (like `waitCondition` etc.) is 10 minutes.
|
|
10
|
+
* This value is not final and can be modified.
|
|
11
|
+
* To disable the timeout, modify this to a large value, like 300000000000 (almost 10 years).
|
|
12
|
+
*/
|
|
13
|
+
static defaultTimeoutMillis: number;
|
|
14
|
+
constructor(message?: string);
|
|
15
|
+
}
|
|
16
|
+
export declare class ExceptionUtils {
|
|
17
|
+
/**
|
|
18
|
+
Cuts the stack trace at the given string, to avoid showing internal Kiss lines,
|
|
19
|
+
which are not interesting to the user.
|
|
20
|
+
|
|
21
|
+
IMPORTANT: This should only be called during development. V8 only computes it if someone
|
|
22
|
+
actually reads the property, which improves performance dramatically for handable errors.
|
|
23
|
+
When you use this, you'll pay the cost even if your caller doesn't need the stack.
|
|
24
|
+
|
|
25
|
+
The given text will be found at the start of the line, like this: ` at ${text} `
|
|
26
|
+
*/
|
|
27
|
+
static sanitizedStackTrace<T extends Error>(error: T, text: string): T;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=StoreException.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoreException.d.ts","sourceRoot":"","sources":["../../../src/StoreException.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAU5B;AAGD,qBAAa,gBAAiB,SAAQ,KAAK;IAEzC;;;;OAIG;IACH,OAAc,oBAAoB,SAAkB;gBAExC,OAAO,CAAC,EAAE,MAAM;CAU7B;AAED,qBAAa,cAAc;IAEzB;;;;;;;;;OASG;IACH,MAAM,CAAC,mBAAmB,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;CAiCvE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An unmodifiable set.
|
|
3
|
+
*
|
|
4
|
+
* An [UnmodifiableSetView] contains a [Set], and prevents that set from being changed through the view.
|
|
5
|
+
* Methods that could change the set, such as [add] and [remove], throw an [UnsupportedError].
|
|
6
|
+
* Permitted operations defer to the wrapped set.
|
|
7
|
+
*/
|
|
8
|
+
export declare class UnmodifiableSetView<T> implements Set<T> {
|
|
9
|
+
private readonly _set;
|
|
10
|
+
constructor(set: Set<T>);
|
|
11
|
+
has(value: T): boolean;
|
|
12
|
+
get size(): number;
|
|
13
|
+
forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
|
|
14
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
15
|
+
entries(): IterableIterator<[T, T]>;
|
|
16
|
+
values(): IterableIterator<T>;
|
|
17
|
+
keys(): IterableIterator<T>;
|
|
18
|
+
add(value: T): this;
|
|
19
|
+
clear(): void;
|
|
20
|
+
delete(value: T): boolean;
|
|
21
|
+
get [Symbol.toStringTag](): string;
|
|
22
|
+
toString(): string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=UnmodifiableSetView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnmodifiableSetView.d.ts","sourceRoot":"","sources":["../../../src/UnmodifiableSetView.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,qBAAa,mBAAmB,CAAC,CAAC,CAAE,YAAW,GAAG,CAAC,CAAC,CAAC;IACnD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;gBAElB,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAIvB,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO;IAItB,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI;IAIpF,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC;IAIxC,OAAO,IAAI,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAInC,MAAM,IAAI,gBAAgB,CAAC,CAAC,CAAC;IAI7B,IAAI,IAAI,gBAAgB,CAAC,CAAC,CAAC;IAI3B,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IAInB,KAAK,IAAI,IAAI;IAIb,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO;IAIzB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;IAED,QAAQ;CAGT"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This exception is meant to represent a user input error, and not a bug or
|
|
3
|
+
* a system error. It must not be logged as an error, but instead shown to the
|
|
4
|
+
* user. When dispatched inside a reducer, a dialog will be shown to the user,
|
|
5
|
+
* with the given message.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* // Throws an exception with the given message.
|
|
11
|
+
* throw new UserException('The item already exists');
|
|
12
|
+
*
|
|
13
|
+
* // Throws an exception with the given message and title.
|
|
14
|
+
* throw new UserException('The item already exists', { title: 'Could not add' });
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* You can also define a hardCause for the exception:
|
|
18
|
+
* ```ts
|
|
19
|
+
* // Throws an exception with the given message.
|
|
20
|
+
* throw new UserException('The item already exists', {hardCause: someError}});
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* The user exception is immutable. But you can use some methods to create a modified copy:
|
|
24
|
+
* - withTitle
|
|
25
|
+
* - withMessage
|
|
26
|
+
* - withHardCause
|
|
27
|
+
* - withDialog
|
|
28
|
+
* - withErrorText
|
|
29
|
+
* - addProps
|
|
30
|
+
* - addCallbacks
|
|
31
|
+
*/
|
|
32
|
+
export declare class UserException extends Error {
|
|
33
|
+
/**
|
|
34
|
+
* The title of the dialog that shows the message.
|
|
35
|
+
*/
|
|
36
|
+
readonly title: string;
|
|
37
|
+
/**
|
|
38
|
+
* The original error that caused the user exception. For example, when validating
|
|
39
|
+
* some user input, if you get a ValidationError, that's the hardCause.
|
|
40
|
+
* Then: `throw new UserException('Invalid number').withHardCause(validationError)`.
|
|
41
|
+
*/
|
|
42
|
+
readonly hardCause: any;
|
|
43
|
+
/**
|
|
44
|
+
* If `true`, throwing the exception will show a dialog or similar UI.
|
|
45
|
+
* If `false` you can still show the error in a different way, usually showing `errorText`
|
|
46
|
+
* in the UI element that is responsible for the error.
|
|
47
|
+
*/
|
|
48
|
+
readonly ifOpenDialog: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Some text to be displayed in the UI element that is responsible for the error.
|
|
51
|
+
* For example, a text field could show this as red text, below it.
|
|
52
|
+
* When building your widgets, you can get the `errorText` from the failed action:
|
|
53
|
+
* `errorText = store.exceptionFor(MyAction).errorText`.
|
|
54
|
+
*/
|
|
55
|
+
readonly errorText: string | null;
|
|
56
|
+
/**
|
|
57
|
+
* Callback to be called after the user views the error, and taps OK in the dialog.
|
|
58
|
+
*/
|
|
59
|
+
readonly onOk?: () => void;
|
|
60
|
+
/**
|
|
61
|
+
* Callback to be called after the user views the error, and taps CANCEL in the dialog.
|
|
62
|
+
*/
|
|
63
|
+
readonly onCancel?: () => void;
|
|
64
|
+
private readonly _props;
|
|
65
|
+
constructor(message: string, { title, hardCause, ifOpenDialog, errorText, onOk, onCancel, props }?: {
|
|
66
|
+
title?: string;
|
|
67
|
+
hardCause?: any;
|
|
68
|
+
ifOpenDialog?: boolean;
|
|
69
|
+
errorText?: string | null;
|
|
70
|
+
onOk?: () => void;
|
|
71
|
+
onCancel?: () => void;
|
|
72
|
+
props?: {
|
|
73
|
+
[key: string]: any;
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
/**
|
|
77
|
+
* Returns a copy of the props object.
|
|
78
|
+
* You can add properties to the user exception by using `addProps`.
|
|
79
|
+
*/
|
|
80
|
+
get props(): {
|
|
81
|
+
[key: string]: any;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
Adds a title to the exception.
|
|
85
|
+
|
|
86
|
+
Usage:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
// Throws an exception with the given message and title.
|
|
90
|
+
throw new UserException('The item already exists').withTitle('Could not add');
|
|
91
|
+
```
|
|
92
|
+
*/
|
|
93
|
+
withTitle(title: string): UserException;
|
|
94
|
+
/**
|
|
95
|
+
Adds a message to the exception.
|
|
96
|
+
|
|
97
|
+
Usage:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
// Throws an exception with the given message and title.
|
|
101
|
+
throw new UserException('The item already exists').withTitle('Could not add');
|
|
102
|
+
```
|
|
103
|
+
*/
|
|
104
|
+
withMessage(message: string): UserException;
|
|
105
|
+
/**
|
|
106
|
+
* Adds a hardCause to the exception.
|
|
107
|
+
*
|
|
108
|
+
* Usage:
|
|
109
|
+
*
|
|
110
|
+
* ```ts
|
|
111
|
+
* throw new UserException('The item already exists').withCause(someError);
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
withHardCause(hardCause: any): UserException;
|
|
115
|
+
/**
|
|
116
|
+
* If `true`, throwing the exception will show a dialog or similar UI.
|
|
117
|
+
* If `false` you can still show the error in a different way, usually showing `errorText`
|
|
118
|
+
* in the UI element that is responsible for the error.
|
|
119
|
+
*
|
|
120
|
+
* Usage:
|
|
121
|
+
*
|
|
122
|
+
* ```ts
|
|
123
|
+
* throw new UserException('The item already exists').withDialog(false);
|
|
124
|
+
* ```
|
|
125
|
+
*
|
|
126
|
+
*/
|
|
127
|
+
withDialog(ifOpenDialog: boolean): UserException;
|
|
128
|
+
/**
|
|
129
|
+
* This exception should NOT open a dialog.
|
|
130
|
+
* Still, the error may be shown in a different way, usually showing [errorText]
|
|
131
|
+
* somewhere in the UI.
|
|
132
|
+
* This is the same as doing: `.withDialog(false)`.
|
|
133
|
+
*/
|
|
134
|
+
get noDialog(): UserException;
|
|
135
|
+
/**
|
|
136
|
+
* Adds some text to be displayed in the UI element that is responsible for the error.
|
|
137
|
+
* For example, a text field could show this as red text, below it.
|
|
138
|
+
*
|
|
139
|
+
* When building your widgets, you can get the `errorText` from the failed action:
|
|
140
|
+
* `errorText = store.exceptionFor(MyAction).errorText`.
|
|
141
|
+
*
|
|
142
|
+
* Usage:
|
|
143
|
+
*
|
|
144
|
+
* ```ts
|
|
145
|
+
* throw new UserException('The item already exists').withDialog(false);
|
|
146
|
+
* ```
|
|
147
|
+
*
|
|
148
|
+
*/
|
|
149
|
+
withErrorText(errorText: string | null): UserException;
|
|
150
|
+
/**
|
|
151
|
+
* Adds `moreProps` to the properties of the `UserException`.
|
|
152
|
+
* If the exception already had `props`, the new `moreProps` will be merged with those.
|
|
153
|
+
*/
|
|
154
|
+
addProps(moreProps?: {
|
|
155
|
+
[key: string]: any;
|
|
156
|
+
}): UserException;
|
|
157
|
+
/**
|
|
158
|
+
* Adds callbacks to the `UserException`.
|
|
159
|
+
*
|
|
160
|
+
* This method is used to add `onOk` and `onCancel` callbacks to the `UserException`.
|
|
161
|
+
*
|
|
162
|
+
* The `onOk` callback will be called when the user taps OK in the error dialog.
|
|
163
|
+
* The `onCancel` callback will be called when the user taps CANCEL in the error dialog.
|
|
164
|
+
*
|
|
165
|
+
* If the exception already had callbacks, the new callbacks will be merged with the old ones,
|
|
166
|
+
* and the old callbacks will be called before the new ones.
|
|
167
|
+
*/
|
|
168
|
+
addCallbacks(onOk?: () => void, onCancel?: () => void): UserException;
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=UserException.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserException.d.ts","sourceRoot":"","sources":["../../../src/UserException.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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IAU5C;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,YAAY,EAAE,OAAO,GAAG,aAAa;IAUhD;;;;;OAKG;IACH,IAAI,QAAQ,IAAI,aAAa,CAE5B;IAED;;;;;;;;;;;;;OAaG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,aAAa;IAUtD;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,aAAa;IAiB3D;;;;;;;;;;OAUG;IACH,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,aAAa;CAiCtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=Wait.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Wait.d.ts","sourceRoot":"","sources":["../../../src/Wait.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PersistAction, PersistException, Persistor, PersistorDummy, PersistorPrinterDecorator } from './Persistor';
|
|
2
|
+
import { ClassPersistor } from './ClassPersistor';
|
|
3
|
+
import { ProcessPersistence } from './ProcessPersistence';
|
|
4
|
+
import { ActionStatus, AsyncReducer, AsyncReducerResult, OptimisticUpdate, KissAction, UserExceptionAction, ReduxReducer, Retry, RetryOptions, SyncReducer, UpdateStateAction } from './KissAction';
|
|
5
|
+
import { Store, createStore, ShowUserException, StoreProvider } from './Store';
|
|
6
|
+
import { useAllState, useClearExceptionFor, useDispatch, useDispatchAll, useDispatchAndWait, useDispatchAndWaitAll, useDispatcher, useDispatchSync, useExceptionFor, useIsFailed, useIsWaiting, useSelect, useSelector, useStore } from './Hooks';
|
|
7
|
+
import { StoreException } from './StoreException';
|
|
8
|
+
import { UserException } from './UserException';
|
|
9
|
+
export { Persistor, PersistorPrinterDecorator, PersistorDummy, PersistException, PersistAction, UpdateStateAction, ClassPersistor, ProcessPersistence, KissAction, UserExceptionAction, ActionStatus, ReduxReducer, SyncReducer, AsyncReducer, AsyncReducerResult, Store, createStore, useStore, useAllState, useSelect, useSelector, StoreProvider, ShowUserException, useIsWaiting, useIsFailed, useExceptionFor, useClearExceptionFor, useDispatch, useDispatchAll, useDispatchAndWait, useDispatchAndWaitAll, useDispatchSync, useDispatcher, StoreException, UserException, OptimisticUpdate, Retry, RetryOptions, };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,yBAAyB,EAAG,MAAM,aAAa,CAAC;AACrH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,KAAK,EACL,YAAY,EACZ,WAAW,EACX,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,eAAe,EACf,WAAW,EACX,YAAY,EACZ,SAAS,EACT,WAAW,EACX,QAAQ,EACT,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EACL,SAAS,EAAE,yBAAyB,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EACxG,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,mBAAmB,EACnB,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,kBAAkB,EACzE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,iBAAiB,EACnG,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,EAChE,WAAW,EAAE,cAAc,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,eAAe,EAAE,aAAa,EACtG,cAAc,EACd,aAAa,EACb,gBAAgB,EAAE,KAAK,EAAE,YAAY,GACtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAErD"}
|
package/lib/cjs/utils.js
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ESSerializer } from './Esserializer';
|
|
2
|
+
import { Persistor } from './Persistor';
|
|
3
|
+
/**
|
|
4
|
+
* Use it like this:
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* const store = createStore<AppState>({
|
|
8
|
+
* initialState: initialState,
|
|
9
|
+
* persistor: new MyPersistor(),
|
|
10
|
+
* });
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* Example for web:
|
|
14
|
+
* ```
|
|
15
|
+
* return new ClassPersistor<State>(
|
|
16
|
+
* async () => window.localStorage.getItem('state'),
|
|
17
|
+
* async (serialized) => window.localStorage.setItem('state', serialized),
|
|
18
|
+
* async () => window.localStorage.clear(),
|
|
19
|
+
* [State, TodoList, TodoItem, Filter] // All state classes the app uses.
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Example for React Native:
|
|
24
|
+
* ```
|
|
25
|
+
* return new ClassPersistor<State>(
|
|
26
|
+
* async () => AsyncStorage.getItem('state'),
|
|
27
|
+
* async (serialized) => AsyncStorage.setItem('state', serialized),
|
|
28
|
+
* async () => AsyncStorage.clear(),
|
|
29
|
+
* [State, TodoList, TodoItem, Filter] // All state classes the app uses.
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export class ClassPersistor extends Persistor {
|
|
34
|
+
loadSerialized;
|
|
35
|
+
saveSerialized;
|
|
36
|
+
deleteSerialized;
|
|
37
|
+
classesToSerialize;
|
|
38
|
+
constructor(
|
|
39
|
+
/**
|
|
40
|
+
* Returns the serialized state. You can use this to load from localStorage or IndexedDB
|
|
41
|
+
* (in React web), or AsyncStorage (in React Native) or other.
|
|
42
|
+
* It should return a Promise that resolves to the serialized state, or to null if the state
|
|
43
|
+
* is not yet persisted.
|
|
44
|
+
*/
|
|
45
|
+
loadSerialized,
|
|
46
|
+
//
|
|
47
|
+
/**
|
|
48
|
+
* Saves the given serialized state. You can use this to save to localStorage or IndexedDB
|
|
49
|
+
* (in React web), or AsyncStorage (in React Native) or other.
|
|
50
|
+
* It should return a Promise that resolves when the state is saved.
|
|
51
|
+
*/
|
|
52
|
+
saveSerialized,
|
|
53
|
+
//
|
|
54
|
+
/**
|
|
55
|
+
* Deletes the serialized state. You can use this to delete from the localStorage or IndexedDB
|
|
56
|
+
* (in React web), or AsyncStorage (in React Native) or other.
|
|
57
|
+
* It should return a Promise that resolves when the state is deleted.
|
|
58
|
+
*/
|
|
59
|
+
deleteSerialized,
|
|
60
|
+
//
|
|
61
|
+
/**
|
|
62
|
+
* You HAVE to list here all the custom classes that are part of your state, directly or
|
|
63
|
+
* indirectly. Note: You don't need to list native JavaScript classes, like Date.
|
|
64
|
+
* For example, suppose you have a class `State` that has a property `todoList` of
|
|
65
|
+
* type `TodoList`.
|
|
66
|
+
* And the class `TodoList` has a property `items` of type `Array<TodoItem>`.
|
|
67
|
+
* Then you have to list all three classes here: `[State, TodoList, TodoItem]`.
|
|
68
|
+
*/
|
|
69
|
+
classesToSerialize) {
|
|
70
|
+
super();
|
|
71
|
+
this.loadSerialized = loadSerialized;
|
|
72
|
+
this.saveSerialized = saveSerialized;
|
|
73
|
+
this.deleteSerialized = deleteSerialized;
|
|
74
|
+
this.classesToSerialize = classesToSerialize;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Read the saved state from the persistence. Should return null if the state is not yet
|
|
78
|
+
* persisted. This method should be called only once, when the app starts, before the store
|
|
79
|
+
* is created. The state it returns may become the store's initial-state. If some error
|
|
80
|
+
* occurs while loading the info, we have to deal with it by fixing the problem. In the worse
|
|
81
|
+
* case, if we think the state is corrupted and cannot be fixed, one alternative is deleting
|
|
82
|
+
* all persisted files and returning null.
|
|
83
|
+
*/
|
|
84
|
+
async readState() {
|
|
85
|
+
// Reads the JSON file as a string.
|
|
86
|
+
const serializedString = await this.loadSerialized();
|
|
87
|
+
if (serializedString === null)
|
|
88
|
+
return null;
|
|
89
|
+
ESSerializer.registerClasses(this.classesToSerialize);
|
|
90
|
+
return ESSerializer.deserialize(serializedString);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Save an initial-state to the persistence.
|
|
94
|
+
*/
|
|
95
|
+
async saveInitialState(state) {
|
|
96
|
+
const serializedString = ESSerializer.serialize(state);
|
|
97
|
+
await this.saveSerialized(serializedString);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Delete the saved state from the persistence.
|
|
101
|
+
*/
|
|
102
|
+
async deleteState() {
|
|
103
|
+
return this.deleteSerialized();
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* We assume the state is small, and we save `newState` everytime, ignoring `lastPersistedState`.
|
|
107
|
+
*/
|
|
108
|
+
async persistDifference(_lastPersistedState, newState) {
|
|
109
|
+
const serializedString = ESSerializer.serialize(newState);
|
|
110
|
+
await this.saveSerialized(serializedString);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// The Esserializer code was copied and adapted from the original copyrighted work, MIT licensed, by cshao.
|
|
2
|
+
// All credit goes to him. See: https://www.npmjs.com/package/esserializer
|
|
3
|
+
const ESSERIALIZER_NULL = '__ESSERIALIZER_NULL__';
|
|
4
|
+
const ARRAY_FIELD = 'ess_arr';
|
|
5
|
+
const BOOLEAN_FIELD = 'ess_bool';
|
|
6
|
+
const CLASS_NAME_FIELD = '*type';
|
|
7
|
+
const OPTIONS_FIELD = 'ess_opt';
|
|
8
|
+
const TIMESTAMP_FIELD = 'ess_ts';
|
|
9
|
+
const TO_STRING_FIELD = 'ess_str';
|
|
10
|
+
const BUILTIN_CLASS_INT8ARRAY = 'Int8Array';
|
|
11
|
+
const BUILTIN_CLASS_UINT8ARRAY = 'Uint8Array';
|
|
12
|
+
const BUILTIN_CLASS_UINT8CLAMPEDARRAY = 'Uint8ClampedArray';
|
|
13
|
+
const BUILTIN_CLASS_INT16ARRAY = 'Int16Array';
|
|
14
|
+
const BUILTIN_CLASS_UINT16ARRAY = 'Uint16Array';
|
|
15
|
+
const BUILTIN_CLASS_INT32ARRAY = 'Int32Array';
|
|
16
|
+
const BUILTIN_CLASS_UINT32ARRAY = 'Uint32Array';
|
|
17
|
+
const BUILTIN_CLASS_FLOAT32ARRAY = 'Float32Array';
|
|
18
|
+
const BUILTIN_CLASS_FLOAT64ARRAY = 'Float64Array';
|
|
19
|
+
const BUILTIN_CLASS_BIGINT64ARRAY = 'BigInt64Array';
|
|
20
|
+
const BUILTIN_CLASS_BIGUINT64ARRAY = 'BigUint64Array';
|
|
21
|
+
const BUILTIN_CLASS_ARRAYBUFFER = 'ArrayBuffer';
|
|
22
|
+
const BUILTIN_CLASS_SHAREDARRAYBUFFER = 'SharedArrayBuffer';
|
|
23
|
+
const BUILTIN_CLASS_BOOLEAN = 'Boolean';
|
|
24
|
+
const BUILTIN_CLASS_DATAVIEW = 'DataView';
|
|
25
|
+
const BUILTIN_CLASS_DATE = 'Date';
|
|
26
|
+
const BUILTIN_CLASS_INTL_COLLATOR = 'Collator';
|
|
27
|
+
const BUILTIN_CLASS_INTL_DATETIMEFORMAT = 'DateTimeFormat';
|
|
28
|
+
const BUILTIN_CLASS_INTL_LISTFORMAT = 'ListFormat';
|
|
29
|
+
const BUILTIN_CLASS_INTL_LOCALE = 'Locale';
|
|
30
|
+
const BUILTIN_CLASS_INTL_NUMBERFORMAT = 'NumberFormat';
|
|
31
|
+
const BUILTIN_CLASS_INTL_PLURALRULES = 'PluralRules';
|
|
32
|
+
const BUILTIN_CLASS_INTL_RELATIVETIMEFORMAT = 'RelativeTimeFormat';
|
|
33
|
+
const BUILTIN_CLASS_REGEXP = 'RegExp';
|
|
34
|
+
const BUILTIN_CLASS_SET = 'Set';
|
|
35
|
+
const BUILTIN_CLASS_STRING = 'String';
|
|
36
|
+
const BUILTIN_CLASS_ERROR = 'Error';
|
|
37
|
+
const BUILTIN_CLASS_EVAL_ERROR = 'EvalError';
|
|
38
|
+
const BUILTIN_CLASS_RANGE_ERROR = 'RangeError';
|
|
39
|
+
const BUILTIN_CLASS_REFERENCE_ERROR = 'ReferenceError';
|
|
40
|
+
const BUILTIN_CLASS_SYNTAX_ERROR = 'SyntaxError';
|
|
41
|
+
const BUILTIN_CLASS_TYPE_ERROR = 'TypeError';
|
|
42
|
+
const BUILTIN_CLASS_URI_ERROR = 'URIError';
|
|
43
|
+
const BUILTIN_CLASS_AGGREGATE_ERROR = 'AggregateError';
|
|
44
|
+
const BUILTIN_TYPE_BIG_INT = 'BI';
|
|
45
|
+
const BUILTIN_TYPE_NOT_FINITE = 'NF';
|
|
46
|
+
const BUILTIN_TYPE_UNDEFINED = 'UD';
|
|
47
|
+
const ALL_BUILTIN_ARRAYS = [
|
|
48
|
+
BUILTIN_CLASS_INT8ARRAY,
|
|
49
|
+
BUILTIN_CLASS_UINT8ARRAY,
|
|
50
|
+
BUILTIN_CLASS_UINT8CLAMPEDARRAY,
|
|
51
|
+
BUILTIN_CLASS_INT16ARRAY,
|
|
52
|
+
BUILTIN_CLASS_UINT16ARRAY,
|
|
53
|
+
BUILTIN_CLASS_INT32ARRAY,
|
|
54
|
+
BUILTIN_CLASS_UINT32ARRAY,
|
|
55
|
+
BUILTIN_CLASS_FLOAT32ARRAY,
|
|
56
|
+
BUILTIN_CLASS_FLOAT64ARRAY,
|
|
57
|
+
BUILTIN_CLASS_BIGINT64ARRAY,
|
|
58
|
+
BUILTIN_CLASS_BIGUINT64ARRAY
|
|
59
|
+
];
|
|
60
|
+
const ALL_BUILTIN_ERRORS = [
|
|
61
|
+
BUILTIN_CLASS_ERROR,
|
|
62
|
+
BUILTIN_CLASS_EVAL_ERROR,
|
|
63
|
+
BUILTIN_CLASS_RANGE_ERROR,
|
|
64
|
+
BUILTIN_CLASS_REFERENCE_ERROR,
|
|
65
|
+
BUILTIN_CLASS_SYNTAX_ERROR,
|
|
66
|
+
BUILTIN_CLASS_TYPE_ERROR,
|
|
67
|
+
BUILTIN_CLASS_URI_ERROR,
|
|
68
|
+
BUILTIN_CLASS_AGGREGATE_ERROR
|
|
69
|
+
];
|
|
70
|
+
const ALL_BUILTIN_INTLS = [
|
|
71
|
+
BUILTIN_CLASS_INTL_COLLATOR,
|
|
72
|
+
BUILTIN_CLASS_INTL_DATETIMEFORMAT,
|
|
73
|
+
BUILTIN_CLASS_INTL_LISTFORMAT,
|
|
74
|
+
BUILTIN_CLASS_INTL_NUMBERFORMAT,
|
|
75
|
+
BUILTIN_CLASS_INTL_PLURALRULES,
|
|
76
|
+
BUILTIN_CLASS_INTL_RELATIVETIMEFORMAT
|
|
77
|
+
];
|
|
78
|
+
const CLASSNAMES_WHOSE_ENUMERABLE_PROPERTIES_SHOULD_BE_IGNORED = [
|
|
79
|
+
BUILTIN_CLASS_STRING, ...ALL_BUILTIN_ARRAYS
|
|
80
|
+
];
|
|
81
|
+
export { ESSERIALIZER_NULL, ALL_BUILTIN_ARRAYS, ALL_BUILTIN_ERRORS, ALL_BUILTIN_INTLS, CLASSNAMES_WHOSE_ENUMERABLE_PROPERTIES_SHOULD_BE_IGNORED, BUILTIN_CLASS_INT8ARRAY, BUILTIN_CLASS_UINT8ARRAY, BUILTIN_CLASS_UINT8CLAMPEDARRAY, BUILTIN_CLASS_INT16ARRAY, BUILTIN_CLASS_UINT16ARRAY, BUILTIN_CLASS_INT32ARRAY, BUILTIN_CLASS_UINT32ARRAY, BUILTIN_CLASS_FLOAT32ARRAY, BUILTIN_CLASS_FLOAT64ARRAY, BUILTIN_CLASS_BIGINT64ARRAY, BUILTIN_CLASS_BIGUINT64ARRAY, BUILTIN_CLASS_ARRAYBUFFER, BUILTIN_CLASS_SHAREDARRAYBUFFER, BUILTIN_CLASS_BOOLEAN, BUILTIN_CLASS_DATAVIEW, BUILTIN_CLASS_DATE, BUILTIN_CLASS_INTL_COLLATOR, BUILTIN_CLASS_INTL_DATETIMEFORMAT, BUILTIN_CLASS_INTL_LISTFORMAT, BUILTIN_CLASS_INTL_LOCALE, BUILTIN_CLASS_INTL_NUMBERFORMAT, BUILTIN_CLASS_INTL_PLURALRULES, BUILTIN_CLASS_INTL_RELATIVETIMEFORMAT, BUILTIN_CLASS_REGEXP, BUILTIN_CLASS_SET, BUILTIN_CLASS_STRING, BUILTIN_CLASS_ERROR, BUILTIN_CLASS_EVAL_ERROR, BUILTIN_CLASS_RANGE_ERROR, BUILTIN_CLASS_REFERENCE_ERROR, BUILTIN_CLASS_SYNTAX_ERROR, BUILTIN_CLASS_TYPE_ERROR, BUILTIN_CLASS_URI_ERROR, BUILTIN_CLASS_AGGREGATE_ERROR, BUILTIN_TYPE_BIG_INT, BUILTIN_TYPE_NOT_FINITE, BUILTIN_TYPE_UNDEFINED, ARRAY_FIELD, BOOLEAN_FIELD, CLASS_NAME_FIELD, OPTIONS_FIELD, TIMESTAMP_FIELD, TO_STRING_FIELD };
|