From 2cd4475427150ad0c53ce939b8241a730d080645 Mon Sep 17 00:00:00 2001 From: "Angel D. Munoz" Date: Sun, 3 Nov 2024 11:51:11 -0600 Subject: [PATCH] refactor: remove common namespace. just use the top level namespace --- Sample/Profile.fs | 2 +- Threads.Lib.Tests/Media.fs | 2 +- Threads.Lib.Tests/Pagination.fs | 2 +- Threads.Lib.Tests/Posts.fs | 2 +- Threads.Lib.Tests/Profiles.fs | 2 +- Threads.Lib.Tests/ReplyManagement.fs | 2 +- Threads.Lib/Common.fs | 21 --------------------- Threads.Lib/Common.fsi | 16 ---------------- Threads.Lib/Media.fs | 2 -- Threads.Lib/Media.fsi | 2 +- Threads.Lib/Pagination.fs | 18 ++++++++++++++++++ Threads.Lib/Pagination.fsi | 14 ++++++++++++++ Threads.Lib/Posts.fs | 2 +- Threads.Lib/Posts.fsi | 2 +- Threads.Lib/ReplyManagement.fs | 2 +- Threads.Lib/ReplyManagement.fsi | 2 +- Threads.Lib/Threads.Lib.fsproj | 4 +--- Threads.Lib/Threads.fs | 2 +- Threads.Lib/Threads.fsi | 2 +- 19 files changed, 46 insertions(+), 55 deletions(-) delete mode 100644 Threads.Lib/Common.fs delete mode 100644 Threads.Lib/Common.fsi diff --git a/Sample/Profile.fs b/Sample/Profile.fs index d52b0ec..ac174ce 100644 --- a/Sample/Profile.fs +++ b/Sample/Profile.fs @@ -18,7 +18,7 @@ open Navs open Navs.Avalonia open Threads.Lib -open Threads.Lib.Common + open Threads.Lib.Profiles module Profile = diff --git a/Threads.Lib.Tests/Media.fs b/Threads.Lib.Tests/Media.fs index 7e20e52..0f12673 100644 --- a/Threads.Lib.Tests/Media.fs +++ b/Threads.Lib.Tests/Media.fs @@ -13,7 +13,7 @@ open Flurl.Http open Flurl.Http.Testing open Threads.Lib -open Threads.Lib.Common + open Threads.Lib.Media diff --git a/Threads.Lib.Tests/Pagination.fs b/Threads.Lib.Tests/Pagination.fs index 140281a..4be287b 100644 --- a/Threads.Lib.Tests/Pagination.fs +++ b/Threads.Lib.Tests/Pagination.fs @@ -6,7 +6,7 @@ open Flurl.Util open Flurl.Http.Testing open Microsoft.VisualStudio.TestTools.UnitTesting open Threads.Lib -open Threads.Lib.Common + [] type PaginationTests() = diff --git a/Threads.Lib.Tests/Posts.fs b/Threads.Lib.Tests/Posts.fs index 05f4a5b..fe16c0b 100644 --- a/Threads.Lib.Tests/Posts.fs +++ b/Threads.Lib.Tests/Posts.fs @@ -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 diff --git a/Threads.Lib.Tests/Profiles.fs b/Threads.Lib.Tests/Profiles.fs index dd7b7ec..24d424f 100644 --- a/Threads.Lib.Tests/Profiles.fs +++ b/Threads.Lib.Tests/Profiles.fs @@ -11,7 +11,7 @@ open Flurl.Http open Flurl.Http.Testing open Threads.Lib -open Threads.Lib.Common + open Threads.Lib.Profiles [] diff --git a/Threads.Lib.Tests/ReplyManagement.fs b/Threads.Lib.Tests/ReplyManagement.fs index 1e39c9e..3777379 100644 --- a/Threads.Lib.Tests/ReplyManagement.fs +++ b/Threads.Lib.Tests/ReplyManagement.fs @@ -10,7 +10,7 @@ open Flurl.Http open Flurl.Http.Testing open Threads.Lib -open Threads.Lib.Common + open Threads.Lib.ReplyManagement diff --git a/Threads.Lib/Common.fs b/Threads.Lib/Common.fs deleted file mode 100644 index 95a052f..0000000 --- a/Threads.Lib/Common.fs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Threads.Lib.Common - - -open Thoth.Json.Net - -[] -type IdLike = { id: string } - -module IdLike = - let Decode: Decoder = - Decode.object(fun get -> { - id = get.Required.Field "id" Decode.string - }) - -[] -type MediaProductType = | Threads - -module MediaProductType = - let asString = - function - | Threads -> "THREADS" diff --git a/Threads.Lib/Common.fsi b/Threads.Lib/Common.fsi deleted file mode 100644 index 81ee7f5..0000000 --- a/Threads.Lib/Common.fsi +++ /dev/null @@ -1,16 +0,0 @@ -namespace Threads.Lib.Common - -open Thoth.Json.Net - -[] -type IdLike = { id: string } - -module internal IdLike = - - val Decode: Decoder - -[] -type MediaProductType = | Threads - -module internal MediaProductType = - val asString: MediaProductType -> string diff --git a/Threads.Lib/Media.fs b/Threads.Lib/Media.fs index d365654..20692fd 100644 --- a/Threads.Lib/Media.fs +++ b/Threads.Lib/Media.fs @@ -6,8 +6,6 @@ open Thoth.Json.Net open Flurl open Flurl.Http -open Threads.Lib.Common - module Media = [] diff --git a/Threads.Lib/Media.fsi b/Threads.Lib/Media.fsi index 1ec3dbc..9567104 100644 --- a/Threads.Lib/Media.fsi +++ b/Threads.Lib/Media.fsi @@ -1,7 +1,7 @@ namespace Threads.Lib open System -open Threads.Lib.Common + module Media = diff --git a/Threads.Lib/Pagination.fs b/Threads.Lib/Pagination.fs index 1e62395..130eef8 100644 --- a/Threads.Lib/Pagination.fs +++ b/Threads.Lib/Pagination.fs @@ -3,6 +3,24 @@ open System open Thoth.Json.Net + +[] +type IdLike = { id: string } + +module IdLike = + let Decode: Decoder = + Decode.object(fun get -> { + id = get.Required.Field "id" Decode.string + }) + +[] +type MediaProductType = | Threads + +module MediaProductType = + let asString = + function + | Threads -> "THREADS" + type Cursor = { before: string; after: string } module Cursor = diff --git a/Threads.Lib/Pagination.fsi b/Threads.Lib/Pagination.fsi index 7a49743..b5d1ccd 100644 --- a/Threads.Lib/Pagination.fsi +++ b/Threads.Lib/Pagination.fsi @@ -3,6 +3,20 @@ namespace Threads.Lib open System open Thoth.Json.Net +[] +type IdLike = { id: string } + +module internal IdLike = + + val Decode: Decoder + +[] +type MediaProductType = | Threads + +module internal MediaProductType = + val asString: MediaProductType -> string + + type Cursor = { before: string; after: string } module internal Cursor = diff --git a/Threads.Lib/Posts.fs b/Threads.Lib/Posts.fs index 4d45136..126a04b 100644 --- a/Threads.Lib/Posts.fs +++ b/Threads.Lib/Posts.fs @@ -4,7 +4,7 @@ open System open Flurl open Flurl.Http open FsToolkit.ErrorHandling -open Threads.Lib.Common + module Posts = diff --git a/Threads.Lib/Posts.fsi b/Threads.Lib/Posts.fsi index bacef5b..5d7d25f 100644 --- a/Threads.Lib/Posts.fsi +++ b/Threads.Lib/Posts.fsi @@ -1,7 +1,7 @@ namespace Threads.Lib open System -open Threads.Lib.Common + module Posts = [] diff --git a/Threads.Lib/ReplyManagement.fs b/Threads.Lib/ReplyManagement.fs index 2a24b30..a2f9fef 100644 --- a/Threads.Lib/ReplyManagement.fs +++ b/Threads.Lib/ReplyManagement.fs @@ -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 diff --git a/Threads.Lib/ReplyManagement.fsi b/Threads.Lib/ReplyManagement.fsi index f584bb5..c301e80 100644 --- a/Threads.Lib/ReplyManagement.fsi +++ b/Threads.Lib/ReplyManagement.fsi @@ -1,6 +1,6 @@ namespace Threads.Lib -open Threads.Lib.Common + module ReplyManagement = open System diff --git a/Threads.Lib/Threads.Lib.fsproj b/Threads.Lib/Threads.Lib.fsproj index 73cd048..a8debdf 100644 --- a/Threads.Lib/Threads.Lib.fsproj +++ b/Threads.Lib/Threads.Lib.fsproj @@ -12,8 +12,6 @@ https://AngelMunoz.github.io/Threads.Lib - - @@ -39,4 +37,4 @@ - + \ No newline at end of file diff --git a/Threads.Lib/Threads.fs b/Threads.Lib/Threads.fs index 36064bd..2cddb54 100644 --- a/Threads.Lib/Threads.fs +++ b/Threads.Lib/Threads.fs @@ -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: diff --git a/Threads.Lib/Threads.fsi b/Threads.Lib/Threads.fsi index 1399bff..afb185f 100644 --- a/Threads.Lib/Threads.fsi +++ b/Threads.Lib/Threads.fsi @@ -4,7 +4,7 @@ open System.Threading open System.Threading.Tasks open System.Runtime.InteropServices -open Threads.Lib.Common + /// /// The Threads Insights API allows you to read the insights from users' own Threads.