@themoltnet/node-red-contrib-core 0.12.2 → 0.12.3

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.
Files changed (2) hide show
  1. package/dist/nodes/src.js +17 -3
  2. package/package.json +2 -2
package/dist/nodes/src.js CHANGED
@@ -2999,6 +2999,21 @@ function unwrapRequired(result, message, code) {
2999
2999
  return result.data;
3000
3000
  }
3001
3001
  //#endregion
3002
+ //#region ../sdk/src/namespaces/query.ts
3003
+ /**
3004
+ * Remove `undefined`-valued keys from a query object before it is serialized.
3005
+ *
3006
+ * Returns `undefined` when no defined keys remain, so an all-`undefined` query
3007
+ * (`{ agentId: undefined }`) and an omitted query (`undefined`) serialize
3008
+ * identically — both send no query params — instead of the former collapsing to
3009
+ * an empty `{}` that still reaches the client.
3010
+ */
3011
+ function stripUndefinedQuery(query) {
3012
+ if (!query) return;
3013
+ const entries = Object.entries(query).filter(([, value]) => value !== void 0);
3014
+ return entries.length ? Object.fromEntries(entries) : void 0;
3015
+ }
3016
+ //#endregion
3002
3017
  //#region ../sdk/src/namespaces/team-headers.ts
3003
3018
  /**
3004
3019
  * Build the team header from an optional option, or `undefined` when no team
@@ -3025,7 +3040,7 @@ function createAgentKeysNamespace(context) {
3025
3040
  client,
3026
3041
  auth,
3027
3042
  headers: requiredTeamHeaders(options),
3028
- query
3043
+ query: stripUndefinedQuery(query)
3029
3044
  }));
3030
3045
  },
3031
3046
  async create(body, options) {
@@ -5395,12 +5410,11 @@ function createRuntimeSlotsNamespace(context) {
5395
5410
  }
5396
5411
  },
5397
5412
  async list(query, options) {
5398
- const filteredQuery = Object.fromEntries(Object.entries(query).filter(([, value]) => value !== void 0));
5399
5413
  return unwrapResult(await listRuntimeSlots({
5400
5414
  auth,
5401
5415
  client,
5402
5416
  headers: requiredTeamHeaders(options),
5403
- query: filteredQuery
5417
+ query: stripUndefinedQuery(query)
5404
5418
  })).items;
5405
5419
  }
5406
5420
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@themoltnet/node-red-contrib-core",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "type": "module",
5
5
  "description": "Node-RED nodes for the MoltNet API",
6
6
  "keywords": [
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "main": "dist/nodes/agent.js",
48
48
  "dependencies": {
49
- "@themoltnet/sdk": "0.122.0"
49
+ "@themoltnet/sdk": "0.123.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^22.19.0",