@xyo-network/module-model 2.84.14 → 2.84.16

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/src/Config.ts CHANGED
@@ -28,68 +28,56 @@ export interface ArchivingModuleConfig {
28
28
  }
29
29
  }
30
30
 
31
- export type ModuleConfig<
32
- TConfig extends Payload | void = void,
33
- TAdditionalParams extends EmptyObject | void = void,
34
- TSchema extends Schema | void = void,
35
- > = Payload<
31
+ export type ModuleConfig<TConfig extends EmptyObject | Payload | void = void, TSchema extends Schema | void = void> = Payload<
36
32
  WithAdditional<
37
- WithAdditional<
38
- {
39
- /** @field The path to use when creating the account */
40
- accountDerivationPath?: string
41
-
42
- /** @field The name/address of the Archivist to use for this module */
43
- readonly archivist?: ArchivistModuleConfig
44
-
45
- /**
46
- * @field The labels used for this module. If a label is specified, then the
47
- * ModuleFactoryLocator will attempt to find a ModuleFactory with the corresponding
48
- * labels to construct this module.
49
- */
50
- readonly labels?: Labels
51
-
52
- /** @field Friendly name of module (not collision resistent). Can be used to resolve module when registered/attached to Node. */
53
- readonly name?: string
54
-
55
- /** @field paging settings for queries */
56
- readonly paging?: Record<string, { size?: number }>
57
-
58
- /** @field The query schemas and allowed/disallowed addresses which are allowed to issue them against the module. If both allowed and disallowed is specified, then disallowed takes priority. */
59
- readonly security?: {
60
- /** @field Will the module process queries that have unsigned BoundWitness in query tuples */
61
- readonly allowAnonymous?: boolean
62
-
63
- /** @field If schema in record, then only these address sets can access query */
64
- readonly allowed?: Record<SchemaString, (Address | CosigningAddressSet)[]>
65
-
66
- /** @field If schema in record, then anyone except these addresses can access query */
67
- readonly disallowed?: Record<SchemaString, Address[]>
68
- }
69
-
70
- /** @field sign every query */
71
- readonly sign?: boolean
72
-
73
- /** @field Store the queries made to the module in an archivist if possible */
74
- readonly storeQueries?: boolean
75
-
76
- /** @field add a timestamp payload to every query */
77
- readonly timestamp?: boolean
78
- } & ArchivingModuleConfig,
79
- TConfig
80
- >,
81
- TAdditionalParams
33
+ {
34
+ /** @field The path to use when creating the account */
35
+ accountDerivationPath?: string
36
+
37
+ /** @field The name/address of the Archivist to use for this module */
38
+ readonly archivist?: ArchivistModuleConfig
39
+
40
+ /**
41
+ * @field The labels used for this module. If a label is specified, then the
42
+ * ModuleFactoryLocator will attempt to find a ModuleFactory with the corresponding
43
+ * labels to construct this module.
44
+ */
45
+ readonly labels?: Labels
46
+
47
+ /** @field Friendly name of module (not collision resistent). Can be used to resolve module when registered/attached to Node. */
48
+ readonly name?: string
49
+
50
+ /** @field paging settings for queries */
51
+ readonly paging?: Record<string, { size?: number }>
52
+
53
+ /** @field The query schemas and allowed/disallowed addresses which are allowed to issue them against the module. If both allowed and disallowed is specified, then disallowed takes priority. */
54
+ readonly security?: {
55
+ /** @field Will the module process queries that have unsigned BoundWitness in query tuples */
56
+ readonly allowAnonymous?: boolean
57
+
58
+ /** @field If schema in record, then only these address sets can access query */
59
+ readonly allowed?: Record<SchemaString, (Address | CosigningAddressSet)[]>
60
+
61
+ /** @field If schema in record, then anyone except these addresses can access query */
62
+ readonly disallowed?: Record<SchemaString, Address[]>
63
+ }
64
+
65
+ /** @field sign every query */
66
+ readonly sign?: boolean
67
+
68
+ /** @field Store the queries made to the module in an archivist if possible */
69
+ readonly storeQueries?: boolean
70
+
71
+ /** @field add a timestamp payload to every query */
72
+ readonly timestamp?: boolean
73
+ } & ArchivingModuleConfig,
74
+ TConfig
82
75
  >,
83
76
  TSchema extends Schema ? TSchema : TConfig extends Payload ? TConfig['schema'] : ModuleConfigSchema
84
77
  >
85
78
 
86
79
  export type AnyConfigSchema<TConfig extends Omit<ModuleConfig, 'schema'> & { schema: string } = Omit<ModuleConfig, 'schema'> & { schema: string }> =
87
- ModuleConfig<
88
- {
89
- schema: string
90
- },
91
- Omit<TConfig, 'schema'>
92
- >
80
+ ModuleConfig<TConfig, string>
93
81
 
94
82
  export type OptionalConfigSchema<TConfig extends AnyConfigSchema<ModuleConfig> = AnyConfigSchema<ModuleConfig>> = Omit<TConfig, 'schema'> & {
95
83
  schema?: TConfig['schema']