@xyo-network/module-model 2.43.7 → 2.43.9

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.
@@ -3,10 +3,11 @@ import { XyoPayload } from '@xyo-network/payload-model';
3
3
  export type AbstractModuleConfigSchema = 'network.xyo.module.config';
4
4
  export declare const AbstractModuleConfigSchema: AbstractModuleConfigSchema;
5
5
  export type AddressString = string;
6
+ export type CosigningAddressSet = string[];
6
7
  export type SchemaString = string;
7
8
  export type AbstractModuleConfigBase<T extends EmptyObject = EmptyObject> = XyoPayload<{
8
9
  security?: {
9
- allowed?: Record<SchemaString, AddressString[][]>;
10
+ allowed?: Record<SchemaString, (AddressString | CosigningAddressSet)[]>;
10
11
  disallowed?: Record<SchemaString, AddressString[]>;
11
12
  };
12
13
  } & T>;
@@ -1 +1 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAEvD,MAAM,MAAM,0BAA0B,GAAG,2BAA2B,CAAA;AACpE,eAAO,MAAM,0BAA0B,EAAE,0BAAwD,CAAA;AAEjG,MAAM,MAAM,aAAa,GAAG,MAAM,CAAA;AAClC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAA;AAEjC,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI,UAAU,CACpF;IAEE,QAAQ,CAAC,EAAE;QAET,OAAO,CAAC,EAAE,MAAM,CAAC,YAAY,EAAE,aAAa,EAAE,EAAE,CAAC,CAAA;QAEjD,UAAU,CAAC,EAAE,MAAM,CAAC,YAAY,EAAE,aAAa,EAAE,CAAC,CAAA;KACnD,CAAA;CACF,GAAG,CAAC,CACN,CAAA;AAED,MAAM,MAAM,oBAAoB,CAAC,OAAO,SAAS,UAAU,GAAG,UAAU,IAAI,wBAAwB,CAAC,OAAO,CAAC,CAAA"}
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAEvD,MAAM,MAAM,0BAA0B,GAAG,2BAA2B,CAAA;AACpE,eAAO,MAAM,0BAA0B,EAAE,0BAAwD,CAAA;AAEjG,MAAM,MAAM,aAAa,GAAG,MAAM,CAAA;AAClC,MAAM,MAAM,mBAAmB,GAAG,MAAM,EAAE,CAAA;AAC1C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAA;AAEjC,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI,UAAU,CACpF;IAEE,QAAQ,CAAC,EAAE;QAET,OAAO,CAAC,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,aAAa,GAAG,mBAAmB,CAAC,EAAE,CAAC,CAAA;QAEvE,UAAU,CAAC,EAAE,MAAM,CAAC,YAAY,EAAE,aAAa,EAAE,CAAC,CAAA;KACnD,CAAA;CACF,GAAG,CAAC,CACN,CAAA;AAED,MAAM,MAAM,oBAAoB,CAAC,OAAO,SAAS,UAAU,GAAG,UAAU,IAAI,wBAAwB,CAAC,OAAO,CAAC,CAAA"}
@@ -1,14 +1,15 @@
1
1
  import { XyoPayload } from '@xyo-network/payload-model';
2
2
  import { Promisable } from '@xyo-network/promise';
3
+ import { AbstractModuleConfig } from '../Config';
3
4
  import { ModuleDescription } from '../ModuleDescription';
4
5
  import { ModuleQueryResult } from '../ModuleQueryResult';
5
6
  import { XyoQueryBoundWitness } from '../Query';
