http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-acknowledgements.plist ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-acknowledgements.plist b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-acknowledgements.plist new file mode 100644 index 0000000..b7c5ce3 --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-acknowledgements.plist @@ -0,0 +1,364 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>PreferenceSpecifiers</key> + <array> + <dict> + <key>FooterText</key> + <string>This application makes use of the following third party libraries:</string> + <key>Title</key> + <string>Acknowledgements</string> + <key>Type</key> + <string>PSGroupSpecifier</string> + </dict> + <dict> + <key>FooterText</key> + <string> +Apache Usergrid itself is licensed under the terms of the Apache License: + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +------------------------------------------------------------------------------ + +USERGRID SUBCOMPONENTS + +The Usergrid software includes a number of subcomponents with separate +copyrights and license terms. Your use of the source code for these +subcomponents is subject to the terms and conditions of the following +licenses. + +IOS SDK +------- +For the SBJson component: + + Copyright (c) Stig Brautaset. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the author nor the names of its contributors may be used + to endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +For the SSKeychain component: +----------------------------- + + Copyright (c) Sam Soffes, http://soff.es + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Other components: +----------------- + +This product bundles angular.js +Copyright(c) Google, Inc. Released under the MIT license. + +This product bundles angular-scenario.js, part of jQuery JavaScript Library +which Includes Sizzle.js Copyright (c) jQuery Foundation, Inc. and others. +Released under the MIT license. + +This product bundles Bootstrap Copyright (c) Twitter, Inc +Licensed under the MIT license. + +The product bundles Intro.js (MIT licensed) +Copyright (c) usabli.ca - A weekend project by Afshin Mehrabani (@afshinmeh) + +This product bundles jQuery +Licensed under MIT license. + +This product bundles jQuery-UI +Licensed under MIT license. + +This product bundles jQuery Sparklines (New BSD License) +Copyright (c) Splunk Inc. + +This product bundles Mocha. +All rights reserved. Licensed under MIT. +Copyright (c) TJ Holowaychuk <[email protected]> + +This product bundles NewtonSoft.Json under MIT license + +This product bundles NPM MD5 (BSD-3 licensed) +Copyright (c) Paul Vorbach and Copyright (C), Jeff Mott. + +This product bundles NSubsttute under BSD license + +This product bundles SBJson, which is available under a "3-clause BSD" license. +For details, see sdks/ios/UGAPI/SBJson/ . + +This product bundles Sphinx under BSD license + +This product bundles SSKeychain, which is available under a "MIT/X11" license. +For details, see sdks/ios/UGAPI/SSKeychain/. + +This product bundles SSToolkit. +Copyright (c) Sam Soffes. All rights reserved. +These files can be located within the /sdks/ios package. + +This product bundles Entypo, CC by SA license + +This product bundles date.min.js, MIT license + +This product bundles jquery.ui.timepicker.min.js, MIT license + +This product bundles blanket_mocha.min.js, MIT license + +This product bundles FontAwesome, SIL Open Font License + +</string> + <key>Title</key> + <string>UsergridSDK</string> + <key>Type</key> + <string>PSGroupSpecifier</string> + </dict> + <dict> + <key>FooterText</key> + <string>Generated by CocoaPods - http://cocoapods.org</string> + <key>Title</key> + <string></string> + <key>Type</key> + <string>PSGroupSpecifier</string> + </dict> + </array> + <key>StringsTable</key> + <string>Acknowledgements</string> + <key>Title</key> + <string>Acknowledgements</string> +</dict> +</plist>
http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-dummy.m ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-dummy.m b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-dummy.m new file mode 100644 index 0000000..ade64bd --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-dummy.m @@ -0,0 +1,5 @@ +#import <Foundation/Foundation.h> +@interface PodsDummy_Pods : NSObject +@end +@implementation PodsDummy_Pods +@end http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-frameworks.sh ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-frameworks.sh b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-frameworks.sh new file mode 100755 index 0000000..df01da7 --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-frameworks.sh @@ -0,0 +1,91 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # use filter instead of exclude so missing patterns dont' throw errors + echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" + /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "Pods/UsergridSDK.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "Pods/UsergridSDK.framework" +fi http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-resources.sh ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-resources.sh b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-resources.sh new file mode 100755 index 0000000..16774fb --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-resources.sh @@ -0,0 +1,95 @@ +#!/bin/sh +set -e + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +realpath() { + DIRECTORY="$(cd "${1%/*}" && pwd)" + FILENAME="${1##*/}" + echo "$DIRECTORY/$FILENAME" +} + +install_resource() +{ + case $1 in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.framework) + echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" + xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + /*) + echo "$1" + echo "$1" >> "$RESOURCES_TO_COPY" + ;; + *) + echo "${PODS_ROOT}/$1" + echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; + esac + + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "`realpath $PODS_ROOT`*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-umbrella.h ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-umbrella.h b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-umbrella.h new file mode 100644 index 0000000..21dcfd2 --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods-umbrella.h @@ -0,0 +1,6 @@ +#import <UIKit/UIKit.h> + + +FOUNDATION_EXPORT double PodsVersionNumber; +FOUNDATION_EXPORT const unsigned char PodsVersionString[]; + http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods.debug.xcconfig ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods.debug.xcconfig b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods.debug.xcconfig new file mode 100644 index 0000000..27fa509 --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods.debug.xcconfig @@ -0,0 +1,8 @@ +EMBEDDED_CONTENT_CONTAINS_SWIFT = YES +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/UsergridSDK.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "UsergridSDK" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods.modulemap ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods.modulemap b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods.modulemap new file mode 100644 index 0000000..8413413 --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods.modulemap @@ -0,0 +1,6 @@ +framework module Pods { + umbrella header "Pods-umbrella.h" + + export * + module * { export * } +} http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods.release.xcconfig ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods.release.xcconfig b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods.release.xcconfig new file mode 100644 index 0000000..27fa509 --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/Target Support Files/Pods/Pods.release.xcconfig @@ -0,0 +1,8 @@ +EMBEDDED_CONTENT_CONTAINS_SWIFT = YES +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/UsergridSDK.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "UsergridSDK" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/Info.plist ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/Info.plist b/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/Info.plist new file mode 100644 index 0000000..ae52e8b --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/Info.plist @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>en</string> + <key>CFBundleExecutable</key> + <string>${EXECUTABLE_NAME}</string> + <key>CFBundleIdentifier</key> + <string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundlePackageType</key> + <string>FMWK</string> + <key>CFBundleShortVersionString</key> + <string>2.1.0-RC.2</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>${CURRENT_PROJECT_VERSION}</string> + <key>NSPrincipalClass</key> + <string></string> +</dict> +</plist> http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK-dummy.m ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK-dummy.m b/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK-dummy.m new file mode 100644 index 0000000..c231e39 --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK-dummy.m @@ -0,0 +1,5 @@ +#import <Foundation/Foundation.h> +@interface PodsDummy_UsergridSDK : NSObject +@end +@implementation PodsDummy_UsergridSDK +@end http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK-prefix.pch ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK-prefix.pch b/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import <UIKit/UIKit.h> +#endif + http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK-umbrella.h ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK-umbrella.h b/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK-umbrella.h new file mode 100644 index 0000000..1e40702 --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK-umbrella.h @@ -0,0 +1,6 @@ +#import <UIKit/UIKit.h> + + +FOUNDATION_EXPORT double UsergridSDKVersionNumber; +FOUNDATION_EXPORT const unsigned char UsergridSDKVersionString[]; + http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK.modulemap ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK.modulemap b/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK.modulemap new file mode 100644 index 0000000..caee652 --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK.modulemap @@ -0,0 +1,6 @@ +framework module UsergridSDK { + umbrella header "UsergridSDK-umbrella.h" + + export * + module * { export * } +} http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK.xcconfig ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK.xcconfig b/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK.xcconfig new file mode 100644 index 0000000..09aaf07 --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/Target Support Files/UsergridSDK/UsergridSDK.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/UsergridSDK" "${PODS_ROOT}/Headers/Public" +OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/UsergridSDK/LICENSE ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/UsergridSDK/LICENSE b/sdks/swift/Samples/Push/Pods/UsergridSDK/LICENSE new file mode 100644 index 0000000..a4b9abe --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/UsergridSDK/LICENSE @@ -0,0 +1,327 @@ + +Apache Usergrid itself is licensed under the terms of the Apache License: + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +------------------------------------------------------------------------------ + +USERGRID SUBCOMPONENTS + +The Usergrid software includes a number of subcomponents with separate +copyrights and license terms. Your use of the source code for these +subcomponents is subject to the terms and conditions of the following +licenses. + +IOS SDK +------- +For the SBJson component: + + Copyright (c) Stig Brautaset. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the author nor the names of its contributors may be used + to endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +For the SSKeychain component: +----------------------------- + + Copyright (c) Sam Soffes, http://soff.es + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Other components: +----------------- + +This product bundles angular.js +Copyright(c) Google, Inc. Released under the MIT license. + +This product bundles angular-scenario.js, part of jQuery JavaScript Library +which Includes Sizzle.js Copyright (c) jQuery Foundation, Inc. and others. +Released under the MIT license. + +This product bundles Bootstrap Copyright (c) Twitter, Inc +Licensed under the MIT license. + +The product bundles Intro.js (MIT licensed) +Copyright (c) usabli.ca - A weekend project by Afshin Mehrabani (@afshinmeh) + +This product bundles jQuery +Licensed under MIT license. + +This product bundles jQuery-UI +Licensed under MIT license. + +This product bundles jQuery Sparklines (New BSD License) +Copyright (c) Splunk Inc. + +This product bundles Mocha. +All rights reserved. Licensed under MIT. +Copyright (c) TJ Holowaychuk <[email protected]> + +This product bundles NewtonSoft.Json under MIT license + +This product bundles NPM MD5 (BSD-3 licensed) +Copyright (c) Paul Vorbach and Copyright (C), Jeff Mott. + +This product bundles NSubsttute under BSD license + +This product bundles SBJson, which is available under a "3-clause BSD" license. +For details, see sdks/ios/UGAPI/SBJson/ . + +This product bundles Sphinx under BSD license + +This product bundles SSKeychain, which is available under a "MIT/X11" license. +For details, see sdks/ios/UGAPI/SSKeychain/. + +This product bundles SSToolkit. +Copyright (c) Sam Soffes. All rights reserved. +These files can be located within the /sdks/ios package. + +This product bundles Entypo, CC by SA license + +This product bundles date.min.js, MIT license + +This product bundles jquery.ui.timepicker.min.js, MIT license + +This product bundles blanket_mocha.min.js, MIT license + +This product bundles FontAwesome, SIL Open Font License + http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/UsergridSDK/README-Docs.md ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/UsergridSDK/README-Docs.md b/sdks/swift/Samples/Push/Pods/UsergridSDK/README-Docs.md new file mode 100644 index 0000000..9d74c88 --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/UsergridSDK/README-Docs.md @@ -0,0 +1,13 @@ +Apache Usergrid Website and Docs +================================ + +Usergrid docs and website can be found in these directories: + +* __website__: This is the source for the website, it is written in Markdown and uses Pandoc to generate HTML. +* __docs__: This is the source for the documentation, it is written in Markdown and uses Sphinx to generate HTML. +* __contents__: This is the target directory for our website and docs generation tools. + +Refer to the README files in the __website__ and __docs__ directories for instructions on how to add and modify +the website and docs, how to run the generators and how to ensure that the __contents__ directory gets published +to __usergrid.apache.org__. + http://git-wip-us.apache.org/repos/asf/usergrid/blob/7442c881/sdks/swift/Samples/Push/Pods/UsergridSDK/sdks/swift/Source/Usergrid.swift ---------------------------------------------------------------------- diff --git a/sdks/swift/Samples/Push/Pods/UsergridSDK/sdks/swift/Source/Usergrid.swift b/sdks/swift/Samples/Push/Pods/UsergridSDK/sdks/swift/Source/Usergrid.swift new file mode 100644 index 0000000..78769ae --- /dev/null +++ b/sdks/swift/Samples/Push/Pods/UsergridSDK/sdks/swift/Source/Usergrid.swift @@ -0,0 +1,610 @@ +// +// Usergrid.swift +// UsergridSDK +// +// Created by Robert Walsh on 7/21/15. +// +/* + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. The ASF licenses this file to You + * under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. For additional information regarding + * copyright in this work, please see the NOTICE file in the top level + * directory of this distribution. + * + */ + +import Foundation + +/// The version number for the Usergrid Swift SDK. +public let UsergridSDKVersion = "2.1.0" + +/** + The `Usergrid` class acts as a static shared instance manager for the `UsergridClient` class. + + The methods and variables in this class are all static and therefore you will never need or want to initialize an instance of the `Usergrid` class. + + Use of this class depends on initialization of the shared instance of the `UsergridClient` object. Because of this, before using any of the static methods + provided you will need to call one of the shared instance initialization methods. Failure to do so will result in failure from all methods. + */ +public class Usergrid: NSObject { + + // MARK: - Static Variables - + + internal static var _sharedClient : UsergridClient! + + /// Used to determine if the shared instance of the `UsergridClient` has been initialized. + public static var isInitialized : Bool { return Usergrid._sharedClient != nil } + + /** + A shared instance of `UsergridClient`, used by the `Usergrid` static methods and acts as the default `UsergridClient` + within the UsergridSDK library. + + - Warning: You must call one of the `Usergrid.initSharedInstance` methods before this or any other `Usergrid` static methods are valid. + */ + public static var sharedInstance : UsergridClient { + assert(Usergrid.isInitialized, "Usergrid shared instance is not initalized!") + return Usergrid._sharedClient + } + + /// The application identifier the shared instance of `UsergridClient`. + public static var appId : String { return Usergrid.sharedInstance.appId } + + /// The organization identifier of the shared instance of `UsergridClient`. + public static var orgId : String { return Usergrid.sharedInstance.orgId } + + /// The base URL that all calls will be made with of the shared instance of `UsergridClient`. + public static var baseUrl : String { return Usergrid.sharedInstance.baseUrl } + + /// The constructed URL string based on the `UsergridClient`'s baseUrl, orgId, and appId of the shared instance of `UsergridClient`. + public static var clientAppURL : String { return Usergrid.sharedInstance.clientAppURL } + + /// The currently logged in `UsergridUser` of the shared instance of `UsergridClient`. + public static var currentUser: UsergridUser? { return Usergrid.sharedInstance.currentUser } + + /// The `UsergridUserAuth` which consists of the token information from the `currentUser` property of the shared instance of `UsergridClient`. + public static var userAuth: UsergridUserAuth? { return Usergrid.sharedInstance.userAuth } + + /// The application level `UsergridAppAuth` object of the shared instance of `UsergridClient`. + public static var appAuth: UsergridAppAuth? { + get{ return Usergrid.sharedInstance.appAuth } + set{ Usergrid.sharedInstance.appAuth = newValue } + } + + // MARK: - Initialization - + + /** + Initializes the `Usergrid.sharedInstance` of `UsergridClient`. + + - parameter orgId: The organization identifier. + - parameter appId: The application identifier. + + - returns: The shared instance of `UsergridClient`. + */ + public static func initSharedInstance(orgId orgId : String, appId: String) -> UsergridClient { + if !Usergrid.isInitialized { + Usergrid._sharedClient = UsergridClient(orgId: orgId, appId: appId) + } else { + print("The Usergrid shared instance was already initialized. All subsequent initialization attempts (including this) will be ignored.") + } + return Usergrid._sharedClient + } + + /** + Initializes the `Usergrid.sharedInstance` of `UsergridClient`. + + - parameter orgId: The organization identifier. + - parameter appId: The application identifier. + - parameter baseUrl: The base URL that all calls will be made with. + + - returns: The shared instance of `UsergridClient`. + */ + public static func initSharedInstance(orgId orgId : String, appId: String, baseUrl: String) -> UsergridClient { + if !Usergrid.isInitialized { + Usergrid._sharedClient = UsergridClient(orgId: orgId, appId: appId, baseUrl: baseUrl) + } else { + print("The Usergrid shared instance was already initialized. All subsequent initialization attempts (including this) will be ignored.") + } + return Usergrid._sharedClient + } + + /** + Initializes the `Usergrid.sharedInstance` of `UsergridClient`. + + - parameter configuration: The configuration for the client to be set up with. + + - returns: The shared instance of `UsergridClient`. + */ + public static func initSharedInstance(configuration configuration: UsergridClientConfig) -> UsergridClient { + if !Usergrid.isInitialized { + Usergrid._sharedClient = UsergridClient(configuration: configuration) + } else { + print("The Usergrid shared instance was already initialized. All subsequent initialization attempts (including this) will be ignored.") + } + return Usergrid._sharedClient + } + + // MARK: - Push Notifications - + + /** + Sets the push token for the given notifier ID and performs a PUT request to update the shared `UsergridDevice` instance using the shared instance of `UsergridCient`. + + - parameter pushToken: The push token from Apple. + - parameter notifierID: The Usergrid notifier ID. + - parameter completion: The completion block. + */ + public static func applyPushToken(pushToken: NSData, notifierID: String, completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.applyPushToken(pushToken, notifierID: notifierID, completion: completion) + } + + /** + Sets the push token for the given notifier ID and performs a PUT request to update the given `UsergridDevice` instance using the shared instance of `UsergridCient`. + + - parameter device: The `UsergridDevice` object. + - parameter pushToken: The push token from Apple. + - parameter notifierID: The Usergrid notifier ID. + - parameter completion: The completion block. + */ + public static func applyPushToken(device: UsergridDevice, pushToken: NSData, notifierID: String, completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.applyPushToken(device, pushToken: pushToken, notifierID: notifierID, completion: completion) + } + + + // MARK: - Authorization - + + /// The `UsergridAuthFallback` value used to determine what type of token will be sent of the shared instance of `UsergridClient`, if any. + public static var authFallback: UsergridAuthFallback { + get{ return Usergrid.sharedInstance.authFallback } + set { Usergrid.sharedInstance.authFallback = newValue } + } + + /** + Sets the shared `UsergridClient`'s `tempAuth` property using the passed in `UsergridAuth`. + + This will cause the next CRUD method performed by the client to use the `tempAuth` property once and will then reset. + + - parameter auth: The `UsergridAuth` object to temporarily use for authentication. + + - returns: The shared instance of `UsergridClient` + */ + public static func usingAuth(auth:UsergridAuth) -> UsergridClient { + return Usergrid.sharedInstance.usingAuth(auth) + } + + /** + Sets the shared `UsergridClient`'s `tempAuth` property using the passed in token. + + This will cause the next CRUD method performed by the client to use the `tempAuth` property once and will then reset. + + - parameter auth: The access token to temporarily use for authentication. + + - returns: The shared instance of `UsergridClient` + */ + public static func usingToken(token:String) -> UsergridClient { + return Usergrid.sharedInstance.usingToken(token) + } + + + /** + Determines the `UsergridAuth` object that will be used for all outgoing requests made by the shared instance of `UsergridClient`. + + If there is a `UsergridUser` logged in and the token of that user is valid then it will return that. + + Otherwise, if the `authFallback` is `.App`, and the `UsergridAppAuth` of the client is set and the token is valid it will return that. + + - returns: The `UsergridAuth` if one is found or nil if not. + */ + public static func authForRequests() -> UsergridAuth? { + return Usergrid.sharedInstance.authForRequests() + } + + /** + Authenticates with the `UsergridAppAuth` that is contained within the shared instance of `UsergridCient`. + + - parameter completion: The completion block that will be called after authentication has completed. + */ + public static func authenticateApp(completion: UsergridAppAuthCompletionBlock? = nil) { + Usergrid.sharedInstance.authenticateApp(completion) + } + + /** + Authenticates with the `UsergridAppAuth` that is passed in using the shared instance of `UsergridCient`. + + - parameter auth: The `UsergridAppAuth` that will be authenticated. + - parameter completion: The completion block that will be called after authentication has completed. + */ + public static func authenticateApp(auth: UsergridAppAuth, completion: UsergridAppAuthCompletionBlock? = nil) { + Usergrid.sharedInstance.authenticateApp(auth, completion: completion) + } + + /** + Authenticates with the `UsergridUserAuth` that is passed in using the shared instance of `UsergridCient`. + + - parameter auth: The `UsergridUserAuth` that will be authenticated. + - parameter completion: The completion block that will be called after authentication has completed. + */ + public static func authenticateUser(auth: UsergridUserAuth, completion: UsergridUserAuthCompletionBlock? = nil) { + Usergrid.sharedInstance.authenticateUser(auth, completion: completion) + } + + /** + Authenticates with the `UsergridUserAuth` that is passed in using the shared instance of `UsergridCient`. + + - parameter auth: The `UsergridUserAuth` that will be authenticated. + - parameter setAsCurrentUser: If the authenticated user should be set as the `UsergridClient.currentUser`. + - parameter completion: The completion block that will be called after authentication has completed. + */ + public static func authenticateUser(userAuth: UsergridUserAuth, setAsCurrentUser:Bool, completion: UsergridUserAuthCompletionBlock? = nil) { + Usergrid.sharedInstance.authenticateUser(userAuth, setAsCurrentUser: setAsCurrentUser, completion: completion) + } + + /** + Logs out the current user of the shared instance locally and remotely. + + - parameter completion: The completion block that will be called after logout has completed. + */ + public static func logoutCurrentUser(completion:UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.logoutCurrentUser(completion) + } + + /** + Logs out the user remotely with the given tokens using the shared instance of `UsergridCient`. + + - parameter completion: The completion block that will be called after logout has completed. + */ + public static func logoutUserAllTokens(uuidOrUsername:String, completion:UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.logoutUserAllTokens(uuidOrUsername, completion: completion) + } + + /** + Logs out a user with the give UUID or username using the shared instance of `UsergridCient`. + + Passing in a token will log out the user for just that token. Passing in nil for the token will logout the user for all tokens. + + - parameter completion: The completion block that will be called after logout has completed. + */ + public static func logoutUser(uuidOrUsername:String, token:String?, completion:UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.logoutUser(uuidOrUsername, token: token, completion: completion) + } + + // MARK: - Generic Request Methods - + + /** + Starts the `UsergridRequest` sending process using the shared instance of `UsergridCient`. + + - Note: This method should only be used when you construct your own `UsergridRequest objects. + + - parameter request: The `UsergridRequest` object to send. + - parameter completion: The optional completion block that will be called once the request has completed. + */ + public static func sendRequest(request:UsergridRequest, completion:UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.sendRequest(request, completion: completion) + } + + // MARK: - GET - + + /** + Gets a single `UsergridEntity` of a given type with a specific UUID/name using the shared instance of `UsergridCient`. + + - parameter type: The `UsergridEntity` type. + - parameter uuidOrName: The UUID or name of the `UsergridEntity`. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func GET(type: String, uuidOrName: String, completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.GET(type,uuidOrName:uuidOrName,completion:completion) + } + + /** + Gets a group of `UsergridEntity` objects of a given type with an optional query using the shared instance of `UsergridCient`. + + - parameter type: The `UsergridEntity` type. + - parameter query: The optional query to use when gathering `UsergridEntity` objects. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func GET(type: String, query: UsergridQuery? = nil, completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.GET(type,query:query,completion:completion) + } + + // MARK: - PUT - + + /** + Updates an `UsergridEntity` with the given type and UUID/name specified using the passed in jsonBody using the shared instance of `UsergridCient`. + + - parameter type: The `UsergridEntity` type. + - parameter uuidOrName: The UUID or name of the `UsergridEntity`. + - parameter jsonBody: The valid JSON body dictionary to update the `UsergridEntity` with. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func PUT(type: String, uuidOrName: String, jsonBody:[String:AnyObject], completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.PUT(type, uuidOrName: uuidOrName, jsonBody: jsonBody, completion: completion) + } + + /** + Updates an `UsergridEntity` with the given type using the jsonBody where the UUID/name is specified inside of the jsonBody using the shared instance of `UsergridCient`. + + - Note: The `jsonBody` must contain a valid value for either `uuid` or `name`. + + - parameter type: The `UsergridEntity` type. + - parameter jsonBody: The valid JSON body dictionary to update the `UsergridEntity` with. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func PUT(type: String, jsonBody:[String:AnyObject], completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.PUT(type, jsonBody: jsonBody, completion: completion) + } + + /** + Updates the passed in `UsergridEntity` using the shared instance of `UsergridCient`. + + - parameter entity: The `UsergridEntity` to update. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func PUT(entity: UsergridEntity, completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.PUT(entity, completion: completion) + } + + /** + Updates the entities that fit the given query using the passed in jsonBody using the shared instance of `UsergridCient`. + + - Note: The query parameter must have a valid `collectionName` before calling this method. + + - parameter query: The query to use when filtering what entities to update. + - parameter jsonBody: The valid JSON body dictionary to update with. + - parameter queryCompletion: The completion block that will be called once the request has completed. + */ + public static func PUT(query: UsergridQuery, jsonBody:[String:AnyObject], queryCompletion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.PUT(query, jsonBody: jsonBody, queryCompletion: queryCompletion) + } + + // MARK: - POST - + + /** + Creates and posts an `UsergridEntity` of the given type with a given name and the given jsonBody using the shared instance of `UsergridCient`. + + - parameter type: The `UsergridEntity` type. + - parameter name: The name of the `UsergridEntity`. + - parameter jsonBody: The valid JSON body dictionary to use when creating the `UsergridEntity`. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func POST(type: String, name: String, jsonBody:[String:AnyObject], completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.POST(type, name: name, jsonBody: jsonBody, completion: completion) + } + + /** + Creates and posts an `UsergridEntity` of the given type with the given jsonBody using the shared instance of `UsergridCient`. + + - parameter type: The `UsergridEntity` type. + - parameter jsonBody: The valid JSON body dictionary to use when creating the `UsergridEntity`. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func POST(type: String, jsonBody:[String:AnyObject], completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.POST(type, jsonBody: jsonBody, completion: completion) + } + + /** + Creates and posts an array of `Entity` objects while assinging the given type to them using the shared instance of `UsergridCient`. + + - parameter type: The `UsergridEntity` type. + - parameter jsonBody: The valid JSON body dictionaries to use when creating the `UsergridEntity` objects. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func POST(type: String, jsonBodies:[[String:AnyObject]], completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.POST(type, jsonBodies: jsonBodies, completion: completion) + } + + /** + Creates and posts creates an `UsergridEntity` using the shared instance of `UsergridCient`. + + - parameter entity: The `UsergridEntity` to create. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func POST(entity:UsergridEntity, completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.POST(entity, completion: completion) + } + + /** + Creates and posts an array of `UsergridEntity` objects using the shared instance of `UsergridCient`. + + - Note: Each `UsergridEntity` in the array much already have a type assigned and must be the same. + + - parameter entities: The `UsergridEntity` objects to create. + - parameter entitiesCompletion: The completion block that will be called once the request has completed. + */ + public static func POST(entities:[UsergridEntity], entitiesCompletion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.POST(entities, entitiesCompletion: entitiesCompletion) + } + + // MARK: - DELETE - + + /** + Destroys the `UsergridEntity` of a given type with a specific UUID/name using the shared instance of `UsergridCient`. + + - parameter type: The `UsergridEntity` type. + - parameter uuidOrName: The UUID or name of the `UsergridEntity`. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func DELETE(type:String, uuidOrName: String, completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.DELETE(type, uuidOrName: uuidOrName, completion: completion) + } + + /** + Destroys the passed `UsergridEntity` using the shared instance of `UsergridCient`. + + - Note: The entity object must have a `uuid` or `name` assigned. + + - parameter entity: The `UsergridEntity` to delete. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func DELETE(entity:UsergridEntity, completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.DELETE(entity, completion:completion) + } + + /** + Destroys the `UsergridEntity` objects that fit the given `UsergridQuery` using the shared instance of `UsergridCient`. + + - Note: The query parameter must have a valid `collectionName` before calling this method. + + - parameter query: The query to use when filtering what entities to delete. + - parameter queryCompletion: The completion block that will be called once the request has completed. + */ + public static func DELETE(query:UsergridQuery, queryCompletion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.DELETE(query, queryCompletion:queryCompletion) + } + + // MARK: - Connection Management - + + /** + Connects the `UsergridEntity` objects via the relationship using the shared instance of `UsergridCient`. + + - parameter entity: The entity that will contain the connection. + - parameter relationship: The relationship of the two entities. + - parameter to: The entity which is connected. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func connect(entity:UsergridEntity, relationship:String, to:UsergridEntity, completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.connect(entity, relationship: relationship, to: to, completion: completion) + } + + /** + Connects the entity objects via the relationship using the shared instance of `UsergridCient`. + + - parameter entityType: The entity type. + - parameter entityID: The entity UUID or name. + - parameter relationship: The relationship of the connection. + - parameter toType: The optional type of the entity you are connecting to. + - parameter toID: The UUID of the entity you are connecting to. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func connect(entityType:String, entityID:String, relationship:String, toType:String?, toID: String, completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.connect(entityType, entityID: entityID, relationship: relationship, toType: toType, toID: toID, completion: completion) + } + + /** + Connects the entity objects via the relationship using the shared instance of `UsergridCient`. + + - parameter entityType: The entity type. + - parameter entityID: The entity UUID or name. + - parameter relationship: The relationship of the connection. + - parameter toType: The type of the entity you are connecting to. + - parameter toName: The name of the entity you are connecting to. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func connect(entityType:String, entityID:String, relationship:String, toType:String, toName: String, completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.connect(entityType, entityID: entityID, relationship: relationship, toType: toType, toName: toName, completion: completion) + } + + + /** + Disconnects the `UsergridEntity` objects via the relationship using the shared instance of `UsergridCient`. + + - parameter entity: The entity that contains the connection. + - parameter relationship: The relationship of the two entities. + - parameter connectingEntity: The entity which is connected. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func disconnect(entity:UsergridEntity, relationship:String, from:UsergridEntity, completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.disconnect(entity, relationship: relationship, from: from, completion: completion) + } + + /** + Disconnects the entity objects via the relationship using the shared instance of `UsergridCient`. + + - parameter entityType: The entity type. + - parameter entityID: The entity UUID or name. + - parameter relationship: The relationship of the connection. + - parameter fromType: The optional type of the entity you are disconnecting from. + - parameter toID: The UUID of the entity you are disconnecting from. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func disconnect(entityType:String, entityID:String, relationship:String, fromType:String?, fromID: String, completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.disconnect(entityType, entityID: entityID, relationship: relationship, fromType: fromType, fromID: fromID, completion: completion) + } + + /** + Disconnects the entity objects via the relationship using the shared instance of `UsergridCient`. + + - parameter entityType: The entity type. + - parameter entityID: The entity UUID or name. + - parameter relationship: The relationship of the connection. + - parameter fromType: The type of the entity you are disconnecting from. + - parameter fromName: The name of the entity you are disconnecting from. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func disconnect(entityType:String, entityID:String, relationship:String, fromType:String, fromName: String, completion: UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.disconnect(entityType, entityID: entityID, relationship: relationship, fromType: fromType, fromName: fromName, completion: completion) + } + + /** + Gets the connected entities for the given relationship using the shared instance of `UsergridCient`. + + - parameter direction: The direction of the connection. + - parameter entity: The entity that contains the connection. + - parameter relationship: The relationship. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func getConnections(direction:UsergridDirection, entity:UsergridEntity, relationship:String, query:UsergridQuery?, completion:UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.getConnections(direction, entity: entity, relationship: relationship, query:query, completion: completion) + } + + /** + Gets the connected entities for the given relationship using the shared instance of `UsergridCient`. + + - parameter direction: The direction of the connection. + - parameter type: The entity type. + - parameter uuidOrName: The entity UUID or name. + - parameter relationship: The relationship of the connection. + - parameter query: The optional query. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func getConnections(direction:UsergridDirection, type:String, uuidOrName:String, relationship:String, query:UsergridQuery?, completion:UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.getConnections(direction, type: type, uuidOrName: uuidOrName, relationship: relationship, query:query, completion: completion) + } + + /** + Gets the connected entities for the given relationship using the shared instance of `UsergridCient`. + + - parameter direction: The direction of the connection. + - parameter uuid: The entity UUID. + - parameter relationship: The relationship of the connection. + - parameter query: The optional query. + - parameter completion: The optional completion block that will be called once the request has completed. + */ + public static func getConnections(direction:UsergridDirection, uuid:String, relationship:String, query:UsergridQuery?, completion:UsergridResponseCompletion? = nil) { + Usergrid.sharedInstance.getConnections(direction, uuid: uuid, relationship: relationship, query: query, completion: completion) + } + + // MARK: - Asset Management - + + /** + Uploads the asset and connects the data to the given `UsergridEntity` using the shared instance of `UsergridCient`. + + - parameter entity: The entity to connect the asset to. + - parameter asset: The asset to upload. + - parameter progress: The progress block that will be called to update the progress of the upload. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func uploadAsset(entity:UsergridEntity, asset:UsergridAsset, progress:UsergridAssetRequestProgress? = nil, completion:UsergridAssetUploadCompletion? = nil) { + Usergrid.sharedInstance.uploadAsset(entity, asset: asset, progress: progress, completion: completion) + } + + /** + Downloads the asset from the given `UsergridEntity` using the shared instance of `UsergridCient`. + + - parameter entity: The entity to which the asset to. + - parameter contentType: The content type of the asset's data. + - parameter progress: The progress block that will be called to update the progress of the download. + - parameter completion: The completion block that will be called once the request has completed. + */ + public static func downloadAsset(entity:UsergridEntity, contentType:String, progress:UsergridAssetRequestProgress? = nil, completion:UsergridAssetDownloadCompletion? = nil) { + Usergrid.sharedInstance.downloadAsset(entity, contentType: contentType, progress: progress, completion: completion) + } +}
