@epilot/cli 0.1.86 → 0.1.88

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.86 — CLI for epilot APIs
32
+ epilot v0.1.88 — CLI for epilot APIs
33
33
 
34
34
  USAGE
35
35
  epilot <api> <operationId> [params...] [flags]
@@ -2256,7 +2256,8 @@
2256
2256
  "type": "string",
2257
2257
  "enum": [
2258
2258
  "tab",
2259
- "group"
2259
+ "group",
2260
+ "widget"
2260
2261
  ]
2261
2262
  },
2262
2263
  "allowed_schemas": {
@@ -3711,7 +3712,7 @@
3711
3712
  },
3712
3713
  "require_password_confirmation": {
3713
3714
  "type": "boolean",
3714
- "description": "Whether the portal user must confirm their current password before the change email request is handed over to the third-party system. When true, the portal collects and verifies the current password before calling the hook. Treated as true when `change_mode` is `synchronous`, since the portal re-creates the login with the confirmed password. Skipped either way for portal users whose identity is managed by an identity provider: an SSO login has no password to confirm.\n",
3715
+ "description": "Whether the portal user must confirm their current password before the change email request is handed over to the third-party system. When true, the portal collects and verifies the current password before calling the hook. Skipped for portal users whose identity is managed by an identity provider: an SSO login has no password to confirm. When no password is confirmed and `change_mode` is `synchronous`, the re-created login gets a random password and the portal user signs in through their identity provider, or sets a new password via the email code flow.\n",
3715
3716
  "default": true
3716
3717
  },
3717
3718
  "explanation": {
@@ -102,6 +102,193 @@
102
102
  }
103
103
  }
104
104
  }
