Skip to content

Commit c9ec0bd

Browse files
committed
Merge remote-tracking branch 'origin/master' into feat-android-updates
2 parents 1e44565 + 650e8a8 commit c9ec0bd

30 files changed

+1224
-195
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ env:
2727
- SDK=CLINode16
2828
- SDK=DartBeta
2929
- SDK=DartStable
30-
- SDK=Deno1171
30+
- SDK=Deno1193
31+
- SDK=Deno1303
3132
- SDK=FlutterStable
3233
- SDK=FlutterBeta
3334
- SDK=Go112

src/SDK/Language/Apple.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,31 @@ public function getFiles(): array
136136
'destination' => '/example-swiftui/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist',
137137
'template' => '/swift/example-swiftui/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist',
138138
],
139+
[
140+
'scope' => 'default',
141+
'destination' => '/example-uikit/UIKitExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved',
142+
'template' => '/swift/example-uikit/UIKitExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved',
143+
],
144+
[
145+
'scope' => 'default',
146+
'destination' => '/example-swiftui/Example.xcodeproj/xcshareddata/xcschemes/test (iOS).xcscheme',
147+
'template' => '/swift/example-swiftui/Example.xcodeproj/xcshareddata/xcschemes/test (iOS).xcscheme',
148+
],
149+
[
150+
'scope' => 'default',
151+
'destination' => '/example-swiftui/Example.xcodeproj/xcshareddata/xcschemes/test (macOS).xcscheme',
152+
'template' => '/swift/example-swiftui/Example.xcodeproj/xcshareddata/xcschemes/test (macOS).xcscheme',
153+
],
154+
[
155+
'scope' => 'default',
156+
'destination' => '/example-swiftui/Example.xcodeproj/xcshareddata/xcschemes/test (tvOS).xcscheme',
157+
'template' => '/swift/example-swiftui/Example.xcodeproj/xcshareddata/xcschemes/test (tvOS).xcscheme',
158+
],
159+
[
160+
'scope' => 'default',
161+
'destination' => '/example-swiftui/Example.xcodeproj/xcshareddata/xcschemes/test (watchOS).xcscheme',
162+
'template' => '/swift/example-swiftui/Example.xcodeproj/xcshareddata/xcschemes/test (watchOS).xcscheme',
163+
],
139164
[
140165
'scope' => 'default',
141166
'destination' => '/example-swiftui/Example.xcodeproj/project.pbxproj',

src/SDK/Language/Swift.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ public function getFiles(): array
206206
],
207207
[
208208
'scope' => 'default',
209-
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/iOS/iOSDeviceInfo.swift',
210-
'template' => 'swift/Sources/DeviceInfo/iOS/iOSDeviceInfo.swift',
209+
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/iOS/IOSDeviceInfo.swift',
210+
'template' => 'swift/Sources/DeviceInfo/iOS/IOSDeviceInfo.swift',
211211
],
212212
[
213213
'scope' => 'default',
@@ -221,13 +221,23 @@ public function getFiles(): array
221221
],
222222
[
223223
'scope' => 'default',
224-
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/MacOS/MacOSDeviceInfo.swift',
225-
'template' => 'swift/Sources/DeviceInfo/MacOS/MacOSDeviceInfo.swift',
224+
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/macOS/MacOSDeviceInfo.swift',
225+
'template' => 'swift/Sources/DeviceInfo/macOS/MacOSDeviceInfo.swift',
226226
],
227227
[
228228
'scope' => 'default',
229-
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/MacOS/CwlSysCtl.swift',
230-
'template' => 'swift/Sources/DeviceInfo/MacOS/CwlSysCtl.swift',
229+
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/watchOS/WatchOSDeviceInfo.swift',
230+
'template' => 'swift/Sources/DeviceInfo/watchOS/WatchOSDeviceInfo.swift',
231+
],
232+
[
233+
'scope' => 'default',
234+
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/watchOS/WKInterfaceDevice+ModelName.swift',
235+
'template' => 'swift/Sources/DeviceInfo/watchOS/WKInterfaceDevice+ModelName.swift',
236+
],
237+
[
238+
'scope' => 'default',
239+
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/macOS/CwlSysCtl.swift',
240+
'template' => 'swift/Sources/DeviceInfo/macOS/CwlSysCtl.swift',
231241
],
232242
[
233243
'scope' => 'default',

templates/deno/README.md.twig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import * as sdk from "https://deno.land/x/{{ spec.title | caseDash }}/mod.ts";
3232
{{ sdk.gettingStarted|raw }}
3333
{% endif %}
3434

35+
> Minimal supported version for Deno SDK is 1.19.0.
36+
3537
## Contribution
3638

3739
This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.

templates/deno/src/inputFile.ts.twig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { readableStreamFromReader } from "https://deno.land/std/streams/conversion.ts";
2-
31
const _bufferToString = (buffer: Uint8Array): ReadableStream<Uint8Array> => {
42
return new ReadableStream({
53
start(controller) {
@@ -16,7 +14,7 @@ export class InputFile {
1614

1715
static fromPath = (filePath: string, filename: string): InputFile => {
1816
const file = Deno.openSync(filePath);
19-
const stream = readableStreamFromReader(file);
17+
const stream = file.readable;
2018
const size = Deno.statSync(filePath).size;
2119
return new InputFile(stream, filename, size);
2220
};

templates/flutter/lib/src/realtime_mixin.dart.twig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,24 @@ mixin RealtimeMixin {
7676
}
7777
break;
7878
}
79+
}, onDone: () {
80+
for (var list in _channels.values) {
81+
for (var stream in list) {
82+
stream.close();
83+
}
84+
}
85+
_channels.clear();
86+
_closeConnection();
87+
}, onError: (err, stack) {
88+
for (var list in _channels.values) {
89+
for (var stream in list) {
90+
stream.sink.addError(err, stack);
91+
}
92+
}
93+
if (_websok?.closeCode != null && _websok?.closeCode != 1008) {
94+
debugPrint("Reconnecting in one second.");
95+
Future.delayed(Duration(seconds: 1), _createSocket);
96+
}
7997
});
8098
} catch (e) {
8199
if (e is {{spec.title | caseUcfirst}}Exception) {

templates/swift/Package.swift.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let package = Package(
77
platforms: [
88
.iOS("15.0"),
99
.macOS("11.0"),
10-
.watchOS("6.0"),
10+
.watchOS("7.0"),
1111
.tvOS("13.0"),
1212
],
1313
products: [

templates/swift/Sources/Client.swift.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,10 +562,10 @@ extension Client {
562562
device = "\(info!.modelIdentifier) iOS/\(info!.systemVersion)"
563563
#elseif os(watchOS)
564564
let info = deviceInfo.watchOSInfo
565-
device = "\(info!.systemInfo.machine) watchOS/\(info!.systemVersion)"
565+
device = "\(info!.modelIdentifier) watchOS/\(info!.systemVersion)"
566566
#elseif os(tvOS)
567-
let info = deviceInfo.tvOSInfo
568-
device = "\(info!.systemInfo.machine) tvOS/\(info!.systemVersion)"
567+
let info = deviceInfo.iOSInfo
568+
device = "\(info!.modelIdentifier) tvOS/\(info!.systemVersion)"
569569
#elseif os(macOS)
570570
let info = deviceInfo.macOSInfo
571571
device = "(Macintosh; \(info!.model))"
Lines changed: 22 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#if os(Linux)
22
import Foundation
33

4-
class LinuxDeviceInfo : DeviceInfo {
4+
class LinuxDeviceInfo {
55

66
let name: String
77
let version: String
@@ -14,53 +14,24 @@ class LinuxDeviceInfo : DeviceInfo {
1414
let variant: String
1515
let variantId: String
1616
let machineId: String
17-
18-
internal init(
19-
name: String,
20-
version: String,
21-
id: String,
22-
idLike: [String],
23-
versionCodename: String,
24-
versionId: String,
25-
prettyName: String,
26-
buildId: String,
27-
variant: String,
28-
variantId: String,
29-
machineId: String
30-
) {
31-
self.name = name
32-
self.version = version
33-
self.id = id
34-
self.idLike = idLike
35-
self.versionCodename = versionCodename
36-
self.versionId = versionId
37-
self.prettyName = prettyName
38-
self.buildId = buildId
39-
self.variant = variant
40-
self.variantId = variantId
41-
self.machineId = machineId
42-
}
43-
44-
public static func get() -> LinuxDeviceInfo {
45-
let os = getOsRelease()
46-
let lsb = getLsbRelease()
47-
let machineId = getMachineId()
48-
49-
return LinuxDeviceInfo(
50-
name: os["NAME"] ?? "Linux",
51-
version: os["VERSION"] ?? lsb["LSB_VERSION"] ?? "",
52-
id: os["ID"] ?? lsb["DISTRIB_ID"] ?? "linux",
53-
idLike: os["ID_LIKE"]?.split(separator: " ").map { String($0) } ?? [],
54-
versionCodename: os["VERSION_CODENAME"] ?? lsb["DISTRIB_CODENAME"] ?? "",
55-
versionId: os["VERSION_ID"] ?? lsb["DISTRIB_RELEASE"] ?? "",
56-
prettyName: os["PRETTY_NAME"] ?? lsb["DISTRIB_DESCRIPTION"] ?? "Linux",
57-
buildId: os["BUILD_ID"] ?? "",
58-
variant: os["VARIANT"] ?? "",
59-
variantId: os["VARIANT_ID"] ?? "",
60-
machineId: machineId
61-
)
17+
18+
public init() {
19+
let os = LinuxDeviceInfo.getOsRelease()
20+
let lsb = LinuxDeviceInfo.getLsbRelease()
21+
22+
name = os["NAME"] ?? "Linux"
23+
version = os["VERSION"] ?? lsb["LSB_VERSION"] ?? ""
24+
id = os["ID"] ?? lsb["DISTRIB_ID"] ?? "linux"
25+
idLike = os["ID_LIKE"]?.split(separator: " ").map { String($0) } ?? []
26+
versionCodename = os["VERSION_CODENAME"] ?? lsb["DISTRIB_CODENAME"] ?? ""
27+
versionId = os["VERSION_ID"] ?? lsb["DISTRIB_RELEASE"] ?? ""
28+
prettyName = os["PRETTY_NAME"] ?? lsb["DISTRIB_DESCRIPTION"] ?? "Linux"
29+
buildId = os["BUILD_ID"] ?? ""
30+
variant = os["VARIANT"] ?? ""
31+
variantId = os["VARIANT_ID"] ?? ""
32+
machineId = LinuxDeviceInfo.getMachineId()
6233
}
63-
34+
6435
private static func getOsRelease() -> [String: String] {
6536
return tryReadKeyValues(path: "/etc/os-release")
6637
}
@@ -82,19 +53,19 @@ class LinuxDeviceInfo : DeviceInfo {
8253
let url = URL(fileURLWithPath: path)
8354
let string = try! String(contentsOf: url, encoding: .utf8)
8455
let lines = string.components(separatedBy: .newlines)
85-
56+
8657
var dict = [String: String]()
8758
for line in lines {
8859
let splits = line.split(separator: "=")
8960
if splits.count > 1 {
9061
let key = String(splits[0])
9162
let value = String(splits[1])
92-
63+
9364
dict[key] = value
9465
}
9566
}
96-
67+
9768
return dict
9869
}
9970
}
100-
#endif
71+
#endif

templates/swift/Sources/DeviceInfo/MacOS/MacOSDeviceInfo.swift

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)