@revoengine/cli 2.0.0 → 2.1.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/CHANGELOG.md +6 -0
- package/README.md +11 -9
- package/dist/src/automation-contract.generated.d.ts +87 -6
- package/dist/src/automation-contract.generated.js +105 -6
- package/dist/src/client.d.ts +3 -0
- package/dist/src/resource-syncs/automation-input.d.ts +2 -2
- package/dist/src/resource-syncs/automation-input.js +7 -17
- package/dist/src/resource-syncs/event-sync.d.ts +2 -0
- package/dist/src/resource-syncs/event-sync.js +18 -8
- package/dist/src/resource-syncs/job-template-sync.d.ts +2 -0
- package/dist/src/resource-syncs/job-template-sync.js +6 -1
- package/dist/src/resource-syncs/runtime-definition-validation.js +10 -2
- package/dist/src/resource-syncs/schedule-sync.js +0 -1
- package/dist/src/sync-omit.js +3 -1
- package/dist/src/types.d.ts +12 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.1.0 — 2026-11-11
|
|
4
|
+
|
|
5
|
+
- Pull, plan and push Job Template Batch or Debounce delivery across every trigger source and dynamic concurrency paths on Platform 1.9.0. Reject retired Event-level collection policies with explicit migration guidance. Preserve source-specific Event and Schedule input and ignore retired merge modes in existing manifests.
|
|
6
|
+
|
|
7
|
+
- Refresh reviewed automation plans after upgrading and follow the [1.9 migration guide](https://docs.revoengine.com/developers/upgrading-to-1-9).
|
|
8
|
+
|
|
3
9
|
## 2.0.0 — 2026-11-07
|
|
4
10
|
|
|
5
11
|
### Upgrade requirements
|
package/README.md
CHANGED
|
@@ -10,11 +10,11 @@ The CLI has three main capabilities:
|
|
|
10
10
|
2. **Project migration** — plan, run, and verify a direct migration between two saved projects with `--from` and `--to`.
|
|
11
11
|
3. **Resource synchronization** — work with one supported resource family through its dedicated `pull`, `plan`, and `push` commands.
|
|
12
12
|
|
|
13
|
-
## Version 2.
|
|
13
|
+
## Version 2.1.0
|
|
14
14
|
|
|
15
|
-
Use this release with Platform 1.
|
|
15
|
+
Use this release with Platform 1.9.0 or later and VS Code extension 2.1.0 or later. Update the compatible clients and backend together. Endpoint and Job configurations no longer accept `skipLibs`, `includeLibs` or `excludeLibs`, including `false` and empty arrays. Remove these fields from current manifests; review and test non-default selections first. Ordinary business payload fields are unaffected.
|
|
16
16
|
|
|
17
|
-
Debugger execution defaults to the caller and can explicitly select the global endpoint or job policy. Browser Live Preview supports pointer gestures, selected-text feedback and active-session status while retaining privacy controls. See the [2.
|
|
17
|
+
Debugger execution defaults to the caller and can explicitly select the global endpoint or job policy. Browser Live Preview supports pointer gestures, selected-text feedback and active-session status while retaining privacy controls. See the [2.1.0 changelog](CHANGELOG.md).
|
|
18
18
|
|
|
19
19
|
Component creation and reviewed source saves can wait up to ten minutes, including cold Sandbox startup. This also extends Node fetch's response-header waiting limit. Upgrade the matching API/Sandbox services to receive the longer server-side validation budget. See the [1.0.35 changelog](CHANGELOG.md). Writes with `--omit` still require the matching API capability `atomicResourceUpdates`.
|
|
20
20
|
|
|
@@ -534,11 +534,11 @@ Existing `database-schema` selectors and `revo database-schemas` commands remain
|
|
|
534
534
|
|
|
535
535
|
Older Event manifests without `custom` must be refreshed with `revo events pull` from the source environment or edited to set `custom` explicitly. The pull upgrades an unchanged, locked manifest without `--force`. Check the `type` too: a legacy `CUSTOM_EXPORT` event now uses `type: "EXPORT", custom: true` when that is the source definition. An Event plan blocks manifests with no `custom` classifier.
|
|
536
536
|
|
|
537
|
-
Event and Schedule manifests retain
|
|
537
|
+
Event and Schedule manifests retain a JSON object `input` at the top level. Pull, plan, push, migration and readback verification preserve it. The runtime exposes it on each trigger. Invalid input and duplicate top-level/extension input block writes, including with `--force`.
|
|
538
538
|
|
|
539
|
-
Previously pulled Event manifests
|
|
539
|
+
Previously pulled Event manifests can still supply input through `extensions.input`. A fresh pull writes `input` at the top level. With `--omit`, the two input layouts share ownership, and pulls retain omitted destination values while refreshing managed nested siblings. The retired `inputMode` field is ignored. Old Event lock hashes are recognized using the complete live input values, so they cannot hide remote drift. Other extension fields still block deployment.
|
|
540
540
|
|
|
541
|
-
|
|
541
|
+
Omitting `input` means `{}` in the portable definition. Older Schedule pulls may omit this field. Pull the source before promotion if a Schedule uses nonempty input, and regenerate saved reviewed plans after upgrading the CLI.
|
|
542
542
|
|
|
543
543
|
### Definition contract checks
|
|
544
544
|
|
|
@@ -870,10 +870,10 @@ An unqualified path must be supported by every selected family. Qualify family-s
|
|
|
870
870
|
| --- | --- |
|
|
871
871
|
| `database-table`, `database-view` | `name`, `category`, `description`, `metadata.label` |
|
|
872
872
|
| `component` | `name`, `description` (alias of `desc`), `active`, `testConfig`, `metadata.label` |
|
|
873
|
-
| `job-template` | `name`, `category`, `description`, `timeout`, `inputs`, `options.retry.maxAttempts` |
|
|
873
|
+
| `job-template` | `name`, `category`, `description`, `timeout`, `inputs`, `delivery`, `options.retry.maxAttempts` |
|
|
874
874
|
| `endpoint` | `name`, `category`, `description`, `active`, `timeout`, `options.input.tenant` |
|
|
875
|
-
| `schedule` | `name`, `category`, `description`, `cron`, `timezone`, `input.tenant
|
|
876
|
-
| `event` | `name`, `category`, `description`, `filter`, `input.tenant
|
|
875
|
+
| `schedule` | `name`, `category`, `description`, `cron`, `timezone`, `input.tenant` |
|
|
876
|
+
| `event` | `name`, `category`, `description`, `filter`, `input.tenant` |
|
|
877
877
|
| `group`, `role-group` | `name`, `category`, `description`, `metadata.label` |
|
|
878
878
|
| `service-account` | `name`, `metadata.label` |
|
|
879
879
|
| `agent` | `name`, `description`, `definition.config.model`, `definition.policy.maxTicks` |
|
|
@@ -897,6 +897,8 @@ Endpoint and Job Template pins use the API content identity `v1:sha256:<64 lower
|
|
|
897
897
|
|
|
898
898
|
Repository `plan/deploy` without `--activate` preserves existing Event and Schedule activation and creates new definitions inactive. Differences from manifest activation remain visible as `activation-drift`, but do not prevent definition convergence. With `--activate`, strict plans and final verification require activation to match the manifest. Reviewed deployment still fences live target activation and rejects changes after planning, in either mode. Named migration and dedicated family plans retain their activation-convergence checks. Deprecated Schedule `targetVersion` is reported diagnostically; the backend does not use it to select a Job Template revision.
|
|
899
899
|
|
|
900
|
+
On Platform 1.9.0, configure collection on the Job Template manifest with top-level `delivery`: `{ "mode": "BATCH", "maxSize": 100, "maxWaitSeconds": 600 }`, or use `"mode": "DEBOUNCE"` with `quietPeriodSeconds`. `maxSize` is 2–1000 and wait/quiet periods are 1–3600 seconds; the quiet period must not exceed the maximum wait. Remove `delivery` or set it to `null` for SINGLE. Collection combines Event, Schedule, manual Run and low-code/API admissions for the same Job configuration. Pull, plan and push preserve this policy, and removing it clears grouping on the target. Former Event-level `delivery` is rejected with an upgrade instruction; move the collection policy to the target Job and remove the former Event `keyPath`, since concurrency is configured separately. Job Template manifests can set `options.concurrency.keyPath` to a JSON Pointer such as `/message/orderId`. Event and Schedule manifests carry their own `input`, exposed on each `api.input().triggers` entry. The CLI ignores retired `inputMode` when reading existing manifests and omits it from pulled definitions and API writes.
|
|
901
|
+
|
|
900
902
|
`CUSTOM_NODEJS` deployment verifies runtime availability and the active desired revision after source readback. Automatic deployment waits up to two minutes for readiness; failed attempts, manual activation requirements and unavailable/pending revisions fail verification without adopting a deployment baseline. Re-run after the runtime is ready. Named `env diff/apply` also reports unavailable unchanged custom runtimes and returns an error on unverified writes. Definition synchronization does not invoke provider/plugin tests; component dependencies and their pinned revisions are checked with read-only API calls, including unchanged definitions.
|
|
901
903
|
|
|
902
904
|
Execution options are compared without hiding runtime differences: an explicit Job Template memory value remains distinct from missing/null memory, which falls back to template input or the current 128 MiB runtime default. The create API initially materializes 256 MiB; CLI creation restores the desired options with a version-guarded update before verification when needed. An empty `options.input` overrides legacy `inputs`. Endpoint null/zero memory is normalized to 32 MiB by both create and update. Old Job baselines that omitted explicit 256 MiB cannot prove memory convergence; re-pull and review those definitions before promotion.
|
|
@@ -261,6 +261,13 @@ export declare const requestContracts: {
|
|
|
261
261
|
readonly JobTemplateRequestDto: {
|
|
262
262
|
readonly type: "object";
|
|
263
263
|
readonly properties: {
|
|
264
|
+
readonly delivery: {
|
|
265
|
+
readonly allOf: readonly [{
|
|
266
|
+
readonly $ref: "#/components/schemas/JobDeliveryDto";
|
|
267
|
+
}];
|
|
268
|
+
readonly nullable: true;
|
|
269
|
+
readonly type: "object";
|
|
270
|
+
};
|
|
264
271
|
readonly executionPolicy: {
|
|
265
272
|
readonly allOf: readonly [{
|
|
266
273
|
readonly $ref: "#/components/schemas/RuntimeJobExecutionPolicyDto";
|
|
@@ -324,6 +331,13 @@ export declare const requestContracts: {
|
|
|
324
331
|
readonly UpdateJobTemplate: {
|
|
325
332
|
readonly type: "object";
|
|
326
333
|
readonly properties: {
|
|
334
|
+
readonly delivery: {
|
|
335
|
+
readonly allOf: readonly [{
|
|
336
|
+
readonly $ref: "#/components/schemas/JobDeliveryDto";
|
|
337
|
+
}];
|
|
338
|
+
readonly nullable: true;
|
|
339
|
+
readonly type: "object";
|
|
340
|
+
};
|
|
327
341
|
readonly executionPolicy: {
|
|
328
342
|
readonly allOf: readonly [{
|
|
329
343
|
readonly $ref: "#/components/schemas/RuntimeJobExecutionPolicyDto";
|
|
@@ -437,6 +451,13 @@ export declare const requestContracts: {
|
|
|
437
451
|
readonly pattern: "^[a-zA-Z0-9_-]*$";
|
|
438
452
|
readonly patternFlags: "";
|
|
439
453
|
};
|
|
454
|
+
readonly keyPath: {
|
|
455
|
+
readonly nullable: true;
|
|
456
|
+
readonly type: "string";
|
|
457
|
+
readonly maxLength: 256;
|
|
458
|
+
readonly pattern: "^(?:\\/(?:[^~/\\u0000-\\u001f\\u007f]|~[01])*)+(?![\\s\\S])";
|
|
459
|
+
readonly patternFlags: "u";
|
|
460
|
+
};
|
|
440
461
|
readonly limit: {
|
|
441
462
|
readonly nullable: true;
|
|
442
463
|
readonly type: "integer";
|
|
@@ -498,6 +519,63 @@ export declare const requestContracts: {
|
|
|
498
519
|
};
|
|
499
520
|
readonly additionalProperties: false;
|
|
500
521
|
};
|
|
522
|
+
readonly EventDeliveryDto: {
|
|
523
|
+
readonly type: "object";
|
|
524
|
+
readonly properties: {
|
|
525
|
+
readonly mode: {
|
|
526
|
+
readonly enum: readonly ["BATCH", "DEBOUNCE"];
|
|
527
|
+
};
|
|
528
|
+
readonly keyPath: {
|
|
529
|
+
readonly nullable: true;
|
|
530
|
+
readonly type: "string";
|
|
531
|
+
readonly maxLength: 256;
|
|
532
|
+
readonly pattern: "^(?:\\/(?:[^~/\\u0000-\\u001f\\u007f]|~[01])*)+(?![\\s\\S])";
|
|
533
|
+
readonly patternFlags: "u";
|
|
534
|
+
};
|
|
535
|
+
readonly maxSize: {
|
|
536
|
+
readonly type: "integer";
|
|
537
|
+
readonly minimum: 2;
|
|
538
|
+
readonly maximum: 1000;
|
|
539
|
+
};
|
|
540
|
+
readonly maxWaitSeconds: {
|
|
541
|
+
readonly type: "integer";
|
|
542
|
+
readonly minimum: 1;
|
|
543
|
+
readonly maximum: 3600;
|
|
544
|
+
};
|
|
545
|
+
readonly quietPeriodSeconds: {
|
|
546
|
+
readonly type: "integer";
|
|
547
|
+
readonly minimum: 1;
|
|
548
|
+
readonly maximum: 3600;
|
|
549
|
+
};
|
|
550
|
+
};
|
|
551
|
+
readonly required: readonly ["mode", "maxSize", "maxWaitSeconds"];
|
|
552
|
+
readonly additionalProperties: false;
|
|
553
|
+
};
|
|
554
|
+
readonly JobDeliveryDto: {
|
|
555
|
+
readonly type: "object";
|
|
556
|
+
readonly properties: {
|
|
557
|
+
readonly mode: {
|
|
558
|
+
readonly enum: readonly ["BATCH", "DEBOUNCE"];
|
|
559
|
+
};
|
|
560
|
+
readonly maxSize: {
|
|
561
|
+
readonly type: "integer";
|
|
562
|
+
readonly minimum: 2;
|
|
563
|
+
readonly maximum: 1000;
|
|
564
|
+
};
|
|
565
|
+
readonly maxWaitSeconds: {
|
|
566
|
+
readonly type: "integer";
|
|
567
|
+
readonly minimum: 1;
|
|
568
|
+
readonly maximum: 3600;
|
|
569
|
+
};
|
|
570
|
+
readonly quietPeriodSeconds: {
|
|
571
|
+
readonly type: "integer";
|
|
572
|
+
readonly minimum: 1;
|
|
573
|
+
readonly maximum: 3600;
|
|
574
|
+
};
|
|
575
|
+
};
|
|
576
|
+
readonly required: readonly ["mode", "maxSize", "maxWaitSeconds"];
|
|
577
|
+
readonly additionalProperties: false;
|
|
578
|
+
};
|
|
501
579
|
readonly RuntimeExecutionPolicyDto: {
|
|
502
580
|
readonly type: "object";
|
|
503
581
|
readonly properties: {
|
|
@@ -706,9 +784,10 @@ export declare const requestContractDefaults: {
|
|
|
706
784
|
};
|
|
707
785
|
};
|
|
708
786
|
export declare const requestContractSemanticSources: {
|
|
709
|
-
readonly "packages/domain/src/utils/backend-metadata.util.ts#assertJsonValue": "
|
|
787
|
+
readonly "packages/domain/src/utils/backend-metadata.util.ts#assertJsonValue": "e3856d26eb4c43aae24e033691f677f700d6d4f7793dd2be79ce89b8a60ad067";
|
|
710
788
|
readonly "packages/domain/src/dto/automation/run.options.dto.ts#JobRetryMinBackoffWithinMaxConstraint": "2c8eb4f844ffabfd03f5ae9617a2b0e9e578fa0b9d2a563081648b6688629439";
|
|
711
789
|
readonly "packages/execution-core/src/modules/@core/services/virtualization.service.ts#normalizeIsolateMemoryLimit": "4cce767b32d7b848cea9502eec5d3df2b7a7dc3e41227eeffda1a6a1e8fc9d96";
|
|
790
|
+
readonly "packages/domain/src/dto/automation/event-delivery.dto.ts#isValidEventDeliveryWait": "25fd97d39db416f9b3087ed29984f853d587b34d8ec54b7e7ac2378108bbd89f";
|
|
712
791
|
readonly "packages/domain/src/utils/backend-metadata.util.ts#assertUserMetadataWritable": "ffc70235399e7542c71b58ae4c31ac55d7db29431fc2b3f51c690dba7281a66a";
|
|
713
792
|
readonly "packages/platform-shared/src/utils/job-retry-policy.util.ts#normalizeJobRetryPolicy": "facef84884b5b4311af06bfb4469f071ff42a4bca067b6d9092d4f6571e8ee86";
|
|
714
793
|
readonly "packages/platform-shared/src/utils/job-retry-policy.util.ts#assertJobRetryPolicyValid": "6511ccafc15233a4ffe4e024f13e6c0e5c9d8a53c261ecc571300495afd804cf";
|
|
@@ -717,8 +796,8 @@ export declare const requestContractSemanticSources: {
|
|
|
717
796
|
readonly "apps/api/src/modules/endpoints/endpoint.service.ts#update": "bc59acaffdb7275659bddb65b8d71e9d8266447054723ea87495eaa0dd512fe1";
|
|
718
797
|
readonly "apps/api/src/modules/endpoints/endpoint.service.ts#validateEndpointOptions": "64686ee1c1e2611aa00847b771de637797a3007062b95e303046ad2cba69e729";
|
|
719
798
|
readonly "apps/api/src/modules/endpoints/endpoint.service.ts#applyEndpointOptionDefaults": "9da1bdfd83a3142b7f44d4ce5ee2aac6cf4ed70bef790f979c412c411fe2790d";
|
|
720
|
-
readonly "apps/api/src/modules/automation/jobs.service.ts#createJobTemplate": "
|
|
721
|
-
readonly "apps/api/src/modules/automation/jobs.service.ts#update": "
|
|
799
|
+
readonly "apps/api/src/modules/automation/jobs.service.ts#createJobTemplate": "59a8433530980f3970c5915f696611f14820c10183b0f917a74912245f1cbd78";
|
|
800
|
+
readonly "apps/api/src/modules/automation/jobs.service.ts#update": "d8b3ccef6ae812e8bcdcd21cf5184c2afe9ede28055f355f684e13a64b094933";
|
|
722
801
|
readonly "packages/platform-shared/src/services/job.scheduler.service.ts#resolveTemplateInputs": "a9a4cc5df4627abf7ee2d2df7f2494d290292a15f4889a5f07a9de104ee33d9f";
|
|
723
802
|
readonly "packages/domain/src/dto/components/component-element-key.const.ts#isLowCodeComponentType": "4918470ef562727becb8c97c5afb7761a49734ecd21a6d3d5436576dbd10a6da";
|
|
724
803
|
readonly "packages/domain/src/dto/components/component-element-key.const.ts#isDefaultLibraryElement": "4faa356b91be5c44ebe3d442b6da26088d6d35d2db5fb073e1103165431cee48";
|
|
@@ -734,11 +813,13 @@ export declare const requestContractSourceProvenance: {
|
|
|
734
813
|
readonly "packages/domain/src/dto/automation/update.api.template.request.dto.ts#UpdateEndpointRequestDto": "20ee0c9afbfa594f189ead2b751aa00b6003efe0b70c5e1158ee78c1e0d29567";
|
|
735
814
|
readonly "packages/domain/src/dto/automation/endpoint.template.request.dto.ts#EndpointOptionsDto": "1ade11735627613a81b5cfaa796dfdc49d4c7e0db01ae6467da6a99a9f3af683";
|
|
736
815
|
readonly "packages/domain/src/dto/automation/endpoint.sse.dto.ts#EndpointSseDto": "960d56ebb300ded00f61f1318522c010135675e0f32a8084fb3e9b16a1c20ecc";
|
|
737
|
-
readonly "packages/domain/src/dto/automation/job.template.request.dto.ts#JobTemplateRequestDto": "
|
|
738
|
-
readonly "packages/domain/src/dto/automation/update.job.template.dto.ts#UpdateJobTemplate": "
|
|
816
|
+
readonly "packages/domain/src/dto/automation/job.template.request.dto.ts#JobTemplateRequestDto": "fcbcfa8fd7b600dabe25d9d1e36414db1894bff89980a106b2cc7fbc7feb94d8";
|
|
817
|
+
readonly "packages/domain/src/dto/automation/update.job.template.dto.ts#UpdateJobTemplate": "bb83065b8ae816cc917ec73abc83af6749bc5fdc00e460b889c41cd34443123e";
|
|
739
818
|
readonly "packages/domain/src/dto/automation/run.options.dto.ts#JobOptionsDto": "a4ee900b8610f7edbabf8d07738f99b33a288327ea0d66e67c0f8c28260215c8";
|
|
740
|
-
readonly "packages/domain/src/dto/automation/run.options.dto.ts#ConcurrencyJobDto": "
|
|
819
|
+
readonly "packages/domain/src/dto/automation/run.options.dto.ts#ConcurrencyJobDto": "8410d5a666f02c0eb09d466f630fe63eb5bcdf77f245e1a8ff1a14894f314966";
|
|
741
820
|
readonly "packages/domain/src/dto/automation/run.options.dto.ts#RetryJobDto": "e42fcd447fe111bdf2da20ad42654e536a01d566f33a1d8f52ec1bb0bd1ee8b1";
|
|
821
|
+
readonly "packages/domain/src/dto/automation/event-delivery.dto.ts#EventDeliveryDto": "0e126b97d338891c74c1e9eaebce5417b2ece210f991dde5dc4ee3b048ba9297";
|
|
822
|
+
readonly "packages/domain/src/dto/automation/job-delivery.dto.ts#JobDeliveryDto": "3c3cc0e3f03e0bd8853d63265218cd80876aca00b4b0ddcdea368f2a2831d922";
|
|
742
823
|
readonly "packages/domain/src/dto/automation/runtime.execution.policy.dto.ts#RuntimeExecutionPolicyDto": "9978ee21a9b7da26c93a4e1516dfc319166a2b55520edee9319d17922b375474";
|
|
743
824
|
readonly "packages/domain/src/dto/automation/runtime.execution.policy.dto.ts#RuntimeJobExecutionPolicyDto": "d900a693362a9de02839e2ae959c4e8ac2ac8e0206a4cbe69e889a3636793d23";
|
|
744
825
|
readonly "packages/domain/src/dto/components/update.component.dto.ts#UpdateComponentDto": "bac5c210c38eb230ae6ca2b42428956ea1c2065ffc947c40478152098a50e673";
|
|
@@ -320,6 +320,15 @@ export const requestContracts = {
|
|
|
320
320
|
"JobTemplateRequestDto": {
|
|
321
321
|
"type": "object",
|
|
322
322
|
"properties": {
|
|
323
|
+
"delivery": {
|
|
324
|
+
"allOf": [
|
|
325
|
+
{
|
|
326
|
+
"$ref": "#/components/schemas/JobDeliveryDto"
|
|
327
|
+
}
|
|
328
|
+
],
|
|
329
|
+
"nullable": true,
|
|
330
|
+
"type": "object"
|
|
331
|
+
},
|
|
323
332
|
"executionPolicy": {
|
|
324
333
|
"allOf": [
|
|
325
334
|
{
|
|
@@ -390,6 +399,15 @@ export const requestContracts = {
|
|
|
390
399
|
"UpdateJobTemplate": {
|
|
391
400
|
"type": "object",
|
|
392
401
|
"properties": {
|
|
402
|
+
"delivery": {
|
|
403
|
+
"allOf": [
|
|
404
|
+
{
|
|
405
|
+
"$ref": "#/components/schemas/JobDeliveryDto"
|
|
406
|
+
}
|
|
407
|
+
],
|
|
408
|
+
"nullable": true,
|
|
409
|
+
"type": "object"
|
|
410
|
+
},
|
|
393
411
|
"executionPolicy": {
|
|
394
412
|
"allOf": [
|
|
395
413
|
{
|
|
@@ -513,6 +531,13 @@ export const requestContracts = {
|
|
|
513
531
|
"pattern": "^[a-zA-Z0-9_-]*$",
|
|
514
532
|
"patternFlags": ""
|
|
515
533
|
},
|
|
534
|
+
"keyPath": {
|
|
535
|
+
"nullable": true,
|
|
536
|
+
"type": "string",
|
|
537
|
+
"maxLength": 256,
|
|
538
|
+
"pattern": "^(?:\\/(?:[^~/\\u0000-\\u001f\\u007f]|~[01])*)+(?![\\s\\S])",
|
|
539
|
+
"patternFlags": "u"
|
|
540
|
+
},
|
|
516
541
|
"limit": {
|
|
517
542
|
"nullable": true,
|
|
518
543
|
"type": "integer",
|
|
@@ -574,6 +599,77 @@ export const requestContracts = {
|
|
|
574
599
|
},
|
|
575
600
|
"additionalProperties": false
|
|
576
601
|
},
|
|
602
|
+
"EventDeliveryDto": {
|
|
603
|
+
"type": "object",
|
|
604
|
+
"properties": {
|
|
605
|
+
"mode": {
|
|
606
|
+
"enum": [
|
|
607
|
+
"BATCH",
|
|
608
|
+
"DEBOUNCE"
|
|
609
|
+
]
|
|
610
|
+
},
|
|
611
|
+
"keyPath": {
|
|
612
|
+
"nullable": true,
|
|
613
|
+
"type": "string",
|
|
614
|
+
"maxLength": 256,
|
|
615
|
+
"pattern": "^(?:\\/(?:[^~/\\u0000-\\u001f\\u007f]|~[01])*)+(?![\\s\\S])",
|
|
616
|
+
"patternFlags": "u"
|
|
617
|
+
},
|
|
618
|
+
"maxSize": {
|
|
619
|
+
"type": "integer",
|
|
620
|
+
"minimum": 2,
|
|
621
|
+
"maximum": 1000
|
|
622
|
+
},
|
|
623
|
+
"maxWaitSeconds": {
|
|
624
|
+
"type": "integer",
|
|
625
|
+
"minimum": 1,
|
|
626
|
+
"maximum": 3600
|
|
627
|
+
},
|
|
628
|
+
"quietPeriodSeconds": {
|
|
629
|
+
"type": "integer",
|
|
630
|
+
"minimum": 1,
|
|
631
|
+
"maximum": 3600
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
"required": [
|
|
635
|
+
"mode",
|
|
636
|
+
"maxSize",
|
|
637
|
+
"maxWaitSeconds"
|
|
638
|
+
],
|
|
639
|
+
"additionalProperties": false
|
|
640
|
+
},
|
|
641
|
+
"JobDeliveryDto": {
|
|
642
|
+
"type": "object",
|
|
643
|
+
"properties": {
|
|
644
|
+
"mode": {
|
|
645
|
+
"enum": [
|
|
646
|
+
"BATCH",
|
|
647
|
+
"DEBOUNCE"
|
|
648
|
+
]
|
|
649
|
+
},
|
|
650
|
+
"maxSize": {
|
|
651
|
+
"type": "integer",
|
|
652
|
+
"minimum": 2,
|
|
653
|
+
"maximum": 1000
|
|
654
|
+
},
|
|
655
|
+
"maxWaitSeconds": {
|
|
656
|
+
"type": "integer",
|
|
657
|
+
"minimum": 1,
|
|
658
|
+
"maximum": 3600
|
|
659
|
+
},
|
|
660
|
+
"quietPeriodSeconds": {
|
|
661
|
+
"type": "integer",
|
|
662
|
+
"minimum": 1,
|
|
663
|
+
"maximum": 3600
|
|
664
|
+
}
|
|
665
|
+
},
|
|
666
|
+
"required": [
|
|
667
|
+
"mode",
|
|
668
|
+
"maxSize",
|
|
669
|
+
"maxWaitSeconds"
|
|
670
|
+
],
|
|
671
|
+
"additionalProperties": false
|
|
672
|
+
},
|
|
577
673
|
"RuntimeExecutionPolicyDto": {
|
|
578
674
|
"type": "object",
|
|
579
675
|
"properties": {
|
|
@@ -993,9 +1089,10 @@ export const requestContractDefaults = {
|
|
|
993
1089
|
}
|
|
994
1090
|
};
|
|
995
1091
|
export const requestContractSemanticSources = {
|
|
996
|
-
"packages/domain/src/utils/backend-metadata.util.ts#assertJsonValue": "
|
|
1092
|
+
"packages/domain/src/utils/backend-metadata.util.ts#assertJsonValue": "e3856d26eb4c43aae24e033691f677f700d6d4f7793dd2be79ce89b8a60ad067",
|
|
997
1093
|
"packages/domain/src/dto/automation/run.options.dto.ts#JobRetryMinBackoffWithinMaxConstraint": "2c8eb4f844ffabfd03f5ae9617a2b0e9e578fa0b9d2a563081648b6688629439",
|
|
998
1094
|
"packages/execution-core/src/modules/@core/services/virtualization.service.ts#normalizeIsolateMemoryLimit": "4cce767b32d7b848cea9502eec5d3df2b7a7dc3e41227eeffda1a6a1e8fc9d96",
|
|
1095
|
+
"packages/domain/src/dto/automation/event-delivery.dto.ts#isValidEventDeliveryWait": "25fd97d39db416f9b3087ed29984f853d587b34d8ec54b7e7ac2378108bbd89f",
|
|
999
1096
|
"packages/domain/src/utils/backend-metadata.util.ts#assertUserMetadataWritable": "ffc70235399e7542c71b58ae4c31ac55d7db29431fc2b3f51c690dba7281a66a",
|
|
1000
1097
|
"packages/platform-shared/src/utils/job-retry-policy.util.ts#normalizeJobRetryPolicy": "facef84884b5b4311af06bfb4469f071ff42a4bca067b6d9092d4f6571e8ee86",
|
|
1001
1098
|
"packages/platform-shared/src/utils/job-retry-policy.util.ts#assertJobRetryPolicyValid": "6511ccafc15233a4ffe4e024f13e6c0e5c9d8a53c261ecc571300495afd804cf",
|
|
@@ -1004,8 +1101,8 @@ export const requestContractSemanticSources = {
|
|
|
1004
1101
|
"apps/api/src/modules/endpoints/endpoint.service.ts#update": "bc59acaffdb7275659bddb65b8d71e9d8266447054723ea87495eaa0dd512fe1",
|
|
1005
1102
|
"apps/api/src/modules/endpoints/endpoint.service.ts#validateEndpointOptions": "64686ee1c1e2611aa00847b771de637797a3007062b95e303046ad2cba69e729",
|
|
1006
1103
|
"apps/api/src/modules/endpoints/endpoint.service.ts#applyEndpointOptionDefaults": "9da1bdfd83a3142b7f44d4ce5ee2aac6cf4ed70bef790f979c412c411fe2790d",
|
|
1007
|
-
"apps/api/src/modules/automation/jobs.service.ts#createJobTemplate": "
|
|
1008
|
-
"apps/api/src/modules/automation/jobs.service.ts#update": "
|
|
1104
|
+
"apps/api/src/modules/automation/jobs.service.ts#createJobTemplate": "59a8433530980f3970c5915f696611f14820c10183b0f917a74912245f1cbd78",
|
|
1105
|
+
"apps/api/src/modules/automation/jobs.service.ts#update": "d8b3ccef6ae812e8bcdcd21cf5184c2afe9ede28055f355f684e13a64b094933",
|
|
1009
1106
|
"packages/platform-shared/src/services/job.scheduler.service.ts#resolveTemplateInputs": "a9a4cc5df4627abf7ee2d2df7f2494d290292a15f4889a5f07a9de104ee33d9f",
|
|
1010
1107
|
"packages/domain/src/dto/components/component-element-key.const.ts#isLowCodeComponentType": "4918470ef562727becb8c97c5afb7761a49734ecd21a6d3d5436576dbd10a6da",
|
|
1011
1108
|
"packages/domain/src/dto/components/component-element-key.const.ts#isDefaultLibraryElement": "4faa356b91be5c44ebe3d442b6da26088d6d35d2db5fb073e1103165431cee48",
|
|
@@ -1021,11 +1118,13 @@ export const requestContractSourceProvenance = {
|
|
|
1021
1118
|
"packages/domain/src/dto/automation/update.api.template.request.dto.ts#UpdateEndpointRequestDto": "20ee0c9afbfa594f189ead2b751aa00b6003efe0b70c5e1158ee78c1e0d29567",
|
|
1022
1119
|
"packages/domain/src/dto/automation/endpoint.template.request.dto.ts#EndpointOptionsDto": "1ade11735627613a81b5cfaa796dfdc49d4c7e0db01ae6467da6a99a9f3af683",
|
|
1023
1120
|
"packages/domain/src/dto/automation/endpoint.sse.dto.ts#EndpointSseDto": "960d56ebb300ded00f61f1318522c010135675e0f32a8084fb3e9b16a1c20ecc",
|
|
1024
|
-
"packages/domain/src/dto/automation/job.template.request.dto.ts#JobTemplateRequestDto": "
|
|
1025
|
-
"packages/domain/src/dto/automation/update.job.template.dto.ts#UpdateJobTemplate": "
|
|
1121
|
+
"packages/domain/src/dto/automation/job.template.request.dto.ts#JobTemplateRequestDto": "fcbcfa8fd7b600dabe25d9d1e36414db1894bff89980a106b2cc7fbc7feb94d8",
|
|
1122
|
+
"packages/domain/src/dto/automation/update.job.template.dto.ts#UpdateJobTemplate": "bb83065b8ae816cc917ec73abc83af6749bc5fdc00e460b889c41cd34443123e",
|
|
1026
1123
|
"packages/domain/src/dto/automation/run.options.dto.ts#JobOptionsDto": "a4ee900b8610f7edbabf8d07738f99b33a288327ea0d66e67c0f8c28260215c8",
|
|
1027
|
-
"packages/domain/src/dto/automation/run.options.dto.ts#ConcurrencyJobDto": "
|
|
1124
|
+
"packages/domain/src/dto/automation/run.options.dto.ts#ConcurrencyJobDto": "8410d5a666f02c0eb09d466f630fe63eb5bcdf77f245e1a8ff1a14894f314966",
|
|
1028
1125
|
"packages/domain/src/dto/automation/run.options.dto.ts#RetryJobDto": "e42fcd447fe111bdf2da20ad42654e536a01d566f33a1d8f52ec1bb0bd1ee8b1",
|
|
1126
|
+
"packages/domain/src/dto/automation/event-delivery.dto.ts#EventDeliveryDto": "0e126b97d338891c74c1e9eaebce5417b2ece210f991dde5dc4ee3b048ba9297",
|
|
1127
|
+
"packages/domain/src/dto/automation/job-delivery.dto.ts#JobDeliveryDto": "3c3cc0e3f03e0bd8853d63265218cd80876aca00b4b0ddcdea368f2a2831d922",
|
|
1029
1128
|
"packages/domain/src/dto/automation/runtime.execution.policy.dto.ts#RuntimeExecutionPolicyDto": "9978ee21a9b7da26c93a4e1516dfc319166a2b55520edee9319d17922b375474",
|
|
1030
1129
|
"packages/domain/src/dto/automation/runtime.execution.policy.dto.ts#RuntimeJobExecutionPolicyDto": "d900a693362a9de02839e2ae959c4e8ac2ac8e0206a4cbe69e889a3636793d23",
|
|
1031
1130
|
"packages/domain/src/dto/components/update.component.dto.ts#UpdateComponentDto": "bac5c210c38eb230ae6ca2b42428956ea1c2065ffc947c40478152098a50e673",
|
package/dist/src/client.d.ts
CHANGED
|
@@ -225,6 +225,7 @@ export type EventMetadataWritePayload = {
|
|
|
225
225
|
metadata: Record<string, unknown>;
|
|
226
226
|
};
|
|
227
227
|
export type EventWritePayload = EventMetadataWritePayload & AutomationRuntimeInputFields & {
|
|
228
|
+
delivery?: null;
|
|
228
229
|
custom?: boolean;
|
|
229
230
|
name?: string;
|
|
230
231
|
category?: string | null;
|
|
@@ -273,6 +274,7 @@ export type ScheduleCreatePayload = AutomationRuntimeInputFields & {
|
|
|
273
274
|
targetConfig?: Record<string, unknown> | null;
|
|
274
275
|
};
|
|
275
276
|
export type JobTemplateUpdatePayload = {
|
|
277
|
+
delivery?: import('./types.ts').JobDelivery | null;
|
|
276
278
|
executionPolicy?: RuntimeExecutionPolicy;
|
|
277
279
|
triggerUser?: string | null;
|
|
278
280
|
version: number;
|
|
@@ -288,6 +290,7 @@ export type JobTemplateUpdatePayload = {
|
|
|
288
290
|
inputs?: unknown;
|
|
289
291
|
};
|
|
290
292
|
export type JobTemplateCreatePayload = {
|
|
293
|
+
delivery?: import('./types.ts').JobDelivery | null;
|
|
291
294
|
executionPolicy?: RuntimeExecutionPolicy;
|
|
292
295
|
triggerUser?: string | null;
|
|
293
296
|
name: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AutomationRuntimeInputFields } from '../types.ts';
|
|
2
2
|
export declare const AUTOMATION_INPUT_FIELDS: Set<string>;
|
|
3
|
-
/** Old Event
|
|
3
|
+
/** Old Event exports placed input under extensions. The retired inputMode never enters a write. */
|
|
4
4
|
export declare function readAutomationInput(value: Record<string, unknown>, legacyExtensions?: boolean): Required<AutomationRuntimeInputFields>;
|
|
5
5
|
export declare function automationInputError(value: Record<string, unknown>, legacyExtensions?: boolean): string | undefined;
|
|
6
|
-
/**
|
|
6
|
+
/** Empty inputs retain the historical portable hash. */
|
|
7
7
|
export declare function automationInputHashFields(value: Record<string, unknown>, legacyExtensions?: boolean): AutomationRuntimeInputFields;
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
import { isRecord } from "./util.js";
|
|
2
2
|
export const AUTOMATION_INPUT_FIELDS = new Set(['input', 'inputMode']);
|
|
3
|
-
|
|
4
|
-
/** Old Event pulls placed these known REST fields under extensions. */
|
|
3
|
+
/** Old Event exports placed input under extensions. The retired inputMode never enters a write. */
|
|
5
4
|
export function readAutomationInput(value, legacyExtensions = false) {
|
|
6
5
|
const extensions = legacyExtensions && isRecord(value.extensions) ? value.extensions : {};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
throw new Error(`Automation "${field}" is defined both at the top level and in extensions.`);
|
|
10
|
-
}
|
|
6
|
+
if (value.input !== undefined && extensions.input !== undefined) {
|
|
7
|
+
throw new Error('Automation "input" is defined both at the top level and in extensions.');
|
|
11
8
|
}
|
|
12
9
|
const input = value.input === undefined ? extensions.input : value.input;
|
|
13
|
-
const inputMode = value.inputMode === undefined ? extensions.inputMode : value.inputMode;
|
|
14
10
|
if (input !== undefined && (!isRecord(input) || ![Object.prototype, null].includes(Object.getPrototypeOf(input)))) {
|
|
15
11
|
throw new Error('Automation "input" must be a JSON object.');
|
|
16
12
|
}
|
|
17
|
-
|
|
18
|
-
throw new Error('Automation "inputMode" must be override, deep_override or replace.');
|
|
19
|
-
}
|
|
20
|
-
return { input: input === undefined ? {} : input, inputMode: (inputMode ?? 'override') };
|
|
13
|
+
return { input: input === undefined ? {} : input };
|
|
21
14
|
}
|
|
22
15
|
export function automationInputError(value, legacyExtensions = false) {
|
|
23
16
|
try {
|
|
@@ -28,11 +21,8 @@ export function automationInputError(value, legacyExtensions = false) {
|
|
|
28
21
|
return error.message;
|
|
29
22
|
}
|
|
30
23
|
}
|
|
31
|
-
/**
|
|
24
|
+
/** Empty inputs retain the historical portable hash. */
|
|
32
25
|
export function automationInputHashFields(value, legacyExtensions = false) {
|
|
33
|
-
const { input
|
|
34
|
-
return {
|
|
35
|
-
...(Object.keys(input).length === 0 ? {} : { input }),
|
|
36
|
-
...(inputMode === 'override' ? {} : { inputMode }),
|
|
37
|
-
};
|
|
26
|
+
const { input } = readAutomationInput(value, legacyExtensions);
|
|
27
|
+
return Object.keys(input).length === 0 ? {} : { input };
|
|
38
28
|
}
|
|
@@ -10,7 +10,7 @@ export const EVENTS_DIRECTORY = 'Events';
|
|
|
10
10
|
export const EVENT_MANIFEST_FILE = 'event.json';
|
|
11
11
|
const EVENT_TRANSPORT_FIELDS = new Set([
|
|
12
12
|
'jobEventId', 'eventId', 'id', 'name', 'category', 'desc', 'description', 'active', 'type',
|
|
13
|
-
'targetType', 'targetId', 'targetVersion', 'targetConfig', 'filter', 'version', 'metadata',
|
|
13
|
+
'targetType', 'targetId', 'targetVersion', 'targetConfig', 'filter', 'delivery', 'version', 'metadata',
|
|
14
14
|
'metaData', 'resourceMetadata', 'topic', 'custom', 'input', 'inputMode', 'deletedAt', 'deletedBy', 'createdAt', 'createdBy',
|
|
15
15
|
'lastUpdateAt', 'lastUpdateBy', 'updatedAt', 'updatedBy', 'history', 'jobEventHistory',
|
|
16
16
|
]);
|
|
@@ -84,6 +84,10 @@ function readWorkspaceEvents(cwd) {
|
|
|
84
84
|
function nonEmptyString(value) {
|
|
85
85
|
return typeof value === 'string' && value.trim().length > 0;
|
|
86
86
|
}
|
|
87
|
+
const RETIRED_EVENT_DELIVERY = 'Event.delivery is retired in Platform 1.9.0. Configure delivery on the target Job Template, then remove Event.delivery (or set it to null); do not copy the former Event keyPath';
|
|
88
|
+
function validEventDelivery(value) {
|
|
89
|
+
return value === null || value === undefined;
|
|
90
|
+
}
|
|
87
91
|
function validManifest(value, stableKeyName) {
|
|
88
92
|
if (!isRecord(value) || value.kind !== 'event' || !nonEmptyString(value.stableKey) || !nonEmptyString(value.name)
|
|
89
93
|
|| !nonEmptyString(value.type) || typeof value.custom !== 'boolean' || !isRecord(value.metadata) || !isRecord(value.target)) {
|
|
@@ -107,7 +111,7 @@ function validManifest(value, stableKeyName) {
|
|
|
107
111
|
if (value.extensions !== undefined && Object.keys(value.extensions).some((field) => !AUTOMATION_INPUT_FIELDS.has(field))) {
|
|
108
112
|
return false;
|
|
109
113
|
}
|
|
110
|
-
if (automationInputError(value, true)) {
|
|
114
|
+
if (automationInputError(value, true) || !validEventDelivery(value.delivery)) {
|
|
111
115
|
return false;
|
|
112
116
|
}
|
|
113
117
|
return readConfiguredResourceMetadataStableKey(value, stableKeyName) === value.stableKey;
|
|
@@ -118,6 +122,9 @@ function manifestFromRecord(input) {
|
|
|
118
122
|
throw new Error(`Event "${stableKey}" is missing the custom classifier in the API response.`);
|
|
119
123
|
}
|
|
120
124
|
const extensions = extensionFields(record);
|
|
125
|
+
if (!validEventDelivery(record.delivery)) {
|
|
126
|
+
throw new Error(`Event "${stableKey}": ${RETIRED_EVENT_DELIVERY}.`);
|
|
127
|
+
}
|
|
121
128
|
return {
|
|
122
129
|
kind: 'event',
|
|
123
130
|
stableKey,
|
|
@@ -155,15 +162,18 @@ export function hashEventContent(manifest) {
|
|
|
155
162
|
}
|
|
156
163
|
/** Recognize an old lock representation without discarding any live non-default input. */
|
|
157
164
|
function legacyEventBaselineHash(manifest, layout) {
|
|
165
|
+
if (manifest.delivery)
|
|
166
|
+
return undefined;
|
|
158
167
|
const fields = Object.keys(layout.extensions || {}).filter(field => AUTOMATION_INPUT_FIELDS.has(field));
|
|
159
168
|
if (fields.length === 0)
|
|
160
169
|
return undefined;
|
|
161
170
|
const input = readAutomationInput(manifest, true);
|
|
162
171
|
if (Object.keys(automationInputHashFields(manifest, true)).some(field => !fields.includes(field)))
|
|
163
172
|
return undefined;
|
|
173
|
+
const legacyMode = manifest.inputMode ?? manifest.extensions?.inputMode ?? layout.extensions?.inputMode ?? 'override';
|
|
164
174
|
const extensions = {
|
|
165
175
|
...unsupportedEventExtensions(manifest),
|
|
166
|
-
...Object.fromEntries(fields.map(field => [field, input
|
|
176
|
+
...Object.fromEntries(fields.map(field => [field, field === 'input' ? input.input : legacyMode])),
|
|
167
177
|
};
|
|
168
178
|
return hashStable({ content: hashStable(eventHashShape(manifest, extensions)), active: manifest.active });
|
|
169
179
|
}
|
|
@@ -236,7 +246,6 @@ function diffEvents(desired, current) {
|
|
|
236
246
|
['filter', desired.filter ?? null, current.filter ?? null],
|
|
237
247
|
['target.jobTemplateStableKey', desired.target.jobTemplateStableKey, current.target.jobTemplateStableKey],
|
|
238
248
|
['input', desiredInput.input, currentInput.input],
|
|
239
|
-
['inputMode', desiredInput.inputMode, currentInput.inputMode],
|
|
240
249
|
['extensions', unsupportedEventExtensions(desired), unsupportedEventExtensions(current)],
|
|
241
250
|
];
|
|
242
251
|
return fields
|
|
@@ -299,10 +308,11 @@ export async function buildEventsPlan(input) {
|
|
|
299
308
|
const inputError = isRecord(manifest) ? automationInputError(manifest, true) : undefined;
|
|
300
309
|
const reason = unsupportedExtensions.length > 0
|
|
301
310
|
? `unsupported extension fields: ${unsupportedExtensions.join(', ')}`
|
|
302
|
-
:
|
|
303
|
-
:
|
|
304
|
-
|
|
305
|
-
|
|
311
|
+
: isRecord(manifest) && !validEventDelivery(manifest.delivery) ? RETIRED_EVENT_DELIVERY
|
|
312
|
+
: inputError ? inputError
|
|
313
|
+
: isRecord(manifest) && manifest.custom === undefined
|
|
314
|
+
? 'missing custom classifier; re-pull the Event from its source or add custom: true/false explicitly'
|
|
315
|
+
: 'invalid manifest';
|
|
306
316
|
blockers.push(`Invalid Event manifest ${path.relative(projectRoot, entry.manifestPath)}: ${reason}.`);
|
|
307
317
|
items.push({ status: 'conflict', name: isRecord(manifest) && nonEmptyString(manifest.name) ? manifest.name : path.basename(entry.manifestPath), reason, blocked: true });
|
|
308
318
|
continue;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type PortableExecutionPolicy, type ExecutionPrincipal } from './account-principal.ts';
|
|
2
2
|
import { type FieldChange } from '../diff-details.ts';
|
|
3
3
|
import type { RevoClient } from '../client.ts';
|
|
4
|
+
import type { JobDelivery } from '../types.ts';
|
|
4
5
|
export declare const JOB_TEMPLATES_DIRECTORY = "JobTemplates";
|
|
5
6
|
export declare const JOB_TEMPLATE_MANIFEST_FILE = "job-template.json";
|
|
6
7
|
export type JobTemplateManifest = {
|
|
8
|
+
delivery?: JobDelivery | null;
|
|
7
9
|
kind: 'job-template';
|
|
8
10
|
stableKey: string;
|
|
9
11
|
name: string;
|
|
@@ -95,7 +95,7 @@ async function loadRemoteComponents(client, cwd) {
|
|
|
95
95
|
const JOB_TEMPLATE_MANIFEST_FIELDS = new Set([
|
|
96
96
|
'executionPrincipal', 'executionPolicy',
|
|
97
97
|
'kind', 'stableKey', 'name', 'category', 'description', 'metadata', 'component',
|
|
98
|
-
'timeout', 'options', 'inputs', 'migration',
|
|
98
|
+
'timeout', 'options', 'inputs', 'delivery', 'migration',
|
|
99
99
|
]);
|
|
100
100
|
const JOB_TEMPLATE_MIGRATION_FIELDS = new Set(['componentBinding', 'executionPrincipal']);
|
|
101
101
|
function hasOnlyKeys(value, allowed) {
|
|
@@ -184,6 +184,7 @@ function manifestFromRecord(record, stableKey, componentKey, stableKeyName) {
|
|
|
184
184
|
...(typeof record.timeout === 'number' ? { timeout: record.timeout } : {}),
|
|
185
185
|
...(record.options === undefined ? {} : { options: canonicalValue(record.options) }),
|
|
186
186
|
...(record.inputs === undefined ? {} : { inputs: canonicalValue(record.inputs) }),
|
|
187
|
+
...(record.delivery == null ? {} : { delivery: canonicalValue(record.delivery) }),
|
|
187
188
|
};
|
|
188
189
|
const errors = jobTemplateDefinitionErrors(manifest);
|
|
189
190
|
if (errors.length > 0)
|
|
@@ -229,6 +230,7 @@ function buildCreatePayload(manifest, componentId) {
|
|
|
229
230
|
...(manifest.timeout === undefined ? {} : { timeout: manifest.timeout }),
|
|
230
231
|
...(options === undefined ? {} : { options }),
|
|
231
232
|
...(manifest.inputs === undefined ? {} : { inputs: canonicalValue(manifest.inputs) }),
|
|
233
|
+
...(manifest.delivery == null ? {} : { delivery: canonicalValue(manifest.delivery) }),
|
|
232
234
|
};
|
|
233
235
|
}
|
|
234
236
|
function buildUpdatePayload(manifest, componentId, version) {
|
|
@@ -243,6 +245,7 @@ function buildUpdatePayload(manifest, componentId, version) {
|
|
|
243
245
|
...(manifest.timeout === undefined ? {} : { timeout: manifest.timeout }),
|
|
244
246
|
options: isRecord(manifest.options) ? canonicalValue(manifest.options) : {},
|
|
245
247
|
...(manifest.inputs === undefined ? {} : { inputs: canonicalValue(manifest.inputs) }),
|
|
248
|
+
delivery: manifest.delivery ?? null,
|
|
246
249
|
version,
|
|
247
250
|
};
|
|
248
251
|
}
|
|
@@ -306,6 +309,7 @@ function jobTemplateDefinitionShape(manifest, normalizeDefaults) {
|
|
|
306
309
|
: manifest.timeout === undefined ? {} : { timeout: manifest.timeout }),
|
|
307
310
|
...(options === undefined ? {} : { options }),
|
|
308
311
|
...(inputs === undefined ? {} : { inputs }),
|
|
312
|
+
...(manifest.delivery == null ? {} : { delivery: canonicalValue(manifest.delivery) }),
|
|
309
313
|
};
|
|
310
314
|
}
|
|
311
315
|
function diffJobTemplates(desired, target) {
|
|
@@ -319,6 +323,7 @@ function diffJobTemplates(desired, target) {
|
|
|
319
323
|
['component.pinnedDigest', desired.component.pinnedDigest, target.component.pinnedDigest],
|
|
320
324
|
...(desired.executionPrincipal ? [['executionPrincipal', desired.executionPrincipal, target.executionPrincipal]] : []),
|
|
321
325
|
...(desired.executionPolicy ? [['executionPolicy', desired.executionPolicy, target.executionPolicy]] : []),
|
|
326
|
+
['delivery', desired.delivery ?? null, target.delivery ?? null],
|
|
322
327
|
['timeout', desired.timeout ?? requestContractDefaults.job.timeout, target.timeout ?? requestContractDefaults.job.timeout],
|
|
323
328
|
[
|
|
324
329
|
'options',
|
|
@@ -40,7 +40,7 @@ export function canonicalJobRuntimeOptionDefaults(value) {
|
|
|
40
40
|
delete normalized.concurrency;
|
|
41
41
|
if (isRecord(normalized.concurrency)) {
|
|
42
42
|
const concurrency = { ...normalized.concurrency };
|
|
43
|
-
for (const key of ['key', 'limit', 'ttl'])
|
|
43
|
+
for (const key of ['key', 'keyPath', 'limit', 'ttl'])
|
|
44
44
|
if (concurrency[key] === null || concurrency[key] === '')
|
|
45
45
|
delete concurrency[key];
|
|
46
46
|
if (Object.keys(concurrency).length === 0)
|
|
@@ -135,8 +135,16 @@ export function endpointDefinitionErrors(manifest) {
|
|
|
135
135
|
}
|
|
136
136
|
/** The runtime normalizes nullable option containers, then validates effective retry backoff. */
|
|
137
137
|
export function jobTemplateDefinitionErrors(manifest) {
|
|
138
|
-
const body = { ...requestFields(manifest), ...(manifest.description === undefined ? {} : { desc: manifest.description }) };
|
|
138
|
+
const body = { ...requestFields(manifest), ...(manifest.delivery === undefined ? {} : { delivery: manifest.delivery }), ...(manifest.description === undefined ? {} : { desc: manifest.description }) };
|
|
139
139
|
const errors = validateRequestContract('JobTemplateRequestDto', body, { partial: true, path: 'JobTemplate' });
|
|
140
|
+
if (isRecord(manifest.delivery)) {
|
|
141
|
+
const delivery = manifest.delivery;
|
|
142
|
+
if (delivery.mode === 'BATCH' && delivery.quietPeriodSeconds !== undefined)
|
|
143
|
+
errors.push('JobTemplate.delivery.quietPeriodSeconds is only supported for DEBOUNCE');
|
|
144
|
+
if (delivery.mode === 'DEBOUNCE' && (typeof delivery.quietPeriodSeconds !== 'number' || delivery.quietPeriodSeconds > Number(delivery.maxWaitSeconds))) {
|
|
145
|
+
errors.push('JobTemplate.delivery.quietPeriodSeconds is required for DEBOUNCE and must not exceed maxWaitSeconds');
|
|
146
|
+
}
|
|
147
|
+
}
|
|
140
148
|
const options = isRecord(manifest.options) ? manifest.options : {};
|
|
141
149
|
if (isRecord(options.retry)) {
|
|
142
150
|
const effective = { ...requestContractDefaults.retry, ...options.retry };
|
|
@@ -321,7 +321,6 @@ function diffSchedules(desired, target) {
|
|
|
321
321
|
['cron', desired.cron, target.cron],
|
|
322
322
|
['timezone', desired.timezone, target.timezone],
|
|
323
323
|
['input', desiredInput.input, targetInput.input],
|
|
324
|
-
['inputMode', desiredInput.inputMode, targetInput.inputMode],
|
|
325
324
|
['target', canonicalValue(desired.target), canonicalValue(target.target)],
|
|
326
325
|
];
|
|
327
326
|
return fields
|
package/dist/src/sync-omit.js
CHANGED
|
@@ -70,7 +70,7 @@ const ordinaryRoots = {
|
|
|
70
70
|
'service-account': ['name'],
|
|
71
71
|
'agent-plugin': ['name'],
|
|
72
72
|
agent: ['name'],
|
|
73
|
-
'job-template': ['name', 'category', 'description', 'timeout', 'inputs'],
|
|
73
|
+
'job-template': ['name', 'category', 'description', 'timeout', 'inputs', 'delivery'],
|
|
74
74
|
endpoint: ['name', 'category', 'description', 'active', 'timeout'],
|
|
75
75
|
schedule: ['name', 'category', 'description', 'cron', 'timezone', 'input', 'inputMode'],
|
|
76
76
|
event: ['name', 'category', 'description', 'filter', 'input', 'inputMode', 'extensions'],
|
|
@@ -96,6 +96,8 @@ function allowedPath(family, parts, stableKeyName = 'stableKey') {
|
|
|
96
96
|
&& !(second === 'details' && (parts.length === 2 || third === stableKeyName || third === 'stableKey'));
|
|
97
97
|
if (family === 'event' && root === 'extensions' && second === 'inputMode' && parts.length > 2)
|
|
98
98
|
return false;
|
|
99
|
+
if (family === 'job-template' && root === 'delivery')
|
|
100
|
+
return parts.length === 1 || schemaAllows(requestContracts.JobDeliveryDto, parts.slice(1));
|
|
99
101
|
if (root === 'options' && runtimeOptionRoots[family]) {
|
|
100
102
|
if (parts.length === 1)
|
|
101
103
|
return true;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -254,6 +254,7 @@ export type GroupRecord = {
|
|
|
254
254
|
[key: string]: unknown;
|
|
255
255
|
};
|
|
256
256
|
export type JobTemplateRecord = {
|
|
257
|
+
delivery?: JobDelivery | null;
|
|
257
258
|
executionPolicy?: RuntimeExecutionPolicy | null;
|
|
258
259
|
jobTemplateId?: string;
|
|
259
260
|
id?: string;
|
|
@@ -277,11 +278,19 @@ export type JobTemplateRecord = {
|
|
|
277
278
|
deletedAt?: string | null;
|
|
278
279
|
[key: string]: unknown;
|
|
279
280
|
};
|
|
280
|
-
export type AutomationInputMode = 'override' | 'deep_override' | 'replace';
|
|
281
281
|
export type AutomationRuntimeInputFields = {
|
|
282
282
|
input?: Record<string, unknown>;
|
|
283
|
-
inputMode?: AutomationInputMode;
|
|
284
283
|
};
|
|
284
|
+
export type JobDelivery = {
|
|
285
|
+
maxSize: number;
|
|
286
|
+
maxWaitSeconds: number;
|
|
287
|
+
} & ({
|
|
288
|
+
mode: 'BATCH';
|
|
289
|
+
quietPeriodSeconds?: never;
|
|
290
|
+
} | {
|
|
291
|
+
mode: 'DEBOUNCE';
|
|
292
|
+
quietPeriodSeconds: number;
|
|
293
|
+
});
|
|
285
294
|
export type ScheduleRecord = AutomationRuntimeInputFields & {
|
|
286
295
|
scheduleId?: string;
|
|
287
296
|
id?: string;
|
|
@@ -306,6 +315,7 @@ export type ScheduleRecord = AutomationRuntimeInputFields & {
|
|
|
306
315
|
[key: string]: unknown;
|
|
307
316
|
};
|
|
308
317
|
export type EventRecord = AutomationRuntimeInputFields & {
|
|
318
|
+
delivery?: unknown;
|
|
309
319
|
jobEventId?: string;
|
|
310
320
|
eventId?: string;
|
|
311
321
|
id?: string;
|