-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
2,184 additions
and
2,874 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"extends": ["../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# dataconnect | ||
|
||
This library contains the [Firebase Dataconnect](https://firebase.google.com/docs/data-connect) definitions. | ||
|
||
Make sure to generate the SDKs before building any app code that depends on it: `nx codegen dataconnect` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* eslint-disable */ | ||
export default { | ||
displayName: "dataconnect", | ||
preset: "../../jest.preset.js", | ||
testEnvironment: "node", | ||
transform: { | ||
"^.+\\.[tj]s$": ["ts-jest", {tsconfig: "<rootDir>/tsconfig.spec.json"}], | ||
}, | ||
moduleFileExtensions: ["ts", "js", "html"], | ||
coverageDirectory: "../../coverage/libs/dataconnect", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "dataconnect", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "libs/dataconnect/src", | ||
"projectType": "library", | ||
"tags": [ | ||
"lib:backend", | ||
"lib:frontend" | ||
], | ||
"targets": { | ||
"build": { | ||
"executor": "nx:noop" | ||
}, | ||
"e2e": { | ||
"executor": "nx:noop" | ||
}, | ||
"test": { | ||
"executor": "nx:noop" | ||
}, | ||
"lint": { | ||
"executor": "nx:noop" | ||
}, | ||
"codegen": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"command": "firebase dataconnect:sdk:generate" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
connectorId: default | ||
generate: | ||
javascriptSdk: | ||
outputDir: ../../lib/js | ||
package: "@tanam/dataconnect" | ||
packageJsonDir: ../../../.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# # Example mutations for a simple movie app | ||
|
||
# # Create a movie based on user input | ||
# mutation CreateMovie( | ||
# $title: String! | ||
# $genre: String! | ||
# $imageUrl: String! | ||
# ) @auth(level: USER_EMAIL_VERIFIED) { | ||
# movie_insert( | ||
# data: { | ||
# title: $title | ||
# genre: $genre | ||
# imageUrl: $imageUrl | ||
# } | ||
# ) | ||
# } | ||
|
||
# # Upsert (update or insert) a user's username based on their auth.uid | ||
# mutation UpsertUser($username: String!) @auth(level: USER) { | ||
# user_upsert( | ||
# data: { | ||
# id_expr: "auth.uid" | ||
# username: $username | ||
# } | ||
# ) | ||
# } | ||
|
||
# # Add a review for a movie | ||
# mutation AddReview( | ||
# $movieId: UUID! | ||
# $rating: Int! | ||
# $reviewText: String! | ||
# ) @auth(level: USER) { | ||
# review_upsert( | ||
# data: { | ||
# userId_expr: "auth.uid" | ||
# movieId: $movieId | ||
# rating: $rating | ||
# reviewText: $reviewText | ||
# # reviewDate defaults to today in the schema. No need to set it manually. | ||
# } | ||
# ) | ||
# } | ||
|
||
# # Logged in user can delete their review for a movie | ||
# mutation DeleteReview( | ||
# $movieId: UUID! | ||
# ) @auth(level: USER) { | ||
# review_delete(key: { userId_expr: "auth.uid", movieId: $movieId }) | ||
# } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# # Example queries for a simple movie app. | ||
|
||
# # @auth() directives control who can call each operation. | ||
# # Anyone should be able to list all movies, so the auth level is set to PUBLIC | ||
# query ListMovies @auth(level: PUBLIC) { | ||
# movies { | ||
# id | ||
# title | ||
# imageUrl | ||
# genre | ||
# } | ||
# } | ||
|
||
# # List all users, only admins should be able to list all users, so we use NO_ACCESS | ||
# query ListUsers @auth(level: NO_ACCESS) { | ||
# users { id, username } | ||
# } | ||
|
||
# # Logged in user can list all their reviews and movie titles associated with the review | ||
# # Since the query requires the uid of the current authenticated user, the auth level is set to USER | ||
# query ListUserReviews @auth(level: USER) { | ||
# user(key: {id_expr: "auth.uid"}) { | ||
# id | ||
# username | ||
# # <field>_on_<foreign_key_field> makes it easy to grab info from another table | ||
# # Here, we use it to grab all the reviews written by the user. | ||
# reviews: reviews_on_user { | ||
# id | ||
# rating | ||
# reviewDate | ||
# reviewText | ||
# movie { | ||
# id | ||
# title | ||
# } | ||
# } | ||
# } | ||
# } | ||
|
||
# # Get movie by id | ||
# query GetMovieById($id: UUID!) @auth(level: PUBLIC) { | ||
# movie(id: $id) { | ||
# id | ||
# title | ||
# imageUrl | ||
# genre | ||
# metadata: movieMetadata_on_movie { | ||
# rating | ||
# releaseYear | ||
# description | ||
# } | ||
# reviews: reviews_on_movie { | ||
# id | ||
# reviewText | ||
# reviewDate | ||
# rating | ||
# user { | ||
# id | ||
# username | ||
# } | ||
# } | ||
# } | ||
# } | ||
|
||
# # Search for movies, actors, and reviews | ||
# query SearchMovie( | ||
# $titleInput: String | ||
# $genre: String | ||
# ) @auth(level: PUBLIC) { | ||
# movies( | ||
# where: { | ||
# _and: [ | ||
# { genre: { eq: $genre } } | ||
# { title: { contains: $titleInput } } | ||
# ] | ||
# } | ||
# ) { | ||
# id | ||
# title | ||
# genre | ||
# imageUrl | ||
# } | ||
# } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
specVersion: "v1beta" | ||
serviceId: "tanam" | ||
location: "us-central1" | ||
schema: | ||
source: "./schema" | ||
datasource: | ||
postgresql: | ||
database: "fdcdb" | ||
cloudSql: | ||
instanceId: "tanam-fdc" | ||
# schemaValidation: "COMPATIBLE" | ||
connectorDirs: ["./connector"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# # Example schema for simple movie review app | ||
|
||
# # Users | ||
# # Suppose a user can leave reviews for movies | ||
# # user -> reviews is a one to many relationship, | ||
# # movie -> reviews is a one to many relationship | ||
# # movie <-> user is a many to many relationship | ||
# type User @table { | ||
# id: String! @col(name: "user_auth") | ||
# username: String! @col(name: "username", dataType: "varchar(50)") | ||
# # The following are generated by the user: User! field in the Review table | ||
# # reviews_on_user | ||
# # movies_via_Review | ||
# } | ||
|
||
# # Movies | ||
# type Movie @table { | ||
# # The below parameter values are generated by default with @table, and can be edited manually. | ||
# # implies directive `@col(name: "movie_id")`, generating a column name | ||
# id: UUID! @default(expr: "uuidV4()") | ||
# title: String! | ||
# imageUrl: String! | ||
# genre: String | ||
# } | ||
|
||
# # Movie Metadata | ||
# # Movie - MovieMetadata is a one-to-one relationship | ||
# type MovieMetadata @table { | ||
# # @unique indicates a 1-1 relationship | ||
# movie: Movie! @unique | ||
# # movieId: UUID <- this is created by the above reference | ||
# rating: Float | ||
# releaseYear: Int | ||
# description: String | ||
# } | ||
|
||
# # Reviews | ||
# type Review @table(name: "Reviews", key: ["movie", "user"]) { | ||
# id: UUID! @default(expr: "uuidV4()") | ||
# user: User! | ||
# movie: Movie! | ||
# rating: Int | ||
# reviewText: String | ||
# reviewDate: Date! @default(expr: "request.time") | ||
# } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"module": "commonjs" | ||
}, | ||
"files": [], | ||
"include": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.lib.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"outDir": "../../dist/out-tsc", | ||
"declaration": true, | ||
"types": ["node"] | ||
}, | ||
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], | ||
"include": ["src/**/*.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../dist/out-tsc", | ||
"module": "commonjs", | ||
"types": ["jest", "node"] | ||
}, | ||
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.