@learncard/core 9.2.1 → 9.3.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/core.cjs.development.js.map +1 -1
- package/dist/core.cjs.production.min.js.map +1 -1
- package/dist/core.esm.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/types/LearnCard.d.ts +2 -2
- package/dist/types/LearnCard.d.ts.map +1 -1
- package/dist/types/helpers.d.ts +1 -1
- package/dist/types/helpers.d.ts.map +1 -1
- package/dist/types/planes.d.ts +25 -25
- package/dist/types/planes.d.ts.map +1 -1
- package/dist/types/utilities.d.ts +9 -8
- package/dist/types/utilities.d.ts.map +1 -1
- package/dist/types/wallet.d.ts +8 -10
- package/dist/types/wallet.d.ts.map +1 -1
- package/dist/wallet/base/helpers.d.ts +3 -3
- package/dist/wallet/base/helpers.d.ts.map +1 -1
- package/dist/wallet/base/wallet.d.ts +2 -14
- package/dist/wallet/base/wallet.d.ts.map +1 -1
- package/dist/wallet/plugins/test-cache/types.d.ts +1 -1
- package/dist/wallet/plugins/test-cache/types.d.ts.map +1 -1
- package/dist/wallet/plugins/test-index/types.d.ts +1 -1
- package/dist/wallet/plugins/test-index/types.d.ts.map +1 -1
- package/dist/wallet/plugins/test-storage/types.d.ts +1 -1
- package/dist/wallet/plugins/test-storage/types.d.ts.map +1 -1
- package/package.json +3 -4
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACjD,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { LearnCard, Plugin } from './wallet';
|
2
|
-
export
|
3
|
-
export
|
2
|
+
export type GetPlugins<LC extends LearnCard<any, any, any>> = LC['plugins'];
|
3
|
+
export type AddPlugin<LC extends LearnCard<any, any, any>, P extends Plugin> = LearnCard<[
|
4
4
|
...GetPlugins<LC>,
|
5
5
|
P
|
6
6
|
]>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LearnCard.d.ts","sourceRoot":"","sources":["../../src/types/LearnCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEjD,
|
1
|
+
{"version":3,"file":"LearnCard.d.ts","sourceRoot":"","sources":["../../src/types/LearnCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,MAAM,UAAU,CAAC,EAAE,SAAS,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC;AAE5E,MAAM,MAAM,SAAS,CAAC,EAAE,SAAS,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,SAAS,CACpF;IAAC,GAAG,UAAU,CAAC,EAAE,CAAC;IAAE,CAAC;CAAC,CACzB,CAAC"}
|
package/dist/types/helpers.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/types/helpers.ts"],"names":[],"mappings":"AAAA,
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/types/helpers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,IAAI,CACxD,CAAC,EACD;KAAG,KAAK,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK;CAAE,CAAC,MAAM,CAAC,CAAC,CAC9E,CAAC"}
|
package/dist/types/planes.d.ts
CHANGED
@@ -3,22 +3,22 @@ import { Query } from 'sift';
|
|
3
3
|
import { Plugin } from './wallet';
|
4
4
|
import { OmitNevers } from './helpers';
|
5
5
|
import { DeepPartial } from './utilities';
|
6
|
-
export
|
7
|
-
export
|
6
|
+
export type CacheStrategy = 'cache-only' | 'cache-first' | 'skip-cache';
|
7
|
+
export type PlaneOptions = {
|
8
8
|
cache?: CacheStrategy;
|
9
9
|
};
|
10
|
-
export
|
11
|
-
export
|
10
|
+
export type ControlPlane = 'read' | 'store' | 'index' | 'cache' | 'id' | 'context';
|
11
|
+
export type FilterForPlane<Plugins extends Plugin[], Plane extends ControlPlane> = [
|
12
12
|
Plugins
|
13
13
|
] extends [1 & Plugins] ? any : {
|
14
14
|
[Index in keyof Plugins]: undefined extends Plugins[Index][Plane] ? never : Plugins[Index]['name'];
|
15
15
|
}[number];
|
16
|
-
export
|
16
|
+
export type GetPlanesForPlugins<Plugins extends Plugin[]> = any[] extends Plugins ? never : {
|
17
17
|
[Index in keyof Plugins]: {
|
18
18
|
[Key in ControlPlane]: undefined extends Plugins[Index][Key] ? never : Key;
|
19
19
|
}[ControlPlane];
|
20
20
|
}[number];
|
21
|
-
export
|
21
|
+
export type GetPlaneProviders<Plugins extends Plugin[], Plane extends ControlPlane> = any[] extends Plugins ? any : {
|
22
22
|
[Index in keyof Plugins]: undefined extends Plugins[Index][Plane] ? never : OmitNevers<{
|
23
23
|
[Name in Plugins[number]['name']]: Name extends Plugins[Index]['name'] ? {
|
24
24
|
name: Name;
|
@@ -27,26 +27,26 @@ export declare type GetPlaneProviders<Plugins extends Plugin[], Plane extends Co
|
|
27
27
|
} : never;
|
28
28
|
}>;
|
29
29
|
}[number];
|
30
|
-
export
|
30
|
+
export type ReadPlane = {
|
31
31
|
get: (uri?: string, options?: PlaneOptions) => Promise<VC | VP | undefined>;
|
32
32
|
};
|
33
|
-
export
|
34
|
-
export
|
33
|
+
export type PluginReadPlane = ReadPlane;
|
34
|
+
export type LearnCardReadPlane<Plugins extends Plugin[]> = ReadPlane & {
|
35
35
|
providers: GetPlaneProviders<Plugins, 'read'>;
|
36
36
|
};
|
37
|
-
export
|
37
|
+
export type EncryptionParams = {
|
38
38
|
recipients: string[];
|
39
39
|
};
|
40
|
-
export
|
40
|
+
export type StorePlane = {
|
41
41
|
upload: (vc: VC | VP, options?: PlaneOptions) => Promise<string>;
|
42
42
|
uploadMany?: (vcs: (VC | VP)[], options?: PlaneOptions) => Promise<string[]>;
|
43
43
|
uploadEncrypted?: (vc: VC | VP, params?: EncryptionParams, options?: PlaneOptions) => Promise<string>;
|
44
44
|
};
|
45
|
-
export
|
46
|
-
export
|
45
|
+
export type PluginStorePlane = StorePlane;
|
46
|
+
export type LearnCardStorePlane<Plugins extends Plugin[]> = Record<FilterForPlane<Plugins, 'store'>, StorePlane> & {
|
47
47
|
providers: GetPlaneProviders<Plugins, 'store'>;
|
48
48
|
};
|
49
|
-
export
|
49
|
+
export type IndexPlane = {
|
50
50
|
get: <Metadata extends Record<string, any> = Record<never, never>>(query?: Partial<Query<CredentialRecord<Metadata>>>, options?: PlaneOptions) => Promise<CredentialRecord<Metadata>[]>;
|
51
51
|
getPage?: <Metadata extends Record<string, any> = Record<never, never>>(query?: Partial<Query<CredentialRecord<Metadata>>>, paginationOptions?: {
|
52
52
|
limit?: number;
|
@@ -64,12 +64,12 @@ export declare type IndexPlane = {
|
|
64
64
|
remove: (id: string, options?: PlaneOptions) => Promise<boolean>;
|
65
65
|
removeAll?: (options?: PlaneOptions) => Promise<boolean>;
|
66
66
|
};
|
67
|
-
export
|
68
|
-
export
|
67
|
+
export type PluginIndexPlane = IndexPlane;
|
68
|
+
export type LearnCardIndexPlane<Plugins extends Plugin[]> = {
|
69
69
|
all: Pick<IndexPlane, 'get'>;
|
70
70
|
providers: GetPlaneProviders<Plugins, 'index'>;
|
71
71
|
} & Record<FilterForPlane<Plugins, 'index'>, IndexPlane>;
|
72
|
-
export
|
72
|
+
export type CachePlane = {
|
73
73
|
getIndex: <Metadata extends Record<string, any> = Record<never, never>>(name: string, query: Partial<Query<CredentialRecord<Metadata>>>) => Promise<CredentialRecord<Metadata>[] | undefined>;
|
74
74
|
setIndex: <Metadata extends Record<string, any> = Record<never, never>>(name: string, query: Partial<Query<CredentialRecord<Metadata>>>, value: CredentialRecord<Metadata>[]) => Promise<boolean>;
|
75
75
|
getIndexPage: <Metadata extends Record<string, any> = Record<never, never>>(name: string, query: Partial<Query<CredentialRecord<Metadata>>>, paginationOptions?: {
|
@@ -96,26 +96,26 @@ export declare type CachePlane = {
|
|
96
96
|
setVc: (uri: string, value: VC | VP | undefined) => Promise<boolean>;
|
97
97
|
flushVc: () => Promise<boolean>;
|
98
98
|
};
|
99
|
-
export
|
100
|
-
export
|
99
|
+
export type PluginCachePlane = CachePlane;
|
100
|
+
export type LearnCardCachePlane<Plugins extends Plugin[]> = CachePlane & {
|
101
101
|
providers: GetPlaneProviders<Plugins, 'cache'>;
|
102
102
|
};
|
103
|
-
export
|
103
|
+
export type IdPlane = {
|
104
104
|
did: (method?: string, options?: PlaneOptions) => string;
|
105
105
|
keypair: (algorithm?: string, options?: PlaneOptions) => JWK;
|
106
106
|
};
|
107
|
-
export
|
108
|
-
export
|
107
|
+
export type PluginIdPlane = IdPlane;
|
108
|
+
export type LearnCardIdPlane<Plugins extends Plugin[]> = IdPlane & {
|
109
109
|
providers: GetPlaneProviders<Plugins, 'id'>;
|
110
110
|
};
|
111
|
-
export
|
111
|
+
export type ContextPlane = {
|
112
112
|
resolveDocument: (uri: string, allowRemote?: boolean) => Promise<Record<string, any> | undefined>;
|
113
113
|
};
|
114
|
-
export
|
114
|
+
export type PluginContextPlane = {
|
115
115
|
resolveStaticDocument: (uri: string) => Promise<Record<string, any> | undefined>;
|
116
116
|
resolveRemoteDocument?: (uri: string) => Promise<Record<string, any> | undefined>;
|
117
117
|
};
|
118
|
-
export
|
118
|
+
export type LearnCardContextPlane<Plugins extends Plugin[]> = ContextPlane & {
|
119
119
|
providers: GetPlaneProviders<Plugins, 'context'>;
|
120
120
|
};
|
121
121
|
//# sourceMappingURL=planes.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"planes.d.ts","sourceRoot":"","sources":["../../src/types/planes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,
|
1
|
+
{"version":3,"file":"planes.d.ts","sourceRoot":"","sources":["../../src/types/planes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,aAAa,GAAG,YAAY,CAAC;AAExE,MAAM,MAAM,YAAY,GAAG;IACvB,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAEnF,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,MA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2
|
-
export
|
2
|
+
export type Tail<T extends any[]> = T extends [any, ...infer R] ? R : never;
|
3
3
|
/** @group Utility Types */
|
4
|
-
export
|
4
|
+
export type Last<T extends any[]> = T extends [...any[], infer R] ? R : never;
|
5
5
|
/** @group Utility Types */
|
6
|
-
export
|
6
|
+
export type RemoveLast<T extends any[]> = T extends [...infer R, any] ? R : [];
|
7
7
|
/** @group Utility Types */
|
8
|
-
export
|
8
|
+
export type RemoveFirstArg<T extends (...args: any[]) => any> = (args: Tail<Parameters<T>>) => ReturnType<T>;
|
9
9
|
/** @group Utility Types */
|
10
|
-
export
|
10
|
+
export type RemoveLastArg<T extends (...args: any[]) => any> = (args: RemoveLast<Parameters<T>>) => ReturnType<T>;
|
11
11
|
/** @group Utility Types */
|
12
|
-
export
|
12
|
+
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
13
13
|
/** @group Utility Types */
|
14
|
-
export
|
14
|
+
export type MergeObjects<Objects extends Record<string, any>[]> = undefined extends Objects[2] ? Omit<Objects[0], keyof Objects[1]> & Objects[1] : Omit<MergeObjects<RemoveLast<Objects>>, keyof Last<Objects>> & Last<Objects>;
|
15
15
|
/** @group Utility Types */
|
16
|
-
export
|
16
|
+
export type DeepPartial<T> = T extends object ? {
|
17
17
|
[P in keyof T]?: DeepPartial<T[P]>;
|
18
18
|
} : T;
|
19
|
+
export type IsAnyOrNever<T> = [T] extends [1 & T] ? true : false;
|
19
20
|
//# sourceMappingURL=utilities.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/types/utilities.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/types/utilities.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,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M,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAC/C,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;AAEnF,2BAA2B;AAC3B,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACvC;KACG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACrC,GACC,CAAC,CAAC;AAER,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC"}
|
package/dist/types/wallet.d.ts
CHANGED
@@ -1,17 +1,15 @@
|
|
1
1
|
import { ControlPlane, GetPlanesForPlugins, PluginReadPlane, PluginStorePlane, PluginIndexPlane, PluginCachePlane, PluginIdPlane, PluginContextPlane, LearnCardReadPlane, LearnCardStorePlane, LearnCardIndexPlane, LearnCardCachePlane, LearnCardIdPlane, LearnCardContextPlane } from './planes';
|
2
|
-
import { UnionToIntersection, MergeObjects } from './utilities';
|
3
|
-
export
|
4
|
-
|
5
|
-
] extends [1 & ControlPlanes] ? NewControlPlanes : [NewControlPlanes] extends [1 & NewControlPlanes] ? ControlPlanes : ControlPlanes | NewControlPlanes, NewMethods & Methods>;
|
6
|
-
export declare type AddImplicitLearnCardArgument<Functions extends Record<string, (...args: any[]) => any> = Record<never, never>, ControlPlanes extends ControlPlane = never, Methods extends Record<string, (...args: any[]) => any> = Record<never, never>, DependentControlPlanes extends ControlPlane = never, DependentMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = {
|
2
|
+
import { UnionToIntersection, MergeObjects, IsAnyOrNever } from './utilities';
|
3
|
+
export type GenerateLearnCard<NewControlPlanes extends ControlPlane = never, NewMethods extends Record<string, (...args: any[]) => any> = Record<never, never>, ControlPlanes extends ControlPlane = never, Methods extends Record<string, (...args: any[]) => any> = Record<never, never>> = LearnCard<any, IsAnyOrNever<ControlPlanes> extends true ? NewControlPlanes : IsAnyOrNever<NewControlPlanes> extends true ? ControlPlanes : ControlPlanes | NewControlPlanes, NewMethods & Methods>;
|
4
|
+
export type AddImplicitLearnCardArgument<Functions extends Record<string, (...args: any[]) => any> = Record<never, never>, ControlPlanes extends ControlPlane = never, Methods extends Record<string, (...args: any[]) => any> = Record<never, never>, DependentControlPlanes extends ControlPlane = never, DependentMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = {
|
7
5
|
[Key in keyof Functions]: <T extends GenerateLearnCard<ControlPlanes, Methods, DependentControlPlanes, DependentMethods>>(learnCard: T, ...args: Parameters<Functions[Key]>) => ReturnType<Functions[Key]>;
|
8
6
|
};
|
9
7
|
/** @group Universal Wallets */
|
10
|
-
export
|
8
|
+
export type GetPluginMethods<Plugins extends Plugin[]> = undefined extends Plugins[1] ? NonNullable<Plugins[0]['_methods']> : UnionToIntersection<NonNullable<MergeObjects<{
|
11
9
|
[Key in keyof Plugins]: NonNullable<Plugins[Key]['_methods']>;
|
12
10
|
}>>>;
|
13
11
|
/** @group Universal Wallets */
|
14
|
-
export
|
12
|
+
export type Plugin<Name extends string = string, ControlPlanes extends ControlPlane = any, Methods extends Record<string, (...args: any[]) => any> = Record<never, never>, DependentControlPlanes extends ControlPlane = never, DependentMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = {
|
15
13
|
name: Name;
|
16
14
|
displayName?: string;
|
17
15
|
description?: string;
|
@@ -23,7 +21,7 @@ export declare type Plugin<Name extends string = string, ControlPlanes extends C
|
|
23
21
|
cache?: {};
|
24
22
|
id?: {};
|
25
23
|
context?: {};
|
26
|
-
} & (
|
24
|
+
} & (IsAnyOrNever<ControlPlanes> extends true ? {} : ('read' extends ControlPlanes ? {
|
27
25
|
read: AddImplicitLearnCardArgument<PluginReadPlane, ControlPlanes, Methods, DependentControlPlanes, DependentMethods>;
|
28
26
|
} : {}) & ('store' extends ControlPlanes ? {
|
29
27
|
store: AddImplicitLearnCardArgument<PluginStorePlane, ControlPlanes, Methods, DependentControlPlanes, DependentMethods>;
|
@@ -37,12 +35,12 @@ export declare type Plugin<Name extends string = string, ControlPlanes extends C
|
|
37
35
|
context: AddImplicitLearnCardArgument<PluginContextPlane, ControlPlanes, Methods, DependentControlPlanes, DependentMethods>;
|
38
36
|
} : {}));
|
39
37
|
/** @group Universal Wallets */
|
40
|
-
export
|
38
|
+
export type LearnCard<Plugins extends Plugin[] = [], ControlPlanes extends ControlPlane = GetPlanesForPlugins<Plugins>, PluginMethods = GetPluginMethods<Plugins>> = {
|
41
39
|
plugins: Plugins;
|
42
40
|
invoke: PluginMethods;
|
43
41
|
addPlugin: <NewPlugin extends Plugin>(plugin: NewPlugin) => Promise<LearnCard<[...Plugins, NewPlugin]>>;
|
44
42
|
debug?: typeof console.log;
|
45
|
-
} & (
|
43
|
+
} & (IsAnyOrNever<ControlPlanes> extends true ? {} : ('read' extends ControlPlanes ? {
|
46
44
|
read: LearnCardReadPlane<Plugins>;
|
47
45
|
} : {}) & ('store' extends ControlPlanes ? {
|
48
46
|
store: LearnCardStorePlane<Plugins>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/types/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACxB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","s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,EAAE,CAAC,GAC9E,CAAC,IAAI,SAAS,aAAa,GAAG;IAAE,EAAE,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;CAAE,GAAG,EAAE,CAAC,GACrE,CAAC,SAAS,SAAS,aAAa,GAAG;IAAE,OAAO,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAA;CAAE,GAAG,EAAE,CAAC,CAAC,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { LearnCard, Plugin } from '../../types/wallet';
|
2
2
|
import { ControlPlane } from '../../types/planes';
|
3
3
|
/** Type guard for removing null/undefined */
|
4
|
-
export declare const isNotNull: <T>(item?: T | null
|
4
|
+
export declare const isNotNull: <T>(item?: T | null) => item is T;
|
5
5
|
/** Removes null/undefined from items in an array */
|
6
6
|
export declare const filterNulls: <T>(array: (T | null | undefined)[]) => T[];
|
7
7
|
/**
|
@@ -9,8 +9,8 @@ export declare const filterNulls: <T>(array: (T | null | undefined)[]) => T[];
|
|
9
9
|
* first value is found, it is returned. If no value is found, undefined is returned instead
|
10
10
|
*/
|
11
11
|
export declare const findFirstResult: <T, U>(array: T[], callback: (item: T) => U | undefined) => U | undefined;
|
12
|
-
export declare const pluginImplementsPlane: <Plane extends ControlPlane>(plugin: Plugin, plane: Plane) => plugin is Plugin<any, Plane
|
13
|
-
export declare const learnCardImplementsPlane: <Plane extends ControlPlane>(learnCard: LearnCard<any, any, any>, plane: Plane) => learnCard is LearnCard<any, Plane
|
12
|
+
export declare const pluginImplementsPlane: <Plane extends ControlPlane>(plugin: Plugin, plane: Plane) => plugin is Plugin<any, Plane>;
|
13
|
+
export declare const learnCardImplementsPlane: <Plane extends ControlPlane>(learnCard: LearnCard<any, any, any>, plane: Plane) => learnCard is LearnCard<any, Plane>;
|
14
14
|
export declare const mapObject: <T extends string, U, V>(obj: Record<T, U>, callback: (value: U, index: number) => V) => Record<T, V>;
|
15
15
|
export declare const isFulfilledAndNotEmpty: <T>(input: PromiseSettledResult<T>) => input is PromiseFulfilledResult<T>;
|
16
16
|
export declare const uniqBy: <Obj extends Record<string, any>>(array: Obj[], key: keyof Obj | ((obj: Obj) => any)) => Obj[];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/wallet/base/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,6CAA6C;AAC7C,eAAO,MAAM,SAAS
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/wallet/base/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,6CAA6C;AAC7C,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,CAAC,GAAG,IAAI,KAAG,IAAI,IAAI,CAAW,CAAC;AAEnE,oDAAoD;AACpD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,QAA4B,CAAC;AAE3F;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,CAAC,SACzB,CAAC,EAAE,YACA,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,SAAS,KACrC,CAAC,GAAG,SAMN,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,KAAK,SAAS,YAAY,UACpD,MAAM,SACP,KAAK,KACb,MAAM,IAAI,MAAM,CAAC,GAAG,EAAE,KAAK,CAS7B,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,KAAK,SAAS,YAAY,aACpD,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,SAC5B,KAAK,KACb,SAAS,IAAI,SAAS,CAAC,GAAG,EAAE,KAAK,CASnC,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,OACvC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,YACP,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,KACzC,MAAM,CAAC,CAAC,EAAE,CAAC,CAIb,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,CAAC,SAC7B,oBAAoB,CAAC,CAAC,CAAC,KAC/B,KAAK,IAAI,sBAAsB,CAAC,CAAC,CAAkD,CAAC;AAEvF,eAAO,MAAM,MAAM,GAAI,GAAG,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,SAC3C,GAAG,EAAE,OACP,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC,UAKvC,CAAC"}
|
@@ -1,17 +1,5 @@
|
|
1
|
-
import { LearnCard, GetPluginMethods
|
1
|
+
import { Plugin, LearnCard, GetPluginMethods } from '../../types/wallet';
|
2
2
|
import { GetPlanesForPlugins } from '../../types/planes';
|
3
3
|
/** @group Universal Wallets */
|
4
|
-
export declare const generateLearnCard: <Plugins extends
|
5
|
-
name: string;
|
6
|
-
displayName?: string | undefined;
|
7
|
-
description?: string | undefined;
|
8
|
-
methods: AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
|
9
|
-
_methods?: Record<never, never> | undefined;
|
10
|
-
read?: {} | undefined;
|
11
|
-
store?: {} | undefined;
|
12
|
-
index?: {} | undefined;
|
13
|
-
cache?: {} | undefined;
|
14
|
-
id?: {} | undefined;
|
15
|
-
context?: {} | undefined;
|
16
|
-
}[] = [], ControlPlanes extends GetPlanesForPlugins<Plugins> = GetPlanesForPlugins<Plugins>, PluginMethods extends GetPluginMethods<Plugins> = GetPluginMethods<Plugins>>(_learnCard?: Partial<LearnCard<Plugins, ControlPlanes, PluginMethods>>) => Promise<LearnCard<Plugins, ControlPlanes, PluginMethods>>;
|
4
|
+
export declare const generateLearnCard: <Plugins extends Plugin[] = [], ControlPlanes extends GetPlanesForPlugins<Plugins> = GetPlanesForPlugins<Plugins>, PluginMethods extends GetPluginMethods<Plugins> = GetPluginMethods<Plugins>>(_learnCard?: Partial<LearnCard<Plugins, ControlPlanes, PluginMethods>>) => Promise<LearnCard<Plugins, ControlPlanes, PluginMethods>>;
|
17
5
|
//# sourceMappingURL=wallet.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../src/wallet/base/wallet.ts"],"names":[],"mappings":"AAGA,OAAO,
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../src/wallet/base/wallet.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAgC,MAAM,cAAc,CAAC;AACjG,OAAO,EAEH,mBAAmB,EAWtB,MAAM,cAAc,CAAC;AA+uBtB,+BAA+B;AAC/B,eAAO,MAAM,iBAAiB,GAC1B,OAAO,SAAS,MAAM,EAAE,OACxB,aAAa,SAAS,mBAAmB,CAAC,OAAO,CAAC,iCAClD,aAAa,SAAS,gBAAgB,CAAC,OAAO,CAAC,2CAEnC,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,KACtE,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,aAAa,CAAC,CAkC1D,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/wallet/plugins/test-cache/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/wallet/plugins/test-cache/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/wallet/plugins/test-index/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/wallet/plugins/test-index/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/wallet/plugins/test-storage/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/wallet/plugins/test-storage/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@learncard/core",
|
3
|
-
"version": "9.
|
3
|
+
"version": "9.3.1",
|
4
4
|
"description": "",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"module": "./dist/core.esm.js",
|
@@ -29,8 +29,7 @@
|
|
29
29
|
"sift": "^17.0.1",
|
30
30
|
"ts-jest": "^29.0.3",
|
31
31
|
"tsc-alias": "^1.6.9",
|
32
|
-
"
|
33
|
-
"@learncard/types": "5.5.1"
|
32
|
+
"@learncard/types": "5.5.2"
|
34
33
|
},
|
35
34
|
"types": "./dist/index.d.ts",
|
36
35
|
"dependencies": {
|
@@ -40,7 +39,7 @@
|
|
40
39
|
"isomorphic-fetch": "^3.0.0",
|
41
40
|
"isomorphic-webcrypto": "^2.3.8",
|
42
41
|
"zod": "^3.20.2",
|
43
|
-
"@learncard/helpers": "1.0.
|
42
|
+
"@learncard/helpers": "1.0.14"
|
44
43
|
},
|
45
44
|
"scripts": {
|
46
45
|
"build": "node ./scripts/build.mjs && shx cp ./scripts/mixedEntypoint.js ./dist/index.js && tsc --p tsconfig.build.json && tsc-alias",
|