@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.mjs
CHANGED
|
@@ -2514,6 +2514,7 @@ var AuthClient = class {
|
|
|
2514
2514
|
* @throws {@link Vectros.BadRequestError}
|
|
2515
2515
|
* @throws {@link Vectros.ForbiddenError}
|
|
2516
2516
|
* @throws {@link Vectros.NotFoundError}
|
|
2517
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2517
2518
|
*
|
|
2518
2519
|
* @example
|
|
2519
2520
|
* await client.auth.createScopedKey({
|
|
@@ -2561,6 +2562,8 @@ var AuthClient = class {
|
|
|
2561
2562
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2562
2563
|
case 404:
|
|
2563
2564
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2565
|
+
case 429:
|
|
2566
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2564
2567
|
default:
|
|
2565
2568
|
throw new VectrosError({
|
|
2566
2569
|
statusCode: _response.error.statusCode,
|
|
@@ -2637,6 +2640,7 @@ var AuthClient = class {
|
|
|
2637
2640
|
*
|
|
2638
2641
|
* @throws {@link Vectros.ForbiddenError}
|
|
2639
2642
|
* @throws {@link Vectros.NotFoundError}
|
|
2643
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2640
2644
|
*
|
|
2641
2645
|
* @example
|
|
2642
2646
|
* await client.auth.revokeScopedKey({
|
|
@@ -2677,6 +2681,8 @@ var AuthClient = class {
|
|
|
2677
2681
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2678
2682
|
case 404:
|
|
2679
2683
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2684
|
+
case 429:
|
|
2685
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2680
2686
|
default:
|
|
2681
2687
|
throw new VectrosError({
|
|
2682
2688
|
statusCode: _response.error.statusCode,
|
|
@@ -2832,7 +2838,7 @@ var AuthClient = class {
|
|
|
2832
2838
|
);
|
|
2833
2839
|
}
|
|
2834
2840
|
/**
|
|
2835
|
-
* 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.
|
|
2841
|
+
* 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.
|
|
2836
2842
|
*
|
|
2837
2843
|
* @param {Vectros.CreateAccessProfileRequest} request
|
|
2838
2844
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -2840,6 +2846,7 @@ var AuthClient = class {
|
|
|
2840
2846
|
* @throws {@link Vectros.BadRequestError}
|
|
2841
2847
|
* @throws {@link Vectros.ForbiddenError}
|
|
2842
2848
|
* @throws {@link Vectros.NotFoundError}
|
|
2849
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2843
2850
|
*
|
|
2844
2851
|
* @example
|
|
2845
2852
|
* await client.auth.createAccessProfile({
|
|
@@ -2853,7 +2860,10 @@ var AuthClient = class {
|
|
|
2853
2860
|
return HttpResponsePromise.fromPromise(this.__createAccessProfile(request, requestOptions));
|
|
2854
2861
|
}
|
|
2855
2862
|
async __createAccessProfile(request, requestOptions) {
|
|
2856
|
-
const { contextId, body: _body } = request;
|
|
2863
|
+
const { contextId, upsert, body: _body } = request;
|
|
2864
|
+
const _queryParams = {
|
|
2865
|
+
upsert
|
|
2866
|
+
};
|
|
2857
2867
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2858
2868
|
const _headers = mergeHeaders(
|
|
2859
2869
|
_authRequest.headers,
|
|
@@ -2868,7 +2878,7 @@ var AuthClient = class {
|
|
|
2868
2878
|
method: "POST",
|
|
2869
2879
|
headers: _headers,
|
|
2870
2880
|
contentType: "application/json",
|
|
2871
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
2881
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
2872
2882
|
requestType: "json",
|
|
2873
2883
|
body: _body,
|
|
2874
2884
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -2888,6 +2898,8 @@ var AuthClient = class {
|
|
|
2888
2898
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2889
2899
|
case 404:
|
|
2890
2900
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2901
|
+
case 429:
|
|
2902
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2891
2903
|
default:
|
|
2892
2904
|
throw new VectrosError({
|
|
2893
2905
|
statusCode: _response.error.statusCode,
|
|
@@ -2961,24 +2973,31 @@ var AuthClient = class {
|
|
|
2961
2973
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/app-contexts");
|
|
2962
2974
|
}
|
|
2963
2975
|
/**
|
|
2964
|
-
* 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.
|
|
2976
|
+
* 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.
|
|
2965
2977
|
*
|
|
2966
|
-
* @param {Vectros.
|
|
2978
|
+
* @param {Vectros.CreateAppContextRequest} request
|
|
2967
2979
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2968
2980
|
*
|
|
2969
2981
|
* @throws {@link Vectros.BadRequestError}
|
|
2970
2982
|
* @throws {@link Vectros.ForbiddenError}
|
|
2983
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2971
2984
|
*
|
|
2972
2985
|
* @example
|
|
2973
2986
|
* await client.auth.createAppContext({
|
|
2974
|
-
*
|
|
2975
|
-
*
|
|
2987
|
+
* body: {
|
|
2988
|
+
* contextId: "myapp",
|
|
2989
|
+
* name: "My Internal App"
|
|
2990
|
+
* }
|
|
2976
2991
|
* })
|
|
2977
2992
|
*/
|
|
2978
2993
|
createAppContext(request, requestOptions) {
|
|
2979
2994
|
return HttpResponsePromise.fromPromise(this.__createAppContext(request, requestOptions));
|
|
2980
2995
|
}
|
|
2981
2996
|
async __createAppContext(request, requestOptions) {
|
|
2997
|
+
const { upsert, body: _body } = request;
|
|
2998
|
+
const _queryParams = {
|
|
2999
|
+
upsert
|
|
3000
|
+
};
|
|
2982
3001
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2983
3002
|
const _headers = mergeHeaders(
|
|
2984
3003
|
_authRequest.headers,
|
|
@@ -2993,9 +3012,9 @@ var AuthClient = class {
|
|
|
2993
3012
|
method: "POST",
|
|
2994
3013
|
headers: _headers,
|
|
2995
3014
|
contentType: "application/json",
|
|
2996
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
3015
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
2997
3016
|
requestType: "json",
|
|
2998
|
-
body:
|
|
3017
|
+
body: _body,
|
|
2999
3018
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
3000
3019
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
3001
3020
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -3011,6 +3030,8 @@ var AuthClient = class {
|
|
|
3011
3030
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
3012
3031
|
case 403:
|
|
3013
3032
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3033
|
+
case 429:
|
|
3034
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3014
3035
|
default:
|
|
3015
3036
|
throw new VectrosError({
|
|
3016
3037
|
statusCode: _response.error.statusCode,
|
|
@@ -3089,7 +3110,7 @@ var AuthClient = class {
|
|
|
3089
3110
|
);
|
|
3090
3111
|
}
|
|
3091
3112
|
/**
|
|
3092
|
-
* 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.
|
|
3113
|
+
* 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.
|
|
3093
3114
|
*
|
|
3094
3115
|
* @param {Vectros.CreateRoleRequest} request
|
|
3095
3116
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -3097,6 +3118,7 @@ var AuthClient = class {
|
|
|
3097
3118
|
* @throws {@link Vectros.BadRequestError}
|
|
3098
3119
|
* @throws {@link Vectros.ForbiddenError}
|
|
3099
3120
|
* @throws {@link Vectros.NotFoundError}
|
|
3121
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3100
3122
|
*
|
|
3101
3123
|
* @example
|
|
3102
3124
|
* await client.auth.createRole({
|
|
@@ -3114,7 +3136,10 @@ var AuthClient = class {
|
|
|
3114
3136
|
return HttpResponsePromise.fromPromise(this.__createRole(request, requestOptions));
|
|
3115
3137
|
}
|
|
3116
3138
|
async __createRole(request, requestOptions) {
|
|
3117
|
-
const { contextId, body: _body } = request;
|
|
3139
|
+
const { contextId, upsert, body: _body } = request;
|
|
3140
|
+
const _queryParams = {
|
|
3141
|
+
upsert
|
|
3142
|
+
};
|
|
3118
3143
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
3119
3144
|
const _headers = mergeHeaders(
|
|
3120
3145
|
_authRequest.headers,
|
|
@@ -3129,7 +3154,7 @@ var AuthClient = class {
|
|
|
3129
3154
|
method: "POST",
|
|
3130
3155
|
headers: _headers,
|
|
3131
3156
|
contentType: "application/json",
|
|
3132
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
3157
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
3133
3158
|
requestType: "json",
|
|
3134
3159
|
body: _body,
|
|
3135
3160
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -3149,6 +3174,8 @@ var AuthClient = class {
|
|
|
3149
3174
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3150
3175
|
case 404:
|
|
3151
3176
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3177
|
+
case 429:
|
|
3178
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3152
3179
|
default:
|
|
3153
3180
|
throw new VectrosError({
|
|
3154
3181
|
statusCode: _response.error.statusCode,
|
|
@@ -3236,6 +3263,7 @@ var AuthClient = class {
|
|
|
3236
3263
|
*
|
|
3237
3264
|
* @throws {@link Vectros.ForbiddenError}
|
|
3238
3265
|
* @throws {@link Vectros.NotFoundError}
|
|
3266
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3239
3267
|
*
|
|
3240
3268
|
* @example
|
|
3241
3269
|
* await client.auth.updateAccessProfile({
|
|
@@ -3283,6 +3311,8 @@ var AuthClient = class {
|
|
|
3283
3311
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3284
3312
|
case 404:
|
|
3285
3313
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3314
|
+
case 429:
|
|
3315
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3286
3316
|
default:
|
|
3287
3317
|
throw new VectrosError({
|
|
3288
3318
|
statusCode: _response.error.statusCode,
|
|
@@ -3306,6 +3336,7 @@ var AuthClient = class {
|
|
|
3306
3336
|
*
|
|
3307
3337
|
* @throws {@link Vectros.ForbiddenError}
|
|
3308
3338
|
* @throws {@link Vectros.NotFoundError}
|
|
3339
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3309
3340
|
*
|
|
3310
3341
|
* @example
|
|
3311
3342
|
* await client.auth.deleteAccessProfile({
|
|
@@ -3347,6 +3378,8 @@ var AuthClient = class {
|
|
|
3347
3378
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3348
3379
|
case 404:
|
|
3349
3380
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3381
|
+
case 429:
|
|
3382
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3350
3383
|
default:
|
|
3351
3384
|
throw new VectrosError({
|
|
3352
3385
|
statusCode: _response.error.statusCode,
|
|
@@ -3428,6 +3461,7 @@ var AuthClient = class {
|
|
|
3428
3461
|
*
|
|
3429
3462
|
* @throws {@link Vectros.ForbiddenError}
|
|
3430
3463
|
* @throws {@link Vectros.NotFoundError}
|
|
3464
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3431
3465
|
*
|
|
3432
3466
|
* @example
|
|
3433
3467
|
* await client.auth.updateAppContext({
|
|
@@ -3475,6 +3509,8 @@ var AuthClient = class {
|
|
|
3475
3509
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3476
3510
|
case 404:
|
|
3477
3511
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3512
|
+
case 429:
|
|
3513
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3478
3514
|
default:
|
|
3479
3515
|
throw new VectrosError({
|
|
3480
3516
|
statusCode: _response.error.statusCode,
|
|
@@ -3494,6 +3530,7 @@ var AuthClient = class {
|
|
|
3494
3530
|
* @throws {@link Vectros.BadRequestError}
|
|
3495
3531
|
* @throws {@link Vectros.ForbiddenError}
|
|
3496
3532
|
* @throws {@link Vectros.NotFoundError}
|
|
3533
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3497
3534
|
*
|
|
3498
3535
|
* @example
|
|
3499
3536
|
* await client.auth.deleteAppContext({
|
|
@@ -3539,6 +3576,8 @@ var AuthClient = class {
|
|
|
3539
3576
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3540
3577
|
case 404:
|
|
3541
3578
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3579
|
+
case 429:
|
|
3580
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3542
3581
|
default:
|
|
3543
3582
|
throw new VectrosError({
|
|
3544
3583
|
statusCode: _response.error.statusCode,
|
|
@@ -3626,6 +3665,7 @@ var AuthClient = class {
|
|
|
3626
3665
|
*
|
|
3627
3666
|
* @throws {@link Vectros.ForbiddenError}
|
|
3628
3667
|
* @throws {@link Vectros.NotFoundError}
|
|
3668
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3629
3669
|
*
|
|
3630
3670
|
* @example
|
|
3631
3671
|
* await client.auth.updateRole({
|
|
@@ -3677,6 +3717,8 @@ var AuthClient = class {
|
|
|
3677
3717
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3678
3718
|
case 404:
|
|
3679
3719
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3720
|
+
case 429:
|
|
3721
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3680
3722
|
default:
|
|
3681
3723
|
throw new VectrosError({
|
|
3682
3724
|
statusCode: _response.error.statusCode,
|
|
@@ -3700,6 +3742,7 @@ var AuthClient = class {
|
|
|
3700
3742
|
*
|
|
3701
3743
|
* @throws {@link Vectros.ForbiddenError}
|
|
3702
3744
|
* @throws {@link Vectros.NotFoundError}
|
|
3745
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3703
3746
|
*
|
|
3704
3747
|
* @example
|
|
3705
3748
|
* await client.auth.deleteRole({
|
|
@@ -3741,6 +3784,8 @@ var AuthClient = class {
|
|
|
3741
3784
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3742
3785
|
case 404:
|
|
3743
3786
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3787
|
+
case 429:
|
|
3788
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3744
3789
|
default:
|
|
3745
3790
|
throw new VectrosError({
|
|
3746
3791
|
statusCode: _response.error.statusCode,
|
|
@@ -4072,6 +4117,7 @@ var AuthClient = class {
|
|
|
4072
4117
|
*
|
|
4073
4118
|
* @throws {@link Vectros.BadRequestError}
|
|
4074
4119
|
* @throws {@link Vectros.ForbiddenError}
|
|
4120
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4075
4121
|
*
|
|
4076
4122
|
* @example
|
|
4077
4123
|
* await client.auth.mintToken({
|
|
@@ -4124,6 +4170,8 @@ var AuthClient = class {
|
|
|
4124
4170
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4125
4171
|
case 403:
|
|
4126
4172
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4173
|
+
case 429:
|
|
4174
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4127
4175
|
default:
|
|
4128
4176
|
throw new VectrosError({
|
|
4129
4177
|
statusCode: _response.error.statusCode,
|
|
@@ -4144,6 +4192,7 @@ var AuthClient = class {
|
|
|
4144
4192
|
* @throws {@link Vectros.ForbiddenError}
|
|
4145
4193
|
* @throws {@link Vectros.NotFoundError}
|
|
4146
4194
|
* @throws {@link Vectros.ConflictError}
|
|
4195
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4147
4196
|
*
|
|
4148
4197
|
* @example
|
|
4149
4198
|
* await client.auth.createInvite({
|
|
@@ -4192,6 +4241,8 @@ var AuthClient = class {
|
|
|
4192
4241
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4193
4242
|
case 409:
|
|
4194
4243
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4244
|
+
case 429:
|
|
4245
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4195
4246
|
default:
|
|
4196
4247
|
throw new VectrosError({
|
|
4197
4248
|
statusCode: _response.error.statusCode,
|
|
@@ -4211,6 +4262,7 @@ var AuthClient = class {
|
|
|
4211
4262
|
* @throws {@link Vectros.BadRequestError}
|
|
4212
4263
|
* @throws {@link Vectros.ForbiddenError}
|
|
4213
4264
|
* @throws {@link Vectros.NotFoundError}
|
|
4265
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4214
4266
|
*
|
|
4215
4267
|
* @example
|
|
4216
4268
|
* await client.auth.resendInvite({
|
|
@@ -4257,6 +4309,8 @@ var AuthClient = class {
|
|
|
4257
4309
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4258
4310
|
case 404:
|
|
4259
4311
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4312
|
+
case 429:
|
|
4313
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4260
4314
|
default:
|
|
4261
4315
|
throw new VectrosError({
|
|
4262
4316
|
statusCode: _response.error.statusCode,
|
|
@@ -4279,6 +4333,7 @@ var ComplianceClient = class {
|
|
|
4279
4333
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4280
4334
|
*
|
|
4281
4335
|
* @throws {@link Vectros.ForbiddenError}
|
|
4336
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4282
4337
|
* @throws {@link Vectros.NotImplementedError}
|
|
4283
4338
|
*
|
|
4284
4339
|
* @example
|
|
@@ -4320,6 +4375,8 @@ var ComplianceClient = class {
|
|
|
4320
4375
|
switch (_response.error.statusCode) {
|
|
4321
4376
|
case 403:
|
|
4322
4377
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4378
|
+
case 429:
|
|
4379
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4323
4380
|
case 501:
|
|
4324
4381
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
4325
4382
|
default:
|
|
@@ -4400,6 +4457,7 @@ var ComplianceClient = class {
|
|
|
4400
4457
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4401
4458
|
*
|
|
4402
4459
|
* @throws {@link Vectros.ForbiddenError}
|
|
4460
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4403
4461
|
* @throws {@link Vectros.NotImplementedError}
|
|
4404
4462
|
*
|
|
4405
4463
|
* @example
|
|
@@ -4439,6 +4497,8 @@ var ComplianceClient = class {
|
|
|
4439
4497
|
switch (_response.error.statusCode) {
|
|
4440
4498
|
case 403:
|
|
4441
4499
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4500
|
+
case 429:
|
|
4501
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4442
4502
|
case 501:
|
|
4443
4503
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
4444
4504
|
default:
|
|
@@ -4578,22 +4638,30 @@ var DocumentsClient = class {
|
|
|
4578
4638
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents");
|
|
4579
4639
|
}
|
|
4580
4640
|
/**
|
|
4581
|
-
* Creates a document from a raw text string and queues it for asynchronous indexing so it becomes searchable. Requires the `documents:c` scope.
|
|
4641
|
+
* 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.
|
|
4582
4642
|
*
|
|
4583
|
-
* @param {Vectros.
|
|
4643
|
+
* @param {Vectros.IngestDocumentRequest} request
|
|
4584
4644
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4585
4645
|
*
|
|
4586
4646
|
* @throws {@link Vectros.BadRequestError}
|
|
4647
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4648
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4587
4649
|
*
|
|
4588
4650
|
* @example
|
|
4589
4651
|
* await client.documents.ingestDocument({
|
|
4590
|
-
*
|
|
4652
|
+
* body: {
|
|
4653
|
+
* title: "Patient Intake Form \u2014 Jane Doe"
|
|
4654
|
+
* }
|
|
4591
4655
|
* })
|
|
4592
4656
|
*/
|
|
4593
4657
|
ingestDocument(request, requestOptions) {
|
|
4594
4658
|
return HttpResponsePromise.fromPromise(this.__ingestDocument(request, requestOptions));
|
|
4595
4659
|
}
|
|
4596
4660
|
async __ingestDocument(request, requestOptions) {
|
|
4661
|
+
const { upsert, body: _body } = request;
|
|
4662
|
+
const _queryParams = {
|
|
4663
|
+
upsert
|
|
4664
|
+
};
|
|
4597
4665
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4598
4666
|
const _headers = mergeHeaders(
|
|
4599
4667
|
_authRequest.headers,
|
|
@@ -4608,9 +4676,9 @@ var DocumentsClient = class {
|
|
|
4608
4676
|
method: "POST",
|
|
4609
4677
|
headers: _headers,
|
|
4610
4678
|
contentType: "application/json",
|
|
4611
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4679
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
4612
4680
|
requestType: "json",
|
|
4613
|
-
body:
|
|
4681
|
+
body: _body,
|
|
4614
4682
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4615
4683
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4616
4684
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -4624,6 +4692,10 @@ var DocumentsClient = class {
|
|
|
4624
4692
|
switch (_response.error.statusCode) {
|
|
4625
4693
|
case 400:
|
|
4626
4694
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4695
|
+
case 403:
|
|
4696
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4697
|
+
case 429:
|
|
4698
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4627
4699
|
default:
|
|
4628
4700
|
throw new VectrosError({
|
|
4629
4701
|
statusCode: _response.error.statusCode,
|
|
@@ -4698,6 +4770,7 @@ var DocumentsClient = class {
|
|
|
4698
4770
|
* @throws {@link Vectros.BadRequestError}
|
|
4699
4771
|
* @throws {@link Vectros.NotFoundError}
|
|
4700
4772
|
* @throws {@link Vectros.ConflictError}
|
|
4773
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4701
4774
|
*
|
|
4702
4775
|
* @example
|
|
4703
4776
|
* await client.documents.updateDocument({
|
|
@@ -4746,6 +4819,8 @@ var DocumentsClient = class {
|
|
|
4746
4819
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4747
4820
|
case 409:
|
|
4748
4821
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4822
|
+
case 429:
|
|
4823
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4749
4824
|
default:
|
|
4750
4825
|
throw new VectrosError({
|
|
4751
4826
|
statusCode: _response.error.statusCode,
|
|
@@ -4763,6 +4838,7 @@ var DocumentsClient = class {
|
|
|
4763
4838
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4764
4839
|
*
|
|
4765
4840
|
* @throws {@link Vectros.NotFoundError}
|
|
4841
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4766
4842
|
*
|
|
4767
4843
|
* @example
|
|
4768
4844
|
* await client.documents.deleteDocument({
|
|
@@ -4801,6 +4877,8 @@ var DocumentsClient = class {
|
|
|
4801
4877
|
switch (_response.error.statusCode) {
|
|
4802
4878
|
case 404:
|
|
4803
4879
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4880
|
+
case 429:
|
|
4881
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4804
4882
|
default:
|
|
4805
4883
|
throw new VectrosError({
|
|
4806
4884
|
statusCode: _response.error.statusCode,
|
|
@@ -4820,6 +4898,7 @@ var DocumentsClient = class {
|
|
|
4820
4898
|
* @throws {@link Vectros.BadRequestError}
|
|
4821
4899
|
* @throws {@link Vectros.NotFoundError}
|
|
4822
4900
|
* @throws {@link Vectros.ConflictError}
|
|
4901
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4823
4902
|
*
|
|
4824
4903
|
* @example
|
|
4825
4904
|
* await client.documents.patchDocument({
|
|
@@ -4868,6 +4947,8 @@ var DocumentsClient = class {
|
|
|
4868
4947
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4869
4948
|
case 409:
|
|
4870
4949
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4950
|
+
case 429:
|
|
4951
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4871
4952
|
default:
|
|
4872
4953
|
throw new VectrosError({
|
|
4873
4954
|
statusCode: _response.error.statusCode,
|
|
@@ -4879,7 +4960,7 @@ var DocumentsClient = class {
|
|
|
4879
4960
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v1/documents/{id}");
|
|
4880
4961
|
}
|
|
4881
4962
|
/**
|
|
4882
|
-
* Finds documents of a given type by
|
|
4963
|
+
* 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.
|
|
4883
4964
|
*
|
|
4884
4965
|
* @param {Vectros.LookupDocumentsRequest} request
|
|
4885
4966
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4948,6 +5029,7 @@ var DocumentsClient = class {
|
|
|
4948
5029
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4949
5030
|
*
|
|
4950
5031
|
* @throws {@link Vectros.BadRequestError}
|
|
5032
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4951
5033
|
*
|
|
4952
5034
|
* @example
|
|
4953
5035
|
* await client.documents.lookupDocumentsByBody({
|
|
@@ -4989,6 +5071,8 @@ var DocumentsClient = class {
|
|
|
4989
5071
|
switch (_response.error.statusCode) {
|
|
4990
5072
|
case 400:
|
|
4991
5073
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5074
|
+
case 429:
|
|
5075
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4992
5076
|
default:
|
|
4993
5077
|
throw new VectrosError({
|
|
4994
5078
|
statusCode: _response.error.statusCode,
|
|
@@ -5171,12 +5255,14 @@ var DocumentsClient = class {
|
|
|
5171
5255
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents/{id}/versions");
|
|
5172
5256
|
}
|
|
5173
5257
|
/**
|
|
5174
|
-
* 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.
|
|
5258
|
+
* 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.
|
|
5175
5259
|
*
|
|
5176
5260
|
* @param {Vectros.FileUploadRequest} request
|
|
5177
5261
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5178
5262
|
*
|
|
5179
5263
|
* @throws {@link Vectros.BadRequestError}
|
|
5264
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
5265
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5180
5266
|
*
|
|
5181
5267
|
* @example
|
|
5182
5268
|
* await client.documents.uploadDocument({
|
|
@@ -5188,6 +5274,10 @@ var DocumentsClient = class {
|
|
|
5188
5274
|
return HttpResponsePromise.fromPromise(this.__uploadDocument(request, requestOptions));
|
|
5189
5275
|
}
|
|
5190
5276
|
async __uploadDocument(request, requestOptions) {
|
|
5277
|
+
const { upsert, ..._body } = request;
|
|
5278
|
+
const _queryParams = {
|
|
5279
|
+
upsert
|
|
5280
|
+
};
|
|
5191
5281
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5192
5282
|
const _headers = mergeHeaders(
|
|
5193
5283
|
_authRequest.headers,
|
|
@@ -5202,9 +5292,9 @@ var DocumentsClient = class {
|
|
|
5202
5292
|
method: "POST",
|
|
5203
5293
|
headers: _headers,
|
|
5204
5294
|
contentType: "application/json",
|
|
5205
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5295
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5206
5296
|
requestType: "json",
|
|
5207
|
-
body:
|
|
5297
|
+
body: _body,
|
|
5208
5298
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5209
5299
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5210
5300
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5218,6 +5308,10 @@ var DocumentsClient = class {
|
|
|
5218
5308
|
switch (_response.error.statusCode) {
|
|
5219
5309
|
case 400:
|
|
5220
5310
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5311
|
+
case 403:
|
|
5312
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
5313
|
+
case 429:
|
|
5314
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5221
5315
|
default:
|
|
5222
5316
|
throw new VectrosError({
|
|
5223
5317
|
statusCode: _response.error.statusCode,
|
|
@@ -5294,22 +5388,30 @@ var FoldersClient = class {
|
|
|
5294
5388
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/folders");
|
|
5295
5389
|
}
|
|
5296
5390
|
/**
|
|
5297
|
-
* 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.
|
|
5391
|
+
* 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.
|
|
5298
5392
|
*
|
|
5299
|
-
* @param {Vectros.
|
|
5393
|
+
* @param {Vectros.CreateFolderRequest} request
|
|
5300
5394
|
* @param {FoldersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5301
5395
|
*
|
|
5302
5396
|
* @throws {@link Vectros.BadRequestError}
|
|
5397
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
5398
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5303
5399
|
*
|
|
5304
5400
|
* @example
|
|
5305
5401
|
* await client.folders.createFolder({
|
|
5306
|
-
*
|
|
5402
|
+
* body: {
|
|
5403
|
+
* name: "Patient Records 2024"
|
|
5404
|
+
* }
|
|
5307
5405
|
* })
|
|
5308
5406
|
*/
|
|
5309
5407
|
createFolder(request, requestOptions) {
|
|
5310
5408
|
return HttpResponsePromise.fromPromise(this.__createFolder(request, requestOptions));
|
|
5311
5409
|
}
|
|
5312
5410
|
async __createFolder(request, requestOptions) {
|
|
5411
|
+
const { upsert, body: _body } = request;
|
|
5412
|
+
const _queryParams = {
|
|
5413
|
+
upsert
|
|
5414
|
+
};
|
|
5313
5415
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5314
5416
|
const _headers = mergeHeaders(
|
|
5315
5417
|
_authRequest.headers,
|
|
@@ -5324,9 +5426,9 @@ var FoldersClient = class {
|
|
|
5324
5426
|
method: "POST",
|
|
5325
5427
|
headers: _headers,
|
|
5326
5428
|
contentType: "application/json",
|
|
5327
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5429
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5328
5430
|
requestType: "json",
|
|
5329
|
-
body:
|
|
5431
|
+
body: _body,
|
|
5330
5432
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5331
5433
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5332
5434
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5340,6 +5442,10 @@ var FoldersClient = class {
|
|
|
5340
5442
|
switch (_response.error.statusCode) {
|
|
5341
5443
|
case 400:
|
|
5342
5444
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5445
|
+
case 403:
|
|
5446
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
5447
|
+
case 429:
|
|
5448
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5343
5449
|
default:
|
|
5344
5450
|
throw new VectrosError({
|
|
5345
5451
|
statusCode: _response.error.statusCode,
|
|
@@ -5412,6 +5518,7 @@ var FoldersClient = class {
|
|
|
5412
5518
|
* @param {FoldersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5413
5519
|
*
|
|
5414
5520
|
* @throws {@link Vectros.NotFoundError}
|
|
5521
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5415
5522
|
*
|
|
5416
5523
|
* @example
|
|
5417
5524
|
* await client.folders.updateFolder({
|
|
@@ -5456,6 +5563,8 @@ var FoldersClient = class {
|
|
|
5456
5563
|
switch (_response.error.statusCode) {
|
|
5457
5564
|
case 404:
|
|
5458
5565
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5566
|
+
case 429:
|
|
5567
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5459
5568
|
default:
|
|
5460
5569
|
throw new VectrosError({
|
|
5461
5570
|
statusCode: _response.error.statusCode,
|
|
@@ -5474,6 +5583,7 @@ var FoldersClient = class {
|
|
|
5474
5583
|
*
|
|
5475
5584
|
* @throws {@link Vectros.BadRequestError}
|
|
5476
5585
|
* @throws {@link Vectros.NotFoundError}
|
|
5586
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5477
5587
|
*
|
|
5478
5588
|
* @example
|
|
5479
5589
|
* await client.folders.deleteFolder({
|
|
@@ -5514,6 +5624,8 @@ var FoldersClient = class {
|
|
|
5514
5624
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5515
5625
|
case 404:
|
|
5516
5626
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5627
|
+
case 429:
|
|
5628
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5517
5629
|
default:
|
|
5518
5630
|
throw new VectrosError({
|
|
5519
5631
|
statusCode: _response.error.statusCode,
|
|
@@ -5533,6 +5645,7 @@ var FoldersClient = class {
|
|
|
5533
5645
|
* @throws {@link Vectros.BadRequestError}
|
|
5534
5646
|
* @throws {@link Vectros.NotFoundError}
|
|
5535
5647
|
* @throws {@link Vectros.ConflictError}
|
|
5648
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5536
5649
|
*
|
|
5537
5650
|
* @example
|
|
5538
5651
|
* await client.folders.patchFolder({
|
|
@@ -5581,6 +5694,8 @@ var FoldersClient = class {
|
|
|
5581
5694
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5582
5695
|
case 409:
|
|
5583
5696
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
5697
|
+
case 429:
|
|
5698
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5584
5699
|
default:
|
|
5585
5700
|
throw new VectrosError({
|
|
5586
5701
|
statusCode: _response.error.statusCode,
|
|
@@ -5737,22 +5852,30 @@ var IdentityClient = class {
|
|
|
5737
5852
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/clients");
|
|
5738
5853
|
}
|
|
5739
5854
|
/**
|
|
5740
|
-
* 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.
|
|
5855
|
+
* 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.
|
|
5741
5856
|
*
|
|
5742
|
-
* @param {Vectros.
|
|
5857
|
+
* @param {Vectros.CreateClientRequest} request
|
|
5743
5858
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5744
5859
|
*
|
|
5745
5860
|
* @throws {@link Vectros.BadRequestError}
|
|
5861
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
5862
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5746
5863
|
*
|
|
5747
5864
|
* @example
|
|
5748
5865
|
* await client.identity.createClient({
|
|
5749
|
-
*
|
|
5866
|
+
* body: {
|
|
5867
|
+
* externalId: "patient_789"
|
|
5868
|
+
* }
|
|
5750
5869
|
* })
|
|
5751
5870
|
*/
|
|
5752
5871
|
createClient(request, requestOptions) {
|
|
5753
5872
|
return HttpResponsePromise.fromPromise(this.__createClient(request, requestOptions));
|
|
5754
5873
|
}
|
|
5755
5874
|
async __createClient(request, requestOptions) {
|
|
5875
|
+
const { upsert, body: _body } = request;
|
|
5876
|
+
const _queryParams = {
|
|
5877
|
+
upsert
|
|
5878
|
+
};
|
|
5756
5879
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5757
5880
|
const _headers = mergeHeaders(
|
|
5758
5881
|
_authRequest.headers,
|
|
@@ -5767,9 +5890,9 @@ var IdentityClient = class {
|
|
|
5767
5890
|
method: "POST",
|
|
5768
5891
|
headers: _headers,
|
|
5769
5892
|
contentType: "application/json",
|
|
5770
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5893
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5771
5894
|
requestType: "json",
|
|
5772
|
-
body:
|
|
5895
|
+
body: _body,
|
|
5773
5896
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5774
5897
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5775
5898
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5783,6 +5906,10 @@ var IdentityClient = class {
|
|
|
5783
5906
|
switch (_response.error.statusCode) {
|
|
5784
5907
|
case 400:
|
|
5785
5908
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5909
|
+
case 403:
|
|
5910
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
5911
|
+
case 429:
|
|
5912
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5786
5913
|
default:
|
|
5787
5914
|
throw new VectrosError({
|
|
5788
5915
|
statusCode: _response.error.statusCode,
|
|
@@ -5855,6 +5982,7 @@ var IdentityClient = class {
|
|
|
5855
5982
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5856
5983
|
*
|
|
5857
5984
|
* @throws {@link Vectros.NotFoundError}
|
|
5985
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5858
5986
|
*
|
|
5859
5987
|
* @example
|
|
5860
5988
|
* await client.identity.updateClient({
|
|
@@ -5899,6 +6027,8 @@ var IdentityClient = class {
|
|
|
5899
6027
|
switch (_response.error.statusCode) {
|
|
5900
6028
|
case 404:
|
|
5901
6029
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6030
|
+
case 429:
|
|
6031
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5902
6032
|
default:
|
|
5903
6033
|
throw new VectrosError({
|
|
5904
6034
|
statusCode: _response.error.statusCode,
|
|
@@ -5916,6 +6046,7 @@ var IdentityClient = class {
|
|
|
5916
6046
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5917
6047
|
*
|
|
5918
6048
|
* @throws {@link Vectros.NotFoundError}
|
|
6049
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5919
6050
|
*
|
|
5920
6051
|
* @example
|
|
5921
6052
|
* await client.identity.deleteClient({
|
|
@@ -5954,6 +6085,8 @@ var IdentityClient = class {
|
|
|
5954
6085
|
switch (_response.error.statusCode) {
|
|
5955
6086
|
case 404:
|
|
5956
6087
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6088
|
+
case 429:
|
|
6089
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5957
6090
|
default:
|
|
5958
6091
|
throw new VectrosError({
|
|
5959
6092
|
statusCode: _response.error.statusCode,
|
|
@@ -5971,6 +6104,7 @@ var IdentityClient = class {
|
|
|
5971
6104
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5972
6105
|
*
|
|
5973
6106
|
* @throws {@link Vectros.BadRequestError}
|
|
6107
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5974
6108
|
*
|
|
5975
6109
|
* @example
|
|
5976
6110
|
* await client.identity.lookupClients({
|
|
@@ -6012,6 +6146,8 @@ var IdentityClient = class {
|
|
|
6012
6146
|
switch (_response.error.statusCode) {
|
|
6013
6147
|
case 400:
|
|
6014
6148
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6149
|
+
case 429:
|
|
6150
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6015
6151
|
default:
|
|
6016
6152
|
throw new VectrosError({
|
|
6017
6153
|
statusCode: _response.error.statusCode,
|
|
@@ -6160,22 +6296,30 @@ var IdentityClient = class {
|
|
|
6160
6296
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/orgs");
|
|
6161
6297
|
}
|
|
6162
6298
|
/**
|
|
6163
|
-
* 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.
|
|
6299
|
+
* 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.
|
|
6164
6300
|
*
|
|
6165
|
-
* @param {Vectros.
|
|
6301
|
+
* @param {Vectros.CreateOrgRequest} request
|
|
6166
6302
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6167
6303
|
*
|
|
6168
6304
|
* @throws {@link Vectros.BadRequestError}
|
|
6305
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
6306
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6169
6307
|
*
|
|
6170
6308
|
* @example
|
|
6171
6309
|
* await client.identity.createOrg({
|
|
6172
|
-
*
|
|
6310
|
+
* body: {
|
|
6311
|
+
* externalId: "clinic_001"
|
|
6312
|
+
* }
|
|
6173
6313
|
* })
|
|
6174
6314
|
*/
|
|
6175
6315
|
createOrg(request, requestOptions) {
|
|
6176
6316
|
return HttpResponsePromise.fromPromise(this.__createOrg(request, requestOptions));
|
|
6177
6317
|
}
|
|
6178
6318
|
async __createOrg(request, requestOptions) {
|
|
6319
|
+
const { upsert, body: _body } = request;
|
|
6320
|
+
const _queryParams = {
|
|
6321
|
+
upsert
|
|
6322
|
+
};
|
|
6179
6323
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6180
6324
|
const _headers = mergeHeaders(
|
|
6181
6325
|
_authRequest.headers,
|
|
@@ -6190,9 +6334,9 @@ var IdentityClient = class {
|
|
|
6190
6334
|
method: "POST",
|
|
6191
6335
|
headers: _headers,
|
|
6192
6336
|
contentType: "application/json",
|
|
6193
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6337
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6194
6338
|
requestType: "json",
|
|
6195
|
-
body:
|
|
6339
|
+
body: _body,
|
|
6196
6340
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6197
6341
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6198
6342
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6206,6 +6350,10 @@ var IdentityClient = class {
|
|
|
6206
6350
|
switch (_response.error.statusCode) {
|
|
6207
6351
|
case 400:
|
|
6208
6352
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6353
|
+
case 403:
|
|
6354
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6355
|
+
case 429:
|
|
6356
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6209
6357
|
default:
|
|
6210
6358
|
throw new VectrosError({
|
|
6211
6359
|
statusCode: _response.error.statusCode,
|
|
@@ -6278,6 +6426,7 @@ var IdentityClient = class {
|
|
|
6278
6426
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6279
6427
|
*
|
|
6280
6428
|
* @throws {@link Vectros.NotFoundError}
|
|
6429
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6281
6430
|
*
|
|
6282
6431
|
* @example
|
|
6283
6432
|
* await client.identity.updateOrg({
|
|
@@ -6322,6 +6471,8 @@ var IdentityClient = class {
|
|
|
6322
6471
|
switch (_response.error.statusCode) {
|
|
6323
6472
|
case 404:
|
|
6324
6473
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6474
|
+
case 429:
|
|
6475
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6325
6476
|
default:
|
|
6326
6477
|
throw new VectrosError({
|
|
6327
6478
|
statusCode: _response.error.statusCode,
|
|
@@ -6339,6 +6490,7 @@ var IdentityClient = class {
|
|
|
6339
6490
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6340
6491
|
*
|
|
6341
6492
|
* @throws {@link Vectros.NotFoundError}
|
|
6493
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6342
6494
|
*
|
|
6343
6495
|
* @example
|
|
6344
6496
|
* await client.identity.deleteOrg({
|
|
@@ -6377,6 +6529,8 @@ var IdentityClient = class {
|
|
|
6377
6529
|
switch (_response.error.statusCode) {
|
|
6378
6530
|
case 404:
|
|
6379
6531
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6532
|
+
case 429:
|
|
6533
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6380
6534
|
default:
|
|
6381
6535
|
throw new VectrosError({
|
|
6382
6536
|
statusCode: _response.error.statusCode,
|
|
@@ -6394,6 +6548,7 @@ var IdentityClient = class {
|
|
|
6394
6548
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6395
6549
|
*
|
|
6396
6550
|
* @throws {@link Vectros.BadRequestError}
|
|
6551
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6397
6552
|
*
|
|
6398
6553
|
* @example
|
|
6399
6554
|
* await client.identity.lookupOrgs({
|
|
@@ -6435,6 +6590,8 @@ var IdentityClient = class {
|
|
|
6435
6590
|
switch (_response.error.statusCode) {
|
|
6436
6591
|
case 400:
|
|
6437
6592
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6593
|
+
case 429:
|
|
6594
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6438
6595
|
default:
|
|
6439
6596
|
throw new VectrosError({
|
|
6440
6597
|
statusCode: _response.error.statusCode,
|
|
@@ -6569,22 +6726,30 @@ var IdentityClient = class {
|
|
|
6569
6726
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users");
|
|
6570
6727
|
}
|
|
6571
6728
|
/**
|
|
6572
|
-
* 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.
|
|
6729
|
+
* 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.
|
|
6573
6730
|
*
|
|
6574
|
-
* @param {Vectros.
|
|
6731
|
+
* @param {Vectros.CreateUserRequest} request
|
|
6575
6732
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6576
6733
|
*
|
|
6577
6734
|
* @throws {@link Vectros.BadRequestError}
|
|
6735
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
6736
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6578
6737
|
*
|
|
6579
6738
|
* @example
|
|
6580
6739
|
* await client.identity.createUser({
|
|
6581
|
-
*
|
|
6740
|
+
* body: {
|
|
6741
|
+
* externalId: "usr_12345"
|
|
6742
|
+
* }
|
|
6582
6743
|
* })
|
|
6583
6744
|
*/
|
|
6584
6745
|
createUser(request, requestOptions) {
|
|
6585
6746
|
return HttpResponsePromise.fromPromise(this.__createUser(request, requestOptions));
|
|
6586
6747
|
}
|
|
6587
6748
|
async __createUser(request, requestOptions) {
|
|
6749
|
+
const { upsert, body: _body } = request;
|
|
6750
|
+
const _queryParams = {
|
|
6751
|
+
upsert
|
|
6752
|
+
};
|
|
6588
6753
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6589
6754
|
const _headers = mergeHeaders(
|
|
6590
6755
|
_authRequest.headers,
|
|
@@ -6599,9 +6764,9 @@ var IdentityClient = class {
|
|
|
6599
6764
|
method: "POST",
|
|
6600
6765
|
headers: _headers,
|
|
6601
6766
|
contentType: "application/json",
|
|
6602
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6767
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6603
6768
|
requestType: "json",
|
|
6604
|
-
body:
|
|
6769
|
+
body: _body,
|
|
6605
6770
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6606
6771
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6607
6772
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6615,6 +6780,10 @@ var IdentityClient = class {
|
|
|
6615
6780
|
switch (_response.error.statusCode) {
|
|
6616
6781
|
case 400:
|
|
6617
6782
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6783
|
+
case 403:
|
|
6784
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6785
|
+
case 429:
|
|
6786
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6618
6787
|
default:
|
|
6619
6788
|
throw new VectrosError({
|
|
6620
6789
|
statusCode: _response.error.statusCode,
|
|
@@ -6687,6 +6856,7 @@ var IdentityClient = class {
|
|
|
6687
6856
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6688
6857
|
*
|
|
6689
6858
|
* @throws {@link Vectros.NotFoundError}
|
|
6859
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6690
6860
|
*
|
|
6691
6861
|
* @example
|
|
6692
6862
|
* await client.identity.updateUser({
|
|
@@ -6731,6 +6901,8 @@ var IdentityClient = class {
|
|
|
6731
6901
|
switch (_response.error.statusCode) {
|
|
6732
6902
|
case 404:
|
|
6733
6903
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6904
|
+
case 429:
|
|
6905
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6734
6906
|
default:
|
|
6735
6907
|
throw new VectrosError({
|
|
6736
6908
|
statusCode: _response.error.statusCode,
|
|
@@ -6748,6 +6920,7 @@ var IdentityClient = class {
|
|
|
6748
6920
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6749
6921
|
*
|
|
6750
6922
|
* @throws {@link Vectros.NotFoundError}
|
|
6923
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6751
6924
|
*
|
|
6752
6925
|
* @example
|
|
6753
6926
|
* await client.identity.deleteUser({
|
|
@@ -6786,6 +6959,8 @@ var IdentityClient = class {
|
|
|
6786
6959
|
switch (_response.error.statusCode) {
|
|
6787
6960
|
case 404:
|
|
6788
6961
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6962
|
+
case 429:
|
|
6963
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6789
6964
|
default:
|
|
6790
6965
|
throw new VectrosError({
|
|
6791
6966
|
statusCode: _response.error.statusCode,
|
|
@@ -6803,6 +6978,7 @@ var IdentityClient = class {
|
|
|
6803
6978
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6804
6979
|
*
|
|
6805
6980
|
* @throws {@link Vectros.BadRequestError}
|
|
6981
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6806
6982
|
*
|
|
6807
6983
|
* @example
|
|
6808
6984
|
* await client.identity.lookupUsers({
|
|
@@ -6844,6 +7020,8 @@ var IdentityClient = class {
|
|
|
6844
7020
|
switch (_response.error.statusCode) {
|
|
6845
7021
|
case 400:
|
|
6846
7022
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7023
|
+
case 429:
|
|
7024
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6847
7025
|
default:
|
|
6848
7026
|
throw new VectrosError({
|
|
6849
7027
|
statusCode: _response.error.statusCode,
|
|
@@ -7180,6 +7358,7 @@ var RecordsClient = class {
|
|
|
7180
7358
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7181
7359
|
*
|
|
7182
7360
|
* @throws {@link Vectros.ForbiddenError}
|
|
7361
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7183
7362
|
* @throws {@link Vectros.NotImplementedError}
|
|
7184
7363
|
*
|
|
7185
7364
|
* @example
|
|
@@ -7219,6 +7398,8 @@ var RecordsClient = class {
|
|
|
7219
7398
|
switch (_response.error.statusCode) {
|
|
7220
7399
|
case 403:
|
|
7221
7400
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7401
|
+
case 429:
|
|
7402
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7222
7403
|
case 501:
|
|
7223
7404
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
7224
7405
|
default:
|
|
@@ -7238,6 +7419,7 @@ var RecordsClient = class {
|
|
|
7238
7419
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7239
7420
|
*
|
|
7240
7421
|
* @throws {@link Vectros.ForbiddenError}
|
|
7422
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7241
7423
|
* @throws {@link Vectros.NotImplementedError}
|
|
7242
7424
|
*
|
|
7243
7425
|
* @example
|
|
@@ -7277,6 +7459,8 @@ var RecordsClient = class {
|
|
|
7277
7459
|
switch (_response.error.statusCode) {
|
|
7278
7460
|
case 403:
|
|
7279
7461
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7462
|
+
case 429:
|
|
7463
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7280
7464
|
case 501:
|
|
7281
7465
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
7282
7466
|
default:
|
|
@@ -7296,6 +7480,7 @@ var RecordsClient = class {
|
|
|
7296
7480
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7297
7481
|
*
|
|
7298
7482
|
* @throws {@link Vectros.ForbiddenError}
|
|
7483
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7299
7484
|
* @throws {@link Vectros.NotImplementedError}
|
|
7300
7485
|
*
|
|
7301
7486
|
* @example
|
|
@@ -7335,6 +7520,8 @@ var RecordsClient = class {
|
|
|
7335
7520
|
switch (_response.error.statusCode) {
|
|
7336
7521
|
case 403:
|
|
7337
7522
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7523
|
+
case 429:
|
|
7524
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7338
7525
|
case 501:
|
|
7339
7526
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
7340
7527
|
default:
|
|
@@ -7412,29 +7599,36 @@ var RecordsClient = class {
|
|
|
7412
7599
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/records");
|
|
7413
7600
|
}
|
|
7414
7601
|
/**
|
|
7415
|
-
* 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.
|
|
7602
|
+
* 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.
|
|
7416
7603
|
*
|
|
7417
|
-
* @param {Vectros.
|
|
7604
|
+
* @param {Vectros.CreateRecordRequest} request
|
|
7418
7605
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7419
7606
|
*
|
|
7420
7607
|
* @throws {@link Vectros.BadRequestError}
|
|
7421
7608
|
* @throws {@link Vectros.ForbiddenError}
|
|
7609
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7422
7610
|
*
|
|
7423
7611
|
* @example
|
|
7424
7612
|
* await client.records.createRecord({
|
|
7425
|
-
*
|
|
7426
|
-
*
|
|
7427
|
-
*
|
|
7428
|
-
*
|
|
7429
|
-
*
|
|
7430
|
-
*
|
|
7431
|
-
*
|
|
7613
|
+
* body: {
|
|
7614
|
+
* typeName: "intake_form",
|
|
7615
|
+
* schemaId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
7616
|
+
* payload: {
|
|
7617
|
+
* "first_name": "Jane",
|
|
7618
|
+
* "email": "jane@example.com"
|
|
7619
|
+
* },
|
|
7620
|
+
* folderId: "f47ac10b-58cc-4372-a567-0e02b2c3d479"
|
|
7621
|
+
* }
|
|
7432
7622
|
* })
|
|
7433
7623
|
*/
|
|
7434
7624
|
createRecord(request, requestOptions) {
|
|
7435
7625
|
return HttpResponsePromise.fromPromise(this.__createRecord(request, requestOptions));
|
|
7436
7626
|
}
|
|
7437
7627
|
async __createRecord(request, requestOptions) {
|
|
7628
|
+
const { upsert, body: _body } = request;
|
|
7629
|
+
const _queryParams = {
|
|
7630
|
+
upsert
|
|
7631
|
+
};
|
|
7438
7632
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
7439
7633
|
const _headers = mergeHeaders(
|
|
7440
7634
|
_authRequest.headers,
|
|
@@ -7449,9 +7643,9 @@ var RecordsClient = class {
|
|
|
7449
7643
|
method: "POST",
|
|
7450
7644
|
headers: _headers,
|
|
7451
7645
|
contentType: "application/json",
|
|
7452
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
7646
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
7453
7647
|
requestType: "json",
|
|
7454
|
-
body:
|
|
7648
|
+
body: _body,
|
|
7455
7649
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
7456
7650
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
7457
7651
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -7467,6 +7661,8 @@ var RecordsClient = class {
|
|
|
7467
7661
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7468
7662
|
case 403:
|
|
7469
7663
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7664
|
+
case 429:
|
|
7665
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7470
7666
|
default:
|
|
7471
7667
|
throw new VectrosError({
|
|
7472
7668
|
statusCode: _response.error.statusCode,
|
|
@@ -7541,6 +7737,7 @@ var RecordsClient = class {
|
|
|
7541
7737
|
* @throws {@link Vectros.BadRequestError}
|
|
7542
7738
|
* @throws {@link Vectros.NotFoundError}
|
|
7543
7739
|
* @throws {@link Vectros.ConflictError}
|
|
7740
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7544
7741
|
*
|
|
7545
7742
|
* @example
|
|
7546
7743
|
* await client.records.updateRecord({
|
|
@@ -7587,6 +7784,8 @@ var RecordsClient = class {
|
|
|
7587
7784
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7588
7785
|
case 409:
|
|
7589
7786
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
7787
|
+
case 429:
|
|
7788
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7590
7789
|
default:
|
|
7591
7790
|
throw new VectrosError({
|
|
7592
7791
|
statusCode: _response.error.statusCode,
|
|
@@ -7604,6 +7803,7 @@ var RecordsClient = class {
|
|
|
7604
7803
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7605
7804
|
*
|
|
7606
7805
|
* @throws {@link Vectros.NotFoundError}
|
|
7806
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7607
7807
|
*
|
|
7608
7808
|
* @example
|
|
7609
7809
|
* await client.records.deleteRecord({
|
|
@@ -7642,6 +7842,8 @@ var RecordsClient = class {
|
|
|
7642
7842
|
switch (_response.error.statusCode) {
|
|
7643
7843
|
case 404:
|
|
7644
7844
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7845
|
+
case 429:
|
|
7846
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7645
7847
|
default:
|
|
7646
7848
|
throw new VectrosError({
|
|
7647
7849
|
statusCode: _response.error.statusCode,
|
|
@@ -7661,6 +7863,7 @@ var RecordsClient = class {
|
|
|
7661
7863
|
* @throws {@link Vectros.BadRequestError}
|
|
7662
7864
|
* @throws {@link Vectros.NotFoundError}
|
|
7663
7865
|
* @throws {@link Vectros.ConflictError}
|
|
7866
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7664
7867
|
*
|
|
7665
7868
|
* @example
|
|
7666
7869
|
* await client.records.patchRecord({
|
|
@@ -7712,6 +7915,8 @@ var RecordsClient = class {
|
|
|
7712
7915
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7713
7916
|
case 409:
|
|
7714
7917
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
7918
|
+
case 429:
|
|
7919
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7715
7920
|
default:
|
|
7716
7921
|
throw new VectrosError({
|
|
7717
7922
|
statusCode: _response.error.statusCode,
|
|
@@ -7800,6 +8005,7 @@ var RecordsClient = class {
|
|
|
7800
8005
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7801
8006
|
*
|
|
7802
8007
|
* @throws {@link Vectros.BadRequestError}
|
|
8008
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7803
8009
|
*
|
|
7804
8010
|
* @example
|
|
7805
8011
|
* await client.records.lookupRecordsByBody({
|
|
@@ -7841,6 +8047,8 @@ var RecordsClient = class {
|
|
|
7841
8047
|
switch (_response.error.statusCode) {
|
|
7842
8048
|
case 400:
|
|
7843
8049
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8050
|
+
case 429:
|
|
8051
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7844
8052
|
default:
|
|
7845
8053
|
throw new VectrosError({
|
|
7846
8054
|
statusCode: _response.error.statusCode,
|
|
@@ -8033,42 +8241,50 @@ var SchemasClient = class {
|
|
|
8033
8241
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/schemas");
|
|
8034
8242
|
}
|
|
8035
8243
|
/**
|
|
8036
|
-
* 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.
|
|
8244
|
+
* 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.
|
|
8037
8245
|
*
|
|
8038
|
-
* @param {Vectros.
|
|
8246
|
+
* @param {Vectros.CreateSchemaRequest} request
|
|
8039
8247
|
* @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8040
8248
|
*
|
|
8041
8249
|
* @throws {@link Vectros.BadRequestError}
|
|
8250
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
8251
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8042
8252
|
*
|
|
8043
8253
|
* @example
|
|
8044
8254
|
* await client.schemas.createSchema({
|
|
8045
|
-
*
|
|
8046
|
-
*
|
|
8047
|
-
*
|
|
8048
|
-
*
|
|
8049
|
-
*
|
|
8050
|
-
*
|
|
8051
|
-
*
|
|
8052
|
-
*
|
|
8053
|
-
*
|
|
8054
|
-
*
|
|
8055
|
-
*
|
|
8056
|
-
*
|
|
8057
|
-
*
|
|
8058
|
-
*
|
|
8059
|
-
*
|
|
8060
|
-
*
|
|
8061
|
-
*
|
|
8062
|
-
*
|
|
8063
|
-
*
|
|
8064
|
-
*
|
|
8065
|
-
*
|
|
8255
|
+
* body: {
|
|
8256
|
+
* typeName: "intake_form",
|
|
8257
|
+
* displayName: "Client Intake Form",
|
|
8258
|
+
* description: "Captures initial client information",
|
|
8259
|
+
* fields: [{
|
|
8260
|
+
* fieldId: "first_name",
|
|
8261
|
+
* fieldType: "string",
|
|
8262
|
+
* required: true,
|
|
8263
|
+
* searchable: true
|
|
8264
|
+
* }, {
|
|
8265
|
+
* fieldId: "email",
|
|
8266
|
+
* fieldType: "string",
|
|
8267
|
+
* required: true
|
|
8268
|
+
* }],
|
|
8269
|
+
* lookupFields: [{
|
|
8270
|
+
* fieldName: "email",
|
|
8271
|
+
* unique: true
|
|
8272
|
+
* }],
|
|
8273
|
+
* capabilities: {
|
|
8274
|
+
* "auditHistory": true
|
|
8275
|
+
* },
|
|
8276
|
+
* allowedSurfaces: ["record"]
|
|
8277
|
+
* }
|
|
8066
8278
|
* })
|
|
8067
8279
|
*/
|
|
8068
8280
|
createSchema(request, requestOptions) {
|
|
8069
8281
|
return HttpResponsePromise.fromPromise(this.__createSchema(request, requestOptions));
|
|
8070
8282
|
}
|
|
8071
8283
|
async __createSchema(request, requestOptions) {
|
|
8284
|
+
const { upsert, body: _body } = request;
|
|
8285
|
+
const _queryParams = {
|
|
8286
|
+
upsert
|
|
8287
|
+
};
|
|
8072
8288
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
8073
8289
|
const _headers = mergeHeaders(
|
|
8074
8290
|
_authRequest.headers,
|
|
@@ -8083,9 +8299,9 @@ var SchemasClient = class {
|
|
|
8083
8299
|
method: "POST",
|
|
8084
8300
|
headers: _headers,
|
|
8085
8301
|
contentType: "application/json",
|
|
8086
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
8302
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
8087
8303
|
requestType: "json",
|
|
8088
|
-
body:
|
|
8304
|
+
body: _body,
|
|
8089
8305
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
8090
8306
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
8091
8307
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -8099,6 +8315,10 @@ var SchemasClient = class {
|
|
|
8099
8315
|
switch (_response.error.statusCode) {
|
|
8100
8316
|
case 400:
|
|
8101
8317
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8318
|
+
case 403:
|
|
8319
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
8320
|
+
case 429:
|
|
8321
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8102
8322
|
default:
|
|
8103
8323
|
throw new VectrosError({
|
|
8104
8324
|
statusCode: _response.error.statusCode,
|
|
@@ -8172,6 +8392,7 @@ var SchemasClient = class {
|
|
|
8172
8392
|
*
|
|
8173
8393
|
* @throws {@link Vectros.BadRequestError}
|
|
8174
8394
|
* @throws {@link Vectros.NotFoundError}
|
|
8395
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8175
8396
|
*
|
|
8176
8397
|
* @example
|
|
8177
8398
|
* await client.schemas.updateSchema({
|
|
@@ -8220,6 +8441,8 @@ var SchemasClient = class {
|
|
|
8220
8441
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8221
8442
|
case 404:
|
|
8222
8443
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
8444
|
+
case 429:
|
|
8445
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8223
8446
|
default:
|
|
8224
8447
|
throw new VectrosError({
|
|
8225
8448
|
statusCode: _response.error.statusCode,
|
|
@@ -8238,6 +8461,7 @@ var SchemasClient = class {
|
|
|
8238
8461
|
*
|
|
8239
8462
|
* @throws {@link Vectros.NotFoundError}
|
|
8240
8463
|
* @throws {@link Vectros.ConflictError}
|
|
8464
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8241
8465
|
*
|
|
8242
8466
|
* @example
|
|
8243
8467
|
* await client.schemas.deleteSchema({
|
|
@@ -8278,6 +8502,8 @@ var SchemasClient = class {
|
|
|
8278
8502
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
8279
8503
|
case 409:
|
|
8280
8504
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
8505
|
+
case 429:
|
|
8506
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8281
8507
|
default:
|
|
8282
8508
|
throw new VectrosError({
|
|
8283
8509
|
statusCode: _response.error.statusCode,
|
|
@@ -8359,6 +8585,7 @@ var SearchClient = class {
|
|
|
8359
8585
|
*
|
|
8360
8586
|
* @throws {@link Vectros.BadRequestError}
|
|
8361
8587
|
* @throws {@link Vectros.ForbiddenError}
|
|
8588
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8362
8589
|
*
|
|
8363
8590
|
* @example
|
|
8364
8591
|
* await client.search.content({
|
|
@@ -8401,6 +8628,8 @@ var SearchClient = class {
|
|
|
8401
8628
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8402
8629
|
case 403:
|
|
8403
8630
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
8631
|
+
case 429:
|
|
8632
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8404
8633
|
default:
|
|
8405
8634
|
throw new VectrosError({
|
|
8406
8635
|
statusCode: _response.error.statusCode,
|
|
@@ -8527,8 +8756,8 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
8527
8756
|
|
|
8528
8757
|
// src/build-info.ts
|
|
8529
8758
|
var BUILD_INFO = {
|
|
8530
|
-
mcpServer: true ? "0.5.
|
|
8531
|
-
sdk: true ? "0.
|
|
8759
|
+
mcpServer: true ? "0.5.3" : "dev",
|
|
8760
|
+
sdk: true ? "0.31.0" : "dev"
|
|
8532
8761
|
};
|
|
8533
8762
|
|
|
8534
8763
|
// src/log.ts
|
|
@@ -9028,15 +9257,17 @@ var recordCreate = ({ client, log }) => ({
|
|
|
9028
9257
|
const type = args.type;
|
|
9029
9258
|
try {
|
|
9030
9259
|
const created = await client.records.createRecord({
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9260
|
+
body: {
|
|
9261
|
+
typeName: type,
|
|
9262
|
+
payload: args.fields,
|
|
9263
|
+
externalId: args.externalId,
|
|
9264
|
+
indexMode: args.indexMode,
|
|
9265
|
+
status: args.status,
|
|
9266
|
+
folderId: args.folderId,
|
|
9267
|
+
userId: args.userId,
|
|
9268
|
+
orgId: args.orgId,
|
|
9269
|
+
clientId: args.clientId
|
|
9270
|
+
}
|
|
9040
9271
|
});
|
|
9041
9272
|
log.debug({ tool: "record_create", type, id: created.id }, "record_create ok");
|
|
9042
9273
|
return { content: [{ type: "text", text: JSON.stringify(created, null, 2) }] };
|
|
@@ -9678,13 +9909,15 @@ var folderCreate = ({ client, log }) => ({
|
|
|
9678
9909
|
handler: async (args) => {
|
|
9679
9910
|
try {
|
|
9680
9911
|
const folder = await client.folders.createFolder({
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9912
|
+
body: {
|
|
9913
|
+
name: args.name,
|
|
9914
|
+
description: args.description,
|
|
9915
|
+
parentFolderId: args.parentId,
|
|
9916
|
+
slug: args.slug,
|
|
9917
|
+
userId: args.userId,
|
|
9918
|
+
orgId: args.orgId,
|
|
9919
|
+
clientId: args.clientId
|
|
9920
|
+
}
|
|
9688
9921
|
});
|
|
9689
9922
|
log.debug({ tool: "folder_create", id: folder.id, name: folder.name }, "folder_create ok");
|
|
9690
9923
|
return { content: [{ type: "text", text: JSON.stringify(folder, null, 2) }] };
|
|
@@ -9938,11 +10171,13 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
9938
10171
|
if (text) {
|
|
9939
10172
|
const storeText = args.storeText ?? true;
|
|
9940
10173
|
const result = await client.documents.ingestDocument({
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
10174
|
+
body: {
|
|
10175
|
+
title,
|
|
10176
|
+
text,
|
|
10177
|
+
indexMode,
|
|
10178
|
+
storeText,
|
|
10179
|
+
...common
|
|
10180
|
+
}
|
|
9946
10181
|
});
|
|
9947
10182
|
log.debug(
|
|
9948
10183
|
{ tool: "document_ingest", mode: "text", id: result?.id, indexMode },
|