@qlever-llc/trellis-svelte 0.8.4 → 0.9.0-rc.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qlever-llc/trellis-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0-rc.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Svelte components and state helpers for Trellis browser applications.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@nats-io/nats-core": "^3.3.1",
|
|
32
|
-
"@qlever-llc/result": "
|
|
33
|
-
"@qlever-llc/trellis": "
|
|
32
|
+
"@qlever-llc/result": "0.9.0-rc.2",
|
|
33
|
+
"@qlever-llc/trellis": "0.9.0-rc.2",
|
|
34
34
|
"typebox": "^1.0.15"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { BaseError } from "@qlever-llc/result";
|
|
2
2
|
import type { AsyncResult } from "@qlever-llc/result";
|
|
3
3
|
import type {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
AuthResolveDeviceUserAuthoritiesOutput,
|
|
5
|
+
AuthResolveDeviceUserAuthoritiesProgress,
|
|
6
6
|
} from "@qlever-llc/trellis/auth";
|
|
7
7
|
import type { OperationEvent, TerminalOperation } from "@qlever-llc/trellis";
|
|
8
8
|
import {
|
|
@@ -63,12 +63,18 @@ export type DeviceActivationControllerConfig = {
|
|
|
63
63
|
export type DeviceActivationOperationRef = {
|
|
64
64
|
watch(): AsyncResult<
|
|
65
65
|
AsyncIterable<
|
|
66
|
-
OperationEvent<
|
|
66
|
+
OperationEvent<
|
|
67
|
+
AuthResolveDeviceUserAuthoritiesProgress,
|
|
68
|
+
AuthResolveDeviceUserAuthoritiesOutput
|
|
69
|
+
>
|
|
67
70
|
>,
|
|
68
71
|
BaseError
|
|
69
72
|
>;
|
|
70
73
|
wait(): AsyncResult<
|
|
71
|
-
TerminalOperation<
|
|
74
|
+
TerminalOperation<
|
|
75
|
+
AuthResolveDeviceUserAuthoritiesProgress,
|
|
76
|
+
AuthResolveDeviceUserAuthoritiesOutput
|
|
77
|
+
>,
|
|
72
78
|
BaseError
|
|
73
79
|
>;
|
|
74
80
|
};
|
|
@@ -334,8 +340,8 @@ export class DeviceActivationControllerCore {
|
|
|
334
340
|
#applyTerminal(
|
|
335
341
|
flowId: string,
|
|
336
342
|
terminal: TerminalOperation<
|
|
337
|
-
|
|
338
|
-
|
|
343
|
+
AuthResolveDeviceUserAuthoritiesProgress,
|
|
344
|
+
AuthResolveDeviceUserAuthoritiesOutput
|
|
339
345
|
>,
|
|
340
346
|
): void {
|
|
341
347
|
const view = mapDeviceActivationTerminal(flowId, terminal);
|
|
@@ -353,7 +359,10 @@ export class DeviceActivationControllerCore {
|
|
|
353
359
|
async #observeWatch(
|
|
354
360
|
flowId: string,
|
|
355
361
|
watch: AsyncIterable<
|
|
356
|
-
OperationEvent<
|
|
362
|
+
OperationEvent<
|
|
363
|
+
AuthResolveDeviceUserAuthoritiesProgress,
|
|
364
|
+
AuthResolveDeviceUserAuthoritiesOutput
|
|
365
|
+
>
|
|
357
366
|
>,
|
|
358
367
|
runId: number,
|
|
359
368
|
): Promise<boolean> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AuthResolveDeviceUserAuthoritiesOutput } from "@qlever-llc/trellis/auth";
|
|
2
2
|
import type { TerminalOperation } from "@qlever-llc/trellis";
|
|
3
3
|
|
|
4
4
|
type DeviceActivationProgressInput = {
|
|
@@ -8,12 +8,12 @@ type DeviceActivationProgressInput = {
|
|
|
8
8
|
requestedAt: string | Date;
|
|
9
9
|
};
|
|
10
10
|
type PendingReviewDeviceActivationOutput = Extract<
|
|
11
|
-
|
|
11
|
+
AuthResolveDeviceUserAuthoritiesOutput,
|
|
12
12
|
{ status: "pending_review" }
|
|
13
13
|
>;
|
|
14
14
|
|
|
15
15
|
function isDeviceActivationProgressInput(
|
|
16
|
-
value:
|
|
16
|
+
value: AuthResolveDeviceUserAuthoritiesOutput,
|
|
17
17
|
): value is PendingReviewDeviceActivationOutput {
|
|
18
18
|
const record = value as Record<string, unknown>;
|
|
19
19
|
return record.status === "pending_review" &&
|
|
@@ -115,7 +115,7 @@ export function createInvalidDeviceActivationView(
|
|
|
115
115
|
|
|
116
116
|
export function mapDeviceActivationOutput(
|
|
117
117
|
flowId: string,
|
|
118
|
-
result:
|
|
118
|
+
result: AuthResolveDeviceUserAuthoritiesOutput,
|
|
119
119
|
): DeviceActivationView {
|
|
120
120
|
if (result.status === "activated") {
|
|
121
121
|
return {
|
|
@@ -253,7 +253,7 @@ export function mapDeviceActivationFailure(
|
|
|
253
253
|
|
|
254
254
|
export function mapDeviceActivationTerminal(
|
|
255
255
|
flowId: string,
|
|
256
|
-
terminal: TerminalOperation<unknown,
|
|
256
|
+
terminal: TerminalOperation<unknown, AuthResolveDeviceUserAuthoritiesOutput>,
|
|
257
257
|
): DeviceActivationView | null {
|
|
258
258
|
if (terminal.state === "completed") {
|
|
259
259
|
return terminal.output
|