@nanobpm/engine-wasm 0.7.1 → 0.8.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.
@@ -1343,3 +1343,25 @@ async function __wbg_init(module_or_path) {
1343
1343
  }
1344
1344
 
1345
1345
  export { initSync, __wbg_init as default };
1346
+
1347
+ // --- nanobpm: use-after-free DX guard (scripts/inject-free-guard.mjs) ---
1348
+ // wasm-bindgen throws the opaque "null pointer passed to rust" when a method is
1349
+ // called on a freed handle (__wbg_ptr === 0). Re-describe that as a clear
1350
+ // use-after-free so a host lifecycle bug is diagnosable at the call site. The
1351
+ // call is still refused — this only changes the message, not the behaviour.
1352
+ for (const __name of Object.getOwnPropertyNames(TestEngine.prototype)) {
1353
+ if (__name === "constructor" || __name === "free" || __name === "__destroy_into_raw") continue;
1354
+ const __desc = Object.getOwnPropertyDescriptor(TestEngine.prototype, __name);
1355
+ if (!__desc || typeof __desc.value !== "function") continue;
1356
+ const __orig = __desc.value;
1357
+ const __guarded = {
1358
+ [__name](...__args) {
1359
+ if (this.__wbg_ptr === 0) {
1360
+ throw new Error("TestEngine used after free(): '" + __name + "' called on a released engine handle");
1361
+ }
1362
+ return __orig.apply(this, __args);
1363
+ },
1364
+ }[__name];
1365
+ Object.defineProperty(TestEngine.prototype, __name, { ...__desc, value: __guarded });
1366
+ }
1367
+ // --- end nanobpm use-after-free DX guard ---
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanobpm/engine-wasm",
3
- "version": "0.7.1",
3
+ "version": "0.8.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",
@@ -1594,3 +1594,25 @@ async function __wbg_init(module_or_path) {
1594
1594
  }
1595
1595
 
1596
1596
  export { initSync, __wbg_init as default };
1597
+
1598
+ // --- nanobpm: use-after-free DX guard (scripts/inject-free-guard.mjs) ---
1599
+ // wasm-bindgen throws the opaque "null pointer passed to rust" when a method is
1600
+ // called on a freed handle (__wbg_ptr === 0). Re-describe that as a clear
1601
+ // use-after-free so a host lifecycle bug is diagnosable at the call site. The
1602
+ // call is still refused — this only changes the message, not the behaviour.
1603
+ for (const __name of Object.getOwnPropertyNames(TestEngine.prototype)) {
1604
+ if (__name === "constructor" || __name === "free" || __name === "__destroy_into_raw") continue;
1605
+ const __desc = Object.getOwnPropertyDescriptor(TestEngine.prototype, __name);
1606
+ if (!__desc || typeof __desc.value !== "function") continue;
1607
+ const __orig = __desc.value;
1608
+ const __guarded = {
1609
+ [__name](...__args) {
1610
+ if (this.__wbg_ptr === 0) {
1611
+ throw new Error("TestEngine used after free(): '" + __name + "' called on a released engine handle");
1612
+ }
1613
+ return __orig.apply(this, __args);
1614
+ },
1615
+ }[__name];
1616
+ Object.defineProperty(TestEngine.prototype, __name, { ...__desc, value: __guarded });
1617
+ }
1618
+ // --- end nanobpm use-after-free DX guard ---
Binary file
@@ -5082,6 +5082,20 @@ export type JobActivationResult = {
5082
5082
  jobs: Array<ActivatedJobResult>;
5083
5083
  };
5084
5084
 
5085
+ /**
5086
+ * The created batch operation for the job update.
5087
+ */
5088
+ export type JobBatchUpdateResult = {
5089
+ /**
5090
+ * Key of the created batch operation.
5091
+ */
5092
+ batchOperationKey: BatchOperationKey;
5093
+ /**
5094
+ * The type of the batch operation.
5095
+ */
5096
+ batchOperationType: string;
5097
+ };
5098
+
5085
5099
  /**
5086
5100
  * JSON object with changed job attribute values. The job cannot be completed or failed with this endpoint, use the complete job or fail job endpoints instead.
5087
5101
  */
