This repository was archived by the owner on Apr 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import Vapor
66
77extension {{ type.localName }}: RouteCollection {
8- func build(_ builder: RouteBuilder) throws {
8+ {{ type.accessLevel }} func build(_ builder: RouteBuilder) throws {
99 builder.group("{{ type.annotations.group }}") { routes in
1010 {% for func in type.methods where func|annotated:"route" %}
1111 // {{ func.annotations.method|uppercase }} /{{ type.annotations.group }}{{ func.annotations.path }}
Original file line number Diff line number Diff line change @@ -54,13 +54,13 @@ extension RawStringConvertible {
5454{% for enum in types.enums|!annotated:"ignore" where arguments.enumOptOut or enum.annotations.enum or enum.based.RawStringConvertible %}
5555
5656extension {{ enum.name }} {
57- static var all: [{{ enum.name }}] = [
57+ {{ type.accessLevel }} static var all: [{{ enum.name }}] = [
5858 {% for case in enum.cases %}
5959 .{{ case.name }},
6060 {% endfor %}
6161 ]
6262
63- static let allRaw = {{ enum.name }}.all.map { $0.rawValue }
63+ {{ type.accessLevel }} static let allRaw = {{ enum.name }}.all.map { $0.rawValue }
6464}
6565
6666{% endfor %}
Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ import {{ var }}
1313{% endif %}
1414
1515extension {{ type.localName }} {
16- internal enum JSONKeys {
16+ {{ type.accessLevel }} enum JSONKeys {
1717 {% for var in type.storedVariables|!annotated:"ignore"|!annotated:"ignoreJSONConvertible" %}
18- static let {{ var.annotations.jsonKey|default:var.name }} = "{{ var.annotations.jsonKey|default:var.name }}"
18+ {{ type.accessLevel }} static let {{ var.annotations.jsonKey|default:var.name }} = "{{ var.annotations.jsonKey|default:var.name }}"
1919 {% endfor %}
2020 }
2121}
@@ -24,7 +24,7 @@ extension {{ type.localName }} {
2424// MARK: - JSONInitializable ({{ type.name }})
2525
2626extension {{ type.localName }}: JSONInitializable {
27- internal convenience init(json: JSON) throws {
27+ {{ type.accessLevel }} convenience init(json: JSON) throws {
2828 {% for var in type.storedVariables|!annotated:"ignore"|!annotated:"ignoreJSONConvertible"|!annotated:"ignoreJSONInitializable" %}
2929 let {{var.name}}: {{var.typeName}} = try json.get(JSONKeys.{{ var.annotations.jsonKey|default:var.name }})
3030 {% endfor %}
@@ -42,7 +42,7 @@ extension {{ type.localName }}: JSONInitializable {
4242// MARK: - JSONRepresentable ({{ type.name }})
4343
4444extension {{ type.localName }}: JSONRepresentable {
45- internal func makeJSON() throws -> JSON {
45+ {{ type.accessLevel }} func makeJSON() throws -> JSON {
4646 var json = JSON()
4747
4848 try json.set({{ type.name }}.idKey, id)
Original file line number Diff line number Diff line change 22
33{% for type in types.based.Model|!protocol|annotated:"model" %}
44 // sourcery:inline:auto:{{ type.name }}.Models
5- internal let storage = Storage()
5+ {{ type.accessLevel }} let storage = Storage()
66
7- internal init(
7+ {{ type.accessLevel }} init(
88 {% for var in type.storedVariables|!annotated:"ignore" %}
99 {{ var.name }}: {{ var.typeName.description }}{% if var.isOptional %} = nil{% endif %}{% if not forloop.last %},{% endif %}
1010 {% endfor %}
Original file line number Diff line number Diff line change @@ -13,14 +13,14 @@ import {{ var }}
1313{% endif %}
1414
1515extension {{ type.localName }}: NodeRepresentable {
16- internal enum NodeKeys {
16+ {{ type.accessLevel }} enum NodeKeys {
1717 {% for var in type.storedVariables|!annotated:"ignore"|!annotated:"ignoreNodeRepresentable" %}
18- static let {{ var.annotations.nodeKey|default:var.name }} = "{{ var.annotations.nodeKey|default:var.name }}"
18+ {{ type.accessLevel }} static let {{ var.annotations.nodeKey|default:var.name }} = "{{ var.annotations.nodeKey|default:var.name }}"
1919 {% endfor %}
2020 }
2121
2222 // MARK: - NodeRepresentable ({{ type.name }})
23- func makeNode(in context: Context?) throws -> Node {
23+ {{ type.accessLevel }} func makeNode(in context: Context?) throws -> Node {
2424 var node = Node([:])
2525
2626 try node.set({{ type.name }}.idKey, id)
Original file line number Diff line number Diff line change @@ -13,15 +13,15 @@ import {{ var }}
1313{% endif %}
1414
1515extension {{ type.localName }}: Preparation {
16- internal enum DatabaseKeys {
17- static let id = {{ type.localName }}.idKey
16+ {{ type.accessLevel }} enum DatabaseKeys {
17+ {{ type.accessLevel }} static let id = {{ type.localName }}.idKey
1818 {% for var in type.storedVariables|!annotated:"ignore"|!annotated:"ignorePreparation" %}
19- static let {{ var.annotations.databaseKey|default:var.name }} = "{{ var.annotations.databaseKey|default:var.name }}"
19+ {{ type.accessLevel }} static let {{ var.annotations.databaseKey|default:var.name }} = "{{ var.annotations.databaseKey|default:var.name }}"
2020 {% endfor %}
2121 }
2222
2323 // MARK: - Preparations ({{ type.name }})
24- internal static func prepare(_ database: Database) throws {
24+ {{ type.accessLevel }} static func prepare(_ database: Database) throws {
2525 try database.create(self) {
2626 $0.id()
2727 {% for var in type.storedVariables|!annotated:"ignore"|!annotated:"ignorePreparation" %}
@@ -34,7 +34,7 @@ extension {{ type.localName }}: Preparation {
3434 {% endfor %}
3535 }
3636
37- internal static func revert(_ database: Database) throws {
37+ {{ type.accessLevel }} static func revert(_ database: Database) throws {
3838 try database.delete(self)
3939 }
4040}
Original file line number Diff line number Diff line change @@ -7,15 +7,15 @@ import Fluent
77
88extension {{ type.localName }}: RowConvertible {
99 // MARK: - RowConvertible ({{ type.name }})
10- convenience internal init (row: Row) throws {
10+ convenience {{ type.accessLevel }} init (row: Row) throws {
1111 try self.init(
1212 {% for var in type.storedVariables|!annotated:"ignore"|!annotated:"ignoreRowConvertible" %}
1313 {{ var.name }}: row.get(DatabaseKeys.{{ var.annotations.databaseKey|default:var.name }}){% if not forloop.last %},{% endif %}
1414 {% endfor %}
1515 )
1616 }
1717
18- internal func makeRow() throws -> Row {
18+ {{ type.accessLevel }} func makeRow() throws -> Row {
1919 var row = Row()
2020
2121 {% for var in type.storedVariables|!annotated:"ignore"|!annotated:"ignoreRowConvertible" %}
You can’t perform that action at this time.
0 commit comments