@epilot/cli 0.1.96 → 0.1.97

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.96 — CLI for epilot APIs
32
+ epilot v0.1.97 — CLI for epilot APIs
33
33
 
34
34
  USAGE
35
35
  epilot <api> <operationId> [params...] [flags]
@@ -302,6 +302,71 @@
302
302
  }
303
303
  }
304
304
  },
305
+ "/v1/designs/{designId}/duplicate": {
306
+ "post": {
307
+ "operationId": "duplicateDesign",
308
+ "summary": "duplicateDesign",
309
+ "description": "Duplicate an existing design owned by the user organization. The copy carries over the style, custom CSS and name (marked as a copy) but does NOT carry over journey/portal relations, so the new design starts with 0 consumers, exactly like a freshly created design.",
310
+ "tags": [
311
+ "design-builder"
312
+ ],
313
+ "parameters": [
314
+ {
315
+ "in": "path",
316
+ "name": "designId",
317
+ "required": true,
318
+ "schema": {
319
+ "$ref": "#/components/schemas/DesignId"
320
+ }
321
+ }
322
+ ],
323
+ "responses": {
324
+ "201": {
325
+ "description": "Success - design duplicated with success.",
326
+ "content": {
327
+ "application/json": {
328
+ "schema": {
329
+ "$ref": "#/components/schemas/AddDesignRes"
330
+ }
331
+ }
332
+ }
333
+ },
334
+ "400": {
335
+ "description": "Validation Errors",
336
+ "content": {
337
+ "application/json": {
338
+ "schema": {
339
+ "$ref": "#/components/schemas/ErrorResp"
340
+ }
341
+ }
342
+ }
343
+ },
344
+ "401": {
345
+ "description": "Authentication Errors",
346
+ "content": {
347
+ "application/json": {
348
+ "schema": {
349
+ "$ref": "#/components/schemas/ErrorResp"
350
+ }
351
+ }
352
+ }
353
+ },
354
+ "404": {
355
+ "description": "No design found"
356
+ },
357
+ "500": {
358
+ "description": "Other errors",
359
+ "content": {
360
+ "application/json": {
361
+ "schema": {
362
+ "$ref": "#/components/schemas/ErrorResp"
363
+ }
364
+ }
365
+ }
366
+ }
367
+ }
368
+ }
369
+ },
305
370
  "/v1/designs/{designId}/parse": {
306
371
  "get": {
307
372
  "operationId": "getThemeFromDesign",
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.0.3",
3
3
  "info": {
4
4
  "title": "Integration Toolkit API",
5
- "version": "1.7.0",
5
+ "version": "1.8.0",
6
6
  "description": "API for integrating with external systems in a standardised way."
7
7
  },
8
8
  "tags": [
@@ -7932,6 +7932,20 @@
7932
7932
  "$ref": "#/components/schemas/MeterReadingUpdate"
7933
7933
  }
7934
7934
  },
7935
+ "prune_scope_updates": {
7936
+ "type": "array",
7937
+ "description": "Resolved prune scopes produced by entity mappings using `upsert-prune-scope-purge` / `upsert-prune-scope-delete`. Each entry describes the entities that would be deleted at runtime because they exist in scope but were not part of this payload.",
7938
+ "items": {
7939
+ "$ref": "#/components/schemas/EntityPruneScopeUpdate"
7940
+ }
7941
+ },
7942
+ "meter_readings_prune_scope_updates": {
7943
+ "type": "array",
7944
+ "description": "Resolved prune scopes produced by meter reading mappings using `upsert-prune-scope`. Each entry describes the readings that would be deleted at runtime for a meter (+ counter) because they were not part of this payload.",
7945
+ "items": {
7946
+ "$ref": "#/components/schemas/MeterReadingPruneScopeUpdate"
7947
+ }
7948
+ },
7935
7949
  "warnings": {
7936
7950
  "type": "array",
7937
7951
  "description": "Validation warnings about the configuration (e.g., unique_ids referencing non-indexed fields)",
@@ -7968,7 +7982,8 @@
7968
7982
  "required": [
7969
7983
  "entity_slug",
7970
7984
  "unique_identifiers",
7971
- "attributes"
7985
+ "attributes",
7986
+ "mode"
7972
7987
  ],
7973
7988
  "properties": {
7974
7989
  "entity_slug": {
@@ -7984,6 +7999,38 @@
7984
7999
  "type": "object",
7985
8000
  "description": "Mapped attribute values",
7986
8001
  "additionalProperties": true
8002
+ },
8003
+ "pricing": {
8004
+ "type": "object",
8005
+ "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.",
8006
+ "required": [
8007
+ "config",
8008
+ "data"
8009
+ ],
8010
+ "properties": {
8011
+ "config": {
8012
+ "type": "object",
8013
+ "additionalProperties": true,
8014
+ "description": "The pricing configuration from the entity mapping"
8015
+ },
8016
+ "data": {
8017
+ "type": "array",
8018
+ "description": "The pricing input data extracted from the payload",
8019
+ "items": {
8020
+ "type": "object",
8021
+ "additionalProperties": true
8022
+ }
8023
+ }
8024
+ }
8025
+ },
8026
+ "mode": {
8027
+ "type": "string",
8028
+ "enum": [
8029
+ "upsert",
8030
+ "delete",
8031
+ "purge"
8032
+ ],
8033
+ "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."
7987
8034
  }
7988
8035
  }
7989
8036
  },
@@ -7991,7 +8038,8 @@
7991
8038
  "type": "object",
7992
8039
  "required": [
7993
8040
  "meter",
7994
- "attributes"
8041
+ "attributes",
8042
+ "mode"
7995
8043
  ],
7996
8044
  "properties": {
7997
8045
  "meter": {
@@ -8021,6 +8069,121 @@
8021
8069
  "type": "object",
8022
8070
  "additionalProperties": true,
8023
8071
  "description": "Meter reading attributes. Required: external_id, timestamp, source, value. `timestamp` must be ISO 8601 — either `YYYY-MM-DD` or `YYYY-MM-DDTHH:mm:ss` (with optional fractional seconds and optional `Z` / `±HH:mm` timezone offset); non-ISO formats (e.g. `DD.MM.YYYY` or epoch numbers) are rejected and must be converted upstream via a `jsonataExpression` (e.g. `$fromMillis(...)`). Date-only values are normalized to midnight UTC and offset-less date-times are anchored to UTC before being forwarded to the metering API. `source` must be one of: ECP, ERP, 360, journey-submission. `reason` (optional) must be one of: regular, irregular, last, first, meter_change, contract_change, meter_adjustment (or empty/null)."
8072
+ },
8073
+ "mode": {
8074
+ "type": "string",
8075
+ "enum": [
8076
+ "upsert",
8077
+ "delete"
8078
+ ],
8079
+ "description": "Effective operation mode applied to this reading at runtime. `upsert-prune-scope` configurations report `upsert` here — their destructive part is reported separately in `meter_readings_prune_scope_updates`."
8080
+ }
8081
+ }
8082
+ },
8083
+ "EntityPruneScopeUpdate": {
8084
+ "type": "object",
8085
+ "description": "A resolved entity prune scope. At runtime, entities of `entity_slug` found within `scope` whose unique identifiers are not listed in `keep_unique_ids` are removed using `deletion_mode`.",
8086
+ "required": [
8087
+ "entity_slug",
8088
+ "scope",
8089
+ "keep_unique_ids",
8090
+ "deletion_mode"
8091
+ ],
8092
+ "properties": {
8093
+ "entity_slug": {
8094
+ "type": "string",
8095
+ "description": "The entity type that would be pruned"
8096
+ },
8097
+ "scope": {
8098
+ "type": "object",
8099
+ "description": "The scope configuration resolved against the payload",
8100
+ "required": [
8101
+ "scope_mode"
8102
+ ],
8103
+ "properties": {
8104
+ "scope_mode": {
8105
+ "type": "string",
8106
+ "enum": [
8107
+ "relations",
8108
+ "query"
8109
+ ],
8110
+ "description": "How the entities in scope are found"
8111
+ },
8112
+ "schema": {
8113
+ "type": "string",
8114
+ "description": "Schema of the related entity defining the scope (`relations` scope_mode only)"
8115
+ },
8116
+ "unique_ids": {
8117
+ "type": "object",
8118
+ "additionalProperties": true,
8119
+ "description": "Resolved unique identifiers of the related scope entity (`relations` scope_mode only)"
8120
+ },
8121
+ "query": {
8122
+ "type": "object",
8123
+ "additionalProperties": true,
8124
+ "description": "Resolved query parameters used to find entities in scope (`query` scope_mode only)"
8125
+ }
8126
+ }
8127
+ },
8128
+ "keep_unique_ids": {
8129
+ "type": "array",
8130
+ "description": "Unique identifiers of the entities upserted by this payload. Everything else found in scope would be deleted.",
8131
+ "items": {
8132
+ "type": "object",
8133
+ "additionalProperties": true
8134
+ }
8135
+ },
8136
+ "deletion_mode": {
8137
+ "type": "string",
8138
+ "enum": [
8139
+ "delete",
8140
+ "purge"
8141
+ ],
8142
+ "description": "`delete` soft deletes the pruned entities, `purge` removes them permanently"
8143
+ }
8144
+ }
8145
+ },
8146
+ "MeterReadingPruneScopeUpdate": {
8147
+ "type": "object",
8148
+ "description": "A resolved meter reading prune scope. At runtime, readings of the given meter (+ counter) whose external ids are not listed in `keep_external_ids` are deleted.",
8149
+ "required": [
8150
+ "meter",
8151
+ "keep_external_ids"
8152
+ ],
8153
+ "properties": {
8154
+ "meter": {
8155
+ "type": "object",
8156
+ "required": [
8157
+ "$entity_unique_ids"
8158
+ ],
8159
+ "properties": {
8160
+ "$entity_unique_ids": {
8161
+ "type": "object",
8162
+ "additionalProperties": true,
8163
+ "description": "Unique identifiers for the meter"
8164
+ }
8165
+ }
8166
+ },
8167
+ "meter_counter": {
8168
+ "type": "object",
8169
+ "properties": {
8170
+ "$entity_unique_ids": {
8171
+ "type": "object",
8172
+ "additionalProperties": true,
8173
+ "description": "Unique identifiers for the meter counter"
8174
+ }
8175
+ }
8176
+ },
8177
+ "keep_external_ids": {
8178
+ "type": "array",
8179
+ "description": "External ids of the readings present in this payload. All other readings in scope would be deleted. An empty array means every reading in scope would be deleted.",
8180
+ "items": {
8181
+ "type": "string"
8182
+ }
8183
+ },
8184
+ "source": {
8185
+ "type": "string",
8186
+ "description": "When set, only readings with this source are eligible for pruning (e.g. `ERP`)"
8024
8187
  }
8025
8188
  }
8026
8189
  },
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  API_LIST
4
- } from "../chunk-A4U3GMLI.js";
4
+ } from "../chunk-6BGA56QC.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.96",
14
+ version: "0.1.97",
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-YMYZM32H.js").then((m) => m.default),
34
- upgrade: () => import("../upgrade-VVU7H3SR.js").then((m) => m.default),
33
+ completion: () => import("../completion-6JGII43G.js").then((m) => m.default),
34
+ upgrade: () => import("../upgrade-3IF3ARUQ.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.96" : (await null).default.version;
137
+ var VERSION = true ? "0.1.97" : (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-YMYZM32H.js");
143
+ const { handleCompletions } = await import("../completion-6JGII43G.js");
144
144
  handleCompletions(args[completionsIdx + 1], args[completionsIdx + 2]);
145
145
  process.exit(0);
146
146
  }
@@ -538,13 +538,14 @@ var API_LIST = [
538
538
  kebabName: "design",
539
539
  title: "Design Builder API v2",
540
540
  serverUrl: "https://design-builder-api.sls.epilot.io",
541
- operationCount: 13,
541
+ operationCount: 14,
542
542
  operationIds: [
543
543
  "getAllDesigns",
544
544
  "addDesign",
545
545
  "getDesign",
546
546
  "updateDesign",
547
547
  "deleteDesign",
548
+ "duplicateDesign",
548
549
  "getThemeFromDesign",
549
550
  "getFiles",
550
551
  "uploadFile",
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  API_LIST
4
- } from "./chunk-A4U3GMLI.js";
4
+ } from "./chunk-6BGA56QC.js";
5
5
  import {
6
6
  DIM,
7
7
  GREEN,
@@ -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.96";
75
+ if (true) return "0.1.97";
76
76
  try {
77
77
  const output = execSync("npm ls -g @epilot/cli --depth=0 --json 2>/dev/null", {
78
78
  encoding: "utf-8",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/cli",
3
- "version": "0.1.96",
3
+ "version": "0.1.97",
4
4
  "description": "CLI for epilot APIs",
5
5
  "type": "module",
6
6
  "bin": {