jazz-vue 0.9.22 → 0.10.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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +29 -0
- package/dist/auth/useDemoAuth.d.ts +5 -55
- package/dist/auth/useIsAuthenticated.d.ts +1 -0
- package/dist/auth/usePasskeyAuth.d.ts +18 -0
- package/dist/auth/usePassphraseAuth.d.ts +18 -0
- package/dist/composables.d.ts +8 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +367 -243
- package/dist/index.js.map +1 -0
- package/dist/provider-CkA-a4Og.js +86 -0
- package/dist/provider-CkA-a4Og.js.map +1 -0
- package/dist/provider.d.ts +39 -13
- package/dist/testing.d.ts +13 -3
- package/dist/testing.js +29 -17
- package/dist/testing.js.map +1 -0
- package/dist/tests/fixtures.d.ts +1 -0
- package/dist/tests/testUtils.d.ts +3 -2
- package/dist/tests/usePassphraseAuth.test.d.ts +1 -0
- package/package.json +7 -6
- package/src/auth/DemoAuthBasicUI.vue +115 -113
- package/src/auth/useDemoAuth.ts +31 -71
- package/src/auth/useIsAuthenticated.ts +18 -0
- package/src/auth/usePasskeyAuth.ts +46 -0
- package/src/auth/usePassphraseAuth.ts +56 -0
- package/src/composables.ts +36 -22
- package/src/index.ts +2 -0
- package/src/provider.ts +55 -56
- package/src/testing.ts +16 -5
- package/src/tests/fixtures.ts +2050 -0
- package/src/tests/testUtils.ts +8 -1
- package/src/tests/useCoState.test.ts +33 -4
- package/src/tests/usePassphraseAuth.test.ts +95 -0
- package/vite.config.ts +2 -0
- package/dist/provider-BZnz6FpX.js +0 -69
package/.turbo/turbo-build.log
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
|
2
|
-
> jazz-vue@0.
|
2
|
+
> jazz-vue@0.10.0 build /home/runner/_work/jazz/jazz/packages/jazz-vue
|
3
3
|
> rm -rf ./dist && vite build
|
4
4
|
|
5
|
-
[36mvite
|
5
|
+
[36mvite v6.0.11 [32mbuilding for production...[36m[39m
|
6
6
|
transforming...
|
7
|
-
[32m✓[39m
|
7
|
+
[32m✓[39m 12 modules transformed.
|
8
8
|
rendering chunks...
|
9
9
|
|
10
10
|
[vite:dts] Start generate declaration files...
|
11
11
|
computing gzip size...
|
12
|
-
[2mdist/[22m[36mtesting.js [39m[1m[
|
13
|
-
[2mdist/[22m[36mprovider-
|
14
|
-
[2mdist/[22m[36mindex.js [39m[1m[
|
15
|
-
[vite:dts] Declaration files built in
|
12
|
+
[2mdist/[22m[36mtesting.js [39m[1m[2m 1.19 kB[22m[1m[22m[2m │ gzip: 0.52 kB[22m[2m │ map: 1.70 kB[22m
|
13
|
+
[2mdist/[22m[36mprovider-CkA-a4Og.js [39m[1m[2m 2.32 kB[22m[1m[22m[2m │ gzip: 0.81 kB[22m[2m │ map: 4.44 kB[22m
|
14
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m13.80 kB[22m[1m[22m[2m │ gzip: 3.50 kB[22m[2m │ map: 22.13 kB[22m
|
15
|
+
[vite:dts] Declaration files built in 6832ms.
|
16
16
|
|
17
|
-
[32m✓ built in
|
17
|
+
[32m✓ built in 6.98s[39m
|
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,34 @@
|
|
1
1
|
# jazz-react
|
2
2
|
|
3
|
+
## 0.10.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- b426342: Return null when a coValue is not found
|
8
|
+
|
9
|
+
### Patch Changes
|
10
|
+
|
11
|
+
- Updated dependencies [b426342]
|
12
|
+
- Updated dependencies [498954f]
|
13
|
+
- Updated dependencies [8217981]
|
14
|
+
- Updated dependencies [d42c2aa]
|
15
|
+
- Updated dependencies [dd03464]
|
16
|
+
- Updated dependencies [b426342]
|
17
|
+
- Updated dependencies [ac3d9fa]
|
18
|
+
- Updated dependencies [610543c]
|
19
|
+
- cojson@0.10.0
|
20
|
+
- jazz-browser@0.10.0
|
21
|
+
- jazz-tools@0.10.0
|
22
|
+
|
23
|
+
## 0.9.23
|
24
|
+
|
25
|
+
### Patch Changes
|
26
|
+
|
27
|
+
- Updated dependencies [70c9a5d]
|
28
|
+
- cojson@0.9.23
|
29
|
+
- jazz-browser@0.9.23
|
30
|
+
- jazz-tools@0.9.23
|
31
|
+
|
3
32
|
## 0.9.22
|
4
33
|
|
5
34
|
### Patch Changes
|
@@ -1,56 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
state: "uninitialized";
|
6
|
-
} | {
|
7
|
-
state: "loading";
|
8
|
-
} | {
|
9
|
-
state: "ready";
|
1
|
+
export declare function useDemoAuth(): import('vue').ComputedRef<{
|
2
|
+
state: string;
|
3
|
+
logIn(username: string): void;
|
4
|
+
signUp(username: string): void;
|
10
5
|
existingUsers: string[];
|
11
|
-
|
12
|
-
logInAs: (existingUser: string) => void;
|
13
|
-
} | {
|
14
|
-
state: "signedIn";
|
15
|
-
logOut: () => void;
|
16
|
-
}) & {
|
17
|
-
errors: string[];
|
18
|
-
};
|
19
|
-
/** @category Auth Providers */
|
20
|
-
export declare function useDemoAuth({ seedAccounts, }?: {
|
21
|
-
seedAccounts?: {
|
22
|
-
[name: string]: {
|
23
|
-
accountID: ID<Account>;
|
24
|
-
accountSecret: AgentSecret;
|
25
|
-
};
|
26
|
-
};
|
27
|
-
}): {
|
28
|
-
authMethod: import('vue').Ref<{
|
29
|
-
driver: {
|
30
|
-
onReady: (next: {
|
31
|
-
signUp: (username: string) => Promise<void>;
|
32
|
-
existingUsers: string[];
|
33
|
-
logInAs: (existingUser: string) => Promise<void>;
|
34
|
-
}) => void;
|
35
|
-
onSignedIn: (next: {
|
36
|
-
logOut: () => void;
|
37
|
-
}) => void;
|
38
|
-
onError: (error: string | Error) => void;
|
39
|
-
};
|
40
|
-
start: () => Promise<import('jazz-tools').AuthResult>;
|
41
|
-
}, BrowserDemoAuth | {
|
42
|
-
driver: {
|
43
|
-
onReady: (next: {
|
44
|
-
signUp: (username: string) => Promise<void>;
|
45
|
-
existingUsers: string[];
|
46
|
-
logInAs: (existingUser: string) => Promise<void>;
|
47
|
-
}) => void;
|
48
|
-
onSignedIn: (next: {
|
49
|
-
logOut: () => void;
|
50
|
-
}) => void;
|
51
|
-
onError: (error: string | Error) => void;
|
52
|
-
};
|
53
|
-
start: () => Promise<import('jazz-tools').AuthResult>;
|
54
|
-
}>;
|
55
|
-
state: import('vue').Reactive<DemoAuthState>;
|
56
|
-
};
|
6
|
+
}>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function useIsAuthenticated(): import('vue').Ref<boolean, boolean>;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* `usePasskeyAuth` composable provides a `JazzAuth` object for passkey authentication.
|
3
|
+
*
|
4
|
+
* @example
|
5
|
+
* ```ts
|
6
|
+
* const auth = usePasskeyAuth({ appName, appHostname });
|
7
|
+
* ```
|
8
|
+
*
|
9
|
+
* @category Auth Providers
|
10
|
+
*/
|
11
|
+
export declare function usePasskeyAuth({ appName, appHostname, }: {
|
12
|
+
appName: string;
|
13
|
+
appHostname?: string;
|
14
|
+
}): import('vue').ComputedRef<{
|
15
|
+
state: string;
|
16
|
+
logIn: () => Promise<void>;
|
17
|
+
signUp: (username: string) => Promise<void>;
|
18
|
+
}>;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* `usePassphraseAuth` composable provides a `JazzAuth` object for passphrase authentication.
|
3
|
+
*
|
4
|
+
* @example
|
5
|
+
* ```ts
|
6
|
+
* const auth = usePassphraseAuth({ wordlist });
|
7
|
+
* ```
|
8
|
+
*
|
9
|
+
* @category Auth Providers
|
10
|
+
*/
|
11
|
+
export declare function usePassphraseAuth({ wordlist, }: {
|
12
|
+
wordlist: string[];
|
13
|
+
}): import('vue').ComputedRef<{
|
14
|
+
state: string;
|
15
|
+
logIn: (passphrase: string) => Promise<void>;
|
16
|
+
signUp: () => Promise<string>;
|
17
|
+
passphrase: string;
|
18
|
+
}>;
|
package/dist/composables.d.ts
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
import { Account, AnonymousJazzAgent, CoValue, CoValueClass, DeeplyLoaded, DepthsIn, ID } from 'jazz-tools';
|
1
|
+
import { Account, AnonymousJazzAgent, AuthSecretStorage, CoValue, CoValueClass, DeeplyLoaded, DepthsIn, ID, JazzContextType } from 'jazz-tools';
|
2
2
|
import { ComputedRef, MaybeRef, Ref } from 'vue';
|
3
3
|
export declare const logoutHandler: Ref<(() => void) | undefined, (() => void) | undefined>;
|
4
|
+
export declare function useJazzContext(): Ref<JazzContextType<Account>, JazzContextType<Account>>;
|
5
|
+
export declare function useAuthSecretStorage(): AuthSecretStorage;
|
4
6
|
export declare function createUseAccountComposables<Acc extends Account>(): {
|
5
7
|
useAccount: {
|
6
8
|
(): {
|
@@ -8,7 +10,7 @@ export declare function createUseAccountComposables<Acc extends Account>(): {
|
|
8
10
|
logOut: () => void;
|
9
11
|
};
|
10
12
|
<D extends DepthsIn<Acc>>(depth: D): {
|
11
|
-
me: ComputedRef<DeeplyLoaded<Acc, D> | undefined>;
|
13
|
+
me: ComputedRef<DeeplyLoaded<Acc, D> | undefined | null>;
|
12
14
|
logOut: () => void;
|
13
15
|
};
|
14
16
|
};
|
@@ -17,7 +19,7 @@ export declare function createUseAccountComposables<Acc extends Account>(): {
|
|
17
19
|
me: ComputedRef<Acc | AnonymousJazzAgent>;
|
18
20
|
};
|
19
21
|
<D extends DepthsIn<Acc>>(depth: D): {
|
20
|
-
me: ComputedRef<DeeplyLoaded<Acc, D> | undefined | AnonymousJazzAgent>;
|
22
|
+
me: ComputedRef<DeeplyLoaded<Acc, D> | undefined | null | AnonymousJazzAgent>;
|
21
23
|
};
|
22
24
|
};
|
23
25
|
};
|
@@ -5475,7 +5477,7 @@ declare const useAccount: {
|
|
5475
5477
|
_type: "CoPlainText";
|
5476
5478
|
}] ? {
|
5477
5479
|
_type: "CoPlainText";
|
5478
|
-
} & CoValue & import('jazz-tools/src/internal.js').UnCo<NonNullable<Account[Key]>> : never) | (undefined extends Account[Key] ? Account[Key] & undefined : never) : never : never; } & Account) | undefined>;
|
5480
|
+
} & CoValue & import('jazz-tools/src/internal.js').UnCo<NonNullable<Account[Key]>> : never) | (undefined extends Account[Key] ? Account[Key] & undefined : never) : never : never; } & Account) | null | undefined>;
|
5479
5481
|
logOut: () => void;
|
5480
5482
|
};
|
5481
5483
|
}, useAccountOrGuest: {
|
@@ -10931,11 +10933,11 @@ declare const useAccount: {
|
|
10931
10933
|
_type: "CoPlainText";
|
10932
10934
|
}] ? {
|
10933
10935
|
_type: "CoPlainText";
|
10934
|
-
} & CoValue & import('jazz-tools/src/internal.js').UnCo<NonNullable<Account[Key]>> : never) | (undefined extends Account[Key] ? Account[Key] & undefined : never) : never : never; } & Account) | undefined>;
|
10936
|
+
} & CoValue & import('jazz-tools/src/internal.js').UnCo<NonNullable<Account[Key]>> : never) | (undefined extends Account[Key] ? Account[Key] & undefined : never) : never : never; } & Account) | null | undefined>;
|
10935
10937
|
};
|
10936
10938
|
};
|
10937
10939
|
export { useAccount, useAccountOrGuest };
|
10938
|
-
export declare function useCoState<V extends CoValue, D>(Schema: CoValueClass<V>, id: MaybeRef<ID<V> | undefined>, depth?: D & DepthsIn<V>): Ref<DeeplyLoaded<V, D> | undefined>;
|
10940
|
+
export declare function useCoState<V extends CoValue, D>(Schema: CoValueClass<V>, id: MaybeRef<ID<V> | undefined>, depth?: D & DepthsIn<V>): Ref<DeeplyLoaded<V, D> | undefined | null>;
|
10939
10941
|
export declare function useAcceptInvite<V extends CoValue>({ invitedObjectSchema, onAccept, forValueHint, }: {
|
10940
10942
|
invitedObjectSchema: CoValueClass<V>;
|
10941
10943
|
onAccept: (projectID: ID<V>) => void;
|
package/dist/index.d.ts
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
export * from './composables.js';
|
2
2
|
export { JazzProvider } from './provider.js';
|
3
3
|
export * from './auth/useDemoAuth.js';
|
4
|
+
export * from './auth/usePassphraseAuth.js';
|
5
|
+
export * from './auth/usePasskeyAuth.js';
|
4
6
|
export { default as DemoAuthBasicUI } from './auth/DemoAuthBasicUI.vue';
|
5
7
|
export { default as ProgressiveImg } from './ProgressiveImg.vue';
|
6
8
|
export { createInviteLink, parseInviteLink } from 'jazz-browser';
|