@junobuild/core 0.0.8 → 0.0.10

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 (53) hide show
  1. package/dist/browser/index.js +15 -15
  2. package/dist/browser/index.js.map +4 -4
  3. package/dist/declarations/cmc/cmc.did.d.ts +30 -30
  4. package/dist/declarations/cmc/cmc.factory.did.js +63 -63
  5. package/dist/declarations/cmc/index.d.ts +18 -18
  6. package/dist/declarations/cmc/index.js +22 -22
  7. package/dist/declarations/console/console.did.d.ts +45 -32
  8. package/dist/declarations/console/console.factory.did.js +60 -47
  9. package/dist/declarations/console/console.factory.did.mjs +60 -47
  10. package/dist/declarations/console/index.d.ts +18 -18
  11. package/dist/declarations/console/index.js +22 -22
  12. package/dist/declarations/frontend/frontend.did.d.ts +136 -136
  13. package/dist/declarations/frontend/frontend.factory.did.js +206 -206
  14. package/dist/declarations/frontend/index.d.ts +18 -18
  15. package/dist/declarations/frontend/index.js +22 -22
  16. package/dist/declarations/ic/ic.did.d.ts +63 -63
  17. package/dist/declarations/ic/ic.factory.did.js +126 -126
  18. package/dist/declarations/internet_identity/index.d.ts +18 -18
  19. package/dist/declarations/internet_identity/index.js +22 -22
  20. package/dist/declarations/internet_identity/internet_identity.did +79 -20
  21. package/dist/declarations/internet_identity/internet_identity.did.d.ts +152 -109
  22. package/dist/declarations/internet_identity/internet_identity.factory.did.js +231 -185
  23. package/dist/declarations/ledger/index.d.ts +18 -18
  24. package/dist/declarations/ledger/index.js +22 -22
  25. package/dist/declarations/ledger/ledger.did.d.ts +64 -64
  26. package/dist/declarations/ledger/ledger.factory.did.js +96 -96
  27. package/dist/declarations/mission_control/index.d.ts +18 -18
  28. package/dist/declarations/mission_control/index.js +22 -22
  29. package/dist/declarations/mission_control/mission_control.did.d.ts +34 -17
  30. package/dist/declarations/mission_control/mission_control.factory.did.js +48 -26
  31. package/dist/declarations/satellite/index.d.ts +18 -18
  32. package/dist/declarations/satellite/index.js +22 -22
  33. package/dist/declarations/satellite/satellite.did.d.ts +132 -113
  34. package/dist/declarations/satellite/satellite.factory.did.js +192 -167
  35. package/dist/declarations/satellite/satellite.factory.did.mjs +190 -167
  36. package/dist/index.js +1 -1
  37. package/dist/node/index.mjs +23 -23
  38. package/dist/node/index.mjs.map +4 -4
  39. package/dist/types/constants/auth.constants.d.ts +10 -3
  40. package/dist/types/index.d.ts +1 -0
  41. package/dist/types/providers/auth.providers.d.ts +31 -0
  42. package/dist/types/services/auth-timout.services.d.ts +1 -1
  43. package/dist/types/services/auth.services.d.ts +2 -2
  44. package/dist/types/services/user.services.d.ts +2 -2
  45. package/dist/types/stores/auth.store.d.ts +0 -1
  46. package/dist/types/types/auth.types.d.ts +4 -4
  47. package/dist/types/types/doc.types.d.ts +1 -0
  48. package/dist/types/types/list.types.d.ts +3 -0
  49. package/dist/types/types/storage.types.d.ts +3 -0
  50. package/dist/types/utils/list.utils.d.ts +1 -1
  51. package/dist/workers/auth.worker.js.map +3 -3
  52. package/package.json +1 -1
  53. package/dist/index.cjs.js +0 -1
@@ -1,4 +1,11 @@
1
- export declare const delegationIdentityExpiration: bigint;
2
- export declare const popupWidth = 576;
3
- export declare const popupHeight = 576;
1
+ export declare const DELEGATION_IDENTITY_EXPIRATION: bigint;
2
+ export declare const II_POPUP: {
3
+ width: number;
4
+ height: number;
5
+ };
6
+ export declare const NFID_POPUP: {
7
+ width: number;
8
+ height: number;
9
+ };
10
+ export declare const INTERNET_COMPUTER_ORG = "internetcomputer.org";
4
11
  export declare const AUTH_TIMER_INTERVAL = 1000;
@@ -1,6 +1,7 @@
1
1
  import type { User } from './types/auth.types';
2
2
  import type { Environment } from './types/env.types';
3
3
  import type { Unsubscribe } from './types/subscription.types';
4
+ export * from './providers/auth.providers';
4
5
  export { signIn, signOut } from './services/auth.services';
5
6
  export * from './services/doc.services';
6
7
  export * from './services/storage.services';
