@jive-sh/server-client 0.2.0 → 0.4.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.
@@ -20,6 +20,39 @@ import type { GenericId as Id } from "convex/values";
20
20
  * ```
21
21
  */
22
22
  export declare const api: {
23
+ accounts: {
24
+ me: FunctionReference<
25
+ "query",
26
+ "public",
27
+ { sessionToken: string },
28
+ null | {
29
+ createdAt: number;
30
+ passkeys: Array<{ createdAt: number; credentialId: string }>;
31
+ username: string;
32
+ }
33
+ >;
34
+ };
35
+ auth: {
36
+ register: FunctionReference<
37
+ "action",
38
+ "public",
39
+ { challenge: string; response: any; signInRequestId?: string },
40
+ { expiresAt: number; sessionToken: string; username: string }
41
+ >;
42
+ registrationOptions: FunctionReference<
43
+ "action",
44
+ "public",
45
+ {},
46
+ { options: any }
47
+ >;
48
+ signIn: FunctionReference<
49
+ "action",
50
+ "public",
51
+ { challenge: string; response: any; signInRequestId?: string },
52
+ { expiresAt: number; sessionToken: string; username: string }
53
+ >;
54
+ signInOptions: FunctionReference<"action", "public", {}, { options: any }>;
55
+ };
23
56
  connections: {
24
57
  completeNpmConnection: FunctionReference<
25
58
  "action",
@@ -38,6 +71,62 @@ export declare const api: {
38
71
  | { reason: string; status: "refused" }
39
72
  >;
40
73
  };
74
+ sessions: {
75
+ signOut: FunctionReference<
76
+ "mutation",
77
+ "public",
78
+ { sessionToken: string },
79
+ null
80
+ >;
81
+ };
82
+ signInRequests: {
83
+ claim: FunctionReference<
84
+ "action",
85
+ "public",
86
+ { claimSecret: string; requestId: string },
87
+ | { status: "pending" }
88
+ | { expiresAt: number; sessionToken: string; status: "approved" }
89
+ | { status: "gone" }
90
+ >;
91
+ describe: FunctionReference<
92
+ "query",
93
+ "public",
94
+ { requestId: string },
95
+ null | { confirmationCode: string; status: "pending" | "approved" }
96
+ >;
97
+ open: FunctionReference<
98
+ "action",
99
+ "public",
100
+ {},
101
+ {
102
+ claimSecret: string;
103
+ confirmationCode: string;
104
+ expiresAt: number;
105
+ loginUrl: string;
106
+ requestId: string;
107
+ }
108
+ >;
109
+ };
110
+ ssh: {
111
+ createKey: FunctionReference<
112
+ "action",
113
+ "public",
114
+ { sessionToken: string },
115
+ { publicKey: string }
116
+ >;
117
+ publicKey: FunctionReference<
118
+ "query",
119
+ "public",
120
+ { sessionToken: string },
121
+ null | { publicKey: string }
122
+ >;
123
+ sign: FunctionReference<
124
+ "action",
125
+ "public",
126
+ { data: ArrayBuffer; sessionToken: string },
127
+ { signature: ArrayBuffer }
128
+ >;
129
+ };
41
130
  };
42
131
 
43
132
  /**
@@ -49,6 +138,69 @@ export declare const api: {
49
138
  * ```
50
139
  */
