@takeshape/schema 11.73.0 → 11.76.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.
- package/dist/builtin-schema.js +1 -0
- package/dist/models/runtime-schema.js +1 -0
- package/dist/project-schema/latest.d.ts +6 -1
- package/dist/project-schema/v3.48.0.d.ts +6 -1
- package/dist/project-schema/v3.49.0.d.ts +6 -1
- package/dist/project-schema/v3.50.0.d.ts +6 -1
- package/dist/project-schema/v3.51.0.d.ts +6 -1
- package/dist/project-schema/v3.52.0.d.ts +6 -1
- package/dist/project-schema/v3.53.0.d.ts +6 -1
- package/dist/project-schema/v3.54.0.d.ts +6 -1
- package/dist/schemas/project-schema/experimental.json +20 -0
- package/dist/util/expressions.js +2 -2
- package/package.json +6 -6
- package/dist/__tests__/_examples.test.d.ts +0 -1
- package/dist/__tests__/_examples.test.js +0 -77
- package/dist/__tests__/agents.test.d.ts +0 -1
- package/dist/__tests__/agents.test.js +0 -163
- package/dist/__tests__/api-version.test.d.ts +0 -1
- package/dist/__tests__/api-version.test.js +0 -24
- package/dist/__tests__/builtin-schema.test.d.ts +0 -1
- package/dist/__tests__/builtin-schema.test.js +0 -18
- package/dist/__tests__/content-schema-transform.test.d.ts +0 -1
- package/dist/__tests__/content-schema-transform.test.js +0 -522
- package/dist/__tests__/create-input-schema.test.d.ts +0 -1
- package/dist/__tests__/create-input-schema.test.js +0 -184
- package/dist/__tests__/enum.test.d.ts +0 -1
- package/dist/__tests__/enum.test.js +0 -36
- package/dist/__tests__/flatten-templates.test.d.ts +0 -1
- package/dist/__tests__/flatten-templates.test.js +0 -40
- package/dist/__tests__/get-is-leaf.test.d.ts +0 -1
- package/dist/__tests__/get-is-leaf.test.js +0 -50
- package/dist/__tests__/interfaces.test.d.ts +0 -1
- package/dist/__tests__/interfaces.test.js +0 -219
- package/dist/__tests__/migration.test.d.ts +0 -1
- package/dist/__tests__/migration.test.js +0 -34
- package/dist/__tests__/mocks.test.d.ts +0 -1
- package/dist/__tests__/mocks.test.js +0 -24
- package/dist/__tests__/refs.test.d.ts +0 -1
- package/dist/__tests__/refs.test.js +0 -813
- package/dist/__tests__/relationships.test.d.ts +0 -1
- package/dist/__tests__/relationships.test.js +0 -638
- package/dist/__tests__/schema-transform.test.d.ts +0 -1
- package/dist/__tests__/schema-transform.test.js +0 -205
- package/dist/__tests__/schema-util.test.d.ts +0 -1
- package/dist/__tests__/schema-util.test.js +0 -1731
- package/dist/__tests__/service-dependencies.test.d.ts +0 -1
- package/dist/__tests__/service-dependencies.test.js +0 -360
- package/dist/__tests__/unions.test.d.ts +0 -1
- package/dist/__tests__/unions.test.js +0 -44
- package/dist/__tests__/validate.test.d.ts +0 -1
- package/dist/__tests__/validate.test.js +0 -1980
- package/dist/__tests__/workflows.test.d.ts +0 -3
- package/dist/__tests__/workflows.test.js +0 -149
- package/dist/layers/__tests__/layers.test.d.ts +0 -1
- package/dist/layers/__tests__/layers.test.js +0 -38
- package/dist/migration/to/__tests__/v3.10.0.test.d.ts +0 -1
- package/dist/migration/to/__tests__/v3.10.0.test.js +0 -90
- package/dist/migration/to/__tests__/v3.12.3.test.d.ts +0 -1
- package/dist/migration/to/__tests__/v3.12.3.test.js +0 -103
- package/dist/migration/to/__tests__/v3.17.test.d.ts +0 -1
- package/dist/migration/to/__tests__/v3.17.test.js +0 -71
- package/dist/migration/to/__tests__/v3.34.0.test.d.ts +0 -1
- package/dist/migration/to/__tests__/v3.34.0.test.js +0 -240
- package/dist/migration/to/__tests__/v3.39.0.test.d.ts +0 -1
- package/dist/migration/to/__tests__/v3.39.0.test.js +0 -116
- package/dist/migration/to/__tests__/v3.46.0.test.d.ts +0 -1
- package/dist/migration/to/__tests__/v3.46.0.test.js +0 -59
- package/dist/models/__tests__/fixtures.d.ts +0 -15
- package/dist/models/__tests__/fixtures.js +0 -56
- package/dist/models/__tests__/query.test.d.ts +0 -1
- package/dist/models/__tests__/query.test.js +0 -19
- package/dist/models/__tests__/runtime-schema.test.d.ts +0 -1
- package/dist/models/__tests__/runtime-schema.test.js +0 -43
- package/dist/models/__tests__/shape.test.d.ts +0 -1
- package/dist/models/__tests__/shape.test.js +0 -24
- package/dist/resolvers/ai/__tests__/rag-query.test.d.ts +0 -1
- package/dist/resolvers/ai/__tests__/rag-query.test.js +0 -49
- package/dist/services/__tests__/services.test.d.ts +0 -1
- package/dist/services/__tests__/services.test.js +0 -113
- package/dist/template-shapes/__tests__/index.test.d.ts +0 -1
- package/dist/template-shapes/__tests__/index.test.js +0 -40
- package/dist/template-shapes/__tests__/names.test.d.ts +0 -1
- package/dist/template-shapes/__tests__/names.test.js +0 -19
- package/dist/template-shapes/__tests__/templates.test.d.ts +0 -1
- package/dist/template-shapes/__tests__/templates.test.js +0 -80
- package/dist/template-shapes/__tests__/where.test.d.ts +0 -1
- package/dist/template-shapes/__tests__/where.test.js +0 -218
- package/dist/types/__tests__/utils.test.d.ts +0 -1
- package/dist/types/__tests__/utils.test.js +0 -159
- package/dist/util/__tests__/api-indexing.test.d.ts +0 -1
- package/dist/util/__tests__/api-indexing.test.js +0 -129
- package/dist/util/__tests__/detect-cycles.test.d.ts +0 -1
- package/dist/util/__tests__/detect-cycles.test.js +0 -193
- package/dist/util/__tests__/expressions.test.d.ts +0 -1
- package/dist/util/__tests__/expressions.test.js +0 -172
- package/dist/util/__tests__/find-shape-at-path.test.d.ts +0 -1
- package/dist/util/__tests__/find-shape-at-path.test.js +0 -41
- package/dist/util/__tests__/form-config.test.d.ts +0 -1
- package/dist/util/__tests__/form-config.test.js +0 -196
- package/dist/util/__tests__/get-return-shape.test.d.ts +0 -1
- package/dist/util/__tests__/get-return-shape.test.js +0 -27
- package/dist/util/__tests__/has-args.test.d.ts +0 -1
- package/dist/util/__tests__/has-args.test.js +0 -46
- package/dist/util/__tests__/merge.test.d.ts +0 -1
- package/dist/util/__tests__/merge.test.js +0 -1074
- package/dist/util/__tests__/patch-schema.test.d.ts +0 -1
- package/dist/util/__tests__/patch-schema.test.js +0 -82
- package/dist/util/__tests__/shapes.test.d.ts +0 -1
- package/dist/util/__tests__/shapes.test.js +0 -30
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import omit from 'lodash/omit.js';
|
|
2
|
-
import set from 'lodash/set.js';
|
|
3
|
-
import { describe, expect, test } from 'vitest';
|
|
4
|
-
import shopifyStoreJson from '@/examples/latest/shopify-store-with-widget.json';
|
|
5
|
-
import { applyDefaultsToSchema } from "../../schema-util.js";
|
|
6
|
-
import { patchSchema } from "../patch-schema.js";
|
|
7
|
-
const shopifyStoreSchema = applyDefaultsToSchema(shopifyStoreJson);
|
|
8
|
-
describe('patchSchema', () => {
|
|
9
|
-
test('delete shape', () => {
|
|
10
|
-
expect(patchSchema(shopifyStoreSchema, {
|
|
11
|
-
shapes: {
|
|
12
|
-
Product: null
|
|
13
|
-
}
|
|
14
|
-
})).toEqual({
|
|
15
|
-
...shopifyStoreSchema,
|
|
16
|
-
shapes: {
|
|
17
|
-
...omit(shopifyStoreSchema.shapes, ['Product'])
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
test('add shape', () => {
|
|
22
|
-
const Dog = {
|
|
23
|
-
name: 'Dog',
|
|
24
|
-
id: 'Dog',
|
|
25
|
-
title: 'Dog',
|
|
26
|
-
schema: {
|
|
27
|
-
type: 'object',
|
|
28
|
-
properties: {}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
expect(patchSchema(shopifyStoreSchema, {
|
|
32
|
-
shapes: {
|
|
33
|
-
Dog
|
|
34
|
-
}
|
|
35
|
-
})).toEqual({
|
|
36
|
-
...shopifyStoreSchema,
|
|
37
|
-
shapes: {
|
|
38
|
-
...shopifyStoreSchema.shapes,
|
|
39
|
-
Dog
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
test('nested paths', () => {
|
|
44
|
-
const agentJson = { api: { type: 'chat' } };
|
|
45
|
-
const aiExperimentalSchema = set(shopifyStoreSchema, 'ai-experimental.agents', { foo: agentJson });
|
|
46
|
-
expect(patchSchema(aiExperimentalSchema, {
|
|
47
|
-
'ai-experimental.agents': {
|
|
48
|
-
foo: null,
|
|
49
|
-
bar: agentJson
|
|
50
|
-
}
|
|
51
|
-
})).toEqual({
|
|
52
|
-
...aiExperimentalSchema,
|
|
53
|
-
'ai-experimental': {
|
|
54
|
-
agents: {
|
|
55
|
-
bar: agentJson
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
test('preserving unpatched props', () => {
|
|
61
|
-
const agentJson = { api: { type: 'chat' } };
|
|
62
|
-
const aiExperimental = {
|
|
63
|
-
agents: { foo: agentJson },
|
|
64
|
-
someOtherPropertyThatIsNotTouched: 'foo'
|
|
65
|
-
};
|
|
66
|
-
const aiExperimentalSchema = set(shopifyStoreSchema, 'ai-experimental', aiExperimental);
|
|
67
|
-
expect(patchSchema(aiExperimentalSchema, {
|
|
68
|
-
'ai-experimental.agents': {
|
|
69
|
-
foo: null,
|
|
70
|
-
bar: agentJson
|
|
71
|
-
}
|
|
72
|
-
})).toEqual({
|
|
73
|
-
...aiExperimentalSchema,
|
|
74
|
-
'ai-experimental': {
|
|
75
|
-
...aiExperimental,
|
|
76
|
-
agents: {
|
|
77
|
-
bar: agentJson
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { deepClone } from '@takeshape/util';
|
|
2
|
-
import { describe, expect, test } from 'vitest';
|
|
3
|
-
import postSchemaJson from '@/examples/latest/post-schema.json';
|
|
4
|
-
import { ensureShape, ensureShapeById } from "../shapes.js";
|
|
5
|
-
function getPostSchema() {
|
|
6
|
-
return deepClone(postSchemaJson);
|
|
7
|
-
}
|
|
8
|
-
describe('ensureShape', () => {
|
|
9
|
-
test('success', () => {
|
|
10
|
-
const postSchema = getPostSchema();
|
|
11
|
-
const shape = postSchema.shapes.Post;
|
|
12
|
-
expect(ensureShape(postSchema, shape.name)).toEqual(shape);
|
|
13
|
-
});
|
|
14
|
-
test('missing', () => {
|
|
15
|
-
const postSchema = getPostSchema();
|
|
16
|
-
expect(() => ensureShape(postSchema, 'Bogus')).toThrowErrorMatchingInlineSnapshot(`[NotFoundError: Shape "Bogus" Not found]`);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
describe('ensureShapeById', () => {
|
|
20
|
-
test('success', () => {
|
|
21
|
-
const postSchema = getPostSchema();
|
|
22
|
-
const shape = postSchema.shapes.Post;
|
|
23
|
-
const shapeId = shape.id;
|
|
24
|
-
expect(ensureShapeById(postSchema, shapeId)).toEqual(shape);
|
|
25
|
-
});
|
|
26
|
-
test('missing', () => {
|
|
27
|
-
const postSchema = getPostSchema();
|
|
28
|
-
expect(() => ensureShapeById(postSchema, 'bogus')).toThrowErrorMatchingInlineSnapshot(`[NotFoundError: Shape with id "bogus" Not found]`);
|
|
29
|
-
});
|
|
30
|
-
});
|