infinispan 0.13.0 → 0.14.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/Dockerfile.server +8 -0
- package/README.md +4 -10
- package/docker-compose.yml +272 -0
- package/gen-asciidoc.sh +46 -0
- package/lib/codec.js +358 -27
- package/lib/functional.js +40 -7
- package/lib/infinispan.js +503 -52
- package/lib/io.js +399 -43
- package/lib/listeners.js +50 -3
- package/lib/near-cache.js +99 -0
- package/lib/protocols.js +560 -75
- package/lib/sasl/digest.js +22 -17
- package/lib/sasl/external.js +7 -4
- package/lib/sasl/factory.js +6 -5
- package/lib/sasl/oauthbearer.js +7 -5
- package/lib/sasl/plain.js +6 -4
- package/lib/sasl/scram.js +19 -11
- package/lib/utils.js +89 -24
- package/package.json +2 -2
- package/run-docker-testsuite.sh +72 -0
- package/types/index.d.ts +192 -1
package/types/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export function client(args: {
|
|
|
20
20
|
/**
|
|
21
21
|
* - Version of client/server protocol.
|
|
22
22
|
*/
|
|
23
|
-
version?: (2.9 | 2.5 | 2.2) | null;
|
|
23
|
+
version?: ('auto' | '4.1' | '4.0' | '3.1' | '3.0' | '2.9' | '2.5' | '2.2') | null;
|
|
24
24
|
/**
|
|
25
25
|
* - Optional cache name.
|
|
26
26
|
*/
|
|
@@ -131,6 +131,15 @@ export function client(args: {
|
|
|
131
131
|
port: number;
|
|
132
132
|
}[];
|
|
133
133
|
}[];
|
|
134
|
+
/**
|
|
135
|
+
* - Near cache configuration. When set, enables client-side caching with server-side invalidation.
|
|
136
|
+
*/
|
|
137
|
+
nearCache?: {
|
|
138
|
+
/**
|
|
139
|
+
* - Maximum number of entries to store in the near cache.
|
|
140
|
+
*/
|
|
141
|
+
maxEntries: number;
|
|
142
|
+
} | null;
|
|
134
143
|
}): Promise<ReturnType<{
|
|
135
144
|
(addrs: any, clientOpts: any): {
|
|
136
145
|
connect: () => any;
|
|
@@ -144,6 +153,14 @@ export function client(args: {
|
|
|
144
153
|
* @since 0.3
|
|
145
154
|
*/
|
|
146
155
|
disconnect: () => Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Returns the active protocol version string (e.g. '3.1', '4.1').
|
|
158
|
+
* When using auto-negotiation, this reflects the negotiated version.
|
|
159
|
+
*
|
|
160
|
+
* @returns {string} Protocol version string.
|
|
161
|
+
* @memberof Client#
|
|
162
|
+
*/
|
|
163
|
+
getProtocolVersion: () => string;
|
|
147
164
|
/**
|
|
148
165
|
* Get the value associated with the given key parameter.
|
|
149
166
|
*
|
|
@@ -651,6 +668,106 @@ export function client(args: {
|
|
|
651
668
|
* @since 0.3
|
|
652
669
|
*/
|
|
653
670
|
removeListener: (listenerId: string) => Promise<any>;
|
|
671
|
+
/**
|
|
672
|
+
* Create a distributed counter.
|
|
673
|
+
*
|
|
674
|
+
* @param {String} name Counter name.
|
|
675
|
+
* @param {CounterConfig} config Counter configuration.
|
|
676
|
+
* @returns {Promise.<Boolean>}
|
|
677
|
+
* @memberof Client#
|
|
678
|
+
* @since 0.14
|
|
679
|
+
*/
|
|
680
|
+
counterCreate: (name: string, config: {
|
|
681
|
+
type: 'strong' | 'weak';
|
|
682
|
+
storage?: 'persistent' | 'volatile';
|
|
683
|
+
initialValue?: number;
|
|
684
|
+
lowerBound?: number;
|
|
685
|
+
upperBound?: number;
|
|
686
|
+
concurrencyLevel?: number;
|
|
687
|
+
}) => Promise<boolean>;
|
|
688
|
+
/**
|
|
689
|
+
* Get the current value of a counter.
|
|
690
|
+
*
|
|
691
|
+
* @param {String} name Counter name.
|
|
692
|
+
* @returns {Promise.<?Number>}
|
|
693
|
+
* @memberof Client#
|
|
694
|
+
* @since 0.14
|
|
695
|
+
*/
|
|
696
|
+
counterGet: (name: string) => Promise<number | undefined>;
|
|
697
|
+
/**
|
|
698
|
+
* Add a value to the counter and return the new value.
|
|
699
|
+
*
|
|
700
|
+
* @param {String} name Counter name.
|
|
701
|
+
* @param {Number} value Value to add.
|
|
702
|
+
* @returns {Promise.<?Number>}
|
|
703
|
+
* @memberof Client#
|
|
704
|
+
* @since 0.14
|
|
705
|
+
*/
|
|
706
|
+
counterAddAndGet: (name: string, value: number) => Promise<number | undefined>;
|
|
707
|
+
/**
|
|
708
|
+
* Reset the counter to its initial value.
|
|
709
|
+
*
|
|
710
|
+
* @param {String} name Counter name.
|
|
711
|
+
* @returns {Promise.<Boolean>}
|
|
712
|
+
* @memberof Client#
|
|
713
|
+
* @since 0.14
|
|
714
|
+
*/
|
|
715
|
+
counterReset: (name: string) => Promise<boolean>;
|
|
716
|
+
/**
|
|
717
|
+
* Compare and swap the counter value.
|
|
718
|
+
*
|
|
719
|
+
* @param {String} name Counter name.
|
|
720
|
+
* @param {Number} expect Expected current value.
|
|
721
|
+
* @param {Number} update New value to set.
|
|
722
|
+
* @returns {Promise.<?Number>}
|
|
723
|
+
* @memberof Client#
|
|
724
|
+
* @since 0.14
|
|
725
|
+
*/
|
|
726
|
+
counterCompareAndSwap: (name: string, expect: number, update: number) => Promise<number | undefined>;
|
|
727
|
+
/**
|
|
728
|
+
* Check if a counter is defined.
|
|
729
|
+
*
|
|
730
|
+
* @param {String} name Counter name.
|
|
731
|
+
* @returns {Promise.<Boolean>}
|
|
732
|
+
* @memberof Client#
|
|
733
|
+
* @since 0.14
|
|
734
|
+
*/
|
|
735
|
+
counterIsDefined: (name: string) => Promise<boolean>;
|
|
736
|
+
/**
|
|
737
|
+
* Get the configuration of a counter.
|
|
738
|
+
*
|
|
739
|
+
* @param {String} name Counter name.
|
|
740
|
+
* @returns {Promise.<?Object>}
|
|
741
|
+
* @memberof Client#
|
|
742
|
+
* @since 0.14
|
|
743
|
+
*/
|
|
744
|
+
counterGetConfiguration: (name: string) => Promise<{
|
|
745
|
+
type: 'strong' | 'weak';
|
|
746
|
+
storage: 'persistent' | 'volatile';
|
|
747
|
+
initialValue: number;
|
|
748
|
+
lowerBound?: number;
|
|
749
|
+
upperBound?: number;
|
|
750
|
+
concurrencyLevel?: number;
|
|
751
|
+
} | undefined>;
|
|
752
|
+
/**
|
|
753
|
+
* Remove a counter from the cluster.
|
|
754
|
+
*
|
|
755
|
+
* @param {String} name Counter name.
|
|
756
|
+
* @returns {Promise.<Boolean>}
|
|
757
|
+
* @memberof Client#
|
|
758
|
+
* @since 0.14
|
|
759
|
+
*/
|
|
760
|
+
counterRemove: (name: string) => Promise<boolean>;
|
|
761
|
+
/**
|
|
762
|
+
* Set a value to the counter and return the previous value.
|
|
763
|
+
*
|
|
764
|
+
* @param {String} name Counter name.
|
|
765
|
+
* @param {Number} value Value to set.
|
|
766
|
+
* @returns {Promise.<?Number>}
|
|
767
|
+
* @memberof Client#
|
|
768
|
+
* @since 0.14
|
|
769
|
+
*/
|
|
770
|
+
counterGetAndSet: (name: string, value: number) => Promise<number | undefined>;
|
|
654
771
|
/**
|
|
655
772
|
* Add script to server(s).
|
|
656
773
|
*
|
|
@@ -784,6 +901,80 @@ export function client(args: {
|
|
|
784
901
|
toString: () => string;
|
|
785
902
|
registerProtostreamType: (typeName: any, descriptorId: any) => any;
|
|
786
903
|
registerProtostreamRoot: (root: any) => any;
|
|
904
|
+
/**
|
|
905
|
+
* Get the number of entries in the near cache.
|
|
906
|
+
*
|
|
907
|
+
* @returns {Number} Number of entries in the near cache, or 0 if near caching is not enabled.
|
|
908
|
+
* @memberof Client#
|
|
909
|
+
* @since 0.14
|
|
910
|
+
*/
|
|
911
|
+
nearCacheSize: () => number;
|
|
912
|
+
/**
|
|
913
|
+
* Admin operations for cache lifecycle, schema management, and indexing.
|
|
914
|
+
* @since 0.15
|
|
915
|
+
*/
|
|
916
|
+
admin: {
|
|
917
|
+
/**
|
|
918
|
+
* Create a cache with the given configuration.
|
|
919
|
+
* @param name Cache name.
|
|
920
|
+
* @param config Cache configuration (XML or JSON).
|
|
921
|
+
* @param opts Optional settings.
|
|
922
|
+
* @since 0.15
|
|
923
|
+
*/
|
|
924
|
+
createCache: (name: string, config?: string, opts?: { template?: string; flags?: string }) => Promise<any>;
|
|
925
|
+
/**
|
|
926
|
+
* Get an existing cache or create it with the given configuration.
|
|
927
|
+
* @param name Cache name.
|
|
928
|
+
* @param config Cache configuration (XML or JSON).
|
|
929
|
+
* @param opts Optional settings.
|
|
930
|
+
* @since 0.15
|
|
931
|
+
*/
|
|
932
|
+
getOrCreateCache: (name: string, config?: string, opts?: { template?: string; flags?: string }) => Promise<any>;
|
|
933
|
+
/**
|
|
934
|
+
* Remove a cache.
|
|
935
|
+
* @param name Cache name.
|
|
936
|
+
* @since 0.15
|
|
937
|
+
*/
|
|
938
|
+
removeCache: (name: string) => Promise<any>;
|
|
939
|
+
/**
|
|
940
|
+
* List all cache names.
|
|
941
|
+
* @since 0.15
|
|
942
|
+
*/
|
|
943
|
+
cacheNames: () => Promise<string[]>;
|
|
944
|
+
/**
|
|
945
|
+
* Update a mutable configuration attribute on a cache.
|
|
946
|
+
* @param name Cache name.
|
|
947
|
+
* @param attribute Attribute path (e.g. 'memory.max-count').
|
|
948
|
+
* @param value New attribute value.
|
|
949
|
+
* @since 0.15
|
|
950
|
+
*/
|
|
951
|
+
updateConfigurationAttribute: (name: string, attribute: string, value: string) => Promise<any>;
|
|
952
|
+
/**
|
|
953
|
+
* Rebuild indexes for a cache.
|
|
954
|
+
* @param name Cache name.
|
|
955
|
+
* @since 0.15
|
|
956
|
+
*/
|
|
957
|
+
reindex: (name: string) => Promise<any>;
|
|
958
|
+
/**
|
|
959
|
+
* Update the index schema for a cache.
|
|
960
|
+
* @param name Cache name.
|
|
961
|
+
* @since 0.15
|
|
962
|
+
*/
|
|
963
|
+
updateIndexSchema: (name: string) => Promise<any>;
|
|
964
|
+
/**
|
|
965
|
+
* Register (create or update) a Protobuf schema on the server.
|
|
966
|
+
* @param name Schema name (e.g. 'person.proto').
|
|
967
|
+
* @param schema Protobuf schema content.
|
|
968
|
+
* @since 0.15
|
|
969
|
+
*/
|
|
970
|
+
registerSchema: (name: string, schema: string) => Promise<any>;
|
|
971
|
+
/**
|
|
972
|
+
* Remove a registered Protobuf schema.
|
|
973
|
+
* @param name Schema name.
|
|
974
|
+
* @since 0.15
|
|
975
|
+
*/
|
|
976
|
+
removeSchema: (name: string) => Promise<any>;
|
|
977
|
+
};
|
|
787
978
|
};
|
|
788
979
|
/**
|
|
789
980
|
* Cluster information.
|