@takeshape/schema 12.14.2 → 12.16.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.
Files changed (71) hide show
  1. package/dist/builtin-schema.js +7 -0
  2. package/dist/migration/index.d.ts +3 -1
  3. package/dist/migration/index.js +3 -1
  4. package/dist/project-schema/index.d.ts +7 -1
  5. package/dist/project-schema/index.js +3 -1
  6. package/dist/project-schema/latest.d.ts +41 -2
  7. package/dist/project-schema/migrate.js +7 -1
  8. package/dist/project-schema/v3.66.0.d.ts +2797 -0
  9. package/dist/project-schema/v3.66.0.js +7 -0
  10. package/dist/project-schema/v3.67.0.d.ts +2805 -0
  11. package/dist/project-schema/v3.67.0.js +7 -0
  12. package/dist/resolvers/ai/hybrid-search.d.ts +77 -0
  13. package/dist/resolvers/ai/hybrid-search.js +64 -0
  14. package/dist/schemas/index.d.ts +2 -2
  15. package/dist/schemas/index.js +6 -2
  16. package/dist/schemas/project-schema/latest.json +59 -2
  17. package/dist/schemas/project-schema/v3.66.0.json +5161 -0
  18. package/dist/schemas/project-schema/v3.67.0.json +5169 -0
  19. package/dist/schemas/project-schema.json +6 -0
  20. package/examples/latest/all-fields-shapes-inline.json +1 -1
  21. package/examples/latest/all-fields-shapes.json +1 -1
  22. package/examples/latest/betzino.json +1 -1
  23. package/examples/latest/blog-schema.json +1 -1
  24. package/examples/latest/brewery-schema.json +1 -1
  25. package/examples/latest/chat-agent-schema.json +1 -1
  26. package/examples/latest/clear-cache-schema.json +1 -1
  27. package/examples/latest/complex-project-schema.json +1 -1
  28. package/examples/latest/complex-schema.json +1 -1
  29. package/examples/latest/edit-schema.json +1 -1
  30. package/examples/latest/frank-and-fred-schema.json +1 -1
  31. package/examples/latest/generate-agent-schema.json +1 -1
  32. package/examples/latest/klirr-schema.json +1 -1
  33. package/examples/latest/layers/rick-and-morty-layer.json +1 -1
  34. package/examples/latest/layers/shopify-layer-2023-01.json +1 -1
  35. package/examples/latest/layers/shopify-storefront-2023-04.json +1 -1
  36. package/examples/latest/layers/wordpress-2024-01.json +1 -1
  37. package/examples/latest/massive-schema.json +1 -1
  38. package/examples/latest/mill-components-schema.json +1 -1
  39. package/examples/latest/nested-shape-arrays.json +1 -1
  40. package/examples/latest/one-earth.json +1 -1
  41. package/examples/latest/pet-oneof-array.json +1 -1
  42. package/examples/latest/post-schema.json +1 -1
  43. package/examples/latest/pruned-shopify-product-schema.json +1 -1
  44. package/examples/latest/rag-example.json +1 -1
  45. package/examples/latest/real-world-schema.json +1 -1
  46. package/examples/latest/recursive-repeater-schema.json +1 -1
  47. package/examples/latest/recursive-schema.json +1 -1
  48. package/examples/latest/rick-and-morty-ast.json +1 -1
  49. package/examples/latest/rick-and-morty-graphql.json +1 -1
  50. package/examples/latest/rick-and-morty-rest.json +1 -1
  51. package/examples/latest/rick-and-morty-user-schema.json +1 -1
  52. package/examples/latest/rick-and-morty-with-indexing.json +1 -1
  53. package/examples/latest/schema-where-filter.json +1 -1
  54. package/examples/latest/schema-with-repeater-draftjs.json +1 -1
  55. package/examples/latest/schema-with-rick-and-morty.json +1 -1
  56. package/examples/latest/shape-books-v3_2_0.json +1 -1
  57. package/examples/latest/shape-books.json +1 -1
  58. package/examples/latest/shape-editor-schema-edited.json +1 -1
  59. package/examples/latest/shape-editor-schema-initial.json +1 -1
  60. package/examples/latest/shapedb-crud-every-prop-type.json +1 -1
  61. package/examples/latest/shopify-lookbook.json +1 -1
  62. package/examples/latest/shopify-product-2022-07.json +1 -1
  63. package/examples/latest/shopify-product-2023-04.json +1 -1
  64. package/examples/latest/shopify-store-with-widget.json +1 -1
  65. package/examples/latest/stripe-product-runtime-schema.json +1 -1
  66. package/examples/latest/stripe-starter-resolved.json +1 -1
  67. package/examples/latest/user-schema-no-required.json +1 -1
  68. package/examples/latest/user-schema-with-defaults.json +1 -1
  69. package/examples/latest/valvoline-ai-demo.json +1 -1
  70. package/examples/latest/vector-search-schema.json +1 -1
  71. package/package.json +6 -6
