@scalekit-sdk/node 2.2.0-beta.0 → 2.2.0-beta.2
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/lib/connected-accounts.d.ts +24 -1
- package/lib/connected-accounts.js +55 -0
- package/lib/connected-accounts.js.map +1 -1
- package/lib/core.js +2 -2
- package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_connect.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/auth_connect.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.d.ts +32 -0
- package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.js +40 -2
- package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/passwordless_connect.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/passwordless_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_connect.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_connect.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.d.ts +4 -0
- package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.js +2 -1
- package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/directories/directories_connect.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/directories/directories_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/domains/domains_connect.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/domains/domains_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/errdetails/errdetails_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/options/options_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_connect.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/roles/roles_connect.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/roles/roles_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/sessions/sessions_connect.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/sessions/sessions_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/tools/tools_connect.d.ts +10 -1
- package/lib/pkg/grpc/scalekit/v1/tools/tools_connect.js +10 -1
- package/lib/pkg/grpc/scalekit/v1/tools/tools_connect.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/tools/tools_pb.d.ts +54 -0
- package/lib/pkg/grpc/scalekit/v1/tools/tools_pb.js +89 -2
- package/lib/pkg/grpc/scalekit/v1/tools/tools_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/users/users_connect.d.ts +10 -1
- package/lib/pkg/grpc/scalekit/v1/users/users_connect.js +10 -1
- package/lib/pkg/grpc/scalekit/v1/users/users_connect.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/users/users_pb.d.ts +17 -0
- package/lib/pkg/grpc/scalekit/v1/users/users_pb.js +33 -2
- package/lib/pkg/grpc/scalekit/v1/users/users_pb.js.map +1 -1
- package/lib/tools.d.ts +22 -5
- package/lib/tools.js +30 -5
- package/lib/tools.js.map +1 -1
- package/package.json +1 -1
- package/reference.md +71 -0
- package/src/connected-accounts.ts +75 -0
- package/src/core.ts +2 -2
- package/src/pkg/grpc/scalekit/v1/auditlogs/auditlogs_connect.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/auditlogs/auditlogs_pb.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/auth/auth_connect.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/auth/auth_pb.ts +57 -1
- package/src/pkg/grpc/scalekit/v1/auth/passwordless_connect.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/auth/passwordless_pb.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/auth/webauthn_connect.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/auth/webauthn_pb.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/commons/commons_pb.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_connect.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_pb.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/connections/connections_connect.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/connections/connections_pb.ts +7 -1
- package/src/pkg/grpc/scalekit/v1/directories/directories_connect.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/directories/directories_pb.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/domains/domains_connect.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/domains/domains_pb.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/errdetails/errdetails_pb.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/options/options_pb.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/organizations/organizations_connect.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/organizations/organizations_pb.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/roles/roles_connect.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/roles/roles_pb.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/sessions/sessions_connect.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/sessions/sessions_pb.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/tools/tools_connect.ts +11 -2
- package/src/pkg/grpc/scalekit/v1/tools/tools_pb.ts +105 -1
- package/src/pkg/grpc/scalekit/v1/users/users_connect.ts +11 -2
- package/src/pkg/grpc/scalekit/v1/users/users_pb.ts +38 -1
- package/src/tools.ts +44 -7
- package/tests/connected-accounts.test.ts +38 -0
- package/tests/tools.test.ts +46 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.10.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/auth/auth.proto (package scalekit.v1.auth, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -468,6 +468,48 @@ export class GetAuthCustomizationsRequest extends Message<GetAuthCustomizationsR
|
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
|
|
471
|
+
/**
|
|
472
|
+
* PortalSettings contains feature flags and settings derived from the workspace's billing subscription
|
|
473
|
+
*
|
|
474
|
+
* @generated from message scalekit.v1.auth.PortalSettings
|
|
475
|
+
*/
|
|
476
|
+
export class PortalSettings extends Message<PortalSettings> {
|
|
477
|
+
/**
|
|
478
|
+
* custom_branding indicates whether the workspace has the Customization billing item enabled,
|
|
479
|
+
* allowing custom portal branding (logos, colors, etc.)
|
|
480
|
+
*
|
|
481
|
+
* @generated from field: bool custom_branding = 1;
|
|
482
|
+
*/
|
|
483
|
+
customBranding = false;
|
|
484
|
+
|
|
485
|
+
constructor(data?: PartialMessage<PortalSettings>) {
|
|
486
|
+
super();
|
|
487
|
+
proto3.util.initPartial(data, this);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
491
|
+
static readonly typeName = "scalekit.v1.auth.PortalSettings";
|
|
492
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
493
|
+
{ no: 1, name: "custom_branding", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
|
|
494
|
+
]);
|
|
495
|
+
|
|
496
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): PortalSettings {
|
|
497
|
+
return new PortalSettings().fromBinary(bytes, options);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): PortalSettings {
|
|
501
|
+
return new PortalSettings().fromJson(jsonValue, options);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): PortalSettings {
|
|
505
|
+
return new PortalSettings().fromJsonString(jsonString, options);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
static equals(a: PortalSettings | PlainMessage<PortalSettings> | undefined, b: PortalSettings | PlainMessage<PortalSettings> | undefined): boolean {
|
|
509
|
+
return proto3.util.equals(PortalSettings, a, b);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
|
|
471
513
|
/**
|
|
472
514
|
* @generated from message scalekit.v1.auth.GetAuthCustomizationsResponse
|
|
473
515
|
*/
|
|
@@ -477,6 +519,13 @@ export class GetAuthCustomizationsResponse extends Message<GetAuthCustomizations
|
|
|
477
519
|
*/
|
|
478
520
|
customizationSettings?: Struct;
|
|
479
521
|
|
|
522
|
+
/**
|
|
523
|
+
* settings contains feature flags derived from the workspace's billing subscription
|
|
524
|
+
*
|
|
525
|
+
* @generated from field: scalekit.v1.auth.PortalSettings settings = 3;
|
|
526
|
+
*/
|
|
527
|
+
settings?: PortalSettings;
|
|
528
|
+
|
|
480
529
|
constructor(data?: PartialMessage<GetAuthCustomizationsResponse>) {
|
|
481
530
|
super();
|
|
482
531
|
proto3.util.initPartial(data, this);
|
|
@@ -486,6 +535,7 @@ export class GetAuthCustomizationsResponse extends Message<GetAuthCustomizations
|
|
|
486
535
|
static readonly typeName = "scalekit.v1.auth.GetAuthCustomizationsResponse";
|
|
487
536
|
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
488
537
|
{ no: 2, name: "customization_settings", kind: "message", T: Struct },
|
|
538
|
+
{ no: 3, name: "settings", kind: "message", T: PortalSettings },
|
|
489
539
|
]);
|
|
490
540
|
|
|
491
541
|
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetAuthCustomizationsResponse {
|
|
@@ -1047,6 +1097,11 @@ export class User extends Message<User> {
|
|
|
1047
1097
|
*/
|
|
1048
1098
|
customAttributes?: Struct;
|
|
1049
1099
|
|
|
1100
|
+
/**
|
|
1101
|
+
* @generated from field: optional string organization_external_id = 15;
|
|
1102
|
+
*/
|
|
1103
|
+
organizationExternalId?: string;
|
|
1104
|
+
|
|
1050
1105
|
constructor(data?: PartialMessage<User>) {
|
|
1051
1106
|
super();
|
|
1052
1107
|
proto3.util.initPartial(data, this);
|
|
@@ -1069,6 +1124,7 @@ export class User extends Message<User> {
|
|
|
1069
1124
|
{ no: 12, name: "locale", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
1070
1125
|
{ no: 13, name: "groups", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
|
|
1071
1126
|
{ no: 14, name: "custom_attributes", kind: "message", T: Struct },
|
|
1127
|
+
{ no: 15, name: "organization_external_id", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
1072
1128
|
]);
|
|
1073
1129
|
|
|
1074
1130
|
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): User {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-connect-es v1.
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.7.0 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/auth/passwordless.proto (package scalekit.v1.auth.passwordless, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.10.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/auth/passwordless.proto (package scalekit.v1.auth.passwordless, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-connect-es v1.
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.7.0 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/auth/webauthn.proto (package scalekit.v1.auth.webauthn, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.10.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/auth/webauthn.proto (package scalekit.v1.auth.webauthn, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.10.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/commons/commons.proto (package scalekit.v1.commons, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-connect-es v1.
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.7.0 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/connected_accounts/connected_accounts.proto (package scalekit.v1.connected_accounts, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.10.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/connected_accounts/connected_accounts.proto (package scalekit.v1.connected_accounts, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-connect-es v1.
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.7.0 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/connections/connections.proto (package scalekit.v1.connections, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.10.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/connections/connections.proto (package scalekit.v1.connections, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -2254,6 +2254,11 @@ export class OAuthConnectionConfig extends Message<OAuthConnectionConfig> {
|
|
|
2254
2254
|
*/
|
|
2255
2255
|
syncUserProfileOnLogin?: boolean;
|
|
2256
2256
|
|
|
2257
|
+
/**
|
|
2258
|
+
* @generated from field: google.protobuf.StringValue token_access_type = 19;
|
|
2259
|
+
*/
|
|
2260
|
+
tokenAccessType?: string;
|
|
2261
|
+
|
|
2257
2262
|
constructor(data?: PartialMessage<OAuthConnectionConfig>) {
|
|
2258
2263
|
super();
|
|
2259
2264
|
proto3.util.initPartial(data, this);
|
|
@@ -2275,6 +2280,7 @@ export class OAuthConnectionConfig extends Message<OAuthConnectionConfig> {
|
|
|
2275
2280
|
{ no: 16, name: "access_type", kind: "message", T: StringValue },
|
|
2276
2281
|
{ no: 17, name: "custom_scope_name", kind: "message", T: StringValue },
|
|
2277
2282
|
{ no: 18, name: "sync_user_profile_on_login", kind: "message", T: BoolValue },
|
|
2283
|
+
{ no: 19, name: "token_access_type", kind: "message", T: StringValue },
|
|
2278
2284
|
]);
|
|
2279
2285
|
|
|
2280
2286
|
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): OAuthConnectionConfig {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-connect-es v1.
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.7.0 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/directories/directories.proto (package scalekit.v1.directories, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.10.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/directories/directories.proto (package scalekit.v1.directories, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-connect-es v1.
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.7.0 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/domains/domains.proto (package scalekit.v1.domains, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.10.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/domains/domains.proto (package scalekit.v1.domains, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.10.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/errdetails/errdetails.proto (package scalekit.v1.errdetails, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.10.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/options/options.proto (package scalekit.v1.options, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-connect-es v1.
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.7.0 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/organizations/organizations.proto (package scalekit.v1.organizations, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.10.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/organizations/organizations.proto (package scalekit.v1.organizations, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-connect-es v1.
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.7.0 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/roles/roles.proto (package scalekit.v1.roles, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.10.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/roles/roles.proto (package scalekit.v1.roles, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-connect-es v1.
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.7.0 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/sessions/sessions.proto (package scalekit.v1.sessions, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.10.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/sessions/sessions.proto (package scalekit.v1.sessions, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// @generated by protoc-gen-connect-es v1.
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.7.0 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/tools/tools.proto (package scalekit.v1.tools, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
5
5
|
|
|
6
|
-
import { CreateToolRequest, CreateToolResponse, DeleteToolRequest, ExecuteToolRequest, ExecuteToolResponse, ListScopedToolsRequest, ListScopedToolsResponse, ListToolsRequest, ListToolsResponse, SetToolDefaultRequest, SetToolDefaultResponse, UpdateToolRequest, UpdateToolResponse } from "./tools_pb.js";
|
|
6
|
+
import { CreateToolRequest, CreateToolResponse, DeleteToolRequest, ExecuteToolRequest, ExecuteToolResponse, ListAvailableToolsRequest, ListAvailableToolsResponse, ListScopedToolsRequest, ListScopedToolsResponse, ListToolsRequest, ListToolsResponse, SetToolDefaultRequest, SetToolDefaultResponse, UpdateToolRequest, UpdateToolResponse } from "./tools_pb.js";
|
|
7
7
|
import { Empty, MethodKind } from "@bufbuild/protobuf";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -39,6 +39,15 @@ export const ToolService = {
|
|
|
39
39
|
O: ListScopedToolsResponse,
|
|
40
40
|
kind: MethodKind.Unary,
|
|
41
41
|
},
|
|
42
|
+
/**
|
|
43
|
+
* @generated from rpc scalekit.v1.tools.ToolService.ListAvailableTools
|
|
44
|
+
*/
|
|
45
|
+
listAvailableTools: {
|
|
46
|
+
name: "ListAvailableTools",
|
|
47
|
+
I: ListAvailableToolsRequest,
|
|
48
|
+
O: ListAvailableToolsResponse,
|
|
49
|
+
kind: MethodKind.Unary,
|
|
50
|
+
},
|
|
42
51
|
/**
|
|
43
52
|
* @generated from rpc scalekit.v1.tools.ToolService.SetToolDefault
|
|
44
53
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.10.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/tools/tools.proto (package scalekit.v1.tools, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -845,3 +845,107 @@ export class ScopedToolFilter extends Message<ScopedToolFilter> {
|
|
|
845
845
|
}
|
|
846
846
|
}
|
|
847
847
|
|
|
848
|
+
/**
|
|
849
|
+
* @generated from message scalekit.v1.tools.ListAvailableToolsRequest
|
|
850
|
+
*/
|
|
851
|
+
export class ListAvailableToolsRequest extends Message<ListAvailableToolsRequest> {
|
|
852
|
+
/**
|
|
853
|
+
* @generated from field: string identifier = 1;
|
|
854
|
+
*/
|
|
855
|
+
identifier = "";
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* @generated from field: uint32 page_size = 2;
|
|
859
|
+
*/
|
|
860
|
+
pageSize = 0;
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* @generated from field: string page_token = 3;
|
|
864
|
+
*/
|
|
865
|
+
pageToken = "";
|
|
866
|
+
|
|
867
|
+
constructor(data?: PartialMessage<ListAvailableToolsRequest>) {
|
|
868
|
+
super();
|
|
869
|
+
proto3.util.initPartial(data, this);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
873
|
+
static readonly typeName = "scalekit.v1.tools.ListAvailableToolsRequest";
|
|
874
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
875
|
+
{ no: 1, name: "identifier", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
876
|
+
{ no: 2, name: "page_size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
|
|
877
|
+
{ no: 3, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
878
|
+
]);
|
|
879
|
+
|
|
880
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ListAvailableToolsRequest {
|
|
881
|
+
return new ListAvailableToolsRequest().fromBinary(bytes, options);
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ListAvailableToolsRequest {
|
|
885
|
+
return new ListAvailableToolsRequest().fromJson(jsonValue, options);
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ListAvailableToolsRequest {
|
|
889
|
+
return new ListAvailableToolsRequest().fromJsonString(jsonString, options);
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
static equals(a: ListAvailableToolsRequest | PlainMessage<ListAvailableToolsRequest> | undefined, b: ListAvailableToolsRequest | PlainMessage<ListAvailableToolsRequest> | undefined): boolean {
|
|
893
|
+
return proto3.util.equals(ListAvailableToolsRequest, a, b);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* @generated from message scalekit.v1.tools.ListAvailableToolsResponse
|
|
899
|
+
*/
|
|
900
|
+
export class ListAvailableToolsResponse extends Message<ListAvailableToolsResponse> {
|
|
901
|
+
/**
|
|
902
|
+
* @generated from field: string next_page_token = 1;
|
|
903
|
+
*/
|
|
904
|
+
nextPageToken = "";
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* @generated from field: uint32 total_size = 2;
|
|
908
|
+
*/
|
|
909
|
+
totalSize = 0;
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* @generated from field: string prev_page_token = 3;
|
|
913
|
+
*/
|
|
914
|
+
prevPageToken = "";
|
|
915
|
+
|
|
916
|
+
/**
|
|
917
|
+
* @generated from field: repeated scalekit.v1.tools.Tool tools = 4;
|
|
918
|
+
*/
|
|
919
|
+
tools: Tool[] = [];
|
|
920
|
+
|
|
921
|
+
constructor(data?: PartialMessage<ListAvailableToolsResponse>) {
|
|
922
|
+
super();
|
|
923
|
+
proto3.util.initPartial(data, this);
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
927
|
+
static readonly typeName = "scalekit.v1.tools.ListAvailableToolsResponse";
|
|
928
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
929
|
+
{ no: 1, name: "next_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
930
|
+
{ no: 2, name: "total_size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
|
|
931
|
+
{ no: 3, name: "prev_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
932
|
+
{ no: 4, name: "tools", kind: "message", T: Tool, repeated: true },
|
|
933
|
+
]);
|
|
934
|
+
|
|
935
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ListAvailableToolsResponse {
|
|
936
|
+
return new ListAvailableToolsResponse().fromBinary(bytes, options);
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ListAvailableToolsResponse {
|
|
940
|
+
return new ListAvailableToolsResponse().fromJson(jsonValue, options);
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ListAvailableToolsResponse {
|
|
944
|
+
return new ListAvailableToolsResponse().fromJsonString(jsonString, options);
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
static equals(a: ListAvailableToolsResponse | PlainMessage<ListAvailableToolsResponse> | undefined, b: ListAvailableToolsResponse | PlainMessage<ListAvailableToolsResponse> | undefined): boolean {
|
|
948
|
+
return proto3.util.equals(ListAvailableToolsResponse, a, b);
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// @generated by protoc-gen-connect-es v1.
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.7.0 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/users/users.proto (package scalekit.v1.users, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
5
5
|
|
|
6
|
-
import { AssignUserRolesRequest, AssignUserRolesResponse, CreateMembershipRequest, CreateMembershipResponse, CreateUserAndMembershipRequest, CreateUserAndMembershipResponse, DeleteMembershipRequest, DeleteUserRequest, GetCurrentUserRequest, GetCurrentUserResponse, GetUserRequest, GetUserResponse, ListOrganizationUsersRequest, ListOrganizationUsersResponse, ListUserPermissionsRequest, ListUserPermissionsResponse, ListUserRolesRequest, ListUserRolesResponse, ListUsersRequest, ListUsersResponse, RemoveUserRoleRequest, ResendInviteRequest, ResendInviteResponse, SearchOrganizationUsersRequest, SearchOrganizationUsersResponse, SearchUsersRequest, SearchUsersResponse, UpdateMembershipRequest, UpdateMembershipResponse, UpdateUserRequest, UpdateUserResponse } from "./users_pb.js";
|
|
6
|
+
import { AssignUserRolesRequest, AssignUserRolesResponse, CreateMembershipRequest, CreateMembershipResponse, CreateUserAndMembershipRequest, CreateUserAndMembershipResponse, DeleteMembershipRequest, DeleteUserRequest, GetCurrentUserRequest, GetCurrentUserResponse, GetSupportHashResponse, GetUserRequest, GetUserResponse, ListOrganizationUsersRequest, ListOrganizationUsersResponse, ListUserPermissionsRequest, ListUserPermissionsResponse, ListUserRolesRequest, ListUserRolesResponse, ListUsersRequest, ListUsersResponse, RemoveUserRoleRequest, ResendInviteRequest, ResendInviteResponse, SearchOrganizationUsersRequest, SearchOrganizationUsersResponse, SearchUsersRequest, SearchUsersResponse, UpdateMembershipRequest, UpdateMembershipResponse, UpdateUserRequest, UpdateUserResponse } from "./users_pb.js";
|
|
7
7
|
import { Empty, MethodKind } from "@bufbuild/protobuf";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -32,6 +32,15 @@ export const UserService = {
|
|
|
32
32
|
O: GetCurrentUserResponse,
|
|
33
33
|
kind: MethodKind.Unary,
|
|
34
34
|
},
|
|
35
|
+
/**
|
|
36
|
+
* @generated from rpc scalekit.v1.users.UserService.GetSupportHash
|
|
37
|
+
*/
|
|
38
|
+
getSupportHash: {
|
|
39
|
+
name: "GetSupportHash",
|
|
40
|
+
I: Empty,
|
|
41
|
+
O: GetSupportHashResponse,
|
|
42
|
+
kind: MethodKind.Unary,
|
|
43
|
+
},
|
|
35
44
|
/**
|
|
36
45
|
* @generated from rpc scalekit.v1.users.UserService.ListUsers
|
|
37
46
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.10.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts"
|
|
2
2
|
// @generated from file scalekit/v1/users/users.proto (package scalekit.v1.users, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -2112,6 +2112,43 @@ export class Permission extends Message<Permission> {
|
|
|
2112
2112
|
}
|
|
2113
2113
|
}
|
|
2114
2114
|
|
|
2115
|
+
/**
|
|
2116
|
+
* @generated from message scalekit.v1.users.GetSupportHashResponse
|
|
2117
|
+
*/
|
|
2118
|
+
export class GetSupportHashResponse extends Message<GetSupportHashResponse> {
|
|
2119
|
+
/**
|
|
2120
|
+
* @generated from field: string support_hash = 1;
|
|
2121
|
+
*/
|
|
2122
|
+
supportHash = "";
|
|
2123
|
+
|
|
2124
|
+
constructor(data?: PartialMessage<GetSupportHashResponse>) {
|
|
2125
|
+
super();
|
|
2126
|
+
proto3.util.initPartial(data, this);
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
2130
|
+
static readonly typeName = "scalekit.v1.users.GetSupportHashResponse";
|
|
2131
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
2132
|
+
{ no: 1, name: "support_hash", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
2133
|
+
]);
|
|
2134
|
+
|
|
2135
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetSupportHashResponse {
|
|
2136
|
+
return new GetSupportHashResponse().fromBinary(bytes, options);
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetSupportHashResponse {
|
|
2140
|
+
return new GetSupportHashResponse().fromJson(jsonValue, options);
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetSupportHashResponse {
|
|
2144
|
+
return new GetSupportHashResponse().fromJsonString(jsonString, options);
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
static equals(a: GetSupportHashResponse | PlainMessage<GetSupportHashResponse> | undefined, b: GetSupportHashResponse | PlainMessage<GetSupportHashResponse> | undefined): boolean {
|
|
2148
|
+
return proto3.util.equals(GetSupportHashResponse, a, b);
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
|
|
2115
2152
|
/**
|
|
2116
2153
|
* @generated from message scalekit.v1.users.ListUserPermissionsResponse
|
|
2117
2154
|
*/
|
package/src/tools.ts
CHANGED
|
@@ -4,6 +4,8 @@ import GrpcConnect from "./connect";
|
|
|
4
4
|
import CoreClient from "./core";
|
|
5
5
|
import { ToolService } from "./pkg/grpc/scalekit/v1/tools/tools_connect";
|
|
6
6
|
import {
|
|
7
|
+
ListAvailableToolsRequest,
|
|
8
|
+
ListAvailableToolsResponse,
|
|
7
9
|
ExecuteToolRequest,
|
|
8
10
|
ExecuteToolResponse,
|
|
9
11
|
Filter,
|
|
@@ -69,26 +71,58 @@ export default class ToolsClient {
|
|
|
69
71
|
*
|
|
70
72
|
* @param identifier Connected account identifier to scope the tools list (for example,
|
|
71
73
|
* a workspace identifier or email).
|
|
72
|
-
* @param options
|
|
73
|
-
* @param options.filter Filter configuration for scoped tools (providers, tool names, connection names).
|
|
74
|
+
* @param options Filter and pagination parameters
|
|
75
|
+
* @param options.filter Filter configuration for scoped tools (providers, tool names, connection names). Required.
|
|
74
76
|
* @param options.pageSize Maximum number of tools to return per page.
|
|
75
77
|
* @param options.pageToken Token from a previous `listScopedTools` response for pagination.
|
|
76
78
|
*/
|
|
77
79
|
async listScopedTools(
|
|
78
80
|
identifier: string,
|
|
79
|
-
options
|
|
80
|
-
filter
|
|
81
|
+
options: {
|
|
82
|
+
filter: PartialMessage<ScopedToolFilter>;
|
|
81
83
|
pageSize?: number;
|
|
82
84
|
pageToken?: string;
|
|
83
85
|
}
|
|
84
86
|
): Promise<ListScopedToolsResponse> {
|
|
85
87
|
const request: PartialMessage<ListScopedToolsRequest> = {
|
|
86
88
|
identifier,
|
|
89
|
+
filter: options.filter as ScopedToolFilter,
|
|
87
90
|
};
|
|
88
91
|
|
|
89
|
-
if (options
|
|
90
|
-
request.
|
|
92
|
+
if (options.pageSize !== undefined) {
|
|
93
|
+
request.pageSize = options.pageSize;
|
|
91
94
|
}
|
|
95
|
+
if (options.pageToken) {
|
|
96
|
+
request.pageToken = options.pageToken;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return this.coreClient.connectExec(this.client.listScopedTools, request);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Lists tools that are available for a specific connected account identifier.
|
|
104
|
+
*
|
|
105
|
+
* This is similar to `listScopedTools` but returns the tools that can be
|
|
106
|
+
* made available for a given identifier, rather than the tools that are
|
|
107
|
+
* already scoped to it.
|
|
108
|
+
*
|
|
109
|
+
* @param identifier Connected account identifier to scope the available tools list (for example,
|
|
110
|
+
* a workspace identifier or email).
|
|
111
|
+
* @param options Optional pagination parameters
|
|
112
|
+
* @param options.pageSize Maximum number of tools to return per page.
|
|
113
|
+
* @param options.pageToken Token from a previous `listAvailableTools` response for pagination.
|
|
114
|
+
*/
|
|
115
|
+
async listAvailableTools(
|
|
116
|
+
identifier: string,
|
|
117
|
+
options?: {
|
|
118
|
+
pageSize?: number;
|
|
119
|
+
pageToken?: string;
|
|
120
|
+
}
|
|
121
|
+
): Promise<ListAvailableToolsResponse> {
|
|
122
|
+
const request: PartialMessage<ListAvailableToolsRequest> = {
|
|
123
|
+
identifier,
|
|
124
|
+
};
|
|
125
|
+
|
|
92
126
|
if (options?.pageSize !== undefined) {
|
|
93
127
|
request.pageSize = options.pageSize;
|
|
94
128
|
}
|
|
@@ -96,7 +130,10 @@ export default class ToolsClient {
|
|
|
96
130
|
request.pageToken = options.pageToken;
|
|
97
131
|
}
|
|
98
132
|
|
|
99
|
-
return this.coreClient.connectExec(
|
|
133
|
+
return this.coreClient.connectExec(
|
|
134
|
+
this.client.listAvailableTools,
|
|
135
|
+
request
|
|
136
|
+
);
|
|
100
137
|
}
|
|
101
138
|
|
|
102
139
|
/**
|
|
@@ -212,6 +212,44 @@ describe('Connected Accounts', () => {
|
|
|
212
212
|
});
|
|
213
213
|
});
|
|
214
214
|
|
|
215
|
+
describe('getOrCreateConnectedAccount', () => {
|
|
216
|
+
it('should throw when connector is empty', async () => {
|
|
217
|
+
await expect(
|
|
218
|
+
client.connectedAccounts.getOrCreateConnectedAccount({
|
|
219
|
+
connector: '',
|
|
220
|
+
identifier: 'user_123',
|
|
221
|
+
})
|
|
222
|
+
).rejects.toThrow('connector is required');
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it('should throw when identifier is empty', async () => {
|
|
226
|
+
await expect(
|
|
227
|
+
client.connectedAccounts.getOrCreateConnectedAccount({
|
|
228
|
+
connector: 'gmail',
|
|
229
|
+
identifier: '',
|
|
230
|
+
})
|
|
231
|
+
).rejects.toThrow('identifier is required');
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
it('should return existing account when found (get path)', async () => {
|
|
235
|
+
const connector = 'gmail';
|
|
236
|
+
const identifier = 'get-or-create-test@example.com';
|
|
237
|
+
try {
|
|
238
|
+
const response = await client.connectedAccounts.getOrCreateConnectedAccount({
|
|
239
|
+
connector,
|
|
240
|
+
identifier,
|
|
241
|
+
organizationId: testOrg,
|
|
242
|
+
});
|
|
243
|
+
expect(response).toBeDefined();
|
|
244
|
+
expect(response.connectedAccount).toBeDefined();
|
|
245
|
+
expect(response.connectedAccount?.identifier).toBe(identifier);
|
|
246
|
+
expect(response.connectedAccount?.connector).toBe(connector);
|
|
247
|
+
} catch (error: unknown) {
|
|
248
|
+
expect(error).toBeDefined();
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
|
|
215
253
|
describe('updateConnectedAccount', () => {
|
|
216
254
|
it('should handle update connected account request', async () => {
|
|
217
255
|
const connector = 'test_connector';
|