Skip to content
This repository was archived by the owner on Aug 18, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Created by https://www.toptal.com/developers/gitignore/api/macos,xcode,swift
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,xcode,swift

Expand Down Expand Up @@ -136,3 +135,22 @@ iOSInjectionProject/
**/xcshareddata/WorkspaceSettings.xcsettings

# End of https://www.toptal.com/developers/gitignore/api/macos,xcode,swift

#amplify
amplify/\#current-cloud-backend
amplify/.config/local-*
amplify/logs
amplify/mock-data
amplify/backend/amplify-meta.json
amplify/backend/awscloudformation
amplify/backend/.temp
build/
dist/
node_modules/
aws-exports.js
awsconfiguration.json
amplifyconfiguration.json
amplify-build-config.json
amplify-gradle-config.json
amplifytools.xcconfig
.secret-*
8 changes: 8 additions & 0 deletions amplify/.config/project-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"projectName": "brain-marks",
"version": "2.0",
"frontend": "ios",
"providers": [
"awscloudformation"
]
}
5 changes: 5 additions & 0 deletions amplify/backend/api/amplifyDatasource/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"AppSyncApiName": "amplifyDatasource",
"DynamoDBBillingMode": "PAY_PER_REQUEST",
"DynamoDBEnableServerSideEncryption": "false"
}
13 changes: 13 additions & 0 deletions amplify/backend/api/amplifyDatasource/schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type AWSTweet @model {
id: ID!
tweetID: String!
text: String
category: AWSCategory @connection(name: "CategorizedTweet")
}

type AWSCategory @model {
id: ID!
name: String!
imageName: String
tweets: [AWSTweet] @connection(name: "CategorizedTweet")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "An auto-generated nested stack.",
"Metadata": {},
"Parameters": {
"AppSyncApiId": {
"Type": "String",
"Description": "The id of the AppSync API associated with this project."
},
"AppSyncApiName": {
"Type": "String",
"Description": "The name of the AppSync API",
"Default": "AppSyncSimpleTransform"
},
"env": {
"Type": "String",
"Description": "The environment name. e.g. Dev, Test, or Production",
"Default": "NONE"
},
"S3DeploymentBucket": {
"Type": "String",
"Description": "The S3 bucket containing all deployment assets for the project."
},
"S3DeploymentRootKey": {
"Type": "String",
"Description": "An S3 key relative to the S3DeploymentBucket that points to the root\nof the deployment directory."
}
},
"Resources": {
"EmptyResource": {
"Type": "Custom::EmptyResource",
"Condition": "AlwaysFalse"
}
},
"Conditions": {
"HasEnvironmentParameter": {
"Fn::Not": [
{
"Fn::Equals": [
{
"Ref": "env"
},
"NONE"
]
}
]
},
"AlwaysFalse": {
"Fn::Equals": ["true", "false"]
}
},
"Outputs": {
"EmptyOutput": {
"Description": "An empty output. You may delete this if you have at least one resource above.",
"Value": ""
}
}
}
10 changes: 10 additions & 0 deletions amplify/backend/api/amplifyDatasource/transform.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"Version": 5,
"ResolverConfig": {
"project": {
"ConflictHandler": "AUTOMERGE",
"ConflictDetection": "VERSION"
}
},
"ElasticsearchWarning": true
}
20 changes: 20 additions & 0 deletions amplify/backend/backend-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"api": {
"amplifyDatasource": {
"service": "AppSync",
"providerPlugin": "awscloudformation",
"output": {
"authConfig": {
"additionalAuthenticationProviders": [],
"defaultAuthentication": {
"authenticationType": "API_KEY",
"apiKeyConfig": {
"description": "",
"apiKeyExpirationDays": 7
}
}
}
}
}
}
}
29 changes: 29 additions & 0 deletions amplify/cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"features": {
"graphqltransformer": {
"addmissingownerfields": true,
"validatetypenamereservedwords": true,
"useexperimentalpipelinedtransformer": false,
"enableiterativegsiupdates": false,
"secondarykeyasgsi": true,
"skipoverridemutationinputtypes": true
},
"frontend-ios": {
"enablexcodeintegration": true
},
"auth": {
"enablecaseinsensitivity": true,
"useinclusiveterminology": true
},
"codegen": {
"useappsyncmodelgenplugin": true,
"usedocsgeneratorplugin": true,
"usetypesgeneratorplugin": true,
"cleangeneratedmodelsdirectory": true,
"retaincasestyle": true
},
"appsync": {
"generategraphqlpermissions": true
}
}
}
29 changes: 29 additions & 0 deletions amplify/generated/models/AWSCategory+Schema.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// swiftlint:disable all
import Amplify
import Foundation

extension AWSCategory {
// MARK: - CodingKeys
public enum CodingKeys: String, ModelKey {
case id
case name
case imageName
case tweets
}

public static let keys = CodingKeys.self
// MARK: - ModelSchema

public static let schema = defineSchema { model in
let aWSCategory = AWSCategory.keys

model.pluralName = "AWSCategories"

model.fields(
.id(),
.field(aWSCategory.name, is: .required, ofType: .string),
.field(aWSCategory.imageName, is: .optional, ofType: .string),
.hasMany(aWSCategory.tweets, is: .optional, ofType: AWSTweet.self, associatedWith: AWSTweet.keys.category)
)
}
}
20 changes: 20 additions & 0 deletions amplify/generated/models/AWSCategory.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// swiftlint:disable all
import Amplify
import Foundation

public struct AWSCategory: Model {
public let id: String
public var name: String
public var imageName: String?
public var tweets: List<AWSTweet>?

public init(id: String = UUID().uuidString,
name: String,
imageName: String? = nil,
tweets: List<AWSTweet>? = []) {
self.id = id
self.name = name
self.imageName = imageName
self.tweets = tweets
}
}
29 changes: 29 additions & 0 deletions amplify/generated/models/AWSTweet+Schema.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// swiftlint:disable all
import Amplify
import Foundation

extension AWSTweet {
// MARK: - CodingKeys
public enum CodingKeys: String, ModelKey {
case id
case tweetID
case text
case category
}

public static let keys = CodingKeys.self
// MARK: - ModelSchema

public static let schema = defineSchema { model in
let aWSTweet = AWSTweet.keys

model.pluralName = "AWSTweets"

model.fields(
.id(),
.field(aWSTweet.tweetID, is: .required, ofType: .string),
.field(aWSTweet.text, is: .optional, ofType: .string),
.belongsTo(aWSTweet.category, is: .optional, ofType: AWSCategory.self, targetName: "awsTweetCategoryId")
)
}
}
20 changes: 20 additions & 0 deletions amplify/generated/models/AWSTweet.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// swiftlint:disable all
import Amplify
import Foundation

public struct AWSTweet: Model {
public let id: String
public var tweetID: String
public var text: String?
public var category: AWSCategory?

public init(id: String = UUID().uuidString,
tweetID: String,
text: String? = nil,
category: AWSCategory? = nil) {
self.id = id
self.tweetID = tweetID
self.text = text
self.category = category
}
}
14 changes: 14 additions & 0 deletions amplify/generated/models/AmplifyModels.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// swiftlint:disable all
import Amplify
import Foundation

// Contains the set of classes that conforms to the `Model` protocol.

final public class AmplifyModels: AmplifyModelRegistration {
public let version: String = "2e2f9f76f94d0d76a69b2e3cdf98ddea"

public func registerModels(registry: ModelRegistry.Type) {
ModelRegistry.register(modelType: AWSTweet.self)
ModelRegistry.register(modelType: AWSCategory.self)
}
}
Loading