@junobuild/core-standalone 1.2.1 → 2.0.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.
Files changed (74) hide show
  1. package/dist/browser/canisterStatus-ENEUF6W6.js +2 -0
  2. package/dist/browser/{chunk-EMF4NSTU.js → chunk-GGU5IQIJ.js} +11 -11
  3. package/dist/browser/{chunk-EMF4NSTU.js.map → chunk-GGU5IQIJ.js.map} +2 -2
  4. package/dist/browser/index.js +15 -15
  5. package/dist/browser/index.js.map +4 -4
  6. package/dist/node/index.mjs +27 -27
  7. package/dist/node/index.mjs.map +4 -4
  8. package/dist/types/{constants → auth/constants}/auth.constants.d.ts +1 -0
  9. package/dist/types/auth/helpers/progress.helpers.d.ts +6 -0
  10. package/dist/types/auth/helpers/window.helpers.d.ts +3 -0
  11. package/dist/types/auth/providers/_auth-client.providers.d.ts +74 -0
  12. package/dist/types/auth/providers/internet-identity.providers.d.ts +28 -0
  13. package/dist/types/auth/providers/nfid.providers.d.ts +28 -0
  14. package/dist/types/auth/providers/webauthn.providers.d.ts +40 -0
  15. package/dist/types/auth/services/_user.services.d.ts +11 -0
  16. package/dist/types/auth/services/auth-timout.services.d.ts +3 -0
  17. package/dist/types/{services → auth/services}/auth.services.d.ts +25 -6
  18. package/dist/types/auth/services/user-webauthn.services.d.ts +8 -0
  19. package/dist/types/{stores → auth/stores}/auth.store.d.ts +3 -3
  20. package/dist/types/auth/types/auth-client.d.ts +43 -0
  21. package/dist/types/auth/types/auth.d.ts +63 -0
  22. package/dist/types/{types → auth/types}/errors.d.ts +6 -0
  23. package/dist/types/auth/types/internet-identity.d.ts +23 -0
  24. package/dist/types/auth/types/nfid.d.ts +22 -0
  25. package/dist/types/auth/types/progress.d.ts +20 -0
  26. package/dist/types/auth/types/provider.d.ts +32 -0
  27. package/dist/types/auth/types/user.d.ts +23 -0
  28. package/dist/types/auth/types/webauthn.d.ts +74 -0
  29. package/dist/types/{utils → auth/utils}/auth.utils.d.ts +1 -0
  30. package/dist/types/{api → datastore/api}/doc.api.d.ts +2 -2
  31. package/dist/types/{services → datastore/services}/doc.services.d.ts +3 -3
  32. package/dist/types/{types → datastore/types}/doc.d.ts +1 -1
  33. package/dist/types/{services → functions/services}/functions.services.d.ts +1 -1
  34. package/dist/types/index.d.ts +32 -22
  35. package/dist/types/{api → storage/api}/storage.api.d.ts +2 -2
  36. package/dist/types/{services → storage/services}/storage.services.d.ts +4 -4
  37. package/dist/types/{types/storage.types.d.ts → storage/types/storage.d.ts} +1 -1
  38. package/dist/workers/auth.worker.js +4 -4
  39. package/dist/workers/auth.worker.js.map +3 -3
  40. package/package.json +3 -3
  41. package/dist/browser/canisterStatus-72I5GDMD.js +0 -2
  42. package/dist/types/providers/auth.providers.d.ts +0 -79
  43. package/dist/types/services/_user.services.d.ts +0 -2
  44. package/dist/types/services/auth-timout.services.d.ts +0 -3
  45. package/dist/types/types/auth.d.ts +0 -90
  46. package/dist/workers/_auth.worker.handler.js +0 -43
  47. package/dist/workers/_auth.worker.handler.js.map +0 -7
  48. /package/dist/browser/{canisterStatus-72I5GDMD.js.map → canisterStatus-ENEUF6W6.js.map} +0 -0
  49. /package/dist/types/{types → auth/types}/post-message.d.ts +0 -0
  50. /package/dist/types/{utils → auth/utils}/events.utils.d.ts +0 -0
  51. /package/dist/types/{utils → auth/utils}/window.utils.d.ts +0 -0
  52. /package/dist/types/{workers/_auth.worker.handler.d.ts → auth/workers/auth.worker.d.ts} +0 -0
  53. /package/dist/types/{api → core/api}/actor.api.d.ts +0 -0
  54. /package/dist/types/{constants → core/constants}/call-options.constants.d.ts +0 -0
  55. /package/dist/types/{constants → core/constants}/container.constants.d.ts +0 -0
  56. /package/dist/types/{services/_identity.services.d.ts → core/services/identity.services.d.ts} +0 -0
  57. /package/dist/types/{stores → core/stores}/_agent.factory.d.ts +0 -0
  58. /package/dist/types/{stores → core/stores}/_store.d.ts +0 -0
  59. /package/dist/types/{stores → core/stores}/actor.store.d.ts +0 -0
  60. /package/dist/types/{stores → core/stores}/agent.store.d.ts +0 -0
  61. /package/dist/types/{stores → core/stores}/env.store.d.ts +0 -0
  62. /package/dist/types/{types → core/types}/actor.d.ts +0 -0
  63. /package/dist/types/{types → core/types}/call-options.d.ts +0 -0
  64. /package/dist/types/{types → core/types}/env.d.ts +0 -0
  65. /package/dist/types/{types → core/types}/list.d.ts +0 -0
  66. /package/dist/types/{types → core/types}/satellite.d.ts +0 -0
  67. /package/dist/types/{types → core/types}/subscription.d.ts +0 -0
  68. /package/dist/types/{types → core/types}/utility.d.ts +0 -0
  69. /package/dist/types/{utils → core/utils}/env.utils.d.ts +0 -0
  70. /package/dist/types/{utils → core/utils}/list.utils.d.ts +0 -0
  71. /package/dist/types/{utils → core/utils}/window.env.utils.d.ts +0 -0
  72. /package/dist/types/{utils → datastore/utils}/data.utils.d.ts +0 -0
  73. /package/dist/types/{utils → datastore/utils}/doc.utils.d.ts +0 -0
  74. /package/dist/types/{utils → storage/utils}/crypto.utils.d.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/core-standalone",
