fakecloud_appsync/lib.rs
1//! AWS AppSync (`appsync`) restJson1 control plane + schema state for fakecloud.
2//!
3//! The full 74-operation AWS AppSync Smithy model. AppSync signs SigV4 with the
4//! `appsync` scope and speaks restJson1; every operation is a RESTful
5//! `<METHOD> /v1|/v2/...` route with path labels (e.g. `POST /v1/apis`,
6//! `GET /v1/apis/{apiId}`, `POST /v1/apis/{apiId}/types/{typeName}/resolvers`),
7//! so requests are routed by their HTTP method + `@http` URI template.
8//!
9//! This is real, persisted, account-partitioned control-plane + schema state,
10//! not a set of stubs:
11//!
12//! * **GraphQL APIs.** `CreateGraphqlApi` mints an `apiId`, ARN, GRAPHQL +
13//! REALTIME endpoint `uris`, and echoes the auth config (`API_KEY`,
14//! `AWS_IAM`, `AMAZON_COGNITO_USER_POOLS`, `OPENID_CONNECT`, `AWS_LAMBDA`),
15//! round-tripping via Get/List/Update/Delete.
16//! * **Sub-resources.** API keys (with expiry), data sources (all
17//! `DataSourceType`s with their config echoed), resolvers (UNIT/PIPELINE,
18//! VTL or `APPSYNC_JS` code, attached to `type.field`), functions, schema
19//! types, API caches, domain names + API associations, the newer Event-API
20//! surface (`CreateApi`/channel namespaces), and merged/source-API
21//! associations. Every sub-resource op validates its parent and returns the
22//! declared `NotFoundException` when the parent (or the resource) is absent.
23//! * **Schema lifecycle.** `StartSchemaCreation` ingests an SDL schema blob and
24//! settles `GetSchemaCreationStatus` to `SUCCESS` on read (a state machine
25//! like other async ops). `GetIntrospectionSchema` returns a representation
26//! (SDL or JSON per the `format` query param) derived from the stored schema.
27//! * **Evaluation.** `EvaluateCode` / `EvaluateMappingTemplate` validate the
28//! code/template + context are well-formed and return a deterministic,
29//! honestly-documented evaluated result (see [`evaluate`]); they do NOT run a
30//! full VTL/`APPSYNC_JS` interpreter.
31//!
32//! Model-driven validation rejects contract violations with the error codes
33//! each operation declares (`BadRequestException` universally, plus
34//! `NotFoundException`, `ConcurrentModificationException`, etc.).
35//!
36//! **Not yet implemented (documented gap, not stubbed):** the GraphQL query
37//! *execution* data plane -- actually resolving GraphQL queries/subscriptions
38//! against the configured data sources -- is a later batch. This crate is the
39//! faithful control plane + schema state that such execution would build on.
40
41pub mod evaluate;
42pub mod persistence;
43pub mod schema;
44pub mod service;
45pub mod state;
46mod validate;
47
48pub use service::{AppSyncService, APPSYNC_ACTIONS};
49pub use state::{
50 AppSyncData, AppSyncSnapshot, SharedAppSyncState, APPSYNC_SNAPSHOT_SCHEMA_VERSION,
51};