@scalekit-sdk/node 1.0.4 → 1.0.6
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/README.md +32 -6
- package/lib/connection.js +5 -20
- package/lib/connection.js.map +1 -1
- package/lib/core.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.d.ts +64 -1
- package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.js +63 -0
- package/lib/pkg/grpc/scalekit/v1/connections/connections_connect.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.d.ts +278 -149
- package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.js +362 -70
- package/lib/pkg/grpc/scalekit/v1/connections/connections_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/domains/domains_connect.d.ts +10 -1
- package/lib/pkg/grpc/scalekit/v1/domains/domains_connect.js +9 -0
- package/lib/pkg/grpc/scalekit/v1/domains/domains_connect.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/domains/domains_pb.d.ts +34 -0
- package/lib/pkg/grpc/scalekit/v1/domains/domains_pb.js +64 -2
- package/lib/pkg/grpc/scalekit/v1/domains/domains_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/errdetails/errdetails_pb.js +1 -1
- package/lib/pkg/grpc/scalekit/v1/errdetails/errdetails_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/options/options_pb.d.ts +6 -0
- package/lib/pkg/grpc/scalekit/v1/options/options_pb.js +8 -1
- package/lib/pkg/grpc/scalekit/v1/options/options_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_connect.d.ts +19 -1
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_connect.js +18 -0
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_connect.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.d.ts +71 -0
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.js +120 -2
- package/lib/pkg/grpc/scalekit/v1/organizations/organizations_pb.js.map +1 -1
- package/lib/scalekit.d.ts +1 -0
- package/lib/scalekit.js +2 -1
- package/lib/scalekit.js.map +1 -1
- package/lib/types/scalekit.d.ts +1 -0
- package/package.json +10 -11
- package/src/connection.ts +5 -20
- package/src/core.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/commons/commons_pb.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/connections/connections_connect.ts +64 -1
- package/src/pkg/grpc/scalekit/v1/connections/connections_pb.ts +508 -156
- package/src/pkg/grpc/scalekit/v1/domains/domains_connect.ts +10 -1
- package/src/pkg/grpc/scalekit/v1/domains/domains_pb.ts +75 -1
- package/src/pkg/grpc/scalekit/v1/errdetails/errdetails_pb.ts +1 -1
- package/src/pkg/grpc/scalekit/v1/options/options_pb.ts +9 -1
- package/src/pkg/grpc/scalekit/v1/organizations/organizations_connect.ts +19 -1
- package/src/pkg/grpc/scalekit/v1/organizations/organizations_pb.ts +142 -1
- package/src/scalekit.ts +34 -7
- package/src/types/auth.ts +7 -0
- package/src/types/scalekit.ts +2 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
5
5
|
|
|
6
|
-
import { CreateDomainRequest, CreateDomainResponse, DeleteDomainRequest, GetDomainRequest, GetDomainResponse, ListDomainRequest, ListDomainResponse, UpdateDomainRequest, UpdateDomainResponse } from "./domains_pb.js";
|
|
6
|
+
import { CreateDomainRequest, CreateDomainResponse, DeleteDomainRequest, GetDomainRequest, GetDomainResponse, ListAuthorizedDomainRequest, ListAuthorizedDomainResponse, ListDomainRequest, ListDomainResponse, UpdateDomainRequest, UpdateDomainResponse } from "./domains_pb.js";
|
|
7
7
|
import { Empty, MethodKind } from "@bufbuild/protobuf";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -57,6 +57,15 @@ export const DomainService = {
|
|
|
57
57
|
O: ListDomainResponse,
|
|
58
58
|
kind: MethodKind.Unary,
|
|
59
59
|
},
|
|
60
|
+
/**
|
|
61
|
+
* @generated from rpc scalekit.v1.domains.DomainService.ListAuthorizedDomains
|
|
62
|
+
*/
|
|
63
|
+
listAuthorizedDomains: {
|
|
64
|
+
name: "ListAuthorizedDomains",
|
|
65
|
+
I: ListAuthorizedDomainRequest,
|
|
66
|
+
O: ListAuthorizedDomainResponse,
|
|
67
|
+
kind: MethodKind.Unary,
|
|
68
|
+
},
|
|
60
69
|
}
|
|
61
70
|
} as const;
|
|
62
71
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.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
|
|
@@ -588,6 +588,80 @@ export class ListDomainResponse extends Message<ListDomainResponse> {
|
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
590
|
|
|
591
|
+
/**
|
|
592
|
+
* @generated from message scalekit.v1.domains.ListAuthorizedDomainRequest
|
|
593
|
+
*/
|
|
594
|
+
export class ListAuthorizedDomainRequest extends Message<ListAuthorizedDomainRequest> {
|
|
595
|
+
/**
|
|
596
|
+
* @generated from field: string origin = 1;
|
|
597
|
+
*/
|
|
598
|
+
origin = "";
|
|
599
|
+
|
|
600
|
+
constructor(data?: PartialMessage<ListAuthorizedDomainRequest>) {
|
|
601
|
+
super();
|
|
602
|
+
proto3.util.initPartial(data, this);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
606
|
+
static readonly typeName = "scalekit.v1.domains.ListAuthorizedDomainRequest";
|
|
607
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
608
|
+
{ no: 1, name: "origin", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
609
|
+
]);
|
|
610
|
+
|
|
611
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ListAuthorizedDomainRequest {
|
|
612
|
+
return new ListAuthorizedDomainRequest().fromBinary(bytes, options);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ListAuthorizedDomainRequest {
|
|
616
|
+
return new ListAuthorizedDomainRequest().fromJson(jsonValue, options);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ListAuthorizedDomainRequest {
|
|
620
|
+
return new ListAuthorizedDomainRequest().fromJsonString(jsonString, options);
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
static equals(a: ListAuthorizedDomainRequest | PlainMessage<ListAuthorizedDomainRequest> | undefined, b: ListAuthorizedDomainRequest | PlainMessage<ListAuthorizedDomainRequest> | undefined): boolean {
|
|
624
|
+
return proto3.util.equals(ListAuthorizedDomainRequest, a, b);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* @generated from message scalekit.v1.domains.ListAuthorizedDomainResponse
|
|
630
|
+
*/
|
|
631
|
+
export class ListAuthorizedDomainResponse extends Message<ListAuthorizedDomainResponse> {
|
|
632
|
+
/**
|
|
633
|
+
* @generated from field: repeated string domains = 1;
|
|
634
|
+
*/
|
|
635
|
+
domains: string[] = [];
|
|
636
|
+
|
|
637
|
+
constructor(data?: PartialMessage<ListAuthorizedDomainResponse>) {
|
|
638
|
+
super();
|
|
639
|
+
proto3.util.initPartial(data, this);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
643
|
+
static readonly typeName = "scalekit.v1.domains.ListAuthorizedDomainResponse";
|
|
644
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
645
|
+
{ no: 1, name: "domains", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
|
|
646
|
+
]);
|
|
647
|
+
|
|
648
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ListAuthorizedDomainResponse {
|
|
649
|
+
return new ListAuthorizedDomainResponse().fromBinary(bytes, options);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ListAuthorizedDomainResponse {
|
|
653
|
+
return new ListAuthorizedDomainResponse().fromJson(jsonValue, options);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ListAuthorizedDomainResponse {
|
|
657
|
+
return new ListAuthorizedDomainResponse().fromJsonString(jsonString, options);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
static equals(a: ListAuthorizedDomainResponse | PlainMessage<ListAuthorizedDomainResponse> | undefined, b: ListAuthorizedDomainResponse | PlainMessage<ListAuthorizedDomainResponse> | undefined): boolean {
|
|
661
|
+
return proto3.util.equals(ListAuthorizedDomainResponse, a, b);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
|
|
591
665
|
/**
|
|
592
666
|
* @generated from message scalekit.v1.domains.Domain
|
|
593
667
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.0 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.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.0 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
|
|
@@ -52,6 +52,13 @@ export enum AuthenticationType {
|
|
|
52
52
|
*/
|
|
53
53
|
WORKSPACE_SESSION = 80,
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* workspace_id,organization_id is in claims and UI in audience
|
|
57
|
+
*
|
|
58
|
+
* @generated from enum value: WORKSPACE_SESSION_CUSTOMER_PORTAL = 112;
|
|
59
|
+
*/
|
|
60
|
+
WORKSPACE_SESSION_CUSTOMER_PORTAL = 112,
|
|
61
|
+
|
|
55
62
|
/**
|
|
56
63
|
* user_id is in claims
|
|
57
64
|
*
|
|
@@ -95,6 +102,7 @@ proto3.util.setEnumType(AuthenticationType, "scalekit.v1.options.AuthenticationT
|
|
|
95
102
|
{ no: 32, name: "CUSTOMER_PORTAL" },
|
|
96
103
|
{ no: 16, name: "SESSION" },
|
|
97
104
|
{ no: 80, name: "WORKSPACE_SESSION" },
|
|
105
|
+
{ no: 112, name: "WORKSPACE_SESSION_CUSTOMER_PORTAL" },
|
|
98
106
|
{ no: 8, name: "USER" },
|
|
99
107
|
{ no: 4, name: "CLIENT" },
|
|
100
108
|
{ no: 20, name: "SESSION_CLIENT" },
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
5
5
|
|
|
6
|
-
import { CreateOrganizationRequest, CreateOrganizationResponse, DeleteOrganizationRequest, DeletePortalLinkRequest, GeneratePortalLinkRequest, GeneratePortalLinkResponse, GetOrganizationRequest, GetOrganizationResponse, GetPortalLinkRequest, GetPortalLinksResponse, ListOrganizationsRequest, ListOrganizationsResponse, UpdateOrganizationRequest, UpdateOrganizationResponse } from "./organizations_pb.js";
|
|
6
|
+
import { CreateOrganizationRequest, CreateOrganizationResponse, DeleteOrganizationRequest, DeletePortalLinkByIdRequest, DeletePortalLinkRequest, GeneratePortalLinkRequest, GeneratePortalLinkResponse, GetOrganizationRequest, GetOrganizationResponse, GetPortalLinkRequest, GetPortalLinksResponse, ListOrganizationsRequest, ListOrganizationsResponse, SearchOrganizationsRequest, SearchOrganizationsResponse, UpdateOrganizationRequest, UpdateOrganizationResponse } from "./organizations_pb.js";
|
|
7
7
|
import { Empty, MethodKind } from "@bufbuild/protobuf";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -50,6 +50,15 @@ export const OrganizationService = {
|
|
|
50
50
|
O: ListOrganizationsResponse,
|
|
51
51
|
kind: MethodKind.Unary,
|
|
52
52
|
},
|
|
53
|
+
/**
|
|
54
|
+
* @generated from rpc scalekit.v1.organizations.OrganizationService.SearchOrganization
|
|
55
|
+
*/
|
|
56
|
+
searchOrganization: {
|
|
57
|
+
name: "SearchOrganization",
|
|
58
|
+
I: SearchOrganizationsRequest,
|
|
59
|
+
O: SearchOrganizationsResponse,
|
|
60
|
+
kind: MethodKind.Unary,
|
|
61
|
+
},
|
|
53
62
|
/**
|
|
54
63
|
* Delete an Organization
|
|
55
64
|
*
|
|
@@ -81,6 +90,15 @@ export const OrganizationService = {
|
|
|
81
90
|
O: Empty,
|
|
82
91
|
kind: MethodKind.Unary,
|
|
83
92
|
},
|
|
93
|
+
/**
|
|
94
|
+
* @generated from rpc scalekit.v1.organizations.OrganizationService.DeletePortalLinkByID
|
|
95
|
+
*/
|
|
96
|
+
deletePortalLinkByID: {
|
|
97
|
+
name: "DeletePortalLinkByID",
|
|
98
|
+
I: DeletePortalLinkByIdRequest,
|
|
99
|
+
O: Empty,
|
|
100
|
+
kind: MethodKind.Unary,
|
|
101
|
+
},
|
|
84
102
|
/**
|
|
85
103
|
* @generated from rpc scalekit.v1.organizations.OrganizationService.GetPortalLinks
|
|
86
104
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v1.
|
|
1
|
+
// @generated by protoc-gen-es v1.10.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
|
|
@@ -562,6 +562,104 @@ export class ListOrganizationsResponse extends Message<ListOrganizationsResponse
|
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
564
|
|
|
565
|
+
/**
|
|
566
|
+
* @generated from message scalekit.v1.organizations.SearchOrganizationsRequest
|
|
567
|
+
*/
|
|
568
|
+
export class SearchOrganizationsRequest extends Message<SearchOrganizationsRequest> {
|
|
569
|
+
/**
|
|
570
|
+
* @generated from field: string query = 1;
|
|
571
|
+
*/
|
|
572
|
+
query = "";
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* @generated from field: uint32 page_size = 2;
|
|
576
|
+
*/
|
|
577
|
+
pageSize = 0;
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* @generated from field: string page_token = 3;
|
|
581
|
+
*/
|
|
582
|
+
pageToken = "";
|
|
583
|
+
|
|
584
|
+
constructor(data?: PartialMessage<SearchOrganizationsRequest>) {
|
|
585
|
+
super();
|
|
586
|
+
proto3.util.initPartial(data, this);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
590
|
+
static readonly typeName = "scalekit.v1.organizations.SearchOrganizationsRequest";
|
|
591
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
592
|
+
{ no: 1, name: "query", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
593
|
+
{ no: 2, name: "page_size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
|
|
594
|
+
{ no: 3, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
595
|
+
]);
|
|
596
|
+
|
|
597
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SearchOrganizationsRequest {
|
|
598
|
+
return new SearchOrganizationsRequest().fromBinary(bytes, options);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SearchOrganizationsRequest {
|
|
602
|
+
return new SearchOrganizationsRequest().fromJson(jsonValue, options);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SearchOrganizationsRequest {
|
|
606
|
+
return new SearchOrganizationsRequest().fromJsonString(jsonString, options);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
static equals(a: SearchOrganizationsRequest | PlainMessage<SearchOrganizationsRequest> | undefined, b: SearchOrganizationsRequest | PlainMessage<SearchOrganizationsRequest> | undefined): boolean {
|
|
610
|
+
return proto3.util.equals(SearchOrganizationsRequest, a, b);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* @generated from message scalekit.v1.organizations.SearchOrganizationsResponse
|
|
616
|
+
*/
|
|
617
|
+
export class SearchOrganizationsResponse extends Message<SearchOrganizationsResponse> {
|
|
618
|
+
/**
|
|
619
|
+
* @generated from field: string next_page_token = 1;
|
|
620
|
+
*/
|
|
621
|
+
nextPageToken = "";
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* @generated from field: uint32 total_size = 2;
|
|
625
|
+
*/
|
|
626
|
+
totalSize = 0;
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* @generated from field: repeated scalekit.v1.organizations.Organization organizations = 3;
|
|
630
|
+
*/
|
|
631
|
+
organizations: Organization[] = [];
|
|
632
|
+
|
|
633
|
+
constructor(data?: PartialMessage<SearchOrganizationsResponse>) {
|
|
634
|
+
super();
|
|
635
|
+
proto3.util.initPartial(data, this);
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
639
|
+
static readonly typeName = "scalekit.v1.organizations.SearchOrganizationsResponse";
|
|
640
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
641
|
+
{ no: 1, name: "next_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
642
|
+
{ no: 2, name: "total_size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
|
|
643
|
+
{ no: 3, name: "organizations", kind: "message", T: Organization, repeated: true },
|
|
644
|
+
]);
|
|
645
|
+
|
|
646
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SearchOrganizationsResponse {
|
|
647
|
+
return new SearchOrganizationsResponse().fromBinary(bytes, options);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SearchOrganizationsResponse {
|
|
651
|
+
return new SearchOrganizationsResponse().fromJson(jsonValue, options);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SearchOrganizationsResponse {
|
|
655
|
+
return new SearchOrganizationsResponse().fromJsonString(jsonString, options);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
static equals(a: SearchOrganizationsResponse | PlainMessage<SearchOrganizationsResponse> | undefined, b: SearchOrganizationsResponse | PlainMessage<SearchOrganizationsResponse> | undefined): boolean {
|
|
659
|
+
return proto3.util.equals(SearchOrganizationsResponse, a, b);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
565
663
|
/**
|
|
566
664
|
* @generated from message scalekit.v1.organizations.DeleteOrganizationRequest
|
|
567
665
|
*/
|
|
@@ -723,6 +821,49 @@ export class DeletePortalLinkRequest extends Message<DeletePortalLinkRequest> {
|
|
|
723
821
|
}
|
|
724
822
|
}
|
|
725
823
|
|
|
824
|
+
/**
|
|
825
|
+
* @generated from message scalekit.v1.organizations.DeletePortalLinkByIdRequest
|
|
826
|
+
*/
|
|
827
|
+
export class DeletePortalLinkByIdRequest extends Message<DeletePortalLinkByIdRequest> {
|
|
828
|
+
/**
|
|
829
|
+
* @generated from field: string id = 1;
|
|
830
|
+
*/
|
|
831
|
+
id = "";
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* @generated from field: string link_id = 2;
|
|
835
|
+
*/
|
|
836
|
+
linkId = "";
|
|
837
|
+
|
|
838
|
+
constructor(data?: PartialMessage<DeletePortalLinkByIdRequest>) {
|
|
839
|
+
super();
|
|
840
|
+
proto3.util.initPartial(data, this);
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
844
|
+
static readonly typeName = "scalekit.v1.organizations.DeletePortalLinkByIdRequest";
|
|
845
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
846
|
+
{ no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
847
|
+
{ no: 2, name: "link_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
848
|
+
]);
|
|
849
|
+
|
|
850
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DeletePortalLinkByIdRequest {
|
|
851
|
+
return new DeletePortalLinkByIdRequest().fromBinary(bytes, options);
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DeletePortalLinkByIdRequest {
|
|
855
|
+
return new DeletePortalLinkByIdRequest().fromJson(jsonValue, options);
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DeletePortalLinkByIdRequest {
|
|
859
|
+
return new DeletePortalLinkByIdRequest().fromJsonString(jsonString, options);
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
static equals(a: DeletePortalLinkByIdRequest | PlainMessage<DeletePortalLinkByIdRequest> | undefined, b: DeletePortalLinkByIdRequest | PlainMessage<DeletePortalLinkByIdRequest> | undefined): boolean {
|
|
863
|
+
return proto3.util.equals(DeletePortalLinkByIdRequest, a, b);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
|
|
726
867
|
/**
|
|
727
868
|
* @generated from message scalekit.v1.organizations.Link
|
|
728
869
|
*/
|
package/src/scalekit.ts
CHANGED
|
@@ -7,7 +7,7 @@ import CoreClient from './core';
|
|
|
7
7
|
import DomainClient from './domain';
|
|
8
8
|
import OrganizationClient from './organization';
|
|
9
9
|
import { AuthorizationUrlOptions, AuthenticationOptions, GrantType, AuthenticationResponse } from './types/scalekit';
|
|
10
|
-
import { IdTokenClaim, User } from './types/auth';
|
|
10
|
+
import { IdpInitiatedLoginClaims, IdTokenClaim, User } from './types/auth';
|
|
11
11
|
|
|
12
12
|
const authorizeEndpoint = "oauth/authorize";
|
|
13
13
|
|
|
@@ -65,6 +65,7 @@ export default class ScalekitClient {
|
|
|
65
65
|
* @param {string} options.domainHint Domain hint parameter
|
|
66
66
|
* @param {string} options.connectionId Connection id parameter
|
|
67
67
|
* @param {string} options.organizationId Organization id parameter
|
|
68
|
+
* @param {string} options.provider Provider i.e. google, github, etc.
|
|
68
69
|
* @param {string} options.codeChallenge Code challenge parameter in case of PKCE
|
|
69
70
|
* @param {string} options.codeChallengeMethod Code challenge method parameter in case of PKCE
|
|
70
71
|
*
|
|
@@ -97,7 +98,8 @@ export default class ScalekitClient {
|
|
|
97
98
|
...(options.connectionId && { connection_id: options.connectionId }),
|
|
98
99
|
...(options.organizationId && { organization_id: options.organizationId }),
|
|
99
100
|
...(options.codeChallenge && { code_challenge: options.codeChallenge }),
|
|
100
|
-
...(options.codeChallengeMethod && { code_challenge_method: options.codeChallengeMethod })
|
|
101
|
+
...(options.codeChallengeMethod && { code_challenge_method: options.codeChallengeMethod }),
|
|
102
|
+
...(options.provider && { provider: options.provider })
|
|
101
103
|
})
|
|
102
104
|
|
|
103
105
|
return `${this.coreClient.envUrl}/${authorizeEndpoint}?${qs}`
|
|
@@ -141,6 +143,16 @@ export default class ScalekitClient {
|
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
145
|
|
|
146
|
+
/**
|
|
147
|
+
* Get the idp initiated login claims
|
|
148
|
+
*
|
|
149
|
+
* @param {string} idpInitiatedLoginToken The idp_initiated_login query param from the URL
|
|
150
|
+
* @returns {object} Returns the idp initiated login claims
|
|
151
|
+
*/
|
|
152
|
+
async getIdpInitiatedLoginClaims(idpInitiatedLoginToken: string): Promise<IdpInitiatedLoginClaims> {
|
|
153
|
+
return await this.validateToken<IdpInitiatedLoginClaims>(idpInitiatedLoginToken);
|
|
154
|
+
}
|
|
155
|
+
|
|
144
156
|
/**
|
|
145
157
|
* Validates the access token.
|
|
146
158
|
*
|
|
@@ -148,15 +160,30 @@ export default class ScalekitClient {
|
|
|
148
160
|
* @return {Promise<boolean>} Returns true if the token is valid, false otherwise.
|
|
149
161
|
*/
|
|
150
162
|
async validateAccessToken(token: string): Promise<boolean> {
|
|
163
|
+
try {
|
|
164
|
+
await this.validateToken(token);
|
|
165
|
+
return true;
|
|
166
|
+
} catch (_) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Validate token
|
|
173
|
+
*
|
|
174
|
+
* @param {string} token The token to be validated
|
|
175
|
+
* @return {Promise<T>} Returns the payload of the token
|
|
176
|
+
*/
|
|
177
|
+
private async validateToken<T>(token: string): Promise<T> {
|
|
151
178
|
await this.coreClient.getJwks();
|
|
152
|
-
const
|
|
179
|
+
const jwks = jose.createLocalJWKSet({
|
|
153
180
|
keys: this.coreClient.keys
|
|
154
181
|
})
|
|
155
182
|
try {
|
|
156
|
-
await jose.jwtVerify(token,
|
|
157
|
-
return
|
|
158
|
-
} catch (
|
|
159
|
-
|
|
183
|
+
const { payload } = await jose.jwtVerify<T>(token, jwks);
|
|
184
|
+
return payload;
|
|
185
|
+
} catch (_) {
|
|
186
|
+
throw new Error("Invalid token");
|
|
160
187
|
}
|
|
161
188
|
}
|
|
162
189
|
}
|
package/src/types/auth.ts
CHANGED
|
@@ -62,4 +62,11 @@ export type TokenResponse = {
|
|
|
62
62
|
access_token: string;
|
|
63
63
|
id_token: string;
|
|
64
64
|
expires_in: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export type IdpInitiatedLoginClaims ={
|
|
68
|
+
connection_id: string;
|
|
69
|
+
organization_id: string;
|
|
70
|
+
login_hint: string;
|
|
71
|
+
relay_state?: string;
|
|
65
72
|
}
|
package/src/types/scalekit.ts
CHANGED
|
@@ -16,10 +16,11 @@ export type AuthorizationUrlOptions = {
|
|
|
16
16
|
loginHint?: string;
|
|
17
17
|
codeChallenge?: string;
|
|
18
18
|
codeChallengeMethod?: string;
|
|
19
|
+
provider?: string;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export type AuthenticationOptions = {
|
|
22
|
-
codeVerifier?: string;
|
|
23
|
+
codeVerifier?: string;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export type AuthenticationResponse = {
|