@takeshape/schema 8.111.3 → 8.112.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.
@@ -0,0 +1,3 @@
1
+ import { ProjectSchema } from '../project-schema';
2
+ export declare function serviceHasIndexedShapes(schema: ProjectSchema, serviceId: string): boolean;
3
+ //# sourceMappingURL=api-indexing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-indexing.d.ts","sourceRoot":"","sources":["../../../src/util/api-indexing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAGhD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAUzF"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.serviceHasIndexedShapes = serviceHasIndexedShapes;
7
+
8
+ var _types = require("../types");
9
+
10
+ function serviceHasIndexedShapes(schema, serviceId) {
11
+ for (const config of Object.values(schema.indexedShapes ?? {})) {
12
+ var _config$queries$list;
13
+
14
+ const queryName = (_config$queries$list = config.queries.list) === null || _config$queries$list === void 0 ? void 0 : _config$queries$list.name;
15
+ const query = queryName && schema.queries[queryName];
16
+
17
+ if (query && (0, _types.isBasicResolver)(query.resolver) && query.resolver.service === serviceId) {
18
+ return true;
19
+ }
20
+ }
21
+
22
+ return false;
23
+ }
@@ -1,3 +1,4 @@
1
+ export * from './api-indexing';
1
2
  export * from './detect-cycles';
2
3
  export * from './merge';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
@@ -4,6 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
+ var _apiIndexing = require("./api-indexing");
8
+
9
+ Object.keys(_apiIndexing).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _apiIndexing[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _apiIndexing[key];
16
+ }
17
+ });
18
+ });
19
+
7
20
  var _detectCycles = require("./detect-cycles");
8
21
 
9
22
  Object.keys(_detectCycles).forEach(function (key) {
@@ -0,0 +1,15 @@
1
+ import { isBasicResolver } from '../types';
2
+ export function serviceHasIndexedShapes(schema, serviceId) {
3
+ for (const config of Object.values(schema.indexedShapes ?? {})) {
4
+ var _config$queries$list;
5
+
6
+ const queryName = (_config$queries$list = config.queries.list) === null || _config$queries$list === void 0 ? void 0 : _config$queries$list.name;
7
+ const query = queryName && schema.queries[queryName];
8
+
9
+ if (query && isBasicResolver(query.resolver) && query.resolver.service === serviceId) {
10
+ return true;
11
+ }
12
+ }
13
+
14
+ return false;
15
+ }
package/es/util/index.js CHANGED
@@ -1,2 +1,3 @@
1
+ export * from './api-indexing';
1
2
  export * from './detect-cycles';
2
3
  export * from './merge';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeshape/schema",
3
- "version": "8.111.3",
3
+ "version": "8.112.0",
4
4
  "description": "TakeShape Schema",
5
5
  "homepage": "https://www.takeshape.io",
6
6
  "repository": {
@@ -21,9 +21,9 @@
21
21
  "examples"
22
22
  ],
23
23
  "dependencies": {
24
- "@takeshape/errors": "8.111.3",
25
- "@takeshape/json-schema": "8.111.3",
26
- "@takeshape/util": "8.111.3",
24
+ "@takeshape/errors": "8.112.0",
25
+ "@takeshape/json-schema": "8.112.0",
26
+ "@takeshape/util": "8.112.0",
27
27
  "ajv": "^8.10.0",
28
28
  "ajv-formats": "^2.1.1",
29
29
  "blueimp-md5": "^2.10.0",