Skip to content

Commit

Permalink
Library 5.0.2 (#113)
Browse files Browse the repository at this point in the history
* nextcloud/ios#2390

Signed-off-by: Marino Faggiana <[email protected]>

* add async/await searchMedia

Signed-off-by: Marino Faggiana <[email protected]>

* Livephoto detect (#51)

* Update NKModel.swift

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* Fix build on macOS broken by freeDisk change (#53)

Signed-off-by: Claudio Cambra <[email protected]>

* livePhotoFile -> fileId

Signed-off-by: Marino Faggiana <[email protected]>

* rollback

Signed-off-by: Marino Faggiana <[email protected]>

* rollback

Signed-off-by: Marino Faggiana <[email protected]>

* Fix error description chunk

Signed-off-by: Marino Faggiana <[email protected]>

* chunk error fix

Signed-off-by: Marino Faggiana <[email protected]>

* errorDescription

Signed-off-by: Marino Faggiana <[email protected]>

* added description

Signed-off-by: Marino Faggiana <[email protected]>

* Change to markdown

Signed-off-by: Milen Pivchev <[email protected]>

* Added e2ee options versionApi

Signed-off-by: Marino Faggiana <[email protected]>

* change variable name

Signed-off-by: Marino Faggiana <[email protected]>

* endpoint update

Signed-off-by: Marino Faggiana <[email protected]>

* Fix chunk S3 (#56)

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>

* public func

Signed-off-by: Marino Faggiana <[email protected]>

* lint

Signed-off-by: Marino Faggiana <[email protected]>

* remove description

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* fix log

Signed-off-by: Marino Faggiana <[email protected]>

* Resolution - GPS (#59)

* fix resolution-gps

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>

* set h, w to Double

Signed-off-by: Marino Faggiana <[email protected]>

* coding (#61)

Signed-off-by: Marino Faggiana <[email protected]>

* normalized taskHandler
            taskHandler(task)
        }.

Signed-off-by: Marino Faggiana <[email protected]>

* add filename in trash (#63)

* add filename

Signed-off-by: Marino Faggiana <[email protected]>

* disable Build and test

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>

* Nextcloud Assistant (#66)

* getTextProcessingTaskTypes

Signed-off-by: Marino Faggiana <[email protected]>

* getTextProcessingTaskTypes

Signed-off-by: Marino Faggiana <[email protected]>

* NKTextProcessingTaskTypes

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Add init

Signed-off-by: Milen Pivchev <[email protected]>

* Change model

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>
Co-authored-by: Milen Pivchev <[email protected]>

* Add support for visionOS, fix tvOS and watchOS support (#67)

* Add CoreServices import for visionOS

Signed-off-by: Claudio Cambra <[email protected]>

* Fix screen scaling calculation when UIScreen is not available (for visionOS)

Signed-off-by: Claudio Cambra <[email protected]>

* Fix availability of UIImage.resizeImage on non iOS platforms

Signed-off-by: Claudio Cambra <[email protected]>

* Add visionOS target support to NextcloudKit

Signed-off-by: Claudio Cambra <[email protected]>

* Bump watchOS version up, per dependency requirements

Signed-off-by: Claudio Cambra <[email protected]>

* Remove reachability observation on watchOS, as this is unsupported in Alamofire

Signed-off-by: Claudio Cambra <[email protected]>

* Remove free disk calculation on watchOS which cannot be done

Signed-off-by: Claudio Cambra <[email protected]>

* Bump up tvOS version per dependencies

Signed-off-by: Claudio Cambra <[email protected]>

* Also restrict free space calculation on tvOS, as unavailable

Signed-off-by: Claudio Cambra <[email protected]>

---------

Signed-off-by: Claudio Cambra <[email protected]>

* Task description (#70)

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* task.taskDescription

Signed-off-by: Marino Faggiana <[email protected]>

* DownloadingFinish

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* improvements

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>

* change TypeIconFile (#71)

Signed-off-by: Marino Faggiana <[email protected]>

* Core Preview Improvements and use only fileId

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* improvements

Signed-off-by: Marino Faggiana <[email protected]>

* Improvements

Signed-off-by: Marino Faggiana <[email protected]>

* added compressionQuality

Signed-off-by: Marino Faggiana <[email protected]>

* Improvements (#76)



Signed-off-by: Marino Faggiana <[email protected]>

* improved code

Signed-off-by: Marino Faggiana <[email protected]>

* fix paramenters default

Signed-off-by: Marino Faggiana <[email protected]>

* fix paramenters default

Signed-off-by: Marino Faggiana <[email protected]>

* improvements

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* improvements

Signed-off-by: Marino Faggiana <[email protected]>

* downloadPreview

Signed-off-by: Marino Faggiana <[email protected]>

* added downloadPreview url

Signed-off-by: Marino Faggiana <[email protected]>

* httpCookieStorage (#80)


Signed-off-by: Marino Faggiana <[email protected]>

* new getUserProfile()

Signed-off-by: Marino Faggiana <[email protected]>

* change paramenter name

Signed-off-by: Marino Faggiana <[email protected]>

* Account (#82)

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* Revert "cod"

This reverts commit 83b75a1.

Signed-off-by: Marino Faggiana <[email protected]>

* Filename validator (#83)

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* cleanup

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Make singleton

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>

* fix session delegate

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* Filename validator (#92)

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* cleanup

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Make singleton

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
Co-authored-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* NextcloudKit Version 5 - Multisession  (#94)


---------

Signed-off-by: Marino Faggiana <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>
Co-authored-by: Milen Pivchev <[email protected]>

* NextcloudKit V 5

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* requestCachePolicy

Signed-off-by: Marino Faggiana <[email protected]>

* cache

Signed-off-by: Marino Faggiana <[email protected]>

* cache

Signed-off-by: Marino Faggiana <[email protected]>

* cache

Signed-off-by: Marino Faggiana <[email protected]>

* Add optional spaces and periods - WCF

Signed-off-by: Milen Pivchev <[email protected]>

WIP

Signed-off-by: Milen Pivchev <[email protected]>

WIP

Signed-off-by: Milen Pivchev <[email protected]>

WIP

Signed-off-by: Milen Pivchev <[email protected]>

WIP

Signed-off-by: Milen Pivchev <[email protected]>

WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Response (#97)

* API

Signed-off-by: Marino Faggiana <[email protected]>

* assistant

Signed-off-by: Marino Faggiana <[email protected]>

* comments

Signed-off-by: Marino Faggiana <[email protected]>

* dashboard

Signed-off-by: Marino Faggiana <[email protected]>

* e2ee

Signed-off-by: Marino Faggiana <[email protected]>

* groupfolders

Signed-off-by: Marino Faggiana <[email protected]>

* hovercard

Signed-off-by: Marino Faggiana <[email protected]>

* login

Signed-off-by: Marino Faggiana <[email protected]>

* nctext

Signed-off-by: Marino Faggiana <[email protected]>

* pn

Signed-off-by: Marino Faggiana <[email protected]>

* richdocuments

Signed-off-by: Marino Faggiana <[email protected]>

* search

Signed-off-by: Marino Faggiana <[email protected]>

* share

Signed-off-by: Marino Faggiana <[email protected]>

* userstatus

Signed-off-by: Marino Faggiana <[email protected]>

* webdav

Signed-off-by: Marino Faggiana <[email protected]>

* upload

Signed-off-by: Marino Faggiana <[email protected]>

* API

Signed-off-by: Marino Faggiana <[email protected]>

* download

Signed-off-by: Marino Faggiana <[email protected]>

* upload

Signed-off-by: Marino Faggiana <[email protected]>

* NextcloudKitSessionDelegate

Signed-off-by: Marino Faggiana <[email protected]>

* normalized

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>

* ThreadSafeArray

Signed-off-by: Marino Faggiana <[email protected]>

* logger delegate

Signed-off-by: Marino Faggiana <[email protected]>

* fix message 503

Signed-off-by: Marino Faggiana <[email protected]>

* public

Signed-off-by: Marino Faggiana <[email protected]>

* fix error

Signed-off-by: Marino Faggiana <[email protected]>

* Add reuse compliance (#96)

* Auto rename (#99)

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* License

Signed-off-by: Milen Pivchev <[email protected]>

* Licenses

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Swiftlint fixes

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Fix lint issue

Signed-off-by: Milen Pivchev <[email protected]>

* Fix ordering

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* License

Signed-off-by: Milen Pivchev <[email protected]>

* Licenses

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Swiftlint fixes

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Fix lint issue

Signed-off-by: Milen Pivchev <[email protected]>

* Fix ordering

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
Co-authored-by: Marino Faggiana <[email protected]>

* Keep original extension

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* License (#102)

Signed-off-by: Marino Faggiana <[email protected]>

* ( multipathServiceType )

Signed-off-by: Marino Faggiana <[email protected]>

* Add more extensive test for AutoRenamer (#101)

* Add more extensive test

Signed-off-by: Milen Pivchev <[email protected]>

* Force check

Signed-off-by: Milen Pivchev <[email protected]>

* Revert "Force check"

This reverts commit b7fadf6.

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
Co-authored-by: Marino Faggiana <[email protected]>

* Split NKModel.swift into designated source code files for every contained type.

Signed-off-by: Iva Horn <[email protected]>

* Update README.md (#106)

Signed-off-by: Milen Pivchev <[email protected]>

* Prettier Landing Page (#108)

- Replaced logo with an self-created image based on the Apple symbol design for frameworks.
- Removed the "V 2" in the top level heading because it contradicts the current major version 5.
- Corrected alt text of image which appears to be copied and pasted from Nextcloud iOS app README.
- Improved orthography on testing headings.
- Added syntax definitions to some code fences.
- Minor formatting improvements.

* Reenabled build on macOS. (#109)

Certain APIs used were not available on macOS in general or the currently supported version per package manifest. I added necessary code switches to make the code at least build again.

Co-authored-by: Marino Faggiana <[email protected]>

* Track ocId in NKTrash items (#110)

Signed-off-by: Claudio Cambra <[email protected]>

* Dav pagination (#111)

* add paginate

Signed-off-by: Marino Faggiana <[email protected]>

* StandardHeaders

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>

* Terms of Service (#112)

* tos

Signed-off-by: Marino Faggiana <[email protected]>

* getTermsOfService

Signed-off-by: Marino Faggiana <[email protected]>

* getTermsOfService

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* signTermsOfService

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>
Signed-off-by: Claudio Cambra <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>
Signed-off-by: Iva Horn <[email protected]>
Co-authored-by: Marino Faggiana <[email protected]>
Co-authored-by: Claudio Cambra <[email protected]>
Co-authored-by: Milen Pivchev <[email protected]>
Co-authored-by: Andy Scherzinger <[email protected]>
Co-authored-by: Iva Horn <[email protected]>
  • Loading branch information
6 people authored Dec 14, 2024
1 parent 154a5cc commit 66d54a9
Show file tree
Hide file tree
Showing 34 changed files with 1,077 additions and 589 deletions.
71 changes: 0 additions & 71 deletions .github/workflows/xcode.xxx

This file was deleted.

96 changes: 96 additions & 0 deletions .github/workflows/xcode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: GPL-3.0-or-later
name: Build and test

on:
push:
branches:
- master
- develop
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
branches:
- master
- develop

env:
DESTINATION_IOS: platform=iOS Simulator,name=iPhone 16,OS=18.1
DESTINATION_MACOS: platform=macOS,arch=x86_64
SCHEME: NextcloudKit
SERVER_BRANCH: stable28
PHP_VERSION: 8.2

jobs:
build-and-test:
name: Build and Test
runs-on: macos-15
if: github.event.pull_request.draft == false
steps:
- name: Set env var
run: echo "DEVELOPER_DIR=$(xcode-select --print-path)" >> $GITHUB_ENV
- uses: actions/checkout@v4

- name: Set up php ${{ env.PHP_VERSION }}
uses: shivammathur/setup-php@8872c784b04a1420e81191df5d64fbd59d3d3033 # v2.30.0
with:
php-version: ${{ env.PHP_VERSION }}
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
extensions: apcu, bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, pgsql, pdo_pgsql
coverage: none
ini-file: development
# Temporary workaround for missing pcntl_* in PHP 8.3: ini-values: apc.enable_cli=on
ini-values: apc.enable_cli=on, disable_functions=

- name: Checkout server
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: true
repository: nextcloud/server
path: server
ref: ${{ env.SERVER_BRANCH }}

- name: Set up Nextcloud
run: |
mkdir server/data
./server/occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
./server/occ config:system:set hashing_default_password --value=true --type=boolean
./server/occ config:system:set auth.bruteforce.protection.enabled --value false --type bool
./server/occ config:system:set ratelimit.protection.enabled --value false --type bool
./server/occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu"
./server/occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu"
./server/occ background:cron
PHP_CLI_SERVER_WORKERS=5 php -S localhost:8080 -t server/ &
# - name: Setup Bundler and Install Gems
# run: |
# gem install bundler
# bundle install
# bundle update
# - name: Install docker
# run: |
# # Workaround for https://github.com/actions/runner-images/issues/8104
# brew remove --ignore-dependencies qemu
# curl -o ./qemu.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/dc0669eca9479e9eeb495397ba3a7480aaa45c2e/Formula/qemu.rb
# brew install ./qemu.rb
#
# brew install docker
# colima start
# - name: Create docker test server and export enviroment variables
# run: |
# source ./create-docker-test-server.sh
# if [ ! -f ".env-vars" ]; then
# touch .env-vars
# echo "export TEST_SERVER_URL=$TEST_SERVER_URL" >> .env-vars
# echo "export TEST_USER=$TEST_USER" >> .env-vars
# echo "export TEST_APP_PASSWORD=$TEST_APP_PASSWORD" >> .env-vars
# fi
# - name: Generate EnvVars file
# run: |
# ./generate-env-vars.sh
- name: Build & Test NextcloudKit
run: |
set -o pipefail && xcodebuild test -scheme "$SCHEME" \
-destination "$DESTINATION_IOS" \
-test-iterations 3 \
-retry-tests-on-failure \
| xcpretty
Binary file modified NextcloudKit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added NextcloudKit.pxd
Binary file not shown.
48 changes: 36 additions & 12 deletions NextcloudKit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 21 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
- SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: GPL-3.0-or-later
-->
# NextcloudKit V 2
<img src="image.png" alt="Demo of the Nextcloud iOS files app" width="200" height="200">

[![REUSE status](https://api.reuse.software/badge/github.com/nextcloud/NextcloudKit)](https://api.reuse.software/info/github.com/nextcloud/NextcloudKit)
<div align="center">
<img src="NextcloudKit.png" alt="Logo of NextcloudKit" width="256" height="256" />
<h1>NextcloudKit</h1>
<img src="https://api.reuse.software/badge/github.com/nextcloud/NextcloudKit" alt="REUSE status" />
</div>

## Installation

### Carthage

[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

To integrate **NextcloudKit** into your Xcode project using Carthage, specify it in your `Cartfile`:
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate **NextcloudKit** into your Xcode project using Carthage, specify it in your `Cartfile`:

```
github "nextcloud/NextcloudKit" "main"
Expand All @@ -23,9 +23,7 @@ Run `carthage update` to build the framework and drag the built `NextcloudKit.fr

### Swift Package Manager

[Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.

Once you have your Swift package set up, adding NextcloudKit as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.
[Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. Once you have your Swift package set up, adding NextcloudKit as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.

```swift
dependencies: [
Expand All @@ -40,37 +38,26 @@ Then, add `NextcloudKit.xcodeproj` to your project, select your app target and a

## Testing

### Unit tests:
### Unit Tests

Since most functions in NextcloudKit involve a server call, you can mock the Alamofire session request. For that we use [Mocker](https://github.com/WeTransfer/Mocker).

### Integration tests:
To run integration tests, we need a docker instance of a Nextcloud test server.
The CI does all this automatically, but to do it manually:
1. Run `docker run --rm -d -p 8080:80 ghcr.io/juliushaertl/nextcloud-dev-php80:latest` to spin up a docker container of the Nextcloud test server.
2. Log in on the test server and generate an app password for device. There are a couple test accounts, but `admin` as username and password works best.
3. Run `./generate-env-vars.sh`. This will generate an `.env-vars` file in the root directory. It contains env vars that the project will use for testing.
4. Provide proper values for the env vars inside the file. Here is an example:
```
export TEST_SERVER_URL=http://localhost:8080
export TEST_USER=nextcloud
export TEST_PASSWORD=FAeSR-6Jk7s-DzLny-CCQHL-f49BP
```
5. Run `./generate-env-vars.sh` again to regenerate the env vars. If all the values are set correctly you will see a generated file called `EnvVars.generated.swift`. It contains the env vars as Swift fields that can be easily used in code:
```
/**
This is generated from the .env-vars file in the root directory. If there is an environment variable here that is needed and not filled, please look into this file.
*/
public struct EnvVars {
static let testUser = "nextcloud"
static let testPassword = "FAeSR-6Jk7s-DzLny-CCQHL-f49BP"
static let testServerUrl = "http://localhost:8080"
### Integration Tests
To run integration tests, you need a docker instance of a Nextcloud test server. [This](https://github.com/szaimen/nextcloud-easy-test) is a good start.

1. In `TestConstants.swift` you must specify your instance credentials. The app token is automatically generated.

```swift
public class TestConstants {
static let timeoutLong: Double = 400
static let server = "http://localhost:8080"
static let username = "admin"
static let password = "admin"
static let account = "\(username) \(server)"
}
```

Note that you always have to run `./generate-env-vars.sh` if you change the values inside `.env-vars`.

6. You can now run the integration tests. They will use the env vars to connect to the test server to do the testing.
2. Run the integration tests.

## Contribution Guidelines & License

Expand Down
4 changes: 2 additions & 2 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ SPDX-PackageSupplier = "2024 Nextcloud GmbH and Nextcloud contributors"
SPDX-PackageDownloadLocation = "https://github.com/nextcloud/NextcloudKit"

[[annotations]]
path = ["image.png", "NextcloudKit.png", "NextcloudKit.svg"]
path = ["NextcloudKit.png", "NextcloudKit.pxd", "NextcloudKit.svg"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2023 Nextcloud GmbH"
SPDX-FileCopyrightText = "2024 Nextcloud GmbH"
SPDX-License-Identifier = "LicenseRef-NextcloudTrademarks"

[[annotations]]
Expand Down
24 changes: 24 additions & 0 deletions Sources/NextcloudKit/Models/NKActivity.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2019 Marino Faggiana
// SPDX-FileCopyrightText: 2023 Claudio Cambra
// SPDX-License-Identifier: GPL-3.0-or-later

import Foundation

public class NKActivity: NSObject {
public var app = ""
public var date = Date()
public var idActivity: Int = 0
public var icon = ""
public var link = ""
public var message = ""
public var messageRich: Data?
public var objectId: Int = 0
public var objectName = ""
public var objectType = ""
public var previews: Data?
public var subject = ""
public var subjectRich: Data?
public var type = ""
public var user = ""
}
20 changes: 20 additions & 0 deletions Sources/NextcloudKit/Models/NKComments.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2019 Marino Faggiana
// SPDX-FileCopyrightText: 2023 Claudio Cambra
// SPDX-License-Identifier: GPL-3.0-or-later

import Foundation

public class NKComments: NSObject {
public var actorDisplayName = ""
public var actorId = ""
public var actorType = ""
public var creationDateTime = Date()
public var isUnread: Bool = false
public var message = ""
public var messageId = ""
public var objectId = ""
public var objectType = ""
public var path = ""
public var verb = ""
}
15 changes: 15 additions & 0 deletions Sources/NextcloudKit/Models/NKEditorDetailsCreators.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2019 Marino Faggiana
// SPDX-FileCopyrightText: 2023 Claudio Cambra
// SPDX-License-Identifier: GPL-3.0-or-later

import Foundation

public class NKEditorDetailsCreators: NSObject {
public var editor = ""
public var ext = ""
public var identifier = ""
public var mimetype = ""
public var name = ""
public var templates: Int = 0
}
13 changes: 13 additions & 0 deletions Sources/NextcloudKit/Models/NKEditorDetailsEditors.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2019 Marino Faggiana
// SPDX-FileCopyrightText: 2023 Claudio Cambra
// SPDX-License-Identifier: GPL-3.0-or-later

import Foundation

public class NKEditorDetailsEditors: NSObject {
public var mimetypes: [String] = []
public var name = ""
public var optionalMimetypes: [String] = []
public var secure: Int = 0
}
15 changes: 15 additions & 0 deletions Sources/NextcloudKit/Models/NKEditorTemplates.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2019 Marino Faggiana
// SPDX-FileCopyrightText: 2023 Claudio Cambra
// SPDX-License-Identifier: GPL-3.0-or-later

import Foundation

public class NKEditorTemplates: NSObject {
public var delete = ""
public var ext = ""
public var identifier = ""
public var name = ""
public var preview = ""
public var type = ""
}
16 changes: 16 additions & 0 deletions Sources/NextcloudKit/Models/NKExternalSite.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2019 Marino Faggiana
// SPDX-FileCopyrightText: 2023 Claudio Cambra
// SPDX-License-Identifier: GPL-3.0-or-later

import Foundation

public class NKExternalSite: NSObject {
public var icon = ""
public var idExternalSite: Int = 0
public var lang = ""
public var name = ""
public var order: Int = 0
public var type = ""
public var url = ""
}
Loading

0 comments on commit 66d54a9

Please sign in to comment.