105
+ },
106
+ "/v1/detect-duplicates": {
107
+ "post": {
108
+ "operationId": "detectDuplicates",
109
+ "summary": "detectDuplicates",
110
+ "description": "Detects potential duplicate entities for the given entity using the schema's prioritized uniqueness rules. Returns matches with a confidence score.",
111
+ "tags": [],
112
+ "requestBody": {
113
+ "content": {
114
+ "application/json": {
115
+ "schema": {
116
+ "$ref": "#/components/schemas/DetectDuplicatesRequestBody"
117
+ }
118
+ }
119
+ }
120
+ },
121
+ "responses": {
122
+ "200": {
123
+ "description": "Potential duplicates ranked by rule priority",
124
+ "content": {
125
+ "application/json": {
126
+ "schema": {
127
+ "$ref": "#/components/schemas/DetectDuplicatesResponse"
128
+ }
129
+ }
130
+ }
131
+ }
132
+ }
133
+ }
134
+ },
135
+ "/v1/uniqueness-criteria": {
136
+ "get": {
137
+ "operationId": "listUniquenessCriteria",
138
+ "summary": "listUniquenessCriteria",
139
+ "description": "Lists UniquenessCriteria for the requesting organization. Optionally filtered by schema.",
140
+ "tags": [],
141
+ "parameters": [
142
+ {
143
+ "name": "schema",
144
+ "in": "query",
145
+ "required": false,
146
+ "schema": {
147
+ "type": "string"
148
+ },
149
+ "description": "Filter results to a specific entity schema."
150
+ }
151
+ ],
152
+ "responses": {
153
+ "200": {
154
+ "description": "Array of UniquenessCriteria records",
155
+ "content": {
156
+ "application/json": {
157
+ "schema": {
158
+ "$ref": "#/components/schemas/UniquenessCriteriaListResponse"
159
+ }
160
+ }
161
+ }
162
+ }
163
+ }
164
+ },
165
+ "post": {
166
+ "operationId": "createUniquenessCriteria",
167
+ "summary": "createUniquenessCriteria",
168
+ "description": "Creates a new UniquenessCriteria record.",
169
+ "tags": [],
170
+ "requestBody": {
171
+ "content": {
172
+ "application/json": {
173
+ "schema": {
174
+ "$ref": "#/components/schemas/UniquenessCriteriaCreateBody"
175
+ }
176
+ }
177
+ }
178
+ },
179
+ "responses": {
180
+ "201": {
181
+ "description": "Created record",
182
+ "content": {
183
+ "application/json": {
184
+ "schema": {
185
+ "$ref": "#/components/schemas/UniquenessCriteria"
186
+ }
187
+ }
188
+ }
189
+ }
190
+ }
191
+ }
192
+ },
193
+ "/v1/uniqueness-criteria/{schema}": {
194
+ "get": {
195
+ "operationId": "getUniquenessCriteria",
196
+ "summary": "getUniquenessCriteria",
197
+ "description": "Fetch a single UniquenessCriteria record.",
198
+ "tags": [],
199
+ "parameters": [
200
+ {
201
+ "name": "schema",
202
+ "in": "path",
203
+ "required": true,
204
+ "schema": {
205
+ "type": "string"
206
+ },
207
+ "description": "Entity schema slug."
208
+ }
209
+ ],
210
+ "responses": {
211
+ "200": {
212
+ "description": "The criteria record",
213
+ "content": {
214
+ "application/json": {
215
+ "schema": {
216
+ "$ref": "#/components/schemas/UniquenessCriteria"
217
+ }
218
+ }
219
+ }
220
+ },
221
+ "404": {
222
+ "description": "Record not found"
223
+ }
224
+ }
225
+ },
226
+ "put": {
227
+ "operationId": "updateUniquenessCriteria",
228
+ "summary": "updateUniquenessCriteria",
229
+ "description": "Replace the matchRules on an existing UniquenessCriteria record.",
230
+ "tags": [],
231
+ "parameters": [
232
+ {
233
+ "name": "schema",
234
+ "in": "path",
235
+ "required": true,
236
+ "schema": {
237
+ "type": "string"
238
+ },
239
+ "description": "Entity schema slug."
240
+ }
241
+ ],
242
+ "requestBody": {
243
+ "content": {
244
+ "application/json": {
245
+ "schema": {
246
+ "$ref": "#/components/schemas/UniquenessCriteriaUpdateBody"
247
+ }
248
+ }
249
+ }
250
+ },
251
+ "responses": {
252
+ "200": {
253
+ "description": "Updated record",
254
+ "content": {
255
+ "application/json": {
256
+ "schema": {
257
+ "$ref": "#/components/schemas/UniquenessCriteria"
258
+ }
259
+ }
260
+ }
261
+ },
262
+ "404": {
263
+ "description": "Record not found"
264
+ }
265
+ }
266
+ },
267
+ "delete": {
268
+ "operationId": "deleteUniquenessCriteria",
269
+ "summary": "deleteUniquenessCriteria",
270
+ "description": "Delete a UniquenessCriteria record.",
271
+ "tags": [],
272
+ "parameters": [
273
+ {
274
+ "name": "schema",
275
+ "in": "path",
276
+ "required": true,
277
+ "schema": {
278
+ "type": "string"
279
+ },
280
+ "description": "Entity schema slug."
281
+ }
282
+ ],
283
+ "responses": {
284
+ "204": {
285
+ "description": "Record deleted"
286
+ },
287
+ "404": {
288
+ "description": "Record not found"
289
+ }
290
+ }
291
+ }
105
292
  }
106
293
  },
107
294
  "components": {
@@ -120,20 +307,26 @@
120
307
  "type": "object",
121
308
  "properties": {
122
309
  "toKeep": {
123
- "type": "string"
310
+ "type": "string",
311
+ "minLength": 1,
312
+ "description": "Entity id to keep and merge the duplicates into"
124
313
  },
125
314
  "toDelete": {
126
315
  "type": "array",
127
316
  "items": {
128
- "type": "string"
129
- }
317
+ "type": "string",
318
+ "minLength": 1
319
+ },
320
+ "minItems": 1,
321
+ "description": "Non-empty list of duplicate entity ids to merge into toKeep and delete"
130
322
  }
131
323
  },
132
324
  "required": [
133
325
  "toKeep",
134
326
  "toDelete"
135
327
  ]
136
- }
328
+ },
329
+ "minItems": 1
137
330
  },
138
331
  "DeduplicateRequestResponse": {
139
332
  "type": "array",
@@ -303,6 +496,205 @@
303
496
  "updatedAt"
304
497
  ],
305
498
  "description": "Represents an async deduplication job"