3
- "version": "1.2.1",
3
+ "version": "2.0.0",
4
4
  "description": "JavaScript core client for Juno with all dependencies bundled — no peer dependencies",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",
@@ -59,8 +59,8 @@
59
59
  "@dfinity/principal": "^2.3.0",
60
60
  "@dfinity/utils": "^2",
61
61
  "@junobuild/errors": "*",
62
- "@junobuild/ic-client": "^2",
63
- "@junobuild/storage": "^1.2.0",
62
+ "@junobuild/ic-client": "^3",
63
+ "@junobuild/storage": "^1.2.1",
64
64
  "@junobuild/utils": "*"
65
65
  }
66
66
  }
@@ -1,2 +0,0 @@
1
- import{v as a,w as b,x as c,y as d}from"./chunk-EMF4NSTU.js";export{a as CustomPath,d as encodePath,c as fetchNodeKeys,b as request};
2
- //# sourceMappingURL=canisterStatus-72I5GDMD.js.map
@@ -1,79 +0,0 @@
1
- import type { InternetIdentityConfig, NFIDConfig, Provider, SignInOptions } from '../types/auth';
2
- /**
3
- * Options for signing in with an authentication provider.
4
- * @interface AuthProviderSignInOptions
5
- */
6
- export interface AuthProviderSignInOptions {
7
- /**
8
- * The URL of the identity provider - commonly Internet Identity.
9
- */
10
- identityProvider: string;
11
- /**
12
- * Optional features for the window opener.
13
- */
14
- windowOpenerFeatures?: string;
15
- }
16
- /**
17
- * Common traits for all authentication providers
18
- * @interface AuthProvider
19
- */
20
- export interface AuthProvider {
21
- /**
22
- * The unique identifier of the provider.
23
- */
24
- readonly id: Provider;
25
- /**
26
- * Method to get the sign-in options for the provider.
27
- * @param options - The sign-in options.
28
- * @returns The sign-in options for the provider that can be use to effectively perform a sign-in.
29
- */
30
- signInOptions: (options: Pick<SignInOptions, 'windowed'>) => AuthProviderSignInOptions;
31
- }
32
- /**
33
- * Internet Identity authentication provider.
34
- * @class InternetIdentityProvider
35
- * @implements {AuthProvider}
36
- */
37
- export declare class InternetIdentityProvider implements AuthProvider {
38
- #private;
39
- /**
40
- * Creates an instance of InternetIdentityProvider.
41
- * @param {InternetIdentityConfig} config - The configuration for Internet Identity.
42
- */
43
- constructor({ domain }: InternetIdentityConfig);
44
- /**
45
- * Gets the identifier of the provider.
46
- * @returns {Provider} The identifier of the provider - `internet_identity`.
47
- */
48
- get id(): Provider;
49
- /**
50
- * Gets the sign-in options for Internet Identity.
51
- * @param {Pick<SignInOptions, 'windowed'>} options - The sign-in options.
52
- * @returns {AuthProviderSignInOptions} The sign-in options for Internet Identity.
53
- */
54
- signInOptions({ windowed }: Pick<SignInOptions, 'windowed'>): AuthProviderSignInOptions;
55
- }
56
- /**
57
- * NFID authentication provider.
58
- * @class NFIDProvider
59
- * @implements {AuthProvider}
60
- */
61
- export declare class NFIDProvider implements AuthProvider {
62
- #private;
63
- /**
64
- * Creates an instance of NFIDProvider.
65
- * @param {NFIDConfig} config - The configuration for NFID.
66
- */
67
- constructor({ appName, logoUrl }: NFIDConfig);
68
- /**
69
- * Gets the identifier of the provider.
70
- * @returns {Provider} The identifier of the provider- nfid.
71
- */
72
- get id(): Provider;
73
- /**
74
- * Gets the sign-in options for NFID.
75
- * @param {Pick<SignInOptions, 'windowed'>} options - The sign-in options.
76
- * @returns {AuthProviderSignInOptions} The sign-in options to effectively sign-in with NFID.
77
- */
78
- signInOptions({ windowed }: Pick<SignInOptions, 'windowed'>): AuthProviderSignInOptions;
79
- }
@@ -1,2 +0,0 @@
1
- import type { Provider, User } from '../types/auth';
2
- export declare const initUser: (provider?: Provider) => Promise<User>;
@@ -1,3 +0,0 @@
1
- import type { EnvironmentWorker } from '../types/env';
2
- import type { Unsubscribe } from '../types/subscription';
3
- export declare const initAuthTimeoutWorker: (auth: EnvironmentWorker) => Unsubscribe;
@@ -1,90 +0,0 @@
1
- import type { InternetIdentityProvider, NFIDProvider } from '../providers/auth.providers';
2
- import type { Doc } from './doc';
3
- /**
4
- * Type representing the available authentication providers.
5
- * @typedef {('internet_identity' | 'nfid')} Provider
6
- */
7
- export type Provider = 'internet_identity' | 'nfid';
8
- /**
9
- * Interface representing user data.
10
- * @interface UserData
11
- */
12
- export interface UserData {
13
- /**
14
- * The potential provider used to sign-in. There is no guarantee that the information can be set by the browser during the sign-in flow, therefore it is optional.
15
- * @type {Provider}
16
- */
17
- provider?: Provider;
18
- }
19
- /**
20
- * Type representing a user document.
21
- * @typedef {Doc<UserData>} User
22
- */
23
- export type User = Doc<UserData>;
24
- /**
25
- * Interface representing sign-in options.
26
- * @interface SignInOptions
27
- */
28
- export interface SignInOptions {
29
- /**
30
- * Maximum time to live for the session. Cannot be extended.
31
- * @type {bigint}
32
- */
33
- maxTimeToLive?: bigint;
34
- /**
35
- * Origin for derivation. Useful when sign-in using the same domain - e.g. sign-in on www.hello.com for hello.com.
36
- * @type {(string | URL)}
37
- */
38
- derivationOrigin?: string | URL;
39
- /**
40
- * Whether to open the sign-in window.
41
- * @default true
42
- * @type {boolean}
43
- */
44
- windowed?: boolean;
45
- /**
46
- * Whether to allow the infamous PIN authentication.
47
- * @default false
48
- * @type {boolean}
49
- */
50
- allowPin?: boolean;
51
- /**
52
- * The authentication provider to use.
53
- * @default InternetIdentityProvider
54
- * @type {(InternetIdentityProvider | NFIDProvider)}
55
- */
56
- provider?: InternetIdentityProvider | NFIDProvider;
57
- }
58
- /**
59
- * Type representing the available Internet Identity domains.
60
- * @typedef {('internetcomputer.org' | 'ic0.app')} InternetIdentityDomain
61
- */
62
- export type InternetIdentityDomain = 'internetcomputer.org' | 'ic0.app';
63
- /**
64
- * Interface representing the configuration for Internet Identity.
65
- * @interface InternetIdentityConfig
66
- */
67
- export interface InternetIdentityConfig {
68
- /**
69
- * The domain for Internet Identity.
70
- * @default internetcomputer.org
71
- * @type {InternetIdentityDomain}
72
- */
73
- domain?: InternetIdentityDomain;
74
- }
75
- /**
76
- * Interface representing the configuration for NFID.
77
- * @interface NFIDConfig
78
- */
79
- export interface NFIDConfig {
80
- /**
81
- * The name of the application.
82
- * @type {string}
83
- */
84
- appName: string;
85
- /**
86
- * The URL of the application's logo.
87
- * @type {string}
88
- */
89
- logoUrl: string;
90
- }