@takeshape/schema 11.144.1 → 11.154.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.
- package/examples/latest/all-fields-shapes-inline.json +1 -1
- package/examples/latest/all-fields-shapes.json +1 -1
- package/examples/latest/betzino.json +1 -1
- package/examples/latest/blog-schema.json +1 -1
- package/examples/latest/brewery-schema.json +1 -1
- package/examples/latest/chat-agent-schema.json +1 -1
- package/examples/latest/clear-cache-schema.json +1 -1
- package/examples/latest/complex-project-schema.json +1 -1
- package/examples/latest/complex-schema.json +1 -1
- package/examples/latest/edit-schema.json +1 -1
- package/examples/latest/frank-and-fred-schema.json +1 -1
- package/examples/latest/generate-agent-schema.json +1 -1
- package/examples/latest/klirr-schema.json +1 -1
- package/examples/latest/layers/rick-and-morty-layer.json +1 -1
- package/examples/latest/layers/shopify-layer-2023-01.json +1 -1
- package/examples/latest/layers/shopify-storefront-2023-04.json +1 -1
- package/examples/latest/layers/wordpress-2024-01.json +1 -1
- package/examples/latest/massive-schema.json +1 -1
- package/examples/latest/mill-components-schema.json +1 -1
- package/examples/latest/nested-shape-arrays.json +1 -1
- package/examples/latest/one-earth.json +1 -1
- package/examples/latest/pet-oneof-array.json +1 -1
- package/examples/latest/post-schema.json +1 -1
- package/examples/latest/pruned-shopify-product-schema.json +1 -1
- package/examples/latest/rag-example.json +1 -1
- package/examples/latest/real-world-schema.json +1 -1
- package/examples/latest/recursive-repeater-schema.json +1 -1
- package/examples/latest/recursive-schema.json +1 -1
- package/examples/latest/rick-and-morty-ast.json +1 -1
- package/examples/latest/rick-and-morty-graphql.json +1 -1
- package/examples/latest/rick-and-morty-rest.json +1 -1
- package/examples/latest/rick-and-morty-user-schema.json +1 -1
- package/examples/latest/rick-and-morty-with-indexing.json +1 -1
- package/examples/latest/schema-where-filter.json +1 -1
- package/examples/latest/schema-with-repeater-draftjs.json +1 -1
- package/examples/latest/schema-with-rick-and-morty.json +1 -1
- package/examples/latest/shape-books-v3_2_0.json +1 -1
- package/examples/latest/shape-books.json +1 -1
- package/examples/latest/shape-editor-schema-edited.json +1 -1
- package/examples/latest/shape-editor-schema-initial.json +1 -1
- package/examples/latest/shapedb-crud-every-prop-type.json +1 -1
- package/examples/latest/shopify-lookbook.json +1 -1
- package/examples/latest/shopify-product-2022-07.json +1 -1
- package/examples/latest/shopify-product-2023-04.json +1 -1
- package/examples/latest/shopify-store-with-widget.json +1 -1
- package/examples/latest/stripe-product-runtime-schema.json +1 -1
- package/examples/latest/stripe-starter-resolved.json +1 -1
- package/examples/latest/user-schema-no-required.json +1 -1
- package/examples/latest/user-schema-with-defaults.json +1 -1
- package/examples/latest/valvoline-ai-demo.json +1461 -1421
- package/examples/latest/vector-search-schema.json +1 -1
- package/package.json +10 -9
- package/dist/agents.d.ts +0 -62
- package/dist/agents.js +0 -338
- package/dist/api-version.d.ts +0 -5
- package/dist/api-version.js +0 -17
- package/dist/auth-schemas.d.ts +0 -128
- package/dist/auth-schemas.js +0 -7
- package/dist/auth-utils.d.ts +0 -5
- package/dist/auth-utils.js +0 -6
- package/dist/builtin-schema.d.ts +0 -18
- package/dist/builtin-schema.js +0 -683
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +0 -1
- package/dist/content-schema-transform.d.ts +0 -35
- package/dist/content-schema-transform.js +0 -162
- package/dist/create-input-schema.d.ts +0 -9
- package/dist/create-input-schema.js +0 -68
- package/dist/enum.d.ts +0 -2
- package/dist/enum.js +0 -9
- package/dist/flatten-templates.d.ts +0 -2
- package/dist/flatten-templates.js +0 -20
- package/dist/get-is-leaf.d.ts +0 -3
- package/dist/get-is-leaf.js +0 -56
- package/dist/index.d.ts +0 -62
- package/dist/index.js +0 -59
- package/dist/interfaces.d.ts +0 -14
- package/dist/interfaces.js +0 -86
- package/dist/layers/layers.d.ts +0 -26
- package/dist/layers/layers.js +0 -301
- package/dist/layers/refs.d.ts +0 -102
- package/dist/layers/refs.js +0 -220
- package/dist/layers/type-utils.d.ts +0 -59
- package/dist/layers/type-utils.js +0 -118
- package/dist/layers/visitor.d.ts +0 -5
- package/dist/layers/visitor.js +0 -38
- package/dist/migration/index.d.ts +0 -73
- package/dist/migration/index.js +0 -103
- package/dist/migration/to/v3.0.0.d.ts +0 -4
- package/dist/migration/to/v3.0.0.js +0 -212
- package/dist/migration/to/v3.1.0.d.ts +0 -4
- package/dist/migration/to/v3.1.0.js +0 -194
- package/dist/migration/to/v3.10.0.d.ts +0 -4
- package/dist/migration/to/v3.10.0.js +0 -67
- package/dist/migration/to/v3.11.0.d.ts +0 -4
- package/dist/migration/to/v3.11.0.js +0 -85
- package/dist/migration/to/v3.12.3.d.ts +0 -4
- package/dist/migration/to/v3.12.3.js +0 -87
- package/dist/migration/to/v3.13.0.d.ts +0 -4
- package/dist/migration/to/v3.13.0.js +0 -17
- package/dist/migration/to/v3.17.0.d.ts +0 -4
- package/dist/migration/to/v3.17.0.js +0 -22
- package/dist/migration/to/v3.18.0.d.ts +0 -4
- package/dist/migration/to/v3.18.0.js +0 -64
- package/dist/migration/to/v3.18.1.d.ts +0 -4
- package/dist/migration/to/v3.18.1.js +0 -12
- package/dist/migration/to/v3.18.2.d.ts +0 -4
- package/dist/migration/to/v3.18.2.js +0 -19
- package/dist/migration/to/v3.20.0.d.ts +0 -4
- package/dist/migration/to/v3.20.0.js +0 -24
- package/dist/migration/to/v3.22.0.d.ts +0 -4
- package/dist/migration/to/v3.22.0.js +0 -25
- package/dist/migration/to/v3.24.0.d.ts +0 -4
- package/dist/migration/to/v3.24.0.js +0 -11
- package/dist/migration/to/v3.25.0.d.ts +0 -4
- package/dist/migration/to/v3.25.0.js +0 -11
- package/dist/migration/to/v3.3.0.d.ts +0 -4
- package/dist/migration/to/v3.3.0.js +0 -13
- package/dist/migration/to/v3.31.0.d.ts +0 -4
- package/dist/migration/to/v3.31.0.js +0 -38
- package/dist/migration/to/v3.32.0.d.ts +0 -4
- package/dist/migration/to/v3.32.0.js +0 -59
- package/dist/migration/to/v3.34.0.d.ts +0 -6
- package/dist/migration/to/v3.34.0.js +0 -111
- package/dist/migration/to/v3.36.0.d.ts +0 -4
- package/dist/migration/to/v3.36.0.js +0 -22
- package/dist/migration/to/v3.39.0.d.ts +0 -4
- package/dist/migration/to/v3.39.0.js +0 -45
- package/dist/migration/to/v3.40.0.d.ts +0 -4
- package/dist/migration/to/v3.40.0.js +0 -26
- package/dist/migration/to/v3.46.0.d.ts +0 -4
- package/dist/migration/to/v3.46.0.js +0 -35
- package/dist/migration/to/v3.57.0.d.ts +0 -4
- package/dist/migration/to/v3.57.0.js +0 -18
- package/dist/migration/to/v3.9.0.d.ts +0 -4
- package/dist/migration/to/v3.9.0.js +0 -79
- package/dist/migration/types.d.ts +0 -26
- package/dist/migration/types.js +0 -3
- package/dist/migration/utils.d.ts +0 -2
- package/dist/migration/utils.js +0 -6
- package/dist/mocks.d.ts +0 -14
- package/dist/mocks.js +0 -58
- package/dist/models/agent.d.ts +0 -3
- package/dist/models/agent.js +0 -29
- package/dist/models/project-schema.d.ts +0 -18
- package/dist/models/project-schema.js +0 -119
- package/dist/models/query.d.ts +0 -3
- package/dist/models/query.js +0 -38
- package/dist/models/runtime-schema.d.ts +0 -9
- package/dist/models/runtime-schema.js +0 -20
- package/dist/models/shape.d.ts +0 -4
- package/dist/models/shape.js +0 -36
- package/dist/models/types.d.ts +0 -36
- package/dist/models/types.js +0 -1
- package/dist/models/user-schema.d.ts +0 -7
- package/dist/models/user-schema.js +0 -9
- package/dist/patterns.d.ts +0 -12
- package/dist/patterns.js +0 -1
- package/dist/project-schema/index.d.ts +0 -211
- package/dist/project-schema/index.js +0 -83
- package/dist/project-schema/latest.d.ts +0 -2619
- package/dist/project-schema/latest.js +0 -7
- package/dist/project-schema/migrate.d.ts +0 -4
- package/dist/project-schema/migrate.js +0 -218
- package/dist/project-schema/v1.0.0.d.ts +0 -299
- package/dist/project-schema/v1.0.0.js +0 -7
- package/dist/project-schema/v3.0.0.d.ts +0 -478
- package/dist/project-schema/v3.0.0.js +0 -7
- package/dist/project-schema/v3.1.0.d.ts +0 -621
- package/dist/project-schema/v3.1.0.js +0 -7
- package/dist/project-schema/v3.10.0.d.ts +0 -1201
- package/dist/project-schema/v3.10.0.js +0 -7
- package/dist/project-schema/v3.11.0.d.ts +0 -1210
- package/dist/project-schema/v3.11.0.js +0 -7
- package/dist/project-schema/v3.12.0.d.ts +0 -1214
- package/dist/project-schema/v3.12.0.js +0 -7
- package/dist/project-schema/v3.12.1.d.ts +0 -1273
- package/dist/project-schema/v3.12.1.js +0 -7
- package/dist/project-schema/v3.12.2.d.ts +0 -1283
- package/dist/project-schema/v3.12.2.js +0 -7
- package/dist/project-schema/v3.12.3.d.ts +0 -1306
- package/dist/project-schema/v3.12.3.js +0 -7
- package/dist/project-schema/v3.13.0.d.ts +0 -1317
- package/dist/project-schema/v3.13.0.js +0 -7
- package/dist/project-schema/v3.13.1.d.ts +0 -1412
- package/dist/project-schema/v3.13.1.js +0 -7
- package/dist/project-schema/v3.14.0.d.ts +0 -1436
- package/dist/project-schema/v3.14.0.js +0 -7
- package/dist/project-schema/v3.15.0.d.ts +0 -1458
- package/dist/project-schema/v3.15.0.js +0 -7
- package/dist/project-schema/v3.16.0.d.ts +0 -1470
- package/dist/project-schema/v3.16.0.js +0 -7
- package/dist/project-schema/v3.17.0.d.ts +0 -1467
- package/dist/project-schema/v3.17.0.js +0 -7
- package/dist/project-schema/v3.17.1.d.ts +0 -1468
- package/dist/project-schema/v3.17.1.js +0 -7
- package/dist/project-schema/v3.18.0.d.ts +0 -1333
- package/dist/project-schema/v3.18.0.js +0 -7
- package/dist/project-schema/v3.18.1.d.ts +0 -1332
- package/dist/project-schema/v3.18.1.js +0 -7
- package/dist/project-schema/v3.18.2.d.ts +0 -1332
- package/dist/project-schema/v3.18.2.js +0 -7
- package/dist/project-schema/v3.19.0.d.ts +0 -1336
- package/dist/project-schema/v3.19.0.js +0 -7
- package/dist/project-schema/v3.2.0.d.ts +0 -632
- package/dist/project-schema/v3.2.0.js +0 -7
- package/dist/project-schema/v3.20.0.d.ts +0 -1336
- package/dist/project-schema/v3.20.0.js +0 -7
- package/dist/project-schema/v3.21.0.d.ts +0 -1338
- package/dist/project-schema/v3.21.0.js +0 -7
- package/dist/project-schema/v3.22.0.d.ts +0 -1344
- package/dist/project-schema/v3.22.0.js +0 -7
- package/dist/project-schema/v3.23.0.d.ts +0 -1376
- package/dist/project-schema/v3.23.0.js +0 -7
- package/dist/project-schema/v3.24.0.d.ts +0 -1364
- package/dist/project-schema/v3.24.0.js +0 -7
- package/dist/project-schema/v3.25.0.d.ts +0 -1363
- package/dist/project-schema/v3.25.0.js +0 -7
- package/dist/project-schema/v3.26.0.d.ts +0 -1388
- package/dist/project-schema/v3.26.0.js +0 -7
- package/dist/project-schema/v3.27.0.d.ts +0 -1397
- package/dist/project-schema/v3.27.0.js +0 -7
- package/dist/project-schema/v3.28.0.d.ts +0 -1416
- package/dist/project-schema/v3.28.0.js +0 -7
- package/dist/project-schema/v3.29.0.d.ts +0 -1423
- package/dist/project-schema/v3.29.0.js +0 -7
- package/dist/project-schema/v3.3.0.d.ts +0 -632
- package/dist/project-schema/v3.3.0.js +0 -7
- package/dist/project-schema/v3.30.0.d.ts +0 -1416
- package/dist/project-schema/v3.30.0.js +0 -7
- package/dist/project-schema/v3.31.0.d.ts +0 -1448
- package/dist/project-schema/v3.31.0.js +0 -7
- package/dist/project-schema/v3.32.0.d.ts +0 -1439
- package/dist/project-schema/v3.32.0.js +0 -7
- package/dist/project-schema/v3.33.0.d.ts +0 -1445
- package/dist/project-schema/v3.33.0.js +0 -7
- package/dist/project-schema/v3.34.0.d.ts +0 -1445
- package/dist/project-schema/v3.34.0.js +0 -7
- package/dist/project-schema/v3.35.0.d.ts +0 -1464
- package/dist/project-schema/v3.35.0.js +0 -7
- package/dist/project-schema/v3.36.0.d.ts +0 -1470
- package/dist/project-schema/v3.36.0.js +0 -7
- package/dist/project-schema/v3.37.0.d.ts +0 -1522
- package/dist/project-schema/v3.37.0.js +0 -7
- package/dist/project-schema/v3.38.0.d.ts +0 -1522
- package/dist/project-schema/v3.38.0.js +0 -7
- package/dist/project-schema/v3.39.0.d.ts +0 -1529
- package/dist/project-schema/v3.39.0.js +0 -7
- package/dist/project-schema/v3.4.0.d.ts +0 -624
- package/dist/project-schema/v3.4.0.js +0 -7
- package/dist/project-schema/v3.40.0.d.ts +0 -1530
- package/dist/project-schema/v3.40.0.js +0 -7
- package/dist/project-schema/v3.41.0.d.ts +0 -1530
- package/dist/project-schema/v3.41.0.js +0 -7
- package/dist/project-schema/v3.42.0.d.ts +0 -1534
- package/dist/project-schema/v3.42.0.js +0 -7
- package/dist/project-schema/v3.43.0.d.ts +0 -1536
- package/dist/project-schema/v3.43.0.js +0 -7
- package/dist/project-schema/v3.44.0.d.ts +0 -1621
- package/dist/project-schema/v3.44.0.js +0 -7
- package/dist/project-schema/v3.45.0.d.ts +0 -1650
- package/dist/project-schema/v3.45.0.js +0 -7
- package/dist/project-schema/v3.46.0.d.ts +0 -1703
- package/dist/project-schema/v3.46.0.js +0 -7
- package/dist/project-schema/v3.47.0.d.ts +0 -1736
- package/dist/project-schema/v3.47.0.js +0 -7
- package/dist/project-schema/v3.48.0.d.ts +0 -2208
- package/dist/project-schema/v3.48.0.js +0 -7
- package/dist/project-schema/v3.49.0.d.ts +0 -2217
- package/dist/project-schema/v3.49.0.js +0 -7
- package/dist/project-schema/v3.5.0.d.ts +0 -649
- package/dist/project-schema/v3.5.0.js +0 -7
- package/dist/project-schema/v3.5.1.d.ts +0 -649
- package/dist/project-schema/v3.5.1.js +0 -7
- package/dist/project-schema/v3.50.0.d.ts +0 -2269
- package/dist/project-schema/v3.50.0.js +0 -7
- package/dist/project-schema/v3.51.0.d.ts +0 -2269
- package/dist/project-schema/v3.51.0.js +0 -7
- package/dist/project-schema/v3.52.0.d.ts +0 -2269
- package/dist/project-schema/v3.52.0.js +0 -7
- package/dist/project-schema/v3.53.0.d.ts +0 -2350
- package/dist/project-schema/v3.53.0.js +0 -7
- package/dist/project-schema/v3.54.0.d.ts +0 -2369
- package/dist/project-schema/v3.54.0.js +0 -7
- package/dist/project-schema/v3.55.0.d.ts +0 -2369
- package/dist/project-schema/v3.55.0.js +0 -7
- package/dist/project-schema/v3.56.0.d.ts +0 -2405
- package/dist/project-schema/v3.56.0.js +0 -7
- package/dist/project-schema/v3.57.0.d.ts +0 -2601
- package/dist/project-schema/v3.57.0.js +0 -7
- package/dist/project-schema/v3.58.0.d.ts +0 -2601
- package/dist/project-schema/v3.58.0.js +0 -7
- package/dist/project-schema/v3.59.0.d.ts +0 -2619
- package/dist/project-schema/v3.59.0.js +0 -7
- package/dist/project-schema/v3.6.0.d.ts +0 -658
- package/dist/project-schema/v3.6.0.js +0 -7
- package/dist/project-schema/v3.7.0.d.ts +0 -961
- package/dist/project-schema/v3.7.0.js +0 -7
- package/dist/project-schema/v3.8.0.d.ts +0 -979
- package/dist/project-schema/v3.8.0.js +0 -7
- package/dist/project-schema/v3.9.0.d.ts +0 -1178
- package/dist/project-schema/v3.9.0.js +0 -7
- package/dist/project-schema/v4.0.0.d.ts +0 -1328
- package/dist/project-schema/v4.0.0.js +0 -7
- package/dist/refs.d.ts +0 -218
- package/dist/refs.js +0 -616
- package/dist/relationships.d.ts +0 -40
- package/dist/relationships.js +0 -302
- package/dist/resolvers/ai/abort-agent-message-args.d.ts +0 -16
- package/dist/resolvers/ai/abort-agent-message-args.js +0 -13
- package/dist/resolvers/ai/abort-agent-message-response.d.ts +0 -39
- package/dist/resolvers/ai/abort-agent-message-response.js +0 -19
- package/dist/resolvers/ai/agent-chat-args.d.ts +0 -17
- package/dist/resolvers/ai/agent-chat-args.js +0 -14
- package/dist/resolvers/ai/agent-chat-payload.d.ts +0 -35
- package/dist/resolvers/ai/agent-chat-payload.js +0 -26
- package/dist/resolvers/ai/agent-chat-response.d.ts +0 -289
- package/dist/resolvers/ai/agent-chat-response.js +0 -21
- package/dist/resolvers/ai/agent-generate-args.d.ts +0 -17
- package/dist/resolvers/ai/agent-generate-args.js +0 -14
- package/dist/resolvers/ai/agent-message-input.d.ts +0 -73
- package/dist/resolvers/ai/agent-message-input.js +0 -39
- package/dist/resolvers/ai/agent-message-output.d.ts +0 -169
- package/dist/resolvers/ai/agent-message-output.js +0 -77
- package/dist/resolvers/ai/agent-message-payload.d.ts +0 -507
- package/dist/resolvers/ai/agent-message-payload.js +0 -156
- package/dist/resolvers/ai/agent-run-mode.d.ts +0 -7
- package/dist/resolvers/ai/agent-run-mode.js +0 -9
- package/dist/resolvers/ai/agent-session-payload.d.ts +0 -515
- package/dist/resolvers/ai/agent-session-payload.js +0 -175
- package/dist/resolvers/ai/create-agent-session-response.d.ts +0 -199
- package/dist/resolvers/ai/create-agent-session-response.js +0 -9
- package/dist/resolvers/ai/embedding-search.d.ts +0 -54
- package/dist/resolvers/ai/embedding-search.js +0 -46
- package/dist/resolvers/ai/get-agent-message-args.d.ts +0 -16
- package/dist/resolvers/ai/get-agent-message-args.js +0 -13
- package/dist/resolvers/ai/get-agent-message-response.d.ts +0 -805
- package/dist/resolvers/ai/get-agent-message-response.js +0 -63
- package/dist/resolvers/ai/inspect-agent-args.d.ts +0 -16
- package/dist/resolvers/ai/inspect-agent-args.js +0 -13
- package/dist/resolvers/ai/inspect-agent-response.d.ts +0 -504
- package/dist/resolvers/ai/inspect-agent-response.js +0 -48
- package/dist/resolvers/ai/send-agent-feedback-args.d.ts +0 -52
- package/dist/resolvers/ai/send-agent-feedback-args.js +0 -16
- package/dist/resolvers/ai/send-agent-message-args.d.ts +0 -48
- package/dist/resolvers/ai/send-agent-message-args.js +0 -36
- package/dist/resolvers/ai/send-agent-message-response.d.ts +0 -353
- package/dist/resolvers/ai/send-agent-message-response.js +0 -51
- package/dist/resolvers/ai/types.d.ts +0 -6
- package/dist/resolvers/ai/types.js +0 -1
- package/dist/resolvers/takeshape/assets/asset-image-meta.d.ts +0 -79
- package/dist/resolvers/takeshape/assets/asset-image-meta.js +0 -98
- package/dist/resolvers/takeshape/assets/asset-image-params.d.ts +0 -901
- package/dist/resolvers/takeshape/assets/asset-image-params.js +0 -726
- package/dist/resolvers/takeshape/assets/asset-image.d.ts +0 -17
- package/dist/resolvers/takeshape/assets/asset-image.js +0 -15
- package/dist/resolvers/takeshape/assets/asset.d.ts +0 -125
- package/dist/resolvers/takeshape/assets/asset.js +0 -107
- package/dist/resolvers/takeshape/assets/constants.d.ts +0 -11
- package/dist/resolvers/takeshape/assets/constants.js +0 -11
- package/dist/resolvers/takeshape/builtins/constants.d.ts +0 -1
- package/dist/resolvers/takeshape/builtins/constants.js +0 -1
- package/dist/runtime-schema.d.ts +0 -6
- package/dist/runtime-schema.js +0 -85
- package/dist/scalars.d.ts +0 -2
- package/dist/scalars.js +0 -4
- package/dist/schema-transform.d.ts +0 -19
- package/dist/schema-transform.js +0 -74
- package/dist/schema-util.d.ts +0 -266
- package/dist/schema-util.js +0 -1127
- package/dist/schemas/auth-schemas.json +0 -374
- package/dist/schemas/index.d.ts +0 -4
- package/dist/schemas/index.js +0 -170
- package/dist/schemas/project-schema/experimental-2025-07.json +0 -1297
- package/dist/schemas/project-schema/latest.d.ts +0 -180
- package/dist/schemas/project-schema/latest.js +0 -11
- package/dist/schemas/project-schema/latest.json +0 -4846
- package/dist/schemas/project-schema/meta-schema-v1.0.0.json +0 -193
- package/dist/schemas/project-schema/meta-schema-v3.0.0.json +0 -608
- package/dist/schemas/project-schema/meta-schema-v3.1.0.json +0 -608
- package/dist/schemas/project-schema/meta-schema-v3.2.0.json +0 -612
- package/dist/schemas/project-schema/meta-schema-v3.3.0.json +0 -612
- package/dist/schemas/project-schema/meta-schema-v3.4.0.json +0 -637
- package/dist/schemas/project-schema/meta-schema-v3.5.0.json +0 -626
- package/dist/schemas/project-schema/meta-schema-v3.5.1.json +0 -626
- package/dist/schemas/project-schema/meta-schema-v3.6.0.json +0 -629
- package/dist/schemas/project-schema/meta-schema-v3.7.0.json +0 -1137
- package/dist/schemas/project-schema/meta-schema-v3.8.0.json +0 -1137
- package/dist/schemas/project-schema/meta-schema-v3.9.0.json +0 -1477
- package/dist/schemas/project-schema/v1.0.0.json +0 -321
- package/dist/schemas/project-schema/v3.0.0.json +0 -414
- package/dist/schemas/project-schema/v3.1.0.json +0 -572
- package/dist/schemas/project-schema/v3.10.0.json +0 -2097
- package/dist/schemas/project-schema/v3.11.0.json +0 -2141
- package/dist/schemas/project-schema/v3.12.0.json +0 -2144
- package/dist/schemas/project-schema/v3.12.1.json +0 -2282
- package/dist/schemas/project-schema/v3.12.2.json +0 -2304
- package/dist/schemas/project-schema/v3.12.3.json +0 -2357
- package/dist/schemas/project-schema/v3.13.0.json +0 -2377
- package/dist/schemas/project-schema/v3.14.0.json +0 -2385
- package/dist/schemas/project-schema/v3.15.0.json +0 -2365
- package/dist/schemas/project-schema/v3.16.0.json +0 -2373
- package/dist/schemas/project-schema/v3.17.0.json +0 -2378
- package/dist/schemas/project-schema/v3.17.1.json +0 -2380
- package/dist/schemas/project-schema/v3.18.0.json +0 -2356
- package/dist/schemas/project-schema/v3.18.1.json +0 -2357
- package/dist/schemas/project-schema/v3.18.2.json +0 -2357
- package/dist/schemas/project-schema/v3.19.0.json +0 -2369
- package/dist/schemas/project-schema/v3.2.0.json +0 -580
- package/dist/schemas/project-schema/v3.20.0.json +0 -2369
- package/dist/schemas/project-schema/v3.21.0.json +0 -2376
- package/dist/schemas/project-schema/v3.22.0.json +0 -2381
- package/dist/schemas/project-schema/v3.23.0.json +0 -2456
- package/dist/schemas/project-schema/v3.24.0.json +0 -2556
- package/dist/schemas/project-schema/v3.25.0.json +0 -2552
- package/dist/schemas/project-schema/v3.26.0.json +0 -2599
- package/dist/schemas/project-schema/v3.27.0.json +0 -2611
- package/dist/schemas/project-schema/v3.28.0.json +0 -2656
- package/dist/schemas/project-schema/v3.29.0.json +0 -2670
- package/dist/schemas/project-schema/v3.3.0.json +0 -581
- package/dist/schemas/project-schema/v3.30.0.json +0 -2656
- package/dist/schemas/project-schema/v3.31.0.json +0 -2714
- package/dist/schemas/project-schema/v3.32.0.json +0 -2708
- package/dist/schemas/project-schema/v3.33.0.json +0 -2715
- package/dist/schemas/project-schema/v3.34.0.json +0 -2715
- package/dist/schemas/project-schema/v3.35.0.json +0 -2748
- package/dist/schemas/project-schema/v3.36.0.json +0 -2756
- package/dist/schemas/project-schema/v3.37.0.json +0 -2821
- package/dist/schemas/project-schema/v3.38.0.json +0 -2819
- package/dist/schemas/project-schema/v3.39.0.json +0 -2827
- package/dist/schemas/project-schema/v3.4.0.json +0 -571
- package/dist/schemas/project-schema/v3.40.0.json +0 -2830
- package/dist/schemas/project-schema/v3.41.0.json +0 -2830
- package/dist/schemas/project-schema/v3.42.0.json +0 -2835
- package/dist/schemas/project-schema/v3.43.0.json +0 -2841
- package/dist/schemas/project-schema/v3.44.0.json +0 -3013
- package/dist/schemas/project-schema/v3.45.0.json +0 -3064
- package/dist/schemas/project-schema/v3.46.0.json +0 -3136
- package/dist/schemas/project-schema/v3.47.0.json +0 -3189
- package/dist/schemas/project-schema/v3.48.0.json +0 -3196
- package/dist/schemas/project-schema/v3.49.0.json +0 -3239
- package/dist/schemas/project-schema/v3.5.0.json +0 -571
- package/dist/schemas/project-schema/v3.5.1.json +0 -571
- package/dist/schemas/project-schema/v3.50.0.json +0 -3320
- package/dist/schemas/project-schema/v3.51.0.json +0 -3326
- package/dist/schemas/project-schema/v3.52.0.json +0 -3326
- package/dist/schemas/project-schema/v3.53.0.json +0 -3476
- package/dist/schemas/project-schema/v3.54.0.json +0 -3512
- package/dist/schemas/project-schema/v3.55.0.json +0 -3515
- package/dist/schemas/project-schema/v3.56.0.json +0 -3530
- package/dist/schemas/project-schema/v3.57.0.json +0 -4815
- package/dist/schemas/project-schema/v3.58.0.json +0 -4815
- package/dist/schemas/project-schema/v3.59.0.json +0 -4846
- package/dist/schemas/project-schema/v3.6.0.json +0 -587
- package/dist/schemas/project-schema/v3.7.0.json +0 -587
- package/dist/schemas/project-schema/v3.8.0.json +0 -604
- package/dist/schemas/project-schema/v3.9.0.json +0 -604
- package/dist/schemas/project-schema/v4.0.0.json +0 -2316
- package/dist/schemas/project-schema.json +0 -214
- package/dist/service-dependencies.d.ts +0 -13
- package/dist/service-dependencies.js +0 -165
- package/dist/services/services.d.ts +0 -31
- package/dist/services/services.js +0 -145
- package/dist/services/types.d.ts +0 -11
- package/dist/services/types.js +0 -1
- package/dist/services/util.d.ts +0 -16
- package/dist/services/util.js +0 -36
- package/dist/shape-paths.d.ts +0 -7
- package/dist/shape-paths.js +0 -28
- package/dist/taxonomies.d.ts +0 -15
- package/dist/taxonomies.js +0 -24
- package/dist/template-shapes/index.d.ts +0 -7
- package/dist/template-shapes/index.js +0 -33
- package/dist/template-shapes/names.d.ts +0 -10
- package/dist/template-shapes/names.js +0 -21
- package/dist/template-shapes/templates.d.ts +0 -32
- package/dist/template-shapes/templates.js +0 -316
- package/dist/template-shapes/types.d.ts +0 -15
- package/dist/template-shapes/types.js +0 -7
- package/dist/template-shapes/where.d.ts +0 -37
- package/dist/template-shapes/where.js +0 -400
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.js +0 -2
- package/dist/types/transforms.d.ts +0 -15
- package/dist/types/transforms.js +0 -1
- package/dist/types/types.d.ts +0 -200
- package/dist/types/types.js +0 -10
- package/dist/types/utils.d.ts +0 -112
- package/dist/types/utils.js +0 -269
- package/dist/unions.d.ts +0 -14
- package/dist/unions.js +0 -77
- package/dist/util/ai-tools.d.ts +0 -2
- package/dist/util/ai-tools.js +0 -14
- package/dist/util/api-indexing.d.ts +0 -9
- package/dist/util/api-indexing.js +0 -57
- package/dist/util/coerce-value.d.ts +0 -9
- package/dist/util/coerce-value.js +0 -32
- package/dist/util/detect-cycles.d.ts +0 -7
- package/dist/util/detect-cycles.js +0 -45
- package/dist/util/expressions.d.ts +0 -34
- package/dist/util/expressions.js +0 -350
- package/dist/util/find-shape-at-path.d.ts +0 -21
- package/dist/util/find-shape-at-path.js +0 -53
- package/dist/util/form-config.d.ts +0 -11
- package/dist/util/form-config.js +0 -62
- package/dist/util/get-conflicting-properties.d.ts +0 -6
- package/dist/util/get-conflicting-properties.js +0 -55
- package/dist/util/get-return-shape.d.ts +0 -4
- package/dist/util/get-return-shape.js +0 -30
- package/dist/util/has-arg.d.ts +0 -6
- package/dist/util/has-arg.js +0 -25
- package/dist/util/is-asset-property.d.ts +0 -3
- package/dist/util/is-asset-property.js +0 -11
- package/dist/util/mcp.d.ts +0 -8
- package/dist/util/mcp.js +0 -21
- package/dist/util/merge.d.ts +0 -15
- package/dist/util/merge.js +0 -254
- package/dist/util/patch-schema.d.ts +0 -8
- package/dist/util/patch-schema.js +0 -51
- package/dist/util/query-field-path.d.ts +0 -9
- package/dist/util/query-field-path.js +0 -23
- package/dist/util/shapes.d.ts +0 -5
- package/dist/util/shapes.js +0 -22
- package/dist/validate/ai.d.ts +0 -6
- package/dist/validate/ai.js +0 -183
- package/dist/validate/errors.d.ts +0 -3
- package/dist/validate/errors.js +0 -20
- package/dist/validate/types.d.ts +0 -1
- package/dist/validate/types.js +0 -1
- package/dist/validate/util.d.ts +0 -3
- package/dist/validate/util.js +0 -28
- package/dist/validate/validate.d.ts +0 -80
- package/dist/validate/validate.js +0 -1058
- package/dist/versions.d.ts +0 -4
- package/dist/versions.js +0 -4
- package/dist/workflows.d.ts +0 -14
- package/dist/workflows.js +0 -66
package/dist/schema-util.js
DELETED
|
@@ -1,1127 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_ENTITLEMENTS, deepClone, ensureArray, pascalCase, visit } from '@takeshape/util';
|
|
2
|
-
import curry from 'lodash/fp/curry.js';
|
|
3
|
-
import orderBy from 'lodash/fp/orderBy.js';
|
|
4
|
-
import isArray from 'lodash/isArray.js';
|
|
5
|
-
import isString from 'lodash/isString.js';
|
|
6
|
-
import keyBy from 'lodash/keyBy.js';
|
|
7
|
-
import mapValues from 'lodash/mapValues.js';
|
|
8
|
-
import uniq from 'lodash/uniq.js';
|
|
9
|
-
import { AGENTS_SCHEMA_PATH, getAgentMap } from './agents.js';
|
|
10
|
-
import { workflowsEnabled } from "./api-version.js";
|
|
11
|
-
import { allBuiltInShapes, getBuiltInForms, getBuiltInShapes } from "./builtin-schema.js";
|
|
12
|
-
import { SERVICE_OBJECT_PATTERN_NAME } from "./constants.js";
|
|
13
|
-
import { createTemplateShapeName, dereferenceObjectSchema, dereferenceSchema, getRef, getRefOrItemsRef, getRefShapeName, isValidRefItem, parseRef, parseReturnShape, refItemToNamespacedShapeName, refItemToShape, refItemToShapeSchema, refToRefItem, returnShapeToSchema, serializePropertyRef } from "./refs.js";
|
|
14
|
-
import { getArgsType, isAllOfSchema, isArraySchema, isCachedShape, isExtendsSchema, isGraphqlResolver, isModelShape, isObjectSchema, isOneOfSchema, isReferenceableShape, isRefSchema } from "./types/index.js";
|
|
15
|
-
import { isUnionSchema } from "./unions.js";
|
|
16
|
-
import { getArgs } from "./util/has-arg.js";
|
|
17
|
-
import { mergeFormProperties, mergeSchemaProperties } from "./util/merge.js";
|
|
18
|
-
import { CURRENT_API_VERSION, CURRENT_SCHEMA_VERSION } from "./versions.js";
|
|
19
|
-
import { defaultWorkflow, getStatusField } from "./workflows.js";
|
|
20
|
-
export function isBuiltinShape(ref) {
|
|
21
|
-
const parsed = parseRef({}, ref);
|
|
22
|
-
return Boolean(parsed.layerId === 'local' && allBuiltInShapes[parsed.shapeName]);
|
|
23
|
-
}
|
|
24
|
-
const builtInQueriesAndMutations = getShapeQueriesAndMutations(Object.values(allBuiltInShapes));
|
|
25
|
-
export function isBuiltinQuery(name) {
|
|
26
|
-
return builtInQueriesAndMutations.queries[name] !== undefined;
|
|
27
|
-
}
|
|
28
|
-
export function isBuiltinMutation(name) {
|
|
29
|
-
return builtInQueriesAndMutations.mutations[name] !== undefined;
|
|
30
|
-
}
|
|
31
|
-
export function isBuiltinType(projectSchema, refSchema) {
|
|
32
|
-
const shapeName = getRefShapeName(projectSchema, refSchema);
|
|
33
|
-
return shapeName !== undefined && isBuiltinShape(shapeName);
|
|
34
|
-
}
|
|
35
|
-
export const schemaMetadataKeys = [
|
|
36
|
-
'$comment',
|
|
37
|
-
'title',
|
|
38
|
-
'description',
|
|
39
|
-
'@l10n',
|
|
40
|
-
'@deprecationReason',
|
|
41
|
-
'@tag',
|
|
42
|
-
'@tags',
|
|
43
|
-
'@syncLocaleStructure',
|
|
44
|
-
'@sensitive'
|
|
45
|
-
];
|
|
46
|
-
export const commonSchemaKeys = ['type', 'default', 'readOnly', ...schemaMetadataKeys];
|
|
47
|
-
export const scalarSchemaKeys = [
|
|
48
|
-
...commonSchemaKeys,
|
|
49
|
-
'format',
|
|
50
|
-
'oneOf',
|
|
51
|
-
'multipleOf',
|
|
52
|
-
'maximum',
|
|
53
|
-
'exclusiveMaximum',
|
|
54
|
-
'minimum',
|
|
55
|
-
'exclusiveMinimum',
|
|
56
|
-
'maxLength',
|
|
57
|
-
'minLength',
|
|
58
|
-
'pattern'
|
|
59
|
-
];
|
|
60
|
-
export const objectSchemaKeys = [...commonSchemaKeys, 'properties', 'required'];
|
|
61
|
-
export const arraySchemaKeys = [
|
|
62
|
-
...commonSchemaKeys,
|
|
63
|
-
'items',
|
|
64
|
-
'additionalItems',
|
|
65
|
-
'maxItems',
|
|
66
|
-
'minItems',
|
|
67
|
-
'uniqueItems'
|
|
68
|
-
];
|
|
69
|
-
export const multipleRelationshipSchemaKeys = [...schemaMetadataKeys, 'maxItems', 'minItems'];
|
|
70
|
-
// All properties except properties, items, additionalItems
|
|
71
|
-
export const nonStructuralSchemaKeys = [
|
|
72
|
-
...scalarSchemaKeys,
|
|
73
|
-
'@resolver',
|
|
74
|
-
'@input',
|
|
75
|
-
'@output',
|
|
76
|
-
'@backreference',
|
|
77
|
-
'@args',
|
|
78
|
-
'required',
|
|
79
|
-
'maxItems',
|
|
80
|
-
'minItems',
|
|
81
|
-
'uniqueItems'
|
|
82
|
-
];
|
|
83
|
-
export function getServiceIdFieldName(serviceFieldName) {
|
|
84
|
-
return `${serviceFieldName}Id`;
|
|
85
|
-
}
|
|
86
|
-
const generatorVersions = {
|
|
87
|
-
[SERVICE_OBJECT_PATTERN_NAME]: '1'
|
|
88
|
-
};
|
|
89
|
-
export function getGeneratorVersion(generator) {
|
|
90
|
-
return generatorVersions[generator];
|
|
91
|
-
}
|
|
92
|
-
// Follow refs to find the path between two shapes in a schema
|
|
93
|
-
export function pathBetween(fromShape, toShape, projectSchema, depthLimit = 4) {
|
|
94
|
-
if (fromShape.name === toShape.name) {
|
|
95
|
-
return [];
|
|
96
|
-
}
|
|
97
|
-
const toShapeName = toShape.name;
|
|
98
|
-
let shortestPath;
|
|
99
|
-
let shortestPathLength = Number.MAX_SAFE_INTEGER;
|
|
100
|
-
const pathBetweenHelper = (schema, pathSoFar, seen, depth) => {
|
|
101
|
-
if (depth > depthLimit) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
if (schema.items) {
|
|
105
|
-
pathBetweenHelper(schema.items, pathSoFar, seen, depth);
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
const refItem = getRef(projectSchema, schema);
|
|
109
|
-
if (refItem) {
|
|
110
|
-
const referenced = refItemToShape(projectSchema, refItem);
|
|
111
|
-
if (referenced) {
|
|
112
|
-
if (referenced.name === toShapeName && pathSoFar.length < shortestPathLength) {
|
|
113
|
-
shortestPath = pathSoFar;
|
|
114
|
-
shortestPathLength = pathSoFar.length;
|
|
115
|
-
}
|
|
116
|
-
else if (!seen.has(referenced.name)) {
|
|
117
|
-
pathBetweenHelper(referenced.schema, pathSoFar, new Set([...seen, referenced.name]), depth);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
else if (pathSoFar.length + 1 < shortestPathLength && (schema.oneOf ?? schema.allOf ?? schema.properties)) {
|
|
122
|
-
if (schema.oneOf) {
|
|
123
|
-
for (const itemSchema of schema.oneOf) {
|
|
124
|
-
pathBetweenHelper(itemSchema, pathSoFar, seen, depth);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
for (const [propName, propSchema] of createSchemaPropertyList(projectSchema, schema).getNodes()) {
|
|
129
|
-
pathBetweenHelper(propSchema, pathSoFar.concat(String(propName)), seen, depth + 1);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
pathBetweenHelper(fromShape.schema, [], new Set([fromShape.name]), 0);
|
|
135
|
-
if (!shortestPath) {
|
|
136
|
-
throw new Error(`No path between ${fromShape.name} and ${toShape.name}`);
|
|
137
|
-
}
|
|
138
|
-
return shortestPath;
|
|
139
|
-
}
|
|
140
|
-
export function getShapeQueriesAndMutations(shapes) {
|
|
141
|
-
const queries = {};
|
|
142
|
-
const mutations = {};
|
|
143
|
-
for (const shape of ensureArray(shapes)) {
|
|
144
|
-
const { name, model } = shape;
|
|
145
|
-
const service = 'shapedb';
|
|
146
|
-
if (model) {
|
|
147
|
-
const isSingleton = model.type === 'single';
|
|
148
|
-
queries[`get${name}`] = {
|
|
149
|
-
shape: name,
|
|
150
|
-
resolver: {
|
|
151
|
-
name: 'shapedb:get',
|
|
152
|
-
service,
|
|
153
|
-
shapeName: name
|
|
154
|
-
},
|
|
155
|
-
description: `Get a ${name} by ID`,
|
|
156
|
-
args: isSingleton
|
|
157
|
-
? createTemplateShapeName('TSGetSingletonArgs', name)
|
|
158
|
-
: createTemplateShapeName('TSGetArgs', name)
|
|
159
|
-
};
|
|
160
|
-
mutations[`update${name}`] = {
|
|
161
|
-
shape: createTemplateShapeName('UpdateResult', name),
|
|
162
|
-
resolver: {
|
|
163
|
-
name: 'shapedb:update',
|
|
164
|
-
service,
|
|
165
|
-
shapeName: name
|
|
166
|
-
},
|
|
167
|
-
description: `Update ${name}`,
|
|
168
|
-
args: createTemplateShapeName('UpdateArgs', name)
|
|
169
|
-
};
|
|
170
|
-
if (!isSingleton) {
|
|
171
|
-
queries[`get${name}List`] = {
|
|
172
|
-
shape: createTemplateShapeName('PaginatedList', name),
|
|
173
|
-
resolver: {
|
|
174
|
-
name: 'shapedb:list',
|
|
175
|
-
service,
|
|
176
|
-
shapeName: name
|
|
177
|
-
},
|
|
178
|
-
description: `Returns a list ${name} in natural order.`,
|
|
179
|
-
args: createTemplateShapeName('TSListArgs', name)
|
|
180
|
-
};
|
|
181
|
-
mutations[`create${name}`] = {
|
|
182
|
-
shape: createTemplateShapeName('CreateResult', name),
|
|
183
|
-
resolver: {
|
|
184
|
-
name: 'shapedb:create',
|
|
185
|
-
service,
|
|
186
|
-
shapeName: name
|
|
187
|
-
},
|
|
188
|
-
description: `Create ${name}`,
|
|
189
|
-
args: createTemplateShapeName('CreateArgs', name)
|
|
190
|
-
};
|
|
191
|
-
mutations[`duplicate${name}`] = {
|
|
192
|
-
shape: createTemplateShapeName('DuplicateResult', name),
|
|
193
|
-
resolver: {
|
|
194
|
-
name: 'shapedb:duplicate',
|
|
195
|
-
service,
|
|
196
|
-
shapeName: name
|
|
197
|
-
},
|
|
198
|
-
description: `Duplicate ${name}`,
|
|
199
|
-
args: createTemplateShapeName('DuplicateArgs', name)
|
|
200
|
-
};
|
|
201
|
-
mutations[`delete${name}`] = {
|
|
202
|
-
shape: createTemplateShapeName('DeleteResult', name),
|
|
203
|
-
resolver: {
|
|
204
|
-
name: 'shapedb:delete',
|
|
205
|
-
service,
|
|
206
|
-
shapeName: name
|
|
207
|
-
},
|
|
208
|
-
description: `Delete ${name}`,
|
|
209
|
-
args: createTemplateShapeName('DeleteArgs', name)
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
return { queries, mutations };
|
|
215
|
-
}
|
|
216
|
-
export function getCommonBuiltInProperties(shape) {
|
|
217
|
-
return {
|
|
218
|
-
_id: {
|
|
219
|
-
title: 'Id',
|
|
220
|
-
type: 'string'
|
|
221
|
-
},
|
|
222
|
-
_shapeId: {
|
|
223
|
-
type: 'string',
|
|
224
|
-
title: 'Shape Id',
|
|
225
|
-
enum: [shape.id]
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
export const DEFAULT_ID_FIELD = 'id';
|
|
230
|
-
export function getIdField(obj) {
|
|
231
|
-
return obj?.idField ?? DEFAULT_ID_FIELD;
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Get properties necessary for cached / remote data to work with the TSSearchable interface.
|
|
235
|
-
*/
|
|
236
|
-
function getCachedBuiltInProperties(shape, properties) {
|
|
237
|
-
const idField = getIdField(shape.cache);
|
|
238
|
-
// TODO Implement `searchSummary` and `_shapeId` here, and remove `getRemoteShapeTSSearchableFields`
|
|
239
|
-
return {
|
|
240
|
-
_id: {
|
|
241
|
-
title: 'Id',
|
|
242
|
-
type: 'string',
|
|
243
|
-
...properties._id,
|
|
244
|
-
...(properties[idField]?.['@mapping'] ? { '@mapping': properties[idField]['@mapping'] } : {})
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
export function getModelBuiltInProperties(projectSchema, shape) {
|
|
249
|
-
const apiVersion = projectSchema.apiVersion ?? CURRENT_API_VERSION;
|
|
250
|
-
const showDeprecationReason = apiVersion !== '1';
|
|
251
|
-
const properties = {
|
|
252
|
-
_version: {
|
|
253
|
-
title: 'Version',
|
|
254
|
-
type: 'integer'
|
|
255
|
-
},
|
|
256
|
-
_shapeName: {
|
|
257
|
-
title: 'Shape Name',
|
|
258
|
-
type: 'string'
|
|
259
|
-
},
|
|
260
|
-
_createdAt: {
|
|
261
|
-
title: 'Created',
|
|
262
|
-
type: 'string',
|
|
263
|
-
format: 'date-time'
|
|
264
|
-
},
|
|
265
|
-
_createdBy: {
|
|
266
|
-
title: 'Created By',
|
|
267
|
-
'@ref': 'local:TSUser',
|
|
268
|
-
'@input': {
|
|
269
|
-
type: 'string'
|
|
270
|
-
},
|
|
271
|
-
'@resolver': {
|
|
272
|
-
name: 'takeshape:getUser',
|
|
273
|
-
service: 'takeshape'
|
|
274
|
-
}
|
|
275
|
-
},
|
|
276
|
-
_updatedAt: {
|
|
277
|
-
title: 'Updated',
|
|
278
|
-
type: 'string',
|
|
279
|
-
format: 'date-time'
|
|
280
|
-
},
|
|
281
|
-
_updatedBy: {
|
|
282
|
-
title: 'Updated By',
|
|
283
|
-
'@ref': 'local:TSUser',
|
|
284
|
-
'@input': {
|
|
285
|
-
type: 'string'
|
|
286
|
-
},
|
|
287
|
-
'@resolver': {
|
|
288
|
-
name: 'takeshape:getUser',
|
|
289
|
-
service: 'takeshape'
|
|
290
|
-
}
|
|
291
|
-
},
|
|
292
|
-
_schemaVersion: {
|
|
293
|
-
title: 'Schema Version',
|
|
294
|
-
type: 'number'
|
|
295
|
-
},
|
|
296
|
-
_enabled: {
|
|
297
|
-
title: 'Enabled',
|
|
298
|
-
type: 'boolean',
|
|
299
|
-
...(showDeprecationReason ? { '@deprecationReason': 'Use _status instead' } : {})
|
|
300
|
-
},
|
|
301
|
-
_enabledAt: {
|
|
302
|
-
title: 'Enabled Date',
|
|
303
|
-
type: 'string',
|
|
304
|
-
format: 'date-time',
|
|
305
|
-
...(showDeprecationReason ? { '@deprecationReason': 'Use a custom date field instead' } : {})
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
if (workflowsEnabled(apiVersion)) {
|
|
309
|
-
return {
|
|
310
|
-
...properties,
|
|
311
|
-
_status: {
|
|
312
|
-
...(projectSchema.workflows && getStatusField(projectSchema.workflows, shape))
|
|
313
|
-
}
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
return properties;
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* Return all the built in property names,
|
|
320
|
-
*/
|
|
321
|
-
export function getBuiltInPropertyNames(profile = BuiltInPropertiesProfile.Model) {
|
|
322
|
-
const fakeShape = {
|
|
323
|
-
id: 'shape-id'
|
|
324
|
-
};
|
|
325
|
-
let keys = [...Object.keys(getCommonBuiltInProperties(fakeShape))];
|
|
326
|
-
if (profile === BuiltInPropertiesProfile.Model) {
|
|
327
|
-
keys = [...keys, ...Object.keys(getModelBuiltInProperties({}, fakeShape))];
|
|
328
|
-
}
|
|
329
|
-
return new Set(keys);
|
|
330
|
-
}
|
|
331
|
-
export var BuiltInPropertiesProfile;
|
|
332
|
-
(function (BuiltInPropertiesProfile) {
|
|
333
|
-
BuiltInPropertiesProfile[BuiltInPropertiesProfile["Model"] = 0] = "Model";
|
|
334
|
-
BuiltInPropertiesProfile[BuiltInPropertiesProfile["Cached"] = 1] = "Cached";
|
|
335
|
-
BuiltInPropertiesProfile[BuiltInPropertiesProfile["None"] = 2] = "None";
|
|
336
|
-
})(BuiltInPropertiesProfile || (BuiltInPropertiesProfile = {}));
|
|
337
|
-
const BUILT_IN_PROPERTY_NAMES = {
|
|
338
|
-
[BuiltInPropertiesProfile.Model]: getBuiltInPropertyNames(BuiltInPropertiesProfile.Model),
|
|
339
|
-
[BuiltInPropertiesProfile.Cached]: getBuiltInPropertyNames(BuiltInPropertiesProfile.Cached),
|
|
340
|
-
[BuiltInPropertiesProfile.None]: getBuiltInPropertyNames(BuiltInPropertiesProfile.None)
|
|
341
|
-
};
|
|
342
|
-
export const isBuiltInPropertyName = (name, profile = BuiltInPropertiesProfile.Model) => {
|
|
343
|
-
return BUILT_IN_PROPERTY_NAMES[profile].has(name);
|
|
344
|
-
};
|
|
345
|
-
/**
|
|
346
|
-
* Get the profile to use for loading built-in properties
|
|
347
|
-
*/
|
|
348
|
-
function getBuiltInPropertiesProfile(shape) {
|
|
349
|
-
if (isModelShape(shape)) {
|
|
350
|
-
return BuiltInPropertiesProfile.Model;
|
|
351
|
-
}
|
|
352
|
-
if (isCachedShape(shape) || isReferenceableShape(shape)) {
|
|
353
|
-
return BuiltInPropertiesProfile.Cached;
|
|
354
|
-
}
|
|
355
|
-
return BuiltInPropertiesProfile.None;
|
|
356
|
-
}
|
|
357
|
-
export function applyBuiltinPropertiesToShape(projectSchema, shape) {
|
|
358
|
-
const profile = getBuiltInPropertiesProfile(shape);
|
|
359
|
-
if (profile === BuiltInPropertiesProfile.None) {
|
|
360
|
-
return shape;
|
|
361
|
-
}
|
|
362
|
-
const shapeObjectSchema = dereferenceObjectSchema(projectSchema, shape.schema, ['shapes', shape.name]);
|
|
363
|
-
const { properties } = shapeObjectSchema;
|
|
364
|
-
const commonProperties = getCommonBuiltInProperties(shape);
|
|
365
|
-
const modelProperties = profile === BuiltInPropertiesProfile.Model ? getModelBuiltInProperties(projectSchema, shape) : undefined;
|
|
366
|
-
const cachedProperties = profile === BuiltInPropertiesProfile.Cached ? getCachedBuiltInProperties(shape, properties) : undefined;
|
|
367
|
-
return {
|
|
368
|
-
...shape,
|
|
369
|
-
schema: {
|
|
370
|
-
...shapeObjectSchema,
|
|
371
|
-
properties: {
|
|
372
|
-
...properties,
|
|
373
|
-
...commonProperties,
|
|
374
|
-
...modelProperties,
|
|
375
|
-
...cachedProperties
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
};
|
|
379
|
-
}
|
|
380
|
-
// Dependencies of these built-in shapes are automatically added by getBuiltinsUsed
|
|
381
|
-
const requiredBuiltinShapes = ['Asset', 'TSRelationship', 'TSStaticSite', 'TSUser'];
|
|
382
|
-
/**
|
|
383
|
-
* Get all built-in shapes that are depended on by the given project schema.
|
|
384
|
-
* Required built-in shapes are always included.
|
|
385
|
-
*/
|
|
386
|
-
export function getBuiltinsUsed(builtInShapes, projectSchema) {
|
|
387
|
-
const builtinsUsed = {};
|
|
388
|
-
const shapeNames = uniq(requiredBuiltinShapes.concat(getAllRefs(projectSchema, (refItem) => refItem.layerId === 'local' && isBuiltinShape(refItem.shapeName)).map((ref) => refItemToNamespacedShapeName(projectSchema, ref))));
|
|
389
|
-
const schemaWithAllBuiltins = {
|
|
390
|
-
...emptySchema('project-id'),
|
|
391
|
-
shapes: builtInShapes
|
|
392
|
-
};
|
|
393
|
-
for (const builtinShapeName of shapeNames) {
|
|
394
|
-
if (builtInShapes[builtinShapeName]) {
|
|
395
|
-
builtinsUsed[builtinShapeName] = builtInShapes[builtinShapeName];
|
|
396
|
-
for (const depShapeName of getShapeDependencies(schemaWithAllBuiltins, builtInShapes[builtinShapeName])) {
|
|
397
|
-
builtinsUsed[depShapeName] = builtInShapes[depShapeName];
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
return builtinsUsed;
|
|
402
|
-
}
|
|
403
|
-
export function applyDefaultsToSchema(projectSchema, options) {
|
|
404
|
-
const optionsWithDefaults = {
|
|
405
|
-
entitlements: DEFAULT_ENTITLEMENTS,
|
|
406
|
-
...options
|
|
407
|
-
};
|
|
408
|
-
const builtInShapes = getBuiltInShapes(optionsWithDefaults);
|
|
409
|
-
const builtinsUsed = getBuiltinsUsed(builtInShapes, projectSchema);
|
|
410
|
-
const builtInQueriesAndMutations = getShapeQueriesAndMutations(Object.values(builtInShapes));
|
|
411
|
-
const builtInForms = getBuiltInForms(optionsWithDefaults);
|
|
412
|
-
return {
|
|
413
|
-
...projectSchema,
|
|
414
|
-
workflows: {
|
|
415
|
-
...projectSchema.workflows,
|
|
416
|
-
...(workflowsEnabled(projectSchema.apiVersion) && {
|
|
417
|
-
default: defaultWorkflow
|
|
418
|
-
})
|
|
419
|
-
},
|
|
420
|
-
queries: {
|
|
421
|
-
...builtInQueriesAndMutations.queries,
|
|
422
|
-
...projectSchema.queries
|
|
423
|
-
},
|
|
424
|
-
mutations: {
|
|
425
|
-
...builtInQueriesAndMutations.mutations,
|
|
426
|
-
...projectSchema.mutations
|
|
427
|
-
},
|
|
428
|
-
shapes: mapValues({ ...builtinsUsed, ...projectSchema.shapes }, (shape) => {
|
|
429
|
-
const builtInShape = builtinsUsed[shape.name];
|
|
430
|
-
if (builtInShape && builtInShape !== shape) {
|
|
431
|
-
shape = {
|
|
432
|
-
...shape,
|
|
433
|
-
schema: mergeSchemaProperties(dereferenceObjectSchema(projectSchema, shape.schema), dereferenceObjectSchema(projectSchema, builtInShape.schema))
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
|
-
return applyBuiltinPropertiesToShape(projectSchema, shape);
|
|
437
|
-
}),
|
|
438
|
-
forms: mapValues({ ...builtInForms, ...projectSchema.forms }, (formsConfig, shapeName) => {
|
|
439
|
-
const builtInFormsConfig = builtInForms[shapeName];
|
|
440
|
-
if (builtInFormsConfig && builtInFormsConfig !== formsConfig) {
|
|
441
|
-
formsConfig = {
|
|
442
|
-
...formsConfig,
|
|
443
|
-
default: mergeFormProperties(formsConfig.default, builtInFormsConfig.default)
|
|
444
|
-
};
|
|
445
|
-
}
|
|
446
|
-
return formsConfig;
|
|
447
|
-
})
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
export function getArgsReference(projectSchema, argsSchema) {
|
|
451
|
-
const args = getArgs(argsSchema);
|
|
452
|
-
if (args && typeof args === 'string') {
|
|
453
|
-
// @args: ShapeName OR Namespace_TypeName
|
|
454
|
-
return parseRef(projectSchema, args);
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
export function getArgsReferenceWithPath(context, argsSchema, schemaPath = []) {
|
|
458
|
-
const refItem = getArgsReference(context, argsSchema);
|
|
459
|
-
if (refItem) {
|
|
460
|
-
const argsType = getArgsType(argsSchema);
|
|
461
|
-
return {
|
|
462
|
-
...refItem,
|
|
463
|
-
path: schemaPath.concat([argsType])
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
export function getArgsShapeSchema(context, argsSchema) {
|
|
468
|
-
const args = getArgs(argsSchema);
|
|
469
|
-
if (args) {
|
|
470
|
-
if (typeof args === 'string') {
|
|
471
|
-
const refItem = getArgsReference(context, argsSchema);
|
|
472
|
-
if (refItem) {
|
|
473
|
-
return refItemToShapeSchema(context, refItem);
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
else {
|
|
477
|
-
return args;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
const createShapeToPropertySchema = (projectSchema, definitions, definitionNames, { useShapeIdDiscriminator, additionalProperties }) => {
|
|
482
|
-
const rewriteRefs = (shape) => {
|
|
483
|
-
const handleSchema = (propSchema) => {
|
|
484
|
-
// Unwrap array schema
|
|
485
|
-
propSchema = propSchema.items ?? propSchema;
|
|
486
|
-
if (isOneOfSchema(propSchema)) {
|
|
487
|
-
const isUnion = isUnionSchema(propSchema);
|
|
488
|
-
if (useShapeIdDiscriminator && isUnion) {
|
|
489
|
-
propSchema.discriminator = {
|
|
490
|
-
propertyName: '_shapeId'
|
|
491
|
-
};
|
|
492
|
-
propSchema.required = ['_shapeId'];
|
|
493
|
-
}
|
|
494
|
-
for (const schema of propSchema.oneOf) {
|
|
495
|
-
handleSchema(schema);
|
|
496
|
-
}
|
|
497
|
-
return;
|
|
498
|
-
}
|
|
499
|
-
// Add workflow validation
|
|
500
|
-
if (propSchema['@workflow']) {
|
|
501
|
-
const workflowName = propSchema['@workflow'];
|
|
502
|
-
const workflow = projectSchema.workflows[workflowName] || defaultWorkflow;
|
|
503
|
-
propSchema.oneOf = workflow.steps.map((step) => ({
|
|
504
|
-
enum: [step.key, step.name],
|
|
505
|
-
title: step.title
|
|
506
|
-
}));
|
|
507
|
-
}
|
|
508
|
-
const refItem = getRef(projectSchema, propSchema);
|
|
509
|
-
if (refItem) {
|
|
510
|
-
const shapeName = refItemToNamespacedShapeName(projectSchema, refItem);
|
|
511
|
-
const shape = refItemToShape(projectSchema, refItem);
|
|
512
|
-
if (shape) {
|
|
513
|
-
delete propSchema['@ref'];
|
|
514
|
-
propSchema.$ref = `#/definitions/${shapeName}`;
|
|
515
|
-
if (!definitionNames.has(shapeName)) {
|
|
516
|
-
definitionNames.add(shapeName);
|
|
517
|
-
const rewritten = rewriteRefs(shape);
|
|
518
|
-
if (isObjectSchema(rewritten)) {
|
|
519
|
-
if (useShapeIdDiscriminator) {
|
|
520
|
-
rewritten.properties._shapeId = {
|
|
521
|
-
type: 'string',
|
|
522
|
-
enum: [shape.id]
|
|
523
|
-
};
|
|
524
|
-
}
|
|
525
|
-
if (additionalProperties !== undefined) {
|
|
526
|
-
rewritten.additionalProperties = additionalProperties;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
definitions[shapeName] = rewritten;
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
};
|
|
534
|
-
const shapeSchema = deepClone(shape.schema);
|
|
535
|
-
if (isOneOfSchema(shapeSchema)) {
|
|
536
|
-
handleSchema(shapeSchema);
|
|
537
|
-
return shapeSchema;
|
|
538
|
-
}
|
|
539
|
-
if (shapeSchema.enum) {
|
|
540
|
-
return shapeSchema;
|
|
541
|
-
}
|
|
542
|
-
// An empty object schema is valid, allowing anything, but will fail dereferencing
|
|
543
|
-
if (!Object.keys(shapeSchema).length) {
|
|
544
|
-
return shapeSchema;
|
|
545
|
-
}
|
|
546
|
-
const shapeSchemaCopy = dereferenceObjectSchema(projectSchema, shapeSchema);
|
|
547
|
-
if (shape.title) {
|
|
548
|
-
shapeSchemaCopy.title = shape.title;
|
|
549
|
-
}
|
|
550
|
-
for (const schema of Object.values(shapeSchemaCopy.properties)) {
|
|
551
|
-
handleSchema(schema);
|
|
552
|
-
}
|
|
553
|
-
if (additionalProperties !== undefined) {
|
|
554
|
-
shapeSchemaCopy.additionalProperties = additionalProperties;
|
|
555
|
-
}
|
|
556
|
-
return shapeSchemaCopy;
|
|
557
|
-
};
|
|
558
|
-
return rewriteRefs;
|
|
559
|
-
};
|
|
560
|
-
export function shapeToPropertySchema(projectSchema, shape) {
|
|
561
|
-
const definitions = {};
|
|
562
|
-
const definitionNames = new Set();
|
|
563
|
-
const convert = createShapeToPropertySchema(projectSchema, definitions, definitionNames, {
|
|
564
|
-
useShapeIdDiscriminator: true
|
|
565
|
-
});
|
|
566
|
-
return {
|
|
567
|
-
...convert(shape),
|
|
568
|
-
definitions
|
|
569
|
-
};
|
|
570
|
-
}
|
|
571
|
-
/**
|
|
572
|
-
* Currently this is not 100% valid JSON schema, but its output can be used with createSchemaValidator
|
|
573
|
-
*/
|
|
574
|
-
export function shapeToJsonSchema(projectSchema, shape) {
|
|
575
|
-
const definitions = {};
|
|
576
|
-
const definitionNames = new Set();
|
|
577
|
-
const convert = createShapeToPropertySchema(projectSchema, definitions, definitionNames, {
|
|
578
|
-
useShapeIdDiscriminator: false,
|
|
579
|
-
additionalProperties: false
|
|
580
|
-
});
|
|
581
|
-
return {
|
|
582
|
-
$id: shape.id,
|
|
583
|
-
...convert(shape),
|
|
584
|
-
definitions
|
|
585
|
-
};
|
|
586
|
-
}
|
|
587
|
-
export function projectSchemaToJSONSchema(projectSchema) {
|
|
588
|
-
const definitions = {};
|
|
589
|
-
const definitionNames = new Set();
|
|
590
|
-
const convert = createShapeToPropertySchema(projectSchema, definitions, definitionNames, {
|
|
591
|
-
useShapeIdDiscriminator: false
|
|
592
|
-
});
|
|
593
|
-
for (const shape of Object.values(projectSchema.shapes)) {
|
|
594
|
-
definitions[shape.name] = convert(shape);
|
|
595
|
-
definitionNames.add(shape.name);
|
|
596
|
-
}
|
|
597
|
-
return {
|
|
598
|
-
definitions
|
|
599
|
-
};
|
|
600
|
-
}
|
|
601
|
-
export function getShapeDependencies(projectSchema, shape, predicate) {
|
|
602
|
-
const shapeNames = new Set();
|
|
603
|
-
const findDependencies = (schema) => {
|
|
604
|
-
const shouldFollow = Boolean(!predicate || predicate(schema));
|
|
605
|
-
if (shouldFollow) {
|
|
606
|
-
const refItem = getRef(projectSchema, schema);
|
|
607
|
-
if (refItem) {
|
|
608
|
-
const refShape = refItemToShape(projectSchema, refItem);
|
|
609
|
-
if (refShape && !shapeNames.has(refShape.name)) {
|
|
610
|
-
shapeNames.add(refShape.name);
|
|
611
|
-
findDependencies(dereferenceSchema(projectSchema, refShape.schema, ['shapes', refShape.name]));
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
else if (isObjectSchema(schema) ||
|
|
615
|
-
isAllOfSchema(schema) ||
|
|
616
|
-
isOneOfSchema(schema) ||
|
|
617
|
-
isExtendsSchema(schema) ||
|
|
618
|
-
isArraySchema(schema)) {
|
|
619
|
-
visitSchemaProperties(schema, [], findDependencies);
|
|
620
|
-
}
|
|
621
|
-
const args = schema['@args'];
|
|
622
|
-
if (args) {
|
|
623
|
-
findDependencies(typeof args === 'string' ? { '@ref': args } : args);
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
return shouldFollow;
|
|
627
|
-
};
|
|
628
|
-
findDependencies(shape.schema);
|
|
629
|
-
return [...shapeNames];
|
|
630
|
-
}
|
|
631
|
-
export function getRelevantShapes(projectSchema, params) {
|
|
632
|
-
const { shapeIds, shapeNames, byId = false, includeDependencies = true } = params;
|
|
633
|
-
if (Boolean(shapeNames?.length) || Boolean(shapeIds?.length)) {
|
|
634
|
-
const ids = new Set(shapeIds);
|
|
635
|
-
const names = new Set(shapeNames);
|
|
636
|
-
const shapes = {};
|
|
637
|
-
for (const shape of Object.values(projectSchema.shapes)) {
|
|
638
|
-
if (ids.has(shape.id) || names.has(shape.name)) {
|
|
639
|
-
const shapeNames = includeDependencies
|
|
640
|
-
? [shape.name].concat(getShapeDependencies(projectSchema, shape))
|
|
641
|
-
: [shape.name];
|
|
642
|
-
for (const shapeName of shapeNames) {
|
|
643
|
-
const dependentShape = projectSchema.shapes[shapeName];
|
|
644
|
-
shapes[byId ? dependentShape.id : dependentShape.name] = dependentShape;
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
return shapes;
|
|
649
|
-
}
|
|
650
|
-
return {};
|
|
651
|
-
}
|
|
652
|
-
export function visitSchemaProperties(root, path, callback) {
|
|
653
|
-
const visitEach = (entries, path) => {
|
|
654
|
-
for (const [name, propSchema] of entries) {
|
|
655
|
-
const newPath = [...path, name];
|
|
656
|
-
visit(propSchema, newPath);
|
|
657
|
-
}
|
|
658
|
-
};
|
|
659
|
-
const visit = (schema, path) => {
|
|
660
|
-
if (schema !== root && callback(schema, path) === false) {
|
|
661
|
-
return;
|
|
662
|
-
}
|
|
663
|
-
if (isArraySchema(schema)) {
|
|
664
|
-
visit(schema.items, [...path, 'items']);
|
|
665
|
-
}
|
|
666
|
-
else if (isObjectSchema(schema)) {
|
|
667
|
-
visitEach(Object.entries(schema.properties), [...path, 'properties']);
|
|
668
|
-
}
|
|
669
|
-
else if (isExtendsSchema(schema)) {
|
|
670
|
-
visitEach(Object.entries(schema.extends), [...path, 'extends']);
|
|
671
|
-
}
|
|
672
|
-
else if (isAllOfSchema(schema)) {
|
|
673
|
-
visitEach(Object.entries(schema.allOf), [...path, 'allOf']);
|
|
674
|
-
}
|
|
675
|
-
else if (isOneOfSchema(schema)) {
|
|
676
|
-
visitEach(Object.entries(schema.oneOf), [...path, 'oneOf']);
|
|
677
|
-
}
|
|
678
|
-
};
|
|
679
|
-
visit(root, path);
|
|
680
|
-
}
|
|
681
|
-
export function visitShapeProperties(shapes, callback) {
|
|
682
|
-
for (const [shapeName, shape] of Object.entries(shapes)) {
|
|
683
|
-
visitSchemaProperties(shape.schema, ['shapes', shapeName, 'schema'], callback);
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
function addRef(refs, ref, predicate) {
|
|
687
|
-
if (ref && (!predicate || predicate(ref))) {
|
|
688
|
-
refs.push(ref);
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
/**
|
|
692
|
-
* Walk through a `ProjectSchemaJSON` and collect all the `ref`s.
|
|
693
|
-
*/
|
|
694
|
-
export function getAllRefsInShapes(projectSchema, predicate) {
|
|
695
|
-
const items = [];
|
|
696
|
-
const refPropNames = ['$ref', '@ref', '@args', 'args', 'interfaces'];
|
|
697
|
-
visit(projectSchema.shapes, refPropNames, (interfaces, refPath) => {
|
|
698
|
-
const propName = refPath[refPath.length - 1];
|
|
699
|
-
const path = ['shapes', ...refPath];
|
|
700
|
-
if (propName === 'interfaces' && isArray(interfaces)) {
|
|
701
|
-
interfaces.forEach((interfaceRefExpression, index) => {
|
|
702
|
-
addRef(items, {
|
|
703
|
-
...parseRef(projectSchema, interfaceRefExpression),
|
|
704
|
-
path: [...path, index]
|
|
705
|
-
}, predicate);
|
|
706
|
-
});
|
|
707
|
-
}
|
|
708
|
-
// The client sometimes generates invalid schemas, like refs that are
|
|
709
|
-
// undefined. Treat ref as unknown and toss those out.
|
|
710
|
-
// See the `useShapeEditor > can deal with renames test`
|
|
711
|
-
if (!isString(interfaces)) {
|
|
712
|
-
return;
|
|
713
|
-
}
|
|
714
|
-
if (propName === '@ref') {
|
|
715
|
-
addRef(items, { ...parseRef(projectSchema, interfaces), path }, predicate);
|
|
716
|
-
}
|
|
717
|
-
else if (propName === '$ref') {
|
|
718
|
-
addRef(items, { ...refToRefItem(projectSchema, interfaces), path }, predicate);
|
|
719
|
-
}
|
|
720
|
-
else if (propName === '@args' || propName === 'args') {
|
|
721
|
-
addRef(items, { ...parseRef(projectSchema, interfaces), path }, predicate);
|
|
722
|
-
}
|
|
723
|
-
});
|
|
724
|
-
return items;
|
|
725
|
-
}
|
|
726
|
-
export function getRefsInAgents(context, predicate) {
|
|
727
|
-
const refs = [];
|
|
728
|
-
const agents = getAgentMap(context);
|
|
729
|
-
if (agents) {
|
|
730
|
-
for (const [agentKey, agent] of Object.entries(agents)) {
|
|
731
|
-
const agentPath = [...AGENTS_SCHEMA_PATH, agentKey];
|
|
732
|
-
agent.api.inputs.forEach((input, index) => {
|
|
733
|
-
const ref = {
|
|
734
|
-
...parseRef(context, input.args),
|
|
735
|
-
path: [...agentPath, 'api', 'inputs', index, 'args']
|
|
736
|
-
};
|
|
737
|
-
addRef(refs, ref, predicate);
|
|
738
|
-
});
|
|
739
|
-
for (const [stateKey, state] of Object.entries(agent.states)) {
|
|
740
|
-
const statePath = [...agentPath, 'states', stateKey];
|
|
741
|
-
if (state.execution.type === 'chat') {
|
|
742
|
-
if (state.execution.artifact) {
|
|
743
|
-
const ref = {
|
|
744
|
-
...parseRef(context, state.execution.artifact),
|
|
745
|
-
path: [...statePath, 'execution', 'artifact']
|
|
746
|
-
};
|
|
747
|
-
addRef(refs, ref, predicate);
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
else if (state.execution.type === 'generate') {
|
|
751
|
-
if (state.execution.outputShape) {
|
|
752
|
-
const ref = {
|
|
753
|
-
...parseRef(context, state.execution.outputShape),
|
|
754
|
-
path: [...statePath, 'execution', 'outputShape']
|
|
755
|
-
};
|
|
756
|
-
addRef(refs, ref, predicate);
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
return refs;
|
|
763
|
-
}
|
|
764
|
-
/**
|
|
765
|
-
* Get all refs
|
|
766
|
-
*/
|
|
767
|
-
export function getAllRefsInQuery(projectSchema, queryPath, query, predicate) {
|
|
768
|
-
const refItems = [];
|
|
769
|
-
const propertyVisitor = (propSchema, propSchemaPath) => {
|
|
770
|
-
addRef(refItems, getRefOrItemsRef(projectSchema, propSchema, propSchemaPath), predicate);
|
|
771
|
-
};
|
|
772
|
-
if (query.args && typeof query.args === 'string') {
|
|
773
|
-
addRef(refItems, getArgsReferenceWithPath(projectSchema, query, queryPath), predicate);
|
|
774
|
-
}
|
|
775
|
-
if (query.args && typeof query.args === 'object') {
|
|
776
|
-
visitSchemaProperties(query.args, [...queryPath, 'args'], propertyVisitor);
|
|
777
|
-
}
|
|
778
|
-
if (query.shape) {
|
|
779
|
-
const { isArray, ref } = parseReturnShape(projectSchema, query.shape);
|
|
780
|
-
if (ref) {
|
|
781
|
-
addRef(refItems, {
|
|
782
|
-
...ref,
|
|
783
|
-
path: queryPath.concat(isArray ? ['shape', 'items', '@ref'] : ['shape'])
|
|
784
|
-
}, predicate);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
return refItems;
|
|
788
|
-
}
|
|
789
|
-
/**
|
|
790
|
-
* Collect refs from `queries` or `mutations`.
|
|
791
|
-
*/
|
|
792
|
-
export function getAllRefsInQueries(projectSchema, rootPropertyName, predicate) {
|
|
793
|
-
const refItems = [];
|
|
794
|
-
const rootPath = [rootPropertyName];
|
|
795
|
-
for (const [queryName, query] of Object.entries(projectSchema[rootPropertyName])) {
|
|
796
|
-
const queryPath = rootPath.concat([queryName]);
|
|
797
|
-
const queryRefs = getAllRefsInQuery(projectSchema, queryPath, query, predicate);
|
|
798
|
-
if (queryRefs.length) {
|
|
799
|
-
refItems.push(...queryRefs);
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
return refItems;
|
|
803
|
-
}
|
|
804
|
-
/**
|
|
805
|
-
* Get all refs in a ProjectSchemaJSON
|
|
806
|
-
* @param predicate return true to include the ref in
|
|
807
|
-
*/
|
|
808
|
-
export function getAllRefs(projectSchema, predicate) {
|
|
809
|
-
return [
|
|
810
|
-
...getAllRefsInShapes(projectSchema, predicate),
|
|
811
|
-
...getAllRefsInQueries(projectSchema, 'queries', predicate),
|
|
812
|
-
...getAllRefsInQueries(projectSchema, 'mutations', predicate),
|
|
813
|
-
...getRefsInAgents(projectSchema, predicate)
|
|
814
|
-
];
|
|
815
|
-
}
|
|
816
|
-
/**
|
|
817
|
-
* Get all valid refs in a ProjectSchemaJSON
|
|
818
|
-
* @param predicate return true to include the ref in
|
|
819
|
-
*/
|
|
820
|
-
export function getAllValidRefs(projectSchema, predicate) {
|
|
821
|
-
return getAllRefs(projectSchema, predicate).filter(isValidRefItem(projectSchema));
|
|
822
|
-
}
|
|
823
|
-
export function splitMapping(mapping) {
|
|
824
|
-
const parts = mapping.split('.');
|
|
825
|
-
return [parts[0], parts.slice(1).join('.')];
|
|
826
|
-
}
|
|
827
|
-
export function findMapping(schema, predicate) {
|
|
828
|
-
const mapping = schema['@mapping'];
|
|
829
|
-
if (Array.isArray(mapping)) {
|
|
830
|
-
return mapping.find(predicate);
|
|
831
|
-
}
|
|
832
|
-
return mapping && predicate(mapping) ? mapping : undefined;
|
|
833
|
-
}
|
|
834
|
-
export function getFirstMapping(schema) {
|
|
835
|
-
return Array.isArray(schema['@mapping']) ? schema['@mapping'][0] : schema['@mapping'];
|
|
836
|
-
}
|
|
837
|
-
/**
|
|
838
|
-
* Find key for use storing data in ShapeDB or API Indexing this allows renaming of properties without db migration
|
|
839
|
-
* Mapping must be using the shapedb service id
|
|
840
|
-
* @param schema
|
|
841
|
-
*/
|
|
842
|
-
export function getStorageKey(schema) {
|
|
843
|
-
const first = findMapping(schema, (mapping) => mapping.startsWith('shapedb:'));
|
|
844
|
-
return first ? splitMapping(first)[1] : undefined;
|
|
845
|
-
}
|
|
846
|
-
export function emptySchema(projectId) {
|
|
847
|
-
return {
|
|
848
|
-
projectId,
|
|
849
|
-
defaultLocale: 'en-us',
|
|
850
|
-
locales: ['en-us'],
|
|
851
|
-
apiVersion: '2',
|
|
852
|
-
schemaVersion: CURRENT_SCHEMA_VERSION,
|
|
853
|
-
queries: {},
|
|
854
|
-
mutations: {},
|
|
855
|
-
shapes: {},
|
|
856
|
-
workflows: {},
|
|
857
|
-
forms: {}
|
|
858
|
-
};
|
|
859
|
-
}
|
|
860
|
-
export function createLayerSchema(partialSchema) {
|
|
861
|
-
return {
|
|
862
|
-
schemaVersion: CURRENT_SCHEMA_VERSION,
|
|
863
|
-
queries: {},
|
|
864
|
-
mutations: {},
|
|
865
|
-
shapes: {},
|
|
866
|
-
...partialSchema
|
|
867
|
-
};
|
|
868
|
-
}
|
|
869
|
-
export function getShapesById(projectSchema) {
|
|
870
|
-
return keyBy(Object.values(projectSchema.shapes), 'id');
|
|
871
|
-
}
|
|
872
|
-
/**
|
|
873
|
-
* Walk through the project schema and return an array of all
|
|
874
|
-
* referenced shape names that are in a service namespace.
|
|
875
|
-
*
|
|
876
|
-
* @param projectSchema A V3 project schema.
|
|
877
|
-
*
|
|
878
|
-
* @returns A `string` array with all the shapes that are in namespaces.
|
|
879
|
-
*/
|
|
880
|
-
export function getAllNamespaceShapes(projectSchema) {
|
|
881
|
-
const isServiceRef = (refItem) => refItem.layerId !== 'local';
|
|
882
|
-
return uniq(getAllValidRefs(projectSchema, isServiceRef).map((ref) => refItemToNamespacedShapeName(projectSchema, ref)));
|
|
883
|
-
}
|
|
884
|
-
/**
|
|
885
|
-
* Returns a list of all shape names in a service namespace, excluding any
|
|
886
|
-
* that have been set directly in the project schema
|
|
887
|
-
*
|
|
888
|
-
* @todo It's unsound to discard dependencies in this way, should avoid
|
|
889
|
-
* collisions with aliases or similar any remote shape that collides,
|
|
890
|
-
* e.g., Shopify_Product -> Shopify_Product_2
|
|
891
|
-
*
|
|
892
|
-
* @param projectSchema A V3 project schema with remote service configs.
|
|
893
|
-
*
|
|
894
|
-
* @returns A `Set` of shape names.
|
|
895
|
-
*/
|
|
896
|
-
export function getNamespacedShapeNameList(projectSchema) {
|
|
897
|
-
const requiredShapeNames = new Set();
|
|
898
|
-
// All the shape names
|
|
899
|
-
const existingShapeNames = new Set(Object.keys(projectSchema.shapes));
|
|
900
|
-
// All the referenced shape names with namespaces that belong to a service
|
|
901
|
-
const namespacedShapeNames = new Set(getAllNamespaceShapes(projectSchema));
|
|
902
|
-
// Add all namespaced shapes to the schema if they are not already present,
|
|
903
|
-
// e.g. Shopify_Product
|
|
904
|
-
for (const name of namespacedShapeNames) {
|
|
905
|
-
if (!existingShapeNames.has(name)) {
|
|
906
|
-
requiredShapeNames.add(name);
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
return requiredShapeNames;
|
|
910
|
-
}
|
|
911
|
-
/**
|
|
912
|
-
* Filter the service map to return only services passing the GraphQL Service
|
|
913
|
-
* typeguard.
|
|
914
|
-
*
|
|
915
|
-
* @param serviceMap A service map.
|
|
916
|
-
*
|
|
917
|
-
* @returns A new map with the filtered list of services
|
|
918
|
-
*/
|
|
919
|
-
export function filterGraphQLServiceMap(serviceMap) {
|
|
920
|
-
const filtered = new Map();
|
|
921
|
-
for (const [serviceKey, serviceConfig] of serviceMap) {
|
|
922
|
-
if (serviceConfig.serviceType === 'graphql') {
|
|
923
|
-
filtered.set(serviceKey, serviceConfig);
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
return filtered;
|
|
927
|
-
}
|
|
928
|
-
/**
|
|
929
|
-
* Creates a schema property list chainable fn, allowing you to manipulate and
|
|
930
|
-
* iterate the properties in a schema.
|
|
931
|
-
*/
|
|
932
|
-
export const createSchemaPropertyList = curry((context, shapeOrSchema) => {
|
|
933
|
-
const propSchema = isShape(shapeOrSchema) ? shapeOrSchema.schema : shapeOrSchema;
|
|
934
|
-
const schema = dereferenceSchema(context, propSchema, isShape(shapeOrSchema) ? ['shapes', shapeOrSchema.name] : undefined);
|
|
935
|
-
const propertyIterator = new Map(isObjectSchema(schema) ? Object.entries(schema.properties) : undefined);
|
|
936
|
-
const defaultOrderByIteratees = [(n) => n[0]];
|
|
937
|
-
const defaultOrderByOrders = ['asc'];
|
|
938
|
-
const _orderBy = (iteratees = defaultOrderByIteratees, orders = defaultOrderByOrders) => {
|
|
939
|
-
self._propertyIterator = new Map(orderBy(iteratees, orders, Array.from(self._propertyIterator)));
|
|
940
|
-
return self;
|
|
941
|
-
};
|
|
942
|
-
const _sortWith = (comparator) => {
|
|
943
|
-
self._propertyIterator = new Map(Array.from(self._propertyIterator).sort(comparator));
|
|
944
|
-
return self;
|
|
945
|
-
};
|
|
946
|
-
const _sortByNamesWithList = (comparatorArray) => {
|
|
947
|
-
// If no array is provided, the original sort is preserved
|
|
948
|
-
if (comparatorArray) {
|
|
949
|
-
self._propertyIterator = new Map(Array.from(self._propertyIterator)
|
|
950
|
-
.filter(([name]) => comparatorArray.includes(name))
|
|
951
|
-
.sort(([nameA], [nameB]) => {
|
|
952
|
-
const indexA = comparatorArray.indexOf(nameA);
|
|
953
|
-
const indexB = comparatorArray.indexOf(nameB);
|
|
954
|
-
return ((indexA > -1 ? indexA : Number.POSITIVE_INFINITY) - (indexB > -1 ? indexB : Number.POSITIVE_INFINITY));
|
|
955
|
-
}));
|
|
956
|
-
}
|
|
957
|
-
return self;
|
|
958
|
-
};
|
|
959
|
-
const _filterBy = (predicate) => {
|
|
960
|
-
self._propertyIterator = new Map(Array.from(self._propertyIterator).filter(predicate));
|
|
961
|
-
return self;
|
|
962
|
-
};
|
|
963
|
-
const _forEach = (iteratee) => {
|
|
964
|
-
Array.from(self._propertyIterator).forEach(iteratee);
|
|
965
|
-
return self;
|
|
966
|
-
};
|
|
967
|
-
const _getNodes = () => {
|
|
968
|
-
return Array.from(self._propertyIterator);
|
|
969
|
-
};
|
|
970
|
-
const _getObject = () => {
|
|
971
|
-
return Array.from(self._propertyIterator).reduce((curr, node) => Object.assign(curr, { [node[0]]: node[1] }), {});
|
|
972
|
-
};
|
|
973
|
-
const _getNames = () => {
|
|
974
|
-
return Array.from(self._propertyIterator, ([name]) => name);
|
|
975
|
-
};
|
|
976
|
-
const _getValues = () => {
|
|
977
|
-
return Array.from(self._propertyIterator, ([, value]) => value);
|
|
978
|
-
};
|
|
979
|
-
const self = {
|
|
980
|
-
_propertyIterator: propertyIterator,
|
|
981
|
-
orderBy: _orderBy,
|
|
982
|
-
sortWith: _sortWith,
|
|
983
|
-
sortByNamesWithList: _sortByNamesWithList,
|
|
984
|
-
filterBy: _filterBy,
|
|
985
|
-
forEach: _forEach,
|
|
986
|
-
getNodes: _getNodes,
|
|
987
|
-
getObject: _getObject,
|
|
988
|
-
getNames: _getNames,
|
|
989
|
-
getValues: _getValues
|
|
990
|
-
};
|
|
991
|
-
return self;
|
|
992
|
-
});
|
|
993
|
-
function isShape(shapeOrSchema) {
|
|
994
|
-
return 'schema' in shapeOrSchema;
|
|
995
|
-
}
|
|
996
|
-
class SchemaPropertyAccessor {
|
|
997
|
-
schema;
|
|
998
|
-
properties;
|
|
999
|
-
entries;
|
|
1000
|
-
constructor(context, shapeOrSchema) {
|
|
1001
|
-
const propSchema = isShape(shapeOrSchema) ? shapeOrSchema.schema : shapeOrSchema;
|
|
1002
|
-
this.schema = dereferenceSchema(context, propSchema, isShape(shapeOrSchema) ? ['shapes', shapeOrSchema.name] : undefined);
|
|
1003
|
-
this.entries = isObjectSchema(this.schema) ? Object.entries(this.schema.properties) : [];
|
|
1004
|
-
this.properties = new Map(this.entries);
|
|
1005
|
-
}
|
|
1006
|
-
getValue(propertyName) {
|
|
1007
|
-
return this.properties.get(propertyName);
|
|
1008
|
-
}
|
|
1009
|
-
findValue(predicate) {
|
|
1010
|
-
return this.entries.find(predicate)?.[1];
|
|
1011
|
-
}
|
|
1012
|
-
findName(predicate) {
|
|
1013
|
-
return this.entries.find(predicate)?.[0];
|
|
1014
|
-
}
|
|
1015
|
-
getKey(propertyName) {
|
|
1016
|
-
const value = this.properties.get(propertyName);
|
|
1017
|
-
if (value) {
|
|
1018
|
-
return getStorageKey(value);
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
/**
|
|
1023
|
-
* Creates a schema property accessor, allowing you to safely access schema
|
|
1024
|
-
* properties.
|
|
1025
|
-
*/
|
|
1026
|
-
export const createSchemaPropertyAccessor = curry((context, shapeOrSchema) => {
|
|
1027
|
-
return new SchemaPropertyAccessor(context, shapeOrSchema);
|
|
1028
|
-
});
|
|
1029
|
-
function findQueryHelper(slice, shapeName, resolver, type) {
|
|
1030
|
-
const schemaPath = type === 'query' ? 'queries' : 'mutations';
|
|
1031
|
-
return Object.keys(slice[schemaPath]).find((queryName) => {
|
|
1032
|
-
const queryOrMutation = slice[schemaPath][queryName];
|
|
1033
|
-
return (queryOrMutation.resolver.name === resolver &&
|
|
1034
|
-
queryOrMutation.resolver.shapeName === shapeName);
|
|
1035
|
-
});
|
|
1036
|
-
}
|
|
1037
|
-
function ensureQueryHelper(slice, shapeName, resolver, type) {
|
|
1038
|
-
const foundQuery = findQueryHelper(slice, shapeName, resolver, type);
|
|
1039
|
-
if (!foundQuery) {
|
|
1040
|
-
throw new Error(`Failed to find a "${resolver}" ${type} for shape "${shapeName}"`);
|
|
1041
|
-
}
|
|
1042
|
-
return foundQuery;
|
|
1043
|
-
}
|
|
1044
|
-
/**
|
|
1045
|
-
* Find the query in the schema that corresponds to the given shape and resolver.
|
|
1046
|
-
*/
|
|
1047
|
-
export const findQueryByShape = (projectSchema, shapeName, resolver) => findQueryHelper(projectSchema, shapeName, resolver, 'query');
|
|
1048
|
-
/**
|
|
1049
|
-
* Find the query in the schema that corresponds to the given shape and resolver.
|
|
1050
|
-
*/
|
|
1051
|
-
export const findMutationByShape = (projectSchema, shapeName, resolver) => findQueryHelper(projectSchema, shapeName, resolver, 'mutation');
|
|
1052
|
-
/**
|
|
1053
|
-
* Find the query in the schema that corresponds to the given shape and resolver.
|
|
1054
|
-
* Throw an error if that query does not exist
|
|
1055
|
-
*/
|
|
1056
|
-
export const ensureQueryByShape = (projectSchema, shapeName, resolver) => ensureQueryHelper(projectSchema, shapeName, resolver, 'query');
|
|
1057
|
-
/**
|
|
1058
|
-
* Find the mutation in the schema that corresponds to the given shape and resolver.
|
|
1059
|
-
* Throw an error if that mutation does not exist
|
|
1060
|
-
*/
|
|
1061
|
-
export const ensureMutationByShape = (projectSchema, shapeName, resolver) => ensureQueryHelper(projectSchema, shapeName, resolver, 'mutation');
|
|
1062
|
-
/**
|
|
1063
|
-
* Find the query in the schema that corresponds to the given shape and resolver.
|
|
1064
|
-
*/
|
|
1065
|
-
export const getDefaultMutationName = (shapeName, resolver) => {
|
|
1066
|
-
const action = resolver.substring(resolver.indexOf(':') + 1);
|
|
1067
|
-
return `${action}${shapeName}`;
|
|
1068
|
-
};
|
|
1069
|
-
export function createShape(name, schema, rest) {
|
|
1070
|
-
return {
|
|
1071
|
-
name,
|
|
1072
|
-
id: name,
|
|
1073
|
-
title: name,
|
|
1074
|
-
schema,
|
|
1075
|
-
...rest
|
|
1076
|
-
};
|
|
1077
|
-
}
|
|
1078
|
-
export function queryToPropertySchema(projectSchema, query) {
|
|
1079
|
-
let mapping;
|
|
1080
|
-
if (isGraphqlResolver(query.resolver)) {
|
|
1081
|
-
mapping = serializePropertyRef({
|
|
1082
|
-
layerId: query.resolver.service,
|
|
1083
|
-
shapeName: 'Query',
|
|
1084
|
-
propertyName: query.resolver.fieldName
|
|
1085
|
-
});
|
|
1086
|
-
}
|
|
1087
|
-
return {
|
|
1088
|
-
...returnShapeToSchema(projectSchema, query.shape),
|
|
1089
|
-
...(mapping ? { '@mapping': mapping } : {}),
|
|
1090
|
-
'@resolver': query.resolver,
|
|
1091
|
-
'@args': query.args
|
|
1092
|
-
};
|
|
1093
|
-
}
|
|
1094
|
-
export function getQueriesShape(projectSchema, operation) {
|
|
1095
|
-
return createShape(pascalCase(operation), {
|
|
1096
|
-
type: 'object',
|
|
1097
|
-
properties: mapValues(projectSchema[operation === 'query' ? 'queries' : 'mutations'], (query) => queryToPropertySchema(projectSchema, query))
|
|
1098
|
-
});
|
|
1099
|
-
}
|
|
1100
|
-
/**
|
|
1101
|
-
* Return true if `schemaWithRef` is a ref to a shape named `shapeName`
|
|
1102
|
-
*/
|
|
1103
|
-
export function schemaMatchesShapeName(workingCopy, propertySchema, shapeName) {
|
|
1104
|
-
const arrayOfShapeRef = getRef(workingCopy, propertySchema);
|
|
1105
|
-
return Boolean(arrayOfShapeRef && refItemToNamespacedShapeName(workingCopy, arrayOfShapeRef) === shapeName);
|
|
1106
|
-
}
|
|
1107
|
-
/**
|
|
1108
|
-
* Return true if `shape` has a property that is an array of refs to `shapeName`
|
|
1109
|
-
*/
|
|
1110
|
-
export const shapeHasArrayPropOfShape = (projectSchema, shape, shapeName) => {
|
|
1111
|
-
if (shape && isObjectSchema(shape.schema)) {
|
|
1112
|
-
for (const propName in shape.schema.properties) {
|
|
1113
|
-
if (Object.hasOwn(shape.schema.properties, propName)) {
|
|
1114
|
-
const propSchema = shape.schema.properties[propName];
|
|
1115
|
-
if (propSchema.items &&
|
|
1116
|
-
isRefSchema(propSchema.items) &&
|
|
1117
|
-
schemaMatchesShapeName(projectSchema, propSchema.items, shapeName)) {
|
|
1118
|
-
return true;
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
|
-
return false;
|
|
1124
|
-
};
|
|
1125
|
-
export const getQueryMapName = (type) => {
|
|
1126
|
-
return type === 'query' ? 'queries' : 'mutations';
|
|
1127
|
-
};
|