appwrite 11.0.0 → 11.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +1 -1
- data/lib/appwrite/id.rb +20 -4
- data/lib/appwrite/services/messaging.rb +10 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bca03eb7af675e72f241faee81443dd471831f3e7835c9f7bb32f83979a9266
|
4
|
+
data.tar.gz: 14612cd69df877ead2f82c0e0e9c9eaf423b1f059d6221570a9a285bd2f91189
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5afccd0969e11345fb06bf9f6857624f98a852d1359a685fe659245d490ff7a03351747b37173a9cb9030a326ee0b275c1ccee911c9cbc9509878c7c7479ac2
|
7
|
+
data.tar.gz: 8083c9e4416972961fc58af0b7a5328b72fb7e3e67f792bef5c7b8a4e04fc3600ae2e6c007e2bdf7093f4418ca34321f00b82428ed4a5514ff8096a06588a90f
|
data/lib/appwrite/client.rb
CHANGED
data/lib/appwrite/id.rb
CHANGED
@@ -1,11 +1,27 @@
|
|
1
|
+
require 'securerandom'
|
2
|
+
|
1
3
|
module Appwrite
|
2
4
|
class ID
|
3
5
|
def self.custom(id)
|
4
6
|
id
|
5
7
|
end
|
6
|
-
|
7
|
-
|
8
|
-
|
8
|
+
|
9
|
+
# Generate a unique ID with padding to have a longer ID
|
10
|
+
def self.unique(padding=7)
|
11
|
+
base_id = self.hex_timestamp
|
12
|
+
random_padding = SecureRandom.hex(padding)
|
13
|
+
random_padding = random_padding[0...padding]
|
14
|
+
base_id + random_padding
|
15
|
+
end
|
16
|
+
|
17
|
+
#Generate an hex ID based on timestamp
|
18
|
+
#Recreated from https://www.php.net/manual/en/function.uniqid.php
|
19
|
+
private_class_method def self.hex_timestamp
|
20
|
+
now = Time.now
|
21
|
+
sec = now.to_i
|
22
|
+
usec = now.usec
|
23
|
+
hex_timestamp = "%08x%05x" % [sec, usec]
|
24
|
+
hex_timestamp
|
9
25
|
end
|
10
26
|
end
|
11
|
-
end
|
27
|
+
end
|
@@ -789,13 +789,13 @@ module Appwrite
|
|
789
789
|
#
|
790
790
|
# @param [String] provider_id Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
791
791
|
# @param [String] name Provider name.
|
792
|
-
# @param [String]
|
793
|
-
# @param [String] sender_id Msg91
|
794
|
-
# @param [String] auth_key Msg91
|
792
|
+
# @param [String] template_id Msg91 template ID
|
793
|
+
# @param [String] sender_id Msg91 sender ID.
|
794
|
+
# @param [String] auth_key Msg91 auth key.
|
795
795
|
# @param [] enabled Set as enabled.
|
796
796
|
#
|
797
797
|
# @return [Provider]
|
798
|
-
def create_msg91_provider(provider_id:, name:,
|
798
|
+
def create_msg91_provider(provider_id:, name:, template_id: nil, sender_id: nil, auth_key: nil, enabled: nil)
|
799
799
|
api_path = '/messaging/providers/msg91'
|
800
800
|
|
801
801
|
if provider_id.nil?
|
@@ -809,7 +809,7 @@ module Appwrite
|
|
809
809
|
api_params = {
|
810
810
|
providerId: provider_id,
|
811
811
|
name: name,
|
812
|
-
|
812
|
+
templateId: template_id,
|
813
813
|
senderId: sender_id,
|
814
814
|
authKey: auth_key,
|
815
815
|
enabled: enabled,
|
@@ -834,12 +834,12 @@ module Appwrite
|
|
834
834
|
# @param [String] provider_id Provider ID.
|
835
835
|
# @param [String] name Provider name.
|
836
836
|
# @param [] enabled Set as enabled.
|
837
|
-
# @param [String]
|
838
|
-
# @param [String]
|
839
|
-
# @param [String]
|
837
|
+
# @param [String] template_id Msg91 template ID.
|
838
|
+
# @param [String] sender_id Msg91 sender ID.
|
839
|
+
# @param [String] auth_key Msg91 auth key.
|
840
840
|
#
|
841
841
|
# @return [Provider]
|
842
|
-
def update_msg91_provider(provider_id:, name: nil, enabled: nil,
|
842
|
+
def update_msg91_provider(provider_id:, name: nil, enabled: nil, template_id: nil, sender_id: nil, auth_key: nil)
|
843
843
|
api_path = '/messaging/providers/msg91/{providerId}'
|
844
844
|
.gsub('{providerId}', provider_id)
|
845
845
|
|
@@ -850,9 +850,9 @@ module Appwrite
|
|
850
850
|
api_params = {
|
851
851
|
name: name,
|
852
852
|
enabled: enabled,
|
853
|
+
templateId: template_id,
|
853
854
|
senderId: sender_id,
|
854
855
|
authKey: auth_key,
|
855
|
-
from: from,
|
856
856
|
}
|
857
857
|
|
858
858
|
api_headers = {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appwrite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 11.0.
|
4
|
+
version: 11.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Appwrite Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|