@sprucelabs/mercury-types 37.0.60 → 37.2.0

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.
@@ -6,19 +6,21 @@ const permissionReferenceSchema = {
6
6
  version: 'v2020_12_25',
7
7
  namespace: 'Mercury',
8
8
  name: '',
9
+ importsWhenRemote: ['import * as MercuryTypes from \'@sprucelabs/mercury-types\'',],
9
10
  moduleToImportFromWhenRemote: '@sprucelabs/mercury-types',
11
+ typeSuffix: '<ContractId extends MercuryTypes.PermissionContractId = MercuryTypes.PermissionContractId>',
10
12
  fields: {
11
13
  /** . */
12
14
  'contractId': {
13
- type: 'id',
15
+ type: 'raw',
14
16
  isRequired: true,
15
- options: undefined
17
+ options: { valueType: `ContractId`, }
16
18
  },
17
19
  /** . */
18
20
  'permissionIdsAny': {
19
- type: 'id',
21
+ type: 'raw',
20
22
  isArray: true,
21
- options: undefined
23
+ options: { valueType: `MercuryTypes.PermissionId<ContractId>`, }
22
24
  },
23
25
  }
24
26
  };
@@ -1,6 +1,7 @@
1
1
  export { SpruceSchemas } from '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schemas.types';
2
2
  import { default as SchemaEntity } from '@sprucelabs/schema';
3
3
  import * as SpruceSchema from '@sprucelabs/schema';
4
+ import * as MercuryTypes from '../../';
4
5
  declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schemas.types' {
5
6
  namespace SpruceSchemas.Mercury.v2020_12_25 {
6
7
  interface EventSignaturesByName {
@@ -340,28 +341,34 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
340
341
  }
341
342
  }
