pulsar-client 1.16.0 → 1.17.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/binding.gyp CHANGED
@@ -49,7 +49,7 @@
49
49
  'xcode_settings': {
50
50
  'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
51
51
  'GCC_ENABLE_CPP_RTTI': 'YES',
52
- 'MACOSX_DEPLOYMENT_TARGET': '11.0',
52
+ 'MACOSX_DEPLOYMENT_TARGET': '13.0',
53
53
  'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++17',
54
54
  'OTHER_CFLAGS': [
55
55
  "-fPIC",
package/index.d.ts CHANGED
@@ -25,7 +25,6 @@ export interface ClientConfig {
25
25
  ioThreads?: number;
26
26
  messageListenerThreads?: number;
27
27
  concurrentLookupRequest?: number;
28
- useTls?: boolean;
29
28
  tlsTrustCertsFilePath?: string;
30
29
  tlsCertificateFilePath?: string;
31
30
  tlsPrivateKeyFilePath?: string;
package/package.json CHANGED
@@ -1,11 +1,19 @@
1
1
  {
2
2
  "name": "pulsar-client",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "description": "Pulsar Node.js client",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "resolutions": {
8
- "minimatch": "^9.0.0"
8
+ "minimatch": "^9.0.0",
9
+ "form-data": "^4.0.1",
10
+ "tough-cookie": "^4.1.3",
11
+ "tar": "^7.5.8"
12
+ },
13
+ "overrides": {
14
+ "form-data": "^4.0.1",
15
+ "tough-cookie": "^4.1.3",
16
+ "tar": "^7.5.8"
9
17
  },
10
18
  "directories": {
11
19
  "src": "src",
@@ -19,7 +27,7 @@
19
27
  "clean": "node-pre-gyp clean",
20
28
  "lint": "clang-format-lint src/*.cc src/*.h && eslint --ext .js .",
21
29
  "format": "clang-format-lint --fix src/*.cc src/*.h && eslint --fix --ext .js .",
22
- "dtslint": "dtslint .",
30
+ "type-check": "tsc --noEmit",
23
31
  "license:report": "mkdir -p report && license-checker --json > report/licenses.json",
24
32
  "license:checkheader": "license-check-and-add check",
25
33
  "license:addheader": "license-check-and-add add",
@@ -38,13 +46,11 @@
38
46
  "node": ">=12.3.0"
39
47
  },
40
48
  "devDependencies": {
41
- "@definitelytyped/utils": "^0.0.168",
42
49
  "@seadub/clang-format-lint": "0.0.2",
43
50
  "@types/node": "^14.14.25",
44
51
  "clang-format": "^1.4.0",
45
52
  "commander": "^6.1.0",
46
53
  "delay": "^4.4.0",
47
- "dtslint": "^4.2.0",
48
54
  "eslint": "^7.8.1",
49
55
  "eslint-config-airbnb-base": "^14.2.0",
50
56
  "eslint-plugin-import": "^2.22.0",
@@ -58,7 +64,7 @@
58
64
  "typescript": "^4.9.5"
59
65
  },
60
66
  "dependencies": {
61
- "@mapbox/node-pre-gyp": "^1.0.11",
67
+ "@mapbox/node-pre-gyp": "^2.0.3",
62
68
  "bindings": "^1.5.0",
63
69
  "node-addon-api": "^4.3.0"
64
70
  },
@@ -68,5 +74,13 @@
68
74
  "host": "https://archive.apache.org/dist/pulsar/pulsar-client-node/",
69
75
  "remote_path": "pulsar-client-node-{version}",
70
76
  "package_name": "napi-{platform}-{libc}-{arch}.tar.gz"
77
+ },
78
+ "jest": {
79
+ "_comment_moduleNameMapper": "Jest 27 does not support the 'exports' field in package.json. consola (a transitive dep of @mapbox/node-pre-gyp) uses 'exports' for its subpath imports (consola/basic, etc.). Without this mapping Jest fails with: Cannot find module 'consola/basic'.",
80
+ "moduleNameMapper": {
81
+ "^consola/basic$": "consola/dist/basic.cjs",
82
+ "^consola/core$": "consola/dist/core.cjs",
83
+ "^consola/utils$": "consola/dist/utils.cjs"
84
+ }
71
85
  }
72
86
  }
@@ -1,2 +1,2 @@
1
- CPP_CLIENT_BASE_URL=https://archive.apache.org/dist/pulsar/pulsar-client-cpp-4.0.0
2
- CPP_CLIENT_VERSION=4.0.0
1
+ CPP_CLIENT_BASE_URL=https://archive.apache.org/dist/pulsar/pulsar-client-cpp-4.1.0
2
+ CPP_CLIENT_VERSION=4.1.0
@@ -77,7 +77,7 @@ char *TokenSupplier(void *ctx) {
77
77
 
78
78
  future.wait();
79
79
 
80
- char *token = (char *)malloc(dataPtr->token.size());
80
+ char *token = (char *)malloc(dataPtr->token.size() + 1);
81
81
  strcpy(token, dataPtr->token.c_str());
82
82
  return token;
83
83
  }
package/src/Client.cc CHANGED
@@ -35,7 +35,6 @@ static const std::string CFG_OP_TIMEOUT = "operationTimeoutSeconds";
35
35
  static const std::string CFG_IO_THREADS = "ioThreads";
36
36
  static const std::string CFG_LISTENER_THREADS = "messageListenerThreads";
37
37
  static const std::string CFG_CONCURRENT_LOOKUP = "concurrentLookupRequest";
38
- static const std::string CFG_USE_TLS = "useTls";
39
38
  static const std::string CFG_TLS_TRUST_CERT = "tlsTrustCertsFilePath";
40
39
  static const std::string CFG_TLS_VALIDATE_HOSTNAME = "tlsValidateHostname";
41
40
  static const std::string CFG_TLS_ALLOW_INSECURE = "tlsAllowInsecureConnection";
@@ -187,11 +186,6 @@ Client::Client(const Napi::CallbackInfo &info) : Napi::ObjectWrap<Client>(info)
187
186
  }
188
187
  }
