feature/RemoveImports #1

Merged
CubeOfShame merged 2 commits from feature/RemoveImports into main 6 months ago
  1. 6
      .woodpecker.yml
  2. 3
      src/Account.fs
  3. 3
      src/Collection.fs
  4. 5
      src/CollectionInvitationManager.fs
  5. 4
      src/CollectionManager.fs
  6. 5
      src/CollectionMemberManager.fs
  7. 4
      src/Item.fs
  8. 3
      src/ItemManager.fs
  9. 5
      src/WebSocketHandle.fs
  10. 24
      test/Fable.Etebase.Tests/Account.Test.fs
  11. 10
      test/Fable.Etebase.Tests/Collection.Test.fs
  12. 10
      test/Fable.Etebase.Tests/CollectionManager.Test.fs
  13. 6
      test/Fable.Etebase.Tests/CollectionSharing.Test.fs
  14. 8
      test/Fable.Etebase.Tests/Item.Test.fs
  15. 8
      test/Fable.Etebase.Tests/ItemManager.Test.fs

@ -8,7 +8,7 @@ pipeline:
- pnpm i --unsafe-perm
- pnpm run test
when:
event: tag
event: [pull_request, tag]
publish:
image: docker.pkg.github.com/kaeedo/fablebuilder/fablebuild:latest
commands:
@ -23,5 +23,5 @@ pipeline:
services:
etebase-server:
image: etesync/test-server:latest
when:
event: tag
when:
event: [pull_request, tag]

@ -24,6 +24,7 @@ type IAccount =
abstract isEtebaseServer: serverUrl: string -> Promise<bool>
abstract restore: accountDataStored: string * ?encryptionKey: byte array -> Promise<Account>
[<AutoOpen>]
module Account =
[<Import("Account", "etebase")>]
let account: IAccount = jsNative
let Account: IAccount = jsNative

@ -26,6 +26,3 @@ type Collection =
abstract setMeta: metadata: #ItemMetadata -> unit
abstract getMeta<'a when 'a :> ItemMetadata> : unit -> 'a
module Collection =
[<Import("Collection", "etebase")>]
let collection: Collection = jsNative

@ -19,8 +19,3 @@ type CollectionInvitationManager =
abstract listIncoming: ?options: FetchOptions -> Promise<ListResponse<SignedInvitation>>
abstract listOutgoing: ?options: FetchOptions -> Promise<ListResponse<SignedInvitation>>
module CollectionInvitationManager =
[<Import("CollectionInvitationManager", "etebase")>]
let collectionInvitationManager: CollectionInvitationManager =
jsNative

@ -26,7 +26,3 @@ type CollectionManager =
abstract list:
callType: string array * ?options: CollectionManagerFetchOptions -> Promise<CollectionListResult<Collection>>
module CollectionManager =
[<Import("CollectionManager", "etebase")>]
let collectionManager: CollectionManager =
jsNative

@ -9,8 +9,3 @@ type CollectionMemberManager =
abstract remove: username: string -> Promise<unit>
abstract leave: unit -> Promise<unit>
abstract list: ?options: FetchOptions -> Promise<ListResponse<CollectionMember>>
module CollectionMemberManager =
[<Import("CollectionMemberManager", "etebase")>]
let collectionMemberManager: CollectionMemberManager =
jsNative

@ -22,7 +22,3 @@ type Item =
abstract setContent: content: string -> Promise<unit>
abstract setContent: content: byte array -> Promise<unit>
abstract delete: ?preserveContent: bool -> unit
module Item =
[<Import("Item", "etebase")>]
let item: Item = jsNative

@ -25,6 +25,3 @@ type ItemManager =
abstract cacheSave: item: Item * ?options: CacheSaveOptions -> byte array
abstract cacheLoad: cache: byte array -> Item
module ItemManager =
[<Import("ItemManager", "etebase")>]
let itemManager: ItemManager = jsNative

@ -7,8 +7,3 @@ open Fable.Core.JsInterop
type WebSocketHandle =
abstract connected: bool
abstract unsubscribe: unit -> Promise<unit>
module WebSocketHandle =
[<Import("WebSocketHandle", "etebase")>]
let webSocketHandle: WebSocketHandle =
jsNative