499
+ },
500
+ "DetectDuplicatesRequestBody": {
501
+ "type": "object",
502
+ "properties": {
503
+ "schema": {
504
+ "type": "string",
505
+ "minLength": 1,
506
+ "description": "Entity schema to search (e.g. 'contact'). Must have UniquenessCriteria configured for the calling org."
507
+ },
508
+ "entity": {
509
+ "type": "object",
510
+ "additionalProperties": {},
511
+ "description": "The entity to look up potential duplicates for. Attribute values are extracted from this entity per the schema's match rules; system fields such as '_id' are supported. A rule is evaluated when at least one of its attributes resolves to a non-empty value on this entity; attributes without a value require candidates to also lack a value for them."
512
+ }
513
+ },
514
+ "required": [
515
+ "schema",
516
+ "entity"
517
+ ]
518
+ },
519
+ "DetectDuplicatesResponse": {
520
+ "type": "object",
521
+ "properties": {
522
+ "matches": {
523
+ "type": "array",
524
+ "items": {
525
+ "$ref": "#/components/schemas/DetectedDuplicateMatch"
526
+ }
527
+ }
528
+ },
529
+ "required": [
530
+ "matches"
531
+ ]
532
+ },
533
+ "DetectedDuplicateMatch": {
534
+ "type": "object",
535
+ "properties": {
536
+ "entity": {
537
+ "$ref": "#/components/schemas/Entity"
538
+ },
539
+ "confidence": {
540
+ "type": "number",
541
+ "minimum": 0,
542
+ "maximum": 1,
543
+ "description": "Confidence score for the match, between 0 and 1."
544
+ },
545
+ "matched_attributes": {
546
+ "type": "array",
547
+ "items": {
548
+ "type": "string"
549
+ },
550
+ "minItems": 1,
551
+ "description": "Names of the attributes that matched on the rule that produced this hit."
552
+ }
553
+ },
554
+ "required": [
555
+ "entity",
556
+ "confidence",
557
+ "matched_attributes"
558
+ ]
559
+ },
560
+ "UniquenessCriteriaListResponse": {
561
+ "type": "object",
562
+ "properties": {
563
+ "items": {
564
+ "type": "array",
565
+ "items": {
566
+ "$ref": "#/components/schemas/UniquenessCriteria"
567
+ }
568
+ }
569
+ },
570
+ "required": [
571
+ "items"
572
+ ]
573
+ },
574
+ "UniquenessCriteria": {
575
+ "type": "object",
576
+ "properties": {
577
+ "id": {
578
+ "type": "string",
579
+ "format": "uuid",
580
+ "description": "Unique identifier of the criteria record."
581
+ },
582
+ "orgId": {
583
+ "type": "string",
584
+ "description": "Organization the criteria belong to."
585
+ },
586
+ "schema": {
587
+ "type": "string",
588
+ "minLength": 1,
589
+ "description": "Entity schema these criteria apply to (e.g. 'contact')."
590
+ },
591
+ "matchRules": {
592
+ "type": "array",
593
+ "items": {
594
+ "$ref": "#/components/schemas/MatchRule"
595
+ },
596
+ "minItems": 1,
597
+ "description": "Ordered list of match rules. Order is the evaluation priority."
598
+ },
599
+ "createdAt": {
600
+ "type": "string",
601
+ "description": "ISO 8601 timestamp of record creation.",
602
+ "format": "date-time"
603
+ },
604
+ "updatedAt": {
605
+ "type": "string",
606
+ "description": "ISO 8601 timestamp of last update.",
607
+ "format": "date-time"
608
+ }
609
+ },
610
+ "required": [
611
+ "id",
612
+ "orgId",
613
+ "schema",
614
+ "matchRules",
615
+ "createdAt",
616
+ "updatedAt"
617
+ ],
618
+ "description": "Defines what makes an entity of a given schema unique within an organization."
619
+ },
620
+ "MatchRule": {
621
+ "type": "object",
622
+ "properties": {
623
+ "name": {
624
+ "type": "string",
625
+ "maxLength": 100,
626
+ "description": "Optional human-readable label for the rule. Purely descriptive; not used during matching."
627
+ },
628
+ "attributes": {
629
+ "type": "array",
630
+ "items": {
631
+ "$ref": "#/components/schemas/MatchAttribute"
632
+ },
633
+ "minItems": 1,
634
+ "description": "Attributes that must all match for this rule to fire. Attributes without a value on the source entity must also have no value on a matching candidate."
635
+ },
636
+ "confidence": {
637
+ "type": "number",
638
+ "minimum": 0,
639
+ "maximum": 1,
640
+ "description": "Confidence assigned to matches produced by this rule, between 0 and 1."
641
+ }
642
+ },
643
+ "required": [
644
+ "attributes",
645
+ "confidence"
646
+ ],
647
+ "description": "One way to identify the same entity. Evaluated in order; first rule whose attributes are all available and that returns hits wins."
648
+ },
649
+ "MatchAttribute": {
650
+ "type": "object",
651
+ "properties": {
652
+ "attribute": {
653
+ "type": "string",
654
+ "minLength": 1,
655
+ "description": "Name of the entity attribute to match on. Its query path is resolved from the entity schema at query time."
656
+ }
657
+ },
658
+ "required": [
659
+ "attribute"
660
+ ],
661
+ "description": "One attribute participating in a match rule. Wrapped as an object so per-attribute options can be added later."
662
+ },
663
+ "UniquenessCriteriaCreateBody": {
664
+ "type": "object",
665
+ "properties": {
666
+ "schema": {
667
+ "type": "string",
668
+ "minLength": 1,
669
+ "description": "Entity schema these criteria apply to."
670
+ },
671
+ "matchRules": {
672
+ "type": "array",
673
+ "items": {
674
+ "$ref": "#/components/schemas/MatchRule"
675
+ },
676
+ "minItems": 1
677
+ }
678
+ },
679
+ "required": [
680
+ "schema",
681
+ "matchRules"
682
+ ]
683
+ },
684
+ "UniquenessCriteriaUpdateBody": {
685
+ "type": "object",
686
+ "properties": {
687
+ "matchRules": {
688
+ "type": "array",
689
+ "items": {
690
+ "$ref": "#/components/schemas/MatchRule"
691
+ },
692
+ "minItems": 1
693
+ }
694
+ },
695
+ "required": [
696
+ "matchRules"
697
+ ]
306
698
  }
