From 8de2bbf650f77d3b757b62404d46653ca76322b9 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 5 Aug 2022 14:02:20 +0000 Subject: [PATCH 01/44] add user-agent to php SDK --- templates/php/src/Client.php.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/php/src/Client.php.twig b/templates/php/src/Client.php.twig index 76bafa344..9fd844497 100644 --- a/templates/php/src/Client.php.twig +++ b/templates/php/src/Client.php.twig @@ -38,6 +38,7 @@ class Client protected $headers = [ 'content-type' => '', 'x-sdk-version' => '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'User-Agent' => '{{spec.title | caseUcfirst}}PHP/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})', ]; /** From 3413467b4263dd81680c769e0a08d22eb018c477 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 5 Aug 2022 14:07:19 +0000 Subject: [PATCH 02/44] add user-agent to node header --- templates/node/lib/client.js.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/node/lib/client.js.twig b/templates/node/lib/client.js.twig index 5442b8d53..fa06f2ec9 100644 --- a/templates/node/lib/client.js.twig +++ b/templates/node/lib/client.js.twig @@ -11,6 +11,7 @@ class Client { this.headers = { 'content-type': '', 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'User-Agent' : '{{spec.title | caseUcfirst}}Node/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', {% endfor %} From 0c8bf17527b9d8ae86f37f42b93723408b39da05 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 5 Aug 2022 14:10:36 +0000 Subject: [PATCH 03/44] add user-agent to python --- templates/python/package/client.py.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/python/package/client.py.twig b/templates/python/package/client.py.twig index 5590b9a95..8678c23f6 100644 --- a/templates/python/package/client.py.twig +++ b/templates/python/package/client.py.twig @@ -12,6 +12,7 @@ class Client: self._global_headers = { 'content-type': '', 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'User-Agent' : '{{spec.title | caseUcfirst}}Python/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', {% endfor %} From 13a1e433404161949c389751f534d57d5dff5f22 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 5 Aug 2022 14:13:34 +0000 Subject: [PATCH 04/44] add user-agent to deno --- templates/deno/src/client.ts.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/deno/src/client.ts.twig b/templates/deno/src/client.ts.twig index 13e444496..5fd9641bd 100644 --- a/templates/deno/src/client.ts.twig +++ b/templates/deno/src/client.ts.twig @@ -12,6 +12,7 @@ export class Client { headers: Payload = { 'content-type': '', 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'User-Agent' : '{{spec.title | caseUcfirst}}Deno/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})', {% for key,header in spec.global.defaultHeaders %} '{{key}}':'{{header}}', {% endfor %} From 3eaba155a8a36c239b4fbda56344dff69d8710a7 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 5 Aug 2022 14:18:24 +0000 Subject: [PATCH 05/44] add user-agent to .NET --- templates/dotnet/src/Appwrite/Client.cs.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/dotnet/src/Appwrite/Client.cs.twig b/templates/dotnet/src/Appwrite/Client.cs.twig index e34f399c7..6b8aeddad 100644 --- a/templates/dotnet/src/Appwrite/Client.cs.twig +++ b/templates/dotnet/src/Appwrite/Client.cs.twig @@ -30,7 +30,8 @@ namespace {{ spec.title | caseUcfirst }} this.headers = new Dictionary() { { "content-type", "application/json" }, - { "x-sdk-version", "{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{sdk.version}}" }{% if spec.global.defaultHeaders | length > 0 %},{% endif %} + { "x-sdk-version", "{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{sdk.version}}" }{% if spec.global.defaultHeaders | length > 0 %}, + { "User-Agent" , "{{spec.title | caseUcfirst}}.NET/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})"},{% endif %} {% for key,header in spec.global.defaultHeaders %} { "{{key}}", "{{header}}" }{% if not loop.last %},{% endif %} From 4cb2fb8afcd8f7c510eea2e0b758c676afefae2b Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 5 Aug 2022 14:21:13 +0000 Subject: [PATCH 06/44] add user-agent to Go --- templates/go/client.go.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/go/client.go.twig b/templates/go/client.go.twig index 12a286103..b1edcc15f 100644 --- a/templates/go/client.go.twig +++ b/templates/go/client.go.twig @@ -66,6 +66,7 @@ func NewClient() Client { {% for key,header in spec.global.defaultHeaders %} "{{key}}" : "{{header}}", "x-sdk-version": "{{ sdk.gitUserName|url_encode }}:go:{{sdk.version}}", + "User-Agent" : "{{spec.title | caseUcfirst}}Go/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})", {% endfor %} } httpClient, err := getDefaultClient(defaultTimeout) From c71771cf3f009e87cc1f020265b3b1d25e0570d0 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 5 Aug 2022 14:29:03 +0000 Subject: [PATCH 07/44] add user-agent to remaining sdks --- templates/go/client.go.twig | 1 + templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig | 3 ++- templates/ruby/lib/container/client.rb.twig | 3 ++- templates/swift/Sources/Client.swift.twig | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/templates/go/client.go.twig b/templates/go/client.go.twig index b1edcc15f..1fcc3c0b3 100644 --- a/templates/go/client.go.twig +++ b/templates/go/client.go.twig @@ -67,6 +67,7 @@ func NewClient() Client { "{{key}}" : "{{header}}", "x-sdk-version": "{{ sdk.gitUserName|url_encode }}:go:{{sdk.version}}", "User-Agent" : "{{spec.title | caseUcfirst}}Go/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})", + {% endfor %} } httpClient, err := getDefaultClient(defaultTimeout) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig index de3a8bff9..0ecb878f4 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig @@ -62,7 +62,8 @@ class Client @JvmOverloads constructor( init { headers = mutableMapOf( "content-type" to "application/json", - "x-sdk-version" to "{{spec.title | caseDash}}:{{ language.name | caseLower }}:${BuildConfig.SDK_VERSION}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} + "x-sdk-version" to "{{spec.title | caseDash}}:{{ language.name | caseLower }}:${BuildConfig.SDK_VERSION}", + "User-Agent" : "{{spec.title | caseUcfirst}}Kotlin/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})", {% for key,header in spec.global.defaultHeaders %} "{{ key | caseLower }}" to "{{ header }}"{% if not loop.last %},{% endif %} diff --git a/templates/ruby/lib/container/client.rb.twig b/templates/ruby/lib/container/client.rb.twig index e09b2922f..e6e4cadf1 100644 --- a/templates/ruby/lib/container/client.rb.twig +++ b/templates/ruby/lib/container/client.rb.twig @@ -12,7 +12,8 @@ module {{ spec.title | caseUcfirst }} @chunk_size = 5*1024*1024 @headers = { 'user-agent' => RUBY_PLATFORM + ':{{ language.name | caseLower }}-' + RUBY_VERSION, - 'x-sdk-version' => '{{ spec.title | caseDash }}:{{ language.name | caseLower }}:{{ sdk.version }}'{% if spec.global.defaultHeaders | length > 0 %},{% endif %} + 'x-sdk-version' => '{{ spec.title | caseDash }}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'User-Agent' : '{{spec.title | caseUcfirst}}Ruby/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})', {% for key,header in spec.global.defaultHeaders %} '{{key}}' => '{{header}}'{% if not loop.last %},{% endif %} diff --git a/templates/swift/Sources/Client.swift.twig b/templates/swift/Sources/Client.swift.twig index 745aec551..6a20795cb 100644 --- a/templates/swift/Sources/Client.swift.twig +++ b/templates/swift/Sources/Client.swift.twig @@ -20,7 +20,8 @@ open class Client { open var headers: [String: String] = [ "content-type": "", - "x-sdk-version": "{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} + "x-sdk-version": "{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}", + "User-Agent" : "{{spec.title | caseUcfirst}}Swift/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})", {% for key,header in spec.global.defaultHeaders %} "{{key}}": "{{header}}"{% if not loop.last %},{% endif %} From 7f71f10045a18d08af67a9851d8be41d37171abf Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 5 Aug 2022 14:32:51 +0000 Subject: [PATCH 08/44] add user-agent to .NET --- templates/dotnet/src/Appwrite/Client.cs.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/dotnet/src/Appwrite/Client.cs.twig b/templates/dotnet/src/Appwrite/Client.cs.twig index 6b8aeddad..2b8a98fd4 100644 --- a/templates/dotnet/src/Appwrite/Client.cs.twig +++ b/templates/dotnet/src/Appwrite/Client.cs.twig @@ -30,8 +30,8 @@ namespace {{ spec.title | caseUcfirst }} this.headers = new Dictionary() { { "content-type", "application/json" }, - { "x-sdk-version", "{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{sdk.version}}" }{% if spec.global.defaultHeaders | length > 0 %}, - { "User-Agent" , "{{spec.title | caseUcfirst}}.NET/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})"},{% endif %} + { "x-sdk-version", "{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{sdk.version}}" }, + { "User-Agent" , "{{spec.title | caseUcfirst}}.NET/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})"}, {% for key,header in spec.global.defaultHeaders %} { "{{key}}", "{{header}}" }{% if not loop.last %},{% endif %} From 7fa43d9f2594969792ab8d2c5e9a65178a76f20d Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 5 Aug 2022 15:21:08 +0000 Subject: [PATCH 09/44] add user-agent to .NET --- templates/dotnet/src/Appwrite/Client.cs.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/dotnet/src/Appwrite/Client.cs.twig b/templates/dotnet/src/Appwrite/Client.cs.twig index 2b8a98fd4..262431d7a 100644 --- a/templates/dotnet/src/Appwrite/Client.cs.twig +++ b/templates/dotnet/src/Appwrite/Client.cs.twig @@ -31,7 +31,7 @@ namespace {{ spec.title | caseUcfirst }} { { "content-type", "application/json" }, { "x-sdk-version", "{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{sdk.version}}" }, - { "User-Agent" , "{{spec.title | caseUcfirst}}.NET/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})"}, + { "User-Agent" , "{{spec.title | caseUcfirst}}DOTNET/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})"}, {% for key,header in spec.global.defaultHeaders %} { "{{key}}", "{{header}}" }{% if not loop.last %},{% endif %} From 2dd161c3dd076b2b71c1d82960bcf4abac1e599f Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 5 Aug 2022 15:26:06 +0000 Subject: [PATCH 10/44] Debug tests --- templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig | 2 +- templates/ruby/lib/container/client.rb.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig index 0ecb878f4..99bb20be8 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig @@ -63,7 +63,7 @@ class Client @JvmOverloads constructor( headers = mutableMapOf( "content-type" to "application/json", "x-sdk-version" to "{{spec.title | caseDash}}:{{ language.name | caseLower }}:${BuildConfig.SDK_VERSION}", - "User-Agent" : "{{spec.title | caseUcfirst}}Kotlin/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})", + "User-Agent" to "{{spec.title | caseUcfirst}}Kotlin/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})", {% for key,header in spec.global.defaultHeaders %} "{{ key | caseLower }}" to "{{ header }}"{% if not loop.last %},{% endif %} diff --git a/templates/ruby/lib/container/client.rb.twig b/templates/ruby/lib/container/client.rb.twig index e6e4cadf1..fe292d200 100644 --- a/templates/ruby/lib/container/client.rb.twig +++ b/templates/ruby/lib/container/client.rb.twig @@ -13,7 +13,7 @@ module {{ spec.title | caseUcfirst }} @headers = { 'user-agent' => RUBY_PLATFORM + ':{{ language.name | caseLower }}-' + RUBY_VERSION, 'x-sdk-version' => '{{ spec.title | caseDash }}:{{ language.name | caseLower }}:{{ sdk.version }}', - 'User-Agent' : '{{spec.title | caseUcfirst}}Ruby/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})', + 'User-Agent' => '{{spec.title | caseUcfirst}}Ruby/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})', {% for key,header in spec.global.defaultHeaders %} '{{key}}' => '{{header}}'{% if not loop.last %},{% endif %} From 24cd3031bfd53517f4a661c98497994d5e1e770c Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 5 Aug 2022 16:19:25 +0000 Subject: [PATCH 11/44] fix kotlin tests --- templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig index 99bb20be8..6fc14bcb6 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig @@ -62,8 +62,9 @@ class Client @JvmOverloads constructor( init { headers = mutableMapOf( "content-type" to "application/json", - "x-sdk-version" to "{{spec.title | caseDash}}:{{ language.name | caseLower }}:${BuildConfig.SDK_VERSION}", - "User-Agent" to "{{spec.title | caseUcfirst}}Kotlin/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})", + "User-Agent" to "{{spec.title | caseUcfirst}}Kotlin/${BuildConfig.SDK_VERSION} (${os.type()} ${os.version()}; ${os.arch()})", + "x-sdk-version" to "{{spec.title | caseDash}}:{{ language.name | caseLower }}:${BuildConfig.SDK_VERSION}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} + {% for key,header in spec.global.defaultHeaders %} "{{ key | caseLower }}" to "{{ header }}"{% if not loop.last %},{% endif %} From beef7318427c4c619b9dc201664247b8ad776fcd Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Mon, 8 Aug 2022 14:04:23 +0000 Subject: [PATCH 12/44] Add user-agent to kotlin --- templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig index 6fc14bcb6..e1f50b132 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig @@ -62,7 +62,8 @@ class Client @JvmOverloads constructor( init { headers = mutableMapOf( "content-type" to "application/json", - "User-Agent" to "{{spec.title | caseUcfirst}}Kotlin/${BuildConfig.SDK_VERSION} (${os.type()} ${os.version()}; ${os.arch()})", + "origin" to "{{ spec.title | caseLower }}-kotlin://${context.packageName}", + "user-agent" to "${context.packageName}/${appVersion}, ${System.getProperty("http.agent")}", "x-sdk-version" to "{{spec.title | caseDash}}:{{ language.name | caseLower }}:${BuildConfig.SDK_VERSION}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} From 69b0a2c761a320837fed5dd78abea5a66b090f69 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Mon, 8 Aug 2022 14:18:03 +0000 Subject: [PATCH 13/44] Add user-agent to kotlin --- templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig index e1f50b132..217c9bbc4 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig @@ -62,8 +62,7 @@ class Client @JvmOverloads constructor( init { headers = mutableMapOf( "content-type" to "application/json", - "origin" to "{{ spec.title | caseLower }}-kotlin://${context.packageName}", - "user-agent" to "${context.packageName}/${appVersion}, ${System.getProperty("http.agent")}", + "user-agent" to "{{spec.title | caseUcfirst}}Kotlin/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})", "x-sdk-version" to "{{spec.title | caseDash}}:{{ language.name | caseLower }}:${BuildConfig.SDK_VERSION}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} From 33d11756c508b45b0f9c40f3e5a7bd285fdb5091 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Mon, 8 Aug 2022 15:51:49 +0000 Subject: [PATCH 14/44] fix kotlin tests --- templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig index 217c9bbc4..4463bd3dd 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig @@ -62,7 +62,7 @@ class Client @JvmOverloads constructor( init { headers = mutableMapOf( "content-type" to "application/json", - "user-agent" to "{{spec.title | caseUcfirst}}Kotlin/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})", + "User-Agent" to "{{spec.title | caseUcfirst}}Kotlin/{{ sdk.version }} ", "x-sdk-version" to "{{spec.title | caseDash}}:{{ language.name | caseLower }}:${BuildConfig.SDK_VERSION}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} From 6c005bc911c25b5aee8fa282ffc4b509d780c99b Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 23 Aug 2022 16:22:41 +0000 Subject: [PATCH 15/44] add user-agent to python --- templates/python/package/client.py.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/python/package/client.py.twig b/templates/python/package/client.py.twig index 8678c23f6..11e90a37e 100644 --- a/templates/python/package/client.py.twig +++ b/templates/python/package/client.py.twig @@ -12,7 +12,7 @@ class Client: self._global_headers = { 'content-type': '', 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', - 'User-Agent' : '{{spec.title | caseUcfirst}}Python/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})', + 'user-agent' : '{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', {% endfor %} From f9050a1a939a9ea49e343d5d5a2fac4a1a02f8f5 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 23 Aug 2022 16:37:23 +0000 Subject: [PATCH 16/44] modify user-agent for php SDK --- templates/php/src/Client.php.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/php/src/Client.php.twig b/templates/php/src/Client.php.twig index 9fd844497..a2a8ae478 100644 --- a/templates/php/src/Client.php.twig +++ b/templates/php/src/Client.php.twig @@ -38,7 +38,7 @@ class Client protected $headers = [ 'content-type' => '', 'x-sdk-version' => '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', - 'User-Agent' => '{{spec.title | caseUcfirst}}PHP/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})', + 'user-agent' => '{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} (${php_uname('s')}; ${php_uname('v')}; ${php_uname('m')})', ]; /** From 0befe1b195d2ef40ec9415ee2630b0e4fc67a26e Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 23 Aug 2022 17:11:16 +0000 Subject: [PATCH 17/44] modify user-agent for Deno SDK --- templates/deno/src/client.ts.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/deno/src/client.ts.twig b/templates/deno/src/client.ts.twig index 5fd9641bd..548518512 100644 --- a/templates/deno/src/client.ts.twig +++ b/templates/deno/src/client.ts.twig @@ -12,7 +12,7 @@ export class Client { headers: Payload = { 'content-type': '', 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', - 'User-Agent' : '{{spec.title | caseUcfirst}}Deno/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})', + 'user-agent' : '{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} (${Deno.build.os}; ${Deno.build.arch})', {% for key,header in spec.global.defaultHeaders %} '{{key}}':'{{header}}', {% endfor %} From 28519b8fad12b219fdc2dc490bed480d06124d64 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 23 Aug 2022 18:01:58 +0000 Subject: [PATCH 18/44] Finish first draft --- templates/dart/lib/src/client_io.dart.twig | 3 +++ templates/dotnet/src/Appwrite/Client.cs.twig | 2 +- templates/go/client.go.twig | 3 ++- templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig | 2 +- templates/node/lib/client.js.twig | 2 +- templates/ruby/lib/container/client.rb.twig | 1 - templates/swift/Sources/Client.swift.twig | 3 +-- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/templates/dart/lib/src/client_io.dart.twig b/templates/dart/lib/src/client_io.dart.twig index 1e9d4da38..ab39352f3 100644 --- a/templates/dart/lib/src/client_io.dart.twig +++ b/templates/dart/lib/src/client_io.dart.twig @@ -1,6 +1,7 @@ import 'dart:io'; import 'dart:math'; import 'package:http/http.dart' as http; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:http/io_client.dart'; import 'client_mixin.dart'; import 'client_base.dart'; @@ -42,6 +43,8 @@ class ClientIO extends ClientBase with ClientMixin { 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', + 'user-agent' : '${packageInfo.packageName}/${packageInfo.version}' + {% endfor %} }; diff --git a/templates/dotnet/src/Appwrite/Client.cs.twig b/templates/dotnet/src/Appwrite/Client.cs.twig index 262431d7a..d340db6a0 100644 --- a/templates/dotnet/src/Appwrite/Client.cs.twig +++ b/templates/dotnet/src/Appwrite/Client.cs.twig @@ -31,7 +31,7 @@ namespace {{ spec.title | caseUcfirst }} { { "content-type", "application/json" }, { "x-sdk-version", "{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{sdk.version}}" }, - { "User-Agent" , "{{spec.title | caseUcfirst}}DOTNET/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})"}, + { "user-agent" , "{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})"}, {% for key,header in spec.global.defaultHeaders %} { "{{key}}", "{{header}}" }{% if not loop.last %},{% endif %} diff --git a/templates/go/client.go.twig b/templates/go/client.go.twig index 1fcc3c0b3..1c8474f8b 100644 --- a/templates/go/client.go.twig +++ b/templates/go/client.go.twig @@ -6,6 +6,7 @@ import ( "encoding/json" "errors" "fmt" + "runtime" "io" "io/ioutil" "mime/multipart" @@ -66,7 +67,7 @@ func NewClient() Client { {% for key,header in spec.global.defaultHeaders %} "{{key}}" : "{{header}}", "x-sdk-version": "{{ sdk.gitUserName|url_encode }}:go:{{sdk.version}}", - "User-Agent" : "{{spec.title | caseUcfirst}}Go/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})", + "User-Agent" : "{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/ (${runtime.GOOS}; ${runtime.GOARCH})", {% endfor %} } diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig index 4463bd3dd..942ce6681 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig @@ -62,7 +62,7 @@ class Client @JvmOverloads constructor( init { headers = mutableMapOf( "content-type" to "application/json", - "User-Agent" to "{{spec.title | caseUcfirst}}Kotlin/{{ sdk.version }} ", + "user-agent" to "{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} ${System.getProperty("http.agent")}", "x-sdk-version" to "{{spec.title | caseDash}}:{{ language.name | caseLower }}:${BuildConfig.SDK_VERSION}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} diff --git a/templates/node/lib/client.js.twig b/templates/node/lib/client.js.twig index fa06f2ec9..a1f6663c9 100644 --- a/templates/node/lib/client.js.twig +++ b/templates/node/lib/client.js.twig @@ -11,7 +11,7 @@ class Client { this.headers = { 'content-type': '', 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', - 'User-Agent' : '{{spec.title | caseUcfirst}}Node/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})', + 'user-agent' : '{{spec.title | caseUcfirst}}Node/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', {% endfor %} diff --git a/templates/ruby/lib/container/client.rb.twig b/templates/ruby/lib/container/client.rb.twig index fe292d200..e83d60853 100644 --- a/templates/ruby/lib/container/client.rb.twig +++ b/templates/ruby/lib/container/client.rb.twig @@ -13,7 +13,6 @@ module {{ spec.title | caseUcfirst }} @headers = { 'user-agent' => RUBY_PLATFORM + ':{{ language.name | caseLower }}-' + RUBY_VERSION, 'x-sdk-version' => '{{ spec.title | caseDash }}:{{ language.name | caseLower }}:{{ sdk.version }}', - 'User-Agent' => '{{spec.title | caseUcfirst}}Ruby/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})', {% for key,header in spec.global.defaultHeaders %} '{{key}}' => '{{header}}'{% if not loop.last %},{% endif %} diff --git a/templates/swift/Sources/Client.swift.twig b/templates/swift/Sources/Client.swift.twig index 6a20795cb..948d6cce2 100644 --- a/templates/swift/Sources/Client.swift.twig +++ b/templates/swift/Sources/Client.swift.twig @@ -20,8 +20,7 @@ open class Client { open var headers: [String: String] = [ "content-type": "", - "x-sdk-version": "{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}", - "User-Agent" : "{{spec.title | caseUcfirst}}Swift/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})", + "x-sdk-version": "{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}" {% for key,header in spec.global.defaultHeaders %} "{{key}}": "{{header}}"{% if not loop.last %},{% endif %} From acc47cdb81e2769dedf035753921648899f5237d Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 23 Aug 2022 18:05:23 +0000 Subject: [PATCH 19/44] minor fix --- templates/dotnet/src/Appwrite/Client.cs.twig | 2 +- templates/ruby/lib/container/client.rb.twig | 2 +- templates/swift/Sources/Client.swift.twig | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/dotnet/src/Appwrite/Client.cs.twig b/templates/dotnet/src/Appwrite/Client.cs.twig index d340db6a0..7d9578fe8 100644 --- a/templates/dotnet/src/Appwrite/Client.cs.twig +++ b/templates/dotnet/src/Appwrite/Client.cs.twig @@ -31,7 +31,7 @@ namespace {{ spec.title | caseUcfirst }} { { "content-type", "application/json" }, { "x-sdk-version", "{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{sdk.version}}" }, - { "user-agent" , "{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})"}, + { "user-agent" , "{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})"}{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} { "{{key}}", "{{header}}" }{% if not loop.last %},{% endif %} diff --git a/templates/ruby/lib/container/client.rb.twig b/templates/ruby/lib/container/client.rb.twig index e83d60853..e09b2922f 100644 --- a/templates/ruby/lib/container/client.rb.twig +++ b/templates/ruby/lib/container/client.rb.twig @@ -12,7 +12,7 @@ module {{ spec.title | caseUcfirst }} @chunk_size = 5*1024*1024 @headers = { 'user-agent' => RUBY_PLATFORM + ':{{ language.name | caseLower }}-' + RUBY_VERSION, - 'x-sdk-version' => '{{ spec.title | caseDash }}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'x-sdk-version' => '{{ spec.title | caseDash }}:{{ language.name | caseLower }}:{{ sdk.version }}'{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} '{{key}}' => '{{header}}'{% if not loop.last %},{% endif %} diff --git a/templates/swift/Sources/Client.swift.twig b/templates/swift/Sources/Client.swift.twig index 948d6cce2..745aec551 100644 --- a/templates/swift/Sources/Client.swift.twig +++ b/templates/swift/Sources/Client.swift.twig @@ -20,7 +20,7 @@ open class Client { open var headers: [String: String] = [ "content-type": "", - "x-sdk-version": "{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}" + "x-sdk-version": "{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} "{{key}}": "{{header}}"{% if not loop.last %},{% endif %} From eccdea816d4536248b524dbb6b4683751ff9274b Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 10 Mar 2023 19:51:14 +0000 Subject: [PATCH 20/44] fix dart tests --- templates/dart/lib/src/client_io.dart.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/dart/lib/src/client_io.dart.twig b/templates/dart/lib/src/client_io.dart.twig index de5eac6a9..ebe7652e0 100644 --- a/templates/dart/lib/src/client_io.dart.twig +++ b/templates/dart/lib/src/client_io.dart.twig @@ -46,7 +46,6 @@ class ClientIO extends ClientBase with ClientMixin { 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', - 'user-agent' : '${packageInfo.packageName}/${packageInfo.version}' {% endfor %} }; From 910bc9fdcd6be94fa57119cc98c495fc6b2c81e2 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 10 Mar 2023 20:02:22 +0000 Subject: [PATCH 21/44] add user-agent for dart --- templates/dart/lib/src/client_io.dart.twig | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/templates/dart/lib/src/client_io.dart.twig b/templates/dart/lib/src/client_io.dart.twig index ebe7652e0..936a0f942 100644 --- a/templates/dart/lib/src/client_io.dart.twig +++ b/templates/dart/lib/src/client_io.dart.twig @@ -2,6 +2,7 @@ import 'dart:io'; import 'dart:math'; import 'package:http/http.dart' as http; import 'package:package_info_plus/package_info_plus.dart'; +import 'package:device_info_plus/device_info_plus.dart'; import 'package:http/io_client.dart'; import 'client_mixin.dart'; import 'client_base.dart'; @@ -89,6 +90,59 @@ class ClientIO extends ClientBase with ClientMixin { _headers![key] = value; return this; } + + Future init() async { + if (_initProgress) return; + _initProgress = true; + final Directory cookieDir = await _getCookiePath(); + _cookieJar = PersistCookieJar(storage: FileStorage(cookieDir.path)); + _interceptors.add(CookieManager(_cookieJar)); + + var device = ''; + try { + PackageInfo packageInfo = await PackageInfo.fromPlatform(); + addHeader( + 'Origin', + '{{spec.title | caseLower}}-${Platform.operatingSystem}://${packageInfo.packageName}', + ); + + //creating custom user agent + DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin(); + if (Platform.isAndroid) { + final andinfo = await deviceInfoPlugin.androidInfo; + device = + '(Linux; U; Android ${andinfo.version.release}; ${andinfo.brand} ${andinfo.model})'; + } + if (Platform.isIOS) { + final iosinfo = await deviceInfoPlugin.iosInfo; + device = '${iosinfo.utsname.machine} iOS/${iosinfo.systemVersion}'; + } + if (Platform.isLinux) { + final lininfo = await deviceInfoPlugin.linuxInfo; + device = '(Linux; U; ${lininfo.id} ${lininfo.version})'; + } + if (Platform.isWindows) { + final wininfo = await deviceInfoPlugin.windowsInfo; + device = + '(Windows NT; ${wininfo.computerName})'; //can't seem to get much info here + } + if (Platform.isMacOS) { + final macinfo = await deviceInfoPlugin.macOsInfo; + device = '(Macintosh; ${macinfo.model})'; + } + addHeader( + 'user-agent', + '${packageInfo.packageName}/${packageInfo.version} $device', + ); + } catch (e) { + debugPrint('Error getting device info: $e'); + device = Platform.operatingSystem; + addHeader('user-agent', '$device'); + } + + _initialized = true; + _initProgress = false; + } @override Future chunkedUpload({ From 64d8aa6e4b45e77826af3fed207ade5549664d09 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 10 Mar 2023 20:39:51 +0000 Subject: [PATCH 22/44] fix issues --- src/SDK/SDK.php | 3 +++ templates/node/lib/client.js.twig | 2 +- templates/php/src/Client.php.twig | 6 +----- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/SDK/SDK.php b/src/SDK/SDK.php index 73a75ce39..d1144e990 100644 --- a/src/SDK/SDK.php +++ b/src/SDK/SDK.php @@ -103,6 +103,9 @@ public function __construct(Language $language, Spec $spec) $this->twig->addFilter(new TwigFilter('caseUcfirst', function ($value) { return ucfirst($this->helperCamelCase($value)); })); + $this->twig->addFilter(new TwigFilter('php_deviceinfo', function ($value) { + return php_uname(); + })); $this->twig->addFilter(new TwigFilter('caseUcwords', function ($value) { return ucwords($value, " -_"); })); diff --git a/templates/node/lib/client.js.twig b/templates/node/lib/client.js.twig index d558cc012..b898dd976 100644 --- a/templates/node/lib/client.js.twig +++ b/templates/node/lib/client.js.twig @@ -11,7 +11,7 @@ class Client { this.headers = { 'accept-encoding': '*', 'content-type': '', - 'user-agent' : '{{spec.title | caseUcfirst}}Node/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})', + 'user-agent' : `{{spec.title | caseUcfirst}}Node/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})`, 'x-sdk-name': '{{ sdk.name }}', 'x-sdk-platform': '{{ sdk.platform }}', 'x-sdk-language': '{{ language.name | caseLower }}', diff --git a/templates/php/src/Client.php.twig b/templates/php/src/Client.php.twig index e9232bc39..64e89e2b2 100644 --- a/templates/php/src/Client.php.twig +++ b/templates/php/src/Client.php.twig @@ -37,15 +37,11 @@ class Client */ protected $headers = [ 'content-type' => '', -<<<<<<< HEAD - 'x-sdk-version' => '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', - 'user-agent' => '{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} (${php_uname('s')}; ${php_uname('v')}; ${php_uname('m')})', -======= + 'user-agent' => '{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} ({{php_deviceinfo}})', 'x-sdk-name'=> '{{ sdk.name }}', 'x-sdk-platform'=> '{{ sdk.platform }}', 'x-sdk-language'=> '{{ language.name | caseLower }}', 'x-sdk-version'=> '{{ sdk.version }}', ->>>>>>> 6d2c065b8e2da4521c3add491fd95646e5bfbb54 ]; /** From 685a0d7ba828ede0f9ff1484db16cdd6b095bdac Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 10 Mar 2023 20:46:03 +0000 Subject: [PATCH 23/44] fix dart package issues --- templates/dart/pubspec.yaml.twig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/dart/pubspec.yaml.twig b/templates/dart/pubspec.yaml.twig index 72948b603..9bcb93805 100644 --- a/templates/dart/pubspec.yaml.twig +++ b/templates/dart/pubspec.yaml.twig @@ -9,6 +9,8 @@ environment: sdk: '>=2.17.0 <3.0.0' dependencies: http: ^0.13.5 + device_info_plus: ^8.1.0 + package_info_plus: ^3.0.3 dev_dependencies: lints: ^2.0.1 From c24136c720f413e89c4797c95d0eee8398ff46b7 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Sat, 11 Mar 2023 09:32:37 +0000 Subject: [PATCH 24/44] fix node failing tests --- templates/node/lib/client.js.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/node/lib/client.js.twig b/templates/node/lib/client.js.twig index b898dd976..d414902d5 100644 --- a/templates/node/lib/client.js.twig +++ b/templates/node/lib/client.js.twig @@ -1,3 +1,4 @@ +const os = require('os'); const URL = require('url').URL; const axios = require('axios'); const FormData = require('form-data'); From 1a2449c2563ba8b06b4ab08c98ab86cf1e1c084a Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Sat, 11 Mar 2023 10:23:40 +0000 Subject: [PATCH 25/44] fix go tests and revert dart --- templates/dart/lib/src/client_io.dart.twig | 55 ---------------------- templates/dart/pubspec.yaml.twig | 3 +- templates/go/client.go.twig | 2 +- 3 files changed, 2 insertions(+), 58 deletions(-) diff --git a/templates/dart/lib/src/client_io.dart.twig b/templates/dart/lib/src/client_io.dart.twig index 936a0f942..6c1469dc5 100644 --- a/templates/dart/lib/src/client_io.dart.twig +++ b/templates/dart/lib/src/client_io.dart.twig @@ -1,8 +1,6 @@ import 'dart:io'; import 'dart:math'; import 'package:http/http.dart' as http; -import 'package:package_info_plus/package_info_plus.dart'; -import 'package:device_info_plus/device_info_plus.dart'; import 'package:http/io_client.dart'; import 'client_mixin.dart'; import 'client_base.dart'; @@ -90,59 +88,6 @@ class ClientIO extends ClientBase with ClientMixin { _headers![key] = value; return this; } - - Future init() async { - if (_initProgress) return; - _initProgress = true; - final Directory cookieDir = await _getCookiePath(); - _cookieJar = PersistCookieJar(storage: FileStorage(cookieDir.path)); - _interceptors.add(CookieManager(_cookieJar)); - - var device = ''; - try { - PackageInfo packageInfo = await PackageInfo.fromPlatform(); - addHeader( - 'Origin', - '{{spec.title | caseLower}}-${Platform.operatingSystem}://${packageInfo.packageName}', - ); - - //creating custom user agent - DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin(); - if (Platform.isAndroid) { - final andinfo = await deviceInfoPlugin.androidInfo; - device = - '(Linux; U; Android ${andinfo.version.release}; ${andinfo.brand} ${andinfo.model})'; - } - if (Platform.isIOS) { - final iosinfo = await deviceInfoPlugin.iosInfo; - device = '${iosinfo.utsname.machine} iOS/${iosinfo.systemVersion}'; - } - if (Platform.isLinux) { - final lininfo = await deviceInfoPlugin.linuxInfo; - device = '(Linux; U; ${lininfo.id} ${lininfo.version})'; - } - if (Platform.isWindows) { - final wininfo = await deviceInfoPlugin.windowsInfo; - device = - '(Windows NT; ${wininfo.computerName})'; //can't seem to get much info here - } - if (Platform.isMacOS) { - final macinfo = await deviceInfoPlugin.macOsInfo; - device = '(Macintosh; ${macinfo.model})'; - } - addHeader( - 'user-agent', - '${packageInfo.packageName}/${packageInfo.version} $device', - ); - } catch (e) { - debugPrint('Error getting device info: $e'); - device = Platform.operatingSystem; - addHeader('user-agent', '$device'); - } - - _initialized = true; - _initProgress = false; - } @override Future chunkedUpload({ diff --git a/templates/dart/pubspec.yaml.twig b/templates/dart/pubspec.yaml.twig index 9bcb93805..8db8a3f54 100644 --- a/templates/dart/pubspec.yaml.twig +++ b/templates/dart/pubspec.yaml.twig @@ -9,8 +9,7 @@ environment: sdk: '>=2.17.0 <3.0.0' dependencies: http: ^0.13.5 - device_info_plus: ^8.1.0 - package_info_plus: ^3.0.3 + dev_dependencies: lints: ^2.0.1 diff --git a/templates/go/client.go.twig b/templates/go/client.go.twig index 3bc203975..df85295fb 100644 --- a/templates/go/client.go.twig +++ b/templates/go/client.go.twig @@ -66,7 +66,7 @@ func NewClient() Client { headers := map[string]string{ {% for key,header in spec.global.defaultHeaders %} "{{key}}" : "{{header}}", - "user-agent" : "{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/ (${runtime.GOOS}; ${runtime.GOARCH})", + "user-agent" : "{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/ ({{runtime.GOOS}} ; {{runtime.GOARCH}})", "x-sdk-name": "{{ sdk.name }}", "x-sdk-platform": "{{ sdk.platform }}", "x-sdk-language": "{{ language.name | caseLower }}", From 619f9da32d26e5507f615f34dbf719df7c4d266d Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Sat, 11 Mar 2023 11:52:48 +0000 Subject: [PATCH 26/44] fix tests --- src/SDK/SDK.php | 4 ++-- templates/dart/lib/src/client_io.dart.twig | 3 ++- templates/deno/src/client.ts.twig | 2 +- templates/go/client.go.twig | 2 +- templates/php/src/Client.php.twig | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/SDK/SDK.php b/src/SDK/SDK.php index d1144e990..957145a20 100644 --- a/src/SDK/SDK.php +++ b/src/SDK/SDK.php @@ -103,8 +103,8 @@ public function __construct(Language $language, Spec $spec) $this->twig->addFilter(new TwigFilter('caseUcfirst', function ($value) { return ucfirst($this->helperCamelCase($value)); })); - $this->twig->addFilter(new TwigFilter('php_deviceinfo', function ($value) { - return php_uname(); + $this->twig->addFilter(new TwigFilter('deviceInfo', function ($value) { + return php_uname('s').';'. php_uname('v') .';'. php_uname('m'); })); $this->twig->addFilter(new TwigFilter('caseUcwords', function ($value) { return ucwords($value, " -_"); diff --git a/templates/dart/lib/src/client_io.dart.twig b/templates/dart/lib/src/client_io.dart.twig index 6c1469dc5..ebd3ab285 100644 --- a/templates/dart/lib/src/client_io.dart.twig +++ b/templates/dart/lib/src/client_io.dart.twig @@ -1,4 +1,4 @@ -import 'dart:io'; +import 'dart:io' show Platform; import 'dart:math'; import 'package:http/http.dart' as http; import 'package:http/io_client.dart'; @@ -43,6 +43,7 @@ class ClientIO extends ClientBase with ClientMixin { 'x-sdk-platform': '{{ sdk.platform }}', 'x-sdk-language': '{{ language.name | caseLower }}', 'x-sdk-version': '{{ sdk.version }}', + 'user-agent' : '{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/({{Platform.operatingSystem}}; {{Platform.operatingSystemVersion}})', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', diff --git a/templates/deno/src/client.ts.twig b/templates/deno/src/client.ts.twig index e66087841..e58e49a80 100644 --- a/templates/deno/src/client.ts.twig +++ b/templates/deno/src/client.ts.twig @@ -11,7 +11,7 @@ export class Client { endpoint: string = '{{spec.endpoint}}'; headers: Payload = { 'content-type': '', - 'user-agent' : '{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} (${Deno.build.os}; ${Deno.build.arch})', + 'user-agent' : `{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} (${Deno.build.os}; ${Deno.build.arch})`, 'x-sdk-name': '{{ sdk.name }}', 'x-sdk-platform': '{{ sdk.platform }}', 'x-sdk-language': '{{ language.name | caseLower }}', diff --git a/templates/go/client.go.twig b/templates/go/client.go.twig index df85295fb..ab1fea719 100644 --- a/templates/go/client.go.twig +++ b/templates/go/client.go.twig @@ -66,7 +66,7 @@ func NewClient() Client { headers := map[string]string{ {% for key,header in spec.global.defaultHeaders %} "{{key}}" : "{{header}}", - "user-agent" : "{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/ ({{runtime.GOOS}} ; {{runtime.GOARCH}})", + "user-agent" : "{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/ ({{deviceInfo}})", "x-sdk-name": "{{ sdk.name }}", "x-sdk-platform": "{{ sdk.platform }}", "x-sdk-language": "{{ language.name | caseLower }}", diff --git a/templates/php/src/Client.php.twig b/templates/php/src/Client.php.twig index 64e89e2b2..c7443274d 100644 --- a/templates/php/src/Client.php.twig +++ b/templates/php/src/Client.php.twig @@ -37,7 +37,7 @@ class Client */ protected $headers = [ 'content-type' => '', - 'user-agent' => '{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} ({{php_deviceinfo}})', + 'user-agent' => '{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} ({{deviceInfo}})', 'x-sdk-name'=> '{{ sdk.name }}', 'x-sdk-platform'=> '{{ sdk.platform }}', 'x-sdk-language'=> '{{ language.name | caseLower }}', From d0d1968908ace15694370b67214162502637f4a0 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Sat, 11 Mar 2023 11:55:10 +0000 Subject: [PATCH 27/44] remove unused import --- templates/go/client.go.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/go/client.go.twig b/templates/go/client.go.twig index ab1fea719..fd7265d47 100644 --- a/templates/go/client.go.twig +++ b/templates/go/client.go.twig @@ -6,7 +6,6 @@ import ( "encoding/json" "errors" "fmt" - "runtime" "io" "io/ioutil" "mime/multipart" From a44d4f1803f9b5334a7db3dab4b9334fb4ec4e92 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Sat, 11 Mar 2023 12:06:00 +0000 Subject: [PATCH 28/44] style: run linter --- src/SDK/SDK.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SDK/SDK.php b/src/SDK/SDK.php index 957145a20..86309855c 100644 --- a/src/SDK/SDK.php +++ b/src/SDK/SDK.php @@ -104,7 +104,7 @@ public function __construct(Language $language, Spec $spec) return ucfirst($this->helperCamelCase($value)); })); $this->twig->addFilter(new TwigFilter('deviceInfo', function ($value) { - return php_uname('s').';'. php_uname('v') .';'. php_uname('m'); + return php_uname('s') . ';' . php_uname('v') . ';' . php_uname('m'); })); $this->twig->addFilter(new TwigFilter('caseUcwords', function ($value) { return ucwords($value, " -_"); From 6aa298032075cf0afa5b3fae9ca7f2d7917b2af8 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Sat, 11 Mar 2023 12:31:14 +0000 Subject: [PATCH 29/44] fix dart tests --- templates/dart/lib/src/client_io.dart.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/dart/lib/src/client_io.dart.twig b/templates/dart/lib/src/client_io.dart.twig index ebd3ab285..257ad5a4b 100644 --- a/templates/dart/lib/src/client_io.dart.twig +++ b/templates/dart/lib/src/client_io.dart.twig @@ -1,3 +1,4 @@ +import 'dart:io'; import 'dart:io' show Platform; import 'dart:math'; import 'package:http/http.dart' as http; From 0209ab5d535fd4ad7c461b71be00f9ffb83a50db Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 20 Apr 2023 06:00:29 +0545 Subject: [PATCH 30/44] Update templates/node/lib/client.js.twig --- templates/node/lib/client.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/lib/client.js.twig b/templates/node/lib/client.js.twig index d414902d5..537848e93 100644 --- a/templates/node/lib/client.js.twig +++ b/templates/node/lib/client.js.twig @@ -12,7 +12,7 @@ class Client { this.headers = { 'accept-encoding': '*', 'content-type': '', - 'user-agent' : `{{spec.title | caseUcfirst}}Node/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})`, + 'user-agent' : `{{spec.title | caseUcfirst}}{{language.name | caseUcFirst}}SDK/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})`, 'x-sdk-name': '{{ sdk.name }}', 'x-sdk-platform': '{{ sdk.platform }}', 'x-sdk-language': '{{ language.name | caseLower }}', From 788b1a328cb9e9621807e58f7c6bc7918c6471ee Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 20 Apr 2023 06:00:42 +0545 Subject: [PATCH 31/44] Update templates/dart/pubspec.yaml.twig --- templates/dart/pubspec.yaml.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/dart/pubspec.yaml.twig b/templates/dart/pubspec.yaml.twig index 8db8a3f54..72948b603 100644 --- a/templates/dart/pubspec.yaml.twig +++ b/templates/dart/pubspec.yaml.twig @@ -10,7 +10,6 @@ environment: dependencies: http: ^0.13.5 - dev_dependencies: lints: ^2.0.1 test: ^1.22.0 From 75c4631b6978bcfc66054c7faa5f718fced9cde8 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 20 Apr 2023 06:00:54 +0545 Subject: [PATCH 32/44] Update templates/dart/lib/src/client_io.dart.twig --- templates/dart/lib/src/client_io.dart.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/dart/lib/src/client_io.dart.twig b/templates/dart/lib/src/client_io.dart.twig index 257ad5a4b..330dc27ce 100644 --- a/templates/dart/lib/src/client_io.dart.twig +++ b/templates/dart/lib/src/client_io.dart.twig @@ -1,5 +1,4 @@ import 'dart:io'; -import 'dart:io' show Platform; import 'dart:math'; import 'package:http/http.dart' as http; import 'package:http/io_client.dart'; From 1e9d549e5853538a1332cc2c749fc201d2c77c01 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 20 Apr 2023 00:18:11 +0000 Subject: [PATCH 33/44] move device infor to PHP --- src/SDK/Language/PHP.php | 5 ++++- src/SDK/SDK.php | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SDK/Language/PHP.php b/src/SDK/Language/PHP.php index 527ba6f47..cb48717e0 100644 --- a/src/SDK/Language/PHP.php +++ b/src/SDK/Language/PHP.php @@ -384,7 +384,10 @@ public function getFilters(): array return [ new TwigFilter('getReturn', function ($value) { return $this->getReturn($value); - }) + }), + $this->twig->addFilter(new TwigFilter('deviceInfo', function ($value) { + return php_uname('s') . ';' . php_uname('v') . ';' . php_uname('m'); + })), ]; } } diff --git a/src/SDK/SDK.php b/src/SDK/SDK.php index 86309855c..73a75ce39 100644 --- a/src/SDK/SDK.php +++ b/src/SDK/SDK.php @@ -103,9 +103,6 @@ public function __construct(Language $language, Spec $spec) $this->twig->addFilter(new TwigFilter('caseUcfirst', function ($value) { return ucfirst($this->helperCamelCase($value)); })); - $this->twig->addFilter(new TwigFilter('deviceInfo', function ($value) { - return php_uname('s') . ';' . php_uname('v') . ';' . php_uname('m'); - })); $this->twig->addFilter(new TwigFilter('caseUcwords', function ($value) { return ucwords($value, " -_"); })); From 57ad01150848ded5b2c15f6547775b76aa4198b4 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 20 Apr 2023 00:18:31 +0000 Subject: [PATCH 34/44] fix typo --- src/SDK/Language/PHP.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SDK/Language/PHP.php b/src/SDK/Language/PHP.php index cb48717e0..ad9ef9c31 100644 --- a/src/SDK/Language/PHP.php +++ b/src/SDK/Language/PHP.php @@ -385,9 +385,9 @@ public function getFilters(): array new TwigFilter('getReturn', function ($value) { return $this->getReturn($value); }), - $this->twig->addFilter(new TwigFilter('deviceInfo', function ($value) { + new TwigFilter('deviceInfo', function ($value) { return php_uname('s') . ';' . php_uname('v') . ';' . php_uname('m'); - })), + }), ]; } } From b52164d80a9db34d56d195f88a94e6c82fe460ed Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 26 Apr 2023 05:07:28 +0000 Subject: [PATCH 35/44] remove extra space --- templates/dart/lib/src/client_io.dart.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/dart/lib/src/client_io.dart.twig b/templates/dart/lib/src/client_io.dart.twig index 330dc27ce..8b02c90dd 100644 --- a/templates/dart/lib/src/client_io.dart.twig +++ b/templates/dart/lib/src/client_io.dart.twig @@ -46,7 +46,6 @@ class ClientIO extends ClientBase with ClientMixin { 'user-agent' : '{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/({{Platform.operatingSystem}}; {{Platform.operatingSystemVersion}})', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', - {% endfor %} }; From 270287a9dbc11f2e2e1c06c08c92026edb5e5159 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 26 Apr 2023 05:09:17 +0000 Subject: [PATCH 36/44] fix --- templates/dotnet/src/Appwrite/Client.cs.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/dotnet/src/Appwrite/Client.cs.twig b/templates/dotnet/src/Appwrite/Client.cs.twig index 322c81bed..9611a6432 100644 --- a/templates/dotnet/src/Appwrite/Client.cs.twig +++ b/templates/dotnet/src/Appwrite/Client.cs.twig @@ -30,7 +30,7 @@ namespace {{ spec.title | caseUcfirst }} this.headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent" , "{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})"}{% if spec.global.defaultHeaders | length > 0 %},{% endif %} + { "user-agent" , "{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})"}, { "x-sdk-name", "{{ sdk.name }}" }, { "x-sdk-platform", "{{ sdk.platform }}" }, { "x-sdk-language", "{{ language.name | caseLower }}" }, From ae0bf769cdbca6dc98535cdbf269df11f2350e8a Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 26 Apr 2023 05:11:04 +0000 Subject: [PATCH 37/44] fix golang --- templates/go/client.go.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/go/client.go.twig b/templates/go/client.go.twig index fd7265d47..a82a126d9 100644 --- a/templates/go/client.go.twig +++ b/templates/go/client.go.twig @@ -65,7 +65,7 @@ func NewClient() Client { headers := map[string]string{ {% for key,header in spec.global.defaultHeaders %} "{{key}}" : "{{header}}", - "user-agent" : "{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/ ({{deviceInfo}})", + "user-agent" : "{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }}", "x-sdk-name": "{{ sdk.name }}", "x-sdk-platform": "{{ sdk.platform }}", "x-sdk-language": "{{ language.name | caseLower }}", From 06bd218d6eac0c89788502e9d22ee42a59f01fd8 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 26 Apr 2023 05:12:20 +0000 Subject: [PATCH 38/44] remove extra lines --- templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig index 85829c9e0..3c12978d5 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig @@ -67,8 +67,6 @@ class Client @JvmOverloads constructor( "x-sdk-platform" to "{{ sdk.platform }}", "x-sdk-language" to "{{ language.name | caseLower }}", "x-sdk-version" to "{{ sdk.version }}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} - - {% for key,header in spec.global.defaultHeaders %} "{{ key | caseLower }}" to "{{ header }}"{% if not loop.last %},{% endif %} {% endfor %} From 0cf1ab8f305fec586314b74e110efde29c730094 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 2 May 2023 11:49:34 +0545 Subject: [PATCH 39/44] Update client_io.dart.twig --- templates/dart/lib/src/client_io.dart.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/dart/lib/src/client_io.dart.twig b/templates/dart/lib/src/client_io.dart.twig index 8b02c90dd..912a6962e 100644 --- a/templates/dart/lib/src/client_io.dart.twig +++ b/templates/dart/lib/src/client_io.dart.twig @@ -43,7 +43,7 @@ class ClientIO extends ClientBase with ClientMixin { 'x-sdk-platform': '{{ sdk.platform }}', 'x-sdk-language': '{{ language.name | caseLower }}', 'x-sdk-version': '{{ sdk.version }}', - 'user-agent' : '{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/({{Platform.operatingSystem}}; {{Platform.operatingSystemVersion}})', + 'user-agent' : '{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} ({{Platform.operatingSystem}}; {{Platform.operatingSystemVersion}})', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', {% endfor %} From ee333470b11d0a76d13eb4d2f0091a2319898c05 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 2 May 2023 11:51:20 +0545 Subject: [PATCH 40/44] Update client.js.twig --- templates/node/lib/client.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/lib/client.js.twig b/templates/node/lib/client.js.twig index 537848e93..b3f92336b 100644 --- a/templates/node/lib/client.js.twig +++ b/templates/node/lib/client.js.twig @@ -12,7 +12,7 @@ class Client { this.headers = { 'accept-encoding': '*', 'content-type': '', - 'user-agent' : `{{spec.title | caseUcfirst}}{{language.name | caseUcFirst}}SDK/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})`, + 'user-agent' : `{{spec.title | caseUcfirst}}{{language.name | caseUcFirst}}SDK/{{ sdk.version }} (${os.type()}; ${os.version()}; ${os.arch()})`, 'x-sdk-name': '{{ sdk.name }}', 'x-sdk-platform': '{{ sdk.platform }}', 'x-sdk-language': '{{ language.name | caseLower }}', From ca476ab87b1f59fa50a2670e2c6c57a5a8833c63 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 2 May 2023 11:54:53 +0545 Subject: [PATCH 41/44] Update client.go.twig --- templates/go/client.go.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/go/client.go.twig b/templates/go/client.go.twig index a82a126d9..8e0d34890 100644 --- a/templates/go/client.go.twig +++ b/templates/go/client.go.twig @@ -65,7 +65,7 @@ func NewClient() Client { headers := map[string]string{ {% for key,header in spec.global.defaultHeaders %} "{{key}}" : "{{header}}", - "user-agent" : "{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }}", + "user-agent" : fmt.Sprintf("{{spec.title | caseUcfirst}}{{ language.name | caseUcfirst }}SDK/{{ sdk.version }} (%s; %s)", runtime.GOOS, runtime.GOARCH), "x-sdk-name": "{{ sdk.name }}", "x-sdk-platform": "{{ sdk.platform }}", "x-sdk-language": "{{ language.name | caseLower }}", @@ -388,4 +388,4 @@ func toString(arg interface{}) string { default: return fmt.Sprintf("%s", v) } -} \ No newline at end of file +} From 5d5fbe4d76f8ff88f15a49b11a92aff425fdd819 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 3 May 2023 13:42:49 +0545 Subject: [PATCH 42/44] Update templates/node/lib/client.js.twig Co-authored-by: Jake Barnby --- templates/node/lib/client.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/lib/client.js.twig b/templates/node/lib/client.js.twig index b3f92336b..b2538e8e8 100644 --- a/templates/node/lib/client.js.twig +++ b/templates/node/lib/client.js.twig @@ -12,7 +12,7 @@ class Client { this.headers = { 'accept-encoding': '*', 'content-type': '', - 'user-agent' : `{{spec.title | caseUcfirst}}{{language.name | caseUcFirst}}SDK/{{ sdk.version }} (${os.type()}; ${os.version()}; ${os.arch()})`, + 'user-agent' : `{{spec.title | caseUcfirst}}{{language.name | caseUcfirst}}SDK/{{ sdk.version }} (${os.type()}; ${os.version()}; ${os.arch()})`, 'x-sdk-name': '{{ sdk.name }}', 'x-sdk-platform': '{{ sdk.platform }}', 'x-sdk-language': '{{ language.name | caseLower }}', From aaa1816e82ce4680540fc733e94b6d081a0f36c6 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 3 May 2023 13:43:28 +0545 Subject: [PATCH 43/44] Update client.go.twig --- templates/go/client.go.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/go/client.go.twig b/templates/go/client.go.twig index 8e0d34890..cea33946f 100644 --- a/templates/go/client.go.twig +++ b/templates/go/client.go.twig @@ -18,6 +18,7 @@ import ( "strconv" "strings" "time" + "runtime" ) const ( From f7883d5fa3b6dc455404be4860e1d25c836698e1 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 3 May 2023 13:44:59 +0545 Subject: [PATCH 44/44] Update PHP.php --- src/SDK/Language/PHP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SDK/Language/PHP.php b/src/SDK/Language/PHP.php index ad9ef9c31..3f6968814 100644 --- a/src/SDK/Language/PHP.php +++ b/src/SDK/Language/PHP.php @@ -386,7 +386,7 @@ public function getFilters(): array return $this->getReturn($value); }), new TwigFilter('deviceInfo', function ($value) { - return php_uname('s') . ';' . php_uname('v') . ';' . php_uname('m'); + return php_uname('s') . '; ' . php_uname('v') . '; ' . php_uname('m'); }), ]; }