@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/index.mjs
CHANGED
|
@@ -2512,6 +2512,7 @@ var AuthClient = class {
|
|
|
2512
2512
|
* @throws {@link Vectros.BadRequestError}
|
|
2513
2513
|
* @throws {@link Vectros.ForbiddenError}
|
|
2514
2514
|
* @throws {@link Vectros.NotFoundError}
|
|
2515
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2515
2516
|
*
|
|
2516
2517
|
* @example
|
|
2517
2518
|
* await client.auth.createScopedKey({
|
|
@@ -2559,6 +2560,8 @@ var AuthClient = class {
|
|
|
2559
2560
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2560
2561
|
case 404:
|
|
2561
2562
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2563
|
+
case 429:
|
|
2564
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2562
2565
|
default:
|
|
2563
2566
|
throw new VectrosError({
|
|
2564
2567
|
statusCode: _response.error.statusCode,
|
|
@@ -2635,6 +2638,7 @@ var AuthClient = class {
|
|
|
2635
2638
|
*
|
|
2636
2639
|
* @throws {@link Vectros.ForbiddenError}
|
|
2637
2640
|
* @throws {@link Vectros.NotFoundError}
|
|
2641
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2638
2642
|
*
|
|
2639
2643
|
* @example
|
|
2640
2644
|
* await client.auth.revokeScopedKey({
|
|
@@ -2675,6 +2679,8 @@ var AuthClient = class {
|
|
|
2675
2679
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2676
2680
|
case 404:
|
|
2677
2681
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2682
|
+
case 429:
|
|
2683
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2678
2684
|
default:
|
|
2679
2685
|
throw new VectrosError({
|
|
2680
2686
|
statusCode: _response.error.statusCode,
|
|
@@ -2830,7 +2836,7 @@ var AuthClient = class {
|
|
|
2830
2836
|
);
|
|
2831
2837
|
}
|
|
2832
2838
|
/**
|
|
2833
|
-
* 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.
|
|
2839
|
+
* 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.
|
|
2834
2840
|
*
|
|
2835
2841
|
* @param {Vectros.CreateAccessProfileRequest} request
|
|
2836
2842
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -2838,6 +2844,7 @@ var AuthClient = class {
|
|
|
2838
2844
|
* @throws {@link Vectros.BadRequestError}
|
|
2839
2845
|
* @throws {@link Vectros.ForbiddenError}
|
|
2840
2846
|
* @throws {@link Vectros.NotFoundError}
|
|
2847
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2841
2848
|
*
|
|
2842
2849
|
* @example
|
|
2843
2850
|
* await client.auth.createAccessProfile({
|
|
@@ -2851,7 +2858,10 @@ var AuthClient = class {
|
|
|
2851
2858
|
return HttpResponsePromise.fromPromise(this.__createAccessProfile(request, requestOptions));
|
|
2852
2859
|
}
|
|
2853
2860
|
async __createAccessProfile(request, requestOptions) {
|
|
2854
|
-
const { contextId, body: _body } = request;
|
|
2861
|
+
const { contextId, upsert, body: _body } = request;
|
|
2862
|
+
const _queryParams = {
|
|
2863
|
+
upsert
|
|
2864
|
+
};
|
|
2855
2865
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2856
2866
|
const _headers = mergeHeaders(
|
|
2857
2867
|
_authRequest.headers,
|
|
@@ -2866,7 +2876,7 @@ var AuthClient = class {
|
|
|
2866
2876
|
method: "POST",
|
|
2867
2877
|
headers: _headers,
|
|
2868
2878
|
contentType: "application/json",
|
|
2869
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
2879
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
2870
2880
|
requestType: "json",
|
|
2871
2881
|
body: _body,
|
|
2872
2882
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -2886,6 +2896,8 @@ var AuthClient = class {
|
|
|
2886
2896
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2887
2897
|
case 404:
|
|
2888
2898
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2899
|
+
case 429:
|
|
2900
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2889
2901
|
default:
|
|
2890
2902
|
throw new VectrosError({
|
|
2891
2903
|
statusCode: _response.error.statusCode,
|
|
@@ -2959,24 +2971,31 @@ var AuthClient = class {
|
|
|
2959
2971
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/app-contexts");
|
|
2960
2972
|
}
|
|
2961
2973
|
/**
|
|
2962
|
-
* 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.
|
|
2974
|
+
* 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.
|
|
2963
2975
|
*
|
|
2964
|
-
* @param {Vectros.
|
|
2976
|
+
* @param {Vectros.CreateAppContextRequest} request
|
|
2965
2977
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2966
2978
|
*
|
|
2967
2979
|
* @throws {@link Vectros.BadRequestError}
|
|
2968
2980
|
* @throws {@link Vectros.ForbiddenError}
|
|
2981
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2969
2982
|
*
|
|
2970
2983
|
* @example
|
|
2971
2984
|
* await client.auth.createAppContext({
|
|
2972
|
-
*
|
|
2973
|
-
*
|
|
2985
|
+
* body: {
|
|
2986
|
+
* contextId: "myapp",
|
|
2987
|
+
* name: "My Internal App"
|
|
2988
|
+
* }
|
|
2974
2989
|
* })
|
|
2975
2990
|
*/
|
|
2976
2991
|
createAppContext(request, requestOptions) {
|
|
2977
2992
|
return HttpResponsePromise.fromPromise(this.__createAppContext(request, requestOptions));
|
|
2978
2993
|
}
|
|
2979
2994
|
async __createAppContext(request, requestOptions) {
|
|
2995
|
+
const { upsert, body: _body } = request;
|
|
2996
|
+
const _queryParams = {
|
|
2997
|
+
upsert
|
|
2998
|
+
};
|
|
2980
2999
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2981
3000
|
const _headers = mergeHeaders(
|
|
2982
3001
|
_authRequest.headers,
|
|
@@ -2991,9 +3010,9 @@ var AuthClient = class {
|
|
|
2991
3010
|
method: "POST",
|
|
2992
3011
|
headers: _headers,
|
|
2993
3012
|
contentType: "application/json",
|
|
2994
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
3013
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
2995
3014
|
requestType: "json",
|
|
2996
|
-
body:
|
|
3015
|
+
body: _body,
|
|
2997
3016
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
2998
3017
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
2999
3018
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -3009,6 +3028,8 @@ var AuthClient = class {
|
|
|
3009
3028
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
3010
3029
|
case 403:
|
|
3011
3030
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3031
|
+
case 429:
|
|
3032
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3012
3033
|
default:
|
|
3013
3034
|
throw new VectrosError({
|
|
3014
3035
|
statusCode: _response.error.statusCode,
|
|
@@ -3087,7 +3108,7 @@ var AuthClient = class {
|
|
|
3087
3108
|
);
|
|
3088
3109
|
}
|
|
3089
3110
|
/**
|
|
3090
|
-
* 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.
|
|
3111
|
+
* 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.
|
|
3091
3112
|
*
|
|
3092
3113
|
* @param {Vectros.CreateRoleRequest} request
|
|
3093
3114
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -3095,6 +3116,7 @@ var AuthClient = class {
|
|
|
3095
3116
|
* @throws {@link Vectros.BadRequestError}
|
|
3096
3117
|
* @throws {@link Vectros.ForbiddenError}
|
|
3097
3118
|
* @throws {@link Vectros.NotFoundError}
|
|
3119
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3098
3120
|
*
|
|
3099
3121
|
* @example
|
|
3100
3122
|
* await client.auth.createRole({
|
|
@@ -3112,7 +3134,10 @@ var AuthClient = class {
|
|
|
3112
3134
|
return HttpResponsePromise.fromPromise(this.__createRole(request, requestOptions));
|
|
3113
3135
|
}
|
|
3114
3136
|
async __createRole(request, requestOptions) {
|
|
3115
|
-
const { contextId, body: _body } = request;
|
|
3137
|
+
const { contextId, upsert, body: _body } = request;
|
|
3138
|
+
const _queryParams = {
|
|
3139
|
+
upsert
|
|
3140
|
+
};
|
|
3116
3141
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
3117
3142
|
const _headers = mergeHeaders(
|
|
3118
3143
|
_authRequest.headers,
|
|
@@ -3127,7 +3152,7 @@ var AuthClient = class {
|
|
|
3127
3152
|
method: "POST",
|
|
3128
3153
|
headers: _headers,
|
|
3129
3154
|
contentType: "application/json",
|
|
3130
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
3155
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
3131
3156
|
requestType: "json",
|
|
3132
3157
|
body: _body,
|
|
3133
3158
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -3147,6 +3172,8 @@ var AuthClient = class {
|
|
|
3147
3172
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3148
3173
|
case 404:
|
|
3149
3174
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3175
|
+
case 429:
|
|
3176
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3150
3177
|
default:
|
|
3151
3178
|
throw new VectrosError({
|
|
3152
3179
|
statusCode: _response.error.statusCode,
|
|
@@ -3234,6 +3261,7 @@ var AuthClient = class {
|
|
|
3234
3261
|
*
|
|
3235
3262
|
* @throws {@link Vectros.ForbiddenError}
|
|
3236
3263
|
* @throws {@link Vectros.NotFoundError}
|
|
3264
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3237
3265
|
*
|
|
3238
3266
|
* @example
|
|
3239
3267
|
* await client.auth.updateAccessProfile({
|
|
@@ -3281,6 +3309,8 @@ var AuthClient = class {
|
|
|
3281
3309
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3282
3310
|
case 404:
|
|
3283
3311
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3312
|
+
case 429:
|
|
3313
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3284
3314
|
default:
|
|
3285
3315
|
throw new VectrosError({
|
|
3286
3316
|
statusCode: _response.error.statusCode,
|
|
@@ -3304,6 +3334,7 @@ var AuthClient = class {
|
|
|
3304
3334
|
*
|
|
3305
3335
|
* @throws {@link Vectros.ForbiddenError}
|
|
3306
3336
|
* @throws {@link Vectros.NotFoundError}
|
|
3337
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3307
3338
|
*
|
|
3308
3339
|
* @example
|
|
3309
3340
|
* await client.auth.deleteAccessProfile({
|
|
@@ -3345,6 +3376,8 @@ var AuthClient = class {
|
|
|
3345
3376
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3346
3377
|
case 404:
|
|
3347
3378
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3379
|
+
case 429:
|
|
3380
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3348
3381
|
default:
|
|
3349
3382
|
throw new VectrosError({
|
|
3350
3383
|
statusCode: _response.error.statusCode,
|
|
@@ -3426,6 +3459,7 @@ var AuthClient = class {
|
|
|
3426
3459
|
*
|
|
3427
3460
|
* @throws {@link Vectros.ForbiddenError}
|
|
3428
3461
|
* @throws {@link Vectros.NotFoundError}
|
|
3462
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3429
3463
|
*
|
|
3430
3464
|
* @example
|
|
3431
3465
|
* await client.auth.updateAppContext({
|
|
@@ -3473,6 +3507,8 @@ var AuthClient = class {
|
|
|
3473
3507
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3474
3508
|
case 404:
|
|
3475
3509
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3510
|
+
case 429:
|
|
3511
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3476
3512
|
default:
|
|
3477
3513
|
throw new VectrosError({
|
|
3478
3514
|
statusCode: _response.error.statusCode,
|
|
@@ -3492,6 +3528,7 @@ var AuthClient = class {
|
|
|
3492
3528
|
* @throws {@link Vectros.BadRequestError}
|
|
3493
3529
|
* @throws {@link Vectros.ForbiddenError}
|
|
3494
3530
|
* @throws {@link Vectros.NotFoundError}
|
|
3531
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3495
3532
|
*
|
|
3496
3533
|
* @example
|
|
3497
3534
|
* await client.auth.deleteAppContext({
|
|
@@ -3537,6 +3574,8 @@ var AuthClient = class {
|
|
|
3537
3574
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3538
3575
|
case 404:
|
|
3539
3576
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3577
|
+
case 429:
|
|
3578
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3540
3579
|
default:
|
|
3541
3580
|
throw new VectrosError({
|
|
3542
3581
|
statusCode: _response.error.statusCode,
|
|
@@ -3624,6 +3663,7 @@ var AuthClient = class {
|
|
|
3624
3663
|
*
|
|
3625
3664
|
* @throws {@link Vectros.ForbiddenError}
|
|
3626
3665
|
* @throws {@link Vectros.NotFoundError}
|
|
3666
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3627
3667
|
*
|
|
3628
3668
|
* @example
|
|
3629
3669
|
* await client.auth.updateRole({
|
|
@@ -3675,6 +3715,8 @@ var AuthClient = class {
|
|
|
3675
3715
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3676
3716
|
case 404:
|
|
3677
3717
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3718
|
+
case 429:
|
|
3719
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3678
3720
|
default:
|
|
3679
3721
|
throw new VectrosError({
|
|
3680
3722
|
statusCode: _response.error.statusCode,
|
|
@@ -3698,6 +3740,7 @@ var AuthClient = class {
|
|
|
3698
3740
|
*
|
|
3699
3741
|
* @throws {@link Vectros.ForbiddenError}
|
|
3700
3742
|
* @throws {@link Vectros.NotFoundError}
|
|
3743
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3701
3744
|
*
|
|
3702
3745
|
* @example
|
|
3703
3746
|
* await client.auth.deleteRole({
|
|
@@ -3739,6 +3782,8 @@ var AuthClient = class {
|
|
|
3739
3782
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3740
3783
|
case 404:
|
|
3741
3784
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3785
|
+
case 429:
|
|
3786
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3742
3787
|
default:
|
|
3743
3788
|
throw new VectrosError({
|
|
3744
3789
|
statusCode: _response.error.statusCode,
|
|
@@ -4070,6 +4115,7 @@ var AuthClient = class {
|
|
|
4070
4115
|
*
|
|
4071
4116
|
* @throws {@link Vectros.BadRequestError}
|
|
4072
4117
|
* @throws {@link Vectros.ForbiddenError}
|
|
4118
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4073
4119
|
*
|
|
4074
4120
|
* @example
|
|
4075
4121
|
* await client.auth.mintToken({
|
|
@@ -4122,6 +4168,8 @@ var AuthClient = class {
|
|
|
4122
4168
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4123
4169
|
case 403:
|
|
4124
4170
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4171
|
+
case 429:
|
|
4172
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4125
4173
|
default:
|
|
4126
4174
|
throw new VectrosError({
|
|
4127
4175
|
statusCode: _response.error.statusCode,
|
|
@@ -4142,6 +4190,7 @@ var AuthClient = class {
|
|
|
4142
4190
|
* @throws {@link Vectros.ForbiddenError}
|
|
4143
4191
|
* @throws {@link Vectros.NotFoundError}
|
|
4144
4192
|
* @throws {@link Vectros.ConflictError}
|
|
4193
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4145
4194
|
*
|
|
4146
4195
|
* @example
|
|
4147
4196
|
* await client.auth.createInvite({
|
|
@@ -4190,6 +4239,8 @@ var AuthClient = class {
|
|
|
4190
4239
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4191
4240
|
case 409:
|
|
4192
4241
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4242
|
+
case 429:
|
|
4243
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4193
4244
|
default:
|
|
4194
4245
|
throw new VectrosError({
|
|
4195
4246
|
statusCode: _response.error.statusCode,
|
|
@@ -4209,6 +4260,7 @@ var AuthClient = class {
|
|
|
4209
4260
|
* @throws {@link Vectros.BadRequestError}
|
|
4210
4261
|
* @throws {@link Vectros.ForbiddenError}
|
|
4211
4262
|
* @throws {@link Vectros.NotFoundError}
|
|
4263
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4212
4264
|
*
|
|
4213
4265
|
* @example
|
|
4214
4266
|
* await client.auth.resendInvite({
|
|
@@ -4255,6 +4307,8 @@ var AuthClient = class {
|
|
|
4255
4307
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4256
4308
|
case 404:
|
|
4257
4309
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4310
|
+
case 429:
|
|
4311
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4258
4312
|
default:
|
|
4259
4313
|
throw new VectrosError({
|
|
4260
4314
|
statusCode: _response.error.statusCode,
|
|
@@ -4277,6 +4331,7 @@ var ComplianceClient = class {
|
|
|
4277
4331
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4278
4332
|
*
|
|
4279
4333
|
* @throws {@link Vectros.ForbiddenError}
|
|
4334
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4280
4335
|
* @throws {@link Vectros.NotImplementedError}
|
|
4281
4336
|
*
|
|
4282
4337
|
* @example
|
|
@@ -4318,6 +4373,8 @@ var ComplianceClient = class {
|
|
|
4318
4373
|
switch (_response.error.statusCode) {
|
|
4319
4374
|
case 403:
|
|
4320
4375
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4376
|
+
case 429:
|
|
4377
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4321
4378
|
case 501:
|
|
4322
4379
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
4323
4380
|
default:
|
|
@@ -4398,6 +4455,7 @@ var ComplianceClient = class {
|
|
|
4398
4455
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4399
4456
|
*
|
|
4400
4457
|
* @throws {@link Vectros.ForbiddenError}
|
|
4458
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4401
4459
|
* @throws {@link Vectros.NotImplementedError}
|
|
4402
4460
|
*
|
|
4403
4461
|
* @example
|
|
@@ -4437,6 +4495,8 @@ var ComplianceClient = class {
|
|
|
4437
4495
|
switch (_response.error.statusCode) {
|
|
4438
4496
|
case 403:
|
|
4439
4497
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4498
|
+
case 429:
|
|
4499
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4440
4500
|
case 501:
|
|
4441
4501
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
4442
4502
|
default:
|
|
@@ -4576,22 +4636,30 @@ var DocumentsClient = class {
|
|
|
4576
4636
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents");
|
|
4577
4637
|
}
|
|
4578
4638
|
/**
|
|
4579
|
-
* Creates a document from a raw text string and queues it for asynchronous indexing so it becomes searchable. Requires the `documents:c` scope.
|
|
4639
|
+
* 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.
|
|
4580
4640
|
*
|
|
4581
|
-
* @param {Vectros.
|
|
4641
|
+
* @param {Vectros.IngestDocumentRequest} request
|
|
4582
4642
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4583
4643
|
*
|
|
4584
4644
|
* @throws {@link Vectros.BadRequestError}
|
|
4645
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4646
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4585
4647
|
*
|
|
4586
4648
|
* @example
|
|
4587
4649
|
* await client.documents.ingestDocument({
|
|
4588
|
-
*
|
|
4650
|
+
* body: {
|
|
4651
|
+
* title: "Patient Intake Form \u2014 Jane Doe"
|
|
4652
|
+
* }
|
|
4589
4653
|
* })
|
|
4590
4654
|
*/
|
|
4591
4655
|
ingestDocument(request, requestOptions) {
|
|
4592
4656
|
return HttpResponsePromise.fromPromise(this.__ingestDocument(request, requestOptions));
|
|
4593
4657
|
}
|
|
4594
4658
|
async __ingestDocument(request, requestOptions) {
|
|
4659
|
+
const { upsert, body: _body } = request;
|
|
4660
|
+
const _queryParams = {
|
|
4661
|
+
upsert
|
|
4662
|
+
};
|
|
4595
4663
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4596
4664
|
const _headers = mergeHeaders(
|
|
4597
4665
|
_authRequest.headers,
|
|
@@ -4606,9 +4674,9 @@ var DocumentsClient = class {
|
|
|
4606
4674
|
method: "POST",
|
|
4607
4675
|
headers: _headers,
|
|
4608
4676
|
contentType: "application/json",
|
|
4609
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4677
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
4610
4678
|
requestType: "json",
|
|
4611
|
-
body:
|
|
4679
|
+
body: _body,
|
|
4612
4680
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4613
4681
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4614
4682
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -4622,6 +4690,10 @@ var DocumentsClient = class {
|
|
|
4622
4690
|
switch (_response.error.statusCode) {
|
|
4623
4691
|
case 400:
|
|
4624
4692
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4693
|
+
case 403:
|
|
4694
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4695
|
+
case 429:
|
|
4696
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4625
4697
|
default:
|
|
4626
4698
|
throw new VectrosError({
|
|
4627
4699
|
statusCode: _response.error.statusCode,
|
|
@@ -4696,6 +4768,7 @@ var DocumentsClient = class {
|
|
|
4696
4768
|
* @throws {@link Vectros.BadRequestError}
|
|
4697
4769
|
* @throws {@link Vectros.NotFoundError}
|
|
4698
4770
|
* @throws {@link Vectros.ConflictError}
|
|
4771
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4699
4772
|
*
|
|
4700
4773
|
* @example
|
|
4701
4774
|
* await client.documents.updateDocument({
|
|
@@ -4744,6 +4817,8 @@ var DocumentsClient = class {
|
|
|
4744
4817
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4745
4818
|
case 409:
|
|
4746
4819
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4820
|
+
case 429:
|
|
4821
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4747
4822
|
default:
|
|
4748
4823
|
throw new VectrosError({
|
|
4749
4824
|
statusCode: _response.error.statusCode,
|
|
@@ -4761,6 +4836,7 @@ var DocumentsClient = class {
|
|
|
4761
4836
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4762
4837
|
*
|
|
4763
4838
|
* @throws {@link Vectros.NotFoundError}
|
|
4839
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4764
4840
|
*
|
|
4765
4841
|
* @example
|
|
4766
4842
|
* await client.documents.deleteDocument({
|
|
@@ -4799,6 +4875,8 @@ var DocumentsClient = class {
|
|
|
4799
4875
|
switch (_response.error.statusCode) {
|
|
4800
4876
|
case 404:
|
|
4801
4877
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4878
|
+
case 429:
|
|
4879
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4802
4880
|
default:
|
|
4803
4881
|
throw new VectrosError({
|
|
4804
4882
|
statusCode: _response.error.statusCode,
|
|
@@ -4818,6 +4896,7 @@ var DocumentsClient = class {
|
|
|
4818
4896
|
* @throws {@link Vectros.BadRequestError}
|
|
4819
4897
|
* @throws {@link Vectros.NotFoundError}
|
|
4820
4898
|
* @throws {@link Vectros.ConflictError}
|
|
4899
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4821
4900
|
*
|
|
4822
4901
|
* @example
|
|
4823
4902
|
* await client.documents.patchDocument({
|
|
@@ -4866,6 +4945,8 @@ var DocumentsClient = class {
|
|
|
4866
4945
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4867
4946
|
case 409:
|
|
4868
4947
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4948
|
+
case 429:
|
|
4949
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4869
4950
|
default:
|
|
4870
4951
|
throw new VectrosError({
|
|
4871
4952
|
statusCode: _response.error.statusCode,
|
|
@@ -4877,7 +4958,7 @@ var DocumentsClient = class {
|
|
|
4877
4958
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v1/documents/{id}");
|
|
4878
4959
|
}
|
|
4879
4960
|
/**
|
|
4880
|
-
* Finds documents of a given type by
|
|
4961
|
+
* 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.
|
|
4881
4962
|
*
|
|
4882
4963
|
* @param {Vectros.LookupDocumentsRequest} request
|
|
4883
4964
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4946,6 +5027,7 @@ var DocumentsClient = class {
|
|
|
4946
5027
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4947
5028
|
*
|
|
4948
5029
|
* @throws {@link Vectros.BadRequestError}
|
|
5030
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4949
5031
|
*
|
|
4950
5032
|
* @example
|
|
4951
5033
|
* await client.documents.lookupDocumentsByBody({
|
|
@@ -4987,6 +5069,8 @@ var DocumentsClient = class {
|
|
|
4987
5069
|
switch (_response.error.statusCode) {
|
|
4988
5070
|
case 400:
|
|
4989
5071
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5072
|
+
case 429:
|
|
5073
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4990
5074
|
default:
|
|
4991
5075
|
throw new VectrosError({
|
|
4992
5076
|
statusCode: _response.error.statusCode,
|
|
@@ -5169,12 +5253,14 @@ var DocumentsClient = class {
|
|
|
5169
5253
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents/{id}/versions");
|
|
5170
5254
|
}
|
|
5171
5255
|
/**
|
|
5172
|
-
* 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.
|
|
5256
|
+
* 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.
|
|
5173
5257
|
*
|
|
5174
5258
|
* @param {Vectros.FileUploadRequest} request
|
|
5175
5259
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5176
5260
|
*
|
|
5177
5261
|
* @throws {@link Vectros.BadRequestError}
|
|
5262
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
5263
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5178
5264
|
*
|
|
5179
5265
|
* @example
|
|
5180
5266
|
* await client.documents.uploadDocument({
|
|
@@ -5186,6 +5272,10 @@ var DocumentsClient = class {
|
|
|
5186
5272
|
return HttpResponsePromise.fromPromise(this.__uploadDocument(request, requestOptions));
|
|
5187
5273
|
}
|
|
5188
5274
|
async __uploadDocument(request, requestOptions) {
|
|
5275
|
+
const { upsert, ..._body } = request;
|
|
5276
|
+
const _queryParams = {
|
|
5277
|
+
upsert
|
|
5278
|
+
};
|
|
5189
5279
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5190
5280
|
const _headers = mergeHeaders(
|
|
5191
5281
|
_authRequest.headers,
|
|
@@ -5200,9 +5290,9 @@ var DocumentsClient = class {
|
|
|
5200
5290
|
method: "POST",
|
|
5201
5291
|
headers: _headers,
|
|
5202
5292
|
contentType: "application/json",
|
|
5203
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5293
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5204
5294
|
requestType: "json",
|
|
5205
|
-
body:
|
|
5295
|
+
body: _body,
|
|
5206
5296
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5207
5297
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5208
5298
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5216,6 +5306,10 @@ var DocumentsClient = class {
|
|
|
5216
5306
|
switch (_response.error.statusCode) {
|
|
5217
5307
|
case 400:
|
|
5218
5308
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5309
|
+
case 403:
|
|
5310
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
5311
|
+
case 429:
|
|
5312
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5219
5313
|
default:
|
|
5220
5314
|
throw new VectrosError({
|
|
5221
5315
|
statusCode: _response.error.statusCode,
|
|
@@ -5292,22 +5386,30 @@ var FoldersClient = class {
|
|
|
5292
5386
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/folders");
|
|
5293
5387
|
}
|
|
5294
5388
|
/**
|
|
5295
|
-
* 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.
|
|
5389
|
+
* 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.
|
|
5296
5390
|
*
|
|
5297
|
-
* @param {Vectros.
|
|
5391
|
+
* @param {Vectros.CreateFolderRequest} request
|
|
5298
5392
|
* @param {FoldersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5299
5393
|
*
|
|
5300
5394
|
* @throws {@link Vectros.BadRequestError}
|
|
5395
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
5396
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5301
5397
|
*
|
|
5302
5398
|
* @example
|
|
5303
5399
|
* await client.folders.createFolder({
|
|
5304
|
-
*
|
|
5400
|
+
* body: {
|
|
5401
|
+
* name: "Patient Records 2024"
|
|
5402
|
+
* }
|
|
5305
5403
|
* })
|
|
5306
5404
|
*/
|
|
5307
5405
|
createFolder(request, requestOptions) {
|
|
5308
5406
|
return HttpResponsePromise.fromPromise(this.__createFolder(request, requestOptions));
|
|
5309
5407
|
}
|
|
5310
5408
|
async __createFolder(request, requestOptions) {
|
|
5409
|
+
const { upsert, body: _body } = request;
|
|
5410
|
+
const _queryParams = {
|
|
5411
|
+
upsert
|
|
5412
|
+
};
|
|
5311
5413
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5312
5414
|
const _headers = mergeHeaders(
|
|
5313
5415
|
_authRequest.headers,
|
|
@@ -5322,9 +5424,9 @@ var FoldersClient = class {
|
|
|
5322
5424
|
method: "POST",
|
|
5323
5425
|
headers: _headers,
|
|
5324
5426
|
contentType: "application/json",
|
|
5325
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5427
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5326
5428
|
requestType: "json",
|
|
5327
|
-
body:
|
|
5429
|
+
body: _body,
|
|
5328
5430
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5329
5431
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5330
5432
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5338,6 +5440,10 @@ var FoldersClient = class {
|
|
|
5338
5440
|
switch (_response.error.statusCode) {
|
|
5339
5441
|
case 400:
|
|
5340
5442
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5443
|
+
case 403:
|
|
5444
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
5445
|
+
case 429:
|
|
5446
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5341
5447
|
default:
|
|
5342
5448
|
throw new VectrosError({
|
|
5343
5449
|
statusCode: _response.error.statusCode,
|
|
@@ -5410,6 +5516,7 @@ var FoldersClient = class {
|
|
|
5410
5516
|
* @param {FoldersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5411
5517
|
*
|
|
5412
5518
|
* @throws {@link Vectros.NotFoundError}
|
|
5519
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5413
5520
|
*
|
|
5414
5521
|
* @example
|
|
5415
5522
|
* await client.folders.updateFolder({
|
|
@@ -5454,6 +5561,8 @@ var FoldersClient = class {
|
|
|
5454
5561
|
switch (_response.error.statusCode) {
|
|
5455
5562
|
case 404:
|
|
5456
5563
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5564
|
+
case 429:
|
|
5565
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5457
5566
|
default:
|
|
5458
5567
|
throw new VectrosError({
|
|
5459
5568
|
statusCode: _response.error.statusCode,
|
|
@@ -5472,6 +5581,7 @@ var FoldersClient = class {
|
|
|
5472
5581
|
*
|
|
5473
5582
|
* @throws {@link Vectros.BadRequestError}
|
|
5474
5583
|
* @throws {@link Vectros.NotFoundError}
|
|
5584
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5475
5585
|
*
|
|
5476
5586
|
* @example
|
|
5477
5587
|
* await client.folders.deleteFolder({
|
|
@@ -5512,6 +5622,8 @@ var FoldersClient = class {
|
|
|
5512
5622
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5513
5623
|
case 404:
|
|
5514
5624
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5625
|
+
case 429:
|
|
5626
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5515
5627
|
default:
|
|
5516
5628
|
throw new VectrosError({
|
|
5517
5629
|
statusCode: _response.error.statusCode,
|
|
@@ -5531,6 +5643,7 @@ var FoldersClient = class {
|
|
|
5531
5643
|
* @throws {@link Vectros.BadRequestError}
|
|
5532
5644
|
* @throws {@link Vectros.NotFoundError}
|
|
5533
5645
|
* @throws {@link Vectros.ConflictError}
|
|
5646
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5534
5647
|
*
|
|
5535
5648
|
* @example
|
|
5536
5649
|
* await client.folders.patchFolder({
|
|
@@ -5579,6 +5692,8 @@ var FoldersClient = class {
|
|
|
5579
5692
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5580
5693
|
case 409:
|
|
5581
5694
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
5695
|
+
case 429:
|
|
5696
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5582
5697
|
default:
|
|
5583
5698
|
throw new VectrosError({
|
|
5584
5699
|
statusCode: _response.error.statusCode,
|
|
@@ -5735,22 +5850,30 @@ var IdentityClient = class {
|
|
|
5735
5850
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/clients");
|
|
5736
5851
|
}
|
|
5737
5852
|
/**
|
|
5738
|
-
* 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.
|
|
5853
|
+
* 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.
|
|
5739
5854
|
*
|
|
5740
|
-
* @param {Vectros.
|
|
5855
|
+
* @param {Vectros.CreateClientRequest} request
|
|
5741
5856
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5742
5857
|
*
|
|
5743
5858
|
* @throws {@link Vectros.BadRequestError}
|
|
5859
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
5860
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5744
5861
|
*
|
|
5745
5862
|
* @example
|
|
5746
5863
|
* await client.identity.createClient({
|
|
5747
|
-
*
|
|
5864
|
+
* body: {
|
|
5865
|
+
* externalId: "patient_789"
|
|
5866
|
+
* }
|
|
5748
5867
|
* })
|
|
5749
5868
|
*/
|
|
5750
5869
|
createClient(request, requestOptions) {
|
|
5751
5870
|
return HttpResponsePromise.fromPromise(this.__createClient(request, requestOptions));
|
|
5752
5871
|
}
|
|
5753
5872
|
async __createClient(request, requestOptions) {
|
|
5873
|
+
const { upsert, body: _body } = request;
|
|
5874
|
+
const _queryParams = {
|
|
5875
|
+
upsert
|
|
5876
|
+
};
|
|
5754
5877
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5755
5878
|
const _headers = mergeHeaders(
|
|
5756
5879
|
_authRequest.headers,
|
|
@@ -5765,9 +5888,9 @@ var IdentityClient = class {
|
|
|
5765
5888
|
method: "POST",
|
|
5766
5889
|
headers: _headers,
|
|
5767
5890
|
contentType: "application/json",
|
|
5768
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5891
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5769
5892
|
requestType: "json",
|
|
5770
|
-
body:
|
|
5893
|
+
body: _body,
|
|
5771
5894
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5772
5895
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5773
5896
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5781,6 +5904,10 @@ var IdentityClient = class {
|
|
|
5781
5904
|
switch (_response.error.statusCode) {
|
|
5782
5905
|
case 400:
|
|
5783
5906
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5907
|
+
case 403:
|
|
5908
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
5909
|
+
case 429:
|
|
5910
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5784
5911
|
default:
|
|
5785
5912
|
throw new VectrosError({
|
|
5786
5913
|
statusCode: _response.error.statusCode,
|
|
@@ -5853,6 +5980,7 @@ var IdentityClient = class {
|
|
|
5853
5980
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5854
5981
|
*
|
|
5855
5982
|
* @throws {@link Vectros.NotFoundError}
|
|
5983
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5856
5984
|
*
|
|
5857
5985
|
* @example
|
|
5858
5986
|
* await client.identity.updateClient({
|
|
@@ -5897,6 +6025,8 @@ var IdentityClient = class {
|
|
|
5897
6025
|
switch (_response.error.statusCode) {
|
|
5898
6026
|
case 404:
|
|
5899
6027
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6028
|
+
case 429:
|
|
6029
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5900
6030
|
default:
|
|
5901
6031
|
throw new VectrosError({
|
|
5902
6032
|
statusCode: _response.error.statusCode,
|
|
@@ -5914,6 +6044,7 @@ var IdentityClient = class {
|
|
|
5914
6044
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5915
6045
|
*
|
|
5916
6046
|
* @throws {@link Vectros.NotFoundError}
|
|
6047
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5917
6048
|
*
|
|
5918
6049
|
* @example
|
|
5919
6050
|
* await client.identity.deleteClient({
|
|
@@ -5952,6 +6083,8 @@ var IdentityClient = class {
|
|
|
5952
6083
|
switch (_response.error.statusCode) {
|
|
5953
6084
|
case 404:
|
|
5954
6085
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6086
|
+
case 429:
|
|
6087
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5955
6088
|
default:
|
|
5956
6089
|
throw new VectrosError({
|
|
5957
6090
|
statusCode: _response.error.statusCode,
|
|
@@ -5969,6 +6102,7 @@ var IdentityClient = class {
|
|
|
5969
6102
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5970
6103
|
*
|
|
5971
6104
|
* @throws {@link Vectros.BadRequestError}
|
|
6105
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5972
6106
|
*
|
|
5973
6107
|
* @example
|
|
5974
6108
|
* await client.identity.lookupClients({
|
|
@@ -6010,6 +6144,8 @@ var IdentityClient = class {
|
|
|
6010
6144
|
switch (_response.error.statusCode) {
|
|
6011
6145
|
case 400:
|
|
6012
6146
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6147
|
+
case 429:
|
|
6148
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6013
6149
|
default:
|
|
6014
6150
|
throw new VectrosError({
|
|
6015
6151
|
statusCode: _response.error.statusCode,
|
|
@@ -6158,22 +6294,30 @@ var IdentityClient = class {
|
|
|
6158
6294
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/orgs");
|
|
6159
6295
|
}
|
|
6160
6296
|
/**
|
|
6161
|
-
* 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.
|
|
6297
|
+
* 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.
|
|
6162
6298
|
*
|
|
6163
|
-
* @param {Vectros.
|
|
6299
|
+
* @param {Vectros.CreateOrgRequest} request
|
|
6164
6300
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6165
6301
|
*
|
|
6166
6302
|
* @throws {@link Vectros.BadRequestError}
|
|
6303
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
6304
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6167
6305
|
*
|
|
6168
6306
|
* @example
|
|
6169
6307
|
* await client.identity.createOrg({
|
|
6170
|
-
*
|
|
6308
|
+
* body: {
|
|
6309
|
+
* externalId: "clinic_001"
|
|
6310
|
+
* }
|
|
6171
6311
|
* })
|
|
6172
6312
|
*/
|
|
6173
6313
|
createOrg(request, requestOptions) {
|
|
6174
6314
|
return HttpResponsePromise.fromPromise(this.__createOrg(request, requestOptions));
|
|
6175
6315
|
}
|
|
6176
6316
|
async __createOrg(request, requestOptions) {
|
|
6317
|
+
const { upsert, body: _body } = request;
|
|
6318
|
+
const _queryParams = {
|
|
6319
|
+
upsert
|
|
6320
|
+
};
|
|
6177
6321
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6178
6322
|
const _headers = mergeHeaders(
|
|
6179
6323
|
_authRequest.headers,
|
|
@@ -6188,9 +6332,9 @@ var IdentityClient = class {
|
|
|
6188
6332
|
method: "POST",
|
|
6189
6333
|
headers: _headers,
|
|
6190
6334
|
contentType: "application/json",
|
|
6191
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6335
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6192
6336
|
requestType: "json",
|
|
6193
|
-
body:
|
|
6337
|
+
body: _body,
|
|
6194
6338
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6195
6339
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6196
6340
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6204,6 +6348,10 @@ var IdentityClient = class {
|
|
|
6204
6348
|
switch (_response.error.statusCode) {
|
|
6205
6349
|
case 400:
|
|
6206
6350
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6351
|
+
case 403:
|
|
6352
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6353
|
+
case 429:
|
|
6354
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6207
6355
|
default:
|
|
6208
6356
|
throw new VectrosError({
|
|
6209
6357
|
statusCode: _response.error.statusCode,
|
|
@@ -6276,6 +6424,7 @@ var IdentityClient = class {
|
|
|
6276
6424
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6277
6425
|
*
|
|
6278
6426
|
* @throws {@link Vectros.NotFoundError}
|
|
6427
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6279
6428
|
*
|
|
6280
6429
|
* @example
|
|
6281
6430
|
* await client.identity.updateOrg({
|
|
@@ -6320,6 +6469,8 @@ var IdentityClient = class {
|
|
|
6320
6469
|
switch (_response.error.statusCode) {
|
|
6321
6470
|
case 404:
|
|
6322
6471
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6472
|
+
case 429:
|
|
6473
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6323
6474
|
default:
|
|
6324
6475
|
throw new VectrosError({
|
|
6325
6476
|
statusCode: _response.error.statusCode,
|
|
@@ -6337,6 +6488,7 @@ var IdentityClient = class {
|
|
|
6337
6488
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6338
6489
|
*
|
|
6339
6490
|
* @throws {@link Vectros.NotFoundError}
|
|
6491
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6340
6492
|
*
|
|
6341
6493
|
* @example
|
|
6342
6494
|
* await client.identity.deleteOrg({
|
|
@@ -6375,6 +6527,8 @@ var IdentityClient = class {
|
|
|
6375
6527
|
switch (_response.error.statusCode) {
|
|
6376
6528
|
case 404:
|
|
6377
6529
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6530
|
+
case 429:
|
|
6531
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6378
6532
|
default:
|
|
6379
6533
|
throw new VectrosError({
|
|
6380
6534
|
statusCode: _response.error.statusCode,
|
|
@@ -6392,6 +6546,7 @@ var IdentityClient = class {
|
|
|
6392
6546
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6393
6547
|
*
|
|
6394
6548
|
* @throws {@link Vectros.BadRequestError}
|
|
6549
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6395
6550
|
*
|
|
6396
6551
|
* @example
|
|
6397
6552
|
* await client.identity.lookupOrgs({
|
|
@@ -6433,6 +6588,8 @@ var IdentityClient = class {
|
|
|
6433
6588
|
switch (_response.error.statusCode) {
|
|
6434
6589
|
case 400:
|
|
6435
6590
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6591
|
+
case 429:
|
|
6592
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6436
6593
|
default:
|
|
6437
6594
|
throw new VectrosError({
|
|
6438
6595
|
statusCode: _response.error.statusCode,
|
|
@@ -6567,22 +6724,30 @@ var IdentityClient = class {
|
|
|
6567
6724
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users");
|
|
6568
6725
|
}
|
|
6569
6726
|
/**
|
|
6570
|
-
* 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.
|
|
6727
|
+
* 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.
|
|
6571
6728
|
*
|
|
6572
|
-
* @param {Vectros.
|
|
6729
|
+
* @param {Vectros.CreateUserRequest} request
|
|
6573
6730
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6574
6731
|
*
|
|
6575
6732
|
* @throws {@link Vectros.BadRequestError}
|
|
6733
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
6734
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6576
6735
|
*
|
|
6577
6736
|
* @example
|
|
6578
6737
|
* await client.identity.createUser({
|
|
6579
|
-
*
|
|
6738
|
+
* body: {
|
|
6739
|
+
* externalId: "usr_12345"
|
|
6740
|
+
* }
|
|
6580
6741
|
* })
|
|
6581
6742
|
*/
|
|
6582
6743
|
createUser(request, requestOptions) {
|
|
6583
6744
|
return HttpResponsePromise.fromPromise(this.__createUser(request, requestOptions));
|
|
6584
6745
|
}
|
|
6585
6746
|
async __createUser(request, requestOptions) {
|
|
6747
|
+
const { upsert, body: _body } = request;
|
|
6748
|
+
const _queryParams = {
|
|
6749
|
+
upsert
|
|
6750
|
+
};
|
|
6586
6751
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6587
6752
|
const _headers = mergeHeaders(
|
|
6588
6753
|
_authRequest.headers,
|
|
@@ -6597,9 +6762,9 @@ var IdentityClient = class {
|
|
|
6597
6762
|
method: "POST",
|
|
6598
6763
|
headers: _headers,
|
|
6599
6764
|
contentType: "application/json",
|
|
6600
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6765
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6601
6766
|
requestType: "json",
|
|
6602
|
-
body:
|
|
6767
|
+
body: _body,
|
|
6603
6768
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6604
6769
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6605
6770
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6613,6 +6778,10 @@ var IdentityClient = class {
|
|
|
6613
6778
|
switch (_response.error.statusCode) {
|
|
6614
6779
|
case 400:
|
|
6615
6780
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6781
|
+
case 403:
|
|
6782
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6783
|
+
case 429:
|
|
6784
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6616
6785
|
default:
|
|
6617
6786
|
throw new VectrosError({
|
|
6618
6787
|
statusCode: _response.error.statusCode,
|
|
@@ -6685,6 +6854,7 @@ var IdentityClient = class {
|
|
|
6685
6854
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6686
6855
|
*
|
|
6687
6856
|
* @throws {@link Vectros.NotFoundError}
|
|
6857
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6688
6858
|
*
|
|
6689
6859
|
* @example
|
|
6690
6860
|
* await client.identity.updateUser({
|
|
@@ -6729,6 +6899,8 @@ var IdentityClient = class {
|
|
|
6729
6899
|
switch (_response.error.statusCode) {
|
|
6730
6900
|
case 404:
|
|
6731
6901
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6902
|
+
case 429:
|
|
6903
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6732
6904
|
default:
|
|
6733
6905
|
throw new VectrosError({
|
|
6734
6906
|
statusCode: _response.error.statusCode,
|
|
@@ -6746,6 +6918,7 @@ var IdentityClient = class {
|
|
|
6746
6918
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6747
6919
|
*
|
|
6748
6920
|
* @throws {@link Vectros.NotFoundError}
|
|
6921
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6749
6922
|
*
|
|
6750
6923
|
* @example
|
|
6751
6924
|
* await client.identity.deleteUser({
|
|
@@ -6784,6 +6957,8 @@ var IdentityClient = class {
|
|
|
6784
6957
|
switch (_response.error.statusCode) {
|
|
6785
6958
|
case 404:
|
|
6786
6959
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6960
|
+
case 429:
|
|
6961
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6787
6962
|
default:
|
|
6788
6963
|
throw new VectrosError({
|
|
6789
6964
|
statusCode: _response.error.statusCode,
|
|
@@ -6801,6 +6976,7 @@ var IdentityClient = class {
|
|
|
6801
6976
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6802
6977
|
*
|
|
6803
6978
|
* @throws {@link Vectros.BadRequestError}
|
|
6979
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6804
6980
|
*
|
|
6805
6981
|
* @example
|
|
6806
6982
|
* await client.identity.lookupUsers({
|
|
@@ -6842,6 +7018,8 @@ var IdentityClient = class {
|
|
|
6842
7018
|
switch (_response.error.statusCode) {
|
|
6843
7019
|
case 400:
|
|
6844
7020
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7021
|
+
case 429:
|
|
7022
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6845
7023
|
default:
|
|
6846
7024
|
throw new VectrosError({
|
|
6847
7025
|
statusCode: _response.error.statusCode,
|
|
@@ -7178,6 +7356,7 @@ var RecordsClient = class {
|
|
|
7178
7356
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7179
7357
|
*
|
|
7180
7358
|
* @throws {@link Vectros.ForbiddenError}
|
|
7359
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7181
7360
|
* @throws {@link Vectros.NotImplementedError}
|
|
7182
7361
|
*
|
|
7183
7362
|
* @example
|
|
@@ -7217,6 +7396,8 @@ var RecordsClient = class {
|
|
|
7217
7396
|
switch (_response.error.statusCode) {
|
|
7218
7397
|
case 403:
|
|
7219
7398
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7399
|
+
case 429:
|
|
7400
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7220
7401
|
case 501:
|
|
7221
7402
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
7222
7403
|
default:
|
|
@@ -7236,6 +7417,7 @@ var RecordsClient = class {
|
|
|
7236
7417
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7237
7418
|
*
|
|
7238
7419
|
* @throws {@link Vectros.ForbiddenError}
|
|
7420
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7239
7421
|
* @throws {@link Vectros.NotImplementedError}
|
|
7240
7422
|
*
|
|
7241
7423
|
* @example
|
|
@@ -7275,6 +7457,8 @@ var RecordsClient = class {
|
|
|
7275
7457
|
switch (_response.error.statusCode) {
|
|
7276
7458
|
case 403:
|
|
7277
7459
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7460
|
+
case 429:
|
|
7461
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7278
7462
|
case 501:
|
|
7279
7463
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
7280
7464
|
default:
|
|
@@ -7294,6 +7478,7 @@ var RecordsClient = class {
|
|
|
7294
7478
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7295
7479
|
*
|
|
7296
7480
|
* @throws {@link Vectros.ForbiddenError}
|
|
7481
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7297
7482
|
* @throws {@link Vectros.NotImplementedError}
|
|
7298
7483
|
*
|
|
7299
7484
|
* @example
|
|
@@ -7333,6 +7518,8 @@ var RecordsClient = class {
|
|
|
7333
7518
|
switch (_response.error.statusCode) {
|
|
7334
7519
|
case 403:
|
|
7335
7520
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7521
|
+
case 429:
|
|
7522
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7336
7523
|
case 501:
|
|
7337
7524
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
7338
7525
|
default:
|
|
@@ -7410,29 +7597,36 @@ var RecordsClient = class {
|
|
|
7410
7597
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/records");
|
|
7411
7598
|
}
|
|
7412
7599
|
/**
|
|
7413
|
-
* 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.
|
|
7600
|
+
* 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.
|
|
7414
7601
|
*
|
|
7415
|
-
* @param {Vectros.
|
|
7602
|
+
* @param {Vectros.CreateRecordRequest} request
|
|
7416
7603
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7417
7604
|
*
|
|
7418
7605
|
* @throws {@link Vectros.BadRequestError}
|
|
7419
7606
|
* @throws {@link Vectros.ForbiddenError}
|
|
7607
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7420
7608
|
*
|
|
7421
7609
|
* @example
|
|
7422
7610
|
* await client.records.createRecord({
|
|
7423
|
-
*
|
|
7424
|
-
*
|
|
7425
|
-
*
|
|
7426
|
-
*
|
|
7427
|
-
*
|
|
7428
|
-
*
|
|
7429
|
-
*
|
|
7611
|
+
* body: {
|
|
7612
|
+
* typeName: "intake_form",
|
|
7613
|
+
* schemaId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
7614
|
+
* payload: {
|
|
7615
|
+
* "first_name": "Jane",
|
|
7616
|
+
* "email": "jane@example.com"
|
|
7617
|
+
* },
|
|
7618
|
+
* folderId: "f47ac10b-58cc-4372-a567-0e02b2c3d479"
|
|
7619
|
+
* }
|
|
7430
7620
|
* })
|
|
7431
7621
|
*/
|
|
7432
7622
|
createRecord(request, requestOptions) {
|
|
7433
7623
|
return HttpResponsePromise.fromPromise(this.__createRecord(request, requestOptions));
|
|
7434
7624
|
}
|
|
7435
7625
|
async __createRecord(request, requestOptions) {
|
|
7626
|
+
const { upsert, body: _body } = request;
|
|
7627
|
+
const _queryParams = {
|
|
7628
|
+
upsert
|
|
7629
|
+
};
|
|
7436
7630
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
7437
7631
|
const _headers = mergeHeaders(
|
|
7438
7632
|
_authRequest.headers,
|
|
@@ -7447,9 +7641,9 @@ var RecordsClient = class {
|
|
|
7447
7641
|
method: "POST",
|
|
7448
7642
|
headers: _headers,
|
|
7449
7643
|
contentType: "application/json",
|
|
7450
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
7644
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
7451
7645
|
requestType: "json",
|
|
7452
|
-
body:
|
|
7646
|
+
body: _body,
|
|
7453
7647
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
7454
7648
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
7455
7649
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -7465,6 +7659,8 @@ var RecordsClient = class {
|
|
|
7465
7659
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7466
7660
|
case 403:
|
|
7467
7661
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7662
|
+
case 429:
|
|
7663
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7468
7664
|
default:
|
|
7469
7665
|
throw new VectrosError({
|
|
7470
7666
|
statusCode: _response.error.statusCode,
|
|
@@ -7539,6 +7735,7 @@ var RecordsClient = class {
|
|
|
7539
7735
|
* @throws {@link Vectros.BadRequestError}
|
|
7540
7736
|
* @throws {@link Vectros.NotFoundError}
|
|
7541
7737
|
* @throws {@link Vectros.ConflictError}
|
|
7738
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7542
7739
|
*
|
|
7543
7740
|
* @example
|
|
7544
7741
|
* await client.records.updateRecord({
|
|
@@ -7585,6 +7782,8 @@ var RecordsClient = class {
|
|
|
7585
7782
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7586
7783
|
case 409:
|
|
7587
7784
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
7785
|
+
case 429:
|
|
7786
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7588
7787
|
default:
|
|
7589
7788
|
throw new VectrosError({
|
|
7590
7789
|
statusCode: _response.error.statusCode,
|
|
@@ -7602,6 +7801,7 @@ var RecordsClient = class {
|
|
|
7602
7801
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7603
7802
|
*
|
|
7604
7803
|
* @throws {@link Vectros.NotFoundError}
|
|
7804
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7605
7805
|
*
|
|
7606
7806
|
* @example
|
|
7607
7807
|
* await client.records.deleteRecord({
|
|
@@ -7640,6 +7840,8 @@ var RecordsClient = class {
|
|
|
7640
7840
|
switch (_response.error.statusCode) {
|
|
7641
7841
|
case 404:
|
|
7642
7842
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7843
|
+
case 429:
|
|
7844
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7643
7845
|
default:
|
|
7644
7846
|
throw new VectrosError({
|
|
7645
7847
|
statusCode: _response.error.statusCode,
|
|
@@ -7659,6 +7861,7 @@ var RecordsClient = class {
|
|
|
7659
7861
|
* @throws {@link Vectros.BadRequestError}
|
|
7660
7862
|
* @throws {@link Vectros.NotFoundError}
|
|
7661
7863
|
* @throws {@link Vectros.ConflictError}
|
|
7864
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7662
7865
|
*
|
|
7663
7866
|
* @example
|
|
7664
7867
|
* await client.records.patchRecord({
|
|
@@ -7710,6 +7913,8 @@ var RecordsClient = class {
|
|
|
7710
7913
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7711
7914
|
case 409:
|
|
7712
7915
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
7916
|
+
case 429:
|
|
7917
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7713
7918
|
default:
|
|
7714
7919
|
throw new VectrosError({
|
|
7715
7920
|
statusCode: _response.error.statusCode,
|
|
@@ -7798,6 +8003,7 @@ var RecordsClient = class {
|
|
|
7798
8003
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7799
8004
|
*
|
|
7800
8005
|
* @throws {@link Vectros.BadRequestError}
|
|
8006
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7801
8007
|
*
|
|
7802
8008
|
* @example
|
|
7803
8009
|
* await client.records.lookupRecordsByBody({
|
|
@@ -7839,6 +8045,8 @@ var RecordsClient = class {
|
|
|
7839
8045
|
switch (_response.error.statusCode) {
|
|
7840
8046
|
case 400:
|
|
7841
8047
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8048
|
+
case 429:
|
|
8049
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7842
8050
|
default:
|
|
7843
8051
|
throw new VectrosError({
|
|
7844
8052
|
statusCode: _response.error.statusCode,
|
|
@@ -8031,42 +8239,50 @@ var SchemasClient = class {
|
|
|
8031
8239
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/schemas");
|
|
8032
8240
|
}
|
|
8033
8241
|
/**
|
|
8034
|
-
* 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.
|
|
8242
|
+
* 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.
|
|
8035
8243
|
*
|
|
8036
|
-
* @param {Vectros.
|
|
8244
|
+
* @param {Vectros.CreateSchemaRequest} request
|
|
8037
8245
|
* @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8038
8246
|
*
|
|
8039
8247
|
* @throws {@link Vectros.BadRequestError}
|
|
8248
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
8249
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8040
8250
|
*
|
|
8041
8251
|
* @example
|
|
8042
8252
|
* await client.schemas.createSchema({
|
|
8043
|
-
*
|
|
8044
|
-
*
|
|
8045
|
-
*
|
|
8046
|
-
*
|
|
8047
|
-
*
|
|
8048
|
-
*
|
|
8049
|
-
*
|
|
8050
|
-
*
|
|
8051
|
-
*
|
|
8052
|
-
*
|
|
8053
|
-
*
|
|
8054
|
-
*
|
|
8055
|
-
*
|
|
8056
|
-
*
|
|
8057
|
-
*
|
|
8058
|
-
*
|
|
8059
|
-
*
|
|
8060
|
-
*
|
|
8061
|
-
*
|
|
8062
|
-
*
|
|
8063
|
-
*
|
|
8253
|
+
* body: {
|
|
8254
|
+
* typeName: "intake_form",
|
|
8255
|
+
* displayName: "Client Intake Form",
|
|
8256
|
+
* description: "Captures initial client information",
|
|
8257
|
+
* fields: [{
|
|
8258
|
+
* fieldId: "first_name",
|
|
8259
|
+
* fieldType: "string",
|
|
8260
|
+
* required: true,
|
|
8261
|
+
* searchable: true
|
|
8262
|
+
* }, {
|
|
8263
|
+
* fieldId: "email",
|
|
8264
|
+
* fieldType: "string",
|
|
8265
|
+
* required: true
|
|
8266
|
+
* }],
|
|
8267
|
+
* lookupFields: [{
|
|
8268
|
+
* fieldName: "email",
|
|
8269
|
+
* unique: true
|
|
8270
|
+
* }],
|
|
8271
|
+
* capabilities: {
|
|
8272
|
+
* "auditHistory": true
|
|
8273
|
+
* },
|
|
8274
|
+
* allowedSurfaces: ["record"]
|
|
8275
|
+
* }
|
|
8064
8276
|
* })
|
|
8065
8277
|
*/
|
|
8066
8278
|
createSchema(request, requestOptions) {
|
|
8067
8279
|
return HttpResponsePromise.fromPromise(this.__createSchema(request, requestOptions));
|
|
8068
8280
|
}
|
|
8069
8281
|
async __createSchema(request, requestOptions) {
|
|
8282
|
+
const { upsert, body: _body } = request;
|
|
8283
|
+
const _queryParams = {
|
|
8284
|
+
upsert
|
|
8285
|
+
};
|
|
8070
8286
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
8071
8287
|
const _headers = mergeHeaders(
|
|
8072
8288
|
_authRequest.headers,
|
|
@@ -8081,9 +8297,9 @@ var SchemasClient = class {
|
|
|
8081
8297
|
method: "POST",
|
|
8082
8298
|
headers: _headers,
|
|
8083
8299
|
contentType: "application/json",
|
|
8084
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
8300
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
8085
8301
|
requestType: "json",
|
|
8086
|
-
body:
|
|
8302
|
+
body: _body,
|
|
8087
8303
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
8088
8304
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
8089
8305
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -8097,6 +8313,10 @@ var SchemasClient = class {
|
|
|
8097
8313
|
switch (_response.error.statusCode) {
|
|
8098
8314
|
case 400:
|
|
8099
8315
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8316
|
+
case 403:
|
|
8317
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
8318
|
+
case 429:
|
|
8319
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8100
8320
|
default:
|
|
8101
8321
|
throw new VectrosError({
|
|
8102
8322
|
statusCode: _response.error.statusCode,
|
|
@@ -8170,6 +8390,7 @@ var SchemasClient = class {
|
|
|
8170
8390
|
*
|
|
8171
8391
|
* @throws {@link Vectros.BadRequestError}
|
|
8172
8392
|
* @throws {@link Vectros.NotFoundError}
|
|
8393
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8173
8394
|
*
|
|
8174
8395
|
* @example
|
|
8175
8396
|
* await client.schemas.updateSchema({
|
|
@@ -8218,6 +8439,8 @@ var SchemasClient = class {
|
|
|
8218
8439
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8219
8440
|
case 404:
|
|
8220
8441
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
8442
|
+
case 429:
|
|
8443
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8221
8444
|
default:
|
|
8222
8445
|
throw new VectrosError({
|
|
8223
8446
|
statusCode: _response.error.statusCode,
|
|
@@ -8236,6 +8459,7 @@ var SchemasClient = class {
|
|
|
8236
8459
|
*
|
|
8237
8460
|
* @throws {@link Vectros.NotFoundError}
|
|
8238
8461
|
* @throws {@link Vectros.ConflictError}
|
|
8462
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8239
8463
|
*
|
|
8240
8464
|
* @example
|
|
8241
8465
|
* await client.schemas.deleteSchema({
|
|
@@ -8276,6 +8500,8 @@ var SchemasClient = class {
|
|
|
8276
8500
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
8277
8501
|
case 409:
|
|
8278
8502
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
8503
|
+
case 429:
|
|
8504
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8279
8505
|
default:
|
|
8280
8506
|
throw new VectrosError({
|
|
8281
8507
|
statusCode: _response.error.statusCode,
|
|
@@ -8357,6 +8583,7 @@ var SearchClient = class {
|
|
|
8357
8583
|
*
|
|
8358
8584
|
* @throws {@link Vectros.BadRequestError}
|
|
8359
8585
|
* @throws {@link Vectros.ForbiddenError}
|
|
8586
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8360
8587
|
*
|
|
8361
8588
|
* @example
|
|
8362
8589
|
* await client.search.content({
|
|
@@ -8399,6 +8626,8 @@ var SearchClient = class {
|
|
|
8399
8626
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8400
8627
|
case 403:
|
|
8401
8628
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
8629
|
+
case 429:
|
|
8630
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8402
8631
|
default:
|
|
8403
8632
|
throw new VectrosError({
|
|
8404
8633
|
statusCode: _response.error.statusCode,
|
|
@@ -8525,8 +8754,8 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
8525
8754
|
|
|
8526
8755
|
// src/build-info.ts
|
|
8527
8756
|
var BUILD_INFO = {
|
|
8528
|
-
mcpServer: true ? "0.5.
|
|
8529
|
-
sdk: true ? "0.
|
|
8757
|
+
mcpServer: true ? "0.5.3" : "dev",
|
|
8758
|
+
sdk: true ? "0.31.0" : "dev"
|
|
8530
8759
|
};
|
|
8531
8760
|
|
|
8532
8761
|
// src/log.ts
|
|
@@ -9026,15 +9255,17 @@ var recordCreate = ({ client, log }) => ({
|
|
|
9026
9255
|
const type = args.type;
|
|
9027
9256
|
try {
|
|
9028
9257
|
const created = await client.records.createRecord({
|
|
9029
|
-
|
|
9030
|
-
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9258
|
+
body: {
|
|
9259
|
+
typeName: type,
|
|
9260
|
+
payload: args.fields,
|
|
9261
|
+
externalId: args.externalId,
|
|
9262
|
+
indexMode: args.indexMode,
|
|
9263
|
+
status: args.status,
|
|
9264
|
+
folderId: args.folderId,
|
|
9265
|
+
userId: args.userId,
|
|
9266
|
+
orgId: args.orgId,
|
|
9267
|
+
clientId: args.clientId
|
|
9268
|
+
}
|
|
9038
9269
|
});
|
|
9039
9270
|
log.debug({ tool: "record_create", type, id: created.id }, "record_create ok");
|
|
9040
9271
|
return { content: [{ type: "text", text: JSON.stringify(created, null, 2) }] };
|
|
@@ -9676,13 +9907,15 @@ var folderCreate = ({ client, log }) => ({
|
|
|
9676
9907
|
handler: async (args) => {
|
|
9677
9908
|
try {
|
|
9678
9909
|
const folder = await client.folders.createFolder({
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9910
|
+
body: {
|
|
9911
|
+
name: args.name,
|
|
9912
|
+
description: args.description,
|
|
9913
|
+
parentFolderId: args.parentId,
|
|
9914
|
+
slug: args.slug,
|
|
9915
|
+
userId: args.userId,
|
|
9916
|
+
orgId: args.orgId,
|
|
9917
|
+
clientId: args.clientId
|
|
9918
|
+
}
|
|
9686
9919
|
});
|
|
9687
9920
|
log.debug({ tool: "folder_create", id: folder.id, name: folder.name }, "folder_create ok");
|
|
9688
9921
|
return { content: [{ type: "text", text: JSON.stringify(folder, null, 2) }] };
|
|
@@ -9936,11 +10169,13 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
9936
10169
|
if (text) {
|
|
9937
10170
|
const storeText = args.storeText ?? true;
|
|
9938
10171
|
const result = await client.documents.ingestDocument({
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
10172
|
+
body: {
|
|
10173
|
+
title,
|
|
10174
|
+
text,
|
|
10175
|
+
indexMode,
|
|
10176
|
+
storeText,
|
|
10177
|
+
...common
|
|
10178
|
+
}
|
|
9944
10179
|
});
|
|
9945
10180
|
log.debug(
|
|
9946
10181
|
{ tool: "document_ingest", mode: "text", id: result?.id, indexMode },
|