@pathscale/wss-adapter 1.0.6 → 1.0.7

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.
@@ -94,25 +94,33 @@ var sendHandler = function (serviceName, serviceConfig, methodName, params) {
94
94
  if (!methodCode) {
95
95
  throw new Error("method ".concat(methodName, " not available in ").concat(serviceName, " service"));
96
96
  }
97
- var purgedParams = {};
98
- if (params) {
99
- if (!Object.keys(params).every(function (param) {
100
- return serviceConfig.methods[methodCode].parameters.includes(param);
101
- })) {
102
- throw new Error("method ".concat(methodCode, " is being called with missing parameters"));
103
- }
104
- serviceConfig.methods[methodCode].parameters.forEach(function (k) {
105
- purgedParams[k] = params[k];
106
- });
107
- var difference = Object.keys(params).filter(function (x) { return !serviceConfig.methods[methodCode].parameters.includes(x); });
108
- if (difference.length) {
109
- throw new Error("method ".concat(methodCode, " is being called with unknow parameters, ").concat(difference));
110
- }
111
- }
97
+ // const purgedParams: Record<string, unknown> = {}
98
+ // if (params) {
99
+ // if (
100
+ // !Object.keys(params).every((param) =>
101
+ // serviceConfig.methods[methodCode].parameters.includes(param)
102
+ // )
103
+ // ) {
104
+ // throw new Error(
105
+ // `method ${methodCode} is being called with missing parameters`
106
+ // )
107
+ // }
108
+ // serviceConfig.methods[methodCode].parameters.forEach((k) => {
109
+ // purgedParams[k] = params[k]
110
+ // })
111
+ // const difference = Object.keys(params).filter(
112
+ // (x) => !serviceConfig.methods[methodCode].parameters.includes(x)
113
+ // )
114
+ // if (difference.length) {
115
+ // throw new Error(
116
+ // `method ${methodCode} is being called with unknow parameters, ${difference}`
117
+ // )
118
+ // }
119
+ // }
112
120
  var payload = {
113
121
  method: Number.parseInt(methodCode),
114
122
  seq: store.sequence.getSeq(),
115
- params: purgedParams,
123
+ params: params,
116
124
  };
117
125
  console.log("".concat(serviceName, "::").concat(methodName, " sends:"), payload);
118
126
  return new Promise(function (resolve, reject) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pathscale/wss-adapter",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Websocket adapter for the Pathscale WSS",
5
5
  "main": "dist/wssAdapter.js",
6
6
  "types": "dist/wssAdapter.d.ts",
package/wssAdapter.ts CHANGED
@@ -123,38 +123,38 @@ const sendHandler = (
123
123
  )
124
124
  }
125
125
 
126
- const purgedParams: Record<string, unknown> = {}
127
-
128
- if (params) {
129
- if (
130
- !Object.keys(params).every((param) =>
131
- serviceConfig.methods[methodCode].parameters.includes(param)
132
- )
133
- ) {
134
- throw new Error(
135
- `method ${methodCode} is being called with missing parameters`
136
- )
137
- }
138
-
139
- serviceConfig.methods[methodCode].parameters.forEach((k) => {
140
- purgedParams[k] = params[k]
141
- })
142
-
143
- const difference = Object.keys(params).filter(
144
- (x) => !serviceConfig.methods[methodCode].parameters.includes(x)
145
- )
146
-
147
- if (difference.length) {
148
- throw new Error(
149
- `method ${methodCode} is being called with unknow parameters, ${difference}`
150
- )
151
- }
152
- }
126
+ // const purgedParams: Record<string, unknown> = {}
127
+
128
+ // if (params) {
129
+ // if (
130
+ // !Object.keys(params).every((param) =>
131
+ // serviceConfig.methods[methodCode].parameters.includes(param)
132
+ // )
133
+ // ) {
134
+ // throw new Error(
135
+ // `method ${methodCode} is being called with missing parameters`
136
+ // )
137
+ // }
138
+
139
+ // serviceConfig.methods[methodCode].parameters.forEach((k) => {
140
+ // purgedParams[k] = params[k]
141
+ // })
142
+
143
+ // const difference = Object.keys(params).filter(
144
+ // (x) => !serviceConfig.methods[methodCode].parameters.includes(x)
145
+ // )
146
+
147
+ // if (difference.length) {
148
+ // throw new Error(
149
+ // `method ${methodCode} is being called with unknow parameters, ${difference}`
150
+ // )
151
+ // }
152
+ // }
153
153
 
154
154
  const payload = {
155
155
  method: Number.parseInt(methodCode),
156
156
  seq: store.sequence.getSeq(),
157
- params: purgedParams,
157
+ params: params,
158
158
  }
159
159
 
160
160
  console.log(`${serviceName}::${methodName} sends:`, payload)