@scalekit-sdk/node 2.1.8 → 2.2.0-beta.0
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/buf.gen.yaml +2 -0
- package/lib/connected-accounts.d.ts +96 -0
- package/lib/connected-accounts.js +186 -0
- package/lib/connected-accounts.js.map +1 -0
- package/lib/core.js +19 -9
- package/lib/core.js.map +1 -1
- package/lib/domain.d.ts +6 -1
- package/lib/domain.js +20 -8
- package/lib/domain.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_pb.d.ts +24 -0
- package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_pb.js +30 -0
- package/lib/pkg/grpc/scalekit/v1/auditlogs/auditlogs_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.d.ts +21 -1
- package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.js +21 -0
- package/lib/pkg/grpc/scalekit/v1/auth/auth_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/auth/webauthn_pb.d.ts +9 -9
- package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.d.ts +4 -0
- package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.js +5 -0
- package/lib/pkg/grpc/scalekit/v1/commons/commons_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_connect.d.ts +87 -0
- package/lib/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_connect.js +95 -0
- package/lib/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_connect.js.map +1 -0
- package/lib/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_pb.d.ts +718 -0
- package/lib/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_pb.js +893 -0
- package/lib/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_pb.js.map +1 -0
- package/lib/pkg/grpc/scalekit/v1/errdetails/errdetails_pb.d.ts +10 -4
- package/lib/pkg/grpc/scalekit/v1/errdetails/errdetails_pb.js +12 -5
- package/lib/pkg/grpc/scalekit/v1/errdetails/errdetails_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/options/options_pb.d.ts +48 -5
- package/lib/pkg/grpc/scalekit/v1/options/options_pb.js +61 -7
- package/lib/pkg/grpc/scalekit/v1/options/options_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/roles/roles_pb.d.ts +25 -0
- package/lib/pkg/grpc/scalekit/v1/roles/roles_pb.js +36 -2
- package/lib/pkg/grpc/scalekit/v1/roles/roles_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/sessions/sessions_pb.d.ts +27 -0
- package/lib/pkg/grpc/scalekit/v1/sessions/sessions_pb.js +44 -1
- package/lib/pkg/grpc/scalekit/v1/sessions/sessions_pb.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/tools/tools_connect.d.ts +75 -0
- package/lib/pkg/grpc/scalekit/v1/tools/tools_connect.js +83 -0
- package/lib/pkg/grpc/scalekit/v1/tools/tools_connect.js.map +1 -0
- package/lib/pkg/grpc/scalekit/v1/tools/tools_pb.d.ts +431 -0
- package/lib/pkg/grpc/scalekit/v1/tools/tools_pb.js +627 -0
- package/lib/pkg/grpc/scalekit/v1/tools/tools_pb.js.map +1 -0
- package/lib/pkg/grpc/scalekit/v1/users/users_connect.d.ts +10 -1
- package/lib/pkg/grpc/scalekit/v1/users/users_connect.js +9 -0
- package/lib/pkg/grpc/scalekit/v1/users/users_connect.js.map +1 -1
- package/lib/pkg/grpc/scalekit/v1/users/users_pb.d.ts +36 -0
- package/lib/pkg/grpc/scalekit/v1/users/users_pb.js +60 -1
- package/lib/pkg/grpc/scalekit/v1/users/users_pb.js.map +1 -1
- package/lib/scalekit.d.ts +4 -0
- package/lib/scalekit.js +21 -7
- package/lib/scalekit.js.map +1 -1
- package/lib/tools.d.ts +75 -0
- package/lib/tools.js +127 -0
- package/lib/tools.js.map +1 -0
- package/package.json +2 -2
- package/reference.md +5865 -0
- package/src/connected-accounts.ts +283 -0
- package/src/core.ts +2 -2
- package/src/domain.ts +29 -7
- package/src/pkg/grpc/scalekit/v1/auditlogs/auditlogs_pb.ts +36 -0
- package/src/pkg/grpc/scalekit/v1/auth/auth_pb.ts +30 -0
- package/src/pkg/grpc/scalekit/v1/commons/commons_pb.ts +6 -0
- package/src/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_connect.ts +94 -0
- package/src/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_pb.ts +1294 -0
- package/src/pkg/grpc/scalekit/v1/errdetails/errdetails_pb.ts +14 -6
- package/src/pkg/grpc/scalekit/v1/options/options_pb.ts +66 -6
- package/src/pkg/grpc/scalekit/v1/roles/roles_pb.ts +38 -0
- package/src/pkg/grpc/scalekit/v1/sessions/sessions_pb.ts +51 -0
- package/src/pkg/grpc/scalekit/v1/tools/tools_connect.ts +82 -0
- package/src/pkg/grpc/scalekit/v1/tools/tools_pb.ts +847 -0
- package/src/pkg/grpc/scalekit/v1/users/users_connect.ts +10 -1
- package/src/pkg/grpc/scalekit/v1/users/users_pb.ts +76 -0
- package/src/scalekit.ts +9 -0
- package/src/tools.ts +166 -0
- package/tests/connected-accounts.test.ts +434 -0
- package/tests/domain.test.ts +54 -0
- package/tests/tools.test.ts +239 -0
- package/tsconfig.json +2 -1
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { PartialMessage } from "@bufbuild/protobuf";
|
|
2
|
+
import { PromiseClient } from "@connectrpc/connect";
|
|
3
|
+
import GrpcConnect from "./connect";
|
|
4
|
+
import CoreClient from "./core";
|
|
5
|
+
import { ConnectedAccountService } from "./pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_connect";
|
|
6
|
+
import {
|
|
7
|
+
CreateConnectedAccount,
|
|
8
|
+
CreateConnectedAccountRequest,
|
|
9
|
+
CreateConnectedAccountResponse,
|
|
10
|
+
DeleteConnectedAccountRequest,
|
|
11
|
+
DeleteConnectedAccountResponse,
|
|
12
|
+
GetConnectedAccountByIdentifierRequest,
|
|
13
|
+
GetConnectedAccountByIdentifierResponse,
|
|
14
|
+
GetMagicLinkForConnectedAccountRequest,
|
|
15
|
+
GetMagicLinkForConnectedAccountResponse,
|
|
16
|
+
ListConnectedAccountsRequest,
|
|
17
|
+
ListConnectedAccountsResponse,
|
|
18
|
+
UpdateConnectedAccount,
|
|
19
|
+
UpdateConnectedAccountRequest,
|
|
20
|
+
UpdateConnectedAccountResponse,
|
|
21
|
+
} from "./pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_pb";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Client for managing connected accounts for third-party integrations.
|
|
25
|
+
*
|
|
26
|
+
* This mirrors the Python SDK `ConnectedAccountsClient` and exposes a typed,
|
|
27
|
+
* ergonomic API around the `ConnectedAccountService` to:
|
|
28
|
+
* - list connected accounts
|
|
29
|
+
* - create/update/delete connected accounts
|
|
30
|
+
* - generate magic links for authorization
|
|
31
|
+
* - fetch full authentication details for a connected account
|
|
32
|
+
*/
|
|
33
|
+
export default class ConnectedAccountsClient {
|
|
34
|
+
private client: PromiseClient<typeof ConnectedAccountService>;
|
|
35
|
+
|
|
36
|
+
constructor(
|
|
37
|
+
private readonly grpcConnect: GrpcConnect,
|
|
38
|
+
private readonly coreClient: CoreClient
|
|
39
|
+
) {
|
|
40
|
+
this.client = this.grpcConnect.createClient(ConnectedAccountService);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Lists connected accounts with optional filters and pagination.
|
|
45
|
+
*
|
|
46
|
+
* @param options Optional filtering and pagination parameters
|
|
47
|
+
*/
|
|
48
|
+
async listConnectedAccounts(options?: {
|
|
49
|
+
organizationId?: string;
|
|
50
|
+
userId?: string;
|
|
51
|
+
connector?: string;
|
|
52
|
+
identifier?: string;
|
|
53
|
+
provider?: string;
|
|
54
|
+
pageSize?: number;
|
|
55
|
+
pageToken?: string;
|
|
56
|
+
query?: string;
|
|
57
|
+
}): Promise<ListConnectedAccountsResponse> {
|
|
58
|
+
const request: PartialMessage<ListConnectedAccountsRequest> = {};
|
|
59
|
+
|
|
60
|
+
if (options?.organizationId) {
|
|
61
|
+
request.organizationId = options.organizationId;
|
|
62
|
+
}
|
|
63
|
+
if (options?.userId) {
|
|
64
|
+
request.userId = options.userId;
|
|
65
|
+
}
|
|
66
|
+
if (options?.connector) {
|
|
67
|
+
request.connector = options.connector;
|
|
68
|
+
}
|
|
69
|
+
if (options?.identifier) {
|
|
70
|
+
request.identifier = options.identifier;
|
|
71
|
+
}
|
|
72
|
+
if (options?.provider) {
|
|
73
|
+
request.provider = options.provider;
|
|
74
|
+
}
|
|
75
|
+
if (options?.pageSize !== undefined) {
|
|
76
|
+
request.pageSize = options.pageSize;
|
|
77
|
+
}
|
|
78
|
+
if (options?.pageToken) {
|
|
79
|
+
request.pageToken = options.pageToken;
|
|
80
|
+
}
|
|
81
|
+
if (options?.query) {
|
|
82
|
+
request.query = options.query;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return this.coreClient.connectExec(
|
|
86
|
+
this.client.listConnectedAccounts,
|
|
87
|
+
request
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Creates a new connected account.
|
|
93
|
+
*
|
|
94
|
+
* @param params Connected account creation parameters
|
|
95
|
+
*/
|
|
96
|
+
async createConnectedAccount(params: {
|
|
97
|
+
connector: string;
|
|
98
|
+
identifier: string;
|
|
99
|
+
connectedAccount: CreateConnectedAccount;
|
|
100
|
+
organizationId?: string;
|
|
101
|
+
userId?: string;
|
|
102
|
+
}): Promise<CreateConnectedAccountResponse> {
|
|
103
|
+
const {
|
|
104
|
+
connector,
|
|
105
|
+
identifier,
|
|
106
|
+
connectedAccount,
|
|
107
|
+
organizationId,
|
|
108
|
+
userId,
|
|
109
|
+
} = params;
|
|
110
|
+
|
|
111
|
+
const request: PartialMessage<CreateConnectedAccountRequest> = {
|
|
112
|
+
connector,
|
|
113
|
+
identifier,
|
|
114
|
+
connectedAccount,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
if (organizationId) {
|
|
118
|
+
request.organizationId = organizationId;
|
|
119
|
+
}
|
|
120
|
+
if (userId) {
|
|
121
|
+
request.userId = userId;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return this.coreClient.connectExec(
|
|
125
|
+
this.client.createConnectedAccount,
|
|
126
|
+
request
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Updates an existing connected account.
|
|
132
|
+
*
|
|
133
|
+
* You can target the account either by `connectedAccountId` or by the combination
|
|
134
|
+
* of `organizationId`/`userId`, `connector`, and `identifier`.
|
|
135
|
+
*/
|
|
136
|
+
async updateConnectedAccount(params: {
|
|
137
|
+
connector: string;
|
|
138
|
+
identifier: string;
|
|
139
|
+
connectedAccount: UpdateConnectedAccount;
|
|
140
|
+
organizationId?: string;
|
|
141
|
+
userId?: string;
|
|
142
|
+
connectedAccountId?: string;
|
|
143
|
+
}): Promise<UpdateConnectedAccountResponse> {
|
|
144
|
+
const {
|
|
145
|
+
connector,
|
|
146
|
+
identifier,
|
|
147
|
+
connectedAccount,
|
|
148
|
+
organizationId,
|
|
149
|
+
userId,
|
|
150
|
+
connectedAccountId,
|
|
151
|
+
} = params;
|
|
152
|
+
|
|
153
|
+
const request: PartialMessage<UpdateConnectedAccountRequest> = {
|
|
154
|
+
connector,
|
|
155
|
+
identifier,
|
|
156
|
+
connectedAccount,
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
if (organizationId) {
|
|
160
|
+
request.organizationId = organizationId;
|
|
161
|
+
}
|
|
162
|
+
if (userId) {
|
|
163
|
+
request.userId = userId;
|
|
164
|
+
}
|
|
165
|
+
if (connectedAccountId) {
|
|
166
|
+
request.id = connectedAccountId;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return this.coreClient.connectExec(
|
|
170
|
+
this.client.updateConnectedAccount,
|
|
171
|
+
request
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Deletes a connected account and revokes its credentials.
|
|
177
|
+
*
|
|
178
|
+
* You can target the account either by `connectedAccountId` or by the combination
|
|
179
|
+
* of `organizationId`/`userId`, `connector`, and `identifier`.
|
|
180
|
+
*/
|
|
181
|
+
async deleteConnectedAccount(params: {
|
|
182
|
+
connector: string;
|
|
183
|
+
identifier: string;
|
|
184
|
+
organizationId?: string;
|
|
185
|
+
userId?: string;
|
|
186
|
+
connectedAccountId?: string;
|
|
187
|
+
}): Promise<DeleteConnectedAccountResponse> {
|
|
188
|
+
const { connector, identifier, organizationId, userId, connectedAccountId } =
|
|
189
|
+
params;
|
|
190
|
+
|
|
191
|
+
const request: PartialMessage<DeleteConnectedAccountRequest> = {
|
|
192
|
+
connector,
|
|
193
|
+
identifier,
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
if (organizationId) {
|
|
197
|
+
request.organizationId = organizationId;
|
|
198
|
+
}
|
|
199
|
+
if (userId) {
|
|
200
|
+
request.userId = userId;
|
|
201
|
+
}
|
|
202
|
+
if (connectedAccountId) {
|
|
203
|
+
request.id = connectedAccountId;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return this.coreClient.connectExec(
|
|
207
|
+
this.client.deleteConnectedAccount,
|
|
208
|
+
request
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Generates a time-limited magic link for connecting or re-authorizing a third-party account.
|
|
214
|
+
*/
|
|
215
|
+
async getMagicLinkForConnectedAccount(params: {
|
|
216
|
+
connector: string;
|
|
217
|
+
identifier: string;
|
|
218
|
+
organizationId?: string;
|
|
219
|
+
userId?: string;
|
|
220
|
+
connectedAccountId?: string;
|
|
221
|
+
}): Promise<GetMagicLinkForConnectedAccountResponse> {
|
|
222
|
+
const { connector, identifier, organizationId, userId, connectedAccountId } =
|
|
223
|
+
params;
|
|
224
|
+
|
|
225
|
+
const request: PartialMessage<GetMagicLinkForConnectedAccountRequest> = {
|
|
226
|
+
connector,
|
|
227
|
+
identifier,
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
if (organizationId) {
|
|
231
|
+
request.organizationId = organizationId;
|
|
232
|
+
}
|
|
233
|
+
if (userId) {
|
|
234
|
+
request.userId = userId;
|
|
235
|
+
}
|
|
236
|
+
if (connectedAccountId) {
|
|
237
|
+
request.id = connectedAccountId;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return this.coreClient.connectExec(
|
|
241
|
+
this.client.getMagicLinkForConnectedAccount,
|
|
242
|
+
request
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Retrieves complete authentication details for a connected account.
|
|
248
|
+
*
|
|
249
|
+
* This method returns sensitive credential information, so ensure you protect access
|
|
250
|
+
* to this in your application.
|
|
251
|
+
*/
|
|
252
|
+
async getConnectedAccountByIdentifier(params: {
|
|
253
|
+
connector: string;
|
|
254
|
+
identifier: string;
|
|
255
|
+
organizationId?: string;
|
|
256
|
+
userId?: string;
|
|
257
|
+
connectedAccountId?: string;
|
|
258
|
+
}): Promise<GetConnectedAccountByIdentifierResponse> {
|
|
259
|
+
const { connector, identifier, organizationId, userId, connectedAccountId } =
|
|
260
|
+
params;
|
|
261
|
+
|
|
262
|
+
const request: PartialMessage<GetConnectedAccountByIdentifierRequest> = {
|
|
263
|
+
connector,
|
|
264
|
+
identifier,
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
if (organizationId) {
|
|
268
|
+
request.organizationId = organizationId;
|
|
269
|
+
}
|
|
270
|
+
if (userId) {
|
|
271
|
+
request.userId = userId;
|
|
272
|
+
}
|
|
273
|
+
if (connectedAccountId) {
|
|
274
|
+
request.id = connectedAccountId;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return this.coreClient.connectExec(
|
|
278
|
+
this.client.getConnectedAccountAuth,
|
|
279
|
+
request
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
package/src/core.ts
CHANGED
|
@@ -23,8 +23,8 @@ export default class CoreClient {
|
|
|
23
23
|
public keys: JWK[] = [];
|
|
24
24
|
public accessToken: string | null = null;
|
|
25
25
|
public axios: Axios;
|
|
26
|
-
public sdkVersion = `Scalekit-Node/2.
|
|
27
|
-
public apiVersion = "
|
|
26
|
+
public sdkVersion = `Scalekit-Node/2.2.0-beta.0`;
|
|
27
|
+
public apiVersion = "20260123";
|
|
28
28
|
public userAgent = `${this.sdkVersion} Node/${process.version} (${
|
|
29
29
|
process.platform
|
|
30
30
|
}; ${os.arch()})`;
|
package/src/domain.ts
CHANGED
|
@@ -114,7 +114,7 @@ export default class DomainClient {
|
|
|
114
114
|
},
|
|
115
115
|
domain: {
|
|
116
116
|
domain: name,
|
|
117
|
-
...(domainTypeValue && { domainType: domainTypeValue }),
|
|
117
|
+
...(!!domainTypeValue && { domainType: domainTypeValue }),
|
|
118
118
|
},
|
|
119
119
|
});
|
|
120
120
|
}
|
|
@@ -175,6 +175,20 @@ export default class DomainClient {
|
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
private resolveDomainType(
|
|
179
|
+
domainType?: DomainType | string
|
|
180
|
+
): DomainType | undefined {
|
|
181
|
+
if (domainType == null) return;
|
|
182
|
+
if (typeof domainType !== 'string') return domainType;
|
|
183
|
+
const resolved = DomainType[domainType as keyof typeof DomainType];
|
|
184
|
+
if (resolved === undefined) {
|
|
185
|
+
throw new Error(
|
|
186
|
+
`Invalid domain type: ${domainType}. Expected ALLOWED_EMAIL_DOMAIN or ORGANIZATION_DOMAIN`
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
return resolved;
|
|
190
|
+
}
|
|
191
|
+
|
|
178
192
|
/**
|
|
179
193
|
* Retrieves all domain configurations for an organization.
|
|
180
194
|
*
|
|
@@ -187,6 +201,8 @@ export default class DomainClient {
|
|
|
187
201
|
*
|
|
188
202
|
* @param {string} organizationId - The organization ID (format: "org_...")
|
|
189
203
|
*
|
|
204
|
+
* @param options Optional parameters for filtering domains
|
|
205
|
+
* @param {DomainType | string} options.domainType Filter domains by type (ALLOWED_EMAIL_DOMAIN or ORGANIZATION_DOMAIN)
|
|
190
206
|
* @returns {Promise<ListDomainResponse>} List of all domains with their configurations
|
|
191
207
|
*
|
|
192
208
|
* @example
|
|
@@ -209,13 +225,19 @@ export default class DomainClient {
|
|
|
209
225
|
* @see {@link getDomain} - Get details for a specific domain
|
|
210
226
|
* @see {@link deleteDomain} - Remove a domain
|
|
211
227
|
*/
|
|
212
|
-
async listDomains(organizationId: string): Promise<ListDomainResponse> {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
228
|
+
async listDomains(organizationId: string, options?: { domainType?: DomainType | string }): Promise<ListDomainResponse> {
|
|
229
|
+
const domainTypeValue = this.resolveDomainType(options?.domainType);
|
|
230
|
+
|
|
231
|
+
return this.coreClient.connectExec(
|
|
232
|
+
this.client.listDomains,
|
|
233
|
+
{
|
|
234
|
+
identities: {
|
|
235
|
+
case: 'organizationId',
|
|
236
|
+
value: organizationId
|
|
237
|
+
},
|
|
238
|
+
...(!!domainTypeValue && { domainType: domainTypeValue })
|
|
217
239
|
},
|
|
218
|
-
|
|
240
|
+
);
|
|
219
241
|
}
|
|
220
242
|
|
|
221
243
|
/**
|
|
@@ -45,6 +45,16 @@ export class ListAuthLogRequest extends Message<ListAuthLogRequest> {
|
|
|
45
45
|
*/
|
|
46
46
|
resourceId = "";
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* @generated from field: string connected_account_identifier = 8;
|
|
50
|
+
*/
|
|
51
|
+
connectedAccountIdentifier = "";
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @generated from field: string client_id = 9;
|
|
55
|
+
*/
|
|
56
|
+
clientId = "";
|
|
57
|
+
|
|
48
58
|
constructor(data?: PartialMessage<ListAuthLogRequest>) {
|
|
49
59
|
super();
|
|
50
60
|
proto3.util.initPartial(data, this);
|
|
@@ -60,6 +70,8 @@ export class ListAuthLogRequest extends Message<ListAuthLogRequest> {
|
|
|
60
70
|
{ no: 5, name: "start_time", kind: "message", T: Timestamp },
|
|
61
71
|
{ no: 6, name: "end_time", kind: "message", T: Timestamp },
|
|
62
72
|
{ no: 7, name: "resource_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
73
|
+
{ no: 8, name: "connected_account_identifier", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
74
|
+
{ no: 9, name: "client_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
63
75
|
]);
|
|
64
76
|
|
|
65
77
|
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ListAuthLogRequest {
|
|
@@ -208,6 +220,26 @@ export class AuthLogRequest extends Message<AuthLogRequest> {
|
|
|
208
220
|
*/
|
|
209
221
|
resourceType = "";
|
|
210
222
|
|
|
223
|
+
/**
|
|
224
|
+
* @generated from field: string connected_account_identifier = 15;
|
|
225
|
+
*/
|
|
226
|
+
connectedAccountIdentifier = "";
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* @generated from field: string client_id = 16;
|
|
230
|
+
*/
|
|
231
|
+
clientId = "";
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* @generated from field: string client_name = 17;
|
|
235
|
+
*/
|
|
236
|
+
clientName = "";
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @generated from field: string client_type = 18;
|
|
240
|
+
*/
|
|
241
|
+
clientType = "";
|
|
242
|
+
|
|
211
243
|
constructor(data?: PartialMessage<AuthLogRequest>) {
|
|
212
244
|
super();
|
|
213
245
|
proto3.util.initPartial(data, this);
|
|
@@ -230,6 +262,10 @@ export class AuthLogRequest extends Message<AuthLogRequest> {
|
|
|
230
262
|
{ no: 12, name: "resource_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
231
263
|
{ no: 13, name: "resource_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
232
264
|
{ no: 14, name: "resource_type", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
265
|
+
{ no: 15, name: "connected_account_identifier", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
266
|
+
{ no: 16, name: "client_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
267
|
+
{ no: 17, name: "client_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
268
|
+
{ no: 18, name: "client_type", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
233
269
|
]);
|
|
234
270
|
|
|
235
271
|
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AuthLogRequest {
|
|
@@ -116,6 +116,26 @@ export enum AuthState {
|
|
|
116
116
|
* @generated from enum value: WEBAUTHN_VERIFIED = 15;
|
|
117
117
|
*/
|
|
118
118
|
WEBAUTHN_VERIFIED = 15,
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @generated from enum value: VERIFICATION_MAGIC_LINK_SENT = 16;
|
|
122
|
+
*/
|
|
123
|
+
VERIFICATION_MAGIC_LINK_SENT = 16,
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @generated from enum value: VERIFICATION_MAGIC_LINK_OTP_SENT = 17;
|
|
127
|
+
*/
|
|
128
|
+
VERIFICATION_MAGIC_LINK_OTP_SENT = 17,
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @generated from enum value: VERIFICATION_OTP_SENT = 18;
|
|
132
|
+
*/
|
|
133
|
+
VERIFICATION_OTP_SENT = 18,
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @generated from enum value: VERIFICATION_COMPLETED = 19;
|
|
137
|
+
*/
|
|
138
|
+
VERIFICATION_COMPLETED = 19,
|
|
119
139
|
}
|
|
120
140
|
// Retrieve enum metadata with: proto3.getEnumType(AuthState)
|
|
121
141
|
proto3.util.setEnumType(AuthState, "scalekit.v1.auth.AuthState", [
|
|
@@ -135,6 +155,10 @@ proto3.util.setEnumType(AuthState, "scalekit.v1.auth.AuthState", [
|
|
|
135
155
|
{ no: 13, name: "AUTHENTICATION_COMPLETED" },
|
|
136
156
|
{ no: 14, name: "AUTHENTICATION_FAILED" },
|
|
137
157
|
{ no: 15, name: "WEBAUTHN_VERIFIED" },
|
|
158
|
+
{ no: 16, name: "VERIFICATION_MAGIC_LINK_SENT" },
|
|
159
|
+
{ no: 17, name: "VERIFICATION_MAGIC_LINK_OTP_SENT" },
|
|
160
|
+
{ no: 18, name: "VERIFICATION_OTP_SENT" },
|
|
161
|
+
{ no: 19, name: "VERIFICATION_COMPLETED" },
|
|
138
162
|
]);
|
|
139
163
|
|
|
140
164
|
/**
|
|
@@ -1073,6 +1097,11 @@ export class GetAuthStateResponse extends Message<GetAuthStateResponse> {
|
|
|
1073
1097
|
*/
|
|
1074
1098
|
authState = AuthState.AUTH_STATE_UNSPECIFIED;
|
|
1075
1099
|
|
|
1100
|
+
/**
|
|
1101
|
+
* @generated from field: scalekit.v1.auth.UserDetails user = 2;
|
|
1102
|
+
*/
|
|
1103
|
+
user?: UserDetails;
|
|
1104
|
+
|
|
1076
1105
|
constructor(data?: PartialMessage<GetAuthStateResponse>) {
|
|
1077
1106
|
super();
|
|
1078
1107
|
proto3.util.initPartial(data, this);
|
|
@@ -1082,6 +1111,7 @@ export class GetAuthStateResponse extends Message<GetAuthStateResponse> {
|
|
|
1082
1111
|
static readonly typeName = "scalekit.v1.auth.GetAuthStateResponse";
|
|
1083
1112
|
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
1084
1113
|
{ no: 1, name: "auth_state", kind: "enum", T: proto3.getEnumType(AuthState) },
|
|
1114
|
+
{ no: 2, name: "user", kind: "message", T: UserDetails },
|
|
1085
1115
|
]);
|
|
1086
1116
|
|
|
1087
1117
|
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetAuthStateResponse {
|
|
@@ -247,6 +247,11 @@ export class OrganizationMembership extends Message<OrganizationMembership> {
|
|
|
247
247
|
*/
|
|
248
248
|
provisioningMethod?: string;
|
|
249
249
|
|
|
250
|
+
/**
|
|
251
|
+
* @generated from field: repeated string permissions = 15;
|
|
252
|
+
*/
|
|
253
|
+
permissions: string[] = [];
|
|
254
|
+
|
|
250
255
|
constructor(data?: PartialMessage<OrganizationMembership>) {
|
|
251
256
|
super();
|
|
252
257
|
proto3.util.initPartial(data, this);
|
|
@@ -267,6 +272,7 @@ export class OrganizationMembership extends Message<OrganizationMembership> {
|
|
|
267
272
|
{ no: 12, name: "accepted_at", kind: "message", T: Timestamp, opt: true },
|
|
268
273
|
{ no: 13, name: "expires_at", kind: "message", T: Timestamp, opt: true },
|
|
269
274
|
{ no: 14, name: "provisioning_method", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
275
|
+
{ no: 15, name: "permissions", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
|
|
270
276
|
]);
|
|
271
277
|
|
|
272
278
|
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): OrganizationMembership {
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts"
|
|
2
|
+
// @generated from file scalekit/v1/connected_accounts/connected_accounts.proto (package scalekit.v1.connected_accounts, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-nocheck
|
|
5
|
+
|
|
6
|
+
import { CreateConnectedAccountRequest, CreateConnectedAccountResponse, DeleteConnectedAccountRequest, DeleteConnectedAccountResponse, GetConnectedAccountByIdentifierRequest, GetConnectedAccountByIdentifierResponse, GetMagicLinkForConnectedAccountRequest, GetMagicLinkForConnectedAccountResponse, ListConnectedAccountsRequest, ListConnectedAccountsResponse, SearchConnectedAccountsRequest, SearchConnectedAccountsResponse, UpdateConnectedAccountRequest, UpdateConnectedAccountResponse } from "./connected_accounts_pb.js";
|
|
7
|
+
import { MethodKind } from "@bufbuild/protobuf";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @generated from service scalekit.v1.connected_accounts.ConnectedAccountService
|
|
11
|
+
*/
|
|
12
|
+
export const ConnectedAccountService = {
|
|
13
|
+
typeName: "scalekit.v1.connected_accounts.ConnectedAccountService",
|
|
14
|
+
methods: {
|
|
15
|
+
/**
|
|
16
|
+
* List Connected Accounts
|
|
17
|
+
*
|
|
18
|
+
* @generated from rpc scalekit.v1.connected_accounts.ConnectedAccountService.ListConnectedAccounts
|
|
19
|
+
*/
|
|
20
|
+
listConnectedAccounts: {
|
|
21
|
+
name: "ListConnectedAccounts",
|
|
22
|
+
I: ListConnectedAccountsRequest,
|
|
23
|
+
O: ListConnectedAccountsResponse,
|
|
24
|
+
kind: MethodKind.Unary,
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* Search Connected Accounts
|
|
28
|
+
*
|
|
29
|
+
* @generated from rpc scalekit.v1.connected_accounts.ConnectedAccountService.SearchConnectedAccounts
|
|
30
|
+
*/
|
|
31
|
+
searchConnectedAccounts: {
|
|
32
|
+
name: "SearchConnectedAccounts",
|
|
33
|
+
I: SearchConnectedAccountsRequest,
|
|
34
|
+
O: SearchConnectedAccountsResponse,
|
|
35
|
+
kind: MethodKind.Unary,
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* Create Connected Account
|
|
39
|
+
*
|
|
40
|
+
* @generated from rpc scalekit.v1.connected_accounts.ConnectedAccountService.CreateConnectedAccount
|
|
41
|
+
*/
|
|
42
|
+
createConnectedAccount: {
|
|
43
|
+
name: "CreateConnectedAccount",
|
|
44
|
+
I: CreateConnectedAccountRequest,
|
|
45
|
+
O: CreateConnectedAccountResponse,
|
|
46
|
+
kind: MethodKind.Unary,
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* Update Connected Account
|
|
50
|
+
*
|
|
51
|
+
* @generated from rpc scalekit.v1.connected_accounts.ConnectedAccountService.UpdateConnectedAccount
|
|
52
|
+
*/
|
|
53
|
+
updateConnectedAccount: {
|
|
54
|
+
name: "UpdateConnectedAccount",
|
|
55
|
+
I: UpdateConnectedAccountRequest,
|
|
56
|
+
O: UpdateConnectedAccountResponse,
|
|
57
|
+
kind: MethodKind.Unary,
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* Delete Connected Account
|
|
61
|
+
*
|
|
62
|
+
* @generated from rpc scalekit.v1.connected_accounts.ConnectedAccountService.DeleteConnectedAccount
|
|
63
|
+
*/
|
|
64
|
+
deleteConnectedAccount: {
|
|
65
|
+
name: "DeleteConnectedAccount",
|
|
66
|
+
I: DeleteConnectedAccountRequest,
|
|
67
|
+
O: DeleteConnectedAccountResponse,
|
|
68
|
+
kind: MethodKind.Unary,
|
|
69
|
+
},
|
|
70
|
+
/**
|
|
71
|
+
* Generate Magic Link for Account Connection
|
|
72
|
+
*
|
|
73
|
+
* @generated from rpc scalekit.v1.connected_accounts.ConnectedAccountService.GetMagicLinkForConnectedAccount
|
|
74
|
+
*/
|
|
75
|
+
getMagicLinkForConnectedAccount: {
|
|
76
|
+
name: "GetMagicLinkForConnectedAccount",
|
|
77
|
+
I: GetMagicLinkForConnectedAccountRequest,
|
|
78
|
+
O: GetMagicLinkForConnectedAccountResponse,
|
|
79
|
+
kind: MethodKind.Unary,
|
|
80
|
+
},
|
|
81
|
+
/**
|
|
82
|
+
* Get Connected Account Authentication Details
|
|
83
|
+
*
|
|
84
|
+
* @generated from rpc scalekit.v1.connected_accounts.ConnectedAccountService.GetConnectedAccountAuth
|
|
85
|
+
*/
|
|
86
|
+
getConnectedAccountAuth: {
|
|
87
|
+
name: "GetConnectedAccountAuth",
|
|
88
|
+
I: GetConnectedAccountByIdentifierRequest,
|
|
89
|
+
O: GetConnectedAccountByIdentifierResponse,
|
|
90
|
+
kind: MethodKind.Unary,
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
} as const;
|
|
94
|
+
|