189
188
 
190
- if (clientConfig.Has(CFG_USE_TLS) && clientConfig.Get(CFG_USE_TLS).IsBoolean()) {
191
- Napi::Boolean useTls = clientConfig.Get(CFG_USE_TLS).ToBoolean();
192
- pulsar_client_configuration_set_use_tls(cClientConfig.get(), useTls.Value());
193
- }
194
-
195
189
  if (clientConfig.Has(CFG_TLS_TRUST_CERT) && clientConfig.Get(CFG_TLS_TRUST_CERT).IsString()) {
196
190
  Napi::String tlsTrustCertsFilePath = clientConfig.Get(CFG_TLS_TRUST_CERT).ToString();
197
191
  pulsar_client_configuration_set_tls_trust_certs_file_path(cClientConfig.get(),
package/src/Client.js CHANGED
@@ -49,7 +49,7 @@ class Client {
49
49
  }
50
50
 
51
51
  close() {
52
- this.client.close();
52
+ return this.client.close();
53
53
  }
54
54
 
55
55
  static setLogHandler(params) {
@@ -1,7 +0,0 @@
1
- {
2
- "recommendations": [
3
- "Orta.vscode-jest",
4
- "firsttris.vscode-jest-runner"
5
- ]
6
- }
7
-
@@ -1,91 +0,0 @@
1
- {
2
- "version": "0.2.0",
3
- "configurations": [
4
-
5
- {
6
- "type": "node",
7
- "request": "launch",
8
- "name": "Debug examples/consumer.js",
9
- "program": "${workspaceFolder}/examples/consumer.js",
10
- "cwd": "${workspaceFolder}",
11
- "console": "integratedTerminal",
12
- "skipFiles": [
13
- "<node_internals>/**"
14
- ]
15
- },
16
- {
17
- "type": "node",
18
- "request": "launch",
19
- "name": "Debug consumer.js (pause on start)",
20
- "program": "${workspaceFolder}/examples/consumer.js",
21
- "cwd": "${workspaceFolder}",
22
- "runtimeArgs": ["--inspect-brk"],
23
- "console": "integratedTerminal",
24
- "skipFiles": [
25
- "<node_internals>/**"
26
- ]
27
- },
28
- {
29
- "type": "node",
30
- "request": "attach",
31
- "name": "Attach to Node (9229)",
32
- "port": 9229,
33
- "restart": false
34
- },
35
- {
36
- "type": "node",
37
- "request": "launch",
38
- "name": "Debug examples/producer.js",
39
- "program": "${workspaceFolder}/examples/producer.js",
40
- "cwd": "${workspaceFolder}",
41
- "console": "integratedTerminal",
42
- "skipFiles": [
43
- "<node_internals>/**"
44
- ]
45
- },
46
- {
47
- "type": "node",
48
- "request": "launch",
49
- "name": "Debug producer.js (pause on start, port 9230)",
50
- "program": "${workspaceFolder}/examples/producer.js",
51
- "cwd": "${workspaceFolder}",
52
- "runtimeArgs": ["--inspect-brk=9230"],
53
- "console": "integratedTerminal",
54
- "skipFiles": [
55
- "<node_internals>/**"
56
- ]
57
- },
58
- {
59
- "type": "node",
60
- "request": "launch",
61
- "name": "Debug Active File",
62
- "program": "${file}",
63
- "cwd": "${workspaceFolder}",
64
- "console": "integratedTerminal",
65
- "skipFiles": [
66
- "<node_internals>/**"
67
- ]
68
- },
69
- {
70
- "type": "node",
71
- "request": "launch",
72
- "name": "Debug Active File (pause on start)",
73
- "program": "${file}",
74
- "cwd": "${workspaceFolder}",
75
- "runtimeArgs": ["--inspect-brk"],
76
- "console": "integratedTerminal",
77
- "skipFiles": [
78
- "<node_internals>/**"
79
- ]
80
- }
81
- ],
82
- "compounds": [
83
- {
84
- "name": "Debug Consumer + Producer",
85
- "configurations": [
86
- "Debug examples/consumer.js",
87
- "Debug examples/producer.js"
88
- ]
89
- }
90
- ]
91
- }