@vectros-ai/mcp-server 0.5.1 → 0.5.3
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 +38 -0
- package/README.md +74 -9
- package/dist/cli-http.js +335 -100
- package/dist/cli-http.js.map +1 -1
- package/dist/cli-http.mjs +335 -100
- package/dist/cli-http.mjs.map +1 -1
- package/dist/cli.js +335 -100
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +335 -100
- package/dist/cli.mjs.map +1 -1
- package/dist/index.js +335 -100
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +335 -100
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
package/dist/cli-http.js
CHANGED
|
@@ -2537,6 +2537,7 @@ var AuthClient = class {
|
|
|
2537
2537
|
* @throws {@link Vectros.BadRequestError}
|
|
2538
2538
|
* @throws {@link Vectros.ForbiddenError}
|
|
2539
2539
|
* @throws {@link Vectros.NotFoundError}
|
|
2540
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2540
2541
|
*
|
|
2541
2542
|
* @example
|
|
2542
2543
|
* await client.auth.createScopedKey({
|
|
@@ -2584,6 +2585,8 @@ var AuthClient = class {
|
|
|
2584
2585
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2585
2586
|
case 404:
|
|
2586
2587
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2588
|
+
case 429:
|
|
2589
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2587
2590
|
default:
|
|
2588
2591
|
throw new VectrosError({
|
|
2589
2592
|
statusCode: _response.error.statusCode,
|
|
@@ -2660,6 +2663,7 @@ var AuthClient = class {
|
|
|
2660
2663
|
*
|
|
2661
2664
|
* @throws {@link Vectros.ForbiddenError}
|
|
2662
2665
|
* @throws {@link Vectros.NotFoundError}
|
|
2666
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2663
2667
|
*
|
|
2664
2668
|
* @example
|
|
2665
2669
|
* await client.auth.revokeScopedKey({
|
|
@@ -2700,6 +2704,8 @@ var AuthClient = class {
|
|
|
2700
2704
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2701
2705
|
case 404:
|
|
2702
2706
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2707
|
+
case 429:
|
|
2708
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2703
2709
|
default:
|
|
2704
2710
|
throw new VectrosError({
|
|
2705
2711
|
statusCode: _response.error.statusCode,
|
|
@@ -2855,7 +2861,7 @@ var AuthClient = class {
|
|
|
2855
2861
|
);
|
|
2856
2862
|
}
|
|
2857
2863
|
/**
|
|
2858
|
-
* 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. 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` may set only `orgId` and `clientId`; 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.
|
|
2864
|
+
* 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` may set only `orgId` and `clientId`; 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.
|
|
2859
2865
|
*
|
|
2860
2866
|
* @param {Vectros.CreateAccessProfileRequest} request
|
|
2861
2867
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -2863,6 +2869,7 @@ var AuthClient = class {
|
|
|
2863
2869
|
* @throws {@link Vectros.BadRequestError}
|
|
2864
2870
|
* @throws {@link Vectros.ForbiddenError}
|
|
2865
2871
|
* @throws {@link Vectros.NotFoundError}
|
|
2872
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2866
2873
|
*
|
|
2867
2874
|
* @example
|
|
2868
2875
|
* await client.auth.createAccessProfile({
|
|
@@ -2876,7 +2883,10 @@ var AuthClient = class {
|
|
|
2876
2883
|
return HttpResponsePromise.fromPromise(this.__createAccessProfile(request, requestOptions));
|
|
2877
2884
|
}
|
|
2878
2885
|
async __createAccessProfile(request, requestOptions) {
|
|
2879
|
-
const { contextId, body: _body } = request;
|
|
2886
|
+
const { contextId, upsert, body: _body } = request;
|
|
2887
|
+
const _queryParams = {
|
|
2888
|
+
upsert
|
|
2889
|
+
};
|
|
2880
2890
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2881
2891
|
const _headers = mergeHeaders(
|
|
2882
2892
|
_authRequest.headers,
|
|
@@ -2891,7 +2901,7 @@ var AuthClient = class {
|
|
|
2891
2901
|
method: "POST",
|
|
2892
2902
|
headers: _headers,
|
|
2893
2903
|
contentType: "application/json",
|
|
2894
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
2904
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
2895
2905
|
requestType: "json",
|
|
2896
2906
|
body: _body,
|
|
2897
2907
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -2911,6 +2921,8 @@ var AuthClient = class {
|
|
|
2911
2921
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2912
2922
|
case 404:
|
|
2913
2923
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2924
|
+
case 429:
|
|
2925
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2914
2926
|
default:
|
|
2915
2927
|
throw new VectrosError({
|
|
2916
2928
|
statusCode: _response.error.statusCode,
|
|
@@ -2984,24 +2996,31 @@ var AuthClient = class {
|
|
|
2984
2996
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/app-contexts");
|
|
2985
2997
|
}
|
|
2986
2998
|
/**
|
|
2987
|
-
* Creates a new app context. This call is idempotent by `contextId`: if an app context with the same `contextId` already exists, the existing app context is returned (with status 200) instead of creating a duplicate. The reserved `contextId` value `vectros-admin` cannot be created through this endpoint; it is provisioned automatically for your account. Requires the `app-contexts:c` scope.
|
|
2999
|
+
* Creates a new app context. This call is idempotent by `contextId`: if an app context with the same `contextId` already exists, the existing app context 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 context was returned) tells the two apart. To overwrite an existing context's `name`/`description` instead of returning it unchanged, set `?upsert=true` (this also requires the `app-contexts:u` scope). The reserved `contextId` value `vectros-admin` cannot be created through this endpoint; it is provisioned automatically for your account. Requires the `app-contexts:c` scope.
|
|
2988
3000
|
*
|
|
2989
|
-
* @param {Vectros.
|
|
3001
|
+
* @param {Vectros.CreateAppContextRequest} request
|
|
2990
3002
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2991
3003
|
*
|
|
2992
3004
|
* @throws {@link Vectros.BadRequestError}
|
|
2993
3005
|
* @throws {@link Vectros.ForbiddenError}
|
|
3006
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2994
3007
|
*
|
|
2995
3008
|
* @example
|
|
2996
3009
|
* await client.auth.createAppContext({
|
|
2997
|
-
*
|
|
2998
|
-
*
|
|
3010
|
+
* body: {
|
|
3011
|
+
* contextId: "myapp",
|
|
3012
|
+
* name: "My Internal App"
|
|
3013
|
+
* }
|
|
2999
3014
|
* })
|
|
3000
3015
|
*/
|
|
3001
3016
|
createAppContext(request, requestOptions) {
|
|
3002
3017
|
return HttpResponsePromise.fromPromise(this.__createAppContext(request, requestOptions));
|
|
3003
3018
|
}
|
|
3004
3019
|
async __createAppContext(request, requestOptions) {
|
|
3020
|
+
const { upsert, body: _body } = request;
|
|
3021
|
+
const _queryParams = {
|
|
3022
|
+
upsert
|
|
3023
|
+
};
|
|
3005
3024
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
3006
3025
|
const _headers = mergeHeaders(
|
|
3007
3026
|
_authRequest.headers,
|
|
@@ -3016,9 +3035,9 @@ var AuthClient = class {
|
|
|
3016
3035
|
method: "POST",
|
|
3017
3036
|
headers: _headers,
|
|
3018
3037
|
contentType: "application/json",
|
|
3019
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
3038
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
3020
3039
|
requestType: "json",
|
|
3021
|
-
body:
|
|
3040
|
+
body: _body,
|
|
3022
3041
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
3023
3042
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
3024
3043
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -3034,6 +3053,8 @@ var AuthClient = class {
|
|
|
3034
3053
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
3035
3054
|
case 403:
|
|
3036
3055
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3056
|
+
case 429:
|
|
3057
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3037
3058
|
default:
|
|
3038
3059
|
throw new VectrosError({
|
|
3039
3060
|
statusCode: _response.error.statusCode,
|
|
@@ -3112,7 +3133,7 @@ var AuthClient = class {
|
|
|
3112
3133
|
);
|
|
3113
3134
|
}
|
|
3114
3135
|
/**
|
|
3115
|
-
* Creates a new role under the given app context. This call is idempotent by `roleId`: if a role with the same `roleId` already exists, the existing role is returned (with status 200) instead of creating a duplicate. If you use a scoped credential, the role's scopes may not exceed your own; a root API key (`sk_`) is exempt. Requires the `profiles:c` scope.
|
|
3136
|
+
* Creates a new role under the given app context. This call is idempotent by `roleId`: if a role with the same `roleId` already exists, the existing role 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 role was returned) tells the two apart. To overwrite an existing role's `name`/`description`/`scopes` instead of returning it unchanged, set `?upsert=true` (this also requires the `profiles:u` scope). If you use a scoped credential, the role's scopes may not exceed your own; a root API key (`sk_`) is exempt. Requires the `profiles:c` scope.
|
|
3116
3137
|
*
|
|
3117
3138
|
* @param {Vectros.CreateRoleRequest} request
|
|
3118
3139
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -3120,6 +3141,7 @@ var AuthClient = class {
|
|
|
3120
3141
|
* @throws {@link Vectros.BadRequestError}
|
|
3121
3142
|
* @throws {@link Vectros.ForbiddenError}
|
|
3122
3143
|
* @throws {@link Vectros.NotFoundError}
|
|
3144
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3123
3145
|
*
|
|
3124
3146
|
* @example
|
|
3125
3147
|
* await client.auth.createRole({
|
|
@@ -3137,7 +3159,10 @@ var AuthClient = class {
|
|
|
3137
3159
|
return HttpResponsePromise.fromPromise(this.__createRole(request, requestOptions));
|
|
3138
3160
|
}
|
|
3139
3161
|
async __createRole(request, requestOptions) {
|
|
3140
|
-
const { contextId, body: _body } = request;
|
|
3162
|
+
const { contextId, upsert, body: _body } = request;
|
|
3163
|
+
const _queryParams = {
|
|
3164
|
+
upsert
|
|
3165
|
+
};
|
|
3141
3166
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
3142
3167
|
const _headers = mergeHeaders(
|
|
3143
3168
|
_authRequest.headers,
|
|
@@ -3152,7 +3177,7 @@ var AuthClient = class {
|
|
|
3152
3177
|
method: "POST",
|
|
3153
3178
|
headers: _headers,
|
|
3154
3179
|
contentType: "application/json",
|
|
3155
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
3180
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
3156
3181
|
requestType: "json",
|
|
3157
3182
|
body: _body,
|
|
3158
3183
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -3172,6 +3197,8 @@ var AuthClient = class {
|
|
|
3172
3197
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3173
3198
|
case 404:
|
|
3174
3199
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3200
|
+
case 429:
|
|
3201
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3175
3202
|
default:
|
|
3176
3203
|
throw new VectrosError({
|
|
3177
3204
|
statusCode: _response.error.statusCode,
|
|
@@ -3259,6 +3286,7 @@ var AuthClient = class {
|
|
|
3259
3286
|
*
|
|
3260
3287
|
* @throws {@link Vectros.ForbiddenError}
|
|
3261
3288
|
* @throws {@link Vectros.NotFoundError}
|
|
3289
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3262
3290
|
*
|
|
3263
3291
|
* @example
|
|
3264
3292
|
* await client.auth.updateAccessProfile({
|
|
@@ -3306,6 +3334,8 @@ var AuthClient = class {
|
|
|
3306
3334
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3307
3335
|
case 404:
|
|
3308
3336
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3337
|
+
case 429:
|
|
3338
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3309
3339
|
default:
|
|
3310
3340
|
throw new VectrosError({
|
|
3311
3341
|
statusCode: _response.error.statusCode,
|
|
@@ -3329,6 +3359,7 @@ var AuthClient = class {
|
|
|
3329
3359
|
*
|
|
3330
3360
|
* @throws {@link Vectros.ForbiddenError}
|
|
3331
3361
|
* @throws {@link Vectros.NotFoundError}
|
|
3362
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3332
3363
|
*
|
|
3333
3364
|
* @example
|
|
3334
3365
|
* await client.auth.deleteAccessProfile({
|
|
@@ -3370,6 +3401,8 @@ var AuthClient = class {
|
|
|
3370
3401
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3371
3402
|
case 404:
|
|
3372
3403
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3404
|
+
case 429:
|
|
3405
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3373
3406
|
default:
|
|
3374
3407
|
throw new VectrosError({
|
|
3375
3408
|
statusCode: _response.error.statusCode,
|
|
@@ -3451,6 +3484,7 @@ var AuthClient = class {
|
|
|
3451
3484
|
*
|
|
3452
3485
|
* @throws {@link Vectros.ForbiddenError}
|
|
3453
3486
|
* @throws {@link Vectros.NotFoundError}
|
|
3487
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3454
3488
|
*
|
|
3455
3489
|
* @example
|
|
3456
3490
|
* await client.auth.updateAppContext({
|
|
@@ -3498,6 +3532,8 @@ var AuthClient = class {
|
|
|
3498
3532
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3499
3533
|
case 404:
|
|
3500
3534
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3535
|
+
case 429:
|
|
3536
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3501
3537
|
default:
|
|
3502
3538
|
throw new VectrosError({
|
|
3503
3539
|
statusCode: _response.error.statusCode,
|
|
@@ -3517,6 +3553,7 @@ var AuthClient = class {
|
|
|
3517
3553
|
* @throws {@link Vectros.BadRequestError}
|
|
3518
3554
|
* @throws {@link Vectros.ForbiddenError}
|
|
3519
3555
|
* @throws {@link Vectros.NotFoundError}
|
|
3556
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3520
3557
|
*
|
|
3521
3558
|
* @example
|
|
3522
3559
|
* await client.auth.deleteAppContext({
|
|
@@ -3562,6 +3599,8 @@ var AuthClient = class {
|
|
|
3562
3599
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3563
3600
|
case 404:
|
|
3564
3601
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3602
|
+
case 429:
|
|
3603
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3565
3604
|
default:
|
|
3566
3605
|
throw new VectrosError({
|
|
3567
3606
|
statusCode: _response.error.statusCode,
|
|
@@ -3649,6 +3688,7 @@ var AuthClient = class {
|
|
|
3649
3688
|
*
|
|
3650
3689
|
* @throws {@link Vectros.ForbiddenError}
|
|
3651
3690
|
* @throws {@link Vectros.NotFoundError}
|
|
3691
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3652
3692
|
*
|
|
3653
3693
|
* @example
|
|
3654
3694
|
* await client.auth.updateRole({
|
|
@@ -3700,6 +3740,8 @@ var AuthClient = class {
|
|
|
3700
3740
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3701
3741
|
case 404:
|
|
3702
3742
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3743
|
+
case 429:
|
|
3744
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3703
3745
|
default:
|
|
3704
3746
|
throw new VectrosError({
|
|
3705
3747
|
statusCode: _response.error.statusCode,
|
|
@@ -3723,6 +3765,7 @@ var AuthClient = class {
|
|
|
3723
3765
|
*
|
|
3724
3766
|
* @throws {@link Vectros.ForbiddenError}
|
|
3725
3767
|
* @throws {@link Vectros.NotFoundError}
|
|
3768
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3726
3769
|
*
|
|
3727
3770
|
* @example
|
|
3728
3771
|
* await client.auth.deleteRole({
|
|
@@ -3764,6 +3807,8 @@ var AuthClient = class {
|
|
|
3764
3807
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3765
3808
|
case 404:
|
|
3766
3809
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3810
|
+
case 429:
|
|
3811
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3767
3812
|
default:
|
|
3768
3813
|
throw new VectrosError({
|
|
3769
3814
|
statusCode: _response.error.statusCode,
|
|
@@ -4095,6 +4140,7 @@ var AuthClient = class {
|
|
|
4095
4140
|
*
|
|
4096
4141
|
* @throws {@link Vectros.BadRequestError}
|
|
4097
4142
|
* @throws {@link Vectros.ForbiddenError}
|
|
4143
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4098
4144
|
*
|
|
4099
4145
|
* @example
|
|
4100
4146
|
* await client.auth.mintToken({
|
|
@@ -4147,6 +4193,8 @@ var AuthClient = class {
|
|
|
4147
4193
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4148
4194
|
case 403:
|
|
4149
4195
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4196
|
+
case 429:
|
|
4197
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4150
4198
|
default:
|
|
4151
4199
|
throw new VectrosError({
|
|
4152
4200
|
statusCode: _response.error.statusCode,
|
|
@@ -4167,6 +4215,7 @@ var AuthClient = class {
|
|
|
4167
4215
|
* @throws {@link Vectros.ForbiddenError}
|
|
4168
4216
|
* @throws {@link Vectros.NotFoundError}
|
|
4169
4217
|
* @throws {@link Vectros.ConflictError}
|
|
4218
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4170
4219
|
*
|
|
4171
4220
|
* @example
|
|
4172
4221
|
* await client.auth.createInvite({
|
|
@@ -4215,6 +4264,8 @@ var AuthClient = class {
|
|
|
4215
4264
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4216
4265
|
case 409:
|
|
4217
4266
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4267
|
+
case 429:
|
|
4268
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4218
4269
|
default:
|
|
4219
4270
|
throw new VectrosError({
|
|
4220
4271
|
statusCode: _response.error.statusCode,
|
|
@@ -4234,6 +4285,7 @@ var AuthClient = class {
|
|
|
4234
4285
|
* @throws {@link Vectros.BadRequestError}
|
|
4235
4286
|
* @throws {@link Vectros.ForbiddenError}
|
|
4236
4287
|
* @throws {@link Vectros.NotFoundError}
|
|
4288
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4237
4289
|
*
|
|
4238
4290
|
* @example
|
|
4239
4291
|
* await client.auth.resendInvite({
|
|
@@ -4280,6 +4332,8 @@ var AuthClient = class {
|
|
|
4280
4332
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4281
4333
|
case 404:
|
|
4282
4334
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4335
|
+
case 429:
|
|
4336
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4283
4337
|
default:
|
|
4284
4338
|
throw new VectrosError({
|
|
4285
4339
|
statusCode: _response.error.statusCode,
|
|
@@ -4302,6 +4356,7 @@ var ComplianceClient = class {
|
|
|
4302
4356
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4303
4357
|
*
|
|
4304
4358
|
* @throws {@link Vectros.ForbiddenError}
|
|
4359
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4305
4360
|
* @throws {@link Vectros.NotImplementedError}
|
|
4306
4361
|
*
|
|
4307
4362
|
* @example
|
|
@@ -4343,6 +4398,8 @@ var ComplianceClient = class {
|
|
|
4343
4398
|
switch (_response.error.statusCode) {
|
|
4344
4399
|
case 403:
|
|
4345
4400
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4401
|
+
case 429:
|
|
4402
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4346
4403
|
case 501:
|
|
4347
4404
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
4348
4405
|
default:
|
|
@@ -4423,6 +4480,7 @@ var ComplianceClient = class {
|
|
|
4423
4480
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4424
4481
|
*
|
|
4425
4482
|
* @throws {@link Vectros.ForbiddenError}
|
|
4483
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4426
4484
|
* @throws {@link Vectros.NotImplementedError}
|
|
4427
4485
|
*
|
|
4428
4486
|
* @example
|
|
@@ -4462,6 +4520,8 @@ var ComplianceClient = class {
|
|
|
4462
4520
|
switch (_response.error.statusCode) {
|
|
4463
4521
|
case 403:
|
|
4464
4522
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4523
|
+
case 429:
|
|
4524
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4465
4525
|
case 501:
|
|
4466
4526
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
4467
4527
|
default:
|
|
@@ -4601,22 +4661,30 @@ var DocumentsClient = class {
|
|
|
4601
4661
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents");
|
|
4602
4662
|
}
|
|
4603
4663
|
/**
|
|
4604
|
-
* Creates a document from a raw text string and queues it for asynchronous indexing so it becomes searchable. Requires the `documents:c` scope.
|
|
4664
|
+
* Creates a document from a raw text string and queues it for asynchronous indexing so it becomes searchable. Optionally supply an `externalId` to make the create idempotent — if a document with the same `externalId` already exists in your context, that existing document is returned unchanged instead of a duplicate being created. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing document was returned) tells the two apart. To overwrite an existing document's content instead of returning it unchanged, set `?upsert=true` (this also requires the `documents:u` scope). Requires the `documents:c` scope.
|
|
4605
4665
|
*
|
|
4606
|
-
* @param {Vectros.
|
|
4666
|
+
* @param {Vectros.IngestDocumentRequest} request
|
|
4607
4667
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4608
4668
|
*
|
|
4609
4669
|
* @throws {@link Vectros.BadRequestError}
|
|
4670
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4671
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4610
4672
|
*
|
|
4611
4673
|
* @example
|
|
4612
4674
|
* await client.documents.ingestDocument({
|
|
4613
|
-
*
|
|
4675
|
+
* body: {
|
|
4676
|
+
* title: "Patient Intake Form \u2014 Jane Doe"
|
|
4677
|
+
* }
|
|
4614
4678
|
* })
|
|
4615
4679
|
*/
|
|
4616
4680
|
ingestDocument(request, requestOptions) {
|
|
4617
4681
|
return HttpResponsePromise.fromPromise(this.__ingestDocument(request, requestOptions));
|
|
4618
4682
|
}
|
|
4619
4683
|
async __ingestDocument(request, requestOptions) {
|
|
4684
|
+
const { upsert, body: _body } = request;
|
|
4685
|
+
const _queryParams = {
|
|
4686
|
+
upsert
|
|
4687
|
+
};
|
|
4620
4688
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4621
4689
|
const _headers = mergeHeaders(
|
|
4622
4690
|
_authRequest.headers,
|
|
@@ -4631,9 +4699,9 @@ var DocumentsClient = class {
|
|
|
4631
4699
|
method: "POST",
|
|
4632
4700
|
headers: _headers,
|
|
4633
4701
|
contentType: "application/json",
|
|
4634
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4702
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
4635
4703
|
requestType: "json",
|
|
4636
|
-
body:
|
|
4704
|
+
body: _body,
|
|
4637
4705
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4638
4706
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4639
4707
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -4647,6 +4715,10 @@ var DocumentsClient = class {
|
|
|
4647
4715
|
switch (_response.error.statusCode) {
|
|
4648
4716
|
case 400:
|
|
4649
4717
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4718
|
+
case 403:
|
|
4719
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4720
|
+
case 429:
|
|
4721
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4650
4722
|
default:
|
|
4651
4723
|
throw new VectrosError({
|
|
4652
4724
|
statusCode: _response.error.statusCode,
|
|
@@ -4721,6 +4793,7 @@ var DocumentsClient = class {
|
|
|
4721
4793
|
* @throws {@link Vectros.BadRequestError}
|
|
4722
4794
|
* @throws {@link Vectros.NotFoundError}
|
|
4723
4795
|
* @throws {@link Vectros.ConflictError}
|
|
4796
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4724
4797
|
*
|
|
4725
4798
|
* @example
|
|
4726
4799
|
* await client.documents.updateDocument({
|
|
@@ -4769,6 +4842,8 @@ var DocumentsClient = class {
|
|
|
4769
4842
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4770
4843
|
case 409:
|
|
4771
4844
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4845
|
+
case 429:
|
|
4846
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4772
4847
|
default:
|
|
4773
4848
|
throw new VectrosError({
|
|
4774
4849
|
statusCode: _response.error.statusCode,
|
|
@@ -4786,6 +4861,7 @@ var DocumentsClient = class {
|
|
|
4786
4861
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4787
4862
|
*
|
|
4788
4863
|
* @throws {@link Vectros.NotFoundError}
|
|
4864
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4789
4865
|
*
|
|
4790
4866
|
* @example
|
|
4791
4867
|
* await client.documents.deleteDocument({
|
|
@@ -4824,6 +4900,8 @@ var DocumentsClient = class {
|
|
|
4824
4900
|
switch (_response.error.statusCode) {
|
|
4825
4901
|
case 404:
|
|
4826
4902
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4903
|
+
case 429:
|
|
4904
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4827
4905
|
default:
|
|
4828
4906
|
throw new VectrosError({
|
|
4829
4907
|
statusCode: _response.error.statusCode,
|
|
@@ -4843,6 +4921,7 @@ var DocumentsClient = class {
|
|
|
4843
4921
|
* @throws {@link Vectros.BadRequestError}
|
|
4844
4922
|
* @throws {@link Vectros.NotFoundError}
|
|
4845
4923
|
* @throws {@link Vectros.ConflictError}
|
|
4924
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4846
4925
|
*
|
|
4847
4926
|
* @example
|
|
4848
4927
|
* await client.documents.patchDocument({
|
|
@@ -4891,6 +4970,8 @@ var DocumentsClient = class {
|
|
|
4891
4970
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4892
4971
|
case 409:
|
|
4893
4972
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4973
|
+
case 429:
|
|
4974
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4894
4975
|
default:
|
|
4895
4976
|
throw new VectrosError({
|
|
4896
4977
|
statusCode: _response.error.statusCode,
|
|
@@ -4902,7 +4983,7 @@ var DocumentsClient = class {
|
|
|
4902
4983
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v1/documents/{id}");
|
|
4903
4984
|
}
|
|
4904
4985
|
/**
|
|
4905
|
-
* Finds documents of a given type by
|
|
4986
|
+
* Finds documents of a given type by field value. Supported fields: `externalId` (the document's first-class external identifier — no schema declaration required) and any field declared as a lookup field on the bound schema. A lookup on a sensitive field is rejected here because the value would appear in the URL query string; use POST /v1/documents/lookup (the request-body variant) for a sensitive field instead. Results are paginated: set `limit` for the page size and feed the returned `nextCursor` back as `startFrom` to fetch the next page. The response is a `{data, nextCursor}` envelope. Requires the `documents:r` scope.
|
|
4906
4987
|
*
|
|
4907
4988
|
* @param {Vectros.LookupDocumentsRequest} request
|
|
4908
4989
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4971,6 +5052,7 @@ var DocumentsClient = class {
|
|
|
4971
5052
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4972
5053
|
*
|
|
4973
5054
|
* @throws {@link Vectros.BadRequestError}
|
|
5055
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4974
5056
|
*
|
|
4975
5057
|
* @example
|
|
4976
5058
|
* await client.documents.lookupDocumentsByBody({
|
|
@@ -5012,6 +5094,8 @@ var DocumentsClient = class {
|
|
|
5012
5094
|
switch (_response.error.statusCode) {
|
|
5013
5095
|
case 400:
|
|
5014
5096
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5097
|
+
case 429:
|
|
5098
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5015
5099
|
default:
|
|
5016
5100
|
throw new VectrosError({
|
|
5017
5101
|
statusCode: _response.error.statusCode,
|
|
@@ -5194,12 +5278,14 @@ var DocumentsClient = class {
|
|
|
5194
5278
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents/{id}/versions");
|
|
5195
5279
|
}
|
|
5196
5280
|
/**
|
|
5197
|
-
* Starts a file-based document by returning a short-lived presigned S3 PUT URL. Upload the file bytes directly to `uploadUrl`; the document is then automatically queued for text extraction and asynchronous indexing. Requires the `documents:c` scope.
|
|
5281
|
+
* Starts a file-based document by returning a short-lived presigned S3 PUT URL. Upload the file bytes directly to `uploadUrl`; the document is then automatically queued for text extraction and asynchronous indexing. Supplying an `externalId` makes this idempotent — re-initiating an upload with the same `externalId` re-issues a fresh presigned URL to the SAME existing document/object (so a re-upload inherently replaces the file body) rather than creating a duplicate. The response's `created` field (and the HTTP status — 201 when a new document was minted, 200 when an existing one was matched) tells the two apart. With `?upsert=true`, the submitted `payload`/`title` are also applied to the matched document (file-body divergence cannot be diffed at upload-init — the bytes have not arrived yet — so the re-upload itself replaces the body; `?upsert=true` requires the `documents:u` scope). Requires the `documents:c` scope.
|
|
5198
5282
|
*
|
|
5199
5283
|
* @param {Vectros.FileUploadRequest} request
|
|
5200
5284
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5201
5285
|
*
|
|
5202
5286
|
* @throws {@link Vectros.BadRequestError}
|
|
5287
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
5288
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5203
5289
|
*
|
|
5204
5290
|
* @example
|
|
5205
5291
|
* await client.documents.uploadDocument({
|
|
@@ -5211,6 +5297,10 @@ var DocumentsClient = class {
|
|
|
5211
5297
|
return HttpResponsePromise.fromPromise(this.__uploadDocument(request, requestOptions));
|
|
5212
5298
|
}
|
|
5213
5299
|
async __uploadDocument(request, requestOptions) {
|
|
5300
|
+
const { upsert, ..._body } = request;
|
|
5301
|
+
const _queryParams = {
|
|
5302
|
+
upsert
|
|
5303
|
+
};
|
|
5214
5304
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5215
5305
|
const _headers = mergeHeaders(
|
|
5216
5306
|
_authRequest.headers,
|
|
@@ -5225,9 +5315,9 @@ var DocumentsClient = class {
|
|
|
5225
5315
|
method: "POST",
|
|
5226
5316
|
headers: _headers,
|
|
5227
5317
|
contentType: "application/json",
|
|
5228
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5318
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5229
5319
|
requestType: "json",
|
|
5230
|
-
body:
|
|
5320
|
+
body: _body,
|
|
5231
5321
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5232
5322
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5233
5323
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5241,6 +5331,10 @@ var DocumentsClient = class {
|
|
|
5241
5331
|
switch (_response.error.statusCode) {
|
|
5242
5332
|
case 400:
|
|
5243
5333
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5334
|
+
case 403:
|
|
5335
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
5336
|
+
case 429:
|
|
5337
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5244
5338
|
default:
|
|
5245
5339
|
throw new VectrosError({
|
|
5246
5340
|
statusCode: _response.error.statusCode,
|
|
@@ -5317,22 +5411,30 @@ var FoldersClient = class {
|
|
|
5317
5411
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/folders");
|
|
5318
5412
|
}
|
|
5319
5413
|
/**
|
|
5320
|
-
* Creates a folder to organize your documents and records. If `parentFolderId` is omitted, the folder is created under your context's default root folder. Requires the `folders:c` scope.
|
|
5414
|
+
* Creates a folder to organize your documents and records. If `parentFolderId` is omitted, the folder is created under your context's default root folder. Folder creation is idempotent by (slug + parent): if a folder with the same slug already exists under the same parent, that existing folder is returned unchanged instead of a duplicate being created. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing folder was returned) tells the two apart. To overwrite an existing folder's mutable fields instead of returning it unchanged, set `?upsert=true` (this also requires the `folders:u` scope). Requires the `folders:c` scope.
|
|
5321
5415
|
*
|
|
5322
|
-
* @param {Vectros.
|
|
5416
|
+
* @param {Vectros.CreateFolderRequest} request
|
|
5323
5417
|
* @param {FoldersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5324
5418
|
*
|
|
5325
5419
|
* @throws {@link Vectros.BadRequestError}
|
|
5420
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
5421
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5326
5422
|
*
|
|
5327
5423
|
* @example
|
|
5328
5424
|
* await client.folders.createFolder({
|
|
5329
|
-
*
|
|
5425
|
+
* body: {
|
|
5426
|
+
* name: "Patient Records 2024"
|
|
5427
|
+
* }
|
|
5330
5428
|
* })
|
|
5331
5429
|
*/
|
|
5332
5430
|
createFolder(request, requestOptions) {
|
|
5333
5431
|
return HttpResponsePromise.fromPromise(this.__createFolder(request, requestOptions));
|
|
5334
5432
|
}
|
|
5335
5433
|
async __createFolder(request, requestOptions) {
|
|
5434
|
+
const { upsert, body: _body } = request;
|
|
5435
|
+
const _queryParams = {
|
|
5436
|
+
upsert
|
|
5437
|
+
};
|
|
5336
5438
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5337
5439
|
const _headers = mergeHeaders(
|
|
5338
5440
|
_authRequest.headers,
|
|
@@ -5347,9 +5449,9 @@ var FoldersClient = class {
|
|
|
5347
5449
|
method: "POST",
|
|
5348
5450
|
headers: _headers,
|
|
5349
5451
|
contentType: "application/json",
|
|
5350
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5452
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5351
5453
|
requestType: "json",
|
|
5352
|
-
body:
|
|
5454
|
+
body: _body,
|
|
5353
5455
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5354
5456
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5355
5457
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5363,6 +5465,10 @@ var FoldersClient = class {
|
|
|
5363
5465
|
switch (_response.error.statusCode) {
|
|
5364
5466
|
case 400:
|
|
5365
5467
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5468
|
+
case 403:
|
|
5469
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
5470
|
+
case 429:
|
|
5471
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5366
5472
|
default:
|
|
5367
5473
|
throw new VectrosError({
|
|
5368
5474
|
statusCode: _response.error.statusCode,
|
|
@@ -5435,6 +5541,7 @@ var FoldersClient = class {
|
|
|
5435
5541
|
* @param {FoldersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5436
5542
|
*
|
|
5437
5543
|
* @throws {@link Vectros.NotFoundError}
|
|
5544
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5438
5545
|
*
|
|
5439
5546
|
* @example
|
|
5440
5547
|
* await client.folders.updateFolder({
|
|
@@ -5479,6 +5586,8 @@ var FoldersClient = class {
|
|
|
5479
5586
|
switch (_response.error.statusCode) {
|
|
5480
5587
|
case 404:
|
|
5481
5588
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5589
|
+
case 429:
|
|
5590
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5482
5591
|
default:
|
|
5483
5592
|
throw new VectrosError({
|
|
5484
5593
|
statusCode: _response.error.statusCode,
|
|
@@ -5497,6 +5606,7 @@ var FoldersClient = class {
|
|
|
5497
5606
|
*
|
|
5498
5607
|
* @throws {@link Vectros.BadRequestError}
|
|
5499
5608
|
* @throws {@link Vectros.NotFoundError}
|
|
5609
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5500
5610
|
*
|
|
5501
5611
|
* @example
|
|
5502
5612
|
* await client.folders.deleteFolder({
|
|
@@ -5537,6 +5647,8 @@ var FoldersClient = class {
|
|
|
5537
5647
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5538
5648
|
case 404:
|
|
5539
5649
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5650
|
+
case 429:
|
|
5651
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5540
5652
|
default:
|
|
5541
5653
|
throw new VectrosError({
|
|
5542
5654
|
statusCode: _response.error.statusCode,
|
|
@@ -5556,6 +5668,7 @@ var FoldersClient = class {
|
|
|
5556
5668
|
* @throws {@link Vectros.BadRequestError}
|
|
5557
5669
|
* @throws {@link Vectros.NotFoundError}
|
|
5558
5670
|
* @throws {@link Vectros.ConflictError}
|
|
5671
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5559
5672
|
*
|
|
5560
5673
|
* @example
|
|
5561
5674
|
* await client.folders.patchFolder({
|
|
@@ -5604,6 +5717,8 @@ var FoldersClient = class {
|
|
|
5604
5717
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5605
5718
|
case 409:
|
|
5606
5719
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
5720
|
+
case 429:
|
|
5721
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5607
5722
|
default:
|
|
5608
5723
|
throw new VectrosError({
|
|
5609
5724
|
statusCode: _response.error.statusCode,
|
|
@@ -5760,22 +5875,30 @@ var IdentityClient = class {
|
|
|
5760
5875
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/clients");
|
|
5761
5876
|
}
|
|
5762
5877
|
/**
|
|
5763
|
-
* Creates a new client identity in your account. This call is idempotent on `externalId`: if a client with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. Requires the `clients:c` scope.
|
|
5878
|
+
* Creates a new client identity in your account. This call is idempotent on `externalId`: if a client 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 client was returned) tells the two apart. To overwrite an existing client's content instead of returning it unchanged, set `?upsert=true` (this also requires the `clients:u` scope). Requires the `clients:c` scope.
|
|
5764
5879
|
*
|
|
5765
|
-
* @param {Vectros.
|
|
5880
|
+
* @param {Vectros.CreateClientRequest} request
|
|
5766
5881
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5767
5882
|
*
|
|
5768
5883
|
* @throws {@link Vectros.BadRequestError}
|
|
5884
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
5885
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5769
5886
|
*
|
|
5770
5887
|
* @example
|
|
5771
5888
|
* await client.identity.createClient({
|
|
5772
|
-
*
|
|
5889
|
+
* body: {
|
|
5890
|
+
* externalId: "patient_789"
|
|
5891
|
+
* }
|
|
5773
5892
|
* })
|
|
5774
5893
|
*/
|
|
5775
5894
|
createClient(request, requestOptions) {
|
|
5776
5895
|
return HttpResponsePromise.fromPromise(this.__createClient(request, requestOptions));
|
|
5777
5896
|
}
|
|
5778
5897
|
async __createClient(request, requestOptions) {
|
|
5898
|
+
const { upsert, body: _body } = request;
|
|
5899
|
+
const _queryParams = {
|
|
5900
|
+
upsert
|
|
5901
|
+
};
|
|
5779
5902
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5780
5903
|
const _headers = mergeHeaders(
|
|
5781
5904
|
_authRequest.headers,
|
|
@@ -5790,9 +5913,9 @@ var IdentityClient = class {
|
|
|
5790
5913
|
method: "POST",
|
|
5791
5914
|
headers: _headers,
|
|
5792
5915
|
contentType: "application/json",
|
|
5793
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5916
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5794
5917
|
requestType: "json",
|
|
5795
|
-
body:
|
|
5918
|
+
body: _body,
|
|
5796
5919
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5797
5920
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5798
5921
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5806,6 +5929,10 @@ var IdentityClient = class {
|
|
|
5806
5929
|
switch (_response.error.statusCode) {
|
|
5807
5930
|
case 400:
|
|
5808
5931
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5932
|
+
case 403:
|
|
5933
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
5934
|
+
case 429:
|
|
5935
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5809
5936
|
default:
|
|
5810
5937
|
throw new VectrosError({
|
|
5811
5938
|
statusCode: _response.error.statusCode,
|
|
@@ -5878,6 +6005,7 @@ var IdentityClient = class {
|
|
|
5878
6005
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5879
6006
|
*
|
|
5880
6007
|
* @throws {@link Vectros.NotFoundError}
|
|
6008
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5881
6009
|
*
|
|
5882
6010
|
* @example
|
|
5883
6011
|
* await client.identity.updateClient({
|
|
@@ -5922,6 +6050,8 @@ var IdentityClient = class {
|
|
|
5922
6050
|
switch (_response.error.statusCode) {
|
|
5923
6051
|
case 404:
|
|
5924
6052
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6053
|
+
case 429:
|
|
6054
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5925
6055
|
default:
|
|
5926
6056
|
throw new VectrosError({
|
|
5927
6057
|
statusCode: _response.error.statusCode,
|
|
@@ -5939,6 +6069,7 @@ var IdentityClient = class {
|
|
|
5939
6069
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5940
6070
|
*
|
|
5941
6071
|
* @throws {@link Vectros.NotFoundError}
|
|
6072
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5942
6073
|
*
|
|
5943
6074
|
* @example
|
|
5944
6075
|
* await client.identity.deleteClient({
|
|
@@ -5977,6 +6108,8 @@ var IdentityClient = class {
|
|
|
5977
6108
|
switch (_response.error.statusCode) {
|
|
5978
6109
|
case 404:
|
|
5979
6110
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6111
|
+
case 429:
|
|
6112
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5980
6113
|
default:
|
|
5981
6114
|
throw new VectrosError({
|
|
5982
6115
|
statusCode: _response.error.statusCode,
|
|
@@ -5994,6 +6127,7 @@ var IdentityClient = class {
|
|
|
5994
6127
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5995
6128
|
*
|
|
5996
6129
|
* @throws {@link Vectros.BadRequestError}
|
|
6130
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5997
6131
|
*
|
|
5998
6132
|
* @example
|
|
5999
6133
|
* await client.identity.lookupClients({
|
|
@@ -6035,6 +6169,8 @@ var IdentityClient = class {
|
|
|
6035
6169
|
switch (_response.error.statusCode) {
|
|
6036
6170
|
case 400:
|
|
6037
6171
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6172
|
+
case 429:
|
|
6173
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6038
6174
|
default:
|
|
6039
6175
|
throw new VectrosError({
|
|
6040
6176
|
statusCode: _response.error.statusCode,
|
|
@@ -6183,22 +6319,30 @@ var IdentityClient = class {
|
|
|
6183
6319
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/orgs");
|
|
6184
6320
|
}
|
|
6185
6321
|
/**
|
|
6186
|
-
* 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. Requires the `orgs:c` scope.
|
|
6322
|
+
* 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.
|
|
6187
6323
|
*
|
|
6188
|
-
* @param {Vectros.
|
|
6324
|
+
* @param {Vectros.CreateOrgRequest} request
|
|
6189
6325
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6190
6326
|
*
|
|
6191
6327
|
* @throws {@link Vectros.BadRequestError}
|
|
6328
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
6329
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6192
6330
|
*
|
|
6193
6331
|
* @example
|
|
6194
6332
|
* await client.identity.createOrg({
|
|
6195
|
-
*
|
|
6333
|
+
* body: {
|
|
6334
|
+
* externalId: "clinic_001"
|
|
6335
|
+
* }
|
|
6196
6336
|
* })
|
|
6197
6337
|
*/
|
|
6198
6338
|
createOrg(request, requestOptions) {
|
|
6199
6339
|
return HttpResponsePromise.fromPromise(this.__createOrg(request, requestOptions));
|
|
6200
6340
|
}
|
|
6201
6341
|
async __createOrg(request, requestOptions) {
|
|
6342
|
+
const { upsert, body: _body } = request;
|
|
6343
|
+
const _queryParams = {
|
|
6344
|
+
upsert
|
|
6345
|
+
};
|
|
6202
6346
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6203
6347
|
const _headers = mergeHeaders(
|
|
6204
6348
|
_authRequest.headers,
|
|
@@ -6213,9 +6357,9 @@ var IdentityClient = class {
|
|
|
6213
6357
|
method: "POST",
|
|
6214
6358
|
headers: _headers,
|
|
6215
6359
|
contentType: "application/json",
|
|
6216
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6360
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6217
6361
|
requestType: "json",
|
|
6218
|
-
body:
|
|
6362
|
+
body: _body,
|
|
6219
6363
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6220
6364
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6221
6365
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6229,6 +6373,10 @@ var IdentityClient = class {
|
|
|
6229
6373
|
switch (_response.error.statusCode) {
|
|
6230
6374
|
case 400:
|
|
6231
6375
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6376
|
+
case 403:
|
|
6377
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6378
|
+
case 429:
|
|
6379
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6232
6380
|
default:
|
|
6233
6381
|
throw new VectrosError({
|
|
6234
6382
|
statusCode: _response.error.statusCode,
|
|
@@ -6301,6 +6449,7 @@ var IdentityClient = class {
|
|
|
6301
6449
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6302
6450
|
*
|
|
6303
6451
|
* @throws {@link Vectros.NotFoundError}
|
|
6452
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6304
6453
|
*
|
|
6305
6454
|
* @example
|
|
6306
6455
|
* await client.identity.updateOrg({
|
|
@@ -6345,6 +6494,8 @@ var IdentityClient = class {
|
|
|
6345
6494
|
switch (_response.error.statusCode) {
|
|
6346
6495
|
case 404:
|
|
6347
6496
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6497
|
+
case 429:
|
|
6498
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6348
6499
|
default:
|
|
6349
6500
|
throw new VectrosError({
|
|
6350
6501
|
statusCode: _response.error.statusCode,
|
|
@@ -6362,6 +6513,7 @@ var IdentityClient = class {
|
|
|
6362
6513
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6363
6514
|
*
|
|
6364
6515
|
* @throws {@link Vectros.NotFoundError}
|
|
6516
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6365
6517
|
*
|
|
6366
6518
|
* @example
|
|
6367
6519
|
* await client.identity.deleteOrg({
|
|
@@ -6400,6 +6552,8 @@ var IdentityClient = class {
|
|
|
6400
6552
|
switch (_response.error.statusCode) {
|
|
6401
6553
|
case 404:
|
|
6402
6554
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6555
|
+
case 429:
|
|
6556
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6403
6557
|
default:
|
|
6404
6558
|
throw new VectrosError({
|
|
6405
6559
|
statusCode: _response.error.statusCode,
|
|
@@ -6417,6 +6571,7 @@ var IdentityClient = class {
|
|
|
6417
6571
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6418
6572
|
*
|
|
6419
6573
|
* @throws {@link Vectros.BadRequestError}
|
|
6574
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6420
6575
|
*
|
|
6421
6576
|
* @example
|
|
6422
6577
|
* await client.identity.lookupOrgs({
|
|
@@ -6458,6 +6613,8 @@ var IdentityClient = class {
|
|
|
6458
6613
|
switch (_response.error.statusCode) {
|
|
6459
6614
|
case 400:
|
|
6460
6615
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6616
|
+
case 429:
|
|
6617
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6461
6618
|
default:
|
|
6462
6619
|
throw new VectrosError({
|
|
6463
6620
|
statusCode: _response.error.statusCode,
|
|
@@ -6592,22 +6749,30 @@ var IdentityClient = class {
|
|
|
6592
6749
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users");
|
|
6593
6750
|
}
|
|
6594
6751
|
/**
|
|
6595
|
-
* Creates a user identity in your account. The operation is idempotent on `externalId`: if a user with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. Requires the `users:c` scope.
|
|
6752
|
+
* Creates a user identity in your account. The operation is idempotent on `externalId`: if a user 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 user was returned) tells the two apart. To overwrite an existing user's mutable fields (email, status, payload, schema binding) instead of returning it unchanged, set `?upsert=true` (this also requires the `users:u` scope). Requires the `users:c` scope.
|
|
6596
6753
|
*
|
|
6597
|
-
* @param {Vectros.
|
|
6754
|
+
* @param {Vectros.CreateUserRequest} request
|
|
6598
6755
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6599
6756
|
*
|
|
6600
6757
|
* @throws {@link Vectros.BadRequestError}
|
|
6758
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
6759
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6601
6760
|
*
|
|
6602
6761
|
* @example
|
|
6603
6762
|
* await client.identity.createUser({
|
|
6604
|
-
*
|
|
6763
|
+
* body: {
|
|
6764
|
+
* externalId: "usr_12345"
|
|
6765
|
+
* }
|
|
6605
6766
|
* })
|
|
6606
6767
|
*/
|
|
6607
6768
|
createUser(request, requestOptions) {
|
|
6608
6769
|
return HttpResponsePromise.fromPromise(this.__createUser(request, requestOptions));
|
|
6609
6770
|
}
|
|
6610
6771
|
async __createUser(request, requestOptions) {
|
|
6772
|
+
const { upsert, body: _body } = request;
|
|
6773
|
+
const _queryParams = {
|
|
6774
|
+
upsert
|
|
6775
|
+
};
|
|
6611
6776
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6612
6777
|
const _headers = mergeHeaders(
|
|
6613
6778
|
_authRequest.headers,
|
|
@@ -6622,9 +6787,9 @@ var IdentityClient = class {
|
|
|
6622
6787
|
method: "POST",
|
|
6623
6788
|
headers: _headers,
|
|
6624
6789
|
contentType: "application/json",
|
|
6625
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6790
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6626
6791
|
requestType: "json",
|
|
6627
|
-
body:
|
|
6792
|
+
body: _body,
|
|
6628
6793
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6629
6794
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6630
6795
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6638,6 +6803,10 @@ var IdentityClient = class {
|
|
|
6638
6803
|
switch (_response.error.statusCode) {
|
|
6639
6804
|
case 400:
|
|
6640
6805
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6806
|
+
case 403:
|
|
6807
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6808
|
+
case 429:
|
|
6809
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6641
6810
|
default:
|
|
6642
6811
|
throw new VectrosError({
|
|
6643
6812
|
statusCode: _response.error.statusCode,
|
|
@@ -6710,6 +6879,7 @@ var IdentityClient = class {
|
|
|
6710
6879
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6711
6880
|
*
|
|
6712
6881
|
* @throws {@link Vectros.NotFoundError}
|
|
6882
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6713
6883
|
*
|
|
6714
6884
|
* @example
|
|
6715
6885
|
* await client.identity.updateUser({
|
|
@@ -6754,6 +6924,8 @@ var IdentityClient = class {
|
|
|
6754
6924
|
switch (_response.error.statusCode) {
|
|
6755
6925
|
case 404:
|
|
6756
6926
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6927
|
+
case 429:
|
|
6928
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6757
6929
|
default:
|
|
6758
6930
|
throw new VectrosError({
|
|
6759
6931
|
statusCode: _response.error.statusCode,
|
|
@@ -6771,6 +6943,7 @@ var IdentityClient = class {
|
|
|
6771
6943
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6772
6944
|
*
|
|
6773
6945
|
* @throws {@link Vectros.NotFoundError}
|
|
6946
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6774
6947
|
*
|
|
6775
6948
|
* @example
|
|
6776
6949
|
* await client.identity.deleteUser({
|
|
@@ -6809,6 +6982,8 @@ var IdentityClient = class {
|
|
|
6809
6982
|
switch (_response.error.statusCode) {
|
|
6810
6983
|
case 404:
|
|
6811
6984
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6985
|
+
case 429:
|
|
6986
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6812
6987
|
default:
|
|
6813
6988
|
throw new VectrosError({
|
|
6814
6989
|
statusCode: _response.error.statusCode,
|
|
@@ -6826,6 +7001,7 @@ var IdentityClient = class {
|
|
|
6826
7001
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6827
7002
|
*
|
|
6828
7003
|
* @throws {@link Vectros.BadRequestError}
|
|
7004
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6829
7005
|
*
|
|
6830
7006
|
* @example
|
|
6831
7007
|
* await client.identity.lookupUsers({
|
|
@@ -6867,6 +7043,8 @@ var IdentityClient = class {
|
|
|
6867
7043
|
switch (_response.error.statusCode) {
|
|
6868
7044
|
case 400:
|
|
6869
7045
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7046
|
+
case 429:
|
|
7047
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6870
7048
|
default:
|
|
6871
7049
|
throw new VectrosError({
|
|
6872
7050
|
statusCode: _response.error.statusCode,
|
|
@@ -7203,6 +7381,7 @@ var RecordsClient = class {
|
|
|
7203
7381
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7204
7382
|
*
|
|
7205
7383
|
* @throws {@link Vectros.ForbiddenError}
|
|
7384
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7206
7385
|
* @throws {@link Vectros.NotImplementedError}
|
|
7207
7386
|
*
|
|
7208
7387
|
* @example
|
|
@@ -7242,6 +7421,8 @@ var RecordsClient = class {
|
|
|
7242
7421
|
switch (_response.error.statusCode) {
|
|
7243
7422
|
case 403:
|
|
7244
7423
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7424
|
+
case 429:
|
|
7425
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7245
7426
|
case 501:
|
|
7246
7427
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
7247
7428
|
default:
|
|
@@ -7261,6 +7442,7 @@ var RecordsClient = class {
|
|
|
7261
7442
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7262
7443
|
*
|
|
7263
7444
|
* @throws {@link Vectros.ForbiddenError}
|
|
7445
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7264
7446
|
* @throws {@link Vectros.NotImplementedError}
|
|
7265
7447
|
*
|
|
7266
7448
|
* @example
|
|
@@ -7300,6 +7482,8 @@ var RecordsClient = class {
|
|
|
7300
7482
|
switch (_response.error.statusCode) {
|
|
7301
7483
|
case 403:
|
|
7302
7484
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7485
|
+
case 429:
|
|
7486
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7303
7487
|
case 501:
|
|
7304
7488
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
7305
7489
|
default:
|
|
@@ -7319,6 +7503,7 @@ var RecordsClient = class {
|
|
|
7319
7503
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7320
7504
|
*
|
|
7321
7505
|
* @throws {@link Vectros.ForbiddenError}
|
|
7506
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7322
7507
|
* @throws {@link Vectros.NotImplementedError}
|
|
7323
7508
|
*
|
|
7324
7509
|
* @example
|
|
@@ -7358,6 +7543,8 @@ var RecordsClient = class {
|
|
|
7358
7543
|
switch (_response.error.statusCode) {
|
|
7359
7544
|
case 403:
|
|
7360
7545
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7546
|
+
case 429:
|
|
7547
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7361
7548
|
case 501:
|
|
7362
7549
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
7363
7550
|
default:
|
|
@@ -7435,29 +7622,36 @@ var RecordsClient = class {
|
|
|
7435
7622
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/records");
|
|
7436
7623
|
}
|
|
7437
7624
|
/**
|
|
7438
|
-
* Creates a new record of a given type. The `payload` is validated against that type's schema before the record is stored. Identify the type by sending `typeName`, `schemaId`, or both (they must agree); if you send only `schemaId`, the type is taken from that schema. Optionally supply an `externalId` to make the create idempotent — if a record with the same `externalId` already exists in your context, that existing record is returned unchanged instead of a duplicate being created. Requires the `records:c:<type>` scope.
|
|
7625
|
+
* Creates a new record of a given type. The `payload` is validated against that type's schema before the record is stored. Identify the type by sending `typeName`, `schemaId`, or both (they must agree); if you send only `schemaId`, the type is taken from that schema. Optionally supply an `externalId` to make the create idempotent — if a record with the same `externalId` already exists in your context, that existing record is returned unchanged instead of a duplicate being created. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing record was returned) tells the two apart. To overwrite an existing record's content instead of returning it unchanged, set `?upsert=true` (this also requires the `records:u:<type>` scope). Requires the `records:c:<type>` scope.
|
|
7439
7626
|
*
|
|
7440
|
-
* @param {Vectros.
|
|
7627
|
+
* @param {Vectros.CreateRecordRequest} request
|
|
7441
7628
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7442
7629
|
*
|
|
7443
7630
|
* @throws {@link Vectros.BadRequestError}
|
|
7444
7631
|
* @throws {@link Vectros.ForbiddenError}
|
|
7632
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7445
7633
|
*
|
|
7446
7634
|
* @example
|
|
7447
7635
|
* await client.records.createRecord({
|
|
7448
|
-
*
|
|
7449
|
-
*
|
|
7450
|
-
*
|
|
7451
|
-
*
|
|
7452
|
-
*
|
|
7453
|
-
*
|
|
7454
|
-
*
|
|
7636
|
+
* body: {
|
|
7637
|
+
* typeName: "intake_form",
|
|
7638
|
+
* schemaId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
7639
|
+
* payload: {
|
|
7640
|
+
* "first_name": "Jane",
|
|
7641
|
+
* "email": "jane@example.com"
|
|
7642
|
+
* },
|
|
7643
|
+
* folderId: "f47ac10b-58cc-4372-a567-0e02b2c3d479"
|
|
7644
|
+
* }
|
|
7455
7645
|
* })
|
|
7456
7646
|
*/
|
|
7457
7647
|
createRecord(request, requestOptions) {
|
|
7458
7648
|
return HttpResponsePromise.fromPromise(this.__createRecord(request, requestOptions));
|
|
7459
7649
|
}
|
|
7460
7650
|
async __createRecord(request, requestOptions) {
|
|
7651
|
+
const { upsert, body: _body } = request;
|
|
7652
|
+
const _queryParams = {
|
|
7653
|
+
upsert
|
|
7654
|
+
};
|
|
7461
7655
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
7462
7656
|
const _headers = mergeHeaders(
|
|
7463
7657
|
_authRequest.headers,
|
|
@@ -7472,9 +7666,9 @@ var RecordsClient = class {
|
|
|
7472
7666
|
method: "POST",
|
|
7473
7667
|
headers: _headers,
|
|
7474
7668
|
contentType: "application/json",
|
|
7475
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
7669
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
7476
7670
|
requestType: "json",
|
|
7477
|
-
body:
|
|
7671
|
+
body: _body,
|
|
7478
7672
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
7479
7673
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
7480
7674
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -7490,6 +7684,8 @@ var RecordsClient = class {
|
|
|
7490
7684
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7491
7685
|
case 403:
|
|
7492
7686
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7687
|
+
case 429:
|
|
7688
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7493
7689
|
default:
|
|
7494
7690
|
throw new VectrosError({
|
|
7495
7691
|
statusCode: _response.error.statusCode,
|
|
@@ -7564,6 +7760,7 @@ var RecordsClient = class {
|
|
|
7564
7760
|
* @throws {@link Vectros.BadRequestError}
|
|
7565
7761
|
* @throws {@link Vectros.NotFoundError}
|
|
7566
7762
|
* @throws {@link Vectros.ConflictError}
|
|
7763
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7567
7764
|
*
|
|
7568
7765
|
* @example
|
|
7569
7766
|
* await client.records.updateRecord({
|
|
@@ -7610,6 +7807,8 @@ var RecordsClient = class {
|
|
|
7610
7807
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7611
7808
|
case 409:
|
|
7612
7809
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
7810
|
+
case 429:
|
|
7811
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7613
7812
|
default:
|
|
7614
7813
|
throw new VectrosError({
|
|
7615
7814
|
statusCode: _response.error.statusCode,
|
|
@@ -7627,6 +7826,7 @@ var RecordsClient = class {
|
|
|
7627
7826
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7628
7827
|
*
|
|
7629
7828
|
* @throws {@link Vectros.NotFoundError}
|
|
7829
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7630
7830
|
*
|
|
7631
7831
|
* @example
|
|
7632
7832
|
* await client.records.deleteRecord({
|
|
@@ -7665,6 +7865,8 @@ var RecordsClient = class {
|
|
|
7665
7865
|
switch (_response.error.statusCode) {
|
|
7666
7866
|
case 404:
|
|
7667
7867
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7868
|
+
case 429:
|
|
7869
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7668
7870
|
default:
|
|
7669
7871
|
throw new VectrosError({
|
|
7670
7872
|
statusCode: _response.error.statusCode,
|
|
@@ -7684,6 +7886,7 @@ var RecordsClient = class {
|
|
|
7684
7886
|
* @throws {@link Vectros.BadRequestError}
|
|
7685
7887
|
* @throws {@link Vectros.NotFoundError}
|
|
7686
7888
|
* @throws {@link Vectros.ConflictError}
|
|
7889
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7687
7890
|
*
|
|
7688
7891
|
* @example
|
|
7689
7892
|
* await client.records.patchRecord({
|
|
@@ -7735,6 +7938,8 @@ var RecordsClient = class {
|
|
|
7735
7938
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7736
7939
|
case 409:
|
|
7737
7940
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
7941
|
+
case 429:
|
|
7942
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7738
7943
|
default:
|
|
7739
7944
|
throw new VectrosError({
|
|
7740
7945
|
statusCode: _response.error.statusCode,
|
|
@@ -7823,6 +8028,7 @@ var RecordsClient = class {
|
|
|
7823
8028
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7824
8029
|
*
|
|
7825
8030
|
* @throws {@link Vectros.BadRequestError}
|
|
8031
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7826
8032
|
*
|
|
7827
8033
|
* @example
|
|
7828
8034
|
* await client.records.lookupRecordsByBody({
|
|
@@ -7864,6 +8070,8 @@ var RecordsClient = class {
|
|
|
7864
8070
|
switch (_response.error.statusCode) {
|
|
7865
8071
|
case 400:
|
|
7866
8072
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8073
|
+
case 429:
|
|
8074
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7867
8075
|
default:
|
|
7868
8076
|
throw new VectrosError({
|
|
7869
8077
|
statusCode: _response.error.statusCode,
|
|
@@ -8056,42 +8264,50 @@ var SchemasClient = class {
|
|
|
8056
8264
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/schemas");
|
|
8057
8265
|
}
|
|
8058
8266
|
/**
|
|
8059
|
-
* Defines a new record type with optional field definitions, validation rules, and lookup indexes. Idempotent by `typeName` within the same ownership scope: re-creating an existing `typeName` returns the existing schema rather than failing. Requires the `schemas:w` scope.
|
|
8267
|
+
* Defines a new record type with optional field definitions, validation rules, and lookup indexes. Idempotent by `typeName` within the same ownership scope: re-creating an existing `typeName` returns the existing schema rather than failing. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing schema was returned) tells the two apart. To reconcile an existing schema to the submitted shape instead of returning it unchanged, set `?upsert=true` (this also requires the `schemas:w` scope; only legal schema changes are applied — migration-locked changes are rejected). Requires the `schemas:w` scope.
|
|
8060
8268
|
*
|
|
8061
|
-
* @param {Vectros.
|
|
8269
|
+
* @param {Vectros.CreateSchemaRequest} request
|
|
8062
8270
|
* @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8063
8271
|
*
|
|
8064
8272
|
* @throws {@link Vectros.BadRequestError}
|
|
8273
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
8274
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8065
8275
|
*
|
|
8066
8276
|
* @example
|
|
8067
8277
|
* await client.schemas.createSchema({
|
|
8068
|
-
*
|
|
8069
|
-
*
|
|
8070
|
-
*
|
|
8071
|
-
*
|
|
8072
|
-
*
|
|
8073
|
-
*
|
|
8074
|
-
*
|
|
8075
|
-
*
|
|
8076
|
-
*
|
|
8077
|
-
*
|
|
8078
|
-
*
|
|
8079
|
-
*
|
|
8080
|
-
*
|
|
8081
|
-
*
|
|
8082
|
-
*
|
|
8083
|
-
*
|
|
8084
|
-
*
|
|
8085
|
-
*
|
|
8086
|
-
*
|
|
8087
|
-
*
|
|
8088
|
-
*
|
|
8278
|
+
* body: {
|
|
8279
|
+
* typeName: "intake_form",
|
|
8280
|
+
* displayName: "Client Intake Form",
|
|
8281
|
+
* description: "Captures initial client information",
|
|
8282
|
+
* fields: [{
|
|
8283
|
+
* fieldId: "first_name",
|
|
8284
|
+
* fieldType: "string",
|
|
8285
|
+
* required: true,
|
|
8286
|
+
* searchable: true
|
|
8287
|
+
* }, {
|
|
8288
|
+
* fieldId: "email",
|
|
8289
|
+
* fieldType: "string",
|
|
8290
|
+
* required: true
|
|
8291
|
+
* }],
|
|
8292
|
+
* lookupFields: [{
|
|
8293
|
+
* fieldName: "email",
|
|
8294
|
+
* unique: true
|
|
8295
|
+
* }],
|
|
8296
|
+
* capabilities: {
|
|
8297
|
+
* "auditHistory": true
|
|
8298
|
+
* },
|
|
8299
|
+
* allowedSurfaces: ["record"]
|
|
8300
|
+
* }
|
|
8089
8301
|
* })
|
|
8090
8302
|
*/
|
|
8091
8303
|
createSchema(request, requestOptions) {
|
|
8092
8304
|
return HttpResponsePromise.fromPromise(this.__createSchema(request, requestOptions));
|
|
8093
8305
|
}
|
|
8094
8306
|
async __createSchema(request, requestOptions) {
|
|
8307
|
+
const { upsert, body: _body } = request;
|
|
8308
|
+
const _queryParams = {
|
|
8309
|
+
upsert
|
|
8310
|
+
};
|
|
8095
8311
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
8096
8312
|
const _headers = mergeHeaders(
|
|
8097
8313
|
_authRequest.headers,
|
|
@@ -8106,9 +8322,9 @@ var SchemasClient = class {
|
|
|
8106
8322
|
method: "POST",
|
|
8107
8323
|
headers: _headers,
|
|
8108
8324
|
contentType: "application/json",
|
|
8109
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
8325
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
8110
8326
|
requestType: "json",
|
|
8111
|
-
body:
|
|
8327
|
+
body: _body,
|
|
8112
8328
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
8113
8329
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
8114
8330
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -8122,6 +8338,10 @@ var SchemasClient = class {
|
|
|
8122
8338
|
switch (_response.error.statusCode) {
|
|
8123
8339
|
case 400:
|
|
8124
8340
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8341
|
+
case 403:
|
|
8342
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
8343
|
+
case 429:
|
|
8344
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8125
8345
|
default:
|
|
8126
8346
|
throw new VectrosError({
|
|
8127
8347
|
statusCode: _response.error.statusCode,
|
|
@@ -8195,6 +8415,7 @@ var SchemasClient = class {
|
|
|
8195
8415
|
*
|
|
8196
8416
|
* @throws {@link Vectros.BadRequestError}
|
|
8197
8417
|
* @throws {@link Vectros.NotFoundError}
|
|
8418
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8198
8419
|
*
|
|
8199
8420
|
* @example
|
|
8200
8421
|
* await client.schemas.updateSchema({
|
|
@@ -8243,6 +8464,8 @@ var SchemasClient = class {
|
|
|
8243
8464
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8244
8465
|
case 404:
|
|
8245
8466
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
8467
|
+
case 429:
|
|
8468
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8246
8469
|
default:
|
|
8247
8470
|
throw new VectrosError({
|
|
8248
8471
|
statusCode: _response.error.statusCode,
|
|
@@ -8261,6 +8484,7 @@ var SchemasClient = class {
|
|
|
8261
8484
|
*
|
|
8262
8485
|
* @throws {@link Vectros.NotFoundError}
|
|
8263
8486
|
* @throws {@link Vectros.ConflictError}
|
|
8487
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8264
8488
|
*
|
|
8265
8489
|
* @example
|
|
8266
8490
|
* await client.schemas.deleteSchema({
|
|
@@ -8301,6 +8525,8 @@ var SchemasClient = class {
|
|
|
8301
8525
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
8302
8526
|
case 409:
|
|
8303
8527
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
8528
|
+
case 429:
|
|
8529
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8304
8530
|
default:
|
|
8305
8531
|
throw new VectrosError({
|
|
8306
8532
|
statusCode: _response.error.statusCode,
|
|
@@ -8382,6 +8608,7 @@ var SearchClient = class {
|
|
|
8382
8608
|
*
|
|
8383
8609
|
* @throws {@link Vectros.BadRequestError}
|
|
8384
8610
|
* @throws {@link Vectros.ForbiddenError}
|
|
8611
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8385
8612
|
*
|
|
8386
8613
|
* @example
|
|
8387
8614
|
* await client.search.content({
|
|
@@ -8424,6 +8651,8 @@ var SearchClient = class {
|
|
|
8424
8651
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8425
8652
|
case 403:
|
|
8426
8653
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
8654
|
+
case 429:
|
|
8655
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8427
8656
|
default:
|
|
8428
8657
|
throw new VectrosError({
|
|
8429
8658
|
statusCode: _response.error.statusCode,
|
|
@@ -8545,8 +8774,8 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
8545
8774
|
|
|
8546
8775
|
// src/build-info.ts
|
|
8547
8776
|
var BUILD_INFO = {
|
|
8548
|
-
mcpServer: true ? "0.5.
|
|
8549
|
-
sdk: true ? "0.
|
|
8777
|
+
mcpServer: true ? "0.5.3" : "dev",
|
|
8778
|
+
sdk: true ? "0.31.0" : "dev"
|
|
8550
8779
|
};
|
|
8551
8780
|
|
|
8552
8781
|
// src/log.ts
|
|
@@ -9046,15 +9275,17 @@ var recordCreate = ({ client, log }) => ({
|
|
|
9046
9275
|
const type = args.type;
|
|
9047
9276
|
try {
|
|
9048
9277
|
const created = await client.records.createRecord({
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9278
|
+
body: {
|
|
9279
|
+
typeName: type,
|
|
9280
|
+
payload: args.fields,
|
|
9281
|
+
externalId: args.externalId,
|
|
9282
|
+
indexMode: args.indexMode,
|
|
9283
|
+
status: args.status,
|
|
9284
|
+
folderId: args.folderId,
|
|
9285
|
+
userId: args.userId,
|
|
9286
|
+
orgId: args.orgId,
|
|
9287
|
+
clientId: args.clientId
|
|
9288
|
+
}
|
|
9058
9289
|
});
|
|
9059
9290
|
log.debug({ tool: "record_create", type, id: created.id }, "record_create ok");
|
|
9060
9291
|
return { content: [{ type: "text", text: JSON.stringify(created, null, 2) }] };
|
|
@@ -9696,13 +9927,15 @@ var folderCreate = ({ client, log }) => ({
|
|
|
9696
9927
|
handler: async (args) => {
|
|
9697
9928
|
try {
|
|
9698
9929
|
const folder = await client.folders.createFolder({
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
|
|
9930
|
+
body: {
|
|
9931
|
+
name: args.name,
|
|
9932
|
+
description: args.description,
|
|
9933
|
+
parentFolderId: args.parentId,
|
|
9934
|
+
slug: args.slug,
|
|
9935
|
+
userId: args.userId,
|
|
9936
|
+
orgId: args.orgId,
|
|
9937
|
+
clientId: args.clientId
|
|
9938
|
+
}
|
|
9706
9939
|
});
|
|
9707
9940
|
log.debug({ tool: "folder_create", id: folder.id, name: folder.name }, "folder_create ok");
|
|
9708
9941
|
return { content: [{ type: "text", text: JSON.stringify(folder, null, 2) }] };
|
|
@@ -9956,11 +10189,13 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
9956
10189
|
if (text) {
|
|
9957
10190
|
const storeText = args.storeText ?? true;
|
|
9958
10191
|
const result = await client.documents.ingestDocument({
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
|
|
9963
|
-
|
|
10192
|
+
body: {
|
|
10193
|
+
title,
|
|
10194
|
+
text,
|
|
10195
|
+
indexMode,
|
|
10196
|
+
storeText,
|
|
10197
|
+
...common
|
|
10198
|
+
}
|
|
9964
10199
|
});
|
|
9965
10200
|
log.debug(
|
|
9966
10201
|
{ tool: "document_ingest", mode: "text", id: result?.id, indexMode },
|