@semapps/ontologies 1.2.0 → 1.2.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.
@@ -1,5 +1,5 @@
1
1
  import fetch from 'node-fetch';
2
- import { ActionSchema } from 'moleculer';
2
+ import type { ActionSchema } from 'moleculer';
3
3
 
4
4
  const Schema = {
5
5
  visibility: 'public',
@@ -1,5 +1,5 @@
1
1
  import fetch from 'node-fetch';
2
- import { ActionSchema } from 'moleculer';
2
+ import type { ActionSchema } from 'moleculer';
3
3
  import { isURL } from '../utils.ts';
4
4
 
5
5
  const Schema = {
package/actions/get.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ActionSchema } from 'moleculer';
1
+ import type { ActionSchema } from 'moleculer';
2
2
 
3
3
  const Schema = {
4
4
  visibility: 'public',
@@ -1,4 +1,4 @@
1
- import { ActionSchema } from 'moleculer';
1
+ import type { ActionSchema } from 'moleculer';
2
2
 
3
3
  const Schema = {
4
4
  visibility: 'public',
@@ -1,4 +1,4 @@
1
- import { ActionSchema } from 'moleculer';
1
+ import type { ActionSchema } from 'moleculer';
2
2
 
3
3
  const Schema = {
4
4
  visibility: 'public',
package/actions/list.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ActionSchema } from 'moleculer';
1
+ import type { ActionSchema } from 'moleculer';
2
2
 
3
3
  const Schema = {
4
4
  visibility: 'public',
@@ -1,4 +1,4 @@
1
- import { ActionSchema } from 'moleculer';
1
+ import type { ActionSchema } from 'moleculer';
2
2
  import { isURL } from '../utils.ts';
3
3
 
4
4
  const regexPrefix = /^([^:]+):([^:]+)$/gm;
@@ -1,4 +1,4 @@
1
- import { ActionSchema } from 'moleculer';
1
+ import type { ActionSchema } from 'moleculer';
2
2
  import { isURL, arrayOf } from '../utils.ts';
3
3
 
4
4
  const Schema = {
@@ -3,8 +3,6 @@ declare const Schema: {
3
3
  params: {
4
4
  prefix: string;
5
5
  };
6
- handler(ctx: Moleculer.Context<Optionalize<{
7
- [x: string]: any;
8
- }>, {}, Moleculer.GenericObject>): Promise<any>;
6
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<any>;
9
7
  };
10
8
  export default Schema;
@@ -3,8 +3,6 @@ declare const Schema: {
3
3
  params: {
4
4
  uri: string;
5
5
  };
6
- handler(ctx: Moleculer.Context<Optionalize<{
7
- [x: string]: any;
8
- }>, {}, Moleculer.GenericObject>): Promise<string | null | undefined>;
6
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<string | null | undefined>;
9
7
  };
10
8
  export default Schema;
@@ -2,21 +2,19 @@ declare const Schema: {
2
2
  visibility: "public";
3
3
  params: {
4
4
  prefix: {
5
- type: "string";
6
- optional: true;
5
+ type: string;
6
+ optional: boolean;
7
7
  };
8
8
  namespace: {
9
- type: "string";
10
- optional: true;
9
+ type: string;
10
+ optional: boolean;
11
11
  };
12
12
  uri: {
13
- type: "string";
14
- optional: true;
13
+ type: string;
14
+ optional: boolean;
15
15
  };
16
16
  };
17
17
  cache: true;
18
- handler(ctx: Moleculer.Context<Optionalize<{
19
- [x: string]: any;
20
- }>, {}, Moleculer.GenericObject>): Promise<any>;
18
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<any>;
21
19
  };
22
20
  export default Schema;
@@ -1,9 +1,7 @@
1
1
  declare const Schema: {
2
2
  visibility: "public";
3
3
  cache: true;
4
- handler(ctx: Moleculer.Context<Optionalize<{
5
- [x: string]: any;
6
- }>, {}, Moleculer.GenericObject>): Promise<{
4
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<{
7
5
  [k: string]: any;
8
6
  }>;
9
7
  };
@@ -1,8 +1,6 @@
1
1
  declare const Schema: {
2
2
  visibility: "public";
3
3
  cache: true;
4
- handler(ctx: Moleculer.Context<Optionalize<{
5
- [x: string]: any;
6
- }>, {}, Moleculer.GenericObject>): Promise<any>;
4
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<any>;
7
5
  };
8
6
  export default Schema;
@@ -1,6 +1,6 @@
1
1
  declare const Schema: {
2
2
  visibility: "public";
3
3
  cache: true;
4
- handler(): any[];
4
+ handler(): unknown[];
5
5
  };
6
6
  export default Schema;
@@ -4,8 +4,6 @@ declare const Schema: {
4
4
  value: string;
5
5
  };
6
6
  cache: true;
7
- handler(ctx: Moleculer.Context<Optionalize<{
8
- [x: string]: any;
9
- }>, {}, Moleculer.GenericObject>): Promise<any>;
7
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<any>;
10
8
  };
11
9
  export default Schema;
@@ -4,31 +4,25 @@ declare const Schema: {
4
4
  prefix: string;
5
5
  namespace: string;
6
6
  owl: {
7
- type: "string";
8
- optional: true;
7
+ type: string;
8
+ optional: boolean;
9
9
  };
10
10
  jsonldContext: {
11
- type: "multi";
12
- rules: ({
13
- type: "array";
14
- } | {
15
- type: "object";
16
- } | {
17
- type: "string";
18
- })[];
19
- optional: true;
11
+ type: string;
12
+ rules: {
13
+ type: string;
14
+ }[];
15
+ optional: boolean;
20
16
  };
21
17
  preserveContextUri: {
22
- type: "boolean";
18
+ type: string;
23
19
  default: boolean;
24
20
  };
25
21
  persist: {
26
- type: "boolean";
22
+ type: string;
27
23
  default: boolean;
28
24
  };
29
25
  };
30
- handler(ctx: Moleculer.Context<Optionalize<{
31
- [x: string]: any;
32
- }>, {}, Moleculer.GenericObject>): Promise<void>;
26
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<void>;
33
27
  };
34
28
  export default Schema;
@@ -74,6 +74,9 @@
74
74
  },
75
75
  "apods:availableApps": {
76
76
  "@type": "@id"
77
+ },
78
+ "apods:recommendedBy": {
79
+ "@type": "@id"
77
80
  }
78
81
  }
79
82
  }
package/dist/service.d.ts CHANGED
@@ -5,68 +5,58 @@ declare const OntologiesSchema: {
5
5
  persistRegistry: boolean;
6
6
  settingsDataset: string;
7
7
  };
8
- created(this: Moleculer.Service<Moleculer.ServiceSettingSchema>): Promise<void>;
9
- started(this: Moleculer.Service<Moleculer.ServiceSettingSchema>): Promise<void>;
8
+ created(this: import("moleculer").Service<import("moleculer").ServiceSettingSchema>): Promise<void>;
9
+ started(this: import("moleculer").Service<import("moleculer").ServiceSettingSchema>): Promise<void>;
10
10
  actions: {
11
11
  findPrefix: {
12
12
  visibility: "public";
13
13
  params: {
14
14
  uri: string;
15
15
  };
16
- handler(ctx: Moleculer.Context<Optionalize<{
17
- [x: string]: any;
18
- }>, {}, Moleculer.GenericObject>): Promise<string | null | undefined>;
16
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<string | null | undefined>;
19
17
  };
20
18
  findNamespace: {
21
19
  visibility: "public";
22
20
  params: {
23
21
  prefix: string;
24
22
  };
25
- handler(ctx: Moleculer.Context<Optionalize<{
26
- [x: string]: any;
27
- }>, {}, Moleculer.GenericObject>): Promise<any>;
23
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<any>;
28
24
  };
29
25
  get: {
30
26
  visibility: "public";
31
27
  params: {
32
28
  prefix: {
33
- type: "string";
34
- optional: true;
29
+ type: string;
30
+ optional: boolean;
35
31
  };
36
32
  namespace: {
37
- type: "string";
38
- optional: true;
33
+ type: string;
34
+ optional: boolean;
39
35
  };
40
36
  uri: {
41
- type: "string";
42
- optional: true;
37
+ type: string;
38
+ optional: boolean;
43
39
  };
44
40
  };
45
41
  cache: true;
46
- handler(ctx: Moleculer.Context<Optionalize<{
47
- [x: string]: any;
48
- }>, {}, Moleculer.GenericObject>): Promise<any>;
42
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<any>;
49
43
  };
50
44
  getPrefixes: {
51
45
  visibility: "public";
52
46
  cache: true;
53
- handler(ctx: Moleculer.Context<Optionalize<{
54
- [x: string]: any;
55
- }>, {}, Moleculer.GenericObject>): Promise<{
47
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<{
56
48
  [k: string]: any;
57
49
  }>;
58
50
  };
59
51
  getRdfPrefixes: {
60
52
  visibility: "public";
61
53
  cache: true;
62
- handler(ctx: Moleculer.Context<Optionalize<{
63
- [x: string]: any;
64
- }>, {}, Moleculer.GenericObject>): Promise<any>;
54
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<any>;
65
55
  };
66
56
  list: {
67
57
  visibility: "public";
68
58
  cache: true;
69
- handler(): any[];
59
+ handler(): unknown[];
70
60
  };
71
61
  prefixToUri: {
72
62
  visibility: "public";
@@ -74,9 +64,7 @@ declare const OntologiesSchema: {
74
64
  value: string;
75
65
  };
76
66
  cache: true;
77
- handler(ctx: Moleculer.Context<Optionalize<{
78
- [x: string]: any;
79
- }>, {}, Moleculer.GenericObject>): Promise<any>;
67
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<any>;
80
68
  };
81
69
  register: {
82
70
  visibility: "public";
@@ -84,32 +72,26 @@ declare const OntologiesSchema: {
84
72
  prefix: string;
85
73
  namespace: string;
86
74
  owl: {
87
- type: "string";
88
- optional: true;
75
+ type: string;
76
+ optional: boolean;
89
77
  };
90
78
  jsonldContext: {
91
- type: "multi";
92
- rules: ({
93
- type: "array";
94
- } | {
95
- type: "object";
96
- } | {
97
- type: "string";
98
- })[];
99
- optional: true;
79
+ type: string;
80
+ rules: {
81
+ type: string;
82
+ }[];
83
+ optional: boolean;
100
84
  };
101
85
  preserveContextUri: {
102
- type: "boolean";
86
+ type: string;
103
87
  default: boolean;
104
88
  };
105
89
  persist: {
106
- type: "boolean";
90
+ type: string;
107
91
  default: boolean;
108
92
  };
109
93
  };
110
- handler(ctx: Moleculer.Context<Optionalize<{
111
- [x: string]: any;
112
- }>, {}, Moleculer.GenericObject>): Promise<void>;
94
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<void>;
113
95
  };
114
96
  };
115
97
  methods: {
@@ -9,24 +9,16 @@ declare const OntologiesRegistrySchema: {
9
9
  };
10
10
  actions: {
11
11
  getByPrefix: {
12
- handler(ctx: Moleculer.Context<Optionalize<{
13
- [x: string]: any;
14
- }>, {}, Moleculer.GenericObject>): Promise<any>;
12
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<any>;
15
13
  };
16
14
  getByNamespace: {
17
- handler(ctx: Moleculer.Context<Optionalize<{
18
- [x: string]: any;
19
- }>, {}, Moleculer.GenericObject>): Promise<any>;
15
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<any>;
20
16
  };
21
17
  list: {
22
- handler(ctx: Moleculer.Context<Optionalize<{
23
- [x: string]: any;
24
- }>, {}, Moleculer.GenericObject>): Promise<any>;
18
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<any>;
25
19
  };
26
20
  updateOrCreate: {
27
- handler(ctx: Moleculer.Context<Optionalize<{
28
- [x: string]: any;
29
- }>, {}, Moleculer.GenericObject>): Promise<void>;
21
+ handler(ctx: import("moleculer").Context<any, any, import("moleculer").GenericObject>): Promise<void>;
30
22
  };
31
23
  };
32
24
  };
@@ -74,6 +74,9 @@
74
74
  },
75
75
  "apods:availableApps": {
76
76
  "@type": "@id"
77
+ },
78
+ "apods:recommendedBy": {
79
+ "@type": "@id"
77
80
  }
78
81
  }
