@nanobpm/engine-wasm 0.12.0 → 0.13.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/build-info.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@nanobpm/engine-wasm",
3
- "version": "0.12.0",
4
- "commit": "809b18f5ff16b8a6e12e2de9ad2da43af6914dc7"
3
+ "version": "0.13.0",
4
+ "commit": "43579a5be74be48b407f15124662e35f86985972"
5
5
  }
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanobpm/engine-wasm",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "The nanobpmn engine (engine-core) compiled to WebAssembly for in-browser BPMN execution: deploy a diagram, start instances, activate/complete jobs, and read live snapshots/traces. Published as two subpath entrypoints — a lean baseline engine (default) and a read-model engine (the gateway's C8-style REST read surface). The substrate for the Bojtos demo framework (ADR 0043) and the console test-run panel.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -271,28 +271,24 @@ export class TestEngine {
271
271
  */
272
272
  resolveIncident(incident_key: string): string;
273
273
  /**
274
- * The AgentHistory turns for `agent_instance_key`, as an
275
- * `AgentInstanceHistorySearchQueryResult` JSON object (`{ items, page }`),
276
- * in the engine's canonical `(loopIteration, producedAt, historyItemKey)`
277
- * order. `filter_json` is `{ commitStatus? }` where `commitStatus` is a REST
278
- * spelling or array of them; **omitting it defaults to COMMITTED only**
279
- * (PENDING/DISCARDED surface only when asked for explicitly). Accepts the
280
- * canonical REST envelope `{ "filter": { commitStatus? } }` as well as the
281
- * top-level shorthand. Mirrors
282
- * `POST /agent-instances/{agentInstanceKey}/history/search`.
283
- */
284
- searchAgentInstanceHistory(agent_instance_key: string, filter_json: string): string;
285
- /**
286
- * The AgentInstances matching an optional filter, as an
287
- * `AgentInstanceSearchQueryResult` JSON object (`{ items, page }`). The
288
- * filter is `{ agentInstanceKey?, agentDefinitionKey?, processInstanceKey?,
289
- * rootProcessInstanceKey?, processDefinitionKey?, status?, elementId?,
290
- * tenantId? }` (`status` a REST spelling, e.g. `"INITIALIZING"`); an
291
- * empty/absent filter returns every instance. Accepts the canonical REST
292
- * envelope `{ "filter": { … } }` as well as the top-level shorthand.
293
- * Mirrors `POST /agent-instances/search`.
294
- */
295
- searchAgentInstances(filter_json: string): string;
274
+ * `searchAgentInstanceHistory` — mirrors
275
+ * `POST /agent-instances/{agentInstanceKey}/history/search`. `query_json`
276
+ * is the spec's `AgentInstanceHistorySearchQuery`, run through the shared
277
+ * `nanobpmn_search` pipeline (COMMITTED-only unless `commitStatus` asks
278
+ * otherwise; every filter operator, sort, limit/cursor paging). Returns the
279
+ * generated `AgentInstanceHistorySearchQueryResult` as JSON.
280
+ */
281
+ searchAgentInstanceHistory(agent_instance_key: string, query_json: string): string;
282
+ /**
283
+ * `searchAgentInstances` — mirrors `POST /agent-instances/search`.
284
+ * `query_json` is the spec's `AgentInstanceSearchQuery` (`{ filter?, sort?,
285
+ * page? }`; empty ⇒ no query), parsed into the generated model and run
286
+ * through the SAME `nanobpmn_search` pipeline the gateway serves (every
287
+ * filter operator, sort, limit/cursor paging). Returns the generated
288
+ * `AgentInstanceSearchQueryResult` as JSON. A property the spec does not
289
+ * define is rejected, never silently ignored.
290
+ */
291
+ searchAgentInstances(query_json: string): string;
296
292
  /**
297
293
  * All process instances, as a `ProcessInstanceSearchQueryResult` JSON object
298
294
  * (`{ items: [...], page: {...} }`). The request body is shape-validated like
@@ -1120,27 +1120,24 @@ export class TestEngine {
1120
1120
  }
1121
1121
  }
1122
1122
  /**
1123
- * The AgentHistory turns for `agent_instance_key`, as an
1124
- * `AgentInstanceHistorySearchQueryResult` JSON object (`{ items, page }`),
1125
- * in the engine's canonical `(loopIteration, producedAt, historyItemKey)`
1126
- * order. `filter_json` is `{ commitStatus? }` where `commitStatus` is a REST
1127
- * spelling or array of them; **omitting it defaults to COMMITTED only**
1128
- * (PENDING/DISCARDED surface only when asked for explicitly). Accepts the
1129
- * canonical REST envelope `{ "filter": { commitStatus? } }` as well as the
1130
- * top-level shorthand. Mirrors
1131
- * `POST /agent-instances/{agentInstanceKey}/history/search`.
1123
+ * `searchAgentInstanceHistory` — mirrors
1124
+ * `POST /agent-instances/{agentInstanceKey}/history/search`. `query_json`
1125
+ * is the spec's `AgentInstanceHistorySearchQuery`, run through the shared
1126
+ * `nanobpmn_search` pipeline (COMMITTED-only unless `commitStatus` asks
1127
+ * otherwise; every filter operator, sort, limit/cursor paging). Returns the
1128
+ * generated `AgentInstanceHistorySearchQueryResult` as JSON.
1132
1129
  * @param {string} agent_instance_key
1133
- * @param {string} filter_json
1130
+ * @param {string} query_json
1134
1131
  * @returns {string}
1135
1132
  */
1136
- searchAgentInstanceHistory(agent_instance_key, filter_json) {
1133
+ searchAgentInstanceHistory(agent_instance_key, query_json) {
1137
1134
  let deferred4_0;
1138
1135
  let deferred4_1;
1139
1136
  try {
1140
1137
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1141
1138
  const ptr0 = passStringToWasm0(agent_instance_key, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
1142
1139
  const len0 = WASM_VECTOR_LEN;
1143
- const ptr1 = passStringToWasm0(filter_json, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
1140
+ const ptr1 = passStringToWasm0(query_json, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
1144
1141
  const len1 = WASM_VECTOR_LEN;
1145
1142
  wasm.testengine_searchAgentInstanceHistory(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
1146
1143
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
@@ -1162,23 +1159,22 @@ export class TestEngine {
1162
1159
  }
1163
1160
  }
1164
1161
  /**
1165
- * The AgentInstances matching an optional filter, as an
1166
- * `AgentInstanceSearchQueryResult` JSON object (`{ items, page }`). The
1167
- * filter is `{ agentInstanceKey?, agentDefinitionKey?, processInstanceKey?,
1168
- * rootProcessInstanceKey?, processDefinitionKey?, status?, elementId?,
1169
- * tenantId? }` (`status` a REST spelling, e.g. `"INITIALIZING"`); an
1170
- * empty/absent filter returns every instance. Accepts the canonical REST
1171
- * envelope `{ "filter": { … } }` as well as the top-level shorthand.
1172
- * Mirrors `POST /agent-instances/search`.
1173
- * @param {string} filter_json
1162
+ * `searchAgentInstances` — mirrors `POST /agent-instances/search`.
1163
+ * `query_json` is the spec's `AgentInstanceSearchQuery` (`{ filter?, sort?,
1164
+ * page? }`; empty ⇒ no query), parsed into the generated model and run
1165
+ * through the SAME `nanobpmn_search` pipeline the gateway serves (every
1166
+ * filter operator, sort, limit/cursor paging). Returns the generated
1167
+ * `AgentInstanceSearchQueryResult` as JSON. A property the spec does not
1168
+ * define is rejected, never silently ignored.
1169
+ * @param {string} query_json
1174
1170
  * @returns {string}
1175
1171
  */
1176
- searchAgentInstances(filter_json) {
1172
+ searchAgentInstances(query_json) {
1177
1173
  let deferred3_0;
1178
1174
  let deferred3_1;
1179
1175
  try {
1180
1176
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1181
- const ptr0 = passStringToWasm0(filter_json, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
1177
+ const ptr0 = passStringToWasm0(query_json, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
1182
1178
  const len0 = WASM_VECTOR_LEN;
1183
1179
  wasm.testengine_searchAgentInstances(retptr, this.__wbg_ptr, ptr0, len0);
1184
1180
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
Binary file
@@ -2,7 +2,9 @@
2
2
  // types for the read-model engine's query results, so browser consumers
3
3
  // (@nanobpm/bojtos-kit → the web-demo-framework) can type
4
4
  // `searchUserTasks` / `searchProcessInstances` / `searchVariables` /
5
- // `getFormByKey` / `getResourceByKey` without hand-mirroring the shapes.
5
+ // `getFormByKey` / `getResourceByKey` without hand-mirroring the shapes, and
6
+ // build agent search requests (`searchAgentInstances` /
7
+ // `searchAgentInstanceHistory`) against the spec's own filter/query/page types.
6
8
  //
7
9
  // These are re-exported from the generated `types.gen.d.ts`, which is derived
8
10
  // from the single source of truth — the Camunda-parity REST OpenAPI in `spec/`
@@ -25,4 +27,65 @@ export type {
25
27
  // Shared search envelope (`{ items, page }`) the *SearchQueryResult types extend.
26
28
  SearchQueryResponse,
27
29
  SearchQueryPageResponse,
30
+
31
+ // ── Agent searches (#1883) ──────────────────────────────────────────────
32
+ // `searchAgentInstances(query: AgentInstanceSearchQuery)` and
33
+ // `searchAgentInstanceHistory(key, query: AgentInstanceHistorySearchQuery)`
34
+ // run the SAME spec-derived search layer as the gateway (every advanced
35
+ // filter operator, sort, limit/offset/cursor paging), so the request types
36
+ // below are the contract the engine accepts, not just what it returns.
37
+ AgentInstanceSearchQuery,
38
+ AgentInstanceFilter,
39
+ AgentInstanceSearchQuerySortRequest,
40
+ AgentInstanceSearchQueryResult,
41
+ AgentInstanceResult,
42
+ AgentInstanceStatusEnum,
43
+ AgentInstanceHistorySearchQuery,
44
+ AgentInstanceHistoryFilter,
45
+ AgentInstanceHistorySearchQuerySortRequest,
46
+ AgentInstanceHistorySearchQueryResult,
47
+ AgentInstanceHistoryItemResult,
48
+ AgentInstanceHistoryRoleEnum,
49
+ AgentInstanceHistoryCommitStatusEnum,
50
+ // Shared search request envelope + paging (`page`) and sort order.
51
+ SearchQueryRequest,
52
+ SearchQueryPageRequest,
53
+ LimitPagination,
54
+ OffsetPagination,
55
+ CursorForwardPagination,
56
+ CursorBackwardPagination,
57
+ SortOrderEnum,
58
+ // Filter properties: a bare value (implicit `$eq`) or an advanced filter.
59
+ StringFilterProperty,
60
+ IntegerFilterProperty,
61
+ DateTimeFilterProperty,
62
+ ElementIdFilterProperty,
63
+ AgentInstanceKeyFilterProperty,
64
+ AgentDefinitionKeyFilterProperty,
65
+ AgentHistoryItemKeyFilterProperty,
66
+ ElementInstanceKeyFilterProperty,
67
+ JobKeyFilterProperty,
68
+ ProcessInstanceKeyFilterProperty,
69
+ ProcessDefinitionKeyFilterProperty,
70
+ AgentInstanceStatusFilterProperty,
71
+ AgentInstanceHistoryRoleFilterProperty,
72
+ AgentInstanceHistoryCommitStatusFilterProperty,
73
+ // Advanced filter operator objects (`$eq`, `$neq`, `$exists`, `$in`,
74
+ // `$notIn`, `$like`, `$gt`, `$gte`, `$lt`, `$lte`).
75
+ BasicStringFilter,
76
+ AdvancedStringFilter,
77
+ LikeFilter,
78
+ AdvancedIntegerFilter,
79
+ AdvancedDateTimeFilter,
80
+ AdvancedElementIdFilter,
81
+ AdvancedAgentInstanceKeyFilter,
82
+ AdvancedAgentDefinitionKeyFilter,
83
+ AdvancedAgentHistoryItemKeyFilter,
84
+ AdvancedElementInstanceKeyFilter,
85
+ AdvancedJobKeyFilter,
86
+ AdvancedProcessInstanceKeyFilter,
87
+ AdvancedProcessDefinitionKeyFilter,
88
+ AdvancedAgentInstanceStatusFilter,
89
+ AdvancedAgentInstanceHistoryRoleFilter,
90
+ AdvancedAgentInstanceHistoryCommitStatusFilter,
28
91
  } from "./types.gen.js";