342
343
  namespace SpruceSchemas.Mercury.v2020_12_25 {
343
- interface PermissionReference {
344
- 'contractId': string;
345
- 'permissionIdsAny'?: string[] | undefined | null;
344
+ interface PermissionReference<ContractId extends MercuryTypes.PermissionContractId = MercuryTypes.PermissionContractId> {
345
+ 'contractId': (ContractId);
346
+ 'permissionIdsAny'?: (MercuryTypes.PermissionId<ContractId>)[] | undefined | null;
346
347
  }
347
348
  interface PermissionReferenceSchema extends SpruceSchema.Schema {
348
349
  id: 'permissionReference';
349
350
  version: 'v2020_12_25';
350
351
  namespace: 'Mercury';
351
352
  name: '';
353
+ importsWhenRemote: ['import * as MercuryTypes from \'@sprucelabs/mercury-types\''];
352
354
  moduleToImportFromWhenRemote: '@sprucelabs/mercury-types';
355
+ typeSuffix: '<ContractId extends MercuryTypes.PermissionContractId = MercuryTypes.PermissionContractId>';
353
356
  fields: {
354
357
  /** . */
355
358
  'contractId': {
356
- type: 'id';
359
+ type: 'raw';
357
360
  isRequired: true;
358
- options: undefined;
361
+ options: {
362
+ valueType: `ContractId`;
363
+ };
359
364
  };
360
365
  /** . */
361
366
  'permissionIdsAny': {
362
- type: 'id';
367
+ type: 'raw';
363
368
  isArray: true;
364
- options: undefined;
369
+ options: {
370
+ valueType: `MercuryTypes.PermissionId<ContractId>`;
371
+ };
365
372
  };
366
373
  };
367
374
  }
@@ -4,19 +4,21 @@ const permissionReferenceSchema = {
4
4
  version: 'v2020_12_25',
5
5
  namespace: 'Mercury',
6
6
  name: '',
7
+ importsWhenRemote: ['import * as MercuryTypes from \'@sprucelabs/mercury-types\'',],
7
8
  moduleToImportFromWhenRemote: '@sprucelabs/mercury-types',
9
+ typeSuffix: '<ContractId extends MercuryTypes.PermissionContractId = MercuryTypes.PermissionContractId>',
8
10
  fields: {
9
11
  /** . */
10
12
  'contractId': {
11
- type: 'id',
13
+ type: 'raw',
12
14
  isRequired: true,
13
- options: undefined
15
+ options: { valueType: `ContractId`, }
14
16
  },
15
17
  /** . */
16
18
  'permissionIdsAny': {
17
- type: 'id',
19
+ type: 'raw',
18
20
  isArray: true,
19
- options: undefined
21
+ options: { valueType: `MercuryTypes.PermissionId<ContractId>`, }
20
22
  },
21
23
  }
22
24
  };
@@ -1,6 +1,7 @@
1
1
  export { SpruceSchemas } from '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schemas.types';
2
2
  import { default as SchemaEntity } from '@sprucelabs/schema';
3
3
  import * as SpruceSchema from '@sprucelabs/schema';
4
+ import * as MercuryTypes from '../../';
4
5
  declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schemas.types' {
5
6
  namespace SpruceSchemas.Mercury.v2020_12_25 {
6
7
  interface EventSignaturesByName {
@@ -340,28 +341,34 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
340
341
  }
341
342
  }
342
343
  namespace SpruceSchemas.Mercury.v2020_12_25 {
343
- interface PermissionReference {
344
- 'contractId': string;
345
- 'permissionIdsAny'?: string[] | undefined | null;
344
+ interface PermissionReference<ContractId extends MercuryTypes.PermissionContractId = MercuryTypes.PermissionContractId> {
345
+ 'contractId': (ContractId);
346
+ 'permissionIdsAny'?: (MercuryTypes.PermissionId<ContractId>)[] | undefined | null;
346
347
  }
347
348
  interface PermissionReferenceSchema extends SpruceSchema.Schema {
348
349
  id: 'permissionReference';
349
350
  version: 'v2020_12_25';
350
351
  namespace: 'Mercury';
351
352
  name: '';
353
+ importsWhenRemote: ['import * as MercuryTypes from \'@sprucelabs/mercury-types\''];
352
354
  moduleToImportFromWhenRemote: '@sprucelabs/mercury-types';
355
+ typeSuffix: '<ContractId extends MercuryTypes.PermissionContractId = MercuryTypes.PermissionContractId>';
353
356
  fields: {
354
357
  /** . */
355
358
  'contractId': {
356
- type: 'id';
359
+ type: 'raw';
357
360
  isRequired: true;
358
- options: undefined;
361
+ options: {
362
+ valueType: `ContractId`;
363
+ };
359
364
  };
360
365
  /** . */
361
366
  'permissionIdsAny': {
362
- type: 'id';
367
+ type: 'raw';
363
368
  isArray: true;
364
- options: undefined;
369
+ options: {
370
+ valueType: `MercuryTypes.PermissionId<ContractId>`;
371
+ };
365
372
  };
366
373
  };
367
374
  }
@@ -69,14 +69,23 @@ declare const _default: {
69
69
  options: {
70
70
  schema: {
71
71
  id: string;
72
+ importsWhenLocal: string[];
73
+ typeSuffix: string;
74
+ importsWhenRemote: string[];
72
75
  fields: {
73
76
  contractId: {
74
- type: "id";
77
+ type: "raw";
75
78
  isRequired: true;
79
+ options: {
80
+ valueType: string;
81
+ };
76
82
  };
77
83
  permissionIdsAny: {
78
- type: "id";
84
+ type: "raw";
79
85
  isArray: true;
86
+ options: {
87
+ valueType: string;
88
+ };
80
89
  };
81
90
  };
82
91
  };
@@ -87,14 +96,23 @@ declare const _default: {
87
96
  options: {
88
97
  schema: {
89
98
  id: string;
99
+ importsWhenLocal: string[];
100
+ typeSuffix: string;
101
+ importsWhenRemote: string[];
90
102
  fields: {
91
103
  contractId: {
92
- type: "id";
104
+ type: "raw";
93
105
  isRequired: true;
106
+ options: {
107
+ valueType: string;
108
+ };
94
109
  };
95
110
  permissionIdsAny: {
96
- type: "id";
111
+ type: "raw";
97
112
  isArray: true;
113
+ options: {
114
+ valueType: string;
115
+ };
98
116
  };
99
117
  };
100
118
  };
@@ -2,14 +2,25 @@ import { buildSchema } from '@sprucelabs/schema';
2
2
  import permissionContractBuilder from './permissionContract.builder.js';
3
3
  const permissionReferenceSchema = buildSchema({
4
4
  id: 'permissionReference',
5
+ importsWhenLocal: [`import * as MercuryTypes from '../../index.js'`],
6
+ typeSuffix: '<ContractId extends MercuryTypes.PermissionContractId = MercuryTypes.PermissionContractId>',
7
+ importsWhenRemote: [
8
+ `import * as MercuryTypes from '@sprucelabs/mercury-types'`,
9
+ ],
5
10
  fields: {
6
11
  contractId: {
7
- type: 'id',
12
+ type: 'raw',
8
13
  isRequired: true,
14
+ options: {
15
+ valueType: 'ContractId',
16
+ },
9
17
  },
10
18
  permissionIdsAny: {
11
- type: 'id',
19
+ type: 'raw',
12
20
  isArray: true,
21
+ options: {
22
+ valueType: 'MercuryTypes.PermissionId<ContractId>',
23
+ },
13
24
  },
14
25
  },
15
26
  });
@@ -37,10 +37,16 @@ export default interface MercuryEventEmitter<Contract extends EventContract> {
37
37
  emitAndFlattenResponses<EventName extends KeyOf<Contract['eventSignatures']> = KeyOf<Contract['eventSignatures']>, IEventSignature extends EventSignature = Contract['eventSignatures'][EventName], ResponseSchema extends Schema = IEventSignature['responsePayloadSchema'] extends Schema ? IEventSignature['responsePayloadSchema'] : never>(eventName: EventName, cb?: EmitCallback<Contract, EventName>): Promise<SchemaValues<ResponseSchema>[]>;
38
38
  off(eventName: EventNames<Contract>, cb?: any): Promise<number>;
39
39
  }
40
- export interface SkillEventSignatures {
40
+ export interface SkillEventSignatures extends EventSignaturesByName {
41
41
  }
42
- /** @ts-ignore */
43
42
  export interface SkillEventContract extends EventContract {
44
43
  eventSignatures: SkillEventSignatures;
45
44
  }
45
+ interface PCM {
46
+ [contractId: string]: string[];
47
+ }
48
+ export interface PermissionContractMap extends PCM {
49
+ }
50
+ export type PermissionContractId = keyof PermissionContractMap;
51
+ export type PermissionId<ContractId extends PermissionContractId> = PermissionContractMap[ContractId];
46
52
  export {};
@@ -69,14 +69,23 @@ declare const _default: {
69
69
  options: {
70
70
  schema: {
71
71
  id: string;
72
+ importsWhenLocal: string[];
73
+ typeSuffix: string;
74
+ importsWhenRemote: string[];
72
75
  fields: {
73
76
  contractId: {
74
- type: "id";
77
+ type: "raw";
75
78
  isRequired: true;
79
+ options: {
80
+ valueType: string;
81
+ };
76
82
  };
77
83
  permissionIdsAny: {
78
- type: "id";
84
+ type: "raw";
79
85
  isArray: true;
86
+ options: {
87
+ valueType: string;
88
+ };
80
89
  };
81
90
  };
82
91
  };
@@ -87,14 +96,23 @@ declare const _default: {
87
96
  options: {
88
97
  schema: {
89
98
  id: string;
99
+ importsWhenLocal: string[];
100
+ typeSuffix: string;
101
+ importsWhenRemote: string[];
90
102
  fields: {
91
103
  contractId: {
92
- type: "id";
104
+ type: "raw";
93
105
  isRequired: true;
106
+ options: {
107
+ valueType: string;
108
+ };
94
109
  };
95
110
  permissionIdsAny: {
96
- type: "id";
111
+ type: "raw";
97
112
  isArray: true;
113
+ options: {
114
+ valueType: string;
115
+ };
98
116
  };
99
117
  };
100
118
  };
@@ -7,14 +7,25 @@ const schema_1 = require("@sprucelabs/schema");
7
7
  const permissionContract_builder_1 = __importDefault(require("./permissionContract.builder"));
8
8
  const permissionReferenceSchema = (0, schema_1.buildSchema)({
9
9
  id: 'permissionReference',
10
+ importsWhenLocal: [`import * as MercuryTypes from '../../'`],
11
+ typeSuffix: '<ContractId extends MercuryTypes.PermissionContractId = MercuryTypes.PermissionContractId>',
12
+ importsWhenRemote: [
13
+ `import * as MercuryTypes from '@sprucelabs/mercury-types'`,
14
+ ],
10
15
  fields: {
11
16
  contractId: {
12
- type: 'id',
17
+ type: 'raw',
13
18
  isRequired: true,
19
+ options: {
20
+ valueType: 'ContractId',
21
+ },
14
22
  },
15
23
  permissionIdsAny: {
16
- type: 'id',
24
+ type: 'raw',
17
25
  isArray: true,
26
+ options: {
27
+ valueType: 'MercuryTypes.PermissionId<ContractId>',
28
+ },
18
29
  },
19
30
  },
20
31
  });
@@ -37,10 +37,16 @@ export default interface MercuryEventEmitter<Contract extends EventContract> {
37
37
  emitAndFlattenResponses<EventName extends KeyOf<Contract['eventSignatures']> = KeyOf<Contract['eventSignatures']>, IEventSignature extends EventSignature = Contract['eventSignatures'][EventName], ResponseSchema extends Schema = IEventSignature['responsePayloadSchema'] extends Schema ? IEventSignature['responsePayloadSchema'] : never>(eventName: EventName, cb?: EmitCallback<Contract, EventName>): Promise<SchemaValues<ResponseSchema>[]>;
38
38
  off(eventName: EventNames<Contract>, cb?: any): Promise<number>;
39
39
  }
40
- export interface SkillEventSignatures {
40
+ export interface SkillEventSignatures extends EventSignaturesByName {
41
41
  }
42
- /** @ts-ignore */
43
42
  export interface SkillEventContract extends EventContract {
44
43
  eventSignatures: SkillEventSignatures;
45
44
  }
45
+ interface PCM {
46
+ [contractId: string]: string[];
47
+ }
48
+ export interface PermissionContractMap extends PCM {
49
+ }
50
+ export type PermissionContractId = keyof PermissionContractMap;
51
+ export type PermissionId<ContractId extends PermissionContractId> = PermissionContractMap[ContractId];
46
52
  export {};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "37.0.60",
6
+ "version": "37.2.0",
7
7
  "files": [
8
8
  "build"
9
9
  ],