@epilot/cli 0.1.68 → 0.1.70

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 CHANGED
@@ -29,7 +29,7 @@ npm install -g @epilot/cli
29
29
 
30
30
  <!-- usage-help -->
31
31
  ```
32
- epilot v0.1.68 — CLI for epilot APIs
32
+ epilot v0.1.70 — CLI for epilot APIs
33
33
 
34
34
  USAGE
35
35
  epilot <api> <operationId> [params...] [flags]
@@ -597,6 +597,12 @@
597
597
  "description": "When true, the issued token may only perform read-only actions. Any action guarded by permissions that is not read-only (i.e. not a view/export/download action) is denied, regardless of the roles the token carries.",
598
598
  "example": true
599
599
  },
600
+ "Anonymize": {
601
+ "type": "boolean",
602
+ "default": false,
603
+ "description": "Forces PII anonymization on all entity data returned to this token. Cannot be disabled by the token bearer. See entity-api anonymized responses.",
604
+ "example": true
605
+ },
600
606
  "AccessTokenParameters": {
601
607
  "type": "object",
602
608
  "additionalProperties": false,
@@ -618,6 +624,9 @@
618
624
  },
619
625
  "read_only": {
620
626
  "$ref": "#/components/schemas/ReadOnly"
627
+ },
628
+ "anonymize": {
629
+ "$ref": "#/components/schemas/Anonymize"
621
630
  }
622
631
  },
623
632
  "required": [
@@ -692,6 +701,9 @@
692
701
  },
693
702
  "read_only": {
694
703
  "$ref": "#/components/schemas/ReadOnly"
704
+ },
705
+ "anonymize": {
706
+ "$ref": "#/components/schemas/Anonymize"
695
707
  }
696
708
  },
697
709
  "required": [
@@ -719,6 +731,9 @@
719
731
  },
720
732
  "read_only": {
721
733
  "$ref": "#/components/schemas/ReadOnly"
734
+ },
735
+ "anonymize": {
736
+ "$ref": "#/components/schemas/Anonymize"
722
737
  }
723
738
  },
724
739
  "required": [
@@ -782,6 +797,9 @@
782
797
  "read_only": {
783
798
  "$ref": "#/components/schemas/ReadOnly"
784
799
  },
800
+ "anonymize": {
801
+ "$ref": "#/components/schemas/Anonymize"
802
+ },
785
803
  "last_used": {
786
804
  "type": "string",
787
805
  "format": "date",
@@ -484,25 +484,75 @@
484
484
  "post": {
485
485
  "operationId": "createExport",
486
486
  "summary": "createExport",
487
- "description": "Request an asynchronous CSV export of the portal user's contracts, delivery points and meters. Returns a job id to poll.",
487
+ "description": "Request an asynchronous CSV export of the portal user's entities for one schema. Columns come from the request Returns a job id to poll.\n",
488
488
  "tags": [
489
489
  "ECP"
490
490
  ],
491
- "parameters": [
492
- {
493
- "in": "query",
494
- "name": "language",
495
- "required": false,
496
- "schema": {
497
- "type": "string",
498
- "enum": [
499
- "de",
500
- "en"
501
- ]
502
- },
503
- "description": "Output language for headers and value formatting. Defaults to German when omitted or unsupported."
491
+ "requestBody": {
492
+ "required": true,
493
+ "content": {
494
+ "application/json": {
495
+ "schema": {
496
+ "type": "object",
497
+ "required": [
498
+ "schema",
499
+ "columns"
500
+ ],
501
+ "properties": {
502
+ "schema": {
503
+ "type": "string",
504
+ "description": "Entity schema to export (must be an allowed portal entity)."
505
+ },
506
+ "search": {
507
+ "type": "object",
508
+ "description": "Search parameters, same shape the entity list queries with.",
509
+ "properties": {
510
+ "q": {
511
+ "type": "string"
512
+ },
513
+ "q_fields": {
514
+ "type": "array",
515
+ "items": {
516
+ "type": "string"
517
+ }
518
+ },
519
+ "filters": {
520
+ "type": "array",
521
+ "items": {
522
+ "type": "object"
523
+ }
524
+ },
525
+ "filters_context": {
526
+ "type": "array",
527
+ "items": {
528
+ "type": "object"
529
+ }
530
+ },
531
+ "sort": {}
532
+ }
533
+ },
534
+ "columns": {
535
+ "type": "array",
536
+ "description": "Ordered column definitions; order is the CSV column order.",
537
+ "items": {
538
+ "$ref": "#/components/schemas/PortalDataExportColumn"
539
+ }
540
+ },
541
+ "expand_over": {
542
+ "type": "string"
543
+ },
544
+ "language": {
545
+ "type": "string",
546
+ "enum": [
547
+ "de",
548
+ "en"
549
+ ]
550
+ }
551
+ }
552
+ }
553
+ }
504
554
  }
505
- ],
555
+ },
506
556
  "security": [
507
557
  {
508
558
  "PortalAuth": []
@@ -540,7 +590,7 @@
540
590
  "$ref": "#/components/responses/Forbidden"
541
591
  },
542
592
  "404": {
543
- "description": "No export profile configured for this organization."
593
+ "description": "Missing or invalid export columns."
544
594
  },
545
595
  "500": {
546
596
  "$ref": "#/components/responses/InternalServerError"
@@ -5879,6 +5929,125 @@
5879
5929
  }
5880
5930
  }
5881
5931
  },
5932
+ "post": {
5933
+ "operationId": "getContractWithTemplates",
5934
+ "summary": "getContractWithTemplates",
5935
+ "description": "Get a contract by id, resolving the provided Handlebars templates against each related meter into templates_output. POST variant of getContract that accepts a request body; the GET remains as a fallback.",
5936
+ "tags": [
5937
+ "ECP"
5938
+ ],
5939
+ "security": [
5940
+ {
5941
+ "PortalAuth": []
5942
+ }
5943
+ ],
5944
+ "parameters": [
5945
+ {
5946
+ "in": "path",
5947
+ "name": "id",
5948
+ "schema": {
5949
+ "$ref": "#/components/schemas/EntityId"
5950
+ },
5951
+ "required": true,
5952
+ "description": "The ID of the contract"
5953
+ }
5954
+ ],
5955
+ "requestBody": {
5956
+ "required": false,
5957
+ "content": {
5958
+ "application/json": {
5959
+ "schema": {
5960
+ "type": "object",
5961
+ "properties": {
5962
+ "templates": {
5963
+ "type": "object",
5964
+ "additionalProperties": {
5965
+ "type": "string"
5966
+ },
5967
+ "description": "Map of content field name to Handlebars template string. Each template is resolved per related meter and returned as templates_output on the meter."
5968
+ }
5969
+ }
5970
+ }
5971
+ }
5972
+ }
5973
+ },
5974
+ "responses": {
5975
+ "200": {
5976
+ "description": "The requested contract returned successfully.",
5977
+ "content": {
5978
+ "application/json": {
5979
+ "schema": {
5980
+ "type": "object",
5981
+ "properties": {
5982
+ "entity": {
5983
+ "$ref": "#/components/schemas/Contract"
5984
+ },
5985
+ "orders": {
5986
+ "type": "array",
5987
+ "description": "The related orders of the requested contract",
5988
+ "items": {
5989
+ "$ref": "#/components/schemas/Order"
5990
+ }
5991
+ },
5992
+ "meters": {
5993
+ "type": "array",
5994
+ "description": "The related meters of the requested contract",
5995
+ "items": {
5996
+ "allOf": [
5997
+ {
5998
+ "$ref": "#/components/schemas/Meter"
5999
+ },
6000
+ {
6001
+ "$ref": "#/components/schemas/EntityTemplates"
6002
+ }
6003
+ ]
6004
+ }
6005
+ },
6006
+ "files": {
6007
+ "type": "array",
6008
+ "description": "The related files of the requested contract",
6009
+ "items": {
6010
+ "$ref": "#/components/schemas/File"
6011
+ }
6012
+ },
6013
+ "relations": {
6014
+ "type": "array",
6015
+ "description": "The related entities of the requested contract",
6016
+ "items": {
6017
+ "$ref": "#/components/schemas/EntityItem"
6018
+ }
6019
+ },
6020
+ "workflow": {
6021
+ "type": "array",
6022
+ "items": {
6023
+ "$ref": "#/components/schemas/WorkflowExecution"
6024
+ }
6025
+ },
6026
+ "journey_actions": {
6027
+ "type": "array",
6028
+ "items": {
6029
+ "$ref": "#/components/schemas/JourneyActions"
6030
+ }
6031
+ }
6032
+ }
6033
+ }
6034
+ }
6035
+ }
6036
+ },
6037
+ "401": {
6038
+ "$ref": "#/components/responses/Unauthorized"
6039
+ },
6040
+ "403": {
6041
+ "$ref": "#/components/responses/Forbidden"
6042
+ },
6043
+ "404": {
6044
+ "$ref": "#/components/responses/NotFound"
6045
+ },
6046
+ "500": {
6047
+ "$ref": "#/components/responses/InternalServerError"
6048
+ }
6049
+ }
6050
+ },
5882
6051
  "patch": {
5883
6052
  "operationId": "updateContract",
5884
6053
  "summary": "updateContract",
@@ -12013,6 +12182,13 @@
12013
12182
  "type": "boolean",
12014
12183
  "example": true,
12015
12184
  "description": "Require symbols"
12185
+ },
12186
+ "password_history_size": {
12187
+ "type": "integer",
12188
+ "minimum": 0,
12189
+ "maximum": 24,
12190
+ "example": 3,
12191
+ "description": "Number of previous passwords a user is prevented from reusing. Set to 0 to disable reuse prevention. Maps to Cognito's PasswordHistorySize and requires the user pool to be on the Essentials or Plus feature plan."
12016
12192
  }
12017
12193
  }
12018
12194
  }
@@ -18207,6 +18383,13 @@
18207
18383
  "type": "boolean",
18208
18384
  "example": true,
18209
18385
  "description": "Require symbols"
18386
+ },
18387
+ "password_history_size": {
18388
+ "type": "integer",
18389
+ "minimum": 0,
18390
+ "maximum": 24,
18391
+ "example": 3,
18392
+ "description": "Number of previous passwords a user is prevented from reusing. Set to 0 to disable reuse prevention. Maps to Cognito's PasswordHistorySize and requires the user pool to be on the Essentials or Plus feature plan."
18210
18393
  }
18211
18394
  }
18212
18395
  }
@@ -18523,6 +18706,90 @@
18523
18706
  "description": "ID of the portal",
18524
18707
  "example": "453ad7bf-86d5-46c8-8252-bcc868df5e3c"
18525
18708
  },
18709
+ "PortalDataExportColumn": {
18710
+ "type": "object",
18711
+ "description": "One column of the portal data export CSV.",
18712
+ "required": [
18713
+ "key",
18714
+ "header",
18715
+ "source"
18716
+ ],
18717
+ "properties": {
18718
+ "key": {
18719
+ "type": "string",
18720
+ "description": "Stable, immutable column id (snake_case). Append-only contract: never rename, reorder semantics, or remove an existing key; new columns are appended.\n",
18721
+ "example": "vertragsnummer"
18722
+ },
18723
+ "header": {
18724
+ "type": "object",
18725
+ "description": "Localized header label, keyed by language (de, en).",
18726
+ "additionalProperties": {
18727
+ "type": "string"
18728
+ },
18729
+ "example": {
18730
+ "de": "Vertragsnummer",
18731
+ "en": "Contract number"
18732
+ }
18733
+ },
18734
+ "source": {
18735
+ "type": "object",
18736
+ "description": "Where the value comes from: relation hops from the anchor entity plus the attribute to read on the resolved entity. An empty path means the anchor itself.\n",
18737
+ "required": [
18738
+ "attribute"
18739
+ ],
18740
+ "properties": {
18741
+ "path": {
18742
+ "type": "array",
18743
+ "description": "Relation hops from the anchor entity (max 3).",
18744
+ "items": {
18745
+ "type": "string"
18746
+ },
18747
+ "example": [
18748
+ "customer"
18749
+ ]
18750
+ },
18751
+ "attribute": {
18752
+ "type": "string",
18753
+ "description": "Attribute to read on the resolved entity.",
18754
+ "example": "customer_number"
18755
+ },
18756
+ "address_field": {
18757
+ "type": "string",
18758
+ "description": "Which part of an address-typed attribute to render.",
18759
+ "enum": [
18760
+ "full",
18761
+ "street",
18762
+ "street_number",
18763
+ "postal_code",
18764
+ "city",
18765
+ "additional_info",
18766
+ "country"
18767
+ ]
18768
+ }
18769
+ }
18770
+ },
18771
+ "formatter": {
18772
+ "type": "string",
18773
+ "enum": [
18774
+ "text",
18775
+ "date",
18776
+ "money_cents",
18777
+ "enum",
18778
+ "address"
18779
+ ]
18780
+ },
18781
+ "enum_labels": {
18782
+ "type": "object",
18783
+ "description": "Localized value maps for the enum formatter, keyed by language then raw value.\n",
18784
+ "additionalProperties": {
18785
+ "type": "object",
18786
+ "additionalProperties": {
18787
+ "type": "string"
18788
+ }
18789
+ }
18790
+ }
18791
+ }
18792
+ },
18526
18793
  "UpsertPortalConfigV3": {
18527
18794
  "allOf": [
18528
18795
  {
@@ -123,6 +123,34 @@
123
123
  },
124
124
  "403": {
125
125
  "description": "Forbidden"
126
+ },
127
+ "409": {
128
+ "description": "Conflict - the draft was edited by someone else since it was loaded",
129
+ "content": {
130
+ "application/json": {
131
+ "schema": {
132
+ "type": "object",
133
+ "properties": {
134
+ "error": {
135
+ "type": "string",
136
+ "description": "Human-readable conflict message",
137
+ "example": "This draft was edited by someone else. Please reload and try again."
138
+ },
139
+ "current_message": {
140
+ "description": "The current server version of the message (includes updated_by / _updated_at)",
141
+ "allOf": [
142
+ {
143
+ "$ref": "#/components/schemas/BaseEntity"
144
+ },
145
+ {
146
+ "$ref": "#/components/schemas/Message"
147
+ }
148
+ ]
149
+ }
150
+ }
151
+ }
152
+ }
153
+ }
126
154
  }
127
155
  }
128
156
  }
@@ -762,6 +790,41 @@
762
790
  }
763
791
  }
764
792
  },
793
+ "/v2/message/threads:workload": {
794
+ "post": {
795
+ "operationId": "getAssigneeWorkload",
796
+ "summary": "getAssigneeWorkload",
797
+ "description": "Return the open-thread workload for a set of user ids.\n\nFor each requested user id, returns the number of *open* threads assigned\ndirectly to that user — matching what the user sees in their central-inbox\nopen view: in inbox, not trashed, not done, and excluding notification-only\nand spam threads.\n\nOnly threads assigned directly to a user are counted; threads assigned to a\ngroup the user belongs to are not. Intended for assignment load-balancing\n(e.g. even-distribution automations) that need a consistent, inbox-aligned\nworkload per user.\n",
798
+ "tags": [
799
+ "Threads"
800
+ ],
801
+ "requestBody": {
802
+ "required": true,
803
+ "content": {
804
+ "application/json": {
805
+ "schema": {
806
+ "$ref": "#/components/schemas/AssigneeWorkloadParams"
807
+ }
808
+ }
809
+ }
810
+ },
811
+ "responses": {
812
+ "200": {
813
+ "description": "Success",
814
+ "content": {
815
+ "application/json": {
816
+ "schema": {
817
+ "$ref": "#/components/schemas/AssigneeWorkloadResults"
818
+ }
819
+ }
820
+ }
821
+ },
822
+ "403": {
823
+ "description": "Forbidden"
824
+ }
825
+ }
826
+ }
827
+ },
765
828
  "/v1/message/threads": {
766
829
  "put": {
767
830
  "operationId": "updateThread",
@@ -2242,6 +2305,11 @@
2242
2305
  "description": "User ID of user sends the message.",
2243
2306
  "example": "206801"
2244
2307
  },
2308
+ "updated_by": {
2309
+ "type": "string",
2310
+ "description": "User ID of the user who last updated (edited) the message. Set for drafts on each save.",
2311
+ "example": "206801"
2312
+ },
2245
2313
  "subject": {
2246
2314
  "type": "string",
2247
2315
  "description": "Subject",
@@ -2466,6 +2534,11 @@
2466
2534
  "type": "boolean",
2467
2535
  "description": "If true then this attachment is sent via link. The link have to be inserted to email body by API caller. In this case, service doesn't process this attachment.\n",
2468
2536
  "default": false
2537
+ },
2538
+ "save_to_entity": {
2539
+ "type": "boolean",
2540
+ "description": "If false, this file relation is kept on the message (e.g. for CID/inline rendering) but is NOT propagated to the entity the email is sent from. Used for inline images such as logos, signatures and social icons. Defaults to true.\n",
2541
+ "default": true
2469
2542
  }
2470
2543
  }
2471
2544
  },
@@ -2481,6 +2554,11 @@
2481
2554
  "description": "Whether the thread is marked as Done immediately after sending the message",
2482
2555
  "default": false
2483
2556
  },
2557
+ "mark_thread_as_read": {
2558
+ "type": "boolean",
2559
+ "description": "Whether to mark the thread as read by the sender's org/user after sending a reply.\nOnly applies when `parent_id` is set. When false, the thread's `org_read_message` and\n`user_read_message` arrays are left unchanged, so the thread remains unread for anyone\nwho had it unread before. Defaults to true for backward compatibility.\n",
2560
+ "default": true
2561
+ },
2484
2562
  "thread": {
2485
2563
  "type": "object",
2486
2564
  "required": [
@@ -2563,6 +2641,19 @@
2563
2641
  "type": "string",
2564
2642
  "description": "Template ID used for sending message.",
2565
2643
  "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
2644
+ },
2645
+ "source": {
2646
+ "type": "string",
2647
+ "description": "Identifies who triggered the send so server-side policy can branch on it.\nFor `manual` sends, the caller's curated `_tags` are trusted as-is and no\nserver-side enrichment from the referenced `template_id` (e.g. merging the\ntemplate's `email_tags`) is performed. Any non-manual value (or omitting the\nfield) opts into template-derived enrichment.\n",
2648
+ "enum": [
2649
+ "manual",
2650
+ "automation",
2651
+ "workflow",
2652
+ "partner",
2653
+ "bulk",
2654
+ "system"
2655
+ ],
2656
+ "example": "manual"
2566
2657
  }
2567
2658
  }
2568
2659
  },
@@ -2661,6 +2752,60 @@
2661
2752
  }
2662
2753
  }
2663
2754
  },
2755
+ "AssigneeWorkloadParams": {
2756
+ "type": "object",
2757
+ "required": [
2758
+ "user_ids"
2759
+ ],
2760
+ "properties": {
2761
+ "user_ids": {
2762
+ "type": "array",
2763
+ "description": "User ids to compute the open-thread workload for. At most 100 per request; larger requests are rejected with 422.",
2764
+ "minItems": 1,
2765
+ "items": {
2766
+ "type": "string"
2767
+ },
2768
+ "example": [
2769
+ "11000902",
2770
+ "11001053"
2771
+ ]
2772
+ }
2773
+ }
2774
+ },
2775
+ "AssigneeWorkload": {
2776
+ "type": "object",
2777
+ "required": [
2778
+ "user_id",
2779
+ "open_threads"
2780
+ ],
2781
+ "properties": {
2782
+ "user_id": {
2783
+ "type": "string",
2784
+ "description": "The user id.",
2785
+ "example": "11000902"
2786
+ },
2787
+ "open_threads": {
2788
+ "type": "number",
2789
+ "description": "Number of open threads assigned directly to the user.",
2790
+ "example": 2
2791
+ }
2792
+ }
2793
+ },
2794
+ "AssigneeWorkloadResults": {
2795
+ "type": "object",
2796
+ "required": [
2797
+ "workloads"
2798
+ ],
2799
+ "properties": {
2800
+ "workloads": {
2801
+ "type": "array",
2802
+ "description": "Open-thread workload per requested user id, in request order.",
2803
+ "items": {
2804
+ "$ref": "#/components/schemas/AssigneeWorkload"
2805
+ }
2806
+ }
2807
+ }
2808
+ },
2664
2809
  "ReadMessagePayload": {
2665
2810
  "type": "object",
2666
2811
  "required": [
@@ -2785,7 +2930,7 @@
2785
2930
  "timestamp": {
2786
2931
  "type": "string",
2787
2932
  "description": "Timestamp of the event",
2788
- "example": "2024-01-01T00:00:00Z"
2933
+ "example": "2024-01-01T00:00:00.000Z"
2789
2934
  }
2790
2935
  }
2791
2936
  },
@@ -104,7 +104,7 @@
104
104
  "properties": {
105
105
  "last_reading": {
106
106
  "type": "string",
107
- "example": "2022-10-10",
107
+ "example": "2022-10-10T00:00:00.000Z",
108
108
  "description": "The timestamp of the last reading"
109
109
  },
110
110
  "current_consumption": {
@@ -2035,7 +2035,7 @@
2035
2035
  },
2036
2036
  "calibration_date": {
2037
2037
  "type": "string",
2038
- "example": "2022-10-10",
2038
+ "example": "2022-10-10T00:00:00.000Z",
2039
2039
  "description": "The calibration date of the meter"
2040
2040
  },
2041
2041
  "contract": {
@@ -2151,7 +2151,7 @@
2151
2151
  "timestamp": {
2152
2152
  "type": "string",
2153
2153
  "description": "If the value is not provided, the system will be set with the time the request is processed.",
2154
- "example": "2022-10-10",
2154
+ "example": "2022-10-10T00:00:00.000Z",
2155
2155
  "format": "date-time"
2156
2156
  },
2157
2157
  "source": {
@@ -2387,7 +2387,7 @@
2387
2387
  "timestamp": {
2388
2388
  "type": "string",
2389
2389
  "description": "If the value is not provided, the system will be set with the time the request is processed.",
2390
- "example": "2022-10-10",
2390
+ "example": "2022-10-10T00:00:00.000Z",
2391
2391
  "format": "date-time"
2392
2392
  },
2393
2393
  "source": {
@@ -2466,7 +2466,7 @@
2466
2466
  },
2467
2467
  "forecast_as_of": {
2468
2468
  "type": "string",
2469
- "example": "2022-12-10",
2469
+ "example": "2022-12-10T00:00:00.000Z",
2470
2470
  "description": "The date as of which the forecast reading value is applicable"
2471
2471
  },
2472
2472
  "current_consumption": {
@@ -2476,7 +2476,7 @@
2476
2476
  },
2477
2477
  "last_reading": {
2478
2478
  "type": "string",
2479
- "example": "2022-10-10",
2479
+ "example": "2022-10-10T00:00:00.000Z",
2480
2480
  "description": "The timestamp of the last reading"
2481
2481
  },
2482
2482
  "conversion_factor": {