@@ -0,0 +1,7 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ export {};
@@ -0,0 +1,77 @@
1
+ import type { FromSchema } from 'json-schema-to-ts';
2
+ export declare const shapeName = "TSHybridSearchArgs";
3
+ export declare const schema: {
4
+ readonly type: "object";
5
+ readonly properties: {
6
+ readonly terms: {
7
+ readonly type: "string";
8
+ readonly description: "The text to search for. Drives both keyword matching and embedding generation.";
9
+ };
10
+ readonly from: {
11
+ readonly type: "integer";
12
+ readonly description: "A number of results to skip before starting to collect the result set. This is useful for pagination.";
13
+ };
14
+ readonly size: {
15
+ readonly type: "integer";
16
+ readonly maximum: 250;
17
+ readonly description: "The maximum number of items to return.";
18
+ };
19
+ readonly filter: {
20
+ readonly description: "An elasticsearch style filter. Overrides onlyEnabled.";
21
+ };
22
+ readonly sort: {
23
+ readonly type: "array";
24
+ readonly description: "The fields to sort the results by.";
25
+ readonly items: {
26
+ readonly type: "object";
27
+ readonly properties: {
28
+ readonly field: {
29
+ readonly type: "string";
30
+ };
31
+ readonly order: {
32
+ readonly type: "string";
33
+ readonly enum: ["asc", "desc"];
34
+ };
35
+ };
36
+ readonly required: ["field", "order"];
37
+ readonly additionalProperties: false;
38
+ };
39
+ };
40
+ readonly config: {
41
+ readonly type: "object";
42
+ readonly properties: {
43
+ readonly keywordWeight: {
44
+ readonly type: "number";
45
+ readonly description: "Weight factor for keyword search results. Default: 0.5";
46
+ };
47
+ readonly vectorWeight: {
48
+ readonly type: "number";
49
+ readonly description: "Weight factor for vector search results. Default: 0.5";
50
+ };
51
+ readonly vectorK: {
52
+ readonly type: "integer";
53
+ readonly minimum: 1;
54
+ readonly description: "Number of nearest neighbors for vector search. Default: 3";
55
+ };
56
+ };
57
+ readonly additionalProperties: false;
58
+ };
59
+ };
60
+ readonly additionalProperties: false;
61
+ };
62
+ export type HybridSearchArgs = FromSchema<typeof schema>;
63
+ export declare const validate: import("ajv").ValidateFunction<{
64
+ sort?: {
65
+ field: string;
66
+ order: "asc" | "desc";
67
+ }[] | undefined;
68
+ filter?: unknown;
69
+ size?: number | undefined;
70
+ from?: number | undefined;
71
+ terms?: string | undefined;
72
+ config?: {
73
+ keywordWeight?: number | undefined;
74
+ vectorWeight?: number | undefined;
75
+ vectorK?: number | undefined;
76
+ } | undefined;
77
+ }>;
@@ -0,0 +1,64 @@
1
+ import { createTypedValidator } from '@takeshape/json-schema';
2
+ export const shapeName = 'TSHybridSearchArgs';
3
+ export const schema = {
4
+ type: 'object',
5
+ properties: {
6
+ terms: {
7
+ type: 'string',
8
+ description: 'The text to search for. Drives both keyword matching and embedding generation.'
9
+ },
10
+ from: {
11
+ type: 'integer',
12
+ description: 'A number of results to skip before starting to collect the result set. This is useful for pagination.'
13
+ },
14
+ size: {
15
+ type: 'integer',
16
+ maximum: 250,
17
+ description: 'The maximum number of items to return.'
18
+ },
19
+ filter: {
20
+ description: 'An elasticsearch style filter. Overrides onlyEnabled.'
21
+ },
22
+ sort: {
23
+ type: 'array',
24
+ description: 'The fields to sort the results by.',
25
+ items: {
26
+ type: 'object',
27
+ properties: {
28
+ field: {
29
+ type: 'string'
30
+ },
31
+ order: {
32
+ type: 'string',
33
+ enum: ['asc', 'desc']
34
+ }
35
+ },
36
+ required: ['field', 'order'],
37
+ additionalProperties: false
38
+ }
39
+ },
40
+ config: {
41
+ type: 'object',
42
+ properties: {
43
+ keywordWeight: {
44
+ type: 'number',
45
+ description: 'Weight factor for keyword search results. Default: 0.5'
46
+ },
47
+ vectorWeight: {
48
+ type: 'number',
49
+ description: 'Weight factor for vector search results. Default: 0.5'
50
+ },
51
+ vectorK: {
52
+ type: 'integer',
53
+ minimum: 1,
54
+ description: 'Number of nearest neighbors for vector search. Default: 3'
55
+ }
56
+ },
57
+ additionalProperties: false
58
+ }
59
+ },
60
+ additionalProperties: false
61
+ };
62
+ export const validate = createTypedValidator(schema, {
63
+ useDefaults: true
64
+ });
@@ -1,4 +1,4 @@
1
- export declare const CURRENT_SCHEMA_VERSION = "3.65.0";
1
+ export declare const CURRENT_SCHEMA_VERSION = "3.67.0";
2
2
  export { default as anyProjectSchema } from './project-schema.json';