@ -14,7 +14,7 @@ Jest.describe (
(promise {
do!
Jest
.expect(Account.account.isEtebaseServer (TestHelpers.testData.Server))
.expect(Account.isEtebaseServer (TestHelpers.testData.Server))
.resolves.toBeTruthy ()
})
)
@ -23,7 +23,7 @@ Jest.describe (
"Should login",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -69,7 +69,7 @@ Jest.describe (
{ Fable.Etebase.User.email = randomEmail
username = randomUsername }
let! response = Account.account.signup (randomUser, randomPassword, TestHelpers.testData.Server)
let! response = Account.signup (randomUser, randomPassword, TestHelpers.testData.Server)
Jest
.expect(response.user.email.ToLowerInvariant())
@ -82,7 +82,7 @@ Jest.describe (
"Should logout",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -113,7 +113,7 @@ Jest.describe (
{ User.email = randomEmail
username = randomUsername }
let! response = Account.account.signup (randomUser, randomPassword, TestHelpers.testData.Server)
let! response = Account.signup (randomUser, randomPassword, TestHelpers.testData.Server)
do! Promise.sleep 200
Jest
@ -130,7 +130,7 @@ Jest.describe (
do! Promise.sleep 200
let! loggedInWithNewPassowrd =
Account.account.login (randomUsername, newRandomPassword, TestHelpers.testData.Server)
Account.login (randomUsername, newRandomPassword, TestHelpers.testData.Server)
Jest
.expect(loggedInWithNewPassowrd.user.username)
@ -143,7 +143,7 @@ Jest.describe (
"Should fetch token",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -166,7 +166,7 @@ Jest.describe (
"Should get dashboard url",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -187,7 +187,7 @@ Jest.describe (
"Should save and restore session",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -202,7 +202,7 @@ Jest.describe (
.expect(savedSession.Length)
.toBeGreaterThan (1)
let! restored = Account.account.restore (savedSession, encryptionKey)
let! restored = Account.restore (savedSession, encryptionKey)
Jest
.expect(restored.user.username)
@ -214,7 +214,7 @@ Jest.describe (
"Should get collection manager",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -230,7 +230,7 @@ Jest.describe (
"Should get invitation manager",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server

@ -34,7 +34,7 @@ Jest.describe (
"Should get collection type",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -67,7 +67,7 @@ Jest.describe (
"Should verify",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -95,7 +95,7 @@ Jest.describe (
"Should delete",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -125,7 +125,7 @@ Jest.describe (
"Should set and get meta data",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -164,7 +164,7 @@ Jest.describe (
"Should create and get content string",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server

@ -12,7 +12,7 @@ Jest.describe (
"Should list collections",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -45,7 +45,7 @@ Jest.describe (
"Should save and load to cache",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -85,7 +85,7 @@ Jest.describe (
"Should fetch single item",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -118,7 +118,7 @@ Jest.describe (
"Should get item manager",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -147,7 +147,7 @@ Jest.describe (
"Should get collection member manager",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server

@ -16,7 +16,7 @@ type CollectionItem =
member this.``type`` = None
Jest.describe.only (
Jest.describe (
"Collection Sharing tests",
fun () ->
Jest.test (
@ -24,7 +24,7 @@ Jest.describe.only (
(promise {
// Login as JessicaHyde and invite WilsonWilson
let! jessicaHyde =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -61,7 +61,7 @@ Jest.describe.only (
// Login as WilsonWilson and accept the invitation
let! wilsonWilson =
Account.account.login (
Account.login (
TestHelpers.testData.User2.Username,
TestHelpers.testData.User2.Password,
TestHelpers.testData.Server

@ -56,7 +56,7 @@ Jest.describe (
"Should verify",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -95,7 +95,7 @@ Jest.describe (
"Should delete",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -136,7 +136,7 @@ Jest.describe (
"Should set and get meta data",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -185,7 +185,7 @@ Jest.describe (
"Should get content",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server

@ -34,7 +34,7 @@ Jest.describe (
"Should create item",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -79,7 +79,7 @@ Jest.describe (
"Should save and load from cache",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -125,7 +125,7 @@ Jest.describe (
"Should upload and download content",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server
@ -172,7 +172,7 @@ Jest.describe (
"Should list items",
(promise {
let! loggedIn =
Account.account.login (
Account.login (
TestHelpers.testData.User1.Username,
TestHelpers.testData.User1.Password,
TestHelpers.testData.Server

Loading…
Cancel
Save