@epilot/cli 0.1.127 → 0.1.128
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/README.md +1 -1
- package/definitions/integration-toolkit.json +942 -45
- package/dist/bin/epilot.js +6 -6
- package/dist/{chunk-LU2DXHM7.js → chunk-DVATEMSL.js} +3 -1
- package/dist/{completion-MLZIPM5I.js → completion-QZPBFCMA.js} +1 -1
- package/dist/{upgrade-D4YUJRJS.js → upgrade-XUKKPWDE.js} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.0.3",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Integration Toolkit API",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.21.0",
|
|
6
6
|
"description": "API for integrating with external systems in a standardised way."
|
|
7
7
|
},
|
|
8
8
|
"tags": [
|
|
@@ -619,6 +619,167 @@
|
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
621
|
},
|
|
622
|
+
"/v1/erp/updates/direct_simulation": {
|
|
623
|
+
"post": {
|
|
624
|
+
"operationId": "simulateDirect",
|
|
625
|
+
"summary": "simulateDirect",
|
|
626
|
+
"description": "Dry run for direct-mode payloads: validates a `DirectPayload` against a `direct: true`\nuse case configuration and previews the internal entity and meter reading updates the\npipeline would apply — without persisting anything.\n\nUnlike the ingest endpoint, validation does not stop at the first problem: ALL issues\nacross all operations are collected into `errors`, each carrying the index of the\noperation it refers to. When the payload is valid, the response additionally contains\nthe translated update previews plus non-blocking `warnings` (for example unique-id\nfields that are not defined in the target entity schema, or a failed server-side\nunique-id type derivation).\n\nUse this endpoint while designing a direct integration, before sending events to\n`POST /v3/erp/updates/events`. See documentation at /docs/DIRECT_MODE.md.\n",
|
|
627
|
+
"tags": [
|
|
628
|
+
"erp"
|
|
629
|
+
],
|
|
630
|
+
"requestBody": {
|
|
631
|
+
"required": true,
|
|
632
|
+
"content": {
|
|
633
|
+
"application/json": {
|
|
634
|
+
"schema": {
|
|
635
|
+
"$ref": "#/components/schemas/DirectSimulationRequest"
|
|
636
|
+
},
|
|
637
|
+
"examples": {
|
|
638
|
+
"entity_upsert": {
|
|
639
|
+
"summary": "Entity upsert (open mode)",
|
|
640
|
+
"value": {
|
|
641
|
+
"event_configuration": {
|
|
642
|
+
"direct": true
|
|
643
|
+
},
|
|
644
|
+
"payload": {
|
|
645
|
+
"version": "1",
|
|
646
|
+
"operations": [
|
|
647
|
+
{
|
|
648
|
+
"entity_slug": "contact",
|
|
649
|
+
"unique_ids": {
|
|
650
|
+
"customer_number": "CUST-12345"
|
|
651
|
+
},
|
|
652
|
+
"attributes": {
|
|
653
|
+
"first_name": "Anna",
|
|
654
|
+
"last_name": "Schmidt",
|
|
655
|
+
"email": "anna.schmidt@example.com"
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
]
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
},
|
|
662
|
+
"allowlist_with_relation": {
|
|
663
|
+
"summary": "Allowlisted entities with a relation",
|
|
664
|
+
"value": {
|
|
665
|
+
"event_configuration": {
|
|
666
|
+
"direct": true,
|
|
667
|
+
"entities": [
|
|
668
|
+
{
|
|
669
|
+
"entity_schema": "contract",
|
|
670
|
+
"unique_ids": [
|
|
671
|
+
"contract_number"
|
|
672
|
+
]
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
"entity_schema": "contact",
|
|
676
|
+
"unique_ids": [
|
|
677
|
+
"customer_number"
|
|
678
|
+
]
|
|
679
|
+
}
|
|
680
|
+
]
|
|
681
|
+
},
|
|
682
|
+
"payload": {
|
|
683
|
+
"version": "1",
|
|
684
|
+
"operations": [
|
|
685
|
+
{
|
|
686
|
+
"entity_slug": "contract",
|
|
687
|
+
"unique_ids": {
|
|
688
|
+
"contract_number": "CTR-001"
|
|
689
|
+
},
|
|
690
|
+
"attributes": {
|
|
691
|
+
"display_name": "Premium Contract",
|
|
692
|
+
"customer": {
|
|
693
|
+
"$relation": {
|
|
694
|
+
"_set": [
|
|
695
|
+
{
|
|
696
|
+
"schema": "contact",
|
|
697
|
+
"unique_ids": {
|
|
698
|
+
"customer_number": "CUST-12345"
|
|
699
|
+
},
|
|
700
|
+
"tags": [
|
|
701
|
+
"primary"
|
|
702
|
+
]
|
|
703
|
+
}
|
|
704
|
+
]
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
]
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
},
|
|
713
|
+
"meter_reading": {
|
|
714
|
+
"summary": "Meter reading",
|
|
715
|
+
"value": {
|
|
716
|
+
"event_configuration": {
|
|
717
|
+
"direct": true
|
|
718
|
+
},
|
|
719
|
+
"payload": {
|
|
720
|
+
"version": "1",
|
|
721
|
+
"operations": [
|
|
722
|
+
{
|
|
723
|
+
"type": "meter_reading",
|
|
724
|
+
"meter": {
|
|
725
|
+
"unique_ids": {
|
|
726
|
+
"meter_number": "M-001"
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
"counter": {
|
|
730
|
+
"unique_ids": {
|
|
731
|
+
"obis_number": "1-0:1.8.0"
|
|
732
|
+
}
|
|
733
|
+
},
|
|
734
|
+
"reading_matching": "strict-date",
|
|
735
|
+
"attributes": {
|
|
736
|
+
"external_id": "R-001",
|
|
737
|
+
"timestamp": "2026-08-24T06:00:00Z",
|
|
738
|
+
"source": "ERP",
|
|
739
|
+
"value": 12345.6
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
]
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
"responses": {
|
|
751
|
+
"200": {
|
|
752
|
+
"description": "Simulation executed - `valid` reports the verdict, `errors` lists every violation",
|
|
753
|
+
"content": {
|
|
754
|
+
"application/json": {
|
|
755
|
+
"schema": {
|
|
756
|
+
"$ref": "#/components/schemas/DirectSimulationResponse"
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
},
|
|
761
|
+
"400": {
|
|
762
|
+
"$ref": "#/components/responses/BadRequest"
|
|
763
|
+
},
|
|
764
|
+
"401": {
|
|
765
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
766
|
+
},
|
|
767
|
+
"422": {
|
|
768
|
+
"description": "Unprocessable entity - simulation could not be executed",
|
|
769
|
+
"content": {
|
|
770
|
+
"application/json": {
|
|
771
|
+
"schema": {
|
|
772
|
+
"$ref": "#/components/schemas/ErrorResponseBase"
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
},
|
|
777
|
+
"500": {
|
|
778
|
+
"$ref": "#/components/responses/InternalServerError"
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
},
|
|
622
783
|
"/v1/erp/updates/mapping_simulation": {
|
|
623
784
|
"post": {
|
|
624
785
|
"operationId": "simulateMapping",
|
|
@@ -2844,6 +3005,59 @@
|
|
|
2844
3005
|
}
|
|
2845
3006
|
}
|
|
2846
3007
|
},
|
|
3008
|
+
"/v1/entities/{entityId}/sync-status": {
|
|
3009
|
+
"get": {
|
|
3010
|
+
"operationId": "getEntitySyncStatus",
|
|
3011
|
+
"summary": "getEntitySyncStatus",
|
|
3012
|
+
"description": "Get the inbound ERP sync status of an entity: when each integration last\nsynchronized (checked) the entity against the ERP, and when it last\nactually changed it. `last_synced_at` also advances on no-op checks —\nevents that were received and evaluated but changed nothing — which by\ndesign leave no trace on the entity itself (no activity feed entry, no\n`_updated_at` bump). Use it to tell whether an entity is up to date with\nthe ERP. Returns an empty list for entities no inbound use case has\nprocessed. Org-scoped via the caller's token.\n",
|
|
3013
|
+
"tags": [
|
|
3014
|
+
"integrations"
|
|
3015
|
+
],
|
|
3016
|
+
"parameters": [
|
|
3017
|
+
{
|
|
3018
|
+
"name": "entityId",
|
|
3019
|
+
"in": "path",
|
|
3020
|
+
"required": true,
|
|
3021
|
+
"description": "The entity ID",
|
|
3022
|
+
"schema": {
|
|
3023
|
+
"type": "string",
|
|
3024
|
+
"format": "uuid"
|
|
3025
|
+
}
|
|
3026
|
+
},
|
|
3027
|
+
{
|
|
3028
|
+
"name": "integration_id",
|
|
3029
|
+
"in": "query",
|
|
3030
|
+
"required": false,
|
|
3031
|
+
"description": "Narrow the result to a single integration",
|
|
3032
|
+
"schema": {
|
|
3033
|
+
"type": "string",
|
|
3034
|
+
"format": "uuid"
|
|
3035
|
+
}
|
|
3036
|
+
}
|
|
3037
|
+
],
|
|
3038
|
+
"responses": {
|
|
3039
|
+
"200": {
|
|
3040
|
+
"description": "Successfully retrieved entity sync status",
|
|
3041
|
+
"content": {
|
|
3042
|
+
"application/json": {
|
|
3043
|
+
"schema": {
|
|
3044
|
+
"$ref": "#/components/schemas/EntitySyncStatusResponse"
|
|
3045
|
+
}
|
|
3046
|
+
}
|
|
3047
|
+
}
|
|
3048
|
+
},
|
|
3049
|
+
"400": {
|
|
3050
|
+
"$ref": "#/components/responses/BadRequest"
|
|
3051
|
+
},
|
|
3052
|
+
"401": {
|
|
3053
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
3054
|
+
},
|
|
3055
|
+
"500": {
|
|
3056
|
+
"$ref": "#/components/responses/InternalServerError"
|
|
3057
|
+
}
|
|
3058
|
+
}
|
|
3059
|
+
}
|
|
3060
|
+
},
|
|
2847
3061
|
"/v1/integrations/{integrationId}/outbound/messages/poll": {
|
|
2848
3062
|
"post": {
|
|
2849
3063
|
"operationId": "pollOutboundMessages",
|
|
@@ -5262,7 +5476,7 @@
|
|
|
5262
5476
|
"additionalProperties": true
|
|
5263
5477
|
}
|
|
5264
5478
|
],
|
|
5265
|
-
"description": "The object data payload - can be either a serialized string or a direct JSON object",
|
|
5479
|
+
"description": "The object data payload - can be either a serialized string or a direct JSON object.\n\nFor events routed to a mapped (default) use case this is the raw ERP object; the use\ncase's mapping configuration transforms it into entity updates.\n\nFor events routed to a use case whose configuration has `direct: true`, the payload\nMUST be a `DirectPayload` (as an object, or a JSON string): a versioned envelope of\npre-mapped entity and meter reading operations that skip the mapping engine entirely.\nDirect use cases accept JSON only - `format: \"xml\"` events are rejected.\n",
|
|
5266
5480
|
"example": "{\"id\":\"BP10001\",\"name\":\"Acme Corporation\",\"type\":\"organization\",\"tax_id\":\"DE123456789\",\"status\":\"active\"}"
|
|
5267
5481
|
},
|
|
5268
5482
|
"use_case_slug": {
|
|
@@ -6064,6 +6278,10 @@
|
|
|
6064
6278
|
"type": "object",
|
|
6065
6279
|
"description": "Configuration for inbound use cases (ERP to epilot)",
|
|
6066
6280
|
"properties": {
|
|
6281
|
+
"direct": {
|
|
6282
|
+
"type": "boolean",
|
|
6283
|
+
"description": "Enables direct mode for this use case. When `true`, every event routed to this use\ncase must carry a `DirectPayload` - pre-mapped entity and meter reading operations -\ninstead of raw ERP data, and the mapping engine is skipped entirely. Everything else\nin the inbound pipeline (deduplication, ordering, create-vs-update resolution,\nrelation resolution, monitoring) behaves exactly as in mapped mode.\n\nIn direct mode, `entities` doubles as an optional allowlist: when non-empty, each\noperation's `entity_slug` must match an entry's `entity_schema`, and when that entry\ndeclares `unique_ids`, the operation's unique-id keys must be exactly that set (or\njust `_id`). Entries need only `entity_schema` and `unique_ids` - `fields` is not\nrequired and is ignored. `meter_readings` is ignored in direct mode.\n\nFlag changes take up to 5 minutes to propagate (configuration cache).\n"
|
|
6284
|
+
},
|
|
6067
6285
|
"entities": {
|
|
6068
6286
|
"type": "array",
|
|
6069
6287
|
"description": "Array of entity configurations for this event",
|
|
@@ -6121,8 +6339,7 @@
|
|
|
6121
6339
|
"type": "object",
|
|
6122
6340
|
"required": [
|
|
6123
6341
|
"entity_schema",
|
|
6124
|
-
"unique_ids"
|
|
6125
|
-
"fields"
|
|
6342
|
+
"unique_ids"
|
|
6126
6343
|
],
|
|
6127
6344
|
"properties": {
|
|
6128
6345
|
"entity_schema": {
|
|
@@ -6168,7 +6385,7 @@
|
|
|
6168
6385
|
},
|
|
6169
6386
|
"fields": {
|
|
6170
6387
|
"type": "array",
|
|
6171
|
-
"description": "Field mapping definitions",
|
|
6388
|
+
"description": "Field mapping definitions. Required for mapped-mode entity configurations; may be\nomitted for allowlist entries of a `direct: true` use case, where no mapping runs.\n",
|
|
6172
6389
|
"items": {
|
|
6173
6390
|
"$ref": "#/components/schemas/IntegrationEntityField"
|
|
6174
6391
|
}
|
|
@@ -8661,52 +8878,90 @@
|
|
|
8661
8878
|
}
|
|
8662
8879
|
}
|
|
8663
8880
|
},
|
|
8664
|
-
"
|
|
8881
|
+
"DirectPayload": {
|
|
8665
8882
|
"type": "object",
|
|
8883
|
+
"description": "The payload of an ERP event routed to a `direct: true` use case: a versioned envelope of\npre-mapped operations that skip the mapping engine. Sent as the `payload` of an\n`ErpEventV3` - either as a JSON object or as a JSON string (`format` must be `json`;\nXML is rejected for direct use cases).\n\nThe schema is strict: unknown keys on the envelope or on any operation are rejected with\nan error naming the offending path. Attribute values, by contrast, pass through to the\nentity verbatim (except `$relation` / `$relation_ref` envelopes, which are validated and\nresolved).\n\nOne event lands as one queue message, so the whole event (including this payload) must\nstay within the 256 KiB message budget. Identical consecutive payloads within 5 minutes\ncan be deduplicated by the queue - use the event's `deduplication_id` deliberately when\nre-sending identical data.\n",
|
|
8666
8884
|
"required": [
|
|
8667
|
-
"
|
|
8668
|
-
"
|
|
8669
|
-
"attributes",
|
|
8670
|
-
"mode"
|
|
8885
|
+
"version",
|
|
8886
|
+
"operations"
|
|
8671
8887
|
],
|
|
8672
8888
|
"properties": {
|
|
8673
|
-
"
|
|
8889
|
+
"version": {
|
|
8674
8890
|
"type": "string",
|
|
8675
|
-
"
|
|
8891
|
+
"enum": [
|
|
8892
|
+
"1"
|
|
8893
|
+
],
|
|
8894
|
+
"description": "Version of the direct payload contract. Currently only `\"1\"` is supported; an\nunsupported version is rejected with `DIRECT_VERSION_UNSUPPORTED`.\n"
|
|
8676
8895
|
},
|
|
8677
|
-
"
|
|
8678
|
-
"type": "
|
|
8679
|
-
"
|
|
8680
|
-
"
|
|
8896
|
+
"operations": {
|
|
8897
|
+
"type": "array",
|
|
8898
|
+
"minItems": 1,
|
|
8899
|
+
"maxItems": 100,
|
|
8900
|
+
"description": "The operations to apply, in order. At most 100 operations per event. Each item is\neither an entity operation (`type` omitted or `\"entity\"`) or a meter reading\noperation (`type: \"meter_reading\"`).\n",
|
|
8901
|
+
"items": {
|
|
8902
|
+
"anyOf": [
|
|
8903
|
+
{
|
|
8904
|
+
"$ref": "#/components/schemas/DirectEntityOperation"
|
|
8905
|
+
},
|
|
8906
|
+
{
|
|
8907
|
+
"$ref": "#/components/schemas/DirectMeterReadingOperation"
|
|
8908
|
+
}
|
|
8909
|
+
]
|
|
8910
|
+
}
|
|
8911
|
+
}
|
|
8912
|
+
}
|
|
8913
|
+
},
|
|
8914
|
+
"DirectEntityOperation": {
|
|
8915
|
+
"type": "object",
|
|
8916
|
+
"description": "A single pre-mapped entity operation: upserts, soft-deletes, or purges one entity,\nidentified by its unique ids. Produces the same internal update as a mapped-mode entity\nconfiguration, so create-vs-update resolution, relation resolution, ordering, and\nmonitoring behave identically.\n",
|
|
8917
|
+
"required": [
|
|
8918
|
+
"entity_slug",
|
|
8919
|
+
"unique_ids"
|
|
8920
|
+
],
|
|
8921
|
+
"additionalProperties": false,
|
|
8922
|
+
"properties": {
|
|
8923
|
+
"type": {
|
|
8924
|
+
"type": "string",
|
|
8925
|
+
"enum": [
|
|
8926
|
+
"entity"
|
|
8927
|
+
],
|
|
8928
|
+
"description": "Operation discriminator. Optional - an operation without `type` is an entity operation."
|
|
8681
8929
|
},
|
|
8682
|
-
"
|
|
8683
|
-
"type": "
|
|
8684
|
-
"
|
|
8685
|
-
"
|
|
8930
|
+
"entity_slug": {
|
|
8931
|
+
"type": "string",
|
|
8932
|
+
"minLength": 1,
|
|
8933
|
+
"description": "Target entity schema slug (e.g. `contact`, `contract`).",
|
|
8934
|
+
"example": "contract"
|
|
8686
8935
|
},
|
|
8687
|
-
"
|
|
8936
|
+
"unique_ids": {
|
|
8688
8937
|
"type": "object",
|
|
8689
|
-
"
|
|
8690
|
-
"
|
|
8691
|
-
"
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
"additionalProperties": true,
|
|
8698
|
-
"description": "The pricing configuration from the entity mapping"
|
|
8699
|
-
},
|
|
8700
|
-
"data": {
|
|
8701
|
-
"type": "array",
|
|
8702
|
-
"description": "The pricing input data extracted from the payload",
|
|
8703
|
-
"items": {
|
|
8704
|
-
"type": "object",
|
|
8705
|
-
"additionalProperties": true
|
|
8938
|
+
"minProperties": 1,
|
|
8939
|
+
"additionalProperties": {
|
|
8940
|
+
"oneOf": [
|
|
8941
|
+
{
|
|
8942
|
+
"type": "string"
|
|
8943
|
+
},
|
|
8944
|
+
{
|
|
8945
|
+
"type": "number"
|
|
8706
8946
|
}
|
|
8707
|
-
|
|
8947
|
+
]
|
|
8948
|
+
},
|
|
8949
|
+
"description": "Attribute values that uniquely identify this entity, as `{ attribute: value }`.\nValues may be strings or numbers (numbers are coerced to strings); values that are\nempty after trimming are rejected. Use `_id` as the sole key to reference an entity\ndirectly by its epilot id.\n\nUnlike mapped mode, the unique-id ATTRIBUTE NAMES are given directly - there is no\nfield-to-attribute mapping step.\n",
|
|
8950
|
+
"example": {
|
|
8951
|
+
"contract_number": "CTR-001"
|
|
8708
8952
|
}
|
|
8709
8953
|
},
|
|
8954
|
+
"unique_id_types": {
|
|
8955
|
+
"type": "object",
|
|
8956
|
+
"additionalProperties": {
|
|
8957
|
+
"type": "string",
|
|
8958
|
+
"enum": [
|
|
8959
|
+
"email",
|
|
8960
|
+
"phone"
|
|
8961
|
+
]
|
|
8962
|
+
},
|
|
8963
|
+
"description": "Optional per-field type hints for repeatable unique-id fields (`email` / `phone`),\nneeded so lookups search the repeatable storage format correctly. When omitted, the\nserver derives the types from the entity schema; explicit values always win over\nderivation.\n"
|
|
8964
|
+
},
|
|
8710
8965
|
"mode": {
|
|
8711
8966
|
"type": "string",
|
|
8712
8967
|
"enum": [
|
|
@@ -8714,20 +8969,586 @@
|
|
|
8714
8969
|
"delete",
|
|
8715
8970
|
"purge"
|
|
8716
8971
|
],
|
|
8717
|
-
"
|
|
8972
|
+
"default": "upsert",
|
|
8973
|
+
"description": "Operation mode: `upsert` creates or updates the entity (default), `delete` soft\ndeletes it, `purge` removes it permanently. For `delete` / `purge`, `attributes`\nmay be omitted - only `unique_ids` are used to locate the entity.\n"
|
|
8974
|
+
},
|
|
8975
|
+
"attributes": {
|
|
8976
|
+
"type": "object",
|
|
8977
|
+
"description": "Attribute values to write, keyed by attribute name. Required when `mode` is `upsert`\n(an empty object is allowed); optional for `delete` / `purge`.\n\nValues are written verbatim - the server does not validate them against the entity\nschema (attributes not defined in the schema are stored but not indexed; the\nsimulation endpoint surfaces warnings for unique-id fields missing from the schema).\nTwo envelope forms receive special treatment: `$relation` values\n(`DirectRelationValue`) and `$relation_ref` values (`DirectRelationRefValue`) are\nvalidated and resolved to entity relations.\n",
|
|
8978
|
+
"additionalProperties": {
|
|
8979
|
+
"anyOf": [
|
|
8980
|
+
{
|
|
8981
|
+
"$ref": "#/components/schemas/DirectRelationValue"
|
|
8982
|
+
},
|
|
8983
|
+
{
|
|
8984
|
+
"$ref": "#/components/schemas/DirectRelationRefValue"
|
|
8985
|
+
},
|
|
8986
|
+
{
|
|
8987
|
+
"description": "Any other JSON value - written to the entity attribute verbatim."
|
|
8988
|
+
}
|
|
8989
|
+
]
|
|
8990
|
+
}
|
|
8718
8991
|
}
|
|
8719
8992
|
}
|
|
8720
8993
|
},
|
|
8721
|
-
"
|
|
8994
|
+
"DirectMeterReadingOperation": {
|
|
8722
8995
|
"type": "object",
|
|
8996
|
+
"description": "A single pre-mapped meter reading operation: upserts or deletes one reading on a meter\n(and optionally a specific counter), identified by their unique ids. Produces the same\ninternal update as a mapped-mode meter reading configuration.\n",
|
|
8723
8997
|
"required": [
|
|
8998
|
+
"type",
|
|
8724
8999
|
"meter",
|
|
8725
|
-
"attributes"
|
|
8726
|
-
"mode"
|
|
9000
|
+
"attributes"
|
|
8727
9001
|
],
|
|
9002
|
+
"additionalProperties": false,
|
|
8728
9003
|
"properties": {
|
|
8729
|
-
"
|
|
8730
|
-
"type": "
|
|
9004
|
+
"type": {
|
|
9005
|
+
"type": "string",
|
|
9006
|
+
"enum": [
|
|
9007
|
+
"meter_reading"
|
|
9008
|
+
],
|
|
9009
|
+
"description": "Operation discriminator. Required for meter reading operations."
|
|
9010
|
+
},
|
|
9011
|
+
"meter": {
|
|
9012
|
+
"type": "object",
|
|
9013
|
+
"required": [
|
|
9014
|
+
"unique_ids"
|
|
9015
|
+
],
|
|
9016
|
+
"additionalProperties": false,
|
|
9017
|
+
"description": "Reference to the meter this reading belongs to.",
|
|
9018
|
+
"properties": {
|
|
9019
|
+
"unique_ids": {
|
|
9020
|
+
"type": "object",
|
|
9021
|
+
"minProperties": 1,
|
|
9022
|
+
"additionalProperties": {
|
|
9023
|
+
"oneOf": [
|
|
9024
|
+
{
|
|
9025
|
+
"type": "string"
|
|
9026
|
+
},
|
|
9027
|
+
{
|
|
9028
|
+
"type": "number"
|
|
9029
|
+
}
|
|
9030
|
+
]
|
|
9031
|
+
},
|
|
9032
|
+
"description": "Attribute values that uniquely identify the meter, as `{ attribute: value }`.",
|
|
9033
|
+
"example": {
|
|
9034
|
+
"meter_number": "M-001"
|
|
9035
|
+
}
|
|
9036
|
+
}
|
|
9037
|
+
}
|
|
9038
|
+
},
|
|
9039
|
+
"counter": {
|
|
9040
|
+
"type": "object",
|
|
9041
|
+
"required": [
|
|
9042
|
+
"unique_ids"
|
|
9043
|
+
],
|
|
9044
|
+
"additionalProperties": false,
|
|
9045
|
+
"description": "Optional reference to the meter counter (register) the reading belongs to. Required\nwhen `reading_matching` is `strict-date`.\n",
|
|
9046
|
+
"properties": {
|
|
9047
|
+
"unique_ids": {
|
|
9048
|
+
"type": "object",
|
|
9049
|
+
"minProperties": 1,
|
|
9050
|
+
"additionalProperties": {
|
|
9051
|
+
"oneOf": [
|
|
9052
|
+
{
|
|
9053
|
+
"type": "string"
|
|
9054
|
+
},
|
|
9055
|
+
{
|
|
9056
|
+
"type": "number"
|
|
9057
|
+
}
|
|
9058
|
+
]
|
|
9059
|
+
},
|
|
9060
|
+
"description": "Attribute values that uniquely identify the counter, as `{ attribute: value }`.",
|
|
9061
|
+
"example": {
|
|
9062
|
+
"obis_number": "1-0:1.8.0"
|
|
9063
|
+
}
|
|
9064
|
+
}
|
|
9065
|
+
}
|
|
9066
|
+
},
|
|
9067
|
+
"mode": {
|
|
9068
|
+
"type": "string",
|
|
9069
|
+
"enum": [
|
|
9070
|
+
"upsert",
|
|
9071
|
+
"delete"
|
|
9072
|
+
],
|
|
9073
|
+
"default": "upsert",
|
|
9074
|
+
"description": "Operation mode: `upsert` creates or updates the reading (default), `delete` removes it."
|
|
9075
|
+
},
|
|
9076
|
+
"reading_matching": {
|
|
9077
|
+
"type": "string",
|
|
9078
|
+
"enum": [
|
|
9079
|
+
"external_id",
|
|
9080
|
+
"strict-date"
|
|
9081
|
+
],
|
|
9082
|
+
"description": "Strategy for matching this reading against existing readings. `external_id` (the\ndefault) matches by the reading's `external_id`; `strict-date` matches by meter +\ncounter + direction + date and REQUIRES `counter`. Useful when readings originate in\nthe portal and are echoed back by the ERP with truncated timestamps.\n"
|
|
9083
|
+
},
|
|
9084
|
+
"attributes": {
|
|
9085
|
+
"type": "object",
|
|
9086
|
+
"required": [
|
|
9087
|
+
"external_id",
|
|
9088
|
+
"timestamp",
|
|
9089
|
+
"source",
|
|
9090
|
+
"value"
|
|
9091
|
+
],
|
|
9092
|
+
"description": "The reading data. Additional keys (e.g. `direction`, `reason`, `read_by`, `status`,\n`metadata`) pass through to the metering service verbatim.\n",
|
|
9093
|
+
"properties": {
|
|
9094
|
+
"external_id": {
|
|
9095
|
+
"oneOf": [
|
|
9096
|
+
{
|
|
9097
|
+
"type": "string"
|
|
9098
|
+
},
|
|
9099
|
+
{
|
|
9100
|
+
"type": "number"
|
|
9101
|
+
}
|
|
9102
|
+
],
|
|
9103
|
+
"description": "External identifier of the reading (numbers are coerced to strings)."
|
|
9104
|
+
},
|
|
9105
|
+
"timestamp": {
|
|
9106
|
+
"type": "string",
|
|
9107
|
+
"description": "When the reading was taken. ISO 8601 - either `YYYY-MM-DD` or\n`YYYY-MM-DDTHH:mm:ss` (optional fractional seconds and `Z` / `±HH:mm` offset).\nOther formats (e.g. `DD.MM.YYYY`, epoch numbers) are rejected.\n",
|
|
9108
|
+
"example": "2026-08-24T06:00:00Z"
|
|
9109
|
+
},
|
|
9110
|
+
"source": {
|
|
9111
|
+
"type": "string",
|
|
9112
|
+
"enum": [
|
|
9113
|
+
"ECP",
|
|
9114
|
+
"ERP",
|
|
9115
|
+
"360",
|
|
9116
|
+
"journey-submission"
|
|
9117
|
+
],
|
|
9118
|
+
"description": "Origin system of the reading."
|
|
9119
|
+
},
|
|
9120
|
+
"value": {
|
|
9121
|
+
"oneOf": [
|
|
9122
|
+
{
|
|
9123
|
+
"type": "number"
|
|
9124
|
+
},
|
|
9125
|
+
{
|
|
9126
|
+
"type": "string"
|
|
9127
|
+
}
|
|
9128
|
+
],
|
|
9129
|
+
"description": "The reading value - a number, or a numeric string (coerced to a number)."
|
|
9130
|
+
}
|
|
9131
|
+
}
|
|
9132
|
+
}
|
|
9133
|
+
}
|
|
9134
|
+
},
|
|
9135
|
+
"DirectRelationValue": {
|
|
9136
|
+
"type": "object",
|
|
9137
|
+
"description": "An entity attribute value that establishes relations to other entities. Written on any\nattribute inside a direct entity operation's `attributes`.\n\nTwo forms are accepted: a bare array of items (shorthand for `_set`, i.e. replace), or\nan object with EXACTLY ONE of the operations `_set` (replace), `_append` (merge,\ndeduplicated by entity id), `_append_all` (merge without deduplication). No other\noperation keys are accepted.\n",
|
|
9138
|
+
"required": [
|
|
9139
|
+
"$relation"
|
|
9140
|
+
],
|
|
9141
|
+
"additionalProperties": false,
|
|
9142
|
+
"properties": {
|
|
9143
|
+
"$relation": {
|
|
9144
|
+
"oneOf": [
|
|
9145
|
+
{
|
|
9146
|
+
"type": "array",
|
|
9147
|
+
"description": "Shorthand for `_set` - replaces the attribute's relations with these items.",
|
|
9148
|
+
"items": {
|
|
9149
|
+
"$ref": "#/components/schemas/DirectRelationItem"
|
|
9150
|
+
}
|
|
9151
|
+
},
|
|
9152
|
+
{
|
|
9153
|
+
"type": "object",
|
|
9154
|
+
"description": "Exactly one of `_set`, `_append`, `_append_all` must be given.",
|
|
9155
|
+
"additionalProperties": false,
|
|
9156
|
+
"properties": {
|
|
9157
|
+
"_set": {
|
|
9158
|
+
"type": "array",
|
|
9159
|
+
"items": {
|
|
9160
|
+
"$ref": "#/components/schemas/DirectRelationItem"
|
|
9161
|
+
}
|
|
9162
|
+
},
|
|
9163
|
+
"_append": {
|
|
9164
|
+
"type": "array",
|
|
9165
|
+
"items": {
|
|
9166
|
+
"$ref": "#/components/schemas/DirectRelationItem"
|
|
9167
|
+
}
|
|
9168
|
+
},
|
|
9169
|
+
"_append_all": {
|
|
9170
|
+
"type": "array",
|
|
9171
|
+
"items": {
|
|
9172
|
+
"$ref": "#/components/schemas/DirectRelationItem"
|
|
9173
|
+
}
|
|
9174
|
+
}
|
|
9175
|
+
}
|
|
9176
|
+
}
|
|
9177
|
+
]
|
|
9178
|
+
}
|
|
9179
|
+
}
|
|
9180
|
+
},
|
|
9181
|
+
"DirectRelationItem": {
|
|
9182
|
+
"type": "object",
|
|
9183
|
+
"description": "One relation target: either an already-resolved reference (`entity_id`), or a lookup by\nunique ids (`schema` + `unique_ids`, resolved by the pipeline like any other unique-id\nlookup, including stub creation and retry when the target does not exist yet). The two\nforms are mutually exclusive. Use `_id` as the sole `unique_ids` key for a direct-id\nlookup.\n",
|
|
9184
|
+
"additionalProperties": false,
|
|
9185
|
+
"properties": {
|
|
9186
|
+
"entity_id": {
|
|
9187
|
+
"type": "string",
|
|
9188
|
+
"description": "Epilot entity id of the relation target. Must not be combined with `schema` / `unique_ids`."
|
|
9189
|
+
},
|
|
9190
|
+
"schema": {
|
|
9191
|
+
"type": "string",
|
|
9192
|
+
"description": "Entity schema slug of the relation target. Required when `entity_id` is not given.",
|
|
9193
|
+
"example": "contact"
|
|
9194
|
+
},
|
|
9195
|
+
"unique_ids": {
|
|
9196
|
+
"type": "object",
|
|
9197
|
+
"minProperties": 1,
|
|
9198
|
+
"additionalProperties": {
|
|
9199
|
+
"oneOf": [
|
|
9200
|
+
{
|
|
9201
|
+
"type": "string"
|
|
9202
|
+
},
|
|
9203
|
+
{
|
|
9204
|
+
"type": "number"
|
|
9205
|
+
}
|
|
9206
|
+
]
|
|
9207
|
+
},
|
|
9208
|
+
"description": "Attribute values that uniquely identify the target. Required when `entity_id` is not given.",
|
|
9209
|
+
"example": {
|
|
9210
|
+
"customer_number": "CUST-12345"
|
|
9211
|
+
}
|
|
9212
|
+
},
|
|
9213
|
+
"unique_id_types": {
|
|
9214
|
+
"type": "object",
|
|
9215
|
+
"additionalProperties": {
|
|
9216
|
+
"type": "string",
|
|
9217
|
+
"enum": [
|
|
9218
|
+
"email",
|
|
9219
|
+
"phone"
|
|
9220
|
+
]
|
|
9221
|
+
},
|
|
9222
|
+
"description": "Optional per-field type hints for repeatable unique-id fields, as on the entity operation."
|
|
9223
|
+
},
|
|
9224
|
+
"tags": {
|
|
9225
|
+
"type": "array",
|
|
9226
|
+
"items": {
|
|
9227
|
+
"type": "string"
|
|
9228
|
+
},
|
|
9229
|
+
"description": "Optional relation tags (e.g. `primary`, `billing`)."
|
|
9230
|
+
}
|
|
9231
|
+
}
|
|
9232
|
+
},
|
|
9233
|
+
"DirectRelationRefValue": {
|
|
9234
|
+
"type": "object",
|
|
9235
|
+
"description": "An entity attribute value that references an ITEM INSIDE a repeatable attribute of\nanother entity - for example one address out of a contact's `address` list. The target\nentity is looked up by unique ids, then the item at `path` matching `value` is\nreferenced (creating it when missing).\n\nThe same operation envelope as `$relation` applies: a bare array is shorthand for\n`_set`, otherwise exactly one of `_set`, `_append`, `_append_all`.\n",
|
|
9236
|
+
"required": [
|
|
9237
|
+
"$relation_ref"
|
|
9238
|
+
],
|
|
9239
|
+
"additionalProperties": false,
|
|
9240
|
+
"properties": {
|
|
9241
|
+
"$relation_ref": {
|
|
9242
|
+
"oneOf": [
|
|
9243
|
+
{
|
|
9244
|
+
"type": "array",
|
|
9245
|
+
"description": "Shorthand for `_set`.",
|
|
9246
|
+
"items": {
|
|
9247
|
+
"$ref": "#/components/schemas/DirectRelationRefItem"
|
|
9248
|
+
}
|
|
9249
|
+
},
|
|
9250
|
+
{
|
|
9251
|
+
"type": "object",
|
|
9252
|
+
"description": "Exactly one of `_set`, `_append`, `_append_all` must be given.",
|
|
9253
|
+
"additionalProperties": false,
|
|
9254
|
+
"properties": {
|
|
9255
|
+
"_set": {
|
|
9256
|
+
"type": "array",
|
|
9257
|
+
"items": {
|
|
9258
|
+
"$ref": "#/components/schemas/DirectRelationRefItem"
|
|
9259
|
+
}
|
|
9260
|
+
},
|
|
9261
|
+
"_append": {
|
|
9262
|
+
"type": "array",
|
|
9263
|
+
"items": {
|
|
9264
|
+
"$ref": "#/components/schemas/DirectRelationRefItem"
|
|
9265
|
+
}
|
|
9266
|
+
},
|
|
9267
|
+
"_append_all": {
|
|
9268
|
+
"type": "array",
|
|
9269
|
+
"items": {
|
|
9270
|
+
"$ref": "#/components/schemas/DirectRelationRefItem"
|
|
9271
|
+
}
|
|
9272
|
+
}
|
|
9273
|
+
}
|
|
9274
|
+
}
|
|
9275
|
+
]
|
|
9276
|
+
}
|
|
9277
|
+
}
|
|
9278
|
+
},
|
|
9279
|
+
"DirectRelationRefItem": {
|
|
9280
|
+
"type": "object",
|
|
9281
|
+
"description": "One relation-ref target - the entity to look up, and the repeatable item to reference on it.",
|
|
9282
|
+
"required": [
|
|
9283
|
+
"schema",
|
|
9284
|
+
"unique_ids",
|
|
9285
|
+
"path",
|
|
9286
|
+
"value"
|
|
9287
|
+
],
|
|
9288
|
+
"additionalProperties": false,
|
|
9289
|
+
"properties": {
|
|
9290
|
+
"schema": {
|
|
9291
|
+
"type": "string",
|
|
9292
|
+
"minLength": 1,
|
|
9293
|
+
"description": "Entity schema slug of the target entity.",
|
|
9294
|
+
"example": "contact"
|
|
9295
|
+
},
|
|
9296
|
+
"unique_ids": {
|
|
9297
|
+
"type": "object",
|
|
9298
|
+
"minProperties": 1,
|
|
9299
|
+
"additionalProperties": {
|
|
9300
|
+
"oneOf": [
|
|
9301
|
+
{
|
|
9302
|
+
"type": "string"
|
|
9303
|
+
},
|
|
9304
|
+
{
|
|
9305
|
+
"type": "number"
|
|
9306
|
+
}
|
|
9307
|
+
]
|
|
9308
|
+
},
|
|
9309
|
+
"description": "Attribute values that uniquely identify the target entity."
|
|
9310
|
+
},
|
|
9311
|
+
"unique_id_types": {
|
|
9312
|
+
"type": "object",
|
|
9313
|
+
"additionalProperties": {
|
|
9314
|
+
"type": "string",
|
|
9315
|
+
"enum": [
|
|
9316
|
+
"email",
|
|
9317
|
+
"phone"
|
|
9318
|
+
]
|
|
9319
|
+
},
|
|
9320
|
+
"description": "Optional per-field type hints for repeatable unique-id fields."
|
|
9321
|
+
},
|
|
9322
|
+
"path": {
|
|
9323
|
+
"type": "string",
|
|
9324
|
+
"minLength": 1,
|
|
9325
|
+
"description": "The attribute on the TARGET entity that holds the repeatable array (e.g. `address`)."
|
|
9326
|
+
},
|
|
9327
|
+
"value": {
|
|
9328
|
+
"description": "The item to match (or create) at `path` - e.g. an address object.",
|
|
9329
|
+
"example": {
|
|
9330
|
+
"street": "Main Street",
|
|
9331
|
+
"city": "Berlin"
|
|
9332
|
+
}
|
|
9333
|
+
}
|
|
9334
|
+
}
|
|
9335
|
+
},
|
|
9336
|
+
"DirectSimulationRequest": {
|
|
9337
|
+
"type": "object",
|
|
9338
|
+
"description": "Request for a direct-mode dry run: the `direct: true` use case configuration to test\nagainst, and the payload to validate and translate.\n",
|
|
9339
|
+
"required": [
|
|
9340
|
+
"event_configuration",
|
|
9341
|
+
"payload"
|
|
9342
|
+
],
|
|
9343
|
+
"properties": {
|
|
9344
|
+
"event_configuration": {
|
|
9345
|
+
"allOf": [
|
|
9346
|
+
{
|
|
9347
|
+
"$ref": "#/components/schemas/InboundIntegrationEventConfiguration"
|
|
9348
|
+
}
|
|
9349
|
+
],
|
|
9350
|
+
"description": "The direct use case configuration to simulate against. `direct` must be `true`;\n`entities` acts as the optional allowlist exactly as at runtime. This is the same\nconfiguration format stored on the inbound use case resource, so a configuration can\nbe tested before saving it.\n"
|
|
9351
|
+
},
|
|
9352
|
+
"payload": {
|
|
9353
|
+
"oneOf": [
|
|
9354
|
+
{
|
|
9355
|
+
"type": "string",
|
|
9356
|
+
"description": "The direct payload as a JSON string (as it would be sent in the event's `payload`)."
|
|
9357
|
+
},
|
|
9358
|
+
{
|
|
9359
|
+
"$ref": "#/components/schemas/DirectPayload"
|
|
9360
|
+
}
|
|
9361
|
+
],
|
|
9362
|
+
"description": "The direct payload to validate - a `DirectPayload` object, or its JSON string form."
|
|
9363
|
+
}
|
|
9364
|
+
}
|
|
9365
|
+
},
|
|
9366
|
+
"DirectSimulationResponse": {
|
|
9367
|
+
"type": "object",
|
|
9368
|
+
"description": "Result of a direct-mode dry run. `valid: false` responses list EVERY violation found\nacross all operations in `errors`. `valid: true` responses preview the internal updates\nthe pipeline would apply, plus non-blocking `warnings`.\n",
|
|
9369
|
+
"required": [
|
|
9370
|
+
"valid",
|
|
9371
|
+
"errors"
|
|
9372
|
+
],
|
|
9373
|
+
"properties": {
|
|
9374
|
+
"valid": {
|
|
9375
|
+
"type": "boolean",
|
|
9376
|
+
"description": "Whether the payload would be accepted by the ingest endpoint."
|
|
9377
|
+
},
|
|
9378
|
+
"errors": {
|
|
9379
|
+
"type": "array",
|
|
9380
|
+
"description": "All validation errors found. Empty when `valid` is `true`.",
|
|
9381
|
+
"items": {
|
|
9382
|
+
"$ref": "#/components/schemas/DirectSimulationError"
|
|
9383
|
+
}
|
|
9384
|
+
},
|
|
9385
|
+
"warnings": {
|
|
9386
|
+
"type": "array",
|
|
9387
|
+
"description": "Non-blocking findings - e.g. unique-id fields not defined in the target entity\nschema (lookups would never match), or a failed server-side unique-id type\nderivation.\n",
|
|
9388
|
+
"items": {
|
|
9389
|
+
"$ref": "#/components/schemas/MappingSimulationWarning"
|
|
9390
|
+
}
|
|
9391
|
+
},
|
|
9392
|
+
"entity_updates": {
|
|
9393
|
+
"type": "array",
|
|
9394
|
+
"description": "The translated internal entity updates, exactly as the pipeline would process them.\nOnly present when `valid` is `true`.\n",
|
|
9395
|
+
"items": {
|
|
9396
|
+
"allOf": [
|
|
9397
|
+
{
|
|
9398
|
+
"$ref": "#/components/schemas/EntityUpdate"
|
|
9399
|
+
},
|
|
9400
|
+
{
|
|
9401
|
+
"type": "object",
|
|
9402
|
+
"properties": {
|
|
9403
|
+
"unique_identifiers_metadata": {
|
|
9404
|
+
"type": "object",
|
|
9405
|
+
"description": "Per-field metadata for repeatable unique-id fields - explicit\n`unique_id_types` merged with server-side schema derivation. Absent when\nno field resolved to a repeatable type.\n",
|
|
9406
|
+
"additionalProperties": {
|
|
9407
|
+
"type": "object",
|
|
9408
|
+
"properties": {
|
|
9409
|
+
"fieldType": {
|
|
9410
|
+
"type": "string",
|
|
9411
|
+
"enum": [
|
|
9412
|
+
"email",
|
|
9413
|
+
"phone"
|
|
9414
|
+
]
|
|
9415
|
+
},
|
|
9416
|
+
"index": {
|
|
9417
|
+
"type": "integer"
|
|
9418
|
+
}
|
|
9419
|
+
}
|
|
9420
|
+
}
|
|
9421
|
+
}
|
|
9422
|
+
}
|
|
9423
|
+
}
|
|
9424
|
+
]
|
|
9425
|
+
}
|
|
9426
|
+
},
|
|
9427
|
+
"meter_reading_updates": {
|
|
9428
|
+
"type": "array",
|
|
9429
|
+
"description": "The translated internal meter reading updates. Only present when `valid` is `true`.\n",
|
|
9430
|
+
"items": {
|
|
9431
|
+
"allOf": [
|
|
9432
|
+
{
|
|
9433
|
+
"$ref": "#/components/schemas/MeterReadingUpdate"
|
|
9434
|
+
},
|
|
9435
|
+
{
|
|
9436
|
+
"type": "object",
|
|
9437
|
+
"properties": {
|
|
9438
|
+
"_config": {
|
|
9439
|
+
"type": "object",
|
|
9440
|
+
"description": "Per-reading pipeline configuration carried by the operation.",
|
|
9441
|
+
"properties": {
|
|
9442
|
+
"reading_matching": {
|
|
9443
|
+
"type": "string",
|
|
9444
|
+
"enum": [
|
|
9445
|
+
"external_id",
|
|
9446
|
+
"strict-date"
|
|
9447
|
+
]
|
|
9448
|
+
}
|
|
9449
|
+
}
|
|
9450
|
+
}
|
|
9451
|
+
}
|
|
9452
|
+
}
|
|
9453
|
+
]
|
|
9454
|
+
}
|
|
9455
|
+
}
|
|
9456
|
+
}
|
|
9457
|
+
},
|
|
9458
|
+
"DirectSimulationError": {
|
|
9459
|
+
"type": "object",
|
|
9460
|
+
"description": "One validation error found during a direct-mode dry run.",
|
|
9461
|
+
"required": [
|
|
9462
|
+
"code",
|
|
9463
|
+
"message"
|
|
9464
|
+
],
|
|
9465
|
+
"properties": {
|
|
9466
|
+
"code": {
|
|
9467
|
+
"type": "string",
|
|
9468
|
+
"enum": [
|
|
9469
|
+
"DIRECT_PAYLOAD_INVALID",
|
|
9470
|
+
"DIRECT_VERSION_UNSUPPORTED",
|
|
9471
|
+
"DIRECT_ENTITY_NOT_ALLOWED"
|
|
9472
|
+
],
|
|
9473
|
+
"description": "Error class, matching the monitoring codes the ingest pipeline emits:\n`DIRECT_PAYLOAD_INVALID` (schema violation, JSON parse failure, or XML format),\n`DIRECT_VERSION_UNSUPPORTED` (unknown payload `version`),\n`DIRECT_ENTITY_NOT_ALLOWED` (entity or unique-id keys not permitted by the use\ncase's allowlist).\n"
|
|
9474
|
+
},
|
|
9475
|
+
"message": {
|
|
9476
|
+
"type": "string",
|
|
9477
|
+
"description": "Human-readable description, including the path of the offending element."
|
|
9478
|
+
},
|
|
9479
|
+
"operation_index": {
|
|
9480
|
+
"type": "integer",
|
|
9481
|
+
"description": "Zero-based index of the operation the error refers to, when attributable to one."
|
|
9482
|
+
}
|
|
9483
|
+
}
|
|
9484
|
+
},
|
|
9485
|
+
"EntityUpdate": {
|
|
9486
|
+
"type": "object",
|
|
9487
|
+
"required": [
|
|
9488
|
+
"entity_slug",
|
|
9489
|
+
"unique_identifiers",
|
|
9490
|
+
"attributes",
|
|
9491
|
+
"mode"
|
|
9492
|
+
],
|
|
9493
|
+
"properties": {
|
|
9494
|
+
"entity_slug": {
|
|
9495
|
+
"type": "string",
|
|
9496
|
+
"description": "The entity type slug"
|
|
9497
|
+
},
|
|
9498
|
+
"unique_identifiers": {
|
|
9499
|
+
"type": "object",
|
|
9500
|
+
"description": "Unique identifier mappings for this entity",
|
|
9501
|
+
"additionalProperties": true
|
|
9502
|
+
},
|
|
9503
|
+
"attributes": {
|
|
9504
|
+
"type": "object",
|
|
9505
|
+
"description": "Mapped attribute values",
|
|
9506
|
+
"additionalProperties": true
|
|
9507
|
+
},
|
|
9508
|
+
"pricing": {
|
|
9509
|
+
"type": "object",
|
|
9510
|
+
"description": "Present when the entity mapping has a `pricing` block. Echoes the pricing configuration and the data extracted for it, so mapping authors can see what would be sent to the pricing service.",
|
|
9511
|
+
"required": [
|
|
9512
|
+
"config",
|
|
9513
|
+
"data"
|
|
9514
|
+
],
|
|
9515
|
+
"properties": {
|
|
9516
|
+
"config": {
|
|
9517
|
+
"type": "object",
|
|
9518
|
+
"additionalProperties": true,
|
|
9519
|
+
"description": "The pricing configuration from the entity mapping"
|
|
9520
|
+
},
|
|
9521
|
+
"data": {
|
|
9522
|
+
"type": "array",
|
|
9523
|
+
"description": "The pricing input data extracted from the payload",
|
|
9524
|
+
"items": {
|
|
9525
|
+
"type": "object",
|
|
9526
|
+
"additionalProperties": true
|
|
9527
|
+
}
|
|
9528
|
+
}
|
|
9529
|
+
}
|
|
9530
|
+
},
|
|
9531
|
+
"mode": {
|
|
9532
|
+
"type": "string",
|
|
9533
|
+
"enum": [
|
|
9534
|
+
"upsert",
|
|
9535
|
+
"delete",
|
|
9536
|
+
"purge"
|
|
9537
|
+
],
|
|
9538
|
+
"description": "Effective operation mode applied to this entity at runtime. `upsert-prune-scope-purge` / `upsert-prune-scope-delete` configurations report `upsert` here, because the individual entities in the payload are upserted — the destructive part of those modes is reported separately in `prune_scope_updates`. For `delete` / `purge`, `attributes` are still mapped and returned but ignored at runtime: only `unique_identifiers` are used to locate the entity to remove."
|
|
9539
|
+
}
|
|
9540
|
+
}
|
|
9541
|
+
},
|
|
9542
|
+
"MeterReadingUpdate": {
|
|
9543
|
+
"type": "object",
|
|
9544
|
+
"required": [
|
|
9545
|
+
"meter",
|
|
9546
|
+
"attributes",
|
|
9547
|
+
"mode"
|
|
9548
|
+
],
|
|
9549
|
+
"properties": {
|
|
9550
|
+
"meter": {
|
|
9551
|
+
"type": "object",
|
|
8731
9552
|
"required": [
|
|
8732
9553
|
"$entity_unique_ids"
|
|
8733
9554
|
],
|
|
@@ -9152,6 +9973,82 @@
|
|
|
9152
9973
|
}
|
|
9153
9974
|
}
|
|
9154
9975
|
},
|
|
9976
|
+
"EntitySyncStatusResponse": {
|
|
9977
|
+
"type": "object",
|
|
9978
|
+
"required": [
|
|
9979
|
+
"entity_id",
|
|
9980
|
+
"sync_states"
|
|
9981
|
+
],
|
|
9982
|
+
"properties": {
|
|
9983
|
+
"entity_id": {
|
|
9984
|
+
"type": "string",
|
|
9985
|
+
"format": "uuid",
|
|
9986
|
+
"description": "The entity the sync states belong to"
|
|
9987
|
+
},
|
|
9988
|
+
"sync_states": {
|
|
9989
|
+
"type": "array",
|
|
9990
|
+
"description": "One entry per integration that has processed an inbound event for the entity",
|
|
9991
|
+
"items": {
|
|
9992
|
+
"$ref": "#/components/schemas/EntitySyncState"
|
|
9993
|
+
}
|
|
9994
|
+
}
|
|
9995
|
+
}
|
|
9996
|
+
},
|
|
9997
|
+
"EntitySyncState": {
|
|
9998
|
+
"type": "object",
|
|
9999
|
+
"required": [
|
|
10000
|
+
"entity_id",
|
|
10001
|
+
"integration_id",
|
|
10002
|
+
"entity_slug",
|
|
10003
|
+
"last_synced_at",
|
|
10004
|
+
"last_operation"
|
|
10005
|
+
],
|
|
10006
|
+
"properties": {
|
|
10007
|
+
"entity_id": {
|
|
10008
|
+
"type": "string",
|
|
10009
|
+
"format": "uuid",
|
|
10010
|
+
"description": "The entity ID"
|
|
10011
|
+
},
|
|
10012
|
+
"integration_id": {
|
|
10013
|
+
"type": "string",
|
|
10014
|
+
"format": "uuid",
|
|
10015
|
+
"description": "The integration that synchronized the entity"
|
|
10016
|
+
},
|
|
10017
|
+
"entity_slug": {
|
|
10018
|
+
"type": "string",
|
|
10019
|
+
"description": "The entity schema slug",
|
|
10020
|
+
"example": "contract"
|
|
10021
|
+
},
|
|
10022
|
+
"use_case_id": {
|
|
10023
|
+
"type": "string",
|
|
10024
|
+
"description": "The inbound use case that last processed the entity"
|
|
10025
|
+
},
|
|
10026
|
+
"last_synced_at": {
|
|
10027
|
+
"type": "string",
|
|
10028
|
+
"format": "date-time",
|
|
10029
|
+
"description": "Last time an inbound ERP event for this entity was processed —\nincluding no-op checks that changed nothing on the entity.\n"
|
|
10030
|
+
},
|
|
10031
|
+
"last_changed_at": {
|
|
10032
|
+
"type": "string",
|
|
10033
|
+
"format": "date-time",
|
|
10034
|
+
"description": "Last time an inbound ERP event actually changed the entity (create/patch/delete)"
|
|
10035
|
+
},
|
|
10036
|
+
"last_operation": {
|
|
10037
|
+
"type": "string",
|
|
10038
|
+
"enum": [
|
|
10039
|
+
"create",
|
|
10040
|
+
"patch",
|
|
10041
|
+
"delete",
|
|
10042
|
+
"no-op"
|
|
10043
|
+
],
|
|
10044
|
+
"description": "Outcome of the most recent inbound sync check"
|
|
10045
|
+
},
|
|
10046
|
+
"last_event_id": {
|
|
10047
|
+
"type": "string",
|
|
10048
|
+
"description": "The event ID of the most recent inbound sync check"
|
|
10049
|
+
}
|
|
10050
|
+
}
|
|
10051
|
+
},
|
|
9155
10052
|
"OutboundStatusResponse": {
|
|
9156
10053
|
"type": "object",
|
|
9157
10054
|
"required": [
|
package/dist/bin/epilot.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
API_LIST
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-DVATEMSL.js";
|
|
5
5
|
|
|
6
6
|
// bin/epilot.ts
|
|
7
7
|
import { runMain } from "citty";
|
|
@@ -11,7 +11,7 @@ import { defineCommand } from "citty";
|
|
|
11
11
|
var main = defineCommand({
|
|
12
12
|
meta: {
|
|
13
13
|
name: "epilot",
|
|
14
|
-
version: "0.1.
|
|
14
|
+
version: "0.1.128",
|
|
15
15
|
description: "CLI for epilot APIs"
|
|
16
16
|
},
|
|
17
17
|
args: {
|
|
@@ -30,8 +30,8 @@ var main = defineCommand({
|
|
|
30
30
|
auth: () => import("../auth-WMXFMPWE.js").then((m) => m.default),
|
|
31
31
|
profile: () => import("../profile-OZJL5ZPT.js").then((m) => m.default),
|
|
32
32
|
config: () => import("../config-DGZIMLZK.js").then((m) => m.default),
|
|
33
|
-
completion: () => import("../completion-
|
|
34
|
-
upgrade: () => import("../upgrade-
|
|
33
|
+
completion: () => import("../completion-QZPBFCMA.js").then((m) => m.default),
|
|
34
|
+
upgrade: () => import("../upgrade-XUKKPWDE.js").then((m) => m.default),
|
|
35
35
|
"access-token": () => import("../access-token-WWE6BDJH.js").then((m) => m.default),
|
|
36
36
|
address: () => import("../address-EH3C4CVB.js").then((m) => m.default),
|
|
37
37
|
"address-suggestions": () => import("../address-suggestions-RRSLOBFW.js").then((m) => m.default),
|
|
@@ -134,13 +134,13 @@ process.stderr.on("error", (err) => {
|
|
|
134
134
|
if (err.code === "EPIPE") process.exit(0);
|
|
135
135
|
throw err;
|
|
136
136
|
});
|
|
137
|
-
var VERSION = true ? "0.1.
|
|
137
|
+
var VERSION = true ? "0.1.128" : (await null).default.version;
|
|
138
138
|
var reorderedArgv = hoistFlagsAfterSubcommand(process.argv.slice(2));
|
|
139
139
|
process.argv = [process.argv[0], process.argv[1], ...reorderedArgv];
|
|
140
140
|
var args = process.argv.slice(2);
|
|
141
141
|
var completionsIdx = args.indexOf("--_completions");
|
|
142
142
|
if (completionsIdx >= 0) {
|
|
143
|
-
const { handleCompletions } = await import("../completion-
|
|
143
|
+
const { handleCompletions } = await import("../completion-QZPBFCMA.js");
|
|
144
144
|
handleCompletions(args[completionsIdx + 1], args[completionsIdx + 2]);
|
|
145
145
|
process.exit(0);
|
|
146
146
|
}
|
|
@@ -881,7 +881,7 @@ var API_LIST = [
|
|
|
881
881
|
kebabName: "integration-toolkit",
|
|
882
882
|
title: "Integration Toolkit API",
|
|
883
883
|
serverUrl: "https://integration-toolkit.sls.epilot.io",
|
|
884
|
-
operationCount:
|
|
884
|
+
operationCount: 70,
|
|
885
885
|
operationIds: [
|
|
886
886
|
"acknowledgeTracking",
|
|
887
887
|
"triggerErp",
|
|
@@ -889,6 +889,7 @@ var API_LIST = [
|
|
|
889
889
|
"processErpUpdatesEventsV2",
|
|
890
890
|
"processErpUpdatesEventsV3",
|
|
891
891
|
"simulateMappingV2",
|
|
892
|
+
"simulateDirect",
|
|
892
893
|
"simulateMapping",
|
|
893
894
|
"listIntegrations",
|
|
894
895
|
"createIntegration",
|
|
@@ -924,6 +925,7 @@ var API_LIST = [
|
|
|
924
925
|
"getMonitoringStats",
|
|
925
926
|
"getMonitoringTimeSeries",
|
|
926
927
|
"getOutboundStatus",
|
|
928
|
+
"getEntitySyncStatus",
|
|
927
929
|
"pollOutboundMessages",
|
|
928
930
|
"ackOutboundMessages",
|
|
929
931
|
"listOutboundDlqMessages",
|
|
@@ -72,7 +72,7 @@ ${GREEN}${BOLD}Upgraded to @epilot/cli@${latest}${RESET}
|
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
var getCurrentVersion = () => {
|
|
75
|
-
if (true) return "0.1.
|
|
75
|
+
if (true) return "0.1.128";
|
|
76
76
|
try {
|
|
77
77
|
const output = execSync("npm ls -g @epilot/cli --depth=0 --json 2>/dev/null", {
|
|
78
78
|
encoding: "utf-8",
|