307
699
  }
308
700
  },
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  API_LIST
4
- } from "../chunk-5D7GCYYX.js";
4
+ } from "../chunk-TGXMWYHZ.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.86",
14
+ version: "0.1.88",
15
15
  description: "CLI for epilot APIs"
16
16
  },
17
17
  args: {
@@ -30,8 +30,8 @@ var main = defineCommand({
30
30
  auth: () => import("../auth-4HG7B2GC.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-N6A4VCAE.js").then((m) => m.default),
34
- upgrade: () => import("../upgrade-KGIYMI4T.js").then((m) => m.default),
33
+ completion: () => import("../completion-NXJUERAR.js").then((m) => m.default),
34
+ upgrade: () => import("../upgrade-34IXMLDG.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.86" : (await null).default.version;
137
+ var VERSION = true ? "0.1.88" : (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-N6A4VCAE.js");
143
+ const { handleCompletions } = await import("../completion-NXJUERAR.js");
144
144
  handleCompletions(args[completionsIdx + 1], args[completionsIdx + 2]);
145
145
  process.exit(0);
146
146
  }
@@ -489,8 +489,18 @@ var API_LIST = [
489
489
  kebabName: "deduplication",
490
490
  title: "Deduplication API",
491
491
  serverUrl: "https://deduplication.sls.epilot.io",
492
- operationCount: 3,
493
- operationIds: ["deduplicate", "deduplicateAsync", "getDeduplicationJob"]
492
+ operationCount: 9,
493
+ operationIds: [
494
+ "deduplicate",
495
+ "deduplicateAsync",
496
+ "getDeduplicationJob",
497
+ "detectDuplicates",
498
+ "listUniquenessCriteria",
499
+ "createUniquenessCriteria",
500
+ "getUniquenessCriteria",
501
+ "updateUniquenessCriteria",
502
+ "deleteUniquenessCriteria"
503
+ ]
494
504
  },
495
505
  {
496
506
  apiName: "design",
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  API_LIST
4
- } from "./chunk-5D7GCYYX.js";
4
+ } from "./chunk-TGXMWYHZ.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.86";
75
+ if (true) return "0.1.88";
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.86",
3
+ "version": "0.1.88",
4
4
  "description": "CLI for epilot APIs",
5
5
  "type": "module",
6
6
  "bin": {