79
82
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@semapps/ontologies",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "SemApps ontologies",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Virtual Assembly",
7
7
  "dependencies": {
8
- "@semapps/triplestore": "1.2.0",
8
+ "@semapps/triplestore": "1.2.1",
9
9
  "moleculer-db": "^0.8.16",
10
10
  "node-fetch": "^2.6.6"
11
11
  },
@@ -21,6 +21,10 @@
21
21
  "peerDependencies": {
22
22
  "moleculer": "^0.14.35"
23
23
  },
24
- "gitHead": "b2d4edd4ace7346c2452cc8831cb30888afda3a9",
24
+ "scripts": {
25
+ "prepack": "node ../../scripts/switch-main-to-publish.js .",
26
+ "postpack": "node ../../scripts/revert-main-from-publish.js ."
27
+ },
28
+ "gitHead": "4bbaa429345b47a365411baed1d163581ae03d9e",
25
29
  "xDevMain": "./index.ts"
26
30
  }
package/service.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { TripleStoreAdapter } from '@semapps/triplestore';
2
- import { ServiceSchema } from 'moleculer';
2
+ import type { ServiceSchema } from 'moleculer';
3
3
  import OntologiesRegistryService from './sub-services/registry.ts';
4
4
  import findPrefixAction from './actions/findPrefix.ts';
5
5
  import findNamespaceAction from './actions/findNamespace.ts';
@@ -1,6 +1,6 @@
1
1
  import DbService from 'moleculer-db';
2
2
  import { TripleStoreAdapter } from '@semapps/triplestore';
3
- import { ServiceSchema } from 'moleculer';
3
+ import type { ServiceSchema } from 'moleculer';
4
4
 
5
5
  const OntologiesRegistrySchema = {
6
6
  name: 'ontologies.registry' as const,