infinispan 0.10.0 → 0.12.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/.eslintrc ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "root":true,
3
+ "env": {
4
+ "es6": true,
5
+ "node": true
6
+ },
7
+ "parserOptions": {
8
+ "ecmaVersion": 2022,
9
+ "sourceType": "module"
10
+ },
11
+ "rules": {
12
+ "standard/no-callback-literal": "off",
13
+ "arrow-spacing": "error",
14
+ "arrow-parens": ["error", "as-needed"],
15
+ "arrow-body-style": ["error", "as-needed"],
16
+ "prefer-template": "error",
17
+ "no-unused-vars": ["warn", {
18
+ "argsIgnorePattern": "^_$|^e$|^reject$|^resolve$"
19
+ }],
20
+ "valid-jsdoc": "error",
21
+ "require-jsdoc": "warn",
22
+ "semi": ["error", "always"],
23
+ "quotes": ["error", "single", { "allowTemplateLiterals": true }]
24
+ }
25
+ }
@@ -24,7 +24,7 @@ pipeline {
24
24
 
25
25
  stage('Install release package') {
26
26
  steps {
27
- nodejs(nodeJSInstallationName: 'Node 14') {
27
+ nodejs(nodeJSInstallationName: 'Node 18') {
28
28
  sh 'rm -drf node_modules/'
29
29
  sh 'npm config ls'
30
30
  sh 'npm install'
@@ -35,10 +35,12 @@ pipeline {
35
35
 
36
36
  stage('Release') {
37
37
  steps {
38
- nodejs(nodeJSInstallationName: 'Node 14') {
38
+ nodejs(nodeJSInstallationName: 'Node 18') {
39
39
  withCredentials([string(credentialsId: 'npmauthtoken', variable: 'NPM_AUTH_TOKEN')]) {
40
40
  sh './set-npm-auth-token.sh'
41
41
  }
42
+ sh "git status"
43
+ sh "git diff"
42
44
  sh "npm-release ${version}"
43
45
  }
44
46
  }
@@ -46,7 +48,7 @@ pipeline {
46
48
 
47
49
  stage('Generate JS API docs and upload') {
48
50
  steps {
49
- nodejs(nodeJSInstallationName: 'Node 14') {
51
+ nodejs(nodeJSInstallationName: 'Node 18') {
50
52
  sh './node_modules/.bin/jsdoc lib/*.js'
51
53
  sh 'mv out apidocs'
52
54
  sh 'mkdir 1.0'
@@ -6,3 +6,4 @@
6
6
  :node_docs: https://docs.jboss.org/infinispan/hotrod-clients/javascript/1.0/apidocs/
7
7
  :server_docs: https://infinispan.org/docs/stable/titles/server/server.html
8
8
  :code_tutorials: https://github.com/infinispan/infinispan-simple-tutorials/
9
+ :query_docs: https://infinispan.org/docs/stable/titles/query/query.html
@@ -0,0 +1,92 @@
1
+ const infinispan = require('infinispan');
2
+ const protobuf = require('protobufjs');
3
+ // This example uses async/await paradigma
4
+ (async function () {
5
+ // User data protobuf definition
6
+ const cacheValueProtoDef = `package awesomepackage;
7
+ /**
8
+ * @TypeId(1000044)
9
+ */
10
+ message AwesomeUser {
11
+ required string name = 1;
12
+ required int64 age = 2;
13
+ required bool isVerified =3;
14
+ }`
15
+ try {
16
+ // Creating clients for two caches:
17
+ // - ___protobuf_metadata for registering .proto file
18
+ // - queryCache for user data
19
+ const connectProp = { port: 11222, host: '127.0.0.1' };
20
+ const commonOpts = {
21
+ version: '3.0',
22
+ authentication: {
23
+ enabled: true,
24
+ saslMechanism: 'DIGEST-MD5',
25
+ userName: 'admin',
26
+ password: 'pass'
27
+ }
28
+ };
29
+ const protoMetaClientOps = {
30
+ cacheName: '___protobuf_metadata',
31
+ dataFormat: { keyType: "text/plain", valueType: "text/plain" }
32
+ }
33
+ const clientOps = {
34
+ dataFormat: { keyType: "text/plain", valueType: "application/x-protostream" },
35
+ cacheName: 'queryCache'
36
+ }
37
+ var protoMetaClient = await infinispan.client(connectProp, Object.assign(commonOpts, protoMetaClientOps));
38
+ var client = await infinispan.client(connectProp, Object.assign(commonOpts, clientOps));
39
+
40
+ // Registering protobuf definition on server
41
+ await protoMetaClient.put("awesomepackage/AwesomeUser.proto", cacheValueProtoDef);
42
+
43
+ // Registering protobuf definition on protobufjs
44
+ const root = protobuf.parse(cacheValueProtoDef).root;
45
+ const AwesomeUser = root.lookupType(".awesomepackage.AwesomeUser");
46
+ client.registerProtostreamRoot(root);
47
+ client.registerProtostreamType(".awesomepackage.AwesomeUser", 1000044);
48
+
49
+ // Cleanup and populating the cache
50
+ await client.clear();
51
+ for (let i = 0; i < 10; i++) {
52
+ const payload = { name: "AwesomeName" + i, age: i, isVerified: (Math.random() < 0.5) };
53
+ const message = AwesomeUser.create(payload);
54
+ console.log("Creating entry:", message);
55
+ await client.put(i.toString(), message)
56
+ }
57
+ // Run the query
58
+ const queryStr = `select u.name,u.age from awesomepackage.AwesomeUser u where u.age<20 order by u.name asc`;
59
+ console.log("Running query:", queryStr);
60
+ const query = await client.query({ queryString: queryStr });
61
+ console.log("Query result:");
62
+ console.log(query);
63
+ } catch (err) {
64
+ handleError(err);
65
+ } finally {
66
+ if (client) {
67
+ await client.disconnect();
68
+ }
69
+ if (protoMetaClient) {
70
+ await protoMetaClient.disconnect();
71
+ }
72
+ }
73
+ })();
74
+
75
+ function handleError(err) {
76
+ if (err.message.includes("'queryCache' not found")) {
77
+ console.log('*** ERROR ***');
78
+ console.log(`*** This example needs a cache 'queryCache' with the following config:
79
+ {
80
+ "local-cache": {
81
+ "statistics": true,
82
+ "encoding": {
83
+ "key": {
84
+ "media-type": "text/plain"
85
+ },
86
+ "value": {
87
+ "media-type": "application/x-protostream"
88
+ }}}}`)
89
+ } else {
90
+ console.log(err);
91
+ }
92
+ }
@@ -2,7 +2,7 @@
2
2
  = Configuring {brandname} connections
3
3
  Configure {hr_js} clients to connect to {brandname} Server.
4
4
 
5
- If add multiple server addresses to the configuration, the {hr_js} client loops through them until it finds a node to which it can connect.
5
+ If you add multiple server addresses to the configuration, the {hr_js} client loops through them until it finds a node to which it can connect.
6
6
 
7
7
  However, you only need to add one {brandname} Server address for the client to receive the entire cluster topology.
8
8
  If the {hr_js} client connects to a single server instance that is a member of a cluster, the client gets the address information for all nodes.
@@ -114,3 +114,15 @@ Use the `getWithMetadata` and `size` methods expire cache entries.
114
114
  ----
115
115
  include::code_examples/ephemeral-data.js[]
116
116
  ----
117
+
118
+ == Working with queries
119
+
120
+ Use the `query` method to perform queries on your caches.
121
+ You must configure {hr_js} client to have `application/x-protostream` data format for values in your caches.
122
+
123
+ [source,javascript,options="nowrap",subs=attributes+]
124
+ ----
125
+ include::code_examples/queries.js[]
126
+ ----
127
+
128
+ See link:{query_docs}[Querying {brandname} caches] for more information.
package/lib/infinispan.js CHANGED
@@ -134,7 +134,7 @@
134
134
  /**
135
135
  * Returns the next entry being iterated over.
136
136
  *
137
- * @returns {module:promise.Promise.<IteratorNext>}
137
+ * @returns {Promise.<IteratorNext>}
138
138
  * It returns a Promise which will be completed with an instance that
139
139
  * provides the next element.
140
140
  * @memberof Iterator#
@@ -169,7 +169,7 @@
169
169
  /**
170
170
  * Close the iteration.
171
171
  *
172
- * @returns {module:promise.Promise}
172
+ * @returns {Promise}
173
173
  * A Promise which will be completed once the iteration has been closed.
174
174
  * @memberof Iterator#
175
175
  * @since 0.3
@@ -201,7 +201,7 @@
201
201
  /**
202
202
  * Disconnect client from backend server(s).
203
203
  *
204
- * @returns {module:promise.Promise}
204
+ * @returns {Promise<void>}
205
205
  * A promise that will be completed once client has
206
206
  * completed disconnection from server(s).
207
207
  * @memberof Client#
@@ -214,7 +214,7 @@
214
214
  * Get the value associated with the given key parameter.
215
215
  *
216
216
  * @param k {(String|Object)} Key to retrieve.
217
- * @returns {module:promise.Promise.<?String>}
217
+ * @returns {Promise.<?String>}
218
218
  * A promise that will be completed with the value associated with
219
219
  * the key, or undefined if the value is not present.
220
220
  * @memberof Client#
@@ -230,7 +230,7 @@
230
230
  * Query the server with the given queryString.
231
231
  *
232
232
  * @param q {(Object)} query to retrieve.
233
- * @returns {module:promise.Promise.<?Object[]>}
233
+ * @returns {Promise.<?Object[]>}
234
234
  * A promise that will be completed with the array of values associated with
235
235
  * the query, or empty array if the no values matches the query.
236
236
  * @memberof Client#
@@ -247,7 +247,7 @@
247
247
  * Check whether the given key is present.
248
248
  *
249
249
  * @param k {(String|Object)} Key to check for presence.
250
- * @returns {module:promise.Promise.<boolean>}
250
+ * @returns {Promise.<boolean>}
251
251
  * A promise that will be completed with true if there is a value
252
252
  * associated with the key, or false otherwise.
253
253
  * @memberof Client#
@@ -274,7 +274,7 @@
274
274
  * Get the value and metadata associated with the given key parameter.
275
275
  *
276
276
  * @param k {(String|Object)} Key to retrieve.
277
- * @returns {module:promise.Promise.<?MetadataValue>}
277
+ * @returns {Promise.<?MetadataValue>}
278
278
  * A promise that will be completed with the value and metadata
279
279
  * associated with the key, or undefined if the value is not present.
280
280
  * @memberof Client#
@@ -316,8 +316,8 @@
316
316
  *
317
317
  * @param k {(String|Object)} Key with which the specified value is to be associated.
318
318
  * @param v {(String|Object)} Value to be associated with the specified key.
319
- * @param opts {?StoreOptions} Optional store options.
320
- * @returns {module:promise.Promise.<?(String|Object)>}
319
+ * @param opts {StoreOptions=} Optional store options.
320
+ * @returns {Promise.<?(String|Object)>}
321
321
  * A promise that will be completed with undefined unless 'previous'
322
322
  * option has been enabled and a previous value exists, in which case it
323
323
  * would return the previous value.
@@ -345,8 +345,8 @@
345
345
  * Removes the mapping for a key if it is present.
346
346
  *
347
347
  * @param k {(String|Object)} Key whose mapping is to be removed.
348
- * @param opts {?RemoveOptions} Optional remove options.
349
- * @returns {module:promise.Promise.<(Boolean|String|Object)>}
348
+ * @param opts {RemoveOptions=} Optional remove options.
349
+ * @returns {Promise.<(Boolean|String|Object)>}
350
350
  * A promise that will be completed with true if the mapping was removed,
351
351
  * or false if the key did not exist.
352
352
  * If the 'previous' option is enabled, it returns the value
@@ -367,8 +367,8 @@
367
367
  *
368
368
  * @param k {(String|Object)} Key with which the specified value is to be associated.
369
369
  * @param v {(String|Object)} Value to be associated with the specified key.
370
- * @param opts {?StoreOptions} Optional store options.
371
- * @returns {module:promise.Promise.<(Boolean|String|Object)>}
370
+ * @param opts {StoreOptions=} Optional store options.
371
+ * @returns {Promise.<(Boolean|String|Object)>}
372
372
  * A promise that will be completed with true if the mapping was stored,
373
373
  * or false if the key is already present.
374
374
  * If the 'previous' option is enabled, it returns the existing value
@@ -389,8 +389,8 @@
389
389
  *
390
390
  * @param k {(String|Object)} Key with which the specified value is associated.
391
391
  * @param v {(String|Object)} Value expected to be associated with the specified key.
392
- * @param opts {?StoreOptions} Optional store options.
393
- * @returns {module:promise.Promise.<(Boolean|String|Object)>}
392
+ * @param opts {StoreOptions=} Optional store options.
393
+ * @returns {Promise.<(Boolean|String|Object)>}
394
394
  * A promise that will be completed with true if the mapping was replaced,
395
395
  * or false if the key does not exist.
396
396
  * If the 'previous' option is enabled, it returns the value that was
@@ -414,8 +414,8 @@
414
414
  * @param version {Buffer} binary buffer version that should match the
415
415
  * one in the server for the operation to succeed. Version information
416
416
  * can be retrieved with getWithMetadata method.
417
- * @param opts {?StoreOptions} Optional store options.
418
- * @returns {module:promise.Promise.<(Boolean|String|Object)>}
417
+ * @param opts {StoreOptions=} Optional store options.
418
+ * @returns {Promise.<(Boolean|String|Object)>}
419
419
  * A promise that will be completed with true if the version matches
420
420
  * and the mapping was replaced, otherwise it returns false if not
421
421
  * replaced because key does not exist or version sent does not match
@@ -442,8 +442,8 @@
442
442
  * @param version {Buffer} binary buffer version that should match the
443
443
  * one in the server for the operation to succeed. Version information
444
444
  * can be retrieved with getWithMetadata method.
445
- * @param opts {?RemoveOptions} Optional remove options.
446
- * @returns {module:promise.Promise.<(Boolean|String|Object)>}
445
+ * @param opts {RemoveOptions=} Optional remove options.
446
+ * @returns {Promise.<(Boolean|String|Object)>}
447
447
  * A promise that will be completed with true if the version matches
448
448
  * and the mapping was removed, otherwise it returns false if not
449
449
  * removed because key does not exist or version sent does not match
@@ -474,7 +474,7 @@
474
474
  * Retrieves all of the entries for the provided keys.
475
475
  *
476
476
  * @param keys {(String[]|Object[])} Keys to find values for.
477
- * @returns {module:promise.Promise.<Entry[]>}
477
+ * @returns {Promise.<Entry[]>}
478
478
  * A promise that will be completed with an array of entries for all
479
479
  * keys found. If a key does not exist, there won't be an entry for that
480
480
  * key in the returned array.
@@ -502,9 +502,9 @@
502
502
  * Stores all of the mappings from the specified entry array.
503
503
  *
504
504
  * @param pairs {Entry[]} key/value pair mappings to be stored
505
- * @param opts {MultiStoreOptions}
505
+ * @param opts {MultiStoreOptions=}
506
506
  * Optional storage options to apply to all entries.
507
- * @returns {module:promise.Promise}
507
+ * @returns {Promise}
508
508
  * A promise that will be completed when all entries have been stored.
509
509
  * @memberof Client#
510
510
  * @since 0.3
@@ -530,8 +530,8 @@
530
530
  *
531
531
  * @param batchSize {Number}
532
532
  * The number of entries transferred from the server at a time.
533
- * @param opts {?IteratorOptions} Optional iteration settings.
534
- * @return {module:promise.Promise.<Iterator>}
533
+ * @param opts {IteratorOptions=} Optional iteration settings.
534
+ * @return {Promise.<Iterator>}
535
535
  * A promise that will be completed with an iterator that can be used
536
536
  * to retrieve stored elements.
537
537
  * @memberof Client#
@@ -548,7 +548,7 @@
548
548
  /**
549
549
  * Count of entries in the server(s).
550
550
  *
551
- * @returns {module:promise.Promise.<Number>}
551
+ * @returns {Promise.<Number>}
552
552
  * A promise that will be completed with the number of entries stored.
553
553
  * @memberof Client#
554
554
  * @since 0.3
@@ -561,7 +561,7 @@
561
561
  /**
562
562
  * Clear all entries stored in server(s).
563
563
  *
564
- * @returns {module:promise.Promise}
564
+ * @returns {Promise}
565
565
  * A promise that will be completed when the clear has been completed.
566
566
  * @memberof Client#
567
567
  * @since 0.3
@@ -574,7 +574,7 @@
574
574
  /**
575
575
  * Pings the server(s).
576
576
  *
577
- * @returns {module:promise.Promise}
577
+ * @returns {Promise}
578
578
  * A promise that will be completed when ping response was received.
579
579
  * @memberof Client#
580
580
  * @since 0.3
@@ -598,7 +598,7 @@
598
598
  /**
599
599
  * Retrieve various statistics from server(s).
600
600
  *
601
- * @returns {module:promise.Promise<StatsItem[]>}
601
+ * @returns {Promise<StatsItem[]>}
602
602
  * A promise that will be completed with an array of statistics, where
603
603
  * each element will have a single property. This single property will
604
604
  * have the statistic name as property name and statistic value as
@@ -632,8 +632,8 @@
632
632
  * entry version and listener id.
633
633
  * 'remove' and 'expiry' events callback the function with key
634
634
  * and listener id.
635
- * @param opts {?ListenOptions} Options for adding listener.
636
- * @returns {module:promise.Promise<String>}
635
+ * @param opts {ListenOptions=} Options for adding listener.
636
+ * @returns {Promise<String>}
637
637
  * A promise that will be completed with the identifier of the listener.
638
638
  * This identifier can be used to register multiple callbacks with the
639
639
  * same listener, or to remove the listener.
@@ -663,7 +663,7 @@
663
663
  *
664
664
  * @param {String} listenerId
665
665
  * Listener identifier to identify listener to remove.
666
- * @return {module:promise.Promise}
666
+ * @return {Promise}
667
667
  * A promise that will be completed when the listener has been removed.
668
668
  * @memberof Client#
669
669
  * @since 0.3
@@ -690,7 +690,7 @@
690
690
  *
691
691
  * @param {String} scriptName Name of the script to store.
692
692
  * @param {String} script Script to store in server.
693
- * @return {module:promise.Promise}
693
+ * @return {Promise}
694
694
  * A promise that will be completed when the script has been stored.
695
695
  * @memberof Client#
696
696
  * @since 0.3
@@ -718,9 +718,9 @@
718
718
  * Execute the named script passing in optional parameters.
719
719
  *
720
720
  * @param {String} scriptName Name of the script to execute.
721
- * @param {?ExecParams[]} params
721
+ * @param {ExecParams[]} [params]
722
722
  * Optional array of named parameters to pass to script in server.
723
- * @returns {module:promise.Promise<String|String[]>}
723
+ * @returns {Promise<String|String[]>}
724
724
  * A promise that will be completed with either the value returned by the
725
725
  * script after execution for local scripts, or an array of values
726
726
  * returned by the script when executed in multiple servers for
@@ -810,7 +810,7 @@
810
810
  * previously declared via configuration.
811
811
  *
812
812
  * @param clusterName name of the cluster to which to switch to
813
- * @return {module:promise.Promise<Boolean>}
813
+ * @return {Promise<Boolean>}
814
814
  * A promise encapsulating a Boolean that indicates {@code true} if the
815
815
  * switch happened, or {@code false} otherwise.
816
816
  * @memberof Topology#
@@ -823,7 +823,7 @@
823
823
  * Switch remote cache manager to the default cluster,
824
824
  * previously declared via configuration.
825
825
  *
826
- * @return {module:promise.Promise<Boolean>}
826
+ * @return {Promise<Boolean>}
827
827
  * A promise encapsulating a Boolean that indicates {@code true} if the
828
828
  * switch happened, or {@code false} otherwise.
829
829
  * @memberof Topology#
@@ -864,20 +864,18 @@
864
864
  * @param args {(ServerAddress|ServerAddress[])}
865
865
  * Optional single or multiple addresses to which to connect. If none
866
866
  * provided, the client will connect to localhost:11222 address by default.
867
- * @param options {module:infinispan.ClientOptions}
867
+ * @param [options] {ClientOptions}
868
868
  * Optional configuration settings.
869
- * @returns A promise that will be completed once the connection
870
- * has been established. The promise will be completed with a client
871
- * instance on which operations can invoked.
872
869
  * @constructs Client
870
+ * @returns {Promise<ReturnType<Client>>}
873
871
  * @since 0.3
874
872
  */
875
873
  exports.client = function client(args, options) {
876
874
  var merged = f.merge(Client.config, options);
877
875
  var c = new Client(u.normalizeAddresses(args), merged);
876
+
878
877
  return c.connect();
879
878
  };
880
-
881
879
  /**
882
880
  * Cluster information.
883
881
  *
@@ -894,26 +892,32 @@
894
892
  * @static
895
893
  * @typedef {Object} ClientOptions
896
894
  * @property {?(2.9|2.5|2.2)} [version=2.9] - Version of client/server protocol.
897
- * @property {?String} cacheName - Optional cache name.
895
+ * @property {?String} [cacheName] - Optional cache name.
898
896
  * @property {?Number} [maxRetries=3] - Optional number of retries for operation.
897
+ * @property {?Object} [ssl] - TLS/SSL properties.
899
898
  * @property {?boolean} [ssl.enabled=false] - Optional flag to enable SSL support.
900
899
  * @property {?String} [ssl.secureProtocol=TLSv1_2_method] - Optional field with secure protocol in use.
901
- * @property {?String[]} ssl.trustCerts - Optional paths of trusted SSL certificates.
902
- * @property {?String} ssl.clientAuth.key - Optional path to client authentication key.
903
- * @property {?String} ssl.clientAuth.passphrase - Optional password for client key.
904
- * @property {?String} ssl.clientAuth.cert - Optional client certificate.
905
- * @property {?String} ssl.sniHostName - Optional SNI host name.
906
- * @property {?String} ssl.cryptoStore.path - Optional crypto store path.
907
- * @property {?String} ssl.cryptoStore.passphrase - Optional password for crypto store.
908
- * @property {?boolean} authentication.enabled - Enable authentication.
909
- * @property {?String} authentication.saslMechanism - Select the SASL mechanism to use. Can be one of PLAIN, DIGEST-MD5, SCRAM-SHA-1, SCRAM-SHA-256, SCRAM-SHA-384, SCRAM-SHA-512, EXTERNAL, OAUTHBEARER
910
- * @property {?String} authentication.userName - The authentication username. Required by the PLAIN, DIGEST and SCRAM mechanisms.
911
- * @property {?String} authentication.password - The authentication password. Required by the PLAIN, DIGEST and SCRAM mechanisms.
912
- * @property {?String} authentication.token - The OAuth token. Required by the OAUTHBEARER mechanism.
913
- * @property {?String} authentication.authzid - The SASL authorization ID.
900
+ * @property {?String[]} [ssl.trustCerts] - Optional paths of trusted SSL certificates.
901
+ * @property {?String} [ssl.clientAuth.key] - Optional path to client authentication key.
902
+ * @property {?String} [ssl.clientAuth.passphrase] - Optional password for client key.
903
+ * @property {?String} [ssl.clientAuth.cert] - Optional client certificate.
904
+ * @property {?String} [ssl.sniHostName] - Optional SNI host name.
905
+ * @property {?String} [ssl.cryptoStore.path] - Optional crypto store path.
906
+ * @property {?String} [ssl.cryptoStore.passphrase] - Optional password for crypto store.
907
+ * @property {?Object} [authentication]- Authentication properties.
908
+ * @property {?boolean} [authentication.enabled]- Enable authentication.
909
+ * @property {?String} [authentication.saslMechanism] - Select the SASL mechanism to use. Can be one of PLAIN, DIGEST-MD5, SCRAM-SHA-1, SCRAM-SHA-256, SCRAM-SHA-384, SCRAM-SHA-512, EXTERNAL, OAUTHBEARER
910
+ * @property {?String} [authentication.userName] - The authentication username. Required by the PLAIN, DIGEST and SCRAM mechanisms.
911
+ * @property {?String} [authentication.password] - The authentication password. Required by the PLAIN, DIGEST and SCRAM mechanisms.
912
+ * @property {?String} [authentication.token] - The OAuth token. Required by the OAUTHBEARER mechanism.
913
+ * @property {?String} [authentication.authzid] - The SASL authorization ID.
914
+ * @property {?String} [authentication.authzid] - The SASL authorization ID.
915
+ * @property {?Object} [dataFormat] - Content-type for entry
916
+ * @property {?String} [dataFormat.keyType] - Content-type for key
917
+ * @property {?String} [dataFormat.valueType] - Content-type for value
914
918
  * @property {?boolean} [topologyUpdates=true] - Optional flag to controls whether the client deals with topology updates or not.
915
- * @property {?(text/plain|application/json)} [mediaType=text/plain] - Media type of the cache contents.
916
- * @property {?Cluster[]} clusters - Optional additional clusters for cross-site failovers.
919
+ * @property {?("text/plain"|"application/json")} [mediaType="text/plain"] - Media type of the cache contents.
920
+ * @property {?Cluster[]} [clusters] - Optional additional clusters for cross-site failovers.
917
921
  * @since 0.3
918
922
  */
919
923
  Client.config = {
@@ -5,7 +5,7 @@
5
5
  * Actually used range is: [4400 .. 4403] *
6
6
  *********************************************************************************************************************/
7
7
  syntax = "proto2";
8
- import "Protos/message-wrapping.proto";
8
+ import "message-wrapping.proto";
9
9
 
10
10
  package org.infinispan.query.remote.client;
11
11
 
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "infinispan",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "Infinispan Javascript client",
5
5
  "main": "index",
6
+ "typings": "./types",
6
7
  "directories": {
7
8
  "test": "test"
8
9
  },
9
10
  "scripts": {
11
+ "lint": "eslint --ignore-path .gitignore .",
10
12
  "test": "./node_modules/.bin/jasmine-node spec"
11
13
  },
12
14
  "author": "Galder Zamarreño",
@@ -28,12 +30,12 @@
28
30
  "buffer-xor": "^2.0.2",
29
31
  "log4js": "^6.4.6",
30
32
  "protobufjs": "^7.0.0",
31
- "underscore": "^1.13.3"
33
+ "underscore": "^1.13.3",
34
+ "urllib": "^3.23.0"
32
35
  },
33
36
  "devDependencies": {
34
- "growl": "^1.10.5",
35
- "jasmine-node": "^3.0.0",
36
- "jsdoc": "^3.6.10",
37
- "request": "^2.88.0"
37
+ "eslint": "^8.26.0",
38
+ "jasmine-node": "^1.16.0",
39
+ "long": "^5.2.3"
38
40
  }
39
41
  }
package/run-servers.sh CHANGED
@@ -9,7 +9,7 @@ else
9
9
  fi
10
10
 
11
11
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
- SERVER_VERSION="${SERVER_VERSION:-"13.0.0.Final"}"
12
+ SERVER_VERSION="${SERVER_VERSION:-"14.0.27.Final"}"
13
13
  SERVER_HOME=${SCRIPT_DIR}/server/original-server
14
14
  SERVER_ZIP=${SCRIPT_DIR}/server/${SERVER_VERSION}.zip
15
15
  CLUSTER_SIZE_MAIN="$SERVER_HOME/bin/cli.sh -c http://admin:pass@localhost:11322 -f batch "
@@ -30,6 +30,7 @@ EOF
30
30
  MEMBERS_MAIN=''
31
31
  while [ "$MEMBERS_MAIN" != '3' ];
32
32
  do
33
+ echo $CLUSTER_SIZE_MAIN
33
34
  MEMBERS_MAIN=$($CLUSTER_SIZE_MAIN | grep cluster_size | cut -d':' -f2 | sed 's/.$//' | sed -e 's/^[[:space:]]*//')
34
35
  echo "Waiting for clusters to form (main: $MEMBERS_MAIN)"
35
36
  sleep 20
@@ -78,6 +79,18 @@ function prepareServerDir()
78
79
 
79
80
  echo "Infinispan configuration file ${confPath} copied to server ${dirName}."
80
81
 
82
+ #Installing nashorn engine before server startup
83
+ # If java > 15
84
+ if [ $(javap -verbose java.lang.String | grep "major version" | cut -d " " -f5) -ge 60 ]; then
85
+ mkdir -p ${SERVER_TMP}/${dirName}/lib
86
+ ${SERVER_TMP}/bin/cli.sh install org.openjdk.nashorn:nashorn-core:15.4 --server-root=${dirName}
87
+ ${SERVER_TMP}/bin/cli.sh install org.ow2.asm:asm:9.4 --server-root=${dirName}
88
+ ${SERVER_TMP}/bin/cli.sh install org.ow2.asm:asm-commons:9.4 --server-root=${dirName}
89
+ ${SERVER_TMP}/bin/cli.sh install org.ow2.asm:asm-tree:9.4 --server-root=${dirName}
90
+ ${SERVER_TMP}/bin/cli.sh install org.ow2.asm:asm-util:9.4 --server-root=${dirName}
91
+ echo Nashorn script engine installed for ${dirName}
92
+ fi
93
+
81
94
  if [[ ${isSsl} = "true" && ${IS_SSL_PROCESSED} = 0 ]]; then
82
95
  ./make-ssl.sh
83
96
  echo "Generate TLS/SSL certificates"
@@ -112,6 +125,8 @@ function startServer()
112
125
  portStr="-p ${port}"
113
126
  fi
114
127
 
128
+ echo 'Cleaning data dir in '$SERVER_TMP''
129
+ rm -rf $SERVER_TMP/data/*
115
130
  echo 'Run server '$nodeName' in '$SERVER_TMP''
116
131
 
117
132
  if [[ ${isCi} = "--ci" ]]; then
package/smoke-tests.sh CHANGED
@@ -15,6 +15,7 @@ node \
15
15
  spec/infinispan_ssl_spec.js \
16
16
  spec/infinispan_stress_spec.js \
17
17
  spec/protocols_spec.js \
18
+ spec/protostream_spec.js \
18
19
  spec/tests.js \
19
20
  spec/utils_spec.js \
20
21
  --captureExceptions --junitreport --forceexit
@@ -6,7 +6,7 @@
6
6
  xmlns:server="urn:infinispan:server:12.0">
7
7
 
8
8
  <cache-container>
9
- <transport cluster="${infinispan.cluster.name}" stack="${infinispan.cluster.stack:tcp}"/>
9
+ <transport cluster="${infinispan.cluster.name:cluster}" stack="${infinispan.cluster.stack:tcp}"/>
10
10
  </cache-container>
11
11
 
12
12
  <server xmlns="urn:infinispan:server:12.0">
@@ -28,7 +28,7 @@
28
28
  <!-- server-identities>
29
29
  <ssl>
30
30
  <keystore path="application.keystore" relative-to="infinispan.server.config.path"
31
- keystore-password="password" alias="server" key-password="password"
31
+ password="password" alias="server" key-password="password"
32
32
  generate-self-signed-certificate-host="localhost"/>
33
33
  </ssl>
34
34
  </server-identities-->
@@ -52,4 +52,4 @@
52
52
  <!-- memcached-connector socket-binding="memcached" / -->
53
53
  </endpoints>
54
54
  </server>
55
- </infinispan>
55
+ </infinispan>
@@ -9,7 +9,7 @@
9
9
  <!-- <security>-->
10
10
  <!-- <authorization/>-->
11
11
  <!-- </security>-->
12
- <transport cluster="${infinispan.cluster.name}" stack="${infinispan.cluster.stack:tcp}" node-name="${infinispan.node.name:}"/>
12
+ <transport cluster="${infinispan.cluster.name:cluster}" stack="${infinispan.cluster.stack:tcp}" node-name="${infinispan.node.name:}"/>
13
13
  <!--<global-state/>-->
14
14
  <metrics accurate-size="true"/>
15
15
  <distributed-cache name="default" segments="20" remote-timeout="30000">
@@ -36,7 +36,7 @@
36
36
  <!-- server-identities>
37
37
  <ssl>
38
38
  <keystore path="application.keystore" relative-to="infinispan.server.config.path"
39
- keystore-password="password" alias="server" key-password="password"
39
+ password="password" alias="server" key-password="password"
40
40
  generate-self-signed-certificate-host="localhost"/>
41
41
  </ssl>
42
42
  </server-identities-->