@vectros-ai/mcp-server 0.7.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +101 -0
- package/README.md +41 -3
- package/dist/cli-http.js +513 -528
- package/dist/cli-http.js.map +1 -1
- package/dist/cli-http.mjs +513 -528
- package/dist/cli-http.mjs.map +1 -1
- package/dist/cli.js +513 -528
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +513 -528
- package/dist/cli.mjs.map +1 -1
- package/dist/index.js +376 -525
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +376 -525
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -42,7 +42,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
42
42
|
// src/server.ts
|
|
43
43
|
var import_server = require("@modelcontextprotocol/sdk/server/index.js");
|
|
44
44
|
|
|
45
|
-
//
|
|
45
|
+
// node_modules/@vectros-ai/sdk/dist/index.mjs
|
|
46
46
|
var __defProp2 = Object.defineProperty;
|
|
47
47
|
var __export2 = (target, all) => {
|
|
48
48
|
for (var name in all)
|
|
@@ -57,7 +57,6 @@ __export2(api_exports, {
|
|
|
57
57
|
BatchWriteRequest: () => BatchWriteRequest,
|
|
58
58
|
BatchWriteResult: () => BatchWriteResult,
|
|
59
59
|
ChatMessage: () => ChatMessage,
|
|
60
|
-
ClientRequest: () => ClientRequest,
|
|
61
60
|
ConflictError: () => ConflictError,
|
|
62
61
|
ContentDeltaEvent: () => ContentDeltaEvent,
|
|
63
62
|
ContentTooLargeError: () => ContentTooLargeError,
|
|
@@ -66,6 +65,7 @@ __export2(api_exports, {
|
|
|
66
65
|
DocumentRequest: () => DocumentRequest,
|
|
67
66
|
DocumentResponse: () => DocumentResponse,
|
|
68
67
|
DoneEvent: () => DoneEvent,
|
|
68
|
+
EntityRequest: () => EntityRequest,
|
|
69
69
|
ErasureCertificate: () => ErasureCertificate,
|
|
70
70
|
ErasureRequest: () => ErasureRequest,
|
|
71
71
|
ErasureRequestResponse: () => ErasureRequestResponse,
|
|
@@ -78,15 +78,13 @@ __export2(api_exports, {
|
|
|
78
78
|
ForbiddenError: () => ForbiddenError,
|
|
79
79
|
IdentityLookupRequest: () => IdentityLookupRequest,
|
|
80
80
|
InternalServerError: () => InternalServerError,
|
|
81
|
-
|
|
82
|
-
ListOrgsRequestOrder: () => ListOrgsRequestOrder,
|
|
81
|
+
ListEntitiesRequestOrder: () => ListEntitiesRequestOrder,
|
|
83
82
|
ListUsersRequestOrder: () => ListUsersRequestOrder,
|
|
84
83
|
LookupDocumentsRequestOrder: () => LookupDocumentsRequestOrder,
|
|
85
84
|
LookupRecordsRequestOrder: () => LookupRecordsRequestOrder,
|
|
86
85
|
ModelDataVersionResponse: () => ModelDataVersionResponse,
|
|
87
86
|
NotFoundError: () => NotFoundError,
|
|
88
87
|
NotImplementedError: () => NotImplementedError,
|
|
89
|
-
OrgRequest: () => OrgRequest,
|
|
90
88
|
PaymentRequiredError: () => PaymentRequiredError,
|
|
91
89
|
PingResponse: () => PingResponse,
|
|
92
90
|
RagSearch: () => RagSearch,
|
|
@@ -327,11 +325,6 @@ var UnauthorizedError = class extends VectrosError {
|
|
|
327
325
|
var auth_exports = {};
|
|
328
326
|
var ErasureRequest;
|
|
329
327
|
((ErasureRequest2) => {
|
|
330
|
-
ErasureRequest2.SubjectType = {
|
|
331
|
-
User: "user",
|
|
332
|
-
Client: "client",
|
|
333
|
-
Org: "org"
|
|
334
|
-
};
|
|
335
328
|
ErasureRequest2.AuditDisposition = {
|
|
336
329
|
RetainRedacted: "retain-redacted",
|
|
337
330
|
Purge: "purge"
|
|
@@ -343,11 +336,6 @@ var ExportRequest;
|
|
|
343
336
|
Tenant: "tenant",
|
|
344
337
|
Subject: "subject"
|
|
345
338
|
};
|
|
346
|
-
ExportRequest2.SubjectType = {
|
|
347
|
-
User: "user",
|
|
348
|
-
Client: "client",
|
|
349
|
-
Org: "org"
|
|
350
|
-
};
|
|
351
339
|
ExportRequest2.Format = {
|
|
352
340
|
Ndjson: "ndjson"
|
|
353
341
|
};
|
|
@@ -386,15 +374,10 @@ var LookupDocumentsRequestOrder = {
|
|
|
386
374
|
var folders_exports = {};
|
|
387
375
|
var identity_exports = {};
|
|
388
376
|
__export2(identity_exports, {
|
|
389
|
-
|
|
390
|
-
ListOrgsRequestOrder: () => ListOrgsRequestOrder,
|
|
377
|
+
ListEntitiesRequestOrder: () => ListEntitiesRequestOrder,
|
|
391
378
|
ListUsersRequestOrder: () => ListUsersRequestOrder
|
|
392
379
|
});
|
|
393
|
-
var
|
|
394
|
-
Asc: "asc",
|
|
395
|
-
Desc: "desc"
|
|
396
|
-
};
|
|
397
|
-
var ListOrgsRequestOrder = {
|
|
380
|
+
var ListEntitiesRequestOrder = {
|
|
398
381
|
Asc: "asc",
|
|
399
382
|
Desc: "desc"
|
|
400
383
|
};
|
|
@@ -493,13 +476,6 @@ var ChatMessage;
|
|
|
493
476
|
Assistant: "assistant"
|
|
494
477
|
};
|
|
495
478
|
})(ChatMessage || (ChatMessage = {}));
|
|
496
|
-
var ClientRequest;
|
|
497
|
-
((ClientRequest2) => {
|
|
498
|
-
ClientRequest2.Status = {
|
|
499
|
-
Active: "ACTIVE",
|
|
500
|
-
Suspended: "SUSPENDED"
|
|
501
|
-
};
|
|
502
|
-
})(ClientRequest || (ClientRequest = {}));
|
|
503
479
|
var ContentDeltaEvent;
|
|
504
480
|
((ContentDeltaEvent2) => {
|
|
505
481
|
ContentDeltaEvent2.Event = {
|
|
@@ -554,6 +530,13 @@ var DoneEvent;
|
|
|
554
530
|
Done: "done"
|
|
555
531
|
};
|
|
556
532
|
})(DoneEvent || (DoneEvent = {}));
|
|
533
|
+
var EntityRequest;
|
|
534
|
+
((EntityRequest2) => {
|
|
535
|
+
EntityRequest2.Status = {
|
|
536
|
+
Active: "ACTIVE",
|
|
537
|
+
Suspended: "SUSPENDED"
|
|
538
|
+
};
|
|
539
|
+
})(EntityRequest || (EntityRequest = {}));
|
|
557
540
|
var ErasureCertificate;
|
|
558
541
|
((ErasureCertificate2) => {
|
|
559
542
|
ErasureCertificate2.AuditDisposition = {
|
|
@@ -569,11 +552,6 @@ var ErasureRequestResponse;
|
|
|
569
552
|
Completed: "completed",
|
|
570
553
|
Failed: "failed"
|
|
571
554
|
};
|
|
572
|
-
ErasureRequestResponse2.SubjectType = {
|
|
573
|
-
User: "user",
|
|
574
|
-
Client: "client",
|
|
575
|
-
Org: "org"
|
|
576
|
-
};
|
|
577
555
|
})(ErasureRequestResponse || (ErasureRequestResponse = {}));
|
|
578
556
|
var ErrorEvent;
|
|
579
557
|
((ErrorEvent2) => {
|
|
@@ -599,11 +577,6 @@ var ExportRequestResponse;
|
|
|
599
577
|
Tenant: "tenant",
|
|
600
578
|
Subject: "subject"
|
|
601
579
|
};
|
|
602
|
-
ExportRequestResponse2.SubjectType = {
|
|
603
|
-
User: "user",
|
|
604
|
-
Client: "client",
|
|
605
|
-
Org: "org"
|
|
606
|
-
};
|
|
607
580
|
})(ExportRequestResponse || (ExportRequestResponse = {}));
|
|
608
581
|
var FieldDef;
|
|
609
582
|
((FieldDef2) => {
|
|
@@ -617,13 +590,6 @@ var FieldDef;
|
|
|
617
590
|
Object: "object",
|
|
618
591
|
Reference: "reference"
|
|
619
592
|
};
|
|
620
|
-
FieldDef2.TargetSurface = {
|
|
621
|
-
Record: "record",
|
|
622
|
-
Document: "document",
|
|
623
|
-
User: "user",
|
|
624
|
-
Org: "org",
|
|
625
|
-
Client: "client"
|
|
626
|
-
};
|
|
627
593
|
})(FieldDef || (FieldDef = {}));
|
|
628
594
|
var IdentityLookupRequest;
|
|
629
595
|
((IdentityLookupRequest2) => {
|
|
@@ -640,13 +606,6 @@ var ModelDataVersionResponse;
|
|
|
640
606
|
Delete: "DELETE"
|
|
641
607
|
};
|
|
642
608
|
})(ModelDataVersionResponse || (ModelDataVersionResponse = {}));
|
|
643
|
-
var OrgRequest;
|
|
644
|
-
((OrgRequest2) => {
|
|
645
|
-
OrgRequest2.Status = {
|
|
646
|
-
Active: "ACTIVE",
|
|
647
|
-
Suspended: "SUSPENDED"
|
|
648
|
-
};
|
|
649
|
-
})(OrgRequest || (OrgRequest = {}));
|
|
650
609
|
var PingResponse;
|
|
651
610
|
((PingResponse2) => {
|
|
652
611
|
PingResponse2.Environment = {
|
|
@@ -676,11 +635,6 @@ var RagSearch;
|
|
|
676
635
|
})(RagSearch || (RagSearch = {}));
|
|
677
636
|
var ReadAccessLogResponse;
|
|
678
637
|
((ReadAccessLogResponse2) => {
|
|
679
|
-
ReadAccessLogResponse2.SubjectType = {
|
|
680
|
-
User: "user",
|
|
681
|
-
Client: "client",
|
|
682
|
-
Org: "org"
|
|
683
|
-
};
|
|
684
638
|
ReadAccessLogResponse2.Action = {
|
|
685
639
|
Read: "read",
|
|
686
640
|
List: "list",
|
|
@@ -691,6 +645,10 @@ var ReadAccessLogResponse;
|
|
|
691
645
|
})(ReadAccessLogResponse || (ReadAccessLogResponse = {}));
|
|
692
646
|
var RecordRequest;
|
|
693
647
|
((RecordRequest2) => {
|
|
648
|
+
RecordRequest2.Status = {
|
|
649
|
+
Active: "ACTIVE",
|
|
650
|
+
Archived: "ARCHIVED"
|
|
651
|
+
};
|
|
694
652
|
RecordRequest2.IndexMode = {
|
|
695
653
|
Hybrid: "HYBRID",
|
|
696
654
|
Semantic: "SEMANTIC",
|
|
@@ -700,6 +658,10 @@ var RecordRequest;
|
|
|
700
658
|
})(RecordRequest || (RecordRequest = {}));
|
|
701
659
|
var RecordResponse;
|
|
702
660
|
((RecordResponse2) => {
|
|
661
|
+
RecordResponse2.Status = {
|
|
662
|
+
Active: "ACTIVE",
|
|
663
|
+
Archived: "ARCHIVED"
|
|
664
|
+
};
|
|
703
665
|
RecordResponse2.IndexStatus = {
|
|
704
666
|
PendingIndex: "PENDING_INDEX",
|
|
705
667
|
Indexed: "INDEXED",
|
|
@@ -742,8 +704,7 @@ var SchemaRequest;
|
|
|
742
704
|
Record: "record",
|
|
743
705
|
Document: "document",
|
|
744
706
|
User: "user",
|
|
745
|
-
|
|
746
|
-
Client: "client"
|
|
707
|
+
Entity: "entity"
|
|
747
708
|
};
|
|
748
709
|
})(AllowedSurfaces = SchemaRequest2.AllowedSurfaces || (SchemaRequest2.AllowedSurfaces = {}));
|
|
749
710
|
})(SchemaRequest || (SchemaRequest = {}));
|
|
@@ -766,8 +727,7 @@ var SchemaResponse;
|
|
|
766
727
|
Record: "record",
|
|
767
728
|
Document: "document",
|
|
768
729
|
User: "user",
|
|
769
|
-
|
|
770
|
-
Client: "client"
|
|
730
|
+
Entity: "entity"
|
|
771
731
|
};
|
|
772
732
|
})(AllowedSurfaces = SchemaResponse2.AllowedSurfaces || (SchemaResponse2.AllowedSurfaces = {}));
|
|
773
733
|
})(SchemaResponse || (SchemaResponse = {}));
|
|
@@ -2408,7 +2368,7 @@ var AuthClient = class {
|
|
|
2408
2368
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/jwks");
|
|
2409
2369
|
}
|
|
2410
2370
|
/**
|
|
2411
|
-
* Returns a page of per-subject PHI read-access rows: who read which subject's PHI, when, against which record, and whether any sensitive value was actually revealed in plaintext. Metadata only — never the PHI itself. This is the disclosure-accounting surface from which a covered entity derives its HIPAA §164.528 accounting of disclosures. Provide at least one query axis: a subject (`subjectType` + `subjectId
|
|
2371
|
+
* Returns a page of per-subject PHI read-access rows: who read which subject's PHI, when, against which record, and whether any sensitive value was actually revealed in plaintext. Metadata only — never the PHI itself. This is the disclosure-accounting surface from which a covered entity derives its HIPAA §164.528 accounting of disclosures. Provide at least one query axis: a subject (`subjectType` + `subjectId`) within a `contextId` for the primary accounting query; `resourceId` within a `contextId` for 'who read this record'; `callerKeyId` for 'what did this credential read' (account-wide forensic); or `contextId` alone to enumerate a whole context. `from`/`to` bound the time window. Results are scoped to your account, derived from your token — never from input. Requires the `access-log:r` scope.
|
|
2412
2372
|
*
|
|
2413
2373
|
* @param {Vectros.GetAccessLogRequest} request
|
|
2414
2374
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -2421,7 +2381,6 @@ var AuthClient = class {
|
|
|
2421
2381
|
* subjectType: "user",
|
|
2422
2382
|
* subjectId: "user_abc123",
|
|
2423
2383
|
* contextId: "ctx_intake",
|
|
2424
|
-
* clientId: "client_xyz789",
|
|
2425
2384
|
* action: "read",
|
|
2426
2385
|
* callerKeyId: "key_abc123",
|
|
2427
2386
|
* resourceType: "intake_form",
|
|
@@ -2436,7 +2395,6 @@ var AuthClient = class {
|
|
|
2436
2395
|
subjectType,
|
|
2437
2396
|
subjectId,
|
|
2438
2397
|
contextId,
|
|
2439
|
-
clientId,
|
|
2440
2398
|
from: from_,
|
|
2441
2399
|
to,
|
|
2442
2400
|
action,
|
|
@@ -2451,7 +2409,6 @@ var AuthClient = class {
|
|
|
2451
2409
|
subjectType,
|
|
2452
2410
|
subjectId,
|
|
2453
2411
|
contextId,
|
|
2454
|
-
clientId,
|
|
2455
2412
|
from: from_,
|
|
2456
2413
|
to,
|
|
2457
2414
|
action,
|
|
@@ -2885,7 +2842,7 @@ var AuthClient = class {
|
|
|
2885
2842
|
);
|
|
2886
2843
|
}
|
|
2887
2844
|
/**
|
|
2888
|
-
* Creates a new access profile under the given app context. This call is idempotent by `principalId`: if a profile with the same `principalId` already exists, the existing profile is returned (with status 200) instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing profile was returned) tells the two apart. To overwrite an existing profile's `scopes`/`roleId`, `identityOverrides`, and `status` instead of returning it unchanged, set `?upsert=true` (this also requires the `profiles:u` scope). You must provide exactly one of `scopes` (an inline list of scopes) or `roleId` (a reference to a role); supplying both, or neither, is rejected. `identityOverrides`
|
|
2845
|
+
* Creates a new access profile under the given app context. This call is idempotent by `principalId`: if a profile with the same `principalId` already exists, the existing profile is returned (with status 200) instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing profile was returned) tells the two apart. To overwrite an existing profile's `scopes`/`roleId`, `identityOverrides`, and `status` instead of returning it unchanged, set `?upsert=true` (this also requires the `profiles:u` scope). You must provide exactly one of `scopes` (an inline list of scopes) or `roleId` (a reference to a role); supplying both, or neither, is rejected. `identityOverrides` is keyed by ownership namespace in `scope:<namespace>` form — `scope:org` and `scope:client` for the reserved namespaces, or any namespace you have registered — and may name at most two; any other key (including the account identifier or `userId`) is rejected. If you use a scoped credential, the profile's effective scopes may not exceed your own; a root API key (`sk_`) is exempt. Requires the `profiles:c` scope.
|
|
2889
2846
|
*
|
|
2890
2847
|
* @param {Vectros.CreateAccessProfileRequest} request
|
|
2891
2848
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -3174,7 +3131,7 @@ var AuthClient = class {
|
|
|
3174
3131
|
* roleId: "engineering-member",
|
|
3175
3132
|
* name: "Engineering Team Member",
|
|
3176
3133
|
* scopes: [{
|
|
3177
|
-
* allowed_actions: ["
|
|
3134
|
+
* allowed_actions: ["records:cru", "search:r"]
|
|
3178
3135
|
* }]
|
|
3179
3136
|
* }
|
|
3180
3137
|
* })
|
|
@@ -3722,7 +3679,7 @@ var AuthClient = class {
|
|
|
3722
3679
|
* roleId: "engineering-member",
|
|
3723
3680
|
* name: "Engineering Team Member",
|
|
3724
3681
|
* scopes: [{
|
|
3725
|
-
* allowed_actions: ["
|
|
3682
|
+
* allowed_actions: ["records:cru", "search:r"]
|
|
3726
3683
|
* }]
|
|
3727
3684
|
* }
|
|
3728
3685
|
* })
|
|
@@ -4175,7 +4132,7 @@ var AuthClient = class {
|
|
|
4175
4132
|
* "userId": "550e8400-e29b-41d4-a716-446655440000"
|
|
4176
4133
|
* },
|
|
4177
4134
|
* dataScope: {
|
|
4178
|
-
* "
|
|
4135
|
+
* "scope:org": ["6ba7b810-9dad-11d1-80b4-00c04fd430c8"]
|
|
4179
4136
|
* }
|
|
4180
4137
|
* },
|
|
4181
4138
|
* expiresInSeconds: 3600
|
|
@@ -4625,7 +4582,7 @@ var DocumentsClient = class {
|
|
|
4625
4582
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
4626
4583
|
}
|
|
4627
4584
|
/**
|
|
4628
|
-
* Returns a paginated list of your documents, optionally filtered by folder (`folderId`) and/or owner (`userId
|
|
4585
|
+
* Returns a paginated list of your documents, optionally filtered by folder (`folderId`) and/or owner (`userId` or `scope`). The response is a `{data, nextCursor}` envelope; pass `nextCursor` back as `startFrom` to fetch the next page. Requires the `documents:r` scope.
|
|
4629
4586
|
*
|
|
4630
4587
|
* @param {Vectros.ListDocumentsRequest} request
|
|
4631
4588
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4633,8 +4590,7 @@ var DocumentsClient = class {
|
|
|
4633
4590
|
* @example
|
|
4634
4591
|
* await client.documents.listDocuments({
|
|
4635
4592
|
* userId: "550e8400-e29b-41d4-a716-446655440000",
|
|
4636
|
-
*
|
|
4637
|
-
* clientId: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
4593
|
+
* scope: "group:eng-team",
|
|
4638
4594
|
* folderId: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
4639
4595
|
* startFrom: "doc_prev123"
|
|
4640
4596
|
* })
|
|
@@ -4643,11 +4599,10 @@ var DocumentsClient = class {
|
|
|
4643
4599
|
return HttpResponsePromise.fromPromise(this.__listDocuments(request, requestOptions));
|
|
4644
4600
|
}
|
|
4645
4601
|
async __listDocuments(request = {}, requestOptions) {
|
|
4646
|
-
const { userId,
|
|
4602
|
+
const { userId, scope, folderId, startFrom, limit } = request;
|
|
4647
4603
|
const _queryParams = {
|
|
4648
4604
|
userId,
|
|
4649
|
-
|
|
4650
|
-
clientId,
|
|
4605
|
+
scope,
|
|
4651
4606
|
folderId,
|
|
4652
4607
|
startFrom,
|
|
4653
4608
|
limit
|
|
@@ -4705,9 +4660,10 @@ var DocumentsClient = class {
|
|
|
4705
4660
|
return HttpResponsePromise.fromPromise(this.__ingestDocument(request, requestOptions));
|
|
4706
4661
|
}
|
|
4707
4662
|
async __ingestDocument(request, requestOptions) {
|
|
4708
|
-
const { upsert, body: _body } = request;
|
|
4663
|
+
const { upsert, allowClear, body: _body } = request;
|
|
4709
4664
|
const _queryParams = {
|
|
4710
|
-
upsert
|
|
4665
|
+
upsert,
|
|
4666
|
+
allowClear
|
|
4711
4667
|
};
|
|
4712
4668
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4713
4669
|
const _headers = mergeHeaders(
|
|
@@ -4831,7 +4787,10 @@ var DocumentsClient = class {
|
|
|
4831
4787
|
return HttpResponsePromise.fromPromise(this.__updateDocument(request, requestOptions));
|
|
4832
4788
|
}
|
|
4833
4789
|
async __updateDocument(request, requestOptions) {
|
|
4834
|
-
const { id, body: _body } = request;
|
|
4790
|
+
const { id, allowClear, body: _body } = request;
|
|
4791
|
+
const _queryParams = {
|
|
4792
|
+
allowClear
|
|
4793
|
+
};
|
|
4835
4794
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4836
4795
|
const _headers = mergeHeaders(
|
|
4837
4796
|
_authRequest.headers,
|
|
@@ -4846,7 +4805,7 @@ var DocumentsClient = class {
|
|
|
4846
4805
|
method: "PUT",
|
|
4847
4806
|
headers: _headers,
|
|
4848
4807
|
contentType: "application/json",
|
|
4849
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4808
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
4850
4809
|
requestType: "json",
|
|
4851
4810
|
body: _body,
|
|
4852
4811
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -5375,7 +5334,7 @@ var FoldersClient = class {
|
|
|
5375
5334
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
5376
5335
|
}
|
|
5377
5336
|
/**
|
|
5378
|
-
* Returns a paginated list of your folders. Pass `parentFolderId` to list the direct children of a specific folder (tree navigation); omit it for a flat list across your account. You can also filter by owner using `userId
|
|
5337
|
+
* Returns a paginated list of your folders. Pass `parentFolderId` to list the direct children of a specific folder (tree navigation); omit it for a flat list across your account. You can also filter by owner using `userId` or `scope`. Results are returned as a `{data, nextCursor}` envelope — pass `nextCursor` as `startFrom` to fetch the next page. Requires the `folders:r` scope.
|
|
5379
5338
|
*
|
|
5380
5339
|
* @param {Vectros.ListFoldersRequest} request
|
|
5381
5340
|
* @param {FoldersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5383,9 +5342,8 @@ var FoldersClient = class {
|
|
|
5383
5342
|
* @example
|
|
5384
5343
|
* await client.folders.listFolders({
|
|
5385
5344
|
* parentFolderId: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
5386
|
-
* orgId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
5387
5345
|
* userId: "550e8400-e29b-41d4-a716-446655440000",
|
|
5388
|
-
*
|
|
5346
|
+
* scope: "group:eng-team",
|
|
5389
5347
|
* startFrom: "fld_prev123"
|
|
5390
5348
|
* })
|
|
5391
5349
|
*/
|
|
@@ -5393,12 +5351,11 @@ var FoldersClient = class {
|
|
|
5393
5351
|
return HttpResponsePromise.fromPromise(this.__listFolders(request, requestOptions));
|
|
5394
5352
|
}
|
|
5395
5353
|
async __listFolders(request = {}, requestOptions) {
|
|
5396
|
-
const { parentFolderId,
|
|
5354
|
+
const { parentFolderId, userId, scope, startFrom, limit } = request;
|
|
5397
5355
|
const _queryParams = {
|
|
5398
5356
|
parentFolderId,
|
|
5399
|
-
orgId,
|
|
5400
5357
|
userId,
|
|
5401
|
-
|
|
5358
|
+
scope,
|
|
5402
5359
|
startFrom,
|
|
5403
5360
|
limit
|
|
5404
5361
|
};
|
|
@@ -5684,7 +5641,7 @@ var FoldersClient = class {
|
|
|
5684
5641
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/folders/{id}");
|
|
5685
5642
|
}
|
|
5686
5643
|
/**
|
|
5687
|
-
* Partially updates a folder using an RFC 7386 JSON Merge Patch. The `name`, `description`, and ownership fields (`userId`, `
|
|
5644
|
+
* Partially updates a folder using an RFC 7386 JSON Merge Patch. The `name`, `description`, and ownership fields (`userId`, `scopes`) are applied when present and left unchanged when omitted; sending any of these as null is rejected, because clearing a field is not supported in this release (omit it instead). `slug` and `parentFolderId` are immutable — a folder cannot be re-slugged or moved via the API — and the request is rejected if either is present. Pass `expectedVersion` for optimistic concurrency (you get a 409 if the folder changed since you last read it). Requires the `folders:u` scope.
|
|
5688
5645
|
*
|
|
5689
5646
|
* @param {Vectros.PatchFolderRequest} request
|
|
5690
5647
|
* @param {FoldersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5817,54 +5774,48 @@ var IdentityClient = class {
|
|
|
5817
5774
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
5818
5775
|
}
|
|
5819
5776
|
/**
|
|
5820
|
-
* Returns a paginated list of
|
|
5777
|
+
* Returns a paginated list of entities in a namespace. Filter by `userId` (entities owned by a user), by `externalId` (exact lookup by your own identifier), or by `scope` (`scope=<namespace>:<value>` — entities that have that value as a parent, e.g. `scope=org:6ba7...`). Naming this namespace's own name in `scope` resolves the entity itself (`scope=team:6ba7...` on `/v1/entities/team` returns that team), since an entity is always in its own scope. `userId` and `scope` can be combined to narrow on both dimensions at once; `externalId` identifies a single entity and cannot be combined with either. Requires the `entities:r:<namespace>` scope.
|
|
5821
5778
|
*
|
|
5822
|
-
* @param {Vectros.
|
|
5779
|
+
* @param {Vectros.ListEntitiesRequest} request
|
|
5823
5780
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5824
5781
|
*
|
|
5825
5782
|
* @example
|
|
5826
|
-
* await client.identity.
|
|
5827
|
-
*
|
|
5828
|
-
* userId: "550e8400-e29b-41d4-a716-446655440000",
|
|
5829
|
-
* externalId: "patient_789",
|
|
5830
|
-
* startFrom: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
5831
|
-
* type: "client_v1",
|
|
5832
|
-
* field: "industry",
|
|
5833
|
-
* value: "healthcare",
|
|
5834
|
-
* prefix: "health"
|
|
5783
|
+
* await client.identity.listEntities({
|
|
5784
|
+
* namespace: "team"
|
|
5835
5785
|
* })
|
|
5836
5786
|
*/
|
|
5837
|
-
|
|
5838
|
-
return HttpResponsePromise.fromPromise(this.
|
|
5787
|
+
listEntities(request, requestOptions) {
|
|
5788
|
+
return HttpResponsePromise.fromPromise(this.__listEntities(request, requestOptions));
|
|
5839
5789
|
}
|
|
5840
|
-
async
|
|
5790
|
+
async __listEntities(request, requestOptions) {
|
|
5841
5791
|
const {
|
|
5842
|
-
|
|
5792
|
+
namespace,
|
|
5843
5793
|
userId,
|
|
5844
5794
|
externalId,
|
|
5845
|
-
|
|
5846
|
-
limit,
|
|
5795
|
+
scope,
|
|
5847
5796
|
type: type_,
|
|
5848
5797
|
field,
|
|
5849
5798
|
value,
|
|
5850
5799
|
from: from_,
|
|
5851
5800
|
to,
|
|
5852
5801
|
prefix,
|
|
5853
|
-
order
|
|
5802
|
+
order,
|
|
5803
|
+
startFrom,
|
|
5804
|
+
limit
|
|
5854
5805
|
} = request;
|
|
5855
5806
|
const _queryParams = {
|
|
5856
|
-
orgId,
|
|
5857
5807
|
userId,
|
|
5858
5808
|
externalId,
|
|
5859
|
-
|
|
5860
|
-
limit,
|
|
5809
|
+
scope,
|
|
5861
5810
|
type: type_,
|
|
5862
5811
|
field,
|
|
5863
5812
|
value,
|
|
5864
5813
|
from: from_,
|
|
5865
5814
|
to,
|
|
5866
5815
|
prefix,
|
|
5867
|
-
order: order != null ? order : void 0
|
|
5816
|
+
order: order != null ? order : void 0,
|
|
5817
|
+
startFrom,
|
|
5818
|
+
limit
|
|
5868
5819
|
};
|
|
5869
5820
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5870
5821
|
const _headers = mergeHeaders(
|
|
@@ -5875,7 +5826,7 @@ var IdentityClient = class {
|
|
|
5875
5826
|
const _response = await fetcher({
|
|
5876
5827
|
url: url_exports.join(
|
|
5877
5828
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
5878
|
-
|
|
5829
|
+
`v1/entities/${url_exports.encodePathParam(namespace)}`
|
|
5879
5830
|
),
|
|
5880
5831
|
method: "GET",
|
|
5881
5832
|
headers: _headers,
|
|
@@ -5896,12 +5847,12 @@ var IdentityClient = class {
|
|
|
5896
5847
|
rawResponse: _response.rawResponse
|
|
5897
5848
|
});
|
|
5898
5849
|
}
|
|
5899
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/
|
|
5850
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/entities/{namespace}");
|
|
5900
5851
|
}
|
|
5901
5852
|
/**
|
|
5902
|
-
* Creates a new
|
|
5853
|
+
* Creates a new entity in the given namespace. This call is idempotent on `externalId` within the namespace: if an entity with the same `externalId` already exists, the existing record is returned instead of creating a duplicate (`created: false`, HTTP 200). To overwrite an existing entity's content instead of returning it unchanged, set `?upsert=true` (also requires the `entities:u:<namespace>` scope). The namespace must be entity-backed (`org`/`client`, or registered via `POST /v1/namespaces`). Requires the `entities:c:<namespace>` scope.
|
|
5903
5854
|
*
|
|
5904
|
-
* @param {Vectros.
|
|
5855
|
+
* @param {Vectros.CreateEntityRequest} request
|
|
5905
5856
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5906
5857
|
*
|
|
5907
5858
|
* @throws {@link Vectros.BadRequestError}
|
|
@@ -5909,17 +5860,18 @@ var IdentityClient = class {
|
|
|
5909
5860
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
5910
5861
|
*
|
|
5911
5862
|
* @example
|
|
5912
|
-
* await client.identity.
|
|
5863
|
+
* await client.identity.createEntity({
|
|
5864
|
+
* namespace: "team",
|
|
5913
5865
|
* body: {
|
|
5914
|
-
* externalId: "
|
|
5866
|
+
* externalId: "team_eng_platform"
|
|
5915
5867
|
* }
|
|
5916
5868
|
* })
|
|
5917
5869
|
*/
|
|
5918
|
-
|
|
5919
|
-
return HttpResponsePromise.fromPromise(this.
|
|
5870
|
+
createEntity(request, requestOptions) {
|
|
5871
|
+
return HttpResponsePromise.fromPromise(this.__createEntity(request, requestOptions));
|
|
5920
5872
|
}
|
|
5921
|
-
async
|
|
5922
|
-
const { upsert, body: _body } = request;
|
|
5873
|
+
async __createEntity(request, requestOptions) {
|
|
5874
|
+
const { namespace, upsert, body: _body } = request;
|
|
5923
5875
|
const _queryParams = {
|
|
5924
5876
|
upsert
|
|
5925
5877
|
};
|
|
@@ -5932,7 +5884,7 @@ var IdentityClient = class {
|
|
|
5932
5884
|
const _response = await fetcher({
|
|
5933
5885
|
url: url_exports.join(
|
|
5934
5886
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
5935
|
-
|
|
5887
|
+
`v1/entities/${url_exports.encodePathParam(namespace)}`
|
|
5936
5888
|
),
|
|
5937
5889
|
method: "POST",
|
|
5938
5890
|
headers: _headers,
|
|
@@ -5965,26 +5917,27 @@ var IdentityClient = class {
|
|
|
5965
5917
|
});
|
|
5966
5918
|
}
|
|
5967
5919
|
}
|
|
5968
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/
|
|
5920
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/entities/{namespace}");
|
|
5969
5921
|
}
|
|
5970
5922
|
/**
|
|
5971
|
-
*
|
|
5923
|
+
* Retrieves a single entity by its namespace and Vectros-assigned ID. Requires the `entities:r:<namespace>` scope.
|
|
5972
5924
|
*
|
|
5973
|
-
* @param {Vectros.
|
|
5925
|
+
* @param {Vectros.GetEntityRequest} request
|
|
5974
5926
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5975
5927
|
*
|
|
5976
5928
|
* @throws {@link Vectros.NotFoundError}
|
|
5977
5929
|
*
|
|
5978
5930
|
* @example
|
|
5979
|
-
* await client.identity.
|
|
5980
|
-
*
|
|
5931
|
+
* await client.identity.getEntity({
|
|
5932
|
+
* namespace: "team",
|
|
5933
|
+
* id: "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
|
|
5981
5934
|
* })
|
|
5982
5935
|
*/
|
|
5983
|
-
|
|
5984
|
-
return HttpResponsePromise.fromPromise(this.
|
|
5936
|
+
getEntity(request, requestOptions) {
|
|
5937
|
+
return HttpResponsePromise.fromPromise(this.__getEntity(request, requestOptions));
|
|
5985
5938
|
}
|
|
5986
|
-
async
|
|
5987
|
-
const { id } = request;
|
|
5939
|
+
async __getEntity(request, requestOptions) {
|
|
5940
|
+
const { namespace, id } = request;
|
|
5988
5941
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5989
5942
|
const _headers = mergeHeaders(
|
|
5990
5943
|
_authRequest.headers,
|
|
@@ -5994,7 +5947,7 @@ var IdentityClient = class {
|
|
|
5994
5947
|
const _response = await fetcher({
|
|
5995
5948
|
url: url_exports.join(
|
|
5996
5949
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
5997
|
-
`v1/
|
|
5950
|
+
`v1/entities/${url_exports.encodePathParam(namespace)}/${url_exports.encodePathParam(id)}`
|
|
5998
5951
|
),
|
|
5999
5952
|
method: "GET",
|
|
6000
5953
|
headers: _headers,
|
|
@@ -6020,30 +5973,31 @@ var IdentityClient = class {
|
|
|
6020
5973
|
});
|
|
6021
5974
|
}
|
|
6022
5975
|
}
|
|
6023
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/
|
|
5976
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/entities/{namespace}/{id}");
|
|
6024
5977
|
}
|
|
6025
5978
|
/**
|
|
6026
|
-
* Updates mutable fields
|
|
5979
|
+
* Updates the mutable fields of an entity. Omitted fields are preserved (a null value does not clear a field), and the `payload` object is replaced in full when supplied. Providing `scopes` replaces the entity's parent edges. Requires the `entities:u:<namespace>` scope.
|
|
6027
5980
|
*
|
|
6028
|
-
* @param {Vectros.
|
|
5981
|
+
* @param {Vectros.UpdateEntityRequest} request
|
|
6029
5982
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6030
5983
|
*
|
|
6031
5984
|
* @throws {@link Vectros.NotFoundError}
|
|
6032
5985
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
6033
5986
|
*
|
|
6034
5987
|
* @example
|
|
6035
|
-
* await client.identity.
|
|
5988
|
+
* await client.identity.updateEntity({
|
|
5989
|
+
* namespace: "team",
|
|
6036
5990
|
* id: "id",
|
|
6037
5991
|
* body: {
|
|
6038
|
-
* externalId: "
|
|
5992
|
+
* externalId: "team_eng_platform"
|
|
6039
5993
|
* }
|
|
6040
5994
|
* })
|
|
6041
5995
|
*/
|
|
6042
|
-
|
|
6043
|
-
return HttpResponsePromise.fromPromise(this.
|
|
5996
|
+
updateEntity(request, requestOptions) {
|
|
5997
|
+
return HttpResponsePromise.fromPromise(this.__updateEntity(request, requestOptions));
|
|
6044
5998
|
}
|
|
6045
|
-
async
|
|
6046
|
-
const { id, body: _body } = request;
|
|
5999
|
+
async __updateEntity(request, requestOptions) {
|
|
6000
|
+
const { namespace, id, body: _body } = request;
|
|
6047
6001
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6048
6002
|
const _headers = mergeHeaders(
|
|
6049
6003
|
_authRequest.headers,
|
|
@@ -6053,7 +6007,7 @@ var IdentityClient = class {
|
|
|
6053
6007
|
const _response = await fetcher({
|
|
6054
6008
|
url: url_exports.join(
|
|
6055
6009
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
6056
|
-
`v1/
|
|
6010
|
+
`v1/entities/${url_exports.encodePathParam(namespace)}/${url_exports.encodePathParam(id)}`
|
|
6057
6011
|
),
|
|
6058
6012
|
method: "PUT",
|
|
6059
6013
|
headers: _headers,
|
|
@@ -6084,27 +6038,28 @@ var IdentityClient = class {
|
|
|
6084
6038
|
});
|
|
6085
6039
|
}
|
|
6086
6040
|
}
|
|
6087
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/
|
|
6041
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/entities/{namespace}/{id}");
|
|
6088
6042
|
}
|
|
6089
6043
|
/**
|
|
6090
|
-
* Permanently deletes
|
|
6044
|
+
* Permanently deletes an entity. This action cannot be undone. Requires the `entities:d:<namespace>` scope.
|
|
6091
6045
|
*
|
|
6092
|
-
* @param {Vectros.
|
|
6046
|
+
* @param {Vectros.DeleteEntityRequest} request
|
|
6093
6047
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6094
6048
|
*
|
|
6095
6049
|
* @throws {@link Vectros.NotFoundError}
|
|
6096
6050
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
6097
6051
|
*
|
|
6098
6052
|
* @example
|
|
6099
|
-
* await client.identity.
|
|
6053
|
+
* await client.identity.deleteEntity({
|
|
6054
|
+
* namespace: "team",
|
|
6100
6055
|
* id: "id"
|
|
6101
6056
|
* })
|
|
6102
6057
|
*/
|
|
6103
|
-
|
|
6104
|
-
return HttpResponsePromise.fromPromise(this.
|
|
6058
|
+
deleteEntity(request, requestOptions) {
|
|
6059
|
+
return HttpResponsePromise.fromPromise(this.__deleteEntity(request, requestOptions));
|
|
6105
6060
|
}
|
|
6106
|
-
async
|
|
6107
|
-
const { id } = request;
|
|
6061
|
+
async __deleteEntity(request, requestOptions) {
|
|
6062
|
+
const { namespace, id } = request;
|
|
6108
6063
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6109
6064
|
const _headers = mergeHeaders(
|
|
6110
6065
|
_authRequest.headers,
|
|
@@ -6114,7 +6069,7 @@ var IdentityClient = class {
|
|
|
6114
6069
|
const _response = await fetcher({
|
|
6115
6070
|
url: url_exports.join(
|
|
6116
6071
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
6117
|
-
`v1/
|
|
6072
|
+
`v1/entities/${url_exports.encodePathParam(namespace)}/${url_exports.encodePathParam(id)}`
|
|
6118
6073
|
),
|
|
6119
6074
|
method: "DELETE",
|
|
6120
6075
|
headers: _headers,
|
|
@@ -6142,27 +6097,36 @@ var IdentityClient = class {
|
|
|
6142
6097
|
});
|
|
6143
6098
|
}
|
|
6144
6099
|
}
|
|
6145
|
-
return handleNonStatusCodeError(
|
|
6100
|
+
return handleNonStatusCodeError(
|
|
6101
|
+
_response.error,
|
|
6102
|
+
_response.rawResponse,
|
|
6103
|
+
"DELETE",
|
|
6104
|
+
"/v1/entities/{namespace}/{id}"
|
|
6105
|
+
);
|
|
6146
6106
|
}
|
|
6147
6107
|
/**
|
|
6148
|
-
*
|
|
6108
|
+
* Looks up entities in a namespace by a schema-declared field value, with the criteria in the request body instead of the URL. Use this for a sensitive field: the value travels in the body and never appears in the URL. Body equivalent of the `type`/`field`/`value` lookup on `GET /v1/entities/{namespace}`, which rejects sensitive-field values and directs you here. Requires the `entities:r:<namespace>` scope.
|
|
6149
6109
|
*
|
|
6150
|
-
* @param {Vectros.
|
|
6110
|
+
* @param {Vectros.LookupEntitiesRequest} request
|
|
6151
6111
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6152
6112
|
*
|
|
6153
6113
|
* @throws {@link Vectros.BadRequestError}
|
|
6154
6114
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
6155
6115
|
*
|
|
6156
6116
|
* @example
|
|
6157
|
-
* await client.identity.
|
|
6158
|
-
*
|
|
6159
|
-
*
|
|
6117
|
+
* await client.identity.lookupEntities({
|
|
6118
|
+
* namespace: "team",
|
|
6119
|
+
* body: {
|
|
6120
|
+
* type: "person_v1",
|
|
6121
|
+
* field: "ssn"
|
|
6122
|
+
* }
|
|
6160
6123
|
* })
|
|
6161
6124
|
*/
|
|
6162
|
-
|
|
6163
|
-
return HttpResponsePromise.fromPromise(this.
|
|
6125
|
+
lookupEntities(request, requestOptions) {
|
|
6126
|
+
return HttpResponsePromise.fromPromise(this.__lookupEntities(request, requestOptions));
|
|
6164
6127
|
}
|
|
6165
|
-
async
|
|
6128
|
+
async __lookupEntities(request, requestOptions) {
|
|
6129
|
+
const { namespace, body: _body } = request;
|
|
6166
6130
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6167
6131
|
const _headers = mergeHeaders(
|
|
6168
6132
|
_authRequest.headers,
|
|
@@ -6172,14 +6136,14 @@ var IdentityClient = class {
|
|
|
6172
6136
|
const _response = await fetcher({
|
|
6173
6137
|
url: url_exports.join(
|
|
6174
6138
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
6175
|
-
|
|
6139
|
+
`v1/entities/${url_exports.encodePathParam(namespace)}/lookup`
|
|
6176
6140
|
),
|
|
6177
6141
|
method: "POST",
|
|
6178
6142
|
headers: _headers,
|
|
6179
6143
|
contentType: "application/json",
|
|
6180
6144
|
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6181
6145
|
requestType: "json",
|
|
6182
|
-
body:
|
|
6146
|
+
body: _body,
|
|
6183
6147
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6184
6148
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6185
6149
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6203,26 +6167,32 @@ var IdentityClient = class {
|
|
|
6203
6167
|
});
|
|
6204
6168
|
}
|
|
6205
6169
|
}
|
|
6206
|
-
return handleNonStatusCodeError(
|
|
6170
|
+
return handleNonStatusCodeError(
|
|
6171
|
+
_response.error,
|
|
6172
|
+
_response.rawResponse,
|
|
6173
|
+
"POST",
|
|
6174
|
+
"/v1/entities/{namespace}/lookup"
|
|
6175
|
+
);
|
|
6207
6176
|
}
|
|
6208
6177
|
/**
|
|
6209
|
-
* Returns the audit trail of changes to
|
|
6178
|
+
* Returns the audit trail of changes made to an entity, newest first. Sensitive field values are redacted in the history. Requires the `entities:r:<namespace>` scope.
|
|
6210
6179
|
*
|
|
6211
|
-
* @param {Vectros.
|
|
6180
|
+
* @param {Vectros.GetEntityVersionsRequest} request
|
|
6212
6181
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6213
6182
|
*
|
|
6214
6183
|
* @throws {@link Vectros.NotFoundError}
|
|
6215
6184
|
*
|
|
6216
6185
|
* @example
|
|
6217
|
-
* await client.identity.
|
|
6186
|
+
* await client.identity.getEntityVersions({
|
|
6187
|
+
* namespace: "team",
|
|
6218
6188
|
* id: "id"
|
|
6219
6189
|
* })
|
|
6220
6190
|
*/
|
|
6221
|
-
|
|
6222
|
-
return HttpResponsePromise.fromPromise(this.
|
|
6191
|
+
getEntityVersions(request, requestOptions) {
|
|
6192
|
+
return HttpResponsePromise.fromPromise(this.__getEntityVersions(request, requestOptions));
|
|
6223
6193
|
}
|
|
6224
|
-
async
|
|
6225
|
-
const { id, startFrom } = request;
|
|
6194
|
+
async __getEntityVersions(request, requestOptions) {
|
|
6195
|
+
const { namespace, id, startFrom } = request;
|
|
6226
6196
|
const _queryParams = {
|
|
6227
6197
|
startFrom
|
|
6228
6198
|
};
|
|
@@ -6235,7 +6205,7 @@ var IdentityClient = class {
|
|
|
6235
6205
|
const _response = await fetcher({
|
|
6236
6206
|
url: url_exports.join(
|
|
6237
6207
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
6238
|
-
`v1/
|
|
6208
|
+
`v1/entities/${url_exports.encodePathParam(namespace)}/${url_exports.encodePathParam(id)}/versions`
|
|
6239
6209
|
),
|
|
6240
6210
|
method: "GET",
|
|
6241
6211
|
headers: _headers,
|
|
@@ -6261,174 +6231,31 @@ var IdentityClient = class {
|
|
|
6261
6231
|
});
|
|
6262
6232
|
}
|
|
6263
6233
|
}
|
|
6264
|
-
return handleNonStatusCodeError(
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
* @param {Vectros.ListOrgsRequest} request
|
|
6270
|
-
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6271
|
-
*
|
|
6272
|
-
* @example
|
|
6273
|
-
* await client.identity.listOrgs({
|
|
6274
|
-
* userId: "550e8400-e29b-41d4-a716-446655440000",
|
|
6275
|
-
* externalId: "clinic_001",
|
|
6276
|
-
* startFrom: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
6277
|
-
* type: "org_v1",
|
|
6278
|
-
* field: "region",
|
|
6279
|
-
* value: "us-east",
|
|
6280
|
-
* prefix: "us-"
|
|
6281
|
-
* })
|
|
6282
|
-
*/
|
|
6283
|
-
listOrgs(request = {}, requestOptions) {
|
|
6284
|
-
return HttpResponsePromise.fromPromise(this.__listOrgs(request, requestOptions));
|
|
6285
|
-
}
|
|
6286
|
-
async __listOrgs(request = {}, requestOptions) {
|
|
6287
|
-
const {
|
|
6288
|
-
userId,
|
|
6289
|
-
externalId,
|
|
6290
|
-
startFrom,
|
|
6291
|
-
limit,
|
|
6292
|
-
type: type_,
|
|
6293
|
-
field,
|
|
6294
|
-
value,
|
|
6295
|
-
from: from_,
|
|
6296
|
-
to,
|
|
6297
|
-
prefix,
|
|
6298
|
-
order
|
|
6299
|
-
} = request;
|
|
6300
|
-
const _queryParams = {
|
|
6301
|
-
userId,
|
|
6302
|
-
externalId,
|
|
6303
|
-
startFrom,
|
|
6304
|
-
limit,
|
|
6305
|
-
type: type_,
|
|
6306
|
-
field,
|
|
6307
|
-
value,
|
|
6308
|
-
from: from_,
|
|
6309
|
-
to,
|
|
6310
|
-
prefix,
|
|
6311
|
-
order: order != null ? order : void 0
|
|
6312
|
-
};
|
|
6313
|
-
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6314
|
-
const _headers = mergeHeaders(
|
|
6315
|
-
_authRequest.headers,
|
|
6316
|
-
this._options?.headers,
|
|
6317
|
-
requestOptions?.headers
|
|
6318
|
-
);
|
|
6319
|
-
const _response = await fetcher({
|
|
6320
|
-
url: url_exports.join(
|
|
6321
|
-
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
6322
|
-
"v1/orgs"
|
|
6323
|
-
),
|
|
6324
|
-
method: "GET",
|
|
6325
|
-
headers: _headers,
|
|
6326
|
-
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6327
|
-
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6328
|
-
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6329
|
-
abortSignal: requestOptions?.abortSignal,
|
|
6330
|
-
fetchFn: this._options?.fetch,
|
|
6331
|
-
logging: this._options.logging
|
|
6332
|
-
});
|
|
6333
|
-
if (_response.ok) {
|
|
6334
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
6335
|
-
}
|
|
6336
|
-
if (_response.error.reason === "status-code") {
|
|
6337
|
-
throw new VectrosError({
|
|
6338
|
-
statusCode: _response.error.statusCode,
|
|
6339
|
-
body: _response.error.body,
|
|
6340
|
-
rawResponse: _response.rawResponse
|
|
6341
|
-
});
|
|
6342
|
-
}
|
|
6343
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/orgs");
|
|
6344
|
-
}
|
|
6345
|
-
/**
|
|
6346
|
-
* Creates a new organization in your account. This call is idempotent on `externalId`: if an organization with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing organization was returned) tells the two apart. To overwrite an existing organization's content instead of returning it unchanged, set `?upsert=true` (this also requires the `orgs:u` scope). Requires the `orgs:c` scope.
|
|
6347
|
-
*
|
|
6348
|
-
* @param {Vectros.CreateOrgRequest} request
|
|
6349
|
-
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6350
|
-
*
|
|
6351
|
-
* @throws {@link Vectros.BadRequestError}
|
|
6352
|
-
* @throws {@link Vectros.ForbiddenError}
|
|
6353
|
-
* @throws {@link Vectros.TooManyRequestsError}
|
|
6354
|
-
*
|
|
6355
|
-
* @example
|
|
6356
|
-
* await client.identity.createOrg({
|
|
6357
|
-
* body: {
|
|
6358
|
-
* externalId: "clinic_001"
|
|
6359
|
-
* }
|
|
6360
|
-
* })
|
|
6361
|
-
*/
|
|
6362
|
-
createOrg(request, requestOptions) {
|
|
6363
|
-
return HttpResponsePromise.fromPromise(this.__createOrg(request, requestOptions));
|
|
6364
|
-
}
|
|
6365
|
-
async __createOrg(request, requestOptions) {
|
|
6366
|
-
const { upsert, body: _body } = request;
|
|
6367
|
-
const _queryParams = {
|
|
6368
|
-
upsert
|
|
6369
|
-
};
|
|
6370
|
-
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6371
|
-
const _headers = mergeHeaders(
|
|
6372
|
-
_authRequest.headers,
|
|
6373
|
-
this._options?.headers,
|
|
6374
|
-
requestOptions?.headers
|
|
6234
|
+
return handleNonStatusCodeError(
|
|
6235
|
+
_response.error,
|
|
6236
|
+
_response.rawResponse,
|
|
6237
|
+
"GET",
|
|
6238
|
+
"/v1/entities/{namespace}/{id}/versions"
|
|
6375
6239
|
);
|
|
6376
|
-
const _response = await fetcher({
|
|
6377
|
-
url: url_exports.join(
|
|
6378
|
-
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
6379
|
-
"v1/orgs"
|
|
6380
|
-
),
|
|
6381
|
-
method: "POST",
|
|
6382
|
-
headers: _headers,
|
|
6383
|
-
contentType: "application/json",
|
|
6384
|
-
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6385
|
-
requestType: "json",
|
|
6386
|
-
body: _body,
|
|
6387
|
-
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6388
|
-
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6389
|
-
abortSignal: requestOptions?.abortSignal,
|
|
6390
|
-
fetchFn: this._options?.fetch,
|
|
6391
|
-
logging: this._options.logging
|
|
6392
|
-
});
|
|
6393
|
-
if (_response.ok) {
|
|
6394
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
6395
|
-
}
|
|
6396
|
-
if (_response.error.reason === "status-code") {
|
|
6397
|
-
switch (_response.error.statusCode) {
|
|
6398
|
-
case 400:
|
|
6399
|
-
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6400
|
-
case 403:
|
|
6401
|
-
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6402
|
-
case 429:
|
|
6403
|
-
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6404
|
-
default:
|
|
6405
|
-
throw new VectrosError({
|
|
6406
|
-
statusCode: _response.error.statusCode,
|
|
6407
|
-
body: _response.error.body,
|
|
6408
|
-
rawResponse: _response.rawResponse
|
|
6409
|
-
});
|
|
6410
|
-
}
|
|
6411
|
-
}
|
|
6412
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/orgs");
|
|
6413
6240
|
}
|
|
6414
6241
|
/**
|
|
6415
|
-
* Retrieves a single
|
|
6242
|
+
* Retrieves a single scope-namespace registration by name. The reserved built-ins `org` and `client` are always resolvable.
|
|
6416
6243
|
*
|
|
6417
|
-
* @param {Vectros.
|
|
6244
|
+
* @param {Vectros.GetNamespaceRequest} request
|
|
6418
6245
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6419
6246
|
*
|
|
6420
6247
|
* @throws {@link Vectros.NotFoundError}
|
|
6421
6248
|
*
|
|
6422
6249
|
* @example
|
|
6423
|
-
* await client.identity.
|
|
6424
|
-
*
|
|
6250
|
+
* await client.identity.getNamespace({
|
|
6251
|
+
* namespace: "team"
|
|
6425
6252
|
* })
|
|
6426
6253
|
*/
|
|
6427
|
-
|
|
6428
|
-
return HttpResponsePromise.fromPromise(this.
|
|
6254
|
+
getNamespace(request, requestOptions) {
|
|
6255
|
+
return HttpResponsePromise.fromPromise(this.__getNamespace(request, requestOptions));
|
|
6429
6256
|
}
|
|
6430
|
-
async
|
|
6431
|
-
const {
|
|
6257
|
+
async __getNamespace(request, requestOptions) {
|
|
6258
|
+
const { namespace } = request;
|
|
6432
6259
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6433
6260
|
const _headers = mergeHeaders(
|
|
6434
6261
|
_authRequest.headers,
|
|
@@ -6438,7 +6265,7 @@ var IdentityClient = class {
|
|
|
6438
6265
|
const _response = await fetcher({
|
|
6439
6266
|
url: url_exports.join(
|
|
6440
6267
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
6441
|
-
`v1/
|
|
6268
|
+
`v1/namespaces/${url_exports.encodePathParam(namespace)}`
|
|
6442
6269
|
),
|
|
6443
6270
|
method: "GET",
|
|
6444
6271
|
headers: _headers,
|
|
@@ -6464,30 +6291,31 @@ var IdentityClient = class {
|
|
|
6464
6291
|
});
|
|
6465
6292
|
}
|
|
6466
6293
|
}
|
|
6467
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/
|
|
6294
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/namespaces/{namespace}");
|
|
6468
6295
|
}
|
|
6469
6296
|
/**
|
|
6470
|
-
* Updates the mutable fields
|
|
6297
|
+
* Updates the mutable fields (`entityBacked`, `defaultSchemaId`) of a registered namespace. The namespace name itself is immutable. Requires a root API key. The reserved built-ins cannot be updated.
|
|
6471
6298
|
*
|
|
6472
|
-
* @param {Vectros.
|
|
6299
|
+
* @param {Vectros.UpdateNamespaceRequest} request
|
|
6473
6300
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6474
6301
|
*
|
|
6302
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
6475
6303
|
* @throws {@link Vectros.NotFoundError}
|
|
6476
6304
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
6477
6305
|
*
|
|
6478
6306
|
* @example
|
|
6479
|
-
* await client.identity.
|
|
6480
|
-
*
|
|
6307
|
+
* await client.identity.updateNamespace({
|
|
6308
|
+
* namespace: "team",
|
|
6481
6309
|
* body: {
|
|
6482
|
-
*
|
|
6310
|
+
* namespace: "team"
|
|
6483
6311
|
* }
|
|
6484
6312
|
* })
|
|
6485
6313
|
*/
|
|
6486
|
-
|
|
6487
|
-
return HttpResponsePromise.fromPromise(this.
|
|
6314
|
+
updateNamespace(request, requestOptions) {
|
|
6315
|
+
return HttpResponsePromise.fromPromise(this.__updateNamespace(request, requestOptions));
|
|
6488
6316
|
}
|
|
6489
|
-
async
|
|
6490
|
-
const {
|
|
6317
|
+
async __updateNamespace(request, requestOptions) {
|
|
6318
|
+
const { namespace, body: _body } = request;
|
|
6491
6319
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6492
6320
|
const _headers = mergeHeaders(
|
|
6493
6321
|
_authRequest.headers,
|
|
@@ -6497,7 +6325,7 @@ var IdentityClient = class {
|
|
|
6497
6325
|
const _response = await fetcher({
|
|
6498
6326
|
url: url_exports.join(
|
|
6499
6327
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
6500
|
-
`v1/
|
|
6328
|
+
`v1/namespaces/${url_exports.encodePathParam(namespace)}`
|
|
6501
6329
|
),
|
|
6502
6330
|
method: "PUT",
|
|
6503
6331
|
headers: _headers,
|
|
@@ -6516,6 +6344,8 @@ var IdentityClient = class {
|
|
|
6516
6344
|
}
|
|
6517
6345
|
if (_response.error.reason === "status-code") {
|
|
6518
6346
|
switch (_response.error.statusCode) {
|
|
6347
|
+
case 403:
|
|
6348
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6519
6349
|
case 404:
|
|
6520
6350
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6521
6351
|
case 429:
|
|
@@ -6528,27 +6358,28 @@ var IdentityClient = class {
|
|
|
6528
6358
|
});
|
|
6529
6359
|
}
|
|
6530
6360
|
}
|
|
6531
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/
|
|
6361
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/namespaces/{namespace}");
|
|
6532
6362
|
}
|
|
6533
6363
|
/**
|
|
6534
|
-
*
|
|
6364
|
+
* Deletes a registered scope namespace. Requires a root API key. The reserved built-ins cannot be deleted. A namespace that still has entities cannot be deleted (409) — delete its entities first; this keeps them reachable by the account-teardown and erasure sweeps.
|
|
6535
6365
|
*
|
|
6536
|
-
* @param {Vectros.
|
|
6366
|
+
* @param {Vectros.DeleteNamespaceRequest} request
|
|
6537
6367
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6538
6368
|
*
|
|
6369
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
6539
6370
|
* @throws {@link Vectros.NotFoundError}
|
|
6540
6371
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
6541
6372
|
*
|
|
6542
6373
|
* @example
|
|
6543
|
-
* await client.identity.
|
|
6544
|
-
*
|
|
6374
|
+
* await client.identity.deleteNamespace({
|
|
6375
|
+
* namespace: "team"
|
|
6545
6376
|
* })
|
|
6546
6377
|
*/
|
|
6547
|
-
|
|
6548
|
-
return HttpResponsePromise.fromPromise(this.
|
|
6378
|
+
deleteNamespace(request, requestOptions) {
|
|
6379
|
+
return HttpResponsePromise.fromPromise(this.__deleteNamespace(request, requestOptions));
|
|
6549
6380
|
}
|
|
6550
|
-
async
|
|
6551
|
-
const {
|
|
6381
|
+
async __deleteNamespace(request, requestOptions) {
|
|
6382
|
+
const { namespace } = request;
|
|
6552
6383
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6553
6384
|
const _headers = mergeHeaders(
|
|
6554
6385
|
_authRequest.headers,
|
|
@@ -6558,7 +6389,7 @@ var IdentityClient = class {
|
|
|
6558
6389
|
const _response = await fetcher({
|
|
6559
6390
|
url: url_exports.join(
|
|
6560
6391
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
6561
|
-
`v1/
|
|
6392
|
+
`v1/namespaces/${url_exports.encodePathParam(namespace)}`
|
|
6562
6393
|
),
|
|
6563
6394
|
method: "DELETE",
|
|
6564
6395
|
headers: _headers,
|
|
@@ -6574,6 +6405,8 @@ var IdentityClient = class {
|
|
|
6574
6405
|
}
|
|
6575
6406
|
if (_response.error.reason === "status-code") {
|
|
6576
6407
|
switch (_response.error.statusCode) {
|
|
6408
|
+
case 403:
|
|
6409
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6577
6410
|
case 404:
|
|
6578
6411
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6579
6412
|
case 429:
|
|
@@ -6586,27 +6419,26 @@ var IdentityClient = class {
|
|
|
6586
6419
|
});
|
|
6587
6420
|
}
|
|
6588
6421
|
}
|
|
6589
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/
|
|
6422
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/namespaces/{namespace}");
|
|
6590
6423
|
}
|
|
6591
6424
|
/**
|
|
6592
|
-
*
|
|
6425
|
+
* Returns the scope namespaces registered in your account, with the reserved built-ins `org` and `client` listed first. Returns a `{data, nextCursor}` envelope.
|
|
6593
6426
|
*
|
|
6594
|
-
* @param {Vectros.
|
|
6427
|
+
* @param {Vectros.ListNamespacesRequest} request
|
|
6595
6428
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6596
6429
|
*
|
|
6597
|
-
* @throws {@link Vectros.BadRequestError}
|
|
6598
|
-
* @throws {@link Vectros.TooManyRequestsError}
|
|
6599
|
-
*
|
|
6600
6430
|
* @example
|
|
6601
|
-
* await client.identity.
|
|
6602
|
-
* type: "person_v1",
|
|
6603
|
-
* field: "ssn"
|
|
6604
|
-
* })
|
|
6431
|
+
* await client.identity.listNamespaces()
|
|
6605
6432
|
*/
|
|
6606
|
-
|
|
6607
|
-
return HttpResponsePromise.fromPromise(this.
|
|
6433
|
+
listNamespaces(request = {}, requestOptions) {
|
|
6434
|
+
return HttpResponsePromise.fromPromise(this.__listNamespaces(request, requestOptions));
|
|
6608
6435
|
}
|
|
6609
|
-
async
|
|
6436
|
+
async __listNamespaces(request = {}, requestOptions) {
|
|
6437
|
+
const { startFrom, limit } = request;
|
|
6438
|
+
const _queryParams = {
|
|
6439
|
+
startFrom,
|
|
6440
|
+
limit
|
|
6441
|
+
};
|
|
6610
6442
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6611
6443
|
const _headers = mergeHeaders(
|
|
6612
6444
|
_authRequest.headers,
|
|
@@ -6616,14 +6448,11 @@ var IdentityClient = class {
|
|
|
6616
6448
|
const _response = await fetcher({
|
|
6617
6449
|
url: url_exports.join(
|
|
6618
6450
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
6619
|
-
"v1/
|
|
6451
|
+
"v1/namespaces"
|
|
6620
6452
|
),
|
|
6621
|
-
method: "
|
|
6453
|
+
method: "GET",
|
|
6622
6454
|
headers: _headers,
|
|
6623
|
-
|
|
6624
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6625
|
-
requestType: "json",
|
|
6626
|
-
body: request,
|
|
6455
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6627
6456
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6628
6457
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6629
6458
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6634,42 +6463,33 @@ var IdentityClient = class {
|
|
|
6634
6463
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
6635
6464
|
}
|
|
6636
6465
|
if (_response.error.reason === "status-code") {
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
default:
|
|
6643
|
-
throw new VectrosError({
|
|
6644
|
-
statusCode: _response.error.statusCode,
|
|
6645
|
-
body: _response.error.body,
|
|
6646
|
-
rawResponse: _response.rawResponse
|
|
6647
|
-
});
|
|
6648
|
-
}
|
|
6466
|
+
throw new VectrosError({
|
|
6467
|
+
statusCode: _response.error.statusCode,
|
|
6468
|
+
body: _response.error.body,
|
|
6469
|
+
rawResponse: _response.rawResponse
|
|
6470
|
+
});
|
|
6649
6471
|
}
|
|
6650
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "
|
|
6472
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/namespaces");
|
|
6651
6473
|
}
|
|
6652
6474
|
/**
|
|
6653
|
-
*
|
|
6475
|
+
* Registers a new scope namespace and declares whether its values resolve to identity entities (`entityBacked`). Requires a root API key. The reserved names `org` and `client` are built in and cannot be registered.
|
|
6654
6476
|
*
|
|
6655
|
-
* @param {Vectros.
|
|
6477
|
+
* @param {Vectros.NamespaceRequest} request
|
|
6656
6478
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6657
6479
|
*
|
|
6658
|
-
* @throws {@link Vectros.
|
|
6480
|
+
* @throws {@link Vectros.BadRequestError}
|
|
6481
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
6482
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6659
6483
|
*
|
|
6660
6484
|
* @example
|
|
6661
|
-
* await client.identity.
|
|
6662
|
-
*
|
|
6485
|
+
* await client.identity.registerNamespace({
|
|
6486
|
+
* namespace: "team"
|
|
6663
6487
|
* })
|
|
6664
6488
|
*/
|
|
6665
|
-
|
|
6666
|
-
return HttpResponsePromise.fromPromise(this.
|
|
6489
|
+
registerNamespace(request, requestOptions) {
|
|
6490
|
+
return HttpResponsePromise.fromPromise(this.__registerNamespace(request, requestOptions));
|
|
6667
6491
|
}
|
|
6668
|
-
async
|
|
6669
|
-
const { id, startFrom } = request;
|
|
6670
|
-
const _queryParams = {
|
|
6671
|
-
startFrom
|
|
6672
|
-
};
|
|
6492
|
+
async __registerNamespace(request, requestOptions) {
|
|
6673
6493
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6674
6494
|
const _headers = mergeHeaders(
|
|
6675
6495
|
_authRequest.headers,
|
|
@@ -6679,11 +6499,14 @@ var IdentityClient = class {
|
|
|
6679
6499
|
const _response = await fetcher({
|
|
6680
6500
|
url: url_exports.join(
|
|
6681
6501
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
6682
|
-
|
|
6502
|
+
"v1/namespaces"
|
|
6683
6503
|
),
|
|
6684
|
-
method: "
|
|
6504
|
+
method: "POST",
|
|
6685
6505
|
headers: _headers,
|
|
6686
|
-
|
|
6506
|
+
contentType: "application/json",
|
|
6507
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6508
|
+
requestType: "json",
|
|
6509
|
+
body: request,
|
|
6687
6510
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6688
6511
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6689
6512
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6695,8 +6518,12 @@ var IdentityClient = class {
|
|
|
6695
6518
|
}
|
|
6696
6519
|
if (_response.error.reason === "status-code") {
|
|
6697
6520
|
switch (_response.error.statusCode) {
|
|
6698
|
-
case
|
|
6699
|
-
throw new
|
|
6521
|
+
case 400:
|
|
6522
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6523
|
+
case 403:
|
|
6524
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6525
|
+
case 429:
|
|
6526
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6700
6527
|
default:
|
|
6701
6528
|
throw new VectrosError({
|
|
6702
6529
|
statusCode: _response.error.statusCode,
|
|
@@ -6705,7 +6532,7 @@ var IdentityClient = class {
|
|
|
6705
6532
|
});
|
|
6706
6533
|
}
|
|
6707
6534
|
}
|
|
6708
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "
|
|
6535
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/namespaces");
|
|
6709
6536
|
}
|
|
6710
6537
|
/**
|
|
6711
6538
|
* Returns a paginated list of the users in your account. Pass `externalId` to look up a single user by your own identifier. To filter on schema-declared lookup fields, supply `type` and `field` together with one lookup mode: `value` (exact match), `from`+`to` (range), or `prefix`. Requires the `users:r` scope.
|
|
@@ -7582,7 +7409,7 @@ var RecordsClient = class {
|
|
|
7582
7409
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/records/batch");
|
|
7583
7410
|
}
|
|
7584
7411
|
/**
|
|
7585
|
-
* Returns a paginated list of records in your account as a `{data, nextCursor}` page. Supply exactly one of `type`, `folderId`, or `recent=true` to choose the mode: `type` lists all records of a single type; `folderId` lists all records in a folder (any type); and `recent=true` returns the account-wide recently-updated feed across all types, newest first. You may combine `type` with `folderId` to list a single type within a folder. The owner filters (`userId`, `
|
|
7412
|
+
* Returns a paginated list of records in your account as a `{data, nextCursor}` page. Supply exactly one of `type`, `folderId`, or `recent=true` to choose the mode: `type` lists all records of a single type; `folderId` lists all records in a folder (any type); and `recent=true` returns the account-wide recently-updated feed across all types, newest first. You may combine `type` with `folderId` to list a single type within a folder. The owner filters (`userId`, `scope`) further narrow the type and folder modes; the `recent` feed is standalone and ignores all filters. Each token only sees the record types it is scoped to read. Requires the `records:r` scope. By default the response returns the indexed projection of each record; set `includePayload=true` to include full payloads.
|
|
7586
7413
|
*
|
|
7587
7414
|
* @param {Vectros.ListRecordsRequest} request
|
|
7588
7415
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -7592,8 +7419,7 @@ var RecordsClient = class {
|
|
|
7592
7419
|
* type: "intake_form",
|
|
7593
7420
|
* folderId: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
7594
7421
|
* userId: "550e8400-e29b-41d4-a716-446655440000",
|
|
7595
|
-
*
|
|
7596
|
-
* clientId: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
7422
|
+
* scope: "group:eng-team",
|
|
7597
7423
|
* startFrom: "550e8400-e29b-41d4-a716-446655440000"
|
|
7598
7424
|
* })
|
|
7599
7425
|
*/
|
|
@@ -7601,13 +7427,12 @@ var RecordsClient = class {
|
|
|
7601
7427
|
return HttpResponsePromise.fromPromise(this.__listRecords(request, requestOptions));
|
|
7602
7428
|
}
|
|
7603
7429
|
async __listRecords(request = {}, requestOptions) {
|
|
7604
|
-
const { type: type_, folderId, userId,
|
|
7430
|
+
const { type: type_, folderId, userId, scope, startFrom, limit, includePayload, recent } = request;
|
|
7605
7431
|
const _queryParams = {
|
|
7606
7432
|
type: type_,
|
|
7607
7433
|
folderId,
|
|
7608
7434
|
userId,
|
|
7609
|
-
|
|
7610
|
-
clientId,
|
|
7435
|
+
scope,
|
|
7611
7436
|
startFrom,
|
|
7612
7437
|
limit,
|
|
7613
7438
|
includePayload,
|
|
@@ -7672,9 +7497,10 @@ var RecordsClient = class {
|
|
|
7672
7497
|
return HttpResponsePromise.fromPromise(this.__createRecord(request, requestOptions));
|
|
7673
7498
|
}
|
|
7674
7499
|
async __createRecord(request, requestOptions) {
|
|
7675
|
-
const { upsert, body: _body } = request;
|
|
7500
|
+
const { upsert, allowClear, body: _body } = request;
|
|
7676
7501
|
const _queryParams = {
|
|
7677
|
-
upsert
|
|
7502
|
+
upsert,
|
|
7503
|
+
allowClear
|
|
7678
7504
|
};
|
|
7679
7505
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
7680
7506
|
const _headers = mergeHeaders(
|
|
@@ -7796,7 +7622,10 @@ var RecordsClient = class {
|
|
|
7796
7622
|
return HttpResponsePromise.fromPromise(this.__updateRecord(request, requestOptions));
|
|
7797
7623
|
}
|
|
7798
7624
|
async __updateRecord(request, requestOptions) {
|
|
7799
|
-
const { id, body: _body } = request;
|
|
7625
|
+
const { id, allowClear, body: _body } = request;
|
|
7626
|
+
const _queryParams = {
|
|
7627
|
+
allowClear
|
|
7628
|
+
};
|
|
7800
7629
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
7801
7630
|
const _headers = mergeHeaders(
|
|
7802
7631
|
_authRequest.headers,
|
|
@@ -7811,7 +7640,7 @@ var RecordsClient = class {
|
|
|
7811
7640
|
method: "PUT",
|
|
7812
7641
|
headers: _headers,
|
|
7813
7642
|
contentType: "application/json",
|
|
7814
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
7643
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
7815
7644
|
requestType: "json",
|
|
7816
7645
|
body: _body,
|
|
7817
7646
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -7902,7 +7731,7 @@ var RecordsClient = class {
|
|
|
7902
7731
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/records/{id}");
|
|
7903
7732
|
}
|
|
7904
7733
|
/**
|
|
7905
|
-
* Partially updates a record using an RFC 7386 JSON Merge Patch. The `payload` object is deep-merged into the existing payload: keys you send overwrite (recursing into nested objects), a key set to null is deleted, and keys you omit are left unchanged — so you can change a single field without re-sending the rest (unlike the full-replacement PUT). Top-level fields (`status`, `folderId`, `userId`, `
|
|
7734
|
+
* Partially updates a record using an RFC 7386 JSON Merge Patch. The `payload` object is deep-merged into the existing payload: keys you send overwrite (recursing into nested objects), a key set to null is deleted, and keys you omit are left unchanged — so you can change a single field without re-sending the rest (unlike the full-replacement PUT). Top-level fields (`status`, `folderId`, `userId`, `scopes`) are set when present and left unchanged when omitted; sending a top-level field as null is rejected (clearing a top-level field is not supported in this release — omit it instead). `typeName`, `schemaId`, `externalId`, and `indexMode` are immutable and rejected if present. The merged result is validated against the schema. Pass `expectedVersion` to make the patch conditional (optimistic concurrency, 409 on conflict). Requires the `records:u:<type>` scope.
|
|
7906
7735
|
*
|
|
7907
7736
|
* @param {Vectros.PatchRecordRequest} request
|
|
7908
7737
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -8228,7 +8057,7 @@ var SchemasClient = class {
|
|
|
8228
8057
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
8229
8058
|
}
|
|
8230
8059
|
/**
|
|
8231
|
-
* Returns a paginated list of the record schemas defined in your account. Filter by `userId` or `
|
|
8060
|
+
* Returns a paginated list of the record schemas defined in your account. Filter by `userId` or `scope` to scope to an owner, by `surface` to list the types bindable to one surface, or by `recordType` to resolve the single schema for a type directly. Filtering by an identity surface (`user` or `entity`) lists your account-wide identity schemas regardless of the calling context; filtering by record or document lists within the calling context. Requires the `schemas:r` scope.
|
|
8232
8061
|
*
|
|
8233
8062
|
* @param {Vectros.ListSchemasRequest} request
|
|
8234
8063
|
* @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -8236,7 +8065,7 @@ var SchemasClient = class {
|
|
|
8236
8065
|
* @example
|
|
8237
8066
|
* await client.schemas.listSchemas({
|
|
8238
8067
|
* userId: "550e8400-e29b-41d4-a716-446655440000",
|
|
8239
|
-
*
|
|
8068
|
+
* scope: "org:6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
8240
8069
|
* surface: "document",
|
|
8241
8070
|
* recordType: "intake_form",
|
|
8242
8071
|
* startFrom: "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
|
|
@@ -8246,10 +8075,10 @@ var SchemasClient = class {
|
|
|
8246
8075
|
return HttpResponsePromise.fromPromise(this.__listSchemas(request, requestOptions));
|
|
8247
8076
|
}
|
|
8248
8077
|
async __listSchemas(request = {}, requestOptions) {
|
|
8249
|
-
const { userId,
|
|
8078
|
+
const { userId, scope, surface, recordType, startFrom, limit } = request;
|
|
8250
8079
|
const _queryParams = {
|
|
8251
8080
|
userId,
|
|
8252
|
-
|
|
8081
|
+
scope,
|
|
8253
8082
|
surface,
|
|
8254
8083
|
recordType,
|
|
8255
8084
|
startFrom,
|
|
@@ -8695,12 +8524,12 @@ var VectrosClient = class {
|
|
|
8695
8524
|
get auth() {
|
|
8696
8525
|
return this._auth ?? (this._auth = new AuthClient(this._options));
|
|
8697
8526
|
}
|
|
8698
|
-
get identity() {
|
|
8699
|
-
return this._identity ?? (this._identity = new IdentityClient(this._options));
|
|
8700
|
-
}
|
|
8701
8527
|
get documents() {
|
|
8702
8528
|
return this._documents ?? (this._documents = new DocumentsClient(this._options));
|
|
8703
8529
|
}
|
|
8530
|
+
get identity() {
|
|
8531
|
+
return this._identity ?? (this._identity = new IdentityClient(this._options));
|
|
8532
|
+
}
|
|
8704
8533
|
get compliance() {
|
|
8705
8534
|
return this._compliance ?? (this._compliance = new ComplianceClient(this._options));
|
|
8706
8535
|
}
|
|
@@ -8798,8 +8627,8 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
8798
8627
|
|
|
8799
8628
|
// src/build-info.ts
|
|
8800
8629
|
var BUILD_INFO = {
|
|
8801
|
-
mcpServer: true ? "0.
|
|
8802
|
-
sdk: true ? "0.
|
|
8630
|
+
mcpServer: true ? "0.10.0" : "dev",
|
|
8631
|
+
sdk: true ? "0.35.0" : "dev"
|
|
8803
8632
|
};
|
|
8804
8633
|
|
|
8805
8634
|
// src/log.ts
|
|
@@ -9035,7 +8864,7 @@ ${detail}${pointer}`
|
|
|
9035
8864
|
|
|
9036
8865
|
// src/tools/hybrid_search.ts
|
|
9037
8866
|
var MCP_DEFAULT_LIMIT = 3;
|
|
9038
|
-
var MCP_MAX_LIMIT =
|
|
8867
|
+
var MCP_MAX_LIMIT = 50;
|
|
9039
8868
|
var MCP_RESPONSE_CHAR_BUDGET = 24e3;
|
|
9040
8869
|
var SNIPPET_MAX_CHARS = 160;
|
|
9041
8870
|
var INTERNAL_METADATA_KEYS = /* @__PURE__ */ new Set(["tenantId", "owner_id", "model_type", "rootFolderId", "folderId"]);
|
|
@@ -9069,9 +8898,9 @@ var inputSchema = {
|
|
|
9069
8898
|
"Keyword-match precision for the BM25 leg (TEXT/HYBRID modes). OR = any term (broad recall), AND = all terms (higher precision), PHRASE = contiguous phrase. Default: PHRASE (slop 3) in HYBRID, OR in TEXT. (The advanced raw-query COMPLEX mode is intentionally not exposed here.)"
|
|
9070
8899
|
),
|
|
9071
8900
|
limit: import_zod.z.number().int().min(1).max(MCP_MAX_LIMIT).optional().describe(
|
|
9072
|
-
`Max hits
|
|
8901
|
+
`Max hits per page. Defaults to a low ${MCP_DEFAULT_LIMIT} to protect the agent context window; raise up to ${MCP_MAX_LIMIT} (the most a single search returns) in one call when you can accept the larger result, or page with \`offset\` instead.`
|
|
9073
8902
|
),
|
|
9074
|
-
offset: import_zod.z.number().int().min(0).optional().describe("Skip the first N hits \u2014 for pagination."),
|
|
8903
|
+
offset: import_zod.z.number().int().min(0).max(200).optional().describe("Skip the first N hits \u2014 for pagination (0\u2013200)."),
|
|
9075
8904
|
folderId: import_zod.z.string().optional().describe("Scope to content in this EXACT folder (Vectros folder id)."),
|
|
9076
8905
|
rootFolderId: import_zod.z.string().optional().describe("Scope to content under this folder AND all its descendants (subtree-root folder id)."),
|
|
9077
8906
|
// Content narrowing.
|
|
@@ -9084,8 +8913,9 @@ var inputSchema = {
|
|
|
9084
8913
|
),
|
|
9085
8914
|
// Ownership.
|
|
9086
8915
|
userId: import_zod.z.string().optional().describe("Restrict to content owned by this user (Vectros UUID)."),
|
|
9087
|
-
|
|
9088
|
-
|
|
8916
|
+
scope: import_zod.z.string().optional().describe(
|
|
8917
|
+
'Restrict to content carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "client:<uuid>", "group:eng-team"). `org` and `client` are built-in namespaces; others are custom scopes you define.'
|
|
8918
|
+
),
|
|
9089
8919
|
// Date window.
|
|
9090
8920
|
createdAfter: import_zod.z.string().optional().describe("Restrict to content created at/after this ISO 8601 UTC timestamp."),
|
|
9091
8921
|
createdBefore: import_zod.z.string().optional().describe("Restrict to content created at/before this ISO 8601 UTC timestamp."),
|
|
@@ -9103,7 +8933,7 @@ var inputSchema = {
|
|
|
9103
8933
|
var hybridSearch = ({ client, log }) => ({
|
|
9104
8934
|
name: "hybrid_search",
|
|
9105
8935
|
title: "Hybrid search",
|
|
9106
|
-
description:
|
|
8936
|
+
description: "Search your tenant's indexed content (documents + structured records) using hybrid BM25 + dense ranking. Returns up to `limit` results (default 3, max 50 \u2014 raise it in one call when you can accept the larger result) with citations and surrounding context for grounding follow-up reasoning. Narrow with contentTypes/typeName/filters, ownership (userId/scope), folder scope, a created date window, keyword precision (textMode OR/AND/PHRASE), relevance floors (minSimilarity/minTextRelevance), uniqueDocuments, and requireComplete (fail closed on a degraded backend). Tenant-isolated; the caller's scoped key fully constrains which content is visible. ARCHIVED (soft-retracted) documents never appear in results \u2014 fetch them by id via document_get, or restore them via document_update. To stay within the agent context window each hit returns its matched chunkText + a short snippet by default; set includeContext:true for the broader surrounding passage. If the whole result would be too large it is truncated to the top hits (truncated:true). totalResults is the full matching pool and hasMore:true means results remain past this page \u2014 raise limit or advance offset to fetch them. textLegEmpty:true flags that the keyword leg matched nothing (all textScores 0) \u2014 usually a too-long PHRASE query; retry with textMode:\"OR\".",
|
|
9107
8937
|
inputSchema,
|
|
9108
8938
|
handler: async (args) => {
|
|
9109
8939
|
const limit = args.limit ?? MCP_DEFAULT_LIMIT;
|
|
@@ -9121,8 +8951,7 @@ var hybridSearch = ({ client, log }) => ({
|
|
|
9121
8951
|
typeName: args.typeName,
|
|
9122
8952
|
filters: args.filters,
|
|
9123
8953
|
userId: args.userId,
|
|
9124
|
-
|
|
9125
|
-
clientId: args.clientId,
|
|
8954
|
+
scope: args.scope,
|
|
9126
8955
|
createdAfter: args.createdAfter,
|
|
9127
8956
|
createdBefore: args.createdBefore,
|
|
9128
8957
|
minSimilarity: args.minSimilarity,
|
|
@@ -9149,6 +8978,12 @@ var hybridSearch = ({ client, log }) => ({
|
|
|
9149
8978
|
envelope.returnedResults = shaped.length;
|
|
9150
8979
|
text = JSON.stringify(envelope, null, 2);
|
|
9151
8980
|
}
|
|
8981
|
+
const offset = args.offset ?? 0;
|
|
8982
|
+
const totalResults = result.totalResults;
|
|
8983
|
+
if (typeof totalResults === "number" && offset + shaped.length < totalResults) {
|
|
8984
|
+
envelope.hasMore = true;
|
|
8985
|
+
text = JSON.stringify(envelope, null, 2);
|
|
8986
|
+
}
|
|
9152
8987
|
log.debug(
|
|
9153
8988
|
{ tool: "hybrid_search", mode, limit, returned: shaped.length, textLegEmpty },
|
|
9154
8989
|
"hybrid_search ok"
|
|
@@ -9184,7 +9019,7 @@ async function drainPages(fetchPage) {
|
|
|
9184
9019
|
|
|
9185
9020
|
// src/tools/record_query.ts
|
|
9186
9021
|
var MCP_DEFAULT_LIMIT2 = 3;
|
|
9187
|
-
var MCP_MAX_LIMIT2 =
|
|
9022
|
+
var MCP_MAX_LIMIT2 = 100;
|
|
9188
9023
|
var inputSchema2 = {
|
|
9189
9024
|
type: import_zod2.z.string().min(1, "type (record type) is required").describe('Record type / schema name (e.g. "patient", "clinical_note").'),
|
|
9190
9025
|
// Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
|
|
@@ -9200,16 +9035,18 @@ var inputSchema2 = {
|
|
|
9200
9035
|
),
|
|
9201
9036
|
// List-mode args:
|
|
9202
9037
|
userId: import_zod2.z.string().optional().describe("List mode: scope to records owned by this user."),
|
|
9203
|
-
|
|
9204
|
-
|
|
9038
|
+
scope: import_zod2.z.string().optional().describe(
|
|
9039
|
+
'List mode: filter to records carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "client:<uuid>", "group:eng-team"). `org` and `client` are built-in namespaces; others are custom scopes you define.'
|
|
9040
|
+
),
|
|
9041
|
+
startFrom: import_zod2.z.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next. Works in both list and lookup mode."),
|
|
9205
9042
|
limit: import_zod2.z.number().int().min(1).max(MCP_MAX_LIMIT2).optional().describe(
|
|
9206
|
-
`Max records
|
|
9043
|
+
`Max records per page. Defaults to a low ${MCP_DEFAULT_LIMIT2} to protect the agent context window; raise up to ${MCP_MAX_LIMIT2} (the records API max) in one call when you can accept the larger payload, or page with \`startFrom\` instead.`
|
|
9207
9044
|
)
|
|
9208
9045
|
};
|
|
9209
9046
|
var recordQuery = ({ client, log }) => ({
|
|
9210
9047
|
name: "record_query",
|
|
9211
9048
|
title: "Record query (list or lookup)",
|
|
9212
|
-
description: "Query structured records of a given type. Two modes:\n \u2022 Lookup on a lookup-indexed field: pass `field` plus exactly one of `value` (exact), `from`+`to` (range), or `prefix`. Works on sensitive fields too.\n \u2022 List by type: omit `field`; optionally filter by `userId
|
|
9049
|
+
description: "Query structured records of a given type. Two modes:\n \u2022 Lookup on a lookup-indexed field: pass `field` plus exactly one of `value` (exact), `from`+`to` (range), or `prefix`. Works on sensitive fields too.\n \u2022 List by type: omit `field`; optionally filter by `userId` or `scope` (`namespace:value`).\nReturns a `{ data, nextCursor }` page: `data` holds up to `limit` records (default 3, max 100 \u2014 raise it in one call when you can accept the payload), and a non-null `nextCursor` means more remain \u2014 pass it back as `startFrom` to page. Mode is auto-detected from the arguments present.",
|
|
9213
9050
|
inputSchema: inputSchema2,
|
|
9214
9051
|
handler: async (args) => {
|
|
9215
9052
|
const limit = args.limit ?? MCP_DEFAULT_LIMIT2;
|
|
@@ -9219,8 +9056,9 @@ var recordQuery = ({ client, log }) => ({
|
|
|
9219
9056
|
const from = args.from;
|
|
9220
9057
|
const to = args.to;
|
|
9221
9058
|
const prefix = args.prefix;
|
|
9059
|
+
const startFrom = args.startFrom;
|
|
9222
9060
|
try {
|
|
9223
|
-
let
|
|
9061
|
+
let page;
|
|
9224
9062
|
if (field) {
|
|
9225
9063
|
const hasEquality = value !== void 0;
|
|
9226
9064
|
const hasRange = from !== void 0 || to !== void 0;
|
|
@@ -9243,7 +9081,7 @@ var recordQuery = ({ client, log }) => ({
|
|
|
9243
9081
|
if (hasRange && !(from !== void 0 && to !== void 0)) {
|
|
9244
9082
|
return toolError("record_query", new Error("range lookup requires both 'from' and 'to'."));
|
|
9245
9083
|
}
|
|
9246
|
-
|
|
9084
|
+
page = await client.records.lookupRecordsByBody({
|
|
9247
9085
|
type,
|
|
9248
9086
|
field,
|
|
9249
9087
|
value,
|
|
@@ -9251,29 +9089,30 @@ var recordQuery = ({ client, log }) => ({
|
|
|
9251
9089
|
to,
|
|
9252
9090
|
prefix,
|
|
9253
9091
|
order: args.order,
|
|
9092
|
+
startFrom,
|
|
9254
9093
|
limit
|
|
9255
9094
|
});
|
|
9256
|
-
records = pageItems(page);
|
|
9257
9095
|
log.debug(
|
|
9258
|
-
{ tool: "record_query", mode: "lookup", type, field, returned:
|
|
9096
|
+
{ tool: "record_query", mode: "lookup", type, field, returned: pageItems(page).length },
|
|
9259
9097
|
"record_query lookup ok"
|
|
9260
9098
|
);
|
|
9261
9099
|
} else {
|
|
9262
|
-
|
|
9100
|
+
page = await client.records.listRecords({
|
|
9263
9101
|
type,
|
|
9264
9102
|
userId: args.userId,
|
|
9265
|
-
|
|
9266
|
-
|
|
9103
|
+
scope: args.scope,
|
|
9104
|
+
startFrom,
|
|
9267
9105
|
limit
|
|
9268
9106
|
});
|
|
9269
|
-
records = pageItems(page);
|
|
9270
9107
|
log.debug(
|
|
9271
|
-
{ tool: "record_query", mode: "list", type, limit, returned:
|
|
9108
|
+
{ tool: "record_query", mode: "list", type, limit, returned: pageItems(page).length },
|
|
9272
9109
|
"record_query list ok"
|
|
9273
9110
|
);
|
|
9274
9111
|
}
|
|
9112
|
+
const records = pageItems(page);
|
|
9113
|
+
const nextCursor = page.nextCursor ?? null;
|
|
9275
9114
|
return {
|
|
9276
|
-
content: [{ type: "text", text: JSON.stringify(records, null, 2) }]
|
|
9115
|
+
content: [{ type: "text", text: JSON.stringify({ data: records, nextCursor }, null, 2) }]
|
|
9277
9116
|
};
|
|
9278
9117
|
} catch (err) {
|
|
9279
9118
|
log.warn({ tool: "record_query", err: String(err) }, "record_query failed");
|
|
@@ -9395,8 +9234,9 @@ var inputSchema4 = {
|
|
|
9395
9234
|
status: import_zod4.z.string().optional().describe("Record lifecycle status. Defaults to ACTIVE server-side."),
|
|
9396
9235
|
folderId: import_zod4.z.string().optional().describe("Group this record into a folder."),
|
|
9397
9236
|
userId: import_zod4.z.string().optional().describe("Owning user id."),
|
|
9398
|
-
|
|
9399
|
-
|
|
9237
|
+
scopes: import_zod4.z.array(import_zod4.z.string()).optional().describe(
|
|
9238
|
+
'Scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]). `org` and `client` are built-in namespaces; others are custom scopes you define. This is the record\'s COMPLETE scope declaration and values must come from the credential\'s own identity. An empty array `[]` creates a PRIVATE record owned by the calling user alone. Omit to stamp the credential\'s full identity \u2014 the default.'
|
|
9239
|
+
)
|
|
9400
9240
|
};
|
|
9401
9241
|
var recordCreate = ({ client, log }) => ({
|
|
9402
9242
|
name: "record_create",
|
|
@@ -9415,8 +9255,7 @@ var recordCreate = ({ client, log }) => ({
|
|
|
9415
9255
|
status: args.status,
|
|
9416
9256
|
folderId: args.folderId,
|
|
9417
9257
|
userId: args.userId,
|
|
9418
|
-
|
|
9419
|
-
clientId: args.clientId
|
|
9258
|
+
scopes: args.scopes
|
|
9420
9259
|
}
|
|
9421
9260
|
});
|
|
9422
9261
|
log.debug({ tool: "record_create", type, id: created.id }, "record_create ok");
|
|
@@ -9501,24 +9340,27 @@ var record_delete_default = recordDelete;
|
|
|
9501
9340
|
// src/tools/rag_ask.ts
|
|
9502
9341
|
var import_zod7 = require("zod");
|
|
9503
9342
|
var SEARCH_MCP_DEFAULT_LIMIT = 5;
|
|
9504
|
-
var SEARCH_MCP_MAX_LIMIT =
|
|
9343
|
+
var SEARCH_MCP_MAX_LIMIT = 50;
|
|
9505
9344
|
var inputSchema7 = {
|
|
9506
9345
|
query: import_zod7.z.string().min(1, "query must be non-empty").describe("Question to ground against retrieved content."),
|
|
9507
9346
|
instructions: import_zod7.z.string().optional().describe(
|
|
9508
9347
|
'System prompt that overrides the default for the generation step \u2014 e.g. "answer only from the provided context, cite sources, be concise". Default: a generic answer-from-context instruction.'
|
|
9509
9348
|
),
|
|
9510
9349
|
model: import_zod7.z.string().optional().describe(
|
|
9511
|
-
"Inference model alias (e.g. claude-haiku-4-5, claude-sonnet-
|
|
9350
|
+
"Inference model alias (e.g. claude-haiku-4-5, claude-sonnet-5, claude-opus-4-8). Default = tier-appropriate Haiku. See GET /v1/models for the catalog the calling key can reach."
|
|
9512
9351
|
),
|
|
9513
9352
|
search: import_zod7.z.object({
|
|
9514
9353
|
mode: import_zod7.z.enum(["HYBRID", "TEXT", "SEMANTIC"]).optional().describe("Retrieval mode. Default HYBRID."),
|
|
9515
|
-
limit: import_zod7.z.number().int().min(1).max(SEARCH_MCP_MAX_LIMIT).optional().describe(
|
|
9354
|
+
limit: import_zod7.z.number().int().min(1).max(SEARCH_MCP_MAX_LIMIT).optional().describe(
|
|
9355
|
+
`Passages to retrieve before generating (the grounding-corpus size). Default ${SEARCH_MCP_DEFAULT_LIMIT}; raise up to ${SEARCH_MCP_MAX_LIMIT} (the RAG search API max) for a broader corpus when the extra grounding is worth the larger prompt.`
|
|
9356
|
+
),
|
|
9516
9357
|
// Retrieval scoping — parity with hybrid_search so an agent can ground the
|
|
9517
9358
|
// answer on a specific owner / folder / type / metadata subset, not just the
|
|
9518
9359
|
// whole-tenant corpus.
|
|
9519
9360
|
userId: import_zod7.z.string().optional().describe("Restrict retrieval to content owned by this user (Vectros UUID)."),
|
|
9520
|
-
|
|
9521
|
-
|
|
9361
|
+
scope: import_zod7.z.string().optional().describe(
|
|
9362
|
+
'Restrict retrieval to content carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "client:<uuid>", "group:eng-team"). `org` and `client` are built-in namespaces; others are custom scopes you define.'
|
|
9363
|
+
),
|
|
9522
9364
|
folderId: import_zod7.z.string().optional().describe("Restrict retrieval to this exact folder."),
|
|
9523
9365
|
rootFolderId: import_zod7.z.string().optional().describe("Restrict retrieval to this folder and all its descendants."),
|
|
9524
9366
|
typeName: import_zod7.z.string().optional().describe("Restrict record retrieval to this schema type."),
|
|
@@ -9536,7 +9378,7 @@ var inputSchema7 = {
|
|
|
9536
9378
|
var ragAsk = ({ client, log }) => ({
|
|
9537
9379
|
name: "rag_ask",
|
|
9538
9380
|
title: "RAG ask (corpus-wide)",
|
|
9539
|
-
description: "Ask a question grounded against
|
|
9381
|
+
description: "Ask a question grounded against your tenant's indexed content. Vectros performs a hybrid search, injects the top-K passages into the prompt, and streams a model answer back. Scope retrieval with `search` (ownership, folder, type, metadata filters, date window) to ground on a subset \u2014 e.g. one patient or one folder \u2014 and steer generation with `instructions` / `temperature`. The full answer is returned as a single response; progress notifications keep the call alive during the 30-45s generation window. Inference runs in-perimeter against AWS Bedrock \u2014 PHI never leaves the BAA boundary.",
|
|
9540
9382
|
inputSchema: inputSchema7,
|
|
9541
9383
|
handler: async (args, extra) => {
|
|
9542
9384
|
try {
|
|
@@ -9545,8 +9387,7 @@ var ragAsk = ({ client, log }) => ({
|
|
|
9545
9387
|
mode: searchArg.mode ?? "HYBRID",
|
|
9546
9388
|
limit: searchArg.limit ?? SEARCH_MCP_DEFAULT_LIMIT,
|
|
9547
9389
|
userId: searchArg.userId,
|
|
9548
|
-
|
|
9549
|
-
clientId: searchArg.clientId,
|
|
9390
|
+
scope: searchArg.scope,
|
|
9550
9391
|
folderId: searchArg.folderId,
|
|
9551
9392
|
rootFolderId: searchArg.rootFolderId,
|
|
9552
9393
|
typeName: searchArg.typeName,
|
|
@@ -9691,32 +9532,32 @@ var inputSchema9 = {
|
|
|
9691
9532
|
userId: import_zod9.z.string().optional().describe(
|
|
9692
9533
|
"Filter to schemas visible to a specific user. Optional; default returns all schemas the credential can see."
|
|
9693
9534
|
),
|
|
9694
|
-
|
|
9695
|
-
|
|
9535
|
+
scope: import_zod9.z.string().optional().describe(
|
|
9536
|
+
'Filter to schemas carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "group:eng-team"). `org` and `client` are built-in namespaces. Optional; default returns all schemas the credential can see.'
|
|
9696
9537
|
),
|
|
9697
|
-
surface: import_zod9.z.enum(["record", "document", "user", "
|
|
9698
|
-
"Filter to schemas bindable to this surface \u2014 e.g. `document` to list only document types, or `record` for record types.
|
|
9538
|
+
surface: import_zod9.z.enum(["record", "document", "user", "entity"]).optional().describe(
|
|
9539
|
+
"Filter to schemas bindable to this surface \u2014 e.g. `document` to list only document types, or `record` for record types. Identity entities in any namespace (org/client/one you registered) bind under the single `entity` surface; `user` and `entity` are account-wide. Optional."
|
|
9699
9540
|
),
|
|
9700
9541
|
recordType: import_zod9.z.string().optional().describe(
|
|
9701
|
-
'Resolve the single schema for this record type (its natural handle, e.g. "patient") instead of listing \u2014 returns a one-element result, or empty if none. Combine with `surface=user|
|
|
9542
|
+
'Resolve the single schema for this record type (its natural handle, e.g. "patient") instead of listing \u2014 returns a one-element result, or empty if none. Combine with `surface=user|entity` for an identity schema. Takes precedence over userId. Optional.'
|
|
9702
9543
|
)
|
|
9703
9544
|
};
|
|
9704
9545
|
var listSchemas = ({ client, log }) => ({
|
|
9705
9546
|
name: "list_schemas",
|
|
9706
9547
|
title: "List record schemas",
|
|
9707
|
-
description: 'List the structured-record schema catalog for
|
|
9548
|
+
description: 'List the structured-record schema catalog for your tenant. Each schema describes a record type (e.g. "patient", "clinical_note") \u2014 its fields, lookup-indexed fields, and capabilities. Use this to discover what record types exist before calling `record_query`. Filter with `surface` (record/document/user/entity \u2014 e.g. only document types), `recordType` (resolve one schema by its type name), or `userId`/`scope`; default returns everything the credential can see.',
|
|
9708
9549
|
inputSchema: inputSchema9,
|
|
9709
9550
|
handler: async (args) => {
|
|
9710
9551
|
const userId = args.userId;
|
|
9711
|
-
const
|
|
9552
|
+
const scope = args.scope;
|
|
9712
9553
|
const surface = args.surface;
|
|
9713
9554
|
const recordType = args.recordType;
|
|
9714
9555
|
try {
|
|
9715
9556
|
const schemas = await drainPages(
|
|
9716
|
-
(startFrom) => client.schemas.listSchemas({ userId,
|
|
9557
|
+
(startFrom) => client.schemas.listSchemas({ userId, scope, surface, recordType, startFrom })
|
|
9717
9558
|
);
|
|
9718
9559
|
log.debug(
|
|
9719
|
-
{ tool: "list_schemas", userId,
|
|
9560
|
+
{ tool: "list_schemas", userId, scope, surface, recordType, returned: schemas.length },
|
|
9720
9561
|
"list_schemas ok"
|
|
9721
9562
|
);
|
|
9722
9563
|
return {
|
|
@@ -9826,7 +9667,7 @@ var document_get_default = documentGet;
|
|
|
9826
9667
|
// src/tools/document_query.ts
|
|
9827
9668
|
var import_zod11 = require("zod");
|
|
9828
9669
|
var MCP_DEFAULT_LIMIT3 = 3;
|
|
9829
|
-
var MCP_MAX_LIMIT3 =
|
|
9670
|
+
var MCP_MAX_LIMIT3 = 100;
|
|
9830
9671
|
var inputSchema11 = {
|
|
9831
9672
|
// Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
|
|
9832
9673
|
field: import_zod11.z.string().optional().describe("Lookup mode: name of the lookup-indexed field to query by."),
|
|
@@ -9841,16 +9682,18 @@ var inputSchema11 = {
|
|
|
9841
9682
|
// List-mode args:
|
|
9842
9683
|
folderId: import_zod11.z.string().optional().describe("List mode: only documents in this folder (Vectros folder id)."),
|
|
9843
9684
|
userId: import_zod11.z.string().optional().describe("List mode: scope to documents owned by this user."),
|
|
9844
|
-
|
|
9845
|
-
|
|
9685
|
+
scope: import_zod11.z.string().optional().describe(
|
|
9686
|
+
'List mode: filter to documents carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "client:<uuid>", "group:eng-team"). `org` and `client` are built-in namespaces; others are custom scopes you define.'
|
|
9687
|
+
),
|
|
9688
|
+
startFrom: import_zod11.z.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next. Works in both list and lookup mode."),
|
|
9846
9689
|
limit: import_zod11.z.number().int().min(1).max(MCP_MAX_LIMIT3).optional().describe(
|
|
9847
|
-
`Max documents
|
|
9690
|
+
`Max documents per page. Defaults to a low ${MCP_DEFAULT_LIMIT3} to protect the agent context window; raise up to ${MCP_MAX_LIMIT3} (the documents API max) in one call when you can accept the larger payload, or page with \`startFrom\` instead.`
|
|
9848
9691
|
)
|
|
9849
9692
|
};
|
|
9850
9693
|
var documentQuery = ({ client, log }) => ({
|
|
9851
9694
|
name: "document_query",
|
|
9852
9695
|
title: "Document query (list or lookup)",
|
|
9853
|
-
description: "Query document metadata. Two modes:\n \u2022 Lookup on a lookup-indexed field: pass `type` and `field` plus exactly one of `value` (exact), `from`+`to` (range), or `prefix`. Works on sensitive fields (equality only there); range/prefix need a range-enabled field.\n \u2022 List: omit `field`; optionally filter by `folderId`/`userId`/`
|
|
9696
|
+
description: "Query document metadata. Two modes:\n \u2022 Lookup on a lookup-indexed field: pass `type` and `field` plus exactly one of `value` (exact), `from`+`to` (range), or `prefix`. Works on sensitive fields (equality only there); range/prefix need a range-enabled field.\n \u2022 List: omit `field`; optionally filter by `folderId`/`userId`/`scope` (`namespace:value`).\nReturns a `{ data, nextCursor }` page: `data` holds up to `limit` documents (default 3, max 100 \u2014 raise it in one call when you can accept the payload), and a non-null `nextCursor` means more remain \u2014 pass it back as `startFrom` to page. Mode is auto-detected. Use document_get for the full text/download URL of one document.",
|
|
9854
9697
|
inputSchema: inputSchema11,
|
|
9855
9698
|
handler: async (args) => {
|
|
9856
9699
|
const limit = args.limit ?? MCP_DEFAULT_LIMIT3;
|
|
@@ -9860,8 +9703,9 @@ var documentQuery = ({ client, log }) => ({
|
|
|
9860
9703
|
const to = args.to;
|
|
9861
9704
|
const prefix = args.prefix;
|
|
9862
9705
|
const type = args.type;
|
|
9706
|
+
const startFrom = args.startFrom;
|
|
9863
9707
|
try {
|
|
9864
|
-
let
|
|
9708
|
+
let page;
|
|
9865
9709
|
if (field) {
|
|
9866
9710
|
const hasEquality = value !== void 0;
|
|
9867
9711
|
const hasRange = from !== void 0 || to !== void 0;
|
|
@@ -9890,7 +9734,7 @@ var documentQuery = ({ client, log }) => ({
|
|
|
9890
9734
|
new Error("lookup requires 'type' (the document's bound schema type) alongside 'field'.")
|
|
9891
9735
|
);
|
|
9892
9736
|
}
|
|
9893
|
-
|
|
9737
|
+
page = await client.documents.lookupDocumentsByBody({
|
|
9894
9738
|
type,
|
|
9895
9739
|
field,
|
|
9896
9740
|
value,
|
|
@@ -9898,28 +9742,29 @@ var documentQuery = ({ client, log }) => ({
|
|
|
9898
9742
|
to,
|
|
9899
9743
|
prefix,
|
|
9900
9744
|
order: args.order,
|
|
9745
|
+
startFrom,
|
|
9901
9746
|
limit
|
|
9902
9747
|
});
|
|
9903
|
-
documents = pageItems(page);
|
|
9904
9748
|
log.debug(
|
|
9905
|
-
{ tool: "document_query", mode: "lookup", type, field, returned:
|
|
9749
|
+
{ tool: "document_query", mode: "lookup", type, field, returned: pageItems(page).length },
|
|
9906
9750
|
"document_query lookup ok"
|
|
9907
9751
|
);
|
|
9908
9752
|
} else {
|
|
9909
|
-
|
|
9753
|
+
page = await client.documents.listDocuments({
|
|
9910
9754
|
folderId: args.folderId,
|
|
9911
9755
|
userId: args.userId,
|
|
9912
|
-
|
|
9913
|
-
|
|
9756
|
+
scope: args.scope,
|
|
9757
|
+
startFrom,
|
|
9914
9758
|
limit
|
|
9915
9759
|
});
|
|
9916
|
-
documents = pageItems(page);
|
|
9917
9760
|
log.debug(
|
|
9918
|
-
{ tool: "document_query", mode: "list", limit, returned:
|
|
9761
|
+
{ tool: "document_query", mode: "list", limit, returned: pageItems(page).length },
|
|
9919
9762
|
"document_query list ok"
|
|
9920
9763
|
);
|
|
9921
9764
|
}
|
|
9922
|
-
|
|
9765
|
+
const documents = pageItems(page);
|
|
9766
|
+
const nextCursor = page.nextCursor ?? null;
|
|
9767
|
+
return { content: [{ type: "text", text: JSON.stringify({ data: documents, nextCursor }, null, 2) }] };
|
|
9923
9768
|
} catch (err) {
|
|
9924
9769
|
log.warn({ tool: "document_query", err: String(err) }, "document_query failed");
|
|
9925
9770
|
return toolError("document_query", err);
|
|
@@ -9948,8 +9793,9 @@ var inputSchema12 = {
|
|
|
9948
9793
|
"Lifecycle status. `ARCHIVED` soft-retracts the document \u2014 it is pulled from search and recall but kept and recoverable; set it back to `ACTIVE` to re-index and restore it. The way to retire superseded content when the credential has no delete authority. Omit to leave unchanged."
|
|
9949
9794
|
),
|
|
9950
9795
|
userId: import_zod12.z.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
9951
|
-
|
|
9952
|
-
|
|
9796
|
+
scopes: import_zod12.z.array(import_zod12.z.string()).optional().describe(
|
|
9797
|
+
'Reassign scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]) \u2014 the COMPLETE new parent set. `org`/`client` are built-in namespaces. Omit to leave ownership unchanged; `[]` clears it (private to the owning user).'
|
|
9798
|
+
),
|
|
9953
9799
|
expectedVersion: import_zod12.z.number().int().optional().describe(
|
|
9954
9800
|
"Optimistic concurrency: the version you last read. If the document changed since, the update is refused as a conflict (re-read and retry). Omit for last-write-wins."
|
|
9955
9801
|
)
|
|
@@ -9969,8 +9815,7 @@ var documentUpdate = ({ client, log }) => ({
|
|
|
9969
9815
|
const folderId = args.folderId;
|
|
9970
9816
|
const status = args.status;
|
|
9971
9817
|
const userId = args.userId;
|
|
9972
|
-
const
|
|
9973
|
-
const clientId = args.clientId;
|
|
9818
|
+
const scopes = args.scopes;
|
|
9974
9819
|
const expectedVersion = args.expectedVersion;
|
|
9975
9820
|
try {
|
|
9976
9821
|
const resolved = await resolveDocumentIdByExternalId(client, { id: documentId, externalId, type });
|
|
@@ -9982,8 +9827,7 @@ var documentUpdate = ({ client, log }) => ({
|
|
|
9982
9827
|
if (folderId !== void 0) body.folderId = folderId;
|
|
9983
9828
|
if (status !== void 0) body.status = status;
|
|
9984
9829
|
if (userId !== void 0) body.userId = userId;
|
|
9985
|
-
if (
|
|
9986
|
-
if (clientId !== void 0) body.clientId = clientId;
|
|
9830
|
+
if (scopes !== void 0) body.scopes = scopes;
|
|
9987
9831
|
if (expectedVersion !== void 0) body.expectedVersion = expectedVersion;
|
|
9988
9832
|
const updated = await client.documents.patchDocument({
|
|
9989
9833
|
id: resolved.id,
|
|
@@ -10028,20 +9872,23 @@ var document_delete_default = documentDelete;
|
|
|
10028
9872
|
// src/tools/folder_query.ts
|
|
10029
9873
|
var import_zod14 = require("zod");
|
|
10030
9874
|
var MCP_DEFAULT_LIMIT4 = 10;
|
|
10031
|
-
var MCP_MAX_LIMIT4 =
|
|
9875
|
+
var MCP_MAX_LIMIT4 = 100;
|
|
10032
9876
|
var inputSchema14 = {
|
|
10033
9877
|
id: import_zod14.z.string().optional().describe("Get mode: fetch this single folder by id."),
|
|
10034
9878
|
parentId: import_zod14.z.string().optional().describe("List mode: direct children of this folder (tree navigation). Omit for a flat tenant list."),
|
|
10035
9879
|
userId: import_zod14.z.string().optional().describe("List mode: scope to folders owned by this user."),
|
|
10036
|
-
|
|
10037
|
-
|
|
9880
|
+
scope: import_zod14.z.string().optional().describe(
|
|
9881
|
+
'List mode: filter to folders carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "client:<uuid>", "group:eng-team"). `org` and `client` are built-in namespaces; others are custom scopes you define.'
|
|
9882
|
+
),
|
|
10038
9883
|
startFrom: import_zod14.z.string().optional().describe("List mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
|
|
10039
|
-
limit: import_zod14.z.number().int().min(1).max(MCP_MAX_LIMIT4).optional().describe(
|
|
9884
|
+
limit: import_zod14.z.number().int().min(1).max(MCP_MAX_LIMIT4).optional().describe(
|
|
9885
|
+
`List mode: max folders per page. Default 10; raise up to ${MCP_MAX_LIMIT4} (the folders API max) in one call when you can accept the larger page, or page with \`startFrom\`.`
|
|
9886
|
+
)
|
|
10040
9887
|
};
|
|
10041
9888
|
var folderQuery = ({ client, log }) => ({
|
|
10042
9889
|
name: "folder_query",
|
|
10043
9890
|
title: "Folder query (list or get)",
|
|
10044
|
-
description: "Read folders. Two modes:\n \u2022 Get: pass `id` \u2192 returns the single folder.\n \u2022 List: omit `id`; pass `parentId` for a folder's direct children (tree navigation) or omit for a flat tenant list. Optionally filter by `userId
|
|
9891
|
+
description: "Read folders. Two modes:\n \u2022 Get: pass `id` \u2192 returns the single folder.\n \u2022 List: omit `id`; pass `parentId` for a folder's direct children (tree navigation) or omit for a flat tenant list. Optionally filter by `userId` or `scope` (`namespace:value`).\nList mode returns `{ data, nextCursor }` (default 10, max 100 per page \u2014 raise it in one call when you can accept the larger page); a non-null `nextCursor` means more remain \u2014 pass it back as `startFrom` to page through all folders. Get mode returns the single folder object.",
|
|
10045
9892
|
inputSchema: inputSchema14,
|
|
10046
9893
|
handler: async (args) => {
|
|
10047
9894
|
const id = args.id;
|
|
@@ -10055,8 +9902,7 @@ var folderQuery = ({ client, log }) => ({
|
|
|
10055
9902
|
const page = await client.folders.listFolders({
|
|
10056
9903
|
parentFolderId: args.parentId,
|
|
10057
9904
|
userId: args.userId,
|
|
10058
|
-
|
|
10059
|
-
clientId: args.clientId,
|
|
9905
|
+
scope: args.scope,
|
|
10060
9906
|
startFrom: args.startFrom,
|
|
10061
9907
|
limit
|
|
10062
9908
|
});
|
|
@@ -10080,8 +9926,9 @@ var inputSchema15 = {
|
|
|
10080
9926
|
parentId: import_zod15.z.string().optional().describe("Parent folder id \u2014 places the folder under this parent. Omit for the context default root. Create-only."),
|
|
10081
9927
|
slug: import_zod15.z.string().optional().describe("Optional stable slug (sibling-unique; idempotency key). Lowercase letters/digits/hyphens. Derived from name when omitted."),
|
|
10082
9928
|
userId: import_zod15.z.string().optional().describe("Owning user (Vectros UUID)."),
|
|
10083
|
-
|
|
10084
|
-
|
|
9929
|
+
scopes: import_zod15.z.array(import_zod15.z.string()).optional().describe(
|
|
9930
|
+
'Scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]). `org` and `client` are built-in namespaces; others are custom scopes you define. This is the folder\'s COMPLETE scope declaration and values must come from the credential\'s own identity. An empty array `[]` creates a PRIVATE folder owned by the calling user alone. Omit to stamp the credential\'s full identity \u2014 the default.'
|
|
9931
|
+
)
|
|
10085
9932
|
};
|
|
10086
9933
|
var folderCreate = ({ client, log }) => ({
|
|
10087
9934
|
name: "folder_create",
|
|
@@ -10097,8 +9944,7 @@ var folderCreate = ({ client, log }) => ({
|
|
|
10097
9944
|
parentFolderId: args.parentId,
|
|
10098
9945
|
slug: args.slug,
|
|
10099
9946
|
userId: args.userId,
|
|
10100
|
-
|
|
10101
|
-
clientId: args.clientId
|
|
9947
|
+
scopes: args.scopes
|
|
10102
9948
|
}
|
|
10103
9949
|
});
|
|
10104
9950
|
log.debug({ tool: "folder_create", id: folder.id, name: folder.name }, "folder_create ok");
|
|
@@ -10118,8 +9964,9 @@ var inputSchema16 = {
|
|
|
10118
9964
|
name: import_zod16.z.string().optional().describe("New folder name. Omit to keep the current name."),
|
|
10119
9965
|
description: import_zod16.z.string().optional().describe("New description. Omit to leave unchanged."),
|
|
10120
9966
|
userId: import_zod16.z.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
10121
|
-
|
|
10122
|
-
|
|
9967
|
+
scopes: import_zod16.z.array(import_zod16.z.string()).optional().describe(
|
|
9968
|
+
'Reassign scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]) \u2014 the COMPLETE new parent set. `org`/`client` are built-in namespaces. Omit to leave ownership unchanged; `[]` clears it (private to the owning user).'
|
|
9969
|
+
),
|
|
10123
9970
|
expectedVersion: import_zod16.z.number().int().optional().describe(
|
|
10124
9971
|
"Optimistic concurrency: the version you last read. If the folder changed since, the update is refused as a conflict (re-read and retry). Omit for last-write-wins."
|
|
10125
9972
|
)
|
|
@@ -10134,16 +9981,14 @@ var folderUpdate = ({ client, log }) => ({
|
|
|
10134
9981
|
const name = args.name;
|
|
10135
9982
|
const description = args.description;
|
|
10136
9983
|
const userId = args.userId;
|
|
10137
|
-
const
|
|
10138
|
-
const clientId = args.clientId;
|
|
9984
|
+
const scopes = args.scopes;
|
|
10139
9985
|
const expectedVersion = args.expectedVersion;
|
|
10140
9986
|
try {
|
|
10141
9987
|
const body = {};
|
|
10142
9988
|
if (name !== void 0) body.name = name;
|
|
10143
9989
|
if (description !== void 0) body.description = description;
|
|
10144
9990
|
if (userId !== void 0) body.userId = userId;
|
|
10145
|
-
if (
|
|
10146
|
-
if (clientId !== void 0) body.clientId = clientId;
|
|
9991
|
+
if (scopes !== void 0) body.scopes = scopes;
|
|
10147
9992
|
if (expectedVersion !== void 0) body.expectedVersion = expectedVersion;
|
|
10148
9993
|
const updated = await client.folders.patchFolder({ id, body });
|
|
10149
9994
|
log.debug({ tool: "folder_update", id }, "folder_update ok");
|
|
@@ -10309,8 +10154,9 @@ var inputSchema19 = {
|
|
|
10309
10154
|
// Common (both modes):
|
|
10310
10155
|
folderId: import_zod18.z.string().optional().describe("Optional folder to ingest into. Default: tenant root."),
|
|
10311
10156
|
userId: import_zod18.z.string().optional().describe("Owning user ID. Optional."),
|
|
10312
|
-
|
|
10313
|
-
|
|
10157
|
+
scopes: import_zod18.z.array(import_zod18.z.string()).optional().describe(
|
|
10158
|
+
"TEXT MODE ONLY. Scope ownership as `namespace:value` entries, at most 2 (e.g. [\"org:<uuid>\", \"group:eng-team\"]). `org` and `client` are built-in namespaces; others are custom scopes you define. This is the document's COMPLETE scope declaration and values must come from the credential's own identity. An empty array `[]` creates a PRIVATE document owned by the calling user alone. Omit to stamp the credential's full identity \u2014 the default. Rejected with `filePath` (file uploads do not accept a scope declaration): a file-uploaded document is stamped with the credential's full identity."
|
|
10159
|
+
)
|
|
10314
10160
|
};
|
|
10315
10161
|
var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
10316
10162
|
name: "document_ingest",
|
|
@@ -10344,14 +10190,20 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
10344
10190
|
)
|
|
10345
10191
|
);
|
|
10346
10192
|
}
|
|
10193
|
+
if (filePath && args.scopes !== void 0) {
|
|
10194
|
+
return toolError(
|
|
10195
|
+
"document_ingest",
|
|
10196
|
+
new Error(
|
|
10197
|
+
"`scopes` is not supported with `filePath` \u2014 file uploads do not accept a scope declaration, and silently ignoring it could make an intended-private document team-visible. Use `text` mode to declare scopes, or omit `scopes` (the upload is stamped with the credential's full identity)."
|
|
10198
|
+
)
|
|
10199
|
+
);
|
|
10200
|
+
}
|
|
10347
10201
|
const common = {
|
|
10348
10202
|
folderId: args.folderId,
|
|
10349
10203
|
payload: args.payload,
|
|
10350
10204
|
schemaId,
|
|
10351
10205
|
externalId: args.externalId,
|
|
10352
|
-
userId: args.userId
|
|
10353
|
-
orgId: args.orgId,
|
|
10354
|
-
clientId: args.clientId
|
|
10206
|
+
userId: args.userId
|
|
10355
10207
|
};
|
|
10356
10208
|
try {
|
|
10357
10209
|
if (text) {
|
|
@@ -10361,6 +10213,9 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
10361
10213
|
title,
|
|
10362
10214
|
text,
|
|
10363
10215
|
indexMode,
|
|
10216
|
+
// Scope ownership is a TEXT-mode contract only (the upload-init
|
|
10217
|
+
// endpoint has no scopes field — see the gate above).
|
|
10218
|
+
scopes: args.scopes,
|
|
10364
10219
|
...common
|
|
10365
10220
|
}
|
|
10366
10221
|
});
|
|
@@ -10453,9 +10308,11 @@ var document_ingest_default = documentIngest;
|
|
|
10453
10308
|
// src/tools/lookup_principal.ts
|
|
10454
10309
|
var import_zod19 = require("zod");
|
|
10455
10310
|
var MCP_DEFAULT_LIMIT5 = 10;
|
|
10456
|
-
var MCP_MAX_LIMIT5 =
|
|
10311
|
+
var MCP_MAX_LIMIT5 = 100;
|
|
10457
10312
|
var inputSchema20 = {
|
|
10458
|
-
kind: import_zod19.z.
|
|
10313
|
+
kind: import_zod19.z.string().describe(
|
|
10314
|
+
'Which principal to look up: "user" (the fixed principal surface), or an entity namespace \u2014 "org", "client" (built in), or a namespace you registered.'
|
|
10315
|
+
),
|
|
10459
10316
|
externalId: import_zod19.z.string().optional().describe(
|
|
10460
10317
|
"Resolve mode: your own stable identifier for the principal. Returns the single matching principal (with its Vectros UUID), or an empty array if none. The fastest path to the UUID the ownership filters need. Takes precedence if both this and a `field` lookup are supplied."
|
|
10461
10318
|
),
|
|
@@ -10467,15 +10324,19 @@ var inputSchema20 = {
|
|
|
10467
10324
|
to: import_zod19.z.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
|
|
10468
10325
|
prefix: import_zod19.z.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
|
|
10469
10326
|
order: import_zod19.z.enum(["asc", "desc"]).optional().describe("Lookup mode: sort direction by the looked-up field. `asc` (default) or `desc`."),
|
|
10470
|
-
|
|
10327
|
+
startFrom: import_zod19.z.string().optional().describe("Lookup mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
|
|
10328
|
+
limit: import_zod19.z.number().int().min(1).max(MCP_MAX_LIMIT5).optional().describe(
|
|
10329
|
+
`Max principals per page. Defaults to ${MCP_DEFAULT_LIMIT5}; raise up to ${MCP_MAX_LIMIT5} (the principals API max) in one call when you can accept the payload, or page with \`startFrom\`.`
|
|
10330
|
+
)
|
|
10471
10331
|
};
|
|
10472
10332
|
var lookupPrincipal = ({ client, log }) => ({
|
|
10473
10333
|
name: "lookup_principal",
|
|
10474
|
-
title: "Look up a user
|
|
10475
|
-
description: "Resolve a user,
|
|
10334
|
+
title: "Look up a user identity or a namespaced identity entity",
|
|
10335
|
+
description: "Resolve a user, or an identity entity in a namespace (org/client/one you registered). Two modes:\n \u2022 Resolve by your own id: pass `externalId` \u2192 the matching principal incl. its Vectros UUID (the id the ownership filters on record_query / hybrid_search / rag_ask expect).\n \u2022 Lookup by a schema field: pass `type` and `field` plus exactly one of `value` (exact), `from`+`to` (range), or `prefix`. Sensitive-field-safe. (If both `externalId` and a `field` lookup are given, `externalId` wins.) Returns a `{ data, nextCursor }` page (default 10, max 100 \u2014 raise it in one call when you can accept the payload); a non-null `nextCursor` means more remain \u2014 pass it back as `startFrom`. Read-only \u2014 does not create or modify identities.",
|
|
10476
10336
|
inputSchema: inputSchema20,
|
|
10477
10337
|
handler: async (args) => {
|
|
10478
10338
|
const kind = args.kind;
|
|
10339
|
+
const isUser = kind === "user";
|
|
10479
10340
|
const limit = args.limit ?? MCP_DEFAULT_LIMIT5;
|
|
10480
10341
|
const externalId = args.externalId;
|
|
10481
10342
|
const type = args.type;
|
|
@@ -10485,16 +10346,11 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
10485
10346
|
const to = args.to;
|
|
10486
10347
|
const prefix = args.prefix;
|
|
10487
10348
|
const order = args.order;
|
|
10349
|
+
const startFrom = args.startFrom;
|
|
10488
10350
|
try {
|
|
10489
10351
|
let page;
|
|
10490
10352
|
if (externalId !== void 0) {
|
|
10491
|
-
|
|
10492
|
-
page = await client.identity.listUsers({ externalId, limit });
|
|
10493
|
-
} else if (kind === "org") {
|
|
10494
|
-
page = await client.identity.listOrgs({ externalId, limit });
|
|
10495
|
-
} else {
|
|
10496
|
-
page = await client.identity.listClients({ externalId, limit });
|
|
10497
|
-
}
|
|
10353
|
+
page = isUser ? await client.identity.listUsers({ externalId, limit }) : await client.identity.listEntities({ namespace: kind, externalId, limit });
|
|
10498
10354
|
log.debug({ tool: "lookup_principal", mode: "resolve", kind }, "lookup_principal resolve ok");
|
|
10499
10355
|
} else if (field !== void 0) {
|
|
10500
10356
|
const hasEquality = value !== void 0;
|
|
@@ -10522,14 +10378,8 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
10522
10378
|
new Error("lookup requires 'type' (the identity schema's record type) alongside 'field'.")
|
|
10523
10379
|
);
|
|
10524
10380
|
}
|
|
10525
|
-
const req = { type, field, value, from, to, prefix, order, limit };
|
|
10526
|
-
|
|
10527
|
-
page = await client.identity.lookupUsers(req);
|
|
10528
|
-
} else if (kind === "org") {
|
|
10529
|
-
page = await client.identity.lookupOrgs(req);
|
|
10530
|
-
} else {
|
|
10531
|
-
page = await client.identity.lookupClients(req);
|
|
10532
|
-
}
|
|
10381
|
+
const req = { type, field, value, from, to, prefix, order, startFrom, limit };
|
|
10382
|
+
page = isUser ? await client.identity.lookupUsers(req) : await client.identity.lookupEntities({ namespace: kind, body: req });
|
|
10533
10383
|
log.debug({ tool: "lookup_principal", mode: "lookup", kind, type, field }, "lookup_principal lookup ok");
|
|
10534
10384
|
} else {
|
|
10535
10385
|
return toolError(
|
|
@@ -10538,7 +10388,8 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
10538
10388
|
);
|
|
10539
10389
|
}
|
|
10540
10390
|
const principals = pageItems(page);
|
|
10541
|
-
|
|
10391
|
+
const nextCursor = page.nextCursor ?? null;
|
|
10392
|
+
return { content: [{ type: "text", text: JSON.stringify({ data: principals, nextCursor }, null, 2) }] };
|
|
10542
10393
|
} catch (err) {
|
|
10543
10394
|
log.warn({ tool: "lookup_principal", kind, err: String(err) }, "lookup_principal failed");
|
|
10544
10395
|
return toolError("lookup_principal", err);
|