@@ -0,0 +1,31 @@
1
+ import { Provider, SignInOptions } from '../types/auth.types';
2
+ export interface AuthProvider {
3
+ readonly id: Provider;
4
+ signInOptions: (options: Pick<SignInOptions, 'windowed'>) => {
5
+ identityProvider: string;
6
+ windowOpenerFeatures?: string;
7
+ };
8
+ }
9
+ export declare class InternetIdentityProvider implements AuthProvider {
10
+ #private;
11
+ constructor({ domain }: {
12
+ domain?: 'internetcomputer.org' | 'ic0.app';
13
+ });
14
+ get id(): Provider;
15
+ signInOptions({ windowed }: Pick<SignInOptions, 'windowed'>): {
16
+ identityProvider: string;
17
+ windowOpenerFeatures?: string;
18
+ };
19
+ }
20
+ export declare class NFIDProvider implements AuthProvider {
21
+ #private;
22
+ constructor({ appName, logoUrl }: {
23
+ appName: string;
24
+ logoUrl: string;
25
+ });
26
+ get id(): Provider;
27
+ signInOptions({ windowed }: Pick<SignInOptions, 'windowed'>): {
28
+ identityProvider: string;
29
+ windowOpenerFeatures?: string;
30
+ };
31
+ }
@@ -1,3 +1,3 @@
1
- import { EnvironmentWorker } from '../types/env.types';
1
+ import type { EnvironmentWorker } from '../types/env.types';
2
2
  import type { Unsubscribe } from '../types/subscription.types';
3
3
  export declare const initAuthTimeoutWorker: (auth: EnvironmentWorker) => Unsubscribe;
@@ -1,6 +1,6 @@
1
1
  import type { Identity } from '@dfinity/agent';
2
- import type { SignInOptions } from '../types/auth.types';
3
- export declare const initAuth: () => Promise<void>;
2
+ import type { Provider, SignInOptions } from '../types/auth.types';
3
+ export declare const initAuth: (provider?: Provider) => Promise<void>;
4
4
  export declare const signIn: (options?: SignInOptions) => Promise<void>;
5
5
  export declare const signOut: () => Promise<void>;
6
6
  export declare const getIdentity: () => Identity | undefined;
@@ -1,2 +1,2 @@
1
- import type { User } from '../types/auth.types';
2
- export declare const initUser: () => Promise<User>;
1
+ import type { Provider, User } from '../types/auth.types';
2
+ export declare const initUser: (provider?: Provider) => Promise<User>;
@@ -9,6 +9,5 @@ export declare class AuthStore extends Store<User | null> {
9
9
  set(authUser: User | null): void;
10
10
  get(): User | null;
11
11
  subscribe(callback: (data: User | null) => void): Unsubscribe;
12
- isLoggedIn(): boolean;
13
12
  reset(): void;
14
13
  }
@@ -1,13 +1,13 @@
1
- import type { Principal } from '@dfinity/principal';
1
+ import { InternetIdentityProvider, NFIDProvider } from '../providers/auth.providers';
2
2
  import type { Doc } from './doc.types';
3
+ export type Provider = 'internet_identity' | 'nfid';
3
4
  export interface UserData {
4
- principal: Principal;
5
- created_at: Date | number | bigint;
6
- updated_at: Date | number | bigint;
5
+ provider?: Provider;
7
6
  }
8
7
  export type User = Doc<UserData>;
9
8
  export interface SignInOptions {
10
9
  maxTimeToLive?: bigint;
11
10
  derivationOrigin?: string | URL;
12
11
  windowed?: boolean;
12
+ provider?: InternetIdentityProvider | NFIDProvider;
13
13
  }
@@ -1,6 +1,7 @@
1
1
  export interface Doc<D> {
2
2
  key: string;
3
3
  data: D;
4
+ owner?: string;
4
5
  created_at?: bigint;
5
6
  updated_at?: bigint;
6
7
  }
@@ -1,3 +1,4 @@
1
+ import type { Principal } from "@dfinity/principal";
1
2
  export interface ListResults<T> {
2
3
  items: T[];
3
4
  length: bigint;
@@ -12,8 +13,10 @@ export interface ListOrder {
12
13
  desc: boolean;
13
14
  field: ListOrderField;
14
15
  }
16
+ export type ListOwner = string | Principal;
15
17
  export interface ListParams {
16
18
  matcher?: string;
17
19
  paginate?: ListPaginate;
18
20
  order?: ListOrder;
21
+ owner?: ListOwner;
19
22
  }
@@ -15,6 +15,9 @@ export interface Asset extends AssetKey {
15
15
  token?: string;
16
16
  headers: [string, string][];
17
17
  encodings: Record<ENCODING_TYPE, AssetEncoding>;
18
+ owner?: string;
19
+ created_at?: bigint;
20
+ updated_at?: bigint;
18
21
  }
19
22
  export interface Assets extends Pick<ListResults<AssetNoContent>, 'length' | 'matches_length'> {
20
23
  assets: Asset[];
@@ -1,3 +1,3 @@
1
1
  import type { ListParams as ListParamsApi } from '../../declarations/satellite/satellite.did';
2
2
  import type { ListParams } from '../types/list.types';
3
- export declare const toListParams: ({ matcher, paginate, order }: ListParams) => ListParamsApi;
3
+ export declare const toListParams: ({ matcher, paginate, order, owner }: ListParams) => ListParamsApi;