51
140
  export declare const internal: {
141
+ auth: {
142
+ createAccount: FunctionReference<
143
+ "mutation",
144
+ "internal",
145
+ {
146
+ credentialId: string;
147
+ publicKey: string;
148
+ signInRequestId?: string;
149
+ tokenHash: string;
150
+ username: string;
151
+ webAuthnUserId: string;
152
+ },
153
+ { expiresAt: number }
154
+ >;
155
+ deleteChallenge: FunctionReference<
156
+ "mutation",
157
+ "internal",
158
+ { id: Id<"webAuthnChallenges"> },
159
+ null
160
+ >;
161
+ openSession: FunctionReference<
162
+ "mutation",
163
+ "internal",
164
+ {
165
+ accountId: Id<"accounts">;
166
+ signInRequestId?: string;
167
+ tokenHash: string;
168
+ },
169
+ { expiresAt: number; username: string }
170
+ >;
171
+ passkeyByCredentialId: FunctionReference<
172
+ "query",
173
+ "internal",
174
+ { credentialId: string },
175
+ null | {
176
+ accountId: Id<"accounts">;
177
+ credentialId: string;
178
+ publicKey: string;
179
+ }
180
+ >;
181
+ spendChallenge: FunctionReference<
182
+ "mutation",
183
+ "internal",
184
+ { challengeHash: string; purpose: "registration" | "signIn" },
185
+ null | { registration?: { username: string; webAuthnUserId: string } }
186
+ >;
187
+ storeChallenge: FunctionReference<
188
+ "mutation",
189
+ "internal",
190
+ {
191
+ challengeHash: string;
192
+ purpose: "registration" | "signIn";
193
+ registration?: { username: string; webAuthnUserId: string };
194
+ },
195
+ null
196
+ >;
197
+ usernameTaken: FunctionReference<
198
+ "query",
199
+ "internal",
200
+ { username: string },
201
+ boolean
202
+ >;
203
+ };
52
204
  connections: {
53
205
  openNpmConnectionRequest: FunctionReference<
54
206
  "action",
@@ -125,6 +277,17 @@ export declare const internal: {
125
277
  >;
126
278
  };
127
279
  seed: {
280
+ accountWithPasskey: FunctionReference<
281
+ "mutation",
282
+ "internal",
283
+ {
284
+ credentialId: string;
285
+ passkeyCreatedAt: number;
286
+ publicKey: string;
287
+ webAuthnUserId: string;
288
+ },
289
+ { created: boolean; username: string }
290
+ >;
128
291
  organizationWithRepository: FunctionReference<
129
292
  "mutation",
130
293
  "internal",
@@ -143,6 +306,57 @@ export declare const internal: {
143
306
  }
144
307
  >;
145
308
  };
309
+ signInRequests: {
310
+ claimWithToken: FunctionReference<
311
+ "mutation",
312
+ "internal",
313
+ { claimSecretHash: string; requestId: string; tokenHash: string },
314
+ | { status: "pending" }
315
+ | { expiresAt: number; status: "approved" }
316
+ | { status: "gone" }
317
+ >;
318
+ deleteRequest: FunctionReference<
319
+ "mutation",
320
+ "internal",
321
+ { id: Id<"signInRequests"> },
322
+ null
323
+ >;
324
+ store: FunctionReference<
325
+ "mutation",
326
+ "internal",
327
+ { claimSecretHash: string; confirmationCode: string },
328
+ { expiresAt: number; requestId: string }
329
+ >;
330
+ };
331
+ ssh: {
332
+ caller: FunctionReference<
333
+ "query",
334
+ "internal",
335
+ { sessionToken: string },
336
+ null | {
337
+ accountId: Id<"accounts">;
338
+ publicKey: null | string;
339
+ username: string;
340
+ }
341
+ >;
342
+ sealedKey: FunctionReference<
343
+ "query",
344
+ "internal",
345
+ { sessionToken: string },
346
+ null | { sealed: null | { keyVersion: number; sealedPrivateKey: string } }
347
+ >;
348
+ storeKey: FunctionReference<
349
+ "mutation",
350
+ "internal",
351
+ {
352
+ accountId: Id<"accounts">;
353
+ keyVersion: number;
354
+ publicKey: string;
355
+ sealedPrivateKey: string;
356
+ },
357
+ string
358
+ >;
359
+ };
146
360
  };
147
361
 
148
362
  export declare const components: {
@@ -27,6 +27,24 @@ import type { GenericId } from "convex/values";
27
27
  */
28
28
 
29
29
  export type DataModel = {
30
+ accounts: {
31
+ document: {
32
+ createdAt: number;
33
+ username: string;
34
+ webAuthnUserId: string;
35
+ _id: Id<"accounts">;
36
+ _creationTime: number;
37
+ };
38
+ fieldPaths:
39
+ "_creationTime" | "_id" | "createdAt" | "username" | "webAuthnUserId";
40
+ indexes: {
41
+ by_id: ["_id"];
42
+ by_creation_time: ["_creationTime"];
43
+ by_username: ["username", "_creationTime"];
44
+ };
45
+ searchIndexes: {};
46
+ vectorIndexes: {};
47
+ };
30
48
  codeRepositories: {
31
49
  document: {
32
50
  name: string;
@@ -144,6 +162,31 @@ export type DataModel = {
144
162
  searchIndexes: {};
145
163
  vectorIndexes: {};
146
164
  };
165
+ passkeys: {
166
+ document: {
167
+ accountId: Id<"accounts">;
168
+ createdAt: number;
169
+ credentialId: string;
170
+ publicKey: string;
171
+ _id: Id<"passkeys">;
172
+ _creationTime: number;
173
+ };
174
+ fieldPaths:
175
+ | "_creationTime"
176
+ | "_id"
177
+ | "accountId"
178
+ | "createdAt"
179
+ | "credentialId"
180
+ | "publicKey";
181
+ indexes: {
182
+ by_id: ["_id"];
183
+ by_creation_time: ["_creationTime"];
184
+ by_account: ["accountId", "_creationTime"];
185
+ by_credential_id: ["credentialId", "_creationTime"];
186
+ };
187
+ searchIndexes: {};
188
+ vectorIndexes: {};
189
+ };
147
190
  provisioningClaims: {
148
191
  document: {
149
192
  expiresAt: number;
@@ -168,6 +211,112 @@ export type DataModel = {
168
211
  searchIndexes: {};
169
212
  vectorIndexes: {};
170
213
  };
214
+ sessions: {
215
+ document: {
216
+ accountId: Id<"accounts">;
217
+ createdAt: number;
218
+ expiresAt: number;
219
+ origin: "browser" | "signInRequest";
220
+ revokedAt?: number;
221
+ tokenHash: string;
222
+ _id: Id<"sessions">;
223
+ _creationTime: number;
224
+ };
225
+ fieldPaths:
226
+ | "_creationTime"
227
+ | "_id"
228
+ | "accountId"
229
+ | "createdAt"
230
+ | "expiresAt"
231
+ | "origin"
232
+ | "revokedAt"
233
+ | "tokenHash";
234
+ indexes: {
235
+ by_id: ["_id"];
236
+ by_creation_time: ["_creationTime"];
237
+ by_account: ["accountId", "_creationTime"];
238
+ by_token_hash: ["tokenHash", "_creationTime"];
239
+ };
240
+ searchIndexes: {};
241
+ vectorIndexes: {};
242
+ };
243
+ signInRequests: {
244
+ document: {
245
+ approvedAccountId?: Id<"accounts">;
246
+ claimSecretHash: string;
247
+ claimedAt?: number;
248
+ confirmationCode: string;
249
+ expiresAt: number;
250
+ _id: Id<"signInRequests">;
251
+ _creationTime: number;
252
+ };
253
+ fieldPaths:
254
+ | "_creationTime"
255
+ | "_id"
256
+ | "approvedAccountId"
257
+ | "claimedAt"
258
+ | "claimSecretHash"
259
+ | "confirmationCode"
260
+ | "expiresAt";
261
+ indexes: {
262
+ by_id: ["_id"];
263
+ by_creation_time: ["_creationTime"];
264
+ };
265
+ searchIndexes: {};
266
+ vectorIndexes: {};
267
+ };
268
+ sshKeys: {
269
+ document: {
270
+ accountId: Id<"accounts">;
271
+ createdAt: number;
272
+ keyVersion: number;
273
+ publicKey: string;
274
+ sealedPrivateKey: string;
275
+ _id: Id<"sshKeys">;
276
+ _creationTime: number;
277
+ };
278
+ fieldPaths:
279
+ | "_creationTime"
280
+ | "_id"
281
+ | "accountId"
282
+ | "createdAt"
283
+ | "keyVersion"
284
+ | "publicKey"
285
+ | "sealedPrivateKey";
286
+ indexes: {
287
+ by_id: ["_id"];
288
+ by_creation_time: ["_creationTime"];
289
+ by_account: ["accountId", "_creationTime"];
290
+ };
291
+ searchIndexes: {};
292
+ vectorIndexes: {};
293
+ };
294
+ webAuthnChallenges: {
295
+ document: {
296
+ challengeHash: string;
297
+ expiresAt: number;
298
+ purpose: "registration" | "signIn";
299
+ registration?: { username: string; webAuthnUserId: string };
300
+ _id: Id<"webAuthnChallenges">;
301
+ _creationTime: number;
302
+ };
303
+ fieldPaths:
304
+ | "_creationTime"
305
+ | "_id"
306
+ | "challengeHash"
307
+ | "expiresAt"
308
+ | "purpose"
309
+ | "registration"
310
+ | "registration.username"
311
+ | "registration.webAuthnUserId";
312
+ indexes: {
313
+ by_id: ["_id"];
314
+ by_creation_time: ["_creationTime"];
315
+ by_challenge_hash: ["challengeHash", "_creationTime"];
316
+ };
317
+ searchIndexes: {};
318
+ vectorIndexes: {};
319
+ };
171
320
  };
172
321
 
173
322
  /**
package/index.js CHANGED
@@ -4,4 +4,4 @@ export const convexUrl = "https://adventurous-viper-740.convex.cloud";
4
4
  /** Where this environment's HTTP actions are served. */
5
5
  export const convexSiteUrl = "https://adventurous-viper-740.convex.site";
6
6
  /** Which deploy these functions came from. */
7
- export const deployment = {"environment":"latest","sourceCommitSha":"3abfe16ea6078162761728d898d3ec45211fae86","version":"0.2.0"};
7
+ export const deployment = {"environment":"latest","sourceCommitSha":"52617a321d77c406e238e6066b8794b4150a193b","version":"0.4.0"};
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@jive-sh/server-client",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "license": "MIT",
5
- "description": "Jive's central server: the Convex backend that holds organizations, code repositories, connections and packages, and provisions packages for pipelines that sign in with their GitHub Actions ID token.",
5
+ "description": "Jive's central server: the Convex backend that holds accounts, passkeys and sessions, organizations, code repositories, connections and packages; people sign in with jive.sh passkeys, programs through sign-in requests, and pipelines provision packages with their GitHub Actions ID token.",
6
6
  "type": "module",
7
7
  "repository": {
8
8
  "type": "git",