@@ -5517,6 +5531,32 @@ export type JobStateEnum = 'CANCELED' | 'COMPLETED' | 'CREATED' | 'ERROR_THROWN'
5517
5531
  */
5518
5532
  export type JobStateFilterProperty = JobStateEnum | AdvancedJobStateFilter;
5519
5533
 
5534
+ /**
5535
+ * The changeset to apply to the matched jobs; at least one field must be non-null.
5536
+ */
5537
+ export type JobUpdateBatchChangeset = {
5538
+ /**
5539
+ * The new job-activation priority (0..=100).
5540
+ */
5541
+ priority?: number | null;
5542
+ /**
5543
+ * The new number of remaining retries.
5544
+ */
5545
+ retries?: number | null;
5546
+ };
5547
+
5548
+ /**
5549
+ * Batch update job request selecting the jobs to update and the new values.
5550
+ */
5551
+ export type JobUpdateBatchOperationRequest = {
5552
+ /**
5553
+ * Filter selecting the jobs to update.
5554
+ */
5555
+ filter: JobFilter;
5556
+ changeset: JobUpdateBatchChangeset;
5557
+ operationReference?: OperationReference;
5558
+ };
5559
+
5520
5560
  export type JobUpdateRequest = {
5521
5561
  changeset: JobChangeset;
5522
5562
  operationReference?: OperationReference;
@@ -5576,6 +5616,8 @@ export type UserTaskProperties = {
5576
5616
 
5577
5617
  export type _1Jobs1Activation = unknown;
5578
5618
 
5619
+ export type _1Jobs1BatchUpdate = unknown;
5620
+
5579
5621
  export type _1Jobs1Search = unknown;
5580
5622
 
5581
5623
  export type _1Jobs1JobKey = unknown;
@@ -13343,6 +13385,44 @@ export type FailJobResponses = {
13343
13385
 
13344
13386
  export type FailJobResponse = FailJobResponses[keyof FailJobResponses];
13345
13387
 
13388
+ export type BatchUpdateJobsData = {
13389
+ body: JobUpdateBatchOperationRequest;
13390
+ path?: never;
13391
+ query?: never;
13392
+ url: '/jobs/batch-update';
13393
+ };
13394
+
13395
+ export type BatchUpdateJobsErrors = {
13396
+ /**
13397
+ * The provided data is not valid.
13398
+ */
13399
+ 400: ProblemDetail;
13400
+ /**
13401
+ * The request lacks valid authentication credentials.
13402
+ */
13403
+ 401: ProblemDetail;
13404
+ /**
13405
+ * An internal error occurred while processing the request.
13406
+ */
13407
+ 500: ProblemDetail;
13408
+ /**
13409
+ * The service is currently unavailable. This may happen only on some requests where the system creates backpressure to prevent the server's compute resources from being exhausted, avoiding more severe failures. In this case, the title of the error object contains `RESOURCE_EXHAUSTED`. Clients are recommended to eventually retry those requests after a backoff period. You can learn more about the backpressure mechanism here: https://docs.camunda.io/docs/components/zeebe/technical-concepts/internal-processing/#handling-backpressure .
13410
+ *
13411
+ */
13412
+ 503: ProblemDetail;
13413
+ };
13414
+
13415
+ export type BatchUpdateJobsError = BatchUpdateJobsErrors[keyof BatchUpdateJobsErrors];
13416
+
13417
+ export type BatchUpdateJobsResponses = {
13418
+ /**
13419
+ * The batch operation was created.
13420
+ */
13421
+ 200: JobBatchUpdateResult;
13422
+ };
13423
+
13424
+ export type BatchUpdateJobsResponse = BatchUpdateJobsResponses[keyof BatchUpdateJobsResponses];
13425
+
13346
13426
  export type GetGlobalJobStatisticsData = {
13347
13427
  body?: never;
13348
13428
  path?: never;