3
- export { default as latestSchemaJson } from './project-schema/v3.65.0.json';
3
+ export { default as latestSchemaJson } from './project-schema/v3.67.0.json';
4
4
  export declare const allProjectSchemas: any[];
@@ -1,7 +1,7 @@
1
1
  // This file is generated by "pnpm json2ts"
2
- export const CURRENT_SCHEMA_VERSION = '3.65.0';
2
+ export const CURRENT_SCHEMA_VERSION = '3.67.0';
3
3
  export { default as anyProjectSchema } from './project-schema.json' with { type: 'json' };
4
- export { default as latestSchemaJson } from './project-schema/v3.65.0.json' with { type: 'json' };
4
+ export { default as latestSchemaJson } from './project-schema/v3.67.0.json' with { type: 'json' };
5
5
  import experimentalSchemaJson from './project-schema/experimental-2025-07.json' with { type: 'json' };
6
6
  import projectSchemaV1_0_0 from './project-schema/v1.0.0.json' with { type: 'json' };
7
7
  import metaSchemaV1_0_0 from './project-schema/meta-schema-v1.0.0.json' with { type: 'json' };
@@ -89,6 +89,8 @@ import projectSchemaV3_62_0 from './project-schema/v3.62.0.json' with { type: 'j
89
89
  import projectSchemaV3_63_0 from './project-schema/v3.63.0.json' with { type: 'json' };
90
90
  import projectSchemaV3_64_0 from './project-schema/v3.64.0.json' with { type: 'json' };
91
91
  import projectSchemaV3_65_0 from './project-schema/v3.65.0.json' with { type: 'json' };
92
+ import projectSchemaV3_66_0 from './project-schema/v3.66.0.json' with { type: 'json' };
93
+ import projectSchemaV3_67_0 from './project-schema/v3.67.0.json' with { type: 'json' };
92
94
  import projectSchemaV4_0_0 from './project-schema/v4.0.0.json' with { type: 'json' };
93
95
  export const allProjectSchemas = [
94
96
  experimentalSchemaJson,
@@ -178,5 +180,7 @@ export const allProjectSchemas = [
178
180
  projectSchemaV3_63_0,
179
181
  projectSchemaV3_64_0,
180
182
  projectSchemaV3_65_0,
183
+ projectSchemaV3_66_0,
184
+ projectSchemaV3_67_0,
181
185
  projectSchemaV4_0_0
182
186
  ];
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://schema.takeshape.io/project-schema/v3.65.0#",
3
+ "$id": "https://schema.takeshape.io/project-schema/v3.67.0#",
4
4
  "title": "Project Schema JSON",
5
5
  "definitions": {
6
6
  "schemaArray": {
@@ -914,6 +914,9 @@
914
914
  {
915
915
  "$ref": "#/definitions/takeshapeResolver"
916
916
  },
917
+ {
918
+ "$ref": "#/definitions/aiHybridSearchResolver"
919
+ },
917
920
  {
918
921
  "$ref": "#/definitions/shapedbResolver"
919
922
  },
@@ -1943,6 +1946,52 @@
1943
1946
  "required": ["name", "service"],
1944
1947
  "additionalProperties": false
1945
1948
  },
1949
+ "aiHybridSearchResolver": {
1950
+ "title": "AIHybridSearchResolver",
1951
+ "type": "object",
1952
+ "properties": {
1953
+ "if": {
1954
+ "type": "string"
1955
+ },
1956
+ "id": {
1957
+ "type": "string",
1958
+ "pattern": "^(?=[a-zA-Z])[-_a-zA-Z0-9]+$"
1959
+ },
1960
+ "name": {
1961
+ "title": "AIHybridSearchResolverName",
1962
+ "type": "string",
1963
+ "description": "Name of the resolver function.",
1964
+ "enum": ["ai:hybridSearch"]
1965
+ },
1966
+ "vectorProperty": {
1967
+ "type": "string",
1968
+ "description": "A vector property ref to use for the query. The property must have an ai:createEmbedding resolver configured. The embedding service and model are derived from the property's resolver config."
1969
+ },
1970
+ "keywordWeight": {
1971
+ "description": "Weight factor for keyword search results. Default: 0.5",
1972
+ "type": "number"
1973
+ },
1974
+ "vectorWeight": {
1975
+ "description": "Weight factor for vector search results. Default: 0.5",
1976
+ "type": "number"
1977
+ },
1978
+ "vectorK": {
1979
+ "description": "Number of nearest neighbors for vector search. Default: 3",
1980
+ "type": "integer",
1981
+ "minimum": 1
1982
+ },
1983
+ "args": {
1984
+ "description": "Mapping and serialization configuration for args.",
1985
+ "$ref": "#/definitions/parameterConfigForJson"
1986
+ },
1987
+ "results": {
1988
+ "description": "Mapping configuration for the results of this resolver step.",
1989
+ "$ref": "#/definitions/parameterConfigForJson"
1990
+ }
1991
+ },
1992
+ "required": ["name", "vectorProperty"],
1993
+ "additionalProperties": false
1994
+ },
1946
1995
  "graphqlResolver": {
1947
1996
  "title": "GraphqlResolver",
1948
1997
  "type": "object",
@@ -2749,6 +2798,10 @@
2749
2798
  },
2750
2799
  "pagination": {
2751
2800
  "$ref": "#/definitions/paginationConfig"
2801
+ },
2802
+ "concurrency": {
2803
+ "type": "number",
2804
+ "description": "When set to a number greater than 0, pages will be fetched in parallel with this concurrency limit during indexing."
2752
2805
  }
2753
2806
  },
2754
2807
  "additionalProperties": false,
@@ -2778,6 +2831,10 @@
2778
2831
  },
2779
2832
  "pagination": {
2780
2833
  "$ref": "#/definitions/paginationConfig"
2834
+ },
2835
+ "concurrency": {
2836
+ "type": "number",
2837
+ "description": "When set to a number greater than 0, pages will be fetched in parallel with this concurrency limit during indexing."
2781
2838
  }
2782
2839
  },
2783
2840
  "additionalProperties": false,
@@ -5031,7 +5088,7 @@
5031
5088
  },
5032
5089
  "schemaVersion": {
5033
5090
  "type": "string",
5034
- "enum": ["3.65.0"],
5091
+ "enum": ["3.67.0"],
5035
5092
  "description": "The version of the schema format your project is using. We increase the version as we make breaking changes to the schema format."
5036
5093
  },
5037
5094
  "projectId": {