Skip to content

Commit

Permalink
refactor: remove common namespace. just use the top level namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelMunoz committed Nov 3, 2024
1 parent 5577c1b commit 2cd4475
Show file tree
Hide file tree
Showing 19 changed files with 46 additions and 55 deletions.
2 changes: 1 addition & 1 deletion Sample/Profile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ open Navs
open Navs.Avalonia

open Threads.Lib
open Threads.Lib.Common

open Threads.Lib.Profiles

module Profile =
Expand Down
2 changes: 1 addition & 1 deletion Threads.Lib.Tests/Media.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ open Flurl.Http
open Flurl.Http.Testing

open Threads.Lib
open Threads.Lib.Common

open Threads.Lib.Media


Expand Down
2 changes: 1 addition & 1 deletion Threads.Lib.Tests/Pagination.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ open Flurl.Util
open Flurl.Http.Testing
open Microsoft.VisualStudio.TestTools.UnitTesting
open Threads.Lib
open Threads.Lib.Common


[<TestClass>]
type PaginationTests() =
Expand Down
2 changes: 1 addition & 1 deletion Threads.Lib.Tests/Posts.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ open System.Threading.Tasks
open Flurl.Util
open Microsoft.VisualStudio.TestTools.UnitTesting
open Flurl.Http.Testing
open Threads.Lib.Common

open Threads.Lib.Posts


Expand Down
2 changes: 1 addition & 1 deletion Threads.Lib.Tests/Profiles.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ open Flurl.Http
open Flurl.Http.Testing

open Threads.Lib
open Threads.Lib.Common

open Threads.Lib.Profiles

[<TestClass>]
Expand Down
2 changes: 1 addition & 1 deletion Threads.Lib.Tests/ReplyManagement.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ open Flurl.Http
open Flurl.Http.Testing

open Threads.Lib
open Threads.Lib.Common

open Threads.Lib.ReplyManagement


Expand Down
21 changes: 0 additions & 21 deletions Threads.Lib/Common.fs

This file was deleted.

16 changes: 0 additions & 16 deletions Threads.Lib/Common.fsi

This file was deleted.

2 changes: 0 additions & 2 deletions Threads.Lib/Media.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ open Thoth.Json.Net
open Flurl
open Flurl.Http

open Threads.Lib.Common

module Media =

[<Struct>]
Expand Down
2 changes: 1 addition & 1 deletion Threads.Lib/Media.fsi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Threads.Lib

open System
open Threads.Lib.Common


module Media =

Expand Down
18 changes: 18 additions & 0 deletions Threads.Lib/Pagination.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
open System
open Thoth.Json.Net


[<Struct>]
type IdLike = { id: string }

module IdLike =
let Decode: Decoder<IdLike> =
Decode.object(fun get -> {
id = get.Required.Field "id" Decode.string
})

[<Struct>]
type MediaProductType = | Threads

module MediaProductType =
let asString =
function
| Threads -> "THREADS"

type Cursor = { before: string; after: string }

module Cursor =
Expand Down
14 changes: 14 additions & 0 deletions Threads.Lib/Pagination.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ namespace Threads.Lib
open System
open Thoth.Json.Net

[<Struct>]
type IdLike = { id: string }

module internal IdLike =

val Decode: Decoder<IdLike>

[<Struct>]
type MediaProductType = | Threads

module internal MediaProductType =
val asString: MediaProductType -> string


type Cursor = { before: string; after: string }

module internal Cursor =
Expand Down
2 changes: 1 addition & 1 deletion Threads.Lib/Posts.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ open System
open Flurl
open Flurl.Http
open FsToolkit.ErrorHandling
open Threads.Lib.Common


module Posts =

Expand Down
2 changes: 1 addition & 1 deletion Threads.Lib/Posts.fsi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Threads.Lib

open System
open Threads.Lib.Common


module Posts =
[<Struct>]
Expand Down
2 changes: 1 addition & 1 deletion Threads.Lib/ReplyManagement.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ open System.Collections.Generic
open Thoth.Json.Net
open Flurl
open Flurl.Http
open Threads.Lib.Common


module ReplyManagement =
open System
Expand Down
2 changes: 1 addition & 1 deletion Threads.Lib/ReplyManagement.fsi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Threads.Lib

open Threads.Lib.Common


module ReplyManagement =
open System
Expand Down
4 changes: 1 addition & 3 deletions Threads.Lib/Threads.Lib.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
<PackageProjectUrl>https://AngelMunoz.github.io/Threads.Lib</PackageProjectUrl>
</PropertyGroup>
<ItemGroup>
<Compile Include="Common.fsi" />
<Compile Include="Common.fs" />
<Compile Include="Pagination.fsi" />
<Compile Include="Pagination.fs" />
<Compile Include="Posts.fsi" />
Expand All @@ -39,4 +37,4 @@
<ItemGroup>
<InternalsVisibleTo Include="$(AssemblyName).Tests" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion Threads.Lib/Threads.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Threads.Lib
open System.Threading
open System.Threading.Tasks
open System.Runtime.InteropServices
open Threads.Lib.Common


type InsightsService =
abstract FetchMediaInsights:
Expand Down
2 changes: 1 addition & 1 deletion Threads.Lib/Threads.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ open System.Threading
open System.Threading.Tasks
open System.Runtime.InteropServices

open Threads.Lib.Common


/// <summary>
/// The Threads Insights API allows you to read the insights from users' own Threads.
Expand Down

0 comments on commit 2cd4475

Please sign in to comment.