@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.js
CHANGED
|
@@ -2553,6 +2553,7 @@ var AuthClient = class {
|
|
|
2553
2553
|
* @throws {@link Vectros.BadRequestError}
|
|
2554
2554
|
* @throws {@link Vectros.ForbiddenError}
|
|
2555
2555
|
* @throws {@link Vectros.NotFoundError}
|
|
2556
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2556
2557
|
*
|
|
2557
2558
|
* @example
|
|
2558
2559
|
* await client.auth.createScopedKey({
|
|
@@ -2600,6 +2601,8 @@ var AuthClient = class {
|
|
|
2600
2601
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2601
2602
|
case 404:
|
|
2602
2603
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2604
|
+
case 429:
|
|
2605
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2603
2606
|
default:
|
|
2604
2607
|
throw new VectrosError({
|
|
2605
2608
|
statusCode: _response.error.statusCode,
|
|
@@ -2676,6 +2679,7 @@ var AuthClient = class {
|
|
|
2676
2679
|
*
|
|
2677
2680
|
* @throws {@link Vectros.ForbiddenError}
|
|
2678
2681
|
* @throws {@link Vectros.NotFoundError}
|
|
2682
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2679
2683
|
*
|
|
2680
2684
|
* @example
|
|
2681
2685
|
* await client.auth.revokeScopedKey({
|
|
@@ -2716,6 +2720,8 @@ var AuthClient = class {
|
|
|
2716
2720
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2717
2721
|
case 404:
|
|
2718
2722
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2723
|
+
case 429:
|
|
2724
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2719
2725
|
default:
|
|
2720
2726
|
throw new VectrosError({
|
|
2721
2727
|
statusCode: _response.error.statusCode,
|
|
@@ -2871,7 +2877,7 @@ var AuthClient = class {
|
|
|
2871
2877
|
);
|
|
2872
2878
|
}
|
|
2873
2879
|
/**
|
|
2874
|
-
* 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.
|
|
2880
|
+
* 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.
|
|
2875
2881
|
*
|
|
2876
2882
|
* @param {Vectros.CreateAccessProfileRequest} request
|
|
2877
2883
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -2879,6 +2885,7 @@ var AuthClient = class {
|
|
|
2879
2885
|
* @throws {@link Vectros.BadRequestError}
|
|
2880
2886
|
* @throws {@link Vectros.ForbiddenError}
|
|
2881
2887
|
* @throws {@link Vectros.NotFoundError}
|
|
2888
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2882
2889
|
*
|
|
2883
2890
|
* @example
|
|
2884
2891
|
* await client.auth.createAccessProfile({
|
|
@@ -2892,7 +2899,10 @@ var AuthClient = class {
|
|
|
2892
2899
|
return HttpResponsePromise.fromPromise(this.__createAccessProfile(request, requestOptions));
|
|
2893
2900
|
}
|
|
2894
2901
|
async __createAccessProfile(request, requestOptions) {
|
|
2895
|
-
const { contextId, body: _body } = request;
|
|
2902
|
+
const { contextId, upsert, body: _body } = request;
|
|
2903
|
+
const _queryParams = {
|
|
2904
|
+
upsert
|
|
2905
|
+
};
|
|
2896
2906
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2897
2907
|
const _headers = mergeHeaders(
|
|
2898
2908
|
_authRequest.headers,
|
|
@@ -2907,7 +2917,7 @@ var AuthClient = class {
|
|
|
2907
2917
|
method: "POST",
|
|
2908
2918
|
headers: _headers,
|
|
2909
2919
|
contentType: "application/json",
|
|
2910
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
2920
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
2911
2921
|
requestType: "json",
|
|
2912
2922
|
body: _body,
|
|
2913
2923
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -2927,6 +2937,8 @@ var AuthClient = class {
|
|
|
2927
2937
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2928
2938
|
case 404:
|
|
2929
2939
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2940
|
+
case 429:
|
|
2941
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2930
2942
|
default:
|
|
2931
2943
|
throw new VectrosError({
|
|
2932
2944
|
statusCode: _response.error.statusCode,
|
|
@@ -3000,24 +3012,31 @@ var AuthClient = class {
|
|
|
3000
3012
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/app-contexts");
|
|
3001
3013
|
}
|
|
3002
3014
|
/**
|
|
3003
|
-
* 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.
|
|
3015
|
+
* 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.
|
|
3004
3016
|
*
|
|
3005
|
-
* @param {Vectros.
|
|
3017
|
+
* @param {Vectros.CreateAppContextRequest} request
|
|
3006
3018
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3007
3019
|
*
|
|
3008
3020
|
* @throws {@link Vectros.BadRequestError}
|
|
3009
3021
|
* @throws {@link Vectros.ForbiddenError}
|
|
3022
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3010
3023
|
*
|
|
3011
3024
|
* @example
|
|
3012
3025
|
* await client.auth.createAppContext({
|
|
3013
|
-
*
|
|
3014
|
-
*
|
|
3026
|
+
* body: {
|
|
3027
|
+
* contextId: "myapp",
|
|
3028
|
+
* name: "My Internal App"
|
|
3029
|
+
* }
|
|
3015
3030
|
* })
|
|
3016
3031
|
*/
|
|
3017
3032
|
createAppContext(request, requestOptions) {
|
|
3018
3033
|
return HttpResponsePromise.fromPromise(this.__createAppContext(request, requestOptions));
|
|
3019
3034
|
}
|
|
3020
3035
|
async __createAppContext(request, requestOptions) {
|
|
3036
|
+
const { upsert, body: _body } = request;
|
|
3037
|
+
const _queryParams = {
|
|
3038
|
+
upsert
|
|
3039
|
+
};
|
|
3021
3040
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
3022
3041
|
const _headers = mergeHeaders(
|
|
3023
3042
|
_authRequest.headers,
|
|
@@ -3032,9 +3051,9 @@ var AuthClient = class {
|
|
|
3032
3051
|
method: "POST",
|
|
3033
3052
|
headers: _headers,
|
|
3034
3053
|
contentType: "application/json",
|
|
3035
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
3054
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
3036
3055
|
requestType: "json",
|
|
3037
|
-
body:
|
|
3056
|
+
body: _body,
|
|
3038
3057
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
3039
3058
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
3040
3059
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -3050,6 +3069,8 @@ var AuthClient = class {
|
|
|
3050
3069
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
3051
3070
|
case 403:
|
|
3052
3071
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3072
|
+
case 429:
|
|
3073
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3053
3074
|
default:
|
|
3054
3075
|
throw new VectrosError({
|
|
3055
3076
|
statusCode: _response.error.statusCode,
|
|
@@ -3128,7 +3149,7 @@ var AuthClient = class {
|
|
|
3128
3149
|
);
|
|
3129
3150
|
}
|
|
3130
3151
|
/**
|
|
3131
|
-
* 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.
|
|
3152
|
+
* 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.
|
|
3132
3153
|
*
|
|
3133
3154
|
* @param {Vectros.CreateRoleRequest} request
|
|
3134
3155
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -3136,6 +3157,7 @@ var AuthClient = class {
|
|
|
3136
3157
|
* @throws {@link Vectros.BadRequestError}
|
|
3137
3158
|
* @throws {@link Vectros.ForbiddenError}
|
|
3138
3159
|
* @throws {@link Vectros.NotFoundError}
|
|
3160
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3139
3161
|
*
|
|
3140
3162
|
* @example
|
|
3141
3163
|
* await client.auth.createRole({
|
|
@@ -3153,7 +3175,10 @@ var AuthClient = class {
|
|
|
3153
3175
|
return HttpResponsePromise.fromPromise(this.__createRole(request, requestOptions));
|
|
3154
3176
|
}
|
|
3155
3177
|
async __createRole(request, requestOptions) {
|
|
3156
|
-
const { contextId, body: _body } = request;
|
|
3178
|
+
const { contextId, upsert, body: _body } = request;
|
|
3179
|
+
const _queryParams = {
|
|
3180
|
+
upsert
|
|
3181
|
+
};
|
|
3157
3182
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
3158
3183
|
const _headers = mergeHeaders(
|
|
3159
3184
|
_authRequest.headers,
|
|
@@ -3168,7 +3193,7 @@ var AuthClient = class {
|
|
|
3168
3193
|
method: "POST",
|
|
3169
3194
|
headers: _headers,
|
|
3170
3195
|
contentType: "application/json",
|
|
3171
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
3196
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
3172
3197
|
requestType: "json",
|
|
3173
3198
|
body: _body,
|
|
3174
3199
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -3188,6 +3213,8 @@ var AuthClient = class {
|
|
|
3188
3213
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3189
3214
|
case 404:
|
|
3190
3215
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3216
|
+
case 429:
|
|
3217
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3191
3218
|
default:
|
|
3192
3219
|
throw new VectrosError({
|
|
3193
3220
|
statusCode: _response.error.statusCode,
|
|
@@ -3275,6 +3302,7 @@ var AuthClient = class {
|
|
|
3275
3302
|
*
|
|
3276
3303
|
* @throws {@link Vectros.ForbiddenError}
|
|
3277
3304
|
* @throws {@link Vectros.NotFoundError}
|
|
3305
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3278
3306
|
*
|
|
3279
3307
|
* @example
|
|
3280
3308
|
* await client.auth.updateAccessProfile({
|
|
@@ -3322,6 +3350,8 @@ var AuthClient = class {
|
|
|
3322
3350
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3323
3351
|
case 404:
|
|
3324
3352
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3353
|
+
case 429:
|
|
3354
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3325
3355
|
default:
|
|
3326
3356
|
throw new VectrosError({
|
|
3327
3357
|
statusCode: _response.error.statusCode,
|
|
@@ -3345,6 +3375,7 @@ var AuthClient = class {
|
|
|
3345
3375
|
*
|
|
3346
3376
|
* @throws {@link Vectros.ForbiddenError}
|
|
3347
3377
|
* @throws {@link Vectros.NotFoundError}
|
|
3378
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3348
3379
|
*
|
|
3349
3380
|
* @example
|
|
3350
3381
|
* await client.auth.deleteAccessProfile({
|
|
@@ -3386,6 +3417,8 @@ var AuthClient = class {
|
|
|
3386
3417
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3387
3418
|
case 404:
|
|
3388
3419
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3420
|
+
case 429:
|
|
3421
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3389
3422
|
default:
|
|
3390
3423
|
throw new VectrosError({
|
|
3391
3424
|
statusCode: _response.error.statusCode,
|
|
@@ -3467,6 +3500,7 @@ var AuthClient = class {
|
|
|
3467
3500
|
*
|
|
3468
3501
|
* @throws {@link Vectros.ForbiddenError}
|
|
3469
3502
|
* @throws {@link Vectros.NotFoundError}
|
|
3503
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3470
3504
|
*
|
|
3471
3505
|
* @example
|
|
3472
3506
|
* await client.auth.updateAppContext({
|
|
@@ -3514,6 +3548,8 @@ var AuthClient = class {
|
|
|
3514
3548
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3515
3549
|
case 404:
|
|
3516
3550
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3551
|
+
case 429:
|
|
3552
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3517
3553
|
default:
|
|
3518
3554
|
throw new VectrosError({
|
|
3519
3555
|
statusCode: _response.error.statusCode,
|
|
@@ -3533,6 +3569,7 @@ var AuthClient = class {
|
|
|
3533
3569
|
* @throws {@link Vectros.BadRequestError}
|
|
3534
3570
|
* @throws {@link Vectros.ForbiddenError}
|
|
3535
3571
|
* @throws {@link Vectros.NotFoundError}
|
|
3572
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3536
3573
|
*
|
|
3537
3574
|
* @example
|
|
3538
3575
|
* await client.auth.deleteAppContext({
|
|
@@ -3578,6 +3615,8 @@ var AuthClient = class {
|
|
|
3578
3615
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3579
3616
|
case 404:
|
|
3580
3617
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3618
|
+
case 429:
|
|
3619
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3581
3620
|
default:
|
|
3582
3621
|
throw new VectrosError({
|
|
3583
3622
|
statusCode: _response.error.statusCode,
|
|
@@ -3665,6 +3704,7 @@ var AuthClient = class {
|
|
|
3665
3704
|
*
|
|
3666
3705
|
* @throws {@link Vectros.ForbiddenError}
|
|
3667
3706
|
* @throws {@link Vectros.NotFoundError}
|
|
3707
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3668
3708
|
*
|
|
3669
3709
|
* @example
|
|
3670
3710
|
* await client.auth.updateRole({
|
|
@@ -3716,6 +3756,8 @@ var AuthClient = class {
|
|
|
3716
3756
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3717
3757
|
case 404:
|
|
3718
3758
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3759
|
+
case 429:
|
|
3760
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3719
3761
|
default:
|
|
3720
3762
|
throw new VectrosError({
|
|
3721
3763
|
statusCode: _response.error.statusCode,
|
|
@@ -3739,6 +3781,7 @@ var AuthClient = class {
|
|
|
3739
3781
|
*
|
|
3740
3782
|
* @throws {@link Vectros.ForbiddenError}
|
|
3741
3783
|
* @throws {@link Vectros.NotFoundError}
|
|
3784
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
3742
3785
|
*
|
|
3743
3786
|
* @example
|
|
3744
3787
|
* await client.auth.deleteRole({
|
|
@@ -3780,6 +3823,8 @@ var AuthClient = class {
|
|
|
3780
3823
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3781
3824
|
case 404:
|
|
3782
3825
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3826
|
+
case 429:
|
|
3827
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3783
3828
|
default:
|
|
3784
3829
|
throw new VectrosError({
|
|
3785
3830
|
statusCode: _response.error.statusCode,
|
|
@@ -4111,6 +4156,7 @@ var AuthClient = class {
|
|
|
4111
4156
|
*
|
|
4112
4157
|
* @throws {@link Vectros.BadRequestError}
|
|
4113
4158
|
* @throws {@link Vectros.ForbiddenError}
|
|
4159
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4114
4160
|
*
|
|
4115
4161
|
* @example
|
|
4116
4162
|
* await client.auth.mintToken({
|
|
@@ -4163,6 +4209,8 @@ var AuthClient = class {
|
|
|
4163
4209
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4164
4210
|
case 403:
|
|
4165
4211
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4212
|
+
case 429:
|
|
4213
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4166
4214
|
default:
|
|
4167
4215
|
throw new VectrosError({
|
|
4168
4216
|
statusCode: _response.error.statusCode,
|
|
@@ -4183,6 +4231,7 @@ var AuthClient = class {
|
|
|
4183
4231
|
* @throws {@link Vectros.ForbiddenError}
|
|
4184
4232
|
* @throws {@link Vectros.NotFoundError}
|
|
4185
4233
|
* @throws {@link Vectros.ConflictError}
|
|
4234
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4186
4235
|
*
|
|
4187
4236
|
* @example
|
|
4188
4237
|
* await client.auth.createInvite({
|
|
@@ -4231,6 +4280,8 @@ var AuthClient = class {
|
|
|
4231
4280
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4232
4281
|
case 409:
|
|
4233
4282
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4283
|
+
case 429:
|
|
4284
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4234
4285
|
default:
|
|
4235
4286
|
throw new VectrosError({
|
|
4236
4287
|
statusCode: _response.error.statusCode,
|
|
@@ -4250,6 +4301,7 @@ var AuthClient = class {
|
|
|
4250
4301
|
* @throws {@link Vectros.BadRequestError}
|
|
4251
4302
|
* @throws {@link Vectros.ForbiddenError}
|
|
4252
4303
|
* @throws {@link Vectros.NotFoundError}
|
|
4304
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4253
4305
|
*
|
|
4254
4306
|
* @example
|
|
4255
4307
|
* await client.auth.resendInvite({
|
|
@@ -4296,6 +4348,8 @@ var AuthClient = class {
|
|
|
4296
4348
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4297
4349
|
case 404:
|
|
4298
4350
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4351
|
+
case 429:
|
|
4352
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4299
4353
|
default:
|
|
4300
4354
|
throw new VectrosError({
|
|
4301
4355
|
statusCode: _response.error.statusCode,
|
|
@@ -4318,6 +4372,7 @@ var ComplianceClient = class {
|
|
|
4318
4372
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4319
4373
|
*
|
|
4320
4374
|
* @throws {@link Vectros.ForbiddenError}
|
|
4375
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4321
4376
|
* @throws {@link Vectros.NotImplementedError}
|
|
4322
4377
|
*
|
|
4323
4378
|
* @example
|
|
@@ -4359,6 +4414,8 @@ var ComplianceClient = class {
|
|
|
4359
4414
|
switch (_response.error.statusCode) {
|
|
4360
4415
|
case 403:
|
|
4361
4416
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4417
|
+
case 429:
|
|
4418
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4362
4419
|
case 501:
|
|
4363
4420
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
4364
4421
|
default:
|
|
@@ -4439,6 +4496,7 @@ var ComplianceClient = class {
|
|
|
4439
4496
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4440
4497
|
*
|
|
4441
4498
|
* @throws {@link Vectros.ForbiddenError}
|
|
4499
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4442
4500
|
* @throws {@link Vectros.NotImplementedError}
|
|
4443
4501
|
*
|
|
4444
4502
|
* @example
|
|
@@ -4478,6 +4536,8 @@ var ComplianceClient = class {
|
|
|
4478
4536
|
switch (_response.error.statusCode) {
|
|
4479
4537
|
case 403:
|
|
4480
4538
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4539
|
+
case 429:
|
|
4540
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4481
4541
|
case 501:
|
|
4482
4542
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
4483
4543
|
default:
|
|
@@ -4617,22 +4677,30 @@ var DocumentsClient = class {
|
|
|
4617
4677
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents");
|
|
4618
4678
|
}
|
|
4619
4679
|
/**
|
|
4620
|
-
* Creates a document from a raw text string and queues it for asynchronous indexing so it becomes searchable. Requires the `documents:c` scope.
|
|
4680
|
+
* 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.
|
|
4621
4681
|
*
|
|
4622
|
-
* @param {Vectros.
|
|
4682
|
+
* @param {Vectros.IngestDocumentRequest} request
|
|
4623
4683
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4624
4684
|
*
|
|
4625
4685
|
* @throws {@link Vectros.BadRequestError}
|
|
4686
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4687
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4626
4688
|
*
|
|
4627
4689
|
* @example
|
|
4628
4690
|
* await client.documents.ingestDocument({
|
|
4629
|
-
*
|
|
4691
|
+
* body: {
|
|
4692
|
+
* title: "Patient Intake Form \u2014 Jane Doe"
|
|
4693
|
+
* }
|
|
4630
4694
|
* })
|
|
4631
4695
|
*/
|
|
4632
4696
|
ingestDocument(request, requestOptions) {
|
|
4633
4697
|
return HttpResponsePromise.fromPromise(this.__ingestDocument(request, requestOptions));
|
|
4634
4698
|
}
|
|
4635
4699
|
async __ingestDocument(request, requestOptions) {
|
|
4700
|
+
const { upsert, body: _body } = request;
|
|
4701
|
+
const _queryParams = {
|
|
4702
|
+
upsert
|
|
4703
|
+
};
|
|
4636
4704
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4637
4705
|
const _headers = mergeHeaders(
|
|
4638
4706
|
_authRequest.headers,
|
|
@@ -4647,9 +4715,9 @@ var DocumentsClient = class {
|
|
|
4647
4715
|
method: "POST",
|
|
4648
4716
|
headers: _headers,
|
|
4649
4717
|
contentType: "application/json",
|
|
4650
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4718
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
4651
4719
|
requestType: "json",
|
|
4652
|
-
body:
|
|
4720
|
+
body: _body,
|
|
4653
4721
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4654
4722
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4655
4723
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -4663,6 +4731,10 @@ var DocumentsClient = class {
|
|
|
4663
4731
|
switch (_response.error.statusCode) {
|
|
4664
4732
|
case 400:
|
|
4665
4733
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4734
|
+
case 403:
|
|
4735
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4736
|
+
case 429:
|
|
4737
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4666
4738
|
default:
|
|
4667
4739
|
throw new VectrosError({
|
|
4668
4740
|
statusCode: _response.error.statusCode,
|
|
@@ -4737,6 +4809,7 @@ var DocumentsClient = class {
|
|
|
4737
4809
|
* @throws {@link Vectros.BadRequestError}
|
|
4738
4810
|
* @throws {@link Vectros.NotFoundError}
|
|
4739
4811
|
* @throws {@link Vectros.ConflictError}
|
|
4812
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4740
4813
|
*
|
|
4741
4814
|
* @example
|
|
4742
4815
|
* await client.documents.updateDocument({
|
|
@@ -4785,6 +4858,8 @@ var DocumentsClient = class {
|
|
|
4785
4858
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4786
4859
|
case 409:
|
|
4787
4860
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4861
|
+
case 429:
|
|
4862
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4788
4863
|
default:
|
|
4789
4864
|
throw new VectrosError({
|
|
4790
4865
|
statusCode: _response.error.statusCode,
|
|
@@ -4802,6 +4877,7 @@ var DocumentsClient = class {
|
|
|
4802
4877
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4803
4878
|
*
|
|
4804
4879
|
* @throws {@link Vectros.NotFoundError}
|
|
4880
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4805
4881
|
*
|
|
4806
4882
|
* @example
|
|
4807
4883
|
* await client.documents.deleteDocument({
|
|
@@ -4840,6 +4916,8 @@ var DocumentsClient = class {
|
|
|
4840
4916
|
switch (_response.error.statusCode) {
|
|
4841
4917
|
case 404:
|
|
4842
4918
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4919
|
+
case 429:
|
|
4920
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4843
4921
|
default:
|
|
4844
4922
|
throw new VectrosError({
|
|
4845
4923
|
statusCode: _response.error.statusCode,
|
|
@@ -4859,6 +4937,7 @@ var DocumentsClient = class {
|
|
|
4859
4937
|
* @throws {@link Vectros.BadRequestError}
|
|
4860
4938
|
* @throws {@link Vectros.NotFoundError}
|
|
4861
4939
|
* @throws {@link Vectros.ConflictError}
|
|
4940
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4862
4941
|
*
|
|
4863
4942
|
* @example
|
|
4864
4943
|
* await client.documents.patchDocument({
|
|
@@ -4907,6 +4986,8 @@ var DocumentsClient = class {
|
|
|
4907
4986
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4908
4987
|
case 409:
|
|
4909
4988
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4989
|
+
case 429:
|
|
4990
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4910
4991
|
default:
|
|
4911
4992
|
throw new VectrosError({
|
|
4912
4993
|
statusCode: _response.error.statusCode,
|
|
@@ -4918,7 +4999,7 @@ var DocumentsClient = class {
|
|
|
4918
4999
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v1/documents/{id}");
|
|
4919
5000
|
}
|
|
4920
5001
|
/**
|
|
4921
|
-
* Finds documents of a given type by
|
|
5002
|
+
* 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.
|
|
4922
5003
|
*
|
|
4923
5004
|
* @param {Vectros.LookupDocumentsRequest} request
|
|
4924
5005
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4987,6 +5068,7 @@ var DocumentsClient = class {
|
|
|
4987
5068
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4988
5069
|
*
|
|
4989
5070
|
* @throws {@link Vectros.BadRequestError}
|
|
5071
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4990
5072
|
*
|
|
4991
5073
|
* @example
|
|
4992
5074
|
* await client.documents.lookupDocumentsByBody({
|
|
@@ -5028,6 +5110,8 @@ var DocumentsClient = class {
|
|
|
5028
5110
|
switch (_response.error.statusCode) {
|
|
5029
5111
|
case 400:
|
|
5030
5112
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5113
|
+
case 429:
|
|
5114
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5031
5115
|
default:
|
|
5032
5116
|
throw new VectrosError({
|
|
5033
5117
|
statusCode: _response.error.statusCode,
|
|
@@ -5210,12 +5294,14 @@ var DocumentsClient = class {
|
|
|
5210
5294
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents/{id}/versions");
|
|
5211
5295
|
}
|
|
5212
5296
|
/**
|
|
5213
|
-
* 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.
|
|
5297
|
+
* 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.
|
|
5214
5298
|
*
|
|
5215
5299
|
* @param {Vectros.FileUploadRequest} request
|
|
5216
5300
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5217
5301
|
*
|
|
5218
5302
|
* @throws {@link Vectros.BadRequestError}
|
|
5303
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
5304
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5219
5305
|
*
|
|
5220
5306
|
* @example
|
|
5221
5307
|
* await client.documents.uploadDocument({
|
|
@@ -5227,6 +5313,10 @@ var DocumentsClient = class {
|
|
|
5227
5313
|
return HttpResponsePromise.fromPromise(this.__uploadDocument(request, requestOptions));
|
|
5228
5314
|
}
|
|
5229
5315
|
async __uploadDocument(request, requestOptions) {
|
|
5316
|
+
const { upsert, ..._body } = request;
|
|
5317
|
+
const _queryParams = {
|
|
5318
|
+
upsert
|
|
5319
|
+
};
|
|
5230
5320
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5231
5321
|
const _headers = mergeHeaders(
|
|
5232
5322
|
_authRequest.headers,
|
|
@@ -5241,9 +5331,9 @@ var DocumentsClient = class {
|
|
|
5241
5331
|
method: "POST",
|
|
5242
5332
|
headers: _headers,
|
|
5243
5333
|
contentType: "application/json",
|
|
5244
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5334
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5245
5335
|
requestType: "json",
|
|
5246
|
-
body:
|
|
5336
|
+
body: _body,
|
|
5247
5337
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5248
5338
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5249
5339
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5257,6 +5347,10 @@ var DocumentsClient = class {
|
|
|
5257
5347
|
switch (_response.error.statusCode) {
|
|
5258
5348
|
case 400:
|
|
5259
5349
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5350
|
+
case 403:
|
|
5351
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
5352
|
+
case 429:
|
|
5353
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5260
5354
|
default:
|
|
5261
5355
|
throw new VectrosError({
|
|
5262
5356
|
statusCode: _response.error.statusCode,
|
|
@@ -5333,22 +5427,30 @@ var FoldersClient = class {
|
|
|
5333
5427
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/folders");
|
|
5334
5428
|
}
|
|
5335
5429
|
/**
|
|
5336
|
-
* 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.
|
|
5430
|
+
* 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.
|
|
5337
5431
|
*
|
|
5338
|
-
* @param {Vectros.
|
|
5432
|
+
* @param {Vectros.CreateFolderRequest} request
|
|
5339
5433
|
* @param {FoldersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5340
5434
|
*
|
|
5341
5435
|
* @throws {@link Vectros.BadRequestError}
|
|
5436
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
5437
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5342
5438
|
*
|
|
5343
5439
|
* @example
|
|
5344
5440
|
* await client.folders.createFolder({
|
|
5345
|
-
*
|
|
5441
|
+
* body: {
|
|
5442
|
+
* name: "Patient Records 2024"
|
|
5443
|
+
* }
|
|
5346
5444
|
* })
|
|
5347
5445
|
*/
|
|
5348
5446
|
createFolder(request, requestOptions) {
|
|
5349
5447
|
return HttpResponsePromise.fromPromise(this.__createFolder(request, requestOptions));
|
|
5350
5448
|
}
|
|
5351
5449
|
async __createFolder(request, requestOptions) {
|
|
5450
|
+
const { upsert, body: _body } = request;
|
|
5451
|
+
const _queryParams = {
|
|
5452
|
+
upsert
|
|
5453
|
+
};
|
|
5352
5454
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5353
5455
|
const _headers = mergeHeaders(
|
|
5354
5456
|
_authRequest.headers,
|
|
@@ -5363,9 +5465,9 @@ var FoldersClient = class {
|
|
|
5363
5465
|
method: "POST",
|
|
5364
5466
|
headers: _headers,
|
|
5365
5467
|
contentType: "application/json",
|
|
5366
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5468
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5367
5469
|
requestType: "json",
|
|
5368
|
-
body:
|
|
5470
|
+
body: _body,
|
|
5369
5471
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5370
5472
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5371
5473
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5379,6 +5481,10 @@ var FoldersClient = class {
|
|
|
5379
5481
|
switch (_response.error.statusCode) {
|
|
5380
5482
|
case 400:
|
|
5381
5483
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5484
|
+
case 403:
|
|
5485
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
5486
|
+
case 429:
|
|
5487
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5382
5488
|
default:
|
|
5383
5489
|
throw new VectrosError({
|
|
5384
5490
|
statusCode: _response.error.statusCode,
|
|
@@ -5451,6 +5557,7 @@ var FoldersClient = class {
|
|
|
5451
5557
|
* @param {FoldersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5452
5558
|
*
|
|
5453
5559
|
* @throws {@link Vectros.NotFoundError}
|
|
5560
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5454
5561
|
*
|
|
5455
5562
|
* @example
|
|
5456
5563
|
* await client.folders.updateFolder({
|
|
@@ -5495,6 +5602,8 @@ var FoldersClient = class {
|
|
|
5495
5602
|
switch (_response.error.statusCode) {
|
|
5496
5603
|
case 404:
|
|
5497
5604
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5605
|
+
case 429:
|
|
5606
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5498
5607
|
default:
|
|
5499
5608
|
throw new VectrosError({
|
|
5500
5609
|
statusCode: _response.error.statusCode,
|
|
@@ -5513,6 +5622,7 @@ var FoldersClient = class {
|
|
|
5513
5622
|
*
|
|
5514
5623
|
* @throws {@link Vectros.BadRequestError}
|
|
5515
5624
|
* @throws {@link Vectros.NotFoundError}
|
|
5625
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5516
5626
|
*
|
|
5517
5627
|
* @example
|
|
5518
5628
|
* await client.folders.deleteFolder({
|
|
@@ -5553,6 +5663,8 @@ var FoldersClient = class {
|
|
|
5553
5663
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5554
5664
|
case 404:
|
|
5555
5665
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5666
|
+
case 429:
|
|
5667
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5556
5668
|
default:
|
|
5557
5669
|
throw new VectrosError({
|
|
5558
5670
|
statusCode: _response.error.statusCode,
|
|
@@ -5572,6 +5684,7 @@ var FoldersClient = class {
|
|
|
5572
5684
|
* @throws {@link Vectros.BadRequestError}
|
|
5573
5685
|
* @throws {@link Vectros.NotFoundError}
|
|
5574
5686
|
* @throws {@link Vectros.ConflictError}
|
|
5687
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5575
5688
|
*
|
|
5576
5689
|
* @example
|
|
5577
5690
|
* await client.folders.patchFolder({
|
|
@@ -5620,6 +5733,8 @@ var FoldersClient = class {
|
|
|
5620
5733
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5621
5734
|
case 409:
|
|
5622
5735
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
5736
|
+
case 429:
|
|
5737
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5623
5738
|
default:
|
|
5624
5739
|
throw new VectrosError({
|
|
5625
5740
|
statusCode: _response.error.statusCode,
|
|
@@ -5776,22 +5891,30 @@ var IdentityClient = class {
|
|
|
5776
5891
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/clients");
|
|
5777
5892
|
}
|
|
5778
5893
|
/**
|
|
5779
|
-
* 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.
|
|
5894
|
+
* 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.
|
|
5780
5895
|
*
|
|
5781
|
-
* @param {Vectros.
|
|
5896
|
+
* @param {Vectros.CreateClientRequest} request
|
|
5782
5897
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5783
5898
|
*
|
|
5784
5899
|
* @throws {@link Vectros.BadRequestError}
|
|
5900
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
5901
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5785
5902
|
*
|
|
5786
5903
|
* @example
|
|
5787
5904
|
* await client.identity.createClient({
|
|
5788
|
-
*
|
|
5905
|
+
* body: {
|
|
5906
|
+
* externalId: "patient_789"
|
|
5907
|
+
* }
|
|
5789
5908
|
* })
|
|
5790
5909
|
*/
|
|
5791
5910
|
createClient(request, requestOptions) {
|
|
5792
5911
|
return HttpResponsePromise.fromPromise(this.__createClient(request, requestOptions));
|
|
5793
5912
|
}
|
|
5794
5913
|
async __createClient(request, requestOptions) {
|
|
5914
|
+
const { upsert, body: _body } = request;
|
|
5915
|
+
const _queryParams = {
|
|
5916
|
+
upsert
|
|
5917
|
+
};
|
|
5795
5918
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5796
5919
|
const _headers = mergeHeaders(
|
|
5797
5920
|
_authRequest.headers,
|
|
@@ -5806,9 +5929,9 @@ var IdentityClient = class {
|
|
|
5806
5929
|
method: "POST",
|
|
5807
5930
|
headers: _headers,
|
|
5808
5931
|
contentType: "application/json",
|
|
5809
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5932
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5810
5933
|
requestType: "json",
|
|
5811
|
-
body:
|
|
5934
|
+
body: _body,
|
|
5812
5935
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5813
5936
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5814
5937
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5822,6 +5945,10 @@ var IdentityClient = class {
|
|
|
5822
5945
|
switch (_response.error.statusCode) {
|
|
5823
5946
|
case 400:
|
|
5824
5947
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5948
|
+
case 403:
|
|
5949
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
5950
|
+
case 429:
|
|
5951
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5825
5952
|
default:
|
|
5826
5953
|
throw new VectrosError({
|
|
5827
5954
|
statusCode: _response.error.statusCode,
|
|
@@ -5894,6 +6021,7 @@ var IdentityClient = class {
|
|
|
5894
6021
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5895
6022
|
*
|
|
5896
6023
|
* @throws {@link Vectros.NotFoundError}
|
|
6024
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5897
6025
|
*
|
|
5898
6026
|
* @example
|
|
5899
6027
|
* await client.identity.updateClient({
|
|
@@ -5938,6 +6066,8 @@ var IdentityClient = class {
|
|
|
5938
6066
|
switch (_response.error.statusCode) {
|
|
5939
6067
|
case 404:
|
|
5940
6068
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6069
|
+
case 429:
|
|
6070
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5941
6071
|
default:
|
|
5942
6072
|
throw new VectrosError({
|
|
5943
6073
|
statusCode: _response.error.statusCode,
|
|
@@ -5955,6 +6085,7 @@ var IdentityClient = class {
|
|
|
5955
6085
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5956
6086
|
*
|
|
5957
6087
|
* @throws {@link Vectros.NotFoundError}
|
|
6088
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
5958
6089
|
*
|
|
5959
6090
|
* @example
|
|
5960
6091
|
* await client.identity.deleteClient({
|
|
@@ -5993,6 +6124,8 @@ var IdentityClient = class {
|
|
|
5993
6124
|
switch (_response.error.statusCode) {
|
|
5994
6125
|
case 404:
|
|
5995
6126
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6127
|
+
case 429:
|
|
6128
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5996
6129
|
default:
|
|
5997
6130
|
throw new VectrosError({
|
|
5998
6131
|
statusCode: _response.error.statusCode,
|
|
@@ -6010,6 +6143,7 @@ var IdentityClient = class {
|
|
|
6010
6143
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6011
6144
|
*
|
|
6012
6145
|
* @throws {@link Vectros.BadRequestError}
|
|
6146
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6013
6147
|
*
|
|
6014
6148
|
* @example
|
|
6015
6149
|
* await client.identity.lookupClients({
|
|
@@ -6051,6 +6185,8 @@ var IdentityClient = class {
|
|
|
6051
6185
|
switch (_response.error.statusCode) {
|
|
6052
6186
|
case 400:
|
|
6053
6187
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6188
|
+
case 429:
|
|
6189
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6054
6190
|
default:
|
|
6055
6191
|
throw new VectrosError({
|
|
6056
6192
|
statusCode: _response.error.statusCode,
|
|
@@ -6199,22 +6335,30 @@ var IdentityClient = class {
|
|
|
6199
6335
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/orgs");
|
|
6200
6336
|
}
|
|
6201
6337
|
/**
|
|
6202
|
-
* 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.
|
|
6338
|
+
* 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.
|
|
6203
6339
|
*
|
|
6204
|
-
* @param {Vectros.
|
|
6340
|
+
* @param {Vectros.CreateOrgRequest} request
|
|
6205
6341
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6206
6342
|
*
|
|
6207
6343
|
* @throws {@link Vectros.BadRequestError}
|
|
6344
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
6345
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6208
6346
|
*
|
|
6209
6347
|
* @example
|
|
6210
6348
|
* await client.identity.createOrg({
|
|
6211
|
-
*
|
|
6349
|
+
* body: {
|
|
6350
|
+
* externalId: "clinic_001"
|
|
6351
|
+
* }
|
|
6212
6352
|
* })
|
|
6213
6353
|
*/
|
|
6214
6354
|
createOrg(request, requestOptions) {
|
|
6215
6355
|
return HttpResponsePromise.fromPromise(this.__createOrg(request, requestOptions));
|
|
6216
6356
|
}
|
|
6217
6357
|
async __createOrg(request, requestOptions) {
|
|
6358
|
+
const { upsert, body: _body } = request;
|
|
6359
|
+
const _queryParams = {
|
|
6360
|
+
upsert
|
|
6361
|
+
};
|
|
6218
6362
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6219
6363
|
const _headers = mergeHeaders(
|
|
6220
6364
|
_authRequest.headers,
|
|
@@ -6229,9 +6373,9 @@ var IdentityClient = class {
|
|
|
6229
6373
|
method: "POST",
|
|
6230
6374
|
headers: _headers,
|
|
6231
6375
|
contentType: "application/json",
|
|
6232
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6376
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6233
6377
|
requestType: "json",
|
|
6234
|
-
body:
|
|
6378
|
+
body: _body,
|
|
6235
6379
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6236
6380
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6237
6381
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6245,6 +6389,10 @@ var IdentityClient = class {
|
|
|
6245
6389
|
switch (_response.error.statusCode) {
|
|
6246
6390
|
case 400:
|
|
6247
6391
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6392
|
+
case 403:
|
|
6393
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6394
|
+
case 429:
|
|
6395
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6248
6396
|
default:
|
|
6249
6397
|
throw new VectrosError({
|
|
6250
6398
|
statusCode: _response.error.statusCode,
|
|
@@ -6317,6 +6465,7 @@ var IdentityClient = class {
|
|
|
6317
6465
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6318
6466
|
*
|
|
6319
6467
|
* @throws {@link Vectros.NotFoundError}
|
|
6468
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6320
6469
|
*
|
|
6321
6470
|
* @example
|
|
6322
6471
|
* await client.identity.updateOrg({
|
|
@@ -6361,6 +6510,8 @@ var IdentityClient = class {
|
|
|
6361
6510
|
switch (_response.error.statusCode) {
|
|
6362
6511
|
case 404:
|
|
6363
6512
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6513
|
+
case 429:
|
|
6514
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6364
6515
|
default:
|
|
6365
6516
|
throw new VectrosError({
|
|
6366
6517
|
statusCode: _response.error.statusCode,
|
|
@@ -6378,6 +6529,7 @@ var IdentityClient = class {
|
|
|
6378
6529
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6379
6530
|
*
|
|
6380
6531
|
* @throws {@link Vectros.NotFoundError}
|
|
6532
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6381
6533
|
*
|
|
6382
6534
|
* @example
|
|
6383
6535
|
* await client.identity.deleteOrg({
|
|
@@ -6416,6 +6568,8 @@ var IdentityClient = class {
|
|
|
6416
6568
|
switch (_response.error.statusCode) {
|
|
6417
6569
|
case 404:
|
|
6418
6570
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6571
|
+
case 429:
|
|
6572
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6419
6573
|
default:
|
|
6420
6574
|
throw new VectrosError({
|
|
6421
6575
|
statusCode: _response.error.statusCode,
|
|
@@ -6433,6 +6587,7 @@ var IdentityClient = class {
|
|
|
6433
6587
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6434
6588
|
*
|
|
6435
6589
|
* @throws {@link Vectros.BadRequestError}
|
|
6590
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6436
6591
|
*
|
|
6437
6592
|
* @example
|
|
6438
6593
|
* await client.identity.lookupOrgs({
|
|
@@ -6474,6 +6629,8 @@ var IdentityClient = class {
|
|
|
6474
6629
|
switch (_response.error.statusCode) {
|
|
6475
6630
|
case 400:
|
|
6476
6631
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6632
|
+
case 429:
|
|
6633
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6477
6634
|
default:
|
|
6478
6635
|
throw new VectrosError({
|
|
6479
6636
|
statusCode: _response.error.statusCode,
|
|
@@ -6608,22 +6765,30 @@ var IdentityClient = class {
|
|
|
6608
6765
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users");
|
|
6609
6766
|
}
|
|
6610
6767
|
/**
|
|
6611
|
-
* 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.
|
|
6768
|
+
* 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.
|
|
6612
6769
|
*
|
|
6613
|
-
* @param {Vectros.
|
|
6770
|
+
* @param {Vectros.CreateUserRequest} request
|
|
6614
6771
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6615
6772
|
*
|
|
6616
6773
|
* @throws {@link Vectros.BadRequestError}
|
|
6774
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
6775
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6617
6776
|
*
|
|
6618
6777
|
* @example
|
|
6619
6778
|
* await client.identity.createUser({
|
|
6620
|
-
*
|
|
6779
|
+
* body: {
|
|
6780
|
+
* externalId: "usr_12345"
|
|
6781
|
+
* }
|
|
6621
6782
|
* })
|
|
6622
6783
|
*/
|
|
6623
6784
|
createUser(request, requestOptions) {
|
|
6624
6785
|
return HttpResponsePromise.fromPromise(this.__createUser(request, requestOptions));
|
|
6625
6786
|
}
|
|
6626
6787
|
async __createUser(request, requestOptions) {
|
|
6788
|
+
const { upsert, body: _body } = request;
|
|
6789
|
+
const _queryParams = {
|
|
6790
|
+
upsert
|
|
6791
|
+
};
|
|
6627
6792
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6628
6793
|
const _headers = mergeHeaders(
|
|
6629
6794
|
_authRequest.headers,
|
|
@@ -6638,9 +6803,9 @@ var IdentityClient = class {
|
|
|
6638
6803
|
method: "POST",
|
|
6639
6804
|
headers: _headers,
|
|
6640
6805
|
contentType: "application/json",
|
|
6641
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6806
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6642
6807
|
requestType: "json",
|
|
6643
|
-
body:
|
|
6808
|
+
body: _body,
|
|
6644
6809
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6645
6810
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6646
6811
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6654,6 +6819,10 @@ var IdentityClient = class {
|
|
|
6654
6819
|
switch (_response.error.statusCode) {
|
|
6655
6820
|
case 400:
|
|
6656
6821
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6822
|
+
case 403:
|
|
6823
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6824
|
+
case 429:
|
|
6825
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6657
6826
|
default:
|
|
6658
6827
|
throw new VectrosError({
|
|
6659
6828
|
statusCode: _response.error.statusCode,
|
|
@@ -6726,6 +6895,7 @@ var IdentityClient = class {
|
|
|
6726
6895
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6727
6896
|
*
|
|
6728
6897
|
* @throws {@link Vectros.NotFoundError}
|
|
6898
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6729
6899
|
*
|
|
6730
6900
|
* @example
|
|
6731
6901
|
* await client.identity.updateUser({
|
|
@@ -6770,6 +6940,8 @@ var IdentityClient = class {
|
|
|
6770
6940
|
switch (_response.error.statusCode) {
|
|
6771
6941
|
case 404:
|
|
6772
6942
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6943
|
+
case 429:
|
|
6944
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6773
6945
|
default:
|
|
6774
6946
|
throw new VectrosError({
|
|
6775
6947
|
statusCode: _response.error.statusCode,
|
|
@@ -6787,6 +6959,7 @@ var IdentityClient = class {
|
|
|
6787
6959
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6788
6960
|
*
|
|
6789
6961
|
* @throws {@link Vectros.NotFoundError}
|
|
6962
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6790
6963
|
*
|
|
6791
6964
|
* @example
|
|
6792
6965
|
* await client.identity.deleteUser({
|
|
@@ -6825,6 +6998,8 @@ var IdentityClient = class {
|
|
|
6825
6998
|
switch (_response.error.statusCode) {
|
|
6826
6999
|
case 404:
|
|
6827
7000
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7001
|
+
case 429:
|
|
7002
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6828
7003
|
default:
|
|
6829
7004
|
throw new VectrosError({
|
|
6830
7005
|
statusCode: _response.error.statusCode,
|
|
@@ -6842,6 +7017,7 @@ var IdentityClient = class {
|
|
|
6842
7017
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6843
7018
|
*
|
|
6844
7019
|
* @throws {@link Vectros.BadRequestError}
|
|
7020
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
6845
7021
|
*
|
|
6846
7022
|
* @example
|
|
6847
7023
|
* await client.identity.lookupUsers({
|
|
@@ -6883,6 +7059,8 @@ var IdentityClient = class {
|
|
|
6883
7059
|
switch (_response.error.statusCode) {
|
|
6884
7060
|
case 400:
|
|
6885
7061
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7062
|
+
case 429:
|
|
7063
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6886
7064
|
default:
|
|
6887
7065
|
throw new VectrosError({
|
|
6888
7066
|
statusCode: _response.error.statusCode,
|
|
@@ -7219,6 +7397,7 @@ var RecordsClient = class {
|
|
|
7219
7397
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7220
7398
|
*
|
|
7221
7399
|
* @throws {@link Vectros.ForbiddenError}
|
|
7400
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7222
7401
|
* @throws {@link Vectros.NotImplementedError}
|
|
7223
7402
|
*
|
|
7224
7403
|
* @example
|
|
@@ -7258,6 +7437,8 @@ var RecordsClient = class {
|
|
|
7258
7437
|
switch (_response.error.statusCode) {
|
|
7259
7438
|
case 403:
|
|
7260
7439
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7440
|
+
case 429:
|
|
7441
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7261
7442
|
case 501:
|
|
7262
7443
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
7263
7444
|
default:
|
|
@@ -7277,6 +7458,7 @@ var RecordsClient = class {
|
|
|
7277
7458
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7278
7459
|
*
|
|
7279
7460
|
* @throws {@link Vectros.ForbiddenError}
|
|
7461
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7280
7462
|
* @throws {@link Vectros.NotImplementedError}
|
|
7281
7463
|
*
|
|
7282
7464
|
* @example
|
|
@@ -7316,6 +7498,8 @@ var RecordsClient = class {
|
|
|
7316
7498
|
switch (_response.error.statusCode) {
|
|
7317
7499
|
case 403:
|
|
7318
7500
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7501
|
+
case 429:
|
|
7502
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7319
7503
|
case 501:
|
|
7320
7504
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
7321
7505
|
default:
|
|
@@ -7335,6 +7519,7 @@ var RecordsClient = class {
|
|
|
7335
7519
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7336
7520
|
*
|
|
7337
7521
|
* @throws {@link Vectros.ForbiddenError}
|
|
7522
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7338
7523
|
* @throws {@link Vectros.NotImplementedError}
|
|
7339
7524
|
*
|
|
7340
7525
|
* @example
|
|
@@ -7374,6 +7559,8 @@ var RecordsClient = class {
|
|
|
7374
7559
|
switch (_response.error.statusCode) {
|
|
7375
7560
|
case 403:
|
|
7376
7561
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7562
|
+
case 429:
|
|
7563
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7377
7564
|
case 501:
|
|
7378
7565
|
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
7379
7566
|
default:
|
|
@@ -7451,29 +7638,36 @@ var RecordsClient = class {
|
|
|
7451
7638
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/records");
|
|
7452
7639
|
}
|
|
7453
7640
|
/**
|
|
7454
|
-
* 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.
|
|
7641
|
+
* 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.
|
|
7455
7642
|
*
|
|
7456
|
-
* @param {Vectros.
|
|
7643
|
+
* @param {Vectros.CreateRecordRequest} request
|
|
7457
7644
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7458
7645
|
*
|
|
7459
7646
|
* @throws {@link Vectros.BadRequestError}
|
|
7460
7647
|
* @throws {@link Vectros.ForbiddenError}
|
|
7648
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7461
7649
|
*
|
|
7462
7650
|
* @example
|
|
7463
7651
|
* await client.records.createRecord({
|
|
7464
|
-
*
|
|
7465
|
-
*
|
|
7466
|
-
*
|
|
7467
|
-
*
|
|
7468
|
-
*
|
|
7469
|
-
*
|
|
7470
|
-
*
|
|
7652
|
+
* body: {
|
|
7653
|
+
* typeName: "intake_form",
|
|
7654
|
+
* schemaId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
7655
|
+
* payload: {
|
|
7656
|
+
* "first_name": "Jane",
|
|
7657
|
+
* "email": "jane@example.com"
|
|
7658
|
+
* },
|
|
7659
|
+
* folderId: "f47ac10b-58cc-4372-a567-0e02b2c3d479"
|
|
7660
|
+
* }
|
|
7471
7661
|
* })
|
|
7472
7662
|
*/
|
|
7473
7663
|
createRecord(request, requestOptions) {
|
|
7474
7664
|
return HttpResponsePromise.fromPromise(this.__createRecord(request, requestOptions));
|
|
7475
7665
|
}
|
|
7476
7666
|
async __createRecord(request, requestOptions) {
|
|
7667
|
+
const { upsert, body: _body } = request;
|
|
7668
|
+
const _queryParams = {
|
|
7669
|
+
upsert
|
|
7670
|
+
};
|
|
7477
7671
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
7478
7672
|
const _headers = mergeHeaders(
|
|
7479
7673
|
_authRequest.headers,
|
|
@@ -7488,9 +7682,9 @@ var RecordsClient = class {
|
|
|
7488
7682
|
method: "POST",
|
|
7489
7683
|
headers: _headers,
|
|
7490
7684
|
contentType: "application/json",
|
|
7491
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
7685
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
7492
7686
|
requestType: "json",
|
|
7493
|
-
body:
|
|
7687
|
+
body: _body,
|
|
7494
7688
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
7495
7689
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
7496
7690
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -7506,6 +7700,8 @@ var RecordsClient = class {
|
|
|
7506
7700
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7507
7701
|
case 403:
|
|
7508
7702
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7703
|
+
case 429:
|
|
7704
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7509
7705
|
default:
|
|
7510
7706
|
throw new VectrosError({
|
|
7511
7707
|
statusCode: _response.error.statusCode,
|
|
@@ -7580,6 +7776,7 @@ var RecordsClient = class {
|
|
|
7580
7776
|
* @throws {@link Vectros.BadRequestError}
|
|
7581
7777
|
* @throws {@link Vectros.NotFoundError}
|
|
7582
7778
|
* @throws {@link Vectros.ConflictError}
|
|
7779
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7583
7780
|
*
|
|
7584
7781
|
* @example
|
|
7585
7782
|
* await client.records.updateRecord({
|
|
@@ -7626,6 +7823,8 @@ var RecordsClient = class {
|
|
|
7626
7823
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7627
7824
|
case 409:
|
|
7628
7825
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
7826
|
+
case 429:
|
|
7827
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7629
7828
|
default:
|
|
7630
7829
|
throw new VectrosError({
|
|
7631
7830
|
statusCode: _response.error.statusCode,
|
|
@@ -7643,6 +7842,7 @@ var RecordsClient = class {
|
|
|
7643
7842
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7644
7843
|
*
|
|
7645
7844
|
* @throws {@link Vectros.NotFoundError}
|
|
7845
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7646
7846
|
*
|
|
7647
7847
|
* @example
|
|
7648
7848
|
* await client.records.deleteRecord({
|
|
@@ -7681,6 +7881,8 @@ var RecordsClient = class {
|
|
|
7681
7881
|
switch (_response.error.statusCode) {
|
|
7682
7882
|
case 404:
|
|
7683
7883
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7884
|
+
case 429:
|
|
7885
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7684
7886
|
default:
|
|
7685
7887
|
throw new VectrosError({
|
|
7686
7888
|
statusCode: _response.error.statusCode,
|
|
@@ -7700,6 +7902,7 @@ var RecordsClient = class {
|
|
|
7700
7902
|
* @throws {@link Vectros.BadRequestError}
|
|
7701
7903
|
* @throws {@link Vectros.NotFoundError}
|
|
7702
7904
|
* @throws {@link Vectros.ConflictError}
|
|
7905
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7703
7906
|
*
|
|
7704
7907
|
* @example
|
|
7705
7908
|
* await client.records.patchRecord({
|
|
@@ -7751,6 +7954,8 @@ var RecordsClient = class {
|
|
|
7751
7954
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7752
7955
|
case 409:
|
|
7753
7956
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
7957
|
+
case 429:
|
|
7958
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7754
7959
|
default:
|
|
7755
7960
|
throw new VectrosError({
|
|
7756
7961
|
statusCode: _response.error.statusCode,
|
|
@@ -7839,6 +8044,7 @@ var RecordsClient = class {
|
|
|
7839
8044
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7840
8045
|
*
|
|
7841
8046
|
* @throws {@link Vectros.BadRequestError}
|
|
8047
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
7842
8048
|
*
|
|
7843
8049
|
* @example
|
|
7844
8050
|
* await client.records.lookupRecordsByBody({
|
|
@@ -7880,6 +8086,8 @@ var RecordsClient = class {
|
|
|
7880
8086
|
switch (_response.error.statusCode) {
|
|
7881
8087
|
case 400:
|
|
7882
8088
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8089
|
+
case 429:
|
|
8090
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7883
8091
|
default:
|
|
7884
8092
|
throw new VectrosError({
|
|
7885
8093
|
statusCode: _response.error.statusCode,
|
|
@@ -8072,42 +8280,50 @@ var SchemasClient = class {
|
|
|
8072
8280
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/schemas");
|
|
8073
8281
|
}
|
|
8074
8282
|
/**
|
|
8075
|
-
* 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.
|
|
8283
|
+
* 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.
|
|
8076
8284
|
*
|
|
8077
|
-
* @param {Vectros.
|
|
8285
|
+
* @param {Vectros.CreateSchemaRequest} request
|
|
8078
8286
|
* @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8079
8287
|
*
|
|
8080
8288
|
* @throws {@link Vectros.BadRequestError}
|
|
8289
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
8290
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8081
8291
|
*
|
|
8082
8292
|
* @example
|
|
8083
8293
|
* await client.schemas.createSchema({
|
|
8084
|
-
*
|
|
8085
|
-
*
|
|
8086
|
-
*
|
|
8087
|
-
*
|
|
8088
|
-
*
|
|
8089
|
-
*
|
|
8090
|
-
*
|
|
8091
|
-
*
|
|
8092
|
-
*
|
|
8093
|
-
*
|
|
8094
|
-
*
|
|
8095
|
-
*
|
|
8096
|
-
*
|
|
8097
|
-
*
|
|
8098
|
-
*
|
|
8099
|
-
*
|
|
8100
|
-
*
|
|
8101
|
-
*
|
|
8102
|
-
*
|
|
8103
|
-
*
|
|
8104
|
-
*
|
|
8294
|
+
* body: {
|
|
8295
|
+
* typeName: "intake_form",
|
|
8296
|
+
* displayName: "Client Intake Form",
|
|
8297
|
+
* description: "Captures initial client information",
|
|
8298
|
+
* fields: [{
|
|
8299
|
+
* fieldId: "first_name",
|
|
8300
|
+
* fieldType: "string",
|
|
8301
|
+
* required: true,
|
|
8302
|
+
* searchable: true
|
|
8303
|
+
* }, {
|
|
8304
|
+
* fieldId: "email",
|
|
8305
|
+
* fieldType: "string",
|
|
8306
|
+
* required: true
|
|
8307
|
+
* }],
|
|
8308
|
+
* lookupFields: [{
|
|
8309
|
+
* fieldName: "email",
|
|
8310
|
+
* unique: true
|
|
8311
|
+
* }],
|
|
8312
|
+
* capabilities: {
|
|
8313
|
+
* "auditHistory": true
|
|
8314
|
+
* },
|
|
8315
|
+
* allowedSurfaces: ["record"]
|
|
8316
|
+
* }
|
|
8105
8317
|
* })
|
|
8106
8318
|
*/
|
|
8107
8319
|
createSchema(request, requestOptions) {
|
|
8108
8320
|
return HttpResponsePromise.fromPromise(this.__createSchema(request, requestOptions));
|
|
8109
8321
|
}
|
|
8110
8322
|
async __createSchema(request, requestOptions) {
|
|
8323
|
+
const { upsert, body: _body } = request;
|
|
8324
|
+
const _queryParams = {
|
|
8325
|
+
upsert
|
|
8326
|
+
};
|
|
8111
8327
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
8112
8328
|
const _headers = mergeHeaders(
|
|
8113
8329
|
_authRequest.headers,
|
|
@@ -8122,9 +8338,9 @@ var SchemasClient = class {
|
|
|
8122
8338
|
method: "POST",
|
|
8123
8339
|
headers: _headers,
|
|
8124
8340
|
contentType: "application/json",
|
|
8125
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
8341
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
8126
8342
|
requestType: "json",
|
|
8127
|
-
body:
|
|
8343
|
+
body: _body,
|
|
8128
8344
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
8129
8345
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
8130
8346
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -8138,6 +8354,10 @@ var SchemasClient = class {
|
|
|
8138
8354
|
switch (_response.error.statusCode) {
|
|
8139
8355
|
case 400:
|
|
8140
8356
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8357
|
+
case 403:
|
|
8358
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
8359
|
+
case 429:
|
|
8360
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8141
8361
|
default:
|
|
8142
8362
|
throw new VectrosError({
|
|
8143
8363
|
statusCode: _response.error.statusCode,
|
|
@@ -8211,6 +8431,7 @@ var SchemasClient = class {
|
|
|
8211
8431
|
*
|
|
8212
8432
|
* @throws {@link Vectros.BadRequestError}
|
|
8213
8433
|
* @throws {@link Vectros.NotFoundError}
|
|
8434
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8214
8435
|
*
|
|
8215
8436
|
* @example
|
|
8216
8437
|
* await client.schemas.updateSchema({
|
|
@@ -8259,6 +8480,8 @@ var SchemasClient = class {
|
|
|
8259
8480
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8260
8481
|
case 404:
|
|
8261
8482
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
8483
|
+
case 429:
|
|
8484
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8262
8485
|
default:
|
|
8263
8486
|
throw new VectrosError({
|
|
8264
8487
|
statusCode: _response.error.statusCode,
|
|
@@ -8277,6 +8500,7 @@ var SchemasClient = class {
|
|
|
8277
8500
|
*
|
|
8278
8501
|
* @throws {@link Vectros.NotFoundError}
|
|
8279
8502
|
* @throws {@link Vectros.ConflictError}
|
|
8503
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8280
8504
|
*
|
|
8281
8505
|
* @example
|
|
8282
8506
|
* await client.schemas.deleteSchema({
|
|
@@ -8317,6 +8541,8 @@ var SchemasClient = class {
|
|
|
8317
8541
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
8318
8542
|
case 409:
|
|
8319
8543
|
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
8544
|
+
case 429:
|
|
8545
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8320
8546
|
default:
|
|
8321
8547
|
throw new VectrosError({
|
|
8322
8548
|
statusCode: _response.error.statusCode,
|
|
@@ -8398,6 +8624,7 @@ var SearchClient = class {
|
|
|
8398
8624
|
*
|
|
8399
8625
|
* @throws {@link Vectros.BadRequestError}
|
|
8400
8626
|
* @throws {@link Vectros.ForbiddenError}
|
|
8627
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
8401
8628
|
*
|
|
8402
8629
|
* @example
|
|
8403
8630
|
* await client.search.content({
|
|
@@ -8440,6 +8667,8 @@ var SearchClient = class {
|
|
|
8440
8667
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8441
8668
|
case 403:
|
|
8442
8669
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
8670
|
+
case 429:
|
|
8671
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8443
8672
|
default:
|
|
8444
8673
|
throw new VectrosError({
|
|
8445
8674
|
statusCode: _response.error.statusCode,
|
|
@@ -8561,8 +8790,8 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
8561
8790
|
|
|
8562
8791
|
// src/build-info.ts
|
|
8563
8792
|
var BUILD_INFO = {
|
|
8564
|
-
mcpServer: true ? "0.5.
|
|
8565
|
-
sdk: true ? "0.
|
|
8793
|
+
mcpServer: true ? "0.5.3" : "dev",
|
|
8794
|
+
sdk: true ? "0.31.0" : "dev"
|
|
8566
8795
|
};
|
|
8567
8796
|
|
|
8568
8797
|
// src/log.ts
|
|
@@ -9062,15 +9291,17 @@ var recordCreate = ({ client, log }) => ({
|
|
|
9062
9291
|
const type = args.type;
|
|
9063
9292
|
try {
|
|
9064
9293
|
const created = await client.records.createRecord({
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9294
|
+
body: {
|
|
9295
|
+
typeName: type,
|
|
9296
|
+
payload: args.fields,
|
|
9297
|
+
externalId: args.externalId,
|
|
9298
|
+
indexMode: args.indexMode,
|
|
9299
|
+
status: args.status,
|
|
9300
|
+
folderId: args.folderId,
|
|
9301
|
+
userId: args.userId,
|
|
9302
|
+
orgId: args.orgId,
|
|
9303
|
+
clientId: args.clientId
|
|
9304
|
+
}
|
|
9074
9305
|
});
|
|
9075
9306
|
log.debug({ tool: "record_create", type, id: created.id }, "record_create ok");
|
|
9076
9307
|
return { content: [{ type: "text", text: JSON.stringify(created, null, 2) }] };
|
|
@@ -9712,13 +9943,15 @@ var folderCreate = ({ client, log }) => ({
|
|
|
9712
9943
|
handler: async (args) => {
|
|
9713
9944
|
try {
|
|
9714
9945
|
const folder = await client.folders.createFolder({
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9946
|
+
body: {
|
|
9947
|
+
name: args.name,
|
|
9948
|
+
description: args.description,
|
|
9949
|
+
parentFolderId: args.parentId,
|
|
9950
|
+
slug: args.slug,
|
|
9951
|
+
userId: args.userId,
|
|
9952
|
+
orgId: args.orgId,
|
|
9953
|
+
clientId: args.clientId
|
|
9954
|
+
}
|
|
9722
9955
|
});
|
|
9723
9956
|
log.debug({ tool: "folder_create", id: folder.id, name: folder.name }, "folder_create ok");
|
|
9724
9957
|
return { content: [{ type: "text", text: JSON.stringify(folder, null, 2) }] };
|
|
@@ -9972,11 +10205,13 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
9972
10205
|
if (text) {
|
|
9973
10206
|
const storeText = args.storeText ?? true;
|
|
9974
10207
|
const result = await client.documents.ingestDocument({
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
10208
|
+
body: {
|
|
10209
|
+
title,
|
|
10210
|
+
text,
|
|
10211
|
+
indexMode,
|
|
10212
|
+
storeText,
|
|
10213
|
+
...common
|
|
10214
|
+
}
|
|
9980
10215
|
});
|
|
9981
10216
|
log.debug(
|
|
9982
10217
|
{ tool: "document_ingest", mode: "text", id: result?.id, indexMode },
|