@xyo-network/archivist-model 2.73.4 → 2.74.1
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/dist/Archivist.d.mts +24 -0
- package/dist/Archivist.d.mts.map +1 -0
- package/dist/Archivist.d.ts +24 -0
- package/dist/Archivist.d.ts.map +1 -0
- package/dist/ArchivistInstance.d.mts +5 -0
- package/dist/ArchivistInstance.d.mts.map +1 -0
- package/dist/ArchivistInstance.d.ts +5 -0
- package/dist/ArchivistInstance.d.ts.map +1 -0
- package/dist/Config.d.mts +18 -0
- package/dist/Config.d.mts.map +1 -0
- package/dist/Config.d.ts +18 -0
- package/dist/Config.d.ts.map +1 -0
- package/dist/EventModels/Cleared.d.mts +7 -0
- package/dist/EventModels/Cleared.d.mts.map +1 -0
- package/dist/EventModels/Cleared.d.ts +7 -0
- package/dist/EventModels/Cleared.d.ts.map +1 -0
- package/dist/EventModels/Deleted.d.mts +9 -0
- package/dist/EventModels/Deleted.d.mts.map +1 -0
- package/dist/EventModels/Deleted.d.ts +9 -0
- package/dist/EventModels/Deleted.d.ts.map +1 -0
- package/dist/EventModels/Inserted.d.mts +10 -0
- package/dist/EventModels/Inserted.d.mts.map +1 -0
- package/dist/EventModels/Inserted.d.ts +10 -0
- package/dist/EventModels/Inserted.d.ts.map +1 -0
- package/dist/EventModels/index.d.mts +4 -0
- package/dist/EventModels/index.d.mts.map +1 -0
- package/dist/EventModels/index.d.ts +4 -0
- package/dist/EventModels/index.d.ts.map +1 -0
- package/dist/Params.d.mts +5 -0
- package/dist/Params.d.mts.map +1 -0
- package/dist/Params.d.ts +5 -0
- package/dist/Params.d.ts.map +1 -0
- package/dist/Queries/All.d.mts +7 -0
- package/dist/Queries/All.d.mts.map +1 -0
- package/dist/Queries/All.d.ts +7 -0
- package/dist/Queries/All.d.ts.map +1 -0
- package/dist/Queries/Clear.d.mts +7 -0
- package/dist/Queries/Clear.d.mts.map +1 -0
- package/dist/Queries/Clear.d.ts +7 -0
- package/dist/Queries/Clear.d.ts.map +1 -0
- package/dist/Queries/Commit.d.mts +7 -0
- package/dist/Queries/Commit.d.mts.map +1 -0
- package/dist/Queries/Commit.d.ts +7 -0
- package/dist/Queries/Commit.d.ts.map +1 -0
- package/dist/Queries/Delete.d.mts +8 -0
- package/dist/Queries/Delete.d.mts.map +1 -0
- package/dist/Queries/Delete.d.ts +8 -0
- package/dist/Queries/Delete.d.ts.map +1 -0
- package/dist/Queries/Get.d.mts +8 -0
- package/dist/Queries/Get.d.mts.map +1 -0
- package/dist/Queries/Get.d.ts +8 -0
- package/dist/Queries/Get.d.ts.map +1 -0
- package/dist/Queries/Insert.d.mts +7 -0
- package/dist/Queries/Insert.d.mts.map +1 -0
- package/dist/Queries/Insert.d.ts +7 -0
- package/dist/Queries/Insert.d.ts.map +1 -0
- package/dist/Queries/index.d.mts +23 -0
- package/dist/Queries/index.d.mts.map +1 -0
- package/dist/Queries/index.d.ts +23 -0
- package/dist/Queries/index.d.ts.map +1 -0
- package/dist/docs.json +1290 -1278
- package/dist/index.d.mts +7 -127
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +7 -127
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/typeChecks.d.mts +15 -0
- package/dist/typeChecks.d.mts.map +1 -0
- package/dist/typeChecks.d.ts +15 -0
- package/dist/typeChecks.d.ts.map +1 -0
- package/package.json +9 -15
- package/src/Archivist.ts +1 -7
- package/src/ArchivistInstance.ts +3 -3
- package/src/Config.ts +11 -14
- package/src/Params.ts +9 -0
- package/src/index.ts +1 -0
- package/src/typeChecks.ts +1 -1
- package/tsup.config.ts +0 -16
- /package/src/{Events → EventModels}/Cleared.ts +0 -0
- /package/src/{Events → EventModels}/Deleted.ts +0 -0
- /package/src/{Events → EventModels}/Inserted.ts +0 -0
- /package/src/{Events → EventModels}/index.ts +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,127 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
interface ArchivistParents {
|
|
10
|
-
commit?: AddressString[];
|
|
11
|
-
read?: AddressString[];
|
|
12
|
-
write?: AddressString[];
|
|
13
|
-
}
|
|
14
|
-
type ArchivistConfigSchema = 'network.xyo.archivist.config';
|
|
15
|
-
declare const ArchivistConfigSchema: ArchivistConfigSchema;
|
|
16
|
-
type ArchivistConfig<TConfig extends Payload | undefined = undefined> = ModuleConfig<WithAdditional<{
|
|
17
|
-
/** @field address of one or more parent archivists to read from */
|
|
18
|
-
parents?: ArchivistParents;
|
|
19
|
-
/** @field fail if some parents can not be resolved (true if unspecified) */
|
|
20
|
-
requireAllParents?: boolean;
|
|
21
|
-
schema: TConfig extends Payload ? TConfig['schema'] : ArchivistConfigSchema;
|
|
22
|
-
/** @field should child store all reads from parents? */
|
|
23
|
-
storeParentReads?: boolean;
|
|
24
|
-
}, Omit<TConfig, 'schema'>>>;
|
|
25
|
-
|
|
26
|
-
type ClearedEventArgs<T extends Module = Module> = ModuleEventArgs<T>;
|
|
27
|
-
interface ClearedEventData<T extends Module = Module> extends EventData {
|
|
28
|
-
cleared: ClearedEventArgs<T>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
type DeletedEventArgs<T extends Module = Module> = ModuleEventArgs<T, {
|
|
32
|
-
hashes: string[];
|
|
33
|
-
}>;
|
|
34
|
-
interface DeletedEventData<T extends Module = Module> extends EventData {
|
|
35
|
-
deleted: DeletedEventArgs<T>;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
type InsertedEventArgs<T extends Module = Module> = ModuleEventArgs<T, {
|
|
39
|
-
payloads: Payload[];
|
|
40
|
-
}>;
|
|
41
|
-
interface InsertedEventData<T extends Module = Module> extends EventData {
|
|
42
|
-
inserted: InsertedEventArgs<T>;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
interface ReadArchivist<TReadResponse, TId = string> {
|
|
46
|
-
all?(): PromisableArray<TReadResponse>;
|
|
47
|
-
get(ids: TId[]): PromisableArray<TReadResponse>;
|
|
48
|
-
}
|
|
49
|
-
interface WriteArchivist<TReadResponse, TWriteResponse = TReadResponse, TWrite = TReadResponse, TId = string> {
|
|
50
|
-
clear?(): Promisable<void>;
|
|
51
|
-
delete?(ids: TId[]): PromisableArray<TId>;
|
|
52
|
-
insert(item: TWrite[]): PromisableArray<TWriteResponse>;
|
|
53
|
-
}
|
|
54
|
-
interface StashArchivist<TWriteResponse> {
|
|
55
|
-
commit?(): PromisableArray<TWriteResponse>;
|
|
56
|
-
}
|
|
57
|
-
type ArchivistParams<TConfig extends AnyConfigSchema<ArchivistConfig> = AnyConfigSchema<ArchivistConfig>, TAdditionalParams extends AnyObject | undefined = undefined> = ModuleParams<TConfig, TAdditionalParams>;
|
|
58
|
-
interface Archivist<TReadResponse = Payload, TWriteResponse = Payload, TWrite = TReadResponse, TId = string> extends ReadArchivist<TReadResponse, TId>, WriteArchivist<TReadResponse, TWriteResponse, TWrite, TId>, StashArchivist<TWriteResponse> {
|
|
59
|
-
}
|
|
60
|
-
interface ArchivistModuleEventData extends InsertedEventData, DeletedEventData, ClearedEventData, ModuleEventData {
|
|
61
|
-
}
|
|
62
|
-
type ArchivistQueryFunctions<TReadResponse = Payload, TWriteResponse = Payload, TWrite = TReadResponse, TId = string> = Archivist<TReadResponse, TWriteResponse, TWrite, TId> & ModuleQueryFunctions;
|
|
63
|
-
type ArchivistModule<TParams extends ModuleParams<AnyConfigSchema<ArchivistConfig>> = ModuleParams<AnyConfigSchema<ArchivistConfig>>, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> = Module<TParams, TEventData>;
|
|
64
|
-
|
|
65
|
-
type ArchivistInstance<TParams extends ModuleParams<AnyConfigSchema<ArchivistConfig>> = ModuleParams<AnyConfigSchema<ArchivistConfig>>, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> = ArchivistModule<TParams, TEventData> & ArchivistQueryFunctions & ModuleInstance<TParams, TEventData>;
|
|
66
|
-
|
|
67
|
-
type ArchivistAllQuerySchema = 'network.xyo.query.archivist.all';
|
|
68
|
-
declare const ArchivistAllQuerySchema: ArchivistAllQuerySchema;
|
|
69
|
-
type ArchivistAllQuery = Query<{
|
|
70
|
-
schema: ArchivistAllQuerySchema;
|
|
71
|
-
}>;
|
|
72
|
-
|
|
73
|
-
type ArchivistClearQuerySchema = 'network.xyo.query.archivist.clear';
|
|
74
|
-
declare const ArchivistClearQuerySchema: ArchivistClearQuerySchema;
|
|
75
|
-
type ArchivistClearQuery = Query<{
|
|
76
|
-
schema: ArchivistClearQuerySchema;
|
|
77
|
-
}>;
|
|
78
|
-
|
|
79
|
-
type ArchivistCommitQuerySchema = 'network.xyo.query.archivist.commit';
|
|
80
|
-
declare const ArchivistCommitQuerySchema: ArchivistCommitQuerySchema;
|
|
81
|
-
type ArchivistCommitQuery = Query<{
|
|
82
|
-
schema: ArchivistCommitQuerySchema;
|
|
83
|
-
}>;
|
|
84
|
-
|
|
85
|
-
type ArchivistDeleteQuerySchema = 'network.xyo.query.archivist.delete';
|
|
86
|
-
declare const ArchivistDeleteQuerySchema: ArchivistDeleteQuerySchema;
|
|
87
|
-
type ArchivistDeleteQuery = Query<{
|
|
88
|
-
hashes: string[];
|
|
89
|
-
schema: ArchivistDeleteQuerySchema;
|
|
90
|
-
}>;
|
|
91
|
-
|
|
92
|
-
type ArchivistGetQuerySchema = 'network.xyo.query.archivist.get';
|
|
93
|
-
declare const ArchivistGetQuerySchema: ArchivistGetQuerySchema;
|
|
94
|
-
type ArchivistGetQuery = Query<{
|
|
95
|
-
hashes: string[];
|
|
96
|
-
schema: ArchivistGetQuerySchema;
|
|
97
|
-
}>;
|
|
98
|
-
|
|
99
|
-
type ArchivistInsertQuerySchema = 'network.xyo.query.archivist.insert';
|
|
100
|
-
declare const ArchivistInsertQuerySchema: ArchivistInsertQuerySchema;
|
|
101
|
-
type ArchivistInsertQuery = Query<{
|
|
102
|
-
schema: ArchivistInsertQuerySchema;
|
|
103
|
-
}>;
|
|
104
|
-
|
|
105
|
-
type ArchivistQueryBase = ArchivistAllQuery | ArchivistClearQuery | ArchivistCommitQuery | ArchivistDeleteQuery | ArchivistGetQuery | ArchivistInsertQuery;
|
|
106
|
-
/**
|
|
107
|
-
* @deprecated Use ArchivistQueryBase instead to
|
|
108
|
-
* match naming convention
|
|
109
|
-
*/
|
|
110
|
-
type ArchivistQueryRoot = ArchivistQueryBase;
|
|
111
|
-
type ArchivistModuleQueries = ModuleQueryBase | ArchivistQueryBase;
|
|
112
|
-
type ArchivistQuery<TQuery extends Query | void = void> = ModuleQuery<TQuery extends Query ? ArchivistQueryBase | TQuery : ArchivistQueryBase>;
|
|
113
|
-
|
|
114
|
-
declare const isArchivistInstance: _xyo_network_object_identity.ObjectTypeCheck<ArchivistInstance>;
|
|
115
|
-
declare const isArchivistModule: _xyo_network_module_model.ModuleTypeCheck<ArchivistModule>;
|
|
116
|
-
declare const asArchivistModule: {
|
|
117
|
-
(obj: any, config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): ArchivistModule | undefined;
|
|
118
|
-
(obj: any, assert: string | (() => string), config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): ArchivistModule;
|
|
119
|
-
};
|
|
120
|
-
declare const asArchivistInstance: {
|
|
121
|
-
(obj: any, config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): ArchivistInstance | undefined;
|
|
122
|
-
(obj: any, assert: string | (() => string), config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): ArchivistInstance;
|
|
123
|
-
};
|
|
124
|
-
declare const withArchivistModule: <R>(module: any, closure: (module: ArchivistModule) => R) => R | undefined;
|
|
125
|
-
declare const withArchivistInstance: <R>(module: any, closure: (module: ArchivistInstance) => R) => R | undefined;
|
|
126
|
-
|
|
127
|
-
export { Archivist, ArchivistAllQuery, ArchivistAllQuerySchema, ArchivistClearQuery, ArchivistClearQuerySchema, ArchivistCommitQuery, ArchivistCommitQuerySchema, ArchivistConfig, ArchivistConfigSchema, ArchivistDeleteQuery, ArchivistDeleteQuerySchema, ArchivistGetQuery, ArchivistGetQuerySchema, ArchivistInsertQuery, ArchivistInsertQuerySchema, ArchivistInstance, ArchivistModule, ArchivistModuleEventData, ArchivistModuleQueries, ArchivistParams, ArchivistParents, ArchivistQuery, ArchivistQueryBase, ArchivistQueryFunctions, ArchivistQueryRoot, ReadArchivist, StashArchivist, WriteArchivist, asArchivistInstance, asArchivistModule, isArchivistInstance, isArchivistModule, withArchivistInstance, withArchivistModule };
|
|
1
|
+
export * from './Archivist';
|
|
2
|
+
export * from './ArchivistInstance';
|
|
3
|
+
export * from './Config';
|
|
4
|
+
export * from './Params';
|
|
5
|
+
export * from './Queries';
|
|
6
|
+
export * from './typeChecks';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,127 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
interface ArchivistParents {
|
|
10
|
-
commit?: AddressString[];
|
|
11
|
-
read?: AddressString[];
|
|
12
|
-
write?: AddressString[];
|
|
13
|
-
}
|
|
14
|
-
type ArchivistConfigSchema = 'network.xyo.archivist.config';
|
|
15
|
-
declare const ArchivistConfigSchema: ArchivistConfigSchema;
|
|
16
|
-
type ArchivistConfig<TConfig extends Payload | undefined = undefined> = ModuleConfig<WithAdditional<{
|
|
17
|
-
/** @field address of one or more parent archivists to read from */
|
|
18
|
-
parents?: ArchivistParents;
|
|
19
|
-
/** @field fail if some parents can not be resolved (true if unspecified) */
|
|
20
|
-
requireAllParents?: boolean;
|
|
21
|
-
schema: TConfig extends Payload ? TConfig['schema'] : ArchivistConfigSchema;
|
|
22
|
-
/** @field should child store all reads from parents? */
|
|
23
|
-
storeParentReads?: boolean;
|
|
24
|
-
}, Omit<TConfig, 'schema'>>>;
|
|
25
|
-
|
|
26
|
-
type ClearedEventArgs<T extends Module = Module> = ModuleEventArgs<T>;
|
|
27
|
-
interface ClearedEventData<T extends Module = Module> extends EventData {
|
|
28
|
-
cleared: ClearedEventArgs<T>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
type DeletedEventArgs<T extends Module = Module> = ModuleEventArgs<T, {
|
|
32
|
-
hashes: string[];
|
|
33
|
-
}>;
|
|
34
|
-
interface DeletedEventData<T extends Module = Module> extends EventData {
|
|
35
|
-
deleted: DeletedEventArgs<T>;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
type InsertedEventArgs<T extends Module = Module> = ModuleEventArgs<T, {
|
|
39
|
-
payloads: Payload[];
|
|
40
|
-
}>;
|
|
41
|
-
interface InsertedEventData<T extends Module = Module> extends EventData {
|
|
42
|
-
inserted: InsertedEventArgs<T>;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
interface ReadArchivist<TReadResponse, TId = string> {
|
|
46
|
-
all?(): PromisableArray<TReadResponse>;
|
|
47
|
-
get(ids: TId[]): PromisableArray<TReadResponse>;
|
|
48
|
-
}
|
|
49
|
-
interface WriteArchivist<TReadResponse, TWriteResponse = TReadResponse, TWrite = TReadResponse, TId = string> {
|
|
50
|
-
clear?(): Promisable<void>;
|
|
51
|
-
delete?(ids: TId[]): PromisableArray<TId>;
|
|
52
|
-
insert(item: TWrite[]): PromisableArray<TWriteResponse>;
|
|
53
|
-
}
|
|
54
|
-
interface StashArchivist<TWriteResponse> {
|
|
55
|
-
commit?(): PromisableArray<TWriteResponse>;
|
|
56
|
-
}
|
|
57
|
-
type ArchivistParams<TConfig extends AnyConfigSchema<ArchivistConfig> = AnyConfigSchema<ArchivistConfig>, TAdditionalParams extends AnyObject | undefined = undefined> = ModuleParams<TConfig, TAdditionalParams>;
|
|
58
|
-
interface Archivist<TReadResponse = Payload, TWriteResponse = Payload, TWrite = TReadResponse, TId = string> extends ReadArchivist<TReadResponse, TId>, WriteArchivist<TReadResponse, TWriteResponse, TWrite, TId>, StashArchivist<TWriteResponse> {
|
|
59
|
-
}
|
|
60
|
-
interface ArchivistModuleEventData extends InsertedEventData, DeletedEventData, ClearedEventData, ModuleEventData {
|
|
61
|
-
}
|
|
62
|
-
type ArchivistQueryFunctions<TReadResponse = Payload, TWriteResponse = Payload, TWrite = TReadResponse, TId = string> = Archivist<TReadResponse, TWriteResponse, TWrite, TId> & ModuleQueryFunctions;
|
|
63
|
-
type ArchivistModule<TParams extends ModuleParams<AnyConfigSchema<ArchivistConfig>> = ModuleParams<AnyConfigSchema<ArchivistConfig>>, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> = Module<TParams, TEventData>;
|
|
64
|
-
|
|
65
|
-
type ArchivistInstance<TParams extends ModuleParams<AnyConfigSchema<ArchivistConfig>> = ModuleParams<AnyConfigSchema<ArchivistConfig>>, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> = ArchivistModule<TParams, TEventData> & ArchivistQueryFunctions & ModuleInstance<TParams, TEventData>;
|
|
66
|
-
|
|
67
|
-
type ArchivistAllQuerySchema = 'network.xyo.query.archivist.all';
|
|
68
|
-
declare const ArchivistAllQuerySchema: ArchivistAllQuerySchema;
|
|
69
|
-
type ArchivistAllQuery = Query<{
|
|
70
|
-
schema: ArchivistAllQuerySchema;
|
|
71
|
-
}>;
|
|
72
|
-
|
|
73
|
-
type ArchivistClearQuerySchema = 'network.xyo.query.archivist.clear';
|
|
74
|
-
declare const ArchivistClearQuerySchema: ArchivistClearQuerySchema;
|
|
75
|
-
type ArchivistClearQuery = Query<{
|
|
76
|
-
schema: ArchivistClearQuerySchema;
|
|
77
|
-
}>;
|
|
78
|
-
|
|
79
|
-
type ArchivistCommitQuerySchema = 'network.xyo.query.archivist.commit';
|
|
80
|
-
declare const ArchivistCommitQuerySchema: ArchivistCommitQuerySchema;
|
|
81
|
-
type ArchivistCommitQuery = Query<{
|
|
82
|
-
schema: ArchivistCommitQuerySchema;
|
|
83
|
-
}>;
|
|
84
|
-
|
|
85
|
-
type ArchivistDeleteQuerySchema = 'network.xyo.query.archivist.delete';
|
|
86
|
-
declare const ArchivistDeleteQuerySchema: ArchivistDeleteQuerySchema;
|
|
87
|
-
type ArchivistDeleteQuery = Query<{
|
|
88
|
-
hashes: string[];
|
|
89
|
-
schema: ArchivistDeleteQuerySchema;
|
|
90
|
-
}>;
|
|
91
|
-
|
|
92
|
-
type ArchivistGetQuerySchema = 'network.xyo.query.archivist.get';
|
|
93
|
-
declare const ArchivistGetQuerySchema: ArchivistGetQuerySchema;
|
|
94
|
-
type ArchivistGetQuery = Query<{
|
|
95
|
-
hashes: string[];
|
|
96
|
-
schema: ArchivistGetQuerySchema;
|
|
97
|
-
}>;
|
|
98
|
-
|
|
99
|
-
type ArchivistInsertQuerySchema = 'network.xyo.query.archivist.insert';
|
|
100
|
-
declare const ArchivistInsertQuerySchema: ArchivistInsertQuerySchema;
|
|
101
|
-
type ArchivistInsertQuery = Query<{
|
|
102
|
-
schema: ArchivistInsertQuerySchema;
|
|
103
|
-
}>;
|
|
104
|
-
|
|
105
|
-
type ArchivistQueryBase = ArchivistAllQuery | ArchivistClearQuery | ArchivistCommitQuery | ArchivistDeleteQuery | ArchivistGetQuery | ArchivistInsertQuery;
|
|
106
|
-
/**
|
|
107
|
-
* @deprecated Use ArchivistQueryBase instead to
|
|
108
|
-
* match naming convention
|
|
109
|
-
*/
|
|
110
|
-
type ArchivistQueryRoot = ArchivistQueryBase;
|
|
111
|
-
type ArchivistModuleQueries = ModuleQueryBase | ArchivistQueryBase;
|
|
112
|
-
type ArchivistQuery<TQuery extends Query | void = void> = ModuleQuery<TQuery extends Query ? ArchivistQueryBase | TQuery : ArchivistQueryBase>;
|
|
113
|
-
|
|
114
|
-
declare const isArchivistInstance: _xyo_network_object_identity.ObjectTypeCheck<ArchivistInstance>;
|
|
115
|
-
declare const isArchivistModule: _xyo_network_module_model.ModuleTypeCheck<ArchivistModule>;
|
|
116
|
-
declare const asArchivistModule: {
|
|
117
|
-
(obj: any, config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): ArchivistModule | undefined;
|
|
118
|
-
(obj: any, assert: string | (() => string), config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): ArchivistModule;
|
|
119
|
-
};
|
|
120
|
-
declare const asArchivistInstance: {
|
|
121
|
-
(obj: any, config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): ArchivistInstance | undefined;
|
|
122
|
-
(obj: any, assert: string | (() => string), config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): ArchivistInstance;
|
|
123
|
-
};
|
|
124
|
-
declare const withArchivistModule: <R>(module: any, closure: (module: ArchivistModule) => R) => R | undefined;
|
|
125
|
-
declare const withArchivistInstance: <R>(module: any, closure: (module: ArchivistInstance) => R) => R | undefined;
|
|
126
|
-
|
|
127
|
-
export { Archivist, ArchivistAllQuery, ArchivistAllQuerySchema, ArchivistClearQuery, ArchivistClearQuerySchema, ArchivistCommitQuery, ArchivistCommitQuerySchema, ArchivistConfig, ArchivistConfigSchema, ArchivistDeleteQuery, ArchivistDeleteQuerySchema, ArchivistGetQuery, ArchivistGetQuerySchema, ArchivistInsertQuery, ArchivistInsertQuerySchema, ArchivistInstance, ArchivistModule, ArchivistModuleEventData, ArchivistModuleQueries, ArchivistParams, ArchivistParents, ArchivistQuery, ArchivistQueryBase, ArchivistQueryFunctions, ArchivistQueryRoot, ReadArchivist, StashArchivist, WriteArchivist, asArchivistInstance, asArchivistModule, isArchivistInstance, isArchivistModule, withArchivistInstance, withArchivistModule };
|
|
1
|
+
export * from './Archivist';
|
|
2
|
+
export * from './ArchivistInstance';
|
|
3
|
+
export * from './Config';
|
|
4
|
+
export * from './Params';
|
|
5
|
+
export * from './Queries';
|
|
6
|
+
export * from './typeChecks';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -59,11 +59,11 @@ var ArchivistInsertQuerySchema = "network.xyo.query.archivist.insert";
|
|
|
59
59
|
|
|
60
60
|
// src/typeChecks.ts
|
|
61
61
|
var import_module_model = require("@xyo-network/module-model");
|
|
62
|
-
var
|
|
62
|
+
var import_object = require("@xyo-network/object");
|
|
63
63
|
var isArchivistInstance = new import_module_model.IsInstanceFactory().create({ get: "function" }, [import_module_model.isModuleInstance]);
|
|
64
64
|
var isArchivistModule = new import_module_model.IsModuleFactory().create([ArchivistGetQuerySchema]);
|
|
65
|
-
var asArchivistModule =
|
|
66
|
-
var asArchivistInstance =
|
|
65
|
+
var asArchivistModule = import_object.AsObjectFactory.create(isArchivistModule);
|
|
66
|
+
var asArchivistInstance = import_object.AsObjectFactory.create(isArchivistInstance);
|
|
67
67
|
var withArchivistModule = import_module_model.WithFactory.create(isArchivistModule);
|
|
68
68
|
var withArchivistInstance = import_module_model.WithFactory.create(isArchivistInstance);
|
|
69
69
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/Config.ts","../src/Queries/All.ts","../src/Queries/Clear.ts","../src/Queries/Commit.ts","../src/Queries/Delete.ts","../src/Queries/Get.ts","../src/Queries/Insert.ts","../src/typeChecks.ts"],"sourcesContent":["export * from './Archivist'\nexport * from './ArchivistInstance'\nexport * from './Config'\nexport * from './Queries'\nexport * from './typeChecks'\n","import {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/Config.ts","../src/Queries/All.ts","../src/Queries/Clear.ts","../src/Queries/Commit.ts","../src/Queries/Delete.ts","../src/Queries/Get.ts","../src/Queries/Insert.ts","../src/typeChecks.ts"],"sourcesContent":["export * from './Archivist'\nexport * from './ArchivistInstance'\nexport * from './Config'\nexport * from './Params'\nexport * from './Queries'\nexport * from './typeChecks'\n","import { AddressString, ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport interface ArchivistParents {\n commit?: AddressString[]\n read?: AddressString[]\n write?: AddressString[]\n}\n\nexport type ArchivistConfigSchema = 'network.xyo.archivist.config'\nexport const ArchivistConfigSchema: ArchivistConfigSchema = 'network.xyo.archivist.config'\n\nexport type ArchivistConfig<TConfig extends Payload | void = void> = ModuleConfig<\n TConfig,\n {\n /** @field address of one or more parent archivists to read from */\n parents?: ArchivistParents\n /** @field fail if some parents can not be resolved (true if unspecified) */\n requireAllParents?: boolean\n /** @field should child store all reads from parents? */\n storeParentReads?: boolean\n },\n TConfig extends Payload ? TConfig['schema'] : ArchivistConfigSchema\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistAllQuerySchema = 'network.xyo.query.archivist.all'\nexport const ArchivistAllQuerySchema: ArchivistAllQuerySchema = 'network.xyo.query.archivist.all'\n\nexport type ArchivistAllQuery = Query<{\n schema: ArchivistAllQuerySchema\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistClearQuerySchema = 'network.xyo.query.archivist.clear'\nexport const ArchivistClearQuerySchema: ArchivistClearQuerySchema = 'network.xyo.query.archivist.clear'\n\nexport type ArchivistClearQuery = Query<{\n schema: ArchivistClearQuerySchema\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistCommitQuerySchema = 'network.xyo.query.archivist.commit'\nexport const ArchivistCommitQuerySchema: ArchivistCommitQuerySchema = 'network.xyo.query.archivist.commit'\n\nexport type ArchivistCommitQuery = Query<{\n schema: ArchivistCommitQuerySchema\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistDeleteQuerySchema = 'network.xyo.query.archivist.delete'\nexport const ArchivistDeleteQuerySchema: ArchivistDeleteQuerySchema = 'network.xyo.query.archivist.delete'\n\nexport type ArchivistDeleteQuery = Query<{\n hashes: string[]\n schema: ArchivistDeleteQuerySchema\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistGetQuerySchema = 'network.xyo.query.archivist.get'\nexport const ArchivistGetQuerySchema: ArchivistGetQuerySchema = 'network.xyo.query.archivist.get'\n\nexport type ArchivistGetQuery = Query<{\n hashes: string[]\n schema: ArchivistGetQuerySchema\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistInsertQuerySchema = 'network.xyo.query.archivist.insert'\nexport const ArchivistInsertQuerySchema: ArchivistInsertQuerySchema = 'network.xyo.query.archivist.insert'\n\nexport type ArchivistInsertQuery = Query<{\n schema: ArchivistInsertQuerySchema\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { ArchivistModule } from './Archivist'\nimport { ArchivistInstance } from './ArchivistInstance'\nimport { ArchivistGetQuerySchema } from './Queries'\n\nexport const isArchivistInstance = new IsInstanceFactory<ArchivistInstance>().create({ get: 'function' }, [isModuleInstance])\nexport const isArchivistModule = new IsModuleFactory<ArchivistModule>().create([ArchivistGetQuerySchema])\n\nexport const asArchivistModule = AsObjectFactory.create(isArchivistModule)\nexport const asArchivistInstance = AsObjectFactory.create(isArchivistInstance)\nexport const withArchivistModule = WithFactory.create(isArchivistModule)\nexport const withArchivistInstance = WithFactory.create(isArchivistInstance)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACUO,IAAM,wBAA+C;;;ACPrD,IAAM,0BAAmD;;;ACAzD,IAAM,4BAAuD;;;ACA7D,IAAM,6BAAyD;;;ACA/D,IAAM,6BAAyD;;;ACA/D,IAAM,0BAAmD;;;ACAzD,IAAM,6BAAyD;;;ACHtE,0BAAkF;AAClF,oBAAgC;AAMzB,IAAM,sBAAsB,IAAI,sCAAqC,EAAE,OAAO,EAAE,KAAK,WAAW,GAAG,CAAC,oCAAgB,CAAC;AACrH,IAAM,oBAAoB,IAAI,oCAAiC,EAAE,OAAO,CAAC,uBAAuB,CAAC;AAEjG,IAAM,oBAAoB,8BAAgB,OAAO,iBAAiB;AAClE,IAAM,sBAAsB,8BAAgB,OAAO,mBAAmB;AACtE,IAAM,sBAAsB,gCAAY,OAAO,iBAAiB;AAChE,IAAM,wBAAwB,gCAAY,OAAO,mBAAmB;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -21,7 +21,7 @@ var ArchivistInsertQuerySchema = "network.xyo.query.archivist.insert";
|
|
|
21
21
|
|
|
22
22
|
// src/typeChecks.ts
|
|
23
23
|
import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from "@xyo-network/module-model";
|
|
24
|
-
import { AsObjectFactory } from "@xyo-network/object
|
|
24
|
+
import { AsObjectFactory } from "@xyo-network/object";
|
|
25
25
|
var isArchivistInstance = new IsInstanceFactory().create({ get: "function" }, [isModuleInstance]);
|
|
26
26
|
var isArchivistModule = new IsModuleFactory().create([ArchivistGetQuerySchema]);
|
|
27
27
|
var asArchivistModule = AsObjectFactory.create(isArchivistModule);
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Config.ts","../src/Queries/All.ts","../src/Queries/Clear.ts","../src/Queries/Commit.ts","../src/Queries/Delete.ts","../src/Queries/Get.ts","../src/Queries/Insert.ts","../src/typeChecks.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/Config.ts","../src/Queries/All.ts","../src/Queries/Clear.ts","../src/Queries/Commit.ts","../src/Queries/Delete.ts","../src/Queries/Get.ts","../src/Queries/Insert.ts","../src/typeChecks.ts"],"sourcesContent":["import { AddressString, ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport interface ArchivistParents {\n commit?: AddressString[]\n read?: AddressString[]\n write?: AddressString[]\n}\n\nexport type ArchivistConfigSchema = 'network.xyo.archivist.config'\nexport const ArchivistConfigSchema: ArchivistConfigSchema = 'network.xyo.archivist.config'\n\nexport type ArchivistConfig<TConfig extends Payload | void = void> = ModuleConfig<\n TConfig,\n {\n /** @field address of one or more parent archivists to read from */\n parents?: ArchivistParents\n /** @field fail if some parents can not be resolved (true if unspecified) */\n requireAllParents?: boolean\n /** @field should child store all reads from parents? */\n storeParentReads?: boolean\n },\n TConfig extends Payload ? TConfig['schema'] : ArchivistConfigSchema\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistAllQuerySchema = 'network.xyo.query.archivist.all'\nexport const ArchivistAllQuerySchema: ArchivistAllQuerySchema = 'network.xyo.query.archivist.all'\n\nexport type ArchivistAllQuery = Query<{\n schema: ArchivistAllQuerySchema\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistClearQuerySchema = 'network.xyo.query.archivist.clear'\nexport const ArchivistClearQuerySchema: ArchivistClearQuerySchema = 'network.xyo.query.archivist.clear'\n\nexport type ArchivistClearQuery = Query<{\n schema: ArchivistClearQuerySchema\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistCommitQuerySchema = 'network.xyo.query.archivist.commit'\nexport const ArchivistCommitQuerySchema: ArchivistCommitQuerySchema = 'network.xyo.query.archivist.commit'\n\nexport type ArchivistCommitQuery = Query<{\n schema: ArchivistCommitQuerySchema\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistDeleteQuerySchema = 'network.xyo.query.archivist.delete'\nexport const ArchivistDeleteQuerySchema: ArchivistDeleteQuerySchema = 'network.xyo.query.archivist.delete'\n\nexport type ArchivistDeleteQuery = Query<{\n hashes: string[]\n schema: ArchivistDeleteQuerySchema\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistGetQuerySchema = 'network.xyo.query.archivist.get'\nexport const ArchivistGetQuerySchema: ArchivistGetQuerySchema = 'network.xyo.query.archivist.get'\n\nexport type ArchivistGetQuery = Query<{\n hashes: string[]\n schema: ArchivistGetQuerySchema\n}>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistInsertQuerySchema = 'network.xyo.query.archivist.insert'\nexport const ArchivistInsertQuerySchema: ArchivistInsertQuerySchema = 'network.xyo.query.archivist.insert'\n\nexport type ArchivistInsertQuery = Query<{\n schema: ArchivistInsertQuerySchema\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { ArchivistModule } from './Archivist'\nimport { ArchivistInstance } from './ArchivistInstance'\nimport { ArchivistGetQuerySchema } from './Queries'\n\nexport const isArchivistInstance = new IsInstanceFactory<ArchivistInstance>().create({ get: 'function' }, [isModuleInstance])\nexport const isArchivistModule = new IsModuleFactory<ArchivistModule>().create([ArchivistGetQuerySchema])\n\nexport const asArchivistModule = AsObjectFactory.create(isArchivistModule)\nexport const asArchivistInstance = AsObjectFactory.create(isArchivistInstance)\nexport const withArchivistModule = WithFactory.create(isArchivistModule)\nexport const withArchivistInstance = WithFactory.create(isArchivistInstance)\n"],"mappings":";AAUO,IAAM,wBAA+C;;;ACPrD,IAAM,0BAAmD;;;ACAzD,IAAM,4BAAuD;;;ACA7D,IAAM,6BAAyD;;;ACA/D,IAAM,6BAAyD;;;ACA/D,IAAM,0BAAmD;;;ACAzD,IAAM,6BAAyD;;;ACHtE,SAAS,mBAAmB,iBAAiB,kBAAkB,mBAAmB;AAClF,SAAS,uBAAuB;AAMzB,IAAM,sBAAsB,IAAI,kBAAqC,EAAE,OAAO,EAAE,KAAK,WAAW,GAAG,CAAC,gBAAgB,CAAC;AACrH,IAAM,oBAAoB,IAAI,gBAAiC,EAAE,OAAO,CAAC,uBAAuB,CAAC;AAEjG,IAAM,oBAAoB,gBAAgB,OAAO,iBAAiB;AAClE,IAAM,sBAAsB,gBAAgB,OAAO,mBAAmB;AACtE,IAAM,sBAAsB,YAAY,OAAO,iBAAiB;AAChE,IAAM,wBAAwB,YAAY,OAAO,mBAAmB;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ArchivistModule } from './Archivist';
|
|
2
|
+
import { ArchivistInstance } from './ArchivistInstance';
|
|
3
|
+
export declare const isArchivistInstance: import("@xyo-network/object").ObjectTypeCheck<ArchivistInstance>;
|
|
4
|
+
export declare const isArchivistModule: import("@xyo-network/module-model").ModuleTypeCheck<ArchivistModule>;
|
|
5
|
+
export declare const asArchivistModule: {
|
|
6
|
+
<TObject extends ArchivistModule>(obj: object | null | undefined, config?: import("@xyo-network/object").ObjectTypeConfig | undefined): TObject | undefined;
|
|
7
|
+
<TObject_1 extends ArchivistModule>(obj: object | null | undefined, assert: string | (() => string), config?: import("@xyo-network/object").ObjectTypeConfig | undefined): TObject_1;
|
|
8
|
+
};
|
|
9
|
+
export declare const asArchivistInstance: {
|
|
10
|
+
<TObject extends ArchivistInstance>(obj: object | null | undefined, config?: import("@xyo-network/object").ObjectTypeConfig | undefined): TObject | undefined;
|
|
11
|
+
<TObject_1 extends ArchivistInstance>(obj: object | null | undefined, assert: string | (() => string), config?: import("@xyo-network/object").ObjectTypeConfig | undefined): TObject_1;
|
|
12
|
+
};
|
|
13
|
+
export declare const withArchivistModule: <R>(module: any, closure: (module: ArchivistModule) => R) => R | undefined;
|
|
14
|
+
export declare const withArchivistInstance: <R>(module: any, closure: (module: ArchivistInstance) => R) => R | undefined;
|
|
15
|
+
//# sourceMappingURL=typeChecks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeChecks.d.ts","sourceRoot":"","sources":["../src/typeChecks.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,eAAO,MAAM,mBAAmB,kEAA6F,CAAA;AAC7H,eAAO,MAAM,iBAAiB,sEAA2E,CAAA;AAEzG,eAAO,MAAM,iBAAiB;;;CAA4C,CAAA;AAC1E,eAAO,MAAM,mBAAmB;;;CAA8C,CAAA;AAC9E,eAAO,MAAM,mBAAmB,4EAAwC,CAAA;AACxE,eAAO,MAAM,qBAAqB,8EAA0C,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ArchivistModule } from './Archivist';
|
|
2
|
+
import { ArchivistInstance } from './ArchivistInstance';
|
|
3
|
+
export declare const isArchivistInstance: import("@xyo-network/object").ObjectTypeCheck<ArchivistInstance>;
|
|
4
|
+
export declare const isArchivistModule: import("@xyo-network/module-model").ModuleTypeCheck<ArchivistModule>;
|
|
5
|
+
export declare const asArchivistModule: {
|
|
6
|
+
<TObject extends ArchivistModule>(obj: object | null | undefined, config?: import("@xyo-network/object").ObjectTypeConfig | undefined): TObject | undefined;
|
|
7
|
+
<TObject_1 extends ArchivistModule>(obj: object | null | undefined, assert: string | (() => string), config?: import("@xyo-network/object").ObjectTypeConfig | undefined): TObject_1;
|
|
8
|
+
};
|
|
9
|
+
export declare const asArchivistInstance: {
|
|
10
|
+
<TObject extends ArchivistInstance>(obj: object | null | undefined, config?: import("@xyo-network/object").ObjectTypeConfig | undefined): TObject | undefined;
|
|
11
|
+
<TObject_1 extends ArchivistInstance>(obj: object | null | undefined, assert: string | (() => string), config?: import("@xyo-network/object").ObjectTypeConfig | undefined): TObject_1;
|
|
12
|
+
};
|
|
13
|
+
export declare const withArchivistModule: <R>(module: any, closure: (module: ArchivistModule) => R) => R | undefined;
|
|
14
|
+
export declare const withArchivistInstance: <R>(module: any, closure: (module: ArchivistInstance) => R) => R | undefined;
|
|
15
|
+
//# sourceMappingURL=typeChecks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeChecks.d.ts","sourceRoot":"","sources":["../src/typeChecks.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,eAAO,MAAM,mBAAmB,kEAA6F,CAAA;AAC7H,eAAO,MAAM,iBAAiB,sEAA2E,CAAA;AAEzG,eAAO,MAAM,iBAAiB;;;CAA4C,CAAA;AAC1E,eAAO,MAAM,mBAAmB;;;CAA8C,CAAA;AAC9E,eAAO,MAAM,mBAAmB,4EAAwC,CAAA;AACxE,eAAO,MAAM,qBAAqB,8EAA0C,CAAA"}
|
package/package.json
CHANGED
|
@@ -10,24 +10,18 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xyo-network/core": "~2.
|
|
14
|
-
"@xyo-network/module-events": "~2.
|
|
15
|
-
"@xyo-network/module-model": "~2.
|
|
16
|
-
"@xyo-network/object
|
|
17
|
-
"@xyo-network/payload-model": "~2.
|
|
18
|
-
"@xyo-network/promise": "~2.
|
|
13
|
+
"@xyo-network/core": "~2.74.1",
|
|
14
|
+
"@xyo-network/module-events": "~2.74.1",
|
|
15
|
+
"@xyo-network/module-model": "~2.74.1",
|
|
16
|
+
"@xyo-network/object": "~2.74.1",
|
|
17
|
+
"@xyo-network/payload-model": "~2.74.1",
|
|
18
|
+
"@xyo-network/promise": "~2.74.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@xylabs/ts-scripts-yarn3": "^
|
|
22
|
-
"@xylabs/tsconfig": "^
|
|
23
|
-
"publint": "^0.2.2",
|
|
24
|
-
"tsup": "^7.2.0",
|
|
21
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.28",
|
|
22
|
+
"@xylabs/tsconfig": "^3.0.28",
|
|
25
23
|
"typescript": "^5.2.2"
|
|
26
24
|
},
|
|
27
|
-
"scripts": {
|
|
28
|
-
"package-compile": "tsup && publint",
|
|
29
|
-
"package-recompile": "tsup && publint"
|
|
30
|
-
},
|
|
31
25
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
32
26
|
"docs": "dist/docs.json",
|
|
33
27
|
"types": "dist/index.d.ts",
|
|
@@ -68,5 +62,5 @@
|
|
|
68
62
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
69
63
|
},
|
|
70
64
|
"sideEffects": false,
|
|
71
|
-
"version": "2.
|
|
65
|
+
"version": "2.74.1"
|
|
72
66
|
}
|
package/src/Archivist.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { AnyObject } from '@xyo-network/core'
|
|
2
1
|
import { AnyConfigSchema, Module, ModuleEventData, ModuleParams, ModuleQueryFunctions } from '@xyo-network/module-model'
|
|
3
2
|
import { Payload } from '@xyo-network/payload-model'
|
|
4
3
|
import { Promisable, PromisableArray } from '@xyo-network/promise'
|
|
5
4
|
|
|
6
5
|
import { ArchivistConfig } from './Config'
|
|
7
|
-
import { ClearedEventData, DeletedEventData, InsertedEventData } from './
|
|
6
|
+
import { ClearedEventData, DeletedEventData, InsertedEventData } from './EventModels'
|
|
8
7
|
|
|
9
8
|
export interface ReadArchivist<TReadResponse, TId = string> {
|
|
10
9
|
all?(): PromisableArray<TReadResponse>
|
|
@@ -21,11 +20,6 @@ export interface StashArchivist<TWriteResponse> {
|
|
|
21
20
|
commit?(): PromisableArray<TWriteResponse>
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
export type ArchivistParams<
|
|
25
|
-
TConfig extends AnyConfigSchema<ArchivistConfig> = AnyConfigSchema<ArchivistConfig>,
|
|
26
|
-
TAdditionalParams extends AnyObject | undefined = undefined,
|
|
27
|
-
> = ModuleParams<TConfig, TAdditionalParams>
|
|
28
|
-
|
|
29
23
|
export interface Archivist<TReadResponse = Payload, TWriteResponse = Payload, TWrite = TReadResponse, TId = string>
|
|
30
24
|
extends ReadArchivist<TReadResponse, TId>,
|
|
31
25
|
WriteArchivist<TReadResponse, TWriteResponse, TWrite, TId>,
|
package/src/ArchivistInstance.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModuleInstance } from '@xyo-network/module-model'
|
|
2
2
|
|
|
3
3
|
import { ArchivistModule, ArchivistModuleEventData, ArchivistQueryFunctions } from './Archivist'
|
|
4
|
-
import {
|
|
4
|
+
import { ArchivistParams } from './Params'
|
|
5
5
|
|
|
6
6
|
export type ArchivistInstance<
|
|
7
|
-
TParams extends
|
|
7
|
+
TParams extends ArchivistParams = ArchivistParams,
|
|
8
8
|
TEventData extends ArchivistModuleEventData = ArchivistModuleEventData,
|
|
9
9
|
> = ArchivistModule<TParams, TEventData> & ArchivistQueryFunctions & ModuleInstance<TParams, TEventData>
|
package/src/Config.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { WithAdditional } from '@xyo-network/core'
|
|
2
1
|
import { AddressString, ModuleConfig } from '@xyo-network/module-model'
|
|
3
2
|
import { Payload } from '@xyo-network/payload-model'
|
|
4
3
|
|
|
@@ -11,17 +10,15 @@ export interface ArchivistParents {
|
|
|
11
10
|
export type ArchivistConfigSchema = 'network.xyo.archivist.config'
|
|
12
11
|
export const ArchivistConfigSchema: ArchivistConfigSchema = 'network.xyo.archivist.config'
|
|
13
12
|
|
|
14
|
-
export type ArchivistConfig<TConfig extends Payload |
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Omit<TConfig, 'schema'>
|
|
26
|
-
>
|
|
13
|
+
export type ArchivistConfig<TConfig extends Payload | void = void> = ModuleConfig<
|
|
14
|
+
TConfig,
|
|
15
|
+
{
|
|
16
|
+
/** @field address of one or more parent archivists to read from */
|
|
17
|
+
parents?: ArchivistParents
|
|
18
|
+
/** @field fail if some parents can not be resolved (true if unspecified) */
|
|
19
|
+
requireAllParents?: boolean
|
|
20
|
+
/** @field should child store all reads from parents? */
|
|
21
|
+
storeParentReads?: boolean
|
|
22
|
+
},
|
|
23
|
+
TConfig extends Payload ? TConfig['schema'] : ArchivistConfigSchema
|
|
27
24
|
>
|
package/src/Params.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AnyObject } from '@xyo-network/core'
|
|
2
|
+
import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'
|
|
3
|
+
|
|
4
|
+
import { ArchivistConfig } from './Config'
|
|
5
|
+
|
|
6
|
+
export type ArchivistParams<
|
|
7
|
+
TConfig extends AnyConfigSchema<ArchivistConfig> = AnyConfigSchema<ArchivistConfig>,
|
|
8
|
+
TAdditionalParams extends AnyObject | undefined = undefined,
|
|
9
|
+
> = ModuleParams<TConfig, TAdditionalParams>
|
package/src/index.ts
CHANGED
package/src/typeChecks.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'
|
|
2
|
-
import { AsObjectFactory } from '@xyo-network/object
|
|
2
|
+
import { AsObjectFactory } from '@xyo-network/object'
|
|
3
3
|
|
|
4
4
|
import { ArchivistModule } from './Archivist'
|
|
5
5
|
import { ArchivistInstance } from './ArchivistInstance'
|
package/tsup.config.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup'
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line import/no-default-export
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
bundle: true,
|
|
6
|
-
cjsInterop: true,
|
|
7
|
-
clean: false,
|
|
8
|
-
dts: {
|
|
9
|
-
entry: ['src/index.ts'],
|
|
10
|
-
},
|
|
11
|
-
entry: ['src/index.ts'],
|
|
12
|
-
format: ['cjs', 'esm'],
|
|
13
|
-
sourcemap: true,
|
|
14
|
-
splitting: false,
|
|
15
|
-
tsconfig: 'tsconfig.json',
|
|
16
|
-
})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|