Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
Update to latest MicroClient
Browse files Browse the repository at this point in the history
  • Loading branch information
Otávio Cordeiro committed May 6, 2022
1 parent 01b83cf commit a164fc7
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 43 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
6 changes: 3 additions & 3 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"pins": [
{
"package": "MicroClient",
"repositoryURL": "https://github.com/MicroClientSwift/MicroClient",
"repositoryURL": "https://github.com/otaviocc/MicroClient",
"state": {
"branch": null,
"revision": "d959c10b6160de50cfa9ef300bb45ddec607cd7b",
"version": "0.0.6"
"revision": "758df84c38dc663cc00b49b377fc8a033a8d4100",
"version": "0.0.12"
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ let package = Package(
],
dependencies: [
.package(
url: "https://github.com/MicroClientSwift/MicroClient",
from: "0.0.3"
url: "https://github.com/otaviocc/MicroClient",
from: "0.0.12"
)
],
targets: [
Expand Down
5 changes: 2 additions & 3 deletions Sources/MicroPinboard/API/PinboardAPIFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ public struct PinboardAPIFactory: PinboardAPIFactoryProtocol {
) -> NetworkConfiguration {
.init(
session: .shared,
defaultDecoder: JSONDecoder.defaultJSONDecoder,
defaultDecoder: .defaultJSONDecoder,
defaultEncoder: JSONEncoder(),
scheme: "https",
hostname: "api.pinboard.in"
baseURL: URL(string: "api.pinboard.in")!
)
}
}
60 changes: 30 additions & 30 deletions Sources/MicroPinboard/API/PostsAPIFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ public enum PostsAPIFactory {
.init(
path: "/v1/posts/add",
method: .get,
parameters: [
"url": url.absoluteString,
"description": description,
"extended": extended,
"tags": tags,
"dt": date.map(DateFormatter.defaultAPIFormatter.string),
"replace": replace,
"shared": shared,
"toread": toread
queryItems: [
.init(name: "url", value: url.absoluteString),
.init(name: "description", value: description),
.init(name: "extended", value: extended),
.init(name: "tags", value: tags),
.init(name: "dt", value: date.map(DateFormatter.defaultAPIFormatter.string)),
.init(name: "replace", value: replace),
.init(name: "shared", value: shared),
.init(name: "toread", value: toread)
]
)
}
Expand All @@ -37,8 +37,8 @@ public enum PostsAPIFactory {
.init(
path: "/v1/posts/delete",
method: .get,
parameters: [
"url": url.absoluteString
queryItems: [
.init(name: "url", value: url.absoluteString)
]
)
}
Expand All @@ -53,11 +53,11 @@ public enum PostsAPIFactory {
.init(
path: "/v1/posts/get",
method: .get,
parameters: [
"tag": tag,
"dt": date.map(DateFormatter.defaultAPIFormatter.string),
"url": url?.absoluteString,
"meta": meta
queryItems: [
.init(name: "tag", value: tag),
.init(name: "dt", value: date.map(DateFormatter.defaultAPIFormatter.string)),
.init(name: "url", value: url?.absoluteString),
.init(name: "meta", value: meta)
]
)
}
Expand All @@ -69,8 +69,8 @@ public enum PostsAPIFactory {
.init(
path: "/v1/posts/dates",
method: .get,
parameters: [
"tag": tag
queryItems: [
.init(name: "tag", value: tag)
]
)
}
Expand All @@ -83,9 +83,9 @@ public enum PostsAPIFactory {
.init(
path: "/v1/posts/recent",
method: .get,
parameters: [
"tag": tag,
"count": count.map(String.init)
queryItems: [
.init(name: "tag", value: tag),
.init(name: "count", value: count.map(String.init))
]
)
}
Expand All @@ -102,13 +102,13 @@ public enum PostsAPIFactory {
.init(
path: "/v1/posts/all",
method: .get,
parameters: [
"tag": tag,
"start": start.map(String.init),
"results": results.map(String.init),
"fromdt": fromDate.map(DateFormatter.defaultAPIFormatter.string),
"todt": toDate.map(DateFormatter.defaultAPIFormatter.string),
"meta": meta.map(String.init)
queryItems: [
.init(name: "tag", value: tag),
.init(name: "start", value: start.map(String.init)),
.init(name: "results", value: results.map(String.init)),
.init(name: "fromdt", value: fromDate.map(DateFormatter.defaultAPIFormatter.string)),
.init(name: "todt", value: toDate.map(DateFormatter.defaultAPIFormatter.string)),
.init(name: "meta", value: meta.map(String.init)),
]
)
}
Expand All @@ -120,8 +120,8 @@ public enum PostsAPIFactory {
.init(
path: "/v1/posts/suggest",
method: .get,
parameters: [
"url": url.absoluteString
queryItems: [
.init(name: "url", value: url.absoluteString)
]
)
}
Expand Down
10 changes: 5 additions & 5 deletions Sources/MicroPinboard/API/TagsAPIFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public enum TagsAPIFactory {
.init(
path: "/v1/tags/delete",
method: .get,
parameters: [
"tag": tag
queryItems: [
.init(name: "tag", value: "tag")
]
)
}
Expand All @@ -34,9 +34,9 @@ public enum TagsAPIFactory {
.init(
path: "/v1/tags/rename",
method: .get,
parameters: [
"old": old,
"new": new
queryItems: [
.init(name: "old", value: old),
.init(name: "new", value: new),
]
)
}
Expand Down

0 comments on commit a164fc7

Please sign in to comment.