6
- export interface Module<TConfig extends XyoPayload = XyoPayload> {
7
+ export interface Module<TConfig extends AbstractModuleConfig = AbstractModuleConfig> {
7
8
  address: string;
8
9
  config: TConfig;
9
10
  description: () => Promisable<ModuleDescription>;
10
11
  queries: () => string[];
11
- query: <T extends XyoQueryBoundWitness = XyoQueryBoundWitness>(query: T, payloads?: XyoPayload[]) => Promisable<ModuleQueryResult>;
12
- queryable: <T extends XyoQueryBoundWitness = XyoQueryBoundWitness>(query: T, payloads?: XyoPayload[]) => Promisable<boolean>;
12
+ query: <T extends XyoQueryBoundWitness = XyoQueryBoundWitness, TConf extends AbstractModuleConfig = AbstractModuleConfig>(query: T, payloads?: XyoPayload[], queryConfig?: TConf) => Promisable<ModuleQueryResult>;
13
+ queryable: <T extends XyoQueryBoundWitness = XyoQueryBoundWitness, TConf extends AbstractModuleConfig = AbstractModuleConfig>(query: T, payloads?: XyoPayload[], queryConfig?: TConf) => boolean;
13
14
  }
14
15
  //# sourceMappingURL=Module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Module.d.ts","sourceRoot":"","sources":["../../../src/model/Module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE/C,MAAM,WAAW,MAAM,CAAC,OAAO,SAAS,UAAU,GAAG,UAAU;IAC7D,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,WAAW,EAAE,MAAM,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAChD,OAAO,EAAE,MAAM,MAAM,EAAE,CAAA;IACvB,KAAK,EAAE,CAAC,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAClI,SAAS,EAAE,CAAC,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,UAAU,CAAC,OAAO,CAAC,CAAA;CAC7H"}
1
+ {"version":3,"file":"Module.d.ts","sourceRoot":"","sources":["../../../src/model/Module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE/C,MAAM,WAAW,MAAM,CAAC,OAAO,SAAS,oBAAoB,GAAG,oBAAoB;IACjF,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,WAAW,EAAE,MAAM,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAChD,OAAO,EAAE,MAAM,MAAM,EAAE,CAAA;IACvB,KAAK,EAAE,CAAC,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,EAAE,KAAK,SAAS,oBAAoB,GAAG,oBAAoB,EACtH,KAAK,EAAE,CAAC,EACR,QAAQ,CAAC,EAAE,UAAU,EAAE,EACvB,WAAW,CAAC,EAAE,KAAK,KAChB,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAClC,SAAS,EAAE,CAAC,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,EAAE,KAAK,SAAS,oBAAoB,GAAG,oBAAoB,EAC1H,KAAK,EAAE,CAAC,EACR,QAAQ,CAAC,EAAE,UAAU,EAAE,EACvB,WAAW,CAAC,EAAE,KAAK,KAChB,OAAO,CAAA;CACb"}
package/package.json CHANGED
@@ -10,13 +10,13 @@
10
10
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xyo-network/boundwitness-model": "^2.43.7",
14
- "@xyo-network/core": "^2.43.7",
15
- "@xyo-network/payload-model": "^2.43.7",
16
- "@xyo-network/promise": "^2.43.7"
13
+ "@xyo-network/boundwitness-model": "^2.43.9",
14
+ "@xyo-network/core": "^2.43.9",
15
+ "@xyo-network/payload-model": "^2.43.9",
16
+ "@xyo-network/promise": "^2.43.9"
17
17
  },
18
18
  "devDependencies": {
19
- "@xylabs/ts-scripts-yarn3": "^2.12.0"
19
+ "@xylabs/ts-scripts-yarn3": "^2.12.21"
20
20
  },
21
21
  "description": "Primary SDK for using XYO Protocol 2.0",
22
22
  "browser": "dist/esm/index.js",
@@ -51,5 +51,5 @@
51
51
  },
52
52
  "sideEffects": false,
53
53
  "types": "dist/esm/index.d.ts",
54
- "version": "2.43.7"
54
+ "version": "2.43.9"
55
55
  }
package/src/Config.ts CHANGED
@@ -5,6 +5,7 @@ export type AbstractModuleConfigSchema = 'network.xyo.module.config'
5
5
  export const AbstractModuleConfigSchema: AbstractModuleConfigSchema = 'network.xyo.module.config'
6
6
 
7
7
  export type AddressString = string
8
+ export type CosigningAddressSet = string[]
8
9
  export type SchemaString = string
9
10
 
10
11
  export type AbstractModuleConfigBase<T extends EmptyObject = EmptyObject> = XyoPayload<
@@ -12,7 +13,7 @@ export type AbstractModuleConfigBase<T extends EmptyObject = EmptyObject> = XyoP
12
13
  //if both allowed and disallowed is specified, then disallowed takes priority
13
14
  security?: {
14
15
  //if schema in record, then only these address sets can access query
15
- allowed?: Record<SchemaString, AddressString[][]>
16
+ allowed?: Record<SchemaString, (AddressString | CosigningAddressSet)[]>
16
17
  //if schema in record, then anyone except these addresses can access query
17
18
  disallowed?: Record<SchemaString, AddressString[]>
18
19
  }
@@ -1,15 +1,24 @@
1
1
  import { XyoPayload } from '@xyo-network/payload-model'
2
2
  import { Promisable } from '@xyo-network/promise'
3
3
 
4
+ import { AbstractModuleConfig } from '../Config'
4
5
  import { ModuleDescription } from '../ModuleDescription'
5
6
  import { ModuleQueryResult } from '../ModuleQueryResult'
6
7
  import { XyoQueryBoundWitness } from '../Query'
7
8
 
8
- export interface Module<TConfig extends XyoPayload = XyoPayload> {
9
+ export interface Module<TConfig extends AbstractModuleConfig = AbstractModuleConfig> {
9
10
  address: string
10
11
  config: TConfig
11
12
  description: () => Promisable<ModuleDescription>
12
13
  queries: () => string[]
13
- query: <T extends XyoQueryBoundWitness = XyoQueryBoundWitness>(query: T, payloads?: XyoPayload[]) => Promisable<ModuleQueryResult>
14
- queryable: <T extends XyoQueryBoundWitness = XyoQueryBoundWitness>(query: T, payloads?: XyoPayload[]) => Promisable<boolean>
14
+ query: <T extends XyoQueryBoundWitness = XyoQueryBoundWitness, TConf extends AbstractModuleConfig = AbstractModuleConfig>(
15
+ query: T,
16
+ payloads?: XyoPayload[],
17
+ queryConfig?: TConf,
18
+ ) => Promisable<ModuleQueryResult>
19
+ queryable: <T extends XyoQueryBoundWitness = XyoQueryBoundWitness, TConf extends AbstractModuleConfig = AbstractModuleConfig>(
20
+ query: T,
21
+ payloads?: XyoPayload[],
22
+ queryConfig?: TConf,
23
+ ) => boolean
15
24
  }